aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-02-24 20:03:55 +0000
committerIan Lance Taylor <ian@airs.com>1996-02-24 20:03:55 +0000
commit053ae1d77a5efa6f1918de5dcb2bd06083b7be5f (patch)
tree9ac45ae53a4a7c2df15646396cf124f70541ba86 /bfd
parentce67d0c3ac2007950a14c1d6ea0c9be1fdedfc24 (diff)
downloadgdb-053ae1d77a5efa6f1918de5dcb2bd06083b7be5f.zip
gdb-053ae1d77a5efa6f1918de5dcb2bd06083b7be5f.tar.gz
gdb-053ae1d77a5efa6f1918de5dcb2bd06083b7be5f.tar.bz2
* elf.c (bfd_elf_set_dt_needed_name): Don't do anything if the
format is not bfd_object. (bfd_elf_get_dt_soname): Likewise.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf.c22
2 files changed, 25 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index cc6060c..1e7f305 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+Sat Feb 24 11:38:58 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * elf.c (bfd_elf_set_dt_needed_name): Don't do anything if the
+ format is not bfd_object.
+ (bfd_elf_get_dt_soname): Likewise.
+
Wed Feb 21 13:58:04 1996 Ian Lance Taylor <ian@cygnus.com>
* coff-sh.c (sh_relax_delete_bytes): Correct range of R_SH_USES
diff --git a/bfd/elf.c b/bfd/elf.c
index da082e0..eab15b0 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -618,11 +618,13 @@ bfd_elf_set_dt_needed_name (abfd, name)
bfd *abfd;
const char *name;
{
- if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
- elf_dt_needed_name (abfd) = name;
+ if (bfd_get_flavour (abfd) == bfd_target_elf_flavour
+ && bfd_get_format (abfd) == bfd_object)
+ elf_dt_name (abfd) = name;
}
-/* Get the list of DT_NEEDED entries for a link. */
+/* Get the list of DT_NEEDED entries for a link. This is a hook for
+ the ELF emulation code. */
struct bfd_link_needed_list *
bfd_elf_get_needed_list (abfd, info)
@@ -633,6 +635,20 @@ bfd_elf_get_needed_list (abfd, info)
return NULL;
return elf_hash_table (info)->needed;
}
+
+/* Get the name actually used for a dynamic object for a link. This
+ is the SONAME entry if there is one. Otherwise, it is the string
+ passed to bfd_elf_set_dt_needed_name, or it is the filename. */
+
+const char *
+bfd_elf_get_dt_soname (abfd)
+ bfd *abfd;
+{
+ if (bfd_get_flavour (abfd) == bfd_target_elf_flavour
+ && bfd_get_format (abfd) == bfd_object)
+ return elf_dt_name (abfd);
+ return NULL;
+}
/* Allocate an ELF string table--force the first byte to be zero. */