diff options
| author | Anton Korobeynikov <asl@math.spbu.ru> | 2007-01-06 18:24:26 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <asl@math.spbu.ru> | 2007-01-06 18:24:26 +0000 |
| commit | bb162f48ba071b6691e9149e3ea6dfd0e79f1960 (patch) | |
| tree | 9966f3a6b3e2510d9945627040ee02139937207c /llvm | |
| parent | aeeeaea5a3fb60a60cdda202fe48786310c6c34d (diff) | |
| download | bcm5719-llvm-bb162f48ba071b6691e9149e3ea6dfd0e79f1960.tar.gz bcm5719-llvm-bb162f48ba071b6691e9149e3ea6dfd0e79f1960.zip | |
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.
llvm-svn: 32958
Diffstat (limited to 'llvm')
| -rwxr-xr-x | llvm/lib/Target/X86/X86ATTAsmPrinter.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp b/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp index e3448928416..d71bc784df5 100755 --- a/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp +++ b/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp @@ -80,8 +80,13 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) { 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. |

