summaryrefslogtreecommitdiff
path: root/tools/llvm-mc
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-05-29 01:11:00 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-05-29 01:11:00 +0000
commitc615a826fd3586f83ef3d6f542b8e3a29432fcd3 (patch)
tree5767657482b195df2313afc1444adcbd4b8d0363 /tools/llvm-mc
parent50d2d2143ed2b16bba4056b604dd3ebc5ee378d2 (diff)
Move RelaxELFRel out to llvm-mc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271160 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-mc')
-rw-r--r--tools/llvm-mc/llvm-mc.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp
index d9e3798ee88..e25cfd4d5bf 100644
--- a/tools/llvm-mc/llvm-mc.cpp
+++ b/tools/llvm-mc/llvm-mc.cpp
@@ -52,6 +52,10 @@ OutputFilename("o", cl::desc("Output filename"),
static cl::opt<bool>
ShowEncoding("show-encoding", cl::desc("Show instruction encodings"));
+static cl::opt<bool>
+RelaxELFRel("relax-relocations", cl::init(false),
+ cl::desc("Emit R_X86_64_GOTPCRELX instead of R_X86_64_GOTPCREL"));
+
static cl::opt<DebugCompressionType>
CompressDebugSections("compress-debug-sections", cl::ValueOptional,
cl::init(DebugCompressionType::DCT_None),
@@ -416,6 +420,8 @@ int main(int argc, char **argv) {
std::unique_ptr<MCAsmInfo> MAI(TheTarget->createMCAsmInfo(*MRI, TripleName));
assert(MAI && "Unable to create target asm info!");
+ MAI->setRelaxELFRelocations(RelaxELFRel);
+
if (CompressDebugSections != DebugCompressionType::DCT_None) {
if (!zlib::isAvailable()) {
errs() << ProgName