This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: readelf build error on 64-bit hosts


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]