mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-21 04:42:53 +08:00
491993044b
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.
17 lines
473 B
Makefile
17 lines
473 B
Makefile
|
|
.*: file format .*
|
|
|
|
Disassembly of section .text:
|
|
|
|
00000000 <_start>:
|
|
0: (48 00 00 01|01 00 00 48) bl 0 <_start>
|
|
0: R_PPC_REL24 near
|
|
4: (48 00 00 01|01 00 00 48) bl 4 <_start\+0x4>
|
|
4: R_PPC_REL24 far
|
|
8: (48 00 00 01|01 00 00 48) bl 8 <_start\+0x8>
|
|
8: R_PPC_REL24 near
|
|
c: (48 00 00 01|01 00 00 48) bl c <_start\+0xc>
|
|
c: R_PPC_REL24 far
|
|
10: (48 00 00 00|00 00 00 48) b 10 <_start\+0x10>
|
|
10: R_PPC_REL24 _start
|