aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MCDwarf.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-12-06 15:35:15 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-12-06 15:35:15 +0000
commit6d86492f5ed0f9853ddd3b24e1aa037e305e1784 (patch)
tree12def9c2448271a475345dfc1e1ff0ecde8704c1 /lib/MC/MCDwarf.cpp
parent7c00391248a88c17d53af0ee65328bcf919abcbd (diff)
downloadexternal_llvm-6d86492f5ed0f9853ddd3b24e1aa037e305e1784.zip
external_llvm-6d86492f5ed0f9853ddd3b24e1aa037e305e1784.tar.gz
external_llvm-6d86492f5ed0f9853ddd3b24e1aa037e305e1784.tar.bz2
Revert previous two patches while I try to find out how to make both
linux and darwin assemblers happy :-( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121004 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCDwarf.cpp')
-rw-r--r--lib/MC/MCDwarf.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/MC/MCDwarf.cpp b/lib/MC/MCDwarf.cpp
index 5d36ee3..53731dc 100644
--- a/lib/MC/MCDwarf.cpp
+++ b/lib/MC/MCDwarf.cpp
@@ -213,8 +213,15 @@ void MCDwarfFileTable::Emit(MCStreamer *MCOS,
// The first 4 bytes is the total length of the information for this
// compilation unit (not including these 4 bytes for the length).
- MCOS->EmitAbsValue(MakeStartMinusEndExpr(MCOS, LineStartSym, LineEndSym,4),
- 4);
+ // FIXME: We create the dummy TotalLength variable because LineEndSym points
+ // to the end of the section and the darwin assembler doesn't consider that
+ // difference an assembly time constant. It might be better for this to be
+ // proected by a flag.
+ MCSymbol *TotalLength = MCOS->getContext().CreateTempSymbol();
+ MCOS->EmitAssignment(TotalLength,
+ MakeStartMinusEndExpr(MCOS, LineStartSym, LineEndSym,
+ 4));
+ MCOS->EmitSymbolValue(TotalLength, 4, 0);
// Next 2 bytes is the Version, which is Dwarf 2.
MCOS->EmitIntValue(2, 2);