Skip to content

[LLD][Docs] Document -z gcs= option in the man page #146522

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
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
14 changes: 14 additions & 0 deletions lld/docs/ld.lld.1
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,11 @@ 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 GNU_PROPERTY_AARCH64_FEATURE_1_GCS property. GNU_PROPERTY_AARCH64_FEATURE_1_GCS indicates object file support for the Guarded Control Stack security feature.
Copy link
Member

Choose a reason for hiding this comment

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

GNU_PROPERTY_AARCH64_FEATURE_1_* properties need to use .Cm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack, handled.

.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
Expand Down Expand Up @@ -953,6 +958,15 @@ 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. A set GCS bit indicates that the object file supports the Guarded Control Stack security feature.
Copy link
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
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
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
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
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
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
Loading