diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2012-07-10 06:50:57 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2012-07-10 06:50:57 +0000 |
commit | eda680f805f57e7acae71350b98c9cfabbda9a58 (patch) | |
tree | 5198a27a8a5b8a09404620bca38bca5d7f01772c /ld/testsuite | |
parent | bc9ad2e430bc419d4e37555d5d70bb6bb4fac341 (diff) | |
download | gdb-eda680f805f57e7acae71350b98c9cfabbda9a58.zip gdb-eda680f805f57e7acae71350b98c9cfabbda9a58.tar.gz gdb-eda680f805f57e7acae71350b98c9cfabbda9a58.tar.bz2 |
Add SORT_NONE and don't sort sort .init/.fini sections
ld/
PR ld/14156
* NEWS: Mention SORT_NONE.
* ld.h (sort_type): Add by_none.
* ld.texinfo: Document SORT_NONE.
* ldgram.y: Handle SORT_NONE.
* ldlang.c (update_wild_statements): Handle by_none. Don't
sort .init/.fini sections.
* ldlex.l: Add SORT_NONE.
ld/testsuite/
PR ld/14156
* ld-elf/fini0.s: New file.
* ld-elf/fini1.s: Likewise.
* ld-elf/fini2.s: Likewise.
* ld-elf/fini3.s: Likewise.
* ld-elf/finin.s: Likewise.
* ld-elf/foo0.s: Likewise.
* ld-elf/foo1.s: Likewise.
* ld-elf/foo2.s: Likewise.
* ld-elf/foo3.s: Likewise.
* ld-elf/foon.s: Likewise.
* ld-elf/init0.s: Likewise.
* ld-elf/init1.s: Likewise.
* ld-elf/init2.s: Likewise.
* ld-elf/init3.s: Likewise.
* ld-elf/initn.s: Likewise.
* ld-elf/pr14156a.d: Likewise.
* ld-elf/pr14156b.d: Likewise.
* ld-elf/pr14156c.d: Likewise.
* ld-elf/pr14156c.t: Likewise.
Diffstat (limited to 'ld/testsuite')
-rw-r--r-- | ld/testsuite/ChangeLog | 23 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/fini0.s | 16 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/fini1.s | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/fini2.s | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/fini3.s | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/finin.s | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/foo0.s | 16 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/foo1.s | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/foo2.s | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/foo3.s | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/foon.s | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/init0.s | 16 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/init1.s | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/init2.s | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/init3.s | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/initn.s | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr14156a.d | 15 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr14156b.d | 15 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr14156c.d | 15 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr14156c.t | 4 |
20 files changed, 192 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index f04cf04..74b2913 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,26 @@ +2012-07-10 H.J. Lu <hongjiu.lu@intel.com> + + PR ld/14156 + * ld-elf/fini0.s: New file. + * ld-elf/fini1.s: Likewise. + * ld-elf/fini2.s: Likewise. + * ld-elf/fini3.s: Likewise. + * ld-elf/finin.s: Likewise. + * ld-elf/foo0.s: Likewise. + * ld-elf/foo1.s: Likewise. + * ld-elf/foo2.s: Likewise. + * ld-elf/foo3.s: Likewise. + * ld-elf/foon.s: Likewise. + * ld-elf/init0.s: Likewise. + * ld-elf/init1.s: Likewise. + * ld-elf/init2.s: Likewise. + * ld-elf/init3.s: Likewise. + * ld-elf/initn.s: Likewise. + * ld-elf/pr14156a.d: Likewise. + * ld-elf/pr14156b.d: Likewise. + * ld-elf/pr14156c.d: Likewise. + * ld-elf/pr14156c.t: Likewise. + 2012-07-09 H.J. Lu <hongjiu.lu@intel.com> PR ld/14323 diff --git a/ld/testsuite/ld-elf/fini0.s b/ld/testsuite/ld-elf/fini0.s new file mode 100644 index 0000000..f2ccfb7 --- /dev/null +++ b/ld/testsuite/ld-elf/fini0.s @@ -0,0 +1,16 @@ + .text + .global start /* Used by SH targets. */ +start: + .global _start +_start: + .global __start +__start: + .global main /* Used by HPPA targets. */ +main: + .dc.a 0 + + .section .fini + .p2align 2 +.globl foo + .type foo,%function +foo: diff --git a/ld/testsuite/ld-elf/fini1.s b/ld/testsuite/ld-elf/fini1.s new file mode 100644 index 0000000..b65d18d --- /dev/null +++ b/ld/testsuite/ld-elf/fini1.s @@ -0,0 +1,6 @@ + .section .fini + .p2align 2 + .type foo1,%function +foo1: + .dc.a 0x0 + .size foo1,.-foo1 diff --git a/ld/testsuite/ld-elf/fini2.s b/ld/testsuite/ld-elf/fini2.s new file mode 100644 index 0000000..b8d7457 --- /dev/null +++ b/ld/testsuite/ld-elf/fini2.s @@ -0,0 +1,6 @@ + .section .fini + .p2align 6 + .type foo2,%function +foo2: + .dc.a 0x0 + .size foo2,.-foo2 diff --git a/ld/testsuite/ld-elf/fini3.s b/ld/testsuite/ld-elf/fini3.s new file mode 100644 index 0000000..7f797c5 --- /dev/null +++ b/ld/testsuite/ld-elf/fini3.s @@ -0,0 +1,6 @@ + .section .fini + .p2align 4 + .type foo3,%function +foo3: + .dc.a 0x0 + .size foo3,.-foo3 diff --git a/ld/testsuite/ld-elf/finin.s b/ld/testsuite/ld-elf/finin.s new file mode 100644 index 0000000..9085080 --- /dev/null +++ b/ld/testsuite/ld-elf/finin.s @@ -0,0 +1,6 @@ + .section .fini + .p2align 8 + .type last,%function +last: + .dc.a 0x0 + .size last,.-last diff --git a/ld/testsuite/ld-elf/foo0.s b/ld/testsuite/ld-elf/foo0.s new file mode 100644 index 0000000..d6fc9c3 --- /dev/null +++ b/ld/testsuite/ld-elf/foo0.s @@ -0,0 +1,16 @@ + .text + .global start /* Used by SH targets. */ +start: + .global _start +_start: + .global __start +__start: + .global main /* Used by HPPA targets. */ +main: + .dc.a 0 + + .section .foo,"ax",@progbits + .p2align 2 +.globl foo + .type foo,%function +foo: diff --git a/ld/testsuite/ld-elf/foo1.s b/ld/testsuite/ld-elf/foo1.s new file mode 100644 index 0000000..4a6d4f4 --- /dev/null +++ b/ld/testsuite/ld-elf/foo1.s @@ -0,0 +1,6 @@ + .section .foo,"ax",@progbits + .p2align 2 + .type foo1,%function +foo1: + .dc.a 0x0 + .size foo1,.-foo1 diff --git a/ld/testsuite/ld-elf/foo2.s b/ld/testsuite/ld-elf/foo2.s new file mode 100644 index 0000000..f95a91b --- /dev/null +++ b/ld/testsuite/ld-elf/foo2.s @@ -0,0 +1,6 @@ + .section .foo,"ax",@progbits + .p2align 6 + .type foo2,%function +foo2: + .dc.a 0x0 + .size foo2,.-foo2 diff --git a/ld/testsuite/ld-elf/foo3.s b/ld/testsuite/ld-elf/foo3.s new file mode 100644 index 0000000..03a32a9 --- /dev/null +++ b/ld/testsuite/ld-elf/foo3.s @@ -0,0 +1,6 @@ + .section .foo,"ax",@progbits + .p2align 4 + .type foo3,%function +foo3: + .dc.a 0x0 + .size foo3,.-foo3 diff --git a/ld/testsuite/ld-elf/foon.s b/ld/testsuite/ld-elf/foon.s new file mode 100644 index 0000000..3a41ec2 --- /dev/null +++ b/ld/testsuite/ld-elf/foon.s @@ -0,0 +1,6 @@ + .section .foo,"ax",@progbits + .p2align 8 + .type last,%function +last: + .dc.a 0x0 + .size last,.-last diff --git a/ld/testsuite/ld-elf/init0.s b/ld/testsuite/ld-elf/init0.s new file mode 100644 index 0000000..3c8cf8c --- /dev/null +++ b/ld/testsuite/ld-elf/init0.s @@ -0,0 +1,16 @@ + .text + .global start /* Used by SH targets. */ +start: + .global _start +_start: + .global __start +__start: + .global main /* Used by HPPA targets. */ +main: + .dc.a 0 + + .section .init + .p2align 2 +.globl foo + .type foo,%function +foo: diff --git a/ld/testsuite/ld-elf/init1.s b/ld/testsuite/ld-elf/init1.s new file mode 100644 index 0000000..5d24ec2 --- /dev/null +++ b/ld/testsuite/ld-elf/init1.s @@ -0,0 +1,6 @@ + .section .init + .p2align 2 + .type foo1,%function +foo1: + .dc.a 0x0 + .size foo1,.-foo1 diff --git a/ld/testsuite/ld-elf/init2.s b/ld/testsuite/ld-elf/init2.s new file mode 100644 index 0000000..2c5c353 --- /dev/null +++ b/ld/testsuite/ld-elf/init2.s @@ -0,0 +1,6 @@ + .section .init + .p2align 6 + .type foo2,%function +foo2: + .dc.a 0x0 + .size foo2,.-foo2 diff --git a/ld/testsuite/ld-elf/init3.s b/ld/testsuite/ld-elf/init3.s new file mode 100644 index 0000000..d6639ce --- /dev/null +++ b/ld/testsuite/ld-elf/init3.s @@ -0,0 +1,6 @@ + .section .init + .p2align 4 + .type foo3,%function +foo3: + .dc.a 0x0 + .size foo3,.-foo3 diff --git a/ld/testsuite/ld-elf/initn.s b/ld/testsuite/ld-elf/initn.s new file mode 100644 index 0000000..8931e52 --- /dev/null +++ b/ld/testsuite/ld-elf/initn.s @@ -0,0 +1,6 @@ + .section .init + .p2align 8 + .type last,%function +last: + .dc.a 0x0 + .size last,.-last diff --git a/ld/testsuite/ld-elf/pr14156a.d b/ld/testsuite/ld-elf/pr14156a.d new file mode 100644 index 0000000..6476857 --- /dev/null +++ b/ld/testsuite/ld-elf/pr14156a.d @@ -0,0 +1,15 @@ +#source: init0.s +#source: init1.s +#source: init2.s +#source: init3.s +#source: initn.s +#ld: --sort-section=alignment +#nm: -n + +#... +[0-9a-f]+ T foo +[0-9a-f]+ t foo1 +[0-9a-f]+ t foo2 +[0-9a-f]+ t foo3 +[0-9a-f]+ t last +#pass diff --git a/ld/testsuite/ld-elf/pr14156b.d b/ld/testsuite/ld-elf/pr14156b.d new file mode 100644 index 0000000..ae9fa05 --- /dev/null +++ b/ld/testsuite/ld-elf/pr14156b.d @@ -0,0 +1,15 @@ +#source: fini0.s +#source: fini1.s +#source: fini2.s +#source: fini3.s +#source: finin.s +#ld: --sort-section=alignment +#nm: -n + +#... +[0-9a-f]+ T foo +[0-9a-f]+ t foo1 +[0-9a-f]+ t foo2 +[0-9a-f]+ t foo3 +[0-9a-f]+ t last +#pass diff --git a/ld/testsuite/ld-elf/pr14156c.d b/ld/testsuite/ld-elf/pr14156c.d new file mode 100644 index 0000000..90ca401 --- /dev/null +++ b/ld/testsuite/ld-elf/pr14156c.d @@ -0,0 +1,15 @@ +#source: foo0.s +#source: foo1.s +#source: foo2.s +#source: foo3.s +#source: foon.s +#ld: --sort-section=alignment -T pr14156c.t +#nm: -n + +#... +[0-9a-f]+ T foo +[0-9a-f]+ t foo1 +[0-9a-f]+ t foo2 +[0-9a-f]+ t foo3 +[0-9a-f]+ t last +#pass diff --git a/ld/testsuite/ld-elf/pr14156c.t b/ld/testsuite/ld-elf/pr14156c.t new file mode 100644 index 0000000..97ad77d --- /dev/null +++ b/ld/testsuite/ld-elf/pr14156c.t @@ -0,0 +1,4 @@ +SECTIONS { + .foo : { *(SORT_NONE(.foo)) } + /DISCARD/ : { *(.*) } +} |