Skip to content

Commit 51235d7

Browse files
committed
[PAC][lld] Test warning emitted for non-PAuth-marked files with -z pac-plt
b616262 changed semantics of `-z pac-plt` initially introduced in e208208, so, the following comment from test/ELF/aarch64-feature-pac.s is no longer true: > There are no warnings in this case as the choice to use PAC in PLT entries > is orthogonal to the choice of using PAC in relocatable objects. The > presence of the PAC .note.gnu.property is an indication of preference by > the relocatable object. This patch updates the test so we ensure a warning is emitted for an input file when `-z pac-plt` is passed but the file does not have GNU_PROPERTY_AARCH64_FEATURE_1_PAC set in GNU_PROPERTY_AARCH64_FEATURE_1_AND property.
1 parent 7e87c2a commit 51235d7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lld/test/ELF/aarch64-feature-pac.s

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,14 @@
7676
# PACDYN-NOT: 0x0000000070000001 (AARCH64_BTI_PLT)
7777
# PACDYN-NOT: 0x0000000070000003 (AARCH64_PAC_PLT)
7878

79-
## Turn on PAC entries with the -z pac-plt command line option. There are no
80-
## warnings in this case as the choice to use PAC in PLT entries is orthogonal
81-
## to the choice of using PAC in relocatable objects. The presence of the PAC
82-
## .note.gnu.property is an indication of preference by the relocatable object.
79+
## Turn on PAC entries with the -z pac-plt command line option. For files w/o
80+
## GNU_PROPERTY_AARCH64_FEATURE_1_PAC set in GNU_PROPERTY_AARCH64_FEATURE_1_AND
81+
## property, emit a warning.
82+
83+
# RUN: ld.lld %t.o %t2.o -z pac-plt %t.so -o %tpacplt.exe 2>&1 | FileCheck -DFILE=%t2.o --check-prefix WARN %s
84+
85+
# WARN: warning: [[FILE]]: -z pac-plt: file does not have GNU_PROPERTY_AARCH64_FEATURE_1_PAC property
8386

84-
# RUN: ld.lld %t.o %t2.o -z pac-plt %t.so -o %tpacplt.exe
8587
# RUN: llvm-readelf -n %tpacplt.exe | FileCheck --check-prefix=PACPROP %s
8688
# RUN: llvm-readelf --dynamic-table %tpacplt.exe | FileCheck --check-prefix PACDYN2 %s
8789
# RUN: llvm-objdump --no-print-imm-hex -d --mattr=+v8.3a --no-show-raw-insn %tpacplt.exe | FileCheck --check-prefix PACPLT %s

0 commit comments

Comments
 (0)