[llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp

Chris Lattner clattner at apple.com
Sat Jan 6 13:39:40 PST 2007


> 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.

Can you be a bit more explicit about what this fixes?

-Chris

>
> ---
> 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.
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list