aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2000-07-20 03:17:32 +0000
committerH.J. Lu <hjl.tools@gmail.com>2000-07-20 03:17:32 +0000
commit49e56c493d447e01ddb915b2612b5542ec6af044 (patch)
tree3e666c7253232a2859ceb6cb15e5ef0468b49247 /ld
parent74816898980f352e2b94c71e5afbcb109f2b50b0 (diff)
downloadgdb-49e56c493d447e01ddb915b2612b5542ec6af044.zip
gdb-49e56c493d447e01ddb915b2612b5542ec6af044.tar.gz
gdb-49e56c493d447e01ddb915b2612b5542ec6af044.tar.bz2
2000-07-19 H.J. Lu <hjl@gnu.org>
* emultempl/elf32.em (gld${EMULATION_NAME}_try_needed): Call bfd_elf_set_dt_needed_soname ().
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/emultempl/elf32.em12
2 files changed, 17 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 0b661b5..db29663 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2000-07-19 H.J. Lu <hjl@gnu.org>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_try_needed): Call
+ bfd_elf_set_dt_needed_soname ().
+
2000-07-18 DJ Delorie <dj@cygnus.com>
* pe-dll.c (pe_dll_id_target): check object target name also
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 7a9c882..3cdb856 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -532,6 +532,18 @@ cat >>e${EMULATION_NAME}.c <<EOF
DT_NEEDED entry for this file. */
bfd_elf_set_dt_needed_name (abfd, "");
+ /* First strip off everything before the last '/'. */
+ name = strrchr (abfd->filename, '/');
+ if (name)
+ name++;
+ else
+ name = abfd->filename;
+
+ /* Tell the ELF backend that the output file needs a DT_NEEDED
+ entry for this file if it is used to resolve the reference in
+ a regular object. */
+ bfd_elf_set_dt_needed_soname (abfd, name);
+
/* Add this file into the symbol table. */
if (! bfd_link_add_symbols (abfd, &link_info))
einfo ("%F%B: could not read symbols: %E\n", abfd);