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