summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorNico Rieck <nico.rieck@gmail.com>2013-07-29 13:58:39 +0000
committerNico Rieck <nico.rieck@gmail.com>2013-07-29 13:58:39 +0000
commit7fdaee8f1520458a96fa47e58ef64ce164e16b8e (patch)
treea6ae36d4245de574b1843181a9ddf384941ce588 /llvm/lib/CodeGen
parent06d17c80cc8947a4ccf79cdb59547607a215050a (diff)
downloadbcm5719-llvm-7fdaee8f1520458a96fa47e58ef64ce164e16b8e.tar.gz
bcm5719-llvm-7fdaee8f1520458a96fa47e58ef64ce164e16b8e.zip
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. llvm-svn: 187356
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 3e1afc01e06..07cf871cef6 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -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);
OpenPOWER on IntegriCloud