| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
This commit fixes a bug where the dynamic loader would crash
when loading audit libraries, via LD_AUDIT, where those libraries
used TLS. The dynamic loader was not considering that the audit
libraries would use TLS and failed to bump the TLS generation
counter leaving TLS usage inconsistent after loading the audit
libraries.
https://sourceware.org/ml/libc-alpha/2014-02/msg00569.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch cleans up following the obsoletion of _BSD_SOURCE and
_SVID_SOURCE by combining __USE_BSD and __USE_SVID into __USE_MISC.
The only non-mechanical part of this patch is the changes to
features.h; everything else is simple substitution of __USE_MISC for
the old macros. Thus, this patch leaves obviously redundant
conditionals such as "defined __USE_MISC || defined __USE_MISC", and
does not update #endif comments where they referred to BSD or SVID in
words instead of the literal macro name. This is intended to
facilitate patch review by separating the less mechanical changes from
these purely mechanical changes into a separate patch. (I do intend
to integrate all the changes from
<https://sourceware.org/ml/libc-alpha/2013-12/msg00226.html>, which I
believe includes all the trailing comment updates, in subsequent
patches.)
Tested x86_64.
* include/features.h (__USE_BSD): Remove macro definitions.
(__USE_SVID): Likewise.
(_BSD_SOURCE): Likewise.
(_SVID_SOURCE): Likewise.
[!defined _BSD_SOURCE && !defined _SVID_SOURCE]: Remove condition
from definition of _DEFAULT_SOURCE.
[_BSD_SOURCE || _SVID_SOURCE]: Change condition to
[_DEFAULT_SOURCE].
* bits/fcntl.h [__USE_BSD]: Change condition to [__USE_MISC].
* bits/mman.h [__USE_BSD]: Likewise.
* bits/termios.h [__USE_BSD]: Likewise.
* bits/waitstatus.h [__USE_BSD]: Likewise.
* ctype/ctype.h [__USE_SVID]: Likewise.
* dirent/dirent.h [__USE_BSD]: Likewise.
* grp/grp.h [__USE_SVID]: Likewise.
[__USE_BSD]: Likewise.
* inet/netinet/igmp.h [__USE_BSD]: Likewise.
* io/fcntl.h [__USE_BSD]: Likewise.
* io/ftw.h [__USE_BSD]: Likewise.
* io/sys/stat.h [__USE_BSD]: Likewise.
* libio/bits/stdio-ldbl.h [__USE_BSD]: Likewise.
* libio/bits/stdio2.h [__USE_BSD]: Likewise.
* libio/stdio.h [__USE_SVID]: Likewise.
[__USE_BSD]: Likewise.
* math/math.h [__USE_SVID]: Likewise.
[__USE_BSD]: Likewise.
* misc/bits/syslog-ldbl.h [__USE_BSD]: Likewise.
* misc/bits/syslog.h [__USE_BSD]: Likewise.
* misc/search.h [__USE_SVID]: Likewise.
* misc/sys/mman.h [__USE_BSD]: Likewise.
* misc/sys/syslog.h [__USE_BSD]: Likewise.
* misc/sys/uio.h [__USE_BSD]: Likewise.
* posix/bits/unistd.h [__USE_BSD]: Likewise.
* posix/glob.h [__USE_BSD]: Likewise.
* posix/regex.h [__USE_BSD]: Likewise.
* posix/sys/types.h [__USE_BSD]: Likewise.
[__USE_SVID]: Likewise.
* posix/sys/utsname.h [__USE_SVID]: Likewise.
* posix/sys/wait.h [__USE_BSD]: Likewise.
[__USE_SVID]: Likewise.
* posix/unistd.h [__USE_BSD]: Likewise.
[__USE_SVID]: Likewise.
* pwd/pwd.h [__USE_SVID]: Likewise.
* resolv/netdb.h [__USE_BSD]: Likewise.
* setjmp/setjmp.h [__USE_BSD]: Likewise.
* signal/signal.h [__USE_BSD]: Likewise.
[__USE_SVID]: Likewise.
* socket/sys/socket.h [__USE_BSD]: Likewise.
* stdlib/fmtmsg.h [__USE_SVID]: Likewise.
* stdlib/stdlib.h [__USE_BSD]: Likewise.
[__USE_SVID]: Likewise.
* string/bits/string2.h [__USE_BSD]: Likewise.
[__USE_SVID]: Likewise.
* string/bits/string3.h [__USE_BSD]: Likewise.
* string/endian.h [__USE_BSD]: Likewise.
* string/string.h [__USE_SVID]: Likewise.
[__USE_BSD]: Likewise.
* string/strings.h [__USE_BSD]: Likewise.
* sysdeps/generic/netinet/ip.h [__USE_BSD]: Likewise.
* sysdeps/gnu/netinet/ip_icmp.h [__USE_BSD]: Likewise.
* sysdeps/mach/hurd/bits/fcntl.h [__USE_BSD]: Likewise.
* sysdeps/mach/hurd/bits/stat.h [__USE_BSD]: Likewise.
* sysdeps/unix/sysv/linux/alpha/bits/mman.h [__USE_BSD]: Likewise.
* sysdeps/unix/sysv/linux/alpha/bits/termios.h [__USE_BSD]:
Likewise.
* sysdeps/unix/sysv/linux/bits/fcntl-linux.h [__USE_BSD]:
Likewise.
* sysdeps/unix/sysv/linux/bits/mman-linux.h [__USE_BSD]: Likewise.
* sysdeps/unix/sysv/linux/bits/sys_errlist.h [__USE_BSD]:
Likewise.
* sysdeps/unix/sysv/linux/bits/termios.h [__USE_BSD]: Likewise.
* sysdeps/unix/sysv/linux/mips/bits/termios.h [__USE_BSD]:
Likewise.
* sysdeps/unix/sysv/linux/netinet/if_ether.h [__USE_BSD]:
Likewise.
* sysdeps/unix/sysv/linux/netinet/if_fddi.h [__USE_BSD]: Likewise.
* sysdeps/unix/sysv/linux/netinet/if_tr.h [__USE_BSD]: Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/termios.h [__USE_BSD]:
Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/termios.h [__USE_BSD]:
Likewise.
* sysdeps/x86/bits/string.h [__USE_BSD]: Likewise.
* sysvipc/sys/ipc.h [__USE_SVID]: Likewise.
* termios/termios.h [__USE_BSD]: Likewise.
* time/sys/time.h [__USE_BSD]: Likewise.
* time/time.h [__USE_BSD]: Likewise.
[__USE_SVID]: Likewise.
* sysdeps/unix/sysv/linux/hppa/bits/mman.h [__USE_BSD]: Change
condition to [__USE_MISC].
|
| |
|
|
|
|
| |
This reverts commit 69a17d9d245dc3551792e95e1823cc2d877592f3.
|
|
|
|
| |
This reverts commit 35e8f7ab94c910659de9d507aa0f3e1f8973d914.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 1f33d36a8a9e78c81bed59b47f260723f56bb7e6.
Conflicts:
elf/dl-misc.c
Also reverts the follow commits that were bug fixes to new code introduced
in the above commit:
063b2acbce83549df82ab30f5af573f1b9c4bd19
b627fdd58554bc36bd344dc40a8787c4b7a9cc46
e81c64bba13d2d8b2a4e53254a82cc80f27c8497
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a signal-safe malloc replacement.
2013-12-18 Andrew Hunter <ahh@google.com>
* sysdeps/generic/ldsodefs.h (__signal_safe_memalign): New prototype.
(__signal_safe_malloc, __signal_safe_free): Likewise.
(__signal_safe_realloc, __signal_safe_calloc): Likewise.
* elf/dl-misc.c (__signal_safe_allocator_header): New struct.
(__signal_safe_memalign, __signal_safe_malloc): New function.
(__signal_safe_free, __signal_safe_realloc): Likewise.
(__signal_safe_calloc): Likewise.
* elf/dl-tls.c (allocate_dtv, _dl_clear_dtv): Call signal-safe
functions.
(_dl_deallocate_tls, _dl_update_slotinfo): Likewise.
|
|
|
|
|
|
|
|
|
|
|
| |
Factor out _dl_clear_dtv.
2013-12-18 Andrew Hunter <ahh@google.com>
* elf/Versions (ld): Add _dl_clear_dtv.
* sysdeps/generic/ldsodefs.h (_dl_clear_dtv): New prototype.
* elf/dl-tls.c (_dl_clear_dtv): New function.
* nptl/allocatestack.c (get_cached_stack): Call _dl_clear_dtv.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2013-12-18 Andrew Hunter <ahh@google.com>
* sysdeps/generic/ldsodefs.h (_dl_mask_all_signals): New prototype.
(_dl_unmask_signals): Likewise.
* sysdeps/mach/hurd/dl-sysdep.h (_dl_mask_all_signals): New stub.
(_dl_unmask_all_signals): Likewise.
* sysdeps/unix/sysv/linux/dl-sysdep.h (_dl_mask_all_signals): New prototype.
(_dl_unmask_all_signals): Likewise.
* sysdeps/unix/sysv/linux/dl-sysdep.c (_dl_mask_all_signals): New function.
(_dl_unmask_signals): Likewise.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
On hppa and ia64, the macro DL_AUTO_FUNCTION_ADDRESS() uses the
variable fptr[2] in it's own scope.
The content of fptr[] is thus undefined right after the macro exits.
Newer gcc's (>= 4.7) reuse the stack space of this variable triggering
a segmentation fault in dl-init.c:69.
To fix this we rewrite the macros to make the call directly to init
and fini without needing to pass back a constructed function pointer.
|
| |
|
|
|
|
|
|
|
| |
Statically built binaries use __pointer_chk_guard_local,
while dynamically built binaries use __pointer_chk_guard.
Provide the right definition depending on the test case
we are building.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The pointer guard used for pointer mangling was not initialized for
static applications resulting in the security feature being disabled.
The pointer guard is now correctly initialized to a random value for
static applications. Existing static applications need to be
recompiled to take advantage of the fix.
The test tst-ptrguard1-static and tst-ptrguard1 add regression
coverage to ensure the pointer guards are sufficiently random
and initialized to a default value.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Many Linux arches require fixed mmaps to be aligned higher than pagesize,
so use the SHMLBA define as it represents this quantity exactly.
This fixes spurious errors seen on those arches like:
cannot map archive header: Invalid argument
URL: http://sourceware.org/bugzilla/show_bug.cgi?id=10283
Reported-by: CHIKAMA Masaki <masaki.chikama@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
|
|
|
|
|
|
|
| |
GCC 4.8 enables -ftree-loop-distribute-patterns at -O3 by default and
this optimization may transform loops into memset/memmove calls. Without
proper handling this may generate unexpected PLT calls on GLIBC.
This patch fixes by create memset/memmove alias to internal GLIBC
__GI_memset/__GI_memmove symbols.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The most common use case of math functions is with default rounding
mode, i.e. rounding to nearest. Setting and restoring rounding mode
is an unnecessary overhead for this, so I've added support for a
context, which does the set/restore only if the FP status needs a
change. The code is written such that only x86 uses these. Other
architectures should be unaffected by it, but would definitely benefit
if the set/restore has as much overhead relative to the rest of the
code, as the x86 bits do.
Here's a summary of the performance improvement due to these
improvements; I've only mentioned functions that use the set/restore
and have benchmark inputs for x86_64:
Before:
cos(): ITERS:4.69335e+08: TOTAL:28884.6Mcy, MAX:4080.28cy, MIN:57.562cy, 16248.6 calls/Mcy
exp(): ITERS:4.47604e+08: TOTAL:28796.2Mcy, MAX:207.721cy, MIN:62.385cy, 15543.9 calls/Mcy
pow(): ITERS:1.63485e+08: TOTAL:28879.9Mcy, MAX:362.255cy, MIN:172.469cy, 5660.86 calls/Mcy
sin(): ITERS:3.89578e+08: TOTAL:28900Mcy, MAX:704.859cy, MIN:47.583cy, 13480.2 calls/Mcy
tan(): ITERS:7.0971e+07: TOTAL:28902.2Mcy, MAX:1357.79cy, MIN:388.58cy, 2455.55 calls/Mcy
After:
cos(): ITERS:6.0014e+08: TOTAL:28875.9Mcy, MAX:364.283cy, MIN:45.716cy, 20783.4 calls/Mcy
exp(): ITERS:5.48578e+08: TOTAL:28764.9Mcy, MAX:191.617cy, MIN:51.011cy, 19071.1 calls/Mcy
pow(): ITERS:1.70013e+08: TOTAL:28873.6Mcy, MAX:689.522cy, MIN:163.989cy, 5888.18 calls/Mcy
sin(): ITERS:4.64079e+08: TOTAL:28891.5Mcy, MAX:6959.3cy, MIN:36.189cy, 16062.8 calls/Mcy
tan(): ITERS:7.2354e+07: TOTAL:28898.9Mcy, MAX:1295.57cy, MIN:380.698cy, 2503.7 calls/Mcy
So the improvements are:
cos: 27.9089%
exp: 22.6919%
pow: 4.01564%
sin: 19.1585%
tan: 1.96086%
The downside of the change is that it will have an adverse performance
impact on non-default rounding modes, but I think the tradeoff is
justified.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
We only need to set/restore rounding mode to ensure correct
computation for non-default rounding modes.
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
It is based on draft TS 18661 and currently enabled as a GNU extension.
|
| |
|
| |
|
|
|
|
| |
Follow-up to commit 495ded2c8c1eb8c0ac4b54add2dd397852e19cba.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Consolidate code to search for an address within a DSO.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|