[PATCH] OpenRISC support for GAS and LD

Johan Rydberg johan.rydberg@netinsight.se
Fri Apr 27 08:54:00 GMT 2001


Hi!

Here is a patch for both GAS and LD that add OpenRISC support.  Also
a small change to BFD.  New files are attached in a gzipped tar archive.

/src/ld:
2001-04-27  Johan Rydberg  <jrydberg@opencores.org>

        * emulparams/elf32openrisc.sh: New file.

        * Makefile.am: Add OpenRISC target.
        * Makefile.in: Regenerated.

        * configure.tgt: Add openrisc-*-* mapping.

/src/gas:
2001-04-27  Johan Rydberg  <jrydberg@opencores.org>

        * config/tc-openrisc.c: New file.
        * config/tc-openrisc.h: Likewise.

        * Makefile.am: Add OpenRISC target.
        * Makefile.in: Regenerated.

        * configure.in (openrisc-*-*): Add target.
        * configure: Regenerated.

/src/gas/testsuite:
2001-04-27  Johan Rydberg  <jrydberg@opencores.org>

        * gas/openrisc/addi.s: New file.
        * gas/openrisc/addi.d: Likewise.
        * gas/openrisc/allinsn.exp: Likewise.
        * gas/openrisc/allinsn.s: Likewise.
        * gas/openrisc/allinsn.d: Likewise.
        * gas/openrisc/lohi.s: Likewise.
        * gas/openrisc/lohi.d: Likewise.
        * gas/openrisc/store.s: Likewise.
        * gas/openrisc/store.d: Likewise.

/src/bfd:
2001-04-27  Johan Rydberg  <jrydberg@opencores.org>

        * elf32-openrisc.c (openrisc_elf_howto_table): Do not complain about
        overflow in R_OPENRISC_LO_16_IN_INSN and R_OPENRISC_HI_16_IN_INSN.
Index: bfd/elf32-openrisc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-openrisc.c,v
retrieving revision 1.1
diff -u -r1.1 elf32-openrisc.c
--- elf32-openrisc.c	2001/04/24 15:08:15	1.1
+++ elf32-openrisc.c	2001/04/27 15:39:39
@@ -94,29 +94,29 @@
 
   HOWTO (R_OPENRISC_LO_16_IN_INSN, /* type */
 	 0,			/* rightshift */
-	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
 	 16,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_bitfield, /* complain_on_overflow */
+	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_OPENRISC_LO_16_IN_INSN", /* name */
 	 false,			/* partial_inplace */
-	 0x0000ffff,		/* src_mask */
+	 0,			/* src_mask */
 	 0x0000ffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
   HOWTO (R_OPENRISC_HI_16_IN_INSN, /* type */
 	 16,			/* rightshift */
-	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
 	 16,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_bitfield,	/* complain_on_overflow */
+	 complain_overflow_dont,	/* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_OPENRISC_HI_16_IN_INSN",	/* name */
 	 false,			/* partial_inplace */
-	 0x0000ffff,		/* src_mask */
+	 0,			/* src_mask */
 	 0x0000ffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
Index: gas/Makefile.am
===================================================================
RCS file: /cvs/src/src/gas/Makefile.am,v
retrieving revision 1.35
diff -u -r1.35 Makefile.am
--- Makefile.am	2001/04/08 05:09:20	1.35
+++ Makefile.am	2001/04/27 15:39:39
@@ -63,6 +63,7 @@
 	mn10200 \
 	mn10300 \
 	ns32k \
+	openrisc \
 	pdp11 \
 	pj \
 	ppc \
@@ -246,6 +247,7 @@
 	config/tc-mn10200.c \
 	config/tc-mn10300.c \
 	config/tc-ns32k.c \
+	config/tc-openrisc.c \
 	config/tc-pdp11.c \
 	config/tc-pj.c \
 	config/tc-ppc.c \
@@ -288,6 +290,7 @@
 	config/tc-mn10200.h \
 	config/tc-mn10300.h \
 	config/tc-ns32k.h \
+	config/tc-openrisc.h \
 	config/tc-pdp11.h \
 	config/tc-pj.h \
 	config/tc-ppc.h \
@@ -1176,6 +1179,12 @@
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h $(INCDIR)/opcode/ns32k.h \
   $(INCDIR)/obstack.h
+DEPTC_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+  $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h subsegs.h \
+  $(INCDIR)/obstack.h $(INCDIR)/symcat.h $(srcdir)/../opcodes/openrisc-desc.h \
+  $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/openrisc-opc.h \
+  cgen.h
 DEPTC_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \
   $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/pdp11.h
 DEPTC_pdp11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pdp11.h \
@@ -1519,6 +1528,10 @@
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h subsegs.h \
   $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
+DEPOBJ_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+  $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h subsegs.h \
+  $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h
 DEPOBJ_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \
   $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
   $(INCDIR)/obstack.h
@@ -1805,6 +1818,9 @@
 DEP_ns32k_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h
+DEP_openrisc_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
+  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+  $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h
 DEP_pdp11_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-pdp11.h \
   $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
 DEP_pdp11_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pdp11.h \
Index: gas/configure.in
===================================================================
RCS file: /cvs/src/src/gas/configure.in,v
retrieving revision 1.65
diff -u -r1.65 configure.in
--- configure.in	2001/04/17 01:36:23	1.65
+++ configure.in	2001/04/27 15:39:40
@@ -357,6 +357,9 @@
 			    ;;
       mn10200-*-*)	    fmt=elf bfd_gas=yes ;;
       mn10300-*-*)	    fmt=elf bfd_gas=yes ;;
