[llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp X86AsmPrinter.cpp
Chris Lattner
clattner at apple.com
Tue Oct 17 17:44:41 PDT 2006
Anton, are you sure this is right? linkonce is probably !=
".linkonce". Please check the semantics carefully, can you cite some
docs on what ".linkonce" does?
Emitting LLVM linkonce symbols the same as LLVM weak symbols should
always be safe.
Thanks,
-Chris
On Oct 17, 2006, at 1:30 PM, Anton Korobeynikov wrote:
>
>
> Changes in directory llvm/lib/Target/X86:
>
> X86ATTAsmPrinter.cpp updated: 1.67 -> 1.68
> X86AsmPrinter.cpp updated: 1.201 -> 1.202
> ---
> Log message:
>
> Adding linkonce linkage codegeneration support for mingw32\cygwin
> targets.
>
>
> ---
> Diffs of the changes: (+26 -1)
>
> X86ATTAsmPrinter.cpp | 14 +++++++++++++-
> X86AsmPrinter.cpp | 13 +++++++++++++
> 2 files changed, 26 insertions(+), 1 deletion(-)
>
>
> Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
> diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.67 llvm/lib/
> Target/X86/X86ATTAsmPrinter.cpp:1.68
> --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.67 Wed Oct 4
> 22:01:21 2006
> +++ llvm/lib/Target/X86/X86ATTAsmPrinter.cpp Tue Oct 17 15:29:49 2006
> @@ -89,13 +89,25 @@
> EmitAlignment(4, F); // FIXME: This should be
> parameterized somewhere.
> O << "\t.globl\t" << CurrentFnName << "\n";
> break;
> - case Function::WeakLinkage:
> case Function::LinkOnceLinkage:
> if (Subtarget->isTargetDarwin()) {
> O << "\t.globl\t" << CurrentFnName << "\n";
> O << "\t.weak_definition\t" << CurrentFnName << "\n";
> } else if (Subtarget->isTargetCygwin()) {
> EmitAlignment(4, F); // FIXME: This should be
> parameterized somewhere.
> + O << "\t.linkonce discard\n";
> + O << "\t.globl " << CurrentFnName << "\n";
> + } else {
> + EmitAlignment(4, F); // FIXME: This should be
> parameterized somewhere.
> + O << "\t.weak " << CurrentFnName << "\n";
> + }
> + break;
> + case Function::WeakLinkage:
> + if (Subtarget->isTargetDarwin()) {
> + O << "\t.globl\t" << CurrentFnName << "\n";
> + O << "\t.weak_definition\t" << CurrentFnName << "\n";
> + } else if (Subtarget->isTargetCygwin()) {
> + EmitAlignment(4, F); // FIXME: This should be
> parameterized somewhere.
> O << "\t.weak " << CurrentFnName << "\n";
> } else {
> EmitAlignment(4, F); // FIXME: This should be
> parameterized somewhere.
>
>
> Index: llvm/lib/Target/X86/X86AsmPrinter.cpp
> diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.201 llvm/lib/Target/
> X86/X86AsmPrinter.cpp:1.202
> --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.201 Sat Oct 14 15:53:35
> 2006
> +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Tue Oct 17 15:29:49 2006
> @@ -174,6 +174,19 @@
> } else {
> switch (I->getLinkage()) {
> case GlobalValue::LinkOnceLinkage:
> + if (Subtarget->isTargetDarwin()) {
> + O << "\t.globl " << name << "\n"
> + << "\t.weak_definition " << name << "\n";
> + SwitchToDataSection(".section
> __DATA,__const_coal,coalesced", I);
> + } else if (Subtarget->isTargetCygwin()) {
> + O << "\t.section\t.llvm.linkonce.d." << name << ",\"aw\"\n"
> + << "\t.globl " << name << "\n"
> + << "\t.linkonce same_size\n";
> + } else {
> + O << "\t.section\t.llvm.linkonce.d." << name << ",\"aw
> \", at progbits\n"
> + << "\t.weak " << name << "\n";
> + }
> + break;
> case GlobalValue::WeakLinkage:
> if (Subtarget->isTargetDarwin()) {
> O << "\t.globl " << name << "\n"
>
>
>
> _______________________________________________
> 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