diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-03-29 23:56:40 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-03-29 23:56:40 +0000 |
commit | c95156262d6f5da3cdfaa8e062c3893d53d5cf44 (patch) | |
tree | 6fa9a02f27394304092157bc937d6aa40cf4aa60 /llvm/lib/MC/MachObjectWriter.cpp | |
parent | b2799edaf61c678bcef7373bdb9b7cd31db67269 (diff) | |
download | bcm5719-llvm-c95156262d6f5da3cdfaa8e062c3893d53d5cf44.tar.gz bcm5719-llvm-c95156262d6f5da3cdfaa8e062c3893d53d5cf44.zip |
MC/Mach-O/x86_64: Support @GOTPCREL on symbols, even for non-PCrel relocations!
llvm-svn: 99853
Diffstat (limited to 'llvm/lib/MC/MachObjectWriter.cpp')
-rw-r--r-- | llvm/lib/MC/MachObjectWriter.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp index 194be6e4713..e073eb5a0d4 100644 --- a/llvm/lib/MC/MachObjectWriter.cpp +++ b/llvm/lib/MC/MachObjectWriter.cpp @@ -612,9 +612,16 @@ public: } } } else { - if (Modifier == MCSymbolRefExpr::VK_GOT) + if (Modifier == MCSymbolRefExpr::VK_GOT) { Type = RIT_X86_64_GOT; - else if (Modifier != MCSymbolRefExpr::VK_None) + } else if (Modifier == MCSymbolRefExpr::VK_GOTPCREL) { + // GOTPCREL is allowed as a modifier on non-PCrel instructions, in + // which case all we do is set the PCrel bit in the relocation entry; + // this is used with exception handling, for example. The source is + // required to include any necessary offset directly. + Type = RIT_X86_64_GOT; + IsPCRel = 1; + } else if (Modifier != MCSymbolRefExpr::VK_None) llvm_report_error("unsupported symbol modifier in relocation"); else Type = RIT_X86_64_Unsigned; |