Add Visium support to ld
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 6 Dec 2014 15:45:22 +0000 (16:45 +0100)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 6 Dec 2014 15:45:22 +0000 (16:45 +0100)
ld/
* configure.tgt: Add Visium support.
* Makefile.am (ALL_EMULATION_SOURCES): Add eelf32visium.c.
(eelf32visium.c): New rule.
* Makefile.in: Regenerate.
* emulparams/elf32visium.sh: New file.
* scripttempl/visium.sc: Likewise.
ld/testsuite/
* lib/ld-lib.exp (check_shared_lib_support): Return 0 for Visium.
* ld-visium/: New directory.

31 files changed:
ld/ChangeLog
ld/Makefile.am
ld/Makefile.in
ld/configure.tgt
ld/emulparams/elf32visium.sh [new file with mode: 0644]
ld/scripttempl/visium.sc [new file with mode: 0644]
ld/testsuite/ChangeLog
ld/testsuite/ld-elf/eh-frame-hdr.d
ld/testsuite/ld-elf/eh5.d
ld/testsuite/ld-elf/flags1.d
ld/testsuite/ld-elf/pr14926.d
ld/testsuite/ld-elf/sec-to-seg.exp
ld/testsuite/ld-visium/brr_x_backward.d [new file with mode: 0644]
ld/testsuite/ld-visium/brr_x_backward1.s [new file with mode: 0644]
ld/testsuite/ld-visium/brr_x_backward2.s [new file with mode: 0644]
ld/testsuite/ld-visium/brr_x_forward.d [new file with mode: 0644]
ld/testsuite/ld-visium/brr_x_forward1.s [new file with mode: 0644]
ld/testsuite/ld-visium/brr_x_forward2.s [new file with mode: 0644]
ld/testsuite/ld-visium/brr_x_seg.s [new file with mode: 0644]
ld/testsuite/ld-visium/brr_x_seg1.d [new file with mode: 0644]
ld/testsuite/ld-visium/brr_x_seg2.d [new file with mode: 0644]
ld/testsuite/ld-visium/imm_x_seg.d [new file with mode: 0644]
ld/testsuite/ld-visium/imm_x_seg.s [new file with mode: 0644]
ld/testsuite/ld-visium/ld1.ld [new file with mode: 0644]
ld/testsuite/ld-visium/ld2.ld [new file with mode: 0644]
ld/testsuite/ld-visium/ld3.ld [new file with mode: 0644]
ld/testsuite/ld-visium/reloc.d [new file with mode: 0644]
ld/testsuite/ld-visium/reloc1.s [new file with mode: 0644]
ld/testsuite/ld-visium/reloc2.s [new file with mode: 0644]
ld/testsuite/ld-visium/visium.exp [new file with mode: 0644]
ld/testsuite/lib/ld-lib.exp

index 9ec721faa55169f978a35f32f770ff9913d75976..7607418e8781b591599055b31659df2d7e645804 100644 (file)
@@ -1,3 +1,12 @@
+2014-12-06  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * configure.tgt: Add Visium support.
+       * Makefile.am (ALL_EMULATION_SOURCES): Add eelf32visium.c.
+       (eelf32visium.c): New rule.
+       * Makefile.in: Regenerate.
+       * emulparams/elf32visium.sh: New file.
+       * scripttempl/visium.sc: Likewise.
+
 2014-11-25  H.J. Lu  <hongjiu.lu@intel.com>
 
        * emulparams/elf_i386.sh (TINY_READONLY_SECTION): New.
index 9575f1f423223becb1347759ca5dc43115b4085d..3639d50548d10f9bfd6ab3054cf955d56ac50c7f 100644 (file)
@@ -264,6 +264,7 @@ ALL_EMULATION_SOURCES = \
        eelf32tilegx_be.c \
        eelf32tilepro.c \
        eelf32vax.c \
+       eelf32visium.c \
        eelf32xc16x.c \
        eelf32xc16xl.c \
        eelf32xc16xs.c \
