xref: /freebsd/contrib/llvm-project/llvm/include/llvm/ExecutionEngine/Orc/Shared/ObjectFormats.h (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1 //===------ ObjectFormats.h - Object format details for ORC -----*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // ORC-specific object format details.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_EXECUTIONENGINE_ORC_SHARED_OBJECTFORMATS_H
14 #define LLVM_EXECUTIONENGINE_ORC_SHARED_OBJECTFORMATS_H
15 
16 #include "llvm/ADT/StringRef.h"
17 
18 namespace llvm {
19 namespace orc {
20 
21 // MachO section names.
22 
23 extern StringRef MachODataCommonSectionName;
24 extern StringRef MachODataDataSectionName;
25 extern StringRef MachOEHFrameSectionName;
26 extern StringRef MachOCompactUnwindInfoSectionName;
27 extern StringRef MachOCStringSectionName;
28 extern StringRef MachOModInitFuncSectionName;
29 extern StringRef MachOObjCCatListSectionName;
30 extern StringRef MachOObjCCatList2SectionName;
31 extern StringRef MachOObjCClassListSectionName;
32 extern StringRef MachOObjCClassNameSectionName;
33 extern StringRef MachOObjCClassRefsSectionName;
34 extern StringRef MachOObjCConstSectionName;
35 extern StringRef MachOObjCDataSectionName;
36 extern StringRef MachOObjCImageInfoSectionName;
37 extern StringRef MachOObjCMethNameSectionName;
38 extern StringRef MachOObjCMethTypeSectionName;
39 extern StringRef MachOObjCNLCatListSectionName;
40 extern StringRef MachOObjCNLClassListSectionName;
41 extern StringRef MachOObjCProtoListSectionName;
42 extern StringRef MachOObjCProtoRefsSectionName;
43 extern StringRef MachOObjCSelRefsSectionName;
44 extern StringRef MachOSwift5ProtoSectionName;
45 extern StringRef MachOSwift5ProtosSectionName;
46 extern StringRef MachOSwift5TypesSectionName;
47 extern StringRef MachOSwift5TypeRefSectionName;
48 extern StringRef MachOSwift5FieldMetadataSectionName;
49 extern StringRef MachOSwift5EntrySectionName;
50 extern StringRef MachOThreadBSSSectionName;
51 extern StringRef MachOThreadDataSectionName;
52 extern StringRef MachOThreadVarsSectionName;
53 
54 extern StringRef MachOInitSectionNames[22];
55 
56 // ELF section names.
57 extern StringRef ELFEHFrameSectionName;
58 
59 extern StringRef ELFInitArrayFuncSectionName;
60 extern StringRef ELFInitFuncSectionName;
61 extern StringRef ELFFiniArrayFuncSectionName;
62 extern StringRef ELFFiniFuncSectionName;
63 extern StringRef ELFCtorArrayFuncSectionName;
64 extern StringRef ELFDtorArrayFuncSectionName;
65 
66 extern StringRef ELFInitSectionNames[3];
67 
68 extern StringRef ELFThreadBSSSectionName;
69 extern StringRef ELFThreadDataSectionName;
70 
71 bool isMachOInitializerSection(StringRef SegName, StringRef SecName);
72 bool isMachOInitializerSection(StringRef QualifiedName);
73 
74 bool isELFInitializerSection(StringRef SecName);
75 
76 bool isCOFFInitializerSection(StringRef Name);
77 
78 } // end namespace orc
79 } // end namespace llvm
80 
81 #endif // LLVM_EXECUTIONENGINE_ORC_SHARED_MEMORYFLAGS_H
82