elfconstants.m4 revision 1.2
1# Copyright (c) 2010,2021 Joseph Koshy
2# All rights reserved.
3
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions
6# are met:
7# 1. Redistributions of source code must retain the above copyright
8#    notice, this list of conditions and the following disclaimer.
9# 2. Redistributions in binary form must reproduce the above copyright
10#    notice, this list of conditions and the following disclaimer in the
11#    documentation and/or other materials provided with the distribution.
12
13# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23# SUCH DAMAGE.
24
25# These definitions are based on:
26# - The public specification of the ELF format as defined in the
27#   October 2009 draft of System V ABI.
28#   See: http://www.sco.com/developers/gabi/latest/ch4.intro.html
29# - The May 1998 (version 1.5) draft of "The ELF-64 object format".
30# - Processor-specific ELF ABI definitions for sparc, i386, amd64, mips,
31#   ia64, powerpc, and RISC-V processors.
32# - The "Linkers and Libraries Guide", from Sun Microsystems.
33
34define(`VCSID_ELFCONSTANTS_M4',
35	`Id: elfconstants.m4 3946 2021-04-10 21:10:42Z jkoshy')
36
37# In the following definitions, `_' is an M4 macro that is meant to be
38# expanded later.  Its intended usage is:
39#
40#   `_(ELF_SYMBOL, VALUE, OPTIONAL-DESCRIPTION)'
41#
42# These (deferred) macros are then grouped together into named collections.
43#
44# At the point of use, `_' would be defined to expand to the desired
45# replacement text.
46#
47#   # File: example_expansion.m4
48#
49#   define(`_',`case $2: return ("$1");')
50#   include(`elfconstants.m4')
51#
52#   const char *name_of_capability(int capability)
53#   {
54#       switch(capability) {
55#       DEFINE_CAPABILITIES();
56#       default:
57#           return (NULL);
58#       }
59#   }   
60
61#
62# Types of capabilities.
63# 
64define(`DEFINE_CAPABILITIES',`
65_(`CA_SUNW_NULL',	0,	`ignored')
66_(`CA_SUNW_HW_1',	1,	`hardware capability')
67_(`CA_SUNW_SW_1',	2,	`software capability')')
68
69#
70# Flags used with dynamic linking entries.
71#
72define(`DEFINE_DYN_FLAGS',`
73_(`DF_ORIGIN',           0x1,
74	`object being loaded may refer to `$ORIGIN'')
75_(`DF_SYMBOLIC',         0x2,
76	`search library for references before executable')
77_(`DF_TEXTREL',          0x4,
78	`relocation entries may modify text segment')
79_(`DF_BIND_NOW',         0x8,
80	`process relocation entries at load time')
81_(`DF_STATIC_TLS',       0x10,
82	`uses static thread-local storage')
83_(`DF_1_BIND_NOW',       0x1,
84	`process relocation entries at load time')
85_(`DF_1_GLOBAL',         0x2,
86	`unused')
87_(`DF_1_GROUP',          0x4,
88	`object is a member of a group')
89_(`DF_1_NODELETE',       0x8,
90	`object cannot be deleted from a process')
91_(`DF_1_LOADFLTR',       0x10,
92	`immediate load filtees')
93_(`DF_1_INITFIRST',      0x20,
94	`initialize object first')
95_(`DF_1_NOOPEN',         0x40,
96	`disallow dlopen()')
97_(`DF_1_ORIGIN',         0x80,
98	`object being loaded may refer to $ORIGIN')
99_(`DF_1_DIRECT',         0x100,
100	`direct bindings enabled')
101_(`DF_1_INTERPOSE',      0x400,
102	`object is interposer')
103_(`DF_1_NODEFLIB',       0x800,
104	`ignore default library search path')
105_(`DF_1_NODUMP',         0x1000,
106	`disallow dldump()')
107_(`DF_1_CONFALT',        0x2000,
108	`object is a configuration alternative')
109_(`DF_1_ENDFILTEE',      0x4000,
110	`filtee terminates filter search')
111_(`DF_1_DISPRELDNE',     0x8000,
112	`displacement relocation done')
113_(`DF_1_DISPRELPND',     0x10000,
114	`displacement relocation pending')')
115
116#
117# Dynamic linking entry types.
118#
119define(`DEFINE_DYN_TYPES',`
120_(`DT_NULL',             0,
121	`end of array')
122_(`DT_NEEDED',           1,
123	`names a needed library')
124_(`DT_PLTRELSZ',         2,
125	`size in bytes of associated relocation entries')
126_(`DT_PLTGOT',           3,
127	`address associated with the procedure linkage table')
128_(`DT_HASH',             4,
129	`address of the symbol hash table')
130_(`DT_STRTAB',           5,
131	`address of the string table')
132_(`DT_SYMTAB',           6,
133	`address of the symbol table')
134_(`DT_RELA',             7,
135	`address of the relocation table')
136_(`DT_RELASZ',           8,
137	`size of the DT_RELA table')
138_(`DT_RELAENT',          9,
139	`size of each DT_RELA entry')
140_(`DT_STRSZ',            10,
141	`size of the string table')
142_(`DT_SYMENT',           11,
143	`size of a symbol table entry')
144_(`DT_INIT',             12,
145	`address of the initialization function')
146_(`DT_FINI',             13,
147	`address of the finalization function')
148_(`DT_SONAME',           14,
149	`names the shared object')
150_(`DT_RPATH',            15,
151	`runtime library search path')
152_(`DT_SYMBOLIC',         16,
153	`alter symbol resolution algorithm')
154_(`DT_REL',              17,
155	`address of the DT_REL table')
156_(`DT_RELSZ',            18,
157	`size of the DT_REL table')
158_(`DT_RELENT',           19,
159	`size of each DT_REL entry')
160_(`DT_PLTREL',           20,
161	`type of relocation entry in the procedure linkage table')
162_(`DT_DEBUG',            21,
163	`used for debugging')
164_(`DT_TEXTREL',          22,
165	`text segment may be written to during relocation')
166_(`DT_JMPREL',           23,
167	`address of relocation entries associated with the procedure linkage table')
168_(`DT_BIND_NOW',         24,
169	`bind symbols at loading time')
170_(`DT_INIT_ARRAY',       25,
171	`pointers to initialization functions')
172_(`DT_FINI_ARRAY',       26,
173	`pointers to termination functions')
174_(`DT_INIT_ARRAYSZ',     27,
175	`size of the DT_INIT_ARRAY')
176_(`DT_FINI_ARRAYSZ',     28,
177	`size of the DT_FINI_ARRAY')
178_(`DT_RUNPATH',          29,
179	`index of library search path string')
180_(`DT_FLAGS',            30,
181	`flags specific to the object being loaded')
182_(`DT_ENCODING',         32,
183	`standard semantics')
184_(`DT_PREINIT_ARRAY',    32,
185	`pointers to pre-initialization functions')
186_(`DT_PREINIT_ARRAYSZ',  33,
187	`size of pre-initialization array')
188_(`DT_MAXPOSTAGS',       34,
189	`the number of positive tags')
190_(`DT_LOOS',             0x6000000DUL,
191	`start of OS-specific types')
192_(`DT_SUNW_AUXILIARY',   0x6000000DUL,
193	`offset of string naming auxiliary filtees')
194_(`DT_SUNW_RTLDINF',     0x6000000EUL,
195	`rtld internal use')
196_(`DT_SUNW_FILTER',      0x6000000FUL,
197	`offset of string naming standard filtees')
198_(`DT_SUNW_CAP',         0x60000010UL,
199	`address of hardware capabilities section')
200_(`DT_SUNW_ASLR',        0x60000023UL,
201	`Address Space Layout Randomization flag')
202_(`DT_HIOS',             0x6FFFF000UL,
203	`end of OS-specific types')
204_(`DT_VALRNGLO',         0x6FFFFD00UL,
205	`start of range using the d_val field')
206_(`DT_GNU_PRELINKED',    0x6FFFFDF5UL,
207	`prelinking timestamp')
208_(`DT_GNU_CONFLICTSZ',   0x6FFFFDF6UL,
209	`size of conflict section')
210_(`DT_GNU_LIBLISTSZ',    0x6FFFFDF7UL,
211	`size of library list')
212_(`DT_CHECKSUM',         0x6FFFFDF8UL,
213	`checksum for the object')
214_(`DT_PLTPADSZ',         0x6FFFFDF9UL,
215	`size of PLT padding')
216_(`DT_MOVEENT',          0x6FFFFDFAUL,
217	`size of DT_MOVETAB entries')
218_(`DT_MOVESZ',           0x6FFFFDFBUL,
219	`total size of the MOVETAB table')
220_(`DT_FEATURE',          0x6FFFFDFCUL,
221	`feature values')
222_(`DT_POSFLAG_1',        0x6FFFFDFDUL,
223	`dynamic position flags')
224_(`DT_SYMINSZ',          0x6FFFFDFEUL,
225	`size of the DT_SYMINFO table')
226_(`DT_SYMINENT',         0x6FFFFDFFUL,
227	`size of a DT_SYMINFO entry')
228_(`DT_VALRNGHI',         0x6FFFFDFFUL,
229	`end of range using the d_val field')
230_(`DT_ADDRRNGLO',        0x6FFFFE00UL,
231	`start of range using the d_ptr field')
232_(`DT_GNU_HASH',	       0x6FFFFEF5UL,
233	`GNU style hash tables')
234_(`DT_TLSDESC_PLT',      0x6FFFFEF6UL,
235	`location of PLT entry for TLS descriptor resolver calls')
236_(`DT_TLSDESC_GOT',      0x6FFFFEF7UL,
237	`location of GOT entry used by TLS descriptor resolver PLT entry')
238_(`DT_GNU_CONFLICT',     0x6FFFFEF8UL,
239	`address of conflict section')
240_(`DT_GNU_LIBLIST',      0x6FFFFEF9UL,
241	`address of conflict section')
242_(`DT_CONFIG',           0x6FFFFEFAUL,
243	`configuration file')
244_(`DT_DEPAUDIT',         0x6FFFFEFBUL,
245	`string defining audit libraries')
246_(`DT_AUDIT',            0x6FFFFEFCUL,
247	`string defining audit libraries')
248_(`DT_PLTPAD',           0x6FFFFEFDUL,
249	`PLT padding')
250_(`DT_MOVETAB',          0x6FFFFEFEUL,
251	`address of a move table')
252_(`DT_SYMINFO',          0x6FFFFEFFUL,
253	`address of the symbol information table')
254_(`DT_ADDRRNGHI',        0x6FFFFEFFUL,
255	`end of range using the d_ptr field')
256_(`DT_VERSYM',	       0x6FFFFFF0UL,
257	`address of the version section')
258_(`DT_RELACOUNT',        0x6FFFFFF9UL,
259	`count of RELA relocations')
260_(`DT_RELCOUNT',         0x6FFFFFFAUL,
261	`count of REL relocations')
262_(`DT_FLAGS_1',          0x6FFFFFFBUL,
263	`flag values')
264_(`DT_VERDEF',	       0x6FFFFFFCUL,
265	`address of the version definition segment')
266_(`DT_VERDEFNUM',	       0x6FFFFFFDUL,
267	`the number of version definition entries')
268_(`DT_VERNEED',	       0x6FFFFFFEUL,
269	`address of section with needed versions')
270_(`DT_VERNEEDNUM',       0x6FFFFFFFUL,
271	`the number of version needed entries')
272_(`DT_LOPROC',           0x70000000UL,
273	`start of processor-specific types')
274_(`DT_ARM_SYMTABSZ',     0x70000001UL,
275	`number of entries in the dynamic symbol table')
276_(`DT_SPARC_REGISTER',   0x70000001UL,
277	`index of an STT_SPARC_REGISTER symbol')
278_(`DT_ARM_PREEMPTMAP',   0x70000002UL,
279	`address of the preemption map')
280_(`DT_MIPS_RLD_VERSION', 0x70000001UL,
281	`version ID for runtime linker interface')
282_(`DT_MIPS_TIME_STAMP',  0x70000002UL,
283	`timestamp')
284_(`DT_MIPS_ICHECKSUM',   0x70000003UL,
285	`checksum of all external strings and common sizes')
286_(`DT_MIPS_IVERSION',    0x70000004UL,
287	`string table index of a version string')
288_(`DT_MIPS_FLAGS',       0x70000005UL,
289	`MIPS-specific flags')
290_(`DT_MIPS_BASE_ADDRESS', 0x70000006UL,
291	`base address for the executable/DSO')
292_(`DT_MIPS_CONFLICT',    0x70000008UL,
293	`address of .conflict section')
294_(`DT_MIPS_LIBLIST',     0x70000009UL,
295	`address of .liblist section')
296_(`DT_MIPS_LOCAL_GOTNO', 0x7000000AUL,
297	`number of local GOT entries')
298_(`DT_MIPS_CONFLICTNO',  0x7000000BUL,
299	`number of entries in the .conflict section')
300_(`DT_MIPS_LIBLISTNO',   0x70000010UL,
301	`number of entries in the .liblist section')
302_(`DT_MIPS_SYMTABNO',    0x70000011UL,
303	`number of entries in the .dynsym section')
304_(`DT_MIPS_UNREFEXTNO',  0x70000012UL,
305	`index of first external dynamic symbol not referenced locally')
306_(`DT_MIPS_GOTSYM',      0x70000013UL,
307	`index of first dynamic symbol corresponds to a GOT entry')
308_(`DT_MIPS_HIPAGENO',    0x70000014UL,
309	`number of page table entries in GOT')
310_(`DT_MIPS_RLD_MAP',     0x70000016UL,
311	`address of runtime linker map')
312_(`DT_MIPS_DELTA_CLASS', 0x70000017UL,
313	`Delta C++ class definition')
314_(`DT_MIPS_DELTA_CLASS_NO', 0x70000018UL,
315	`number of entries in DT_MIPS_DELTA_CLASS')
316_(`DT_MIPS_DELTA_INSTANCE', 0x70000019UL,
317	`Delta C++ class instances')
318_(`DT_MIPS_DELTA_INSTANCE_NO', 0x7000001AUL,
319	`number of entries in DT_MIPS_DELTA_INSTANCE')
320_(`DT_MIPS_DELTA_RELOC', 0x7000001BUL,
321	`Delta relocations')
322_(`DT_MIPS_DELTA_RELOC_NO', 0x7000001CUL,
323	`number of entries in DT_MIPS_DELTA_RELOC')
324_(`DT_MIPS_DELTA_SYM',   0x7000001DUL,
325	`Delta symbols referred by Delta relocations')
326_(`DT_MIPS_DELTA_SYM_NO', 0x7000001EUL,
327	`number of entries in DT_MIPS_DELTA_SYM')
328_(`DT_MIPS_DELTA_CLASSSYM', 0x70000020UL,
329	`Delta symbols for class declarations')
330_(`DT_MIPS_DELTA_CLASSSYM_NO', 0x70000021UL,
331	`number of entries in DT_MIPS_DELTA_CLASSSYM')
332_(`DT_MIPS_CXX_FLAGS',   0x70000022UL,
333	`C++ flavor flags')
334_(`DT_MIPS_PIXIE_INIT',  0x70000023UL,
335	`address of an initialization routine created by pixie')
336_(`DT_MIPS_SYMBOL_LIB',  0x70000024UL,
337	`address of .MIPS.symlib section')
338_(`DT_MIPS_LOCALPAGE_GOTIDX', 0x70000025UL,
339	`GOT index of first page table entry for a segment')
340_(`DT_MIPS_LOCAL_GOTIDX', 0x70000026UL,
341	`GOT index of first page table entry for a local symbol')
342_(`DT_MIPS_HIDDEN_GOTIDX', 0x70000027UL,
343	`GOT index of first page table entry for a hidden symbol')
344_(`DT_MIPS_PROTECTED_GOTIDX', 0x70000028UL,
345	`GOT index of first page table entry for a protected symbol')
346_(`DT_MIPS_OPTIONS',     0x70000029UL,
347	`address of .MIPS.options section')
348_(`DT_MIPS_INTERFACE',   0x7000002AUL,
349	`address of .MIPS.interface section')
350_(`DT_MIPS_DYNSTR_ALIGN', 0x7000002BUL,
351	`???')
352_(`DT_MIPS_INTERFACE_SIZE', 0x7000002CUL,
353	`size of .MIPS.interface section')
354_(`DT_MIPS_RLD_TEXT_RESOLVE_ADDR', 0x7000002DUL,
355	`address of _rld_text_resolve in GOT')
356_(`DT_MIPS_PERF_SUFFIX', 0x7000002EUL,
357	`default suffix of DSO to be appended by dlopen')
358_(`DT_MIPS_COMPACT_SIZE', 0x7000002FUL,
359	`size of a ucode compact relocation record (o32)')
360_(`DT_MIPS_GP_VALUE',    0x70000030UL,
361	`GP value of a specified GP relative range')
362_(`DT_MIPS_AUX_DYNAMIC', 0x70000031UL,
363	`address of an auxiliary dynamic table')
364_(`DT_MIPS_PLTGOT',      0x70000032UL,
365	`address of the PLTGOT')
366_(`DT_MIPS_RLD_OBJ_UPDATE', 0x70000033UL,
367	`object list update callback')
368_(`DT_MIPS_RWPLT',       0x70000034UL,
369	`address of a writable PLT')
370_(`DT_PPC_GOT',          0x70000000UL,
371	`value of _GLOBAL_OFFSET_TABLE_')
372_(`DT_PPC_TLSOPT',       0x70000001UL,
373	`TLS descriptor should be optimized')
374_(`DT_PPC64_GLINK',      0x70000000UL,
375	`address of .glink section')
376_(`DT_PPC64_OPD',        0x70000001UL,
377	`address of .opd section')
378_(`DT_PPC64_OPDSZ',      0x70000002UL,
379	`size of .opd section')
380_(`DT_PPC64_TLSOPT',     0x70000003UL,
381	`TLS descriptor should be optimized')
382_(`DT_AUXILIARY',        0x7FFFFFFDUL,
383	`offset of string naming auxiliary filtees')
384_(`DT_USED',             0x7FFFFFFEUL,
385	`ignored')
386_(`DT_FILTER',           0x7FFFFFFFUL,
387	`index of string naming filtees')
388_(`DT_HIPROC',           0x7FFFFFFFUL,
389	`end of processor-specific types')
390')
391
392define(`DEFINE_DYN_TYPE_ALIASES',`
393_(`DT_DEPRECATED_SPARC_REGISTER', `DT_SPARC_REGISTER')
394')
395
396#
397# Flags used in the executable header (field: e_flags).
398#
399define(`DEFINE_EHDR_FLAGS',`
400_(EF_ARM_RELEXEC,      0x00000001UL,
401	`dynamic segment describes only how to relocate segments')
402_(EF_ARM_HASENTRY,     0x00000002UL,
403	`e_entry contains a program entry point')
404_(EF_ARM_SYMSARESORTED, 0x00000004UL,
405	`subsection of symbol table is sorted by symbol value')
406_(EF_ARM_DYNSYMSUSESEGIDX, 0x00000008UL,
407	`dynamic symbol st_shndx = containing segment index + 1')
408_(EF_ARM_MAPSYMSFIRST, 0x00000010UL,
409	`mapping symbols precede other local symbols in symtab')
410_(EF_ARM_BE8,          0x00800000UL,
411	`file contains BE-8 code')
412_(EF_ARM_LE8,          0x00400000UL,
413	`file contains LE-8 code')
414_(EF_ARM_EABIMASK,     0xFF000000UL,
415	`mask for ARM EABI version number (0 denotes GNU or unknown)')
416_(EF_ARM_EABI_UNKNOWN, 0x00000000UL,
417	`Unknown or GNU ARM EABI version number')
418_(EF_ARM_EABI_VER1,    0x01000000UL,
419	`ARM EABI version 1')
420_(EF_ARM_EABI_VER2,    0x02000000UL,
421	`ARM EABI version 2')
422_(EF_ARM_EABI_VER3,    0x03000000UL,
423	`ARM EABI version 3')
424_(EF_ARM_EABI_VER4,    0x04000000UL,
425	`ARM EABI version 4')
426_(EF_ARM_EABI_VER5,    0x05000000UL,
427	`ARM EABI version 5')
428_(EF_ARM_INTERWORK,    0x00000004UL,
429	`GNU EABI extension')
430_(EF_ARM_APCS_26,      0x00000008UL,
431	`GNU EABI extension')
432_(EF_ARM_APCS_FLOAT,   0x00000010UL,
433	`GNU EABI extension')
434_(EF_ARM_PIC,          0x00000020UL,
435	`GNU EABI extension')
436_(EF_ARM_ALIGN8,       0x00000040UL,
437	`GNU EABI extension')
438_(EF_ARM_NEW_ABI,      0x00000080UL,
439	`GNU EABI extension')
440_(EF_ARM_OLD_ABI,      0x00000100UL,
441	`GNU EABI extension')
442_(EF_ARM_SOFT_FLOAT,   0x00000200UL,
443	`GNU EABI extension')
444_(EF_ARM_VFP_FLOAT,    0x00000400UL,
445	`GNU EABI extension')
446_(EF_ARM_MAVERICK_FLOAT, 0x00000800UL,
447	`GNU EABI extension')
448_(EF_MIPS_NOREORDER,   0x00000001UL,
449	`at least one .noreorder directive appeared in the source')
450_(EF_MIPS_PIC,         0x00000002UL,
451	`file contains position independent code')
452_(EF_MIPS_CPIC,        0x00000004UL,
453	`file code uses standard conventions for calling PIC')
454_(EF_MIPS_UCODE,       0x00000010UL,
455	`file contains UCODE (obsolete)')
456_(EF_MIPS_ABI,	      0x00007000UL,
457	`Application binary interface, see E_MIPS_* values')
458_(EF_MIPS_ABI2,        0x00000020UL,
459	`file follows MIPS III 32-bit ABI')
460_(EF_MIPS_OPTIONS_FIRST, 0x00000080UL,
461	`ld(1) should process .MIPS.options section first')
462_(EF_MIPS_ARCH_ASE,    0x0F000000UL,
463	`file uses application-specific architectural extensions')
464_(EF_MIPS_ARCH_ASE_MDMX, 0x08000000UL,
465	`file uses MDMX multimedia extensions')
466_(EF_MIPS_ARCH_ASE_M16, 0x04000000UL,
467	`file uses MIPS-16 ISA extensions')
468_(EF_MIPS_ARCH_ASE_MICROMIPS, 0x02000000UL,
469	`MicroMIPS architecture')
470_(EF_MIPS_ARCH,         0xF0000000UL,
471	`4-bit MIPS architecture field')
472_(EF_MIPS_ARCH_1,	0x00000000UL,
473	`MIPS I instruction set')
474_(EF_MIPS_ARCH_2,	0x10000000UL,
475	`MIPS II instruction set')
476_(EF_MIPS_ARCH_3,	0x20000000UL,
477	`MIPS III instruction set')
478_(EF_MIPS_ARCH_4,	0x30000000UL,
479	`MIPS IV instruction set')
480_(EF_MIPS_ARCH_5,	0x40000000UL,
481	`Never introduced')
482_(EF_MIPS_ARCH_32,	0x50000000UL,
483	`Mips32 Revision 1')
484_(EF_MIPS_ARCH_64,	0x60000000UL,
485	`Mips64 Revision 1')
486_(EF_MIPS_ARCH_32R2,	0x70000000UL,
487	`Mips32 Revision 2')
488_(EF_MIPS_ARCH_64R2,	0x80000000UL,
489	`Mips64 Revision 2')
490_(EF_PPC_EMB,          0x80000000UL,
491	`Embedded PowerPC flag')
492_(EF_PPC_RELOCATABLE,  0x00010000UL,
493	`-mrelocatable flag')
494_(EF_PPC_RELOCATABLE_LIB, 0x00008000UL,
495	`-mrelocatable-lib flag')
496_(EF_RISCV_RVC,	    0x00000001UL,
497	`Compressed instruction extension')
498_(EF_RISCV_FLOAT_ABI_MASK, 0x00000006UL,
499	`Floating point ABI')
500_(EF_RISCV_FLOAT_ABI_SOFT, 0x00000000UL,
501	`Software emulated floating point')
502_(EF_RISCV_FLOAT_ABI_SINGLE, 0x00000002UL,
503	`Single precision floating point')
504_(EF_RISCV_FLOAT_ABI_DOUBLE, 0x00000004UL,
505	`Double precision floating point')
506_(EF_RISCV_FLOAT_ABI_QUAD, 0x00000006UL,
507	`Quad precision floating point')
508_(EF_RISCV_RVE,	    0x00000008UL,
509	`Compressed instruction ABI')
510_(EF_RISCV_TSO,	    0x00000010UL,
511	`RVTSO memory consistency model')
512_(EF_SPARC_EXT_MASK,   0x00ffff00UL,
513	`Vendor Extension mask')
514_(EF_SPARC_32PLUS,     0x00000100UL,
515	`Generic V8+ features')
516_(EF_SPARC_SUN_US1,    0x00000200UL,
517	`Sun UltraSPARCTM 1 Extensions')
518_(EF_SPARC_HAL_R1,     0x00000400UL,
519	`HAL R1 Extensions')
520_(EF_SPARC_SUN_US3,    0x00000800UL,
521	`Sun UltraSPARC 3 Extensions')
522_(EF_SPARCV9_MM,       0x00000003UL,
523	`Mask for Memory Model')
524_(EF_SPARCV9_TSO,      0x00000000UL,
525	`Total Store Ordering')
526_(EF_SPARCV9_PSO,      0x00000001UL,
527	`Partial Store Ordering')
528_(EF_SPARCV9_RMO,      0x00000002UL,
529	`Relaxed Memory Ordering')
530')
531
532#
533# Offsets in the `ei_ident[]` field of an ELF executable header.
534#
535define(`DEFINE_EI_OFFSETS',`
536_(EI_MAG0,     0,
537	`magic number')
538_(EI_MAG1,     1,
539	`magic number')
540_(EI_MAG2,     2,
541	`magic number')
542_(EI_MAG3,     3,
543	`magic number')
544_(EI_CLASS,    4,
545	`file class')
546_(EI_DATA,     5,
547	`data encoding')
548_(EI_VERSION,  6,
549	`file version')
550_(EI_OSABI,    7,
551	`OS ABI kind')
552_(EI_ABIVERSION, 8,
553	`OS ABI version')
554_(EI_PAD,	    9,
555	`padding start')
556_(EI_NIDENT,  16,
557	`total size')
558')
559
560#
561# The ELF class of an object.
562#
563define(`DEFINE_ELF_CLASSES',`
564_(ELFCLASSNONE, 0,
565	`Unknown ELF class')
566_(ELFCLASS32,   1,
567	`32 bit objects')
568_(ELFCLASS64,   2,
569	`64 bit objects')
570')
571
572#
573# Endianness of data in an ELF object.
574#
575define(`DEFINE_ELF_DATA_ENDIANNESSES',`
576_(ELFDATANONE, 0,
577	`Unknown data endianness')
578_(ELFDATA2LSB, 1,
579	`little endian')
580_(ELFDATA2MSB, 2,
581	`big endian')
582')
583
584
585#
586# The magic numbers used in the initial four bytes of an ELF object.
587#
588# These numbers are: 0x7F, 'E', 'L' and 'F'.
589define(`DEFINE_ELF_MAGIC_VALUES',`
590_(ELFMAG0, 0x7FU)
591_(ELFMAG1, 0x45U)
592_(ELFMAG2, 0x4CU)
593_(ELFMAG3, 0x46U)
594')
595
596#
597# ELF OS ABI field.
598#
599define(`DEFINE_ELF_OSABIS',`
600_(ELFOSABI_NONE,       0,
601	`No extensions or unspecified')
602_(ELFOSABI_SYSV,       0,
603	`SYSV')
604_(ELFOSABI_HPUX,       1,
605	`Hewlett-Packard HP-UX')
606_(ELFOSABI_NETBSD,     2,
607	`NetBSD')
608_(ELFOSABI_GNU,        3,
609	`GNU')
610_(ELFOSABI_HURD,       4,
611	`GNU/HURD')
612_(ELFOSABI_86OPEN,     5,
613	`86Open Common ABI')
614_(ELFOSABI_SOLARIS,    6,
615	`Sun Solaris')
616_(ELFOSABI_AIX,        7,
617	`AIX')
618_(ELFOSABI_IRIX,       8,
619	`IRIX')
620_(ELFOSABI_FREEBSD,    9,
621	`FreeBSD')
622_(ELFOSABI_TRU64,      10,
623	`Compaq TRU64 UNIX')
624_(ELFOSABI_MODESTO,    11,
625	`Novell Modesto')
626_(ELFOSABI_OPENBSD,    12,
627	`Open BSD')
628_(ELFOSABI_OPENVMS,    13,
629	`Open VMS')
630_(ELFOSABI_NSK,        14,
631	`Hewlett-Packard Non-Stop Kernel')
632_(ELFOSABI_AROS,       15,
633	`Amiga Research OS')
634_(ELFOSABI_FENIXOS,    16,
635	`The FenixOS highly scalable multi-core OS')
636_(ELFOSABI_CLOUDABI,   17,
637	`Nuxi CloudABI')
638_(ELFOSABI_OPENVOS,    18,
639	`Stratus Technologies OpenVOS')
640_(ELFOSABI_ARM_AEABI,  64,
641	`ARM specific symbol versioning extensions')
642_(ELFOSABI_ARM,        97,
643	`ARM ABI')
644_(ELFOSABI_STANDALONE, 255,
645	`Standalone (embedded) application')
646')
647
648# OS ABI aliases.
649define(`DEFINE_ELF_OSABI_ALIASES',`
650_(ELFOSABI_LINUX,	ELFOSABI_GNU)
651')
652
653#
654# ELF Machine types: (EM_*).
655#
656define(`DEFINE_ELF_MACHINE_TYPES',`
657_(EM_NONE,             0,
658	`No machine')
659_(EM_M32,              1,
660	`AT&T WE 32100')
661_(EM_SPARC,            2,
662	`SPARC')
663_(EM_386,              3,
664	`Intel 80386')
665_(EM_68K,              4,
666	`Motorola 68000')
667_(EM_88K,              5,
668	`Motorola 88000')
669_(EM_IAMCU,            6,
670	`Intel MCU')
671_(EM_860,              7,
672	`Intel 80860')
673_(EM_MIPS,             8,
674	`MIPS I Architecture')
675_(EM_S370,             9,
676	`IBM System/370 Processor')
677_(EM_MIPS_RS3_LE,      10,
678	`MIPS RS3000 Little-endian')
679_(EM_PARISC,           15,
680	`Hewlett-Packard PA-RISC')
681_(EM_VPP500,           17,
682	`Fujitsu VPP500')
683_(EM_SPARC32PLUS,      18,
684	`Enhanced instruction set SPARC')
685_(EM_960,              19,
686	`Intel 80960')
687_(EM_PPC,              20,
688	`PowerPC')
689_(EM_PPC64,            21,
690	`64-bit PowerPC')
691_(EM_S390,             22,
692	`IBM System/390 Processor')
693_(EM_SPU,              23,
694	`IBM SPU/SPC')
695_(EM_V800,             36,
696	`NEC V800')
697_(EM_FR20,             37,
698	`Fujitsu FR20')
699_(EM_RH32,             38,
700	`TRW RH-32')
701_(EM_RCE,              39,
702	`Motorola RCE')
703_(EM_ARM,              40,
704	`Advanced RISC Machines ARM')
705_(EM_ALPHA,            41,
706	`Digital Alpha')
707_(EM_SH,               42,
708	`Hitachi SH')
709_(EM_SPARCV9,          43,
710	`SPARC Version 9')
711_(EM_TRICORE,          44,
712	`Siemens TriCore embedded processor')
713_(EM_ARC,              45,
714	`Argonaut RISC Core, Argonaut Technologies Inc.')
715_(EM_H8_300,           46,
716	`Hitachi H8/300')
717_(EM_H8_300H,          47,
718	`Hitachi H8/300H')
719_(EM_H8S,              48,
720	`Hitachi H8S')
721_(EM_H8_500,           49,
722	`Hitachi H8/500')
723_(EM_IA_64,            50,
724	`Intel IA-64 processor architecture')
725_(EM_MIPS_X,           51,
726	`Stanford MIPS-X')
727_(EM_COLDFIRE,         52,
728	`Motorola ColdFire')
729_(EM_68HC12,           53,
730	`Motorola M68HC12')
731_(EM_MMA,              54,
732	`Fujitsu MMA Multimedia Accelerator')
733_(EM_PCP,              55,
734	`Siemens PCP')
735_(EM_NCPU,             56,
736	`Sony nCPU embedded RISC processor')
737_(EM_NDR1,             57,
738	`Denso NDR1 microprocessor')
739_(EM_STARCORE,         58,
740	`Motorola Star*Core processor')
741_(EM_ME16,             59,
742	`Toyota ME16 processor')
743_(EM_ST100,            60,
744	`STMicroelectronics ST100 processor')
745_(EM_TINYJ,            61,
746	`Advanced Logic Corp. TinyJ embedded processor family')
747_(EM_X86_64,           62,
748	`AMD x86-64 architecture')
749_(EM_PDSP,             63,
750	`Sony DSP Processor')
751_(EM_PDP10,            64,
752	`Digital Equipment Corp. PDP-10')
753_(EM_PDP11,            65,
754	`Digital Equipment Corp. PDP-11')
755_(EM_FX66,             66,
756	`Siemens FX66 microcontroller')
757_(EM_ST9PLUS,          67,
758	`STMicroelectronics ST9+ 8/16 bit microcontroller')
759_(EM_ST7,              68,
760	`STMicroelectronics ST7 8-bit microcontroller')
761_(EM_68HC16,           69,
762	`Motorola MC68HC16 Microcontroller')
763_(EM_68HC11,           70,
764	`Motorola MC68HC11 Microcontroller')
765_(EM_68HC08,           71,
766	`Motorola MC68HC08 Microcontroller')
767_(EM_68HC05,           72,
768	`Motorola MC68HC05 Microcontroller')
769_(EM_SVX,              73,
770	`Silicon Graphics SVx')
771_(EM_ST19,             74,
772	`STMicroelectronics ST19 8-bit microcontroller')
773_(EM_VAX,              75,
774	`Digital VAX')
775_(EM_CRIS,             76,
776	`Axis Communications 32-bit embedded processor')
777_(EM_JAVELIN,          77,
778	`Infineon Technologies 32-bit embedded processor')
779_(EM_FIREPATH,         78,
780	`Element 14 64-bit DSP Processor')
781_(EM_ZSP,              79,
782	`LSI Logic 16-bit DSP Processor')
783_(EM_MMIX,             80,
784	`Educational 64-bit processor by Donald Knuth')
785_(EM_HUANY,            81,
786	`Harvard University machine-independent object files')
787_(EM_PRISM,            82,
788	`SiTera Prism')
789_(EM_AVR,              83,
790	`Atmel AVR 8-bit microcontroller')
791_(EM_FR30,             84,
792	`Fujitsu FR30')
793_(EM_D10V,             85,
794	`Mitsubishi D10V')
795_(EM_D30V,             86,
796	`Mitsubishi D30V')
797_(EM_V850,             87,
798	`NEC v850')
799_(EM_M32R,             88,
800	`Mitsubishi M32R')
801_(EM_MN10300,          89,
802	`Matsushita MN10300')
803_(EM_MN10200,          90,
804	`Matsushita MN10200')
805_(EM_PJ,               91,
806	`picoJava')
807_(EM_OPENRISC,         92,
808	`OpenRISC 32-bit embedded processor')
809_(EM_ARC_COMPACT,      93,
810	`ARC International ARCompact processor')
811_(EM_XTENSA,           94,
812	`Tensilica Xtensa Architecture')
813_(EM_VIDEOCORE,        95,
814	`Alphamosaic VideoCore processor')
815_(EM_TMM_GPP,          96,
816	`Thompson Multimedia General Purpose Processor')
817_(EM_NS32K,            97,
818	`National Semiconductor 32000 series')
819_(EM_TPC,              98,
820	`Tenor Network TPC processor')
821_(EM_SNP1K,            99,
822	`Trebia SNP 1000 processor')
823_(EM_ST200,            100,
824	`STMicroelectronics (www.st.com) ST200 microcontroller')
825_(EM_IP2K,             101,
826	`Ubicom IP2xxx microcontroller family')
827_(EM_MAX,              102,
828	`MAX Processor')
829_(EM_CR,               103,
830	`National Semiconductor CompactRISC microprocessor')
831_(EM_F2MC16,           104,
832	`Fujitsu F2MC16')
833_(EM_MSP430,           105,
834	`Texas Instruments embedded microcontroller msp430')
835_(EM_BLACKFIN,         106,
836	`Analog Devices Blackfin (DSP) processor')
837_(EM_SE_C33,           107,
838	`S1C33 Family of Seiko Epson processors')
839_(EM_SEP,              108,
840	`Sharp embedded microprocessor')
841_(EM_ARCA,             109,
842	`Arca RISC Microprocessor')
843_(EM_UNICORE,          110,
844	`Microprocessor series from PKU-Unity Ltd. and MPRC of Peking University')
845_(EM_EXCESS,           111,
846	`eXcess: 16/32/64-bit configurable embedded CPU')
847_(EM_DXP,              112,
848	`Icera Semiconductor Inc. Deep Execution Processor')
849_(EM_ALTERA_NIOS2,     113,
850	`Altera Nios II soft-core processor')
851_(EM_CRX,              114,
852	`National Semiconductor CompactRISC CRX microprocessor')
853_(EM_XGATE,            115,
854	`Motorola XGATE embedded processor')
855_(EM_C166,             116,
856	`Infineon C16x/XC16x processor')
857_(EM_M16C,             117,
858	`Renesas M16C series microprocessors')
859_(EM_DSPIC30F,         118,
860	`Microchip Technology dsPIC30F Digital Signal Controller')
861_(EM_CE,               119,
862	`Freescale Communication Engine RISC core')
863_(EM_M32C,             120,
864	`Renesas M32C series microprocessors')
865_(EM_TSK3000,          131,
866	`Altium TSK3000 core')
867_(EM_RS08,             132,
868	`Freescale RS08 embedded processor')
869_(EM_SHARC,            133,
870	`Analog Devices SHARC family of 32-bit DSP processors')
871_(EM_ECOG2,            134,
872	`Cyan Technology eCOG2 microprocessor')
873_(EM_SCORE7,           135,
874	`Sunplus S+core7 RISC processor')
875_(EM_DSP24,            136,
876	`New Japan Radio (NJR) 24-bit DSP Processor')
877_(EM_VIDEOCORE3,       137,
878	`Broadcom VideoCore III processor')
879_(EM_LATTICEMICO32,    138,
880	`RISC processor for Lattice FPGA architecture')
881_(EM_SE_C17,           139,
882	`Seiko Epson C17 family')
883_(EM_TI_C6000,         140,
884	`The Texas Instruments TMS320C6000 DSP family')
885_(EM_TI_C2000,         141,
886	`The Texas Instruments TMS320C2000 DSP family')
887_(EM_TI_C5500,         142,
888	`The Texas Instruments TMS320C55x DSP family')
889_(EM_MMDSP_PLUS,       160,
890	`STMicroelectronics 64bit VLIW Data Signal Processor')
891_(EM_CYPRESS_M8C,      161,
892	`Cypress M8C microprocessor')
893_(EM_R32C,             162,
894	`Renesas R32C series microprocessors')
895_(EM_TRIMEDIA,         163,
896	`NXP Semiconductors TriMedia architecture family')
897_(EM_QDSP6,            164,
898	`QUALCOMM DSP6 Processor')
899_(EM_8051,             165,
900	`Intel 8051 and variants')
901_(EM_STXP7X,           166,
902	`STMicroelectronics STxP7x family of configurable and extensible RISC processors')
903_(EM_NDS32,            167,
904	`Andes Technology compact code size embedded RISC processor family')
905_(EM_ECOG1,            168,
906	`Cyan Technology eCOG1X family')
907_(EM_ECOG1X,           168,
908	`Cyan Technology eCOG1X family')
909_(EM_MAXQ30,           169,
910	`Dallas Semiconductor MAXQ30 Core Micro-controllers')
911_(EM_XIMO16,           170,
912	`New Japan Radio (NJR) 16-bit DSP Processor')
913_(EM_MANIK,            171,
914	`M2000 Reconfigurable RISC Microprocessor')
915_(EM_CRAYNV2,          172,
916	`Cray Inc. NV2 vector architecture')
917_(EM_RX,               173,
918	`Renesas RX family')
919_(EM_METAG,            174,
920	`Imagination Technologies META processor architecture')
921_(EM_MCST_ELBRUS,      175,
922	`MCST Elbrus general purpose hardware architecture')
923_(EM_ECOG16,           176,
924	`Cyan Technology eCOG16 family')
925_(EM_CR16,             177,
926	`National Semiconductor CompactRISC CR16 16-bit microprocessor')
927_(EM_ETPU,             178,
928	`Freescale Extended Time Processing Unit')
929_(EM_SLE9X,            179,
930	`Infineon Technologies SLE9X core')
931_(EM_AARCH64,          183,
932	`AArch64 (64-bit ARM)')
933_(EM_AVR32,            185,
934	`Atmel Corporation 32-bit microprocessor family')
935_(EM_STM8,             186,
936	`STMicroeletronics STM8 8-bit microcontroller')
937_(EM_TILE64,           187,
938	`Tilera TILE64 multicore architecture family')
939_(EM_TILEPRO,          188,
940	`Tilera TILEPro multicore architecture family')
941_(EM_MICROBLAZE,       189,
942	`Xilinx MicroBlaze 32-bit RISC soft processor core')
943_(EM_CUDA,             190,
944	`NVIDIA CUDA architecture')
945_(EM_TILEGX,           191,
946	`Tilera TILE-Gx multicore architecture family')
947_(EM_CLOUDSHIELD,      192,
948	`CloudShield architecture family')
949_(EM_COREA_1ST,        193,
950	`KIPO-KAIST Core-A 1st generation processor family')
951_(EM_COREA_2ND,        194,
952	`KIPO-KAIST Core-A 2nd generation processor family')
953_(EM_ARC_COMPACT2,     195,
954	`Synopsys ARCompact V2')
955_(EM_OPEN8,            196,
956	`Open8 8-bit RISC soft processor core')
957_(EM_RL78,             197,
958	`Renesas RL78 family')
959_(EM_VIDEOCORE5,       198,
960	`Broadcom VideoCore V processor')
961_(EM_78KOR,            199,
962	`Renesas 78KOR family')
963_(EM_56800EX,          200,
964	`Freescale 56800EX Digital Signal Controller')
965_(EM_BA1,              201,
966	`Beyond BA1 CPU architecture')
967_(EM_BA2,              202,
968	`Beyond BA2 CPU architecture')
969_(EM_XCORE,            203,
970	`XMOS xCORE processor family')
971_(EM_MCHP_PIC,         204,
972	`Microchip 8-bit PIC(r) family')
973_(EM_INTELGT,          205,
974	`Intel Graphics Technology')
975_(EM_INTEL206,         206,
976	`Reserved by Intel')
977_(EM_INTEL207,         207,
978	`Reserved by Intel')
979_(EM_INTEL208,         208,
980	`Reserved by Intel')
981_(EM_INTEL209,         209,
982	`Reserved by Intel')
983_(EM_KM32,             210,
984	`KM211 KM32 32-bit processor')
985_(EM_KMX32,            211,
986	`KM211 KMX32 32-bit processor')
987_(EM_KMX16,            212,
988	`KM211 KMX16 16-bit processor')
989_(EM_KMX8,             213,
990	`KM211 KMX8 8-bit processor')
991_(EM_KVARC,            214,
992	`KM211 KMX32 KVARC processor')
993_(EM_CDP,              215,
994	`Paneve CDP architecture family')
995_(EM_COGE,             216,
996	`Cognitive Smart Memory Processor')
997_(EM_COOL,             217,
998	`Bluechip Systems CoolEngine')
999_(EM_NORC,             218,
1000	`Nanoradio Optimized RISC')
1001_(EM_CSR_KALIMBA,      219,
1002	`CSR Kalimba architecture family')
1003_(EM_Z80,              220,
1004	`Zilog Z80')
1005_(EM_VISIUM,           221,
1006	`Controls and Data Services VISIUMcore processor')
1007_(EM_FT32,             222,
1008	`FTDI Chip FT32 high performance 32-bit RISC architecture')
1009_(EM_MOXIE,            223,
1010	`Moxie processor family')
1011_(EM_AMDGPU,           224,
1012	`AMD GPU architecture')
1013_(EM_RISCV,            243,
1014	`RISC-V')
1015_(EM_LANAI,            244,
1016	`Lanai processor')
1017_(EM_CEVA,             245,
1018	`CEVA Processor Architecture Family')
1019_(EM_CEVA_X2,          246,
1020	`CEVA X2 Processor Family')
1021_(EM_BPF,              247,
1022	`Linux BPF ��� in-kernel virtual machine')
1023_(EM_GRAPHCORE_IPU,    248,
1024	`Graphcore Intelligent Processing Unit')
1025_(EM_IMG1,             249,
1026	`Imagination Technologies')
1027_(EM_NFP,              250,
1028	`Netronome Flow Processor (NFP)')
1029_(EM_CSKY,             252,
1030	`C-SKY processor family')
1031_(EM_65816,            257,
1032	`WDC 65816/65C816')
1033_(EM_KF32,             259,
1034	`ChipON KungFu 32')
1035')
1036
1037define(`DEFINE_ELF_MACHINE_TYPE_SYNONYMS',`
1038_(EM_AMD64, EM_X86_64)
1039_(EM_ARC_A5, EM_ARC_COMPACT)
1040')
1041
1042#
1043# ELF file types: (ET_*).
1044#
1045define(`DEFINE_ELF_TYPES',`
1046_(ET_NONE,   0,
1047	`No file type')
1048_(ET_REL,    1,
1049	`Relocatable object')
1050_(ET_EXEC,   2,
1051	`Executable')
1052_(ET_DYN,    3,
1053	`Shared object')
1054_(ET_CORE,   4,
1055	`Core file')
1056_(ET_LOOS,   0xFE00U,
1057	`Begin OS-specific range')
1058_(ET_HIOS,   0xFEFFU,
1059	`End OS-specific range')
1060_(ET_LOPROC, 0xFF00U,
1061	`Begin processor-specific range')
1062_(ET_HIPROC, 0xFFFFU,
1063	`End processor-specific range')
1064')
1065
1066# ELF file format version numbers.
1067define(`DEFINE_ELF_FILE_VERSIONS',`
1068_(EV_NONE, 0)
1069_(EV_CURRENT, 1)
1070')
1071
1072#
1073# Flags for section groups.
1074#
1075define(`DEFINE_GRP_FLAGS',`
1076_(GRP_COMDAT, 	0x1,
1077	`COMDAT semantics')
1078_(GRP_MASKOS,	0x0ff00000,
1079	`OS-specific flags')
1080_(GRP_MASKPROC, 	0xf0000000,
1081	`processor-specific flags')
1082')
1083
1084#
1085# Flags / mask for .gnu.versym sections.
1086#
1087define(`DEFINE_VERSYMS',`
1088_(VERSYM_VERSION,	0x7fff)
1089_(VERSYM_HIDDEN,	0x8000)
1090')
1091
1092#
1093# Flags used by program header table entries.
1094#
1095define(`DEFINE_PHDR_FLAGS',`
1096_(PF_X,                0x1,
1097	`Execute')
1098_(PF_W,                0x2,
1099	`Write')
1100_(PF_R,                0x4,
1101	`Read')
1102_(PF_MASKOS,           0x0ff00000,
1103	`OS-specific flags')
1104_(PF_MASKPROC,         0xf0000000,
1105	`Processor-specific flags')
1106_(PF_ARM_SB,           0x10000000,
1107	`segment contains the location addressed by the static base')
1108_(PF_ARM_PI,           0x20000000,
1109	`segment is position-independent')
1110_(PF_ARM_ABS,          0x40000000,
1111	`segment must be loaded at its base address')
1112')
1113
1114#
1115# Types of program header table entries.
1116#
1117define(`DEFINE_PHDR_TYPES',`
1118_(PT_NULL,             0UL,
1119	`ignored entry')
1120_(PT_LOAD,             1UL,
1121	`loadable segment')
1122_(PT_DYNAMIC,          2UL,
1123	`contains dynamic linking information')
1124_(PT_INTERP,           3UL,
1125	`names an interpreter')
1126_(PT_NOTE,             4UL,
1127	`auxiliary information')
1128_(PT_SHLIB,            5UL,
1129	`reserved')
1130_(PT_PHDR,             6UL,
1131	`describes the program header itself')
1132_(PT_TLS,              7UL,
1133	`thread local storage')
1134_(PT_LOOS,             0x60000000UL,
1135	`start of OS-specific range')
1136_(PT_SUNW_UNWIND,      0x6464E550UL,
1137	`Solaris/amd64 stack unwind tables')
1138_(PT_GNU_EH_FRAME,     0x6474E550UL,
1139	`GCC generated .eh_frame_hdr segment')
1140_(PT_GNU_STACK,	    0x6474E551UL,
1141	`Stack flags')
1142_(PT_GNU_RELRO,	    0x6474E552UL,
1143	`Segment becomes read-only after relocation')
1144_(PT_OPENBSD_RANDOMIZE,0x65A3DBE6UL,
1145	`Segment filled with random data')
1146_(PT_OPENBSD_WXNEEDED, 0x65A3DBE7UL,
1147	`Program violates W^X')
1148_(PT_OPENBSD_BOOTDATA, 0x65A41BE6UL,
1149	`Boot data')
1150_(PT_SUNWBSS,          0x6FFFFFFAUL,
1151	`A Solaris .SUNW_bss section')
1152_(PT_SUNWSTACK,        0x6FFFFFFBUL,
1153	`A Solaris process stack')
1154_(PT_SUNWDTRACE,       0x6FFFFFFCUL,
1155	`Used by dtrace(1)')
1156_(PT_SUNWCAP,          0x6FFFFFFDUL,
1157	`Special hardware capability requirements')
1158_(PT_HIOS,             0x6FFFFFFFUL,
1159	`end of OS-specific range')
1160_(PT_LOPROC,           0x70000000UL,
1161	`start of processor-specific range')
1162_(PT_ARM_ARCHEXT,      0x70000000UL,
1163	`platform architecture compatibility information')
1164_(PT_ARM_EXIDX,        0x70000001UL,
1165	`exception unwind tables')
1166_(PT_MIPS_REGINFO,     0x70000000UL,
1167	`register usage information')
1168_(PT_MIPS_RTPROC,      0x70000001UL,
1169	`runtime procedure table')
1170_(PT_MIPS_OPTIONS,     0x70000002UL,
1171	`options segment')
1172_(PT_HIPROC,           0x7FFFFFFFUL,
1173	`end of processor-specific range')
1174')
1175
1176define(`DEFINE_PHDR_TYPE_SYNONYMS',`
1177_(PT_ARM_UNWIND,	PT_ARM_EXIDX)
1178_(PT_HISUNW,	PT_HIOS)
1179_(PT_LOSUNW,	PT_SUNWBSS)
1180')
1181
1182#
1183# Section flags.
1184#
1185define(`DEFINE_SECTION_FLAGS',`
1186_(SHF_WRITE,           0x1,
1187	`writable during program execution')
1188_(SHF_ALLOC,           0x2,
1189	`occupies memory during program execution')
1190_(SHF_EXECINSTR,       0x4,
1191	`executable instructions')
1192_(SHF_MERGE,           0x10,
1193	`may be merged to prevent duplication')
1194_(SHF_STRINGS,         0x20,
1195	`NUL-terminated character strings')
1196_(SHF_INFO_LINK,       0x40,
1197	`the sh_info field holds a link')
1198_(SHF_LINK_ORDER,      0x80,
1199	`special ordering requirements during linking')
1200_(SHF_OS_NONCONFORMING, 0x100,
1201	`requires OS-specific processing during linking')
1202_(SHF_GROUP,           0x200,
1203	`member of a section group')
1204_(SHF_TLS,             0x400,
1205	`holds thread-local storage')
1206_(SHF_COMPRESSED,      0x800,
1207	`holds compressed data')
1208_(SHF_MASKOS,          0x0FF00000UL,
1209	`bits reserved for OS-specific semantics')
1210_(SHF_AMD64_LARGE,     0x10000000UL,
1211	`section uses large code model')
1212_(SHF_ENTRYSECT,       0x10000000UL,
1213	`section contains an entry point (ARM)')
1214_(SHF_COMDEF,          0x80000000UL,
1215	`section may be multiply defined in input to link step (ARM)')
1216_(SHF_MIPS_GPREL,      0x10000000UL,
1217	`section must be part of global data area')
1218_(SHF_MIPS_MERGE,      0x20000000UL,
1219	`section data should be merged to eliminate duplication')
1220_(SHF_MIPS_ADDR,       0x40000000UL,
1221	`section data is addressed by default')
1222_(SHF_MIPS_STRING,     0x80000000UL,
1223	`section data is string data by default')
1224_(SHF_MIPS_NOSTRIP,    0x08000000UL,
1225	`section data may not be stripped')
1226_(SHF_MIPS_LOCAL,      0x04000000UL,
1227	`section data local to process')
1228_(SHF_MIPS_NAMES,      0x02000000UL,
1229	`linker must generate implicit hidden weak names')
1230_(SHF_MIPS_NODUPE,     0x01000000UL,
1231	`linker must retain only one copy')
1232_(SHF_ORDERED,         0x40000000UL,
1233	`section is ordered with respect to other sections')
1234_(SHF_EXCLUDE,	     0x80000000UL,
1235	`section is excluded from executables and shared objects')
1236_(SHF_MASKPROC,        0xF0000000UL,
1237	`bits reserved for processor-specific semantics')
1238')
1239
1240#
1241# Special section indices.
1242#
1243define(`DEFINE_SECTION_INDICES',`
1244_(SHN_UNDEF, 	0,
1245	 `undefined section')
1246_(SHN_LORESERVE, 	0xFF00U,
1247	`start of reserved area')
1248_(SHN_LOPROC, 	0xFF00U,
1249	`start of processor-specific range')
1250_(SHN_BEFORE,	0xFF00U,
1251	`used for section ordering')
1252_(SHN_AFTER,	0xFF01U,
1253	`used for section ordering')
1254_(SHN_AMD64_LCOMMON, 0xFF02U,
1255	`large common block label')
1256_(SHN_MIPS_ACOMMON, 0xFF00U,
1257	`allocated common symbols in a DSO')
1258_(SHN_MIPS_TEXT,	0xFF01U,
1259	`Reserved (obsolete)')
1260_(SHN_MIPS_DATA,	0xFF02U,
1261	`Reserved (obsolete)')
1262_(SHN_MIPS_SCOMMON, 0xFF03U,
1263	`gp-addressable common symbols')
1264_(SHN_MIPS_SUNDEFINED, 0xFF04U,
1265	`gp-addressable undefined symbols')
1266_(SHN_MIPS_LCOMMON, 0xFF05U,
1267	`local common symbols')
1268_(SHN_MIPS_LUNDEFINED, 0xFF06U,
1269	`local undefined symbols')
1270_(SHN_HIPROC, 	0xFF1FU,
1271	`end of processor-specific range')
1272_(SHN_LOOS, 	0xFF20U,
1273	`start of OS-specific range')
1274_(SHN_SUNW_IGNORE, 0xFF3FU,
1275	`used by dtrace')
1276_(SHN_HIOS, 	0xFF3FU,
1277	`end of OS-specific range')
1278_(SHN_ABS, 	0xFFF1U,
1279	`absolute references')
1280_(SHN_COMMON, 	0xFFF2U,
1281	`references to COMMON areas')
1282_(SHN_XINDEX, 	0xFFFFU,
1283	`extended index')
1284_(SHN_HIRESERVE, 	0xFFFFU,
1285	`end of reserved area')
1286')
1287
1288#
1289# Section types.
1290#
1291define(`DEFINE_SECTION_TYPES',`
1292_(SHT_NULL,            0, `inactive header')
1293_(SHT_PROGBITS,        1, `program defined information')
1294_(SHT_SYMTAB,          2, `symbol table')
1295_(SHT_STRTAB,          3, `string table')
1296_(SHT_RELA,            4,
1297	`relocation entries with addends')
1298_(SHT_HASH,            5, `symbol hash table')
1299_(SHT_DYNAMIC,         6,
1300	`information for dynamic linking')
1301_(SHT_NOTE,            7, `additional notes')
1302_(SHT_NOBITS,          8, `section occupying no space')
1303_(SHT_REL,             9,
1304	`relocation entries without addends')
1305_(SHT_SHLIB,           10, `reserved')
1306_(SHT_DYNSYM,          11, `symbol table')
1307_(SHT_INIT_ARRAY,      14,
1308	`pointers to initialization functions')
1309_(SHT_FINI_ARRAY,      15,
1310	`pointers to termination functions')
1311_(SHT_PREINIT_ARRAY,   16,
1312	`pointers to functions called before initialization')
1313_(SHT_GROUP,           17, `defines a section group')
1314_(SHT_SYMTAB_SHNDX,    18,
1315	`used for extended section numbering')
1316_(SHT_LOOS,            0x60000000UL,
1317	`start of OS-specific range')
1318_(SHT_SUNW_dof,	     0x6FFFFFF4UL,
1319	`used by dtrace')
1320_(SHT_SUNW_cap,	     0x6FFFFFF5UL,
1321	`capability requirements')
1322_(SHT_GNU_ATTRIBUTES,  0x6FFFFFF5UL,
1323	`object attributes')
1324_(SHT_SUNW_SIGNATURE,  0x6FFFFFF6UL,
1325	`module verification signature')
1326_(SHT_GNU_HASH,	     0x6FFFFFF6UL,
1327	`GNU Hash sections')
1328_(SHT_GNU_LIBLIST,     0x6FFFFFF7UL,
1329	`List of libraries to be prelinked')
1330_(SHT_SUNW_ANNOTATE,   0x6FFFFFF7UL,
1331	`special section where unresolved references are allowed')
1332_(SHT_SUNW_DEBUGSTR,   0x6FFFFFF8UL,
1333	`debugging information')
1334_(SHT_CHECKSUM, 	     0x6FFFFFF8UL,
1335	`checksum for dynamic shared objects')
1336_(SHT_SUNW_DEBUG,      0x6FFFFFF9UL,
1337	`debugging information')
1338_(SHT_SUNW_move,       0x6FFFFFFAUL,
1339	`information to handle partially initialized symbols')
1340_(SHT_SUNW_COMDAT,     0x6FFFFFFBUL,
1341	`section supporting merging of multiple copies of data')
1342_(SHT_SUNW_syminfo,    0x6FFFFFFCUL,
1343	`additional symbol information')
1344_(SHT_SUNW_verdef,     0x6FFFFFFDUL,
1345	`symbol versioning information')
1346_(SHT_SUNW_verneed,    0x6FFFFFFEUL,
1347	`symbol versioning requirements')
1348_(SHT_SUNW_versym,     0x6FFFFFFFUL,
1349	`symbol versioning table')
1350_(SHT_HIOS,            0x6FFFFFFFUL,
1351	`end of OS-specific range')
1352_(SHT_LOPROC,          0x70000000UL,
1353	`start of processor-specific range')
1354_(SHT_ARM_EXIDX,       0x70000001UL,
1355	`exception index table')
1356_(SHT_ARM_PREEMPTMAP,  0x70000002UL,
1357	`BPABI DLL dynamic linking preemption map')
1358_(SHT_ARM_ATTRIBUTES,  0x70000003UL,
1359	`object file compatibility attributes')
1360_(SHT_ARM_DEBUGOVERLAY, 0x70000004UL,
1361	`overlay debug information')
1362_(SHT_ARM_OVERLAYSECTION, 0x70000005UL,
1363	`overlay debug information')
1364_(SHT_MIPS_LIBLIST,    0x70000000UL,
1365	`DSO library information used in link')
1366_(SHT_MIPS_MSYM,       0x70000001UL,
1367	`MIPS symbol table extension')
1368_(SHT_MIPS_CONFLICT,   0x70000002UL,
1369	`symbol conflicting with DSO-defined symbols ')
1370_(SHT_MIPS_GPTAB,      0x70000003UL,
1371	`global pointer table')
1372_(SHT_MIPS_UCODE,      0x70000004UL,
1373	`reserved')
1374_(SHT_MIPS_DEBUG,      0x70000005UL,
1375	`reserved (obsolete debug information)')
1376_(SHT_MIPS_REGINFO,    0x70000006UL,
1377	`register usage information')
1378_(SHT_MIPS_PACKAGE,    0x70000007UL,
1379	`OSF reserved')
1380_(SHT_MIPS_PACKSYM,    0x70000008UL,
1381	`OSF reserved')
1382_(SHT_MIPS_RELD,       0x70000009UL,
1383	`dynamic relocation')
1384_(SHT_MIPS_IFACE,      0x7000000BUL,
1385	`subprogram interface information')
1386_(SHT_MIPS_CONTENT,    0x7000000CUL,
1387	`section content classification')
1388_(SHT_MIPS_OPTIONS,     0x7000000DUL,
1389	`general options')
1390_(SHT_MIPS_DELTASYM,   0x7000001BUL,
1391	`Delta C++: symbol table')
1392_(SHT_MIPS_DELTAINST,  0x7000001CUL,
1393	`Delta C++: instance table')
1394_(SHT_MIPS_DELTACLASS, 0x7000001DUL,
1395	`Delta C++: class table')
1396_(SHT_MIPS_DWARF,      0x7000001EUL,
1397	`DWARF debug information')
1398_(SHT_MIPS_DELTADECL,  0x7000001FUL,
1399	`Delta C++: declarations')
1400_(SHT_MIPS_SYMBOL_LIB, 0x70000020UL,
1401	`symbol-to-library mapping')
1402_(SHT_MIPS_EVENTS,     0x70000021UL,
1403	`event locations')
1404_(SHT_MIPS_TRANSLATE,  0x70000022UL,
1405	`???')
1406_(SHT_MIPS_PIXIE,      0x70000023UL,
1407	`special pixie sections')
1408_(SHT_MIPS_XLATE,      0x70000024UL,
1409	`address translation table')
1410_(SHT_MIPS_XLATE_DEBUG, 0x70000025UL,
1411	`SGI internal address translation table')
1412_(SHT_MIPS_WHIRL,      0x70000026UL,
1413	`intermediate code')
1414_(SHT_MIPS_EH_REGION,  0x70000027UL,
1415	`C++ exception handling region info')
1416_(SHT_MIPS_XLATE_OLD,  0x70000028UL,
1417	`obsolete')
1418_(SHT_MIPS_PDR_EXCEPTION, 0x70000029UL,
1419	`runtime procedure descriptor table exception information')
1420_(SHT_MIPS_ABIFLAGS,   0x7000002AUL,
1421	`ABI flags')
1422_(SHT_SPARC_GOTDATA,   0x70000000UL,
1423	`SPARC-specific data')
1424_(SHT_X86_64_UNWIND,   0x70000001UL,
1425	`unwind tables for the AMD64')
1426_(SHT_ORDERED,         0x7FFFFFFFUL,
1427	`sort entries in the section')
1428_(SHT_HIPROC,          0x7FFFFFFFUL,
1429	`end of processor-specific range')
1430_(SHT_LOUSER,          0x80000000UL,
1431	`start of application-specific range')
1432_(SHT_HIUSER,          0xFFFFFFFFUL,
1433	`end of application-specific range')
1434')
1435
1436# Aliases for section types.
1437define(`DEFINE_SECTION_TYPE_ALIASES',`
1438_(SHT_AMD64_UNWIND,	SHT_X86_64_UNWIND)
1439_(SHT_GNU_verdef,	SHT_SUNW_verdef)
1440_(SHT_GNU_verneed,	SHT_SUNW_verneed)
1441_(SHT_GNU_versym,	SHT_SUNW_versym)
1442')
1443
1444#
1445# Symbol binding information.
1446#
1447define(`DEFINE_SYMBOL_BINDINGS',`
1448_(STB_LOCAL,           0,
1449	`not visible outside defining object file')
1450_(STB_GLOBAL,          1,
1451	`visible across all object files being combined')
1452_(STB_WEAK,            2,
1453	`visible across all object files but with low precedence')
1454_(STB_LOOS,            10,
1455	`start of OS-specific range')
1456_(STB_GNU_UNIQUE,      10,
1457	`unique symbol (GNU)')
1458_(STB_HIOS,            12,
1459	`end of OS-specific range')
1460_(STB_LOPROC,          13,
1461	`start of processor-specific range')
1462_(STB_HIPROC,          15,
1463	`end of processor-specific range')
1464')
1465
1466#
1467# Symbol types
1468#
1469define(`DEFINE_SYMBOL_TYPES',`
1470_(STT_NOTYPE,          0,
1471	`unspecified type')
1472_(STT_OBJECT,          1,
1473	`data object')
1474_(STT_FUNC,            2,
1475	`executable code')
1476_(STT_SECTION,         3,
1477	`section')
1478_(STT_FILE,            4,
1479	`source file')
1480_(STT_COMMON,          5,
1481	`uninitialized common block')
1482_(STT_TLS,             6,
1483	`thread local storage')
1484_(STT_LOOS,            10,
1485	`start of OS-specific types')
1486_(STT_GNU_IFUNC,       10,
1487	`indirect function')
1488_(STT_HIOS,            12,
1489	`end of OS-specific types')
1490_(STT_LOPROC,          13,
1491	`start of processor-specific types')
1492_(STT_ARM_TFUNC,       13,
1493	`Thumb function (GNU)')
1494_(STT_ARM_16BIT,       15,
1495	`Thumb label (GNU)')
1496_(STT_SPARC_REGISTER,  13,
1497	`SPARC register information')
1498_(STT_HIPROC,          15,
1499	`end of processor-specific types')
1500')
1501
1502#
1503# Symbol binding.
1504#
1505define(`DEFINE_SYMBOL_BINDING_KINDS',`
1506_(SYMINFO_BT_SELF,	0xFFFFU,
1507	`bound to self')
1508_(SYMINFO_BT_PARENT,	0xFFFEU,
1509	`bound to parent')
1510_(SYMINFO_BT_NONE,	0xFFFDU,
1511	`no special binding')
1512')
1513
1514#
1515# Symbol visibility.
1516#
1517define(`DEFINE_SYMBOL_VISIBILITIES',`
1518_(STV_DEFAULT,         0,
1519	`as specified by symbol type')
1520_(STV_INTERNAL,        1,
1521	`as defined by processor semantics')
1522_(STV_HIDDEN,          2,
1523	`hidden from other components')
1524_(STV_PROTECTED,       3,
1525	`local references are not preemptable')
1526')
1527
1528#
1529# Symbol flags.
1530#
1531define(`DEFINE_SYMBOL_FLAGS',`
1532_(SYMINFO_FLG_DIRECT,	0x01,
1533	`directly assocated reference')
1534_(SYMINFO_FLG_COPY,	0x04,
1535	`definition by copy-relocation')
1536_(SYMINFO_FLG_LAZYLOAD,	0x08,
1537	`object should be lazily loaded')
1538_(SYMINFO_FLG_DIRECTBIND,	0x10,
1539	`reference should be directly bound')
1540_(SYMINFO_FLG_NOEXTDIRECT, 0x20,
1541	`external references not allowed to bind to definition')
1542')
1543
1544#
1545# Version dependencies.
1546#
1547define(`DEFINE_VERSIONING_DEPENDENCIES',`
1548_(VER_NDX_LOCAL,	0,
1549	`local scope')
1550_(VER_NDX_GLOBAL,	1,
1551	`global scope')
1552')
1553
1554#
1555# Version flags.
1556#
1557define(`DEFINE_VERSIONING_FLAGS',`
1558_(VER_FLG_BASE,		0x1,
1559	`file version')
1560_(VER_FLG_WEAK,		0x2,
1561	`weak version')
1562')
1563
1564#
1565# Version needs
1566#
1567define(`DEFINE_VERSIONING_NEEDS',`
1568_(VER_NEED_NONE,		0,
1569	`invalid version')
1570_(VER_NEED_CURRENT,	1,
1571	`current version')
1572')
1573
1574#
1575# Versioning numbers.
1576#
1577define(`DEFINE_VERSIONING_NUMBERS',`
1578_(VER_DEF_NONE,		0,
1579	`invalid version')
1580_(VER_DEF_CURRENT,	1, 
1581	`current version')
1582')
1583
1584#
1585# Relocation types.
1586#
1587define(`DEFINE_386_RELOCATIONS',`
1588_(R_386_NONE,		0)
1589_(R_386_32,		1)
1590_(R_386_PC32,		2)
1591_(R_386_GOT32,		3)
1592_(R_386_PLT32,		4)
1593_(R_386_COPY,		5)
1594_(R_386_GLOB_DAT,	6)
1595_(R_386_JUMP_SLOT,	7)
1596_(R_386_RELATIVE,	8)
1597_(R_386_GOTOFF,		9)
1598_(R_386_GOTPC,		10)
1599_(R_386_32PLT,		11)
1600_(R_386_TLS_TPOFF,	14)
1601_(R_386_TLS_IE,		15)
1602_(R_386_TLS_GOTIE,	16)
1603_(R_386_TLS_LE,		17)
1604_(R_386_TLS_GD,		18)
1605_(R_386_TLS_LDM,	19)
1606_(R_386_16,		20)
1607_(R_386_PC16,		21)
1608_(R_386_8,		22)
1609_(R_386_PC8,		23)
1610_(R_386_TLS_GD_32,	24)
1611_(R_386_TLS_GD_PUSH,	25)
1612_(R_386_TLS_GD_CALL,	26)
1613_(R_386_TLS_GD_POP,	27)
1614_(R_386_TLS_LDM_32,	28)
1615_(R_386_TLS_LDM_PUSH,	29)
1616_(R_386_TLS_LDM_CALL,	30)
1617_(R_386_TLS_LDM_POP,	31)
1618_(R_386_TLS_LDO_32,	32)
1619_(R_386_TLS_IE_32,	33)
1620_(R_386_TLS_LE_32,	34)
1621_(R_386_TLS_DTPMOD32,	35)
1622_(R_386_TLS_DTPOFF32,	36)
1623_(R_386_TLS_TPOFF32,	37)
1624_(R_386_SIZE32,		38)
1625_(R_386_TLS_GOTDESC,	39)
1626_(R_386_TLS_DESC_CALL,	40)
1627_(R_386_TLS_DESC,	41)
1628_(R_386_IRELATIVE,	42)
1629_(R_386_GOT32X,		43)
1630')
1631
1632define(`DEFINE_AARCH64_RELOCATIONS',`
1633_(R_AARCH64_NONE,				0)
1634_(R_AARCH64_ABS64,				257)
1635_(R_AARCH64_ABS32,				258)
1636_(R_AARCH64_ABS16,				259)
1637_(R_AARCH64_PREL64,				260)
1638_(R_AARCH64_PREL32,				261)
1639_(R_AARCH64_PREL16,				262)
1640_(R_AARCH64_MOVW_UABS_G0,			263)
1641_(R_AARCH64_MOVW_UABS_G0_NC,			264)
1642_(R_AARCH64_MOVW_UABS_G1,			265)
1643_(R_AARCH64_MOVW_UABS_G1_NC,			266)
1644_(R_AARCH64_MOVW_UABS_G2,			267)
1645_(R_AARCH64_MOVW_UABS_G2_NC,			268)
1646_(R_AARCH64_MOVW_UABS_G3,			269)
1647_(R_AARCH64_MOVW_SABS_G0,			270)
1648_(R_AARCH64_MOVW_SABS_G1,			271)
1649_(R_AARCH64_MOVW_SABS_G2,			272)
1650_(R_AARCH64_LD_PREL_LO19,			273)
1651_(R_AARCH64_ADR_PREL_LO21,			274)
1652_(R_AARCH64_ADR_PREL_PG_HI21,			275)
1653_(R_AARCH64_ADR_PREL_PG_HI21_NC,		276)
1654_(R_AARCH64_ADD_ABS_LO12_NC,			277)
1655_(R_AARCH64_LDST8_ABS_LO12_NC,			278)
1656_(R_AARCH64_TSTBR14,				279)
1657_(R_AARCH64_CONDBR19,				280)
1658_(R_AARCH64_JUMP26,				282)
1659_(R_AARCH64_CALL26,				283)
1660_(R_AARCH64_LDST16_ABS_LO12_NC,			284)
1661_(R_AARCH64_LDST32_ABS_LO12_NC,			285)
1662_(R_AARCH64_LDST64_ABS_LO12_NC,			286)
1663_(R_AARCH64_MOVW_PREL_G0,			287)
1664_(R_AARCH64_MOVW_PREL_G0_NC,			288)
1665_(R_AARCH64_MOVW_PREL_G1,			289)
1666_(R_AARCH64_MOVW_PREL_G1_NC,			290)
1667_(R_AARCH64_MOVW_PREL_G2,			291)
1668_(R_AARCH64_MOVW_PREL_G2_NC,			292)
1669_(R_AARCH64_MOVW_PREL_G3,			293)
1670_(R_AARCH64_LDST128_ABS_LO12_NC,		299)
1671_(R_AARCH64_MOVW_GOTOFF_G0,			300)
1672_(R_AARCH64_MOVW_GOTOFF_G0_NC,			301)
1673_(R_AARCH64_MOVW_GOTOFF_G1,			302)
1674_(R_AARCH64_MOVW_GOTOFF_G1_NC,			303)
1675_(R_AARCH64_MOVW_GOTOFF_G2,			304)
1676_(R_AARCH64_MOVW_GOTOFF_G2_NC,			305)
1677_(R_AARCH64_MOVW_GOTOFF_G3,			306)
1678_(R_AARCH64_GOTREL64,				307)
1679_(R_AARCH64_GOTREL32,				308)
1680_(R_AARCH64_GOT_LD_PREL19,			309)
1681_(R_AARCH64_LD64_GOTOFF_LO15,			310)
1682_(R_AARCH64_ADR_GOT_PAGE,			311)
1683_(R_AARCH64_LD64_GOT_LO12_NC,			312)
1684_(R_AARCH64_LD64_GOTPAGE_LO15,			313)
1685_(R_AARCH64_TLSGD_ADR_PREL21,			512)
1686_(R_AARCH64_TLSGD_ADR_PAGE21,			513)
1687_(R_AARCH64_TLSGD_ADD_LO12_NC,			514)
1688_(R_AARCH64_TLSGD_MOVW_G1,			515)
1689_(R_AARCH64_TLSGD_MOVW_G0_NC,			516)
1690_(R_AARCH64_TLSLD_ADR_PREL21,			517)
1691_(R_AARCH64_TLSLD_ADR_PAGE21,			518)
1692_(R_AARCH64_TLSLD_ADD_LO12_NC,			519)
1693_(R_AARCH64_TLSLD_MOVW_G1,			520)
1694_(R_AARCH64_TLSLD_MOVW_G0_NC,			521)
1695_(R_AARCH64_TLSLD_LD_PREL19,			522)
1696_(R_AARCH64_TLSLD_MOVW_DTPREL_G2,		523)
1697_(R_AARCH64_TLSLD_MOVW_DTPREL_G1,		524)
1698_(R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC,		525)
1699_(R_AARCH64_TLSLD_MOVW_DTPREL_G0,		526)
1700_(R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC,		527)
1701_(R_AARCH64_TLSLD_ADD_DTPREL_HI12,		529)
1702_(R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC,		530)
1703_(R_AARCH64_TLSLD_LDST8_DTPREL_LO12,		531)
1704_(R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC,		532)
1705_(R_AARCH64_TLSLD_LDST16_DTPREL_LO12,		533)
1706_(R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC,	534)
1707_(R_AARCH64_TLSLD_LDST32_DTPREL_LO12,		535)
1708_(R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC,	536)
1709_(R_AARCH64_TLSLD_LDST64_DTPREL_LO12,		537)
1710_(R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC,	538)
1711_(R_AARCH64_TLSIE_MOVW_GOTTPREL_G1,		539)
1712_(R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC,		540)
1713_(R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21,		541)
1714_(R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC,	542)
1715_(R_AARCH64_TLSIE_LD_GOTTPREL_PREL19,		543)
1716_(R_AARCH64_TLSLE_MOVW_TPREL_G2,		544)
1717_(R_AARCH64_TLSLE_MOVW_TPREL_G1,		545)
1718_(R_AARCH64_TLSLE_MOVW_TPREL_G1_NC,		546)
1719_(R_AARCH64_TLSLE_MOVW_TPREL_G0,		547)
1720_(R_AARCH64_TLSLE_MOVW_TPREL_G0_NC,		548)
1721_(R_AARCH64_TLSLE_ADD_TPREL_HI12,		549)
1722_(R_AARCH64_TLSLE_ADD_TPREL_LO12,		550)
1723_(R_AARCH64_TLSLE_ADD_TPREL_LO12_NC,		551)
1724_(R_AARCH64_TLSLE_LDST8_TPREL_LO12,		552)
1725_(R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC,		553)
1726_(R_AARCH64_TLSLE_LDST16_TPREL_LO12,		554)
1727_(R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC,		555)
1728_(R_AARCH64_TLSLE_LDST32_TPREL_LO12,		556)
1729_(R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC,		557)
1730_(R_AARCH64_TLSLE_LDST64_TPREL_LO12,		558)
1731_(R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC,		559)
1732_(R_AARCH64_TLSDESC_LD_PREL19,			560)
1733_(R_AARCH64_TLSDESC_ADR_PREL21,			561)
1734_(R_AARCH64_TLSDESC_ADR_PAGE21,			562)
1735_(R_AARCH64_TLSDESC_LD64_LO12,			563)
1736_(R_AARCH64_TLSDESC_ADD_LO12,			564)
1737_(R_AARCH64_TLSDESC_OFF_G1,			565)
1738_(R_AARCH64_TLSDESC_OFF_G0_NC,			566)
1739_(R_AARCH64_TLSDESC_LDR,			567)
1740_(R_AARCH64_TLSDESC_ADD,			568)
1741_(R_AARCH64_TLSDESC_CALL,			569)
1742_(R_AARCH64_TLSLE_LDST128_TPREL_LO12,		570)
1743_(R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC,	571)
1744_(R_AARCH64_TLSLD_LDST128_DTPREL_LO12,		572)
1745_(R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC,	573)
1746_(R_AARCH64_COPY,				1024)
1747_(R_AARCH64_GLOB_DAT,				1025)
1748_(R_AARCH64_JUMP_SLOT,				1026)
1749_(R_AARCH64_RELATIVE,				1027)
1750_(R_AARCH64_TLS_DTPREL64,			1028)
1751_(R_AARCH64_TLS_DTPMOD64,			1029)
1752_(R_AARCH64_TLS_TPREL64,			1030)
1753_(R_AARCH64_TLSDESC,				1031)
1754_(R_AARCH64_IRELATIVE,				1032)
1755')
1756
1757#
1758# These are the symbols used in the Sun ``Linkers and Loaders
1759# Guide'', Document No: 817-1984-17.  See the X86_64 relocations list
1760# below for the spellings used in the ELF specification.
1761#
1762define(`DEFINE_AMD64_RELOCATIONS',`
1763_(R_AMD64_NONE,		0)
1764_(R_AMD64_64,		1)
1765_(R_AMD64_PC32,		2)
1766_(R_AMD64_GOT32,	3)
1767_(R_AMD64_PLT32,	4)
1768_(R_AMD64_COPY,		5)
1769_(R_AMD64_GLOB_DAT,	6)
1770_(R_AMD64_JUMP_SLOT,	7)
1771_(R_AMD64_RELATIVE,	8)
1772_(R_AMD64_GOTPCREL,	9)
1773_(R_AMD64_32,		10)
1774_(R_AMD64_32S,		11)
1775_(R_AMD64_16,		12)
1776_(R_AMD64_PC16,		13)
1777_(R_AMD64_8,		14)
1778_(R_AMD64_PC8,		15)
1779_(R_AMD64_PC64,		24)
1780_(R_AMD64_GOTOFF64,	25)
1781_(R_AMD64_GOTPC32,	26)
1782')
1783
1784#
1785# Relocation definitions from the ARM ELF ABI, version "ARM IHI
1786# 0044E" released on 30th November 2012.
1787#
1788define(`DEFINE_ARM_RELOCATIONS',`
1789_(R_ARM_NONE,			0)
1790_(R_ARM_PC24,			1)
1791_(R_ARM_ABS32,			2)
1792_(R_ARM_REL32,			3)
1793_(R_ARM_LDR_PC_G0,		4)
1794_(R_ARM_ABS16,			5)
1795_(R_ARM_ABS12,			6)
1796_(R_ARM_THM_ABS5,		7)
1797_(R_ARM_ABS8,			8)
1798_(R_ARM_SBREL32,		9)
1799_(R_ARM_THM_CALL,		10)
1800_(R_ARM_THM_PC8,		11)
1801_(R_ARM_BREL_ADJ,		12)
1802_(R_ARM_SWI24,			13)
1803_(R_ARM_TLS_DESC,		13)
1804_(R_ARM_THM_SWI8,		14)
1805_(R_ARM_XPC25,			15)
1806_(R_ARM_THM_XPC22,		16)
1807_(R_ARM_TLS_DTPMOD32,		17)
1808_(R_ARM_TLS_DTPOFF32,		18)
1809_(R_ARM_TLS_TPOFF32,		19)
1810_(R_ARM_COPY,			20)
1811_(R_ARM_GLOB_DAT,		21)
1812_(R_ARM_JUMP_SLOT,		22)
1813_(R_ARM_RELATIVE,		23)
1814_(R_ARM_GOTOFF32,		24)
1815_(R_ARM_BASE_PREL,		25)
1816_(R_ARM_GOT_BREL,		26)
1817_(R_ARM_PLT32,			27)
1818_(R_ARM_CALL,			28)
1819_(R_ARM_JUMP24,			29)
1820_(R_ARM_THM_JUMP24,		30)
1821_(R_ARM_BASE_ABS,		31)
1822_(R_ARM_ALU_PCREL_7_0,		32)
1823_(R_ARM_ALU_PCREL_15_8,		33)
1824_(R_ARM_ALU_PCREL_23_15,	34)
1825_(R_ARM_LDR_SBREL_11_0_NC,	35)
1826_(R_ARM_ALU_SBREL_19_12_NC,	36)
1827_(R_ARM_ALU_SBREL_27_20_CK,	37)
1828_(R_ARM_TARGET1,		38)
1829_(R_ARM_SBREL31,		39)
1830_(R_ARM_V4BX,			40)
1831_(R_ARM_TARGET2,		41)
1832_(R_ARM_PREL31,			42)
1833_(R_ARM_MOVW_ABS_NC,		43)
1834_(R_ARM_MOVT_ABS,		44)
1835_(R_ARM_MOVW_PREL_NC,		45)
1836_(R_ARM_MOVT_PREL,		46)
1837_(R_ARM_THM_MOVW_ABS_NC,	47)
1838_(R_ARM_THM_MOVT_ABS,		48)
1839_(R_ARM_THM_MOVW_PREL_NC,	49)
1840_(R_ARM_THM_MOVT_PREL,		50)
1841_(R_ARM_THM_JUMP19,		51)
1842_(R_ARM_THM_JUMP6,		52)
1843_(R_ARM_THM_ALU_PREL_11_0,	53)
1844_(R_ARM_THM_PC12,		54)
1845_(R_ARM_ABS32_NOI,		55)
1846_(R_ARM_REL32_NOI,		56)
1847_(R_ARM_ALU_PC_G0_NC,		57)
1848_(R_ARM_ALU_PC_G0,		58)
1849_(R_ARM_ALU_PC_G1_NC,		59)
1850_(R_ARM_ALU_PC_G1,		60)
1851_(R_ARM_ALU_PC_G2,		61)
1852_(R_ARM_LDR_PC_G1,		62)
1853_(R_ARM_LDR_PC_G2,		63)
1854_(R_ARM_LDRS_PC_G0,		64)
1855_(R_ARM_LDRS_PC_G1,		65)
1856_(R_ARM_LDRS_PC_G2,		66)
1857_(R_ARM_LDC_PC_G0,		67)
1858_(R_ARM_LDC_PC_G1,		68)
1859_(R_ARM_LDC_PC_G2,		69)
1860_(R_ARM_ALU_SB_G0_NC,		70)
1861_(R_ARM_ALU_SB_G0,		71)
1862_(R_ARM_ALU_SB_G1_NC,		72)
1863_(R_ARM_ALU_SB_G1,		73)
1864_(R_ARM_ALU_SB_G2,		74)
1865_(R_ARM_LDR_SB_G0,		75)
1866_(R_ARM_LDR_SB_G1,		76)
1867_(R_ARM_LDR_SB_G2,		77)
1868_(R_ARM_LDRS_SB_G0,		78)
1869_(R_ARM_LDRS_SB_G1,		79)
1870_(R_ARM_LDRS_SB_G2,		80)
1871_(R_ARM_LDC_SB_G0,		81)
1872_(R_ARM_LDC_SB_G1,		82)
1873_(R_ARM_LDC_SB_G2,		83)
1874_(R_ARM_MOVW_BREL_NC,		84)
1875_(R_ARM_MOVT_BREL,		85)
1876_(R_ARM_MOVW_BREL,		86)
1877_(R_ARM_THM_MOVW_BREL_NC,	87)
1878_(R_ARM_THM_MOVT_BREL,		88)
1879_(R_ARM_THM_MOVW_BREL,		89)
1880_(R_ARM_TLS_GOTDESC,		90)
1881_(R_ARM_TLS_CALL,		91)
1882_(R_ARM_TLS_DESCSEQ,		92)
1883_(R_ARM_THM_TLS_CALL,		93)
1884_(R_ARM_PLT32_ABS,		94)
1885_(R_ARM_GOT_ABS,		95)
1886_(R_ARM_GOT_PREL,		96)
1887_(R_ARM_GOT_BREL12,		97)
1888_(R_ARM_GOTOFF12,		98)
1889_(R_ARM_GOTRELAX,		99)
1890_(R_ARM_GNU_VTENTRY,		100)
1891_(R_ARM_GNU_VTINHERIT,		101)
1892_(R_ARM_THM_JUMP11,		102)
1893_(R_ARM_THM_JUMP8,		103)
1894_(R_ARM_TLS_GD32,		104)
1895_(R_ARM_TLS_LDM32,		105)
1896_(R_ARM_TLS_LDO32,		106)
1897_(R_ARM_TLS_IE32,		107)
1898_(R_ARM_TLS_LE32,		108)
1899_(R_ARM_TLS_LDO12,		109)
1900_(R_ARM_TLS_LE12,		110)
1901_(R_ARM_TLS_IE12GP,		111)
1902_(R_ARM_PRIVATE_0,		112)
1903_(R_ARM_PRIVATE_1,		113)
1904_(R_ARM_PRIVATE_2,		114)
1905_(R_ARM_PRIVATE_3,		115)
1906_(R_ARM_PRIVATE_4,		116)
1907_(R_ARM_PRIVATE_5,		117)
1908_(R_ARM_PRIVATE_6,		118)
1909_(R_ARM_PRIVATE_7,		119)
1910_(R_ARM_PRIVATE_8,		120)
1911_(R_ARM_PRIVATE_9,		121)
1912_(R_ARM_PRIVATE_10,		122)
1913_(R_ARM_PRIVATE_11,		123)
1914_(R_ARM_PRIVATE_12,		124)
1915_(R_ARM_PRIVATE_13,		125)
1916_(R_ARM_PRIVATE_14,		126)
1917_(R_ARM_PRIVATE_15,		127)
1918_(R_ARM_ME_TOO,			128)
1919_(R_ARM_THM_TLS_DESCSEQ16,	129)
1920_(R_ARM_THM_TLS_DESCSEQ32,	130)
1921_(R_ARM_THM_GOT_BREL12,		131)
1922_(R_ARM_IRELATIVE,		140)
1923')
1924
1925define(`DEFINE_IA64_RELOCATIONS',`
1926_(R_IA_64_NONE,			0)
1927_(R_IA_64_IMM14,		0x21)
1928_(R_IA_64_IMM22,		0x22)
1929_(R_IA_64_IMM64,		0x23)
1930_(R_IA_64_DIR32MSB,		0x24)
1931_(R_IA_64_DIR32LSB,		0x25)
1932_(R_IA_64_DIR64MSB,		0x26)
1933_(R_IA_64_DIR64LSB,		0x27)
1934_(R_IA_64_GPREL22,		0x2a)
1935_(R_IA_64_GPREL64I,		0x2b)
1936_(R_IA_64_GPREL32MSB,		0x2c)
1937_(R_IA_64_GPREL32LSB,		0x2d)
1938_(R_IA_64_GPREL64MSB,		0x2e)
1939_(R_IA_64_GPREL64LSB,		0x2f)
1940_(R_IA_64_LTOFF22,		0x32)
1941_(R_IA_64_LTOFF64I,		0x33)
1942_(R_IA_64_PLTOFF22,		0x3a)
1943_(R_IA_64_PLTOFF64I,		0x3b)
1944_(R_IA_64_PLTOFF64MSB,		0x3e)
1945_(R_IA_64_PLTOFF64LSB,		0x3f)
1946_(R_IA_64_FPTR64I,		0x43)
1947_(R_IA_64_FPTR32MSB,		0x44)
1948_(R_IA_64_FPTR32LSB,		0x45)
1949_(R_IA_64_FPTR64MSB,		0x46)
1950_(R_IA_64_FPTR64LSB,		0x47)
1951_(R_IA_64_PCREL60B,		0x48)
1952_(R_IA_64_PCREL21B,		0x49)
1953_(R_IA_64_PCREL21M,		0x4a)
1954_(R_IA_64_PCREL21F,		0x4b)
1955_(R_IA_64_PCREL32MSB,		0x4c)
1956_(R_IA_64_PCREL32LSB,		0x4d)
1957_(R_IA_64_PCREL64MSB,		0x4e)
1958_(R_IA_64_PCREL64LSB,		0x4f)
1959_(R_IA_64_LTOFF_FPTR22,		0x52)
1960_(R_IA_64_LTOFF_FPTR64I,	0x53)
1961_(R_IA_64_LTOFF_FPTR32MSB,	0x54)
1962_(R_IA_64_LTOFF_FPTR32LSB,	0x55)
1963_(R_IA_64_LTOFF_FPTR64MSB,	0x56)
1964_(R_IA_64_LTOFF_FPTR64LSB,	0x57)
1965_(R_IA_64_SEGREL32MSB,		0x5c)
1966_(R_IA_64_SEGREL32LSB,		0x5d)
1967_(R_IA_64_SEGREL64MSB,		0x5e)
1968_(R_IA_64_SEGREL64LSB,		0x5f)
1969_(R_IA_64_SECREL32MSB,		0x64)
1970_(R_IA_64_SECREL32LSB,		0x65)
1971_(R_IA_64_SECREL64MSB,		0x66)
1972_(R_IA_64_SECREL64LSB,		0x67)
1973_(R_IA_64_REL32MSB,		0x6c)
1974_(R_IA_64_REL32LSB,		0x6d)
1975_(R_IA_64_REL64MSB,		0x6e)
1976_(R_IA_64_REL64LSB,		0x6f)
1977_(R_IA_64_LTV32MSB,		0x74)
1978_(R_IA_64_LTV32LSB,		0x75)
1979_(R_IA_64_LTV64MSB,		0x76)
1980_(R_IA_64_LTV64LSB,		0x77)
1981_(R_IA_64_PCREL21BI,		0x79)
1982_(R_IA_64_PCREL22,		0x7A)
1983_(R_IA_64_PCREL64I,		0x7B)
1984_(R_IA_64_IPLTMSB,		0x80)
1985_(R_IA_64_IPLTLSB,		0x81)
1986_(R_IA_64_SUB,			0x85)
1987_(R_IA_64_LTOFF22X,		0x86)
1988_(R_IA_64_LDXMOV,		0x87)
1989_(R_IA_64_TPREL14,		0x91)
1990_(R_IA_64_TPREL22,		0x92)
1991_(R_IA_64_TPREL64I,		0x93)
1992_(R_IA_64_TPREL64MSB,		0x96)
1993_(R_IA_64_TPREL64LSB,		0x97)
1994_(R_IA_64_LTOFF_TPREL22,	0x9A)
1995_(R_IA_64_DTPMOD64MSB,		0xA6)
1996_(R_IA_64_DTPMOD64LSB,		0xA7)
1997_(R_IA_64_LTOFF_DTPMOD22,	0xAA)
1998_(R_IA_64_DTPREL14,		0xB1)
1999_(R_IA_64_DTPREL22,		0xB2)
2000_(R_IA_64_DTPREL64I,		0xB3)
2001_(R_IA_64_DTPREL32MSB,		0xB4)
2002_(R_IA_64_DTPREL32LSB,		0xB5)
2003_(R_IA_64_DTPREL64MSB,		0xB6)
2004_(R_IA_64_DTPREL64LSB,		0xB7)
2005_(R_IA_64_LTOFF_DTPREL22,	0xBA)
2006')
2007
2008define(`DEFINE_MIPS_RELOCATIONS',`
2009_(R_MIPS_NONE,			0)
2010_(R_MIPS_16,			1)
2011_(R_MIPS_32,			2)
2012_(R_MIPS_REL32,			3)
2013_(R_MIPS_26,			4)
2014_(R_MIPS_HI16,			5)
2015_(R_MIPS_LO16,			6)
2016_(R_MIPS_GPREL16,		7)
2017_(R_MIPS_LITERAL, 		8)
2018_(R_MIPS_GOT16,			9)
2019_(R_MIPS_PC16,			10)
2020_(R_MIPS_CALL16,		11)
2021_(R_MIPS_GPREL32,		12)
2022_(R_MIPS_SHIFT5,		16)
2023_(R_MIPS_SHIFT6,		17)
2024_(R_MIPS_64,			18)
2025_(R_MIPS_GOT_DISP,		19)
2026_(R_MIPS_GOT_PAGE,		20)
2027_(R_MIPS_GOT_OFST,		21)
2028_(R_MIPS_GOT_HI16,		22)
2029_(R_MIPS_GOT_LO16,		23)
2030_(R_MIPS_SUB,			24)
2031_(R_MIPS_CALLHI16,		30)
2032_(R_MIPS_CALLLO16,		31)
2033_(R_MIPS_JALR,			37)
2034_(R_MIPS_TLS_DTPMOD32,		38)
2035_(R_MIPS_TLS_DTPREL32,		39)
2036_(R_MIPS_TLS_DTPMOD64,		40)
2037_(R_MIPS_TLS_DTPREL64,		41)
2038_(R_MIPS_TLS_GD,		42)
2039_(R_MIPS_TLS_LDM,		43)
2040_(R_MIPS_TLS_DTPREL_HI16,	44)
2041_(R_MIPS_TLS_DTPREL_LO16,	45)
2042_(R_MIPS_TLS_GOTTPREL,		46)
2043_(R_MIPS_TLS_TPREL32,		47)
2044_(R_MIPS_TLS_TPREL64,		48)
2045_(R_MIPS_TLS_TPREL_HI16,	49)
2046_(R_MIPS_TLS_TPREL_LO16,	50)
2047')
2048
2049define(`DEFINE_PPC32_RELOCATIONS',`
2050_(R_PPC_NONE,		0)
2051_(R_PPC_ADDR32,		1)
2052_(R_PPC_ADDR24,		2)
2053_(R_PPC_ADDR16,		3)
2054_(R_PPC_ADDR16_LO,	4)
2055_(R_PPC_ADDR16_HI,	5)
2056_(R_PPC_ADDR16_HA,	6)
2057_(R_PPC_ADDR14,		7)
2058_(R_PPC_ADDR14_BRTAKEN,	8)
2059_(R_PPC_ADDR14_BRNTAKEN, 9)
2060_(R_PPC_REL24,		10)
2061_(R_PPC_REL14,		11)
2062_(R_PPC_REL14_BRTAKEN,	12)
2063_(R_PPC_REL14_BRNTAKEN,	13)
2064_(R_PPC_GOT16,		14)
2065_(R_PPC_GOT16_LO,	15)
2066_(R_PPC_GOT16_HI,	16)
2067_(R_PPC_GOT16_HA,	17)
2068_(R_PPC_PLTREL24,	18)
2069_(R_PPC_COPY,		19)
2070_(R_PPC_GLOB_DAT,	20)
2071_(R_PPC_JMP_SLOT,	21)
2072_(R_PPC_RELATIVE,	22)
2073_(R_PPC_LOCAL24PC,	23)
2074_(R_PPC_UADDR32,	24)
2075_(R_PPC_UADDR16,	25)
2076_(R_PPC_REL32,		26)
2077_(R_PPC_PLT32,		27)
2078_(R_PPC_PLTREL32,	28)
2079_(R_PPC_PLT16_LO,	29)
2080_(R_PPC_PLT16_HI,	30)
2081_(R_PPC_PLT16_HA,	31)
2082_(R_PPC_SDAREL16,	32)
2083_(R_PPC_SECTOFF,	33)
2084_(R_PPC_SECTOFF_LO,	34)
2085_(R_PPC_SECTOFF_HI,	35)
2086_(R_PPC_SECTOFF_HA,	36)
2087_(R_PPC_ADDR30,		37)
2088_(R_PPC_TLS,		67)
2089_(R_PPC_DTPMOD32,	68)
2090_(R_PPC_TPREL16,	69)
2091_(R_PPC_TPREL16_LO,	70)
2092_(R_PPC_TPREL16_HI,	71)
2093_(R_PPC_TPREL16_HA,	72)
2094_(R_PPC_TPREL32,	73)
2095_(R_PPC_DTPREL16,	74)
2096_(R_PPC_DTPREL16_LO,	75)
2097_(R_PPC_DTPREL16_HI,	76)
2098_(R_PPC_DTPREL16_HA,	77)
2099_(R_PPC_DTPREL32,	78)
2100_(R_PPC_GOT_TLSGD16,	79)
2101_(R_PPC_GOT_TLSGD16_LO,	80)
2102_(R_PPC_GOT_TLSGD16_HI,	81)
2103_(R_PPC_GOT_TLSGD16_HA,	82)
2104_(R_PPC_GOT_TLSLD16,	83)
2105_(R_PPC_GOT_TLSLD16_LO,	84)
2106_(R_PPC_GOT_TLSLD16_HI,	85)
2107_(R_PPC_GOT_TLSLD16_HA,	86)
2108_(R_PPC_GOT_TPREL16,	87)
2109_(R_PPC_GOT_TPREL16_LO,	88)
2110_(R_PPC_GOT_TPREL16_HI,	89)
2111_(R_PPC_GOT_TPREL16_HA,	90)
2112_(R_PPC_GOT_DTPREL16,	91)
2113_(R_PPC_GOT_DTPREL16_LO, 92)
2114_(R_PPC_GOT_DTPREL16_HI, 93)
2115_(R_PPC_GOT_DTPREL16_HA, 94)
2116_(R_PPC_TLSGD,		95)
2117_(R_PPC_TLSLD,		96)
2118_(R_PPC_EMB_NADDR32,	101)
2119_(R_PPC_EMB_NADDR16,	102)
2120_(R_PPC_EMB_NADDR16_LO,	103)
2121_(R_PPC_EMB_NADDR16_HI,	104)
2122_(R_PPC_EMB_NADDR16_HA,	105)
2123_(R_PPC_EMB_SDAI16,	106)
2124_(R_PPC_EMB_SDA2I16,	107)
2125_(R_PPC_EMB_SDA2REL,	108)
2126_(R_PPC_EMB_SDA21,	109)
2127_(R_PPC_EMB_MRKREF,	110)
2128_(R_PPC_EMB_RELSEC16,	111)
2129_(R_PPC_EMB_RELST_LO,	112)
2130_(R_PPC_EMB_RELST_HI,	113)
2131_(R_PPC_EMB_RELST_HA,	114)
2132_(R_PPC_EMB_BIT_FLD,	115)
2133_(R_PPC_EMB_RELSDA,	116)
2134')
2135
2136define(`DEFINE_PPC64_RELOCATIONS',`
2137_(R_PPC64_NONE,			0)
2138_(R_PPC64_ADDR32,		1)
2139_(R_PPC64_ADDR24,		2)
2140_(R_PPC64_ADDR16,		3)
2141_(R_PPC64_ADDR16_LO,		4)
2142_(R_PPC64_ADDR16_HI,		5)
2143_(R_PPC64_ADDR16_HA,		6)
2144_(R_PPC64_ADDR14,		7)
2145_(R_PPC64_ADDR14_BRTAKEN,	8)
2146_(R_PPC64_ADDR14_BRNTAKEN,	9)
2147_(R_PPC64_REL24,		10)
2148_(R_PPC64_REL14,		11)
2149_(R_PPC64_REL14_BRTAKEN,	12)
2150_(R_PPC64_REL14_BRNTAKEN,	13)
2151_(R_PPC64_GOT16,		14)
2152_(R_PPC64_GOT16_LO,		15)
2153_(R_PPC64_GOT16_HI,		16)
2154_(R_PPC64_GOT16_HA,		17)
2155_(R_PPC64_COPY,			19)
2156_(R_PPC64_GLOB_DAT,		20)
2157_(R_PPC64_JMP_SLOT,		21)
2158_(R_PPC64_RELATIVE,		22)
2159_(R_PPC64_UADDR32,		24)
2160_(R_PPC64_UADDR16,		25)
2161_(R_PPC64_REL32,		26)
2162_(R_PPC64_PLT32,		27)
2163_(R_PPC64_PLTREL32,		28)
2164_(R_PPC64_PLT16_LO,		29)
2165_(R_PPC64_PLT16_HI,		30)
2166_(R_PPC64_PLT16_HA,		31)
2167_(R_PPC64_SECTOFF,		33)
2168_(R_PPC64_SECTOFF_LO,		34)
2169_(R_PPC64_SECTOFF_HI,		35)
2170_(R_PPC64_SECTOFF_HA,		36)
2171_(R_PPC64_ADDR30,		37)
2172_(R_PPC64_ADDR64,		38)
2173_(R_PPC64_ADDR16_HIGHER,	39)
2174_(R_PPC64_ADDR16_HIGHERA,	40)
2175_(R_PPC64_ADDR16_HIGHEST,	41)
2176_(R_PPC64_ADDR16_HIGHESTA,	42)
2177_(R_PPC64_UADDR64,		43)
2178_(R_PPC64_REL64,		44)
2179_(R_PPC64_PLT64,		45)
2180_(R_PPC64_PLTREL64,		46)
2181_(R_PPC64_TOC16,		47)
2182_(R_PPC64_TOC16_LO,		48)
2183_(R_PPC64_TOC16_HI,		49)
2184_(R_PPC64_TOC16_HA,		50)
2185_(R_PPC64_TOC,			51)
2186_(R_PPC64_PLTGOT16,		52)
2187_(R_PPC64_PLTGOT16_LO,		53)
2188_(R_PPC64_PLTGOT16_HI,		54)
2189_(R_PPC64_PLTGOT16_HA,		55)
2190_(R_PPC64_ADDR16_DS,		56)
2191_(R_PPC64_ADDR16_LO_DS,		57)
2192_(R_PPC64_GOT16_DS,		58)
2193_(R_PPC64_GOT16_LO_DS,		59)
2194_(R_PPC64_PLT16_LO_DS,		60)
2195_(R_PPC64_SECTOFF_DS,		61)
2196_(R_PPC64_SECTOFF_LO_DS,	62)
2197_(R_PPC64_TOC16_DS,		63)
2198_(R_PPC64_TOC16_LO_DS,		64)
2199_(R_PPC64_PLTGOT16_DS,		65)
2200_(R_PPC64_PLTGOT16_LO_DS,	66)
2201_(R_PPC64_TLS,			67)
2202_(R_PPC64_DTPMOD64,		68)
2203_(R_PPC64_TPREL16,		69)
2204_(R_PPC64_TPREL16_LO,		60)
2205_(R_PPC64_TPREL16_HI,		71)
2206_(R_PPC64_TPREL16_HA,		72)
2207_(R_PPC64_TPREL64,		73)
2208_(R_PPC64_DTPREL16,		74)
2209_(R_PPC64_DTPREL16_LO,		75)
2210_(R_PPC64_DTPREL16_HI,		76)
2211_(R_PPC64_DTPREL16_HA,		77)
2212_(R_PPC64_DTPREL64,		78)
2213_(R_PPC64_GOT_TLSGD16,		79)
2214_(R_PPC64_GOT_TLSGD16_LO,	80)
2215_(R_PPC64_GOT_TLSGD16_HI,	81)
2216_(R_PPC64_GOT_TLSGD16_HA,	82)
2217_(R_PPC64_GOT_TLSLD16,		83)
2218_(R_PPC64_GOT_TLSLD16_LO,	84)
2219_(R_PPC64_GOT_TLSLD16_HI,	85)
2220_(R_PPC64_GOT_TLSLD16_HA,	86)
2221_(R_PPC64_GOT_TPREL16_DS,	87)
2222_(R_PPC64_GOT_TPREL16_LO_DS,	88)
2223_(R_PPC64_GOT_TPREL16_HI,	89)
2224_(R_PPC64_GOT_TPREL16_HA,	90)
2225_(R_PPC64_GOT_DTPREL16_DS,	91)
2226_(R_PPC64_GOT_DTPREL16_LO_DS,	92)
2227_(R_PPC64_GOT_DTPREL16_HI,	93)
2228_(R_PPC64_GOT_DTPREL16_HA,	94)
2229_(R_PPC64_TPREL16_DS,		95)
2230_(R_PPC64_TPREL16_LO_DS,	96)
2231_(R_PPC64_TPREL16_HIGHER,	97)
2232_(R_PPC64_TPREL16_HIGHERA,	98)
2233_(R_PPC64_TPREL16_HIGHEST,	99)
2234_(R_PPC64_TPREL16_HIGHESTA,	100)
2235_(R_PPC64_DTPREL16_DS,		101)
2236_(R_PPC64_DTPREL16_LO_DS,	102)
2237_(R_PPC64_DTPREL16_HIGHER,	103)
2238_(R_PPC64_DTPREL16_HIGHERA,	104)
2239_(R_PPC64_DTPREL16_HIGHEST,	105)
2240_(R_PPC64_DTPREL16_HIGHESTA,	106)
2241_(R_PPC64_TLSGD,		107)
2242_(R_PPC64_TLSLD,		108)
2243')
2244
2245define(`DEFINE_RISCV_RELOCATIONS',`
2246_(R_RISCV_NONE,			0)
2247_(R_RISCV_32,			1)
2248_(R_RISCV_64,			2)
2249_(R_RISCV_RELATIVE,		3)
2250_(R_RISCV_COPY,			4)
2251_(R_RISCV_JUMP_SLOT,		5)
2252_(R_RISCV_TLS_DTPMOD32,		6)
2253_(R_RISCV_TLS_DTPMOD64,		7)
2254_(R_RISCV_TLS_DTPREL32,		8)
2255_(R_RISCV_TLS_DTPREL64,		9)
2256_(R_RISCV_TLS_TPREL32,		10)
2257_(R_RISCV_TLS_TPREL64,		11)
2258_(R_RISCV_BRANCH,		16)
2259_(R_RISCV_JAL,			17)
2260_(R_RISCV_CALL,			18)
2261_(R_RISCV_CALL_PLT,		19)
2262_(R_RISCV_GOT_HI20,		20)
2263_(R_RISCV_TLS_GOT_HI20,		21)
2264_(R_RISCV_TLS_GD_HI20,		22)
2265_(R_RISCV_PCREL_HI20,		23)
2266_(R_RISCV_PCREL_LO12_I,		24)
2267_(R_RISCV_PCREL_LO12_S,		25)
2268_(R_RISCV_HI20,			26)
2269_(R_RISCV_LO12_I,		27)
2270_(R_RISCV_LO12_S,		28)
2271_(R_RISCV_TPREL_HI20,		29)
2272_(R_RISCV_TPREL_LO12_I,		30)
2273_(R_RISCV_TPREL_LO12_S,		31)
2274_(R_RISCV_TPREL_ADD,		32)
2275_(R_RISCV_ADD8,			33)
2276_(R_RISCV_ADD16,		34)
2277_(R_RISCV_ADD32,		35)
2278_(R_RISCV_ADD64,		36)
2279_(R_RISCV_SUB8,			37)
2280_(R_RISCV_SUB16,		38)
2281_(R_RISCV_SUB32,		39)
2282_(R_RISCV_SUB64,		40)
2283_(R_RISCV_GNU_VTINHERIT,	41)
2284_(R_RISCV_GNU_VTENTRY,		42)
2285_(R_RISCV_ALIGN,		43)
2286_(R_RISCV_RVC_BRANCH,		44)
2287_(R_RISCV_RVC_JUMP,		45)
2288_(R_RISCV_RVC_LUI,		46)
2289_(R_RISCV_GPREL_I,		47)
2290_(R_RISCV_GPREL_S,		48)
2291_(R_RISCV_TPREL_I,		49)
2292_(R_RISCV_TPREL_S,		50)
2293_(R_RISCV_RELAX,		51)
2294_(R_RISCV_SUB6,			52)
2295_(R_RISCV_SET6,			53)
2296_(R_RISCV_SET8,			54)
2297_(R_RISCV_SET16,		55)
2298_(R_RISCV_SET32,		56)
2299_(R_RISCV_32_PCREL,		57)
2300_(R_RISCV_IRELATIVE,		58)
2301')
2302
2303define(`DEFINE_SPARC_RELOCATIONS',`
2304_(R_SPARC_NONE,		0)
2305_(R_SPARC_8,		1)
2306_(R_SPARC_16,		2)
2307_(R_SPARC_32, 		3)
2308_(R_SPARC_DISP8,	4)
2309_(R_SPARC_DISP16,	5)
2310_(R_SPARC_DISP32,	6)
2311_(R_SPARC_WDISP30,	7)
2312_(R_SPARC_WDISP22,	8)
2313_(R_SPARC_HI22,		9)
2314_(R_SPARC_22,		10)
2315_(R_SPARC_13,		11)
2316_(R_SPARC_LO10,		12)
2317_(R_SPARC_GOT10,	13)
2318_(R_SPARC_GOT13,	14)
2319_(R_SPARC_GOT22,	15)
2320_(R_SPARC_PC10,		16)
2321_(R_SPARC_PC22,		17)
2322_(R_SPARC_WPLT30,	18)
2323_(R_SPARC_COPY,		19)
2324_(R_SPARC_GLOB_DAT,	20)
2325_(R_SPARC_JMP_SLOT,	21)
2326_(R_SPARC_RELATIVE,	22)
2327_(R_SPARC_UA32,		23)
2328_(R_SPARC_PLT32,	24)
2329_(R_SPARC_HIPLT22,	25)
2330_(R_SPARC_LOPLT10,	26)
2331_(R_SPARC_PCPLT32,	27)
2332_(R_SPARC_PCPLT22,	28)
2333_(R_SPARC_PCPLT10,	29)
2334_(R_SPARC_10,		30)
2335_(R_SPARC_11,		31)
2336_(R_SPARC_64,		32)
2337_(R_SPARC_OLO10,	33)
2338_(R_SPARC_HH22,		34)
2339_(R_SPARC_HM10,		35)
2340_(R_SPARC_LM22,		36)
2341_(R_SPARC_PC_HH22,	37)
2342_(R_SPARC_PC_HM10,	38)
2343_(R_SPARC_PC_LM22,	39)
2344_(R_SPARC_WDISP16,	40)
2345_(R_SPARC_WDISP19,	41)
2346_(R_SPARC_GLOB_JMP,	42)
2347_(R_SPARC_7,		43)
2348_(R_SPARC_5,		44)
2349_(R_SPARC_6,		45)
2350_(R_SPARC_DISP64,	46)
2351_(R_SPARC_PLT64,	47)
2352_(R_SPARC_HIX22,	48)
2353_(R_SPARC_LOX10,	49)
2354_(R_SPARC_H44,		50)
2355_(R_SPARC_M44,		51)
2356_(R_SPARC_L44,		52)
2357_(R_SPARC_REGISTER,	53)
2358_(R_SPARC_UA64,		54)
2359_(R_SPARC_UA16,		55)
2360_(R_SPARC_TLS_GD_HI22,	56)
2361_(R_SPARC_TLS_GD_LO10,	57)
2362_(R_SPARC_TLS_GD_ADD,	58)
2363_(R_SPARC_TLS_GD_CALL,	59)
2364_(R_SPARC_TLS_LDM_HI22,	60)
2365_(R_SPARC_TLS_LDM_LO10,	61)
2366_(R_SPARC_TLS_LDM_ADD,	62)
2367_(R_SPARC_TLS_LDM_CALL,	63)
2368_(R_SPARC_TLS_LDO_HIX22, 64)
2369_(R_SPARC_TLS_LDO_LOX10, 65)
2370_(R_SPARC_TLS_LDO_ADD,	66)
2371_(R_SPARC_TLS_IE_HI22,	67)
2372_(R_SPARC_TLS_IE_LO10,	68)
2373_(R_SPARC_TLS_IE_LD,	69)
2374_(R_SPARC_TLS_IE_LDX,	70)
2375_(R_SPARC_TLS_IE_ADD,	71)
2376_(R_SPARC_TLS_LE_HIX22,	72)
2377_(R_SPARC_TLS_LE_LOX10,	73)
2378_(R_SPARC_TLS_DTPMOD32,	74)
2379_(R_SPARC_TLS_DTPMOD64,	75)
2380_(R_SPARC_TLS_DTPOFF32,	76)
2381_(R_SPARC_TLS_DTPOFF64,	77)
2382_(R_SPARC_TLS_TPOFF32,	78)
2383_(R_SPARC_TLS_TPOFF64,	79)
2384_(R_SPARC_GOTDATA_HIX22, 80)
2385_(R_SPARC_GOTDATA_LOX10, 81)
2386_(R_SPARC_GOTDATA_OP_HIX22, 82)
2387_(R_SPARC_GOTDATA_OP_LOX10, 83)
2388_(R_SPARC_GOTDATA_OP,	84)
2389_(R_SPARC_H34,		85)
2390')
2391
2392define(`DEFINE_X86_64_RELOCATIONS',`
2393_(R_X86_64_NONE,	0)
2394_(R_X86_64_64,		1)
2395_(R_X86_64_PC32,	2)
2396_(R_X86_64_GOT32,	3)
2397_(R_X86_64_PLT32,	4)
2398_(R_X86_64_COPY,	5)
2399_(R_X86_64_GLOB_DAT,	6)
2400_(R_X86_64_JUMP_SLOT,	7)
2401_(R_X86_64_RELATIVE,	8)
2402_(R_X86_64_GOTPCREL,	9)
2403_(R_X86_64_32,		10)
2404_(R_X86_64_32S,		11)
2405_(R_X86_64_16,		12)
2406_(R_X86_64_PC16,	13)
2407_(R_X86_64_8,		14)
2408_(R_X86_64_PC8,		15)
2409_(R_X86_64_DTPMOD64,	16)
2410_(R_X86_64_DTPOFF64,	17)
2411_(R_X86_64_TPOFF64,	18)
2412_(R_X86_64_TLSGD,	19)
2413_(R_X86_64_TLSLD,	20)
2414_(R_X86_64_DTPOFF32,	21)
2415_(R_X86_64_GOTTPOFF,	22)
2416_(R_X86_64_TPOFF32,	23)
2417_(R_X86_64_PC64,	24)
2418_(R_X86_64_GOTOFF64,	25)
2419_(R_X86_64_GOTPC32,	26)
2420_(R_X86_64_GOT64,	27)
2421_(R_X86_64_GOTPCREL64,	28)
2422_(R_X86_64_GOTPC64,	29)
2423_(R_X86_64_GOTPLT64,	30)
2424_(R_X86_64_PLTOFF64,	31)
2425_(R_X86_64_SIZE32,	32)
2426_(R_X86_64_SIZE64,	33)
2427_(R_X86_64_GOTPC32_TLSDESC, 34)
2428_(R_X86_64_TLSDESC_CALL, 35)
2429_(R_X86_64_TLSDESC,	36)
2430_(R_X86_64_IRELATIVE,	37)
2431_(R_X86_64_RELATIVE64,	38)
2432_(R_X86_64_GOTPCRELX,	41)
2433_(R_X86_64_REX_GOTPCRELX, 42)
2434')
2435
2436define(`DEFINE_RELOCATIONS',`
2437DEFINE_386_RELOCATIONS()
2438DEFINE_AARCH64_RELOCATIONS()
2439DEFINE_AMD64_RELOCATIONS()
2440DEFINE_ARM_RELOCATIONS()
2441DEFINE_IA64_RELOCATIONS()
2442DEFINE_MIPS_RELOCATIONS()
2443DEFINE_PPC32_RELOCATIONS()
2444DEFINE_PPC64_RELOCATIONS()
2445DEFINE_RISCV_RELOCATIONS()
2446DEFINE_SPARC_RELOCATIONS()
2447DEFINE_X86_64_RELOCATIONS()
2448')
2449
2450define(`DEFINE_LL_FLAGS',`
2451_(LL_NONE,			0,
2452	`no flags')
2453_(LL_EXACT_MATCH,		0x1,
2454	`require an exact match')
2455_(LL_IGNORE_INT_VER,	0x2,
2456	`ignore version incompatibilities')
2457_(LL_REQUIRE_MINOR,	0x4,
2458	`')
2459_(LL_EXPORTS,		0x8,
2460	`')
2461_(LL_DELAY_LOAD,		0x10,
2462	`')
2463_(LL_DELTA,		0x20,
2464	`')
2465')
2466
2467#
2468# Note tags
2469#
2470define(`DEFINE_NOTE_ENTRY_TYPES',`
2471_(NT_ABI_TAG,			1,
2472	`Tag indicating the ABI')
2473_(NT_GNU_HWCAP,			2,
2474	`Hardware capabilities')
2475_(NT_GNU_BUILD_ID,		3,
2476	`Build id, set by ld(1)')
2477_(NT_GNU_GOLD_VERSION,		4,
2478	`Version number of the GNU gold linker')
2479_(NT_PRSTATUS,			1,
2480	`Process status')
2481_(NT_FPREGSET,			2,
2482	`Floating point information')
2483_(NT_PRPSINFO,			3,
2484	`Process information')
2485_(NT_AUXV,			6,
2486	`Auxiliary vector')
2487_(NT_PRXFPREG,		0x46E62B7FUL,
2488	`Linux user_xfpregs structure')
2489_(NT_PSTATUS,			10,
2490	`Linux process status')
2491_(NT_FPREGS,			12,
2492	`Linux floating point regset')
2493_(NT_PSINFO,			13,
2494	`Linux process information')
2495_(NT_LWPSTATUS,			16,
2496	`Linux lwpstatus_t type')
2497_(NT_LWPSINFO,			17,
2498	`Linux lwpinfo_t type')
2499_(NT_FREEBSD_NOINIT_TAG,	2,
2500	`FreeBSD no .init tag')
2501_(NT_FREEBSD_ARCH_TAG,		3,
2502	`FreeBSD arch tag')
2503_(NT_FREEBSD_FEATURE_CTL,	4,
2504	`FreeBSD feature control')
2505')
2506
2507# Aliases for the ABI tag.
2508define(`DEFINE_NOTE_ENTRY_ALIASES',`
2509_(NT_FREEBSD_ABI_TAG,	NT_ABI_TAG)
2510_(NT_GNU_ABI_TAG,		NT_ABI_TAG)
2511_(NT_NETBSD_IDENT,	NT_ABI_TAG)
2512_(NT_OPENBSD_IDENT,	NT_ABI_TAG)
2513')
2514
2515#
2516# Option kinds.
2517#
2518define(`DEFINE_OPTION_KINDS',`
2519_(ODK_NULL,       0,
2520	`undefined')
2521_(ODK_REGINFO,    1,
2522	`register usage info')
2523_(ODK_EXCEPTIONS, 2,
2524	`exception processing info')
2525_(ODK_PAD,        3,
2526	`section padding')
2527_(ODK_HWPATCH,    4,
2528	`hardware patch applied')
2529_(ODK_FILL,       5,
2530	`fill value used by linker')
2531_(ODK_TAGS,       6,
2532	`reserved space for tools')
2533_(ODK_HWAND,      7,
2534	`hardware AND patch applied')
2535_(ODK_HWOR,       8,
2536	`hardware OR patch applied')
2537_(ODK_GP_GROUP,   9,
2538	`GP group to use for text/data sections')
2539_(ODK_IDENT,      10,
2540	`ID information')
2541_(ODK_PAGESIZE,   11,
2542	`page size information')
2543')
2544
2545#
2546# ODK_EXCEPTIONS info field masks.
2547#
2548define(`DEFINE_OPTION_EXCEPTIONS',`
2549_(OEX_FPU_MIN,    0x0000001FUL,
2550	`minimum FPU exception which must be enabled')
2551_(OEX_FPU_MAX,    0x00001F00UL,
2552	`maximum FPU exception which can be enabled')
2553_(OEX_PAGE0,      0x00010000UL,
2554	`page zero must be mapped')
2555_(OEX_SMM,        0x00020000UL,
2556	`run in sequential memory mode')
2557_(OEX_PRECISEFP,  0x00040000UL,
2558	`run in precise FP exception mode')
2559_(OEX_DISMISS,    0x00080000UL,
2560	`dismiss invalid address traps')
2561')
2562
2563#
2564# ODK_PAD info field masks.
2565#
2566define(`DEFINE_OPTION_PADS',`
2567_(OPAD_PREFIX,   0x0001)
2568_(OPAD_POSTFIX,  0x0002)
2569_(OPAD_SYMBOL,   0x0004)
2570')
2571
2572#
2573# ODK_HWPATCH info field masks and ODK_HWAND/ODK_HWOR
2574# info field and hwp_flags[12] masks.
2575#
2576define(`DEFINE_ODK_HWPATCH_MASKS',`
2577_(OHW_R4KEOP,     0x00000001UL,
2578	`patch for R4000 branch at end-of-page bug')
2579_(OHW_R8KPFETCH,  0x00000002UL,
2580	`R8000 prefetch bug may occur')
2581_(OHW_R5KEOP,     0x00000004UL,
2582	`patch for R5000 branch at end-of-page bug')
2583_(OHW_R5KCVTL,    0x00000008UL,
2584	`R5000 cvt.[ds].l bug: clean == 1')
2585_(OHW_R10KLDL,    0x00000010UL,
2586	`need patch for R10000 misaligned load')
2587_(OHWA0_R4KEOP_CHECKED, 0x00000001UL,
2588	`object checked for R4000 end-of-page bug')
2589_(OHWA0_R4KEOP_CLEAN, 0x00000002UL,
2590	`object verified clean for R4000 end-of-page bug')
2591_(OHWO0_FIXADE,   0x00000001UL,
2592	`object requires call to fixade')
2593')
2594
2595#
2596# ODK_IDENT/ODK_GP_GROUP info field masks.
2597#
2598define(`DEFINE_ODK_GP_MASKS',`
2599_(OGP_GROUP,      0x0000FFFFUL,
2600	`GP group number')
2601_(OGP_SELF,       0x00010000UL,
2602	`GP group is self-contained')
2603')
2604
2605# MIPS ABI related constants.
2606define(`DEFINE_MIPS_ABIS',`
2607_(E_MIPS_ABI_O32,		0x00001000,
2608	`MIPS 32 bit ABI (UCODE)')
2609_(E_MIPS_ABI_O64,		0x00002000,
2610	`UCODE MIPS 64 bit ABI')
2611_(E_MIPS_ABI_EABI32,	0x00003000,
2612	`Embedded ABI for 32-bit')
2613_(E_MIPS_ABI_EABI64,	0x00004000,
2614	`Embedded ABI for 64-bit')
2615')
2616