Browse Source
Add testcases to verify that all SHT_NOTE sections with the same section alignment are placed in a single PT_NOTE segment. PR ld/23658 * testsuite/ld-elf/pr23658-1.d: New file. * testsuite/ld-elf/pr23658-1a.s: Likewise. * testsuite/ld-elf/pr23658-1b.s: Likewise. * testsuite/ld-elf/pr23658-1c.s: Likewise. * testsuite/ld-elf/pr23658-1d.s: Likewise. * testsuite/ld-elf/pr23658-2.rd: Likewise. * testsuite/ld-elf/pr23658-3.d: Likewise. * testsuite/ld-elf/pr23658-3.s: Likewise. * testsuite/ld-elf/pr23658-3.t: Likewise. * testsuite/ld-elf/shared.exp: Run PR ld/23658 tests.users/ahayward/variable_sve2
11 changed files with 152 additions and 0 deletions
@ -0,0 +1,16 @@ |
|||
#source: pr23658-1a.s |
|||
#source: pr23658-1b.s |
|||
#source: pr23658-1c.s |
|||
#source: pr23658-1d.s |
|||
#source: start.s |
|||
#ld: --build-id |
|||
#readelf: -l --wide |
|||
# Since generic linker targets don't place SHT_NOTE sections as orphan, |
|||
# SHT_NOTE sections aren't grouped nor sorted. |
|||
#xfail: cr16-* crx-* d30v-* dlx-* fr30-* frv-* iq2000-* |
|||
#xfail: m68hc12-* mn10200-* moxie-* mt-* msp430-* pj-* |
|||
|
|||
#... |
|||
+[0-9]+ +\.note\.4 \.note\.1 + |
|||
+[0-9]+ +\.note.gnu.build-id \.note\.2 .note\.3 + |
|||
#pass |
|||
@ -0,0 +1,21 @@ |
|||
.text |
|||
.global foo |
|||
foo: |
|||
.dc.a 0 |
|||
|
|||
.section ".note.4", "a" |
|||
.p2align 3 |
|||
.long .L1 - .L0 /* name length. */ |
|||
.long .L3 - .L1 /* data length. */ |
|||
.long 123456 /* note type. */ |
|||
.L0: |
|||
.asciz "GNU" /* vendor name. */ |
|||
.L1: |
|||
.p2align 3 |
|||
.long 0 /* pr_type. */ |
|||
.long .L5 - .L4 /* pr_datasz. */ |
|||
.L4: |
|||
.zero 0x10 |
|||
.L5: |
|||
.p2align 3 |
|||
.L3: |
|||
@ -0,0 +1,16 @@ |
|||
.section ".note.2", "a" |
|||
.p2align 2 |
|||
.long .L1 - .L0 /* name length. */ |
|||
.long .L3 - .L1 /* data length. */ |
|||
.long 12345 /* note type. */ |
|||
.L0: |
|||
.asciz "GNU" /* vendor name. */ |
|||
.L1: |
|||
.p2align 2 |
|||
.long 0 /* pr_type. */ |
|||
.long .L5 - .L4 /* pr_datasz. */ |
|||
.L4: |
|||
.zero 0x10 |
|||
.L5: |
|||
.p2align 2 |
|||
.L3: |
|||
@ -0,0 +1,16 @@ |
|||
.section ".note.1", "a" |
|||
.p2align 3 |
|||
.long .L1 - .L0 /* name length. */ |
|||
.long .L3 - .L1 /* data length. */ |
|||
.long 12345 /* note type. */ |
|||
.L0: |
|||
.asciz "GNU" /* vendor name. */ |
|||
.L1: |
|||
.p2align 3 |
|||
.long 0 /* pr_type. */ |
|||
.long .L5 - .L4 /* pr_datasz. */ |
|||
.L4: |
|||
.zero 0x10 |
|||
.L5: |
|||
.p2align 3 |
|||
.L3: |
|||
@ -0,0 +1,16 @@ |
|||
.section ".note.3", "a" |
|||
.p2align 2 |
|||
.long .L1 - .L0 /* name length. */ |
|||
.long .L3 - .L1 /* data length. */ |
|||
.long 12345 /* note type. */ |
|||
.L0: |
|||
.asciz "GNU" /* vendor name. */ |
|||
.L1: |
|||
.p2align 2 |
|||
.long 0 /* pr_type. */ |
|||
.long .L5 - .L4 /* pr_datasz. */ |
|||
.L4: |
|||
.zero 0x10 |
|||
.L5: |
|||
.p2align 2 |
|||
.L3: |
|||
@ -0,0 +1,6 @@ |
|||
#... |
|||
+[0-9]+ +\.interp \.note.4 \.note.1 \.note.2 \.note.3.* |
|||
#... |
|||
+[0-9]+ +\.note\.4 \.note\.1 + |
|||
+[0-9]+ +\.note\.2 .note\.3 + |
|||
#pass |
|||
@ -0,0 +1,8 @@ |
|||
#as: -mx86-used-note=yes |
|||
#ld: -T pr23658-3.t -z noseparate-code |
|||
#nm: -B |
|||
#target: i?86-*-* x86_64-*-* |
|||
|
|||
#... |
|||
0+4000 D __FOO |
|||
#... |
|||
@ -0,0 +1,4 @@ |
|||
.data |
|||
.global baz |
|||
baz: |
|||
.word 0 |
|||
@ -0,0 +1,14 @@ |
|||
SECTIONS |
|||
{ |
|||
.data 0x1000 : |
|||
{ |
|||
*(.data) |
|||
QUAD (__FOO); |
|||
} |
|||
|
|||
.foo 0x4000 : |
|||
{ |
|||
PROVIDE (__FOO = .); |
|||
*(.foo) |
|||
} |
|||
} |
|||
Loading…
Reference in new issue