PC-relative memory operand could reference a different object from
the one located at the target address, e.g. when a negative offset
is used. Check relocations for the real referenced object.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
bolt/lib/Core/BinaryFunction.cpp | ||
---|---|---|
1359 | I think I miss understand something. Why are we subtracting Addend from the Value of relocation? Isn't it S + A - P? |
bolt/lib/Core/BinaryFunction.cpp | ||
---|---|---|
1359 | Value is what the expression S + A - P evaluates to. |
bolt/lib/Core/BinaryFunction.cpp | ||
---|---|---|
1359 | Ah, had it backwards in my mind. |
bolt/lib/Core/BinaryFunction.cpp | ||
---|---|---|
1401 | Maybe move this code to smth like replaceMemOperandWithSymbolRef, that will use setOperandToSymbolRef ? |
bolt/lib/Core/BinaryFunction.cpp | ||
---|---|---|
1401 | That's a reasonable suggestion. However, I'm in the process of refactoring the code to use MCSymbolizer that will render such effort wasteful. The new code will not be replacing the operand but generating the expression in-place. |
I think I miss understand something. Why are we subtracting Addend from the Value of relocation? Isn't it S + A - P?
Presumably Relocation.Vaue is the address of the Symbol?