This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ 18960] setlocale.c: Mark *_used symbols as unaligned.
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Rich Felker <dalias at libc dot org>
- Cc: Florian Weimer <fweimer at redhat dot com>, Marcin KoÅcielnicki <koriakin at 0x04 dot net>, libc-alpha at sourceware dot org
- Date: Mon, 28 Sep 2015 15:58:20 -0400
- Subject: Re: [PATCH][BZ 18960] setlocale.c: Mark *_used symbols as unaligned.
- Authentication-results: sourceware.org; auth=none
- References: <1443360385-20079-1-git-send-email-koriakin at 0x04 dot net> <20150928141824 dot GX17773 at brightrain dot aerifal dot cx> <5609541A dot 5070500 at redhat dot com> <20150928151749 dot GK5140 at vapier dot lan> <56095B35 dot 8020709 at redhat dot com> <56095C87 dot 9060100 at redhat dot com> <20150928182217 dot GC17773 at brightrain dot aerifal dot cx>
On 09/28/2015 02:22 PM, Rich Felker wrote:
>> It seems a bit like overkill right now though. I think just making the
>> value 16 with a comment will work.
>
> Is there a reason this hack with absolute definitions is being used
> rather than just defining actual objects for the symbols to resolve to
> (or aliasing them to objects that already exist)? This approach would
> not require any ABI-specific knowledge.
Yes, exactly, I was just wondering this myself.
I think indeed we can just do away with the micro-optimization of using
the address as a flag and just allocate an object with a known value.
Keep in mind this is only for static linking, since that's the only time
NL_CURRENT_INDIRECT is defined.
In the dynamic linking case everything is loaded in the libc.so DSO at
load time, there is no way to avoid the overhead of handling all of the
categories.
Cheers,
Carlos.