summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-spu
diff options
context:
space:
mode:
authorTrevor Smigiel <Trevor_Smigiel@playstation.sony.com>2009-08-05 20:40:34 +0000
committerTrevor Smigiel <Trevor_Smigiel@playstation.sony.com>2009-08-05 20:40:34 +0000
commit86d862ba8a925b34276dd0abae24d34948600826 (patch)
treec3df5f1b8da70c3e6a574b1fa1154c54ff6c97ee /ld/testsuite/ld-spu
parent68a44794e419457bebccae833b98abe2b7335fb9 (diff)
downloadbinutils-redhat-86d862ba8a925b34276dd0abae24d34948600826.tar.gz
bfd/
* elf32-spu.h (spu_elf_params): Add member emit_fixups. (spu_elf_size_sections): Declare prototype. * elf32-spu.c (spu_link_hash_table): Add member sfixup. (FIXUP_RECORD_SIZE, FIXUP_GET, FIXUP_PUT): New macros. (spu_elf_emit_fixup): New function. (spu_elf_relocate_section): Emit fixup for each SPU_ADDR32. (spu_elf_size_sections): New function. ld/ * emulparams/elf32_spu.sh (OTHER_READONLY_SECTIONS): Add .fixup section and __fixup_start symbol. * emultempl/spuelf.em (params): Initialize emit_fixups member. (spu_before_allocation): Call spu_elf_size_sections. (OPTION_SPU_EMIT_FIXUPS): Define. (PARSE_AND_LIST_LONGOPTS): Add --emit-fixups. (PARSE_AND_LIST_ARGS_CASES): Handle --emit-fixups. * ld.texinfo (--emit-fixups): Document. ld/testsuite/ * ld-spu/fixup.d: New. * ld-spu/fixup.s: New.
Diffstat (limited to 'ld/testsuite/ld-spu')
-rw-r--r--ld/testsuite/ld-spu/fixup.d20
-rw-r--r--ld/testsuite/ld-spu/fixup.s24
2 files changed, 44 insertions, 0 deletions
diff --git a/ld/testsuite/ld-spu/fixup.d b/ld/testsuite/ld-spu/fixup.d
new file mode 100644
index 0000000000..39f731baa7
--- /dev/null
+++ b/ld/testsuite/ld-spu/fixup.d
@@ -0,0 +1,20 @@
+#source: fixup.s
+#ld: --emit-fixups
+#objdump: -s
+
+.*elf32-spu
+
+Contents of section .text:
+ 0000 00000000 ....
+Contents of section .fixup:
+ 0004 0000008b 00000091 000000c1 00000000 ................
+Contents of section .data:
+ 0080 000000d0 00000000 00000000 000000c0 ................
+ 0090 00000000 00000000 00000000 000000b0 ................
+ 00a0 00000001 00000000 00000000 00000000 ................
+ 00b0 00000002 00000000 00000000 00000000 ................
+ 00c0 00000000 00000000 00000000 00000080 ................
+Contents of section .note.spu_name:
+.*
+.*
+#pass
diff --git a/ld/testsuite/ld-spu/fixup.s b/ld/testsuite/ld-spu/fixup.s
new file mode 100644
index 0000000000..c0fd6db8bc
--- /dev/null
+++ b/ld/testsuite/ld-spu/fixup.s
@@ -0,0 +1,24 @@
+ .global _end
+ .global _start
+ .global glob
+ .global after
+ .global before
+ .weak undef
+
+ .section .text,"ax"
+_start:
+ stop
+
+
+ .data
+ .p2align 4
+before:
+ .long _end, 0, _start, after
+ .long 0, 0, 0, glob
+loc:
+ .long 1,0,0,0
+glob:
+ .long 2,0,0,0
+after:
+ .long 0, 0, 0, before
+