mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-29 10:32:47 +00:00
Defined weak symbols should have non-zero value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117585 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9f36e7389f
commit
1973d43792
@ -438,10 +438,9 @@ static uint64_t SymbolValue(MCSymbolData &Data, const MCAsmLayout &Layout) {
|
|||||||
if (!Symbol.isInSection())
|
if (!Symbol.isInSection())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!Data.isCommon() && !(Data.getFlags() & ELF_STB_Weak))
|
if (MCFragment *FF = Data.getFragment())
|
||||||
if (MCFragment *FF = Data.getFragment())
|
return Layout.getSymbolAddress(&Data) -
|
||||||
return Layout.getSymbolAddress(&Data) -
|
Layout.getSectionAddress(FF->getParent());
|
||||||
Layout.getSectionAddress(FF->getParent());
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
.weak foo
|
.weak foo
|
||||||
.long foo
|
.long foo
|
||||||
|
|
||||||
// And that bar is after all local symbols
|
// And that bar is after all local symbols and has non zero value.
|
||||||
.weak bar
|
.weak bar
|
||||||
bar:
|
bar:
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ bar:
|
|||||||
//CHECK-NEXT: ('st_type', 0x00000000)
|
//CHECK-NEXT: ('st_type', 0x00000000)
|
||||||
//CHECK-NEXT: ('st_other', 0x00000000)
|
//CHECK-NEXT: ('st_other', 0x00000000)
|
||||||
//CHECK-NEXT: ('st_shndx', 0x00000001)
|
//CHECK-NEXT: ('st_shndx', 0x00000001)
|
||||||
//CHECK-NEXT: ('st_value', 0x00000000)
|
//CHECK-NEXT: ('st_value', 0x00000004)
|
||||||
//CHECK-NEXT: ('st_size', 0x00000000)
|
//CHECK-NEXT: ('st_size', 0x00000000)
|
||||||
//CHECK-NEXT: ),
|
//CHECK-NEXT: ),
|
||||||
//CHECK-NEXT: # Symbol 0x00000005
|
//CHECK-NEXT: # Symbol 0x00000005
|
||||||
|
Loading…
Reference in New Issue
Block a user