@@ -1231,6 +1232,9 @@ eelf32tilepro.c: $(srcdir)/emulparams/elf32tilepro.sh \
 eelf32vax.c: $(srcdir)/emulparams/elf32vax.sh \
   $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 
+eelf32visium.c: $(srcdir)/emulparams/elf32visium.sh \
+  $(ELF_DEPS) $(srcdir)/scripttempl/visium.sc ${GEN_DEPENDS}
+
 eelf32xc16x.c: $(srcdir)/emulparams/elf32xc16x.sh \
   $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
   $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
index 9f56ca1fb176a53362ad2cac9792918d3a39d4be..20d10a1932d3e203053ad0873ac1c4d0da46025e 100644 (file)
@@ -572,6 +572,7 @@ ALL_EMULATION_SOURCES = \
        eelf32tilegx_be.c \
        eelf32tilepro.c \
        eelf32vax.c \
+       eelf32visium.c \
        eelf32xc16x.c \
        eelf32xc16xl.c \
        eelf32xc16xs.c \
@@ -1190,6 +1191,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32tilegx_be.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32tilepro.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32vax.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32visium.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xc16x.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xc16xl.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32xc16xs.Po@am__quote@
@@ -2672,6 +2674,9 @@ eelf32tilepro.c: $(srcdir)/emulparams/elf32tilepro.sh \
 eelf32vax.c: $(srcdir)/emulparams/elf32vax.sh \
   $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
 
+eelf32visium.c: $(srcdir)/emulparams/elf32visium.sh \
+  $(ELF_DEPS) $(srcdir)/scripttempl/visium.sc ${GEN_DEPENDS}
+
 eelf32xc16x.c: $(srcdir)/emulparams/elf32xc16x.sh \
   $(ELF_DEPS) $(srcdir)/emultempl/needrelax.em \
   $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
index 24e36d10f0d2b3b5d45d4ea74a7a81d7f92174f4..2f7744a26f13b116b2b6cfa43f05a92ef3960569 100644 (file)
@@ -755,6 +755,8 @@ vax-*-netbsdaout* | vax-*-netbsd*)
                        targ_extra_emuls=elf32vax ;;
 vax-*-linux-*)         targ_emul=elf32vax
                        ;;
+visium-*-elf)          targ_emul=elf32visium
+                       ;;
 w65-*-*)               targ_emul=w65
                        ;;
 xc16x-*-elf)           targ_emul=elf32xc16x
