OSDN Git Service

Revert ARM linker patch and apply similar patch to bfd instead
authorNick Clifton <nickc@redhat.com>
Tue, 27 Aug 2002 11:01:55 +0000 (11:01 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 27 Aug 2002 11:01:55 +0000 (11:01 +0000)
bfd/ChangeLog
bfd/elf32-arm.h

index d3631b0..2ea53bc 100644 (file)
@@ -1,3 +1,8 @@
+2002-08-27  Adam Nemet  <anemet@lnxw.com>
+
+       * elf32-arm.h (elf32_arm_finish_dynamic_sections): Set the last
+       bit of DT_INIT and DT_FINI for Thumb functions.
+
 2002-08-26  Alan Modra  <amodra@bigpond.net.au>
 
        * coffcode.h (coff_set_arch_mach_hook): Handle W65MAGIC.
index bfc1aa6..5cd9434 100644 (file)
@@ -3546,6 +3546,31 @@ elf32_arm_finish_dynamic_sections (output_bfd, info)
                }
              bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
              break;
+
+             /* Set the bottom bit of DT_INIT/FINI if the
+                corresponding function is Thumb.  */
+           case DT_INIT:
+             name = info->init_function;
+             goto get_sym;
+           case DT_FINI:
+             name = info->fini_function;
+           get_sym:
+             /* If it wasn't set by elf_bfd_final_link
+                then there is nothing to ajdust.  */
+             if (dyn.d_un.d_val != 0)
+               {
+                 struct elf_link_hash_entry * eh;
+
+                 eh = elf_link_hash_lookup (elf_hash_table (info), name,
+                                            false, false, true);
+                 if (eh != (struct elf_link_hash_entry *) NULL
+                     && ELF_ST_TYPE (eh->type) == STT_ARM_TFUNC)
+                   {
+                     dyn.d_un.d_val |= 1;
+                     bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);                
+                   }
+               }
+             break;
            }
        }