mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
Avoid an infinite cycle with private linkage and -f{data|function}-sections.
When outputting an object we check its section to find its name, but when looking for the section with -ffunction-section we look for the symbol name. Break the loop by requesting a name with the private prefix when constructing the section name. This matches the behavior before r201608. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201622 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -248,12 +248,12 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
|
||||
Prefix = getSectionPrefixForGlobal(Kind);
|
||||
|
||||
SmallString<128> Name(Prefix, Prefix+strlen(Prefix));
|
||||
MCSymbol *Sym = TM.getTargetLowering()->getSymbol(GV, Mang);
|
||||
Name.append(Sym->getName().begin(), Sym->getName().end());
|
||||
TM.getTargetLowering()->getNameWithPrefix(Name, GV, Mang, true);
|
||||
|
||||
StringRef Group = "";
|
||||
unsigned Flags = getELFSectionFlags(Kind);
|
||||
if (GV->isWeakForLinker()) {
|
||||
Group = Sym->getName();
|
||||
Group = Name.substr(strlen(Prefix));
|
||||
Flags |= ELF::SHF_GROUP;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user