MSYS2-packages/clang/0007-getLoadAddressWithOffset-assertion.patch
2020-12-10 21:53:30 +01:00

46 lines
2.4 KiB
Diff

Index: lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFI386.h
===================================================================
--- a/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFI386.h (revision 283036)
+++ b/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFI386.h (working copy)
@@ -142,8 +142,7 @@
uint64_t Result =
RE.Sections.SectionA == static_cast<uint32_t>(-1)
? Value
- : Sections[RE.Sections.SectionA].getLoadAddressWithOffset(
- RE.Addend);
+ : Sections[RE.Sections.SectionA].getLoadAddress() + RE.Addend;
assert(Result <= UINT32_MAX && "relocation overflow");
DEBUG(dbgs() << "\t\tOffset: " << RE.Offset
<< " RelType: IMAGE_REL_I386_DIR32"
@@ -159,7 +158,7 @@
// The target's 32-bit RVA.
// NOTE: use Section[0].getLoadAddress() as an approximation of ImageBase
uint64_t Result =
- Sections[RE.Sections.SectionA].getLoadAddressWithOffset(RE.Addend) -
+ Sections[RE.Sections.SectionA].getLoadAddress() + RE.Addend -
Sections[0].getLoadAddress();
assert(static_cast<int32_t>(Result) <= INT32_MAX &&
"relocation overflow");
Index: lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFThumb.h
===================================================================
--- a/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFThumb.h (revision 283036)
+++ b/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFThumb.h (working copy)
@@ -184,7 +184,7 @@
uint64_t Result =
RE.Sections.SectionA == static_cast<uint32_t>(-1)
? Value
- : Sections[RE.Sections.SectionA].getLoadAddressWithOffset(RE.Addend);
+ : Sections[RE.Sections.SectionA].getLoadAddress() + RE.Addend;
Result |= ISASelectionBit;
assert(Result <= UINT32_MAX && "relocation overflow");
DEBUG(dbgs() << "\t\tOffset: " << RE.Offset
@@ -229,7 +229,7 @@
case COFF::IMAGE_REL_ARM_MOV32T: {
// 32-bit VA of the target applied to a contiguous MOVW+MOVT pair.
uint64_t Result =
- Sections[RE.Sections.SectionA].getLoadAddressWithOffset(RE.Addend);
+ Sections[RE.Sections.SectionA].getLoadAddress() + RE.Addend;
assert(Result <= UINT32_MAX && "relocation overflow");
DEBUG(dbgs() << "\t\tOffset: " << RE.Offset
<< " RelType: IMAGE_REL_ARM_MOV32T"