This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Use 1U everywhere in elf/elf.h.
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, Andreas Schwab <schwab at linux-m68k dot org>
- Date: Fri, 06 Mar 2015 17:23:20 -0500
- Subject: Re: [PATCH] Use 1U everywhere in elf/elf.h.
- Authentication-results: sourceware.org; auth=none
- References: <54F9E0CE dot 8070303 at redhat dot com> <20150306180147 dot 7EA492C3B32 at topped-with-meat dot com>
On 03/06/2015 01:01 PM, Roland McGrath wrote:
> It you're going to do it, you should be consistent and cover all the ones
> that aren't written using << too. (Every bare integer constant has type
> int.) Also, if this is important you should write a test for it. I'm not
> sure what is the easiest or best way to verify that a constant's type is
> something in particular. Note that the right type is not necessarily
> something like 'unsigned int', but is a type whose signedness matches and
> whose width is no larger than, the type of the corresponding struct field.
>
> The test can use some scripting to grovel the full set of macro names to
> test, with some hand-written rules for choosing the type (e.g. 'R_*' ->
> 'Elf32_Word').
I would like to write a test case for it, but I can't get anything to
trigger the original reported failure by readelf when running with
-fsanitize=undefined.
Therefore I can't at present even get a reproducer nor write a regression
test, but I know what what we have for SHF_EXCLUDE is wrong.
Anyone else able to create a test case that shows this?
It would obviously require libubsan for `make check`, but that isn't
too bad?
Cheers,
Carlos.