LLVM 22.0.0git
XCOFF.h
Go to the documentation of this file.
1//===-- llvm/BinaryFormat/XCOFF.h - The XCOFF file format -------*- 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// This file defines manifest constants for the XCOFF object file format.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_BINARYFORMAT_XCOFF_H
14#define LLVM_BINARYFORMAT_XCOFF_H
15
17#include <stddef.h>
18#include <stdint.h>
19
20namespace llvm {
21class StringRef;
22template <unsigned> class SmallString;
23template <typename T> class Expected;
24
25namespace XCOFF {
26
27// Constants used in the XCOFF definition.
28
29constexpr size_t FileNamePadSize = 6;
30constexpr size_t NameSize = 8;
31constexpr size_t AuxFileEntNameSize = 14;
32constexpr size_t FileHeaderSize32 = 20;
33constexpr size_t FileHeaderSize64 = 24;
34constexpr size_t AuxFileHeaderSize32 = 72;
35constexpr size_t AuxFileHeaderSize64 = 110;
36constexpr size_t AuxFileHeaderSizeShort = 28;
37constexpr size_t SectionHeaderSize32 = 40;
38constexpr size_t SectionHeaderSize64 = 72;
39constexpr size_t SymbolTableEntrySize = 18;
40constexpr size_t RelocationSerializationSize32 = 10;
41constexpr size_t RelocationSerializationSize64 = 14;
42constexpr size_t ExceptionSectionEntrySize32 = 6;
43constexpr size_t ExceptionSectionEntrySize64 = 10;
44constexpr uint16_t RelocOverflow = 65535;
45constexpr uint8_t AllocRegNo = 31;
46
47enum ReservedSectionNum : int16_t { N_DEBUG = -2, N_ABS = -1, N_UNDEF = 0 };
48
49enum MagicNumber : uint16_t { XCOFF32 = 0x01DF, XCOFF64 = 0x01F7 };
50
51// Masks for packing/unpacking the r_rsize field of relocations.
52
53// The msb is used to indicate if the bits being relocated are signed or
54// unsigned.
55static constexpr uint8_t XR_SIGN_INDICATOR_MASK = 0x80;
56// The 2nd msb is used to indicate that the binder has replaced/modified the
57// original instruction.
58static constexpr uint8_t XR_FIXUP_INDICATOR_MASK = 0x40;
59// The remaining bits specify the bit length of the relocatable reference
60// minus one.
61static constexpr uint8_t XR_BIASED_LENGTH_MASK = 0x3f;
62
63// This field only exists in the XCOFF64 definition.
65 SHR_SYMTAB = 0x8000, ///< At exec time, create shared symbol table for program
66 ///< (main program only).
67 FORK_POLICY = 0x4000, ///< Forktree policy specified (main program only).
68 FORK_COR = 0x2000 ///< If _AOUT_FORK_POLICY is set, specify copy-on-reference
69 ///< if this bit is set. Specify copy-on- write otherwise.
70 ///< If _AOUT_FORK_POLICY is 0, this bit is reserved for
71 ///< future use and should be set to 0.
72};
73
77};
78
80 F_RELFLG = 0x0001, ///< relocation info stripped from file
81 F_EXEC = 0x0002, ///< file is executable (i.e., it
82 ///< has a loader section)
83 F_LNNO = 0x0004, ///< line numbers stripped from file
84 F_LSYMS = 0x0008, ///< local symbols stripped from file
85 F_FDPR_PROF = 0x0010, ///< file was profiled with FDPR
86 F_FDPR_OPTI = 0x0020, ///< file was reordered with FDPR
87 F_DSA = 0x0040, ///< file uses Dynamic Segment Allocation (32-bit
88 ///< only)
89 F_DEP_1 = 0x0080, ///< Data Execution Protection bit 1
90 F_VARPG = 0x0100, ///< executable requests using variable size pages
91 F_LPTEXT = 0x0400, ///< executable requires large pages for text
92 F_LPDATA = 0x0800, ///< executable requires large pages for data
93 F_DYNLOAD = 0x1000, ///< file is dynamically loadable and
94 ///< executable (equivalent to F_EXEC on AIX)
95 F_SHROBJ = 0x2000, ///< file is a shared object
97 0x4000, ///< file can be loaded by the system loader, but it is
98 ///< ignored by the linker if it is a member of an archive.
99 F_DEP_2 = 0x8000 ///< Data Execution Protection bit 2
101
102// x_smclas field of x_csect from system header: /usr/include/syms.h
103/// Storage Mapping Class definitions.
105 // READ ONLY CLASSES
106 XMC_PR = 0, ///< Program Code
107 XMC_RO = 1, ///< Read Only Constant
108 XMC_DB = 2, ///< Debug Dictionary Table
109 XMC_GL = 6, ///< Global Linkage (Interfile Interface Code)
110 XMC_XO = 7, ///< Extended Operation (Pseudo Machine Instruction)
111 XMC_SV = 8, ///< Supervisor Call (32-bit process only)
112 XMC_SV64 = 17, ///< Supervisor Call for 64-bit process
113 XMC_SV3264 = 18, ///< Supervisor Call for both 32- and 64-bit processes
114 XMC_TI = 12, ///< Traceback Index csect
115 XMC_TB = 13, ///< Traceback Table csect
116
117 // READ WRITE CLASSES
118 XMC_RW = 5, ///< Read Write Data
119 XMC_TC0 = 15, ///< TOC Anchor for TOC Addressability
120 XMC_TC = 3, ///< General TOC item
121 XMC_TD = 16, ///< Scalar data item in the TOC
122 XMC_DS = 10, ///< Descriptor csect
123 XMC_UA = 4, ///< Unclassified - Treated as Read Write
124 XMC_BS = 9, ///< BSS class (uninitialized static internal)
125 XMC_UC = 11, ///< Un-named Fortran Common
126
127 XMC_TL = 20, ///< Initialized thread-local variable
128 XMC_UL = 21, ///< Uninitialized thread-local variable
129 XMC_TE = 22 ///< Symbol mapped at the end of TOC
131
132// Flags for defining the section type. Masks for use with the (signed, 32-bit)
133// s_flags field of the section header structure, selecting for values in the
134// lower 16 bits. Defined in the system header `scnhdr.h`.
135enum SectionTypeFlags : int32_t {
136 STYP_PAD = 0x0008,
137 STYP_DWARF = 0x0010,
138 STYP_TEXT = 0x0020,
139 STYP_DATA = 0x0040,
140 STYP_BSS = 0x0080,
141 STYP_EXCEPT = 0x0100,
142 STYP_INFO = 0x0200,
143 STYP_TDATA = 0x0400,
144 STYP_TBSS = 0x0800,
145 STYP_LOADER = 0x1000,
146 STYP_DEBUG = 0x2000,
147 STYP_TYPCHK = 0x4000,
148 STYP_OVRFLO = 0x8000
150
151/// Values for defining the section subtype of sections of type STYP_DWARF as
152/// they would appear in the (signed, 32-bit) s_flags field of the section
153/// header structure, contributing to the 16 most significant bits. Defined in
154/// the system header `scnhdr.h`.
156 SSUBTYP_DWINFO = 0x1'0000, ///< DWARF info section
157 SSUBTYP_DWLINE = 0x2'0000, ///< DWARF line section
158 SSUBTYP_DWPBNMS = 0x3'0000, ///< DWARF pubnames section
159 SSUBTYP_DWPBTYP = 0x4'0000, ///< DWARF pubtypes section
160 SSUBTYP_DWARNGE = 0x5'0000, ///< DWARF aranges section
161 SSUBTYP_DWABREV = 0x6'0000, ///< DWARF abbrev section
162 SSUBTYP_DWSTR = 0x7'0000, ///< DWARF str section
163 SSUBTYP_DWRNGES = 0x8'0000, ///< DWARF ranges section
164 SSUBTYP_DWLOC = 0x9'0000, ///< DWARF loc section
165 SSUBTYP_DWFRAME = 0xA'0000, ///< DWARF frame section
166 SSUBTYP_DWMAC = 0xB'0000 ///< DWARF macinfo section
168
169// STORAGE CLASSES, n_sclass field of syment.
170// The values come from `storclass.h` and `dbxstclass.h`.
172 // Storage classes used for symbolic debugging symbols.
173 C_FILE = 103, // File name
174 C_BINCL = 108, // Beginning of include file
175 C_EINCL = 109, // Ending of include file
176 C_GSYM = 128, // Global variable
177 C_STSYM = 133, // Statically allocated symbol
178 C_BCOMM = 135, // Beginning of common block
179 C_ECOMM = 137, // End of common block
180 C_ENTRY = 141, // Alternate entry
181 C_BSTAT = 143, // Beginning of static block
182 C_ESTAT = 144, // End of static block
183 C_GTLS = 145, // Global thread-local variable
184 C_STTLS = 146, // Static thread-local variable
185
186 // Storage classes used for DWARF symbols.
187 C_DWARF = 112, // DWARF section symbol
188
189 // Storage classes used for absolute symbols.
190 C_LSYM = 129, // Automatic variable allocated on stack
191 C_PSYM = 130, // Argument to subroutine allocated on stack
192 C_RSYM = 131, // Register variable
193 C_RPSYM = 132, // Argument to function or procedure stored in register
194 C_ECOML = 136, // Local member of common block
195 C_FUN = 142, // Function or procedure
196
197 // Storage classes used for undefined external symbols or
198 // symbols of general sections.
199 C_EXT = 2, // External symbol
200 C_WEAKEXT = 111, // Weak external symbol
201
202 // Storage classes used for symbols of general sections.
204 C_STAT = 3, // Static
205 C_BLOCK = 100, // ".bb" or ".eb"
206 C_FCN = 101, // ".bf" or ".ef"
207 C_HIDEXT = 107, // Un-named external symbol
208 C_INFO = 110, // Comment string in .info section
209 C_DECL = 140, // Declaration of object (type)
210
211 // Storage classes - Obsolete/Undocumented.
212 C_AUTO = 1, // Automatic variable
213 C_REG = 4, // Register variable
214 C_EXTDEF = 5, // External definition
215 C_LABEL = 6, // Label
216 C_ULABEL = 7, // Undefined label
217 C_MOS = 8, // Member of structure
218 C_ARG = 9, // Function argument
219 C_STRTAG = 10, // Structure tag
220 C_MOU = 11, // Member of union
221 C_UNTAG = 12, // Union tag
222 C_TPDEF = 13, // Type definition
223 C_USTATIC = 14, // Undefined static
224 C_ENTAG = 15, // Enumeration tag
225 C_MOE = 16, // Member of enumeration
226 C_REGPARM = 17, // Register parameter
227 C_FIELD = 18, // Bit field
228 C_EOS = 102, // End of structure
229 C_LINE = 104,
230 C_ALIAS = 105, // Duplicate tag
231 C_HIDDEN = 106, // Special storage class for external
232 C_EFCN = 255, // Physical end of function
233
234 // Storage classes - reserved
235 C_TCSYM = 134 // Reserved
237
238// Flags for defining the symbol type. Values to be encoded into the lower 3
239// bits of the (unsigned, 8-bit) x_smtyp field of csect auxiliary symbol table
240// entries. Defined in the system header `syms.h`.
242 XTY_ER = 0, ///< External reference.
243 XTY_SD = 1, ///< Csect definition for initialized storage.
244 XTY_LD = 2, ///< Label definition.
245 ///< Defines an entry point to an initialized csect.
246 XTY_CM = 3 ///< Common csect definition. For uninitialized storage.
248
249/// Values for visibility as they would appear when encoded in the high 4 bits
250/// of the 16-bit unsigned n_type field of symbol table entries. Valid for
251/// 32-bit XCOFF only when the vstamp in the auxiliary header is greater than 1.
255 SYM_V_HIDDEN = 0x2000,
257 SYM_V_EXPORTED = 0x4000
259
260constexpr uint16_t VISIBILITY_MASK = 0x7000;
261
262// Relocation types, defined in `/usr/include/reloc.h`.
264 R_POS = 0x00, ///< Positive relocation. Provides the address of the referenced
265 ///< symbol.
266 R_RL = 0x0c, ///< Positive indirect load relocation. Modifiable instruction.
267 R_RLA = 0x0d, ///< Positive load address relocation. Modifiable instruction.
268
269 R_NEG = 0x01, ///< Negative relocation. Provides the negative of the address
270 ///< of the referenced symbol.
271 R_REL = 0x02, ///< Relative to self relocation. Provides a displacement value
272 ///< between the address of the referenced symbol and the
273 ///< address being relocated.
274
275 R_TOC = 0x03, ///< Relative to the TOC relocation. Provides a displacement
276 ///< that is the difference between the address of the
277 ///< referenced symbol and the TOC anchor csect.
278 R_TRL = 0x12, ///< TOC relative indirect load relocation. Similar to R_TOC,
279 ///< but not modifiable instruction.
280
281 R_TRLA =
282 0x13, ///< Relative to the TOC or to the thread-local storage base
283 ///< relocation. Compilers are not permitted to generate this
284 ///< relocation type. It is the result of a reversible
285 ///< transformation by the linker of an R_TOC relation that turned a
286 ///< load instruction into an add-immediate instruction.
287
288 R_GL = 0x05, ///< Global linkage-external TOC address relocation. Provides the
289 ///< address of the external TOC associated with a defined
290 ///< external symbol.
291 R_TCL = 0x06, ///< Local object TOC address relocation. Provides the address
292 ///< of the local TOC entry of a defined external symbol.
293
294 R_REF = 0x0f, ///< A non-relocating relocation. Used to prevent the binder
295 ///< from garbage collecting a csect (such as code used for
296 ///< dynamic initialization of non-local statics) for which
297 ///< another csect has an implicit dependency.
298
299 R_BA = 0x08, ///< Branch absolute relocation. Provides the address of the
300 ///< referenced symbol. References a non-modifiable instruction.
301 R_BR = 0x0a, ///< Branch relative to self relocation. Provides the
302 ///< displacement that is the difference between the address of
303 ///< the referenced symbol and the address of the referenced
304 ///< branch instruction. References a non-modifiable instruction.
305 R_RBA = 0x18, ///< Branch absolute relocation. Similar to R_BA but
306 ///< references a modifiable instruction.
307 R_RBR = 0x1a, ///< Branch relative to self relocation. Similar to the R_BR
308 ///< relocation type, but references a modifiable instruction.
309
310 R_TLS = 0x20, ///< General-dynamic reference to TLS symbol.
311 R_TLS_IE = 0x21, ///< Initial-exec reference to TLS symbol.
312 R_TLS_LD = 0x22, ///< Local-dynamic reference to TLS symbol.
313 R_TLS_LE = 0x23, ///< Local-exec reference to TLS symbol.
314 R_TLSM = 0x24, ///< Module reference to TLS. Provides a handle for the module
315 ///< containing the referenced symbol.
316 R_TLSML = 0x25, ///< Module reference to the local TLS storage.
317
318 R_TOCU = 0x30, ///< Relative to TOC upper. Specifies the high-order 16 bits of
319 ///< a large code model TOC-relative relocation.
320 R_TOCL = 0x31 ///< Relative to TOC lower. Specifies the low-order 16 bits of a
321 ///< large code model TOC-relative relocation.
323
325 XFT_FN = 0, ///< Specifies the source-file name.
326 XFT_CT = 1, ///< Specifies the compiler time stamp.
327 XFT_CV = 2, ///< Specifies the compiler version number.
328 XFT_CD = 128 ///< Specifies compiler-defined information.
330
332 TB_C = 0, ///< C language.
333 TB_Fortran = 1, ///< Fortran language.
334 TB_CPLUSPLUS = 9 ///< C++ language.
336
337// XCOFF specific CPU IDs, defined in AIX OS header: `/usr/include/aouthdr.h`.
339 TCPU_INVALID = 0, ///< Invalid id - assumes POWER for old objects.
340 TCPU_PPC = 1, ///< PowerPC common architecture 32 bit mode.
341 TCPU_PPC64 = 2, ///< PowerPC common architecture 64-bit mode.
342 TCPU_COM = 3, ///< POWER and PowerPC architecture common.
343 TCPU_PWR = 4, ///< POWER common architecture objects.
344 TCPU_ANY = 5, ///< Mixture of any incompatable POWER
345 ///< and PowerPC architecture implementations.
346 TCPU_601 = 6, ///< 601 implementation of PowerPC architecture.
347 TCPU_603 = 7, ///< 603 implementation of PowerPC architecture.
348 TCPU_604 = 8, ///< 604 implementation of PowerPC architecture.
349
350 // The following are PowerPC 64-bit architectures.
362
363 TCPU_PWRX = 224 ///< RS2 implementation of POWER architecture.
365
367 AUX_EXCEPT = 255, ///< Identifies an exception auxiliary entry.
368 AUX_FCN = 254, ///< Identifies a function auxiliary entry.
369 AUX_SYM = 253, ///< Identifies a symbol auxiliary entry.
370 AUX_FILE = 252, ///< Identifies a file auxiliary entry.
371 AUX_CSECT = 251, ///< Identifies a csect auxiliary entry.
372 AUX_SECT = 250 ///< Identifies a SECT auxiliary entry.
373}; // 64-bit XCOFF file only.
374
379 unsigned FixedParmsNum,
380 unsigned FloatingParmsNum);
382parseParmsTypeWithVecInfo(uint32_t Value, unsigned FixedParmsNum,
383 unsigned FloatingParmsNum, unsigned VectorParmsNum);
385 unsigned ParmsNum);
386
405 };
406 // Byte 1
407 static constexpr uint32_t VersionMask = 0xFF00'0000;
408 static constexpr uint8_t VersionShift = 24;
409
410 // Byte 2
411 static constexpr uint32_t LanguageIdMask = 0x00FF'0000;
412 static constexpr uint8_t LanguageIdShift = 16;
413
414 // Byte 3
415 static constexpr uint32_t IsGlobaLinkageMask = 0x0000'8000;
416 static constexpr uint32_t IsOutOfLineEpilogOrPrologueMask = 0x0000'4000;
417 static constexpr uint32_t HasTraceBackTableOffsetMask = 0x0000'2000;
418 static constexpr uint32_t IsInternalProcedureMask = 0x0000'1000;
419 static constexpr uint32_t HasControlledStorageMask = 0x0000'0800;
420 static constexpr uint32_t IsTOClessMask = 0x0000'0400;
421 static constexpr uint32_t IsFloatingPointPresentMask = 0x0000'0200;
423 0x0000'0100;
424
425 // Byte 4
426 static constexpr uint32_t IsInterruptHandlerMask = 0x0000'0080;
427 static constexpr uint32_t IsFunctionNamePresentMask = 0x0000'0040;
428 static constexpr uint32_t IsAllocaUsedMask = 0x0000'0020;
429 static constexpr uint32_t OnConditionDirectiveMask = 0x0000'001C;
430 static constexpr uint32_t IsCRSavedMask = 0x0000'0002;
431 static constexpr uint32_t IsLRSavedMask = 0x0000'0001;
432 static constexpr uint8_t OnConditionDirectiveShift = 2;
433
434 // Byte 5
435 static constexpr uint32_t IsBackChainStoredMask = 0x8000'0000;
436 static constexpr uint32_t IsFixupMask = 0x4000'0000;
437 static constexpr uint32_t FPRSavedMask = 0x3F00'0000;
438 static constexpr uint32_t FPRSavedShift = 24;
439
440 // Byte 6
441 static constexpr uint32_t HasExtensionTableMask = 0x0080'0000;
442 static constexpr uint32_t HasVectorInfoMask = 0x0040'0000;
443 static constexpr uint32_t GPRSavedMask = 0x003F'0000;
444 static constexpr uint32_t GPRSavedShift = 16;
445
446 // Byte 7
447 static constexpr uint32_t NumberOfFixedParmsMask = 0x0000'FF00;
448 static constexpr uint8_t NumberOfFixedParmsShift = 8;
449
450 // Byte 8
451 static constexpr uint32_t NumberOfFloatingPointParmsMask = 0x0000'00FE;
452 static constexpr uint32_t HasParmsOnStackMask = 0x0000'0001;
454
455 // Masks to select leftmost bits for decoding parameter type information.
456 // Bit to use when vector info is not presented.
457 static constexpr uint32_t ParmTypeIsFloatingBit = 0x8000'0000;
458 static constexpr uint32_t ParmTypeFloatingIsDoubleBit = 0x4000'0000;
459 // Bits to use when vector info is presented.
460 static constexpr uint32_t ParmTypeIsFixedBits = 0x0000'0000;
461 static constexpr uint32_t ParmTypeIsVectorBits = 0x4000'0000;
462 static constexpr uint32_t ParmTypeIsFloatingBits = 0x8000'0000;
463 static constexpr uint32_t ParmTypeIsDoubleBits = 0xC000'0000;
464 static constexpr uint32_t ParmTypeMask = 0xC000'0000;
465
466 // Vector extension
467 static constexpr uint16_t NumberOfVRSavedMask = 0xFC00;
468 static constexpr uint16_t IsVRSavedOnStackMask = 0x0200;
469 static constexpr uint16_t HasVarArgsMask = 0x0100;
470 static constexpr uint8_t NumberOfVRSavedShift = 10;
471
472 static constexpr uint16_t NumberOfVectorParmsMask = 0x00FE;
473 static constexpr uint16_t HasVMXInstructionMask = 0x0001;
474 static constexpr uint8_t NumberOfVectorParmsShift = 1;
475
476 static constexpr uint32_t ParmTypeIsVectorCharBit = 0x0000'0000;
477 static constexpr uint32_t ParmTypeIsVectorShortBit = 0x4000'0000;
478 static constexpr uint32_t ParmTypeIsVectorIntBit = 0x8000'0000;
479 static constexpr uint32_t ParmTypeIsVectorFloatBit = 0xC000'0000;
480
481 static constexpr uint8_t WidthOfParamType = 2;
482};
483
484// Extended Traceback table flags.
486 TB_OS1 = 0x80, ///< Reserved for OS use.
487 TB_RESERVED = 0x40, ///< Reserved for compiler.
488 TB_SSP_CANARY = 0x20, ///< stack smasher canary present on stack.
489 TB_OS2 = 0x10, ///< Reserved for OS use.
490 TB_EH_INFO = 0x08, ///< Exception handling info present.
491 TB_LONGTBTABLE2 = 0x01 ///< Additional tbtable extension exists.
493
498
501 : MappingClass(SMC), Type(ST) {}
504};
505
506} // end namespace XCOFF
507} // end namespace llvm
508
509#endif
#define LLVM_ABI
Definition: Compiler.h:213
Tagged union holding either a T or a Error.
Definition: Error.h:485
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
Definition: SmallString.h:26
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
LLVM Value Representation.
Definition: Value.h:75
DwarfSectionSubtypeFlags
Values for defining the section subtype of sections of type STYP_DWARF as they would appear in the (s...
Definition: XCOFF.h:155
@ SSUBTYP_DWARNGE
DWARF aranges section.
Definition: XCOFF.h:160
@ SSUBTYP_DWFRAME
DWARF frame section.
Definition: XCOFF.h:165
@ SSUBTYP_DWABREV
DWARF abbrev section.
Definition: XCOFF.h:161
@ SSUBTYP_DWINFO
DWARF info section.
Definition: XCOFF.h:156
@ SSUBTYP_DWRNGES
DWARF ranges section.
Definition: XCOFF.h:163
@ SSUBTYP_DWLOC
DWARF loc section.
Definition: XCOFF.h:164
@ SSUBTYP_DWMAC
DWARF macinfo section.
Definition: XCOFF.h:166
@ SSUBTYP_DWPBNMS
DWARF pubnames section.
Definition: XCOFF.h:158
@ SSUBTYP_DWPBTYP
DWARF pubtypes section.
Definition: XCOFF.h:159
@ SSUBTYP_DWLINE
DWARF line section.
Definition: XCOFF.h:157
@ SSUBTYP_DWSTR
DWARF str section.
Definition: XCOFF.h:162
AuxHeaderFlags64
Definition: XCOFF.h:64
@ FORK_POLICY
Forktree policy specified (main program only).
Definition: XCOFF.h:67
@ SHR_SYMTAB
At exec time, create shared symbol table for program (main program only).
Definition: XCOFF.h:65
@ FORK_COR
If _AOUT_FORK_POLICY is set, specify copy-on-reference if this bit is set.
Definition: XCOFF.h:68
static constexpr uint8_t XR_BIASED_LENGTH_MASK
Definition: XCOFF.h:61
constexpr size_t RelocationSerializationSize32
Definition: XCOFF.h:40
LLVM_ABI SmallString< 32 > getExtendedTBTableFlagString(uint8_t Flag)
Definition: XCOFF.cpp:221
@ F_DSA
file uses Dynamic Segment Allocation (32-bit only)
Definition: XCOFF.h:87
@ F_SHROBJ
file is a shared object
Definition: XCOFF.h:95
@ F_DEP_2
Data Execution Protection bit 2.
Definition: XCOFF.h:99
@ F_LNNO
line numbers stripped from file
Definition: XCOFF.h:83
@ F_DYNLOAD
file is dynamically loadable and executable (equivalent to F_EXEC on AIX)
Definition: XCOFF.h:93
@ F_LPDATA
executable requires large pages for data
Definition: XCOFF.h:92
@ F_LPTEXT
executable requires large pages for text
Definition: XCOFF.h:91
@ F_LOADONLY
file can be loaded by the system loader, but it is ignored by the linker if it is a member of an arch...
Definition: XCOFF.h:96
@ F_RELFLG
relocation info stripped from file
Definition: XCOFF.h:80
@ F_DEP_1
Data Execution Protection bit 1.
Definition: XCOFF.h:89
@ F_LSYMS
local symbols stripped from file
Definition: XCOFF.h:84
@ F_FDPR_PROF
file was profiled with FDPR
Definition: XCOFF.h:85
@ F_FDPR_OPTI
file was reordered with FDPR
Definition: XCOFF.h:86
@ F_EXEC
file is executable (i.e., it has a loader section)
Definition: XCOFF.h:81
@ F_VARPG
executable requests using variable size pages
Definition: XCOFF.h:90
LLVM_ABI XCOFF::CFileCpuId getCpuID(StringRef CPU)
Definition: XCOFF.cpp:112
constexpr size_t ExceptionSectionEntrySize64
Definition: XCOFF.h:43
static constexpr uint8_t XR_FIXUP_INDICATOR_MASK
Definition: XCOFF.h:58
constexpr uint16_t VISIBILITY_MASK
Definition: XCOFF.h:260
LLVM_ABI Expected< SmallString< 32 > > parseParmsTypeWithVecInfo(uint32_t Value, unsigned FixedParmsNum, unsigned FloatingParmsNum, unsigned VectorParmsNum)
Definition: XCOFF.cpp:247
static constexpr uint8_t XR_SIGN_INDICATOR_MASK
Definition: XCOFF.h:55
LLVM_ABI StringRef getRelocationTypeString(XCOFF::RelocationType Type)
Definition: XCOFF.cpp:55
LLVM_ABI Expected< SmallString< 32 > > parseParmsType(uint32_t Value, unsigned FixedParmsNum, unsigned FloatingParmsNum)
Definition: XCOFF.cpp:169
constexpr size_t RelocationSerializationSize64
Definition: XCOFF.h:41
constexpr size_t ExceptionSectionEntrySize32
Definition: XCOFF.h:42
constexpr size_t FileHeaderSize64
Definition: XCOFF.h:33
LLVM_ABI StringRef getMappingClassString(XCOFF::StorageMappingClass SMC)
Definition: XCOFF.cpp:22
constexpr size_t AuxFileHeaderSize64
Definition: XCOFF.h:35
constexpr size_t SectionHeaderSize64
Definition: XCOFF.h:38
LLVM_ABI Expected< SmallString< 32 > > parseVectorParmsType(uint32_t Value, unsigned ParmsNum)
Definition: XCOFF.cpp:299
constexpr size_t AuxFileEntNameSize
Definition: XCOFF.h:31
SymbolAuxType
Definition: XCOFF.h:366
@ AUX_SECT
Identifies a SECT auxiliary entry.
Definition: XCOFF.h:372
@ AUX_FILE
Identifies a file auxiliary entry.
Definition: XCOFF.h:370
@ AUX_EXCEPT
Identifies an exception auxiliary entry.
Definition: XCOFF.h:367
@ AUX_FCN
Identifies a function auxiliary entry.
Definition: XCOFF.h:368
@ AUX_SYM
Identifies a symbol auxiliary entry.
Definition: XCOFF.h:369
@ AUX_CSECT
Identifies a csect auxiliary entry.
Definition: XCOFF.h:371
RelocationType
Definition: XCOFF.h:263
@ R_RBR
Branch relative to self relocation.
Definition: XCOFF.h:307
@ R_TOC
Relative to the TOC relocation.
Definition: XCOFF.h:275
@ R_RLA
Positive load address relocation. Modifiable instruction.
Definition: XCOFF.h:267
@ R_TLSML
Module reference to the local TLS storage.
Definition: XCOFF.h:316
@ R_TRL
TOC relative indirect load relocation.
Definition: XCOFF.h:278
@ R_BR
Branch relative to self relocation.
Definition: XCOFF.h:301
@ R_POS
Positive relocation.
Definition: XCOFF.h:264
@ R_RBA
Branch absolute relocation.
Definition: XCOFF.h:305
@ R_BA
Branch absolute relocation.
Definition: XCOFF.h:299
@ R_REL
Relative to self relocation.
Definition: XCOFF.h:271
@ R_NEG
Negative relocation.
Definition: XCOFF.h:269
@ R_TLS_IE
Initial-exec reference to TLS symbol.
Definition: XCOFF.h:311
@ R_TLSM
Module reference to TLS.
Definition: XCOFF.h:314
@ R_GL
Global linkage-external TOC address relocation.
Definition: XCOFF.h:288
@ R_REF
A non-relocating relocation.
Definition: XCOFF.h:294
@ R_RL
Positive indirect load relocation. Modifiable instruction.
Definition: XCOFF.h:266
@ R_TRLA
Relative to the TOC or to the thread-local storage base relocation.
Definition: XCOFF.h:281
@ R_TCL
Local object TOC address relocation.
Definition: XCOFF.h:291
@ R_TOCL
Relative to TOC lower.
Definition: XCOFF.h:320
@ R_TOCU
Relative to TOC upper.
Definition: XCOFF.h:318
@ R_TLS_LD
Local-dynamic reference to TLS symbol.
Definition: XCOFF.h:312
@ R_TLS
General-dynamic reference to TLS symbol.
Definition: XCOFF.h:310
@ R_TLS_LE
Local-exec reference to TLS symbol.
Definition: XCOFF.h:313
ExtendedTBTableFlag
Definition: XCOFF.h:485
@ TB_EH_INFO
Exception handling info present.
Definition: XCOFF.h:490
@ TB_OS1
Reserved for OS use.
Definition: XCOFF.h:486
@ TB_SSP_CANARY
stack smasher canary present on stack.
Definition: XCOFF.h:488
@ TB_LONGTBTABLE2
Additional tbtable extension exists.
Definition: XCOFF.h:491
@ TB_OS2
Reserved for OS use.
Definition: XCOFF.h:489
@ TB_RESERVED
Reserved for compiler.
Definition: XCOFF.h:487
@ TB_Fortran
Fortran language.
Definition: XCOFF.h:333
@ TB_C
C language.
Definition: XCOFF.h:332
@ TB_CPLUSPLUS
C++ language.
Definition: XCOFF.h:334
VisibilityType
Values for visibility as they would appear when encoded in the high 4 bits of the 16-bit unsigned n_t...
Definition: XCOFF.h:252
@ SYM_V_PROTECTED
Definition: XCOFF.h:256
@ SYM_V_HIDDEN
Definition: XCOFF.h:255
@ SYM_V_EXPORTED
Definition: XCOFF.h:257
@ SYM_V_INTERNAL
Definition: XCOFF.h:254
@ SYM_V_UNSPECIFIED
Definition: XCOFF.h:253
@ TCPU_PWR6E
Definition: XCOFF.h:357
@ TCPU_PWR9
Definition: XCOFF.h:360
@ TCPU_A35
Definition: XCOFF.h:352
@ TCPU_PWRX
RS2 implementation of POWER architecture.
Definition: XCOFF.h:363
@ TCPU_604
604 implementation of PowerPC architecture.
Definition: XCOFF.h:348
@ TCPU_PWR7
Definition: XCOFF.h:358
@ TCPU_PWR8
Definition: XCOFF.h:359
@ TCPU_ANY
Mixture of any incompatable POWER and PowerPC architecture implementations.
Definition: XCOFF.h:344
@ TCPU_PPC64
PowerPC common architecture 64-bit mode.
Definition: XCOFF.h:341
@ TCPU_PWR10
Definition: XCOFF.h:361
@ TCPU_PWR
POWER common architecture objects.
Definition: XCOFF.h:343
@ TCPU_PWR5X
Definition: XCOFF.h:356
@ TCPU_COM
POWER and PowerPC architecture common.
Definition: XCOFF.h:342
@ TCPU_603
603 implementation of PowerPC architecture.
Definition: XCOFF.h:347
@ TCPU_PPC
PowerPC common architecture 32 bit mode.
Definition: XCOFF.h:340
@ TCPU_PWR6
Definition: XCOFF.h:355
@ TCPU_PWR5
Definition: XCOFF.h:353
@ TCPU_620
Definition: XCOFF.h:351
@ TCPU_601
601 implementation of PowerPC architecture.
Definition: XCOFF.h:346
@ TCPU_970
Definition: XCOFF.h:354
@ TCPU_INVALID
Invalid id - assumes POWER for old objects.
Definition: XCOFF.h:339
constexpr size_t NameSize
Definition: XCOFF.h:30
constexpr uint16_t RelocOverflow
Definition: XCOFF.h:44
constexpr size_t AuxFileHeaderSizeShort
Definition: XCOFF.h:36
constexpr size_t AuxFileHeaderSize32
Definition: XCOFF.h:34
ReservedSectionNum
Definition: XCOFF.h:47
@ N_DEBUG
Definition: XCOFF.h:47
@ N_UNDEF
Definition: XCOFF.h:47
@ N_ABS
Definition: XCOFF.h:47
CFileStringType
Definition: XCOFF.h:324
@ XFT_FN
Specifies the source-file name.
Definition: XCOFF.h:325
@ XFT_CD
Specifies compiler-defined information.
Definition: XCOFF.h:328
@ XFT_CV
Specifies the compiler version number.
Definition: XCOFF.h:327
@ XFT_CT
Specifies the compiler time stamp.
Definition: XCOFF.h:326
constexpr size_t FileHeaderSize32
Definition: XCOFF.h:32
StorageClass
Definition: XCOFF.h:171
@ C_BCOMM
Definition: XCOFF.h:178
@ C_GTLS
Definition: XCOFF.h:183
@ C_LINE
Definition: XCOFF.h:229
@ C_DECL
Definition: XCOFF.h:209
@ C_PSYM
Definition: XCOFF.h:191
@ C_RPSYM
Definition: XCOFF.h:193
@ C_STRTAG
Definition: XCOFF.h:219
@ C_FIELD
Definition: XCOFF.h:227
@ C_GSYM
Definition: XCOFF.h:176
@ C_BINCL
Definition: XCOFF.h:174
@ C_UNTAG
Definition: XCOFF.h:221
@ C_AUTO
Definition: XCOFF.h:212
@ C_RSYM
Definition: XCOFF.h:192
@ C_EXTDEF
Definition: XCOFF.h:214
@ C_LABEL
Definition: XCOFF.h:215
@ C_BLOCK
Definition: XCOFF.h:205
@ C_STAT
Definition: XCOFF.h:204
@ C_INFO
Definition: XCOFF.h:208
@ C_ENTRY
Definition: XCOFF.h:180
@ C_STTLS
Definition: XCOFF.h:184
@ C_WEAKEXT
Definition: XCOFF.h:200
@ C_ENTAG
Definition: XCOFF.h:224
@ C_EINCL
Definition: XCOFF.h:175
@ C_LSYM
Definition: XCOFF.h:190
@ C_ALIAS
Definition: XCOFF.h:230
@ C_EFCN
Definition: XCOFF.h:232
@ C_ULABEL
Definition: XCOFF.h:216
@ C_FILE
Definition: XCOFF.h:173
@ C_NULL
Definition: XCOFF.h:203
@ C_STSYM
Definition: XCOFF.h:177
@ C_ECOML
Definition: XCOFF.h:194
@ C_DWARF
Definition: XCOFF.h:187
@ C_HIDDEN
Definition: XCOFF.h:231
@ C_REGPARM
Definition: XCOFF.h:226
@ C_TPDEF
Definition: XCOFF.h:222
@ C_USTATIC
Definition: XCOFF.h:223
@ C_HIDEXT
Definition: XCOFF.h:207
@ C_TCSYM
Definition: XCOFF.h:235
@ C_ECOMM
Definition: XCOFF.h:179
@ C_BSTAT
Definition: XCOFF.h:181
@ C_ESTAT
Definition: XCOFF.h:182
StorageMappingClass
Storage Mapping Class definitions.
Definition: XCOFF.h:104
@ XMC_TE
Symbol mapped at the end of TOC.
Definition: XCOFF.h:129
@ XMC_TB
Traceback Table csect.
Definition: XCOFF.h:115
@ XMC_TC0
TOC Anchor for TOC Addressability.
Definition: XCOFF.h:119
@ XMC_SV3264
Supervisor Call for both 32- and 64-bit processes.
Definition: XCOFF.h:113
@ XMC_GL
Global Linkage (Interfile Interface Code)
Definition: XCOFF.h:109
@ XMC_DS
Descriptor csect.
Definition: XCOFF.h:122
@ XMC_SV64
Supervisor Call for 64-bit process.
Definition: XCOFF.h:112
@ XMC_RW
Read Write Data.
Definition: XCOFF.h:118
@ XMC_TL
Initialized thread-local variable.
Definition: XCOFF.h:127
@ XMC_RO
Read Only Constant.
Definition: XCOFF.h:107
@ XMC_DB
Debug Dictionary Table.
Definition: XCOFF.h:108
@ XMC_UA
Unclassified - Treated as Read Write.
Definition: XCOFF.h:123
@ XMC_SV
Supervisor Call (32-bit process only)
Definition: XCOFF.h:111
@ XMC_TD
Scalar data item in the TOC.
Definition: XCOFF.h:121
@ XMC_UC
Un-named Fortran Common.
Definition: XCOFF.h:125
@ XMC_UL
Uninitialized thread-local variable.
Definition: XCOFF.h:128
@ XMC_TI
Traceback Index csect.
Definition: XCOFF.h:114
@ XMC_PR
Program Code.
Definition: XCOFF.h:106
@ XMC_XO
Extended Operation (Pseudo Machine Instruction)
Definition: XCOFF.h:110
@ XMC_BS
BSS class (uninitialized static internal)
Definition: XCOFF.h:124
@ XMC_TC
General TOC item.
Definition: XCOFF.h:120
constexpr size_t SectionHeaderSize32
Definition: XCOFF.h:37
XCOFFInterpret
Definition: XCOFF.h:74
@ NEW_XCOFF_INTERPRET
Definition: XCOFF.h:76
@ OLD_XCOFF_INTERPRET
Definition: XCOFF.h:75
constexpr size_t SymbolTableEntrySize
Definition: XCOFF.h:39
constexpr size_t FileNamePadSize
Definition: XCOFF.h:29
LLVM_ABI StringRef getTCPUString(XCOFF::CFileCpuId TCPU)
Definition: XCOFF.cpp:141
LLVM_ABI StringRef getNameForTracebackTableLanguageId(TracebackTable::LanguageID LangId)
Definition: XCOFF.cpp:89
constexpr uint8_t AllocRegNo
Definition: XCOFF.h:45
@ XTY_CM
Common csect definition. For uninitialized storage.
Definition: XCOFF.h:246
@ XTY_SD
Csect definition for initialized storage.
Definition: XCOFF.h:243
@ XTY_LD
Label definition.
Definition: XCOFF.h:244
@ XTY_ER
External reference.
Definition: XCOFF.h:242
MagicNumber
Definition: XCOFF.h:49
@ XCOFF32
Definition: XCOFF.h:49
@ XCOFF64
Definition: XCOFF.h:49
SectionTypeFlags
Definition: XCOFF.h:135
@ STYP_TYPCHK
Definition: XCOFF.h:147
@ STYP_LOADER
Definition: XCOFF.h:145
@ STYP_DWARF
Definition: XCOFF.h:137
@ STYP_DATA
Definition: XCOFF.h:139
@ STYP_INFO
Definition: XCOFF.h:142
@ STYP_TDATA
Definition: XCOFF.h:143
@ STYP_TEXT
Definition: XCOFF.h:138
@ STYP_DEBUG
Definition: XCOFF.h:146
@ STYP_PAD
Definition: XCOFF.h:136
@ STYP_EXCEPT
Definition: XCOFF.h:141
@ STYP_OVRFLO
Definition: XCOFF.h:148
@ STYP_BSS
Definition: XCOFF.h:140
@ STYP_TBSS
Definition: XCOFF.h:144
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
StorageMappingClass MappingClass
Definition: XCOFF.h:502
CsectProperties(StorageMappingClass SMC, SymbolType ST)
Definition: XCOFF.h:500
static constexpr uint32_t VersionMask
Definition: XCOFF.h:407
static constexpr uint32_t FPRSavedMask
Definition: XCOFF.h:437
static constexpr uint16_t NumberOfVRSavedMask
Definition: XCOFF.h:467
static constexpr uint8_t NumberOfFloatingPointParmsShift
Definition: XCOFF.h:453
static constexpr uint32_t NumberOfFixedParmsMask
Definition: XCOFF.h:447
static constexpr uint16_t HasVMXInstructionMask
Definition: XCOFF.h:473
static constexpr uint32_t IsLRSavedMask
Definition: XCOFF.h:431
static constexpr uint16_t HasVarArgsMask
Definition: XCOFF.h:469
static constexpr uint32_t IsTOClessMask
Definition: XCOFF.h:420
static constexpr uint32_t IsAllocaUsedMask
Definition: XCOFF.h:428
static constexpr uint8_t WidthOfParamType
Definition: XCOFF.h:481
static constexpr uint16_t IsVRSavedOnStackMask
Definition: XCOFF.h:468
static constexpr uint32_t ParmTypeFloatingIsDoubleBit
Definition: XCOFF.h:458
static constexpr uint16_t NumberOfVectorParmsMask
Definition: XCOFF.h:472
static constexpr uint32_t ParmTypeIsFloatingBit
Definition: XCOFF.h:457
static constexpr uint32_t IsFloatingPointPresentMask
Definition: XCOFF.h:421
static constexpr uint32_t FPRSavedShift
Definition: XCOFF.h:438
static constexpr uint32_t ParmTypeIsVectorShortBit
Definition: XCOFF.h:477
static constexpr uint32_t IsOutOfLineEpilogOrPrologueMask
Definition: XCOFF.h:416
static constexpr uint32_t NumberOfFloatingPointParmsMask
Definition: XCOFF.h:451
static constexpr uint32_t HasControlledStorageMask
Definition: XCOFF.h:419
static constexpr uint32_t ParmTypeMask
Definition: XCOFF.h:464
static constexpr uint32_t HasExtensionTableMask
Definition: XCOFF.h:441
static constexpr uint32_t IsInternalProcedureMask
Definition: XCOFF.h:418
static constexpr uint32_t ParmTypeIsDoubleBits
Definition: XCOFF.h:463
static constexpr uint8_t VersionShift
Definition: XCOFF.h:408
static constexpr uint32_t HasTraceBackTableOffsetMask
Definition: XCOFF.h:417
static constexpr uint32_t IsCRSavedMask
Definition: XCOFF.h:430
static constexpr uint8_t NumberOfFixedParmsShift
Definition: XCOFF.h:448
static constexpr uint32_t GPRSavedMask
Definition: XCOFF.h:443
static constexpr uint32_t ParmTypeIsVectorIntBit
Definition: XCOFF.h:478
static constexpr uint8_t NumberOfVectorParmsShift
Definition: XCOFF.h:474
static constexpr uint32_t IsFixupMask
Definition: XCOFF.h:436
static constexpr uint32_t IsGlobaLinkageMask
Definition: XCOFF.h:415
static constexpr uint32_t HasParmsOnStackMask
Definition: XCOFF.h:452
static constexpr uint32_t ParmTypeIsFixedBits
Definition: XCOFF.h:460
static constexpr uint32_t OnConditionDirectiveMask
Definition: XCOFF.h:429
static constexpr uint32_t ParmTypeIsVectorBits
Definition: XCOFF.h:461
static constexpr uint32_t IsFunctionNamePresentMask
Definition: XCOFF.h:427
static constexpr uint32_t IsBackChainStoredMask
Definition: XCOFF.h:435
static constexpr uint32_t ParmTypeIsVectorCharBit
Definition: XCOFF.h:476
static constexpr uint32_t IsInterruptHandlerMask
Definition: XCOFF.h:426
static constexpr uint32_t LanguageIdMask
Definition: XCOFF.h:411
static constexpr uint8_t LanguageIdShift
Definition: XCOFF.h:412
static constexpr uint32_t ParmTypeIsVectorFloatBit
Definition: XCOFF.h:479
static constexpr uint8_t OnConditionDirectiveShift
Definition: XCOFF.h:432
static constexpr uint32_t HasVectorInfoMask
Definition: XCOFF.h:442
static constexpr uint32_t ParmTypeIsFloatingBits
Definition: XCOFF.h:462
static constexpr uint8_t NumberOfVRSavedShift
Definition: XCOFF.h:470
static constexpr uint32_t IsFloatingPointOperationLogOrAbortEnabledMask
Definition: XCOFF.h:422
static constexpr uint32_t GPRSavedShift
Definition: XCOFF.h:444