aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-11-08 13:17:43 +0000
committerNick Clifton <nickc@redhat.com>2004-11-08 13:17:43 +0000
commit7499d566bb9495cac23109f01ded20f8849d08ae (patch)
tree30530048723553d2c770364cea592becdda630c1 /ld
parentdc85a459cf260d72565cb988960c12ff9cd3da3c (diff)
downloadfsf-binutils-gdb-7499d566bb9495cac23109f01ded20f8849d08ae.zip
fsf-binutils-gdb-7499d566bb9495cac23109f01ded20f8849d08ae.tar.gz
fsf-binutils-gdb-7499d566bb9495cac23109f01ded20f8849d08ae.tar.bz2
Add support fpr MAXQ processor
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog10
-rw-r--r--ld/Makefile.am4
-rw-r--r--ld/Makefile.in15
-rw-r--r--ld/NEWS2
-rw-r--r--ld/configure.tgt1
-rw-r--r--ld/emulparams/maxqcoff.sh7
-rw-r--r--ld/scripttempl/maxqcoff.sc43
-rw-r--r--ld/testsuite/ld-maxq/addend.dd21
-rw-r--r--ld/testsuite/ld-maxq/addend.s16
-rw-r--r--ld/testsuite/ld-maxq/maxq.exp52
-rw-r--r--ld/testsuite/ld-maxq/paddr.dd16
-rw-r--r--ld/testsuite/ld-maxq/paddr.s14
-rw-r--r--ld/testsuite/ld-maxq/paddr1.dd18
-rw-r--r--ld/testsuite/ld-maxq/paddr1.s10
-rw-r--r--ld/testsuite/ld-maxq/r32-1.s20
-rw-r--r--ld/testsuite/ld-maxq/r32-2.s13
-rw-r--r--ld/testsuite/ld-maxq/r32.dd31
17 files changed, 287 insertions, 6 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 99d27ee..b667596 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,13 @@
+2004-11-08 Inderpreet Singh <inderpreetb@nioda.hcltech.com>
+ Vineet Sharma <vineets@noida.hcltech.com>
+
+ * Makefile.am: Add entries for new maxq-coff target.
+ * Makefile.in: Regenerate.
+ * configure.tgt: Add support for maxq.
+ * emulparams/maxqcoff.sh: New File.
+ * scripttempl/maxqcoff.sc: New linker script for target maxq.
+ * NEWS: Mention the new target.
+
2004-11-08 Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>
* testsuite/ld-scripts/weak.exp: Enable test on PE,
diff --git a/ld/Makefile.am b/ld/Makefile.am
index cd44049..32a630f 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -250,6 +250,7 @@ ALL_EMULATIONS = \
em68knbsd.o \
em68kpsos.o \
em88kbcs.o \
+ emaxqcoff.o \
emcorepe.o \
emipsbig.o \
emipsbsd.o \
@@ -1042,6 +1043,9 @@ em68kpsos.c: $(srcdir)/emulparams/m68kpsos.sh \
em88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS}
${GENSCRIPTS} m88kbcs "$(tdir_m88kbcs)"
+emaxqcoff.c: $(srcdir)/emulparams/maxqcoff.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/maxqcoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} maxqcoff "$(tdir_maxqcoff)"
emcorepe.c: $(srcdir)/emulparams/mcorepe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
${GENSCRIPTS} mcorepe "$(tdir_mcorepe)"
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 6e6aeb0..39f2878 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
@@ -201,7 +201,7 @@ INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) -I$(to
BFDLIB = ../bfd/libbfd.la
LIBIBERTY = ../libiberty/libiberty.a
-ALL_EMULATIONS = ea29k.o eaixppc.o eaixrs6.o ealpha.o earcelf.o earm_epoc_pe.o earmaoutb.o earmaoutl.o earmcoff.o earmelf.o earmelfb.o earmelf_fbsd.o earmelf_linux.o earmelfb_linux.o earmelf_nbsd.o earmelfb_nbsd.o earmnto.o earmnbsd.o earmpe.o earmsymbian.o eavr2.o eavr1.o eavr3.o eavr4.o eavr5.o ecoff_i860.o ecoff_sparc.o ecrisaout.o ecriself.o ecrislinux.o ed10velf.o ed30v_e.o ed30v_o.o ed30velf.o edelta68.o eelf32_dlx.o eebmon29k.o eelf32_i960.o eelf32_i860.o eelf32_sparc.o eelf32b4300.o eelf32cr16c.o eelf32bmip.o eelf32bmipn32.o eelf32btsmip.o eelf32crx.o eelf32btsmipn32.o eelf32ltsmip.o eelf32ltsmipn32.o eelf32ebmip.o eelf32elmip.o eelf32fr30.o eelf32frv.o eelf32i370.o eelf32ip2k.o eelf32iq2000.o eelf32iq10.o eelf32l4300.o eelf32lmip.o eelf32lppc.o eelf32lppcnto.o eelf32lppcsim.o eelf32mcore.o eelf32mipswindiss.o eelf32openrisc.o eelf32ppc.o eelf32ppc_fbsd.o eelf32ppclinux.o eelf32ppcnto.o eelf32ppcsim.o eelf32ppcwindiss.o eelf32vax.o eelf32xstormy16.o eelf32xtensa.o eelf_i386.o eelf_i386_be.o eelf_i386_chaos.o eelf_i386_fbsd.o eelf_i386_ldso.o eelf_s390.o egld960.o egld960coff.o eh8300.o eh8300h.o eh8300s.o eh8300elf.o eh8300hn.o eh8300sn.o eh8300sx.o eh8300helf.o eh8300self.o eh8300hnelf.o eh8300snelf.o eh8300sxelf.o eh8300sxn.o eh8300sxnelf.o eh8500.o eh8500b.o eh8500c.o eh8500m.o eh8500s.o ehp300bsd.o ehp3hpux.o ehppaelf.o ehppalinux.o ehppanbsd.o ehppaobsd.o ei386aout.o ei386beos.o ei386bsd.o ei386coff.o ei386go32.o ei386linux.o ei386lynx.o ei386mach.o ei386moss.o ei386msdos.o ei386nbsd.o ei386nto.o ei386nw.o ei386pe.o ei386pe_posix.o elnk960.o em32relf.o em32rlelf.o em32relf_linux.o em32rlelf_linux.o em68hc11elf.o em68hc11elfb.o em68hc12elf.o em68hc12elfb.o em68k4knbsd.o em68kaout.o em68kaux.o em68kcoff.o em68kelf.o em68kelfnbsd.o em68klinux.o em68klynx.o em68knbsd.o em68kpsos.o em88kbcs.o emcorepe.o emipsbig.o emipsbsd.o emipsidt.o emipsidtl.o emipslit.o emipslnews.o emipspe.o emsp430x110.o emsp430x112.o emsp430x1101.o emsp430x1111.o emsp430x1121.o emsp430x1122.o emsp430x1132.o emsp430x122.o emsp430x123.o emsp430x1222.o emsp430x1232.o emsp430x133.o emsp430x135.o emsp430x1331.o emsp430x1351.o emsp430x147.o emsp430x148.o emsp430x149.o emsp430x155.o emsp430x156.o emsp430x157.o emsp430x167.o emsp430x168.o emsp430x169.o emsp430x1610.o emsp430x1611.o emsp430x1612.o emsp430x311.o emsp430x312.o emsp430x313.o emsp430x314.o emsp430x315.o emsp430x323.o emsp430x325.o emsp430x336.o emsp430x337.o emsp430x412.o emsp430x413.o emsp430x415.o emsp430x417.o emsp430xE423.o emsp430xE425.o emsp430xE427.o emsp430xW423.o emsp430xW425.o emsp430xW427.o emsp430xG437.o emsp430xG438.o emsp430xG439.o emsp430x435.o emsp430x436.o emsp430x437.o emsp430x447.o emsp430x448.o emsp430x449.o enews.o ens32knbsd.o eor32.o eor32elf.o epc532macha.o epdp11.o epjelf.o epjlelf.o eppcmacos.o eppcnw.o eppcpe.o eppclynx.o eriscix.o esa29200.o esh.o eshelf32.o eshlelf32.o eshelf32_linux.o eshlelf32_linux.o eshelf32_nbsd.o eshlelf32_nbsd.o eshelf.o eshelf_linux.o eshlelf_linux.o eshelf_nbsd.o eshlelf_nbsd.o eshelf_nto.o eshlelf_nto.o eshl.o eshlelf.o eshlsymbian.o eshpe.o esparcaout.o esparclinux.o esparclynx.o esparcnbsd.o est2000.o esun3.o esun4.o etic30aout.o etic30coff.o etic3xcoff.o etic3xcoff_onchip.o etic4xcoff.o etic54xcoff.o etic80coff.o evanilla.o evax.o evaxnbsd.o evsta.o ew65.o ez8001.o eelf32frvfd.o ez8002.o
+ALL_EMULATIONS = ea29k.o eaixppc.o eaixrs6.o ealpha.o earcelf.o earm_epoc_pe.o earmaoutb.o earmaoutl.o earmcoff.o earmelf.o earmelfb.o earmelf_fbsd.o earmelf_linux.o earmelfb_linux.o earmelf_nbsd.o earmelfb_nbsd.o earmnto.o earmnbsd.o earmpe.o earmsymbian.o eavr2.o eavr1.o eavr3.o eavr4.o eavr5.o ecoff_i860.o ecoff_sparc.o ecrisaout.o ecriself.o ecrislinux.o ed10velf.o ed30v_e.o ed30v_o.o ed30velf.o edelta68.o eelf32_dlx.o eebmon29k.o eelf32_i960.o eelf32_i860.o eelf32_sparc.o eelf32b4300.o eelf32cr16c.o eelf32bmip.o eelf32bmipn32.o eelf32btsmip.o eelf32crx.o eelf32btsmipn32.o eelf32ltsmip.o eelf32ltsmipn32.o eelf32ebmip.o eelf32elmip.o eelf32fr30.o eelf32frv.o eelf32i370.o eelf32ip2k.o eelf32iq2000.o eelf32iq10.o eelf32l4300.o eelf32lmip.o eelf32lppc.o eelf32lppcnto.o eelf32lppcsim.o eelf32mcore.o eelf32mipswindiss.o eelf32openrisc.o eelf32ppc.o eelf32ppc_fbsd.o eelf32ppclinux.o eelf32ppcnto.o eelf32ppcsim.o eelf32ppcwindiss.o eelf32vax.o eelf32xstormy16.o eelf32xtensa.o eelf_i386.o eelf_i386_be.o eelf_i386_chaos.o eelf_i386_fbsd.o eelf_i386_ldso.o eelf_s390.o egld960.o egld960coff.o eh8300.o eh8300h.o eh8300s.o eh8300elf.o eh8300hn.o eh8300sn.o eh8300sx.o eh8300helf.o eh8300self.o eh8300hnelf.o eh8300snelf.o eh8300sxelf.o eh8300sxn.o eh8300sxnelf.o eh8500.o eh8500b.o eh8500c.o eh8500m.o eh8500s.o ehp300bsd.o ehp3hpux.o ehppaelf.o ehppalinux.o ehppanbsd.o ehppaobsd.o ei386aout.o ei386beos.o ei386bsd.o ei386coff.o ei386go32.o ei386linux.o ei386lynx.o ei386mach.o ei386moss.o ei386msdos.o ei386nbsd.o ei386nto.o ei386nw.o ei386pe.o ei386pe_posix.o elnk960.o em32relf.o em32rlelf.o em32relf_linux.o em32rlelf_linux.o em68hc11elf.o em68hc11elfb.o em68hc12elf.o em68hc12elfb.o em68k4knbsd.o em68kaout.o em68kaux.o em68kcoff.o em68kelf.o em68kelfnbsd.o em68klinux.o em68klynx.o em68knbsd.o em68kpsos.o em88kbcs.o emaxqcoff.o emcorepe.o emipsbig.o emipsbsd.o emipsidt.o emipsidtl.o emipslit.o emipslnews.o emipspe.o emsp430x110.o emsp430x112.o emsp430x1101.o emsp430x1111.o emsp430x1121.o emsp430x1122.o emsp430x1132.o emsp430x122.o emsp430x123.o emsp430x1222.o emsp430x1232.o emsp430x133.o emsp430x135.o emsp430x1331.o emsp430x1351.o emsp430x147.o emsp430x148.o emsp430x149.o emsp430x155.o emsp430x156.o emsp430x157.o emsp430x167.o emsp430x168.o emsp430x169.o emsp430x1610.o emsp430x1611.o emsp430x1612.o emsp430x311.o emsp430x312.o emsp430x313.o emsp430x314.o emsp430x315.o emsp430x323.o emsp430x325.o emsp430x336.o emsp430x337.o emsp430x412.o emsp430x413.o emsp430x415.o emsp430x417.o emsp430xE423.o emsp430xE425.o emsp430xE427.o emsp430xW423.o emsp430xW425.o emsp430xW427.o emsp430xG437.o emsp430xG438.o emsp430xG439.o emsp430x435.o emsp430x436.o emsp430x437.o emsp430x447.o emsp430x448.o emsp430x449.o enews.o ens32knbsd.o eor32.o eor32elf.o epc532macha.o epdp11.o epjelf.o epjlelf.o eppcmacos.o eppcnw.o eppcpe.o eppclynx.o eriscix.o esa29200.o esh.o eshelf32.o eshlelf32.o eshelf32_linux.o eshlelf32_linux.o eshelf32_nbsd.o eshlelf32_nbsd.o eshelf.o eshelf_linux.o eshlelf_linux.o eshelf_nbsd.o eshlelf_nbsd.o eshelf_nto.o eshlelf_nto.o eshl.o eshlelf.o eshlsymbian.o eshpe.o esparcaout.o esparclinux.o esparclynx.o esparcnbsd.o est2000.o esun3.o esun4.o etic30aout.o etic30coff.o etic3xcoff.o etic3xcoff_onchip.o etic4xcoff.o etic54xcoff.o etic80coff.o evanilla.o evax.o evaxnbsd.o evsta.o ew65.o ez8001.o eelf32frvfd.o ez8002.o
ALL_64_EMULATIONS = eelf64_aix.o eelf64_ia64.o eelf64_ia64_fbsd.o eshelf64.o eshlelf64.o eshelf64_nbsd.o eshlelf64_nbsd.o eelf_x86_64.o eelf_x86_64_fbsd.o eelf64_s390.o eelf64_sparc.o eelf64_sparc_fbsd.o eelf64alpha.o eelf64alpha_fbsd.o eelf64alpha_nbsd.o eelf64bmip.o eelf64btsmip.o eelf64ltsmip.o eelf64hppa.o eelf64mmix.o emmo.o eelf64ppc.o eelf64lppc.o ehppa64linux.o
@@ -301,7 +301,7 @@ deffilep.c ldgram.c ldlex.c
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
+TAR = gtar
GZIP_ENV = --best
SOURCES = $(ld_new_SOURCES) $(EXTRA_ld_new_SOURCES)
OBJECTS = $(ld_new_OBJECTS)
@@ -644,7 +644,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) $(LISP
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)config.in$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags config.in $$unique $(LISP))
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.in $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
@@ -734,7 +734,7 @@ site.exp: Makefile
@echo 'set build_alias $(build_alias)' >> $@-t
@echo 'set build_triplet $(build_triplet)' >> $@-t
@echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t
- @test ! -f $(srcdir)/site.exp || sed '1,/^## All variables above are.*##/ d' $(srcdir)/site.exp >> $@-t
+ @test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t
@test ! -f site.exp || mv site.exp site.bak
@mv $@-t site.exp
info-am: $(INFO_DEPS)
@@ -783,7 +783,7 @@ distclean-generic:
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
- -test -z "ldlexcdeffilephdeffilepcldgramhldgramc$(MAINTAINERCLEANFILES)" || rm -f ldlexc deffileph deffilepc ldgramh ldgramc $(MAINTAINERCLEANFILES)
+ -test -z "ldlexldeffilephdeffilepcldgramhldgramc$(MAINTAINERCLEANFILES)" || rm -f ldlexl deffileph deffilepc ldgramh ldgramc $(MAINTAINERCLEANFILES)
mostlyclean-am: mostlyclean-hdr mostlyclean-noinstPROGRAMS \
mostlyclean-compile mostlyclean-libtool \
mostlyclean-aminfo mostlyclean-tags mostlyclean-generic \
@@ -1455,6 +1455,9 @@ em68kpsos.c: $(srcdir)/emulparams/m68kpsos.sh \
em88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
$(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS}
${GENSCRIPTS} m88kbcs "$(tdir_m88kbcs)"
+emaxqcoff.c: $(srcdir)/emulparams/maxqcoff.sh \
+ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/maxqcoff.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} maxqcoff "$(tdir_maxqcoff)"
emcorepe.c: $(srcdir)/emulparams/mcorepe.sh \
$(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
${GENSCRIPTS} mcorepe "$(tdir_mcorepe)"
diff --git a/ld/NEWS b/ld/NEWS
index 03bd4f6..8196f44 100644
--- a/ld/NEWS
+++ b/ld/NEWS
@@ -1,5 +1,7 @@
-*- text -*-
+* Port to MAXQ processor contributed by HCL Tech.
+
* Added SEGMENT_START to the linker script language to permit the user to
override the base address for a segment from the command-line.
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 85ae8aa..1a20c85 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -130,6 +130,7 @@ m68*-sun-sunos[34]*) targ_emul=sun3 ;;
m68*-wrs-vxworks*) targ_emul=sun3 ;;
m68*-ericsson-ose) targ_emul=sun3 ;;
m68*-apple-aux*) targ_emul=m68kaux ;;
+maxq-*-coff) targ_emul=maxqcoff;;
*-tandem-none) targ_emul=st2000 ;;
i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;;
diff --git a/ld/emulparams/maxqcoff.sh b/ld/emulparams/maxqcoff.sh
new file mode 100644
index 0000000..d07533b
--- /dev/null
+++ b/ld/emulparams/maxqcoff.sh
@@ -0,0 +1,7 @@
+OUTPUT_FORMAT="coff-maxq"
+
+SCRIPT_NAME=maxqcoff
+
+ARCH=MAXQ
+
+TEXT_START_ADDR=0x8000
diff --git a/ld/scripttempl/maxqcoff.sc b/ld/scripttempl/maxqcoff.sc
new file mode 100644
index 0000000..2e09304
--- /dev/null
+++ b/ld/scripttempl/maxqcoff.sc
@@ -0,0 +1,43 @@
+test -z "$ENTRY" && ENTRY=_main
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+${LIB_SEARCH_DIRS}
+ENTRY(${ENTRY})
+MEMORY
+ {
+ rom (rx) : ORIGIN = 0, LENGTH = 0x7FFE
+ ram (!rx) : org = 0x0A000, l = 0x5FFF
+ }
+
+SECTIONS
+{
+ .text ${RELOCATING+ 0x0000}:
+ {
+ *(.text)
+ } >rom
+
+ .data ${RELOCATING}:
+ {
+ *(.data)
+ *(.rodata)
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ edata = .};
+ }>ram
+
+/* .bss ${RELOCATING+ SIZEOF(.data) + 0x0000} :
+ {
+ *(.bss)
+ *(COMMON)
+ }
+*/
+ .stab 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stab ]
+ }
+ .stabstr 0 ${RELOCATING+(NOLOAD)} :
+ {
+ [ .stabstr ]
+ }
+}
+EOF
diff --git a/ld/testsuite/ld-maxq/addend.dd b/ld/testsuite/ld-maxq/addend.dd
new file mode 100644
index 0000000..5cd8b32
--- /dev/null
+++ b/ld/testsuite/ld-maxq/addend.dd
@@ -0,0 +1,21 @@
+.*: +file format .*
+
+Disassembly of section .text:
+
+00000000 <_main>:
+ 0: 78 56 [ ]*MOVE 56h, #78h
+ ...
+
+00000004 <_buf1>:
+ 4: 34 12 [ ]*MOVE 12h, #34h
+ ...
+
+00000008 <_start>:
+ 8: 3a da [ ]*NOP
+ a: 3a da [ ]*NOP
+ c: 00 0b [ ]*MOVE PFX\[0\], #00h
+ e: 03 09 [ ]*MOVE A\[0\], #03h
+ 10: 00 0b [ ]*MOVE PFX\[0\], #00h
+ 12: 01 09 [ ]*MOVE A\[0\], #01h
+ 14: fa 3d [ ]*CALL #fah
+ 16: f8 3d [ ]*CALL #f8h
diff --git a/ld/testsuite/ld-maxq/addend.s b/ld/testsuite/ld-maxq/addend.s
new file mode 100644
index 0000000..a5ca450
--- /dev/null
+++ b/ld/testsuite/ld-maxq/addend.s
@@ -0,0 +1,16 @@
+; Addend check testcases
+; inderpreetb@noida.hcltech.com
+.global _main
+_main:
+_buf0:
+ .long 0x5678
+_buf1:
+ .long 0x1234
+_start:
+ nop
+ nop
+ move A[0], _buf1+2
+ move A[0], _buf1-2
+ call _buf0+8
+ call _buf1+2
+
diff --git a/ld/testsuite/ld-maxq/maxq.exp b/ld/testsuite/ld-maxq/maxq.exp
new file mode 100644
index 0000000..ceac713
--- /dev/null
+++ b/ld/testsuite/ld-maxq/maxq.exp
@@ -0,0 +1,52 @@
+# Expect script for ld-maxq tests
+# Copyright (C) 2004 Free Software Foundation
+#
+# This file 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 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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 this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# Written by inderpreetb@noida.hcltech.com
+
+# Test maxq linking; all types of relocs. This tests the assembler and
+# tools like objdump as well as the linker.
+
+if { !([istarget "maxq*-*-*"] ) } {
+ return
+}
+
+# List contains test-items with 3 items followed by 2 lists:
+# 0:name 1:ld options 2:assembler options
+# 3:filenames of assembler files 4: action and options. 5: name of output file
+
+# Actions:
+# objdump: Apply objdump options on result. Compare with regex (last arg).
+# nm: Apply nm options on result. Compare with regex (last arg).
+# readelf: Apply readelf options on result. Compare with regex (last arg).
+
+set maxqtests {
+{"32-bit Relocation check" "" ""
+{r32-1.s r32-2.s} {{objdump -drw r32.dd}}
+"r32.o" }
+{"maxq addend check" "" ""
+{addend.s} {{objdump -dw addend.dd}}
+"addendo.o" }
+{"16bit relocation test" "" ""
+{paddr.s} {{objdump -Dw paddr.dd}}
+"paddro.o" }
+{"16bit relocation test-1" "" ""
+{paddr1.s} {{objdump -Dw paddr1.dd}}
+"paddro1.o" }
+
+}
+
+run_ld_link_tests $maxqtests
diff --git a/ld/testsuite/ld-maxq/paddr.dd b/ld/testsuite/ld-maxq/paddr.dd
new file mode 100644
index 0000000..8f5ab48
--- /dev/null
+++ b/ld/testsuite/ld-maxq/paddr.dd
@@ -0,0 +1,16 @@
+.*: +file format .*
+
+Disassembly of section .text:
+
+00000000 <main>:
+ 0: 12 09 [ ]*MOVE A\[0\], #12h
+ 2: 3a da [ ]*NOP
+ 4: 3a da [ ]*NOP
+ ...
+Disassembly of section .data:
+
+0000a000 <lb>:
+ a000: 23 00 [ ]*MOVE 00h, #23h
+
+0000a002 <plc>:
+ a002: 00 a0 [ ]*MOVE 20h, 00h
diff --git a/ld/testsuite/ld-maxq/paddr.s b/ld/testsuite/ld-maxq/paddr.s
new file mode 100644
index 0000000..693da88
--- /dev/null
+++ b/ld/testsuite/ld-maxq/paddr.s
@@ -0,0 +1,14 @@
+.text
+main:
+
+ move A[0], #12h
+ nop
+ nop
+
+
+
+.data
+
+lb: .word 0x23
+plc: .word lb
+
diff --git a/ld/testsuite/ld-maxq/paddr1.dd b/ld/testsuite/ld-maxq/paddr1.dd
new file mode 100644
index 0000000..1297b83
--- /dev/null
+++ b/ld/testsuite/ld-maxq/paddr1.dd
@@ -0,0 +1,18 @@
+.*: +file format .*
+
+Disassembly of section .text:
+
+00000000 <main>:
+ 0: 12 09 MOVE A\[0\], #12h
+ 2: 3a da NOP
+ 4: 3a da NOP
+ ...
+Disassembly of section .data:
+
+0000a000 <lb>:
+ a000: 23 00 MOVE 00h, #23h
+ ...
+
+0000a004 <plc>:
+ a004: 00 a0 MOVE 20h, 00h
+ ...
diff --git a/ld/testsuite/ld-maxq/paddr1.s b/ld/testsuite/ld-maxq/paddr1.s
new file mode 100644
index 0000000..2f3d165
--- /dev/null
+++ b/ld/testsuite/ld-maxq/paddr1.s
@@ -0,0 +1,10 @@
+.text
+main:
+
+ move A[0], #12h
+ nop
+ nop
+.data
+
+lb: .long 0x23
+plc: .long lb
diff --git a/ld/testsuite/ld-maxq/r32-1.s b/ld/testsuite/ld-maxq/r32-1.s
new file mode 100644
index 0000000..9cf38c1
--- /dev/null
+++ b/ld/testsuite/ld-maxq/r32-1.s
@@ -0,0 +1,20 @@
+; Test the intersegment relocation
+; Inderpreetb@noida.hcltech.com
+
+.global _start
+.extern _main
+_start:
+ call _main
+ nop
+ nop
+ nop
+ nop
+.global _exit
+_exit:
+ nop
+ nop
+ nop
+.global _abort
+_abort:
+ nop
+ nop
diff --git a/ld/testsuite/ld-maxq/r32-2.s b/ld/testsuite/ld-maxq/r32-2.s
new file mode 100644
index 0000000..49bb59e
--- /dev/null
+++ b/ld/testsuite/ld-maxq/r32-2.s
@@ -0,0 +1,13 @@
+;
+; test the intersegment relocation
+; inderpreetb@noida.hcltech.com
+.extern _start
+.extern _abort
+.extern _exit
+.global _main
+_main:
+ call _exit
+ call _abort
+ ljump _abort
+ ljump _exit
+
diff --git a/ld/testsuite/ld-maxq/r32.dd b/ld/testsuite/ld-maxq/r32.dd
new file mode 100644
index 0000000..f245ca9
--- /dev/null
+++ b/ld/testsuite/ld-maxq/r32.dd
@@ -0,0 +1,31 @@
+.*: +file format .*
+
+Disassembly of section .text:
+
+00000000 <_start>:
+ 0: 00 0b [ ]*MOVE PFX\[0\], #00h
+ 2: 0c 3d [ ]*CALL #0ch
+ 4: 3a da [ ]*NOP
+ 6: 3a da [ ]*NOP
+ 8: 3a da [ ]*NOP
+ a: 3a da [ ]*NOP
+
+0000000c <_exit>:
+ c: 3a da [ ]*NOP
+ e: 3a da [ ]*NOP
+ 10: 3a da [ ]*NOP
+
+00000012 <_abort>:
+ 12: 3a da [ ]*NOP
+ 14: 3a da [ ]*NOP
+ ...
+
+00000018 <_main>:
+ 18: 00 0b [ ]*MOVE PFX\[0\], #00h
+ 1a: 06 3d [ ]*CALL #06h
+ 1c: 00 0b [ ]*MOVE PFX\[0\], #00h
+ 1e: 09 3d [ ]*CALL #09h
+ 20: 00 0b [ ]*MOVE PFX\[0\], #00h
+ 22: 09 0c [ ]*JUMP #09h
+ 24: 00 0b [ ]*MOVE PFX\[0\], #00h
+ 26: 06 0c [ ]*JUMP #06h