From 7c9e8d98112842cba7fde29e05ab9860c9098b43 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 18 Aug 2006 14:38:00 +0000 Subject: [PATCH] 2006-08-18 H.J. Lu PR ld/3052 * ld-elf/loadaddr.s: New file. * ld-elf/loadaddr1.d: Likewise. * ld-elf/loadaddr1.t: Likewise. * ld-elf/loadaddr2.d: Likewise. * ld-elf/loadaddr2.t: Likewise. --- ld/testsuite/ChangeLog | 9 +++++++++ ld/testsuite/ld-elf/loadaddr.s | 16 ++++++++++++++++ ld/testsuite/ld-elf/loadaddr1.d | 10 ++++++++++ ld/testsuite/ld-elf/loadaddr1.t | 13 +++++++++++++ ld/testsuite/ld-elf/loadaddr2.d | 10 ++++++++++ ld/testsuite/ld-elf/loadaddr2.t | 13 +++++++++++++ 6 files changed, 71 insertions(+) create mode 100644 ld/testsuite/ld-elf/loadaddr.s create mode 100644 ld/testsuite/ld-elf/loadaddr1.d create mode 100644 ld/testsuite/ld-elf/loadaddr1.t create mode 100644 ld/testsuite/ld-elf/loadaddr2.d create mode 100644 ld/testsuite/ld-elf/loadaddr2.t diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index fae1e90735e..ac678c30342 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2006-08-18 H.J. Lu + + PR ld/3052 + * ld-elf/loadaddr.s: New file. + * ld-elf/loadaddr1.d: Likewise. + * ld-elf/loadaddr1.t: Likewise. + * ld-elf/loadaddr2.d: Likewise. + * ld-elf/loadaddr2.t: Likewise. + 2006-08-17 Alan Modra * ld-powerpc/tlsexe.d: Update for lazy link stub change. diff --git a/ld/testsuite/ld-elf/loadaddr.s b/ld/testsuite/ld-elf/loadaddr.s new file mode 100644 index 00000000000..dcf40c89603 --- /dev/null +++ b/ld/testsuite/ld-elf/loadaddr.s @@ -0,0 +1,16 @@ + .text + .globl main + .globl start + .globl _start + .globl __start +main: +start: +_start: +__start: + .byte 0 + .section .bar,"ax","progbits" + .byte 0 + .section .foo,"aw","progbits" + .byte 0 + .data + .byte 0 diff --git a/ld/testsuite/ld-elf/loadaddr1.d b/ld/testsuite/ld-elf/loadaddr1.d new file mode 100644 index 00000000000..f4b01dd14ed --- /dev/null +++ b/ld/testsuite/ld-elf/loadaddr1.d @@ -0,0 +1,10 @@ +#source: loadaddr.s +#ld: -T loadaddr1.t -z max-page-size=0x200000 +#readelf: -l --wide +#target: *-*-linux* + +#... + LOAD +0x000000 0xf*80000000 0xf*80000000 0x100041 0x100041 RWE 0x200000 + LOAD +0x200000 0xf*ff600000 0xf*80101000 0x0*1 0x0*1 R E 0x200000 + LOAD +0x302000 0xf*80102000 0xf*80102000 0x0*1 0x0*1 RW 0x200000 +#pass diff --git a/ld/testsuite/ld-elf/loadaddr1.t b/ld/testsuite/ld-elf/loadaddr1.t new file mode 100644 index 00000000000..c4b5d908d18 --- /dev/null +++ b/ld/testsuite/ld-elf/loadaddr1.t @@ -0,0 +1,13 @@ +SECTIONS +{ + . = -0x7ff00000; + .text : {*(.text .text.*)} + . = ALIGN(64); + .foo : { *(.foo) } + .bar -0xa00000 : AT ((LOADADDR(.foo) + SIZEOF(.foo) + 4095) & ~(4095)) + { *(.bar) } + . = LOADADDR(.bar) + 4096; + . = ALIGN(8192); + .data : { *(.data) } + /DISCARD/ : { *(.*) } +} diff --git a/ld/testsuite/ld-elf/loadaddr2.d b/ld/testsuite/ld-elf/loadaddr2.d new file mode 100644 index 00000000000..0044b8b33d5 --- /dev/null +++ b/ld/testsuite/ld-elf/loadaddr2.d @@ -0,0 +1,10 @@ +#source: loadaddr.s +#ld: -T loadaddr2.t -z max-page-size=0x200000 +#readelf: -l --wide +#target: *-*-linux* + +#... + LOAD +0x000000 0xf*80000000 0xf*80000000 0x100041 0x100041 RWE 0x200000 + LOAD +0x110000 0xf*80110000 0xf*80101000 0x0*1 0x0*1 R E 0x200000 + LOAD +0x302000 0xf*80302000 0xf*80302000 0x0*1 0x0*1 RW 0x200000 +#pass diff --git a/ld/testsuite/ld-elf/loadaddr2.t b/ld/testsuite/ld-elf/loadaddr2.t new file mode 100644 index 00000000000..71a1a6baf05 --- /dev/null +++ b/ld/testsuite/ld-elf/loadaddr2.t @@ -0,0 +1,13 @@ +SECTIONS +{ + . = -0x7ff00000; + .text : {*(.text .text.*)} + . = ALIGN(64); + .foo : { *(.foo) } + .bar -0x7fef0000 : AT ((LOADADDR(.foo) + SIZEOF(.foo) + 4095) & ~(4095)) + { *(.bar) } + . = LOADADDR(.bar) + 0x200000; + . = ALIGN(8192); + .data : { *(.data) } + /DISCARD/ : { *(.*) } +} -- 2.30.2