Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 1 | //===-- X86TargetAsmInfo.cpp - X86 asm properties ---------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 4ee451d | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file contains the declarations of the X86TargetAsmInfo properties. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "X86TargetAsmInfo.h" |
| 15 | #include "X86TargetMachine.h" |
| 16 | #include "X86Subtarget.h" |
Reid Spencer | 7aa8a45 | 2007-01-12 23:22:14 +0000 | [diff] [blame] | 17 | #include "llvm/DerivedTypes.h" |
Chris Lattner | 625bd05 | 2006-11-29 01:14:06 +0000 | [diff] [blame] | 18 | #include "llvm/InlineAsm.h" |
| 19 | #include "llvm/Instructions.h" |
Chris Lattner | 3e9f1d0 | 2007-04-01 20:49:36 +0000 | [diff] [blame] | 20 | #include "llvm/Intrinsics.h" |
Chris Lattner | 625bd05 | 2006-11-29 01:14:06 +0000 | [diff] [blame] | 21 | #include "llvm/Module.h" |
| 22 | #include "llvm/ADT/StringExtras.h" |
Anton Korobeynikov | cee750f | 2008-02-27 23:33:50 +0000 | [diff] [blame] | 23 | #include "llvm/Support/Dwarf.h" |
| 24 | |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 25 | using namespace llvm; |
Anton Korobeynikov | cee750f | 2008-02-27 23:33:50 +0000 | [diff] [blame] | 26 | using namespace llvm::dwarf; |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 27 | |
Dan Gohman | cfbb2f0 | 2008-03-25 21:45:14 +0000 | [diff] [blame] | 28 | static const char *const x86_asm_table[] = { |
| 29 | "{si}", "S", |
Andrew Lenharth | 6c0695f | 2006-11-28 19:52:49 +0000 | [diff] [blame] | 30 | "{di}", "D", |
| 31 | "{ax}", "a", |
| 32 | "{cx}", "c", |
Andrew Lenharth | 6c0695f | 2006-11-28 19:52:49 +0000 | [diff] [blame] | 33 | "{memory}", "memory", |
| 34 | "{flags}", "", |
| 35 | "{dirflag}", "", |
| 36 | "{fpsr}", "", |
| 37 | "{cc}", "cc", |
| 38 | 0,0}; |
| 39 | |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 40 | X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) { |
| 41 | const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>(); |
Anton Korobeynikov | cee750f | 2008-02-27 23:33:50 +0000 | [diff] [blame] | 42 | X86TM = &TM; |
| 43 | |
Andrew Lenharth | 6c0695f | 2006-11-28 19:52:49 +0000 | [diff] [blame] | 44 | AsmTransCBE = x86_asm_table; |
Anton Korobeynikov | 8210045 | 2008-07-09 13:20:27 +0000 | [diff] [blame] | 45 | |
Bill Wendling | cb90099 | 2007-01-16 09:29:17 +0000 | [diff] [blame] | 46 | AssemblerDialect = Subtarget->getAsmFlavor(); |
Jim Laskey | 8e8de8f | 2006-09-07 22:05:02 +0000 | [diff] [blame] | 47 | } |
Chris Lattner | afbfded | 2006-10-05 02:43:52 +0000 | [diff] [blame] | 48 | |
Chris Lattner | 625bd05 | 2006-11-29 01:14:06 +0000 | [diff] [blame] | 49 | bool X86TargetAsmInfo::LowerToBSwap(CallInst *CI) const { |
| 50 | // FIXME: this should verify that we are targetting a 486 or better. If not, |
| 51 | // we will turn this bswap into something that will be lowered to logical ops |
| 52 | // instead of emitting the bswap asm. For now, we don't support 486 or lower |
| 53 | // so don't worry about this. |
Anton Korobeynikov | 8210045 | 2008-07-09 13:20:27 +0000 | [diff] [blame] | 54 | |
Chris Lattner | 625bd05 | 2006-11-29 01:14:06 +0000 | [diff] [blame] | 55 | // Verify this is a simple bswap. |
| 56 | if (CI->getNumOperands() != 2 || |
| 57 | CI->getType() != CI->getOperand(1)->getType() || |
Chris Lattner | 42a7551 | 2007-01-15 02:27:26 +0000 | [diff] [blame] | 58 | !CI->getType()->isInteger()) |
Chris Lattner | 625bd05 | 2006-11-29 01:14:06 +0000 | [diff] [blame] | 59 | return false; |
Anton Korobeynikov | 8210045 | 2008-07-09 13:20:27 +0000 | [diff] [blame] | 60 | |
Chris Lattner | 3e9f1d0 | 2007-04-01 20:49:36 +0000 | [diff] [blame] | 61 | const IntegerType *Ty = dyn_cast<IntegerType>(CI->getType()); |
| 62 | if (!Ty || Ty->getBitWidth() % 16 != 0) |
Reid Spencer | a54b7cb | 2007-01-12 07:05:14 +0000 | [diff] [blame] | 63 | return false; |
Anton Korobeynikov | 8210045 | 2008-07-09 13:20:27 +0000 | [diff] [blame] | 64 | |
Chris Lattner | 625bd05 | 2006-11-29 01:14:06 +0000 | [diff] [blame] | 65 | // Okay, we can do this xform, do so now. |
Chandler Carruth | 6994040 | 2007-08-04 01:51:18 +0000 | [diff] [blame] | 66 | const Type *Tys[] = { Ty }; |
Chris Lattner | 625bd05 | 2006-11-29 01:14:06 +0000 | [diff] [blame] | 67 | Module *M = CI->getParent()->getParent()->getParent(); |
Chandler Carruth | 6994040 | 2007-08-04 01:51:18 +0000 | [diff] [blame] | 68 | Constant *Int = Intrinsic::getDeclaration(M, Intrinsic::bswap, Tys, 1); |
Anton Korobeynikov | 8210045 | 2008-07-09 13:20:27 +0000 | [diff] [blame] | 69 | |
Chris Lattner | 625bd05 | 2006-11-29 01:14:06 +0000 | [diff] [blame] | 70 | Value *Op = CI->getOperand(1); |
Gabor Greif | 051a950 | 2008-04-06 20:25:17 +0000 | [diff] [blame] | 71 | Op = CallInst::Create(Int, Op, CI->getName(), CI); |
Anton Korobeynikov | 8210045 | 2008-07-09 13:20:27 +0000 | [diff] [blame] | 72 | |
Chris Lattner | 625bd05 | 2006-11-29 01:14:06 +0000 | [diff] [blame] | 73 | CI->replaceAllUsesWith(Op); |
| 74 | CI->eraseFromParent(); |
| 75 | return true; |
| 76 | } |
| 77 | |
| 78 | |
| 79 | bool X86TargetAsmInfo::ExpandInlineAsm(CallInst *CI) const { |
| 80 | InlineAsm *IA = cast<InlineAsm>(CI->getCalledValue()); |
Chris Lattner | 5d52135 | 2006-11-29 01:48:01 +0000 | [diff] [blame] | 81 | std::vector<InlineAsm::ConstraintInfo> Constraints = IA->ParseConstraints(); |
Anton Korobeynikov | 8210045 | 2008-07-09 13:20:27 +0000 | [diff] [blame] | 82 | |
Chris Lattner | 625bd05 | 2006-11-29 01:14:06 +0000 | [diff] [blame] | 83 | std::string AsmStr = IA->getAsmString(); |
Anton Korobeynikov | 8210045 | 2008-07-09 13:20:27 +0000 | [diff] [blame] | 84 | |
Chris Lattner | 625bd05 | 2006-11-29 01:14:06 +0000 | [diff] [blame] | 85 | // TODO: should remove alternatives from the asmstring: "foo {a|b}" -> "foo a" |
| 86 | std::vector<std::string> AsmPieces; |
| 87 | SplitString(AsmStr, AsmPieces, "\n"); // ; as separator? |
Anton Korobeynikov | 8210045 | 2008-07-09 13:20:27 +0000 | [diff] [blame] | 88 | |
Chris Lattner | 625bd05 | 2006-11-29 01:14:06 +0000 | [diff] [blame] | 89 | switch (AsmPieces.size()) { |
Anton Korobeynikov | 8210045 | 2008-07-09 13:20:27 +0000 | [diff] [blame] | 90 | default: return false; |
Chris Lattner | 625bd05 | 2006-11-29 01:14:06 +0000 | [diff] [blame] | 91 | case 1: |
| 92 | AsmStr = AsmPieces[0]; |
| 93 | AsmPieces.clear(); |
| 94 | SplitString(AsmStr, AsmPieces, " \t"); // Split with whitespace. |
Anton Korobeynikov | 8210045 | 2008-07-09 13:20:27 +0000 | [diff] [blame] | 95 | |
Chris Lattner | 5d52135 | 2006-11-29 01:48:01 +0000 | [diff] [blame] | 96 | // bswap $0 |
Anton Korobeynikov | 8210045 | 2008-07-09 13:20:27 +0000 | [diff] [blame] | 97 | if (AsmPieces.size() == 2 && |
Chris Lattner | 625bd05 | 2006-11-29 01:14:06 +0000 | [diff] [blame] | 98 | AsmPieces[0] == "bswap" && AsmPieces[1] == "$0") { |
| 99 | // No need to check constraints, nothing other than the equivalent of |
| 100 | // "=r,0" would be valid here. |
| 101 | return LowerToBSwap(CI); |
| 102 | } |
| 103 | break; |
Chris Lattner | 5d52135 | 2006-11-29 01:48:01 +0000 | [diff] [blame] | 104 | case 3: |
Reid Spencer | 4785781 | 2006-12-31 05:55:36 +0000 | [diff] [blame] | 105 | if (CI->getType() == Type::Int64Ty && Constraints.size() >= 2 && |
Chris Lattner | 5d52135 | 2006-11-29 01:48:01 +0000 | [diff] [blame] | 106 | Constraints[0].Codes.size() == 1 && Constraints[0].Codes[0] == "A" && |
| 107 | Constraints[1].Codes.size() == 1 && Constraints[1].Codes[0] == "0") { |
| 108 | // bswap %eax / bswap %edx / xchgl %eax, %edx -> llvm.bswap.i64 |
| 109 | std::vector<std::string> Words; |
| 110 | SplitString(AsmPieces[0], Words, " \t"); |
| 111 | if (Words.size() == 2 && Words[0] == "bswap" && Words[1] == "%eax") { |
| 112 | Words.clear(); |
| 113 | SplitString(AsmPieces[1], Words, " \t"); |
| 114 | if (Words.size() == 2 && Words[0] == "bswap" && Words[1] == "%edx") { |
| 115 | Words.clear(); |
| 116 | SplitString(AsmPieces[2], Words, " \t,"); |
| 117 | if (Words.size() == 3 && Words[0] == "xchgl" && Words[1] == "%eax" && |
| 118 | Words[2] == "%edx") { |
| 119 | return LowerToBSwap(CI); |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | break; |
Chris Lattner | 625bd05 | 2006-11-29 01:14:06 +0000 | [diff] [blame] | 125 | } |
| 126 | return false; |
| 127 | } |
Anton Korobeynikov | cee750f | 2008-02-27 23:33:50 +0000 | [diff] [blame] | 128 | |
Anton Korobeynikov | 4468b7a | 2008-07-09 13:20:48 +0000 | [diff] [blame] | 129 | X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM): |
| 130 | X86TargetAsmInfo(TM) { |
| 131 | bool is64Bit = X86TM->getSubtarget<X86Subtarget>().is64Bit(); |
| 132 | |
| 133 | AlignmentIsInBytes = false; |
| 134 | TextAlignFillValue = 0x90; |
| 135 | GlobalPrefix = "_"; |
| 136 | if (!is64Bit) |
| 137 | Data64bitsDirective = 0; // we can't emit a 64-bit unit |
| 138 | ZeroDirective = "\t.space\t"; // ".space N" emits N zeros. |
| 139 | PrivateGlobalPrefix = "L"; // Marker for constant pool idxs |
| 140 | BSSSection = 0; // no BSS section. |
| 141 | ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill |
| 142 | ConstantPoolSection = "\t.const\n"; |
| 143 | JumpTableDataSection = "\t.const\n"; |
| 144 | CStringSection = "\t.cstring"; |
| 145 | FourByteConstantSection = "\t.literal4\n"; |
| 146 | EightByteConstantSection = "\t.literal8\n"; |
| 147 | // FIXME: Why don't always use this section? |
| 148 | if (is64Bit) |
| 149 | SixteenByteConstantSection = "\t.literal16\n"; |
| 150 | ReadOnlySection = "\t.const\n"; |
| 151 | LCOMMDirective = "\t.lcomm\t"; |
| 152 | SwitchToSectionDirective = "\t.section "; |
| 153 | StringConstantPrefix = "\1LC"; |
| 154 | COMMDirectiveTakesAlignment = false; |
| 155 | HasDotTypeDotSizeDirective = false; |
| 156 | if (TM.getRelocationModel() == Reloc::Static) { |
| 157 | StaticCtorsSection = ".constructor"; |
| 158 | StaticDtorsSection = ".destructor"; |
| 159 | } else { |
| 160 | StaticCtorsSection = ".mod_init_func"; |
| 161 | StaticDtorsSection = ".mod_term_func"; |
| 162 | } |
| 163 | if (is64Bit) { |
| 164 | PersonalityPrefix = ""; |
| 165 | PersonalitySuffix = "+4@GOTPCREL"; |
| 166 | } else { |
| 167 | PersonalityPrefix = "L"; |
| 168 | PersonalitySuffix = "$non_lazy_ptr"; |
| 169 | } |
| 170 | NeedsIndirectEncoding = true; |
| 171 | InlineAsmStart = "## InlineAsm Start"; |
| 172 | InlineAsmEnd = "## InlineAsm End"; |
| 173 | CommentString = "##"; |
| 174 | SetDirective = "\t.set"; |
| 175 | PCSymbol = "."; |
| 176 | UsedDirective = "\t.no_dead_strip\t"; |
| 177 | WeakDefDirective = "\t.weak_definition "; |
| 178 | WeakRefDirective = "\t.weak_reference "; |
| 179 | HiddenDirective = "\t.private_extern "; |
| 180 | ProtectedDirective = "\t.globl\t"; |
| 181 | |
| 182 | // In non-PIC modes, emit a special label before jump tables so that the |
| 183 | // linker can perform more accurate dead code stripping. |
| 184 | if (TM.getRelocationModel() != Reloc::PIC_) { |
| 185 | // Emit a local label that is preserved until the linker runs. |
| 186 | JumpTableSpecialLabelPrefix = "l"; |
| 187 | } |
| 188 | |
| 189 | SupportsDebugInformation = true; |
| 190 | NeedsSet = true; |
| 191 | DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug"; |
| 192 | DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug"; |
| 193 | DwarfLineSection = ".section __DWARF,__debug_line,regular,debug"; |
| 194 | DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug"; |
| 195 | DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug"; |
| 196 | DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug"; |
| 197 | DwarfStrSection = ".section __DWARF,__debug_str,regular,debug"; |
| 198 | DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug"; |
| 199 | DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug"; |
| 200 | DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug"; |
| 201 | DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug"; |
| 202 | |
| 203 | // Exceptions handling |
| 204 | SupportsExceptionHandling = true; |
| 205 | GlobalEHDirective = "\t.globl\t"; |
| 206 | SupportsWeakOmittedEHFrame = false; |
| 207 | AbsoluteEHSectionOffsets = false; |
| 208 | DwarfEHFrameSection = |
| 209 | ".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support"; |
| 210 | DwarfExceptionSection = ".section __DATA,__gcc_except_tab"; |
| 211 | } |
| 212 | |
Anton Korobeynikov | b9e58ef | 2008-07-09 13:21:08 +0000 | [diff] [blame] | 213 | unsigned |
| 214 | X86DarwinTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason, |
| 215 | bool Global) const { |
| 216 | if (Reason == DwarfEncoding::Functions && Global) |
| 217 | return (DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4); |
| 218 | else if (Reason == DwarfEncoding::CodeLabels || !Global) |
| 219 | return DW_EH_PE_pcrel; |
| 220 | else |
| 221 | return DW_EH_PE_absptr; |
| 222 | } |
| 223 | |
Anton Korobeynikov | b9a02fc | 2008-07-09 13:21:29 +0000 | [diff] [blame] | 224 | std::string |
Anton Korobeynikov | 4039e68 | 2008-07-09 13:23:57 +0000 | [diff] [blame] | 225 | X86DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { |
| 226 | SectionKind::Kind Kind = SectionKindForGlobal(GV); |
Anton Korobeynikov | c33a744 | 2008-07-09 13:27:59 +0000 | [diff] [blame^] | 227 | bool isWeak = GV->isWeakForLinker(); |
Anton Korobeynikov | 4039e68 | 2008-07-09 13:23:57 +0000 | [diff] [blame] | 228 | |
| 229 | switch (Kind) { |
| 230 | case SectionKind::Text: |
| 231 | if (isWeak) |
| 232 | return ".section __TEXT,__textcoal_nt,coalesced,pure_instructions"; |
| 233 | else |
| 234 | return getTextSection(); |
| 235 | case SectionKind::Data: |
| 236 | case SectionKind::ThreadData: |
| 237 | case SectionKind::BSS: |
| 238 | case SectionKind::ThreadBSS: |
| 239 | if (cast<GlobalVariable>(GV)->isConstant()) { |
| 240 | if (isWeak) |
| 241 | return ".section __DATA,__const_coal,coalesced"; |
| 242 | else |
| 243 | return ".const_data"; |
| 244 | } else { |
| 245 | if (isWeak) |
| 246 | return ".section __DATA,__datacoal_nt,coalesced"; |
| 247 | else |
| 248 | return getDataSection(); |
| 249 | } |
| 250 | case SectionKind::ROData: |
| 251 | if (isWeak) |
| 252 | return ".section __DATA,__const_coal,coalesced"; |
| 253 | else |
| 254 | return getReadOnlySection(); |
| 255 | case SectionKind::RODataMergeStr: |
| 256 | return MergeableStringSection(cast<GlobalVariable>(GV)); |
| 257 | case SectionKind::RODataMergeConst: |
| 258 | return MergeableConstSection(cast<GlobalVariable>(GV)); |
| 259 | default: |
| 260 | assert(0 && "Unsuported section kind for global"); |
| 261 | } |
| 262 | |
| 263 | // FIXME: Do we have any extra special weird cases? |
| 264 | } |
| 265 | |
| 266 | std::string |
| 267 | X86DarwinTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const { |
| 268 | unsigned Flags = SectionFlagsForGlobal(GV, GV->getSection().c_str()); |
| 269 | unsigned Size = SectionFlags::getEntitySize(Flags); |
| 270 | |
| 271 | if (Size) { |
| 272 | const TargetData *TD = X86TM->getTargetData(); |
| 273 | unsigned Align = TD->getPreferredAlignment(GV); |
| 274 | if (Align <= 32) |
| 275 | return getCStringSection(); |
| 276 | } |
| 277 | |
| 278 | return getReadOnlySection(); |
| 279 | } |
| 280 | |
| 281 | std::string |
| 282 | X86DarwinTargetAsmInfo::MergeableConstSection(const GlobalVariable *GV) const { |
| 283 | unsigned Flags = SectionFlagsForGlobal(GV, GV->getSection().c_str()); |
| 284 | unsigned Size = SectionFlags::getEntitySize(Flags); |
| 285 | |
| 286 | if (Size == 4) |
| 287 | return FourByteConstantSection; |
| 288 | else if (Size == 8) |
| 289 | return EightByteConstantSection; |
| 290 | else if (Size == 16 && X86TM->getSubtarget<X86Subtarget>().is64Bit()) |
| 291 | return SixteenByteConstantSection; |
| 292 | |
| 293 | return getReadOnlySection(); |
| 294 | } |
| 295 | |
| 296 | std::string |
Anton Korobeynikov | b9a02fc | 2008-07-09 13:21:29 +0000 | [diff] [blame] | 297 | X86DarwinTargetAsmInfo::UniqueSectionForGlobal(const GlobalValue* GV, |
| 298 | SectionKind::Kind kind) const { |
Anton Korobeynikov | 4039e68 | 2008-07-09 13:23:57 +0000 | [diff] [blame] | 299 | assert(0 && "Darwin does not use unique sections"); |
| 300 | return ""; |
| 301 | } |
| 302 | |
| 303 | unsigned |
| 304 | X86DarwinTargetAsmInfo::SectionFlagsForGlobal(const GlobalValue *GV, |
| 305 | const char* name) const { |
| 306 | unsigned Flags = |
| 307 | TargetAsmInfo::SectionFlagsForGlobal(GV, |
| 308 | GV->getSection().c_str()); |
| 309 | |
| 310 | // If there was decision to put stuff into mergeable section - calculate |
| 311 | // entity size |
| 312 | if (Flags & SectionFlags::Mergeable) { |
| 313 | const TargetData *TD = X86TM->getTargetData(); |
| 314 | Constant *C = cast<GlobalVariable>(GV)->getInitializer(); |
| 315 | const Type *Type; |
| 316 | |
| 317 | if (Flags & SectionFlags::Strings) { |
| 318 | const ConstantArray *CVA = cast<ConstantArray>(C); |
| 319 | Type = CVA->getType()->getElementType(); |
| 320 | } else |
| 321 | Type = C->getType(); |
| 322 | |
| 323 | unsigned Size = TD->getABITypeSize(Type); |
Anton Korobeynikov | 7e7fc82 | 2008-07-09 13:26:52 +0000 | [diff] [blame] | 324 | if (Size > 16 || |
| 325 | !(Flags & SectionFlags::Strings || |
| 326 | (Size == 4 || Size == 8 || Size == 16))) { |
| 327 | // Not suitable for mergeable |
Anton Korobeynikov | 4039e68 | 2008-07-09 13:23:57 +0000 | [diff] [blame] | 328 | Size = 0; |
Anton Korobeynikov | 87fc6b4 | 2008-07-09 13:26:05 +0000 | [diff] [blame] | 329 | Flags &= ~SectionFlags::Mergeable; |
| 330 | } |
Anton Korobeynikov | 4039e68 | 2008-07-09 13:23:57 +0000 | [diff] [blame] | 331 | Flags = SectionFlags::setEntitySize(Flags, Size); |
| 332 | } |
| 333 | |
| 334 | return Flags; |
Anton Korobeynikov | b9a02fc | 2008-07-09 13:21:29 +0000 | [diff] [blame] | 335 | } |
| 336 | |
Anton Korobeynikov | 4468b7a | 2008-07-09 13:20:48 +0000 | [diff] [blame] | 337 | X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const X86TargetMachine &TM): |
| 338 | X86TargetAsmInfo(TM) { |
| 339 | bool is64Bit = X86TM->getSubtarget<X86Subtarget>().is64Bit(); |
| 340 | |
Anton Korobeynikov | b20015b | 2008-07-09 13:25:26 +0000 | [diff] [blame] | 341 | ReadOnlySection = ".rodata"; |
Anton Korobeynikov | 2a88917 | 2008-07-09 13:25:46 +0000 | [diff] [blame] | 342 | FourByteConstantSection = "\t.section\t.rodata.cst4,\"aM\",@progbits,4"; |
| 343 | EightByteConstantSection = "\t.section\t.rodata.cst8,\"aM\",@progbits,8"; |
| 344 | SixteenByteConstantSection = "\t.section\t.rodata.cst16,\"aM\",@progbits,16"; |
Anton Korobeynikov | b20015b | 2008-07-09 13:25:26 +0000 | [diff] [blame] | 345 | CStringSection = ".rodata.str"; |
Anton Korobeynikov | 4468b7a | 2008-07-09 13:20:48 +0000 | [diff] [blame] | 346 | PrivateGlobalPrefix = ".L"; |
| 347 | WeakRefDirective = "\t.weak\t"; |
| 348 | SetDirective = "\t.set\t"; |
| 349 | PCSymbol = "."; |
| 350 | |
| 351 | // Set up DWARF directives |
| 352 | HasLEB128 = true; // Target asm supports leb128 directives (little-endian) |
| 353 | |
| 354 | // Debug Information |
| 355 | AbsoluteDebugSectionOffsets = true; |
| 356 | SupportsDebugInformation = true; |
| 357 | DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\",@progbits"; |
| 358 | DwarfInfoSection = "\t.section\t.debug_info,\"\",@progbits"; |
| 359 | DwarfLineSection = "\t.section\t.debug_line,\"\",@progbits"; |
| 360 | DwarfFrameSection = "\t.section\t.debug_frame,\"\",@progbits"; |
| 361 | DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"\",@progbits"; |
| 362 | DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"\",@progbits"; |
| 363 | DwarfStrSection = "\t.section\t.debug_str,\"\",@progbits"; |
| 364 | DwarfLocSection = "\t.section\t.debug_loc,\"\",@progbits"; |
| 365 | DwarfARangesSection = "\t.section\t.debug_aranges,\"\",@progbits"; |
| 366 | DwarfRangesSection = "\t.section\t.debug_ranges,\"\",@progbits"; |
| 367 | DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"\",@progbits"; |
| 368 | |
| 369 | // Exceptions handling |
| 370 | if (!is64Bit) |
| 371 | SupportsExceptionHandling = true; |
| 372 | AbsoluteEHSectionOffsets = false; |
| 373 | DwarfEHFrameSection = "\t.section\t.eh_frame,\"aw\",@progbits"; |
| 374 | DwarfExceptionSection = "\t.section\t.gcc_except_table,\"a\",@progbits"; |
| 375 | |
| 376 | // On Linux we must declare when we can use a non-executable stack. |
| 377 | if (X86TM->getSubtarget<X86Subtarget>().isLinux()) |
| 378 | NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\",@progbits"; |
| 379 | } |
| 380 | |
Anton Korobeynikov | b9e58ef | 2008-07-09 13:21:08 +0000 | [diff] [blame] | 381 | unsigned |
| 382 | X86ELFTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason, |
| 383 | bool Global) const { |
| 384 | CodeModel::Model CM = X86TM->getCodeModel(); |
| 385 | bool is64Bit = X86TM->getSubtarget<X86Subtarget>().is64Bit(); |
| 386 | |
| 387 | if (X86TM->getRelocationModel() == Reloc::PIC_) { |
| 388 | unsigned Format = 0; |
| 389 | |
| 390 | if (!is64Bit) |
| 391 | // 32 bit targets always encode pointers as 4 bytes |
| 392 | Format = DW_EH_PE_sdata4; |
| 393 | else { |
| 394 | // 64 bit targets encode pointers in 4 bytes iff: |
| 395 | // - code model is small OR |
| 396 | // - code model is medium and we're emitting externally visible symbols |
| 397 | // or any code symbols |
| 398 | if (CM == CodeModel::Small || |
| 399 | (CM == CodeModel::Medium && (Global || |
| 400 | Reason != DwarfEncoding::Data))) |
| 401 | Format = DW_EH_PE_sdata4; |
| 402 | else |
| 403 | Format = DW_EH_PE_sdata8; |
| 404 | } |
| 405 | |
| 406 | if (Global) |
| 407 | Format |= DW_EH_PE_indirect; |
| 408 | |
| 409 | return (Format | DW_EH_PE_pcrel); |
| 410 | } else { |
| 411 | if (is64Bit && |
| 412 | (CM == CodeModel::Small || |
| 413 | (CM == CodeModel::Medium && Reason != DwarfEncoding::Data))) |
| 414 | return DW_EH_PE_udata4; |
| 415 | else |
| 416 | return DW_EH_PE_absptr; |
| 417 | } |
| 418 | } |
| 419 | |
Anton Korobeynikov | 4260ad3 | 2008-07-09 13:23:08 +0000 | [diff] [blame] | 420 | std::string |
| 421 | X86ELFTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { |
| 422 | SectionKind::Kind kind = SectionKindForGlobal(GV); |
| 423 | |
| 424 | if (const Function *F = dyn_cast<Function>(GV)) { |
| 425 | switch (F->getLinkage()) { |
| 426 | default: assert(0 && "Unknown linkage type!"); |
| 427 | case Function::InternalLinkage: |
| 428 | case Function::DLLExportLinkage: |
| 429 | case Function::ExternalLinkage: |
| 430 | return getTextSection(); |
| 431 | case Function::WeakLinkage: |
| 432 | case Function::LinkOnceLinkage: |
| 433 | return UniqueSectionForGlobal(F, kind); |
| 434 | } |
| 435 | } else if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV)) { |
Anton Korobeynikov | c33a744 | 2008-07-09 13:27:59 +0000 | [diff] [blame^] | 436 | if (GVar->isWeakForLinker() |
Anton Korobeynikov | 4260ad3 | 2008-07-09 13:23:08 +0000 | [diff] [blame] | 437 | return UniqueSectionForGlobal(GVar, kind); |
| 438 | else { |
| 439 | switch (kind) { |
| 440 | case SectionKind::Data: |
| 441 | return getDataSection(); |
| 442 | case SectionKind::BSS: |
| 443 | // ELF targets usually have BSS sections |
| 444 | return getBSSSection(); |
| 445 | case SectionKind::ROData: |
Anton Korobeynikov | 4260ad3 | 2008-07-09 13:23:08 +0000 | [diff] [blame] | 446 | return getReadOnlySection(); |
Anton Korobeynikov | 01b0e24 | 2008-07-09 13:23:37 +0000 | [diff] [blame] | 447 | case SectionKind::RODataMergeStr: |
| 448 | return MergeableStringSection(GVar); |
| 449 | case SectionKind::RODataMergeConst: |
| 450 | return MergeableConstSection(GVar); |
Anton Korobeynikov | 4260ad3 | 2008-07-09 13:23:08 +0000 | [diff] [blame] | 451 | case SectionKind::ThreadData: |
| 452 | // ELF targets usually support TLS stuff |
| 453 | return getTLSDataSection(); |
| 454 | case SectionKind::ThreadBSS: |
| 455 | return getTLSBSSSection(); |
| 456 | default: |
| 457 | assert(0 && "Unsuported section kind for global"); |
| 458 | } |
| 459 | } |
| 460 | } else |
| 461 | assert(0 && "Unsupported global"); |
| 462 | } |
| 463 | |
Anton Korobeynikov | 01b0e24 | 2008-07-09 13:23:37 +0000 | [diff] [blame] | 464 | std::string |
| 465 | X86ELFTargetAsmInfo::MergeableConstSection(const GlobalVariable *GV) const { |
| 466 | unsigned Flags = SectionFlagsForGlobal(GV, GV->getSection().c_str()); |
| 467 | unsigned Size = SectionFlags::getEntitySize(Flags); |
| 468 | |
| 469 | // FIXME: string here is temporary, until stuff will fully land in. |
Anton Korobeynikov | 2a88917 | 2008-07-09 13:25:46 +0000 | [diff] [blame] | 470 | // We cannot use {Four,Eight,Sixteen}ByteConstantSection here, since it's |
| 471 | // currently directly used by asmprinter. |
| 472 | if (Size == 4 || Size == 8 || Size == 16) |
| 473 | return ".rodata.cst" + utostr(Size); |
Anton Korobeynikov | 4039e68 | 2008-07-09 13:23:57 +0000 | [diff] [blame] | 474 | |
| 475 | return getReadOnlySection(); |
Anton Korobeynikov | 01b0e24 | 2008-07-09 13:23:37 +0000 | [diff] [blame] | 476 | } |
| 477 | |
| 478 | std::string |
| 479 | X86ELFTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const { |
| 480 | unsigned Flags = SectionFlagsForGlobal(GV, GV->getSection().c_str()); |
| 481 | unsigned Size = SectionFlags::getEntitySize(Flags); |
| 482 | |
| 483 | if (Size) { |
| 484 | // We also need alignment here |
| 485 | const TargetData *TD = X86TM->getTargetData(); |
| 486 | unsigned Align = TD->getPreferredAlignment(GV); |
| 487 | if (Align < Size) |
| 488 | Align = Size; |
| 489 | |
Anton Korobeynikov | 1290ecf | 2008-07-09 13:26:24 +0000 | [diff] [blame] | 490 | return getCStringSection() + utostr(Size) + '.' + utostr(Align); |
Anton Korobeynikov | 4039e68 | 2008-07-09 13:23:57 +0000 | [diff] [blame] | 491 | } |
| 492 | |
| 493 | return getReadOnlySection(); |
Anton Korobeynikov | 01b0e24 | 2008-07-09 13:23:37 +0000 | [diff] [blame] | 494 | } |
| 495 | |
| 496 | unsigned |
| 497 | X86ELFTargetAsmInfo::SectionFlagsForGlobal(const GlobalValue *GV, |
| 498 | const char* name) const { |
| 499 | unsigned Flags = |
| 500 | TargetAsmInfo::SectionFlagsForGlobal(GV, |
| 501 | GV->getSection().c_str()); |
| 502 | |
| 503 | // If there was decision to put stuff into mergeable section - calculate |
| 504 | // entity size |
| 505 | if (Flags & SectionFlags::Mergeable) { |
| 506 | const TargetData *TD = X86TM->getTargetData(); |
| 507 | Constant *C = cast<GlobalVariable>(GV)->getInitializer(); |
| 508 | const Type *Type; |
| 509 | |
| 510 | if (Flags & SectionFlags::Strings) { |
| 511 | const ConstantArray *CVA = cast<ConstantArray>(C); |
| 512 | Type = CVA->getType()->getElementType(); |
| 513 | } else |
| 514 | Type = C->getType(); |
| 515 | |
| 516 | unsigned Size = TD->getABITypeSize(Type); |
Anton Korobeynikov | 7e7fc82 | 2008-07-09 13:26:52 +0000 | [diff] [blame] | 517 | // FIXME: size check here ugly, and will hopefully have gone, when we will |
| 518 | // have sane interface for attaching flags to sections. |
| 519 | if (Size > 16 || |
| 520 | !(Flags & SectionFlags::Strings || |
| 521 | (Size == 4 || Size == 8 || Size == 16))) { |
| 522 | // Not suitable for mergeable |
Anton Korobeynikov | 01b0e24 | 2008-07-09 13:23:37 +0000 | [diff] [blame] | 523 | Size = 0; |
Anton Korobeynikov | 87fc6b4 | 2008-07-09 13:26:05 +0000 | [diff] [blame] | 524 | Flags &= ~SectionFlags::Mergeable; |
| 525 | } |
Anton Korobeynikov | 01b0e24 | 2008-07-09 13:23:37 +0000 | [diff] [blame] | 526 | Flags = SectionFlags::setEntitySize(Flags, Size); |
| 527 | } |
| 528 | |
Anton Korobeynikov | b20015b | 2008-07-09 13:25:26 +0000 | [diff] [blame] | 529 | // FIXME: This is hacky and will be removed when switching from std::string |
| 530 | // sections into 'general' ones |
| 531 | |
| 532 | // Mark section as named, when needed (so, we we will need .section directive |
| 533 | // to switch into it). |
Anton Korobeynikov | 7e7fc82 | 2008-07-09 13:26:52 +0000 | [diff] [blame] | 534 | unsigned TypeFlags = Flags & SectionFlags::TypeFlags; |
| 535 | if (!TypeFlags /* Read-only section */ || |
| 536 | (TypeFlags & (SectionFlags::Mergeable | |
| 537 | SectionFlags::TLS | |
| 538 | SectionFlags::Linkonce))) |
Anton Korobeynikov | b20015b | 2008-07-09 13:25:26 +0000 | [diff] [blame] | 539 | Flags |= SectionFlags::Named; |
| 540 | |
Anton Korobeynikov | 01b0e24 | 2008-07-09 13:23:37 +0000 | [diff] [blame] | 541 | return Flags; |
| 542 | } |
| 543 | |
| 544 | |
Anton Korobeynikov | f447e3d | 2008-07-09 13:21:49 +0000 | [diff] [blame] | 545 | std::string X86ELFTargetAsmInfo::PrintSectionFlags(unsigned flags) const { |
| 546 | std::string Flags = ",\""; |
| 547 | |
| 548 | if (!(flags & SectionFlags::Debug)) |
| 549 | Flags += 'a'; |
| 550 | if (flags & SectionFlags::Code) |
| 551 | Flags += 'x'; |
| 552 | if (flags & SectionFlags::Writeable) |
| 553 | Flags += 'w'; |
| 554 | if (flags & SectionFlags::Mergeable) |
| 555 | Flags += 'M'; |
| 556 | if (flags & SectionFlags::Strings) |
| 557 | Flags += 'S'; |
| 558 | if (flags & SectionFlags::TLS) |
| 559 | Flags += 'T'; |
| 560 | |
| 561 | Flags += "\""; |
| 562 | |
| 563 | // FIXME: There can be exceptions here |
| 564 | if (flags & SectionFlags::BSS) |
| 565 | Flags += ",@nobits"; |
| 566 | else |
| 567 | Flags += ",@progbits"; |
| 568 | |
Anton Korobeynikov | 6d82942 | 2008-07-09 13:22:17 +0000 | [diff] [blame] | 569 | if (unsigned entitySize = SectionFlags::getEntitySize(flags)) |
| 570 | Flags += "," + utostr(entitySize); |
Anton Korobeynikov | f447e3d | 2008-07-09 13:21:49 +0000 | [diff] [blame] | 571 | |
| 572 | return Flags; |
| 573 | } |
| 574 | |
Anton Korobeynikov | 4468b7a | 2008-07-09 13:20:48 +0000 | [diff] [blame] | 575 | X86COFFTargetAsmInfo::X86COFFTargetAsmInfo(const X86TargetMachine &TM): |
| 576 | X86TargetAsmInfo(TM) { |
| 577 | GlobalPrefix = "_"; |
| 578 | LCOMMDirective = "\t.lcomm\t"; |
| 579 | COMMDirectiveTakesAlignment = false; |
| 580 | HasDotTypeDotSizeDirective = false; |
| 581 | StaticCtorsSection = "\t.section .ctors,\"aw\""; |
| 582 | StaticDtorsSection = "\t.section .dtors,\"aw\""; |
| 583 | HiddenDirective = NULL; |
| 584 | PrivateGlobalPrefix = "L"; // Prefix for private global symbols |
| 585 | WeakRefDirective = "\t.weak\t"; |
| 586 | SetDirective = "\t.set\t"; |
| 587 | |
| 588 | // Set up DWARF directives |
| 589 | HasLEB128 = true; // Target asm supports leb128 directives (little-endian) |
| 590 | AbsoluteDebugSectionOffsets = true; |
| 591 | AbsoluteEHSectionOffsets = false; |
| 592 | SupportsDebugInformation = true; |
| 593 | DwarfSectionOffsetDirective = "\t.secrel32\t"; |
| 594 | DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"dr\""; |
| 595 | DwarfInfoSection = "\t.section\t.debug_info,\"dr\""; |
| 596 | DwarfLineSection = "\t.section\t.debug_line,\"dr\""; |
| 597 | DwarfFrameSection = "\t.section\t.debug_frame,\"dr\""; |
| 598 | DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"dr\""; |
| 599 | DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"dr\""; |
| 600 | DwarfStrSection = "\t.section\t.debug_str,\"dr\""; |
| 601 | DwarfLocSection = "\t.section\t.debug_loc,\"dr\""; |
| 602 | DwarfARangesSection = "\t.section\t.debug_aranges,\"dr\""; |
| 603 | DwarfRangesSection = "\t.section\t.debug_ranges,\"dr\""; |
| 604 | DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"dr\""; |
| 605 | } |
| 606 | |
Anton Korobeynikov | b9e58ef | 2008-07-09 13:21:08 +0000 | [diff] [blame] | 607 | unsigned |
| 608 | X86COFFTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason, |
| 609 | bool Global) const { |
| 610 | CodeModel::Model CM = X86TM->getCodeModel(); |
| 611 | bool is64Bit = X86TM->getSubtarget<X86Subtarget>().is64Bit(); |
Anton Korobeynikov | cee750f | 2008-02-27 23:33:50 +0000 | [diff] [blame] | 612 | |
Anton Korobeynikov | b9e58ef | 2008-07-09 13:21:08 +0000 | [diff] [blame] | 613 | if (X86TM->getRelocationModel() == Reloc::PIC_) { |
| 614 | unsigned Format = 0; |
Anton Korobeynikov | cee750f | 2008-02-27 23:33:50 +0000 | [diff] [blame] | 615 | |
Anton Korobeynikov | b9e58ef | 2008-07-09 13:21:08 +0000 | [diff] [blame] | 616 | if (!is64Bit) |
| 617 | // 32 bit targets always encode pointers as 4 bytes |
| 618 | Format = DW_EH_PE_sdata4; |
| 619 | else { |
| 620 | // 64 bit targets encode pointers in 4 bytes iff: |
| 621 | // - code model is small OR |
| 622 | // - code model is medium and we're emitting externally visible symbols |
| 623 | // or any code symbols |
| 624 | if (CM == CodeModel::Small || |
| 625 | (CM == CodeModel::Medium && (Global || |
| 626 | Reason != DwarfEncoding::Data))) |
Anton Korobeynikov | cee750f | 2008-02-27 23:33:50 +0000 | [diff] [blame] | 627 | Format = DW_EH_PE_sdata4; |
Anton Korobeynikov | cee750f | 2008-02-27 23:33:50 +0000 | [diff] [blame] | 628 | else |
Anton Korobeynikov | b9e58ef | 2008-07-09 13:21:08 +0000 | [diff] [blame] | 629 | Format = DW_EH_PE_sdata8; |
Anton Korobeynikov | cee750f | 2008-02-27 23:33:50 +0000 | [diff] [blame] | 630 | } |
Anton Korobeynikov | cee750f | 2008-02-27 23:33:50 +0000 | [diff] [blame] | 631 | |
Anton Korobeynikov | b9e58ef | 2008-07-09 13:21:08 +0000 | [diff] [blame] | 632 | if (Global) |
| 633 | Format |= DW_EH_PE_indirect; |
| 634 | |
| 635 | return (Format | DW_EH_PE_pcrel); |
| 636 | } else { |
| 637 | if (is64Bit && |
| 638 | (CM == CodeModel::Small || |
| 639 | (CM == CodeModel::Medium && Reason != DwarfEncoding::Data))) |
| 640 | return DW_EH_PE_udata4; |
| 641 | else |
| 642 | return DW_EH_PE_absptr; |
Anton Korobeynikov | cee750f | 2008-02-27 23:33:50 +0000 | [diff] [blame] | 643 | } |
| 644 | } |
| 645 | |
Anton Korobeynikov | b9a02fc | 2008-07-09 13:21:29 +0000 | [diff] [blame] | 646 | std::string |
| 647 | X86COFFTargetAsmInfo::UniqueSectionForGlobal(const GlobalValue* GV, |
| 648 | SectionKind::Kind kind) const { |
| 649 | switch (kind) { |
| 650 | case SectionKind::Text: |
| 651 | return ".text$linkonce" + GV->getName(); |
| 652 | case SectionKind::Data: |
| 653 | case SectionKind::BSS: |
| 654 | case SectionKind::ThreadData: |
| 655 | case SectionKind::ThreadBSS: |
| 656 | return ".data$linkonce" + GV->getName(); |
| 657 | case SectionKind::ROData: |
| 658 | case SectionKind::RODataMergeConst: |
| 659 | case SectionKind::RODataMergeStr: |
| 660 | return ".rdata$linkonce" + GV->getName(); |
Anton Korobeynikov | 29b03f7 | 2008-07-09 13:19:38 +0000 | [diff] [blame] | 661 | default: |
Anton Korobeynikov | b9a02fc | 2008-07-09 13:21:29 +0000 | [diff] [blame] | 662 | assert(0 && "Unknown section kind"); |
Anton Korobeynikov | 29b03f7 | 2008-07-09 13:19:38 +0000 | [diff] [blame] | 663 | } |
| 664 | } |
| 665 | |
Anton Korobeynikov | b20015b | 2008-07-09 13:25:26 +0000 | [diff] [blame] | 666 | unsigned |
| 667 | X86COFFTargetAsmInfo::SectionFlagsForGlobal(const GlobalValue *GV, |
| 668 | const char* name) const { |
| 669 | unsigned Flags = |
| 670 | TargetAsmInfo::SectionFlagsForGlobal(GV, |
| 671 | GV->getSection().c_str()); |
| 672 | |
| 673 | // Mark section as named, when needed (so, we we will need .section directive |
| 674 | // to switch into it). |
Anton Korobeynikov | 7e7fc82 | 2008-07-09 13:26:52 +0000 | [diff] [blame] | 675 | unsigned TypeFlags = Flags & SectionFlags::TypeFlags; |
| 676 | if (!TypeFlags /* Read-only section */ || |
| 677 | (TypeFlags & (SectionFlags::Mergeable | |
| 678 | SectionFlags::TLS | |
| 679 | SectionFlags::Linkonce))) |
Anton Korobeynikov | b20015b | 2008-07-09 13:25:26 +0000 | [diff] [blame] | 680 | Flags |= SectionFlags::Named; |
| 681 | |
| 682 | return Flags; |
| 683 | } |
| 684 | |
Anton Korobeynikov | f447e3d | 2008-07-09 13:21:49 +0000 | [diff] [blame] | 685 | std::string X86COFFTargetAsmInfo::PrintSectionFlags(unsigned flags) const { |
| 686 | std::string Flags = ",\""; |
| 687 | |
| 688 | if (flags & SectionFlags::Code) |
| 689 | Flags += 'x'; |
| 690 | if (flags & SectionFlags::Writeable) |
| 691 | Flags += 'w'; |
| 692 | |
| 693 | Flags += "\""; |
| 694 | |
| 695 | return Flags; |
| 696 | } |
| 697 | |
| 698 | X86WinTargetAsmInfo::X86WinTargetAsmInfo(const X86TargetMachine &TM): |
| 699 | X86TargetAsmInfo(TM) { |
| 700 | GlobalPrefix = "_"; |
| 701 | CommentString = ";"; |
| 702 | |
| 703 | PrivateGlobalPrefix = "$"; |
| 704 | AlignDirective = "\talign\t"; |
| 705 | ZeroDirective = "\tdb\t"; |
| 706 | ZeroDirectiveSuffix = " dup(0)"; |
| 707 | AsciiDirective = "\tdb\t"; |
| 708 | AscizDirective = 0; |
| 709 | Data8bitsDirective = "\tdb\t"; |
| 710 | Data16bitsDirective = "\tdw\t"; |
| 711 | Data32bitsDirective = "\tdd\t"; |
| 712 | Data64bitsDirective = "\tdq\t"; |
| 713 | HasDotTypeDotSizeDirective = false; |
| 714 | |
| 715 | TextSection = "_text"; |
| 716 | DataSection = "_data"; |
| 717 | JumpTableDataSection = NULL; |
| 718 | SwitchToSectionDirective = ""; |
| 719 | TextSectionStartSuffix = "\tsegment 'CODE'"; |
| 720 | DataSectionStartSuffix = "\tsegment 'DATA'"; |
| 721 | SectionEndDirectiveSuffix = "\tends\n"; |
| 722 | } |