]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* elf32-arm.c (elf32_arm_modify_segment_map): New function.
authorMark Mitchell <mark@codesourcery.com>
Sun, 20 Mar 2005 19:16:25 +0000 (19:16 +0000)
committerMark Mitchell <mark@codesourcery.com>
Sun, 20 Mar 2005 19:16:25 +0000 (19:16 +0000)
(elf32_arm_additional_program_headers): Likewise.
(elf_backend_modify_segment_map): Define.
(elf_backend_additional_program_headers): Likewise.
(elf32_arm_symbian_modify_segment_map): Use
elf32_arm_modify_segment_map.

* binutils/readelf.c (get_arm_segment_type): New function.
(get_segment_type): Use it.

* arm.h (PT_ARM_EXIDX): Define.

bfd/ChangeLog
bfd/elf32-arm.c
bfd/po/es.gmo
binutils/ChangeLog
binutils/po/es.gmo
binutils/po/fr.gmo
binutils/po/ru.gmo
binutils/po/tr.gmo
binutils/readelf.c
include/elf/ChangeLog
include/elf/arm.h

index 9114c4e5ccd9cdfecbe341f16f1acdd0b5b57778..3bbd61f28db865f8a7d05ece9538e0a60980f4ae 100644 (file)
@@ -1,3 +1,14 @@
+2005-03-17  Paul Brook <paul@codesourcery.com>
+           Dan Jacobowitz <dan@codesourcery.com>
+           Mark Mitchell  <mark@codesourcery.com>
+
+       * elf32-arm.c (elf32_arm_modify_segment_map): New function.
+       (elf32_arm_additional_program_headers): Likewise.
+       (elf_backend_modify_segment_map): Define.
+       (elf_backend_additional_program_headers): Likewise.
+       (elf32_arm_symbian_modify_segment_map): Use
+       elf32_arm_modify_segment_map.
+
 2005-03-16  Alan Modra  <amodra@bigpond.net.au>
 
        * elf32-ppc.c (ppc_elf_create_linker_section): Set SEC_LINKER_CREATED
index 660a9909dc04ae438a0ccae6d1e8e30dc9e0cf7d..f438f03e7071cc754c707c65cad32e2e013550ab 100644 (file)
@@ -5710,6 +5710,55 @@ elf32_arm_swap_symbol_out (bfd *abfd,
   bfd_elf32_swap_symbol_out (abfd, src, cdst, shndx);
 }
 
