binutils-gdb/ld/testsuite/ld-arm/ifunc-6.dd
Tamar Christina b4e87f2c1e Arm: Fix performance issue with thumb-2 tailcalls
We currently use a padding NOP after a Thumb to Arm interworking veneer (BX pc).
The NOP is never executed but may result in a performance penalty on some cores.

For this reason this patch changes the NOPs after Thumb to Arm veneers into B .-2
and adds a note to this in the source code for future reference.

bfd/ChangeLog:

	* elf32-arm.c (elf32_thumb2_plt_entry, elf32_arm_plt_thumb_stub,
	elf32_arm_stub_long_branch_v4t_thumb_thumb,
	elf32_arm_stub_long_branch_v4t_thumb_arm,
	elf32_arm_stub_short_branch_v4t_thumb_arm,
	elf32_arm_stub_long_branch_v4t_thumb_arm_pic,
	elf32_arm_stub_long_branch_v4t_thumb_thumb_pic,
	elf32_arm_stub_long_branch_v4t_thumb_tls_pic): Change nop to branch to
	previous instruction.

ld/ChangeLog:

	* testsuite/ld-arm/cortex-a8-fix-b-plt.d: Update Testcase.
	* testsuite/ld-arm/cortex-a8-fix-b-rel-arm.d: Likewise.
	* testsuite/ld-arm/cortex-a8-fix-bcc-plt.d: Likewise.
	* testsuite/ld-arm/farcall-cond-thumb-arm.d: Likewise.
	* testsuite/ld-arm/farcall-mixed-app.d: Likewise.
	* testsuite/ld-arm/farcall-mixed-app2.d: Likewise.
	* testsuite/ld-arm/farcall-mixed-lib-v4t.d: Likewise.
	* testsuite/ld-arm/farcall-thumb-arm-pic-veneer.d: Likewise.
	* testsuite/ld-arm/farcall-thumb-arm-short.d: Likewise.
	* testsuite/ld-arm/farcall-thumb-arm.d: Likewise.
	* testsuite/ld-arm/farcall-thumb-thumb-pic-veneer.d: Likewise.
	* testsuite/ld-arm/farcall-thumb-thumb.d: Likewise.
	* testsuite/ld-arm/fix-arm1176-on.d: Likewise.
	* testsuite/ld-arm/ifunc-10.dd: Likewise.
	* testsuite/ld-arm/ifunc-2.dd: Likewise.
	* testsuite/ld-arm/ifunc-4.dd: Likewise.
	* testsuite/ld-arm/ifunc-6.dd: Likewise.
	* testsuite/ld-arm/ifunc-8.dd: Likewise.
	* testsuite/ld-arm/jump-reloc-veneers-long.d: Likewise.
	* testsuite/ld-arm/mixed-app.d: Likewise.
	* testsuite/ld-arm/thumb2-b-interwork.d: Likewise.
	* testsuite/ld-arm/tls-longplt.d: Likewise.
	* testsuite/ld-arm/tls-thumb1.d: Likewise.
2019-08-20 16:35:28 +01:00

176 lines
8.7 KiB
Plaintext

