binutils-gdb/ld/testsuite/ld-mips-elf/relax-offset.dd
Maciej W. Rozycki 9f00292e69 MIPS/GAS: Use non-zero frag offset directly in PIC branch relaxation
Use frag symbols with a non-zero offset directly in `fix_new_exp' calls
made in PIC branch relaxation.  There is no need here to make a helper
symbol to hold the result of a `symbol+offset' calculation requested as
only branches to local symbols are relaxed and in this case the LO16
part of the PIC address load sequence will have the offset accounted for
in calculation against the local GOT entry retrieved as the GOT16 high
part.  Consequently actual code produed is identical whether a helper
symbol is used or the original `symbol+offset' expression used directly.
Verify that this is indeed the case with GAS and LD tests.

	gas/
	* config/tc-mips.c (md_convert_frag): Don't make a helper
	expression symbol for `fix_new_exp' called with a non-zero
	offset.
	* testsuite/gas/mips/relax-offset.d: New test.
	* testsuite/gas/mips/mips1@relax-offset.d: New test.
	* testsuite/gas/mips/r3000@relax-offset.d: New test.
	* testsuite/gas/mips/r3900@relax-offset.d: New test.
	* testsuite/gas/mips/micromips@relax-offset.d: New test.
	* testsuite/gas/mips/relax-offset.l: New stderr output.
	* testsuite/gas/mips/relax-offset.s: New test source.
	* testsuite/gas/mips/mips.exp: Run the new tests.

	ld/
	* testsuite/ld-mips-elf/relax-offset.dd: New test.
	* testsuite/ld-mips-elf/relax-offset.gd: New test.
	* testsuite/ld-mips-elf/relax-offset-umips.dd: New test.
	* testsuite/ld-mips-elf/relax-offset-umips.gd: New test.
	* testsuite/ld-mips-elf/relax-offset.ld: New test linker script.
	* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
	(prune_warnings): New temporary procedure.
2017-07-01 00:42:19 +01:00

20 lines
552 B
Plaintext

.*: +file format .*mips.*
Disassembly of section \.text:
00000000 <.*> 3c1c0003 lui gp,0x3
00000004 <.*> 279c8040 addiu gp,gp,-32704
00000008 <.*> 0399e021 addu gp,gp,t9
0000000c <.*> 14800004 bnez a0,00000020 <.*>
00000010 <.*> 00000000 nop
00000014 <.*> 8f818018 lw at,-32744\(gp\)
00000018 <.*> 24210034 addiu at,at,52
0000001c <.*> 00200008 jr at
00000020 <.*> 00000000 nop
00000024 <.*> 03e00008 jr ra
00000028 <.*> 00000000 nop
\.\.\.
00020030 <.*> 0000000c syscall
00020034 <.*> 03e00008 jr ra
00020038 <.*> 00000000 nop
\.\.\.