This is the mail archive of the mailing list for the GDB 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: [PATCH/RFC] Reorganize osabi.c:generic_elf_osabi_sniff_abi_tag_sections()

On Mon, Jan 19, 2004 at 07:39:03PM +0100, Mark Kettenis wrote:
>    Date: Sun, 18 Jan 2004 17:52:54 -0500
>    From: Daniel Jacobowitz <>
>    On Sun, Jan 18, 2004 at 09:40:40PM +0100, Mark Kettenis wrote:
>    > +  /* ...and check it.  */
>    > +  gdb_assert (notesz <= MAX_NOTESZ);
>    > +  if (notesz > bfd_section_size (abfd, sect))
>    > +    return 0;
>    I'd rather not add assertions based on the input file.  Can we complain
>    and fail instead?
> Ah, but the assert is an internal consistency check.  It checks
> whether the MAX_NOTESZ limit is large enough for the note the caller
> of check_note() is checking for.  Basically the assert triggers if
> someone adds a check_note() call with a long name, or a large
> descriptor size.  In that case the person in question should increase
> MAX_NOTESZ.  The assert is guaranteed not to be triggered for the
> check_note() calls in my patch.

Oh, you're right - I leapt to the conclusion that this was based on the
size of notes in the input.  Sorry.

Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

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