Skip to content
Snippets Groups Projects
Commit 392f084f authored by NAKAMURA Takumi's avatar NAKAMURA Takumi
Browse files

lib/CodeGen/TargetLoweringObjectFileImpl.cpp: Tweak to emit...

lib/CodeGen/TargetLoweringObjectFileImpl.cpp: Tweak to emit ".{section}${name}" instead of ".{section}$linkonce_{name}" for linkonce sections.

It seems GNU ld/PECOFF relies on section names, linking with g++'s libstdc++.a would fail.

llvm-svn: 116791
parent 2006bbef
No related branches found
No related tags found
No related merge requests found
...@@ -981,12 +981,12 @@ getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind, ...@@ -981,12 +981,12 @@ getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
static const char *getCOFFSectionPrefixForUniqueGlobal(SectionKind Kind) { static const char *getCOFFSectionPrefixForUniqueGlobal(SectionKind Kind) {
if (Kind.isText()) if (Kind.isText())
return ".text$linkonce"; return ".text$";
if (Kind.isBSS ()) if (Kind.isBSS ())
return ".bss$linkonce"; return ".bss$";
if (Kind.isWriteable()) if (Kind.isWriteable())
return ".data$linkonce"; return ".data$";
return ".rdata$linkonce"; return ".rdata$";
} }
...@@ -1001,7 +1001,7 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, ...@@ -1001,7 +1001,7 @@ SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
const char *Prefix = getCOFFSectionPrefixForUniqueGlobal(Kind); const char *Prefix = getCOFFSectionPrefixForUniqueGlobal(Kind);
SmallString<128> Name(Prefix, Prefix+strlen(Prefix)); SmallString<128> Name(Prefix, Prefix+strlen(Prefix));
MCSymbol *Sym = Mang->getSymbol(GV); MCSymbol *Sym = Mang->getSymbol(GV);
Name.append(Sym->getName().begin(), Sym->getName().end()); Name.append(Sym->getName().begin() + 1, Sym->getName().end());
unsigned Characteristics = getCOFFSectionFlags(Kind); unsigned Characteristics = getCOFFSectionFlags(Kind);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment