diff --git a/gnu/dist/toolchain/ld/emultempl/elf32.em b/gnu/dist/toolchain/ld/emultempl/elf32.em index 7d4939ec988f..e4e803498a30 100644 --- a/gnu/dist/toolchain/ld/emultempl/elf32.em +++ b/gnu/dist/toolchain/ld/emultempl/elf32.em @@ -243,7 +243,7 @@ gld${EMULATION_NAME}_try_needed (name, force) int force; { bfd *abfd; - const char *soname; + char *soname; abfd = bfd_openr (name, bfd_get_target (output_bfd)); if (abfd == NULL) @@ -329,7 +329,7 @@ cat >>e${EMULATION_NAME}.c <filename); + soname = xstrdup (basename (abfd->filename)); if (trace_file_tries) info_msg (_("found %s at %s\n"), soname, name); @@ -340,6 +340,7 @@ cat >>e${EMULATION_NAME}.c <>e${EMULATION_NAME}.c <