about summary refs log tree commit diff
path: root/elf/elf.h
Commit message (Collapse)AuthorAgeFilesLines
* Add support for DT_MIPS_RLD_MAP_REL.Matthew Fortune2015-06-261-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.
* elf.h: Add section compression constants and structures.Mark Wielaard2015-05-011-0/+25
| | | | | Add SHF_COMPRESSED section flag, Elf32_Chdr and Elf64_Chdr structs and ELFCOMPRESS constants to elf/elf.h.
* elf.h SHF_EXCLUDE signed int 31 bit shift triggers undefined behaviour.Mark Wielaard2015-04-281-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.
* powerpc __tls_get_addr call optimizationAlan Modra2015-03-251-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.
* Add Nios II definitions to elf/elf.h.Chung-Lin Tang2015-01-081-0/+53
|
* Update copyright dates with scripts/update-copyrights.Joseph Myers2015-01-021-1/+1
|
* Add support for MIPS O32 FPXX and .MIPS.abiflagsMatthew Fortune2014-12-311-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.
* AArch64: Update relocations for ILP32Will Newton2014-11-211-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.
* Correct DT_PPC64_NUMAlan Modra2014-07-141-1/+1
| | | | | | [BZ #17153] * elf/elf.h (DT_PPC64_NUM): Correct value. * NEWS: Add to fixed bug list.
* Update copyright notices with scripts/update-copyrightsAllan McRae2014-01-011-1/+1
|
* PowerPC64 ELFv2 ABI 3/6: PLT local entry point optimizationUlrich Weigand2013-12-041-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 ...
* PowerPC64 ELFv2 ABI 2/6: Remove function descriptorsUlrich Weigand2013-12-041-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.
* PowerPC64: Report overflow on @h and @ha relocationsAlan Modra2013-12-041-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.
* Add AArch64 relocation definitions.Petr Machata2013-09-301-0/+112
|
* MIPS: IEEE 754-2008 NaN encoding supportMaciej W. Rozycki2013-09-181-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
* Fix typos.Ondřej Bílka2013-08-291-1/+1
|
* Add AT_HWCAP2 as a new auxv_t a_type to elf.h.Ryan S. Arnold2013-06-261-1/+4
|
* Adding MicroBlaze support to elf/elf.hDavid Holsgrove2013-04-161-0/+32
| | | | Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
* Add ARM relocation constants to elf/elf.h.Petr Machata2013-02-201-18/+119
|
* Implement x86 SIZE32/SIZE64 relocationsH.J. Lu2013-01-161-1/+1
|
* 2013-01-11 Steve Ellcey <sellcey@mips.com>Steve Ellcey2013-01-111-2/+4
| | | | | | | * elf/elf.h (EF_MIPS_ARCH_32): Fix value. (EF_MIPS_ARCH_64): Fix value. (EF_MIPS_ARCH_32R2): New. (EF_MIPS_ARCH_64R2): New.
* Fix whitespace in elf.h MIPS macros.Roland McGrath2013-01-101-86/+86
|
* Update copyright notices with scripts/update-copyrights.Joseph Myers2013-01-021-1/+1
|
* Add values from Linux 3.7 to <elf.h>Andreas Jaeger2012-12-281-0/+5
|
* Check supported DF_1_XXX bitsH.J. Lu2012-11-211-0/+9
|
* Adjust comment above AArch64 relocs.Marcus Shawcroft2012-11-081-1/+1
|
* Adding AArch64 support to elf/elf.hMarcus Shawcroft2012-11-071-0/+18
|
* elf.h: add new tilegx relocations (copy from binutils trunk)Chris Metcalf2012-11-031-3/+14
|
* Synchronize with linux/elf.h.Petr Machata2012-09-061-0/+9
| | | | Add new ARM and s390 note constants e.g. NT_*.
* Check floating-point ABI in ARM VALID_ELF_HEADER.Steve McIntyre2012-08-231-0/+3
|
* Add new AM33 relocsMark Salter2012-08-081-2/+17
|
* S/390: Add support for STT_GNU_IFUNC symbols.Andreas Krebbel2012-07-191-1/+2
| | | | | | Add support for STT_GNU_IFUNC symbols and the new R_390_IRELATIVE relocation. Provide optimized version of memcpy, memset, and memcmp for z10 and z196.
* Handle R_X86_64_RELATIVE64 and R_X86_64_64 for x32H.J. Lu2012-05-101-1/+2
|
* Handle some new sparc relocation types.David S. Miller2012-04-071-0/+1
| | | | | | | | * elf/elf.h (R_SPARC_WDISP10): Define. * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Handle R_SPARC_SIZE32. * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Handle R_SPARC_SIZE64 and R_SPARC_H34.
* Replace FSF snail mail address with URLs.Paul Eggert2012-02-091-3/+2
|
* Add Tile relocation types.Chris Metcalf2012-01-301-3/+219
|
* Define ELFOSABI_GNU.Roland McGrath2011-09-091-1/+2
|
* Sanitize HWCAP_SPARC_* defines/usage, and add new entries.David S. Miller2011-09-011-11/+0
|
* elf.h: Define R_ARM_IRELATIVE reloc type.Richard Sandiford2011-04-191-1/+2
|
* elf/elf.h: Add new ARM TLS relocs.Nathan Sidwell2011-02-181-1/+7
|
* elf/elf.h: Add SH specific ELF header flags.Matt Fleming2010-04-131-0/+24
|
* elf/elf.h (ELFOSABI_ARM_AEABI): Define.Joseph Myers2010-04-051-0/+1
|
* elf.h: Add missing R_X86_64_*64 relocs.Roland McGrath2010-03-111-1/+7
|
* Define new x86-64 relocation symbolsUlrich Drepper2010-03-041-1/+3
|
* Define NT_X86_XSTATE constant for ELF core files.Roland McGrath2010-02-281-0/+1
|
* Sparc STT_GNU_IFUNC supportDavid S. Miller2010-02-101-0/+2
|
* Add m68k TLS relocationsMaxim Kuvyrkov2010-02-101-1/+22
|
* /390: Add runtime check for the highgprs kernel feature.Andreas Krebbel2010-01-151-0/+6
|
* Add new ELF constant PN_XNUM.Roland McGrath2010-01-071-1/+7
|
* Implement IFUNC for PPC.Alan Modra2009-10-301-9/+14
|