mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
Correctly compute the size of common symbols in COFF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219324 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c5dc4aa8ad
commit
8e5fbd755f
@ -222,12 +222,17 @@ std::error_code COFFObjectFile::getSymbolSize(DataRefImpl Ref,
|
||||
if (std::error_code EC = getSection(Symb.getSectionNumber(), Section))
|
||||
return EC;
|
||||
|
||||
if (Symb.getSectionNumber() == COFF::IMAGE_SYM_UNDEFINED)
|
||||
Result = UnknownAddressOrSize;
|
||||
else if (Section)
|
||||
if (Symb.getSectionNumber() == COFF::IMAGE_SYM_UNDEFINED) {
|
||||
if (Symb.getValue() == 0)
|
||||
Result = UnknownAddressOrSize;
|
||||
else
|
||||
Result = Symb.getValue();
|
||||
} else if (Section) {
|
||||
Result = Section->SizeOfRawData - Symb.getValue();
|
||||
else
|
||||
} else {
|
||||
Result = 0;
|
||||
}
|
||||
|
||||
return object_error::success;
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ COFF-COMMON-NEXT: 00000000 00000014 d .drectve
|
||||
COFF-COMMON-NEXT: 00000000 00000000 n .file
|
||||
COFF-COMMON-NEXT: 00000000 00000014 r .rdata$zzz
|
||||
COFF-COMMON-NEXT: 00000000 00000000 t .text
|
||||
COFF-COMMON-NEXT: C _a
|
||||
COFF-COMMON-NEXT: 00000004 C _a
|
||||
|
||||
|
||||
ELF-NOT: U
|
||||
|
Loading…
x
Reference in New Issue
Block a user