@@ -359,23 +359,23 @@ void AArch64AsmPrinter::emitStartOfAsmFile(Module &M) {
359
359
if (const auto *BTE = mdconst::extract_or_null<ConstantInt>(
360
360
M.getModuleFlag (" branch-target-enforcement" ))) {
361
361
if (!BTE->isZero ()) {
362
- BAFlags |= AArch64BuildAttributes ::FeatureAndBitsFlag::Feature_BTI_Flag;
362
+ BAFlags |= AArch64BuildAttrs ::FeatureAndBitsFlag::Feature_BTI_Flag;
363
363
GNUFlags |= ELF::GNU_PROPERTY_AARCH64_FEATURE_1_BTI;
364
364
}
365
365
}
366
366
367
367
if (const auto *GCS = mdconst::extract_or_null<ConstantInt>(
368
368
M.getModuleFlag (" guarded-control-stack" ))) {
369
369
if (!GCS->isZero ()) {
370
- BAFlags |= AArch64BuildAttributes ::FeatureAndBitsFlag::Feature_GCS_Flag;
370
+ BAFlags |= AArch64BuildAttrs ::FeatureAndBitsFlag::Feature_GCS_Flag;
371
371
GNUFlags |= ELF::GNU_PROPERTY_AARCH64_FEATURE_1_GCS;
372
372
}
373
373
}
374
374
375
375
if (const auto *Sign = mdconst::extract_or_null<ConstantInt>(
376
376
M.getModuleFlag (" sign-return-address" ))) {
377
377
if (!Sign->isZero ()) {
378
- BAFlags |= AArch64BuildAttributes ::FeatureAndBitsFlag::Feature_PAC_Flag;
378
+ BAFlags |= AArch64BuildAttrs ::FeatureAndBitsFlag::Feature_PAC_Flag;
379
379
GNUFlags |= ELF::GNU_PROPERTY_AARCH64_FEATURE_1_PAC;
380
380
}
381
381
}
@@ -478,45 +478,35 @@ void AArch64AsmPrinter::emitAttributes(unsigned Flags,
478
478
479
479
if (PAuthABIPlatform || PAuthABIVersion) {
480
480
TS->emitAtributesSubsection (
481
- AArch64BuildAttributes::getVendorName (
482
- AArch64BuildAttributes::AEABI_PAUTHABI),
483
- AArch64BuildAttributes::SubsectionOptional::REQUIRED,
484
- AArch64BuildAttributes::SubsectionType::ULEB128);
485
- TS->emitAttribute (AArch64BuildAttributes::getVendorName (
486
- AArch64BuildAttributes::AEABI_PAUTHABI),
487
- AArch64BuildAttributes::TAG_PAUTH_PLATFORM,
488
- PAuthABIPlatform, " " , false );
489
- TS->emitAttribute (AArch64BuildAttributes::getVendorName (
490
- AArch64BuildAttributes::AEABI_PAUTHABI),
491
- AArch64BuildAttributes::TAG_PAUTH_SCHEMA, PAuthABIVersion,
492
- " " , false );
493
- }
494
-
495
- unsigned BTIValue =
496
- (Flags & AArch64BuildAttributes::Feature_BTI_Flag) ? 1 : 0 ;
497
- unsigned PACValue =
498
- (Flags & AArch64BuildAttributes::Feature_PAC_Flag) ? 1 : 0 ;
499
- unsigned GCSValue =
500
- (Flags & AArch64BuildAttributes::Feature_GCS_Flag) ? 1 : 0 ;
481
+ AArch64BuildAttrs::getVendorName (AArch64BuildAttrs::AEABI_PAUTHABI),
482
+ AArch64BuildAttrs::SubsectionOptional::REQUIRED,
483
+ AArch64BuildAttrs::SubsectionType::ULEB128);
484
+ TS->emitAttribute (
485
+ AArch64BuildAttrs::getVendorName (AArch64BuildAttrs::AEABI_PAUTHABI),
486
+ AArch64BuildAttrs::TAG_PAUTH_PLATFORM, PAuthABIPlatform, " " , false );
487
+ TS->emitAttribute (
488
+ AArch64BuildAttrs::getVendorName (AArch64BuildAttrs::AEABI_PAUTHABI),
489
+ AArch64BuildAttrs::TAG_PAUTH_SCHEMA, PAuthABIVersion, " " , false );
490
+ }
491
+
492
+ unsigned BTIValue = (Flags & AArch64BuildAttrs::Feature_BTI_Flag) ? 1 : 0 ;
493
+ unsigned PACValue = (Flags & AArch64BuildAttrs::Feature_PAC_Flag) ? 1 : 0 ;
494
+ unsigned GCSValue = (Flags & AArch64BuildAttrs::Feature_GCS_Flag) ? 1 : 0 ;
501
495
502
496
if (BTIValue || PACValue || GCSValue) {
503
- TS->emitAtributesSubsection (
504
- AArch64BuildAttributes::getVendorName (
505
- AArch64BuildAttributes::AEABI_FEATURE_AND_BITS),
506
- AArch64BuildAttributes::SubsectionOptional::OPTIONAL,
507
- AArch64BuildAttributes::SubsectionType::ULEB128);
508
- TS->emitAttribute (AArch64BuildAttributes::getVendorName (
509
- AArch64BuildAttributes::AEABI_FEATURE_AND_BITS),
510
- AArch64BuildAttributes::TAG_FEATURE_BTI, BTIValue, " " ,
511
- false );
512
- TS->emitAttribute (AArch64BuildAttributes::getVendorName (
513
- AArch64BuildAttributes::AEABI_FEATURE_AND_BITS),
514
- AArch64BuildAttributes::TAG_FEATURE_PAC, PACValue, " " ,
515
- false );
516
- TS->emitAttribute (AArch64BuildAttributes::getVendorName (
517
- AArch64BuildAttributes::AEABI_FEATURE_AND_BITS),
518
- AArch64BuildAttributes::TAG_FEATURE_GCS, GCSValue, " " ,
519
- false );
497
+ TS->emitAtributesSubsection (AArch64BuildAttrs::getVendorName (
498
+ AArch64BuildAttrs::AEABI_FEATURE_AND_BITS),
499
+ AArch64BuildAttrs::SubsectionOptional::OPTIONAL,
500
+ AArch64BuildAttrs::SubsectionType::ULEB128);
501
+ TS->emitAttribute (AArch64BuildAttrs::getVendorName (
502
+ AArch64BuildAttrs::AEABI_FEATURE_AND_BITS),
503
+ AArch64BuildAttrs::TAG_FEATURE_BTI, BTIValue, " " , false );
504
+ TS->emitAttribute (AArch64BuildAttrs::getVendorName (
505
+ AArch64BuildAttrs::AEABI_FEATURE_AND_BITS),
506
+ AArch64BuildAttrs::TAG_FEATURE_PAC, PACValue, " " , false );
507
+ TS->emitAttribute (AArch64BuildAttrs::getVendorName (
508
+ AArch64BuildAttrs::AEABI_FEATURE_AND_BITS),
509
+ AArch64BuildAttrs::TAG_FEATURE_GCS, GCSValue, " " , false );
520
510
}
521
511
}
522
512
0 commit comments