ELFOSABI_GNU
authorThomas Schwinge <tschwinge@gnu.org>
Sun, 3 Jul 2011 13:37:09 +0000 (13:37 +0000)
committerThomas Schwinge <tschwinge@gnu.org>
Sun, 3 Jul 2011 13:37:09 +0000 (13:37 +0000)
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.

20 files changed:
bfd/ChangeLog
bfd/elf.c
bfd/elf32-hppa.c
bfd/elf32-i370.c
bfd/elf64-hppa.c
binutils/ChangeLog
binutils/doc/binutils.texi
binutils/elfedit.c
binutils/readelf.c
elfcpp/ChangeLog
elfcpp/elfcpp.h
gas/ChangeLog
gas/config/obj-elf.c
gas/config/tc-ia64.c
gas/doc/as.texinfo
include/elf/ChangeLog
include/elf/common.h
ld/testsuite/ChangeLog
ld/testsuite/ld-ifunc/ifunc.exp
ld/testsuite/ld-unique/unique.exp

index 0263f148de61a97b4815dc921c0afc8509423e09..c4aa50d7b5c3ecfbe76efdd07487c530b4745817 100644 (file)
@@ -1,3 +1,12 @@
+2011-07-03  Samuel Thibault  <samuel.thibault@gnu.org>
+           Thomas Schwinge  <thomas@schwinge.name>
+
+       * 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.
+
 2011-07-01  Ian Lance Taylor  <iant@google.com>
 
        * elf32-i386.c (elf_i386_eh_frame_plt): Correct expression: change
index 0c1eb7d77175c7bfa7f4bc418cab8353885db5d6..aa40c339086c4a660a98b195b2c0a9681d70b9ac 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -9610,11 +9610,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 0e33f47a6a409bfced8a2730fc3351c947077b6e..7f0f2cb10e8608497281ed4eec4e2f4075df8e21 100644 (file)
@@ -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;
     }
@@ -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
 
index c9f4333bba41fb0256b36cc7ea9e56606139079b..808292703313f8c3d4da447d4fca0f580fab8bd5 100644 (file)
@@ -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
 
index d78225b567dce34dd0d135259e9fc17adbf7530d..92adf78901b357948daa6e3e6fb5ed9666f2302f 100644 (file)
@@ -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;
     }
@@ -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
index d358a16b44c58d3f5ea43fb58eae38ed56b30355..1d243157b3e60a1210d2f88d3cc0bc2c24f2cf23 100644 (file)
@@ -1,3 +1,12 @@
+2011-07-03  Samuel Thibault  <samuel.thibault@gnu.org>
+           Thomas Schwinge  <thomas@schwinge.name>
+
+       * 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.
+
 2011-07-01  Nick Clifton  <nickc@redhat.com>
 
        PR binutils/12325
index fb1f960fafb617df39a9c5fd67dc3958c757857f..64abcf2467ed92c4c4467714f6de45ac455f16f5 100644 (file)
@@ -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}.
 
index 1805ec1b5e91c4a78c4e79ca2cc7d6079ac2bd2a..4cc28465f9ad9eb23f7f217797c9f766432cea7e 100644 (file)
@@ -518,8 +518,8 @@ osabis[] =
   { ELFOSABI_NONE, "none" },
   { ELFOSABI_HPUX, "HPUX" },
   { ELFOSABI_NETBSD, "NetBSD" },
-  { ELFOSABI_LINUX, "Linux" },
-  { ELFOSABI_HURD, "Hurd" },
+  { ELFOSABI_GNU, "GNU" },
+  { ELFOSABI_GNU, "Linux" },
   { ELFOSABI_SOLARIS, "Solaris" },
   { ELFOSABI_AIX, "AIX" },
   { ELFOSABI_IRIX, "Irix" },
index c1bc2c5f8f40727dc2edcf091d04b961b0231d33..7922f8ae7842d3d183cd8cee1fe4a464a24313b6 100644 (file)
@@ -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";
@@ -8587,8 +8586,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);
@@ -8640,8 +8639,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";
 
