aboutsummaryrefslogtreecommitdiff
path: root/elf/elf.h
AgeCommit message (Collapse)AuthorFilesLines
2019-01-01Update copyright dates with scripts/update-copyrights.Joseph Myers1-1/+1
* All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
2018-11-29C-SKY: Add dynamic relocations to elf.hMao Han1-1/+66
* elf/elf.h (EM_CSKY, R_CKCORE_NONE, R_CKCORE_ADDR32) (R_CKCORE_PCRELIMM8BY4, R_CKCORE_PCRELIMM11BY2, R_CKCORE_PCREL32) (R_CKCORE_PCRELJSR_IMM11BY2, R_CKCORE_RELATIVE, R_CKCORE_COPY) (R_CKCORE_GLOB_DAT, R_CKCORE_JUMP_SLOT, R_CKCORE_GOTOFF) (R_CKCORE_GOTPC, R_CKCORE_GOT32, R_CKCORE_PLT32, R_CKCORE_ADDRGOT) (R_CKCORE_ADDRPLT, R_CKCORE_PCREL_IMM26BY2, R_CKCORE_PCREL_IMM16BY2) (R_CKCORE_PCREL_IMM16BY4, R_CKCORE_PCREL_IMM10BY2) (R_CKCORE_PCREL_IMM10BY4, R_CKCORE_ADDR_HI16, R_CKCORE_ADDR_LO16) (R_CKCORE_GOTPC_HI16, R_CKCORE_GOTPC_LO16, R_CKCORE_GOTOFF_HI16) (R_CKCORE_GOTOFF_LO16, R_CKCORE_GOT12, R_CKCORE_GOT_HI16) (R_CKCORE_GOT_LO16, R_CKCORE_PLT12, R_CKCORE_PLT_HI16) (R_CKCORE_PLT_LO16, R_CKCORE_ADDRGOT_HI16, R_CKCORE_ADDRGOT_LO16) (R_CKCORE_ADDRPLT_HI16, R_CKCORE_ADDRPLT_LO16) (R_CKCORE_PCREL_JSR_IMM26BY2, R_CKCORE_TOFFSET_LO16) (R_CKCORE_DOFFSET_LO16, R_CKCORE_PCREL_IMM18BY2) (R_CKCORE_DOFFSET_IMM18, R_CKCORE_DOFFSET_IMM18BY2) (R_CKCORE_DOFFSET_IMM18BY4, R_CKCORE_GOT_IMM18BY4) (R_CKCORE_PLT_IMM18BY4, R_CKCORE_PCREL_IMM7BY4, R_CKCORE_TLS_LE32) (R_CKCORE_TLS_IE32, R_CKCORE_TLS_GD32, R_CKCORE_TLS_LDM32) (R_CKCORE_TLS_LDO32, R_CKCORE_TLS_DTPMOD32, R_CKCORE_TLS_DTPOFF32) (R_CKCORE_TLS_TPOFF32): New defines.
2018-10-25Add new ELF note types from Linux 4.19 to elf.h.Joseph Myers1-0/+2
This patch adds NT_MIPS_DSP and NT_MIPS_FP_MODE from Linux 4.19 to elf.h. Tested for x86_64. * elf/elf.h (NT_MIPS_DSP): New macro. (NT_MIPS_FP_MODE): Likewise.
2018-08-20Add NT_VMCOREDD, AT_MINSIGSTKSZ from Linux 4.18 to elf.h.Joseph Myers1-0/+4
This patch adds two new constants from Linux 4.18 to elf.h, NT_VMCOREDD and AT_MINSIGSTKSZ. Tested for x86_64. * elf/elf.c (NT_VMCOREDD): New macro. (AT_MINSIGSTKSZ): Likewise.
2018-06-21Add Andes nds32 dynamic relocations to elf.hVincent Chen1-0/+10
* elf/elf.h (R_NDS32_NONE): New define. (R_NDS32_32_RELA): Likewise. (R_NDS32_COPY): Likewise. (R_NDS32_GLOB_DAT): Likewise. (R_NDS32_JUMP_SLOT): Likewise. (R_NDS32_RELATIVE): Likewise. (R_NDS32_TLS_TPOFF): Likewise. (R_NDS32_TLS_DESC): Likewise.
2018-06-21elf.h: Add BPF relocation types.Mark Wielaard1-1/+2
The BPF ELF format has new relocation types R_BPF_64_64 and R_BPF_64_32. The existing R_BPF_MAP_FD was an extension that never got implemented. Remove it, because the constant conflicts with the official R_BPF_64_64. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2018-04-23Add NT_PPC_PKEY from Linux 4.16 to elf.h.Joseph Myers1-0/+2
This patch adds the NT_PPC_PKEY macro from Linux 4.16 to elf.h. Tested for x86_64. * elf/elf.h (NT_PPC_PKEY): New macro.
2018-03-26RISC-V: add remaining relocationsAndreas Schwab1-12/+56
2018-03-19Add SHT_X86_64_UNWIND to elf.h (bug 20079).Joseph Myers1-0/+3
As requested in bug 20079, this patch adds SHT_X86_64_UNWIND (a standard value from the x86_64 ABI) to elf.h. Tested for x86_64. [BZ #20079] * elf/elf.h (SHT_X86_64_UNWIND): New macro.
2018-02-06Add elf.h NT_* macros from Linux 4.15 (bug 14890).Joseph Myers1-0/+9
Linux 4.15 adds NT_S390_RI_CB to linux/elf.h (and NT_ARM_SVE, which we already have in glibc). This shows up that various other ELF note values from linux/elf.h are missing from glibc's elf.h. This patch adds the missing values that are relevant to glibc architectures. As elf.h is a general description of the ELF format, not necessarily limited to glibc configurations, there's an argument for having the remaining NT_* values that Linux uses for non-glibc architectures in glibc's elf.h as well, but this patch does not add them. Adding the NT_PRFPREG name is bug 14890. That bug also requests making the NT_FPREGSET name obsolete. Given that elf.h is not just for Linux but can describe ELF for other operating systems, I don't think that a change of name in the Linux kernel is sufficient justification for declaring the other name obsolete; there can be multiple names for the same note value, even with incompatible semantics, if those reflect variants of the ELF format in actual use. For example, FreeBSD appears still to have the name NT_FPREGSET <https://github.com/freebsd/freebsd/blob/master/sys/sys/elf_common.h> (note: I haven't checked whether the FreeBSD kernel actually generates such notes or whether this is actually an other-OS definition present in FreeBSD's header). [BZ #14890] * elf/elf.h (NT_PRFPREG): New macro. (NT_S390_VXRS_LOW): Likewise. (NT_S390_VXRS_HIGH): Likewise. (NT_S390_GS_CB): Likewise. (NT_S390_GS_BC): Likewise. (NT_S390_RI_CB): Likewise.
2018-02-05Add DT_SYMTAB_SHNDX from gABIH.J. Lu1-1/+2
* elf/elf.h (DT_SYMTAB_SHNDX): New. Set to 34. (DT_NUM): Updated to 35.
2018-01-25Add support for the RISC-V-specific ELF flagsPalmer Dabbelt1-0/+8
The RISC-V port defines ELF flags that enforce compatibility between various objects. This adds the shared support necessary for these flags. 2018-01-25 Palmer Dabbelt <palmer@sifive.com> * elf/cache.c (print_entry): Add FLAG_RISCV_FLOAT_ABI_SOFT and FLAG_RISCV_FLOAT_ABI_DOUBLE. * elf/elf.h (EF_RISCV_RVC): New define. (EF_RISCV_FLOAT_ABI): Likewise. (EF_RISCV_FLOAT_ABI_SOFT): Likewise. (EF_RISCV_FLOAT_ABI_SINGLE): Likewise. (EF_RISCV_FLOAT_ABI_DOUBLE): Likewise. (EF_RISCV_FLOAT_ABI_QUAD): Likewise. * sysdeps/generic/ldconfig.h (FLAG_RISCV_FLOAT_ABI_SOFT): New define. (FLAG_RISCV_FLOAT_ABI_DOUBLE): Likewise.
2018-01-15Add NT_ARM_SVE to elf.hAlan Hayward1-0/+2
This definition is for AArch64 SVE registers in elf core dumps. * elf/elf.h (NT_ARM_SVE): Define.
2018-01-13Synchronize DF_1_* flags with binutils (Bug 22707)Carlos O'Donell1-0/+2
This patch synchronizes DF_1_* flags with binutils and ensures that all DF_1_* flags defined in binutil's include/elf/common.h are also defined glibc's elf/elf.h. This is a user visible change since elf/elf.h is installed by default as /usr/include/elf.h. Signed-off-by: Carlos O'Donell <carlos@redhat.com>
2018-01-06Add RISC-V dynamic relocations to elf.hPalmer Dabbelt1-0/+14
These relocations can appear in shared objects on RISC-V ELF systems. 2018-01-06 Palmer Dabbelt <palmer@sifive.com> * elf/elf.h (R_RISCV_NONE): New define. (R_RISCV_32): Likewise. (R_RISCV_64): Likewise. (R_RISCV_RELATIVE): Likewise. (R_RISCV_COPY): Likewise. (R_RISCV_JUMP_SLOT): Likewise. (R_RISCV_TLS_DTPMOD32): Likewise. (R_RISCV_TLS_DTPMOD64): Likewise. (R_RISCV_TLS_DTPREL32): Likewise. (R_RISCV_TLS_DTPREL64): Likewise. (R_RISCV_TLS_TPREL32): Likewise. (R_RISCV_TLS_TPREL64): Likewise.
2018-01-01Update copyright dates with scripts/update-copyrights.Joseph Myers1-1/+1
* All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
2017-08-18Add NT_GNU_PROPERTY_TYPE_0 macrosH.J. Lu1-0/+56
Add macros used in GNU .note.gnu.property notes (NT_GNU_PROPERTY_TYPE_0). * elf/elf.h (NT_GNU_PROPERTY_TYPE_0): New. (NOTE_GNU_PROPERTY_SECTION_NAME): Likewise. (GNU_PROPERTY_STACK_SIZE): Likewie. (GNU_PROPERTY_NO_COPY_ON_PROTECTED): Likewie. (GNU_PROPERTY_LOPROC): Likewise. (GNU_PROPERTY_HIPROC): Likewise. (GNU_PROPERTY_LOUSER): Likewise. (GNU_PROPERTY_HIUSER): Likewise. (GNU_PROPERTY_X86_ISA_1_USED): Likwise. (GNU_PROPERTY_X86_ISA_1_NEEDED): Likwise. (GNU_PROPERTY_X86_FEATURE_1_AND): Likwise. (GNU_PROPERTY_X86_ISA_1_486): Likwise. (GNU_PROPERTY_X86_ISA_1_586): Likwise. (GNU_PROPERTY_X86_ISA_1_686): Likwise. (GNU_PROPERTY_X86_ISA_1_SSE): Likwise. (GNU_PROPERTY_X86_ISA_1_SSE2): Likwise. (GNU_PROPERTY_X86_ISA_1_SSE3): Likwise. (GNU_PROPERTY_X86_ISA_1_SSSE3): Likwise. (GNU_PROPERTY_X86_ISA_1_SSE4_1): Likwise. (GNU_PROPERTY_X86_ISA_1_SSE4_2): Likwise. (GNU_PROPERTY_X86_ISA_1_AVX): Likwise. (GNU_PROPERTY_X86_ISA_1_AVX2): Likwise. (GNU_PROPERTY_X86_ISA_1_AVX512F): Likwise. (GNU_PROPERTY_X86_ISA_1_AVX512CD): Likwise. (GNU_PROPERTY_X86_ISA_1_AVX512ER): Likwise. (GNU_PROPERTY_X86_ISA_1_AVX512PF): Likwise. (GNU_PROPERTY_X86_ISA_1_AVX512VL): Likwise. (GNU_PROPERTY_X86_ISA_1_AVX512DQ): Likwise. (GNU_PROPERTY_X86_ISA_1_AVX512BW): Likwise. (GNU_PROPERTY_X86_FEATURE_1_IBT): Likwise. (GNU_PROPERTY_X86_FEATURE_1_SHSTK): Likwise.
2017-08-15powerpc: Add values from Linux 4.8 to <elf.h>Gustavo Romero1-0/+16
Add powerpc specific note sections available since Linux v4.8. * elf/elf.h A (NT_PPC_TAR): New macro. (NT_PPC_PPR): Likewise. (NT_PPC_DSCR): Likewise. (NT_PPC_EBB): Likewise. (NT_PPC_PMU): Likewise. (NT_PPC_TM_CGPR): Likewise. (NT_PPC_TM_CFPR): Likewise. (NT_PPC_TM_CVMX): Likewise. (NT_PPC_TM_CVSX): Likewise. (NT_PPC_TM_SPR): Likewise. (NT_PPC_TM_CTAR): Likewise. (NT_PPC_TM_CPPR): Likewise. (NT_PPC_TM_CDSCR): Likewise.
2017-06-14PowerPC64 ELFv2 PPC64_OPT_LOCALENTRYAlan Modra1-1/+2
ELFv2 functions with localentry:0 are those with a single entry point, ie. global entry == local entry, that have no requirement on r2 or r12 and guarantee r2 is unchanged on return. Such an external function can be called via the PLT without saving r2 or restoring it on return, avoiding a common load-hit-store for small functions. This patch implements the ld.so changes necessary for this optimization. ld.so needs to check that an optimized plt call sequence is in fact calling a function implemented with localentry:0, end emit a fatal error otherwise. The elf/testobj6.c change is to stop "error while loading shared libraries: expected localentry:0 `preload'" when running elf/preloadtest, which we'd get otherwise. * elf/elf.h (PPC64_OPT_LOCALENTRY): Define. * sysdeps/alpha/dl-machine.h (elf_machine_fixup_plt): Add refsym and sym parameters. Adjust callers. * sysdeps/aarch64/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/arm/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/generic/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/hppa/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/i386/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/ia64/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/m68k/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/microblaze/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/mips/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/nios2/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/s390/s390-32/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/s390/s390-64/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sh/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/tile/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/x86_64/dl-machine.h (elf_machine_fixup_plt): Likewise. * sysdeps/powerpc/powerpc64/dl-machine.c (_dl_error_localentry): New. (_dl_reloc_overflow): Increase buffser size. Formatting. * sysdeps/powerpc/powerpc64/dl-machine.h (ppc64_local_entry_offset): Delete reloc param, add refsym and sym. Check optimized plt call stubs for localentry:0 functions. Adjust callers. (elf_machine_fixup_plt, elf_machine_plt_conflict): Add refsym and sym parameters. Adjust callers. (_dl_reloc_overflow): Move attribute. (_dl_error_localentry): Declare. * elf/dl-runtime.c (_dl_fixup): Save original sym. Pass refsym and sym to elf_machine_fixup_plt. * elf/testobj6.c (preload): Call printf.
2017-04-11Support auxilliary vector components for cache geometries.Paul Clarke1-0/+12
Add support to getauxval() for new types to get L1, L2, L3 cache sizes, cache line sizes, and cache associativities. The new types for getauxval() were added in the stream for Linux kernel v4.11 in commit 98a5f361b8625c6f4841d6ba013bbf0e80d08147. * elf/elf.h (AT_L1I_CACHESIZE, AT_L1I_CACHEGEOMETRY, AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY, AT_L2_CACHESIZE, AT_L2_CACHEGEOMETRY, AT_L3_CACHESIZE, AT_L3_CACHEGEOMETRY): New. Add auxvec identifiers from kernel arch/powerpc/include/uapi/asm/auxvec.h.
2017-01-01Update copyright dates with scripts/update-copyrights.Joseph Myers1-1/+1
2016-07-19elf/elf.h: Add missing Meta relocationsWill Newton1-0/+15
2016-07-19 Will Newton <will.newton@gmail.com> * elf/elf.h (R_METAG_REL8, R_METAG_REL16, R_METAG_TLS_GD R_METAG_TLS_LDM, R_METAG_TLS_LDO_HI16, R_METAG_TLS_LDO_LO16, R_METAG_TLS_LDO, R_METAG_TLS_IE, R_METAG_TLS_IENONPIC, R_METAG_TLS_IENONPIC_HI16, R_METAG_TLS_IENONPIC_LO16, R_METAG_TLS_LE, R_METAG_TLS_LE_HI16, R_METAG_TLS_LE_LO16): New.
2016-07-18elf: Define missing Meta architecture specific relocationsKhem Raj1-0/+47
2016-06-28elf.h: Add declarations for BPFRichard Henderson1-1/+7
The EM_BPF number has been officially assigned, though it has not yet been posted to the gabi webpage yet. * elf/elf.h (EM_BPF): New. (EM_NUM): Update. (R_BPF_NONE, R_BPF_MAP_FD): New.
2016-06-28elf.h: Sync with the gabi webpageRichard Henderson1-83/+192
http://www.sco.com/developers/gabi/latest/ch4.eheader.html Retrieved 2016-06-20. * elf/elf.h (EM_IAMCU, EM_SPU, EM_PDP10, EM_PDP11, EM_ARC_COMPACT, EM_VIDEOCORE, EM_TMM_GPP, EM_NS32K, EM_TPC, EM_SNP1K, EM_ST200, EM_IP2K, EM_MAX, EM_CR, EM_F2MC16, EM_MSP430, EM_BLACKFIN, EM_SE_C33, EM_SEP, EM_ARCA, EM_UNICORE, EM_EXCESS, EM_DXP, EM_ALTERA_NIOS2, EM_CRX, EM_XGATE, EM_C166, EM_M16C, EM_DSPIC30F, EM_CE, EM_M32C, EM_TSK3000, EM_RS08, EM_SHARC, EM_ECOG2, EM_SCORE7, EM_DSP24, EM_VIDEOCORE3, EM_LATTICEMICO32, EM_SE_C17, EM_TI_C6000, EM_TI_C2000, EM_TI_C5500, EM_TI_ARP32, EM_TI_PRU, EM_MMDSP_PLUS, EM_CYPRESS_M8C, EM_R32C, EM_TRIMEDIA, EM_QDSP6, EM_8051, EM_STXP7X, EM_NDS32, EM_ECOG1X, EM_MAXQ30, EM_XIMO16, EM_MANIK, EM_CRAYNV2, EM_RX, EM_METAG, EM_MCST_ELBRUS, EM_ECOG16, EM_CR16, EM_ETPU, EM_SLE9X, EM_L10M, EM_K10M, EM_AVR32, EM_STM8, EM_TILE64, EM_CUDA, EM_CLOUDSHIELD, EM_COREA_1ST, EM_COREA_2ND, EM_ARC_COMPACT2, EM_OPEN8, EM_RL78, EM_VIDEOCORE5, EM_78KOR, EM_56800EX, EM_BA1, EM_BA2, EM_XCORE, EM_MCHP_PIC, EM_KM32, EM_KMX32, EM_EMX16, EM_EMX8, EM_KVARC, EM_CDP, EM_COGE, EM_COOL, EM_NORC, EM_CSR_KALIMBA, EM_Z80, EM_VISIUM, EM_FT32, EM_MOXIE, EM_AMDGPU, EM_RISCV): New. (EM_NUM): Update.
2016-02-19elf.h: Add NT_ARM_SYSTEM_CALL constant.Mark Wielaard1-0/+1
Linux kernel 3.18 added the NT_ARM_SYSTEM_CALL regset for aarch64. * elf/elf.h: Add NT_ARM_SYSTEM_CALL.
2016-02-19elf/elf.h: Add new 386 and X86_64 relocations from binutils.Mark Wielaard1-3/+12
The following new 386 and X86_64 were added to binutils. They are non-dynamic relocations, so don't need direct handling in glibc. But other programs, like elfutils, use the glibc elf.h definitions for the names and numbers when inspecting ET_REL files. R_386_GOT32X was proposed in https://groups.google.com/forum/#!topic/ia32-abi/GbJJskkid4I X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX were proposed in https://groups.google.com/forum/#!topic/x86-64-abi/n9AWHogmVY0 There also used to be R_X86_64_PC32_BND and R_X86_64_PLT32_BND but those already got deprecated in https://groups.google.com/d/msg/x86-64-abi/-hdQyMixt8Y/XFDOvioG85cJ * elf/elf.h (R_386_GOT32X): New. (R_386_NUM): Update. (R_X86_64_GOTPCRELX: New. (R_X86_64_REX_GOTPCRELX): New. (R_X86_64_NUM): Update.
2016-01-31Revert "elf/elf.h: Add new 386 and X86_64 relocations from binutils."Mark Wielaard1-12/+3
This reverts commit 3da75f08818fa3d217e5d566477c7001cb774792. glibc 2.23 hard freeze doesn't allow this change at this time.
2016-01-31elf/elf.h: Add new 386 and X86_64 relocations from binutils.Mark Wielaard1-3/+12
The following new 386 and X86_64 were added to binutils. They are non-dynamic relocations, so don't need direct handling in glibc. But other programs, like elfutils, use the glibc elf.h definitions for the names and numbers when inspecting ET_REL files. R_386_GOT32X was proposed in https://groups.google.com/forum/#!topic/ia32-abi/GbJJskkid4I X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX were proposed in https://groups.google.com/forum/#!topic/x86-64-abi/n9AWHogmVY0 There also used to be R_X86_64_PC32_BND and R_X86_64_PLT32_BND but those already got deprecated in https://groups.google.com/d/msg/x86-64-abi/-hdQyMixt8Y/XFDOvioG85cJ * elf/elf.h (R_386_GOT32X): New. (R_386_NUM): Update. (R_X86_64_GOTPCRELX: New. (R_X86_64_REX_GOTPCRELX): New. (R_X86_64_NUM): Update.
2016-01-04Update copyright dates with scripts/update-copyrights.Joseph Myers1-1/+1
2015-06-26Add support for DT_MIPS_RLD_MAP_REL.Matthew Fortune1-1/+5
This tag allows debugging of MIPS position independent executables and provides access to shared library information. * elf/elf.h (DT_MIPS_RLD_MAP_REL): New macro. (DT_MIPS_NUM): Update. * sysdeps/mips/dl-machine.h (ELF_MACHINE_DEBUG_SETUP): Handle DT_MIPS_RLD_MAP_REL.
2015-05-01elf.h: Add section compression constants and structures.Mark Wielaard1-0/+25
Add SHF_COMPRESSED section flag, Elf32_Chdr and Elf64_Chdr structs and ELFCOMPRESS constants to elf/elf.h.
2015-04-28elf.h SHF_EXCLUDE signed int 31 bit shift triggers undefined behaviour.Mark Wielaard1-1/+1
Any use of SHF_EXCLUDE in code that tries to check it against sh_flags will trigger undefined behaviour because it is defined as a 31 bit shift against an signed integer. Fix by explicitly using an unsigned int.
2015-03-25powerpc __tls_get_addr call optimizationAlan Modra1-1/+7
This patch is glibc support for a PowerPC TLS optimization, inspired by Alexandre Oliva's TLS optimization for other processors, http://www.lsd.ic.unicamp.br/~oliva/writeups/TLS/RFC-TLSDESC-x86.txt In essence, this optimization uses a zero module id in the tls_index GOT entry to indicate that a TLS variable is allocated space in the static TLS area. A special plt call linker stub for __tls_get_addr checks for such a tls_index and if found, returns the offset immediately. The linker communicates the fact that the special __tls_get_addr stub is used by setting a bit in the dynamic tag DT_PPC64_OPT/DT_PPC_OPT. glibc communicates to the linker that this optimization is available by the presence of __tls_get_addr_opt. tst-tlsmod2.so is built with -Wl,--no-tls-get-addr-optimize for tst-tls-dlinfo, which otherwise would fail since it tests that no static tls is allocated. The ld option --no-tls-get-addr-optimize has been available since binutils-2.20 so doesn't need a configure test. * NEWS: Advertise TLS optimization. * elf/elf.h (R_PPC_TLSGD, R_PPC_TLSLD, DT_PPC_OPT, PPC_OPT_TLS): Define. (DT_PPC_NUM): Increment. * elf/dynamic-link.h (HAVE_STATIC_TLS): Define. (CHECK_STATIC_TLS): Use here. * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela): Optimize TLS descriptors. * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela): Likewise. * sysdeps/powerpc/dl-tls.c: New file. * sysdeps/powerpc/Versions: Add __tls_get_addr_opt. * sysdeps/powerpc/tst-tlsopt-powerpc.c: New tls test. * sysdeps/unix/sysv/linux/powerpc/Makefile: Add new test. Build tst-tlsmod2.so with --no-tls-get-addr-optimize. * sysdeps/unix/sysv/linux/powerpc/powerpc32/ld.abilist: Update. * sysdeps/unix/sysv/linux/powerpc/powerpc64/ld.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/ld-le.abilist: Likewise.
2015-01-08Add Nios II definitions to elf/elf.h.Chung-Lin Tang1-0/+53
2015-01-02Update copyright dates with scripts/update-copyrights.Joseph Myers1-1/+1
2014-12-31Add support for MIPS O32 FPXX and .MIPS.abiflagsMatthew Fortune1-3/+100
* elf/elf.h (PT_MIPS_ABIFLAGS): Define. (Elf_MIPS_ABIFlags_v0): New structure. (EF_MIPS_FP64): Define. (MIPS_AFL_REG_NONE, MIPS_AFL_REG_32, MIPS_AFL_REG_64): Likewise. (MIPS_AFL_REG_128, MIPS_AFL_ASE_DSP, MIPS_AFL_ASE_DSP64): Likewise. (MIPS_AFL_ASE_DSPR2, MIPS_AFL_ASE_EVA, MIPS_AFL_ASE_MCU): Likewise. (MIPS_AFL_ASE_MDMX, MIPS_AFL_ASE_MIPS3D, MIPS_AFL_ASE_MT): Likewise. (MIPS_AFL_ASE_SMARTMIPS, MIPS_AFL_ASE_VIRT): Likewise. (MIPS_AFL_ASE_VIRT64, MIPS_AFL_ASE_MSA, MIPS_AFL_ASE_MSA64): Likewise. (MIPS_AFL_ASE_MIPS16, MIPS_AFL_ASE_MICROMIPS): Likewise. (MIPS_AFL_ASE_XPA, MIPS_AFL_EXT_XLR, MIPS_AFL_EXT_OCTEON2): Likewise. (MIPS_AFL_EXT_OCTEONP, MIPS_AFL_EXT_LOONGSON_3A): Likewise. (MIPS_AFL_EXT_OCTEON, MIPS_AFL_EXT_5900, MIPS_AFL_EXT_4010): Likewise. (MIPS_AFL_EXT_4100, MIPS_AFL_EXT_3900, MIPS_AFL_EXT_10000): Likewise. (MIPS_AFL_EXT_SB1, MIPS_AFL_EXT_4111, MIPS_AFL_EXT_4120): Likewise. (MIPS_AFL_EXT_5400, MIPS_AFL_EXT_5500): Likewise. (MIPS_AFL_EXT_LOONGSON_2E, MIPS_AFL_EXT_LOONGSON_2F): Likewise. (Val_GNU_MIPS_ABI_FP_ANY, Val_GNU_MIPS_ABI_FP_DOUBLE): New enum values. (Val_GNU_MIPS_ABI_FP_SINGLE, Val_GNU_MIPS_ABI_FP_SOFT): Likewise. (Val_GNU_MIPS_ABI_FP_OLD_64, Val_GNU_MIPS_ABI_FP_XX): Likewise. (Val_GNU_MIPS_ABI_FP_64, Val_GNU_MIPS_ABI_FP_64A): Likewise. (Val_GNU_MIPS_ABI_FP_MAX): Likewise. * sysdeps/mips/Makefile [subdir=elf]: Add tst-abi-interlink, tst-mode-switch-1, tst-mode-switch-2, tst-mode-switch-3 tests. * sysdeps/mips/bits/linkmap.h (struct link_map_machine): Add fpmode field. * sysdeps/mips/dl-machine.h (elf_machine_matches_host): Reject EF_MIPS_FP64. * sysdeps/mips/dl-machine-reject-phdr.h: New file. * sysdeps/mips/tst-abi-fp32mod.c: Likewise. * sysdeps/mips/tst-abi-fpxxmod.c: Likewise. * sysdeps/mips/tst-abi-fpxxomod.c: Likewise. * sysdeps/mips/tst-abi-fp64mod.c: Likewise. * sysdeps/mips/tst-abi-fp64amod.c: Likewise. * sysdeps/mips/tst-abi-interlink.c: Likewise. * sysdeps/mips/tst-mode-switch-1.c: Likewise. * sysdeps/mips/tst-mode-switch-2.c: Likewise. * sysdeps/mips/tst-mode-switch-3.c: Likewise. * sysdeps/unix/sysv/linux/mips/configure.ac (o32-fpabi): Define to record the current FP ABI extension. (mips-mode-switch): Define to show if kernel headers support mode switching. * sysdeps/unix/sysv/linux/mips/configure: Regenerate. * sysdeps/unix/sysv/linux/mips/ldsodefs.h: Increase maximum supported SYSV ABI version to 3. * sysdeps/unix/sysv/linux/mips/libc-abis: Add new MIPS_O32_FP64 feature.
2014-11-21AArch64: Update relocations for ILP32Will Newton1-3/+17
The latest version of the binutils ELF header defines a new set of dynamic relocations for ILP32 and renames some to make the naming more uniform. ChangeLog: 2014-11-21 Will Newton <will.newton@linaro.org> Andrew Pinski <andrew.pinski@caviumnetworks.com> * elf/elf.h (R_AARCH64_P32_ABS32, R_AARCH64_P32_COPY, R_AARCH64_P32_GLOB_DAT, R_AARCH64_P32_JUMP_SLOT, R_AARCH64_P32_RELATIVE, R_AARCH64_P32_TLS_DTPMOD, R_AARCH64_P32_TLS_DTPREL, R_AARCH64_P32_TLS_TPREL, R_AARCH64_P32_TLSDESC, R_AARCH64_P32_IRELATIVE): Define. (R_AARCH64_TLS_DTPMOD64): Rename to .. (R_AARCH64_TLS_DTPMOD): This. (R_AARCH64_TLS_DTPREL64): Rename to ... (R_AARCH64_TLS_DTPREL): This. (R_AARCH64_TLS_TPREL64): Rename to ... (R_AARCH64_TLS_TPREL): This. * sysdeps/aarch64/dl-machine.h (elf_machine_type_class): Update R_AARCH64_TLS_DTPMOD64, R_AARCH64_TLS_DTPREL64, and R_AARCH64_TLS_TPREL64. (elf_machine_rela): Likewise.
2014-07-14Correct DT_PPC64_NUMAlan Modra1-1/+1
[BZ #17153] * elf/elf.h (DT_PPC64_NUM): Correct value. * NEWS: Add to fixed bug list.
2014-01-01Update copyright notices with scripts/update-copyrightsAllan McRae1-1/+1
2013-12-04PowerPC64 ELFv2 ABI 3/6: PLT local entry point optimizationUlrich Weigand1-0/+11
This is a follow-on to the previous patch to support the ELFv2 ABI in the dynamic loader, split off into its own patch since it is just an optional optimization. In the ELFv2 ABI, most functions define both a global and a local entry point; the local entry requires r2 to be already set up by the caller to point to the callee's TOC; while the global entry does not require the caller to know about the callee's TOC, but it needs to set up r12 to the callee's entry point address. Now, when setting up a PLT slot, the dynamic linker will usually need to enter the target function's global entry point. However, if the linker can prove that the target function is in the same DSO as the PLT slot itself, and the whole DSO only uses a single TOC (which the linker will let ld.so know via a DT_PPC64_OPT entry), then it is possible to actually enter the local entry point address into the PLT slot, for a slight improvement in performance. Note that this uncovered a problem on the first call via _dl_runtime_resolve, because that routine neglected to restore the caller's TOC before calling the target function for the first time, since it assumed that function would always reload its own TOC anyway ...
2013-12-04PowerPC64 ELFv2 ABI 2/6: Remove function descriptorsUlrich Weigand1-0/+6
This patch adds support for the ELFv2 ABI feature to remove function descriptors. See this GCC patch for in-depth discussion: http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01141.html This mostly involves two types of changes: updating assembler source files to the new logic, and updating the dynamic loader. After the refactoring in the previous patch, most of the assembler source changes can be handled simply by providing ELFv2 versions of the macros in sysdep.h. One somewhat non-obvious change is in __GI__setjmp: this used to "fall through" to the immediately following __setjmp ENTRY point. This is no longer safe in the ELFv2 since ENTRY defines both a global and a local entry point, and you cannot simply fall through to a global entry point as it requires r12 to be set up. Also, makecontext needs to be updated to set up registers according to the new ABI for calling into the context's start routine. The dynamic linker changes mostly consist of removing special code to handle function descriptors. We also need to support the new PLT and glink format used by the the ELFv2 linker, see: https://sourceware.org/ml/binutils/2013-10/msg00376.html In addition, the dynamic linker now verifies that the dynamic libraries it loads match its own ABI. The hack in VDSO_IFUNC_RET to "synthesize" a function descriptor for vDSO routines is also no longer necessary for ELFv2.
2013-12-04PowerPC64: Report overflow on @h and @ha relocationsAlan Modra1-0/+11
This patch updates glibc in accordance with the binutils patch checked in here: https://sourceware.org/ml/binutils/2013-10/msg00372.html This changes the various R_PPC64_..._HI and _HA relocations to report 32-bit overflows. The motivation is that existing uses of @h / @ha are to build up 32-bit offsets (for the "medium model" TOC access that GCC now defaults to), and we'd really like to see failures at link / load time rather than silent truncations. For those rare cases where a modifier is needed to build up a 64-bit constant, new relocations _HIGH / _HIGHA are supported. The patch also fixes a bug in overflow checking for the R_PPC64_ADDR30 and R_PPC64_ADDR32 relocations.
2013-09-30Add AArch64 relocation definitions.Petr Machata1-0/+112
2013-09-18MIPS: IEEE 754-2008 NaN encoding supportMaciej W. Rozycki1-0/+1
It has been a long practice for software using IEEE 754 floating-point arithmetic run on MIPS processors to use an encoding of Not-a-Number (NaN) data different to one used by software run on other processors. And as of IEEE 754-2008 revision [1] this encoding does not follow one recommended in the standard, as specified in section 6.2.1, where it is stated that quiet NaNs should have the first bit (d1) of their significand set to 1 while signalling NaNs should have that bit set to 0, but MIPS software interprets the two bits in the opposite manner. As from revision 3.50 [2][3] the MIPS Architecture provides for processors that support the IEEE 754-2008 preferred NaN encoding format. As the two formats (further referred to as "legacy NaN" and "2008 NaN") are incompatible to each other, tools have to provide support for the two formats to help people avoid using incompatible binary modules. The change is comprised of two functional groups of features, both of which are required for correct support. 1. Dynamic linker support. To enforce the NaN encoding requirement in dynamic linking a new ELF file header flag has been defined. This flag is set for 2008-NaN shared modules and executables and clear for legacy-NaN ones. The dynamic linker silently ignores any incompatible modules it encounters in dependency processing. To avoid unnecessary processing of incompatible modules in the presence of a shared module cache, a set of new cache flags has been defined to mark 2008-NaN modules for the three ABIs supported. Changes to sysdeps/unix/sysv/linux/mips/readelflib.c have been made following an earlier code quality suggestion made here: http://sourceware.org/ml/libc-ports/2009-03/msg00036.html and are therefore a little bit more extensive than the minimum required. Finally a new name has been defined for the dynamic linker so that 2008-NaN and legacy-NaN binaries can coexist on a single system that supports dual-mode operation and that a legacy dynamic linker that does not support verifying the 2008-NaN ELF file header flag is not chosen to interpret a 2008-NaN binary by accident. 2. Floating environment support. IEEE 754-2008 features are controlled in the Floating-Point Control and Status (FCSR) register and updates are needed to floating environment support so that the 2008-NaN flag is set correctly and the kernel default, inferred from the 2008-NaN ELF file header flag at the time an executable is loaded, respected. As the NaN encoding format is a property of GCC code generation that is both a user-selected GCC configuration default and can be overridden with GCC options, code that needs to know what NaN encoding standard it has been configured for checks for the __mips_nan2008 macro that is defined internally by GCC whenever the 2008-NaN mode has been selected. This mode is determined at the glibc configuration time and therefore a few consistency checks have been added to catch cases where compilation flags have been overridden by the user. The 2008 NaN set of features relies on kernel support as the in-kernel floating-point emulator needs to be aware of the NaN encoding used even on hard-float processors and configure the FPU context according to the value of the 2008 NaN ELF file header flag of the executable being started. As at this time work on kernel support is still in progress and the relevant changes have not made their way yet to linux.org master repository. Therefore the minimum version supported has been artificially set to 10.0.0 so that 2008-NaN code is not accidentally run on a Linux kernel that does not suppport it. It is anticipated that the version is adjusted later on to the actual initial linux.org kernel version to support this feature. Legacy NaN encoding support is unaffected, older kernel versions remain supported. [1] "IEEE Standard for Floating-Point Arithmetic", IEEE Computer Society, IEEE Std 754-2008, 29 August 2008 [2] "MIPS Architecture For Programmers, Volume I-A: Introduction to the MIPS32 Architecture", MIPS Technologies, Inc., Document Number: MD00082, Revision 3.50, September 20, 2012 [3] "MIPS Architecture For Programmers, Volume I-A: Introduction to the MIPS64 Architecture", MIPS Technologies, Inc., Document Number: MD00083, Revision 3.50, September 20, 2012
2013-08-29Fix typos.Ondřej Bílka1-1/+1
2013-06-26Add AT_HWCAP2 as a new auxv_t a_type to elf.h.Ryan S. Arnold1-1/+4
2013-04-16Adding MicroBlaze support to elf/elf.hDavid Holsgrove1-0/+32
Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
2013-02-20Add ARM relocation constants to elf/elf.h.Petr Machata1-18/+119
2013-01-16Implement x86 SIZE32/SIZE64 relocationsH.J. Lu1-1/+1