Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD

Joel Brobecker brobecker@adacore.com
Mon Jul 4 18:53:00 GMT 2011


> 2011-07-04  Thomas Schwinge  <thomas@schwinge.name>
> 
> 	gdb/
> 	* osabi.c (generic_elf_osabi_sniffer) <ELFOSABI_GNU>: Handle in the
> 	same way as ELFOSABI_NONE.
> 	<ELFOSABI_LINUX, ELFOSABI_HURD>: Remove cases.

Thanks for doing this. The patch looks good to me overall.  Just one
minor comment:

> diff --git a/gdb/osabi.c b/gdb/osabi.c
> index a264924..7820ecb 100644
> --- a/gdb/osabi.c
> +++ b/gdb/osabi.c
> @@ -519,6 +519,11 @@ generic_elf_osabi_sniffer (bfd *abfd)
>           the base specification for that machine (there are no
>           OS-specific extensions).  In order to determine the real OS
>           in use we must look for OS-specific notes.  */
> +      /* Fall through.  */
> +
> +    case ELFOSABI_GNU:
> +      /* The same applies for ELFOSABI_GNU: this can mean GNU/Hurd, GNU/Linux,
> +         and possibly more.  */

I'm not sure I like the fall through. In fact, it's not a real fall
through. What we could do is have:

        case ELFOSABI_NONE:
        case ELFOSABI_GNU:
          /* When the EI_OSABI field in the ELF header is ELFOSABI_NONE
             [...].

             The same applies for ELFOSABI_GNU: this can mean GNU/Hurd,
             GNU/Linux, and possibly more.  */

Also, we're trying to keep our lines of code, including comments to
70 characters (it's a soft limit). If you can fit something in under
80 charas but not un 70, and it looks better on one line, do it. But
otherwise, try to stay withing the 70 chars limit.

Pre-approved with those changes.

-- 
Joel



More information about the Binutils mailing list