diff options
Diffstat (limited to 'lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp')
| -rw-r--r-- | lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp b/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp index d18298385adf2..2d9dd4f8f83f2 100644 --- a/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp +++ b/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp @@ -265,15 +265,19 @@ void AVRAsmBackend::adjustFixupValue(const MCFixup &Fixup, adjust::ldi::fixup(Size, Fixup, Value, Ctx); break; case AVR::fixup_lo8_ldi: + adjust::ldi::lo8(Size, Fixup, Value, Ctx); + break; case AVR::fixup_lo8_ldi_pm: - if (Kind == AVR::fixup_lo8_ldi_pm) adjust::pm(Value); - + case AVR::fixup_lo8_ldi_gs: + adjust::pm(Value); adjust::ldi::lo8(Size, Fixup, Value, Ctx); break; case AVR::fixup_hi8_ldi: + adjust::ldi::hi8(Size, Fixup, Value, Ctx); + break; case AVR::fixup_hi8_ldi_pm: - if (Kind == AVR::fixup_hi8_ldi_pm) adjust::pm(Value); - + case AVR::fixup_hi8_ldi_gs: + adjust::pm(Value); adjust::ldi::hi8(Size, Fixup, Value, Ctx); break; case AVR::fixup_hh8_ldi: @@ -316,6 +320,13 @@ void AVRAsmBackend::adjustFixupValue(const MCFixup &Fixup, Value &= 0xffff; break; + case AVR::fixup_16_pm: + Value >>= 1; // Flash addresses are always shifted. + adjust::unsigned_width(16, Value, std::string("port number"), Fixup, Ctx); + + Value &= 0xffff; + break; + case AVR::fixup_6_adiw: adjust::fixup_6_adiw(Fixup, Value, Ctx); break; @@ -329,6 +340,7 @@ void AVRAsmBackend::adjustFixupValue(const MCFixup &Fixup, break; // Fixups which do not require adjustments. + case FK_Data_1: case FK_Data_2: case FK_Data_4: case FK_Data_8: @@ -340,7 +352,8 @@ void AVRAsmBackend::adjustFixupValue(const MCFixup &Fixup, } } -MCObjectWriter *AVRAsmBackend::createObjectWriter(raw_pwrite_stream &OS) const { +std::unique_ptr<MCObjectWriter> +AVRAsmBackend::createObjectWriter(raw_pwrite_stream &OS) const { return createAVRELFObjectWriter(OS, MCELFObjectTargetWriter::getOSABI(OSType)); } @@ -421,8 +434,9 @@ MCFixupKindInfo const &AVRAsmBackend::getFixupKindInfo(MCFixupKind Kind) const { {"fixup_8_hi8", 0, 8, 0}, {"fixup_8_hlo8", 0, 8, 0}, - {"fixup_sym_diff", 0, 32, 0}, - {"fixup_16_ldst", 0, 16, 0}, + {"fixup_diff8", 0, 8, 0}, + {"fixup_diff16", 0, 16, 0}, + {"fixup_diff32", 0, 32, 0}, {"fixup_lds_sts_16", 0, 16, 0}, |
