public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD
@ 2011-06-19 20:32 Samuel Thibault
  2011-06-24 23:13 ` Samuel Thibault
  2011-06-30  9:47 ` Nick Clifton
  0 siblings, 2 replies; 13+ messages in thread
From: Samuel Thibault @ 2011-06-19 20:32 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 613 bytes --]

Forwarded from http://sourceware.org/bugzilla/show_bug.cgi?id=12913

Hello,

H.J. Lu added separate ELFOSABI_LINUX and _HURD definitions, but these
are actually meant to be the same: the dynamic linker is the same in
both cases, from glibc, with the same "GNU" extensions.

A recent change (http://sourceware.org/bugzilla/show_bug.cgi?id=10549)
made this issue apparent eventually.  Roland says we should simply
rename the existing ELFOSABI_LINUX into ELFOSABI_GNU, and remove
ELFOSABI_HURD.  The attached patch does this (but keeps ELFOSABI_LINUX
as an alias for software which may already be using it).

Samuel

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 9257 bytes --]

2011-06-19  Samuel Thibault  <samuel.thibault@gnu.org>

	* elf.c (_bfd_elf_set_osabi): Use ELFOSABI_GNU name instead
	of ELFOSABI_LINUX alias.
	* elf32-hppa.c (elf32_hppa_object_p): Likewise.
	* elf64-hppa.c (elf32_hppa_object_p): Likewise.

Index: bfd/elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.541
diff -u -p -r1.541 elf.c
--- bfd/elf.c	16 Jun 2011 12:34:19 -0000	1.541
+++ bfd/elf.c	19 Jun 2011 19:31:13 -0000
@@ -9608,11 +9608,11 @@ _bfd_elf_set_osabi (bfd * abfd,
   i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi;
 
   /* To make things simpler for the loader on Linux systems we set the
-     osabi field to ELFOSABI_LINUX if the binary contains symbols of
+     osabi field to ELFOSABI_GNU if the binary contains symbols of
      the STT_GNU_IFUNC type or STB_GNU_UNIQUE binding.  */
   if (i_ehdrp->e_ident[EI_OSABI] == ELFOSABI_NONE
       && elf_tdata (abfd)->has_gnu_symbols)
-    i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_LINUX;
+    i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_GNU;
 }
 
 
Index: bfd/elf32-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-hppa.c,v
retrieving revision 1.178
diff -u -p -r1.178 elf32-hppa.c
--- bfd/elf32-hppa.c	13 Jun 2011 00:59:10 -0000	1.178
+++ bfd/elf32-hppa.c	19 Jun 2011 19:31:13 -0000
@@ -950,9 +950,9 @@ elf32_hppa_object_p (bfd *abfd)
   i_ehdrp = elf_elfheader (abfd);
   if (strcmp (bfd_get_target (abfd), "elf32-hppa-linux") == 0)
     {
-      /* GCC on hppa-linux produces binaries with OSABI=Linux,
+      /* GCC on hppa-linux produces binaries with OSABI=GNU,
 	 but the kernel produces corefiles with OSABI=SysV.  */
-      if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX &&
+      if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_GNU &&
 	  i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_NONE) /* aka SYSV */
 	return FALSE;
     }
Index: bfd/elf64-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-hppa.c,v
retrieving revision 1.103
diff -u -p -r1.103 elf64-hppa.c
--- bfd/elf64-hppa.c	13 Jun 2011 00:59:12 -0000	1.103
+++ bfd/elf64-hppa.c	19 Jun 2011 19:31:14 -0000
@@ -329,9 +329,9 @@ elf64_hppa_object_p (bfd *abfd)
   i_ehdrp = elf_elfheader (abfd);
   if (strcmp (bfd_get_target (abfd), "elf64-hppa-linux") == 0)
     {
-      /* GCC on hppa-linux produces binaries with OSABI=Linux,
+      /* GCC on hppa-linux produces binaries with OSABI=GNU,
 	 but the kernel produces corefiles with OSABI=SysV.  */
-      if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX
+      if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_GNU
 	  && i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_NONE) /* aka SYSV */
 	return FALSE;
     }

2011-06-19  Samuel Thibault  <samuel.thibault@gnu.org>

	* elfedit.c (osabis): Use ELFOSABI_GNU name instead
	of ELFOSABI_LINUX alias and ELFOSABI_HURD. Add GNU alias.
	* readelf.c (get_osabi_name): Likewise.
	(get_symbol_binding): Likewise.
	(get_symbol_type): Likewise.

Index: binutils/elfedit.c
===================================================================
RCS file: /cvs/src/src/binutils/elfedit.c,v
retrieving revision 1.7
diff -u -p -r1.7 elfedit.c
--- binutils/elfedit.c	21 Nov 2010 21:27:15 -0000	1.7
+++ binutils/elfedit.c	19 Jun 2011 20:24:23 -0000
@@ -518,8 +518,9 @@ osabis[] =
   { ELFOSABI_NONE, "none" },
   { ELFOSABI_HPUX, "HPUX" },
   { ELFOSABI_NETBSD, "NetBSD" },
-  { ELFOSABI_LINUX, "Linux" },
-  { ELFOSABI_HURD, "Hurd" },
+  { ELFOSABI_GNU, "Linux" },
+  { ELFOSABI_GNU, "GNU" },
+  { ELFOSABI_GNU, "Hurd" },
   { ELFOSABI_SOLARIS, "Solaris" },
   { ELFOSABI_AIX, "AIX" },
   { ELFOSABI_IRIX, "Irix" },
Index: binutils/readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.548
diff -u -p -r1.548 readelf.c
--- binutils/readelf.c	15 Jun 2011 16:36:57 -0000	1.548
+++ binutils/readelf.c	19 Jun 2011 19:31:14 -0000
@@ -2612,8 +2612,7 @@ get_osabi_name (unsigned int osabi)
     case ELFOSABI_NONE:		return "UNIX - System V";
     case ELFOSABI_HPUX:		return "UNIX - HP-UX";
     case ELFOSABI_NETBSD:	return "UNIX - NetBSD";
-    case ELFOSABI_LINUX:	return "UNIX - Linux";
-    case ELFOSABI_HURD:		return "GNU/Hurd";
+    case ELFOSABI_GNU:		return "UNIX - GNU";
     case ELFOSABI_SOLARIS:	return "UNIX - Solaris";
     case ELFOSABI_AIX:		return "UNIX - AIX";
     case ELFOSABI_IRIX:		return "UNIX - IRIX";
