mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-18 12:29:27 +00:00
Make LTO expect common and weak to be represented differently.
Reading .bc files from before that change will no longer work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51457 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
31e5bdccf2
commit
ed1ec3aa6b
@ -191,17 +191,7 @@ void LTOModule::addDefinedSymbol(GlobalValue* def, Mangler &mangler,
|
|||||||
|
|
||||||
// set definition part
|
// set definition part
|
||||||
if ( def->hasWeakLinkage() || def->hasLinkOnceLinkage() ) {
|
if ( def->hasWeakLinkage() || def->hasLinkOnceLinkage() ) {
|
||||||
// lvm bitcode does not differenciate between weak def data
|
attr |= LTO_SYMBOL_DEFINITION_WEAK;
|
||||||
// and tentative definitions!
|
|
||||||
// HACK HACK HACK
|
|
||||||
// C++ does not use tentative definitions, but does use weak symbols
|
|
||||||
// so guess that anything that looks like a C++ symbol is weak and others
|
|
||||||
// are tentative definitions
|
|
||||||
if ( (strncmp(symbolName, "__Z", 3) == 0) )
|
|
||||||
attr |= LTO_SYMBOL_DEFINITION_WEAK;
|
|
||||||
else {
|
|
||||||
attr |= LTO_SYMBOL_DEFINITION_TENTATIVE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if ( def->hasCommonLinkage()) {
|
else if ( def->hasCommonLinkage()) {
|
||||||
attr |= LTO_SYMBOL_DEFINITION_TENTATIVE;
|
attr |= LTO_SYMBOL_DEFINITION_TENTATIVE;
|
||||||
|
Loading…
Reference in New Issue
Block a user