[llvm-commits] [llvm] r121034 - /llvm/trunk/lib/MC/MachObjectWriter.cpp
Rafael Espindola
rafael.espindola at gmail.com
Mon Dec 6 11:55:05 PST 2010
Author: rafael
Date: Mon Dec 6 13:55:05 2010
New Revision: 121034
URL: http://llvm.org/viewvc/llvm-project?rev=121034&view=rev
Log:
Another use of getSymbolOffset.
Modified:
llvm/trunk/lib/MC/MachObjectWriter.cpp
Modified: llvm/trunk/lib/MC/MachObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MachObjectWriter.cpp?rev=121034&r1=121033&r2=121034&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MachObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/MachObjectWriter.cpp Mon Dec 6 13:55:05 2010
@@ -536,10 +536,14 @@
if (A_Base == B_Base && A_Base)
report_fatal_error("unsupported relocation with identical base");
- Value += Layout.getSymbolAddress(&A_SD) -
- (A_Base == NULL ? 0 : Layout.getSymbolAddress(A_Base));
- Value -= Layout.getSymbolAddress(&B_SD) -
- (B_Base == NULL ? 0 : Layout.getSymbolAddress(B_Base));
+ assert((A_Base == NULL) == (B_Base == NULL));
+ assert(A_SD.getFragment()->getParent() ==
+ B_SD.getFragment()->getParent());
+
+ Value += Layout.getSymbolOffset(&A_SD) -
+ (A_Base == NULL ? 0 : Layout.getSymbolOffset(A_Base));
+ Value -= Layout.getSymbolOffset(&B_SD) -
+ (B_Base == NULL ? 0 : Layout.getSymbolOffset(B_Base));
if (A_Base) {
Index = A_Base->getIndex();
More information about the llvm-commits
mailing list