[llvm-commits] [llvm] r120854 - /llvm/trunk/lib/MC/MCDwarf.cpp
Rafael Espindola
rafael.espindola at gmail.com
Fri Dec 3 15:36:59 PST 2010
Author: rafael
Date: Fri Dec 3 17:36:59 2010
New Revision: 120854
URL: http://llvm.org/viewvc/llvm-project?rev=120854&view=rev
Log:
First step in fixing MC. Make it clear that we are avoiding a bug in the
darwin9 linker, what is needed to avoid it and where to get more information.
Also make the workaround simpler. Just the regular end_sequence we normally
create is more than 4 bytes.
Tested by building cctools and ld64 from darwin9 on a darwin10 system and using
those. I checked that I was able to reproduce the bootstrap failure when
the the workaround was disabled.
Modified:
llvm/trunk/lib/MC/MCDwarf.cpp
Modified: llvm/trunk/lib/MC/MCDwarf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=120854&r1=120853&r2=120854&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCDwarf.cpp (original)
+++ llvm/trunk/lib/MC/MCDwarf.cpp Fri Dec 3 17:36:59 2010
@@ -297,17 +297,14 @@
}
if (TextSection && MCLineSectionOrder.begin() == MCLineSectionOrder.end()) {
- // Emit dummy entry if line table is empty.
+ // The darwin9 linker has a bug (see PR8715). For for 32-bit architectures
+ // it requires:
+ // total_length >= prologue_length + 10
+ // We are 4 bytes short, since we have total_length = 51 and
+ // prologue_length = 45
- MCOS->SwitchSection(TextSection);
- MCSymbol *SectionEnd = MCOS->getContext().CreateTempSymbol();
- // Set the value of the symbol, as we are at the end of the section.
- MCOS->EmitLabel(SectionEnd);
-
- // Switch back the the dwarf line section.
- MCOS->SwitchSection(DwarfLineSection);
-
- MCOS->EmitDwarfAdvanceLineAddr(INT64_MAX, NULL, SectionEnd);
+ // The regular end_sequence should be sufficient.
+ MCDwarfLineAddr::Emit(MCOS, INT64_MAX, 0);
}
// This is the end of the section, so set the value of the symbol at the end
More information about the llvm-commits
mailing list