mach-o: output output_section target_index to write relocs.
authorTristan Gingold <tristan.gingold@adacore.com>
Fri, 4 Apr 2014 10:37:50 +0000 (12:37 +0200)
committerTristan Gingold <tristan.gingold@adacore.com>
Fri, 4 Apr 2014 12:22:18 +0000 (14:22 +0200)
bfd/
* mach-o-i386.c (bfd_mach_o_i386_swap_reloc_out): Use target index
of output_section.
* mach-o-x86-64.c (bfd_mach_o_x86_64_swap_reloc_out): Ditto.

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

index e134050a982049de239f03919547dadda185a43c..1eac58ad15c5552395ab4008d934fa0c7c98dfb9 100644 (file)
@@ -1,3 +1,9 @@
+2014-04-04  Tristan Gingold  <gingold@adacore.com>
+
+       * mach-o-i386.c (bfd_mach_o_i386_swap_reloc_out): Use target index
+       of output_section.
+       * mach-o-x86-64.c (bfd_mach_o_x86_64_swap_reloc_out): Ditto.
+
 2014-04-04  Tristan Gingold  <gingold@adacore.com>
 
        * bfd.c (bfd_get_arch_size): Default is taken from arch.
index 95dc48cb8b449685b8463aff1ca58ec1cba8ace0..8349c66c575e8604dfe70637e2d5caf44ec0c830 100644 (file)
@@ -210,7 +210,8 @@ bfd_mach_o_i386_swap_reloc_out (arelent *rel, bfd_mach_o_reloc_info *rinfo)
       if ((*rel->sym_ptr_ptr)->flags & BSF_SECTION_SYM)
         {
           rinfo->r_extern = 0;
-          rinfo->r_value = (*rel->sym_ptr_ptr)->section->target_index;
+          rinfo->r_value =
+           (*rel->sym_ptr_ptr)->section->output_section->target_index;
         }
       else
         {
index 53ff8429a1f33f836c1857046244d6316a36dc54..221c030ac5cde2a83584f0ba1b678717d1a7ca21 100644 (file)
@@ -284,7 +284,8 @@ bfd_mach_o_x86_64_swap_reloc_out (arelent *rel, bfd_mach_o_reloc_info *rinfo)
   if ((*rel->sym_ptr_ptr)->flags & BSF_SECTION_SYM)
     {
       rinfo->r_extern = 0;
-      rinfo->r_value = (*rel->sym_ptr_ptr)->section->target_index;
+      rinfo->r_value =
+       (*rel->sym_ptr_ptr)->section->output_section->target_index;
     }
   else
     {