[PATCH] D109183: [asan] Fixed link error by setting jump symbol to R_X86_64_PLT32.
Kirill Stoimenov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 2 12:28:38 PDT 2021
kstoimenov created this revision.
kstoimenov added a reviewer: vitalybuka.
Herald added subscribers: pengfei, hiraditya.
kstoimenov requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Fixing this link error:
ld: error: relocation R_X86_64_PC32 cannot be used against symbol __asan_report_load...; recompile with -fPIC
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D109183
Files:
llvm/lib/Target/X86/X86MCInstLower.cpp
Index: llvm/lib/Target/X86/X86MCInstLower.cpp
===================================================================
--- llvm/lib/Target/X86/X86MCInstLower.cpp
+++ llvm/lib/Target/X86/X86MCInstLower.cpp
@@ -1526,7 +1526,8 @@
STI);
OutStreamer->emitInstruction(
MCInstBuilder(X86::JMP_1)
- .addExpr(MCSymbolRefExpr::create(ReportError, OutContext)),
+ .addExpr(MCSymbolRefExpr::create(ReportError, MCSymbolRefExpr::VK_PLT,
+ OutContext)),
STI);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109183.370363.patch
Type: text/x-patch
Size: 555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210902/c64274d3/attachment.bin>
More information about the llvm-commits
mailing list