readelf build error on 64-bit hosts

nick clifton nickc@redhat.com
Wed Feb 27 12:16:00 GMT 2013


Hi Alan,

>>From the PR15181 fix, I believe..
>
> readelf.c: In function ‘process_corefile_note_segment’:
> readelf.c:13370:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
> readelf.c:13391:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]

Doh - I know I should have checked on a 64-bit host.

> On looking at the change, I think there are some other errors too.  This:
>
>        Elf_External_Note * next;
> ..
> 	  if (data_remaining < sizeof * next)
>
> will cause a failure if the last note in a note section has namesz and
> descsz both zero (Elf_External_Note includes a one byte name array).

Urg, yes,

> What do you think of the following?
>
> 	* readelf.c (offsetof): Define.
> 	(CHECK_ENTSIZE_VALUES): Remove extraneous indefinite article.
> 	(process_corefile_note_segment): Allow notes without name or
> 	desc.  Combine out-of-range checks.  Disallow "negative"
> 	notesz or descaz.

Much better - please apply it have not done so already.

Thanks for fixing this.

Cheers
   Nick



More information about the Binutils mailing list