binutils-gdb/ld/testsuite/ld-powerpc/relaxrl.d
Alan Modra 491993044b 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.
2018-07-25 16:52:58 +09:30

28 lines
932 B
Makefile

.*: file format .*
Disassembly of section .text:
0+ <_start>:
+0: (48 00 00 15|15 00 00 48) bl 14 <_start\+0x14>
+4: (48 00 00 21|21 00 00 48) bl 24 <_start\+0x24>
+8: (48 00 00 0d|0d 00 00 48) bl 14 <_start\+0x14>
8: R_PPC_NONE \*ABS\*
+c: (48 00 00 19|19 00 00 48) bl 24 <_start\+0x24>
c: R_PPC_NONE \*ABS\*
+10: (48 00 00 00|00 00 00 48) b 10 <_start\+0x10>
10: R_PPC_REL24 _start
+14: (3d 80 00 00|00 00 80 3d) lis r12,0
1(6|4): R_PPC_ADDR16_HA near
+18: (39 8c 00 00|00 00 8c 39) addi r12,r12,0
1(a|8): R_PPC_ADDR16_LO near
+1c: (7d 89 03 a6|a6 03 89 7d) mtctr r12
+20: (4e 80 04 20|20 04 80 4e) bctr
+24: (3d 80 00 00|00 00 80 3d) lis r12,0
2(6|4): R_PPC_ADDR16_HA far
+28: (39 8c 00 00|00 00 8c 39) addi r12,r12,0
2(a|8): R_PPC_ADDR16_LO far
+2c: (7d 89 03 a6|a6 03 89 7d) mtctr r12
+30: (4e 80 04 20|20 04 80 4e) bctr
\.\.\.