diff options
author | Ian Lance Taylor <ian@airs.com> | 1996-02-19 17:41:04 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1996-02-19 17:41:04 +0000 |
commit | 60a49e7f8ad3085700b8d19c6181bda523293fea (patch) | |
tree | b4d48df21e69655c2dfbf7c22251fb8aafeb5bcb /bfd/elflink.h | |
parent | 169df8d594f03c010e7a0b5137df61f5d80f8944 (diff) | |
download | gdb-60a49e7f8ad3085700b8d19c6181bda523293fea.zip gdb-60a49e7f8ad3085700b8d19c6181bda523293fea.tar.gz gdb-60a49e7f8ad3085700b8d19c6181bda523293fea.tar.bz2 |
* 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.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r-- | bfd/elflink.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h index 83f0eb0..c2160c8 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, |