1 //===-- ARMTargetAsmInfo.cpp - ARM 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 ARMTargetAsmInfo properties.
12 //===----------------------------------------------------------------------===//
14 #include "ARMTargetAsmInfo.h"
15 #include "ARMTargetMachine.h"
20 ARMTargetAsmInfo::ARMTargetAsmInfo(const ARMTargetMachine &TM) {
21 const ARMSubtarget *Subtarget = &TM.getSubtarget<ARMSubtarget>();
22 if (Subtarget->isTargetDarwin()) {
24 PrivateGlobalPrefix = "L";
25 BSSSection = 0; // no BSS section.
26 ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill
27 SetDirective = "\t.set";
28 WeakRefDirective = "\t.weak_reference\t";
29 HiddenDirective = "\t.private_extern\t";
30 JumpTableDataSection = ".const";
31 CStringSection = "\t.cstring";
32 FourByteConstantSection = "\t.literal4\n";
33 EightByteConstantSection = "\t.literal8\n";
34 ReadOnlySection = "\t.const\n";
35 HasDotTypeDotSizeDirective = false;
36 if (TM.getRelocationModel() == Reloc::Static) {
37 StaticCtorsSection = ".constructor";
38 StaticDtorsSection = ".destructor";
40 StaticCtorsSection = ".mod_init_func";
41 StaticDtorsSection = ".mod_term_func";
44 // In non-PIC modes, emit a special label before jump tables so that the
45 // linker can perform more accurate dead code stripping.
46 if (TM.getRelocationModel() != Reloc::PIC_) {
47 // Emit a local label that is preserved until the linker runs.
48 JumpTableSpecialLabelPrefix = "l";
52 DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
53 DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug";
54 DwarfLineSection = ".section __DWARF,__debug_line,regular,debug";
55 DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug";
56 DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug";
57 DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug";
58 DwarfStrSection = ".section __DWARF,__debug_str,regular,debug";
59 DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug";
60 DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug";
61 DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug";
62 DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
64 PrivateGlobalPrefix = ".L";
65 WeakRefDirective = "\t.weak\t";
66 if (Subtarget->isAAPCS_ABI()) {
67 StaticCtorsSection = "\t.section .init_array,\"aw\",%init_array";
68 StaticDtorsSection = "\t.section .fini_array,\"aw\",%fini_array";
70 StaticCtorsSection = "\t.section .ctors,\"aw\",%progbits";
71 StaticDtorsSection = "\t.section .dtors,\"aw\",%progbits";
75 ZeroDirective = "\t.space\t";
76 AlignmentIsInBytes = false;
77 Data64bitsDirective = 0;
79 DataSection = "\t.data";
80 ConstantPoolSection = "\t.text\n";
81 COMMDirectiveTakesAlignment = false;
82 InlineAsmStart = "@ InlineAsm Start";
83 InlineAsmEnd = "@ InlineAsm End";
84 LCOMMDirective = "\t.lcomm\t";
85 isThumb = Subtarget->isThumb();