1 //===-- PPCTargetAsmInfo.cpp - PPC asm properties ---------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by James M. Laskey and is distributed under the
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the declarations of the DarwinTargetAsmInfo properties.
12 //===----------------------------------------------------------------------===//
14 #include "PPCTargetAsmInfo.h"
15 #include "PPCTargetMachine.h"
16 #include "llvm/Function.h"
19 PPCTargetAsmInfo::PPCTargetAsmInfo(const PPCTargetMachine &TM) {
20 bool isPPC64 = TM.getSubtargetImpl()->isPPC64();
22 ZeroDirective = "\t.space\t";
23 SetDirective = "\t.set";
24 Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
25 AlignmentIsInBytes = false;
26 LCOMMDirective = "\t.lcomm\t";
27 InlineAsmStart = "# InlineAsm Start";
28 InlineAsmEnd = "# InlineAsm End";
29 AssemblerDialect = TM.getSubtargetImpl()->getAsmFlavor();
32 AddressSize = isPPC64 ? 8 : 4;
33 DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
34 DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug";
35 DwarfLineSection = ".section __DWARF,__debug_line,regular,debug";
36 DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug";
37 DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug";
38 DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug";
39 DwarfStrSection = ".section __DWARF,__debug_str,regular,debug";
40 DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug";
41 DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug";
42 DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug";
43 DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
45 ".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support";
46 DwarfExceptionSection = ".section __DATA,__gcc_except_tab";
49 DarwinTargetAsmInfo::DarwinTargetAsmInfo(const PPCTargetMachine &TM)
50 : PPCTargetAsmInfo(TM)
55 PrivateGlobalPrefix = "L";
56 ConstantPoolSection = "\t.const\t";
57 JumpTableDataSection = ".const";
58 GlobalDirective = "\t.globl\t";
59 CStringSection = "\t.cstring";
60 FourByteConstantSection = "\t.literal4\n";
61 EightByteConstantSection = "\t.literal8\n";
62 ReadOnlySection = "\t.const\n";
63 if (TM.getRelocationModel() == Reloc::Static) {
64 StaticCtorsSection = ".constructor";
65 StaticDtorsSection = ".destructor";
67 StaticCtorsSection = ".mod_init_func";
68 StaticDtorsSection = ".mod_term_func";
70 UsedDirective = "\t.no_dead_strip\t";
71 WeakRefDirective = "\t.weak_reference\t";
72 HiddenDirective = "\t.private_extern\t";
73 SupportsExceptionHandling = true;
75 // In non-PIC modes, emit a special label before jump tables so that the
76 // linker can perform more accurate dead code stripping.
77 if (TM.getRelocationModel() != Reloc::PIC_) {
78 // Emit a local label that is preserved until the linker runs.
79 JumpTableSpecialLabelPrefix = "l";
83 LinuxTargetAsmInfo::LinuxTargetAsmInfo(const PPCTargetMachine &TM)
84 : PPCTargetAsmInfo(TM)
88 PrivateGlobalPrefix = "";
89 ConstantPoolSection = "\t.section .rodata.cst4\t";
90 JumpTableDataSection = ".section .rodata.cst4";
91 CStringSection = "\t.section\t.rodata";
92 StaticCtorsSection = ".section\t.ctors,\"aw\",@progbits";
93 StaticDtorsSection = ".section\t.dtors,\"aw\",@progbits";
94 UsedDirective = "\t# .no_dead_strip\t";
95 WeakRefDirective = "\t.weak\t";