public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Roland McGrath <mcgrathr@google.com>
To: GDB <gdb-patches@sourceware.org>
Cc: "binutils@sourceware.org" <binutils@sourceware.org>
Subject: [PATCH users/roland/osabi] Recognize GNU .note.ABI-tag values 5 (syllable) and 6 (nacl)
Date: Fri, 29 May 2015 01:10:00 -0000	[thread overview]
Message-ID: <CAB=4xhpRRhMYF7-FtsYuTdCSn3fNOB1gOT_xjYaS11jJ6myGHw@mail.gmail.com> (raw)

These two values are assigned in glibc trunk (5 has been assigned to
syllable for several years, and 6 is quite recent).  I don't actually know
anything about Syllable, but IMHO it makes sense for the other GNU packages
that think about these values at all (binutils/gdb) to grok all the values
that exist in the GNU package that owns this number space (libc).

OK for trunk and gdb's 7.9 branch?  (I don't really care about the readelf
change, but I'm happy to put it on binutils' 2.25 branch if anyone thinks
it's worthwhile.)


Thanks,
Roland


binutils/
	* readelf.c (print_gnu_note: NT_GNU_ABI_TAG): Recognize
	GNU_ABI_TAG_SYLLABLE and GNU_ABI_TAG_NACL.

gdb/
	* defs.h (enum gdb_osabi): Add GDB_OSABI_SYLLABLE and GDB_OSABI_NACL.
	* osabi.c (generic_elf_osabi_sniff_abi_tag_sections): Recognize
	GNU_ABI_TAG_SYLLABLE and GNU_ABI_TAG_NACL.
	* configure.tgt (*-*-nacl*): Set gdb_osabi=GDB_OSABI_NACL.

include/elf/
	* common.h (GNU_ABI_TAG_SYLLABLE): New macro.
	(GNU_ABI_TAG_NACL): New macro.

diff --git a/binutils/readelf.c b/binutils/readelf.c
index b584db5..a0c20a3 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -15125,6 +15125,12 @@ print_gnu_note (Elf_Internal_Note *pnote)
 	  case GNU_ABI_TAG_NETBSD:
 	    osname = "NetBSD";
 	    break;
+	  case GNU_ABI_TAG_SYLLABLE:
+	    osname = "Syllable";
+	    break;
+	  case GNU_ABI_TAG_NACL:
+	    osname = "NaCl";
+	    break;
 	  default:
 	    osname = "Unknown";
 	    break;
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index 4e4d6a9..d7f083d 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -702,6 +702,7 @@ case "${targ}" in
 		gdb_osabi=GDB_OSABI_FREEBSD_ELF ;;
 *-*-linux* | *-*-uclinux*)
 		gdb_osabi=GDB_OSABI_LINUX ;;
+*-*-nacl*)	gdb_osabi=GDB_OSABI_NACL ;;
 *-*-nto*)	gdb_osabi=GDB_OSABI_QNXNTO ;;
 m68*-*-openbsd* | m88*-*-openbsd* | vax-*-openbsd*) ;;
 *-*-openbsd*)	gdb_osabi=GDB_OSABI_OPENBSD_ELF ;;
diff --git a/gdb/defs.h b/gdb/defs.h
index 44702ea..20d9eaf 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -569,6 +569,8 @@ enum gdb_osabi
   GDB_OSABI_LYNXOS178,
   GDB_OSABI_NEWLIB,
   GDB_OSABI_SDE,
+  GDB_OSABI_SYLLABLE,
+  GDB_OSABI_NACL,

   GDB_OSABI_INVALID		/* keep this last */
 };
diff --git a/gdb/osabi.c b/gdb/osabi.c
index 9d90c55..879f68b 100644
--- a/gdb/osabi.c
+++ b/gdb/osabi.c
@@ -492,6 +492,14 @@ generic_elf_osabi_sniff_abi_tag_sections (bfd
*abfd, asection *sect, void *obj)
 	      *osabi = GDB_OSABI_NETBSD_ELF;
 	      break;

+	    case GNU_ABI_TAG_SYLLABLE:
+	      *osabi = GDB_OSABI_SYLLABLE;
+	      break;
+
+	    case GNU_ABI_TAG_NACL:
+	      *osabi = GDB_OSABI_NACL;
+	      break;
+
 	    default:
 	      internal_error (__FILE__, __LINE__,
 			      _("generic_elf_osabi_sniff_abi_tag_sections: "
diff --git a/include/elf/common.h b/include/elf/common.h
index b087d9c..e6d8c14 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -635,6 +635,8 @@
 #define GNU_ABI_TAG_SOLARIS	2
 #define GNU_ABI_TAG_FREEBSD	3
 #define GNU_ABI_TAG_NETBSD	4
+#define GNU_ABI_TAG_SYLLABLE	5
+#define GNU_ABI_TAG_NACL	6

 /* Values for NetBSD .note.netbsd.ident notes.  Note name is "NetBSD".  */

             reply	other threads:[~2015-05-29  1:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-29  1:10 Roland McGrath [this message]
2015-05-29  9:58 ` Nicholas Clifton
2015-05-29 16:15   ` Roland McGrath
2015-05-29 10:29 ` Pedro Alves
2015-05-29 16:47   ` Roland McGrath
2015-05-29 17:07     ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAB=4xhpRRhMYF7-FtsYuTdCSn3fNOB1gOT_xjYaS11jJ6myGHw@mail.gmail.com' \
    --to=mcgrathr@google.com \
    --cc=binutils@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).