mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
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:
+6
-4
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user