This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Add AT_PLATFORM to _dl_aux_init ()
- From: Carlos Eduardo Seo <cseo at linux dot vnet dot ibm dot com>
- To: "Carlos O'Donell" <carlos at redhat dot com>
- Cc: Tulio Machado <tuliom at linux dot vnet dot ibm dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 22 Oct 2015 09:41:28 -0500
- Subject: Re: [PATCH] Add AT_PLATFORM to _dl_aux_init ()
- Authentication-results: sourceware.org; auth=none
- References: <C3307D15-82BC-4BFD-8628-CDB9CAE83180 at linux dot vnet dot ibm dot com> <8737x3zzd1 dot fsf at totoro dot br dot ibm dot com> <5628511D dot 8080608 at redhat dot com> <20151022053016 dot GH26317 at vapier dot lan> <5628EB02 dot 9090803 at redhat dot com>
> On Oct 22, 2015, at 8:56 AM, Carlos O'Donell <carlos@redhat.com> wrote:
>>
>> diff --git a/elf/dl-support.c b/elf/dl-support.c
>> index 9bbaa5b..9af0d8a 100644
>> --- a/elf/dl-support.c
>> +++ b/elf/dl-support.c
>> @@ -244,6 +244,9 @@ _dl_aux_init (ElfW(auxv_t) *av)
>> case AT_PHNUM:
>> GL(dl_phnum) = av->a_un.a_val;
>> break;
>> + case AT_PLATFORM:
>> + GLRO(dl_platform) = (void *) av->a_un.a_val;
>
> You explicitly cast the `uint64_t/uint32_t` to `void *`,
> but GLRO(dl_platform) is a `const char *`.
>
> Why not cast to that?
>
> I agree that the rest of the cases don't cast properly either.
TBH, I just copied the code from _dl_sysdep_start for consistency. Maybe we should do a cleanup on these in the future?
--
Carlos Eduardo Seo
Software Engineer - Linux on Power Toolchain
cseo@linux.vnet.ibm.com