aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
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/emultempl
parent74816898980f352e2b94c71e5afbcb109f2b50b0 (diff)
downloadbinutils-49e56c493d447e01ddb915b2612b5542ec6af044.zip
binutils-49e56c493d447e01ddb915b2612b5542ec6af044.tar.gz
binutils-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/emultempl')
-rw-r--r--ld/emultempl/elf32.em12
1 files changed, 12 insertions, 0 deletions
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);