aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/mxp/demo
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/mxp/demo')
-rw-r--r--gcc/config/mxp/demo/Makefile78
-rw-r--r--gcc/config/mxp/demo/array.c9
-rw-r--r--gcc/config/mxp/demo/crtroend.S3
-rw-r--r--gcc/config/mxp/demo/crtrostart.S3
-rw-r--r--gcc/config/mxp/demo/crtvend.S3
-rw-r--r--gcc/config/mxp/demo/demo.c35
-rw-r--r--gcc/config/mxp/demo/demo.h12
-rw-r--r--gcc/config/mxp/demo/dma-gen.c79
-rw-r--r--gcc/config/mxp/demo/max.c25
-rw-r--r--gcc/config/mxp/demo/mxp-start.S13
-rw-r--r--gcc/config/mxp/demo/mxp-wrap.S39
-rw-r--r--gcc/config/mxp/demo/mxp.x254
12 files changed, 553 insertions, 0 deletions
diff --git a/gcc/config/mxp/demo/Makefile b/gcc/config/mxp/demo/Makefile
new file mode 100644
index 00000000000..84d851e33a2
--- /dev/null
+++ b/gcc/config/mxp/demo/Makefile
@@ -0,0 +1,78 @@
+MXP_CC1=/scratch/gcc-4.4.0-20080716-arc-int/bld-mxp/gcc/cc1
+MXP_AS=~irfanr/tasks/045_mxp2/binutils/build/gas/as-new
+MXP_LD=~irfanr/tasks/045_mxp2/binutils/build/ld/ld-new
+ARC_CC=/apps/gnu/arc-gnu-tools/rel2.1/elf32/bin/arc-elf32-gcc
+ARC_AS=/apps/gnu/arc-gnu-tools/rel2.1/elf32/bin/arc-elf32-as
+ARC_LD=/apps/gnu/arc-gnu-tools/rel2.1/elf32/bin/arc-elf32-ld
+OBJCOPY=/apps/gnu/arc-gnu-tools/rel2.1/elf32/bin/arc-elf32-objcopy
+OPTS=-O2 -ftree-vectorize -g
+
+all: arc-demo mxp-demo
+
+clean:
+ rm -f *.s *.o mxp-max.x0 mxp-max.x1 arc-demo mxp-demo dma-gen
+
+mxp-max-0.s: max.c demo.h
+ $(MXP_CC1) $(OPTS) -g0 -quiet -mint16 -fno-common -mno-vim-label -o $@ $<
+
+mxp-max.s: mxp-max-0.s
+ sed -e 's/@.LC0]/0]/' -e 's/@s]/16]/' -e 's/vnop/vrec pcl/' -e 's/vjb vr31,pcl//' < $< > $@
+
+mxp-max.o: mxp-max.s
+ $(MXP_AS) -mA7 -msimd -o $@ $<
+
+mxp-array.s: array.c demo.h
+ $(MXP_CC1) $(OPTS) -g0 -quiet -mint16 -fno-common -mno-vim-label -o $@ $<
+
+mxp-array.o: mxp-array.s
+ $(MXP_AS) -mA7 -msimd -o $@ $<
+
+crtrostart.o: crtrostart.S
+ $(ARC_CC) -c -o $@ $<
+
+crtroend.o: crtroend.S
+ $(ARC_CC) -c -o $@ $<
+
+mxp-max.x0: mxp.x
+
+MXP_MAX_OBJS=crtrostart.o mxp-max.o mxp-array.o crtroend.o
+mxp-max.x0: $(MXP_MAX_OBJS)
+ $(MXP_LD) -o $@ $(MXP_MAX_OBJS) -T mxp.x -e f
+
+mxp-max.x1: mxp-max.x0
+ $(OBJCOPY) --prefix-symbols=__mxp__ -R .bss $< $@
+
+dma-gen: dma-gen.c
+
+dma-f-ro.s: mxp-max.x0 dma-gen
+ echo @__mxp____dma_start 0 0x`nm $<|sed -e '/ __sdm_rodata_end$$/s/ .*//p' -e d`
+ ./dma-gen @__mxp____dma_start 0 0x`nm $<|sed -e '/ __sdm_rodata_end$$/s/ .*//p' -e d` > $@
+
+mxp-start.s: mxp-start.S dma-f-ro.s
+ $(ARC_CC) -S $< '-DDMA_S="dma-f-ro.s"' -DSCM_START=0 -E > $@
+
+mxp-start.o: mxp-start.s
+ $(ARC_AS) -mA7 -msimd -o $@ $<
+
+dma-f-s.s: mxp-max.x0 array.o dma-gen
+ ./dma-gen @dma_start 0x`nm $<|sed -e '/ dma_start$$/s/ .*//p' -e d; size -A -d array.o|sed -e '/^\.bss\>/s/.*\<\([0-9][0-9]*\>\).*/\1/p' -e d` > $@
+crtvend.o: crtvend.S
+ $(ARC_AS) -mA7 -msimd -o $@ $<
+
+demo.o: demo.c demo.h
+ $(ARC_CC) -mA7 $(OPTS) -c $<
+
+array.o: array.c demo.h
+ $(ARC_CC) -mA7 $(OPTS) -c -fno-common $<
+
+max.o: max.c demo.h
+ $(ARC_CC) -mA7 $(OPTS) -c $<
+
+arc-demo: demo.o array.o max.o
+ $(ARC_CC) -mA7 $(OPTS) $^ -o $@
+
+mxp-wrap.o: mxp-wrap.S dma-f-s.s mxp-max.x0
+ $(ARC_CC) -c -mA7 -msimd $< -o $@ -DENTRY=0x`nm mxp-max.x0|sed -e '/ f$$/s/ .*//p' -e d`
+
+mxp-demo: demo.o array.o mxp-wrap.o mxp-start.s mxp-max.x1 crtvend.S
+ $(ARC_CC) -mA7 $(OPTS) -msimd $^ -o $@
diff --git a/gcc/config/mxp/demo/array.c b/gcc/config/mxp/demo/array.c
new file mode 100644
index 00000000000..a040ab29e38
--- /dev/null
+++ b/gcc/config/mxp/demo/array.c
@@ -0,0 +1,9 @@
+#include "demo.h"
+
+struct array_struct s;
+
+struct {} dma_end;
+
+/* ??? gcc won't accept alias data definition - but this works for our
+ purposes. */
+int dma_start () __attribute__ ((alias("s")));
diff --git a/gcc/config/mxp/demo/crtroend.S b/gcc/config/mxp/demo/crtroend.S
new file mode 100644
index 00000000000..7f9db6ef80e
--- /dev/null
+++ b/gcc/config/mxp/demo/crtroend.S
@@ -0,0 +1,3 @@
+ .global __dma_end
+ .section .rodata
+__dma_end:
diff --git a/gcc/config/mxp/demo/crtrostart.S b/gcc/config/mxp/demo/crtrostart.S
new file mode 100644
index 00000000000..de9a76e1f6a
--- /dev/null
+++ b/gcc/config/mxp/demo/crtrostart.S
@@ -0,0 +1,3 @@
+ .global __dma_start
+ .section .rodata
+__dma_start:
diff --git a/gcc/config/mxp/demo/crtvend.S b/gcc/config/mxp/demo/crtvend.S
new file mode 100644
index 00000000000..f228cce5ee7
--- /dev/null
+++ b/gcc/config/mxp/demo/crtvend.S
@@ -0,0 +1,3 @@
+; Put this at the end of the linked simd text section.
+ j_s.d [blink]
+ vendrec r12
diff --git a/gcc/config/mxp/demo/demo.c b/gcc/config/mxp/demo/demo.c
new file mode 100644
index 00000000000..a5852708e9f
--- /dev/null
+++ b/gcc/config/mxp/demo/demo.c
@@ -0,0 +1,35 @@
+#include <stdio.h>
+#include "demo.h"
+
+static unsigned long rand_seed = 47114711;
+long
+simple_rand ()
+{
+ unsigned long this = rand_seed * 1103515245 + 12345;
+ rand_seed = this;
+ return this >> 8;
+}
+
+int
+main (int argc, char **argv)
+{
+ int i;
+ unsigned long res;
+
+ if (argc > 1)
+ rand_seed = atol (argv[1]);
+ for (i = 0; i < sizeof (s) / sizeof (ELEMTYPE); i++)
+ {
+ long el = simple_rand () & 0x7ff;
+
+ /* Make this a 15 bit signed number so that XORing two of these will
+ again yeild a 15 bit signed numbers, and adding two of those will
+ fit in a short. */
+ s.a[i] = (el & 0x4000) ? -0x8000 + el : el;
+ /* Hack: Using s.a to access all of s. */
+ s.a[i] = el;
+ }
+ res = f ();
+ printf ("result is:%ld 0x%lx\n", res, res);
+ return 0;
+}
diff --git a/gcc/config/mxp/demo/demo.h b/gcc/config/mxp/demo/demo.h
new file mode 100644
index 00000000000..a1542f75d42
--- /dev/null
+++ b/gcc/config/mxp/demo/demo.h
@@ -0,0 +1,12 @@
+#define LEN 1440
+/* ??? vectorization won't take place for 'short' even if it's the same
+ data layout as 'int' */
+#if defined (__ARC600__) || defined (__ARC700__)
+#define ELEMTYPE short
+#else
+#define ELEMTYPE int
+#endif
+
+extern struct array_struct { ELEMTYPE a[LEN], b[LEN*2], c[LEN*2]; } s;
+
+extern unsigned long maxsum;
diff --git a/gcc/config/mxp/demo/dma-gen.c b/gcc/config/mxp/demo/dma-gen.c
new file mode 100644
index 00000000000..eebda100cf3
--- /dev/null
+++ b/gcc/config/mxp/demo/dma-gen.c
@@ -0,0 +1,79 @@
+/* Generate an assembly file with set-up code to place before the linked
+ simd text section.
+ This will kick of a DMA copy of initialized data (read-only and
+ ordinary initialized data are supposed to be concatenated) from main
+ memory to SDM, and then start recording to SCM.
+ Command line parameters:
+ 1: transfer source address in main memory.
+ 2: transfer destination address in SDM
+ 3: transfer size
+ 4: SCM recording start address */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main (int argc, char **argv)
+{
+ int sdm_start, size;
+ char *main_start;
+ int i;
+ int stride, lines;
+
+ if (argc < 4)
+ exit (1);
+
+ main_start = argv[1];
+ sdm_start = strtol (argv[2], NULL, 0);
+ size = strtol (argv[3], NULL, 0);
+ /* Setting up multiple transfers is expensive, so prefer to transfer a
+ little bit more instead. The worst this will do for sizes up to
+ 37 KB is to transfer 10 extra 32-bit words. */
+ i = (size + 3) >> 2;
+ {
+ int x_start = (i > 63 ? 63 : i);
+ int x_end = (i <= 255 ? 1 : (i+254)/255);
+ int x;
+ int min = i;
+ int min_x = 0, min_y = 0;
+
+ for (x = x_start, min = i; x >= x_end; x--)
+ {
+ int y = (i + x - 1) / x;
+ int r;
+
+ if (y > 255)
+ y = 255;
+ r = x * y - i;
+ if (r < 0)
+ abort ();
+ if (min > r)
+ {
+ min = r;
+ min_x = x;
+ min_y = y;
+ }
+ if (r == 0)
+ break;
+ }
+#if 0
+ printf ("%d %d %d %d\n", i, min_x, min_y, min);
+#endif
+ stride = min_x * 4;
+ lines = min_y;
+ }
+ if (size == lines * stride)
+ printf ("; Copying 0x%x bytes.\n", size);
+ else
+ printf ("; Need to copy 0x%x bytes, copying 0x%x instead.\n",
+ size, lines * stride);
+ printf ("\tvdiwr dr0,0x%x; SDM start\n", sdm_start);
+ printf ("\tmov_s r12,%d\n", stride);
+ printf ("\tvdiwr dr1,r12; SDM stride\n");
+ printf ("\tvdiwr dr2,0x1f%02x%02x; copy %d lines of %d bytes\n",
+ lines, stride, lines, stride);
+ printf ("\tvdiwr dr4,%s; main memory start\n", main_start);
+ printf ("\tvdiwr dr5,r12; main memory stride\n");
+ printf ("\tvdirun pcl,pcl; start dma transfer\n");
+ exit (0);
+}
diff --git a/gcc/config/mxp/demo/max.c b/gcc/config/mxp/demo/max.c
new file mode 100644
index 00000000000..b86db6f5f0a
--- /dev/null
+++ b/gcc/config/mxp/demo/max.c
@@ -0,0 +1,25 @@
+/* /cc1 -O3 t1.c -quiet -fdump-tree-all -ftree-vectorize -fdump-tree-vect-details -mint16 */
+
+#include "demo.h"
+
+unsigned long
+f ()
+{
+ int i, j0, k0, j, k;
+ unsigned long maxsum = 0;
+
+ for (j0 = 0; j0 < LEN; j0 += 8)
+ for (k0 = 0; k0 < LEN; k0 += 8)
+ {
+ ELEMTYPE max = -0x7fff-1;
+
+ for (j = j0, k = k0, i = 0; i < LEN; i++, j++, k++)
+ {
+ ELEMTYPE sum = (s.a[i] ^ s.b[j]) + (s.a[i] ^ s.c[k]);
+
+ max = sum > max ? sum : max;
+ }
+ maxsum += max;
+ }
+ return maxsum;
+}
diff --git a/gcc/config/mxp/demo/mxp-start.S b/gcc/config/mxp/demo/mxp-start.S
new file mode 100644
index 00000000000..f2f3a5d9679
--- /dev/null
+++ b/gcc/config/mxp/demo/mxp-start.S
@@ -0,0 +1,13 @@
+/* Load a single overlay at program startup. */
+ .text
+load_overlay:
+#include DMA_S
+#if 0
+ vrec SCM_START; start recording overlay
+#else
+ mov_s r12, SCM_START
+ vrec r12; start recording overlay
+#endif
+ .section .ctors,"aw",@progbits
+ .align 4
+ .word load_overlay
diff --git a/gcc/config/mxp/demo/mxp-wrap.S b/gcc/config/mxp/demo/mxp-wrap.S
new file mode 100644
index 00000000000..263621132cc
--- /dev/null
+++ b/gcc/config/mxp/demo/mxp-wrap.S
@@ -0,0 +1,39 @@
+/* Wrapper to call @f on mxp. */
+
+/* 2D Transfer mode: use frame table entry 31, specify source
+ and stride in DMA registers DR4 and DR5, i.e.
+ SYS_SRC_ADR_REG and SYS_STRIDE_REG */
+
+ .global f
+f:
+
+#include "dma-f-s.s"
+ vdmawait 1,127 ; Wait for dma transfer to finish.
+; set up sepcial integer registers: i8: stack, i9: absolute addressing base address.
+#if 0
+ vmov.3 vr1,@__mxp____stack_top
+#else
+ vmovw vr1,@__mxp____stack_top,1
+ vbic.2 vr1,vr1,vr1 ; clear i9
+#endif
+; use mxp @f code
+ ; ??? assembler rejects vrun @__mxp__f / 0x0
+ mov_s r12,ENTRY
+ vrun r12
+; get the result out of vr2 by storing to sdm and using dma out.
+ vst128r vr2,[r0] ; overwrites first eight bytes of input in sdm.
+ vdowr dr0,r0 ; SDM start (little endian!)
+ mov_s r12,4
+ vdowr dr1,r12; SDM stride
+ vdowr dr2,0x1f0104; copy 1 line of 2 bytes
+ vdowr dr4,@result; main memory start
+ vdowr dr5,r12; main memory stride
+ vdorun pcl,pcl; start dma transfer
+ vdmawait 127,1 ; Wait for dma transfer to finish.
+.Lwait_for_mxp:
+ lr r0,[SE_STAT]
+ bbit1 r0,6,.Lwait_for_mxp
+ j_s.d [blink]
+ ld r0,[@result]
+
+ .comm result,2,2
diff --git a/gcc/config/mxp/demo/mxp.x b/gcc/config/mxp/demo/mxp.x
new file mode 100644
index 00000000000..77cda97422d
--- /dev/null
+++ b/gcc/config/mxp/demo/mxp.x
@@ -0,0 +1,254 @@
+/* Default linker script, for normal executables */
+OUTPUT_FORMAT("elf32-littlearc", "elf32-bigarc",
+ "elf32-littlearc")
+OUTPUT_ARCH(arc)
+ENTRY(main)
+SEARCH_DIR("/home/irfanr/tasks/045_mxp2/binutils/installdir/arc-elf32/lib");
+/* Do we need any of these for elf?
+ __DYNAMIC = 0; */
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+/* PROVIDE (__executable_start = 0x180); . = 0x180; */
+/* PROVIDE (__executable_start = 0x103); . = 0x103; */
+PROVIDE (__executable_start = 0x0); . = 0x0;
+ .interp : { *(.interp) }
+ .hash : { *(.hash) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .init :
+ {
+ KEEP (*(.init))
+ } =0
+ .plt : { *(.plt) }
+ .text :
+ {
+ *(.text .stub .text.* .gnu.linkonce.t.*)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ } =0
+ .text.init :
+ {
+ *(.text.init)
+ } =0
+ .fini :
+ {
+ KEEP (*(.fini))
+ } =0
+ PROVIDE (__etext = .);
+ PROVIDE (_etext = .);
+ PROVIDE (etext = .);
+ /* If load address of rodata has less alignment than rodata, objcopy will
+ complain. */
+ . = ALIGN(128 / 8);
+ __rodata_start = .;
+ . = 0;
+ /* This is the value that is to be loaded into i9 for
+ 'absolute' addressing. */
+ PROVIDE (__mxp__sdm_base = .);
+ .rodata.mxp : AT (__rodata_start)
+ { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+ __sdm_rodata_end = .;
+ __rodata_end = __rodata_start + __sdm_rodata_end;
+/*
+ .rodata1 : { *(.rodata1) }
+ .sdata2 : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) }
+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+/*
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. * /
+ . = ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1));
+ /* Ensure the __preinit_array_start label is properly aligned. We
+ could instead move the label definition inside the section, but
+ the linker would then create the section even if it turns out to
+ be empty, which isn't pretty. * /
+ . = ALIGN(32 / 8);
+ PROVIDE (__preinit_array_start = .);
+ .preinit_array : { *(.preinit_array) }
+ PROVIDE (__preinit_array_end = .);
+ PROVIDE (__init_array_start = .);
+ .init_array : { *(.init_array) }
+ PROVIDE (__init_array_end = .);
+ PROVIDE (__fini_array_start = .);
+ .fini_array : { *(.fini_array) }
+ PROVIDE (__fini_array_end = .);
+ .data :
+ {
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data.init :
+ {
+ *(.data.init)
+ }
+ .data1 : { *(.data1) }
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .eh_frame : { KEEP (*(.eh_frame)) }
+ .gcc_except_table : { *(.gcc_except_table) }
+ .dynamic : { *(.dynamic) }
+ .ctors :
+ {
+ /* 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))
+ }
+ .dtors :
+ {
+ KEEP (*crtbegin*.o(.dtors))
+ KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ }
+ .jcr : { KEEP (*(.jcr)) }
+ .got : { *(.got.plt) *(.got) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. * /
+ .sdata :
+ {
+ __SDATA_BEGIN__ = .;
+ *(.sdata .sdata.* .gnu.linkonce.s.*)
+ }
+ _edata = .;
+ PROVIDE (edata = .);
+ __bss_start = .;
+ .sbss :
+ {
+ PROVIDE (__sbss_start = .);
+ PROVIDE (___sbss_start = .);
+ *(.dynsbss)
+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
+ *(.scommon)
+ PROVIDE (__sbss_end = .);
+ PROVIDE (___sbss_end = .);
+ }
+*/
+ .bss (NOLOAD) :
+ {
+ __sdm_bss_start = .;
+ *(.bss)
+ *(.bss.* .gnu.linkonce.b.*)
+ __sdm_bss_common = .;
+ *(COMMON)
+ /* Align here to ensure that the .bss section occupies space up to
+ _end. Align after .bss to ensure correct alignment even if the
+ .bss section disappears because there are no input sections. */
+ . = ALIGN(32 / 8);
+ }
+ __sdm_bss_end = .;
+ __bss_end = __rodata_start + __sdm_bss_end;
+ /* Next load address would be at __rodata_start + __sdm_bss_common . */
+ . = ALIGN(32 / 8);
+ _end = .;
+ PROVIDE (end = .);
+ /* We want to be able to set a default stack / heap size in a dejagnu
+ board description file, but override it for selected test cases.
+ The options appear in the wrong order to do this with a single symbol -
+ ldflags comes after flags injected with per-file stanzas, and thus
+ the setting from ldflags prevails. */
+ .heap (NOLOAD) :
+ {
+ __start_heap = . ;
+ . = . + (DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : (DEFINED(__DEFAULT_HEAP_SIZE) ? __DEFAULT_HEAP_SIZE : 20)) ;
+ __end_heap = . ;
+ }
+ . = ALIGN(0x8);
+ .stack (NOLOAD) :
+ {
+ __stack = . ;
+ . = . + (DEFINED(__STACK_SIZE) ? __STACK_SIZE : (DEFINED(__DEFAULT_STACK_SIZE) ? __DEFAULT_STACK_SIZE : 64)) ;
+ /*
+ . = 0x7ff0;
+ __stack_top = . ;
+ */
+ }
+ __stack_top = 0x7ff0;
+ /* 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) }
+ .arcextmap 0 : { *(.arcextmap) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* ARC Extension Sections */
+ .arcextmap 0 :
+ {
+ *(.gnu.linkonce.arcextmap.*)
+ }
+ /DISCARD/ : { *(.__arc_profile_*) }
+ /DISCARD/ : { *(.note.GNU-stack) }
+}