-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[PAC][lld] Support -z nopac-plt
flag
#132973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Support `-z nopac-plt` so it's possible to cancel previous `-z pac-plt`.
@llvm/pr-subscribers-lld-elf @llvm/pr-subscribers-lld Author: Daniil Kovalev (kovdan01) ChangesSupport Full diff: https://github.com/llvm/llvm-project/pull/132973.diff 2 Files Affected:
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 3e7e05746483a..0f862cab5d026 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -1566,7 +1566,7 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
ctx.arg.zNodlopen = hasZOption(args, "nodlopen");
ctx.arg.zNow = getZFlag(args, "now", "lazy", false);
ctx.arg.zOrigin = hasZOption(args, "origin");
- ctx.arg.zPacPlt = hasZOption(args, "pac-plt");
+ ctx.arg.zPacPlt = getZFlag(args, "pac-plt", "nopac-plt", false);
ctx.arg.zRelro = getZFlag(args, "relro", "norelro", true);
ctx.arg.zRetpolineplt = hasZOption(args, "retpolineplt");
ctx.arg.zRodynamic = hasZOption(args, "rodynamic");
diff --git a/lld/test/ELF/aarch64-feature-pac.s b/lld/test/ELF/aarch64-feature-pac.s
index 4fd1fd2acea73..3a1032647f7c2 100644
--- a/lld/test/ELF/aarch64-feature-pac.s
+++ b/lld/test/ELF/aarch64-feature-pac.s
@@ -8,10 +8,15 @@
## We do not add PAC support when the inputs don't have the .note.gnu.property
## field.
-# RUN: ld.lld %tno.o %t3.o --shared -o %tno.so
-# RUN: llvm-objdump --no-print-imm-hex -d --mattr=+v8.3a --no-show-raw-insn %tno.so | FileCheck --check-prefix=NOPAC %s
-# RUN: llvm-readelf -x .got.plt %tno.so | FileCheck --check-prefix SOGOTPLT %s
-# RUN: llvm-readelf --dynamic-table %tno.so | FileCheck --check-prefix NOPACDYN %s
+# RUN: ld.lld %tno.o %t3.o --shared -o %tno1.so
+# RUN: llvm-objdump --no-print-imm-hex -d --mattr=+v8.3a --no-show-raw-insn %tno1.so | FileCheck --check-prefix=NOPAC %s
+# RUN: llvm-readelf -x .got.plt %tno1.so | FileCheck --check-prefix SOGOTPLT %s
+# RUN: llvm-readelf --dynamic-table %tno1.so | FileCheck --check-prefix NOPACDYN %s
+
+# RUN: ld.lld %tno.o %t3.o --shared -o %tno2.so -z pac-plt -znopac-plt
+# RUN: llvm-objdump --no-print-imm-hex -d --mattr=+v8.3a --no-show-raw-insn %tno2.so | FileCheck --check-prefix=NOPAC %s
+# RUN: llvm-readelf -x .got.plt %tno2.so | FileCheck --check-prefix SOGOTPLT %s
+# RUN: llvm-readelf --dynamic-table %tno2.so | FileCheck --check-prefix NOPACDYN %s
# NOPAC: 00000000000102b8 <func2>:
# NOPAC-NEXT: 102b8: bl 0x102f0 <func3@plt>
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/15065 Here is the relevant piece of the build log for the reference
|
Support
-z nopac-plt
so it's possible to cancel previous-z pac-plt
.