index d4380aedd5eb0edd6a406b2a7cdf1c3c7717996f..0306aa80228f16429923bea10588f67d71edcd80 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-03  Samuel Thibault  <samuel.thibault@gnu.org>
+           Thomas Schwinge  <thomas@schwinge.name>
+
+       * elfcpp.h (ELFOSABI): Add ELFOSABI_GNU with value of ELFOSABI_LINUX,
+       keep ELFOSABI_LINUX as an alias.  Remove ELFOSABI_HURD.
+
 2011-07-01  Ian Lance Taylor  <iant@google.com>
 
        * dwarf.h (enum DW_CFA): Define.
index b3eff64c48755dfb5c294e53f0981c6c0b232990..7a70765327c6d879549b70b1f4017d5a7c1e8169 100644 (file)
@@ -129,10 +129,9 @@ enum ELFOSABI
   ELFOSABI_NONE = 0,
   ELFOSABI_HPUX = 1,
   ELFOSABI_NETBSD = 2,
-  // ELFOSABI_LINUX is not listed in the ELF standard.
+  ELFOSABI_GNU = 3,
+  // ELFOSABI_LINUX 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,
index 3b833c8ccb4e909690f793837132efb12161cc0a..9e7e5943c8bbf1a1ebd1d4ae1fee1db574f1c697 100644 (file)
@@ -1,3 +1,10 @@
+2011-07-03  Samuel Thibault  <samuel.thibault@gnu.org>
+           Thomas Schwinge  <thomas@schwinge.name>
+
+       * config/obj-elf.c (obj_elf_type): Use ELFOSABI_GNU name instead of
+       ELFOSABI_LINUX alias.
+       * config/tc-ia64.c: Likewise.
+
 2011-06-30  Paul Carroll  <pcarroll@codesourcery.com>
 
        * config/tc-arm.c (do_t_add_sub): Only allow LSL shifts of less
index 30eb8163ddea395a4f0ff5aff30ff930c76dbd77..820f1cf908f58537ee898213ea305b537ef2a3a7 100644 (file)
@@ -1704,8 +1704,8 @@ obj_elf_type (int ignore ATTRIBUTE_UNUSED)
       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_UNUSED)
       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)
index 17ced7a0cf03a88d1bc66b439151e06c8891e3f7..a5100c28cf2b5d0fa0fb0edcdf7e60aeac48315b 100644 (file)
@@ -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 } },
index 7313b16cd5db71e34e5ea0f6d54a4bb98930f475..d4879b605965105375a5058643783e0bdc7ce21c 100644 (file)
@@ -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
 
index 76fa7e5e1f43241d131c2045a5b497de61a3532e..9401ad20e31eaef2c68b34eea957c32e22d66967 100644 (file)
@@ -1,3 +1,10 @@
+2011-07-03  Samuel Thibault  <samuel.thibault@gnu.org>
+           Thomas Schwinge  <thomas@schwinge.name>
+
+       * common.h (ELFOSABI_GNU): Define, replaces...
+       (ELFOSABI_LINUX): ... this, kept as an alias.
+       (ELFOSABI_HURD): Remove.
+
 2011-06-15  Ulrich Weigand  <ulrich.weigand@linaro.org>
 
        * common.h (NT_ARM_VFP): Define.
index 70088a09bc1e4307b3a565afc0e9e8de081131a8..1d704b1e931f55b9ad66f8d91ffc912542d1c2c8 100644 (file)
@@ -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 */
index 1d266394e3d261e11662f857782c4e0974c8167a..bd2fdf5155ea7ca678b4fcc0e5fade7ed8756b3d 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-03  Samuel Thibault  <samuel.thibault@gnu.org>
+           Thomas Schwinge  <thomas@schwinge.name>
+
+       * ld-ifunc/ifunc.exp: Update for changed output.
+       * ld-unique/unique.exp: Likewise.
+
 2011-06-27  Nick Clifton  <nickc@redhat.com>
 
        * ld-elf/elf.exp: Exlcude all v850 targets from note-3 test.
index 6c20dc079b96a8b1ee02c30dc77f9274ff799b77..60599ff526248bace99c4ec5eecfa02a0f620696 100644 (file)
@@ -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}]} {
index 4d73e32f3369ad88f42d9e65b3e824ef0857b4f9..d9e93ca9818d9bed55e95aab5f9a6f0e00ad9da8 100644 (file)
@@ -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]
 }
 
This page took 0.054313 seconds and 4 git commands to generate.