@@ -8585,8 +8584,8 @@ get_symbol_binding (unsigned int binding
       else if (binding >= STB_LOOS && binding <= STB_HIOS)
 	{
 	  if (binding == STB_GNU_UNIQUE
-	      && (elf_header.e_ident[EI_OSABI] == ELFOSABI_LINUX
-		  /* GNU/Linux is still using the default value 0.  */
+	      && (elf_header.e_ident[EI_OSABI] == ELFOSABI_GNU
+		  /* GNU is still using the default value 0.  */
 		  || elf_header.e_ident[EI_OSABI] == ELFOSABI_NONE))
 	    return "UNIQUE";
 	  snprintf (buff, sizeof (buff), _("<OS specific>: %d"), binding);
@@ -8638,8 +8637,8 @@ get_symbol_type (unsigned int type)
 	    }
 
 	  if (type == STT_GNU_IFUNC
-	      && (elf_header.e_ident[EI_OSABI] == ELFOSABI_LINUX
-		  /* GNU/Linux is still using the default value 0.  */
+	      && (elf_header.e_ident[EI_OSABI] == ELFOSABI_GNU
+		  /* GNU is still using the default value 0.  */
 		  || elf_header.e_ident[EI_OSABI] == ELFOSABI_NONE))
 	    return "IFUNC";
 

2011-06-19  Samuel Thibault  <samuel.thibault@gnu.org>

	* elfcpp.h (ELFOSABI): Add ELFOSABI_GNU with value of ELFOSABI_LINUX,
	keep ELFOSABI_LINUX as an alias. Remove ELFOSABI_HURD.

Index: elfcpp/elfcpp.h
===================================================================
RCS file: /cvs/src/src/elfcpp/elfcpp.h,v
retrieving revision 1.32
diff -u -p -r1.32 elfcpp.h
--- elfcpp/elfcpp.h	12 Aug 2010 22:18:14 -0000	1.32
+++ elfcpp/elfcpp.h	19 Jun 2011 19:31:14 -0000
@@ -129,10 +129,10 @@ enum ELFOSABI
   ELFOSABI_NONE = 0,
   ELFOSABI_HPUX = 1,
   ELFOSABI_NETBSD = 2,
-  // ELFOSABI_LINUX is not listed in the ELF standard.
+  // ELFOSABI_GNU is not listed in the ELF standard.
+  ELFOSABI_GNU = 3,
+  // ELFOSABI_LINUX is not listed in the ELF standard, and is an alias for ELFOSABI_GNU
   ELFOSABI_LINUX = 3,
-  // ELFOSABI_HURD is not listed in the ELF standard.
-  ELFOSABI_HURD = 4,
   ELFOSABI_SOLARIS = 6,
   ELFOSABI_AIX = 7,
   ELFOSABI_IRIX = 8,

2011-06-19  Samuel Thibault  <samuel.thibault@gnu.org>

	* config/obj-elf.c (obj_elf_type): Use ELFOSABI_GNU name instead
	of ELFOSABI_LINUX alias.

Index: gas/config/obj-elf.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-elf.c,v
retrieving revision 1.141
diff -u -p -r1.141 obj-elf.c
--- gas/config/obj-elf.c	30 Mar 2011 15:06:51 -0000	1.141
+++ gas/config/obj-elf.c	19 Jun 2011 19:41:02 -0000
@@ -1704,8 +1704,8 @@ obj_elf_type (int ignore ATTRIBUTE_UNUSE
       const struct elf_backend_data *bed;
 
       bed = get_elf_backend_data (stdoutput);
-      if (!(bed->elf_osabi == ELFOSABI_LINUX
-	    /* GNU/Linux is still using the default value 0.  */
+      if (!(bed->elf_osabi == ELFOSABI_GNU
+	    /* GNU is still using the default value 0.  */
 	    || bed->elf_osabi == ELFOSABI_NONE))
 	as_bad (_("symbol type \"%s\" is supported only by GNU targets"),
 		type_name);
@@ -1716,14 +1716,14 @@ obj_elf_type (int ignore ATTRIBUTE_UNUSE
       struct elf_backend_data *bed;
 
       bed = (struct elf_backend_data *) get_elf_backend_data (stdoutput);
-      if (!(bed->elf_osabi == ELFOSABI_LINUX
-	    /* GNU/Linux is still using the default value 0.  */
+      if (!(bed->elf_osabi == ELFOSABI_GNU
+	    /* GNU is still using the default value 0.  */
 	    || bed->elf_osabi == ELFOSABI_NONE))
 	as_bad (_("symbol type \"%s\" is supported only by GNU targets"),
 		type_name);
       type = BSF_OBJECT | BSF_GNU_UNIQUE;
-      /* PR 10549: Always set OSABI field to LINUX for objects containing unique symbols.  */
-      bed->elf_osabi = ELFOSABI_LINUX;
+      /* PR 10549: Always set OSABI field to GNU for objects containing unique symbols.  */
+      bed->elf_osabi = ELFOSABI_GNU;
     }
 #ifdef md_elf_symbol_type
   else if ((type = md_elf_symbol_type (type_name, sym, elfsym)) != -1)

2011-06-19  Samuel Thibault  <samuel.thibault@gnu.org>

	* common.h (ELFOSABI_GNU): Define, replaces...
	(ELFOSABI_LINUX): ... this, kept as an alias.
	(ELFOSABI_HURD): Remove.

Index: include/elf/common.h
===================================================================
RCS file: /cvs/src/src/include/elf/common.h,v
retrieving revision 1.130
diff -u -p -r1.130 common.h
--- include/elf/common.h	15 Jun 2011 16:36:58 -0000	1.130
+++ include/elf/common.h	19 Jun 2011 19:31:15 -0000
@@ -62,8 +62,8 @@
 #define ELFOSABI_NONE	      0	/* UNIX System V ABI */
 #define ELFOSABI_HPUX	      1	/* HP-UX operating system */
 #define ELFOSABI_NETBSD	      2	/* NetBSD */
-#define ELFOSABI_LINUX	      3	/* GNU/Linux */
-#define ELFOSABI_HURD	      4	/* GNU/Hurd */
+#define ELFOSABI_GNU	      3	/* GNU */
+#define ELFOSABI_LINUX	      3	/* Alias for ELFOSABI_GNU */
 #define ELFOSABI_SOLARIS      6	/* Solaris */
 #define ELFOSABI_AIX	      7	/* AIX */
 #define ELFOSABI_IRIX	      8	/* IRIX */

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD
  2011-06-19 20:32 Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD Samuel Thibault
@ 2011-06-24 23:13 ` Samuel Thibault
  2011-06-30  9:47 ` Nick Clifton
  1 sibling, 0 replies; 13+ messages in thread
From: Samuel Thibault @ 2011-06-24 23:13 UTC (permalink / raw)
  To: binutils

Samuel Thibault, le Sun 19 Jun 2011 22:32:24 +0200, a écrit :
> Forwarded from http://sourceware.org/bugzilla/show_bug.cgi?id=12913
> 
> Hello,
> 
> H.J. Lu added separate ELFOSABI_LINUX and _HURD definitions, but these
> are actually meant to be the same: the dynamic linker is the same in
> both cases, from glibc, with the same "GNU" extensions.
> 
> A recent change (http://sourceware.org/bugzilla/show_bug.cgi?id=10549)
> made this issue apparent eventually.  Roland says we should simply
> rename the existing ELFOSABI_LINUX into ELFOSABI_GNU, and remove
> ELFOSABI_HURD.  The attached patch does this (but keeps ELFOSABI_LINUX
> as an alias for software which may already be using it).

Ping?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD
  2011-06-19 20:32 Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD Samuel Thibault
  2011-06-24 23:13 ` Samuel Thibault
@ 2011-06-30  9:47 ` Nick Clifton
  2011-07-04  0:54   ` Thomas Schwinge
  2011-07-05 11:39   ` [PATCH, go] " Thomas Schwinge
  1 sibling, 2 replies; 13+ messages in thread
From: Nick Clifton @ 2011-06-30  9:47 UTC (permalink / raw)
  To: Samuel Thibault; +Cc: binutils

Hi Samuel,

 > 2011-06-19  Samuel Thibault  <samuel.thibault@gnu.org>
 >
 >	* elf.c (_bfd_elf_set_osabi): Use ELFOSABI_GNU name instead
 >	of ELFOSABI_LINUX alias.
 >	* elf32-hppa.c (elf32_hppa_object_p): Likewise.
 >	* elf64-hppa.c (elf32_hppa_object_p): Likewise.
 >
 > 2011-06-19  Samuel Thibault  <samuel.thibault@gnu.org>
 >
 >	* elfedit.c (osabis): Use ELFOSABI_GNU name instead
 >	of ELFOSABI_LINUX alias and ELFOSABI_HURD. Add GNU alias.
 >	* readelf.c (get_osabi_name): Likewise.
 >	(get_symbol_binding): Likewise.
 >	(get_symbol_type): Likewise.
 >
 > 2011-06-19  Samuel Thibault  <samuel.thibault@gnu.org>
 >
 >	* elfcpp.h (ELFOSABI): Add ELFOSABI_GNU with value of ELFOSABI_LINUX,
 >	keep ELFOSABI_LINUX as an alias. Remove ELFOSABI_HURD.
 >
 > 2011-06-19  Samuel Thibault  <samuel.thibault@gnu.org>
 >
 >	* config/obj-elf.c (obj_elf_type): Use ELFOSABI_GNU name instead
 >	of ELFOSABI_LINUX alias.
 >
 > 2011-06-19  Samuel Thibault  <samuel.thibault@gnu.org>
 >
 >	* common.h (ELFOSABI_GNU): Define, replaces...
 >	(ELFOSABI_LINUX): ... this, kept as an alias.
 >	(ELFOSABI_HURD): Remove.

Approved - please apply.

Cheers
   Nick

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD
  2011-06-30  9:47 ` Nick Clifton
@ 2011-07-04  0:54   ` Thomas Schwinge
  2011-07-04  7:15     ` Matt Rice
  2011-07-05 11:39   ` [PATCH, go] " Thomas Schwinge
  1 sibling, 1 reply; 13+ messages in thread
From: Thomas Schwinge @ 2011-07-04  0:54 UTC (permalink / raw)
  To: Nick Clifton, Samuel Thibault; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 9368 bytes --]

Hallo!

On Thu, 30 Jun 2011 10:48:02 +0100, Nick Clifton <nickc@redhat.com> wrote:
>  > [ELFOSABI_GNU]
> 
> Approved - please apply.

Applied, with the following additional changed:

diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index c28dafa..7f0f2cb 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -4678,7 +4678,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
 #undef TARGET_BIG_NAME
 #define TARGET_BIG_NAME		"elf32-hppa-linux"
 #undef ELF_OSABI
-#define ELF_OSABI		ELFOSABI_LINUX
+#define ELF_OSABI		ELFOSABI_GNU
 #undef elf32_bed
 #define elf32_bed		elf32_hppa_linux_bed
 
diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c
index c9f4333..8082927 100644
--- a/bfd/elf32-i370.c
+++ b/bfd/elf32-i370.c
@@ -1368,7 +1368,7 @@ i370_elf_relocate_section (bfd *output_bfd,
 #define ELF_MACHINE_ALT1	EM_I370_OLD
 #endif
 #define ELF_MAXPAGESIZE		0x1000
-#define ELF_OSABI		ELFOSABI_LINUX
+#define ELF_OSABI		ELFOSABI_GNU
 
 #define elf_info_to_howto	i370_elf_info_to_howto
 
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index 4d2e316..92adf78 100644
--- a/bfd/elf64-hppa.c
+++ b/bfd/elf64-hppa.c
@@ -4097,7 +4097,7 @@ const struct elf_size_info hppa64_elf_size_info =
 #undef TARGET_BIG_NAME
 #define TARGET_BIG_NAME			"elf64-hppa-linux"
 #undef ELF_OSABI
-#define ELF_OSABI			ELFOSABI_LINUX
+#define ELF_OSABI			ELFOSABI_GNU
 #undef elf_backend_post_process_headers
 #define elf_backend_post_process_headers _bfd_elf_set_osabi
 #undef elf64_bed
diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi
index fb1f960..64abcf2 100644
--- a/binutils/doc/binutils.texi
+++ b/binutils/doc/binutils.texi
@@ -4295,7 +4295,8 @@ Set the matching input ELF file OSABI to @var{osabi}.  If
 @option{--input-osabi} isn't specified, it will match any ELF OSABIs.
 
 The supported ELF OSABIs are, @var{none}, @var{HPUX}, @var{NetBSD},
-@var{Linux}, @var{Hurd}, @var{Solaris}, @var{AIX}, @var{Irix},
+@var{GNU}, @var{Linux} (alias for @var{GNU}),
+@var{Solaris}, @var{AIX}, @var{Irix},
 @var{FreeBSD}, @var{TRU64}, @var{Modesto}, @var{OpenBSD}, @var{OpenVMS},
 @var{NSK}, @var{AROS} and @var{FenixOS}.
 
diff --git a/binutils/elfedit.c b/binutils/elfedit.c
index a8c385b..4cc2846 100644
--- a/binutils/elfedit.c
+++ b/binutils/elfedit.c
@@ -518,9 +518,8 @@ osabis[] =
   { ELFOSABI_NONE, "none" },
   { ELFOSABI_HPUX, "HPUX" },
   { ELFOSABI_NETBSD, "NetBSD" },
-  { ELFOSABI_GNU, "Linux" },
   { ELFOSABI_GNU, "GNU" },
-  { ELFOSABI_GNU, "Hurd" },
+  { ELFOSABI_GNU, "Linux" },
   { ELFOSABI_SOLARIS, "Solaris" },
   { ELFOSABI_AIX, "AIX" },
   { ELFOSABI_IRIX, "Irix" },
diff --git a/elfcpp/elfcpp.h b/elfcpp/elfcpp.h
index a11f65e..7a70765 100644
--- a/elfcpp/elfcpp.h
+++ b/elfcpp/elfcpp.h
@@ -129,9 +129,8 @@ enum ELFOSABI
   ELFOSABI_NONE = 0,
   ELFOSABI_HPUX = 1,
   ELFOSABI_NETBSD = 2,
-  // ELFOSABI_GNU is not listed in the ELF standard.
   ELFOSABI_GNU = 3,
-  // ELFOSABI_LINUX is not listed in the ELF standard, and is an alias for ELFOSABI_GNU
+  // ELFOSABI_LINUX is an alias for ELFOSABI_GNU.
   ELFOSABI_LINUX = 3,
   ELFOSABI_SOLARIS = 6,
   ELFOSABI_AIX = 7,
diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c
index 17ced7a..a5100c2 100644
--- a/gas/config/tc-ia64.c
+++ b/gas/config/tc-ia64.c
@@ -614,7 +614,7 @@ pseudo_func[] =
     { "svr4",	PSEUDO_FUNC_CONST,	{ ELFOSABI_NONE } },
     { "hpux",	PSEUDO_FUNC_CONST,	{ ELFOSABI_HPUX } },
     { "nt",	PSEUDO_FUNC_CONST,	{ 2 } },		/* conflicts w/ELFOSABI_NETBSD */
-    { "linux",	PSEUDO_FUNC_CONST,	{ ELFOSABI_LINUX } },
+    { "linux",	PSEUDO_FUNC_CONST,	{ ELFOSABI_GNU } },
     { "freebsd", PSEUDO_FUNC_CONST,	{ ELFOSABI_FREEBSD } },
     { "openvms", PSEUDO_FUNC_CONST,	{ ELFOSABI_OPENVMS } },
     { "nsk",	PSEUDO_FUNC_CONST,	{ ELFOSABI_NSK } },
diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo
index 7313b16..d4879b6 100644
--- a/gas/doc/as.texinfo
+++ b/gas/doc/as.texinfo
@@ -6438,7 +6438,7 @@ Mark the symbol as being a function name.
 @item STT_GNU_IFUNC
 @itemx gnu_indirect_function
 Mark the symbol as an indirect function when evaluated during reloc
-processing.  (This is only supported on Linux targeted assemblers).
+processing.  (This is only supported on assemblers targeting GNU systems).
 
 @item STT_OBJECT
 @itemx object
@@ -6459,7 +6459,8 @@ Does not mark the symbol in any way.  It is supported just for completeness.
 @item gnu_unique_object
 Marks the symbol as being a globally unique data object.  The dynamic linker
 will make sure that in the entire process there is just one symbol with this
-name and type in use.  (This is only supported on Linux targeted assemblers).
+name and type in use.  (This is only supported on assemblers targeting GNU
+systems).
 
 @end table
 
diff --git a/ld/testsuite/ld-ifunc/ifunc.exp b/ld/testsuite/ld-ifunc/ifunc.exp
index 6c20dc0..60599ff 100644
--- a/ld/testsuite/ld-ifunc/ifunc.exp
+++ b/ld/testsuite/ld-ifunc/ifunc.exp
@@ -244,19 +244,19 @@ if { $fails == 0 } {
 # Check the executables and shared libraries
 #
 # The linked ifunc using executables and the shared library containing
-# ifunc should have an OSABI field of LINUX.  The linked non-ifunc using
+# ifunc should have an OSABI field of GNU.  The linked non-ifunc using
 # executable should have an OSABI field of NONE (aka System V).
 
-if {! [check_osabi tmpdir/libshared_ifunc.so {UNIX - Linux}]} {
-    fail "Shared libraries containing ifunc does not have an OS/ABI field of LINUX"
+if {! [check_osabi tmpdir/libshared_ifunc.so {UNIX - GNU}]} {
+    fail "Shared libraries containing ifunc does not have an OS/ABI field of GNU"
     set fails [expr $fails + 1]
 }
-if {! [check_osabi tmpdir/local_prog {UNIX - Linux}]} {
-    fail "Local ifunc-using executable does not have an OS/ABI field of LINUX"
+if {! [check_osabi tmpdir/local_prog {UNIX - GNU}]} {
+    fail "Local ifunc-using executable does not have an OS/ABI field of GNU"
     set fails [expr $fails + 1]
 }
-if {! [check_osabi tmpdir/static_prog {UNIX - Linux}]} {
-    fail "Static ifunc-using executable does not have an OS/ABI field of LINUX"
+if {! [check_osabi tmpdir/static_prog {UNIX - GNU}]} {
+    fail "Static ifunc-using executable does not have an OS/ABI field of GNU"
     set fails [expr $fails + 1]
 }
 if {! [check_osabi tmpdir/dynamic_prog {UNIX - System V}]} {
diff --git a/ld/testsuite/ld-unique/unique.exp b/ld/testsuite/ld-unique/unique.exp
index 4d73e32..d9e93ca 100644
--- a/ld/testsuite/ld-unique/unique.exp
+++ b/ld/testsuite/ld-unique/unique.exp
@@ -149,8 +149,8 @@ if { $fails != 0 } {
 }
 
 # Check the object file.
-if {! [check_osabi tmpdir/unique.o {UNIX - Linux}]} {
-    fail "Object containing unique does not have an OS/ABI field of LINUX"
+if {! [check_osabi tmpdir/unique.o {UNIX - GNU}]} {
+    fail "Object containing unique does not have an OS/ABI field of GNU"
     set fails [expr $fails + 1]
 }
 
@@ -164,8 +164,8 @@ if { $fails == 0 } {
 }
 
 # Check the executable.
-if {! [check_osabi tmpdir/unique_prog {UNIX - Linux}]} {
-    fail "Executable containing unique does not have an OS/ABI field of LINUX"
+if {! [check_osabi tmpdir/unique_prog {UNIX - GNU}]} {
+    fail "Executable containing unique does not have an OS/ABI field of GNU"
     set fails [expr $fails + 1]
 }
 
@@ -194,8 +194,8 @@ if { $fails == 0 } {
 }
 
 # Check the unique PIC file.
-if {! [check_osabi tmpdir/unique_shared.o {UNIX - Linux}]} {
-    fail "PIC Object containing unique does not have an OS/ABI field of LINUX"
+if {! [check_osabi tmpdir/unique_shared.o {UNIX - GNU}]} {
+    fail "PIC Object containing unique does not have an OS/ABI field of GNU"
     set fails [expr $fails + 1]
 }
 
@@ -209,8 +209,8 @@ if { $fails == 0 } {
 }
 
 # Check the unique shared library.
-if {! [check_osabi tmpdir/libunique_shared.so {UNIX - Linux}]} {
-    fail "Shared library containing unique does not have an OS/ABI field of LINUX"
+if {! [check_osabi tmpdir/libunique_shared.so {UNIX - GNU}]} {
+    fail "Shared library containing unique does not have an OS/ABI field of GNU"
     set fails [expr $fails + 1]
 }
 

Final ChangeLog:

2011-07-03  Samuel Thibault  <samuel.thibault@gnu.org>
	    Thomas Schwinge  <thomas@schwinge.name>

	bfd/
	* elf.c (_bfd_elf_set_osabi): Use ELFOSABI_GNU name instead of
	ELFOSABI_LINUX alias.
	* elf32-hppa.c: Likewise.
	* elf32-i370.c: Likewise.
	* elf64-hppa.c: Likewise.

	binutils/
	* elfedit.c (osabis): Use ELFOSABI_GNU name instead of ELFOSABI_LINUX
	alias and ELFOSABI_HURD.  Add GNU alias.
	* readelf.c (get_osabi_name, get_symbol_binding, get_symbol_type):
	Likewise.
	* doc/binutils.texi <elfedit>: Update accordingly.

	elfcpp/
	* elfcpp.h (ELFOSABI): Add ELFOSABI_GNU with value of ELFOSABI_LINUX,
	keep ELFOSABI_LINUX as an alias.  Remove ELFOSABI_HURD.

	gas/
	* config/obj-elf.c (obj_elf_type): Use ELFOSABI_GNU name instead of
	ELFOSABI_LINUX alias.
	* config/tc-ia64.c: Likewise.

	include/elf/
	* common.h (ELFOSABI_GNU): Define, replaces...
	(ELFOSABI_LINUX): ... this, kept as an alias.
	(ELFOSABI_HURD): Remove.

	ld/testsuite/
	* ld-ifunc/ifunc.exp: Update for changed output.
	* ld-unique/unique.exp: Likewise.


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD
  2011-07-04  0:54   ` Thomas Schwinge
@ 2011-07-04  7:15     ` Matt Rice
  2011-07-04  9:00       ` Samuel Thibault
  0 siblings, 1 reply; 13+ messages in thread
From: Matt Rice @ 2011-07-04  7:15 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: Nick Clifton, Samuel Thibault, binutils

On Sun, Jul 3, 2011 at 6:40 AM, Thomas Schwinge <thomas@schwinge.name> wrote:
> Hallo!
>
> On Thu, 30 Jun 2011 10:48:02 +0100, Nick Clifton <nickc@redhat.com> wrote:
>>  > [ELFOSABI_GNU]
>>
>> Approved - please apply.
>
> Applied, with the following additional changed:

Hi, It isn't immediately obvious to me how to fix it but this patch
broke gdb compilation,

ELFOSABI_HURD and ELFOSABI_LINUX caused the respective i386gnu-tdep.c
and i386-linux-tdep.c implementations to be used.  Not sure what to
replace that with, with these being the same and/or missing.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD
  2011-07-04  7:15     ` Matt Rice
@ 2011-07-04  9:00       ` Samuel Thibault
  2011-07-04 16:43         ` Thomas Schwinge
  0 siblings, 1 reply; 13+ messages in thread
From: Samuel Thibault @ 2011-07-04  9:00 UTC (permalink / raw)
  To: Matt Rice; +Cc: Thomas Schwinge, Nick Clifton, binutils, roland

Matt Rice, le Sun 03 Jul 2011 23:42:10 -0700, a écrit :
> On Sun, Jul 3, 2011 at 6:40 AM, Thomas Schwinge <thomas@schwinge.name> wrote:
> > Hallo!
> >
> > On Thu, 30 Jun 2011 10:48:02 +0100, Nick Clifton <nickc@redhat.com> wrote:
> >>  > [ELFOSABI_GNU]
> >>
> >> Approved - please apply.
> >
> > Applied, with the following additional changed:
> 
> Hi, It isn't immediately obvious to me how to fix it but this patch
> broke gdb compilation,
> 
> ELFOSABI_HURD and ELFOSABI_LINUX caused the respective i386gnu-tdep.c
> and i386-linux-tdep.c implementations to be used.  Not sure what to
> replace that with, with these being the same and/or missing.

I believe it should be turned into just one case (ELFOSABI_GNU), and
then use generic_elf_osabi_sniff_abi_tag_sections, as is done for
ELFOSABI_NONE, to distinguish between LINUX and HURD.

Samuel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD
  2011-07-04  9:00       ` Samuel Thibault
@ 2011-07-04 16:43         ` Thomas Schwinge
  2011-07-04 18:02           ` [PATCH, GDB] " Thomas Schwinge
  2011-07-04 18:53           ` Joel Brobecker
  0 siblings, 2 replies; 13+ messages in thread
From: Thomas Schwinge @ 2011-07-04 16:43 UTC (permalink / raw)
  To: Samuel Thibault, Matt Rice, gdb-patches; +Cc: Nick Clifton, binutils, roland

[-- Attachment #1: Type: text/plain, Size: 2723 bytes --]

Hallo!

On Mon, 4 Jul 2011 09:15:26 +0200, Samuel Thibault <samuel.thibault@ens-lyon.org> wrote:
> Matt Rice, le Sun 03 Jul 2011 23:42:10 -0700, a écrit :
> > On Sun, Jul 3, 2011 at 6:40 AM, Thomas Schwinge <thomas@schwinge.name> wrote:
> > > On Thu, 30 Jun 2011 10:48:02 +0100, Nick Clifton <nickc@redhat.com> wrote:
> > >>  > [ELFOSABI_GNU]
> > >>
> > >> Approved - please apply.
> > >
> > > Applied, with the following additional changed:
> > 
> > Hi, It isn't immediately obvious to me how to fix it but this patch
> > broke gdb compilation,
> > 
> > ELFOSABI_HURD and ELFOSABI_LINUX caused the respective i386gnu-tdep.c
> > and i386-linux-tdep.c implementations to be used.  Not sure what to
> > replace that with, with these being the same and/or missing.
> 
> I believe it should be turned into just one case (ELFOSABI_GNU), and
> then use generic_elf_osabi_sniff_abi_tag_sections, as is done for
> ELFOSABI_NONE, to distinguish between LINUX and HURD.

That's what I'm thinking too, and here is the simple patch -- completely
untested.  Matt, are you interested in testing this?  The must be no
regressions for GNU/Linux, and it should work with GNU/Hurd (additional
hurdles: this will also need the patch from PR gdb/12222, and the
testsuite won't come to an end anyway; see
<http://www.gnu.org/software/hurd/open_issues/gdb_testsuite.html> and
<http://www.gnu.org/software/hurd/open_issues/term_blocking.html>).
Otherwise, I can have a look later on.

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.

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.  */
       bfd_map_over_sections (abfd,
 			     generic_elf_osabi_sniff_abi_tag_sections,
 			     &osabi);
@@ -532,14 +537,6 @@ generic_elf_osabi_sniffer (bfd *abfd)
       osabi = GDB_OSABI_NETBSD_ELF;
       break;
 
-    case ELFOSABI_LINUX:
-      osabi = GDB_OSABI_LINUX;
-      break;
-
-    case ELFOSABI_HURD:
-      osabi = GDB_OSABI_HURD;
-      break;
-
     case ELFOSABI_SOLARIS:
       osabi = GDB_OSABI_SOLARIS;
       break;


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH, GDB] Re: Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD
  2011-07-04 16:43         ` Thomas Schwinge
@ 2011-07-04 18:02           ` Thomas Schwinge
  2011-07-04 18:53           ` Joel Brobecker
  1 sibling, 0 replies; 13+ messages in thread
From: Thomas Schwinge @ 2011-07-04 18:02 UTC (permalink / raw)
  To: gdb-patches; +Cc: Nick Clifton, binutils, roland, Samuel Thibault, Matt Rice

[-- Attachment #1: Type: text/plain, Size: 6139 bytes --]

Hallo!

On Mon, 04 Jul 2011 12:55:55 +0200, I wrote:
> On Mon, 4 Jul 2011 09:15:26 +0200, Samuel Thibault <samuel.thibault@ens-lyon.org> wrote:
> > Matt Rice, le Sun 03 Jul 2011 23:42:10 -0700, a écrit :
> > > On Sun, Jul 3, 2011 at 6:40 AM, Thomas Schwinge <thomas@schwinge.name> wrote:
> > > > On Thu, 30 Jun 2011 10:48:02 +0100, Nick Clifton <nickc@redhat.com> wrote:
> > > >>  > [ELFOSABI_GNU]
> > > >>
> > > >> Approved - please apply.
> > > >
> > > > Applied, with the following additional changed:
> > > 
> > > Hi, It isn't immediately obvious to me how to fix it but this patch
> > > broke gdb compilation,
> > > 
> > > ELFOSABI_HURD and ELFOSABI_LINUX caused the respective i386gnu-tdep.c
> > > and i386-linux-tdep.c implementations to be used.  Not sure what to
> > > replace that with, with these being the same and/or missing.
> > 
> > I believe it should be turned into just one case (ELFOSABI_GNU), and
> > then use generic_elf_osabi_sniff_abi_tag_sections, as is done for
> > ELFOSABI_NONE, to distinguish between LINUX and HURD.
> 
> That's what I'm thinking too, and here is the simple patch -- completely
> untested.  Matt, are you interested in testing this?  The must be no
> regressions for GNU/Linux [...]

No regressions in the testsuite for i686-pc-linux-gnu.

Additional manual testing:

GNU/Hurd box:

    $ cp /bin/true true-h-0
    $ cp /bin/true true-h-3
    $ elfedit --output-osabi none true-h-0
    $ elfedit --output-osabi linux true-h-3

(Need to use ``--output-osabi linux'' until ``--output-osabi GNU'' is
supported by the installed binutils version.)

GNU/Linux box:

    $ cp /bin/true true-l-0
    $ cp /bin/true true-l-3
    $ elfedit --output-osabi none true-l-0
    $ elfedit --output-osabi linux true-l-3

Without the patch, on i686-pc-linux-gnu:

    $ for f in ~/tmp/true-*; do echo "* $(basename "$f"):" && gdb/gdb --batch -q -ex 'show osabi' "$f"; done
    * true-h-0:
    
    warning: A handler for the OS ABI "GNU/Hurd" is not built into this configuration
    of GDB.  Attempting to continue with the default i386 settings.
    
    The current OS ABI is "auto" (currently "GNU/Hurd").
    The default OS ABI is "GNU/Linux".
    * true-h-3:
    The current OS ABI is "auto" (currently "GNU/Linux").
    The default OS ABI is "GNU/Linux".
    * true-l-0:
    The current OS ABI is "auto" (currently "GNU/Linux").
    The default OS ABI is "GNU/Linux".
    * true-l-3:
    The current OS ABI is "auto" (currently "GNU/Linux").
    The default OS ABI is "GNU/Linux".

(true-h-3 should fail in the same way as true-h-0.)

With the patch, on i686-pc-linux-gnu:

    $ for f in ~/tmp/true-*; do echo "* $(basename "$f"):" && gdb/gdb --batch -q -ex 'show osabi' "$f"; done
    * true-h-0:
    
    warning: A handler for the OS ABI "GNU/Hurd" is not built into this configuration
    of GDB.  Attempting to continue with the default i386 settings.
    
    The current OS ABI is "auto" (currently "GNU/Hurd").
    The default OS ABI is "GNU/Linux".
    * true-h-3:
    
    warning: A handler for the OS ABI "GNU/Hurd" is not built into this configuration
    of GDB.  Attempting to continue with the default i386 settings.
    
    The current OS ABI is "auto" (currently "GNU/Hurd").
    The default OS ABI is "GNU/Linux".
    * true-l-0:
    The current OS ABI is "auto" (currently "GNU/Linux").
    The default OS ABI is "GNU/Linux".
    * true-l-3:
    The current OS ABI is "auto" (currently "GNU/Linux").
    The default OS ABI is "GNU/Linux".

All OK.

With the patch, on i686-unknown-gnu0.3:

    $ for f in ~/tmp/true-*; do echo "* $(basename "$f"):" && gdb/gdb --batch -q -ex 'show osabi' "$f"; done
    * true-h-0:
    The current OS ABI is "auto" (currently "GNU/Hurd").
    The default OS ABI is "GNU/Hurd".
    * true-h-3:
    The current OS ABI is "auto" (currently "GNU/Hurd").
    The default OS ABI is "GNU/Hurd".
    * true-l-0:
    
    warning: A handler for the OS ABI "GNU/Linux" is not built into this configuration
    of GDB.  Attempting to continue with the default i386 settings.
    
    The current OS ABI is "auto" (currently "GNU/Linux").
    The default OS ABI is "GNU/Hurd".
    * true-l-3:
    
    warning: A handler for the OS ABI "GNU/Linux" is not built into this configuration
    of GDB.  Attempting to continue with the default i386 settings.
    
    The current OS ABI is "auto" (currently "GNU/Linux").
    The default OS ABI is "GNU/Hurd".

All OK.

> 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.
> 
> 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.  */
>        bfd_map_over_sections (abfd,
>  			     generic_elf_osabi_sniff_abi_tag_sections,
>  			     &osabi);
> @@ -532,14 +537,6 @@ generic_elf_osabi_sniffer (bfd *abfd)
>        osabi = GDB_OSABI_NETBSD_ELF;
>        break;
>  
> -    case ELFOSABI_LINUX:
> -      osabi = GDB_OSABI_LINUX;
> -      break;
> -
> -    case ELFOSABI_HURD:
> -      osabi = GDB_OSABI_HURD;
> -      break;
> -
>      case ELFOSABI_SOLARIS:
>        osabi = GDB_OSABI_SOLARIS;
>        break;

OK for HEAD?


I now had a look at the complete ``Cygnus src tree'', and there is no
further use of ELFOSABI_HURD.  There is an additional definition of it in
winsup/cygwin/include/sys/elf_common.h (and ELFOSABI_GNU missing).  Is
that file still in active use?


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD
  2011-07-04 16:43         ` Thomas Schwinge
  2011-07-04 18:02           ` [PATCH, GDB] " Thomas Schwinge
@ 2011-07-04 18:53           ` Joel Brobecker
  2011-07-04 19:35             ` Thomas Schwinge
  1 sibling, 1 reply; 13+ messages in thread
From: Joel Brobecker @ 2011-07-04 18:53 UTC (permalink / raw)
  To: Thomas Schwinge
  Cc: Samuel Thibault, Matt Rice, gdb-patches, Nick Clifton, binutils, roland

> 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD
  2011-07-04 18:53           ` Joel Brobecker
@ 2011-07-04 19:35             ` Thomas Schwinge
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas Schwinge @ 2011-07-04 19:35 UTC (permalink / raw)
  To: Joel Brobecker
  Cc: Samuel Thibault, Matt Rice, gdb-patches, Nick Clifton, binutils, roland

[-- Attachment #1: Type: text/plain, Size: 2344 bytes --]

Hallo!

On Mon, 4 Jul 2011 11:02:25 -0700, Joel Brobecker <brobecker@adacore.com> wrote:
> > 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: [...]

Ack.

> 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.

Aha, I hadn't picked up that yet.  Will try to remember.  :-)

Committed:

ELFOSABI_GNU.

	gdb/
	* osabi.c (generic_elf_osabi_sniffer) <ELFOSABI_GNU>: Handle in the
	same way as ELFOSABI_NONE.
	<ELFOSABI_LINUX, ELFOSABI_HURD>: Remove cases.

---
 gdb/osabi.c |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/gdb/osabi.c b/gdb/osabi.c
index a264924..e161b58 100644
--- a/gdb/osabi.c
+++ b/gdb/osabi.c
@@ -514,11 +514,14 @@ generic_elf_osabi_sniffer (bfd *abfd)
   switch (elfosabi)
     {
     case ELFOSABI_NONE:
+    case ELFOSABI_GNU:
       /* When the EI_OSABI field in the ELF header is ELFOSABI_NONE
          (0), then the ELF structures in the file are conforming to
          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.  */
+         in use we must look for OS-specific notes.  The same applies
+         for ELFOSABI_GNU: this can mean GNU/Hurd, GNU/Linux, and
+         possibly more.  */
       bfd_map_over_sections (abfd,
 			     generic_elf_osabi_sniff_abi_tag_sections,
 			     &osabi);
@@ -532,14 +535,6 @@ generic_elf_osabi_sniffer (bfd *abfd)
       osabi = GDB_OSABI_NETBSD_ELF;
       break;
 
-    case ELFOSABI_LINUX:
-      osabi = GDB_OSABI_LINUX;
-      break;
-
-    case ELFOSABI_HURD:
-      osabi = GDB_OSABI_HURD;
-      break;
-
     case ELFOSABI_SOLARIS:
       osabi = GDB_OSABI_SOLARIS;
       break;
-- 
tg: (a627682..) elfosabi_gnu (depends on: master)


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH, go] Re: Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD
  2011-06-30  9:47 ` Nick Clifton
  2011-07-04  0:54   ` Thomas Schwinge
@ 2011-07-05 11:39   ` Thomas Schwinge
  2011-07-05 20:39     ` Ian Lance Taylor
  1 sibling, 1 reply; 13+ messages in thread
From: Thomas Schwinge @ 2011-07-05 11:39 UTC (permalink / raw)
  To: Ian Lance Taylor, gcc-patches; +Cc: binutils, Nick Clifton, Samuel Thibault

[-- Attachment #1: Type: text/plain, Size: 3247 bytes --]

Hallo!

On Thu, 30 Jun 2011 10:48:02 +0100, Nick Clifton <nickc@redhat.com> wrote:
>  > 2011-06-19  Samuel Thibault  <samuel.thibault@gnu.org>
>  >
>  >	* elf.c (_bfd_elf_set_osabi): Use ELFOSABI_GNU name instead
>  >	of ELFOSABI_LINUX alias.
>  >	* elf32-hppa.c (elf32_hppa_object_p): Likewise.
>  >	* elf64-hppa.c (elf32_hppa_object_p): Likewise.
>  >
>  > 2011-06-19  Samuel Thibault  <samuel.thibault@gnu.org>
>  >
>  >	* elfedit.c (osabis): Use ELFOSABI_GNU name instead
>  >	of ELFOSABI_LINUX alias and ELFOSABI_HURD. Add GNU alias.
>  >	* readelf.c (get_osabi_name): Likewise.
>  >	(get_symbol_binding): Likewise.
>  >	(get_symbol_type): Likewise.
>  >
>  > 2011-06-19  Samuel Thibault  <samuel.thibault@gnu.org>
>  >
>  >	* elfcpp.h (ELFOSABI): Add ELFOSABI_GNU with value of ELFOSABI_LINUX,
>  >	keep ELFOSABI_LINUX as an alias. Remove ELFOSABI_HURD.
>  >
>  > 2011-06-19  Samuel Thibault  <samuel.thibault@gnu.org>
>  >
>  >	* config/obj-elf.c (obj_elf_type): Use ELFOSABI_GNU name instead
>  >	of ELFOSABI_LINUX alias.
>  >
>  > 2011-06-19  Samuel Thibault  <samuel.thibault@gnu.org>
>  >
>  >	* common.h (ELFOSABI_GNU): Define, replaces...
>  >	(ELFOSABI_LINUX): ... this, kept as an alias.
>  >	(ELFOSABI_HURD): Remove.
> 
> Approved - please apply.

The only ELFOSABI_* occurrences in GCC trunk are in libgo.

Ian, what do you think about the following patch (untested -- what
testing does this need)?  Is it even worth keeping the ELFOSABI_LINUX
alias?  (It can never be returned via osabiStrings.)

(No ChangeLog.)

---
 libgo/go/debug/elf/elf.go      |    7 +++----
 libgo/go/debug/elf/elf_test.go |    2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/libgo/go/debug/elf/elf.go b/libgo/go/debug/elf/elf.go
index 5d45b24..0c313e5 100644
--- a/libgo/go/debug/elf/elf.go
+++ b/libgo/go/debug/elf/elf.go
@@ -119,8 +119,8 @@ const (
 	ELFOSABI_NONE       OSABI = 0   /* UNIX System V ABI */
 	ELFOSABI_HPUX       OSABI = 1   /* HP-UX operating system */
 	ELFOSABI_NETBSD     OSABI = 2   /* NetBSD */
-	ELFOSABI_LINUX      OSABI = 3   /* GNU/Linux */
-	ELFOSABI_HURD       OSABI = 4   /* GNU/Hurd */
+	ELFOSABI_GNU        OSABI = 3   /* GNU */
+	ELFOSABI_LINUX      OSABI = 3   /* GNU/Linux; alias for ELFOSABI_GNU */
 	ELFOSABI_86OPEN     OSABI = 5   /* 86Open common IA32 ABI */
 	ELFOSABI_SOLARIS    OSABI = 6   /* Solaris */
 	ELFOSABI_AIX        OSABI = 7   /* AIX */
@@ -139,8 +139,7 @@ var osabiStrings = []intName{
 	{0, "ELFOSABI_NONE"},
 	{1, "ELFOSABI_HPUX"},
 	{2, "ELFOSABI_NETBSD"},
-	{3, "ELFOSABI_LINUX"},
-	{4, "ELFOSABI_HURD"},
+	{3, "ELFOSABI_GNU"},
 	{5, "ELFOSABI_86OPEN"},
 	{6, "ELFOSABI_SOLARIS"},
 	{7, "ELFOSABI_AIX"},
diff --git a/libgo/go/debug/elf/elf_test.go b/libgo/go/debug/elf/elf_test.go
index 67b961b..118e20a 100644
--- a/libgo/go/debug/elf/elf_test.go
+++ b/libgo/go/debug/elf/elf_test.go
@@ -15,7 +15,7 @@ type nameTest struct {
 }
 
 var nameTests = []nameTest{
-	{ELFOSABI_LINUX, "ELFOSABI_LINUX"},
+	{ELFOSABI_GNU, "ELFOSABI_GNU"},
 	{ET_EXEC, "ET_EXEC"},
 	{EM_860, "EM_860"},
 	{SHN_LOPROC, "SHN_LOPROC"},
-- 
tg: (1677490..) elfosabi_gnu (depends on: master)


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH, go] Re: Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD
  2011-07-05 11:39   ` [PATCH, go] " Thomas Schwinge
@ 2011-07-05 20:39     ` Ian Lance Taylor
  2011-07-06  0:51       ` Thomas Schwinge
  0 siblings, 1 reply; 13+ messages in thread
From: Ian Lance Taylor @ 2011-07-05 20:39 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: gcc-patches, binutils, Nick Clifton, Samuel Thibault

Thomas Schwinge <thomas@schwinge.name> writes:

> The only ELFOSABI_* occurrences in GCC trunk are in libgo.
>
> Ian, what do you think about the following patch (untested -- what
> testing does this need)?  Is it even worth keeping the ELFOSABI_LINUX
> alias?  (It can never be returned via osabiStrings.)

These files are simply copied directly from the master Go library, so
the change should be made there.  See libgo/README and
http://golang.org/doc/contribute.html.

I can probably take care of it at some point if you don't want to
bother.

Ian

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH, go] Re: Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD
  2011-07-05 20:39     ` Ian Lance Taylor
@ 2011-07-06  0:51       ` Thomas Schwinge
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas Schwinge @ 2011-07-06  0:51 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches, binutils, Nick Clifton, Samuel Thibault

[-- Attachment #1: Type: text/plain, Size: 920 bytes --]

Hallo!

On Tue, 05 Jul 2011 12:19:31 -0700, Ian Lance Taylor <iant@google.com> wrote:
> Thomas Schwinge <thomas@schwinge.name> writes:
> 
> > The only ELFOSABI_* occurrences in GCC trunk are in libgo.
> >
> > Ian, what do you think about the following patch (untested -- what
> > testing does this need)?  Is it even worth keeping the ELFOSABI_LINUX
> > alias?  (It can never be returned via osabiStrings.)
> 
> These files are simply copied directly from the master Go library, so
> the change should be made there.  See libgo/README and
> http://golang.org/doc/contribute.html.
> 
> I can probably take care of it at some point if you don't want to
> bother.

It would be great if you could do that.  I already did file the
individual contributor license agreement, but I think learning the whole
code review process for this small change is a bit too much for the
moment.


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-07-05 22:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-19 20:32 Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD Samuel Thibault
2011-06-24 23:13 ` Samuel Thibault
2011-06-30  9:47 ` Nick Clifton
2011-07-04  0:54   ` Thomas Schwinge
2011-07-04  7:15     ` Matt Rice
2011-07-04  9:00       ` Samuel Thibault
2011-07-04 16:43         ` Thomas Schwinge
2011-07-04 18:02           ` [PATCH, GDB] " Thomas Schwinge
2011-07-04 18:53           ` Joel Brobecker
2011-07-04 19:35             ` Thomas Schwinge
2011-07-05 11:39   ` [PATCH, go] " Thomas Schwinge
2011-07-05 20:39     ` Ian Lance Taylor
2011-07-06  0:51       ` Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).