You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When GCS was introduced to LLD, the gcs-report option allowed
for a user to gain information relating to if their relocatable objects
supported the feature. For an executable or shared-library to support
GCS, all relocatable objects must declare that they support GCS.
The gcs-report checks were only done on relocatable object files,
however for a program to enable GCS, the executable and all
shared libraries that it loads must enable GCS.
gcs-report-dynamic enables checks to be performed on all shared
objects loaded by LLD, and in cases where GCS is not supported,
a warning or error will be emitted.
It should be noted that only shared files directly passed to LLD
are checked for GCS support. Files that are noted in the `DT_NEEDED`
tags are assumed to have had their GCS support checked when they
were created.
The behaviour of the -zgcs-dynamic-report option matches that of
GNU ld. The behaviour is as follows unless the user explicitly
sets the value:
* -zgcs-report=warning or -zgcs-report=error implies
-zgcs-report-dynamic=warning.
This approach avoids inheriting an error level if the
user wishes to continue building a module without rebuilding all
the shared libraries. The same approach was taken for the GNU ld
linker, so behaviour is identical across the toolchains.
This implementation matches the error message and command
line interface used within the GNU ld Linker. See here:
https://inbox.sourceware.org/binutils/[email protected]/
To enable the checking of the GNU GCS Attributes when linking together
an application, LLD needs to be able to parse a Shared Files program
headers. This will enable a new option, allowing the user to output
diagnostic information relating to if there are shared files being
used that do not support the GCS extension.
To define if a shared file support GCS, the GNU GCS Attribute will
be stored within the Program Header, so this is parsed and, if
found, the `andFeatures` value updated to reflect the support level.
## gcs-report-dynamic should report any dynamic objects that does not have the gcs property. This also ensures the inhertance from gcs-report is working correctly.
# REPORT-WARN-DYNAMIC: warning: no-gcs.so: GCS is required by -z gcs, but this shared library lacks the necessary property note. The dynamic loader might not enable GCS or refuse to load the program unless all shared library dependencies have the GCS marking.
70
+
# REPORT-WARN-DYNAMIC-NOT: warning: force-gcs.so: GCS is required by -z gcs, but this shared library lacks the necessary property note. The dynamic loader might not enable GCS or refuse to load the program unless all shared library dependencies have the GCS marking.
71
+
# REPORT-ERROR-DYNAMIC: error: no-gcs.so: GCS is required by -z gcs, but this shared library lacks the necessary property note. The dynamic loader might not enable GCS or refuse to load the program unless all shared library dependencies have the GCS marking.
72
+
# REPORT-ERROR-DYNAMIC-NOT: error: force-gcs.so: GCS is required by -z gcs, but this shared library lacks the necessary property note. The dynamic loader might not enable GCS or refuse to load the program unless all shared library dependencies have the GCS marking.
0 commit comments