diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-03-11 18:22:51 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-03-11 18:22:51 +0000 |
commit | 8f0448cabcc37f3ecd7099c658346c0ece521e22 (patch) | |
tree | 45432033c42d5b0accd46d637819adb749575f58 /lib/MC/MCAssembler.cpp | |
parent | b0722af7985044696da45d29cc04d4b533f08c03 (diff) |
MC/Mach-O: Add MCSymbolData::getAddress() utility.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98266 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCAssembler.cpp')
-rw-r--r-- | lib/MC/MCAssembler.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp index 8d0075e93b..564111844c 100644 --- a/lib/MC/MCAssembler.cpp +++ b/lib/MC/MCAssembler.cpp @@ -400,7 +400,7 @@ public: if (Symbol.isAbsolute()) { llvm_unreachable("FIXME: Not yet implemented!"); } else { - Address = Data.getFragment()->getAddress() + Data.getOffset(); + Address = Data.getAddress(); } } else if (Data.isCommon()) { // Common symbols are encoded with the size in the address @@ -452,7 +452,7 @@ public: llvm_report_error("symbol '" + A->getName() + "' can not be undefined in a subtraction expression"); - uint32_t Value = A_SD->getFragment()->getAddress() + A_SD->getOffset(); + uint32_t Value = A_SD->getAddress(); uint32_t Value2 = 0; if (const MCSymbol *B = Target.getSymB()) { @@ -468,7 +468,7 @@ public: // relocation types from the linkers point of view, this is done solely // for pedantic compatibility with 'as'. Type = A_SD->isExternal() ? RIT_Difference : RIT_LocalDifference; - Value2 = B_SD->getFragment()->getAddress() + B_SD->getOffset(); + Value2 = B_SD->getAddress(); } // The value which goes in the fixup is current value of the expression. @@ -561,7 +561,7 @@ public: if (&*it == SD->getFragment()->getParent()) break; assert(it != ie && "Unable to find section index!"); - Value = SD->getFragment()->getAddress() + SD->getOffset(); + Value = SD->getAddress(); } Type = RIT_Vanilla; |