elfdefinitions.m4 revision 1.2
1/*-
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 */
26divert(-1)
27define(`VCSID_ELFDEFINITIONS_M4',
28	`Id: elfdefinitions.m4 3947 2021-04-10 21:15:17Z jkoshy')
29include(`elfconstants.m4')dnl
30
31define(`_',`ifelse(eval(len($1) <= 7),1,
32    `#define	$1		$2',
33    `#define	$1	$2')')
34divert(0)dnl
35
36/*
37 * WARNING: GENERATED FILE.  DO NOT MODIFY.
38 *
39 *  GENERATED FROM: VCSID_ELFDEFINITIONS_M4
40 *  GENERATED FROM: VCSID_ELFCONSTANTS_M4
41 */
42
43/*
44 * These definitions are based on:
45 * - The public specification of the ELF format as defined in the
46 *   October 2009 draft of System V ABI.
47 *   See: http://www.sco.com/developers/gabi/latest/ch4.intro.html
48 * - The May 1998 (version 1.5) draft of "The ELF-64 object format".
49 * - Processor-specific ELF ABI definitions for sparc, i386, amd64, mips,
50 *   ia64, powerpc, and RISC-V processors.
51 * - The "Linkers and Libraries Guide", from Sun Microsystems.
52 */
53
54#ifndef _SYS_ELFDEFINITIONS_H_
55#define _SYS_ELFDEFINITIONS_H_
56
57#include <stdint.h>
58
59/*
60 * Types of capabilities.
61 */
62DEFINE_CAPABILITIES()
63
64/*
65 * Flags used with dynamic linking entries.
66 */
67DEFINE_DYN_FLAGS()
68
69/*
70 * Dynamic linking entry types.
71 */
72DEFINE_DYN_TYPES()
73
74/* Aliases for dynamic linking entry symbols. */
75DEFINE_DYN_TYPE_ALIASES()
76
77/*
78 * Flags used in the executable header (field: e_flags).
79 */
80DEFINE_EHDR_FLAGS()
81
82/*
83 * Offsets in the `ei_ident[]' field of an ELF executable header.
84 */
85DEFINE_EI_OFFSETS()
86
87/*
88 * The ELF class of an object.
89 */
90DEFINE_ELF_CLASSES()
91
92/*
93 * Endianness of data in an ELF object.
94 */
95DEFINE_ELF_DATA_ENDIANNESSES()
96
97/*
98 * The magic numbers used in the initial four bytes of an ELF object.
99 *
100 * These numbers are: 0x7F, 'E', 'L' and 'F'.
101 */
102DEFINE_ELF_MAGIC_VALUES()
103
104/*
105 * ELF OS ABI field.
106 */
107DEFINE_ELF_OSABIS()
108
109/* OS ABI Aliases. */
110DEFINE_ELF_OSABI_ALIASES()
111
112/*
113 * ELF Machine types: (EM_*).
114 */
115DEFINE_ELF_MACHINE_TYPES()
116/* Other synonyms. */
117DEFINE_ELF_MACHINE_TYPE_SYNONYMS()
118
119/*
120 * ELF file types: (ET_*).
121 */
122DEFINE_ELF_TYPES()
123
124/* ELF file format version numbers. */
125DEFINE_ELF_FILE_VERSIONS()
126
127/*
128 * Flags for section groups.
129 */
130DEFINE_GRP_FLAGS()
131
132/*
133 * Flags / mask for .gnu.versym sections.
134 */
135DEFINE_VERSYMS()
136
137/*
138 * Flags used by program header table entries.
139 */
140DEFINE_PHDR_FLAGS()
141
142/*
143 * Types of program header table entries.
144 */
145DEFINE_PHDR_TYPES()
146/* synonyms. */
147DEFINE_PHDR_TYPE_SYNONYMS()
148
149/*
150 * Section flags.
151 */
152DEFINE_SECTION_FLAGS()
153
154/*
155 * Special section indices.
156 */
157DEFINE_SECTION_INDICES()
158
159/*
160 * Section types.
161 */
162DEFINE_SECTION_TYPES()
163/* Aliases for section types. */
164DEFINE_SECTION_TYPE_ALIASES()
165
166#define	PN_XNUM			0xFFFFU /* Use extended section numbering. */
167
168/*
169 * Symbol binding information.
170 */
171DEFINE_SYMBOL_BINDINGS()
172
173/*
174 * Symbol types
175 */
176DEFINE_SYMBOL_TYPES()
177
178/*
179 * Symbol binding.
180 */
181DEFINE_SYMBOL_BINDING_KINDS()
182
183/*
184 * Symbol visibility.
185 */
186DEFINE_SYMBOL_VISIBILITIES()
187
188/*
189 * Symbol flags.
190 */
191DEFINE_SYMBOL_FLAGS()
192
193/*
194 * Versioning dependencies.
195 */
196DEFINE_VERSIONING_DEPENDENCIES()
197
198/*
199 * Versioning flags.
200 */
201DEFINE_VERSIONING_FLAGS()
202
203/*
204 * Versioning needs
205 */
206DEFINE_VERSIONING_NEEDS()
207
208/*
209 * Versioning numbers.
210 */
211DEFINE_VERSIONING_NUMBERS()
212
213/**
214 ** Relocation types.
215 **/
216DEFINE_RELOCATIONS()
217
218/*
219 * MIPS ABI related.
220 */
221DEFINE_MIPS_ABIS()
222
223/**
224 ** ELF Types.
225 **/
226
227typedef uint32_t	Elf32_Addr;	/* Program address. */
228typedef uint8_t		Elf32_Byte;	/* Unsigned tiny integer. */
229typedef uint16_t	Elf32_Half;	/* Unsigned medium integer. */
230typedef uint32_t	Elf32_Off;	/* File offset. */
231typedef uint16_t	Elf32_Section;	/* Section index. */
232typedef int32_t		Elf32_Sword;	/* Signed integer. */
233typedef uint32_t	Elf32_Word;	/* Unsigned integer. */
234typedef uint64_t	Elf32_Lword;	/* Unsigned long integer. */
235
236typedef uint64_t	Elf64_Addr;	/* Program address. */
237typedef uint8_t		Elf64_Byte;	/* Unsigned tiny integer. */
238typedef uint16_t	Elf64_Half;	/* Unsigned medium integer. */
239typedef uint64_t	Elf64_Off;	/* File offset. */
240typedef uint16_t	Elf64_Section;	/* Section index. */
241typedef int32_t		Elf64_Sword;	/* Signed integer. */
242typedef uint32_t	Elf64_Word;	/* Unsigned integer. */
243typedef uint64_t	Elf64_Lword;	/* Unsigned long integer. */
244typedef uint64_t	Elf64_Xword;	/* Unsigned long integer. */
245typedef int64_t		Elf64_Sxword;	/* Signed long integer. */
246
247
248/*
249 * Capability descriptors.
250 */
251
252/* 32-bit capability descriptor. */
253typedef struct {
254	Elf32_Word	c_tag;	     /* Type of entry. */
255	union {
256		Elf32_Word	c_val; /* Integer value. */
257		Elf32_Addr	c_ptr; /* Pointer value. */
258	} c_un;
259} Elf32_Cap;
260
261/* 64-bit capability descriptor. */
262typedef struct {
263	Elf64_Xword	c_tag;	     /* Type of entry. */
264	union {
265		Elf64_Xword	c_val; /* Integer value. */
266		Elf64_Addr	c_ptr; /* Pointer value. */
267	} c_un;
268} Elf64_Cap;
269
270/*
271 * MIPS .conflict section entries.
272 */
273
274/* 32-bit entry. */
275typedef struct {
276	Elf32_Addr	c_index;
277} Elf32_Conflict;
278
279/* 64-bit entry. */
280typedef struct {
281	Elf64_Addr	c_index;
282} Elf64_Conflict;
283
284/*
285 * Dynamic section entries.
286 */
287
288/* 32-bit entry. */
289typedef struct {
290	Elf32_Sword	d_tag;	     /* Type of entry. */
291	union {
292		Elf32_Word	d_val; /* Integer value. */
293		Elf32_Addr	d_ptr; /* Pointer value. */
294	} d_un;
295} Elf32_Dyn;
296
297/* 64-bit entry. */
298typedef struct {
299	Elf64_Sxword	d_tag;	     /* Type of entry. */
300	union {
301		Elf64_Xword	d_val; /* Integer value. */
302		Elf64_Addr	d_ptr; /* Pointer value; */
303	} d_un;
304} Elf64_Dyn;
305
306
307/*
308 * The executable header (EHDR).
309 */
310
311/* 32 bit EHDR. */
312typedef struct {
313	unsigned char   e_ident[EI_NIDENT]; /* ELF identification. */
314	Elf32_Half      e_type;	     /* Object file type (ET_*). */
315	Elf32_Half      e_machine;   /* Machine type (EM_*). */
316	Elf32_Word      e_version;   /* File format version (EV_*). */
317	Elf32_Addr      e_entry;     /* Start address. */
318	Elf32_Off       e_phoff;     /* File offset to the PHDR table. */
319	Elf32_Off       e_shoff;     /* File offset to the SHDRheader. */
320	Elf32_Word      e_flags;     /* Flags (EF_*). */
321	Elf32_Half      e_ehsize;    /* Elf header size in bytes. */
322	Elf32_Half      e_phentsize; /* PHDR table entry size in bytes. */
323	Elf32_Half      e_phnum;     /* Number of PHDR entries. */
324	Elf32_Half      e_shentsize; /* SHDR table entry size in bytes. */
325	Elf32_Half      e_shnum;     /* Number of SHDR entries. */
326	Elf32_Half      e_shstrndx;  /* Index of section name string table. */
327} Elf32_Ehdr;
328
329
330/* 64 bit EHDR. */
331typedef struct {
332	unsigned char   e_ident[EI_NIDENT]; /* ELF identification. */
333	Elf64_Half      e_type;	     /* Object file type (ET_*). */
334	Elf64_Half      e_machine;   /* Machine type (EM_*). */
335	Elf64_Word      e_version;   /* File format version (EV_*). */
336	Elf64_Addr      e_entry;     /* Start address. */
337	Elf64_Off       e_phoff;     /* File offset to the PHDR table. */
338	Elf64_Off       e_shoff;     /* File offset to the SHDRheader. */
339	Elf64_Word      e_flags;     /* Flags (EF_*). */
340	Elf64_Half      e_ehsize;    /* Elf header size in bytes. */
341	Elf64_Half      e_phentsize; /* PHDR table entry size in bytes. */
342	Elf64_Half      e_phnum;     /* Number of PHDR entries. */
343	Elf64_Half      e_shentsize; /* SHDR table entry size in bytes. */
344	Elf64_Half      e_shnum;     /* Number of SHDR entries. */
345	Elf64_Half      e_shstrndx;  /* Index of section name string table. */
346} Elf64_Ehdr;
347
348
349/*
350 * Shared object information.
351 */
352
353/* 32-bit entry. */
354typedef struct {
355	Elf32_Word l_name;	     /* The name of a shared object. */
356	Elf32_Word l_time_stamp;     /* 32-bit timestamp. */
357	Elf32_Word l_checksum;	     /* Checksum of visible symbols, sizes. */
358	Elf32_Word l_version;	     /* Interface version string index. */
359	Elf32_Word l_flags;	     /* Flags (LL_*). */
360} Elf32_Lib;
361
362/* 64-bit entry. */
363typedef struct {
364	Elf64_Word l_name;	     /* The name of a shared object. */
365	Elf64_Word l_time_stamp;     /* 32-bit timestamp. */
366	Elf64_Word l_checksum;	     /* Checksum of visible symbols, sizes. */
367	Elf64_Word l_version;	     /* Interface version string index. */
368	Elf64_Word l_flags;	     /* Flags (LL_*). */
369} Elf64_Lib;
370
371DEFINE_LL_FLAGS()
372
373/*
374 * Note tags
375 */
376DEFINE_NOTE_ENTRY_TYPES()
377/* Aliases for the ABI tag. */
378DEFINE_NOTE_ENTRY_ALIASES()
379
380/*
381 * Note descriptors.
382 */
383
384typedef	struct {
385	uint32_t	n_namesz;    /* Length of note's name. */
386	uint32_t	n_descsz;    /* Length of note's value. */
387	uint32_t	n_type;	     /* Type of note. */
388} Elf_Note;
389
390typedef Elf_Note Elf32_Nhdr;	     /* 32-bit note header. */
391typedef Elf_Note Elf64_Nhdr;	     /* 64-bit note header. */
392
393/*
394 * MIPS ELF options descriptor header.
395 */
396
397typedef struct {
398	Elf64_Byte	kind;        /* Type of options. */
399	Elf64_Byte     	size;	     /* Size of option descriptor. */
400	Elf64_Half	section;     /* Index of section affected. */
401	Elf64_Word	info;        /* Kind-specific information. */
402} Elf_Options;
403
404/*
405 * Option kinds.
406 */
407DEFINE_OPTION_KINDS()
408
409/*
410 * ODK_EXCEPTIONS info field masks.
411 */
412DEFINE_OPTION_EXCEPTIONS()
413
414/*
415 * ODK_PAD info field masks.
416 */
417DEFINE_OPTION_PADS()
418
419/*
420 * ODK_HWPATCH info field masks and ODK_HWAND/ODK_HWOR info field
421 * and hwp_flags[12] masks.
422 */
423DEFINE_ODK_HWPATCH_MASKS()
424
425/*
426 * ODK_IDENT/ODK_GP_GROUP info field masks.
427 */
428DEFINE_ODK_GP_MASKS()
429
430/*
431 * MIPS ELF register info descriptor.
432 */
433
434/* 32 bit RegInfo entry. */
435typedef struct {
436	Elf32_Word	ri_gprmask;  /* Mask of general register used. */
437	Elf32_Word	ri_cprmask[4]; /* Mask of coprocessor register used. */
438	Elf32_Addr	ri_gp_value; /* GP register value. */
439} Elf32_RegInfo;
440
441/* 64 bit RegInfo entry. */
442typedef struct {
443	Elf64_Word	ri_gprmask;  /* Mask of general register used. */
444	Elf64_Word	ri_pad;	     /* Padding. */
445	Elf64_Word	ri_cprmask[4]; /* Mask of coprocessor register used. */
446	Elf64_Addr	ri_gp_value; /* GP register value. */
447} Elf64_RegInfo;
448
449/*
450 * Program Header Table (PHDR) entries.
451 */
452
453/* 32 bit PHDR entry. */
454typedef struct {
455	Elf32_Word	p_type;	     /* Type of segment. */
456	Elf32_Off	p_offset;    /* File offset to segment. */
457	Elf32_Addr	p_vaddr;     /* Virtual address in memory. */
458	Elf32_Addr	p_paddr;     /* Physical address (if relevant). */
459	Elf32_Word	p_filesz;    /* Size of segment in file. */
460	Elf32_Word	p_memsz;     /* Size of segment in memory. */
461	Elf32_Word	p_flags;     /* Segment flags. */
462	Elf32_Word	p_align;     /* Alignment constraints. */
463} Elf32_Phdr;
464
465/* 64 bit PHDR entry. */
466typedef struct {
467	Elf64_Word	p_type;	     /* Type of segment. */
468	Elf64_Word	p_flags;     /* Segment flags. */
469	Elf64_Off	p_offset;    /* File offset to segment. */
470	Elf64_Addr	p_vaddr;     /* Virtual address in memory. */
471	Elf64_Addr	p_paddr;     /* Physical address (if relevant). */
472	Elf64_Xword	p_filesz;    /* Size of segment in file. */
473	Elf64_Xword	p_memsz;     /* Size of segment in memory. */
474	Elf64_Xword	p_align;     /* Alignment constraints. */
475} Elf64_Phdr;
476
477
478/*
479 * Move entries, for describing data in COMMON blocks in a compact
480 * manner.
481 */
482
483/* 32-bit move entry. */
484typedef struct {
485	Elf32_Lword	m_value;     /* Initialization value. */
486	Elf32_Word 	m_info;	     /* Encoded size and index. */
487	Elf32_Word	m_poffset;   /* Offset relative to symbol. */
488	Elf32_Half	m_repeat;    /* Repeat count. */
489	Elf32_Half	m_stride;    /* Number of units to skip. */
490} Elf32_Move;
491
492/* 64-bit move entry. */
493typedef struct {
494	Elf64_Lword	m_value;     /* Initialization value. */
495	Elf64_Xword 	m_info;	     /* Encoded size and index. */
496	Elf64_Xword	m_poffset;   /* Offset relative to symbol. */
497	Elf64_Half	m_repeat;    /* Repeat count. */
498	Elf64_Half	m_stride;    /* Number of units to skip. */
499} Elf64_Move;
500
501#define ELF32_M_SYM(I)		((I) >> 8)
502#define ELF32_M_SIZE(I)		((unsigned char) (I))
503#define ELF32_M_INFO(M, S)	(((M) << 8) + (unsigned char) (S))
504
505#define ELF64_M_SYM(I)		((I) >> 8)
506#define ELF64_M_SIZE(I)		((unsigned char) (I))
507#define ELF64_M_INFO(M, S)	(((M) << 8) + (unsigned char) (S))
508
509/*
510 * Section Header Table (SHDR) entries.
511 */
512
513/* 32 bit SHDR */
514typedef struct {
515	Elf32_Word	sh_name;     /* index of section name */
516	Elf32_Word	sh_type;     /* section type */
517	Elf32_Word	sh_flags;    /* section flags */
518	Elf32_Addr	sh_addr;     /* in-memory address of section */
519	Elf32_Off	sh_offset;   /* file offset of section */
520	Elf32_Word	sh_size;     /* section size in bytes */
521	Elf32_Word	sh_link;     /* section header table link */
522	Elf32_Word	sh_info;     /* extra information */
523	Elf32_Word	sh_addralign; /* alignment constraint */
524	Elf32_Word	sh_entsize;   /* size for fixed-size entries */
525} Elf32_Shdr;
526
527/* 64 bit SHDR */
528typedef struct {
529	Elf64_Word	sh_name;     /* index of section name */
530	Elf64_Word	sh_type;     /* section type */
531	Elf64_Xword	sh_flags;    /* section flags */
532	Elf64_Addr	sh_addr;     /* in-memory address of section */
533	Elf64_Off	sh_offset;   /* file offset of section */
534	Elf64_Xword	sh_size;     /* section size in bytes */
535	Elf64_Word	sh_link;     /* section header table link */
536	Elf64_Word	sh_info;     /* extra information */
537	Elf64_Xword	sh_addralign; /* alignment constraint */
538	Elf64_Xword	sh_entsize;  /* size for fixed-size entries */
539} Elf64_Shdr;
540
541
542/*
543 * Symbol table entries.
544 */
545
546typedef struct {
547	Elf32_Word	st_name;     /* index of symbol's name */
548	Elf32_Addr	st_value;    /* value for the symbol */
549	Elf32_Word	st_size;     /* size of associated data */
550	unsigned char	st_info;     /* type and binding attributes */
551	unsigned char	st_other;    /* visibility */
552	Elf32_Half	st_shndx;    /* index of related section */
553} Elf32_Sym;
554
555typedef struct {
556	Elf64_Word	st_name;     /* index of symbol's name */
557	unsigned char	st_info;     /* type and binding attributes */
558	unsigned char	st_other;    /* visibility */
559	Elf64_Half	st_shndx;    /* index of related section */
560	Elf64_Addr	st_value;    /* value for the symbol */
561	Elf64_Xword	st_size;     /* size of associated data */
562} Elf64_Sym;
563
564#define ELF32_ST_BIND(I)	((I) >> 4)
565#define ELF32_ST_TYPE(I)	((I) & 0xFU)
566#define ELF32_ST_INFO(B,T)	(((B) << 4) + ((T) & 0xF))
567
568#define ELF64_ST_BIND(I)	((I) >> 4)
569#define ELF64_ST_TYPE(I)	((I) & 0xFU)
570#define ELF64_ST_INFO(B,T)	(((B) << 4) + ((T) & 0xF))
571
572#define ELF32_ST_VISIBILITY(O)	((O) & 0x3)
573#define ELF64_ST_VISIBILITY(O)	((O) & 0x3)
574
575/*
576 * Syminfo descriptors, containing additional symbol information.
577 */
578
579/* 32-bit entry. */
580typedef struct {
581	Elf32_Half	si_boundto;  /* Entry index with additional flags. */
582	Elf32_Half	si_flags;    /* Flags. */
583} Elf32_Syminfo;
584
585/* 64-bit entry. */
586typedef struct {
587	Elf64_Half	si_boundto;  /* Entry index with additional flags. */
588	Elf64_Half	si_flags;    /* Flags. */
589} Elf64_Syminfo;
590
591/*
592 * Relocation descriptors.
593 */
594
595typedef struct {
596	Elf32_Addr	r_offset;    /* location to apply relocation to */
597	Elf32_Word	r_info;	     /* type+section for relocation */
598} Elf32_Rel;
599
600typedef struct {
601	Elf32_Addr	r_offset;    /* location to apply relocation to */
602	Elf32_Word	r_info;      /* type+section for relocation */
603	Elf32_Sword	r_addend;    /* constant addend */
604} Elf32_Rela;
605
606typedef struct {
607	Elf64_Addr	r_offset;    /* location to apply relocation to */
608	Elf64_Xword	r_info;      /* type+section for relocation */
609} Elf64_Rel;
610
611typedef struct {
612	Elf64_Addr	r_offset;    /* location to apply relocation to */
613	Elf64_Xword	r_info;      /* type+section for relocation */
614	Elf64_Sxword	r_addend;    /* constant addend */
615} Elf64_Rela;
616
617
618#define ELF32_R_SYM(I)		((I) >> 8)
619#define ELF32_R_TYPE(I)		((unsigned char) (I))
620#define ELF32_R_INFO(S,T)	(((S) << 8) + (unsigned char) (T))
621
622#define ELF64_R_SYM(I)		((I) >> 32)
623#define ELF64_R_TYPE(I)		((I) & 0xFFFFFFFFUL)
624#define ELF64_R_INFO(S,T)	\
625	(((Elf64_Xword) (S) << 32) + ((T) & 0xFFFFFFFFUL))
626
627/*
628 * Symbol versioning structures.
629 */
630
631/* 32-bit structures. */
632typedef struct
633{
634	Elf32_Word	vda_name;    /* Index to name. */
635	Elf32_Word	vda_next;    /* Offset to next entry. */
636} Elf32_Verdaux;
637
638typedef struct
639{
640	Elf32_Word	vna_hash;    /* Hash value of dependency name. */
641	Elf32_Half	vna_flags;   /* Flags. */
642	Elf32_Half	vna_other;   /* Unused. */
643	Elf32_Word	vna_name;    /* Offset to dependency name. */
644	Elf32_Word	vna_next;    /* Offset to next vernaux entry. */
645} Elf32_Vernaux;
646
647typedef struct
648{
649	Elf32_Half	vd_version;  /* Version information. */
650	Elf32_Half	vd_flags;    /* Flags. */
651	Elf32_Half	vd_ndx;	     /* Index into the versym section. */
652	Elf32_Half	vd_cnt;	     /* Number of aux entries. */
653	Elf32_Word	vd_hash;     /* Hash value of name. */
654	Elf32_Word	vd_aux;	     /* Offset to aux entries. */
655	Elf32_Word	vd_next;     /* Offset to next version definition. */
656} Elf32_Verdef;
657
658typedef struct
659{
660	Elf32_Half	vn_version;  /* Version number. */
661	Elf32_Half	vn_cnt;	     /* Number of aux entries. */
662	Elf32_Word	vn_file;     /* Offset of associated file name. */
663	Elf32_Word	vn_aux;	     /* Offset of vernaux array. */
664	Elf32_Word	vn_next;     /* Offset of next verneed entry. */
665} Elf32_Verneed;
666
667typedef Elf32_Half	Elf32_Versym;
668
669/* 64-bit structures. */
670
671typedef struct {
672	Elf64_Word	vda_name;    /* Index to name. */
673	Elf64_Word	vda_next;    /* Offset to next entry. */
674} Elf64_Verdaux;
675
676typedef struct {
677	Elf64_Word	vna_hash;    /* Hash value of dependency name. */
678	Elf64_Half	vna_flags;   /* Flags. */
679	Elf64_Half	vna_other;   /* Unused. */
680	Elf64_Word	vna_name;    /* Offset to dependency name. */
681	Elf64_Word	vna_next;    /* Offset to next vernaux entry. */
682} Elf64_Vernaux;
683
684typedef struct {
685	Elf64_Half	vd_version;  /* Version information. */
686	Elf64_Half	vd_flags;    /* Flags. */
687	Elf64_Half	vd_ndx;	     /* Index into the versym section. */
688	Elf64_Half	vd_cnt;	     /* Number of aux entries. */
689	Elf64_Word	vd_hash;     /* Hash value of name. */
690	Elf64_Word	vd_aux;	     /* Offset to aux entries. */
691	Elf64_Word	vd_next;     /* Offset to next version definition. */
692} Elf64_Verdef;
693
694typedef struct {
695	Elf64_Half	vn_version;  /* Version number. */
696	Elf64_Half	vn_cnt;	     /* Number of aux entries. */
697	Elf64_Word	vn_file;     /* Offset of associated file name. */
698	Elf64_Word	vn_aux;	     /* Offset of vernaux array. */
699	Elf64_Word	vn_next;     /* Offset of next verneed entry. */
700} Elf64_Verneed;
701
702typedef Elf64_Half	Elf64_Versym;
703
704
705/*
706 * The header for GNU-style hash sections.
707 */
708
709typedef struct {
710	uint32_t	gh_nbuckets;	/* Number of hash buckets. */
711	uint32_t	gh_symndx;	/* First visible symbol in .dynsym. */
712	uint32_t	gh_maskwords;	/* #maskwords used in bloom filter. */
713	uint32_t	gh_shift2;	/* Bloom filter shift count. */
714} Elf_GNU_Hash_Header;
715
716#endif	/* _SYS_ELFDEFINITIONS_H_ */
717