+Mon Feb 19 12:37:41 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * 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 <dje@charmed.cygnus.com>
* elf32-sparc.c (elf32_sparc_reloc_type_lookup): Renamed from
/* 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;
}
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);
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,