summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-powerpc/powerpc.exp
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-07-25 15:24:55 +0930
committerAlan Modra <amodra@gmail.com>2018-07-25 16:52:58 +0930
commit491993044ba6cfb2b0fc93c8b3032d5c91cccda5 (patch)
treeef399640acd0e20d9bd6f165015a882f66f0faad /ld/testsuite/ld-powerpc/powerpc.exp
parentbe3e27bb5554e45d54d7cdc74353dda246239475 (diff)
downloadbinutils-gdb-491993044ba6cfb2b0fc93c8b3032d5c91cccda5.tar.gz
Enhance powerpc ld -r --relax
One of the ill effects of ld -r is to mash together sections. That can result in reduced icache performance at runtime due to unexpected movement of code. Another problem is that sections can become too large to link on targets that have limited relative addressing. ld -r --relax attempts to overcome the large section problem for branches by inserting trampolines, but the powerpc support added lots of unnecessary trampolines. This patch trims them somewhat. bfd/ * elf32-ppc.c (ppc_elf_relax_section): Ignore common or undef locals. Avoid trashing toff with added when used as a symbol index. Ignore R_PPC_PLTREL24 addends in unused example code. Avoid creating unnecessary fixups when relocatable. ld/ * testsuite/ld-powerpc/big.s: New file. * testsuite/ld-powerpc/relaxrl.d: New test. * testsuite/ld-powerpc/powerpc.exp: Run new test. * testsuite/ld-powerpc/relaxr.d: Adjust.
Diffstat (limited to 'ld/testsuite/ld-powerpc/powerpc.exp')
-rw-r--r--ld/testsuite/ld-powerpc/powerpc.exp3
1 files changed, 3 insertions, 0 deletions
diff --git a/ld/testsuite/ld-powerpc/powerpc.exp b/ld/testsuite/ld-powerpc/powerpc.exp
index 0359ba28cb2..cfeb277f043 100644
--- a/ld/testsuite/ld-powerpc/powerpc.exp
+++ b/ld/testsuite/ld-powerpc/powerpc.exp
@@ -160,6 +160,9 @@ set ppcelftests {
{"relocatable relaxing" "-melf32ppc -r --relax" "" "-a32" "relax.s"
{{objdump -dr relaxr.d}}
"rrelax"}
+ {"relocatable relaxing large" "-melf32ppc -r --relax" "" "-a32" "relax.s big.s"
+ {{objdump -dr relaxrl.d}}
+ "rrelax"}
}
set ppc64elftests {