[clang] [llvm] [AIX][TOC] Add -mtocdata/-mno-tocdata options on AIX (PR #67999)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 2 11:58:40 PDT 2023
stephenpeckham wrote:
> What are the ABI implications here? Do all translation units have to agree on whether a variable is "tocdata"? The manual change hints there's some sort of linker fixup, but it's not clear to me how that works.
There are no ABI implications. Using -mtocdata removes a level of indirection, but you can mix tocdata and non-tocdata references to the same variable.
The -mtocdata option is intended for variables that are part of the current loadable object and not imported. If you specify --mtocdata for a symbol that is actually imported, the linker will generate extra code (called "fixup" code) to reference the variable. A warning is printed because fixup code is not great for performance
https://github.com/llvm/llvm-project/pull/67999
More information about the llvm-commits
mailing list