.*
Disassembly of section \.iplt:
00009000 <\.iplt>:
#------------------------------------------------------------------------------
#------ thumb entry to f3's .iplt entry
#------------------------------------------------------------------------------
9000: 4778 bx pc
9002: e7fd b.n .+ <.+>
#------------------------------------------------------------------------------
#------ f3's .iplt entry
#------------------------------------------------------------------------------
9004: e28fc600 add ip, pc, #0, 12
9008: e28cca08 add ip, ip, #8, 20 ; 0x8000
900c: e5bcf000 ldr pc, \[ip, #0\]!
#------------------------------------------------------------------------------
#------ f2's .iplt entry
#------------------------------------------------------------------------------
9010: e28fc600 add ip, pc, #0, 12
9014: e28cca07 add ip, ip, #28672 ; 0x7000
9018: e5bcfff8 ldr pc, \[ip, #4088\]! ; 0xff8
#------------------------------------------------------------------------------
#------ thumb entry to f4's .iplt entry
#------------------------------------------------------------------------------
901c: 4778 bx pc
901e: e7fd b.n .+ <.+>
#------------------------------------------------------------------------------
#------ f4's .iplt entry
#------------------------------------------------------------------------------
9020: e28fc600 add ip, pc, #0, 12
9024: e28cca07 add ip, ip, #28672 ; 0x7000
9028: e5bcffec ldr pc, \[ip, #4076\]! ; 0xfec
#------------------------------------------------------------------------------
#------ f1's .iplt entry
#------------------------------------------------------------------------------
902c: e28fc600 add ip, pc, #0, 12
9030: e28cca07 add ip, ip, #28672 ; 0x7000
9034: e5bcffe4 ldr pc, \[ip, #4068\]! ; 0xfe4
Disassembly of section \.text:
0000a000 <f1>:
a000: e1a0f00e mov pc, lr
0000a004 <f2>:
a004: 46f7 mov pc, lr
\.\.\.
0000a008 <f3>:
a008: e1a0f00e mov pc, lr
0000a00c <f4>:
a00c: 46f7 mov pc, lr
\.\.\.
0000a010 <_start>:
a010: eb0017fa bl 10000 <foo>
a014: ea0017f9 b 10000 <foo>
a018: 0a0017f8 beq 10000 <foo>
a01c: e59f4000 ldr r4, \[pc\] ; a024 <_start\+0x14>
a020: e59f4000 ldr r4, \[pc\] ; a028 <_start\+0x18>
#------------------------------------------------------------------------------
#------ .got offset for foo
#------------------------------------------------------------------------------
a024: 00000020 \.word 0x00000020
#------------------------------------------------------------------------------
#------ PC-relative offset of .got entry for foo
#------------------------------------------------------------------------------
a028: 00006ff4 \.word 0x00006ff4
#------------------------------------------------------------------------------
#------ f1's .iplt entry
#------------------------------------------------------------------------------
a02c: ebfffbfe bl 902c <__irel_end\+0x100c>
#------------------------------------------------------------------------------
#------ f1's .iplt entry
#------------------------------------------------------------------------------
a030: eafffbfd b 902c <__irel_end\+0x100c>
#------------------------------------------------------------------------------
#------ f1's .iplt entry
#------------------------------------------------------------------------------
a034: 0afffbfc beq 902c <__irel_end\+0x100c>
a038: e59f4000 ldr r4, \[pc\] ; a040 <_start\+0x30>
a03c: e59f4000 ldr r4, \[pc\] ; a044 <_start\+0x34>
#------------------------------------------------------------------------------
#------ GP-relative offset of f1's .igot.plt entry
#------------------------------------------------------------------------------
a040: 00000018 \.word 0x00000018
#------------------------------------------------------------------------------
#------ PC-relative offset of f1's .igot.plt entry
#------------------------------------------------------------------------------
a044: 00006fd4 \.word 0x00006fd4
#------------------------------------------------------------------------------
#------ f2's .iplt entry
#------------------------------------------------------------------------------
a048: ebfffbf0 bl 9010 <__irel_end\+0xff0>
#------------------------------------------------------------------------------
#------ f2's .iplt entry
#------------------------------------------------------------------------------
a04c: eafffbef b 9010 <__irel_end\+0xff0>
#------------------------------------------------------------------------------
#------ f2's .iplt entry
#------------------------------------------------------------------------------
a050: 0afffbee beq 9010 <__irel_end\+0xff0>
a054: e59f4000 ldr r4, \[pc\] ; a05c <_start\+0x4c>
a058: e59f4000 ldr r4, \[pc\] ; a060 <_start\+0x50>
#------------------------------------------------------------------------------
#------ GP-relative offset of f2's .igot.plt entry
#------------------------------------------------------------------------------
a05c: 00000010 \.word 0x00000010
#------------------------------------------------------------------------------
#------ PC-relative offset of f2's .igot.plt entry
#------------------------------------------------------------------------------
a060: 00006fb0 \.word 0x00006fb0
0000a064 <_thumb>:
a064: f005 ffcc bl 10000 <foo>
a068: f005 bfca b\.w 10000 <foo>
a06c: f005 87c8 beq\.w 10000 <foo>
a070: 4c00 ldr r4, \[pc, #0\] ; \(a074 <_thumb\+0x10>\)
a072: 4c01 ldr r4, \[pc, #4\] ; \(a078 <_thumb\+0x14>\)
#------------------------------------------------------------------------------
#------ .got offset for foo
#------------------------------------------------------------------------------
a074: 00000020 \.word 0x00000020
#------------------------------------------------------------------------------
#------ PC-relative offset of .got entry for foo
#------------------------------------------------------------------------------
a078: 00006fa4 \.word 0x00006fa4
#------------------------------------------------------------------------------
#------ f3's .iplt entry
#------------------------------------------------------------------------------
a07c: f7fe efc2 blx 9004 <__irel_end\+0xfe4>
#------------------------------------------------------------------------------
#------ thumb entry to f3's .iplt entry
#------------------------------------------------------------------------------
a080: f7fe bfbe b\.w 9000 <__irel_end\+0xfe0>
#------------------------------------------------------------------------------
#------ thumb entry to f3's .iplt entry
#------------------------------------------------------------------------------
a084: f43e afbc beq\.w 9000 <__irel_end\+0xfe0>
a088: 4c00 ldr r4, \[pc, #0\] ; \(a08c <_thumb\+0x28>\)
a08a: 4c01 ldr r4, \[pc, #4\] ; \(a090 <_thumb\+0x2c>\)
#------------------------------------------------------------------------------
#------ GP-relative offset of f3's .igot.plt entry
#------------------------------------------------------------------------------
a08c: 0000000c \.word 0x0000000c
#------------------------------------------------------------------------------
#------ PC-relative offset of f3's .igot.plt entry
#------------------------------------------------------------------------------
a090: 00006f7c \.word 0x00006f7c
#------------------------------------------------------------------------------
#------ f4's .iplt entry
#------------------------------------------------------------------------------
a094: f7fe efc4 blx 9020 <__irel_end\+0x1000>
#------------------------------------------------------------------------------
#------ thumb entry to f4's .iplt entry
#------------------------------------------------------------------------------
a098: f7fe bfc0 b\.w 901c <__irel_end\+0xffc>
#------------------------------------------------------------------------------
#------ thumb entry to f4's .iplt entry
#------------------------------------------------------------------------------
a09c: f43e afbe beq\.w 901c <__irel_end\+0xffc>
a0a0: 4c00 ldr r4, \[pc, #0\] ; \(a0a4 <_thumb\+0x40>\)
a0a2: 4c01 ldr r4, \[pc, #4\] ; \(a0a8 <_thumb\+0x44>\)
#------------------------------------------------------------------------------
#------ GP-relative offset of f4's .igot.plt entry
#------------------------------------------------------------------------------
a0a4: 00000014 \.word 0x00000014
#------------------------------------------------------------------------------
#------ PC-relative offset of f4's .igot.plt entry
#------------------------------------------------------------------------------
a0a8: 00006f6c \.word 0x00006f6c