Skip to content

Commit f687378

Browse files
committed
[RuntimeDyld] Implemented relocation for ELF::R_X86_64_GOTPC32
Differential Revision: https://reviews.llvm.org/D95512
1 parent 6c1ac14 commit f687378

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1813,10 +1813,13 @@ RuntimeDyldELF::processRelocationRef(
18131813
addRelocationForSymbol(RE, Value.SymbolName);
18141814
else
18151815
addRelocationForSection(RE, Value.SectionID);
1816-
} else if (RelType == ELF::R_X86_64_GOTPC64) {
1816+
} else if (RelType == ELF::R_X86_64_GOTPC32) {
18171817
// Materialize the address of the base of the GOT relative to the PC.
18181818
// This doesn't create a GOT entry, but it does mean we need a GOT
18191819
// section.
1820+
(void)allocateGOTEntries(0);
1821+
resolveGOTOffsetRelocation(SectionID, Offset, Addend, ELF::R_X86_64_PC32);
1822+
} else if (RelType == ELF::R_X86_64_GOTPC64) {
18201823
(void)allocateGOTEntries(0);
18211824
resolveGOTOffsetRelocation(SectionID, Offset, Addend, ELF::R_X86_64_PC64);
18221825
} else if (RelType == ELF::R_X86_64_GOTOFF64) {

0 commit comments

Comments
 (0)