summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2010-06-16 21:32:38 +0000
committerEric Christopher <echristo@apple.com>2010-06-16 21:32:38 +0000
commitbc06737c355f7206beecf5c7c0fb0d818c1297a4 (patch)
treee3259561fb9acf652a3a673ef35dcd72729ce26f /lib
parentc66d0f2a9386cc7cb3237b8e3cace2b62a9c7dc8 (diff)
downloadllvm-bc06737c355f7206beecf5c7c0fb0d818c1297a4.tar.gz
llvm-bc06737c355f7206beecf5c7c0fb0d818c1297a4.tar.bz2
llvm-bc06737c355f7206beecf5c7c0fb0d818c1297a4.tar.xz
In progress on 32-bit addends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106154 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/MC/MachObjectWriter.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/MC/MachObjectWriter.cpp b/lib/MC/MachObjectWriter.cpp
index 7be7af21b3..347615011a 100644
--- a/lib/MC/MachObjectWriter.cpp
+++ b/lib/MC/MachObjectWriter.cpp
@@ -756,8 +756,14 @@ public:
MCSymbolData *SD_A = &Asm.getSymbolData(Target.getSymA()->getSymbol());
unsigned Index = SD_A->getIndex();
- if (Target.getSymB())
+ // We're only going to have a second symbol in pic mode and it'll be a
+ // subtraction from the picbase. For 32-bit pic the addend is the difference
+ // between the picbase and the next address.
+ if (Target.getSymB()) {
IsPCRel = 1;
+ } else {
+ FixedValue = 0;
+ }
// struct relocation_info (8 bytes)
MachRelocationEntry MRE;