diff options
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/aarch64-elf.exp | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/bti-plt-1.s | 17 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/bti-plt-6.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/bti-plt-7.d | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/bti-warn.d | 16 |
6 files changed, 48 insertions, 4 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 6116ca6..2853c09 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +2019-03-21 Sudakshina Das <sudi.das@arm.com> + + * testsuite/ld-aarch64/aarch64-elf.exp: Add new test. + * testsuite/ld-aarch64/bti-plt-1.s: Add .ifdef for PAC note section. + * testsuite/ld-aarch64/bti-plt-6.d: Update warning. + * testsuite/ld-aarch64/bti-plt-7.d: Likewise. + * testsuite/ld-aarch64/bti-warn.d: New test. + 2019-03-21 Alan Modra <amodra@gmail.com> * testsuite/ld-elf/fini2.s: Reduce alignment. diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp index 12c2d97..ba3ce36 100644 --- a/ld/testsuite/ld-aarch64/aarch64-elf.exp +++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp @@ -407,3 +407,5 @@ run_dump_test "pac-plt-1" run_dump_test "pac-plt-2" run_dump_test "bti-pac-plt-1" run_dump_test "bti-pac-plt-2" + +run_dump_test "bti-warn" diff --git a/ld/testsuite/ld-aarch64/bti-plt-1.s b/ld/testsuite/ld-aarch64/bti-plt-1.s index b798ca4..8bb39c4 100644 --- a/ld/testsuite/ld-aarch64/bti-plt-1.s +++ b/ld/testsuite/ld-aarch64/bti-plt-1.s @@ -21,3 +21,20 @@ _start: .p2align 3 5: .endif +.ifdef __property_pac__ + .section ".note.gnu.property", "a" + .p2align 3 + .long 1f - 0f /* name length */ + .long 5f - 2f /* data length */ + .long 5 /* note type */ +0: .asciz "GNU" /* vendor name */ +1: + .p2align 3 +2: .long 0xc0000000 /* pr_type. */ + .long 4f - 3f /* pr_datasz. */ +3: + .long 0x2 /* PAC. */ +4: + .p2align 3 +5: +.endif diff --git a/ld/testsuite/ld-aarch64/bti-plt-6.d b/ld/testsuite/ld-aarch64/bti-plt-6.d index c7d5169..30d225d 100644 --- a/ld/testsuite/ld-aarch64/bti-plt-6.d +++ b/ld/testsuite/ld-aarch64/bti-plt-6.d @@ -1,9 +1,9 @@ #name: Warn with one missing GNU NOTE BTI input -#source: property-bti-pac1.s #source: property-bti-pac2.s +#source: property-bti-pac1.s #as: -mabi=lp64 -defsym __property_pac__=1 #ld: -shared --force-bti -#warning: .*: warning: BTI turned on by --force-bti.*$ +#warning: .*property-bti-pac2.*: warning: BTI turned on by --force-bti.*$ #readelf: -n # Should warn about the missing input BTI NOTE but should diff --git a/ld/testsuite/ld-aarch64/bti-plt-7.d b/ld/testsuite/ld-aarch64/bti-plt-7.d index 625f284..e8fa0d3 100644 --- a/ld/testsuite/ld-aarch64/bti-plt-7.d +++ b/ld/testsuite/ld-aarch64/bti-plt-7.d @@ -1,9 +1,10 @@ #name: Warn when neither inputs has GNU NOTE BTI -#source: property-bti-pac1.s +#source: property-bti-pac2.s #source: plt_mapping_symbol.s #as: -mabi=lp64 #ld: -shared --force-bti -#warning: .*: warning: BTI turned on by --force-bti.*$ +#warning: .*plt_mapping_symbol.*: warning: BTI turned on by --force-bti.* +#warning: .*property-bti-pac2.*: warning: BTI turned on by --force-bti.* #readelf: -n # Should warn about the missing input BTI NOTE but should diff --git a/ld/testsuite/ld-aarch64/bti-warn.d b/ld/testsuite/ld-aarch64/bti-warn.d new file mode 100644 index 0000000..c2edccf --- /dev/null +++ b/ld/testsuite/ld-aarch64/bti-warn.d @@ -0,0 +1,16 @@ +#name: Warn when both have GNU prop but neither BTI +#source: property-bti-pac2.s +#source: bti-plt-1.s +#as: -mabi=lp64 --defsym __guard_property_bti__=1 --defsym __property_pac__=1 +#ld: -shared --force-bti +#warning: .*property-bti-pac2.*: warning: BTI turned on by --force-bti.* +#warning: .*bti-plt-1.*: warning: BTI turned on by --force-bti.* +#readelf: -n + +# Should warn about the missing input BTI NOTE but should +# still mark output as BTI + +Displaying notes found in: .note.gnu.property + Owner Data size Description + GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0 + Properties: AArch64 feature: BTI, PAC |