summaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2013-04-26 01:26:45 +0000
committerAlan Modra <amodra@bigpond.net.au>2013-04-26 01:26:45 +0000
commitd74956bb23139e40aef1c90702fd5a6b1d28d283 (patch)
tree86c880f397b3fe49ee825316ce703a381b231b1d /ld/emultempl
parente424632a520bdd142b2904bf0a63e4aac02b53ab (diff)
downloadbinutils-redhat-d74956bb23139e40aef1c90702fd5a6b1d28d283.tar.gz
* emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Test
unresolved_syms_in_shared_libs rather than !executable to determine whether to load DT_NEEDED libraries.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/elf32.em15
1 files changed, 9 insertions, 6 deletions
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index ea7bad08e7..83a554fa74 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -1178,13 +1178,16 @@ gld${EMULATION_NAME}_after_open (void)
int force;
/* If the lib that needs this one was --as-needed and wasn't
- found to be needed, then this lib isn't needed either. Skip
- the lib when creating a shared object unless we are copying
- DT_NEEDED entres. */
+ found to be needed, then this lib isn't needed either. */
if (l->by != NULL
- && ((bfd_elf_get_dyn_lib_class (l->by) & DYN_AS_NEEDED) != 0
- || (!link_info.executable
- && bfd_elf_get_dyn_lib_class (l->by) & DYN_NO_ADD_NEEDED) != 0))
+ && (bfd_elf_get_dyn_lib_class (l->by) & DYN_AS_NEEDED) != 0)
+ continue;
+
+ /* Skip the lib if --no-copy-dt-needed-entries and
+ --allow-shlib-undefined is in effect. */
+ if (l->by != NULL
+ && link_info.unresolved_syms_in_shared_libs == RM_IGNORE
+ && (bfd_elf_get_dyn_lib_class (l->by) & DYN_NO_ADD_NEEDED) != 0)
continue;
/* If we've already seen this file, skip it. */