xref: /netbsd-src/external/gpl3/gdb/dist/include/elf/hppa.h (revision e663ba6e3a60083e70de702e9d54bf486a57b6a7)
198b9484cSchristos /* HPPA ELF support for BFD.
2*e663ba6eSchristos    Copyright (C) 1993-2024 Free Software Foundation, Inc.
398b9484cSchristos 
498b9484cSchristos    This file is part of BFD, the Binary File Descriptor library.
598b9484cSchristos 
698b9484cSchristos    This program is free software; you can redistribute it and/or modify
798b9484cSchristos    it under the terms of the GNU General Public License as published by
898b9484cSchristos    the Free Software Foundation; either version 3 of the License, or
998b9484cSchristos    (at your option) any later version.
1098b9484cSchristos 
1198b9484cSchristos    This program is distributed in the hope that it will be useful,
1298b9484cSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
1398b9484cSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1498b9484cSchristos    GNU General Public License for more details.
1598b9484cSchristos 
1698b9484cSchristos    You should have received a copy of the GNU General Public License
1798b9484cSchristos    along with this program; if not, write to the Free Software
1898b9484cSchristos    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
1998b9484cSchristos    MA 02110-1301, USA.  */
2098b9484cSchristos 
2198b9484cSchristos /* This file holds definitions specific to the HPPA ELF ABI.  Note
2298b9484cSchristos    that most of this is not actually implemented by BFD.  */
2398b9484cSchristos 
2498b9484cSchristos #ifndef _ELF_HPPA_H
2598b9484cSchristos #define _ELF_HPPA_H
2698b9484cSchristos 
2798b9484cSchristos /* Processor specific flags for the ELF header e_flags field.  */
2898b9484cSchristos 
2998b9484cSchristos /* Trap null address dereferences.  */
3098b9484cSchristos #define EF_PARISC_TRAPNIL	0x00010000
3198b9484cSchristos 
3298b9484cSchristos /* .PARISC.archext section is present.  */
3398b9484cSchristos #define EF_PARISC_EXT		0x00020000
3498b9484cSchristos 
3598b9484cSchristos /* Program expects little-endian mode.  */
3698b9484cSchristos #define EF_PARISC_LSB		0x00040000
3798b9484cSchristos 
3898b9484cSchristos /* Program expects wide mode.  */
3998b9484cSchristos #define EF_PARISC_WIDE		0x00080000
4098b9484cSchristos 
4198b9484cSchristos /* Do not allow kernel-assisted branch prediction.  */
4298b9484cSchristos #define EF_PARISC_NO_KABP	0x00100000
4398b9484cSchristos 
4498b9484cSchristos /* Allow lazy swap for dynamically allocated program segments.  */
4598b9484cSchristos #define EF_PARISC_LAZYSWAP	0x00400000
4698b9484cSchristos 
4798b9484cSchristos /* Architecture version */
4898b9484cSchristos #define EF_PARISC_ARCH		0x0000ffff
4998b9484cSchristos 
5098b9484cSchristos #define EFA_PARISC_1_0			0x020b
5198b9484cSchristos #define EFA_PARISC_1_1			0x0210
5298b9484cSchristos #define EFA_PARISC_2_0			0x0214
5398b9484cSchristos 
5498b9484cSchristos /* Special section indices.  */
5598b9484cSchristos /* A symbol that has been declared as a tentative definition in an ANSI C
5698b9484cSchristos    compilation.  */
5798b9484cSchristos #define SHN_PARISC_ANSI_COMMON 	SHN_LORESERVE
5898b9484cSchristos 
5998b9484cSchristos /* A symbol that has been declared as a common block using the
6098b9484cSchristos    huge memory model.  */
6198b9484cSchristos #define SHN_PARISC_HUGE_COMMON	(SHN_LORESERVE + 1)
6298b9484cSchristos 
6398b9484cSchristos /* Processor specific section types.  */
6498b9484cSchristos 
6598b9484cSchristos /* Section contains product specific extension bits.  */
6698b9484cSchristos #define SHT_PARISC_EXT		0x70000000
6798b9484cSchristos 
6898b9484cSchristos /* Section contains unwind table entries.  */
6998b9484cSchristos #define SHT_PARISC_UNWIND	0x70000001
7098b9484cSchristos 
7198b9484cSchristos /* Section contains debug information for optimized code.  */
7298b9484cSchristos #define SHT_PARISC_DOC		0x70000002
7398b9484cSchristos 
7498b9484cSchristos /* Section contains code annotations.  */
7598b9484cSchristos #define SHT_PARISC_ANNOT	0x70000003
7698b9484cSchristos 
7798b9484cSchristos /* DLKM special section.  */
7898b9484cSchristos #define SHT_PARISC_DLKM		0x70000004
7998b9484cSchristos 
8098b9484cSchristos /* These are strictly for compatibility with the older elf32-hppa
8198b9484cSchristos    implementation.  Hopefully we can eliminate them in the future.  */
8298b9484cSchristos /* Optional section holding argument location/relocation info.  */
8398b9484cSchristos #define SHT_PARISC_SYMEXTN    SHT_LOPROC + 8
8498b9484cSchristos 
8598b9484cSchristos /* Option section for linker stubs.  */
8698b9484cSchristos #define SHT_PARISC_STUBS      SHT_LOPROC + 9
8798b9484cSchristos 
8898b9484cSchristos /* Processor specific section flags.  */
8998b9484cSchristos 
9098b9484cSchristos /* Section contains code compiled for static branch prediction.  */
9198b9484cSchristos #define SHF_PARISC_SBP		0x80000000
9298b9484cSchristos 
9398b9484cSchristos /* Section should be allocated from from GP.  */
9498b9484cSchristos #define SHF_PARISC_HUGE		0x40000000
9598b9484cSchristos 
9698b9484cSchristos /* Section should go near GP.  */
9798b9484cSchristos #define SHF_PARISC_SHORT	0x20000000
9898b9484cSchristos 
9998b9484cSchristos /* Section is weak ordered.  */
10098b9484cSchristos #define SHF_PARISC_WEAKORDER	0x10000000
10198b9484cSchristos 
10298b9484cSchristos /* Identifies the entry point of a millicode routine.  */
10398b9484cSchristos #define STT_PARISC_MILLI	13
10498b9484cSchristos 
10598b9484cSchristos /* ELF/HPPA relocation types */
10698b9484cSchristos 
10798b9484cSchristos /* Note: PA-ELF is defined to use only RELA relocations.  */
10898b9484cSchristos #include "elf/reloc-macros.h"
10998b9484cSchristos 
11098b9484cSchristos START_RELOC_NUMBERS (elf_hppa_reloc_type)
11198b9484cSchristos RELOC_NUMBER (R_PARISC_NONE,	         0) /* No reloc */
11298b9484cSchristos 
11398b9484cSchristos /*		Data / Inst. Format	   Relocation Expression	  */
11498b9484cSchristos 
11598b9484cSchristos RELOC_NUMBER (R_PARISC_DIR32,	   	 1)
11698b9484cSchristos /*		32-bit word            	   symbol + addend    		  */
11798b9484cSchristos 
11898b9484cSchristos RELOC_NUMBER (R_PARISC_DIR21L,	   	 2)
11998b9484cSchristos /*		long immediate (7)	   LR(symbol, addend) 		  */
12098b9484cSchristos 
12198b9484cSchristos RELOC_NUMBER (R_PARISC_DIR17R,	   	 3)
12298b9484cSchristos /*		branch external (19)	   RR(symbol, addend) 		  */
12398b9484cSchristos 
12498b9484cSchristos RELOC_NUMBER (R_PARISC_DIR17F,	   	 4)
12598b9484cSchristos /*		branch external (19)	   symbol + addend    		  */
12698b9484cSchristos 
12798b9484cSchristos RELOC_NUMBER (R_PARISC_DIR14R,	   	 6)
12898b9484cSchristos /*		load/store (1)		   RR(symbol, addend) 		  */
12998b9484cSchristos 
13098b9484cSchristos RELOC_NUMBER (R_PARISC_DIR14F,	   	 7)
13198b9484cSchristos /*		load/store (1)		   symbol, addend 		  */
13298b9484cSchristos 
13398b9484cSchristos /* PC-relative relocation types
13498b9484cSchristos    Typically used for calls.
13598b9484cSchristos    Note PCREL17C and PCREL17F differ only in overflow handling.
13698b9484cSchristos    PCREL17C never reports a relocation error.
13798b9484cSchristos 
13898b9484cSchristos    When supporting argument relocations, function calls must be
13998b9484cSchristos    accompanied by parameter relocation information.  This information is
14098b9484cSchristos    carried in the ten high-order bits of the addend field.  The remaining
1414559860eSchristos    22 bits of the addend field are sign-extended to form the Addend.
14298b9484cSchristos 
14398b9484cSchristos    Note the code to build argument relocations depends on the
14498b9484cSchristos    addend being zero.  A consequence of this limitation is GAS
14598b9484cSchristos    can not perform relocation reductions for function symbols.  */
14698b9484cSchristos 
14798b9484cSchristos RELOC_NUMBER (R_PARISC_PCREL12F,  	 8)
14898b9484cSchristos /*		op & branch (17)	   symbol - PC - 8 + addend    	  */
14998b9484cSchristos 
15098b9484cSchristos RELOC_NUMBER (R_PARISC_PCREL32,   	 9)
15198b9484cSchristos /*		32-bit word		   symbol - PC - 8 + addend    	  */
15298b9484cSchristos 
15398b9484cSchristos RELOC_NUMBER (R_PARISC_PCREL21L,  	10)
15498b9484cSchristos /*		long immediate (7)	   L(symbol - PC - 8 + addend) 	  */
15598b9484cSchristos 
15698b9484cSchristos RELOC_NUMBER (R_PARISC_PCREL17R,  	11)
15798b9484cSchristos /*		branch external (19)	   R(symbol - PC - 8 + addend) 	  */
15898b9484cSchristos 
15998b9484cSchristos RELOC_NUMBER (R_PARISC_PCREL17F,  	12)
16098b9484cSchristos /*		branch (20)		   symbol - PC - 8 + addend    	  */
16198b9484cSchristos 
16298b9484cSchristos RELOC_NUMBER (R_PARISC_PCREL17C,  	13)
16398b9484cSchristos /*		branch (20)		   symbol - PC - 8 + addend    	  */
16498b9484cSchristos 
16598b9484cSchristos RELOC_NUMBER (R_PARISC_PCREL14R,  	14)
16698b9484cSchristos /*		load/store (1)		   R(symbol - PC - 8 + addend) 	  */
16798b9484cSchristos 
16898b9484cSchristos RELOC_NUMBER (R_PARISC_PCREL14F,  	15)
16998b9484cSchristos /*		load/store (1)             symbol - PC - 8 + addend    	  */
17098b9484cSchristos 
17198b9484cSchristos 
17298b9484cSchristos /* DP-relative relocation types.  */
17398b9484cSchristos RELOC_NUMBER (R_PARISC_DPREL21L,  	18)
17498b9484cSchristos /*		long immediate (7)         LR(symbol - GP, addend)  	  */
17598b9484cSchristos 
17698b9484cSchristos RELOC_NUMBER (R_PARISC_DPREL14WR, 	19)
17798b9484cSchristos /*		load/store mod. comp. (2)  RR(symbol - GP, addend)  	  */
17898b9484cSchristos 
17998b9484cSchristos RELOC_NUMBER (R_PARISC_DPREL14DR, 	20)
18098b9484cSchristos /*		load/store doubleword (3)  RR(symbol - GP, addend)  	  */
18198b9484cSchristos 
18298b9484cSchristos RELOC_NUMBER (R_PARISC_DPREL14R,  	22)
18398b9484cSchristos /*		load/store (1)             RR(symbol - GP, addend)  	  */
18498b9484cSchristos 
18598b9484cSchristos RELOC_NUMBER (R_PARISC_DPREL14F,  	23)
18698b9484cSchristos /*		load/store (1)             symbol - GP + addend     	  */
18798b9484cSchristos 
18898b9484cSchristos 
18998b9484cSchristos /* Data linkage table (DLT) relocation types
19098b9484cSchristos 
19198b9484cSchristos    SOM DLT_REL fixup requests are used to for static data references
19298b9484cSchristos    from position-independent code within shared libraries.  They are
19398b9484cSchristos    similar to the GOT relocation types in some SVR4 implementations.  */
19498b9484cSchristos 
19598b9484cSchristos RELOC_NUMBER (R_PARISC_DLTREL21L,     	26)
19698b9484cSchristos /*		long immediate (7)         LR(symbol - GP, addend) 	  */
19798b9484cSchristos 
19898b9484cSchristos RELOC_NUMBER (R_PARISC_DLTREL14R,     	30)
19998b9484cSchristos /*		load/store (1)             RR(symbol - GP, addend) 	  */
20098b9484cSchristos 
20198b9484cSchristos RELOC_NUMBER (R_PARISC_DLTREL14F,     	31)
20298b9484cSchristos /*		load/store (1)             symbol - GP + addend    	  */
20398b9484cSchristos 
20498b9484cSchristos 
20598b9484cSchristos /* DLT indirect relocation types  */
20698b9484cSchristos RELOC_NUMBER (R_PARISC_DLTIND21L,     	34)
20798b9484cSchristos /*		long immediate (7)         L(ltoff(symbol + addend)) 	  */
20898b9484cSchristos 
20998b9484cSchristos RELOC_NUMBER (R_PARISC_DLTIND14R,     	38)
21098b9484cSchristos /*		load/store (1)             R(ltoff(symbol + addend)) 	  */
21198b9484cSchristos 
21298b9484cSchristos RELOC_NUMBER (R_PARISC_DLTIND14F,     	39)
21398b9484cSchristos /*		load/store (1)             ltoff(symbol + addend)    	  */
21498b9484cSchristos 
21598b9484cSchristos 
21698b9484cSchristos /* Base relative relocation types.  Ugh.  These imply lots of state */
21798b9484cSchristos RELOC_NUMBER (R_PARISC_SETBASE,       	40)
21898b9484cSchristos /*		none                       no reloc; base := sym     	  */
21998b9484cSchristos 
22098b9484cSchristos RELOC_NUMBER (R_PARISC_SECREL32,      	41)
22198b9484cSchristos /*		32-bit word                symbol - SECT + addend    	  */
22298b9484cSchristos 
22398b9484cSchristos RELOC_NUMBER (R_PARISC_BASEREL21L,    	42)
22498b9484cSchristos /*		long immediate (7)         LR(symbol - base, addend) 	  */
22598b9484cSchristos 
22698b9484cSchristos RELOC_NUMBER (R_PARISC_BASEREL17R,    	43)
22798b9484cSchristos /*		branch external (19)       RR(symbol - base, addend) 	  */
22898b9484cSchristos 
22998b9484cSchristos RELOC_NUMBER (R_PARISC_BASEREL17F,    	44)
23098b9484cSchristos /*		branch external (19)       symbol - base + addend    	  */
23198b9484cSchristos 
23298b9484cSchristos RELOC_NUMBER (R_PARISC_BASEREL14R,    	46)
23398b9484cSchristos /*		load/store (1)             RR(symbol - base, addend) 	  */
23498b9484cSchristos 
23598b9484cSchristos RELOC_NUMBER (R_PARISC_BASEREL14F,    	47)
23698b9484cSchristos /*		load/store (1)             symbol - base, addend     	  */
23798b9484cSchristos 
23898b9484cSchristos 
23998b9484cSchristos /* Segment relative relocation types.  */
24098b9484cSchristos RELOC_NUMBER (R_PARISC_SEGBASE,       	48)
24198b9484cSchristos /*		none                       no relocation; SB := sym  	  */
24298b9484cSchristos 
24398b9484cSchristos RELOC_NUMBER (R_PARISC_SEGREL32,      	49)
24498b9484cSchristos /*		32-bit word                symbol - SB + addend 	  */
24598b9484cSchristos 
24698b9484cSchristos 
24798b9484cSchristos /* Offsets from the PLT.  */
24898b9484cSchristos RELOC_NUMBER (R_PARISC_PLTOFF21L,     	50)
24998b9484cSchristos /*		long immediate (7)         LR(pltoff(symbol), addend) 	  */
25098b9484cSchristos 
25198b9484cSchristos RELOC_NUMBER (R_PARISC_PLTOFF14R,     	54)
25298b9484cSchristos /*		load/store (1)             RR(pltoff(symbol), addend) 	  */
25398b9484cSchristos 
25498b9484cSchristos RELOC_NUMBER (R_PARISC_PLTOFF14F,     	55)
25598b9484cSchristos /*		load/store (1)             pltoff(symbol) + addend    	  */
25698b9484cSchristos 
25798b9484cSchristos 
25898b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF_FPTR32,  	57)
25998b9484cSchristos /*		32-bit word                ltoff(fptr(symbol+addend))     */
26098b9484cSchristos 
26198b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF_FPTR21L, 	58)
26298b9484cSchristos /*		long immediate (7)         L(ltoff(fptr(symbol+addend)))  */
26398b9484cSchristos 
26498b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF_FPTR14R, 	62)
26598b9484cSchristos /*		load/store (1)             R(ltoff(fptr(symbol+addend)))  */
26698b9484cSchristos 
26798b9484cSchristos 
26898b9484cSchristos RELOC_NUMBER (R_PARISC_FPTR64,        	64)
26998b9484cSchristos /*		64-bit doubleword          fptr(symbol+addend) 		  */
27098b9484cSchristos 
27198b9484cSchristos 
27298b9484cSchristos /* Plabel relocation types.  */
27398b9484cSchristos RELOC_NUMBER (R_PARISC_PLABEL32,      	65)
27498b9484cSchristos /*		32-bit word	  	   fptr(symbol) 		  */
27598b9484cSchristos 
27698b9484cSchristos RELOC_NUMBER (R_PARISC_PLABEL21L,     	66)
27798b9484cSchristos /*		long immediate (7)         L(fptr(symbol))		  */
27898b9484cSchristos 
27998b9484cSchristos RELOC_NUMBER (R_PARISC_PLABEL14R,     	70)
28098b9484cSchristos /*		load/store (1)             R(fptr(symbol))		  */
28198b9484cSchristos 
28298b9484cSchristos 
28398b9484cSchristos /* PCREL relocations.  */
28498b9484cSchristos RELOC_NUMBER (R_PARISC_PCREL64,       	72)
28598b9484cSchristos /*		64-bit doubleword          symbol - PC - 8 + addend       */
28698b9484cSchristos 
28798b9484cSchristos RELOC_NUMBER (R_PARISC_PCREL22C,      	73)
28898b9484cSchristos /*		branch & link (21)         symbol - PC - 8 + addend       */
28998b9484cSchristos 
29098b9484cSchristos RELOC_NUMBER (R_PARISC_PCREL22F,      	74)
29198b9484cSchristos /*		branch & link (21)         symbol - PC - 8 + addend       */
29298b9484cSchristos 
29398b9484cSchristos RELOC_NUMBER (R_PARISC_PCREL14WR,     	75)
29498b9484cSchristos /*		load/store mod. comp. (2)  R(symbol - PC - 8 + addend)    */
29598b9484cSchristos 
29698b9484cSchristos RELOC_NUMBER (R_PARISC_PCREL14DR,     	76)
29798b9484cSchristos /*		load/store doubleword (3)  R(symbol - PC - 8 + addend)    */
29898b9484cSchristos 
29998b9484cSchristos RELOC_NUMBER (R_PARISC_PCREL16F,      	77)
30098b9484cSchristos /*		load/store (1)             symbol - PC - 8 + addend       */
30198b9484cSchristos 
30298b9484cSchristos RELOC_NUMBER (R_PARISC_PCREL16WF,     	78)
30398b9484cSchristos /*		load/store mod. comp. (2)  symbol - PC - 8 + addend       */
30498b9484cSchristos 
30598b9484cSchristos RELOC_NUMBER (R_PARISC_PCREL16DF,     	79)
30698b9484cSchristos /*		load/store doubleword (3)  symbol - PC - 8 + addend       */
30798b9484cSchristos 
30898b9484cSchristos 
30998b9484cSchristos RELOC_NUMBER (R_PARISC_DIR64,         	80)
31098b9484cSchristos /*		64-bit doubleword          symbol + addend    		  */
31198b9484cSchristos 
31298b9484cSchristos RELOC_NUMBER (R_PARISC_DIR14WR,       	83)
31398b9484cSchristos /*		load/store mod. comp. (2)  RR(symbol, addend) 		  */
31498b9484cSchristos 
31598b9484cSchristos RELOC_NUMBER (R_PARISC_DIR14DR,       	84)
31698b9484cSchristos /*		load/store doubleword (3)  RR(symbol, addend) 		  */
31798b9484cSchristos 
31898b9484cSchristos RELOC_NUMBER (R_PARISC_DIR16F,        	85)
31998b9484cSchristos /*		load/store (1)             symbol + addend    		  */
32098b9484cSchristos 
32198b9484cSchristos RELOC_NUMBER (R_PARISC_DIR16WF,       	86)
32298b9484cSchristos /*		load/store mod. comp. (2)  symbol + addend    		  */
32398b9484cSchristos 
32498b9484cSchristos RELOC_NUMBER (R_PARISC_DIR16DF,       	87)
32598b9484cSchristos /*		load/store doubleword (3)  symbol + addend    		  */
32698b9484cSchristos 
32798b9484cSchristos RELOC_NUMBER (R_PARISC_GPREL64,       	88)
32898b9484cSchristos /*		64-bit doubleword          symbol - GP + addend 	  */
32998b9484cSchristos 
33098b9484cSchristos RELOC_NUMBER (R_PARISC_DLTREL14WR,    	91)
33198b9484cSchristos /*		load/store mod. comp. (2)  RR(symbol - GP, addend) 	  */
33298b9484cSchristos 
33398b9484cSchristos RELOC_NUMBER (R_PARISC_DLTREL14DR,    	92)
33498b9484cSchristos /*		load/store doubleword (3)  RR(symbol - GP, addend) 	  */
33598b9484cSchristos 
33698b9484cSchristos RELOC_NUMBER (R_PARISC_GPREL16F,      	93)
33798b9484cSchristos /*		load/store (1)             symbol - GP + addend    	  */
33898b9484cSchristos 
33998b9484cSchristos RELOC_NUMBER (R_PARISC_GPREL16WF,     	94)
34098b9484cSchristos /*		load/store mod. comp. (2)  symbol - GP + addend    	  */
34198b9484cSchristos 
34298b9484cSchristos RELOC_NUMBER (R_PARISC_GPREL16DF,     	95)
34398b9484cSchristos /*		load/store doubleword (3)  symbol - GP + addend    	  */
34498b9484cSchristos 
34598b9484cSchristos 
34698b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF64,      	96)
34798b9484cSchristos /*		64-bit doubleword          ltoff(symbol + addend)    	  */
34898b9484cSchristos 
34998b9484cSchristos RELOC_NUMBER (R_PARISC_DLTIND14WR,   	99)
35098b9484cSchristos /*		load/store mod. comp. (2)  R(ltoff(symbol + addend)) 	  */
35198b9484cSchristos 
35298b9484cSchristos RELOC_NUMBER (R_PARISC_DLTIND14DR,     100)
35398b9484cSchristos /*		load/store doubleword (3)  R(ltoff(symbol + addend)) 	  */
35498b9484cSchristos 
35598b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF16F,       101)
35698b9484cSchristos /*		load/store (1)             ltoff(symbol + addend)    	  */
35798b9484cSchristos 
35898b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF16WF,      102)
35998b9484cSchristos /*		load/store mod. comp. (2)  ltoff(symbol + addend)    	  */
36098b9484cSchristos 
36198b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF16DF,      103)
36298b9484cSchristos /*		load/store doubleword (3)  ltoff(symbol + addend)    	  */
36398b9484cSchristos 
36498b9484cSchristos 
36598b9484cSchristos RELOC_NUMBER (R_PARISC_SECREL64,       104)
36698b9484cSchristos /*		64-bit doubleword          symbol - SECT + addend 	  */
36798b9484cSchristos 
36898b9484cSchristos RELOC_NUMBER (R_PARISC_BASEREL14WR,    107)
36998b9484cSchristos /*		load/store mod. comp. (2)  RR(symbol - base, addend) 	  */
37098b9484cSchristos 
37198b9484cSchristos RELOC_NUMBER (R_PARISC_BASEREL14DR,    108)
37298b9484cSchristos /*		load/store doubleword (3)  RR(symbol - base, addend) 	  */
37398b9484cSchristos 
37498b9484cSchristos 
37598b9484cSchristos RELOC_NUMBER (R_PARISC_SEGREL64,       112)
37698b9484cSchristos /*		64-bit doubleword          symbol - SB + addend 	  */
37798b9484cSchristos 
37898b9484cSchristos RELOC_NUMBER (R_PARISC_PLTOFF14WR,     115)
37998b9484cSchristos /*		load/store mod. comp. (2)  RR(pltoff(symbol), addend) 	  */
38098b9484cSchristos 
38198b9484cSchristos RELOC_NUMBER (R_PARISC_PLTOFF14DR,     116)
38298b9484cSchristos /*		load/store doubleword (3)  RR(pltoff(symbol), addend) 	  */
38398b9484cSchristos 
38498b9484cSchristos RELOC_NUMBER (R_PARISC_PLTOFF16F,      117)
38598b9484cSchristos /*		load/store (1)             pltoff(symbol) + addend    	  */
38698b9484cSchristos 
38798b9484cSchristos RELOC_NUMBER (R_PARISC_PLTOFF16WF,     118)
38898b9484cSchristos /*		load/store mod. comp. (2)  pltoff(symbol) + addend    	  */
38998b9484cSchristos 
39098b9484cSchristos RELOC_NUMBER (R_PARISC_PLTOFF16DF,     119)
39198b9484cSchristos /*		load/store doubleword (3)  pltoff(symbol) + addend    	  */
39298b9484cSchristos 
39398b9484cSchristos 
39498b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF_FPTR64,   120)
39598b9484cSchristos /*		64-bit doubleword          ltoff(fptr(symbol+addend))     */
39698b9484cSchristos 
39798b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF_FPTR14WR, 123)
39898b9484cSchristos /*		load/store mod. comp. (2)  R(ltoff(fptr(symbol+addend)))  */
39998b9484cSchristos 
40098b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF_FPTR14DR, 124)
40198b9484cSchristos /*		load/store doubleword (3)  R(ltoff(fptr(symbol+addend)))  */
40298b9484cSchristos 
40398b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF_FPTR16F,  125)
40498b9484cSchristos /*		load/store (1)             ltoff(fptr(symbol+addend))     */
40598b9484cSchristos 
40698b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF_FPTR16WF, 126)
40798b9484cSchristos /*		load/store mod. comp. (2)  ltoff(fptr(symbol+addend))     */
40898b9484cSchristos 
40998b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF_FPTR16DF, 127)
41098b9484cSchristos /*		load/store doubleword (3)  ltoff(fptr(symbol+addend))     */
41198b9484cSchristos 
41298b9484cSchristos 
41398b9484cSchristos RELOC_NUMBER (R_PARISC_COPY, 	       128)
41498b9484cSchristos /*		data                       Dynamic relocations only 	  */
41598b9484cSchristos 
41698b9484cSchristos RELOC_NUMBER (R_PARISC_IPLT, 	       129)
41798b9484cSchristos /*		plt                                                 	  */
41898b9484cSchristos 
41998b9484cSchristos RELOC_NUMBER (R_PARISC_EPLT, 	       130)
42098b9484cSchristos /*		plt                                                 	  */
42198b9484cSchristos 
42298b9484cSchristos 
42398b9484cSchristos RELOC_NUMBER (R_PARISC_TPREL32,        153)
42498b9484cSchristos /*		32-bit word                symbol - TP + addend    	  */
42598b9484cSchristos 
42698b9484cSchristos RELOC_NUMBER (R_PARISC_TPREL21L,       154)
42798b9484cSchristos /*		long immediate (7)         LR(symbol - TP, addend) 	  */
42898b9484cSchristos 
42998b9484cSchristos RELOC_NUMBER (R_PARISC_TPREL14R,       158)
43098b9484cSchristos /*		load/store (1)             RR(symbol - TP, addend) 	  */
43198b9484cSchristos 
43298b9484cSchristos 
43398b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF_TP21L,    162)
43498b9484cSchristos /*		long immediate (7)         L(ltoff(symbol - TP + addend)) */
43598b9484cSchristos 
43698b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF_TP14R,    166)
43798b9484cSchristos /*		load/store (1)             R(ltoff(symbol - TP + addend)) */
43898b9484cSchristos 
43998b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF_TP14F,    167)
44098b9484cSchristos /*		load/store (1)             ltoff(symbol - TP + addend)    */
44198b9484cSchristos 
44298b9484cSchristos 
44398b9484cSchristos RELOC_NUMBER (R_PARISC_TPREL64,        216)
44498b9484cSchristos /*		64-bit word                symbol - TP + addend        	  */
44598b9484cSchristos 
44698b9484cSchristos RELOC_NUMBER (R_PARISC_TPREL14WR,      219)
44798b9484cSchristos /*		load/store mod. comp. (2)  RR(symbol - TP, addend)     	  */
44898b9484cSchristos 
44998b9484cSchristos RELOC_NUMBER (R_PARISC_TPREL14DR,      220)
45098b9484cSchristos /*		load/store doubleword (3)  RR(symbol - TP, addend)     	  */
45198b9484cSchristos 
45298b9484cSchristos RELOC_NUMBER (R_PARISC_TPREL16F,       221)
45398b9484cSchristos /*		load/store (1)             symbol - TP + addend        	  */
45498b9484cSchristos 
45598b9484cSchristos RELOC_NUMBER (R_PARISC_TPREL16WF,      222)
45698b9484cSchristos /*		load/store mod. comp. (2)  symbol - TP + addend        	  */
45798b9484cSchristos 
45898b9484cSchristos RELOC_NUMBER (R_PARISC_TPREL16DF,      223)
45998b9484cSchristos /*		load/store doubleword (3)  symbol - TP + addend        	  */
46098b9484cSchristos 
46198b9484cSchristos 
46298b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF_TP64,     224)
46398b9484cSchristos /*		64-bit doubleword          ltoff(symbol - TP + addend)    */
46498b9484cSchristos 
46598b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF_TP14WR,   227)
46698b9484cSchristos /*		load/store mod. comp. (2)  R(ltoff(symbol - TP + addend)) */
46798b9484cSchristos 
46898b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF_TP14DR,   228)
46998b9484cSchristos /*		load/store doubleword (3)  R(ltoff(symbol - TP + addend)) */
47098b9484cSchristos 
47198b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF_TP16F,    229)
47298b9484cSchristos /*		load/store (1)             ltoff(symbol - TP + addend)    */
47398b9484cSchristos 
47498b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF_TP16WF,   230)
47598b9484cSchristos /*		load/store mod. comp. (2)  ltoff(symbol - TP + addend)    */
47698b9484cSchristos 
47798b9484cSchristos RELOC_NUMBER (R_PARISC_LTOFF_TP16DF,   231)
47898b9484cSchristos /*		load/store doubleword (3)  ltoff(symbol - TP + addend)    */
47998b9484cSchristos 
48098b9484cSchristos RELOC_NUMBER (R_PARISC_GNU_VTENTRY,    232)
48198b9484cSchristos RELOC_NUMBER (R_PARISC_GNU_VTINHERIT,  233)
48298b9484cSchristos 
48398b9484cSchristos RELOC_NUMBER (R_PARISC_TLS_GD21L,      234)
48498b9484cSchristos RELOC_NUMBER (R_PARISC_TLS_GD14R,      235)
48598b9484cSchristos RELOC_NUMBER (R_PARISC_TLS_GDCALL,     236)
48698b9484cSchristos RELOC_NUMBER (R_PARISC_TLS_LDM21L,     237)
48798b9484cSchristos RELOC_NUMBER (R_PARISC_TLS_LDM14R,     238)
48898b9484cSchristos RELOC_NUMBER (R_PARISC_TLS_LDMCALL,    239)
48998b9484cSchristos RELOC_NUMBER (R_PARISC_TLS_LDO21L,     240)
49098b9484cSchristos RELOC_NUMBER (R_PARISC_TLS_LDO14R,     241)
49198b9484cSchristos RELOC_NUMBER (R_PARISC_TLS_DTPMOD32,   242)
49298b9484cSchristos RELOC_NUMBER (R_PARISC_TLS_DTPMOD64,   243)
49398b9484cSchristos RELOC_NUMBER (R_PARISC_TLS_DTPOFF32,   244)
49498b9484cSchristos RELOC_NUMBER (R_PARISC_TLS_DTPOFF64,   245)
49598b9484cSchristos 
49698b9484cSchristos END_RELOC_NUMBERS (R_PARISC_UNIMPLEMENTED)
49798b9484cSchristos 
49898b9484cSchristos #define R_PARISC_TLS_LE21L     R_PARISC_TPREL21L
49998b9484cSchristos #define R_PARISC_TLS_LE14R     R_PARISC_TPREL14R
50098b9484cSchristos #define R_PARISC_TLS_IE21L     R_PARISC_LTOFF_TP21L
50198b9484cSchristos #define R_PARISC_TLS_IE14R     R_PARISC_LTOFF_TP14R
50298b9484cSchristos #define R_PARISC_TLS_TPREL32   R_PARISC_TPREL32
50398b9484cSchristos #define R_PARISC_TLS_TPREL64   R_PARISC_TPREL64
50498b9484cSchristos 
50598b9484cSchristos #ifndef RELOC_MACROS_GEN_FUNC
50698b9484cSchristos typedef enum elf_hppa_reloc_type elf_hppa_reloc_type;
50798b9484cSchristos #endif
50898b9484cSchristos 
50998b9484cSchristos #define PT_PARISC_ARCHEXT	0x70000000
51098b9484cSchristos #define PT_PARISC_UNWIND	0x70000001
51198b9484cSchristos #define PT_PARISC_WEAKORDER	0x70000002
51298b9484cSchristos 
51398b9484cSchristos /* Flag bits in sh_flags of ElfXX_Shdr.  */
51498b9484cSchristos #define SHF_HP_TLS              0x01000000
51598b9484cSchristos #define SHF_HP_NEAR_SHARED      0x02000000
51698b9484cSchristos #define SHF_HP_FAR_SHARED       0x04000000
51798b9484cSchristos #define SHF_HP_COMDAT           0x08000000
51898b9484cSchristos #define SHF_HP_CONST            0x00800000
51998b9484cSchristos 
52098b9484cSchristos /* Reserved section header indices.  */
52198b9484cSchristos #define SHN_TLS_COMMON          (SHN_LOOS + 0x0)
52298b9484cSchristos #define SHN_NS_COMMON           (SHN_LOOS + 0x1)
52398b9484cSchristos #define SHN_FS_COMMON           (SHN_LOOS + 0x2)
52498b9484cSchristos #define SHN_NS_UNDEF            (SHN_LOOS + 0x3)
52598b9484cSchristos #define SHN_FS_UNDEF            (SHN_LOOS + 0x4)
52698b9484cSchristos #define SHN_HP_EXTERN           (SHN_LOOS + 0x5)
52798b9484cSchristos #define SHN_HP_EXTHINT          (SHN_LOOS + 0x6)
52898b9484cSchristos #define SHN_HP_UNDEF_BIND_IMM   (SHN_LOOS + 0x7)
52998b9484cSchristos 
53098b9484cSchristos /* Values of sh_type in ElfXX_Shdr.  */
53198b9484cSchristos #define SHT_HP_OVLBITS  (SHT_LOOS + 0x0)
53298b9484cSchristos #define SHT_HP_DLKM     (SHT_LOOS + 0x1)
53398b9484cSchristos #define SHT_HP_COMDAT   (SHT_LOOS + 0x2)
53498b9484cSchristos #define SHT_HP_OBJDICT  (SHT_LOOS + 0x3)
53598b9484cSchristos #define SHT_HP_ANNOT    (SHT_LOOS + 0x4)
53698b9484cSchristos 
53798b9484cSchristos /* Flag bits in p_flags of ElfXX_Phdr.  */
53898b9484cSchristos #define PF_HP_CODE		0x00040000
53998b9484cSchristos #define PF_HP_MODIFY		0x00080000
54098b9484cSchristos #define PF_HP_PAGE_SIZE		0x00100000
54198b9484cSchristos #define PF_HP_FAR_SHARED	0x00200000
54298b9484cSchristos #define PF_HP_NEAR_SHARED	0x00400000
54398b9484cSchristos #define PF_HP_LAZYSWAP		0x00800000
54498b9484cSchristos #define PF_HP_CODE_DEPR		0x01000000
54598b9484cSchristos #define PF_HP_MODIFY_DEPR	0x02000000
54698b9484cSchristos #define PF_HP_LAZYSWAP_DEPR	0x04000000
54798b9484cSchristos #define PF_PARISC_SBP		0x08000000
54898b9484cSchristos #define PF_HP_SBP		0x08000000
54998b9484cSchristos 
55098b9484cSchristos 
55198b9484cSchristos /* Processor specific dynamic array tags.  */
55298b9484cSchristos 
55398b9484cSchristos /* Arggh.  HP's tools define these symbols based on the
55498b9484cSchristos    old value of DT_LOOS.  So we must do the same to be
55598b9484cSchristos    compatible.  */
55698b9484cSchristos #define DT_HP_LOAD_MAP		(OLD_DT_LOOS + 0x0)
55798b9484cSchristos #define DT_HP_DLD_FLAGS		(OLD_DT_LOOS + 0x1)
55898b9484cSchristos #define DT_HP_DLD_HOOK		(OLD_DT_LOOS + 0x2)
55998b9484cSchristos #define DT_HP_UX10_INIT		(OLD_DT_LOOS + 0x3)
56098b9484cSchristos #define DT_HP_UX10_INITSZ	(OLD_DT_LOOS + 0x4)
56198b9484cSchristos #define DT_HP_PREINIT		(OLD_DT_LOOS + 0x5)
56298b9484cSchristos #define DT_HP_PREINITSZ		(OLD_DT_LOOS + 0x6)
56398b9484cSchristos #define DT_HP_NEEDED		(OLD_DT_LOOS + 0x7)
56498b9484cSchristos #define DT_HP_TIME_STAMP	(OLD_DT_LOOS + 0x8)
56598b9484cSchristos #define DT_HP_CHECKSUM		(OLD_DT_LOOS + 0x9)
56698b9484cSchristos #define DT_HP_GST_SIZE		(OLD_DT_LOOS + 0xa)
56798b9484cSchristos #define DT_HP_GST_VERSION	(OLD_DT_LOOS + 0xb)
56898b9484cSchristos #define DT_HP_GST_HASHVAL	(OLD_DT_LOOS + 0xc)
56998b9484cSchristos #define DT_HP_EPLTREL		(OLD_DT_LOOS + 0xd)
57098b9484cSchristos #define DT_HP_EPLTRELSZ		(OLD_DT_LOOS + 0xe)
57198b9484cSchristos #define DT_HP_FILTERED		(OLD_DT_LOOS + 0xf)
57298b9484cSchristos #define DT_HP_FILTER_TLS	(OLD_DT_LOOS + 0x10)
57398b9484cSchristos #define DT_HP_COMPAT_FILTERED	(OLD_DT_LOOS + 0x11)
57498b9484cSchristos #define DT_HP_LAZYLOAD		(OLD_DT_LOOS + 0x12)
57598b9484cSchristos #define DT_HP_BIND_NOW_COUNT	(OLD_DT_LOOS + 0x13)
57698b9484cSchristos #define DT_PLT			(OLD_DT_LOOS + 0x14)
57798b9484cSchristos #define DT_PLT_SIZE		(OLD_DT_LOOS + 0x15)
57898b9484cSchristos #define DT_DLT			(OLD_DT_LOOS + 0x16)
57998b9484cSchristos #define DT_DLT_SIZE		(OLD_DT_LOOS + 0x17)
58098b9484cSchristos 
58198b9484cSchristos /* Values for DT_HP_DLD_FLAGS.  */
58298b9484cSchristos #define DT_HP_DEBUG_PRIVATE		0x00001 /* Map text private */
58398b9484cSchristos #define DT_HP_DEBUG_CALLBACK		0x00002 /* Callback */
58498b9484cSchristos #define DT_HP_DEBUG_CALLBACK_BOR	0x00004 /* BOR callback */
58598b9484cSchristos #define DT_HP_NO_ENVVAR			0x00008 /* No env var */
58698b9484cSchristos #define DT_HP_BIND_NOW			0x00010 /* Bind now */
58798b9484cSchristos #define DT_HP_BIND_NONFATAL		0x00020 /* Bind non-fatal */
58898b9484cSchristos #define DT_HP_BIND_VERBOSE		0x00040 /* Bind verbose */
58998b9484cSchristos #define DT_HP_BIND_RESTRICTED		0x00080 /* Bind restricted */
59098b9484cSchristos #define DT_HP_BIND_SYMBOLIC		0x00100 /* Bind symbolic */
59198b9484cSchristos #define DT_HP_RPATH_FIRST		0x00200 /* RPATH first */
59298b9484cSchristos #define DT_HP_BIND_DEPTH_FIRST		0x00400 /* Bind depth-first */
59398b9484cSchristos #define DT_HP_GST			0x00800 /* Dld global sym table */
59498b9484cSchristos #define DT_HP_SHLIB_FIXED		0x01000 /* shared vtable support */
59598b9484cSchristos #define DT_HP_MERGE_SHLIB_SEG		0x02000 /* merge shlib data segs */
59698b9484cSchristos #define DT_HP_NODELETE			0x04000 /* never unload */
59798b9484cSchristos #define DT_HP_GROUP			0x08000 /* bind only within group */
59898b9484cSchristos #define DT_HP_PROTECT_LINKAGE_TABLE	0x10000 /* protected linkage table */
59998b9484cSchristos 
60098b9484cSchristos /* Program header extensions.  */
60198b9484cSchristos #define PT_HP_TLS		(PT_LOOS + 0x0)
60298b9484cSchristos #define PT_HP_CORE_NONE		(PT_LOOS + 0x1)
60398b9484cSchristos #define PT_HP_CORE_VERSION	(PT_LOOS + 0x2)
60498b9484cSchristos #define PT_HP_CORE_KERNEL	(PT_LOOS + 0x3)
60598b9484cSchristos #define PT_HP_CORE_COMM		(PT_LOOS + 0x4)
60698b9484cSchristos #define PT_HP_CORE_PROC		(PT_LOOS + 0x5)
60798b9484cSchristos #define PT_HP_CORE_LOADABLE	(PT_LOOS + 0x6)
60898b9484cSchristos #define PT_HP_CORE_STACK	(PT_LOOS + 0x7)
60998b9484cSchristos #define PT_HP_CORE_SHM		(PT_LOOS + 0x8)
61098b9484cSchristos #define PT_HP_CORE_MMF		(PT_LOOS + 0x9)
61198b9484cSchristos #define PT_HP_PARALLEL		(PT_LOOS + 0x10)
61298b9484cSchristos #define PT_HP_FASTBIND		(PT_LOOS + 0x11)
61398b9484cSchristos #define PT_HP_OPT_ANNOT		(PT_LOOS + 0x12)
61498b9484cSchristos #define PT_HP_HSL_ANNOT		(PT_LOOS + 0x13)
61598b9484cSchristos #define PT_HP_STACK		(PT_LOOS + 0x14)
61698b9484cSchristos #define PT_HP_CORE_UTSNAME	(PT_LOOS + 0x15)
61798b9484cSchristos 
61898b9484cSchristos /* Binding information.  */
61998b9484cSchristos #define STB_HP_ALIAS		(STB_LOOS + 0x0)
62098b9484cSchristos 
62198b9484cSchristos /* Additional symbol types.  */
62298b9484cSchristos #define STT_HP_OPAQUE		(STT_LOOS + 0x1)
62398b9484cSchristos #define STT_HP_STUB		(STT_LOOS + 0x2)
62498b9484cSchristos 
62598b9484cSchristos /* Note types.  */
62698b9484cSchristos #define NT_HP_COMPILER		1
62798b9484cSchristos #define NT_HP_COPYRIGHT		2
62898b9484cSchristos #define NT_HP_VERSION		3
62998b9484cSchristos #define NT_HP_SRCFILE_INFO	4
63098b9484cSchristos #define NT_HP_LINKER		5
63198b9484cSchristos #define NT_HP_INSTRUMENTED	6
63298b9484cSchristos #define NT_HP_UX_OPTIONS	7
63398b9484cSchristos 
63498b9484cSchristos #endif /* _ELF_HPPA_H */
635