}
// Globals without external linkage apparently do not go in the symbol table.
if (!GV->hasLocalLinkage()) {
- MachOSym Sym(GV, Mang->getValueName(GV), Sec->Index, TAI);
+ MachOSym Sym(GV, Mang->getMangledName(GV), Sec->Index, TAI);
Sym.n_value = Sec->size();
SymbolTable.push_back(Sym);
}
// merged with other symbols.
if (NoInit || GV->hasLinkOnceLinkage() || GV->hasWeakLinkage() ||
GV->hasCommonLinkage()) {
- MachOSym ExtOrCommonSym(GV, Mang->getValueName(GV),
+ MachOSym ExtOrCommonSym(GV, Mang->getMangledName(GV),
MachOSym::NO_SECT, TAI);
// For undefined (N_UNDF) external (N_EXT) types, n_value is the size in
// bytes of the symbol.
for (std::vector<GlobalValue*>::iterator I = PendingGlobals.begin(),
E = PendingGlobals.end(); I != E; ++I) {
if (GVOffset[*I] == 0 && GVSection[*I] == 0) {
- MachOSym UndfSym(*I, Mang->getValueName(*I), MachOSym::NO_SECT, TAI);
+ MachOSym UndfSym(*I, Mang->getMangledName(*I), MachOSym::NO_SECT, TAI);
SymbolTable.push_back(UndfSym);
GVOffset[*I] = -1;
}
GV(gv), n_strx(0), n_type(sect == NO_SECT ? N_UNDF : N_SECT), n_sect(sect),
n_desc(0), n_value(0) {
+ // FIXME: This is completely broken, it should use the mangler interface.
switch (GV->getLinkage()) {
default:
llvm_unreachable("Unexpected linkage type!");
case GlobalValue::PrivateLinkage:
GVName = TAI->getPrivateGlobalPrefix() + name;
break;
+ case GlobalValue::LinkerPrivateLinkage:
+ GVName = TAI->getLinkerPrivateGlobalPrefix() + name;
+ break;
case GlobalValue::InternalLinkage:
GVName = TAI->getGlobalPrefix() + name;
break;
}
} // end namespace llvm
-