From fbee3eca653355a625cbc85f2b280b69889a803f Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Mon, 6 Jan 2020 14:58:43 +0000 Subject: [PATCH 4/4] Add powerpc test for non-contiguous memory regions 2020-01-06 Christophe Lyon ld/ * testsuite/ld-powerpc/powerpc.exp: Run new test. * testsuite/ld-powerpc/non-contiguous-powerpc.d: New. * testsuite/ld-powerpc/non-contiguous-powerpc.ld: New. * testsuite/ld-powerpc/non-contiguous-powerpc.sd: New. Change-Id: Iad0b160ad1b382a158dc06fa4e4656eb06691a8a --- ld/testsuite/ld-powerpc/non-contiguous-powerpc.d | 4 ++++ ld/testsuite/ld-powerpc/non-contiguous-powerpc.ld | 22 ++++++++++++++++++++++ ld/testsuite/ld-powerpc/non-contiguous-powerpc.s | 8 ++++++++ ld/testsuite/ld-powerpc/powerpc.exp | 2 ++ 4 files changed, 36 insertions(+) create mode 100644 ld/testsuite/ld-powerpc/non-contiguous-powerpc.d create mode 100644 ld/testsuite/ld-powerpc/non-contiguous-powerpc.ld create mode 100644 ld/testsuite/ld-powerpc/non-contiguous-powerpc.s diff --git a/ld/testsuite/ld-powerpc/non-contiguous-powerpc.d b/ld/testsuite/ld-powerpc/non-contiguous-powerpc.d new file mode 100644 index 0000000..2dd7d21 --- /dev/null +++ b/ld/testsuite/ld-powerpc/non-contiguous-powerpc.d @@ -0,0 +1,4 @@ +#name: non-contiguous-powerpc +#source: non-contiguous-powerpc.s +#ld: --enable-non-contiguous-regions -T non-contiguous-powerpc.ld +#error: \ARelaxation not supported with --enable-non-contiguous-regions.* \ No newline at end of file diff --git a/ld/testsuite/ld-powerpc/non-contiguous-powerpc.ld b/ld/testsuite/ld-powerpc/non-contiguous-powerpc.ld new file mode 100644 index 0000000..744d246 --- /dev/null +++ b/ld/testsuite/ld-powerpc/non-contiguous-powerpc.ld @@ -0,0 +1,22 @@ +/* Distance between 'one' and 'two' means that relaxation implies that + .text.one's size increases. Even though the result would fit in + 'oneandhalf', this is not supported by + --enable-non-contiguous-regions. */ + +MEMORY { + one (RXAI) : ORIGIN = 0x00000000, LENGTH = 0x00000010 + oneandhalf (RXAI) : ORIGIN = 0x00001000, LENGTH = 0x00001010 + two (RXAI) : ORIGIN = 0x20000000, LENGTH = 0x10000000 +} + +SECTIONS { + one : { + *(.text.one) + } > one + oneandhalf : { + *(.text.one) + } > oneandhalf + two : { + *(.text.two) + } > two +} diff --git a/ld/testsuite/ld-powerpc/non-contiguous-powerpc.s b/ld/testsuite/ld-powerpc/non-contiguous-powerpc.s new file mode 100644 index 0000000..e02b322 --- /dev/null +++ b/ld/testsuite/ld-powerpc/non-contiguous-powerpc.s @@ -0,0 +1,8 @@ + .machine "ppc" + + .section .text.one + b 2f + + .section .text.two +2: + nop diff --git a/ld/testsuite/ld-powerpc/powerpc.exp b/ld/testsuite/ld-powerpc/powerpc.exp index 94b2fac..796635f 100644 --- a/ld/testsuite/ld-powerpc/powerpc.exp +++ b/ld/testsuite/ld-powerpc/powerpc.exp @@ -443,3 +443,5 @@ run_dump_test "vle-multiseg-6" run_dump_test "ppc476-shared" run_dump_test "ppc476-shared2" + +run_dump_test "non-contiguous-powerpc" -- 2.7.4