xstrdup the return value of basename() before recording it in the bfd

with bfd_elf_set_dt_needed_soname().  Fixes the "NEEDED crtend.o"
problem reported on tech-toolchain/current-users.

Problem spotted by Ryo HAYASAKA <ryoh@jaist.ac.jp>.
This commit is contained in:
thorpej 2002-10-31 23:21:17 +00:00
parent 8b5e86873c
commit f8b18efd0c
1 changed files with 1 additions and 1 deletions

View File

@ -350,7 +350,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
/* 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, soname);
bfd_elf_set_dt_needed_soname (abfd, xstrdup (soname));
/* Add this file into the symbol table. */
if (! bfd_link_add_symbols (abfd, &link_info))