diff --git a/ld/emulparams/elf32visium.sh b/ld/emulparams/elf32visium.sh
new file mode 100644 (file)
index 0000000..17cf4b9
--- /dev/null
@@ -0,0 +1,9 @@
+SCRIPT_NAME=visium
+OUTPUT_FORMAT="elf32-visium"
+TEXT_START_ADDR=0x00000000
+MAXPAGESIZE=0x10000
+NONPAGED_TEXT_START_ADDR=0x10000
+ARCH=visium
+MACHINE=
+TEMPLATE_NAME=elf32
+DYNAMIC_LINK=FALSE
diff --git a/ld/scripttempl/visium.sc b/ld/scripttempl/visium.sc
new file mode 100644 (file)
index 0000000..60338b1
--- /dev/null
@@ -0,0 +1,181 @@
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# 
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.
+
+#  Many sections come in three flavours.  There is the 'real' section,
+#  like ".data".  Then there are the per-procedure or per-variable
+#  sections, generated by -ffunction-sections and -fdata-sections in GCC,
+#  and useful for --gc-sections, which for a variable "foo" might be
+#  ".data.foo".  Then there are the linkonce sections, for which the linker
+#  eliminates duplicates, which are named like ".gnu.linkonce.d.foo".
+#  The exact correspondences are:
+#
+#  Section     Linkonce section
+#  .text       .gnu.linkonce.t.foo
+#  .rodata     .gnu.linkonce.r.foo
+#  .data       .gnu.linkonce.d.foo
+#  .bss                .gnu.linkonce.b.foo
+#  .sdata      .gnu.linkonce.s.foo
+#  .sbss       .gnu.linkonce.sb.foo
+#  .sdata2     .gnu.linkonce.s2.foo
+#  .sbss2      .gnu.linkonce.sb2.foo
+#  .debug_info .gnu.linkonce.wi.foo
+#  .tdata      .gnu.linkonce.td.foo
+#  .tbss       .gnu.linkonce.tb.foo
+#  .lrodata    .gnu.linkonce.lr.foo
+#  .ldata      .gnu.linkonce.l.foo
+#  .lbss       .gnu.linkonce.lb.foo
+#
+#  Each of these can also have corresponding .rel.* and .rela.* sections.
+
+test -z "$ENTRY" && ENTRY=__start
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+
+ENTRY(${ENTRY})
+
+/* Start and end of main stack. Assumes 256K of RAM.  */
+${RELOCATING+ _estack = 0xe0040000 - 4;}
+${RELOCATING+ _sstack = 0xe0040000 - 64K;}
+
+/* End of heap.  */
+${RELOCATING+ _eheap = _sstack - 4;}
+
+
+MEMORY
+{
+  init    : ORIGIN = 0x00000000, LENGTH = 0x0003fffc
+  scr     : ORIGIN = 0x0003fffc, LENGTH = 0x00000004
+  rom     : ORIGIN = 0x00044000, LENGTH = 0x1ffbc000
+  ram     : ORIGIN = 0xe0000000, LENGTH = 0x10000000
+  saferam : ORIGIN = 0xf0000000, LENGTH = 0x10000000
+}
+
+
+SECTIONS
+{
+  .init ${RELOCATING-0} : {
+    KEEP (*(.init))
+    KEEP (*(.fini))
+    ${RELOCATING+ _einit  =  .;}
+  } ${RELOCATING+ > init}
+
+  .text ${RELOCATING-0} : {
+    ${RELOCATING+ _ftext  =  .;}
+    *(.text)
+    ${RELOCATING+*(.text.*)}
+    ${RELOCATING+*(.gnu.linkonce.t.*)}
+    ${RELOCATING+ _etext  =  .;}
+  } ${RELOCATING+ > rom}
+
+  .ctors ${RELOCATING-0} : {
+    ${CONSTRUCTING+ . = ALIGN(4);}
+    ${CONSTRUCTING+ __CTOR_LIST__ = .;}
+    /* gcc uses crtbegin.o to find the start of
+       the constructors, so we make sure it is
+       first.  Because this is a wildcard, it
+       doesn't matter if the user does not
+       actually link against crtbegin.o; the
+       linker won't look for a file to match a
+       wildcard.  The wildcard also means that it
+       doesn't matter which directory crtbegin.o
+       is in.  */
+
+    KEEP (*crtbegin*.o(.ctors))
+
+    /* We don't want to include the .ctor section from
+       from the crtend.o file until after the sorted ctors.
+       The .ctor section from the crtend file contains the
+       end of ctors marker and it must be last.  */
+
+    KEEP (*(EXCLUDE_FILE (*crtend*.o) .ctors))
+    KEEP (*(SORT(.ctors.*)))
+    KEEP (*(.ctors))
+    ${CONSTRUCTING+ __CTOR_END__ = .;}
+  } ${RELOCATING+ > rom}
+
+  .dtors ${RELOCATING-0} : {
+    ${CONSTRUCTING+ __DTOR_LIST__ = .;}
+    KEEP (*crtbegin*.o(.dtors))
+    KEEP (*(EXCLUDE_FILE (*crtend*.o) .dtors))
+    KEEP (*(SORT(.dtors.*)))
+    KEEP (*(.dtors))
+    ${CONSTRUCTING+ __DTOR_END__ = .;}
+  } ${RELOCATING+ > rom}
+  .rodata ${RELOCATING-0} : {
+    ${RELOCATING+ . = ALIGN(4);}
+    ${RELOCATING+ _srdata  =  .;}
+    *(.rdata)
+    *(.rodata)
+    ${RELOCATING+*(.rodata.*)}
+    ${RELOCATING+*(.gnu.linkonce.r.*)}
+    ${RELOCATING+ . = ALIGN(4);}
+    ${RELOCATING+ _erdata  =  .;}
+  } ${RELOCATING+ > rom}
+
+  .eh_frame ${RELOCATING-0} :
+  {
+    ${RELOCATING+PROVIDE (__eh_frame_begin = .);}
+    *(.eh_frame)
+    ${RELOCATING+ LONG (0);}
+    ${RELOCATING+PROVIDE (__eh_frame_end = .);}
+  } ${RELOCATING+ > rom}
+  .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) } ${RELOCATING+ > rom}
+  .jcr ${RELOCATING-0} : { *(.jcr) } ${RELOCATING+ > rom}
+
+  .data ${RELOCATING-0} : {
+    ${RELOCATING+ . = ALIGN(4);}
+    ${RELOCATING+ _sdata  =  .;}
+    *(.data)
+    ${RELOCATING+*(.data.*)}
+    ${RELOCATING+*(.gnu.linkonce.d.*)}
+    ${RELOCATING+ . = ALIGN(4);}
+    ${RELOCATING+ _edata  =  .;}
+  } ${RELOCATING+ > ram}
+  .bss ${RELOCATING-0} : {                                     
+    ${RELOCATING+ . = ALIGN(4);}
+    ${RELOCATING+ __bss_start = .;}
+    *(.bss)
+    ${RELOCATING+*(.bss.*)}
+    ${RELOCATING+*(.gnu.linkonce.b.*)}
+    *(COMMON)
+    ${RELOCATING+ . = ALIGN(4);}
+    ${RELOCATING+ __bss_end = .;}
+    ${RELOCATING+ _sheap = .;}
+  } ${RELOCATING+ > ram}
+
+  saferam ${RELOCATING-0} : {
+    *(saferam)
+    ${RELOCATING+ . = ALIGN(4);}
+    ${RELOCATING+ unitidentry = .;}
+  } ${RELOCATING+ > saferam}
+
+  /* Stabs debugging sections.  */
+  .stab          0 : { *(.stab) }
+  .stabstr       0 : { *(.stabstr) }
+  .stab.excl     0 : { *(.stab.excl) }
+  .stab.exclstr  0 : { *(.stab.exclstr) }
+  .stab.index    0 : { *(.stab.index) }
+  .stab.indexstr 0 : { *(.stab.indexstr) }
+
+  .comment       0 : { *(.comment) }
+
+EOF
+
+. $srcdir/scripttempl/DWARF.sc
+
+cat <<EOF
+}
+
+/* Provide a default address for the simulated file-I/O device.  */
+PROVIDE (_sim_fileio_register = 0x2fff0000);
+
+/* Provide a default address for the simulated command line device.  */
+PROVIDE (_sim_cmdline_header = 0x2ffe0000);
+
+/* Provide a default address for the simulated 1 MHz clock.  */
+PROVIDE (_sim_clock = 0x20002100);
+
+EOF
index 8ebe2fb17424069146b3ddc3badd5cba5a44bbaf..b27177e0c3ab4f0b0672871582b590237a90d259 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-06  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * lib/ld-lib.exp (check_shared_lib_support): Return 0 for Visium.
+       * ld-visium/: New directory.
+
 2014-12-04  Alan Modra  <amodra@gmail.com>
 
        * ld-powerpc/vxworks-relax.rd: Update for reloc sorting.
