|
|
Message-ID: <6f8c7482-0ff9-e331-5d56-f5fc117d0aee@mirbsd.de>
Date: Tue, 3 Nov 2026 03:45:17 +0100 (CET)
From: Thorsten Glaser <tg@...bsd.de>
To: musl@...ts.openwall.com
Subject: Re: ldso: map_library does not validate e_phentsize
On Tue, 3 Nov 2026, Puranam, Ananta Srikar wrote:
>- A shared library with a __thread variable aligned to more than the
> page size (for example aligned(8192)) gets a TLS block that is
> misaligned by a multiple of the page size. The values are right,
> but the alignment the program asked for is silently lost. glibc
> lays out the same files correctly.
The GCC docs say that applications may not require that:
Note that the effectiveness of 'aligned' attributes for static
variables may be limited by inherent limitations in the system
linker and/or object file format. On some systems, the linker is
only able to arrange for variables to be aligned up to a certain
maximum alignment. (For some linkers, the maximum supported
alignment may be very very small.) If your linker is only able to
align variables up to a maximum of 8-byte alignment, then
specifying 'aligned(16)' in an '__attribute__' still only provides
you with 8-byte alignment. See your linker documentation for
further information.
This explicitly states silent under-alignment is an option.
(If the fix is easy enough, it’ll still be good to have, of course.)
bye,
//mirabilos
--
https://toot.mirbsd.org/@mirabilos/statuses/01KNQD9RNZM1Z2A61AZHG857MP
↑ long list of references on why “AI”/LLMs are bad for everyone
also: ↓ from https://toot.cat/@dthompson/117180306961006760
> "responsible LLM usage" is the "clean coal" of the tech world
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.