binutils-gdb/ld/testsuite/ld-powerpc/weak1so.d
Alan Modra f5b9c288a3 PowerPC64 undefined weak visibility vs GOT optimisation
Undefined weak symbols with non-default visibility are seen as local
by SYMBOL_REFERENCES_LOCAL.  This stops a got indirect to relative
optimisation for them, so that pies and dlls don't get non-zero values
when loading somewhere other than the address they are linked at
(which always happens).  The optimisation could be allowed for pdes,
but I thought it best not to allow it there too.

bfd/
	* elf64-ppc.c (ppc64_elf_relocate_section): Don't optimise got
	indirect to pc-relative or toc-relative for undefined symbols.
ld/
	* testsuite/ld-powerpc/weak1.d,
	* testsuite/ld-powerpc/weak1.r,
	* testsuite/ld-powerpc/weak1.s,
	* testsuite/ld-powerpc/weak1so.d,
	* testsuite/ld-powerpc/weak1so.r: New tests.
	* testsuite/ld-powerpc/powerpc.exp: Run them.
2021-03-02 21:47:42 +10:30

27 lines
1009 B
Makefile

.*: file format .*
Disassembly of section \.text:
0+1c0 <_start>:
1c0: (04 10 00 01|01 00 10 04) pld r3,66144
1c4: (e4 60 02 60|60 02 60 e4)
1c8: (04 10 00 01|01 00 10 04) pld r3,66112
1cc: (e4 60 02 40|40 02 60 e4)
1d0: (04 10 00 01|01 00 10 04) pld r3,66120
1d4: (e4 60 02 48|48 02 60 e4)
1d8: (04 10 00 01|01 00 10 04) pld r3,66104
1dc: (e4 60 02 38|38 02 60 e4)
1e0: (e8 62 80 20|20 80 62 e8) ld r3,-32736\(r2\)
1e4: (e8 62 80 08|08 80 62 e8) ld r3,-32760\(r2\)
1e8: (e8 62 80 18|18 80 62 e8) ld r3,-32744\(r2\)
1ec: (e8 62 80 10|10 80 62 e8) ld r3,-32752\(r2\)
1f0: (60 00 00 00|00 00 00 60) nop
1f4: (e8 62 80 20|20 80 62 e8) ld r3,-32736\(r2\)
1f8: (60 00 00 00|00 00 00 60) nop
1fc: (e8 62 80 08|08 80 62 e8) ld r3,-32760\(r2\)
200: (60 00 00 00|00 00 00 60) nop
204: (e8 62 80 18|18 80 62 e8) ld r3,-32744\(r2\)
208: (60 00 00 00|00 00 00 60) nop
20c: (e8 62 80 10|10 80 62 e8) ld r3,-32752\(r2\)