xref: /netbsd-src/external/gpl3/gdb/dist/include/elf/common.h (revision 889f3bb010ad20d396fb291b89f202288dac2c87)
198b9484cSchristos /* ELF support for BFD.
2*889f3bb0Schristos    Copyright (C) 1991-2024 Free Software Foundation, Inc.
398b9484cSchristos 
498b9484cSchristos    Written by Fred Fish @ Cygnus Support, from information published
598b9484cSchristos    in "UNIX System V Release 4, Programmers Guide: ANSI C and
698b9484cSchristos    Programming Support Tools".
798b9484cSchristos 
898b9484cSchristos    This file is part of BFD, the Binary File Descriptor library.
998b9484cSchristos 
1098b9484cSchristos    This program is free software; you can redistribute it and/or modify
1198b9484cSchristos    it under the terms of the GNU General Public License as published by
1298b9484cSchristos    the Free Software Foundation; either version 3 of the License, or
1398b9484cSchristos    (at your option) any later version.
1498b9484cSchristos 
1598b9484cSchristos    This program is distributed in the hope that it will be useful,
1698b9484cSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
1798b9484cSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1898b9484cSchristos    GNU General Public License for more details.
1998b9484cSchristos 
2098b9484cSchristos    You should have received a copy of the GNU General Public License
2198b9484cSchristos    along with this program; if not, write to the Free Software
2298b9484cSchristos    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
2398b9484cSchristos    MA 02110-1301, USA.  */
2498b9484cSchristos 
2598b9484cSchristos /* This file is part of ELF support for BFD, and contains the portions
2698b9484cSchristos    that are common to both the internal and external representations.
2798b9484cSchristos    For example, ELFMAG0 is the byte 0x7F in both the internal (in-memory)
2898b9484cSchristos    and external (in-file) representations.  */
2998b9484cSchristos 
3098b9484cSchristos #ifndef _ELF_COMMON_H
3198b9484cSchristos #define _ELF_COMMON_H
3298b9484cSchristos 
3398b9484cSchristos /* Fields in e_ident[].  */
3498b9484cSchristos 
3598b9484cSchristos #define EI_MAG0		0	/* File identification byte 0 index */
3698b9484cSchristos #define ELFMAG0		   0x7F	/* Magic number byte 0 */
3798b9484cSchristos 
3898b9484cSchristos #define EI_MAG1		1	/* File identification byte 1 index */
3998b9484cSchristos #define ELFMAG1		    'E'	/* Magic number byte 1 */
4098b9484cSchristos 
4198b9484cSchristos #define EI_MAG2		2	/* File identification byte 2 index */
4298b9484cSchristos #define ELFMAG2		    'L'	/* Magic number byte 2 */
4398b9484cSchristos 
4498b9484cSchristos #define EI_MAG3		3	/* File identification byte 3 index */
4598b9484cSchristos #define ELFMAG3		    'F'	/* Magic number byte 3 */
4698b9484cSchristos 
4798b9484cSchristos #define EI_CLASS	4	/* File class */
4898b9484cSchristos #define ELFCLASSNONE	      0	/* Invalid class */
4998b9484cSchristos #define ELFCLASS32	      1	/* 32-bit objects */
5098b9484cSchristos #define ELFCLASS64	      2	/* 64-bit objects */
5198b9484cSchristos 
5298b9484cSchristos #define EI_DATA		5	/* Data encoding */
5398b9484cSchristos #define ELFDATANONE	      0	/* Invalid data encoding */
5498b9484cSchristos #define ELFDATA2LSB	      1	/* 2's complement, little endian */
5598b9484cSchristos #define ELFDATA2MSB	      2	/* 2's complement, big endian */
5698b9484cSchristos 
5798b9484cSchristos #define EI_VERSION	6	/* File version */
5898b9484cSchristos 
5998b9484cSchristos #define EI_OSABI	7	/* Operating System/ABI indication */
6098b9484cSchristos #define ELFOSABI_NONE	      0	/* UNIX System V ABI */
6198b9484cSchristos #define ELFOSABI_HPUX	      1	/* HP-UX operating system */
6298b9484cSchristos #define ELFOSABI_NETBSD	      2	/* NetBSD */
63a2e2270fSchristos #define ELFOSABI_GNU	      3	/* GNU */
64a2e2270fSchristos #define ELFOSABI_LINUX	      3	/* Alias for ELFOSABI_GNU */
6598b9484cSchristos #define ELFOSABI_SOLARIS      6	/* Solaris */
6698b9484cSchristos #define ELFOSABI_AIX	      7	/* AIX */
6798b9484cSchristos #define ELFOSABI_IRIX	      8	/* IRIX */
6898b9484cSchristos #define ELFOSABI_FREEBSD      9	/* FreeBSD */
6998b9484cSchristos #define ELFOSABI_TRU64	     10	/* TRU64 UNIX */
7098b9484cSchristos #define ELFOSABI_MODESTO     11	/* Novell Modesto */
7198b9484cSchristos #define ELFOSABI_OPENBSD     12	/* OpenBSD */
7298b9484cSchristos #define ELFOSABI_OPENVMS     13	/* OpenVMS */
7398b9484cSchristos #define ELFOSABI_NSK	     14	/* Hewlett-Packard Non-Stop Kernel */
7498b9484cSchristos #define ELFOSABI_AROS	     15	/* AROS */
7598b9484cSchristos #define ELFOSABI_FENIXOS     16 /* FenixOS */
76212397c6Schristos #define ELFOSABI_CLOUDABI    17 /* Nuxi CloudABI */
773b99ba0fSchristos #define ELFOSABI_OPENVOS     18 /* Stratus Technologies OpenVOS */
783b99ba0fSchristos 
7998b9484cSchristos #define ELFOSABI_C6000_ELFABI 64 /* Bare-metal TMS320C6000 */
80924795e6Schristos #define ELFOSABI_AMDGPU_HSA  64 /* AMD HSA Runtime */
8198b9484cSchristos #define ELFOSABI_C6000_LINUX 65 /* Linux TMS320C6000 */
82924795e6Schristos #define ELFOSABI_AMDGPU_PAL  65 /* AMD PAL Runtime */
83314094e7Schristos #define ELFOSABI_ARM_FDPIC   65 /* ARM FDPIC */
84924795e6Schristos #define ELFOSABI_AMDGPU_MESA3D 66 /* AMD Mesa3D Runtime */
8598b9484cSchristos #define ELFOSABI_ARM	     97	/* ARM */
8698b9484cSchristos #define ELFOSABI_STANDALONE 255	/* Standalone (embedded) application */
8798b9484cSchristos 
8898b9484cSchristos #define EI_ABIVERSION	8	/* ABI version */
8998b9484cSchristos 
9098b9484cSchristos #define EI_PAD		9	/* Start of padding bytes */
9198b9484cSchristos 
9298b9484cSchristos 
9398b9484cSchristos /* Values for e_type, which identifies the object file type.  */
9498b9484cSchristos 
9598b9484cSchristos #define ET_NONE		0	/* No file type */
9698b9484cSchristos #define ET_REL		1	/* Relocatable file */
97db9b8011Schristos #define ET_EXEC		2	/* Position-dependent executable file */
98db9b8011Schristos #define ET_DYN		3	/* Position-independent executable or
99db9b8011Schristos 				   shared object file */
10098b9484cSchristos #define ET_CORE		4	/* Core file */
10198b9484cSchristos #define ET_LOOS		0xFE00	/* Operating system-specific */
10298b9484cSchristos #define ET_HIOS		0xFEFF	/* Operating system-specific */
10398b9484cSchristos #define ET_LOPROC	0xFF00	/* Processor-specific */
10498b9484cSchristos #define ET_HIPROC	0xFFFF	/* Processor-specific */
10598b9484cSchristos 
10698b9484cSchristos /* Values for e_machine, which identifies the architecture.  These numbers
10798b9484cSchristos    are officially assigned by registry@sco.com.  See below for a list of
10898b9484cSchristos    ad-hoc numbers used during initial development.  */
10998b9484cSchristos 
11098b9484cSchristos #define EM_NONE		  0	/* No machine */
11198b9484cSchristos #define EM_M32		  1	/* AT&T WE 32100 */
11298b9484cSchristos #define EM_SPARC	  2	/* SUN SPARC */
11398b9484cSchristos #define EM_386		  3	/* Intel 80386 */
11498b9484cSchristos #define EM_68K		  4	/* Motorola m68k family */
11598b9484cSchristos #define EM_88K		  5	/* Motorola m88k family */
116212397c6Schristos #define EM_IAMCU	  6	/* Intel MCU */
11798b9484cSchristos #define EM_860		  7	/* Intel 80860 */
11898b9484cSchristos #define EM_MIPS		  8	/* MIPS R3000 (officially, big-endian only) */
11998b9484cSchristos #define EM_S370		  9	/* IBM System/370 */
1203b99ba0fSchristos #define EM_MIPS_RS3_LE	 10	/* MIPS R3000 little-endian (Oct 4 1999 Draft).  Deprecated.  */
1213b99ba0fSchristos #define EM_OLD_SPARCV9	 11	/* Old version of Sparc v9, from before the ABI.  Deprecated.  */
12298b9484cSchristos #define EM_res011	 11	/* Reserved */
12398b9484cSchristos #define EM_res012	 12	/* Reserved */
12498b9484cSchristos #define EM_res013	 13	/* Reserved */
12598b9484cSchristos #define EM_res014	 14	/* Reserved */
12698b9484cSchristos #define EM_PARISC	 15	/* HPPA */
12798b9484cSchristos #define EM_res016	 16	/* Reserved */
1283b99ba0fSchristos #define EM_PPC_OLD	 17	/* Old version of PowerPC.  Deprecated.  */
12998b9484cSchristos #define EM_VPP550	 17	/* Fujitsu VPP500 */
13098b9484cSchristos #define EM_SPARC32PLUS	 18	/* Sun's "v8plus" */
13198b9484cSchristos #define EM_960		 19	/* Intel 80960 */
13298b9484cSchristos #define EM_PPC		 20	/* PowerPC */
13398b9484cSchristos #define EM_PPC64	 21	/* 64-bit PowerPC */
13498b9484cSchristos #define EM_S390		 22	/* IBM S/390 */
13598b9484cSchristos #define EM_SPU		 23	/* Sony/Toshiba/IBM SPU */
13698b9484cSchristos #define EM_res024	 24	/* Reserved */
13798b9484cSchristos #define EM_res025	 25	/* Reserved */
13898b9484cSchristos #define EM_res026	 26	/* Reserved */
13998b9484cSchristos #define EM_res027	 27	/* Reserved */
14098b9484cSchristos #define EM_res028	 28	/* Reserved */
14198b9484cSchristos #define EM_res029	 29	/* Reserved */
14298b9484cSchristos #define EM_res030	 30	/* Reserved */
14398b9484cSchristos #define EM_res031	 31	/* Reserved */
14498b9484cSchristos #define EM_res032	 32	/* Reserved */
14598b9484cSchristos #define EM_res033	 33	/* Reserved */
14698b9484cSchristos #define EM_res034	 34	/* Reserved */
14798b9484cSchristos #define EM_res035	 35	/* Reserved */
14898b9484cSchristos #define EM_V800		 36	/* NEC V800 series */
14998b9484cSchristos #define EM_FR20		 37	/* Fujitsu FR20 */
15098b9484cSchristos #define EM_RH32		 38	/* TRW RH32 */
15198b9484cSchristos #define EM_MCORE	 39	/* Motorola M*Core */ /* May also be taken by Fujitsu MMA */
15298b9484cSchristos #define EM_RCE		 39	/* Old name for MCore */
15398b9484cSchristos #define EM_ARM		 40	/* ARM */
15498b9484cSchristos #define EM_OLD_ALPHA	 41	/* Digital Alpha */
15598b9484cSchristos #define EM_SH		 42	/* Renesas (formerly Hitachi) / SuperH SH */
15698b9484cSchristos #define EM_SPARCV9	 43	/* SPARC v9 64-bit */
15798b9484cSchristos #define EM_TRICORE	 44	/* Siemens Tricore embedded processor */
15898b9484cSchristos #define EM_ARC		 45	/* ARC Cores */
15998b9484cSchristos #define EM_H8_300	 46	/* Renesas (formerly Hitachi) H8/300 */
16098b9484cSchristos #define EM_H8_300H	 47	/* Renesas (formerly Hitachi) H8/300H */
16198b9484cSchristos #define EM_H8S		 48	/* Renesas (formerly Hitachi) H8S */
16298b9484cSchristos #define EM_H8_500	 49	/* Renesas (formerly Hitachi) H8/500 */
16398b9484cSchristos #define EM_IA_64	 50	/* Intel IA-64 Processor */
16498b9484cSchristos #define EM_MIPS_X	 51	/* Stanford MIPS-X */
16598b9484cSchristos #define EM_COLDFIRE	 52	/* Motorola Coldfire */
16698b9484cSchristos #define EM_68HC12	 53	/* Motorola M68HC12 */
16798b9484cSchristos #define EM_MMA		 54	/* Fujitsu Multimedia Accelerator */
16898b9484cSchristos #define EM_PCP		 55	/* Siemens PCP */
16998b9484cSchristos #define EM_NCPU		 56	/* Sony nCPU embedded RISC processor */
170a2e2270fSchristos #define EM_NDR1		 57	/* Denso NDR1 microprocessor */
17198b9484cSchristos #define EM_STARCORE	 58	/* Motorola Star*Core processor */
17298b9484cSchristos #define EM_ME16		 59	/* Toyota ME16 processor */
17398b9484cSchristos #define EM_ST100	 60	/* STMicroelectronics ST100 processor */
17498b9484cSchristos #define EM_TINYJ	 61	/* Advanced Logic Corp. TinyJ embedded processor */
17598b9484cSchristos #define EM_X86_64	 62	/* Advanced Micro Devices X86-64 processor */
17698b9484cSchristos #define EM_PDSP		 63	/* Sony DSP Processor */
17798b9484cSchristos #define EM_PDP10	 64	/* Digital Equipment Corp. PDP-10 */
17898b9484cSchristos #define EM_PDP11	 65	/* Digital Equipment Corp. PDP-11 */
17998b9484cSchristos #define EM_FX66		 66	/* Siemens FX66 microcontroller */
18098b9484cSchristos #define EM_ST9PLUS	 67	/* STMicroelectronics ST9+ 8/16 bit microcontroller */
18198b9484cSchristos #define EM_ST7		 68	/* STMicroelectronics ST7 8-bit microcontroller */
18298b9484cSchristos #define EM_68HC16	 69	/* Motorola MC68HC16 Microcontroller */
18398b9484cSchristos #define EM_68HC11	 70	/* Motorola MC68HC11 Microcontroller */
18498b9484cSchristos #define EM_68HC08	 71	/* Motorola MC68HC08 Microcontroller */
18598b9484cSchristos #define EM_68HC05	 72	/* Motorola MC68HC05 Microcontroller */
18698b9484cSchristos #define EM_SVX		 73	/* Silicon Graphics SVx */
18798b9484cSchristos #define EM_ST19		 74	/* STMicroelectronics ST19 8-bit cpu */
18898b9484cSchristos #define EM_VAX		 75	/* Digital VAX */
18998b9484cSchristos #define EM_CRIS		 76	/* Axis Communications 32-bit embedded processor */
19098b9484cSchristos #define EM_JAVELIN	 77	/* Infineon Technologies 32-bit embedded cpu */
19198b9484cSchristos #define EM_FIREPATH	 78	/* Element 14 64-bit DSP processor */
19298b9484cSchristos #define EM_ZSP		 79	/* LSI Logic's 16-bit DSP processor */
19398b9484cSchristos #define EM_MMIX		 80	/* Donald Knuth's educational 64-bit processor */
19498b9484cSchristos #define EM_HUANY	 81	/* Harvard's machine-independent format */
19598b9484cSchristos #define EM_PRISM	 82	/* SiTera Prism */
19698b9484cSchristos #define EM_AVR		 83	/* Atmel AVR 8-bit microcontroller */
19798b9484cSchristos #define EM_FR30		 84	/* Fujitsu FR30 */
19898b9484cSchristos #define EM_D10V		 85	/* Mitsubishi D10V */
19998b9484cSchristos #define EM_D30V		 86	/* Mitsubishi D30V */
20098b9484cSchristos #define EM_V850		 87	/* Renesas V850 (formerly NEC V850) */
20198b9484cSchristos #define EM_M32R		 88	/* Renesas M32R (formerly Mitsubishi M32R) */
20298b9484cSchristos #define EM_MN10300	 89	/* Matsushita MN10300 */
20398b9484cSchristos #define EM_MN10200	 90	/* Matsushita MN10200 */
20498b9484cSchristos #define EM_PJ		 91	/* picoJava */
205968cf8f2Schristos #define EM_OR1K		 92	/* OpenRISC 1000 32-bit embedded processor */
206c358683dSchristos #define EM_ARC_COMPACT	 93	/* ARC International ARCompact processor */
20798b9484cSchristos #define EM_XTENSA	 94	/* Tensilica Xtensa Architecture */
2083b99ba0fSchristos #define EM_SCORE_OLD	 95	/* Old Sunplus S+core7 backend magic number. Written in the absence of an ABI.  */
20998b9484cSchristos #define EM_VIDEOCORE	 95	/* Alphamosaic VideoCore processor */
21098b9484cSchristos #define EM_TMM_GPP	 96	/* Thompson Multimedia General Purpose Processor */
21198b9484cSchristos #define EM_NS32K	 97	/* National Semiconductor 32000 series */
21298b9484cSchristos #define EM_TPC		 98	/* Tenor Network TPC processor */
2133b99ba0fSchristos #define EM_PJ_OLD	 99	/* Old value for picoJava.  Deprecated.  */
21498b9484cSchristos #define EM_SNP1K	 99	/* Trebia SNP 1000 processor */
21598b9484cSchristos #define EM_ST200	100	/* STMicroelectronics ST200 microcontroller */
21698b9484cSchristos #define EM_IP2K		101	/* Ubicom IP2022 micro controller */
21798b9484cSchristos #define EM_MAX		102	/* MAX Processor */
21898b9484cSchristos #define EM_CR		103	/* National Semiconductor CompactRISC */
21998b9484cSchristos #define EM_F2MC16	104	/* Fujitsu F2MC16 */
22098b9484cSchristos #define EM_MSP430	105	/* TI msp430 micro controller */
22198b9484cSchristos #define EM_BLACKFIN	106	/* ADI Blackfin */
22298b9484cSchristos #define EM_SE_C33	107	/* S1C33 Family of Seiko Epson processors */
22398b9484cSchristos #define EM_SEP		108	/* Sharp embedded microprocessor */
22498b9484cSchristos #define EM_ARCA		109	/* Arca RISC Microprocessor */
22598b9484cSchristos #define EM_UNICORE	110	/* Microprocessor series from PKU-Unity Ltd. and MPRC of Peking University */
22698b9484cSchristos #define EM_EXCESS	111	/* eXcess: 16/32/64-bit configurable embedded CPU */
22798b9484cSchristos #define EM_DXP		112	/* Icera Semiconductor Inc. Deep Execution Processor */
22898b9484cSchristos #define EM_ALTERA_NIOS2	113	/* Altera Nios II soft-core processor */
22998b9484cSchristos #define EM_CRX		114	/* National Semiconductor CRX */
2303b99ba0fSchristos #define EM_CR16_OLD	115	/* Old, value for National Semiconductor CompactRISC.  Deprecated.  */
23198b9484cSchristos #define EM_XGATE	115	/* Motorola XGATE embedded processor */
23298b9484cSchristos #define EM_C166		116	/* Infineon C16x/XC16x processor */
23398b9484cSchristos #define EM_M16C		117	/* Renesas M16C series microprocessors */
23498b9484cSchristos #define EM_DSPIC30F	118	/* Microchip Technology dsPIC30F Digital Signal Controller */
23598b9484cSchristos #define EM_CE		119	/* Freescale Communication Engine RISC core */
23698b9484cSchristos #define EM_M32C		120	/* Renesas M32C series microprocessors */
23798b9484cSchristos #define EM_res121	121	/* Reserved */
23898b9484cSchristos #define EM_res122	122	/* Reserved */
23998b9484cSchristos #define EM_res123	123	/* Reserved */
24098b9484cSchristos #define EM_res124	124	/* Reserved */
24198b9484cSchristos #define EM_res125	125	/* Reserved */
24298b9484cSchristos #define EM_res126	126	/* Reserved */
24398b9484cSchristos #define EM_res127	127	/* Reserved */
24498b9484cSchristos #define EM_res128	128	/* Reserved */
24598b9484cSchristos #define EM_res129	129	/* Reserved */
24698b9484cSchristos #define EM_res130	130	/* Reserved */
24798b9484cSchristos #define EM_TSK3000	131	/* Altium TSK3000 core */
24898b9484cSchristos #define EM_RS08		132	/* Freescale RS08 embedded processor */
24998b9484cSchristos #define EM_res133	133	/* Reserved */
25098b9484cSchristos #define EM_ECOG2	134	/* Cyan Technology eCOG2 microprocessor */
25198b9484cSchristos #define EM_SCORE	135	/* Sunplus Score */
25298b9484cSchristos #define EM_SCORE7	135	/* Sunplus S+core7 RISC processor */
25398b9484cSchristos #define EM_DSP24	136	/* New Japan Radio (NJR) 24-bit DSP Processor */
25498b9484cSchristos #define EM_VIDEOCORE3	137	/* Broadcom VideoCore III processor */
25598b9484cSchristos #define EM_LATTICEMICO32 138	/* RISC processor for Lattice FPGA architecture */
25698b9484cSchristos #define EM_SE_C17	139	/* Seiko Epson C17 family */
25798b9484cSchristos #define EM_TI_C6000	140	/* Texas Instruments TMS320C6000 DSP family */
25898b9484cSchristos #define EM_TI_C2000	141	/* Texas Instruments TMS320C2000 DSP family */
25998b9484cSchristos #define EM_TI_C5500	142	/* Texas Instruments TMS320C55x DSP family */
26098b9484cSchristos #define EM_res143	143	/* Reserved */
2613b99ba0fSchristos #define EM_TI_PRU	144	/* Texas Instruments Programmable Realtime Unit */
26298b9484cSchristos #define EM_res145	145	/* Reserved */
26398b9484cSchristos #define EM_res146	146	/* Reserved */
26498b9484cSchristos #define EM_res147	147	/* Reserved */
26598b9484cSchristos #define EM_res148	148	/* Reserved */
26698b9484cSchristos #define EM_res149	149	/* Reserved */
26798b9484cSchristos #define EM_res150	150	/* Reserved */
26898b9484cSchristos #define EM_res151	151	/* Reserved */
26998b9484cSchristos #define EM_res152	152	/* Reserved */
27098b9484cSchristos #define EM_res153	153	/* Reserved */
27198b9484cSchristos #define EM_res154	154	/* Reserved */
27298b9484cSchristos #define EM_res155	155	/* Reserved */
27398b9484cSchristos #define EM_res156	156	/* Reserved */
27498b9484cSchristos #define EM_res157	157	/* Reserved */
27598b9484cSchristos #define EM_res158	158	/* Reserved */
27698b9484cSchristos #define EM_res159	159	/* Reserved */
27798b9484cSchristos #define EM_MMDSP_PLUS	160	/* STMicroelectronics 64bit VLIW Data Signal Processor */
27898b9484cSchristos #define EM_CYPRESS_M8C	161	/* Cypress M8C microprocessor */
27998b9484cSchristos #define EM_R32C		162	/* Renesas R32C series microprocessors */
28098b9484cSchristos #define EM_TRIMEDIA	163	/* NXP Semiconductors TriMedia architecture family */
28198b9484cSchristos #define EM_QDSP6	164	/* QUALCOMM DSP6 Processor */
28298b9484cSchristos #define EM_8051		165	/* Intel 8051 and variants */
28398b9484cSchristos #define EM_STXP7X	166	/* STMicroelectronics STxP7x family */
28498b9484cSchristos #define EM_NDS32	167	/* Andes Technology compact code size embedded RISC processor family */
28598b9484cSchristos #define EM_ECOG1	168	/* Cyan Technology eCOG1X family */
28698b9484cSchristos #define EM_ECOG1X	168	/* Cyan Technology eCOG1X family */
28798b9484cSchristos #define EM_MAXQ30	169	/* Dallas Semiconductor MAXQ30 Core Micro-controllers */
28898b9484cSchristos #define EM_XIMO16	170	/* New Japan Radio (NJR) 16-bit DSP Processor */
28998b9484cSchristos #define EM_MANIK	171	/* M2000 Reconfigurable RISC Microprocessor */
29098b9484cSchristos #define EM_CRAYNV2	172	/* Cray Inc. NV2 vector architecture */
29198b9484cSchristos #define EM_RX		173	/* Renesas RX family */
292a2e2270fSchristos #define EM_METAG	174	/* Imagination Technologies Meta processor architecture */
29398b9484cSchristos #define EM_MCST_ELBRUS	175	/* MCST Elbrus general purpose hardware architecture */
29498b9484cSchristos #define EM_ECOG16	176	/* Cyan Technology eCOG16 family */
29598b9484cSchristos #define EM_CR16		177	/* National Semiconductor CompactRISC 16-bit processor */
29698b9484cSchristos #define EM_ETPU		178	/* Freescale Extended Time Processing Unit */
29798b9484cSchristos #define EM_SLE9X	179	/* Infineon Technologies SLE9X core */
29898b9484cSchristos #define EM_L1OM		180	/* Intel L1OM */
299a2e2270fSchristos #define EM_K1OM		181	/* Intel K1OM */
30098b9484cSchristos #define EM_INTEL182	182	/* Reserved by Intel */
301a2e2270fSchristos #define EM_AARCH64	183	/* ARM 64-bit architecture */
302a2e2270fSchristos #define EM_ARM184	184	/* Reserved by ARM */
30398b9484cSchristos #define EM_AVR32	185	/* Atmel Corporation 32-bit microprocessor family */
30498b9484cSchristos #define EM_STM8		186	/* STMicroeletronics STM8 8-bit microcontroller */
30598b9484cSchristos #define EM_TILE64	187	/* Tilera TILE64 multicore architecture family */
30698b9484cSchristos #define EM_TILEPRO	188	/* Tilera TILEPro multicore architecture family */
30798b9484cSchristos #define EM_MICROBLAZE	189	/* Xilinx MicroBlaze 32-bit RISC soft processor core */
30898b9484cSchristos #define EM_CUDA		190	/* NVIDIA CUDA architecture */
309a2e2270fSchristos #define EM_TILEGX	191	/* Tilera TILE-Gx multicore architecture family */
3103b99ba0fSchristos #define EM_CLOUDSHIELD 	192 	/* CloudShield architecture family */
3113b99ba0fSchristos #define EM_COREA_1ST 	193 	/* KIPO-KAIST Core-A 1st generation processor family */
3123b99ba0fSchristos #define EM_COREA_2ND 	194 	/* KIPO-KAIST Core-A 2nd generation processor family */
313c358683dSchristos #define EM_ARC_COMPACT2 195	/* Synopsys ARCompact V2 */
3143b99ba0fSchristos #define EM_OPEN8 	196 	/* Open8 8-bit RISC soft processor core */
315a2e2270fSchristos #define EM_RL78		197	/* Renesas RL78 family.  */
3163b99ba0fSchristos #define EM_VIDEOCORE5 	198 	/* Broadcom VideoCore V processor */
317a2e2270fSchristos #define EM_78K0R	199	/* Renesas 78K0R.  */
3183b99ba0fSchristos #define EM_56800EX 	200 	/* Freescale 56800EX Digital Signal Controller (DSC) */
3193b99ba0fSchristos #define EM_BA1 		201 	/* Beyond BA1 CPU architecture */
3203b99ba0fSchristos #define EM_BA2 		202 	/* Beyond BA2 CPU architecture */
3213b99ba0fSchristos #define EM_XCORE 	203 	/* XMOS xCORE processor family */
3223b99ba0fSchristos #define EM_MCHP_PIC 	204 	/* Microchip 8-bit PIC(r) family */
323924795e6Schristos #define EM_INTELGT	205	/* Intel Graphics Technology */
32403467a24Schristos #define EM_INTEL206	206	/* Reserved by Intel */
32503467a24Schristos #define EM_INTEL207	207	/* Reserved by Intel */
32603467a24Schristos #define EM_INTEL208	208	/* Reserved by Intel */
32703467a24Schristos #define EM_INTEL209	209	/* Reserved by Intel */
3283b99ba0fSchristos #define EM_KM32 	210 	/* KM211 KM32 32-bit processor */
3293b99ba0fSchristos #define EM_KMX32 	211 	/* KM211 KMX32 32-bit processor */
3303b99ba0fSchristos #define EM_KMX16 	212 	/* KM211 KMX16 16-bit processor */
3313b99ba0fSchristos #define EM_KMX8 	213 	/* KM211 KMX8 8-bit processor */
3323b99ba0fSchristos #define EM_KVARC 	214 	/* KM211 KVARC processor */
3333b99ba0fSchristos #define EM_CDP 		215 	/* Paneve CDP architecture family */
3343b99ba0fSchristos #define EM_COGE 	216 	/* Cognitive Smart Memory Processor */
3353b99ba0fSchristos #define EM_COOL 	217 	/* Bluechip Systems CoolEngine */
3363b99ba0fSchristos #define EM_NORC 	218 	/* Nanoradio Optimized RISC */
3373b99ba0fSchristos #define EM_CSR_KALIMBA 	219 	/* CSR Kalimba architecture family */
3383b99ba0fSchristos #define EM_Z80 		220 	/* Zilog Z80 */
339968cf8f2Schristos #define EM_VISIUM	221	/* Controls and Data Services VISIUMcore processor */
340212397c6Schristos #define EM_FT32         222     /* FTDI Chip FT32 high performance 32-bit RISC architecture */
341968cf8f2Schristos #define EM_MOXIE        223     /* Moxie processor family */
3423b99ba0fSchristos #define EM_AMDGPU 	224 	/* AMD GPU architecture */
3433b99ba0fSchristos #define EM_RISCV 	243 	/* RISC-V */
3443b99ba0fSchristos #define EM_LANAI	244	/* Lanai 32-bit processor.  */
345924795e6Schristos #define EM_CEVA		245	/* CEVA Processor Architecture Family */
346924795e6Schristos #define EM_CEVA_X2	246	/* CEVA X2 Processor Family */
3473b99ba0fSchristos #define EM_BPF		247	/* Linux BPF – in-kernel virtual machine.  */
348924795e6Schristos #define EM_GRAPHCORE_IPU 248	/* Graphcore Intelligent Processing Unit */
349924795e6Schristos #define EM_IMG1		249	/* Imagination Technologies */
350314094e7Schristos #define EM_NFP		250	/* Netronome Flow Processor.  */
351924795e6Schristos #define EM_VE		251	/* NEC Vector Engine */
352314094e7Schristos #define EM_CSKY		252	/* C-SKY processor family.  */
353924795e6Schristos #define EM_ARC_COMPACT3_64 253	/* Synopsys ARCv2.3 64-bit */
354924795e6Schristos #define EM_MCS6502	254	/* MOS Technology MCS 6502 processor */
355924795e6Schristos #define EM_ARC_COMPACT3	255	/* Synopsys ARCv2.3 32-bit */
356924795e6Schristos #define EM_KVX		256	/* Kalray VLIW core of the MPPA processor family */
357924795e6Schristos #define EM_65816	257	/* WDC 65816/65C816 */
358924795e6Schristos #define EM_LOONGARCH	258	/* LoongArch */
359924795e6Schristos #define EM_KF32		259	/* ChipON KungFu32 */
360924795e6Schristos #define EM_U16_U8CORE	260	/* LAPIS nX-U16/U8 */
361924795e6Schristos #define EM_TACHYUM	261	/* Tachyum */
362924795e6Schristos #define EM_56800EF	262	/* NXP 56800EF Digital Signal Controller (DSC) */
36398b9484cSchristos 
36498b9484cSchristos /* If it is necessary to assign new unofficial EM_* values, please pick large
36598b9484cSchristos    random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision
36698b9484cSchristos    with official or non-GNU unofficial values.
36798b9484cSchristos 
36898b9484cSchristos    NOTE: Do not just increment the most recent number by one.
36998b9484cSchristos    Somebody else somewhere will do exactly the same thing, and you
37098b9484cSchristos    will have a collision.  Instead, pick a random number.
37198b9484cSchristos 
37298b9484cSchristos    Normally, each entity or maintainer responsible for a machine with an
37398b9484cSchristos    unofficial e_machine number should eventually ask registry@sco.com for
37498b9484cSchristos    an officially blessed number to be added to the list above.	*/
37598b9484cSchristos 
37698b9484cSchristos /* AVR magic number.  Written in the absense of an ABI.  */
37798b9484cSchristos #define EM_AVR_OLD		0x1057
37898b9484cSchristos 
37998b9484cSchristos /* MSP430 magic number.  Written in the absense of everything.  */
38098b9484cSchristos #define EM_MSP430_OLD		0x1059
38198b9484cSchristos 
38298b9484cSchristos /* Morpho MT.   Written in the absense of an ABI.  */
38398b9484cSchristos #define EM_MT			0x2530
38498b9484cSchristos 
38598b9484cSchristos /* FR30 magic number - no EABI available.  */
38698b9484cSchristos #define EM_CYGNUS_FR30		0x3330
38798b9484cSchristos 
3883b99ba0fSchristos /* Unofficial value for Web Assembly binaries, as used by LLVM.  */
3893b99ba0fSchristos #define EM_WEBASSEMBLY		0x4157
3903b99ba0fSchristos 
391314094e7Schristos /* Freescale S12Z.   The Freescale toolchain generates elf files with this value.  */
392314094e7Schristos #define EM_S12Z               0x4DEF
393314094e7Schristos 
39498b9484cSchristos /* DLX magic number.  Written in the absense of an ABI.  */
39598b9484cSchristos #define EM_DLX			0x5aa5
39698b9484cSchristos 
39798b9484cSchristos /* FRV magic number - no EABI available??.  */
39898b9484cSchristos #define EM_CYGNUS_FRV		0x5441
39998b9484cSchristos 
40098b9484cSchristos /* Infineon Technologies 16-bit microcontroller with C166-V2 core.  */
40198b9484cSchristos #define EM_XC16X		0x4688
40298b9484cSchristos 
40398b9484cSchristos /* D10V backend magic number.  Written in the absence of an ABI.  */
40498b9484cSchristos #define EM_CYGNUS_D10V		0x7650
40598b9484cSchristos 
40698b9484cSchristos /* D30V backend magic number.  Written in the absence of an ABI.  */
40798b9484cSchristos #define EM_CYGNUS_D30V		0x7676
40898b9484cSchristos 
40998b9484cSchristos /* Ubicom IP2xxx;   Written in the absense of an ABI.  */
41098b9484cSchristos #define EM_IP2K_OLD		0x8217
41198b9484cSchristos 
41298b9484cSchristos /* Cygnus PowerPC ELF backend.  Written in the absence of an ABI.  */
41398b9484cSchristos #define EM_CYGNUS_POWERPC	0x9025
41498b9484cSchristos 
41598b9484cSchristos /* Alpha backend magic number.  Written in the absence of an ABI.  */
41698b9484cSchristos #define EM_ALPHA		0x9026
41798b9484cSchristos 
41898b9484cSchristos /* Cygnus M32R ELF backend.  Written in the absence of an ABI.  */
41998b9484cSchristos #define EM_CYGNUS_M32R		0x9041
42098b9484cSchristos 
42198b9484cSchristos /* V850 backend magic number.  Written in the absense of an ABI.  */
42298b9484cSchristos #define EM_CYGNUS_V850		0x9080
42398b9484cSchristos 
42498b9484cSchristos /* old S/390 backend magic number. Written in the absence of an ABI.  */
42598b9484cSchristos #define EM_S390_OLD		0xa390
42698b9484cSchristos 
42798b9484cSchristos /* Old, unofficial value for Xtensa.  */
42898b9484cSchristos #define EM_XTENSA_OLD		0xabc7
42998b9484cSchristos 
43098b9484cSchristos #define EM_XSTORMY16		0xad45
43198b9484cSchristos 
43298b9484cSchristos /* mn10200 and mn10300 backend magic numbers.
43398b9484cSchristos    Written in the absense of an ABI.  */
43498b9484cSchristos #define EM_CYGNUS_MN10300	0xbeef
43598b9484cSchristos #define EM_CYGNUS_MN10200	0xdead
43698b9484cSchristos 
43798b9484cSchristos /* Renesas M32C and M16C.  */
43898b9484cSchristos #define EM_M32C_OLD		0xFEB0
43998b9484cSchristos 
44098b9484cSchristos /* Vitesse IQ2000.  */
44198b9484cSchristos #define EM_IQ2000		0xFEBA
44298b9484cSchristos 
44398b9484cSchristos /* NIOS magic number - no EABI available.  */
44498b9484cSchristos #define EM_NIOS32		0xFEBB
44598b9484cSchristos 
44698b9484cSchristos #define EM_CYGNUS_MEP		0xF00D  /* Toshiba MeP */
44798b9484cSchristos 
448968cf8f2Schristos /* Old, unofficial value for Moxie.  */
449968cf8f2Schristos #define EM_MOXIE_OLD            0xFEED
45098b9484cSchristos 
45198b9484cSchristos #define EM_MICROBLAZE_OLD	0xbaab	/* Old MicroBlaze */
45298b9484cSchristos 
453a2e2270fSchristos #define EM_ADAPTEVA_EPIPHANY	0x1223  /* Adapteva's Epiphany architecture.  */
454a2e2270fSchristos 
455968cf8f2Schristos /* Old constant that might be in use by some software. */
456968cf8f2Schristos #define EM_OPENRISC		EM_OR1K
457968cf8f2Schristos 
458314094e7Schristos /* C-SKY historically used 39, the same value as MCORE, from which the
459314094e7Schristos    architecture was derived.  */
460314094e7Schristos #define EM_CSKY_OLD		EM_MCORE
461314094e7Schristos 
46298b9484cSchristos /* See the above comment before you add a new EM_* value here.  */
46398b9484cSchristos 
46498b9484cSchristos /* Values for e_version.  */
46598b9484cSchristos 
46698b9484cSchristos #define EV_NONE		0		/* Invalid ELF version */
46798b9484cSchristos #define EV_CURRENT	1		/* Current version */
46898b9484cSchristos 
46998b9484cSchristos /* Value for e_phnum. */
47098b9484cSchristos #define PN_XNUM		0xffff		/* Extended numbering */
47198b9484cSchristos 
47298b9484cSchristos /* Values for program header, p_type field.  */
47398b9484cSchristos 
47498b9484cSchristos #define PT_NULL		0		/* Program header table entry unused */
47598b9484cSchristos #define PT_LOAD		1		/* Loadable program segment */
47698b9484cSchristos #define PT_DYNAMIC	2		/* Dynamic linking information */
47798b9484cSchristos #define PT_INTERP	3		/* Program interpreter */
47898b9484cSchristos #define PT_NOTE		4		/* Auxiliary information */
47998b9484cSchristos #define PT_SHLIB	5		/* Reserved, unspecified semantics */
48098b9484cSchristos #define PT_PHDR		6		/* Entry for header table itself */
48198b9484cSchristos #define PT_TLS		7		/* Thread local storage segment */
48298b9484cSchristos #define PT_LOOS		0x60000000	/* OS-specific */
48398b9484cSchristos #define PT_HIOS		0x6fffffff	/* OS-specific */
48498b9484cSchristos #define PT_LOPROC	0x70000000	/* Processor-specific */
48598b9484cSchristos #define PT_HIPROC	0x7FFFFFFF	/* Processor-specific */
48698b9484cSchristos 
48798b9484cSchristos #define PT_GNU_EH_FRAME	(PT_LOOS + 0x474e550) /* Frame unwind information */
48898b9484cSchristos #define PT_SUNW_EH_FRAME PT_GNU_EH_FRAME      /* Solaris uses the same value */
48998b9484cSchristos #define PT_GNU_STACK	(PT_LOOS + 0x474e551) /* Stack flags */
49098b9484cSchristos #define PT_GNU_RELRO	(PT_LOOS + 0x474e552) /* Read-only after relocation */
491314094e7Schristos #define PT_GNU_PROPERTY	(PT_LOOS + 0x474e553) /* GNU property */
492*889f3bb0Schristos #define PT_GNU_SFRAME	(PT_LOOS + 0x474e554) /* SFrame stack trace information */
49398b9484cSchristos 
494db9b8011Schristos /* OpenBSD segment types.  */
495*889f3bb0Schristos #define PT_OPENBSD_MUTABLE   (PT_LOOS + 0x5a3dbe5)  /* Like bss, but not immutable.  */
496db9b8011Schristos #define PT_OPENBSD_RANDOMIZE (PT_LOOS + 0x5a3dbe6)  /* Fill with random data.  */
497db9b8011Schristos #define PT_OPENBSD_WXNEEDED  (PT_LOOS + 0x5a3dbe7)  /* Program does W^X violations.  */
498*889f3bb0Schristos #define PT_OPENBSD_NOBTCFI   (PT_LOOS + 0x5a3dbe8)  /* No branch target CFI.  */
499*889f3bb0Schristos #define PT_OPENBSD_SYSCALLS  (PT_LOOS + 0x5a3dbe9)  /* System call sites.  */
500db9b8011Schristos #define PT_OPENBSD_BOOTDATA  (PT_LOOS + 0x5a41be6)  /* Section for boot arguments.  */
501db9b8011Schristos 
5023b99ba0fSchristos /* Mbind segments */
5033b99ba0fSchristos #define PT_GNU_MBIND_NUM 4096
5043b99ba0fSchristos #define PT_GNU_MBIND_LO (PT_LOOS + 0x474e555)
5053b99ba0fSchristos #define PT_GNU_MBIND_HI (PT_GNU_MBIND_LO + PT_GNU_MBIND_NUM - 1)
5063b99ba0fSchristos 
50798b9484cSchristos /* Program segment permissions, in program header p_flags field.  */
50898b9484cSchristos 
50998b9484cSchristos #define PF_X		(1 << 0)	/* Segment is executable */
51098b9484cSchristos #define PF_W		(1 << 1)	/* Segment is writable */
51198b9484cSchristos #define PF_R		(1 << 2)	/* Segment is readable */
51298b9484cSchristos /* #define PF_MASKOS	0x0F000000    *//* OS-specific reserved bits */
51398b9484cSchristos #define PF_MASKOS	0x0FF00000	/* New value, Oct 4, 1999 Draft */
51498b9484cSchristos #define PF_MASKPROC	0xF0000000	/* Processor-specific reserved bits */
51598b9484cSchristos 
51698b9484cSchristos /* Values for section header, sh_type field.  */
51798b9484cSchristos 
51898b9484cSchristos #define SHT_NULL	0		/* Section header table entry unused */
51998b9484cSchristos #define SHT_PROGBITS	1		/* Program specific (private) data */
52098b9484cSchristos #define SHT_SYMTAB	2		/* Link editing symbol table */
52198b9484cSchristos #define SHT_STRTAB	3		/* A string table */
52298b9484cSchristos #define SHT_RELA	4		/* Relocation entries with addends */
52398b9484cSchristos #define SHT_HASH	5		/* A symbol hash table */
52498b9484cSchristos #define SHT_DYNAMIC	6		/* Information for dynamic linking */
52598b9484cSchristos #define SHT_NOTE	7		/* Information that marks file */
52698b9484cSchristos #define SHT_NOBITS	8		/* Section occupies no space in file */
52798b9484cSchristos #define SHT_REL		9		/* Relocation entries, no addends */
52898b9484cSchristos #define SHT_SHLIB	10		/* Reserved, unspecified semantics */
52998b9484cSchristos #define SHT_DYNSYM	11		/* Dynamic linking symbol table */
53098b9484cSchristos 
53198b9484cSchristos #define SHT_INIT_ARRAY	  14		/* Array of ptrs to init functions */
53298b9484cSchristos #define SHT_FINI_ARRAY	  15		/* Array of ptrs to finish functions */
53398b9484cSchristos #define SHT_PREINIT_ARRAY 16		/* Array of ptrs to pre-init funcs */
53498b9484cSchristos #define SHT_GROUP	  17		/* Section contains a section group */
535314094e7Schristos #define SHT_SYMTAB_SHNDX  18		/* Indices for SHN_XINDEX entries */
536924795e6Schristos #define SHT_RELR	  19		/* RELR relative relocations */
53798b9484cSchristos 
53898b9484cSchristos #define SHT_LOOS	0x60000000	/* First of OS specific semantics */
53998b9484cSchristos #define SHT_HIOS	0x6fffffff	/* Last of OS specific semantics */
54098b9484cSchristos 
54198b9484cSchristos #define SHT_GNU_INCREMENTAL_INPUTS 0x6fff4700   /* incremental build data */
54298b9484cSchristos #define SHT_GNU_ATTRIBUTES 0x6ffffff5	/* Object attributes */
54398b9484cSchristos #define SHT_GNU_HASH	0x6ffffff6	/* GNU style symbol hash table */
54498b9484cSchristos #define SHT_GNU_LIBLIST	0x6ffffff7	/* List of prelink dependencies */
54598b9484cSchristos 
54698b9484cSchristos /* The next three section types are defined by Solaris, and are named
54798b9484cSchristos    SHT_SUNW*.  We use them in GNU code, so we also define SHT_GNU*
54898b9484cSchristos    versions.  */
54998b9484cSchristos #define SHT_SUNW_verdef	0x6ffffffd	/* Versions defined by file */
55098b9484cSchristos #define SHT_SUNW_verneed 0x6ffffffe	/* Versions needed by file */
55198b9484cSchristos #define SHT_SUNW_versym	0x6fffffff	/* Symbol versions */
55298b9484cSchristos 
55398b9484cSchristos #define SHT_GNU_verdef	SHT_SUNW_verdef
55498b9484cSchristos #define SHT_GNU_verneed	SHT_SUNW_verneed
55598b9484cSchristos #define SHT_GNU_versym	SHT_SUNW_versym
55698b9484cSchristos 
55798b9484cSchristos #define SHT_LOPROC	0x70000000	/* Processor-specific semantics, lo */
55898b9484cSchristos #define SHT_HIPROC	0x7FFFFFFF	/* Processor-specific semantics, hi */
55998b9484cSchristos #define SHT_LOUSER	0x80000000	/* Application-specific semantics */
56098b9484cSchristos /* #define SHT_HIUSER	0x8FFFFFFF    *//* Application-specific semantics */
56198b9484cSchristos #define SHT_HIUSER	0xFFFFFFFF	/* New value, defined in Oct 4, 1999 Draft */
56298b9484cSchristos 
56398b9484cSchristos /* Values for section header, sh_flags field.  */
56498b9484cSchristos 
56598b9484cSchristos #define SHF_WRITE	(1 << 0)	/* Writable data during execution */
56698b9484cSchristos #define SHF_ALLOC	(1 << 1)	/* Occupies memory during execution */
56798b9484cSchristos #define SHF_EXECINSTR	(1 << 2)	/* Executable machine instructions */
56898b9484cSchristos #define SHF_MERGE	(1 << 4)	/* Data in this section can be merged */
56998b9484cSchristos #define SHF_STRINGS	(1 << 5)	/* Contains null terminated character strings */
57098b9484cSchristos #define SHF_INFO_LINK	(1 << 6)	/* sh_info holds section header table index */
57198b9484cSchristos #define SHF_LINK_ORDER	(1 << 7)	/* Preserve section ordering when linking */
57298b9484cSchristos #define SHF_OS_NONCONFORMING (1 << 8)	/* OS specific processing required */
57398b9484cSchristos #define SHF_GROUP	(1 << 9)	/* Member of a section group */
57498b9484cSchristos #define SHF_TLS		(1 << 10)	/* Thread local storage section */
575212397c6Schristos #define SHF_COMPRESSED	(1 << 11)	/* Section with compressed data */
57698b9484cSchristos 
57798b9484cSchristos /* #define SHF_MASKOS	0x0F000000    *//* OS-specific semantics */
57898b9484cSchristos #define SHF_MASKOS	0x0FF00000	/* New value, Oct 4, 1999 Draft */
579924795e6Schristos #define SHF_GNU_RETAIN	      (1 << 21)	/* Section should not be garbage collected by the linker.  */
58098b9484cSchristos #define SHF_MASKPROC	0xF0000000	/* Processor-specific semantics */
58198b9484cSchristos 
58298b9484cSchristos /* This used to be implemented as a processor specific section flag.
58398b9484cSchristos    We just make it generic.  */
58498b9484cSchristos #define SHF_EXCLUDE	0x80000000	/* Link editor is to exclude
58598b9484cSchristos 					   this section from executable
58698b9484cSchristos 					   and shared library that it
58798b9484cSchristos 					   builds when those objects
58898b9484cSchristos 					   are not to be further
58998b9484cSchristos 					   relocated.  */
59098b9484cSchristos 
5913b99ba0fSchristos #define SHF_GNU_MBIND	0x01000000	/* Mbind section.  */
5923b99ba0fSchristos 
5933b99ba0fSchristos /* Compression types.  */
594212397c6Schristos #define ELFCOMPRESS_ZLIB   1		/* Compressed with zlib.  */
595924795e6Schristos #define ELFCOMPRESS_ZSTD   2		/* Compressed with zstd  */
596924795e6Schristos 					/* (see http://www.zstandard.org). */
597212397c6Schristos #define ELFCOMPRESS_LOOS   0x60000000	/* OS-specific semantics, lo */
598212397c6Schristos #define ELFCOMPRESS_HIOS   0x6FFFFFFF	/* OS-specific semantics, hi */
599212397c6Schristos #define ELFCOMPRESS_LOPROC 0x70000000	/* Processor-specific semantics, lo */
600212397c6Schristos #define ELFCOMPRESS_HIPROC 0x7FFFFFFF	/* Processor-specific semantics, hi */
601212397c6Schristos 
60298b9484cSchristos /* Values of note segment descriptor types for core files.  */
60398b9484cSchristos 
60498b9484cSchristos #define NT_PRSTATUS	1		/* Contains copy of prstatus struct */
60598b9484cSchristos #define NT_FPREGSET	2		/* Contains copy of fpregset struct */
60698b9484cSchristos #define NT_PRPSINFO	3		/* Contains copy of prpsinfo struct */
60798b9484cSchristos #define NT_TASKSTRUCT	4		/* Contains copy of task struct */
60898b9484cSchristos #define NT_AUXV		6		/* Contains copy of Elfxx_auxv_t */
60998b9484cSchristos #define NT_PRXFPREG	0x46e62b7f	/* Contains a user_xfpregs_struct; */
61098b9484cSchristos 					/*   note name must be "LINUX".  */
61198b9484cSchristos #define NT_PPC_VMX	0x100		/* PowerPC Altivec/VMX registers */
61298b9484cSchristos 					/*   note name must be "LINUX".  */
61398b9484cSchristos #define NT_PPC_VSX	0x102		/* PowerPC VSX registers */
61498b9484cSchristos 					/*   note name must be "LINUX".  */
615314094e7Schristos #define NT_PPC_TAR	0x103		/* PowerPC Target Address Register */
616314094e7Schristos 					/*   note name must be "LINUX".  */
617314094e7Schristos #define NT_PPC_PPR	0x104		/* PowerPC Program Priority Register */
618314094e7Schristos 					/*   note name must be "LINUX".  */
619314094e7Schristos #define NT_PPC_DSCR	0x105		/* PowerPC Data Stream Control Register */
620314094e7Schristos 					/*   note name must be "LINUX".  */
621314094e7Schristos #define NT_PPC_EBB	0x106		/* PowerPC Event Based Branch Registers */
622314094e7Schristos 					/*   note name must be "LINUX".  */
623314094e7Schristos #define NT_PPC_PMU	0x107		/* PowerPC Performance Monitor Registers */
624314094e7Schristos 					/*   note name must be "LINUX".  */
625314094e7Schristos #define NT_PPC_TM_CGPR	0x108		/* PowerPC TM checkpointed GPR Registers */
626314094e7Schristos 					/*   note name must be "LINUX".  */
627314094e7Schristos #define NT_PPC_TM_CFPR	0x109		/* PowerPC TM checkpointed FPR Registers */
628314094e7Schristos 					/*   note name must be "LINUX".  */
629314094e7Schristos #define NT_PPC_TM_CVMX	0x10a		/* PowerPC TM checkpointed VMX Registers */
630314094e7Schristos 					/*   note name must be "LINUX".  */
631314094e7Schristos #define NT_PPC_TM_CVSX	0x10b		/* PowerPC TM checkpointed VSX Registers */
632314094e7Schristos 					/*   note name must be "LINUX".  */
633314094e7Schristos #define NT_PPC_TM_SPR	0x10c		/* PowerPC TM Special Purpose Registers */
634314094e7Schristos 					/*   note name must be "LINUX".  */
635314094e7Schristos #define NT_PPC_TM_CTAR	0x10d		/* PowerPC TM checkpointed TAR */
636314094e7Schristos 					/*   note name must be "LINUX".  */
637314094e7Schristos #define NT_PPC_TM_CPPR	0x10e		/* PowerPC TM checkpointed PPR */
638314094e7Schristos 					/*   note name must be "LINUX".  */
639314094e7Schristos #define NT_PPC_TM_CDSCR	0x10f		/* PowerPC TM checkpointed Data SCR */
640314094e7Schristos 					/*   note name must be "LINUX".  */
641a2e2270fSchristos #define NT_386_TLS	0x200		/* x86 TLS information */
642a2e2270fSchristos 					/*   note name must be "LINUX".  */
643a2e2270fSchristos #define NT_386_IOPERM	0x201		/* x86 io permissions */
644a2e2270fSchristos 					/*   note name must be "LINUX".  */
64598b9484cSchristos #define NT_X86_XSTATE	0x202		/* x86 XSAVE extended state */
64698b9484cSchristos 					/*   note name must be "LINUX".  */
647db9b8011Schristos #define NT_X86_CET	0x203		/* x86 CET state.  */
648db9b8011Schristos 					/*   note name must be "LINUX".  */
649*889f3bb0Schristos #define NT_X86_SHSTK	0x204		/* x86 SHSTK state.  */
650*889f3bb0Schristos 					/* This replaces NT_X86_CET (0x203).  */
651*889f3bb0Schristos 					/*   note name must be "LINUX".  */
65298b9484cSchristos #define NT_S390_HIGH_GPRS 0x300		/* S/390 upper halves of GPRs  */
65398b9484cSchristos 					/*   note name must be "LINUX".  */
65498b9484cSchristos #define NT_S390_TIMER	0x301		/* S390 timer */
65598b9484cSchristos 					/*   note name must be "LINUX".  */
65698b9484cSchristos #define NT_S390_TODCMP	0x302		/* S390 TOD clock comparator */
65798b9484cSchristos 					/*   note name must be "LINUX".  */
65898b9484cSchristos #define NT_S390_TODPREG	0x303		/* S390 TOD programmable register */
65998b9484cSchristos 					/*   note name must be "LINUX".  */
66098b9484cSchristos #define NT_S390_CTRS	0x304		/* S390 control registers */
66198b9484cSchristos 					/*   note name must be "LINUX".  */
66298b9484cSchristos #define NT_S390_PREFIX	0x305		/* S390 prefix register */
66398b9484cSchristos 					/*   note name must be "LINUX".  */
664a2e2270fSchristos #define NT_S390_LAST_BREAK      0x306   /* S390 breaking event address */
665a2e2270fSchristos 					/*   note name must be "LINUX".  */
666a2e2270fSchristos #define NT_S390_SYSTEM_CALL     0x307   /* S390 system call restart data */
667a2e2270fSchristos 					/*   note name must be "LINUX".  */
668a2e2270fSchristos #define NT_S390_TDB	0x308		/* S390 transaction diagnostic block */
669a2e2270fSchristos 					/*   note name must be "LINUX".  */
670212397c6Schristos #define NT_S390_VXRS_LOW	0x309	/* S390 vector registers 0-15 upper half */
671212397c6Schristos 					/*   note name must be "LINUX".  */
672212397c6Schristos #define NT_S390_VXRS_HIGH	0x30a	/* S390 vector registers 16-31 */
673212397c6Schristos 					/*   note name must be "LINUX".  */
674314094e7Schristos #define NT_S390_GS_CB	0x30b		/* s390 guarded storage registers */
675314094e7Schristos 					/*   note name must be "LINUX".  */
676314094e7Schristos #define NT_S390_GS_BC	0x30c		/* s390 guarded storage broadcast control block */
677314094e7Schristos 					/*   note name must be "LINUX".  */
678a2e2270fSchristos #define NT_ARM_VFP	0x400		/* ARM VFP registers */
679a2e2270fSchristos /* The following definitions should really use NT_AARCH_..., but defined
680a2e2270fSchristos    this way for compatibility with Linux.  */
681a2e2270fSchristos #define NT_ARM_TLS	0x401		/* AArch TLS registers */
682a2e2270fSchristos 					/*   note name must be "LINUX".  */
683a2e2270fSchristos #define NT_ARM_HW_BREAK	0x402		/* AArch hardware breakpoint registers */
684a2e2270fSchristos 					/*   note name must be "LINUX".  */
685a2e2270fSchristos #define NT_ARM_HW_WATCH	0x403		/* AArch hardware watchpoint registers */
686a2e2270fSchristos 					/*   note name must be "LINUX".  */
687924795e6Schristos #define NT_ARM_SYSTEM_CALL      0x404   /* AArch ARM system call number */
688924795e6Schristos 					/*   note name must be "LINUX".  */
6893b99ba0fSchristos #define NT_ARM_SVE	0x405		/* AArch SVE registers.  */
6903b99ba0fSchristos 					/*   note name must be "LINUX".  */
691314094e7Schristos #define NT_ARM_PAC_MASK	0x406		/* AArch pointer authentication code masks */
692314094e7Schristos 					/*   note name must be "LINUX".  */
693924795e6Schristos #define NT_ARM_PACA_KEYS  0x407		/* ARM pointer authentication address
694924795e6Schristos 					   keys */
695924795e6Schristos 					/*   note name must be "LINUX".  */
696924795e6Schristos #define NT_ARM_PACG_KEYS  0x408		/* ARM pointer authentication generic
697924795e6Schristos 					   keys */
698924795e6Schristos 					/*  note name must be "LINUX".  */
699924795e6Schristos #define NT_ARM_TAGGED_ADDR_CTRL	0x409	/* AArch64 tagged address control
700924795e6Schristos 					   (prctl()) */
701924795e6Schristos 					/*   note name must be "LINUX".  */
702924795e6Schristos #define NT_ARM_PAC_ENABLED_KEYS	0x40a	/* AArch64 pointer authentication
703924795e6Schristos 					   enabled keys (prctl()) */
704924795e6Schristos 					/*   note name must be "LINUX".  */
705*889f3bb0Schristos #define NT_ARM_SSVE     0x40b        	/* AArch64 SME streaming SVE registers.  */
706*889f3bb0Schristos 					/*   Note: name must be "LINUX".  */
707*889f3bb0Schristos #define NT_ARM_ZA       0x40c           /* AArch64 SME ZA register.  */
708*889f3bb0Schristos 					/*   Note: name must be "LINUX".  */
709*889f3bb0Schristos #define NT_ARM_ZT       0x40d           /* AArch64 SME2 ZT registers.  */
710*889f3bb0Schristos 					/*   Note: name must be "LINUX".  */
711db9b8011Schristos #define NT_ARC_V2	0x600		/* ARC HS accumulator/extra registers.  */
712db9b8011Schristos 					/*   note name must be "LINUX".  */
713924795e6Schristos #define NT_LARCH_CPUCFG 0xa00		/* LoongArch CPU config registers */
714924795e6Schristos 					/*   note name must be "LINUX".  */
715924795e6Schristos #define NT_LARCH_CSR    0xa01		/* LoongArch Control State Registers */
716924795e6Schristos 					/*   note name must be "LINUX".  */
717924795e6Schristos #define NT_LARCH_LSX    0xa02		/* LoongArch SIMD eXtension registers */
718924795e6Schristos 					/*   note name must be "LINUX".  */
719924795e6Schristos #define NT_LARCH_LASX   0xa03		/* LoongArch Advanced SIMD eXtension registers */
720924795e6Schristos 					/*   note name must be "LINUX".  */
721924795e6Schristos #define NT_LARCH_LBT    0xa04		/* LoongArch Binary Translation registers */
722924795e6Schristos 					/*   note name must be "CORE".  */
723924795e6Schristos #define NT_RISCV_CSR    0x900		/* RISC-V Control and Status Registers */
724924795e6Schristos 					/*   note name must be "LINUX".  */
725a2e2270fSchristos #define NT_SIGINFO	0x53494749	/* Fields of siginfo_t.  */
726a2e2270fSchristos #define NT_FILE		0x46494c45	/* Description of mapped files.  */
72798b9484cSchristos 
728924795e6Schristos /* The range 0xff000000 to 0xffffffff is set aside for notes that don't
729924795e6Schristos    originate from any particular operating system.  */
730924795e6Schristos #define NT_GDB_TDESC	0xff000000	/* Contains copy of GDB's target description XML.  */
731924795e6Schristos 
73298b9484cSchristos /* Note segments for core files on dir-style procfs systems.  */
73398b9484cSchristos 
73498b9484cSchristos #define NT_PSTATUS	10		/* Has a struct pstatus */
73598b9484cSchristos #define NT_FPREGS	12		/* Has a struct fpregset */
73698b9484cSchristos #define NT_PSINFO	13		/* Has a struct psinfo */
73798b9484cSchristos #define NT_LWPSTATUS	16		/* Has a struct lwpstatus_t */
73898b9484cSchristos #define NT_LWPSINFO	17		/* Has a struct lwpsinfo_t */
73998b9484cSchristos #define NT_WIN32PSTATUS	18		/* Has a struct win32_pstatus */
74098b9484cSchristos 
741a2e2270fSchristos /* Note segment for SystemTap probes.  */
742a2e2270fSchristos #define NT_STAPSDT	3
74398b9484cSchristos 
744c358683dSchristos /* Note segments for core files on FreeBSD systems.  Note name is
745c358683dSchristos    "FreeBSD".  */
746c358683dSchristos 
747c358683dSchristos #define	NT_FREEBSD_THRMISC	7	/* Thread miscellaneous info. */
748c358683dSchristos #define	NT_FREEBSD_PROCSTAT_PROC	8	/* Procstat proc data. */
749c358683dSchristos #define	NT_FREEBSD_PROCSTAT_FILES	9	/* Procstat files data. */
750c358683dSchristos #define	NT_FREEBSD_PROCSTAT_VMMAP	10	/* Procstat vmmap data. */
751c358683dSchristos #define	NT_FREEBSD_PROCSTAT_GROUPS	11	/* Procstat groups data. */
752c358683dSchristos #define	NT_FREEBSD_PROCSTAT_UMASK	12	/* Procstat umask data. */
753c358683dSchristos #define	NT_FREEBSD_PROCSTAT_RLIMIT	13	/* Procstat rlimit data. */
754c358683dSchristos #define	NT_FREEBSD_PROCSTAT_OSREL	14	/* Procstat osreldate data. */
755c358683dSchristos #define	NT_FREEBSD_PROCSTAT_PSSTRINGS	15	/* Procstat ps_strings data. */
756c358683dSchristos #define	NT_FREEBSD_PROCSTAT_AUXV	16	/* Procstat auxv data. */
757314094e7Schristos #define	NT_FREEBSD_PTLWPINFO	17	/* Thread ptrace miscellaneous info. */
758924795e6Schristos #define	NT_FREEBSD_X86_SEGBASES	0x200	/* x86 segment base registers */
759c358683dSchristos 
76098b9484cSchristos /* Note segments for core files on NetBSD systems.  Note name
76198b9484cSchristos    must start with "NetBSD-CORE".  */
76298b9484cSchristos 
76398b9484cSchristos #define NT_NETBSDCORE_PROCINFO	1	/* Has a struct procinfo */
764db9b8011Schristos #define NT_NETBSDCORE_AUXV	2	/* Has auxv data */
765db9b8011Schristos #define NT_NETBSDCORE_LWPSTATUS	24	/* Has LWPSTATUS data */
76698b9484cSchristos #define NT_NETBSDCORE_FIRSTMACH	32	/* start of machdep note types */
76798b9484cSchristos 
76898b9484cSchristos 
76998b9484cSchristos /* Note segments for core files on OpenBSD systems.  Note name is
77098b9484cSchristos    "OpenBSD".  */
77198b9484cSchristos 
77298b9484cSchristos #define NT_OPENBSD_PROCINFO	10
77398b9484cSchristos #define NT_OPENBSD_AUXV		11
77498b9484cSchristos #define NT_OPENBSD_REGS		20
77598b9484cSchristos #define NT_OPENBSD_FPREGS	21
77698b9484cSchristos #define NT_OPENBSD_XFPREGS	22
77798b9484cSchristos #define NT_OPENBSD_WCOOKIE	23
77898b9484cSchristos 
779*889f3bb0Schristos /* Note segments for core files on QNX systems.  Note name
780*889f3bb0Schristos    must start with "QNX".  */
781*889f3bb0Schristos #define QNT_DEBUG_FULLPATH 1
782*889f3bb0Schristos #define QNT_DEBUG_RELOC    2
783*889f3bb0Schristos #define QNT_STACK          3
784*889f3bb0Schristos #define QNT_GENERATOR      4
785*889f3bb0Schristos #define QNT_DEFAULT_LIB    5
786*889f3bb0Schristos #define QNT_CORE_SYSINFO   6
787*889f3bb0Schristos #define QNT_CORE_INFO      7
788*889f3bb0Schristos #define QNT_CORE_STATUS    8
789*889f3bb0Schristos #define QNT_CORE_GREG      9
790*889f3bb0Schristos #define QNT_CORE_FPREG     10
791*889f3bb0Schristos #define QNT_LINK_MAP       11
79298b9484cSchristos 
793924795e6Schristos /* Note segments for core files on Solaris systems.  Note name
794924795e6Schristos    must start with "CORE".  */
795924795e6Schristos #define SOLARIS_NT_PRSTATUS    1
796924795e6Schristos #define SOLARIS_NT_PRFPREG     2
797924795e6Schristos #define SOLARIS_NT_PRPSINFO    3
798924795e6Schristos #define SOLARIS_NT_PRXREG      4
799924795e6Schristos #define SOLARIS_NT_PLATFORM    5
800924795e6Schristos #define SOLARIS_NT_AUXV        6
801924795e6Schristos #define SOLARIS_NT_GWINDOWS    7
802924795e6Schristos #define SOLARIS_NT_ASRS        8
803924795e6Schristos #define SOLARIS_NT_LDT         9
804924795e6Schristos #define SOLARIS_NT_PSTATUS    10
805924795e6Schristos #define SOLARIS_NT_PSINFO     13
806924795e6Schristos #define SOLARIS_NT_PRCRED     14
807924795e6Schristos #define SOLARIS_NT_UTSNAME    15
808924795e6Schristos #define SOLARIS_NT_LWPSTATUS  16
809924795e6Schristos #define SOLARIS_NT_LWPSINFO   17
810924795e6Schristos #define SOLARIS_NT_PRPRIV     18
811924795e6Schristos #define SOLARIS_NT_PRPRIVINFO 19
812924795e6Schristos #define SOLARIS_NT_CONTENT    20
813924795e6Schristos #define SOLARIS_NT_ZONENAME   21
814924795e6Schristos #define SOLARIS_NT_PRCPUXREG  22
815924795e6Schristos 
81698b9484cSchristos /* Note segments for core files on SPU systems.  Note name
81798b9484cSchristos    must start with "SPU/".  */
81898b9484cSchristos 
81998b9484cSchristos #define NT_SPU		1
82098b9484cSchristos 
82198b9484cSchristos /* Values of note segment descriptor types for object files.  */
82298b9484cSchristos 
82398b9484cSchristos #define NT_VERSION	1		/* Contains a version string.  */
82498b9484cSchristos #define NT_ARCH		2		/* Contains an architecture string.  */
825924795e6Schristos #define NT_GO_BUILDID	4		/* Contains GO buildid data.  */
82698b9484cSchristos 
82798b9484cSchristos /* Values for notes in non-core files using name "GNU".  */
82898b9484cSchristos 
82998b9484cSchristos #define NT_GNU_ABI_TAG		1
83098b9484cSchristos #define NT_GNU_HWCAP		2	/* Used by ld.so and kernel vDSO.  */
83198b9484cSchristos #define NT_GNU_BUILD_ID		3	/* Generated by ld --build-id.  */
83298b9484cSchristos #define NT_GNU_GOLD_VERSION	4	/* Generated by gold.  */
8333b99ba0fSchristos #define NT_GNU_PROPERTY_TYPE_0  5	/* Generated by gcc.  */
8343b99ba0fSchristos 
8353b99ba0fSchristos #define NT_GNU_BUILD_ATTRIBUTE_OPEN	0x100
8363b99ba0fSchristos #define NT_GNU_BUILD_ATTRIBUTE_FUNC	0x101
8373b99ba0fSchristos 
8383b99ba0fSchristos #define GNU_BUILD_ATTRIBUTE_TYPE_NUMERIC	'*'
8393b99ba0fSchristos #define GNU_BUILD_ATTRIBUTE_TYPE_STRING		'$'
8403b99ba0fSchristos #define GNU_BUILD_ATTRIBUTE_TYPE_BOOL_TRUE	'+'
8413b99ba0fSchristos #define GNU_BUILD_ATTRIBUTE_TYPE_BOOL_FALSE	'!'
8423b99ba0fSchristos 
8433b99ba0fSchristos #define GNU_BUILD_ATTRIBUTE_VERSION	1
8443b99ba0fSchristos #define GNU_BUILD_ATTRIBUTE_STACK_PROT	2
8453b99ba0fSchristos #define GNU_BUILD_ATTRIBUTE_RELRO	3
8463b99ba0fSchristos #define GNU_BUILD_ATTRIBUTE_STACK_SIZE	4
8473b99ba0fSchristos #define GNU_BUILD_ATTRIBUTE_TOOL	5
8483b99ba0fSchristos #define GNU_BUILD_ATTRIBUTE_ABI		6
8493b99ba0fSchristos #define GNU_BUILD_ATTRIBUTE_PIC		7
8503b99ba0fSchristos #define GNU_BUILD_ATTRIBUTE_SHORT_ENUM	8
8513b99ba0fSchristos 
8523b99ba0fSchristos #define NOTE_GNU_PROPERTY_SECTION_NAME	".note.gnu.property"
8533b99ba0fSchristos #define GNU_BUILD_ATTRS_SECTION_NAME	".gnu.build.attributes"
8543b99ba0fSchristos 
8553b99ba0fSchristos /* Values used in GNU .note.gnu.property notes (NT_GNU_PROPERTY_TYPE_0).  */
8563b99ba0fSchristos #define GNU_PROPERTY_STACK_SIZE			1
8573b99ba0fSchristos #define GNU_PROPERTY_NO_COPY_ON_PROTECTED	2
8583b99ba0fSchristos 
859924795e6Schristos /* A 4-byte unsigned integer property: A bit is set if it is set in all
860924795e6Schristos    relocatable inputs.  */
861924795e6Schristos #define GNU_PROPERTY_UINT32_AND_LO	0xb0000000
862924795e6Schristos #define GNU_PROPERTY_UINT32_AND_HI	0xb0007fff
863924795e6Schristos 
864924795e6Schristos /* A 4-byte unsigned integer property: A bit is set if it is set in any
865924795e6Schristos    relocatable inputs.  */
866924795e6Schristos #define GNU_PROPERTY_UINT32_OR_LO	0xb0008000
867924795e6Schristos #define GNU_PROPERTY_UINT32_OR_HI	0xb000ffff
868924795e6Schristos 
869924795e6Schristos /* The needed properties by the object file.  */
870924795e6Schristos #define GNU_PROPERTY_1_NEEDED		GNU_PROPERTY_UINT32_OR_LO
871924795e6Schristos 
872924795e6Schristos /* Set if the object file requires canonical function pointers and
873924795e6Schristos    cannot be used with copy relocation.  */
874924795e6Schristos #define GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS	(1U << 0)
875924795e6Schristos 
8763b99ba0fSchristos /* Processor-specific semantics, lo */
8773b99ba0fSchristos #define GNU_PROPERTY_LOPROC  0xc0000000
8783b99ba0fSchristos /* Processor-specific semantics, hi */
8793b99ba0fSchristos #define GNU_PROPERTY_HIPROC  0xdfffffff
8803b99ba0fSchristos /* Application-specific semantics, lo */
8813b99ba0fSchristos #define GNU_PROPERTY_LOUSER  0xe0000000
8823b99ba0fSchristos /* Application-specific semantics, hi */
8833b99ba0fSchristos #define GNU_PROPERTY_HIUSER  0xffffffff
8843b99ba0fSchristos 
885314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_USED	0xc0000000
886314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_NEEDED	0xc0000001
8873b99ba0fSchristos 
888314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_486	(1U << 0)
889314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_586	(1U << 1)
890314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_686	(1U << 2)
891314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_SSE	(1U << 3)
892314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_SSE2	(1U << 4)
893314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_SSE3	(1U << 5)
894314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_SSSE3	(1U << 6)
895314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_SSE4_1	(1U << 7)
896314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_SSE4_2	(1U << 8)
897314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_AVX	(1U << 9)
898314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_AVX2	(1U << 10)
899314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512F	(1U << 11)
900314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512CD	(1U << 12)
901314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512ER	(1U << 13)
902314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512PF	(1U << 14)
903314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512VL	(1U << 15)
904314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512DQ	(1U << 16)
905314094e7Schristos #define GNU_PROPERTY_X86_COMPAT_ISA_1_AVX512BW	(1U << 17)
906314094e7Schristos 
907314094e7Schristos /* A 4-byte unsigned integer property: A bit is set if it is set in all
908314094e7Schristos    relocatable inputs.  */
909314094e7Schristos #define GNU_PROPERTY_X86_UINT32_AND_LO		0xc0000002
910314094e7Schristos #define GNU_PROPERTY_X86_UINT32_AND_HI		0xc0007fff
911314094e7Schristos 
912314094e7Schristos /* A 4-byte unsigned integer property: A bit is set if it is set in any
913314094e7Schristos    relocatable inputs.  */
914314094e7Schristos #define GNU_PROPERTY_X86_UINT32_OR_LO		0xc0008000
915314094e7Schristos #define GNU_PROPERTY_X86_UINT32_OR_HI		0xc000ffff
916314094e7Schristos 
917314094e7Schristos /* A 4-byte unsigned integer property: A bit is set if it is set in any
918314094e7Schristos    relocatable inputs and the property is present in all relocatable
919314094e7Schristos    inputs.  */
920314094e7Schristos #define GNU_PROPERTY_X86_UINT32_OR_AND_LO	0xc0010000
921314094e7Schristos #define GNU_PROPERTY_X86_UINT32_OR_AND_HI	0xc0017fff
922314094e7Schristos 
923314094e7Schristos #define GNU_PROPERTY_X86_FEATURE_1_AND \
924314094e7Schristos   (GNU_PROPERTY_X86_UINT32_AND_LO + 0)
925314094e7Schristos 
926314094e7Schristos #define GNU_PROPERTY_X86_ISA_1_NEEDED \
927924795e6Schristos   (GNU_PROPERTY_X86_UINT32_OR_LO + 2)
928314094e7Schristos #define GNU_PROPERTY_X86_FEATURE_2_NEEDED \
929314094e7Schristos   (GNU_PROPERTY_X86_UINT32_OR_LO + 1)
930314094e7Schristos 
931314094e7Schristos #define GNU_PROPERTY_X86_ISA_1_USED \
932924795e6Schristos   (GNU_PROPERTY_X86_UINT32_OR_AND_LO + 2)
933314094e7Schristos #define GNU_PROPERTY_X86_FEATURE_2_USED \
934314094e7Schristos   (GNU_PROPERTY_X86_UINT32_OR_AND_LO + 1)
935314094e7Schristos 
936924795e6Schristos /* GNU_PROPERTY_X86_ISA_1_BASELINE: CMOV, CX8 (cmpxchg8b), FPU (fld),
937924795e6Schristos    MMX, OSFXSR (fxsave), SCE (syscall), SSE and SSE2.  */
938924795e6Schristos #define GNU_PROPERTY_X86_ISA_1_BASELINE		(1U << 0)
939924795e6Schristos /* GNU_PROPERTY_X86_ISA_1_V2: GNU_PROPERTY_X86_ISA_1_BASELINE,
940924795e6Schristos    CMPXCHG16B (cmpxchg16b), LAHF-SAHF (lahf), POPCNT (popcnt), SSE3,
941924795e6Schristos    SSSE3, SSE4.1 and SSE4.2.  */
942924795e6Schristos #define GNU_PROPERTY_X86_ISA_1_V2		(1U << 1)
943924795e6Schristos /* GNU_PROPERTY_X86_ISA_1_V3: GNU_PROPERTY_X86_ISA_1_V2, AVX, AVX2, BMI1,
944924795e6Schristos    BMI2, F16C, FMA, LZCNT, MOVBE, XSAVE.  */
945924795e6Schristos #define GNU_PROPERTY_X86_ISA_1_V3		(1U << 2)
946924795e6Schristos /* GNU_PROPERTY_X86_ISA_1_V4: GNU_PROPERTY_X86_ISA_1_V3, AVX512F,
947924795e6Schristos    AVX512BW, AVX512CD, AVX512DQ and AVX512VL.  */
948924795e6Schristos #define GNU_PROPERTY_X86_ISA_1_V4		(1U << 3)
949924795e6Schristos 
950314094e7Schristos #define GNU_PROPERTY_X86_FEATURE_1_IBT		(1U << 0)
951314094e7Schristos #define GNU_PROPERTY_X86_FEATURE_1_SHSTK	(1U << 1)
952924795e6Schristos #define GNU_PROPERTY_X86_FEATURE_1_LAM_U48	(1U << 2)
953924795e6Schristos #define GNU_PROPERTY_X86_FEATURE_1_LAM_U57	(1U << 3)
954314094e7Schristos 
955314094e7Schristos #define GNU_PROPERTY_X86_FEATURE_2_X86		(1U << 0)
956314094e7Schristos #define GNU_PROPERTY_X86_FEATURE_2_X87		(1U << 1)
957314094e7Schristos #define GNU_PROPERTY_X86_FEATURE_2_MMX		(1U << 2)
958314094e7Schristos #define GNU_PROPERTY_X86_FEATURE_2_XMM		(1U << 3)
959314094e7Schristos #define GNU_PROPERTY_X86_FEATURE_2_YMM		(1U << 4)
960314094e7Schristos #define GNU_PROPERTY_X86_FEATURE_2_ZMM		(1U << 5)
961314094e7Schristos #define GNU_PROPERTY_X86_FEATURE_2_FXSR		(1U << 6)
962314094e7Schristos #define GNU_PROPERTY_X86_FEATURE_2_XSAVE	(1U << 7)
963314094e7Schristos #define GNU_PROPERTY_X86_FEATURE_2_XSAVEOPT	(1U << 8)
964314094e7Schristos #define GNU_PROPERTY_X86_FEATURE_2_XSAVEC	(1U << 9)
965db9b8011Schristos #define GNU_PROPERTY_X86_FEATURE_2_TMM		(1U << 10)
966924795e6Schristos #define GNU_PROPERTY_X86_FEATURE_2_MASK		(1U << 11)
967924795e6Schristos 
968924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_NEEDED \
969924795e6Schristos   (GNU_PROPERTY_X86_UINT32_OR_LO + 0)
970924795e6Schristos 
971924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_USED \
972924795e6Schristos   (GNU_PROPERTY_X86_UINT32_OR_AND_LO + 0)
973924795e6Schristos 
974924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_CMOV		(1U << 0)
975924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_SSE		(1U << 1)
976924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_SSE2		(1U << 2)
977924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_SSE3		(1U << 3)
978924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_SSSE3		(1U << 4)
979924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_SSE4_1		(1U << 5)
980924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_SSE4_2		(1U << 6)
981924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_AVX		(1U << 7)
982924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_AVX2		(1U << 8)
983924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_FMA		(1U << 9)
984924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_AVX512F		(1U << 10)
985924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_AVX512CD	(1U << 11)
986924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_AVX512ER	(1U << 12)
987924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_AVX512PF	(1U << 13)
988924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_AVX512VL	(1U << 14)
989924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_AVX512DQ	(1U << 15)
990924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_AVX512BW	(1U << 16)
991924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_AVX512_4FMAPS	(1U << 17)
992924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_AVX512_4VNNIW	(1U << 18)
993924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_AVX512_BITALG	(1U << 19)
994924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_AVX512_IFMA	(1U << 20)
995924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_AVX512_VBMI	(1U << 21)
996924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_AVX512_VBMI2	(1U << 22)
997924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_AVX512_VNNI	(1U << 23)
998924795e6Schristos #define GNU_PROPERTY_X86_COMPAT_2_ISA_1_AVX512_BF16	(1U << 24)
999db9b8011Schristos 
1000db9b8011Schristos /* AArch64 specific GNU PROPERTY.  */
1001db9b8011Schristos #define GNU_PROPERTY_AARCH64_FEATURE_1_AND	0xc0000000
1002db9b8011Schristos 
1003db9b8011Schristos #define GNU_PROPERTY_AARCH64_FEATURE_1_BTI	(1U << 0)
1004db9b8011Schristos #define GNU_PROPERTY_AARCH64_FEATURE_1_PAC	(1U << 1)
100598b9484cSchristos 
100698b9484cSchristos /* Values used in GNU .note.ABI-tag notes (NT_GNU_ABI_TAG).  */
100798b9484cSchristos #define GNU_ABI_TAG_LINUX	0
100898b9484cSchristos #define GNU_ABI_TAG_HURD	1
100998b9484cSchristos #define GNU_ABI_TAG_SOLARIS	2
101098b9484cSchristos #define GNU_ABI_TAG_FREEBSD	3
101198b9484cSchristos #define GNU_ABI_TAG_NETBSD	4
1012212397c6Schristos #define GNU_ABI_TAG_SYLLABLE	5
1013212397c6Schristos #define GNU_ABI_TAG_NACL	6
101498b9484cSchristos 
101598b9484cSchristos /* Values for NetBSD .note.netbsd.ident notes.  Note name is "NetBSD".  */
101698b9484cSchristos 
101798b9484cSchristos #define NT_NETBSD_IDENT		1
1018c358683dSchristos #define NT_NETBSD_MARCH		5
101998b9484cSchristos 
1020924795e6Schristos /* Values for NetBSD .note.netbsd.ident notes.  Note name is "PaX".  */
1021924795e6Schristos #define NT_NETBSD_PAX		3
1022924795e6Schristos #define NT_NETBSD_PAX_MPROTECT		0x01	/* Force enable Mprotect.  */
1023924795e6Schristos #define NT_NETBSD_PAX_NOMPROTECT	0x02	/* Force disable Mprotect.  */
1024924795e6Schristos #define NT_NETBSD_PAX_GUARD		0x04	/* Force enable Segvguard.  */
1025924795e6Schristos #define NT_NETBSD_PAX_NOGUARD		0x08	/* Force disable Segvguard.  */
1026924795e6Schristos #define NT_NETBSD_PAX_ASLR		0x10	/* Force enable ASLR.  */
1027924795e6Schristos #define NT_NETBSD_PAX_NOASLR		0x20	/* Force disable ASLR.  */
1028924795e6Schristos 
102998b9484cSchristos /* Values for OpenBSD .note.openbsd.ident notes.  Note name is "OpenBSD".  */
103098b9484cSchristos 
103198b9484cSchristos #define NT_OPENBSD_IDENT	1
103298b9484cSchristos 
103398b9484cSchristos /* Values for FreeBSD .note.ABI-tag notes.  Note name is "FreeBSD".  */
103498b9484cSchristos 
103598b9484cSchristos #define NT_FREEBSD_ABI_TAG	1
103698b9484cSchristos 
1037924795e6Schristos /* Values for FDO .note.package notes as defined on https://systemd.io/COREDUMP_PACKAGE_METADATA/  */
1038924795e6Schristos #define FDO_PACKAGING_METADATA	0xcafe1a7e
1039924795e6Schristos 
1040*889f3bb0Schristos /* Values for FDO .note.dlopen notes as defined on https://systemd.io/ELF_DLOPEN_METADATA/  */
1041*889f3bb0Schristos #define FDO_DLOPEN_METADATA 0x407c0c0a
1042*889f3bb0Schristos 
104398b9484cSchristos /* These three macros disassemble and assemble a symbol table st_info field,
104498b9484cSchristos    which contains the symbol binding and symbol type.  The STB_ and STT_
104598b9484cSchristos    defines identify the binding and type.  */
104698b9484cSchristos 
104798b9484cSchristos #define ELF_ST_BIND(val)		(((unsigned int)(val)) >> 4)
104898b9484cSchristos #define ELF_ST_TYPE(val)		((val) & 0xF)
104998b9484cSchristos #define ELF_ST_INFO(bind,type)		(((bind) << 4) + ((type) & 0xF))
105098b9484cSchristos 
105198b9484cSchristos /* The 64bit and 32bit versions of these macros are identical, but
105298b9484cSchristos    the ELF spec defines them, so here they are.  */
105398b9484cSchristos #define ELF32_ST_BIND  ELF_ST_BIND
105498b9484cSchristos #define ELF32_ST_TYPE  ELF_ST_TYPE
105598b9484cSchristos #define ELF32_ST_INFO  ELF_ST_INFO
105698b9484cSchristos #define ELF64_ST_BIND  ELF_ST_BIND
105798b9484cSchristos #define ELF64_ST_TYPE  ELF_ST_TYPE
105898b9484cSchristos #define ELF64_ST_INFO  ELF_ST_INFO
105998b9484cSchristos 
106098b9484cSchristos /* This macro disassembles and assembles a symbol's visibility into
106198b9484cSchristos    the st_other field.  The STV_ defines specify the actual visibility.  */
106298b9484cSchristos 
106398b9484cSchristos #define ELF_ST_VISIBILITY(v)		((v) & 0x3)
106498b9484cSchristos /* The remaining bits in the st_other field are not currently used.
106598b9484cSchristos    They should be set to zero.  */
106698b9484cSchristos 
106798b9484cSchristos #define ELF32_ST_VISIBILITY  ELF_ST_VISIBILITY
106898b9484cSchristos #define ELF64_ST_VISIBILITY  ELF_ST_VISIBILITY
106998b9484cSchristos 
107098b9484cSchristos 
107198b9484cSchristos #define STN_UNDEF	0		/* Undefined symbol index */
107298b9484cSchristos 
107398b9484cSchristos #define STB_LOCAL	0		/* Symbol not visible outside obj */
107498b9484cSchristos #define STB_GLOBAL	1		/* Symbol visible outside obj */
107598b9484cSchristos #define STB_WEAK	2		/* Like globals, lower precedence */
107698b9484cSchristos #define STB_LOOS	10		/* OS-specific semantics */
107798b9484cSchristos #define STB_GNU_UNIQUE	10		/* Symbol is unique in namespace */
107898b9484cSchristos #define STB_HIOS	12		/* OS-specific semantics */
107998b9484cSchristos #define STB_LOPROC	13		/* Processor-specific semantics */
108098b9484cSchristos #define STB_HIPROC	15		/* Processor-specific semantics */
108198b9484cSchristos 
108298b9484cSchristos #define STT_NOTYPE	0		/* Symbol type is unspecified */
108398b9484cSchristos #define STT_OBJECT	1		/* Symbol is a data object */
108498b9484cSchristos #define STT_FUNC	2		/* Symbol is a code object */
108598b9484cSchristos #define STT_SECTION	3		/* Symbol associated with a section */
108698b9484cSchristos #define STT_FILE	4		/* Symbol gives a file name */
108798b9484cSchristos #define STT_COMMON	5		/* An uninitialised common block */
108898b9484cSchristos #define STT_TLS		6		/* Thread local data object */
108998b9484cSchristos #define STT_RELC	8		/* Complex relocation expression */
109098b9484cSchristos #define STT_SRELC	9		/* Signed Complex relocation expression */
109198b9484cSchristos #define STT_LOOS	10		/* OS-specific semantics */
109298b9484cSchristos #define STT_GNU_IFUNC	10		/* Symbol is an indirect code object */
109398b9484cSchristos #define STT_HIOS	12		/* OS-specific semantics */
109498b9484cSchristos #define STT_LOPROC	13		/* Processor-specific semantics */
109598b9484cSchristos #define STT_HIPROC	15		/* Processor-specific semantics */
109698b9484cSchristos 
109798b9484cSchristos /* The following constants control how a symbol may be accessed once it has
109898b9484cSchristos    become part of an executable or shared library.  */
109998b9484cSchristos 
110098b9484cSchristos #define STV_DEFAULT	0		/* Visibility is specified by binding type */
110198b9484cSchristos #define STV_INTERNAL	1		/* OS specific version of STV_HIDDEN */
110298b9484cSchristos #define STV_HIDDEN	2		/* Can only be seen inside currect component */
110398b9484cSchristos #define STV_PROTECTED	3		/* Treat as STB_LOCAL inside current component */
110498b9484cSchristos 
110598b9484cSchristos /* Relocation info handling macros.  */
110698b9484cSchristos 
110798b9484cSchristos #define ELF32_R_SYM(i)		((i) >> 8)
110898b9484cSchristos #define ELF32_R_TYPE(i)		((i) & 0xff)
1109db9b8011Schristos #define ELF32_R_INFO(s,t)	(((unsigned) (s) << 8) + ((t) & 0xff))
111098b9484cSchristos 
111198b9484cSchristos #define ELF64_R_SYM(i)		((i) >> 32)
111298b9484cSchristos #define ELF64_R_TYPE(i)		((i) & 0xffffffff)
111398b9484cSchristos #define ELF64_R_INFO(s,t)	(((bfd_vma) (s) << 31 << 1) + (bfd_vma) (t))
111498b9484cSchristos 
111598b9484cSchristos /* Dynamic section tags.  */
111698b9484cSchristos 
111798b9484cSchristos #define DT_NULL		0
111898b9484cSchristos #define DT_NEEDED	1
111998b9484cSchristos #define DT_PLTRELSZ	2
112098b9484cSchristos #define DT_PLTGOT	3
112198b9484cSchristos #define DT_HASH		4
112298b9484cSchristos #define DT_STRTAB	5
112398b9484cSchristos #define DT_SYMTAB	6
112498b9484cSchristos #define DT_RELA		7
112598b9484cSchristos #define DT_RELASZ	8
112698b9484cSchristos #define DT_RELAENT	9
112798b9484cSchristos #define DT_STRSZ	10
112898b9484cSchristos #define DT_SYMENT	11
112998b9484cSchristos #define DT_INIT		12
113098b9484cSchristos #define DT_FINI		13
113198b9484cSchristos #define DT_SONAME	14
113298b9484cSchristos #define DT_RPATH	15
113398b9484cSchristos #define DT_SYMBOLIC	16
113498b9484cSchristos #define DT_REL		17
113598b9484cSchristos #define DT_RELSZ	18
113698b9484cSchristos #define DT_RELENT	19
113798b9484cSchristos #define DT_PLTREL	20
113898b9484cSchristos #define DT_DEBUG	21
113998b9484cSchristos #define DT_TEXTREL	22
114098b9484cSchristos #define DT_JMPREL	23
114198b9484cSchristos #define DT_BIND_NOW	24
114298b9484cSchristos #define DT_INIT_ARRAY	25
114398b9484cSchristos #define DT_FINI_ARRAY	26
114498b9484cSchristos #define DT_INIT_ARRAYSZ 27
114598b9484cSchristos #define DT_FINI_ARRAYSZ 28
114698b9484cSchristos #define DT_RUNPATH	29
114798b9484cSchristos #define DT_FLAGS	30
1148*889f3bb0Schristos 
1149*889f3bb0Schristos /* Values in the range [DT_ENCODING, DT_LOOS) use d_un.d_ptr if the
1150*889f3bb0Schristos    value is even, d_un.d_val if odd.  */
1151*889f3bb0Schristos #define DT_ENCODING	32
115298b9484cSchristos #define DT_PREINIT_ARRAY   32
115398b9484cSchristos #define DT_PREINIT_ARRAYSZ 33
11543b99ba0fSchristos #define DT_SYMTAB_SHNDX    34
1155924795e6Schristos #define DT_RELRSZ	35
1156924795e6Schristos #define DT_RELR		36
1157924795e6Schristos #define DT_RELRENT	37
115898b9484cSchristos 
115998b9484cSchristos /* Note, the Oct 4, 1999 draft of the ELF ABI changed the values
116098b9484cSchristos    for DT_LOOS and DT_HIOS.  Some implementations however, use
116198b9484cSchristos    values outside of the new range (see below).	 */
116298b9484cSchristos #define OLD_DT_LOOS	0x60000000
116398b9484cSchristos #define DT_LOOS		0x6000000d
116498b9484cSchristos #define DT_HIOS		0x6ffff000
116598b9484cSchristos #define OLD_DT_HIOS	0x6fffffff
116698b9484cSchristos 
116798b9484cSchristos #define DT_LOPROC	0x70000000
116898b9484cSchristos #define DT_HIPROC	0x7fffffff
116998b9484cSchristos 
117098b9484cSchristos /* The next 2 dynamic tag ranges, integer value range (DT_VALRNGLO to
117198b9484cSchristos    DT_VALRNGHI) and virtual address range (DT_ADDRRNGLO to DT_ADDRRNGHI),
117298b9484cSchristos    are used on Solaris.  We support them everywhere.  Note these values
117398b9484cSchristos    lie outside of the (new) range for OS specific values.  This is a
117498b9484cSchristos    deliberate special case and we maintain it for backwards compatability.
117598b9484cSchristos  */
117698b9484cSchristos #define DT_VALRNGLO	0x6ffffd00
1177924795e6Schristos #define DT_GNU_FLAGS_1  0x6ffffdf4
117898b9484cSchristos #define DT_GNU_PRELINKED 0x6ffffdf5
117998b9484cSchristos #define DT_GNU_CONFLICTSZ 0x6ffffdf6
118098b9484cSchristos #define DT_GNU_LIBLISTSZ 0x6ffffdf7
118198b9484cSchristos #define DT_CHECKSUM	0x6ffffdf8
118298b9484cSchristos #define DT_PLTPADSZ	0x6ffffdf9
118398b9484cSchristos #define DT_MOVEENT	0x6ffffdfa
118498b9484cSchristos #define DT_MOVESZ	0x6ffffdfb
118598b9484cSchristos #define DT_FEATURE	0x6ffffdfc
118698b9484cSchristos #define DT_POSFLAG_1	0x6ffffdfd
118798b9484cSchristos #define DT_SYMINSZ	0x6ffffdfe
118898b9484cSchristos #define DT_SYMINENT	0x6ffffdff
118998b9484cSchristos #define DT_VALRNGHI	0x6ffffdff
119098b9484cSchristos 
119198b9484cSchristos #define DT_ADDRRNGLO	0x6ffffe00
119298b9484cSchristos #define DT_GNU_HASH	0x6ffffef5
119398b9484cSchristos #define DT_TLSDESC_PLT	0x6ffffef6
119498b9484cSchristos #define DT_TLSDESC_GOT	0x6ffffef7
119598b9484cSchristos #define DT_GNU_CONFLICT	0x6ffffef8
119698b9484cSchristos #define DT_GNU_LIBLIST	0x6ffffef9
119798b9484cSchristos #define DT_CONFIG	0x6ffffefa
119898b9484cSchristos #define DT_DEPAUDIT	0x6ffffefb
119998b9484cSchristos #define DT_AUDIT	0x6ffffefc
120098b9484cSchristos #define DT_PLTPAD	0x6ffffefd
120198b9484cSchristos #define DT_MOVETAB	0x6ffffefe
120298b9484cSchristos #define DT_SYMINFO	0x6ffffeff
120398b9484cSchristos #define DT_ADDRRNGHI	0x6ffffeff
120498b9484cSchristos 
120598b9484cSchristos #define DT_RELACOUNT	0x6ffffff9
120698b9484cSchristos #define DT_RELCOUNT	0x6ffffffa
120798b9484cSchristos #define DT_FLAGS_1	0x6ffffffb
120898b9484cSchristos #define DT_VERDEF	0x6ffffffc
120998b9484cSchristos #define DT_VERDEFNUM	0x6ffffffd
121098b9484cSchristos #define DT_VERNEED	0x6ffffffe
121198b9484cSchristos #define DT_VERNEEDNUM	0x6fffffff
121298b9484cSchristos 
121398b9484cSchristos /* This tag is a GNU extension to the Solaris version scheme.  */
121498b9484cSchristos #define DT_VERSYM	0x6ffffff0
121598b9484cSchristos 
121698b9484cSchristos #define DT_LOPROC	0x70000000
121798b9484cSchristos #define DT_HIPROC	0x7fffffff
121898b9484cSchristos 
121998b9484cSchristos /* These section tags are used on Solaris.  We support them
122098b9484cSchristos    everywhere, and hope they do not conflict.  */
122198b9484cSchristos 
122298b9484cSchristos #define DT_AUXILIARY	0x7ffffffd
122398b9484cSchristos #define DT_USED		0x7ffffffe
122498b9484cSchristos #define DT_FILTER	0x7fffffff
122598b9484cSchristos 
122698b9484cSchristos 
122798b9484cSchristos /* Values used in DT_FEATURE .dynamic entry.  */
122898b9484cSchristos #define DTF_1_PARINIT	0x00000001
122998b9484cSchristos /* From
123098b9484cSchristos 
123198b9484cSchristos    http://docs.sun.com:80/ab2/coll.45.13/LLM/@Ab2PageView/21165?Ab2Lang=C&Ab2Enc=iso-8859-1
123298b9484cSchristos 
123398b9484cSchristos    DTF_1_CONFEXP is the same as DTF_1_PARINIT. It is a typo. The value
123498b9484cSchristos    defined here is the same as the one in <sys/link.h> on Solaris 8.  */
123598b9484cSchristos #define DTF_1_CONFEXP	0x00000002
123698b9484cSchristos 
123798b9484cSchristos /* Flag values used in the DT_POSFLAG_1 .dynamic entry.	 */
123898b9484cSchristos #define DF_P1_LAZYLOAD	0x00000001
123998b9484cSchristos #define DF_P1_GROUPPERM	0x00000002
124098b9484cSchristos 
1241924795e6Schristos /* Flag value in the DT_GNU_FLAGS_1 /dynamic entry.  */
1242924795e6Schristos #define DF_GNU_1_UNIQUE 0x00000001
1243924795e6Schristos 
124498b9484cSchristos /* Flag value in in the DT_FLAGS_1 .dynamic entry.  */
124598b9484cSchristos #define DF_1_NOW	0x00000001
124698b9484cSchristos #define DF_1_GLOBAL	0x00000002
124798b9484cSchristos #define DF_1_GROUP	0x00000004
124898b9484cSchristos #define DF_1_NODELETE	0x00000008
124998b9484cSchristos #define DF_1_LOADFLTR	0x00000010
125098b9484cSchristos #define DF_1_INITFIRST	0x00000020
125198b9484cSchristos #define DF_1_NOOPEN	0x00000040
125298b9484cSchristos #define DF_1_ORIGIN	0x00000080
125398b9484cSchristos #define DF_1_DIRECT	0x00000100
125498b9484cSchristos #define DF_1_TRANS	0x00000200
125598b9484cSchristos #define DF_1_INTERPOSE	0x00000400
125698b9484cSchristos #define DF_1_NODEFLIB	0x00000800
125798b9484cSchristos #define DF_1_NODUMP	0x00001000
1258a2e2270fSchristos #define DF_1_CONFALT	0x00002000
1259a2e2270fSchristos #define DF_1_ENDFILTEE	0x00004000
1260a2e2270fSchristos #define	DF_1_DISPRELDNE	0x00008000
1261a2e2270fSchristos #define	DF_1_DISPRELPND	0x00010000
1262a2e2270fSchristos #define	DF_1_NODIRECT	0x00020000
1263a2e2270fSchristos #define	DF_1_IGNMULDEF	0x00040000
1264a2e2270fSchristos #define	DF_1_NOKSYMS	0x00080000
1265a2e2270fSchristos #define	DF_1_NOHDR	0x00100000
1266a2e2270fSchristos #define	DF_1_EDITED	0x00200000
1267a2e2270fSchristos #define	DF_1_NORELOC	0x00400000
1268a2e2270fSchristos #define	DF_1_SYMINTPOSE	0x00800000
1269a2e2270fSchristos #define	DF_1_GLOBAUDIT	0x01000000
1270a2e2270fSchristos #define	DF_1_SINGLETON	0x02000000
1271c358683dSchristos #define	DF_1_STUB	0x04000000
1272c358683dSchristos #define	DF_1_PIE	0x08000000
1273314094e7Schristos #define	DF_1_KMOD	0x10000000
1274314094e7Schristos #define	DF_1_WEAKFILTER	0x20000000
1275314094e7Schristos #define	DF_1_NOCOMMON	0x40000000
127698b9484cSchristos 
127798b9484cSchristos /* Flag values for the DT_FLAGS entry.	*/
127898b9484cSchristos #define DF_ORIGIN	(1 << 0)
127998b9484cSchristos #define DF_SYMBOLIC	(1 << 1)
128098b9484cSchristos #define DF_TEXTREL	(1 << 2)
128198b9484cSchristos #define DF_BIND_NOW	(1 << 3)
128298b9484cSchristos #define DF_STATIC_TLS	(1 << 4)
128398b9484cSchristos 
128498b9484cSchristos /* These constants are used for the version number of a Elf32_Verdef
128598b9484cSchristos    structure.  */
128698b9484cSchristos 
128798b9484cSchristos #define VER_DEF_NONE		0
128898b9484cSchristos #define VER_DEF_CURRENT		1
128998b9484cSchristos 
129098b9484cSchristos /* These constants appear in the vd_flags field of a Elf32_Verdef
129198b9484cSchristos    structure.
129298b9484cSchristos 
129398b9484cSchristos    Cf. the Solaris Linker and Libraries Guide, Ch. 7, Object File Format,
129498b9484cSchristos    Versioning Sections, for a description:
129598b9484cSchristos 
129698b9484cSchristos    http://docs.sun.com/app/docs/doc/819-0690/chapter6-93046?l=en&a=view  */
129798b9484cSchristos 
129898b9484cSchristos #define VER_FLG_BASE		0x1
129998b9484cSchristos #define VER_FLG_WEAK		0x2
130098b9484cSchristos #define VER_FLG_INFO		0x4
130198b9484cSchristos 
130298b9484cSchristos /* These special constants can be found in an Elf32_Versym field.  */
130398b9484cSchristos 
130498b9484cSchristos #define VER_NDX_LOCAL		0
130598b9484cSchristos #define VER_NDX_GLOBAL		1
130698b9484cSchristos 
130798b9484cSchristos /* These constants are used for the version number of a Elf32_Verneed
130898b9484cSchristos    structure.  */
130998b9484cSchristos 
131098b9484cSchristos #define VER_NEED_NONE		0
131198b9484cSchristos #define VER_NEED_CURRENT	1
131298b9484cSchristos 
131398b9484cSchristos /* This flag appears in a Versym structure.  It means that the symbol
131498b9484cSchristos    is hidden, and is only visible with an explicit version number.
131598b9484cSchristos    This is a GNU extension.  */
131698b9484cSchristos 
131798b9484cSchristos #define VERSYM_HIDDEN		0x8000
131898b9484cSchristos 
131998b9484cSchristos /* This is the mask for the rest of the Versym information.  */
132098b9484cSchristos 
132198b9484cSchristos #define VERSYM_VERSION		0x7fff
132298b9484cSchristos 
132398b9484cSchristos /* This is a special token which appears as part of a symbol name.  It
132498b9484cSchristos    indictes that the rest of the name is actually the name of a
132598b9484cSchristos    version node, and is not part of the actual name.  This is a GNU
132698b9484cSchristos    extension.  For example, the symbol name `stat@ver2' is taken to
132798b9484cSchristos    mean the symbol `stat' in version `ver2'.  */
132898b9484cSchristos 
132998b9484cSchristos #define ELF_VER_CHR	'@'
133098b9484cSchristos 
133198b9484cSchristos /* Possible values for si_boundto.  */
133298b9484cSchristos 
133398b9484cSchristos #define SYMINFO_BT_SELF		0xffff	/* Symbol bound to self */
133498b9484cSchristos #define SYMINFO_BT_PARENT	0xfffe	/* Symbol bound to parent */
133598b9484cSchristos #define SYMINFO_BT_LOWRESERVE	0xff00	/* Beginning of reserved entries */
133698b9484cSchristos 
133798b9484cSchristos /* Possible bitmasks for si_flags.  */
133898b9484cSchristos 
133998b9484cSchristos #define SYMINFO_FLG_DIRECT	0x0001	/* Direct bound symbol */
134098b9484cSchristos #define SYMINFO_FLG_PASSTHRU	0x0002	/* Pass-thru symbol for translator */
134198b9484cSchristos #define SYMINFO_FLG_COPY	0x0004	/* Symbol is a copy-reloc */
134298b9484cSchristos #define SYMINFO_FLG_LAZYLOAD	0x0008	/* Symbol bound to object to be lazy loaded */
134398b9484cSchristos 
134498b9484cSchristos /* Syminfo version values.  */
134598b9484cSchristos 
134698b9484cSchristos #define SYMINFO_NONE		0
134798b9484cSchristos #define SYMINFO_CURRENT		1
134898b9484cSchristos #define SYMINFO_NUM		2
134998b9484cSchristos 
135098b9484cSchristos /* Section Group Flags.	 */
135198b9484cSchristos 
135298b9484cSchristos #define GRP_COMDAT		0x1	/* A COMDAT group */
13533b99ba0fSchristos #define GRP_MASKOS 	 0x0ff00000	/* Bits in this range reserved for OS specific use.  */
13543b99ba0fSchristos #define GRP_MASKPROC 	 0xf0000000	/* Bits in this range reserved for processor use.  */
135598b9484cSchristos 
135698b9484cSchristos /* Auxv a_type values.  */
135798b9484cSchristos 
135898b9484cSchristos #define AT_NULL		0		/* End of vector */
135998b9484cSchristos #define AT_IGNORE	1		/* Entry should be ignored */
136098b9484cSchristos #define AT_EXECFD	2		/* File descriptor of program */
136198b9484cSchristos #define AT_PHDR		3		/* Program headers for program */
136298b9484cSchristos #define AT_PHENT	4		/* Size of program header entry */
136398b9484cSchristos #define AT_PHNUM	5		/* Number of program headers */
136498b9484cSchristos #define AT_PAGESZ	6		/* System page size */
136598b9484cSchristos #define AT_BASE		7		/* Base address of interpreter */
136698b9484cSchristos #define AT_FLAGS	8		/* Flags */
136798b9484cSchristos #define AT_ENTRY	9		/* Entry point of program */
136898b9484cSchristos #define AT_NOTELF	10		/* Program is not ELF */
136998b9484cSchristos #define AT_UID		11		/* Real uid */
137098b9484cSchristos #define AT_EUID		12		/* Effective uid */
137198b9484cSchristos #define AT_GID		13		/* Real gid */
137298b9484cSchristos #define AT_EGID		14		/* Effective gid */
137398b9484cSchristos #define AT_CLKTCK	17		/* Frequency of times() */
137498b9484cSchristos #define AT_PLATFORM	15		/* String identifying platform.  */
137598b9484cSchristos #define AT_HWCAP	16		/* Machine dependent hints about
137698b9484cSchristos 					   processor capabilities.  */
137798b9484cSchristos #define AT_FPUCW	18		/* Used FPU control word.  */
137898b9484cSchristos #define AT_DCACHEBSIZE	19		/* Data cache block size.  */
137998b9484cSchristos #define AT_ICACHEBSIZE	20		/* Instruction cache block size.  */
138098b9484cSchristos #define AT_UCACHEBSIZE	21		/* Unified cache block size.  */
138198b9484cSchristos #define AT_IGNOREPPC	22		/* Entry should be ignored */
138298b9484cSchristos #define	AT_SECURE	23		/* Boolean, was exec setuid-like?  */
138398b9484cSchristos #define AT_BASE_PLATFORM 24		/* String identifying real platform,
138498b9484cSchristos 					   may differ from AT_PLATFORM.  */
138598b9484cSchristos #define AT_RANDOM	25		/* Address of 16 random bytes.  */
1386968cf8f2Schristos #define AT_HWCAP2	26		/* Extension of AT_HWCAP.  */
1387*889f3bb0Schristos #define AT_RSEQ_FEATURE_SIZE	27	/* rseq supported feature size */
1388*889f3bb0Schristos #define AT_RSEQ_ALIGN	28		/* rseq allocation alignment */
138998b9484cSchristos #define AT_EXECFN	31		/* Filename of executable.  */
139098b9484cSchristos /* Pointer to the global system page used for system calls and other
139198b9484cSchristos    nice things.  */
139298b9484cSchristos #define AT_SYSINFO	32
139398b9484cSchristos #define AT_SYSINFO_EHDR	33 /* Pointer to ELF header of system-supplied DSO.  */
139498b9484cSchristos 
1395a2e2270fSchristos /* More complete cache descriptions than AT_[DIU]CACHEBSIZE.  If the
1396a2e2270fSchristos    value is -1, then the cache doesn't exist.  Otherwise:
1397a2e2270fSchristos 
1398a2e2270fSchristos    bit 0-3:  Cache set-associativity; 0 means fully associative.
1399a2e2270fSchristos    bit 4-7:  Log2 of cacheline size.
1400a2e2270fSchristos    bit 8-31:  Size of the entire cache >> 8.  */
1401a2e2270fSchristos 
1402a2e2270fSchristos #define AT_L1I_CACHESHAPE 34
1403a2e2270fSchristos #define AT_L1D_CACHESHAPE 35
1404a2e2270fSchristos #define AT_L2_CACHESHAPE  36
1405a2e2270fSchristos #define AT_L3_CACHESHAPE  37
1406a2e2270fSchristos 
1407db9b8011Schristos /* Shapes of the caches, with more room to describe them.
1408db9b8011Schristos    *GEOMETRY are comprised of cache line size in bytes in the bottom 16 bits
1409db9b8011Schristos    and the cache associativity in the next 16 bits.  */
1410db9b8011Schristos #define AT_L1I_CACHESIZE	40
1411db9b8011Schristos #define AT_L1I_CACHEGEOMETRY	41
1412db9b8011Schristos #define AT_L1D_CACHESIZE	42
1413db9b8011Schristos #define AT_L1D_CACHEGEOMETRY	43
1414db9b8011Schristos #define AT_L2_CACHESIZE		44
1415db9b8011Schristos #define AT_L2_CACHEGEOMETRY	45
1416db9b8011Schristos #define AT_L3_CACHESIZE		46
1417db9b8011Schristos #define AT_L3_CACHEGEOMETRY	47
1418db9b8011Schristos 
1419db9b8011Schristos #define AT_MINSIGSTKSZ		51 /* Stack needed for signal delivery
1420db9b8011Schristos 				      (AArch64).  */
1421db9b8011Schristos 
1422c358683dSchristos #define AT_FREEBSD_EXECPATH     15      /* Path to the executable. */
1423c358683dSchristos #define AT_FREEBSD_CANARY       16      /* Canary for SSP. */
1424c358683dSchristos #define AT_FREEBSD_CANARYLEN    17      /* Length of the canary. */
1425c358683dSchristos #define AT_FREEBSD_OSRELDATE    18      /* OSRELDATE. */
1426c358683dSchristos #define AT_FREEBSD_NCPUS        19      /* Number of CPUs. */
1427c358683dSchristos #define AT_FREEBSD_PAGESIZES    20      /* Pagesizes. */
1428c358683dSchristos #define AT_FREEBSD_PAGESIZESLEN 21      /* Number of pagesizes. */
1429c358683dSchristos #define AT_FREEBSD_TIMEKEEP     22      /* Pointer to timehands. */
1430c358683dSchristos #define AT_FREEBSD_STACKPROT    23      /* Initial stack protection. */
1431314094e7Schristos #define AT_FREEBSD_EHDRFLAGS    24      /* e_flags field from ELF header. */
1432314094e7Schristos #define AT_FREEBSD_HWCAP        25      /* CPU feature flags. */
1433314094e7Schristos #define AT_FREEBSD_HWCAP2       26      /* CPU feature flags 2. */
1434db9b8011Schristos #define AT_FREEBSD_BSDFLAGS     27      /* ELF BSD Flags. */
1435db9b8011Schristos #define AT_FREEBSD_ARGC         28      /* Argument count. */
1436db9b8011Schristos #define AT_FREEBSD_ARGV         29      /* Argument vector. */
1437db9b8011Schristos #define AT_FREEBSD_ENVC         30      /* Environment count. */
1438db9b8011Schristos #define AT_FREEBSD_ENVV         31      /* Environment vvector. */
1439db9b8011Schristos #define AT_FREEBSD_PS_STRINGS   32      /* struct ps_strings. */
1440924795e6Schristos #define AT_FREEBSD_FXRNG        33      /* Pointer to root RNG seed version. */
1441924795e6Schristos #define AT_FREEBSD_KPRELOAD     34      /* Base of vdso. */
1442924795e6Schristos #define AT_FREEBSD_USRSTACKBASE 35      /* Top of user stack. */
1443924795e6Schristos #define AT_FREEBSD_USRSTACKLIM  36      /* Grow limit of user stack. */
1444c358683dSchristos 
14453d052782Srin #define AT_NETBSD_STACKBASE     13      /* Base address of the main thread. */
14463d052782Srin 
144798b9484cSchristos #define AT_SUN_UID      2000    /* Effective user ID.  */
144898b9484cSchristos #define AT_SUN_RUID     2001    /* Real user ID.  */
144998b9484cSchristos #define AT_SUN_GID      2002    /* Effective group ID.  */
145098b9484cSchristos #define AT_SUN_RGID     2003    /* Real group ID.  */
145198b9484cSchristos #define AT_SUN_LDELF    2004    /* Dynamic linker's ELF header.  */
145298b9484cSchristos #define AT_SUN_LDSHDR   2005    /* Dynamic linker's section headers.  */
145398b9484cSchristos #define AT_SUN_LDNAME   2006    /* String giving name of dynamic linker.  */
145498b9484cSchristos #define AT_SUN_LPAGESZ  2007    /* Large pagesize.   */
145598b9484cSchristos #define AT_SUN_PLATFORM 2008    /* Platform name string.  */
1456314094e7Schristos #define AT_SUN_CAP_HW1	2009	/* Machine dependent hints about
145798b9484cSchristos 				   processor capabilities.  */
1458924795e6Schristos #ifndef AT_SUN_HWCAP
1459314094e7Schristos #define AT_SUN_HWCAP	AT_SUN_CAP_HW1 /* For backward compat only.  */
1460924795e6Schristos #endif
146198b9484cSchristos #define AT_SUN_IFLUSH   2010    /* Should flush icache? */
146298b9484cSchristos #define AT_SUN_CPU      2011    /* CPU name string.  */
146398b9484cSchristos #define AT_SUN_EMUL_ENTRY 2012	/* COFF entry point address.  */
146498b9484cSchristos #define AT_SUN_EMUL_EXECFD 2013	/* COFF executable file descriptor.  */
146598b9484cSchristos #define AT_SUN_EXECNAME 2014    /* Canonicalized file name given to execve.  */
146698b9484cSchristos #define AT_SUN_MMU      2015    /* String for name of MMU module.   */
146798b9484cSchristos #define AT_SUN_LDDATA   2016    /* Dynamic linker's data segment address.  */
146898b9484cSchristos #define AT_SUN_AUXFLAGS	2017	/* AF_SUN_ flags passed from the kernel.  */
1469314094e7Schristos #define	AT_SUN_EMULATOR	2018	/* Name of emulation binary for runtime
1470314094e7Schristos 				   linker.  */
1471314094e7Schristos #define	AT_SUN_BRANDNAME 2019	/* Name of brand library.  */
1472314094e7Schristos #define	AT_SUN_BRAND_AUX1 2020	/* Aux vectors for brand modules.  */
1473314094e7Schristos #define	AT_SUN_BRAND_AUX2 2021
1474314094e7Schristos #define	AT_SUN_BRAND_AUX3 2022
1475314094e7Schristos #define	AT_SUN_CAP_HW2	2023	/* Extension of AT_SUN_CAP_HW1.  */
147698b9484cSchristos 
147798b9484cSchristos #endif /* _ELF_COMMON_H */
1478