Compile:
authorChris Lattner <sabre@nondot.org>
Tue, 26 Sep 2006 03:39:53 +0000 (03:39 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 26 Sep 2006 03:39:53 +0000 (03:39 +0000)
int x __attribute__((used));

to:

        .data
.comm _x,4              ; 'x'
        .no_dead_strip  _x

on both x86 and ppc darwin targets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30605 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCTargetAsmInfo.cpp
lib/Target/X86/X86TargetAsmInfo.cpp

index 201d80c89fe062d02ca25fb818c1f35c44d71cf6..03e9a01dd318a3a0fde5e4e302f5cf3356ace227 100644 (file)
@@ -32,6 +32,7 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const PPCTargetMachine &TM) {
   LCOMMDirective = "\t.lcomm\t";
   StaticCtorsSection = ".mod_init_func";
   StaticDtorsSection = ".mod_term_func";
+  UsedDirective = "\t.no_dead_strip\t";
   InlineAsmStart = "# InlineAsm Start";
   InlineAsmEnd = "# InlineAsm End";
   
index 9ca0e15bc92903665c2b467d9c2a50277dbbae90..581feb7542aaf4d5b445300b4566611c79b86746 100644 (file)
@@ -44,6 +44,7 @@ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) {
     InlineAsmStart = "# InlineAsm Start";
     InlineAsmEnd = "# InlineAsm End";
     SetDirective = "\t.set";
+    UsedDirective = "\t.no_dead_strip\t";
     
     NeedsSet = true;
     DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";