aarch64: check GCS feature in GNU properties of input dynamic objects

The Guarded Control Stack (GCS) feature requires that two things:
- at static link time, all the input objects of a link unit have to
  be compatible with GCS.
- at runtime, the executable and the shared libraries which it
  depends on have to be compatible with GCS.
Both of those criteria are checked with the GCS feature stored in
the GNU property note.

The previous patch, adding support for the GCS feature check in GNU
note properties for input objects, ignored the input dynamic objects.
Although this support was better than no check, it was still
delaying the detection of compatibility issues up to the runtime
linker.

In order to help the developer in detecting such an incompatibility
issue as early as possible, this patch adds a check for input dynamic
objects lacking the GCS marking. This check can be controlled via the
linker option '-z gcs-report-dynamic[=none|warning|error]'. By default,
if the option is omitted, it inherits the value from '-z gcs-report'.
However, the inherited value is capped to 'warning' as a user might
want to only report errors in the currently built module, and not the
shared dependencies. If a user also wants to error on GCS issues in
the shared libraries, '-z gcs-report-dynamic=error' will have to be
specified explicitly.
5 files changed