[llvm] [AArch64, ELF] Allow implicit $d/$x at section beginning (PR #99718)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 9 11:06:23 PDT 2024


smithp35 wrote:

Morello definitely couldn't use this option https://github.com/ARM-software/abi-aa/blob/main/aaelf64-morello/aaelf64-morello.rst#mapping-symbols . Having said that Morello is not part of upstream LLVM and is an architecture experiment.

Yes I don't think there will be a single option that is going to work for everyone.
| option | impact |
|--------|---------|
| default | covers all cases but too many mapping symbols |
| omit leading $x, trailing $x if required | could cause $x and $d at same address, error in some tools. or be incorrect when a data section follows a code section with a trailing $x |
| omit leading $x, no trailing $x | incorrect when data is last in the section and code follows in next section. Will have double $x when combined with the default option. |
| imply $x from STT_FUNC, $d from STT_OBJECT | no guarantee that symbol is first, and user has typed symbol properly. |

On reflection I think putting the trailing $x in is probably the least worst optimised solution as I expect it is the least likely to cause problems.

Is there a strong objection to optimising this at link time? There would be some run-time overhead to scan for redundant $x and removing them, but this would always give the same answer as the current default.



https://github.com/llvm/llvm-project/pull/99718


More information about the llvm-commits mailing list