+
+      openrisc-*-*)	    fmt=elf bfd_gas=yes ;;
+
       pj*)		    fmt=elf ;;
       ppc-*-pe | ppc-*-cygwin* | ppc-*-winnt*)
 		            fmt=coff em=pe ;;
@@ -525,7 +528,7 @@
 
     # Any other special object files needed ?
     case ${cpu_type} in
-      fr30 | m32r)
+      fr30 | m32r | openrisc)
 	using_cgen=yes
 	;;
 
Index: ld/Makefile.am
===================================================================
RCS file: /cvs/src/src/ld/Makefile.am,v
retrieving revision 1.57
diff -u -r1.57 Makefile.am
--- Makefile.am	2001/04/08 05:13:57	1.57
+++ Makefile.am	2001/04/27 15:39:40
@@ -155,6 +155,7 @@
 	eelf32lppc.o \
 	eelf32lppcsim.o \
 	eelf32mcore.o \
+	eelf32openrisc.o \
 	eelf32ppc.o \
 	eelf32ppclinux.o \
 	eelf32ppcsim.o \
@@ -482,6 +483,9 @@
 eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32lsmip "$(tdir_elf32lsmip)"
+eelf32openrisc.c: $(srcdir)/emulparams/elf32openrisc.sh \
+  $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+	${GENSCRIPTS} elf32openrisc "$(tdir_openrisc)"
 eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 	${GENSCRIPTS} elf32ppc "$(tdir_elf32ppc)"
Index: ld/configure.tgt
===================================================================
RCS file: /cvs/src/src/ld/configure.tgt,v
retrieving revision 1.51
diff -u -r1.51 configure.tgt
--- configure.tgt	2001/04/08 05:13:57	1.51
+++ configure.tgt	2001/04/27 15:39:40
@@ -303,6 +303,7 @@
 z8k-*-coff) 		targ_emul=z8002; targ_extra_emuls=z8001 ;;
 ns32k-pc532-mach* | ns32k-pc532-ux*)	targ_emul=pc532macha ;;
 ns32k-pc532-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd ;;
+openrisc-*-*)		targ_emul=elf32openrisc ;;
 powerpc-*-freebsd*)	targ_emul=elf32ppc;
 			targ_extra_emuls=elf32ppcsim;
 			targ_extra_libpath=elf32ppc;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gas-patch-1-files.tgz
Type: application/x-gzip
Size: 7934 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20010427/e9be8c2d/attachment.bin>


More information about the Binutils mailing list