Skip to content

Commit

Permalink
[RuntimeDyld] RuntimeDyldELF: Clear GOTOffsetMap when resetting GOT s…
Browse files Browse the repository at this point in the history
…ection.

When the GOT section ID is reset, the GOTOffsetMap must also be cleared,
otherwise spurious matches can be located when handling GOT relocations
in subsequently-linked objects.

Fixes Issue #61402 - see #61402.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D146938
  • Loading branch information
gmarkall authored and lhames committed Apr 3, 2023
1 parent 398effa commit 2e1b838
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2406,6 +2406,7 @@ Error RuntimeDyldELF::finalizeLoad(const ObjectFile &Obj,
}
}

GOTOffsetMap.clear();
GOTSectionID = 0;
CurrentGOTIndex = 0;

Expand Down

0 comments on commit 2e1b838

Please sign in to comment.