31 MCContext &Ctx)
const;
34 MSP430AsmBackend(
const MCSubtargetInfo &STI, uint8_t OSABI)
36 ~MSP430AsmBackend()
override =
default;
38 void applyFixup(
const MCFragment &,
const MCFixup &,
const MCValue &Target,
39 uint8_t *
Data, uint64_t
Value,
bool IsResolved)
override;
41 std::unique_ptr<MCObjectTargetWriter>
42 createObjectTargetWriter()
const override {
46 MCFixupKindInfo getFixupKindInfo(
MCFixupKind Kind)
const override {
52 {
"fixup_32", 0, 32, 0},
53 {
"fixup_10_pcrel", 0, 10, 0},
54 {
"fixup_16", 0, 16, 0},
55 {
"fixup_16_pcrel", 0, 16, 0},
56 {
"fixup_16_byte", 0, 16, 0},
57 {
"fixup_16_pcrel_byte", 0, 16, 0},
58 {
"fixup_2x_pcrel", 0, 10, 0},
59 {
"fixup_rl_pcrel", 0, 16, 0},
61 {
"fixup_sym_diff", 0, 32, 0},
65 "Not all fixup kinds added to Infos array");
73 bool writeNopData(raw_ostream &OS, uint64_t
Count,
74 const MCSubtargetInfo *STI)
const override;
106void MSP430AsmBackend::applyFixup(
const MCFragment &
F,
const MCFixup &
Fixup,
107 const MCValue &Target, uint8_t *
Data,
108 uint64_t
Value,
bool IsResolved) {
109 maybeAddReloc(
F,
Fixup, Target,
Value, IsResolved);
111 MCFixupKindInfo
Info = getFixupKindInfo(
Fixup.getKind());
118 unsigned NumBytes =
alignTo(
Info.TargetSize +
Info.TargetOffset, 8) / 8;
120 "Invalid fixup offset!");
124 for (
unsigned i = 0; i != NumBytes; ++i) {
125 Data[i] |= uint8_t((
Value >> (i * 8)) & 0xff);
129bool MSP430AsmBackend::writeNopData(raw_ostream &OS, uint64_t
Count,
130 const MCSubtargetInfo *STI)
const {
131 if ((
Count % 2) != 0)
135 uint64_t NopCount =
Count / 2;
137 OS.
write(
"\x03\x43", 2);
unsigned const MachineRegisterInfo * MRI
static uint64_t adjustFixupValue(const MCFixup &Fixup, const MCValue &Target, uint64_t Value, MCContext &Ctx, const Triple &TheTriple, bool IsResolved)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file implements a class to represent arbitrary precision integral constant values and operations...
PowerPC TLS Dynamic Call Fixup
Generic interface to target specific assembler backends.
virtual MCFixupKindInfo getFixupKindInfo(MCFixupKind Kind) const
Get information on a fixup kind.
Context object for machine code objects.
LLVM_ABI void reportError(SMLoc L, const Twine &Msg)
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Generic base class for all target subtargets.
Target - Wrapper for Target specific information.
LLVM Value Representation.
raw_ostream & write(unsigned char C)
Error applyFixup(LinkGraph &G, Block &B, const Edge &E, const ArmConfig &ArmCfg)
Apply fixup expression for edge to block content.
Context & getContext() const
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr Value
uint16_t MCFixupKind
Extensible enumeration to represent the type of a fixup.
FunctionAddr VTableAddr Count
FunctionAddr VTableAddr uintptr_t uintptr_t Data
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
MCAsmBackend * createMSP430MCAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
std::unique_ptr< MCObjectTargetWriter > createMSP430ELFObjectWriter(uint8_t OSABI)