[lld] [AArch64][GCS][LLD] Introduce -zgcs-report-dynamic Command Line Option (PR #127787)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 12 10:01:26 PDT 2025


================
@@ -1629,7 +1667,6 @@ static void readConfigs(Ctx &ctx, opt::InputArgList &args) {
       std::make_pair("bti-report", &ctx.arg.zBtiReport),
       std::make_pair("cet-report", &ctx.arg.zCetReport),
       std::make_pair("execute-only-report", &ctx.arg.zExecuteOnlyReport),
-      std::make_pair("gcs-report", &ctx.arg.zGcsReport),
       std::make_pair("pauth-report", &ctx.arg.zPauthReport)};
----------------
MaskRay wrote:

I disagree. The is significant duplication and code bloat due to none/warning/error parsing.
You could add
```
if (option.first == "gcs-report-dynamic")
  reportDynamicSpecified = true
```

then after the for loop,
```
  if (!reportDynamicDefined && ctx.arg.zGcsReport != ReportPolicy::None &&
      ctx.arg.zGcsReportDynamic == ReportPolicy::None)
    ctx.arg.zGcsReportDynamic = ReportPolicy::Warning;
```

https://github.com/llvm/llvm-project/pull/127787


More information about the llvm-commits mailing list