[PATCH 2/2] [nto] Improve ABI sniffing.
Pedro Alves
palves@redhat.com
Wed Oct 21 16:39:00 GMT 2015
On 10/21/2015 03:14 PM, Aleksandar Ristovski wrote:
> + name = note + sizeof_Elf_Nhdr;
> + if (sectsize < namelen + sizeof_Elf_Nhdr
> + || namelen > sizeof (QNX_NOTE_NAME))
> + {
> + /* Can not be QNX note. */
> + XDELETEVEC (note);
> + return;
> + }
> +
> + if (namelen == sizeof (QNX_NOTE_NAME)
> + && 0 == strcmp (name, QNX_NOTE_NAME))
> + *(enum gdb_osabi *) obj = GDB_OSABI_QNXNTO;
> +
> + XDELETEVEC (note);
Looks like these two ifs are now the same as the simpler:
name = note + sizeof_Elf_Nhdr;
if (sectsize >= namelen + sizeof_Elf_Nhdr
&& namelen == sizeof (QNX_NOTE_NAME)
&& 0 == strcmp (name, QNX_NOTE_NAME))
*(enum gdb_osabi *) obj = GDB_OSABI_QNXNTO;
XDELETEVEC (note);
OK with that change.
Thanks,
Pedro Alves
More information about the Gdb-patches
mailing list