When the instrumented binary is linked as PIE, we need to apply the
relative relocations to sleds. This is handled by the dynamic linker
at runtime, but when processing the file we have to do it ourselves.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
llvm/lib/XRay/InstrumentationMap.cpp | ||
---|---|---|
90 | Section.relocations() applies on either SHT_REL or SHT_RELA. I think the code can be applied on just SHT_RELA. if (Section.isBSS() || Section.isVirtual()) is not necessary. |
llvm/lib/XRay/InstrumentationMap.cpp | ||
---|---|---|
97 | The code only works on x86_64 and ppc64le. So the relative relocations can just be enumerated here. |
llvm/lib/XRay/InstrumentationMap.cpp | ||
---|---|---|
97 | Please explicitly check for the relocation types you care about. They are not the only relocations you can find in a PIE binary, even with static linking. |
llvm/lib/XRay/InstrumentationMap.cpp | ||
---|---|---|
105 | It can be simplified with |
Section.relocations() applies on either SHT_REL or SHT_RELA. I think the code can be applied on just SHT_RELA.
if (Section.isBSS() || Section.isVirtual()) is not necessary.