This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Mach-O] use section index from output section (to write relocs)


Hi,

like as symbols, the relevant section index while writing relocs is the one
of the output_section.

Committed on trunk.

Tristan.

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.


diff --git a/bfd/mach-o-i386.c b/bfd/mach-o-i386.c
index 95dc48c..8349c66 100644
--- a/bfd/mach-o-i386.c
+++ b/bfd/mach-o-i386.c
@@ -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
         {
diff --git a/bfd/mach-o-x86-64.c b/bfd/mach-o-x86-64.c
index 53ff842..221c030 100644
--- a/bfd/mach-o-x86-64.c
+++ b/bfd/mach-o-x86-64.c
@@ -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
     {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]