27 cl::desc(
"Add .note.gnu.property with BTI to assembly files"),
41 bool HasAddressDiversity) {
53 return ConstantPools->addEntry(
Streamer, Expr,
Size, Loc);
57 ConstantPools->emitForCurrentSection(
Streamer);
79 if (PAuthABIPlatform !=
uint64_t(-1))
80 DescSz += 4 + 4 + 8 * 2;
93 "The .note.gnu.property is not emitted because it is already present.");
115 if (PAuthABIPlatform !=
uint64_t(-1)) {
132 for (
char &
C : Buffer) {
144 if (TT.isOSBinFormatELF())
146 if (TT.isOSBinFormatCOFF())
161 if (VendorName == SubSection.VendorName) {
175std::unique_ptr<MCELFStreamer::AttributeSubSection>
178 if (SubSection.IsActive) {
179 return std::make_unique<MCELFStreamer::AttributeSubSection>(SubSection);
185std::unique_ptr<MCELFStreamer::AttributeSubSection>
188 if (
Name == SubSection.VendorName) {
189 return std::make_unique<MCELFStreamer::AttributeSubSection>(SubSection);
200 assert(0 &&
"Arguments error");
205 "Can not add AArch64 build attribute: no AArch64 subsection exists");
210 if (VendorName == SubSection.VendorName) {
211 if (!SubSection.IsActive) {
213 "Can not add AArch64 build attribute: subsection is not active");
222 "Can not add AArch64 build attribute: An attribute with "
223 "the same tag and a different value already exists");
228 "AArch64 build attribute: An attribute with the same tag "
229 "and a same value already exists");
235 if (
unsigned(-1) !=
Value)
245 assert(0 &&
"Can not add AArch64 build attribute: required subsection does "
251 if (VendorName == SubSection.VendorName) {
252 SubSection.IsActive =
true;
254 SubSection.IsActive =
false;
static cl::opt< bool > MarkBTIProperty("aarch64-mark-bti-property", cl::Hidden, cl::desc("Add .note.gnu.property with BTI to assembly files"), cl::init(false))
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static const AArch64AuthMCExpr * create(const MCExpr *Expr, uint16_t Discriminator, AArch64PACKey::ID Key, bool HasAddressDiversity, MCContext &Ctx)
AArch64TargetStreamer(MCStreamer &S)
void activateAtributesSubsection(StringRef VendorName)
void emitConstantPools() override
virtual void emitAttribute(StringRef VendorName, unsigned Tag, unsigned Value, std::string String, bool Override)
const MCExpr * addConstantPoolEntry(const MCExpr *, unsigned Size, SMLoc Loc)
Callback used to implement the ldr= pseudo.
~AArch64TargetStreamer() override
SmallVector< MCELFStreamer::AttributeSubSection, 64 > AttributeSubSections
std::unique_ptr< MCELFStreamer::AttributeSubSection > getActiveAtributesSubsection()
void emitNoteSection(unsigned Flags, uint64_t PAuthABIPlatform=-1, uint64_t PAuthABIVersion=-1)
Callback used to implement the .note.gnu.property section.
void emitAuthValue(const MCExpr *Expr, uint16_t Discriminator, AArch64PACKey::ID Key, bool HasAddressDiversity)
Callback used to emit AUTH expressions (e.g.
virtual void emitAtributesSubsection(StringRef VendorName, AArch64BuildAttributes::SubsectionOptional IsOptional, AArch64BuildAttributes::SubsectionType ParameterType)
Build attributes implementation.
std::unique_ptr< MCELFStreamer::AttributeSubSection > getAtributesSubsectionByName(StringRef Name)
void emitCurrentConstantPool()
Callback used to implement the .ltorg directive.
virtual void emitInst(uint32_t Inst)
Callback used to implement the .inst directive.
Context object for machine code objects.
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
void reportWarning(SMLoc L, const Twine &Msg)
Base class for the full range of assembler expressions which are needed for parsing.
This represents a section on linux, lots of unix variants and some bare metal systems.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
bool isRegistered() const
Streaming machine code generation interface.
MCContext & getContext() const
virtual void emitValueToAlignment(Align Alignment, int64_t Value=0, unsigned ValueSize=1, unsigned MaxBytesToEmit=0)
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
virtual void emitIntValue(uint64_t Value, unsigned Size)
Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers.
MCSymbol * endSection(MCSection *Section)
virtual void switchSection(MCSection *Section, uint32_t Subsec=0)
Set the current section where code is being emitted to Section.
MCSection * getCurrentSectionOnly() const
virtual void emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc())
Emit the expression Value into the output as a native integer of the given Size bytes.
virtual void emitBytes(StringRef Data)
Emit the bytes in Data into the output.
Generic base class for all target subtargets.
const Triple & getTargetTriple() const
Target specific streamer interface.
MCStreamer & getStreamer()
Represents a location in source code.
StringRef - Represent a constant reference to a string, i.e.
Triple - Helper class for working with autoconf configuration names.
LLVM Value Representation.
@ C
The default llvm calling convention, compatible with C.
@ GNU_PROPERTY_AARCH64_FEATURE_1_BTI
@ GNU_PROPERTY_AARCH64_FEATURE_PAUTH
@ GNU_PROPERTY_AARCH64_FEATURE_1_AND
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
MCTargetStreamer * createAArch64NullTargetStreamer(MCStreamer &S)
MCTargetStreamer * createAArch64ObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
This struct is a compact representation of a valid (non-zero power of two) alignment.
ELF object attributes section emission support.
ELF object attributes subsection support.