mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
Use proper section suffix for COFF weak symbols
32-bit symbols have "_" as global prefix, but when forming the name of COMDAT sections this prefix is ignored. The current behavior assumes that this prefix is always present which is not the case for 64-bit and names are truncated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187356 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -726,9 +726,8 @@ getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
|
||||
if (GV->isWeakForLinker()) {
|
||||
Selection = COFF::IMAGE_COMDAT_SELECT_ANY;
|
||||
Characteristics |= COFF::IMAGE_SCN_LNK_COMDAT;
|
||||
MCSymbol *Sym = Mang->getSymbol(GV);
|
||||
Name.append("$");
|
||||
Name.append(Sym->getName().begin() + 1, Sym->getName().end());
|
||||
Mang->getNameWithPrefix(Name, GV, false, false);
|
||||
}
|
||||
return getContext().getCOFFSection(Name,
|
||||
Characteristics,
|
||||
@ -761,8 +760,7 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
|
||||
if (GV->isWeakForLinker()) {
|
||||
const char *Prefix = getCOFFSectionPrefixForUniqueGlobal(Kind);
|
||||
SmallString<128> Name(Prefix, Prefix+strlen(Prefix));
|
||||
MCSymbol *Sym = Mang->getSymbol(GV);
|
||||
Name.append(Sym->getName().begin() + 1, Sym->getName().end());
|
||||
Mang->getNameWithPrefix(Name, GV, false, false);
|
||||
|
||||
unsigned Characteristics = getCOFFSectionFlags(Kind);
|
||||
|
||||
|
Reference in New Issue
Block a user