From: kettenis Date: Tue, 12 May 2015 21:05:42 +0000 (+0000) Subject: Revert rev 1.3. While that change appears to make the behaviour similar to X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=105c77736e0cb4456fcd1721512a57770bc49c8f;p=openbsd Revert rev 1.3. While that change appears to make the behaviour similar to binutils 2.15, it introduces bogus failures when inter-library dependencies are present. With the binutils 2.17 behaviour restored, --as-needed will cause linker failures when necessary inter-library dependencies are not present. This is actually a good thing as binutils 2.15 will silently produce executables that will fail at runtime in those cases. ok miod@ --- diff --git a/gnu/usr.bin/binutils-2.17/bfd/elflink.c b/gnu/usr.bin/binutils-2.17/bfd/elflink.c index 6bb64fbc5a5..b572921706f 100644 --- a/gnu/usr.bin/binutils-2.17/bfd/elflink.c +++ b/gnu/usr.bin/binutils-2.17/bfd/elflink.c @@ -3079,11 +3079,8 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) bfd_boolean add_needed; struct elf_link_hash_table *htab; bfd_size_type amt; -#if 0 void *alloc_mark = NULL; -#endif void *old_tab = NULL; -#if 0 void *old_hash; void *old_ent; struct bfd_link_hash_entry *old_undefs = NULL; @@ -3091,7 +3088,6 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) long old_dynsymcount = 0; size_t tabsize = 0; size_t hashsize = 0; -#endif htab = elf_hash_table (info); bed = get_elf_backend_data (abfd); @@ -3466,7 +3462,6 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) } } -#if 0 /* If we are loading an as-needed shared lib, save the symbol table state before we start adding symbols. If the lib turns out to be unneeded, restore the state. */ @@ -3529,7 +3524,6 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) } } } -#endif weaks = NULL; ever = extversym != NULL ? extversym + extsymoff : NULL; @@ -4139,7 +4133,6 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) isymbuf = NULL; } -#if 0 if ((elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0) { unsigned int i; @@ -4183,7 +4176,6 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) free (nondeflt_vers); return TRUE; } -#endif if (old_tab != NULL) {