summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-arc
diff options
context:
space:
mode:
authorClaudiu Zissulescu <claziss@gmail.com>2019-07-24 16:33:29 +0300
committerClaudiu Zissulescu <claziss@gmail.com>2019-07-24 16:33:29 +0300
commitef551643dc282159185cb9916c7cb0308ae03cdd (patch)
tree90007b800835a19087ca4580e7a061ca5dad491e /ld/testsuite/ld-arc
parentc54e42531adb7bf8d58bd4c3c8e0c710305959e1 (diff)
downloadbinutils-gdb-ef551643dc282159185cb9916c7cb0308ae03cdd.tar.gz
[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.d14
-rw-r--r--ld/testsuite/ld-arc/relax-local-pic.s16
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 00000000000..5ed268809ab
--- /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 00000000000..66c48b4ad70
--- /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