summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>1996-07-15 17:12:25 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>1996-07-15 17:12:25 +0000
commitf164aa7f0987375bfb76a52a810231ea69e38ec7 (patch)
tree702d94e848337ac3f7b352a47ebd3827c8926658 /gnu/usr.bin/binutils
parent7ed65de36502faee38259c10817deb6f5b28b30f (diff)
A couple of more fixes. -static *IS* static...
Diffstat (limited to 'gnu/usr.bin/binutils')
-rw-r--r--gnu/usr.bin/binutils/bfd/elf32-mips.c2
-rw-r--r--gnu/usr.bin/binutils/ld/lexsup.c11
2 files changed, 9 insertions, 4 deletions
diff --git a/gnu/usr.bin/binutils/bfd/elf32-mips.c b/gnu/usr.bin/binutils/bfd/elf32-mips.c
index 62b9caef454..234b1095364 100644
--- a/gnu/usr.bin/binutils/bfd/elf32-mips.c
+++ b/gnu/usr.bin/binutils/bfd/elf32-mips.c
@@ -4416,7 +4416,7 @@ mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_byte *cr;
if ((info->shared
- && (h != NULL
+ || (h != NULL && !info->static_link
&& ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
== 0)))
&& (input_section->flags & SEC_ALLOC) != 0)
diff --git a/gnu/usr.bin/binutils/ld/lexsup.c b/gnu/usr.bin/binutils/ld/lexsup.c
index 33dd94debd5..8ab6203baa0 100644
--- a/gnu/usr.bin/binutils/ld/lexsup.c
+++ b/gnu/usr.bin/binutils/ld/lexsup.c
@@ -78,7 +78,8 @@ int parsing_defsym = 0;
#define OPTION_SHARED (OPTION_RPATH_LINK + 1)
#define OPTION_SONAME (OPTION_SHARED + 1)
#define OPTION_SORT_COMMON (OPTION_SONAME + 1)
-#define OPTION_STATS (OPTION_SORT_COMMON + 1)
+#define OPTION_STATIC (OPTION_SORT_COMMON + 1)
+#define OPTION_STATS (OPTION_STATIC + 1)
#define OPTION_SYMBOLIC (OPTION_STATS + 1)
#define OPTION_TBSS (OPTION_SYMBOLIC + 1)
#define OPTION_TDATA (OPTION_TBSS + 1)
@@ -210,13 +211,13 @@ static const struct ld_option ld_options[] =
'\0', NULL, NULL, ONE_DASH },
{ {"call_shared", no_argument, NULL, OPTION_CALL_SHARED},
'\0', NULL, NULL, ONE_DASH },
- { {"Bstatic", no_argument, NULL, OPTION_NON_SHARED},
+ { {"Bstatic", no_argument, NULL, OPTION_STATIC},
'\0', NULL, "Do not link against shared libraries", ONE_DASH },
{ {"dn", no_argument, NULL, OPTION_NON_SHARED},
'\0', NULL, NULL, ONE_DASH },
{ {"non_shared", no_argument, NULL, OPTION_NON_SHARED},
'\0', NULL, NULL, ONE_DASH },
- { {"static", no_argument, NULL, OPTION_NON_SHARED},
+ { {"static", no_argument, NULL, OPTION_STATIC},
'\0', NULL, NULL, ONE_DASH },
{ {"Bsymbolic", no_argument, NULL, OPTION_SYMBOLIC},
'\0', NULL, "Bind global references locally", ONE_DASH },
@@ -608,6 +609,10 @@ parse_args (argc, argv)
case 's':
link_info.strip = strip_all;
break;
+ case OPTION_STATIC:
+ config.dynamic_link = false;
+ link_info.static_link = true; /*XXX added for mips, check ppc usage */
+ break;
case OPTION_SHARED:
link_info.shared = true;
break;