This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Ensure DSO_FILENAME does not dereference NULL.
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Marcus Shawcroft <marcus dot shawcroft at linaro dot org>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 12 Nov 2013 13:43:05 -0800
- Subject: Re: [PATCH] Ensure DSO_FILENAME does not dereference NULL.
- Authentication-results: sourceware.org; auth=none
- References: <CABXK9ndMvnpRArWGU4-JWgiePLOXNs74AuK9C6dm0J1Gyu+k_A at mail dot gmail dot com> <167D67C8-67D3-4BAD-B4A2-53ADC9FAE3EB at gmail dot com> <CABXK9ne5mM6n7ExVpuzrzvrvB2rdvJpKFphnL=5xySYgeijB-g at mail dot gmail dot com>
On Tue, Nov 12, 2013 at 1:35 PM, Marcus Shawcroft
<marcus.shawcroft@linaro.org> wrote:
> On 12 November 2013 18:27, <pinskia@gmail.com> wrote:
>
>>> One effect of this patch is to replace unreachable paths with a call to abort().
>>
>> Hmm, it calls __builtin_trap shouldn't GCC back end for both arm and aarch64 support that directly instead?
>
> Yep, I agree both gcc backends should get support for
> __builtin_trap(), (Ill make sure a patch appears shortly), but I think
> that this and the related patch I posted earlier for glibc both still
> stand.
I am testing the patch for aarch64 back-end which uses "brk #0"
instruction. I filed
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59091 for the arm back-end
issue.
I agree that we should fix glibc also due to your analysis below.
Thanks,
Andrew Pinski
>
> In the case of this patch, given:
>
> #define DSO_FILENAME(name) ((name)[0] ? (name) : (rtld_progname ?:
> "<main program>"))
> ...
> const char *reference_name = undef_map ? undef_map->l_name : NULL;
> _dl_signal_cerror (0, DSO_FILENAME (reference_name), .... )
>
> the attempt to give NULL to DSO_FILENAME() when undef_map == NULL is wrong.
>
> Cheers
> /Marcus