[llvm-dev] RFC: avoid relocations by using PC
Shawn Landden via llvm-dev
llvm-dev at lists.llvm.org
Sun Feb 24 09:14:22 PST 2019
When PIC code uses a string, this creates a relocation that slows down
program startup time. As long as the string is in the same compilation unit
as the PIC code this relocation is unnecessary, as the offset of the
compiled unit is stored in the program counter, and can be accessed by a
stored subtraction/addition. This would mean more instructions at the call
site, so the details I would image would require some careful coordination
between llvm and lld.
I have a bug for this: https://bugs.llvm.org/show_bug.cgi?id=39049
and would greatly appreciate feedback, and pointers on how to do this.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev