From 60a49e7f8ad3085700b8d19c6181bda523293fea Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 19 Feb 1996 17:41:04 +0000 Subject: [PATCH] * elf-bfd.h (struct elf_obj_tdata): Rename dt_needed_name to dt_name. (elf_dt_name): Rename from elf_dt_needed_name. * elf.c (bfd_elf_set_dt_needed_name): Use elf_dt_name, not elf_dt_needed_name. (bfd_elf_get_dt_soname): New function. * elflink.h (elf_link_add_object_symbols): Use elf_dt_name, not elf_dt_needed_name. Save the SONAME back in elf_dt_name. * bfd-in.h (bfd_elf_get_dt_soname): Declare. * bfd-in2.h: Rebuild. --- bfd/ChangeLog | 13 +++++++++++++ bfd/elflink.h | 20 +++++++++++++------- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 6704c471e67..9978ee36c9a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,16 @@ +Mon Feb 19 12:37:41 1996 Ian Lance Taylor + + * elf-bfd.h (struct elf_obj_tdata): Rename dt_needed_name to + dt_name. + (elf_dt_name): Rename from elf_dt_needed_name. + * elf.c (bfd_elf_set_dt_needed_name): Use elf_dt_name, not + elf_dt_needed_name. + (bfd_elf_get_dt_soname): New function. + * elflink.h (elf_link_add_object_symbols): Use elf_dt_name, not + elf_dt_needed_name. Save the SONAME back in elf_dt_name. + * bfd-in.h (bfd_elf_get_dt_soname): Declare. + * bfd-in2.h: Rebuild. + Mon Feb 19 02:50:23 1996 Doug Evans * elf32-sparc.c (elf32_sparc_reloc_type_lookup): Renamed from diff --git a/bfd/elflink.h b/bfd/elflink.h index 83f0eb0bc81..c2160c86cee 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -380,15 +380,15 @@ elf_link_add_object_symbols (abfd, info) /* Find the name to use in a DT_NEEDED entry that refers to this object. If the object has a DT_SONAME entry, we use it. Otherwise, if the generic linker stuck something in - elf_dt_needed_name, we use that. Otherwise, we just use the - file name. If the generic linker put a null string into - elf_dt_needed_name, we don't make a DT_NEEDED entry at all, - even if there is a DT_SONAME entry. */ + elf_dt_name, we use that. Otherwise, we just use the file + name. If the generic linker put a null string into + elf_dt_name, we don't make a DT_NEEDED entry at all, even if + there is a DT_SONAME entry. */ add_needed = true; name = bfd_get_filename (abfd); - if (elf_dt_needed_name (abfd) != NULL) + if (elf_dt_name (abfd) != NULL) { - name = elf_dt_needed_name (abfd); + name = elf_dt_name (abfd); if (*name == '\0') add_needed = false; } @@ -420,7 +420,7 @@ elf_link_add_object_symbols (abfd, info) Elf_Internal_Dyn dyn; elf_swap_dyn_in (abfd, extdyn, &dyn); - if (add_needed && dyn.d_tag == DT_SONAME) + if (dyn.d_tag == DT_SONAME) { name = bfd_elf_string_from_elf_section (abfd, link, dyn.d_un.d_val); @@ -520,6 +520,12 @@ elf_link_add_object_symbols (abfd, info) if (! elf_add_dynamic_entry (info, DT_NEEDED, strindex)) goto error_return; } + + /* Save the SONAME, if there is one, because sometimes the + linker emulation code will need to know it. */ + if (*name == '\0') + name = bfd_get_filename (abfd); + elf_dt_name (abfd) = name; } if (bfd_seek (abfd, -- 2.30.2