diff options
author | Iain Sandoe <iain@codesourcery.com> | 2012-01-13 15:19:13 +0000 |
---|---|---|
committer | Iain Sandoe <iain@codesourcery.com> | 2012-01-13 15:19:13 +0000 |
commit | 34dd18bca5b8991d5e107dc1669ba6710916ce1d (patch) | |
tree | dd8c4d6ffcd6a8745710832b9abee5f444f97376 /gas/config/obj-macho.c | |
parent | 0ee339bc478ec8c35f4fee8998456bc33be0a3e2 (diff) | |
download | gdb-34dd18bca5b8991d5e107dc1669ba6710916ce1d.zip gdb-34dd18bca5b8991d5e107dc1669ba6710916ce1d.tar.gz gdb-34dd18bca5b8991d5e107dc1669ba6710916ce1d.tar.bz2 |
reverse the order of relocs in mach-o gas output.
gas:
* config/obj-macho.c (obj_mach_o_reorder_section_relocs): New.
* config/obj-macho.h (SET_SECTION_RELOCS): Define.
(obj_mach_o_reorder_section_relocs): Declare.
gas/testsuite:
* gas/all/redef2.d: Skip for Darwin.
* gas/all/redef3.d: Likewise.
* gas/all/weakref1.d: Likewise.
* gas/macros/irp.d: Likewise.
* gas/macros/repeat.d: Likewise.
* gas/macros/rept.d: Likewise.
* gas/macros/test2.d: Likewise.
* gas/macros/vararg.d: Likewise.
* gas/mach-o/macro-irp.d: New.
* gas/mach-o/macro-repeat.d: New.
* gas/mach-o/macro-rept.d: New.
* gas/mach-o/macro-test2.d: New.
* gas/mach-o/macro-vararg.d: New.
* gas/mach-o/redef2.d: New.
* gas/mach-o/redef3.d: New.
Diffstat (limited to 'gas/config/obj-macho.c')
-rw-r--r-- | gas/config/obj-macho.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gas/config/obj-macho.c b/gas/config/obj-macho.c index ddf0988..f0cb43e 100644 --- a/gas/config/obj-macho.c +++ b/gas/config/obj-macho.c @@ -1679,6 +1679,23 @@ obj_mach_o_frob_file_after_relocs (void) bfd_map_over_sections (stdoutput, obj_mach_o_set_indirect_symbols, (char *) 0); } +/* Reverse relocations order to make ld happy. */ + +void +obj_mach_o_reorder_section_relocs (asection *sec, arelent **rels, unsigned int n) +{ + unsigned int i; + unsigned int max = n / 2; + + for (i = 0; i < max; i++) + { + arelent *r = rels[i]; + rels[i] = rels[n - i - 1]; + rels[n - i - 1] = r; + } + bfd_set_reloc (stdoutput, sec, rels, n); +} + /* Support stabs for mach-o. */ void |