This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Should rename ELFOSABI_LINUX into ELFOSABI_GNU, and drop ELFOSABI_HURD


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: pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]