index 45a890d801255ea0bad38d2082e49ca1d95d5cf1..4214ed5fa51a666d3901fe0323a53f169283de0d 100644 (file)
@@ -2,7 +2,7 @@
 #ld: -e _start --eh-frame-hdr
 #objdump: -hw
 #target: cfi
-#xfail: avr*-*-* or1k-*-*
+#xfail: avr*-*-* or1k-*-* visium-*-*
 # avr doesn't support shared libraries.
 #...
   [0-9] .eh_frame_hdr 0*[12][048c] .*
index 29dcdf9a71210dca911aabf5893225688ebe7f4b..1a5148c2ace5796f1cb273bd474e75d8b1eabf1d 100644 (file)
@@ -4,7 +4,7 @@
 #ld:
 #readelf: -wf
 #target: cfi
-#notarget: alpha* hppa64* tile*
+#notarget: alpha* hppa64* tile* visium*
 
 Contents of the .eh_frame section:
 
index 63c2e3a049271a20ca799670ae44f812bca2543e..e7c6b4f5eeff9d209be7140e932f865d9c8cd886 100644 (file)
@@ -3,9 +3,9 @@
 #objcopy_linked_file: --set-section-flags .post_text_reserve=contents,alloc,load,readonly,code
 #readelf: -l --wide
 #xfail: "avr-*-*" "dlx-*-*" "h8300-*-*" "i960-*-*" "ip2k-*-*" "m32r-*-*"
