aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-04-26 01:26:45 +0000
committerAlan Modra <amodra@gmail.com>2013-04-26 01:26:45 +0000
commit4706eab946cabc77df441377e1e7ee7767197076 (patch)
treec7d8d5d03f6165ade26ecbdcedd38717601da662
parent0b000dbb4929f9478633f3bf4a2a84c989befecb (diff)
downloadgdb-4706eab946cabc77df441377e1e7ee7767197076.zip
gdb-4706eab946cabc77df441377e1e7ee7767197076.tar.gz
gdb-4706eab946cabc77df441377e1e7ee7767197076.tar.bz2
* 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.
-rw-r--r--ld/ChangeLog6
-rw-r--r--ld/emultempl/elf32.em15
2 files changed, 15 insertions, 6 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index ff69706..7f94840 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2013-04-26 Alan Modra <amodra@gmail.com>
+
+ * 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.
+
2013-04-25 Alan Modra <amodra@gmail.com>
* Makefile.am (ALL_EMULATION_SOURCES): Add eelf32lppclinux.c.
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index ea7bad0..83a554f 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. */