mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-30 05:24:22 +00:00
Fixed debug_aranges handling for common symbols.
The size of common symbols is now tracked correctly, so they can be listed in the arange section without needing knowledge of other following symbols. .comm (and .lcomm) do not indicate to the system assembler any particular section to use, so we have to treat them as having no section. Test case update to account for this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191210 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -2838,12 +2838,17 @@ void DwarfDebug::emitDebugARanges() {
|
||||
Asm->EmitLabelReference(Span.Start, PtrSize);
|
||||
|
||||
// Calculate the size as being from the span start to it's end.
|
||||
// If we have no valid end symbol, then we just cover the first byte.
|
||||
// (this sucks, but I can't seem to figure out how to get the size)
|
||||
if (Span.End)
|
||||
if (Span.End) {
|
||||
Asm->EmitLabelDifference(Span.End, Span.Start, PtrSize);
|
||||
else
|
||||
Asm->OutStreamer.EmitIntValue(1, PtrSize);
|
||||
} else {
|
||||
// For symbols without an end marker (e.g. common), we
|
||||
// write a single arange entry containing just that one symbol.
|
||||
uint64_t Size = SymSize[Span.Start];
|
||||
if (Size == 0)
|
||||
Size = 1;
|
||||
|
||||
Asm->OutStreamer.EmitIntValue(Size, PtrSize);
|
||||
}
|
||||
}
|
||||
|
||||
Asm->OutStreamer.AddComment("ARange terminator");
|
||||
|
Reference in New Issue
Block a user