-#xfail: "moxie-*-*" "mt-*-*" "*-*-nacl*"
+#xfail: "moxie-*-*" "mt-*-*" "visium-*-*" "*-*-nacl*"
 #xfail: "*-*-hpux*" "hppa*64*-*-*"
-# Fails on the AVR, DLX, H8300, I960, IP2K, M32R, MOXIE, MT,
+# Fails on the AVR, DLX, H8300, I960, IP2K, M32R, MOXIE, MT, VISIUM
 #  and all NaCl targets,
 #  because the two sections are not merged into one segment.
 #  (There is no good reason why they have to be).
index 148c8b468e828b8f03dd5f7fe038df669b648f4c..4f7fef4e76d5104073bb47cd2a15cba7d5f4a254 100644 (file)
@@ -1,6 +1,6 @@
 #ld: -Ttext=0x60
 #readelf: -S --wide
-#notarget: d10v-*-* msp*-*-* xstormy*-*-*
+#notarget: d10v-*-* msp*-*-* visium-*-* xstormy*-*-*
 # the above targets use memory regions that don't allow 0x60 for .text
 
 #...
index 612dd0c48514daf7251320de69c23ddf5c663342..30bf756ab9c293b5d72d22d201f29d34a3dc05c1 100644 (file)
@@ -86,6 +86,7 @@ if {    [istarget avr-*-*]
      || [istarget moxie-*-*]
      || [istarget msp430-*-*]
      || [istarget mt-*-*]
+     || [istarget visium-*-*]
     } {
     set B_test_same_seg 0
 } else {
diff --git a/ld/testsuite/ld-visium/brr_x_backward.d b/ld/testsuite/ld-visium/brr_x_backward.d
new file mode 100644 (file)
index 0000000..543e912
--- /dev/null
@@ -0,0 +1,4 @@
+#source: brr_x_backward1.s
+#source: brr_x_backward2.s
+#ld:
+#error: relocation truncated to fit: R_VISIUM_PC16
diff --git a/ld/testsuite/ld-visium/brr_x_backward1.s b/ld/testsuite/ld-visium/brr_x_backward1.s
new file mode 100644 (file)
index 0000000..03542f2
--- /dev/null
@@ -0,0 +1,6 @@
+       .text
+       .global start
+start:
+       .global L1,L2
+L1:    nop
+L2:
diff --git a/ld/testsuite/ld-visium/brr_x_backward2.s b/ld/testsuite/ld-visium/brr_x_backward2.s
new file mode 100644 (file)
index 0000000..ef15268
--- /dev/null
@@ -0,0 +1,7 @@
+       .text
+       .rept   32767
+       nop
+       .endr
+       brr     tr,L1
+       nop
+       brr     tr,L2
diff --git a/ld/testsuite/ld-visium/brr_x_forward.d b/ld/testsuite/ld-visium/brr_x_forward.d
new file mode 100644 (file)
index 0000000..29adf74
--- /dev/null
@@ -0,0 +1,4 @@
+#source: brr_x_forward1.s
+#source: brr_x_forward2.s
+#ld:
+#error: relocation truncated to fit: R_VISIUM_PC16
diff --git a/ld/testsuite/ld-visium/brr_x_forward1.s b/ld/testsuite/ld-visium/brr_x_forward1.s
new file mode 100644 (file)
index 0000000..34fddf8
--- /dev/null
@@ -0,0 +1,7 @@
+       .text
+       brr     tr,L1
+       nop
+       brr     tr,L2
+       .rept   32765
+       nop
+       .endr
diff --git a/ld/testsuite/ld-visium/brr_x_forward2.s b/ld/testsuite/ld-visium/brr_x_forward2.s
new file mode 100644 (file)
index 0000000..65e3dae
--- /dev/null
@@ -0,0 +1,6 @@
+       .global start
+       .global L1,L2
+       .text
+start:
+L1:    nop
+L2:
diff --git a/ld/testsuite/ld-visium/brr_x_seg.s b/ld/testsuite/ld-visium/brr_x_seg.s
new file mode 100644 (file)
index 0000000..8a55711
--- /dev/null
@@ -0,0 +1,9 @@
+       .text
+       nop
+       brr     tr,L1
+       nop
+       .data
+       .global start
+start:
+       .long   0
+L1:
diff --git a/ld/testsuite/ld-visium/brr_x_seg1.d b/ld/testsuite/ld-visium/brr_x_seg1.d
new file mode 100644 (file)
index 0000000..ace1028
--- /dev/null
@@ -0,0 +1,3 @@
+#source: brr_x_seg.s
+#ld: -T ld1.ld
+#error: relocation truncated to fit: R_VISIUM_PC16
diff --git a/ld/testsuite/ld-visium/brr_x_seg2.d b/ld/testsuite/ld-visium/brr_x_seg2.d
new file mode 100644 (file)
index 0000000..9441d86
--- /dev/null
@@ -0,0 +1,3 @@
+#source: brr_x_seg.s
+#ld: -T ld2.ld
+#error: relocation truncated to fit: R_VISIUM_PC16
diff --git a/ld/testsuite/ld-visium/imm_x_seg.d b/ld/testsuite/ld-visium/imm_x_seg.d
new file mode 100644 (file)
index 0000000..d52fb7e
--- /dev/null
@@ -0,0 +1,3 @@
+#source: imm_x_seg.s
+#ld: -T ld3.ld
+#error: relocation truncated to fit: R_VISIUM_IM16_PCREL
diff --git a/ld/testsuite/ld-visium/imm_x_seg.s b/ld/testsuite/ld-visium/imm_x_seg.s
new file mode 100644 (file)
index 0000000..d490b6f
--- /dev/null
@@ -0,0 +1,8 @@
+       .section seg1
+foo:
+       nop
+       moviq   r6,bar-foo
+
+       .section seg2
+bar:
+       .end
diff --git a/ld/testsuite/ld-visium/ld1.ld b/ld/testsuite/ld-visium/ld1.ld
new file mode 100644 (file)
index 0000000..fc33cf8
--- /dev/null
@@ -0,0 +1,9 @@
+SECTIONS
+{
+  .text 0x10000 : {
+    *(.text)
+  }
+  .data 0x30000 : {
+    *(.data)
+  }
+}
diff --git a/ld/testsuite/ld-visium/ld2.ld b/ld/testsuite/ld-visium/ld2.ld
new file mode 100644 (file)
index 0000000..74f399a
--- /dev/null
@@ -0,0 +1,9 @@
+SECTIONS
+{
+  .text 0x30004 : {
+    *(.text)
+  }
+  .data 0x10000 : {
+    *(.data)
+  }
+}
diff --git a/ld/testsuite/ld-visium/ld3.ld b/ld/testsuite/ld-visium/ld3.ld
new file mode 100644 (file)
index 0000000..e3934cd
--- /dev/null
@@ -0,0 +1,9 @@
+SECTIONS
+{
+  seg1 0x10000 : {
+    *(seg1)
+  }
+  seg2 0x20000 : {
+    *(seg2)
+  }
+}
diff --git a/ld/testsuite/ld-visium/reloc.d b/ld/testsuite/ld-visium/reloc.d
new file mode 100644 (file)
index 0000000..bca5817
--- /dev/null
@@ -0,0 +1,14 @@
+#source: reloc1.s
+#source: reloc2.s
+#ld: -T ld1.ld
+#objdump: -s
+
+.*: +file format .*
+
+Contents of section .text:
+ 10000 00000000 7800000a 84c20034 8482003c  ....x......4...<
+ 10010 84a20001 84c20002 0442002c 84020002  .........B.,....
+ 10020 0482002c 84a20002 84c21000           ...,........    
+Contents of section .data:
+ 30000 00140014 00000014 0001002c 0002002c  ...........,...,
+ 30010 10001010                             ....            
diff --git a/ld/testsuite/ld-visium/reloc1.s b/ld/testsuite/ld-visium/reloc1.s
new file mode 100644 (file)
index 0000000..41be3de
--- /dev/null
@@ -0,0 +1,24 @@
+       .data
+foo:
+       .byte   0
+       .byte   data1-foo
+       .word   data1-foo
+       .long   data1-foo
+       .long   text1
+       .long   text2
+       .word   abs1
+       .word   abs1+0x10
+       .text
+bar:
+       nop
+       brr     tr,text1
+       moviq   r2,text1-bar+8
+       movil   r2,%l text2-bar+16
+       moviu   r2,%u text2-bar+16
+       moviq   r2,%u text2
+       subi    r2,%l text2
+       addi    r2,%u text2
+       movil   r2, text2       ; with movil, the %l may be omitted
+       moviu   r2,%u text2
+       moviq   r2,abs1
+       .end
diff --git a/ld/testsuite/ld-visium/reloc2.s b/ld/testsuite/ld-visium/reloc2.s
new file mode 100644 (file)
index 0000000..517d977
--- /dev/null
@@ -0,0 +1,12 @@
+       .global abs1
+abs1 = 0x1000
+
+       .data
+       .global data1
+data1:
+       .text
+       .global text1
+text1:
+       .global text2
+text2 = . + 65536
+       .end
diff --git a/ld/testsuite/ld-visium/visium.exp b/ld/testsuite/ld-visium/visium.exp
new file mode 100644 (file)
index 0000000..c61467c
--- /dev/null
@@ -0,0 +1,30 @@
+# Expect script for Visium tests.
+#   Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# This file is part of the GNU Binutils.
+#
+# This program 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 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., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+# Visium linker testsuite.
+
+if [istarget visium-*-*] {
+    run_dump_test "brr_x_backward"
+    run_dump_test "brr_x_forward"
+    run_dump_test "brr_x_seg1"
+    run_dump_test "brr_x_seg2"
+    run_dump_test "imm_x_seg"
+    run_dump_test "reloc"
+}
index 870cd1247e2107a8ad6dd830b7c38635ec45451c..1d112d65c3f7b06bb428fa13558c995b60779774 100644 (file)
@@ -1652,6 +1652,7 @@ proc check_shared_lib_support { } {
         && ![istarget rx-*-*]
         && ![istarget spu-*-*]
         && ![istarget v850*-*-*]
+        && ![istarget visium-*-*]
         && ![istarget xstormy16-*-*]
         && ![istarget *-*-irix*]
         && ![istarget *-*-rtems] } {