about summary refs log tree commit diff
path: root/elf
Commit message (Collapse)AuthorAgeFilesLines
* MIPS: IEEE 754-2008 NaN encoding supportMaciej W. Rozycki2013-09-182-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 static-binary lazy FPU context allocationMaciej W. Rozycki2013-09-091-0/+6
| | | | | | | | | | | | | | | | | | | Long ago static startup did not parse the auxiliary vector and therefore could not get at any `AT_FPUCW' tag to check whether upon FPU context allocation the kernel would use a FPU control word setting different to that provided by the `__fpu_control' variable. Static startup therefore always initialized the FPU control word, forcing immediate FPU context allocation even for binaries that otherwise never used the FPU. As from GIT commit f8f900ecb9096ec47f5b7bb7626e29223c69061a static startup supports parsing the auxiliary vector, so now it can avoid explicit initialization of the FPU control word, just as can dynamic startup, in the usual case where the setting written to the FPU control word would be the same as the kernel uses. This defers FPU context allocation until the binary itself actually pokes at the FPU. Note that the `AT_FPUCW' tag is usually absent from the auxiliary vector in which case _FPU_DEFAULT is assumed to be the kernel default.
* Remove --disable-versioning.Joseph Myers2013-09-041-1/+1
|
* Fix typos.Ondřej Bílka2013-08-301-1/+1
|
* Fix typos.Ondřej Bílka2013-08-291-1/+1
|
* Fix typos.Ondřej Bílka2013-08-215-5/+5
|
* * elf/setup-vdso.h (setup_vdso): Fix missing string termination.Andreas Arnez2013-08-201-1/+1
|
* Add GLRO(dl_hwcap2) for new AT_HWCAP2 auxv_t a_type.Ryan S. Arnold2013-06-282-3/+11
|
* Test for mprotect failure in dl-load.c (bug 12492).Pierre Ynard2013-06-281-1/+5
|
* Mark packed structure element used with atomic operation aligned.Nathan Froyd2013-06-281-1/+12
|
* [BZ #15022] Correct global-scope dlopen issues in static executables.Maciej W. Rozycki2013-06-283-31/+46
| | | | | | | | This change creates a link map in static executables to serve as the global search list for dlopen. It fixes a problem with the inability to access the global symbol object and a crash on an attempt to map a DSO into the global scope. Some code that has become dead after the addition of this link map is removed too and test cases are provided.
* [BZ #15022] Avoid repeated calls to DL_STATIC_INIT for the same module.Maciej W. Rozycki2013-06-261-4/+4
|
* Add AT_HWCAP2 as a new auxv_t a_type to elf.h.Ryan S. Arnold2013-06-261-1/+4
|
* Remove dead DL_DST_REQ_STATIC code.Maciej W. Rozycki2013-06-221-13/+0
|
* Use rtld-CPPFLAGS in rtld-%.os rules for generated sources.Roland McGrath2013-06-181-12/+22
|
* Don't let ld.so that failed its sanity check land in place.Roland McGrath2013-06-131-2/+5
|
* Fix leading whitespaces.Ondrej Bilka2013-06-061-4/+4
|
* Remove trailing whitespace.Joseph Myers2013-06-055-12/+12
|
* Avoid crashing in LD_DEBUG when program name is unavailableSiddhesh Poyarekar2013-05-2914-49/+92
| | | | | | | | | Resolves: #15465 The program name may be unavailable if the user application tampers with argc and argv[]. Some parts of the dynamic linker caters for this while others don't, so this patch consolidates the check and fallback into a single macro and updates all users.
* Update comments in ldconfig.c and dl-hwcaps.c.Carlos O'Donell2013-05-222-8/+10
| | | | | | | | | | | | | | | | | In dl-hwcaps.c the comment read that rounding was done to ElfW(Addr), but it's actually rounded to ElfW(Word). In ldconfig.c we make each comment a sentence and mention that the "tls" pseudo-hwcap is just for legacy installations where TLS was optional. --- 2013-05-22 Carlos O'Donell <carlos@redhat.com> * elf/ldconfig.c (is_hwcap_platform): Make comments full setences. (main): Mention "tls" pseudo-hwcap is legacy. * elf/dl-hwcaps.c (_dl_important_hwcaps): Correct rounding comment.
* Add #include <stdint.h> for uint[32|64]_t usage (except installed headers).Ryan S. Arnold2013-05-167-1/+7
|
* Add comments to vDSO hwcap loading process.Carlos O'Donell2013-05-142-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Loading of the vDSO pseudo-hwcap from the type 2 GNU note is a rather arcane and poorly documented process. Given that I had a chance to review this code today I thought I would add all of the things I had to lookup to verify the validity of the process. With a single .note.GNU the vDSO can register up to 64 flags, though in practice you are limited to 64 - _DL_FIRST_EXTRA bits which on x86 is 12 bits. The only use of this that I know of is in the Xen support in Linux where they use the 1st bit to indicate "nosegneg". I see "We use bit 1 to avoid bugs in some versions of glibc when bit 0 is used; the choice is otherwise arbitrary.", but no reference to a glibc bug anywhere. The code as-is should support bit zero, so we still have that free for future use. The kernel, glibc, and ld.so.cache must coordinate to ensure that bit values don't go too high and are used consistently. --- 2013-05-13 Carlos O'Donell <carlos@redhat.com> * elf/dl-hwcaps.c (_dl_important_hwcaps): Comment vDSO hwcap loading. * elf/ldconfig.c (is_hwcap_platform): Comment each hwcap check. (main): Comment "tls" pseudo-hwcap.
* Use *stat64 instead of *stat in installed programsFlorian Weimer2013-05-101-2/+2
| | | | | This ensures reliable operation on file systems with inode numbers which do not fit into 32 bits.
* Add more comments to dlclose() algorithm.Carlos O'Donell2013-05-091-0/+6
| | | | | | | | | | | | | | The algorithm for scanning dependencies upon dlclose is less than immediately obvious. This patch adds two bits of comments that explain why you start the dependency search at l_initfini[1], and why you need to restart the search. --- 2013-05-09 Carlos O'Donell <carlos@redhat.com> * elf/dl-close.c (_dl_close_worker): Add comments.
* Remove a dead declaration.Roland McGrath2013-05-061-7/+0
|
* Split _dl_writev out from _dl_debug_vdprintf.Roland McGrath2013-05-062-20/+59
|
* Fix NEED_DL_SYSINFO{,_DSO} conditionalization in _dl_sysdep_start.Roland McGrath2013-05-031-4/+9
|
* Move x86_64-specific audit tests to sysdeps/x86_64/.Joseph Myers2013-04-2517-1518/+0
|
* Adding MicroBlaze support to elf/elf.hDavid Holsgrove2013-04-161-0/+32
| | | | Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
* Fix invalid free of memory allocated during rtld initAndreas Schwab2013-04-111-0/+6
|
* dl_open_worker: Memset all of seen array.Carlos O'Donell2013-04-061-1/+1
| | | | | | | | | | | | | The seen array was doubled in size recently, but the memset to clear the array was not adjusted. We adjust the memset to always be correct regardless of the size of seen. --- 2013-04-06 Carlos O'Donell <carlos@redhat.com> [BZ #15309] * elf/dl-open.c (dl_open_worker): memset all of seen array.
* Make _dl_phdr pointer to const.Roland McGrath2013-03-281-2/+2
|
* Consolidate declarations of _dl_phdr, _dl_phnum.Roland McGrath2013-03-281-4/+0
|
* Add support for rtld directory different from slib directoryAndreas Schwab2013-03-191-5/+6
|
* Clean up _dl_pagesize initialization.Roland McGrath2013-03-151-4/+2
|
* Fix NEED_DL_SYSINFO_DSO conditionals.Roland McGrath2013-03-015-8/+8
|
* Add ARM relocation constants to elf/elf.h.Petr Machata2013-02-201-18/+119
|
* unify xmalloc prototypes & friendsMike Frysinger2013-02-181-4/+1
| | | | | | | | These prototypes are duplicated in many places. Add a dedicated header for holding prototypes for program-specific functions to avoid that. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* New function _dl_find_dso_for_objectSiddhesh Poyarekar2013-02-184-38/+38
| | | | Consolidate code to search for an address within a DSO.
* Sort Versions filesAndreas Jaeger2013-02-171-12/+11
|
* Remove miscellaneous bounded-pointers relics in C code.Joseph Myers2013-02-151-1/+1
|
* Remove bp-sym.h and BP_SYM uses from C code.Joseph Myers2013-02-141-2/+1
|
* Remove __ptrvalue, __bounded and __unbounded.Joseph Myers2013-02-131-3/+1
|
* Add more comments to _dl_load_cache_lookup().Carlos O'Donell2013-02-081-2/+3
| | | | | | Calling _dl_load_cache_lookup will load the cache if not already. If loading the cache fails no more attempts will be made to load the cache.
* ARM: Support loading unmarked objects from cache.Carlos O'Donell2013-02-081-0/+4
| | | | | | | | | | | | ARM now supports loading unmarked objects from the dynamic loader cache. Unmarked objects can be used with the hard-float or soft-float ABI. We must support loading unmarked objects during the transition period from a binutils that does not mark objects to one that does mark them with the correct ELF flags. Signed-off-by: Carlos O'Donell <carlos@redhat.com>
* Remove lots of inline keywords.Roland McGrath2013-02-072-5/+3
|
* Replace an alloca use with a variable-length array.Roland McGrath2013-02-051-3/+2
|
* Don't use GLIBC_PRIVATE errno outside of librariesAndreas Schwab2013-02-041-0/+1
|
* Improve link_map.l_addr comment.Jan Kratochvil2013-02-021-1/+2
|
* Build elf/tst-array2 and elf/tst-array5 with --no-as-neededAdam Conrad2013-01-221-0/+3
| | | | | * elf/Makefile (LDFLAGS-tst-array2): Add $(no-as-needed). (LDFLAGS-tst-array5): Likewise.