* elflink.h (NAME(bfd_elf,size_dynamic_sections)): Only create
authorIan Lance Taylor <ian@airs.com>
Fri, 17 Nov 1995 15:05:44 +0000 (15:05 +0000)
committerIan Lance Taylor <ian@airs.com>
Fri, 17 Nov 1995 15:05:44 +0000 (15:05 +0000)
DT_INIT and DT_FINI entries if the _init or _fini symbol is
defined or mentioned in a regular file.
PR 8462.

bfd/ChangeLog
bfd/elflink.h

index ffadb6d07dea246e417cdbc973ee6826a8fca9e4..b71d6a52786eaf515e94fb41c792c2ea09fe1db6 100644 (file)
@@ -1,3 +1,9 @@
+Fri Nov 17 10:02:58 1995  Ian Lance Taylor  <ian@cygnus.com>
+
+       * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Only create
+       DT_INIT and DT_FINI entries if the _init or _fini symbol is
+       defined or mentioned in a regular file.
+
 Thu Nov 16 15:16:42 1995  Kim Knuttila  <krk@cygnus.com>
 
        * coff-ppc.c (ppc_record_data_in_toc_entry): new function
index 725aa930b136689beffc77b0b1a97c20ac20d306..37dd4439d9807804d10fe86766ae439fccd81997 100644 (file)
@@ -1345,6 +1345,7 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
   if (elf_hash_table (info)->dynamic_sections_created)
     {
       struct elf_info_failed eif;
+      struct elf_link_hash_entry *h;
       bfd_size_type strsize;
 
       *sinterpptr = bfd_get_section_by_name (dynobj, ".interp");
@@ -1391,14 +1392,20 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
       /* Add some entries to the .dynamic section.  We fill in some of the
         values later, in elf_bfd_final_link, but we must add the entries
         now so that we know the final size of the .dynamic section.  */
-      if (elf_link_hash_lookup (elf_hash_table (info), "_init", false,
-                               false, false) != NULL)
+      h =  elf_link_hash_lookup (elf_hash_table (info), "_init", false,
+                               false, false);
+      if (h != NULL
+         && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
+                                       | ELF_LINK_HASH_DEF_REGULAR)) != 0)
        {
          if (! elf_add_dynamic_entry (info, DT_INIT, 0))
            return false;
        }
-      if (elf_link_hash_lookup (elf_hash_table (info), "_fini", false,
-                               false, false) != NULL)
+      h =  elf_link_hash_lookup (elf_hash_table (info), "_fini", false,
+                                false, false);
+      if (h != NULL
+         && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
+                                       | ELF_LINK_HASH_DEF_REGULAR)) != 0)
        {
          if (! elf_add_dynamic_entry (info, DT_FINI, 0))
            return false;
This page took 0.033357 seconds and 4 git commands to generate.