[llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
Anton Korobeynikov
asl at math.spbu.ru
Sat Jan 6 10:24:41 PST 2007
Changes in directory llvm/lib/Target/X86:
X86ATTAsmPrinter.cpp updated: 1.81 -> 1.82
---
Log message:
gcc often inserts it's own names for sections (e.g.
gnu.linkonce.t.FunctionName). Convert them to "normal" LLVM names,
otherwise linker won't be able to merge them.
---
Diffs of the changes: (+7 -2)
X86ATTAsmPrinter.cpp | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.81 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.82
--- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.81 Wed Jan 3 05:43:14 2007
+++ llvm/lib/Target/X86/X86ATTAsmPrinter.cpp Sat Jan 6 12:24:26 2007
@@ -80,8 +80,13 @@
X86SharedAsmPrinter::decorateName(CurrentFnName, F);
- SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
-
+ // Change GNU linkonce to LLVM linkonce name
+ if (F->hasSection() &&
+ (F->getSection().find(".gnu.linkonce.t") != std::string::npos))
+ SwitchToTextSection(getSectionForFunction(*F).c_str(), NULL);
+ else
+ SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+
switch (F->getLinkage()) {
default: assert(0 && "Unknown linkage type!");
case Function::InternalLinkage: // Symbols default to internal.
More information about the llvm-commits
mailing list