* libelf.h (struct elf_obj_tdata): New field dt_needed_name.
authorIan Lance Taylor <ian@airs.com>
Thu, 16 Jun 1994 00:01:32 +0000 (00:01 +0000)
committerIan Lance Taylor <ian@airs.com>
Thu, 16 Jun 1994 00:01:32 +0000 (00:01 +0000)
(elf_dt_needed_name): New accessor macro.
* elfcode.h (elf_link_add_object_symbols): If elf_dt_needed_name
is set, use that instead of the filename for the DT_NEEDED dynamic
entry.
* elf.c (bfd_elf_set_dt_needed_name): New function.
* bfd-in.h (bfd_elf_set_dt_needed_name): Declare.
* bfd-in2.h: Rebuilt.

bfd/ChangeLog
bfd/bfd-in.h
bfd/bfd-in2.h
bfd/elfcode.h
bfd/libelf.h

index 772e08e6a2c5fe8fa60724901a6b463c66a2324d..c4b2187b7d5dfe47c25d345375471e4e14c24f18 100644 (file)
@@ -10,6 +10,15 @@ Wed Jun 15 18:02:21 1994  Ken Raeburn  (raeburn@cujo.cygnus.com)
 
 Wed Jun 15 01:34:07 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
 
+       * libelf.h (struct elf_obj_tdata): New field dt_needed_name.
+       (elf_dt_needed_name): New accessor macro.
+       * elfcode.h (elf_link_add_object_symbols): If elf_dt_needed_name
+       is set, use that instead of the filename for the DT_NEEDED dynamic
+       entry.
+       * elf.c (bfd_elf_set_dt_needed_name): New function.
+       * bfd-in.h (bfd_elf_set_dt_needed_name): Declare.
+       * bfd-in2.h: Rebuilt.
+
        * elfcode.h (NAME(bfd_elf,size_dynamic_sections)): Add sinterpptr
        argument, and set it to the .interp section.
        * bfd-in.h (bfd_elf32_size_dynamic_sections): Update prototype.
index 645f24b4f79e2a6e67cf5624aeaecc5c635ae76b..ad9fa967df5f818894c2e0e076976bbb313be821 100644 (file)
@@ -535,6 +535,7 @@ extern boolean bfd_elf32_size_dynamic_sections
   PARAMS ((bfd *, struct bfd_link_info *, struct sec **));
 extern boolean bfd_elf64_size_dynamic_sections
   PARAMS ((bfd *, struct bfd_link_info *, struct sec **));
+extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
 
 /* SunOS shared library support routines for the linker.  */
 
index 536ca7406db72f257c87ed87ee433d00278e2399..7be96910570826953824327a99847be8e097cebb 100644 (file)
@@ -535,6 +535,7 @@ extern boolean bfd_elf32_size_dynamic_sections
   PARAMS ((bfd *, struct bfd_link_info *, struct sec **));
 extern boolean bfd_elf64_size_dynamic_sections
   PARAMS ((bfd *, struct bfd_link_info *, struct sec **));
+extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *));
 
 /* SunOS shared library support routines for the linker.  */
 
index c46ffde38f19272c061c307d38cb1d9d32086023..e471b56c71049b16fc5b09e4b60915af438d52e3 100644 (file)
@@ -4163,8 +4163,12 @@ 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, we use the file name.  */
+        Otherwise, if the generic linker stuck something in
+        elf_dt_needed_name, we use that.  Otherwise, we just use the
+        file name.  */
       name = bfd_get_filename (abfd);
+      if (elf_dt_needed_name (abfd) != NULL)
+       name = elf_dt_needed_name (abfd);
       s = bfd_get_section_by_name (abfd, ".dynamic");
       if (s != NULL)
        {
index 6850abaf5f2913e20b00686e75232c74c28eb2c4..2838a5e228293dbe37d94d083ef6d5496109e3a1 100644 (file)
@@ -417,6 +417,12 @@ struct elf_obj_tdata
      minus the sh_info field of the symbol table header.  */
   struct elf_link_hash_entry **sym_hashes;
 
+  /* The linker ELF emulation code needs to let the backend ELF linker
+     know what filename should be used for a dynamic object if the
+     dynamic object is found using a search.  This field is used to
+     hold that information.  */
+  const char *dt_needed_name;
+
   /* Irix 5 often screws up the symbol table, sorting local symbols
      after global symbols.  This flag is set if the symbol table in
      this BFD appears to be screwed up.  If it is, we ignore the
@@ -441,6 +447,7 @@ struct elf_obj_tdata
 #define elf_gp(bfd)            (elf_tdata(bfd) -> gp)
 #define elf_gp_size(bfd)       (elf_tdata(bfd) -> gp_size)
 #define elf_sym_hashes(bfd)    (elf_tdata(bfd) -> sym_hashes)
+#define elf_dt_needed_name(bfd)        (elf_tdata(bfd) -> dt_needed_name)
 #define elf_bad_symtab(bfd)    (elf_tdata(bfd) -> bad_symtab)
 \f
 extern char * elf_string_from_elf_section PARAMS ((bfd *, unsigned, unsigned));
This page took 0.041181 seconds and 4 git commands to generate.