diff options
author | Claudiu Zissulescu <claziss@gmail.com> | 2019-07-24 16:33:29 +0300 |
---|---|---|
committer | Claudiu Zissulescu <claziss@gmail.com> | 2019-07-24 16:33:29 +0300 |
commit | ef551643dc282159185cb9916c7cb0308ae03cdd (patch) | |
tree | 90007b800835a19087ca4580e7a061ca5dad491e /ld/testsuite/ld-arc | |
parent | c54e42531adb7bf8d58bd4c3c8e0c710305959e1 (diff) | |
download | fsf-binutils-gdb-ef551643dc282159185cb9916c7cb0308ae03cdd.zip fsf-binutils-gdb-ef551643dc282159185cb9916c7cb0308ae03cdd.tar.gz fsf-binutils-gdb-ef551643dc282159185cb9916c7cb0308ae03cdd.tar.bz2 |
[ARC] Add linker relaxation.
Add linker relaxation. The first relaxation added is converting
GOTPC32 to PCREL relocations. This relaxation doesn't change the size of
the binary.
bfd/
xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com>
* elf32-arc.c (bfd_get_32_me): New function.
(bfd_put_32_me): Likewise.
(arc_elf_relax_section): Likewise.
(bfd_elf32_bfd_relax_section): Define.
ld/testsuite/
xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com>
* ld-arc/relax-local-pic.d: New test.
* ld-arc/relax-local-pic.s: New file.
Diffstat (limited to 'ld/testsuite/ld-arc')
-rw-r--r-- | ld/testsuite/ld-arc/relax-local-pic.d | 14 | ||||
-rw-r--r-- | ld/testsuite/ld-arc/relax-local-pic.s | 16 |
2 files changed, 30 insertions, 0 deletions
diff --git a/ld/testsuite/ld-arc/relax-local-pic.d b/ld/testsuite/ld-arc/relax-local-pic.d new file mode 100644 index 0000000..5ed2688 --- /dev/null +++ b/ld/testsuite/ld-arc/relax-local-pic.d @@ -0,0 +1,14 @@ +#source: relax-local-pic.s +#as: +#ld: -q -A elf32-arclittle -relax +#objdump: -dr + +[^:]+: file format elf32-.*arc + + +Disassembly of section \.text: + +00000100 <__start>: + 100: 2700 7f84 0000 [0-9a-f]+ add r4,pcl,0x[0-9a-f]+.* + 104: R_ARC_PC32 a_in_other_thread + 108: 1c00 [0-9a-f\s]+ st\s+.* diff --git a/ld/testsuite/ld-arc/relax-local-pic.s b/ld/testsuite/ld-arc/relax-local-pic.s new file mode 100644 index 0000000..66c48b4 --- /dev/null +++ b/ld/testsuite/ld-arc/relax-local-pic.s @@ -0,0 +1,16 @@ + .section .text + .align 4 + .global __start + .type __start, @function +__start: + ld r4,[pcl,@a_in_other_thread@gotpc] + st 1,[r4] + .size __start, .-__start + + .global a_in_other_thread + .section .data + .align 4 + .type a_in_other_thread, @object + .size a_in_other_thread, 4 +a_in_other_thread: + .word -559038737 |