23283c1be0
This moves .got too, which requires .sdata and .sbss to move with it, because these sections share addressing via the toc pointer and with small-model code must be within a 16-bit signed offset. .plt, .iplt and .branch_lt must also be moved since they are addressed via a 32-bit offset from the toc pointer, and we might have a very large .data section. This change means we may have some bss style sections before the data segment, necessitating another PT_LOAD header. Also, since _edata is defined at the end of the data segment it's possible with an empty .data to have _edata at the end of .plt which looks a little unusual since .plt is a bss style section. That should only happen rarely in real world binaries, but does occur in the ld testsuite. ld/ * emulparams/elf64ppc.sh (BSS_PLT): Don't define. (OTHER_READWRITE_SECTIONS): Move .branch_lt to.. (OTHER_RELRO_SECTIONS_2): ..here. (DATA_GOT, SEPARATE_GOTPLT, DATA_SDATA, DATA_PLT, PLT_BEFORE_GOT): Define. * scripttempl/elf.sc: Handle DATA_SDATA and DATA_GOT/DATA_PLT/ PLT_BEFORE_GOT combination. (DATA_GOT, SDATA_GOT): Don't define if either is already defined. ld/testsuite/ * ld-powerpc/ambiguousv1.d, * ld-powerpc/ambiguousv1b.d, * ld-powerpc/ambiguousv2.d, * ld-powerpc/ambiguousv2b.d, * ld-powerpc/elfv2exe.d, * ld-powerpc/elfv2so.d, * ld-powerpc/tlsexe.r, * ld-powerpc/tlsexetoc.r, * ld-powerpc/tlsso.r, * ld-powerpc/tlstocso.r: Update.
24 lines
687 B
Makefile
24 lines
687 B
Makefile
#source: startv1.s
|
|
#source: funref.s
|
|
#as: -a64
|
|
#ld: -melf64ppc --emit-stub-syms
|
|
#ld_after_inputfiles: tmpdir/funv1.so
|
|
#readelf: -rs --wide
|
|
# Check that we do the right thing with funref.s that doesn't have
|
|
# anything to mark it as ELFv1 or ELFv2. We should get a dynamic
|
|
# reloc on the function address, and my_func should be undefined
|
|
# dynamic with value zero.
|
|
|
|
Relocation section .* contains 1 entries:
|
|
.*
|
|
.* R_PPC64_ADDR64 +0+ my_func \+ 0
|
|
|
|
Symbol table '\.dynsym' contains 5 entries:
|
|
.*
|
|
0: .*
|
|
1: 0+00000000 0 FUNC GLOBAL DEFAULT UND my_func
|
|
#...
|
|
Symbol table '\.symtab' contains 19 entries:
|
|
#...
|
|
14: 0+00000000 0 FUNC GLOBAL DEFAULT UND my_func
|
|
#pass
|