mirror of
https://github.com/bminor/binutils-gdb.git
synced 2026-02-04 19:21:30 +00:00
The aarch64 ABI states that long branch veneers may be added to facilitate linking code that is beyond the range of a 26-bit call or branch; but it requires that the target symbol be a function symbol. Ensure that this latter condition is maintained by rejecting relaxation of a static function symbol to it's section symbol. Note that there should probably be a fix to the linker to enforce this during link time. I've not done this for now because that might break some existing object code that has been built with older versions of gas. At some point we should revisit this. This change also causes a small change in the LD testsuite: instead of generating some veneers with the section name we now (correctly) generate them using the name of the called function.
37 lines
785 B
Makefile
37 lines
785 B
Makefile
#name: aarch64-farcall-bl-section
|
|
#source: farcall-bl-section.s
|
|
#as:
|
|
#ld: -Ttext 0x1000 --section-start .foo=0x8001000
|
|
#objdump: -dr
|
|
#...
|
|
|
|
Disassembly of section .text:
|
|
|
|
.* <_start>:
|
|
1000: 94000006 bl 1018 <__bar_veneer>
|
|
1004: 94000009 bl 1028 <__bar2_veneer>
|
|
1008: d65f03c0 ret
|
|
100c: d503201f nop
|
|
1010: 1400000e b 1048 <__bar2_veneer\+0x20>
|
|
1014: d503201f nop
|
|
|
|
.* <__bar_veneer>:
|
|
1018: 90040010 adrp x16, 8001000 <bar>
|
|
101c: 91000210 add x16, x16, #0x0
|
|
1020: d61f0200 br x16
|
|
1024: 00000000 udf #0
|
|
|
|
.* <__bar2_veneer>:
|
|
1028: 90040010 adrp x16, 8001000 <bar>
|
|
102c: 91001210 add x16, x16, #0x4
|
|
1030: d61f0200 br x16
|
|
...
|
|
|
|
Disassembly of section .foo:
|
|
|
|
.* <bar>:
|
|
8001000: d65f03c0 ret
|
|
|
|
.* <bar2>:
|
|
8001004: d65f03c0 ret
|