/* HPPA ELF support for BFD.
- Copyright (C) 1993, 94, 95, 99, 2000 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1998, 1999, 2000, 2005, 2006, 2008, 2010
+ Free Software Foundation, Inc.
-This file is part of BFD, the Binary File Descriptor library.
+ This file is part of BFD, the Binary File Descriptor library.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+ MA 02110-1301, USA. */
/* This file holds definitions specific to the HPPA ELF ABI. Note
that most of this is not actually implemented by BFD. */
/* Special section indices. */
/* A symbol that has been declared as a tentative definition in an ANSI C
compilation. */
-#define SHN_PARISC_ANSI_COMMON 0xff00
+#define SHN_PARISC_ANSI_COMMON SHN_LORESERVE
/* A symbol that has been declared as a common block using the
huge memory model. */
-#define SHN_PARISC_HUGE_COMMON 0xff01
+#define SHN_PARISC_HUGE_COMMON (SHN_LORESERVE + 1)
/* Processor specific section types. */
/* Section contains code annotations. */
#define SHT_PARISC_ANNOT 0x70000003
+/* DLKM special section. */
+#define SHT_PARISC_DLKM 0x70000004
+
/* These are strictly for compatibility with the older elf32-hppa
implementation. Hopefully we can eliminate them in the future. */
/* Optional section holding argument location/relocation info. */
-#define SHT_PARISC_SYMEXTN SHT_LOPROC+8
+#define SHT_PARISC_SYMEXTN SHT_LOPROC + 8
/* Option section for linker stubs. */
-#define SHT_PARISC_STUBS SHT_LOPROC+9
+#define SHT_PARISC_STUBS SHT_LOPROC + 9
/* Processor specific section flags. */
/* Section should go near GP. */
#define SHF_PARISC_SHORT 0x20000000
+/* Section is weak ordered. */
+#define SHF_PARISC_WEAKORDER 0x10000000
/* Identifies the entry point of a millicode routine. */
#define STT_PARISC_MILLI 13
RELOC_NUMBER (R_PARISC_DIR14R, 6)
/* load/store (1) RR(symbol, addend) */
+RELOC_NUMBER (R_PARISC_DIR14F, 7)
+/* load/store (1) symbol, addend */
+
/* PC-relative relocation types
Typically used for calls.
Note PCREL17C and PCREL17F differ only in overflow handling.
RELOC_NUMBER (R_PARISC_DIR64, 80)
/* 64-bit doubleword symbol + addend */
-RELOC_NUMBER (R_PARISC_DIR64WR, 81)
-/* 64-bit doubleword RR(symbol, addend) */
-
-RELOC_NUMBER (R_PARISC_DIR64DR, 82)
-/* 64-bit doubleword RR(symbol, addend) */
-
RELOC_NUMBER (R_PARISC_DIR14WR, 83)
/* load/store mod. comp. (2) RR(symbol, addend) */
RELOC_NUMBER (R_PARISC_GNU_VTENTRY, 232)
RELOC_NUMBER (R_PARISC_GNU_VTINHERIT, 233)
+RELOC_NUMBER (R_PARISC_TLS_GD21L, 234)
+RELOC_NUMBER (R_PARISC_TLS_GD14R, 235)
+RELOC_NUMBER (R_PARISC_TLS_GDCALL, 236)
+RELOC_NUMBER (R_PARISC_TLS_LDM21L, 237)
+RELOC_NUMBER (R_PARISC_TLS_LDM14R, 238)
+RELOC_NUMBER (R_PARISC_TLS_LDMCALL, 239)
+RELOC_NUMBER (R_PARISC_TLS_LDO21L, 240)
+RELOC_NUMBER (R_PARISC_TLS_LDO14R, 241)
+RELOC_NUMBER (R_PARISC_TLS_DTPMOD32, 242)
+RELOC_NUMBER (R_PARISC_TLS_DTPMOD64, 243)
+RELOC_NUMBER (R_PARISC_TLS_DTPOFF32, 244)
+RELOC_NUMBER (R_PARISC_TLS_DTPOFF64, 245)
+
END_RELOC_NUMBERS (R_PARISC_UNIMPLEMENTED)
+#define R_PARISC_TLS_LE21L R_PARISC_TPREL21L
+#define R_PARISC_TLS_LE14R R_PARISC_TPREL14R
+#define R_PARISC_TLS_IE21L R_PARISC_LTOFF_TP21L
+#define R_PARISC_TLS_IE14R R_PARISC_LTOFF_TP14R
+#define R_PARISC_TLS_TPREL32 R_PARISC_TPREL32
+#define R_PARISC_TLS_TPREL64 R_PARISC_TPREL64
+
#ifndef RELOC_MACROS_GEN_FUNC
typedef enum elf_hppa_reloc_type elf_hppa_reloc_type;
#endif
#define PT_PARISC_ARCHEXT 0x70000000
#define PT_PARISC_UNWIND 0x70000001
-#define PF_PARISC_SBP 0x08000000
+#define PT_PARISC_WEAKORDER 0x70000002
+
+/* Flag bits in sh_flags of ElfXX_Shdr. */
+#define SHF_HP_TLS 0x01000000
+#define SHF_HP_NEAR_SHARED 0x02000000
+#define SHF_HP_FAR_SHARED 0x04000000
+#define SHF_HP_COMDAT 0x08000000
+#define SHF_HP_CONST 0x00800000
+
+/* Reserved section header indices. */
+#define SHN_TLS_COMMON (SHN_LOOS + 0x0)
+#define SHN_NS_COMMON (SHN_LOOS + 0x1)
+#define SHN_FS_COMMON (SHN_LOOS + 0x2)
+#define SHN_NS_UNDEF (SHN_LOOS + 0x3)
+#define SHN_FS_UNDEF (SHN_LOOS + 0x4)
+#define SHN_HP_EXTERN (SHN_LOOS + 0x5)
+#define SHN_HP_EXTHINT (SHN_LOOS + 0x6)
+#define SHN_HP_UNDEF_BIND_IMM (SHN_LOOS + 0x7)
+
+/* Values of sh_type in ElfXX_Shdr. */
+#define SHT_HP_OVLBITS (SHT_LOOS + 0x0)
+#define SHT_HP_DLKM (SHT_LOOS + 0x1)
+#define SHT_HP_COMDAT (SHT_LOOS + 0x2)
+#define SHT_HP_OBJDICT (SHT_LOOS + 0x3)
+#define SHT_HP_ANNOT (SHT_LOOS + 0x4)
+
+/* Flag bits in p_flags of ElfXX_Phdr. */
+#define PF_HP_CODE 0x00040000
+#define PF_HP_MODIFY 0x00080000
#define PF_HP_PAGE_SIZE 0x00100000
#define PF_HP_FAR_SHARED 0x00200000
#define PF_HP_NEAR_SHARED 0x00400000
-#define PF_HP_CODE 0x01000000
-#define PF_HP_MODIFY 0x02000000
-#define PF_HP_LAZYSWAP 0x04000000
+#define PF_HP_LAZYSWAP 0x00800000
+#define PF_HP_CODE_DEPR 0x01000000
+#define PF_HP_MODIFY_DEPR 0x02000000
+#define PF_HP_LAZYSWAP_DEPR 0x04000000
+#define PF_PARISC_SBP 0x08000000
#define PF_HP_SBP 0x08000000
\f
/* Processor specific dynamic array tags. */
-#define DT_HP_LOAD_MAP (DT_LOOS + 0x0)
-#define DT_HP_DLD_FLAGS (DT_LOOS + 0x1)
-#define DT_HP_DLD_HOOK (DT_LOOS + 0x2)
-#define DT_HP_UX10_INIT (DT_LOOS + 0x3)
-#define DT_HP_UX10_INITSZ (DT_LOOS + 0x4)
-#define DT_HP_PREINIT (DT_LOOS + 0x5)
-#define DT_HP_PREINITSZ (DT_LOOS + 0x6)
-#define DT_HP_NEEDED (DT_LOOS + 0x7)
-#define DT_HP_TIME_STAMP (DT_LOOS + 0x8)
-#define DT_HP_CHECKSUM (DT_LOOS + 0x9)
-#define DT_HP_GST_SIZE (DT_LOOS + 0xa)
-#define DT_HP_GST_VERSION (DT_LOOS + 0xb)
-#define DT_HP_GST_HASHVAL (DT_LOOS + 0xc)
+/* Arggh. HP's tools define these symbols based on the
+ old value of DT_LOOS. So we must do the same to be
+ compatible. */
+#define DT_HP_LOAD_MAP (OLD_DT_LOOS + 0x0)
+#define DT_HP_DLD_FLAGS (OLD_DT_LOOS + 0x1)
+#define DT_HP_DLD_HOOK (OLD_DT_LOOS + 0x2)
+#define DT_HP_UX10_INIT (OLD_DT_LOOS + 0x3)
+#define DT_HP_UX10_INITSZ (OLD_DT_LOOS + 0x4)
+#define DT_HP_PREINIT (OLD_DT_LOOS + 0x5)
+#define DT_HP_PREINITSZ (OLD_DT_LOOS + 0x6)
+#define DT_HP_NEEDED (OLD_DT_LOOS + 0x7)
+#define DT_HP_TIME_STAMP (OLD_DT_LOOS + 0x8)
+#define DT_HP_CHECKSUM (OLD_DT_LOOS + 0x9)
+#define DT_HP_GST_SIZE (OLD_DT_LOOS + 0xa)
+#define DT_HP_GST_VERSION (OLD_DT_LOOS + 0xb)
+#define DT_HP_GST_HASHVAL (OLD_DT_LOOS + 0xc)
+#define DT_HP_EPLTREL (OLD_DT_LOOS + 0xd)
+#define DT_HP_EPLTRELSZ (OLD_DT_LOOS + 0xe)
+#define DT_HP_FILTERED (OLD_DT_LOOS + 0xf)
+#define DT_HP_FILTER_TLS (OLD_DT_LOOS + 0x10)
+#define DT_HP_COMPAT_FILTERED (OLD_DT_LOOS + 0x11)
+#define DT_HP_LAZYLOAD (OLD_DT_LOOS + 0x12)
+#define DT_HP_BIND_NOW_COUNT (OLD_DT_LOOS + 0x13)
+#define DT_PLT (OLD_DT_LOOS + 0x14)
+#define DT_PLT_SIZE (OLD_DT_LOOS + 0x15)
+#define DT_DLT (OLD_DT_LOOS + 0x16)
+#define DT_DLT_SIZE (OLD_DT_LOOS + 0x17)
/* Values for DT_HP_DLD_FLAGS. */
-#define DT_HP_DEBUG_PRIVATE 0x0001 /* Map text private */
-#define DT_HP_DEBUG_CALLBACK 0x0002 /* Callback */
-#define DT_HP_DEBUG_CALLBACK_BOR 0x0004 /* BOR callback */
-#define DT_HP_NO_ENVVAR 0x0008 /* No env var */
-#define DT_HP_BIND_NOW 0x0010 /* Bind now */
-#define DT_HP_BIND_NONFATAL 0x0020 /* Bind non-fatal */
-#define DT_HP_BIND_VERBOSE 0x0040 /* Bind verbose */
-#define DT_HP_BIND_RESTRICTED 0x0080 /* Bind restricted */
-#define DT_HP_BIND_SYMBOLIC 0x0100 /* Bind symbolic */
-#define DT_HP_RPATH_FIRST 0x0200 /* RPATH first */
-#define DT_HP_BIND_DEPTH_FIRST 0x0400 /* Bind depth-first */
+#define DT_HP_DEBUG_PRIVATE 0x00001 /* Map text private */
+#define DT_HP_DEBUG_CALLBACK 0x00002 /* Callback */
+#define DT_HP_DEBUG_CALLBACK_BOR 0x00004 /* BOR callback */
+#define DT_HP_NO_ENVVAR 0x00008 /* No env var */
+#define DT_HP_BIND_NOW 0x00010 /* Bind now */
+#define DT_HP_BIND_NONFATAL 0x00020 /* Bind non-fatal */
+#define DT_HP_BIND_VERBOSE 0x00040 /* Bind verbose */
+#define DT_HP_BIND_RESTRICTED 0x00080 /* Bind restricted */
+#define DT_HP_BIND_SYMBOLIC 0x00100 /* Bind symbolic */
+#define DT_HP_RPATH_FIRST 0x00200 /* RPATH first */
+#define DT_HP_BIND_DEPTH_FIRST 0x00400 /* Bind depth-first */
+#define DT_HP_GST 0x00800 /* Dld global sym table */
+#define DT_HP_SHLIB_FIXED 0x01000 /* shared vtable support */
+#define DT_HP_MERGE_SHLIB_SEG 0x02000 /* merge shlib data segs */
+#define DT_HP_NODELETE 0x04000 /* never unload */
+#define DT_HP_GROUP 0x08000 /* bind only within group */
+#define DT_HP_PROTECT_LINKAGE_TABLE 0x10000 /* protected linkage table */
/* Program header extensions. */
#define PT_HP_TLS (PT_LOOS + 0x0)
#define PT_HP_CORE_MMF (PT_LOOS + 0x9)
#define PT_HP_PARALLEL (PT_LOOS + 0x10)
#define PT_HP_FASTBIND (PT_LOOS + 0x11)
+#define PT_HP_OPT_ANNOT (PT_LOOS + 0x12)
+#define PT_HP_HSL_ANNOT (PT_LOOS + 0x13)
+#define PT_HP_STACK (PT_LOOS + 0x14)
+#define PT_HP_CORE_UTSNAME (PT_LOOS + 0x15)
+
+/* Binding information. */
+#define STB_HP_ALIAS (STB_LOOS + 0x0)
/* Additional symbol types. */
#define STT_HP_OPAQUE (STT_LOOS + 0x1)
#define STT_HP_STUB (STT_LOOS + 0x2)
+/* Note types. */
+#define NT_HP_COMPILER 1
+#define NT_HP_COPYRIGHT 2
+#define NT_HP_VERSION 3
+#define NT_HP_SRCFILE_INFO 4
+#define NT_HP_LINKER 5
+#define NT_HP_INSTRUMENTED 6
+#define NT_HP_UX_OPTIONS 7
+
#endif /* _ELF_HPPA_H */