correct some mach-o section specification nits.
authorIain Sandoe <iain@codesourcery.com>
Fri, 10 Feb 2012 11:07:33 +0000 (11:07 +0000)
committerIain Sandoe <iain@codesourcery.com>
Fri, 10 Feb 2012 11:07:33 +0000 (11:07 +0000)
bfd:

* mach-o.c (mach_o_section_name_xlat): Correct eh-frame section
parameters.
* mach-o-x86-64.c (text_section_names_xlat): New.
(mach_o_x86_64_segsec_names_xlat): New.
(bfd_mach_o_tgt_seg_table): Define to mach_o_x86_64_segsec_names_xlat.
* mach-o-i386.c (text_section_names_xlat): Correct section parameters.

bfd/ChangeLog
bfd/mach-o-i386.c
bfd/mach-o-x86-64.c
bfd/mach-o.c

index c6e315988aa666c411a7c3b5bcba56eaefbb94f0..3fbda98489985b85339d11076febdaa5a819471c 100644 (file)
@@ -1,3 +1,12 @@
+2012-02-10  Iain Sandoe  <idsandoe@googlemail.com>
+
+       * mach-o.c (mach_o_section_name_xlat): Correct eh-frame section
+       parameters.
+       * mach-o-x86-64.c (text_section_names_xlat): New.
+       (mach_o_x86_64_segsec_names_xlat): New.
+       (bfd_mach_o_tgt_seg_table): Define to mach_o_x86_64_segsec_names_xlat.
+       * mach-o-i386.c (text_section_names_xlat): Correct section parameters.
+
 2012-02-10  Tristan Gingold  <gingold@adacore.com>
 
        * elfnn-ia64.c (elfNN_vms_object_p): Change comparison operator
index d1067104132483db02a73b1e12350b8db4e430b6..71272eb2520dc837b2d1a08ed155f2427b63276f 100644 (file)
@@ -283,11 +283,11 @@ bfd_mach_o_i386_print_thread (bfd *abfd, bfd_mach_o_thread_flavour *thread,
 static const mach_o_section_name_xlat text_section_names_xlat[] =
   {
     {  ".symbol_stub",                 "__symbol_stub",
-       SEC_DATA | SEC_LOAD,            BFD_MACH_O_S_SYMBOL_STUBS,
+       SEC_CODE | SEC_LOAD,            BFD_MACH_O_S_SYMBOL_STUBS,
        BFD_MACH_O_S_ATTR_PURE_INSTRUCTIONS,
                                        0},
     {  ".picsymbol_stub",              "__picsymbol_stub",
-       SEC_DATA | SEC_LOAD,            BFD_MACH_O_S_SYMBOL_STUBS,
+       SEC_CODE | SEC_LOAD,            BFD_MACH_O_S_SYMBOL_STUBS,
        BFD_MACH_O_S_ATTR_PURE_INSTRUCTIONS,
                                        0},
     { NULL, NULL, 0, 0, 0, 0}
@@ -315,7 +315,7 @@ static const mach_o_section_name_xlat data_section_names_xlat[] =
 static const mach_o_section_name_xlat import_section_names_xlat[] =
   {
     {  ".picsymbol_stub3",             "__jump_table",
-       SEC_DATA | SEC_LOAD,            BFD_MACH_O_S_SYMBOL_STUBS,
+       SEC_CODE | SEC_LOAD,            BFD_MACH_O_S_SYMBOL_STUBS,
        BFD_MACH_O_S_ATTR_PURE_INSTRUCTIONS 
        | BFD_MACH_O_S_SELF_MODIFYING_CODE,
                                        6},
index 48e51e206e523ebdb24e0b7f027f6e8d297af95e..232701e86708eee3b0337672496fab8d1bee3fce 100644 (file)
@@ -326,13 +326,30 @@ bfd_mach_o_section_type_valid_for_x86_64 (unsigned long val)
   return TRUE;
 }
 
+/* We want to bump the alignment of some sections.  */
+static const mach_o_section_name_xlat text_section_names_xlat[] =
+  {
+    {  ".eh_frame",                            "__eh_frame",
+       SEC_READONLY | SEC_DATA | SEC_LOAD,     BFD_MACH_O_S_COALESCED,
+       BFD_MACH_O_S_ATTR_LIVE_SUPPORT
+       | BFD_MACH_O_S_ATTR_STRIP_STATIC_SYMS
+       | BFD_MACH_O_S_ATTR_NO_TOC,             3},
+    { NULL, NULL, 0, 0, 0, 0}
+  };
+
+const mach_o_segment_name_xlat mach_o_x86_64_segsec_names_xlat[] =
+  {
+    { "__TEXT", text_section_names_xlat },
+    { NULL, NULL }
+  };
+
 #define bfd_mach_o_swap_reloc_in bfd_mach_o_x86_64_swap_reloc_in
 #define bfd_mach_o_swap_reloc_out bfd_mach_o_x86_64_swap_reloc_out
 
 #define bfd_mach_o_bfd_reloc_type_lookup bfd_mach_o_x86_64_bfd_reloc_type_lookup
 #define bfd_mach_o_bfd_reloc_name_lookup bfd_mach_o_x86_64_bfd_reloc_name_lookup
 #define bfd_mach_o_print_thread NULL
-#define bfd_mach_o_tgt_seg_table NULL
+#define bfd_mach_o_tgt_seg_table mach_o_x86_64_segsec_names_xlat
 #define bfd_mach_o_section_type_valid_for_tgt bfd_mach_o_section_type_valid_for_x86_64
 
 #define TARGET_NAME            mach_o_x86_64_vec
index 5386b1ada1440bfd6b1e078d83cf5ef81530efa2..73d4594bc75e8833faa19bb05a330f1d415999eb 100644 (file)
@@ -121,10 +121,10 @@ static const mach_o_section_name_xlat text_section_names_xlat[] =
        SEC_CODE | SEC_LOAD,                    BFD_MACH_O_S_REGULAR,
        BFD_MACH_O_S_ATTR_NONE,                 0},
     {  ".eh_frame",                            "__eh_frame",
-       SEC_READONLY | SEC_LOAD,                BFD_MACH_O_S_COALESCED,
+       SEC_READONLY | SEC_DATA | SEC_LOAD,     BFD_MACH_O_S_COALESCED,
        BFD_MACH_O_S_ATTR_LIVE_SUPPORT
        | BFD_MACH_O_S_ATTR_STRIP_STATIC_SYMS
-       | BFD_MACH_O_S_ATTR_NO_TOC,             3},
+       | BFD_MACH_O_S_ATTR_NO_TOC,             2},
     { NULL, NULL, 0, 0, 0, 0}
   };