6060#include " llvm/Option/ArgList.h"
6161#include " llvm/Remarks/HotnessThresholdParser.h"
6262#include " llvm/Support/CommandLine.h"
63- #include " llvm/Support/SaveAndRestore.h"
6463#include " llvm/Support/Compression.h"
6564#include " llvm/Support/FileSystem.h"
6665#include " llvm/Support/GlobPattern.h"
6766#include " llvm/Support/LEB128.h"
6867#include " llvm/Support/Parallel.h"
6968#include " llvm/Support/Path.h"
69+ #include " llvm/Support/SaveAndRestore.h"
7070#include " llvm/Support/TarWriter.h"
7171#include " llvm/Support/TargetSelect.h"
7272#include " llvm/Support/TimeProfiler.h"
@@ -407,7 +407,7 @@ static void checkOptions(Ctx &ctx) {
407407 ErrAlways (ctx) << " -z pauth-report only supported on AArch64" ;
408408 if (ctx.arg .zGcsReport != GcsReportPolicy::None)
409409 ErrAlways (ctx) << " -z gcs-report only supported on AArch64" ;
410- if (ctx.arg .zGcsReportDynamic != GcsReportPolicy::None)
410+ if (ctx.arg .zGcsReportDynamic != GcsReportPolicy::None)
411411 ErrAlways (ctx) << " -z gcs-report-dynamic only supported on AArch64" ;
412412 if (ctx.arg .zGcs != GcsPolicy::Implicit)
413413 ErrAlways (ctx) << " -z gcs only supported on AArch64" ;
@@ -623,9 +623,10 @@ static GcsReportPolicy getZGcsReportDynamic(Ctx &ctx, opt::InputArgList &args) {
623623 }
624624 // If the user has not defined a value for gcs-report-dynamic, but has for
625625 // gcs-report, we want to inherit that value for gcs-report-dynamic. This is
626- // capped at a warning to ensure a users module can still build, while providing
627- // information relating to if a dynamic object supports GCS.
628- if (kv.first == " gcs-report" && (kv.second == " warning" || kv.second == " error" ))
626+ // capped at a warning to ensure a users module can still build, while
627+ // providing information relating to if a dynamic object supports GCS.
628+ if (kv.first == " gcs-report" &&
629+ (kv.second == " warning" || kv.second == " error" ))
629630 ret = GcsReportPolicy::Warning;
630631 }
631632
@@ -2890,11 +2891,12 @@ static void readSecurityNotes(Ctx &ctx) {
28902891 return {ctx, DiagLevel::None};
28912892 return report (config);
28922893 };
2893- auto reportGcsPolicy = [&](GcsReportPolicy config, bool cond) -> ELFSyncStream {
2894+ auto reportGcsPolicy = [&](GcsReportPolicy config,
2895+ bool cond) -> ELFSyncStream {
28942896 if (cond)
28952897 return {ctx, DiagLevel::None};
28962898 StringRef configString = " none" ;
2897- if (config == GcsReportPolicy::Warning)
2899+ if (config == GcsReportPolicy::Warning)
28982900 configString = " warning" ;
28992901 else if (config == GcsReportPolicy::Error)
29002902 configString = " error" ;
@@ -2910,7 +2912,7 @@ static void readSecurityNotes(Ctx &ctx) {
29102912 " GNU_PROPERTY_AARCH64_FEATURE_1_BTI property" ;
29112913
29122914 reportGcsPolicy (ctx.arg .zGcsReport ,
2913- features & GNU_PROPERTY_AARCH64_FEATURE_1_GCS)
2915+ features & GNU_PROPERTY_AARCH64_FEATURE_1_GCS)
29142916 << f
29152917 << " : -z gcs-report: file does not have "
29162918 " GNU_PROPERTY_AARCH64_FEATURE_1_GCS property" ;
@@ -2980,15 +2982,21 @@ static void readSecurityNotes(Ctx &ctx) {
29802982 else if (ctx.arg .zGcs == GcsPolicy::Never)
29812983 ctx.arg .andFeatures &= ~GNU_PROPERTY_AARCH64_FEATURE_1_GCS;
29822984
2983- // If we are utilising GCS at any stage, the sharedFiles should be checked to ensure they also support this feature.
2984- // The gcs-report-dynamic option is used to indicate if the user wants information relating to this, and will be set
2985- // depending on the user's input, or warning if gcs-report is set to either `warning` or `error`.
2986- if (ctx.arg .andFeatures & GNU_PROPERTY_AARCH64_FEATURE_1_GCS)
2985+ // If we are utilising GCS at any stage, the sharedFiles should be checked to
2986+ // ensure they also support this feature. The gcs-report-dynamic option is
2987+ // used to indicate if the user wants information relating to this, and will
2988+ // be set depending on the user's input, or warning if gcs-report is set to
2989+ // either `warning` or `error`.
2990+ if (ctx.arg .andFeatures & GNU_PROPERTY_AARCH64_FEATURE_1_GCS)
29872991 for (SharedFile *f : ctx.sharedFiles )
2988- reportGcsPolicy (ctx.arg .zGcsReportDynamic , f->andFeatures & GNU_PROPERTY_AARCH64_FEATURE_1_GCS) << f
2989- << " : GCS is required by -z gcs, but this shared library lacks the necessary property note. The "
2990- << " dynamic loader might not enable GCS or refuse to load the program unless all shared library "
2991- << " dependancies have the GCS marking." ;
2992+ reportGcsPolicy (ctx.arg .zGcsReportDynamic ,
2993+ f->andFeatures & GNU_PROPERTY_AARCH64_FEATURE_1_GCS)
2994+ << f
2995+ << " : GCS is required by -z gcs, but this shared library lacks the "
2996+ " necessary property note. The "
2997+ << " dynamic loader might not enable GCS or refuse to load the "
2998+ " program unless all shared library "
2999+ << " dependancies have the GCS marking." ;
29923000}
29933001
29943002static void initSectionsAndLocalSyms (ELFFileBase *file, bool ignoreComdats) {
0 commit comments