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