[lld] 8bb97d2 - [LLD][Docs] Document -z gcs= option in the man page (#146522)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 21 07:23:21 PDT 2025
Author: SivanShani-Arm
Date: 2025-07-21T15:23:18+01:00
New Revision: 8bb97d2d1e7a3488fdd0052674d654663d87256c
URL: https://github.com/llvm/llvm-project/commit/8bb97d2d1e7a3488fdd0052674d654663d87256c
DIFF: https://github.com/llvm/llvm-project/commit/8bb97d2d1e7a3488fdd0052674d654663d87256c.diff
LOG: [LLD][Docs] Document -z gcs= option in the man page (#146522)
Add documentation for the -z gcs= option to the LLD man page. This flag
controls how the GCS bit is set in the output:
- implicit (default): inferred from input objects
- never: GCS bit is never set
- always: GCS bit is always set
Clarifies behavior for users and aligns the man page with existing
functionality.
Added:
Modified:
lld/docs/ld.lld.1
Removed:
################################################################################
diff --git a/lld/docs/ld.lld.1 b/lld/docs/ld.lld.1
index 7edc522b4f6a4..1835879b671e8 100644
--- a/lld/docs/ld.lld.1
+++ b/lld/docs/ld.lld.1
@@ -798,6 +798,13 @@ Specify how to report the missing GNU_PROPERTY_X86_FEATURE_1_IBT or GNU_PROPERTY
.Cm none
is the default, linker will not report the missing property otherwise will be reported as a warning or an error.
.Pp
+.It Cm gcs-report Ns = Ns Ar [none|warning|error]
+Specify how to report missing
+.Cm GNU_PROPERTY_AARCH64_FEATURE_1_GCS
+property. GNU_PROPERTY_AARCH64_FEATURE_1_GCS indicates object file support for the Guarded Control Stack security feature.
+.Cm none
+is the default, linker will not report the missing property otherwise will be reported as a warning or an error.
+.Pp
.It Cm dynamic-undefined-weak
Make undefined weak symbols dynamic when the dynamic symbol table is present, if they are referenced from
relocatable object files and not forced local by symbol visibility or versioning. Do not make them dynamic when
@@ -953,6 +960,17 @@ disallows overlap.
.It Cm shstk
x86 only, use shadow stack.
.Pp
+.It Cm gcs Ns = Ns Ar [implicit|never|always]
+Specifies how the
+.Cm GNU_PROPERTY_AARCH64_FEATURE_1_GCS
+bit is set in the output ELF file. When set, it indicates support for the Guarded Control Stack (GCS) security feature.
+.Cm implicit
+(default) The GCS feature bit is set if all input relocatable files have a .note.gnu.property section containing the GNU_PROPERTY_AARCH64_FEATURE_1_GCS bit.
+.Cm never
+clears the GCS feature bit regardless of input relocatable files' markings.
+.Cm always
+sets the GCS feature bit regardless of input object markings.
+.Pp
.It Cm stack-size Ns = Ns Ar size
Set the main thread's stack size to
.Ar size .
More information about the llvm-commits
mailing list