Downgrade DWARF2 section limit error to a warning

We currently emit an error when trying to assemble a file with more
than one section using DWARF2 debug info. This should be a warning
instead, as the resulting file will still be usable, but with a
degraded debug illusion.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218241 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Oliver Stannard
2014-09-22 10:45:16 +00:00
parent 1e165a0d5e
commit 98ef3474ef
4 changed files with 75 additions and 7 deletions
+6 -4
View File
@@ -536,7 +536,8 @@ static void EmitGenDwarfAbbrev(MCStreamer *MCOS) {
MCOS->EmitULEB128IntValue(dwarf::DW_TAG_compile_unit);
MCOS->EmitIntValue(dwarf::DW_CHILDREN_yes, 1);
EmitAbbrev(MCOS, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4);
if (MCOS->getContext().getGenDwarfSectionSyms().size() > 1) {
if (MCOS->getContext().getGenDwarfSectionSyms().size() > 1 &&
MCOS->getContext().getDwarfVersion() >= 3) {
EmitAbbrev(MCOS, dwarf::DW_AT_ranges, dwarf::DW_FORM_data4);
} else {
EmitAbbrev(MCOS, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr);
@@ -873,10 +874,11 @@ void MCGenDwarfInfo::Emit(MCStreamer *MCOS) {
if (MCOS->getContext().getGenDwarfSectionSyms().empty())
return;
// We only need to use the .debug_ranges section if we have multiple
// code sections.
// We only use the .debug_ranges section if we have multiple code sections,
// and we are emitting a DWARF version which supports it.
const bool UseRangesSection =
MCOS->getContext().getGenDwarfSectionSyms().size() > 1;
MCOS->getContext().getGenDwarfSectionSyms().size() > 1 &&
MCOS->getContext().getDwarfVersion() >= 3;
CreateDwarfSectionSymbols |= UseRangesSection;
MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection());