mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 00:20:25 +00:00
Add CommonLinkage; currently tentative definitions
are represented as "weak", but there are subtle differences in some cases on Darwin, so we need both. The intent is that "common" will behave identically to "weak" unless somebody changes their target to do something else. No functional change as yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51118 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -403,7 +403,8 @@ void MachOWriter::EmitGlobal(GlobalVariable *GV) {
|
||||
// If this global is part of the common block, add it now. Variables are
|
||||
// part of the common block if they are zero initialized and allowed to be
|
||||
// merged with other symbols.
|
||||
if (NoInit || GV->hasLinkOnceLinkage() || GV->hasWeakLinkage()) {
|
||||
if (NoInit || GV->hasLinkOnceLinkage() || GV->hasWeakLinkage() ||
|
||||
GV->hasCommonLinkage()) {
|
||||
MachOSym ExtOrCommonSym(GV, Mang->getValueName(GV), MachOSym::NO_SECT,TM);
|
||||
// For undefined (N_UNDF) external (N_EXT) types, n_value is the size in
|
||||
// bytes of the symbol.
|
||||
@@ -951,6 +952,7 @@ MachOSym::MachOSym(const GlobalValue *gv, std::string name, uint8_t sect,
|
||||
break;
|
||||
case GlobalValue::WeakLinkage:
|
||||
case GlobalValue::LinkOnceLinkage:
|
||||
case GlobalValue::CommonLinkage:
|
||||
assert(!isa<Function>(gv) && "Unexpected linkage type for Function!");
|
||||
case GlobalValue::ExternalLinkage:
|
||||
GVName = TAI->getGlobalPrefix() + name;
|
||||
|
||||
Reference in New Issue
Block a user