+/* Add the PT_ARM_EXIDX program header.  */
+
+static bfd_boolean
+elf32_arm_modify_segment_map (bfd *abfd, 
+                             struct bfd_link_info *info ATTRIBUTE_UNUSED)
+{
+  struct elf_segment_map *m;
+  asection *sec;
+
+  sec = bfd_get_section_by_name (abfd, ".ARM.exidx");
+  if (sec != NULL && (sec->flags & SEC_LOAD) != 0)
+    {
+      /* If there is already a PT_ARM_EXIDX header, then we do not
+        want to add another one.  This situation arises when running
+        "strip"; the input binary already has the header.  */
+      m = elf_tdata (abfd)->segment_map;
+      while (m && m->p_type != PT_ARM_EXIDX)
+       m = m->next;
+      if (!m)
+       {
+         m = bfd_zalloc (abfd, sizeof (struct elf_segment_map));
+         if (m == NULL)
+           return FALSE;
+         m->p_type = PT_ARM_EXIDX;
+         m->count = 1;
+         m->sections[0] = sec;
+
+         m->next = elf_tdata (abfd)->segment_map;
+         elf_tdata (abfd)->segment_map = m;
+       }
+    }
+
+  return TRUE;
+}
+
+/* We may add a PT_ARM_EXIDX program header.  */
+
+static int
+elf32_arm_additional_program_headers (bfd *abfd)
+{
+  asection *sec;
+
+  sec = bfd_get_section_by_name (abfd, ".ARM.exidx");
+  if (sec != NULL && (sec->flags & SEC_LOAD) != 0)
+    return 1;
+  else
+    return 0;
+}
+
 /* We use this to override swap_symbol_in and swap_symbol_out.  */
 const struct elf_size_info elf32_arm_size_info = {
   sizeof (Elf32_External_Ehdr),
@@ -5780,6 +5829,9 @@ const struct elf_size_info elf32_arm_size_info = {
 #define elf_backend_copy_indirect_symbol        elf32_arm_copy_indirect_symbol
 #define elf_backend_symbol_processing          elf32_arm_symbol_processing
 #define elf_backend_size_info                  elf32_arm_size_info
+#define elf_backend_modify_segment_map         elf32_arm_modify_segment_map
+#define elf_backend_additional_program_headers \
+  elf32_arm_additional_program_headers
 
 #define elf_backend_can_refcount    1
 #define elf_backend_can_gc_sections 1
@@ -5914,8 +5966,7 @@ elf32_arm_symbian_begin_write_processing (bfd *abfd,
 
 static bfd_boolean
 elf32_arm_symbian_modify_segment_map (bfd *abfd, 
-                                     struct bfd_link_info *info 
-                                       ATTRIBUTE_UNUSED)
+                                     struct bfd_link_info *info)
 {
   struct elf_segment_map *m;
   asection *dynsec;
@@ -5932,7 +5983,8 @@ elf32_arm_symbian_modify_segment_map (bfd *abfd,
       elf_tdata (abfd)->segment_map = m;
     }
 
-  return TRUE;
+  /* Also call the generic arm routine.  */
+  return elf32_arm_modify_segment_map (abfd, info);
 }
 
 #undef elf32_bed
index 3b3adfc6aab2ac823b1f5029212dcd3fba820631..cff702a204fd0b809f1b2039085aba9895a89512 100644 (file)
Binary files a/bfd/po/es.gmo and b/bfd/po/es.gmo differ
index 2c302ca049ce2827c5937f6c705d27a381fbcd4a..a978d0b4489d42b83bc0b01457cb1e36134a0d0f 100644 (file)
@@ -1,3 +1,10 @@
+2005-03-17  Paul Brook <paul@codesourcery.com>
+           Dan Jacobowitz <dan@codesourcery.com>
+           Mark Mitchell  <mark@codesourcery.com>
+
+       * binutils/readelf.c (get_arm_segment_type): New function.
+       (get_segment_type): Use it.
+
 2005-03-15  Alan Modra  <amodra@bigpond.net.au>
 
        * po/es.po: Commit new Spanish translation.
index 622e305344f83a53006fb200abfaf577b21787cc..bc12e337746ed347796f43b07160a0f75488bbfc 100644 (file)
Binary files a/binutils/po/es.gmo and b/binutils/po/es.gmo differ
index 4425835e7cd1120ecb56259301c8ca994368ee67..e92b6c8b83d2cd65382776a4138ecd406e6e1914 100644 (file)
Binary files a/binutils/po/fr.gmo and b/binutils/po/fr.gmo differ
index 5ea07a1ee401a7d58ccd534f2c3854039c289fe8..df9584885b232fabfe6d3d9354c847a513fd39bd 100644 (file)
Binary files a/binutils/po/ru.gmo and b/binutils/po/ru.gmo differ
index ba1cda99b8e58eca26fd0db8870ace130a738e6f..bf530ce5e68e13f5b2a98e6c149bc9cb720b6af5 100644 (file)
Binary files a/binutils/po/tr.gmo and b/binutils/po/tr.gmo differ
index 9c4d2a44b0c66ae01dcd47f52658e0be1eb9e597..31fd3fa0e9278cb6ed0ebc020ce4c83440932c4c 100644 (file)
@@ -2234,6 +2234,20 @@ get_osabi_name (unsigned int osabi)
     }
 }
 
+static const char *
+get_arm_segment_type (unsigned long type)
+{
+  switch (type)
+    {
+    case PT_ARM_EXIDX:
+      return "EXIDX";
+    default:
+      break;
+    }
+
+  return NULL;
+}
+
 static const char *
 get_mips_segment_type (unsigned long type)
 {
@@ -2324,6 +2338,9 @@ get_segment_type (unsigned long p_type)
 
          switch (elf_header.e_machine)
            {
+           case EM_ARM:
+             result = get_arm_segment_type (p_type);
+             break;
            case EM_MIPS:
            case EM_MIPS_RS3_LE:
              result = get_mips_segment_type (p_type);
index 91a81b9959457fb4d573059d924ff33faf3f4a35..46df13d03a0d880fa3acd875a11ac78a90204255 100644 (file)
@@ -1,3 +1,9 @@
+2005-03-17  Paul Brook <paul@codesourcery.com>
+           Dan Jacobowitz <dan@codesourcery.com>
+           Mark Mitchell  <mark@codesourcery.com>
+
+       * arm.h (PT_ARM_EXIDX): Define.
+
 2005-03-02  Daniel Jacobowitz  <dan@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>
 
index 78678295d9c1fea23718e421d047e274f4c2f571..de3ed0664415fd18fdd9f6272d5dc82993abfa89 100644 (file)
@@ -37,6 +37,9 @@
 #define EF_ARM_VFP_FLOAT   0x400
 #define EF_ARM_MAVERICK_FLOAT 0x800
 
+/* Frame unwind information */
+#define PT_ARM_EXIDX (PT_LOPROC + 1) 
+
 /* Other constants defined in the ARM ELF spec. version B-01.  */
 #define EF_ARM_SYMSARESORTED 0x04      /* NB conflicts with EF_INTERWORK */
 #define EF_ARM_DYNSYMSUSESEGIDX 0x08   /* NB conflicts with EF_APCS26 */