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: [PATCH] initial i386-nacl target support for gas


This patch adds initial support for the i386-nacl target to gas.  It's
already supported in BFD.  This is not everything that's needed to be
actually useful for building Native Client binaries, but it's a start.

Ok for trunk?


Thanks,
Roland


gas/
2012-01-23  Roland McGrath  <mcgrathr@google.com>

	* configure.tgt (i386-*-nacl*): Match it.
	* config/te-nacl.h: New file.
	* config/tc-i386.h [TE_NACL] (ELF_TARGET_FORMAT): Define for this case.
	* config/tc-i386.c [TE_NACL] (i386_comment_chars, PREFIX_SEPARATOR):
	Use TE_GNU et al case for TE_NACL too.

diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index dbac2ce..75ed56c 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -309,7 +309,8 @@ const char extra_symbol_chars[] = "*%-(["
      || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF))	\
 	 && !defined (TE_GNU)				\
 	 && !defined (TE_LINUX)				\
- 	 && !defined (TE_NETWARE)			\
+	 && !defined (TE_NACL)				\
+	 && !defined (TE_NETWARE)			\
 	 && !defined (TE_FreeBSD)			\
 	 && !defined (TE_DragonFly)			\
 	 && !defined (TE_NetBSD)))
diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h
index 6a6b31d..688c69a 100644
--- a/gas/config/tc-i386.h
+++ b/gas/config/tc-i386.h
@@ -1,6 +1,6 @@
 /* tc-i386.h -- Header file for tc-i386.c
    Copyright 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
    Free Software Foundation, Inc.

    This file is part of GAS, the GNU Assembler.
@@ -61,6 +61,8 @@ extern unsigned long i386_mach (void);
 #define ELF_TARGET_FORMAT64	"elf64-x86-64-freebsd"
 #elif defined (TE_VXWORKS)
 #define ELF_TARGET_FORMAT	"elf32-i386-vxworks"
+#elif defined (TE_NACL)
+#define ELF_TARGET_FORMAT	"elf32-i386-nacl"
 #endif

 #ifdef TE_SOLARIS
diff --git a/gas/config/te-nacl.h b/gas/config/te-nacl.h
new file mode 100644
index 0000000..6550756
--- /dev/null
+++ b/gas/config/te-nacl.h
@@ -0,0 +1,23 @@
+/* Copyright 2012 Free Software Foundation, Inc.
+
+   This file is part of GAS, the GNU Assembler.
+
+   GAS is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 3,
+   or (at your option) any later version.
+
+   GAS is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+   the GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GAS; see the file COPYING.  If not, write to the Free
+   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
+
+#define TE_NACL
+#define LOCAL_LABELS_FB 1
+
+#include "obj-format.h"
diff --git a/gas/configure.tgt b/gas/configure.tgt
index 7090682..c33bb7a 100644
--- a/gas/configure.tgt
+++ b/gas/configure.tgt
@@ -181,6 +181,7 @@ case ${generic_target} in
   i386-*-elf)				fmt=elf ;;
   i386-*-kaos*)				fmt=elf ;;
   i386-*-bsd*)				fmt=aout em=386bsd ;;
+  i386-*-nacl*)				fmt=elf  em=nacl ;;
   i386-*-netbsd0.8)			fmt=aout em=386bsd ;;
   i386-*-netbsdpe*)			fmt=coff em=pe ;;
   i386-*-netbsd*-gnu* | \


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