f8406b33 | 06-Oct-2016 |
zrj <rimvydas.jasinskas@gmail.com> |
<sys/cdefs.h>: Rework __weak_reference() macro.
My LTO build blew away weak symbols from slim LTO objects. Use __strong_reference() + weak attribute to allow the compiler to catch extern declaration
<sys/cdefs.h>: Rework __weak_reference() macro.
My LTO build blew away weak symbols from slim LTO objects. Use __strong_reference() + weak attribute to allow the compiler to catch extern declarations and not to fold weak symbols as local ones.
Keep previous version as __weak_reference_asm() in _pthread_stubs.c for now due to several issues (there is a need to do it in a cleaner way).
lib/libc/gen/ucontext.c: add missing __DECONST for ucp, shouldn't sigreturn take const ucontext_t?
lib/libc/inet/inet_ntoa.c: add missing #undef inet_ntoa_r
No symbol changes in libc and librt on normal compilation.
While there, add __weak_symbol attribute for future additions.
show more ...
|
3f81f453 | 03-Sep-2016 |
Matthew Dillon <dillon@apollo.backplane.com> |
libc - Fix malloc() alignment for small allocations
* malloc()'s slab allocator was set to use 8-byte alignment for any allocation < 128 bytes that was not otherwise on an integral alignment bou
libc - Fix malloc() alignment for small allocations
* malloc()'s slab allocator was set to use 8-byte alignment for any allocation < 128 bytes that was not otherwise on an integral alignment boundary. This breaks GCC-7 which assumes 16-byte alignment for non-16-integral sizes < 128 bytes. e.g. if 18 bytes is allocated, GCC-7 assumes the resulting pointer will be 16-byte-aligned.
* The standard is somewhat deficient in its characterization of what the required alignment should be, because there are already instructions which prefer 32 and 64 byte alignments, but are relaxed on Intel to only require 16-byte alignments (aka %ymm and %zmm registers in the vector extensions), and its stupid to enforce even larger alignments for tiny allocations.
* But generally speaking it makes sense to enforce a 16-byte alignment for any allocations >= 16 bytes, regardless of the size being passed-in not being 16-byte aligned, and this change does that. Allocations of less than 16 bytes will still be 8-byte aligned because it is phenominally wasteful for them not to be.
Reported-by: marino
show more ...
|