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 | cea9d1d634fd5a952ee51a5e0dc1d5a094d9b6da (patch) | |
tree | c157b4e21cfea32d603ae4b1ca6e0e18e3251edd /lib/Target/X86/X86ATTAsmPrinter.cpp | |
parent | c2ca99c15a3ca474fad015ae7b63c853144148d1 (diff) | |
download | llvm-cea9d1d634fd5a952ee51a5e0dc1d5a094d9b6da.tar.gz llvm-cea9d1d634fd5a952ee51a5e0dc1d5a094d9b6da.tar.bz2 llvm-cea9d1d634fd5a952ee51a5e0dc1d5a094d9b6da.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32958 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86ATTAsmPrinter.cpp')
-rwxr-xr-x | lib/Target/X86/X86ATTAsmPrinter.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Target/X86/X86ATTAsmPrinter.cpp b/lib/Target/X86/X86ATTAsmPrinter.cpp index e344892841..d71bc784df 100755 --- a/lib/Target/X86/X86ATTAsmPrinter.cpp +++ b/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. |