Patchwork [go] Re: Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD

login
register
mail settings
Submitter Thomas Schwinge
Date July 5, 2011, 11:29 a.m.
Message ID <871uy5hsol.fsf@kepler.schwinge.homeip.net>
Download mbox | patch
Permalink /patch/103255/
State New
Headers show

Comments

Thomas Schwinge - July 5, 2011, 11:29 a.m.
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(-)
Ian Taylor - July 5, 2011, 7:19 p.m.
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
Thomas Schwinge - July 5, 2011, 10:30 p.m.
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

Patch

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"},