forked from OSchip/llvm-project
[JITLink][ELF/x86-64] When building PLT stub, use -4 offset for PCRel32.
This is required for ELF where PCRel32 doesn't implicitly subtract 4. No test case yet: I haven't figured out a good way to test stub generation -- this may required extensions to jitlink-check.
This commit is contained in:
parent
4a63e53373
commit
b3e0135a6f
|
@ -70,7 +70,7 @@ public:
|
||||||
G.createContentBlock(getStubsSection(), getStubBlockContent(), 0, 1, 0);
|
G.createContentBlock(getStubsSection(), getStubBlockContent(), 0, 1, 0);
|
||||||
// Re-use GOT entries for stub targets.
|
// Re-use GOT entries for stub targets.
|
||||||
auto &GOTEntrySymbol = getGOTEntrySymbol(Target);
|
auto &GOTEntrySymbol = getGOTEntrySymbol(Target);
|
||||||
StubContentBlock.addEdge(PCRel32, 2, GOTEntrySymbol, 0);
|
StubContentBlock.addEdge(PCRel32, 2, GOTEntrySymbol, -4);
|
||||||
return G.addAnonymousSymbol(StubContentBlock, 0, 6, true, false);
|
return G.addAnonymousSymbol(StubContentBlock, 0, 6, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue