aboutsummaryrefslogtreecommitdiff
path: root/libiberty/simple-object-mach-o.c
diff options
context:
space:
mode:
Diffstat (limited to 'libiberty/simple-object-mach-o.c')
-rw-r--r--libiberty/simple-object-mach-o.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libiberty/simple-object-mach-o.c b/libiberty/simple-object-mach-o.c
index 03954d2..bbb7d75 100644
--- a/libiberty/simple-object-mach-o.c
+++ b/libiberty/simple-object-mach-o.c
@@ -1225,6 +1225,11 @@ simple_object_mach_o_write_segment (simple_object_write *sobj, int descriptor,
index[4 * i] -= index[0];
index[0] = 0;
+ /* Swap the indices, if required. */
+
+ for (i = 0; i < (nsects_in * 4); ++i)
+ set_32 ((unsigned char *) &index[i], index[i]);
+
sechdr_offset += sechdrsize;
/* Write out the section names.