summaryrefslogtreecommitdiff
path: root/support/splint/examples/ld/ldexample.hw
diff options
context:
space:
mode:
Diffstat (limited to 'support/splint/examples/ld/ldexample.hw')
-rw-r--r--support/splint/examples/ld/ldexample.hw77
1 files changed, 77 insertions, 0 deletions
diff --git a/support/splint/examples/ld/ldexample.hw b/support/splint/examples/ld/ldexample.hw
new file mode 100644
index 0000000000..a5cab97d2a
--- /dev/null
+++ b/support/splint/examples/ld/ldexample.hw
@@ -0,0 +1,77 @@
+INCLUDE file.ld
+
+MEMORY
+{
+ @> @<Some random portion of \ld\ code@> @=
+ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
+ FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 128K
+ ASH (rx) : ORIGIN = 8001000, LENGTH = 128K
+ @> @<Some random portion of \ld\ code@> @=
+ CLASH (rx) : ORIGIN = 700000, LENGTH = 128K
+ ASH (rx) : ORIGIN = $8000000, LENGTH = 128K
+ CLASH (rx) : ORIGIN = 700000B, LENGTH = 128K
+ INCLUDE file.mem
+ @> @<Some random portion of \ld\ code@> @=
+
+}
+
+_estack = 0x20005000;
+_bstack = a > 0 ? NEXT(11) : 0x19;
+ @> @<Some random portion of \ld\ code@> @=
+PROVIDE( var1 = . );
+PROVIDE_HIDDEN( var2 = . );
+ @> @<Some random portion of \ld\ code@> @=
+HIDDEN( var3 = . );
+ENTRY(_entry);
+
+SECTIONS
+{
+ @> @<Some random portion of \ld\ code@> @=
+ .isr_vector ALIGN(8) (NOLOAD): AT(.) ALIGN(.) ALIGN_WITH_INPUT SUBALIGN(8) SPECIAL
+ {
+ . = ALIGN(4);
+ KEEP(*(.isr_vector))
+ . = ALIGN(4);
+ } > FLASH AT > RAM : FLASH : RAM : OTHER = . + 8
+ @> @<Some random portion of \ld\ code@> @=
+ .text :
+ {
+ /* skip this comment */;
+ . = ALIGN(4);
+ *(.text)
+ *(.text.*)
+ *(.rodata)
+ *(.rodata*)
+ *(.glue_7)
+ *(.glue_7t)
+ . = ALIGN(4);
+ _etext = . + 8;
+ _sidata = _etext;
+ PROVIDE( var1 = . );
+ PROVIDE_HIDDEN( var2 = . );
+ HIDDEN( var3 = . );
+ } >FLASH AT > RAM
+
+ @> @<Some random portion of \ld\ code@> @=
+ .data : AT ( _sidata )
+ {
+ . = ALIGN(4);
+ _sdata = . ;
+ *(.data)
+ *(.data.*)
+ . = ALIGN(4);
+ _edata = . ;
+ } >RAM
+
+ .bss :
+ {
+ . = ALIGN(4);
+ _sbss = .;
+ *(.bss)
+ *(COMMON)
+ . = ALIGN(4);
+ _ebss = . ;
+ } >RAM
+ @> @<Some random portion of \ld\ code@> @=
+
+}