1 //===-- MObjectFileInfo.cpp - Object File Information ---------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/MC/MCObjectFileInfo.h"
11 #include "llvm/MC/MCContext.h"
12 #include "llvm/MC/MCSection.h"
13 #include "llvm/MC/MCSectionCOFF.h"
14 #include "llvm/MC/MCSectionELF.h"
15 #include "llvm/MC/MCSectionMachO.h"
16 #include "llvm/ADT/Triple.h"
19 void MCObjectFileInfo::InitMachOMCObjectFileInfo(Triple T) {
21 IsFunctionEHFrameSymbolPrivate = false;
22 SupportsWeakOmittedEHFrame = false;
24 PersonalityEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel
25 | dwarf::DW_EH_PE_sdata4;
26 LSDAEncoding = FDEEncoding = FDECFIEncoding = dwarf::DW_EH_PE_pcrel;
27 TTypeEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel |
28 dwarf::DW_EH_PE_sdata4;
30 // .comm doesn't support alignment before Leopard.
31 if (T.isMacOSX() && T.isMacOSXVersionLT(10, 5))
32 CommDirectiveSupportsAlignment = false;
34 StructorOutputOrder = Structors::PriorityOrder;
37 = Ctx->getMachOSection("__TEXT", "__text",
38 MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
39 SectionKind::getText());
41 = Ctx->getMachOSection("__DATA", "__data", 0,
42 SectionKind::getDataRel());
44 TLSDataSection // .tdata
45 = Ctx->getMachOSection("__DATA", "__thread_data",
46 MCSectionMachO::S_THREAD_LOCAL_REGULAR,
47 SectionKind::getDataRel());
48 TLSBSSSection // .tbss
49 = Ctx->getMachOSection("__DATA", "__thread_bss",
50 MCSectionMachO::S_THREAD_LOCAL_ZEROFILL,
51 SectionKind::getThreadBSS());
53 // TODO: Verify datarel below.
55 = Ctx->getMachOSection("__DATA", "__thread_vars",
56 MCSectionMachO::S_THREAD_LOCAL_VARIABLES,
57 SectionKind::getDataRel());
60 = Ctx->getMachOSection("__DATA", "__thread_init",
61 MCSectionMachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS,
62 SectionKind::getDataRel());
64 CStringSection // .cstring
65 = Ctx->getMachOSection("__TEXT", "__cstring",
66 MCSectionMachO::S_CSTRING_LITERALS,
67 SectionKind::getMergeable1ByteCString());
69 = Ctx->getMachOSection("__TEXT","__ustring", 0,
70 SectionKind::getMergeable2ByteCString());
71 FourByteConstantSection // .literal4
72 = Ctx->getMachOSection("__TEXT", "__literal4",
73 MCSectionMachO::S_4BYTE_LITERALS,
74 SectionKind::getMergeableConst4());
75 EightByteConstantSection // .literal8
76 = Ctx->getMachOSection("__TEXT", "__literal8",
77 MCSectionMachO::S_8BYTE_LITERALS,
78 SectionKind::getMergeableConst8());
80 // ld_classic doesn't support .literal16 in 32-bit mode, and ld64 falls back
81 // to using it in -static mode.
82 SixteenByteConstantSection = 0;
83 if (RelocM != Reloc::Static &&
84 T.getArch() != Triple::x86_64 && T.getArch() != Triple::ppc64)
85 SixteenByteConstantSection = // .literal16
86 Ctx->getMachOSection("__TEXT", "__literal16",
87 MCSectionMachO::S_16BYTE_LITERALS,
88 SectionKind::getMergeableConst16());
90 ReadOnlySection // .const
91 = Ctx->getMachOSection("__TEXT", "__const", 0,
92 SectionKind::getReadOnly());
95 = Ctx->getMachOSection("__TEXT", "__textcoal_nt",
96 MCSectionMachO::S_COALESCED |
97 MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
98 SectionKind::getText());
100 = Ctx->getMachOSection("__TEXT", "__const_coal",
101 MCSectionMachO::S_COALESCED,
102 SectionKind::getReadOnly());
103 ConstDataSection // .const_data
104 = Ctx->getMachOSection("__DATA", "__const", 0,
105 SectionKind::getReadOnlyWithRel());
107 = Ctx->getMachOSection("__DATA","__datacoal_nt",
108 MCSectionMachO::S_COALESCED,
109 SectionKind::getDataRel());
111 = Ctx->getMachOSection("__DATA","__common",
112 MCSectionMachO::S_ZEROFILL,
113 SectionKind::getBSS());
115 = Ctx->getMachOSection("__DATA","__bss", MCSectionMachO::S_ZEROFILL,
116 SectionKind::getBSS());
119 LazySymbolPointerSection
120 = Ctx->getMachOSection("__DATA", "__la_symbol_ptr",
121 MCSectionMachO::S_LAZY_SYMBOL_POINTERS,
122 SectionKind::getMetadata());
123 NonLazySymbolPointerSection
124 = Ctx->getMachOSection("__DATA", "__nl_symbol_ptr",
125 MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS,
126 SectionKind::getMetadata());
128 if (RelocM == Reloc::Static) {
130 = Ctx->getMachOSection("__TEXT", "__constructor", 0,
131 SectionKind::getDataRel());
133 = Ctx->getMachOSection("__TEXT", "__destructor", 0,
134 SectionKind::getDataRel());
137 = Ctx->getMachOSection("__DATA", "__mod_init_func",
138 MCSectionMachO::S_MOD_INIT_FUNC_POINTERS,
139 SectionKind::getDataRel());
141 = Ctx->getMachOSection("__DATA", "__mod_term_func",
142 MCSectionMachO::S_MOD_TERM_FUNC_POINTERS,
143 SectionKind::getDataRel());
146 // Exception Handling.
147 LSDASection = Ctx->getMachOSection("__TEXT", "__gcc_except_tab", 0,
148 SectionKind::getReadOnlyWithRel());
150 if (T.isMacOSX() && !T.isMacOSXVersionLT(10, 6))
151 CompactUnwindSection =
152 Ctx->getMachOSection("__LD", "__compact_unwind",
153 MCSectionMachO::S_ATTR_DEBUG,
154 SectionKind::getReadOnly());
156 // Debug Information.
157 DwarfAccelNamesSection =
158 Ctx->getMachOSection("__DWARF", "__apple_names",
159 MCSectionMachO::S_ATTR_DEBUG,
160 SectionKind::getMetadata());
161 DwarfAccelObjCSection =
162 Ctx->getMachOSection("__DWARF", "__apple_objc",
163 MCSectionMachO::S_ATTR_DEBUG,
164 SectionKind::getMetadata());
165 // 16 character section limit...
166 DwarfAccelNamespaceSection =
167 Ctx->getMachOSection("__DWARF", "__apple_namespac",
168 MCSectionMachO::S_ATTR_DEBUG,
169 SectionKind::getMetadata());
170 DwarfAccelTypesSection =
171 Ctx->getMachOSection("__DWARF", "__apple_types",
172 MCSectionMachO::S_ATTR_DEBUG,
173 SectionKind::getMetadata());
176 Ctx->getMachOSection("__DWARF", "__debug_abbrev",
177 MCSectionMachO::S_ATTR_DEBUG,
178 SectionKind::getMetadata());
180 Ctx->getMachOSection("__DWARF", "__debug_info",
181 MCSectionMachO::S_ATTR_DEBUG,
182 SectionKind::getMetadata());
184 Ctx->getMachOSection("__DWARF", "__debug_line",
185 MCSectionMachO::S_ATTR_DEBUG,
186 SectionKind::getMetadata());
188 Ctx->getMachOSection("__DWARF", "__debug_frame",
189 MCSectionMachO::S_ATTR_DEBUG,
190 SectionKind::getMetadata());
191 DwarfPubTypesSection =
192 Ctx->getMachOSection("__DWARF", "__debug_pubtypes",
193 MCSectionMachO::S_ATTR_DEBUG,
194 SectionKind::getMetadata());
196 Ctx->getMachOSection("__DWARF", "__debug_str",
197 MCSectionMachO::S_ATTR_DEBUG,
198 SectionKind::getMetadata());
200 Ctx->getMachOSection("__DWARF", "__debug_loc",
201 MCSectionMachO::S_ATTR_DEBUG,
202 SectionKind::getMetadata());
203 DwarfARangesSection =
204 Ctx->getMachOSection("__DWARF", "__debug_aranges",
205 MCSectionMachO::S_ATTR_DEBUG,
206 SectionKind::getMetadata());
208 Ctx->getMachOSection("__DWARF", "__debug_ranges",
209 MCSectionMachO::S_ATTR_DEBUG,
210 SectionKind::getMetadata());
211 DwarfMacroInfoSection =
212 Ctx->getMachOSection("__DWARF", "__debug_macinfo",
213 MCSectionMachO::S_ATTR_DEBUG,
214 SectionKind::getMetadata());
215 DwarfDebugInlineSection =
216 Ctx->getMachOSection("__DWARF", "__debug_inlined",
217 MCSectionMachO::S_ATTR_DEBUG,
218 SectionKind::getMetadata());
220 TLSExtraDataSection = TLSTLVSection;
223 void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) {
224 if (T.getArch() == Triple::x86) {
225 PersonalityEncoding = (RelocM == Reloc::PIC_)
226 ? dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4
227 : dwarf::DW_EH_PE_absptr;
228 LSDAEncoding = (RelocM == Reloc::PIC_)
229 ? dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4
230 : dwarf::DW_EH_PE_absptr;
231 FDEEncoding = FDECFIEncoding = (RelocM == Reloc::PIC_)
232 ? dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4
233 : dwarf::DW_EH_PE_absptr;
234 TTypeEncoding = (RelocM == Reloc::PIC_)
235 ? dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4
236 : dwarf::DW_EH_PE_absptr;
237 } else if (T.getArch() == Triple::x86_64) {
238 FDECFIEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
240 if (RelocM == Reloc::PIC_) {
241 PersonalityEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel |
242 ((CMModel == CodeModel::Small || CMModel == CodeModel::Medium)
243 ? dwarf::DW_EH_PE_sdata4 : dwarf::DW_EH_PE_sdata8);
244 LSDAEncoding = dwarf::DW_EH_PE_pcrel |
245 (CMModel == CodeModel::Small
246 ? dwarf::DW_EH_PE_sdata4 : dwarf::DW_EH_PE_sdata8);
247 FDEEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
248 TTypeEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel |
249 ((CMModel == CodeModel::Small || CMModel == CodeModel::Medium)
250 ? dwarf::DW_EH_PE_sdata4 : dwarf::DW_EH_PE_sdata8);
252 PersonalityEncoding =
253 (CMModel == CodeModel::Small || CMModel == CodeModel::Medium)
254 ? dwarf::DW_EH_PE_udata4 : dwarf::DW_EH_PE_absptr;
255 LSDAEncoding = (CMModel == CodeModel::Small)
256 ? dwarf::DW_EH_PE_udata4 : dwarf::DW_EH_PE_absptr;
257 FDEEncoding = dwarf::DW_EH_PE_udata4;
258 TTypeEncoding = (CMModel == CodeModel::Small)
259 ? dwarf::DW_EH_PE_udata4 : dwarf::DW_EH_PE_absptr;
263 StructorOutputOrder = Structors::ReversePriorityOrder;
267 Ctx->getELFSection(".bss", ELF::SHT_NOBITS,
268 ELF::SHF_WRITE |ELF::SHF_ALLOC,
269 SectionKind::getBSS());
272 Ctx->getELFSection(".text", ELF::SHT_PROGBITS,
275 SectionKind::getText());
278 Ctx->getELFSection(".data", ELF::SHT_PROGBITS,
279 ELF::SHF_WRITE |ELF::SHF_ALLOC,
280 SectionKind::getDataRel());
283 Ctx->getELFSection(".rodata", ELF::SHT_PROGBITS,
285 SectionKind::getReadOnly());
288 Ctx->getELFSection(".tdata", ELF::SHT_PROGBITS,
289 ELF::SHF_ALLOC | ELF::SHF_TLS |
291 SectionKind::getThreadData());
294 Ctx->getELFSection(".tbss", ELF::SHT_NOBITS,
295 ELF::SHF_ALLOC | ELF::SHF_TLS |
297 SectionKind::getThreadBSS());
300 Ctx->getELFSection(".data.rel", ELF::SHT_PROGBITS,
301 ELF::SHF_ALLOC |ELF::SHF_WRITE,
302 SectionKind::getDataRel());
304 DataRelLocalSection =
305 Ctx->getELFSection(".data.rel.local", ELF::SHT_PROGBITS,
306 ELF::SHF_ALLOC |ELF::SHF_WRITE,
307 SectionKind::getDataRelLocal());
310 Ctx->getELFSection(".data.rel.ro", ELF::SHT_PROGBITS,
311 ELF::SHF_ALLOC |ELF::SHF_WRITE,
312 SectionKind::getReadOnlyWithRel());
314 DataRelROLocalSection =
315 Ctx->getELFSection(".data.rel.ro.local", ELF::SHT_PROGBITS,
316 ELF::SHF_ALLOC |ELF::SHF_WRITE,
317 SectionKind::getReadOnlyWithRelLocal());
319 MergeableConst4Section =
320 Ctx->getELFSection(".rodata.cst4", ELF::SHT_PROGBITS,
321 ELF::SHF_ALLOC |ELF::SHF_MERGE,
322 SectionKind::getMergeableConst4());
324 MergeableConst8Section =
325 Ctx->getELFSection(".rodata.cst8", ELF::SHT_PROGBITS,
326 ELF::SHF_ALLOC |ELF::SHF_MERGE,
327 SectionKind::getMergeableConst8());
329 MergeableConst16Section =
330 Ctx->getELFSection(".rodata.cst16", ELF::SHT_PROGBITS,
331 ELF::SHF_ALLOC |ELF::SHF_MERGE,
332 SectionKind::getMergeableConst16());
335 Ctx->getELFSection(".ctors", ELF::SHT_PROGBITS,
336 ELF::SHF_ALLOC |ELF::SHF_WRITE,
337 SectionKind::getDataRel());
340 Ctx->getELFSection(".dtors", ELF::SHT_PROGBITS,
341 ELF::SHF_ALLOC |ELF::SHF_WRITE,
342 SectionKind::getDataRel());
344 // Exception Handling Sections.
346 // FIXME: We're emitting LSDA info into a readonly section on ELF, even though
347 // it contains relocatable pointers. In PIC mode, this is probably a big
348 // runtime hit for C++ apps. Either the contents of the LSDA need to be
349 // adjusted or this should be a data section.
351 Ctx->getELFSection(".gcc_except_table", ELF::SHT_PROGBITS,
353 SectionKind::getReadOnly());
355 // Debug Info Sections.
357 Ctx->getELFSection(".debug_abbrev", ELF::SHT_PROGBITS, 0,
358 SectionKind::getMetadata());
360 Ctx->getELFSection(".debug_info", ELF::SHT_PROGBITS, 0,
361 SectionKind::getMetadata());
363 Ctx->getELFSection(".debug_line", ELF::SHT_PROGBITS, 0,
364 SectionKind::getMetadata());
366 Ctx->getELFSection(".debug_frame", ELF::SHT_PROGBITS, 0,
367 SectionKind::getMetadata());
368 DwarfPubTypesSection =
369 Ctx->getELFSection(".debug_pubtypes", ELF::SHT_PROGBITS, 0,
370 SectionKind::getMetadata());
372 Ctx->getELFSection(".debug_str", ELF::SHT_PROGBITS,
373 ELF::SHF_MERGE | ELF::SHF_STRINGS,
374 SectionKind::getMergeable1ByteCString());
376 Ctx->getELFSection(".debug_loc", ELF::SHT_PROGBITS, 0,
377 SectionKind::getMetadata());
378 DwarfARangesSection =
379 Ctx->getELFSection(".debug_aranges", ELF::SHT_PROGBITS, 0,
380 SectionKind::getMetadata());
382 Ctx->getELFSection(".debug_ranges", ELF::SHT_PROGBITS, 0,
383 SectionKind::getMetadata());
384 DwarfMacroInfoSection =
385 Ctx->getELFSection(".debug_macinfo", ELF::SHT_PROGBITS, 0,
386 SectionKind::getMetadata());
390 void MCObjectFileInfo::InitCOFFMCObjectFileInfo(Triple T) {
392 StructorOutputOrder = Structors::ReversePriorityOrder;
395 Ctx->getCOFFSection(".text",
396 COFF::IMAGE_SCN_CNT_CODE |
397 COFF::IMAGE_SCN_MEM_EXECUTE |
398 COFF::IMAGE_SCN_MEM_READ,
399 SectionKind::getText());
401 Ctx->getCOFFSection(".data",
402 COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
403 COFF::IMAGE_SCN_MEM_READ |
404 COFF::IMAGE_SCN_MEM_WRITE,
405 SectionKind::getDataRel());
407 Ctx->getCOFFSection(".rdata",
408 COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
409 COFF::IMAGE_SCN_MEM_READ,
410 SectionKind::getReadOnly());
412 Ctx->getCOFFSection(".ctors",
413 COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
414 COFF::IMAGE_SCN_MEM_READ |
415 COFF::IMAGE_SCN_MEM_WRITE,
416 SectionKind::getDataRel());
418 Ctx->getCOFFSection(".dtors",
419 COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
420 COFF::IMAGE_SCN_MEM_READ |
421 COFF::IMAGE_SCN_MEM_WRITE,
422 SectionKind::getDataRel());
424 // FIXME: We're emitting LSDA info into a readonly section on COFF, even
425 // though it contains relocatable pointers. In PIC mode, this is probably a
426 // big runtime hit for C++ apps. Either the contents of the LSDA need to be
427 // adjusted or this should be a data section.
429 Ctx->getCOFFSection(".gcc_except_table",
430 COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
431 COFF::IMAGE_SCN_MEM_READ,
432 SectionKind::getReadOnly());
436 Ctx->getCOFFSection(".debug_abbrev",
437 COFF::IMAGE_SCN_MEM_DISCARDABLE |
438 COFF::IMAGE_SCN_MEM_READ,
439 SectionKind::getMetadata());
441 Ctx->getCOFFSection(".debug_info",
442 COFF::IMAGE_SCN_MEM_DISCARDABLE |
443 COFF::IMAGE_SCN_MEM_READ,
444 SectionKind::getMetadata());
446 Ctx->getCOFFSection(".debug_line",
447 COFF::IMAGE_SCN_MEM_DISCARDABLE |
448 COFF::IMAGE_SCN_MEM_READ,
449 SectionKind::getMetadata());
451 Ctx->getCOFFSection(".debug_frame",
452 COFF::IMAGE_SCN_MEM_DISCARDABLE |
453 COFF::IMAGE_SCN_MEM_READ,
454 SectionKind::getMetadata());
455 DwarfPubTypesSection =
456 Ctx->getCOFFSection(".debug_pubtypes",
457 COFF::IMAGE_SCN_MEM_DISCARDABLE |
458 COFF::IMAGE_SCN_MEM_READ,
459 SectionKind::getMetadata());
461 Ctx->getCOFFSection(".debug_str",
462 COFF::IMAGE_SCN_MEM_DISCARDABLE |
463 COFF::IMAGE_SCN_MEM_READ,
464 SectionKind::getMetadata());
466 Ctx->getCOFFSection(".debug_loc",
467 COFF::IMAGE_SCN_MEM_DISCARDABLE |
468 COFF::IMAGE_SCN_MEM_READ,
469 SectionKind::getMetadata());
470 DwarfARangesSection =
471 Ctx->getCOFFSection(".debug_aranges",
472 COFF::IMAGE_SCN_MEM_DISCARDABLE |
473 COFF::IMAGE_SCN_MEM_READ,
474 SectionKind::getMetadata());
476 Ctx->getCOFFSection(".debug_ranges",
477 COFF::IMAGE_SCN_MEM_DISCARDABLE |
478 COFF::IMAGE_SCN_MEM_READ,
479 SectionKind::getMetadata());
480 DwarfMacroInfoSection =
481 Ctx->getCOFFSection(".debug_macinfo",
482 COFF::IMAGE_SCN_MEM_DISCARDABLE |
483 COFF::IMAGE_SCN_MEM_READ,
484 SectionKind::getMetadata());
487 Ctx->getCOFFSection(".drectve",
488 COFF::IMAGE_SCN_LNK_INFO,
489 SectionKind::getMetadata());
492 Ctx->getCOFFSection(".pdata",
493 COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
494 COFF::IMAGE_SCN_MEM_READ |
495 COFF::IMAGE_SCN_MEM_WRITE,
496 SectionKind::getDataRel());
499 Ctx->getCOFFSection(".xdata",
500 COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
501 COFF::IMAGE_SCN_MEM_READ |
502 COFF::IMAGE_SCN_MEM_WRITE,
503 SectionKind::getDataRel());
506 void MCObjectFileInfo::InitMCObjectFileInfo(StringRef TT, Reloc::Model relocm,
514 CommDirectiveSupportsAlignment = true;
515 SupportsWeakOmittedEHFrame = true;
516 IsFunctionEHFrameSymbolPrivate = true;
518 PersonalityEncoding = LSDAEncoding = FDEEncoding = FDECFIEncoding =
519 TTypeEncoding = dwarf::DW_EH_PE_absptr;
521 EHFrameSection = 0; // Created on demand.
522 CompactUnwindSection = 0; // Used only by selected targets.
523 DwarfAccelNamesSection = 0; // Used only by selected targets.
524 DwarfAccelObjCSection = 0; // Used only by selected targets.
525 DwarfAccelNamespaceSection = 0; // Used only by selected targets.
526 DwarfAccelTypesSection = 0; // Used only by selected targets.
529 Triple::ArchType Arch = T.getArch();
530 // FIXME: Checking for Arch here to filter out bogus triples such as
531 // cellspu-apple-darwin. Perhaps we should fix in Triple?
532 if ((Arch == Triple::x86 || Arch == Triple::x86_64 ||
533 Arch == Triple::arm || Arch == Triple::thumb ||
534 Arch == Triple::ppc || Arch == Triple::ppc64 ||
535 Arch == Triple::UnknownArch) &&
536 (T.isOSDarwin() || T.getEnvironment() == Triple::MachO)) {
538 InitMachOMCObjectFileInfo(T);
539 } else if ((Arch == Triple::x86 || Arch == Triple::x86_64) &&
540 (T.getOS() == Triple::MinGW32 || T.getOS() == Triple::Cygwin ||
541 T.getOS() == Triple::Win32)) {
543 InitCOFFMCObjectFileInfo(T);
546 InitELFMCObjectFileInfo(T);
550 void MCObjectFileInfo::InitEHFrameSection() {
553 Ctx->getMachOSection("__TEXT", "__eh_frame",
554 MCSectionMachO::S_COALESCED |
555 MCSectionMachO::S_ATTR_NO_TOC |
556 MCSectionMachO::S_ATTR_STRIP_STATIC_SYMS |
557 MCSectionMachO::S_ATTR_LIVE_SUPPORT,
558 SectionKind::getReadOnly());
559 else if (Env == IsELF)
561 Ctx->getELFSection(".eh_frame", ELF::SHT_PROGBITS,
563 SectionKind::getDataRel());
566 Ctx->getCOFFSection(".eh_frame",
567 COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
568 COFF::IMAGE_SCN_MEM_READ |
569 COFF::IMAGE_SCN_MEM_WRITE,
570 SectionKind::getDataRel());