From 17726590be307e467ab66e309f6967a5d0c12dcf Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Mon, 25 Nov 2019 08:56:22 +0000 Subject: [PATCH 2/2] Add test for non-contiguous memory 2019-11-27 Christophe Lyon ld/ * testsuite/ld-elf/non-contiguous.d: New. * testsuite/ld-elf/non-contiguous.ld: New. * testsuite/ld-elf/non-contiguous.s: New. --- ld/testsuite/ld-elf/non-contiguous.d | 46 +++++++++++++++++++++++++++++++++++ ld/testsuite/ld-elf/non-contiguous.ld | 29 ++++++++++++++++++++++ ld/testsuite/ld-elf/non-contiguous.s | 22 +++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 ld/testsuite/ld-elf/non-contiguous.d create mode 100644 ld/testsuite/ld-elf/non-contiguous.ld create mode 100644 ld/testsuite/ld-elf/non-contiguous.s diff --git a/ld/testsuite/ld-elf/non-contiguous.d b/ld/testsuite/ld-elf/non-contiguous.d new file mode 100644 index 0000000..bcb9174 --- /dev/null +++ b/ld/testsuite/ld-elf/non-contiguous.d @@ -0,0 +1,46 @@ +#name: non-contiguous +#source: non-contiguous.s +#ld: --enable-non-contiguous-regions -T non-contiguous.ld +#objdump: -rdtsh +#xfail: [is_generic] + +.*: file format elf32-(little|big)arm + +Sections: +Idx Name Size VMA LMA File off Algn + 0 \.raml 0000000c 1fff0000 1fff0000 00010000 2\*\*0 + CONTENTS, ALLOC, LOAD, DATA + 1 \.ramu 00000014 20000000 1fff000c 00020000 2\*\*0 + CONTENTS, ALLOC, LOAD, DATA + 2 \.ramz 0000003c 20040000 20000014 00030000 2\*\*0 + CONTENTS, ALLOC, LOAD, DATA + 3 .ARM.attributes 00000014 00000000 00000000 0003003c 2\*\*0 + CONTENTS, READONLY +SYMBOL TABLE: +1fff0000 l d .raml 00000000 .raml +20000000 l d .ramu 00000000 .ramu +20040000 l d .ramz 00000000 .ramz +00000000 l d .ARM.attributes 00000000 .ARM.attributes +00000000 l df \*ABS\* 00000000 .*/non-contiguous.o +00000002 l \*ABS\* 00000000 ALIGN +1fff000c g .raml 00000000 _raml_end +2004003c g .ramz 00000000 _ramz_end +20000000 g .ramu 00000000 _rmau_start +1fff0000 g .raml 00000000 _rmal_start +20000014 g .ramu 00000000 _ramu_end +20040000 g .ramz 00000000 _rmaz_start + + +Contents of section .raml: + 1fff0000 01000000 02000000 03000000 ............ +Contents of section .ramu: + 20000000 04000000 05000000 06000000 07000000 ................ + 20000010 08000000 .... +Contents of section .ramz: + 20040000 09090909 09090909 09090909 09090909 ................ + 20040010 09090909 09090909 09090909 09090909 ................ + 20040020 09090909 09090909 09090909 09090909 ................ + 20040030 09090909 09090909 09090909 ............ +Contents of section .ARM.attributes: + 0000 41130000 00616561 62690001 09000000 A....aeabi...... + 0010 08010901 .... diff --git a/ld/testsuite/ld-elf/non-contiguous.ld b/ld/testsuite/ld-elf/non-contiguous.ld new file mode 100644 index 0000000..1c99381 --- /dev/null +++ b/ld/testsuite/ld-elf/non-contiguous.ld @@ -0,0 +1,29 @@ +MEMORY +{ + RAML (rwx) : ORIGIN = 0x1FFF0000, LENGTH = 0x00010 + RAMU (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00040 + RAMZ (rwx) : ORIGIN = 0x20040000, LENGTH = 0x00040 +} + +SECTIONS +{ + .raml : AT ( ADDR (.text) + SIZEOF (.text) ) + { _rmal_start = . ; + *(.boot) ; + *(.data) *(.data.*) ; + _raml_end = . ; + } > RAML + + .ramu : AT ( ADDR (.raml) + SIZEOF (.raml) ) + { _rmau_start = . ; + *(.data) *(.data.*) ; + _ramu_end = . ; + } > RAMU + + .ramz : AT ( ADDR (.ramu) + SIZEOF (.ramu) ) + { _rmaz_start = . ; + *(.data) *(.data.*) ; + _ramz_end = . ; + } > RAMZ +} + diff --git a/ld/testsuite/ld-elf/non-contiguous.s b/ld/testsuite/ld-elf/non-contiguous.s new file mode 100644 index 0000000..e0aad36 --- /dev/null +++ b/ld/testsuite/ld-elf/non-contiguous.s @@ -0,0 +1,22 @@ + .syntax unified + .section .data.1 + # Fit in RAML + .word 1 + .word 2 + .word 3 + + .section .data.2 + # Fit in RAMU + .word 4 + .word 5 + .word 6 + + .section .data.3 + # Fit in RAMU + .word 7 + .word 8 + + .section .data.4 + # Fit in RAMZ + .fill 0x3c, 1, 9 + -- 2.7.4