Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[LLD][Docs] Document -z gcs option in the man page
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.
  • Loading branch information
sivan-shani committed Jul 1, 2025
commit cce8b24fc4fab4e4614e0f641180cf7b9146e499
10 changes: 10 additions & 0 deletions lld/docs/ld.lld.1
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,16 @@ disallows overlap.
.It Cm shstk
x86 only, use shadow stack.
.Pp
.It Cm gcs Ns = Ns Ar [implicit|never|always]
Specify how the GCS bit is set. Set GCS bit indicates object file that supports Guarded Control Stack.
Specify how the GCS bit is set. A set GCS bit indicates that the object file supports the Guarded Control Stack security feature.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to say

Specify how the GNU_PROPERTY_AARCH64_FEATURE_1_GCS feature bit is set in the output ELF file. When set this declares that the ELF file supports the Guarded Control Stack (GCS) security feature.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, wording improved

.Cm implicit
is the default, where the GCS bit is inferred from the input objects.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From looking at noseparate-code above. I suggest
(default) feature bit is inferred from the input object marking.

I've suggested feature bit rather than GCS bit as we've used the full GNU_PROPERTY_AARCH64_FEATURE_1_GCS feature bit above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, wording improved

.Cm never
disables the GCS bit regardless of input markings.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest
clears the feature bit regardless of input object marking.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, wording improved

.Cm always
enables the GCS bit regardless of input markings.
.Pp
.It Cm stack-size Ns = Ns Ar size
Set the main thread's stack size to
.Ar size .
Expand Down