This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] elf.h SHF_EXCLUDE signed int 31 bit shift triggers undefined behaviour.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Mark Wielaard <mjw at redhat dot com>
- Cc: libc-alpha at sourceware dot org, fweimer at redhat dot com, Josh Stone <jistone at redhat dot com>
- Date: Wed, 13 May 2015 12:27:15 +0200
- Subject: Re: [PATCH] elf.h SHF_EXCLUDE signed int 31 bit shift triggers undefined behaviour.
- Authentication-results: sourceware.org; auth=none
- References: <1427193579-26102-1-git-send-email-mjw at redhat dot com>
On Tue, Mar 24, 2015 at 11:39:39AM +0100, Mark Wielaard wrote:
> Any use of SHF_EXCLUDE in code that tries to check it against sh_flags
> will trigger undefined behaviour because it is defined as a 31 bit shift
> against an signed integer. Fix by explicitly using an unsigned int.
> ---
> ChangeLog | 4 ++++
> elf/elf.h | 2 +-
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
I looked that Florian acked this at patchwork thread. Florian, could you also
commit it or do we need more discussion?