diff --git a/llvm/include/llvm/Object/RelocVisitor.h b/llvm/include/llvm/Object/RelocVisitor.h index a1696c54daab..1d3d79a2a1aa 100644 --- a/llvm/include/llvm/Object/RelocVisitor.h +++ b/llvm/include/llvm/Object/RelocVisitor.h @@ -100,6 +100,8 @@ private: case Triple::arm: case Triple::armeb: return visitARM(Rel, R, Value); + case Triple::avr: + return visitAVR(Rel, R, Value); case Triple::lanai: return visitLanai(Rel, R, Value); case Triple::mipsel: @@ -258,6 +260,16 @@ private: return 0; } + uint64_t visitAVR(uint32_t Rel, RelocationRef R, uint64_t Value) { + if (Rel == ELF::R_AVR_16) { + return (Value + getELFAddend(R)) & 0xFFFF; + } else if (Rel == ELF::R_AVR_32) { + return (Value + getELFAddend(R)) & 0xFFFFFFFF; + } + HasError = true; + return 0; + } + uint64_t visitLanai(uint32_t Rel, RelocationRef R, uint64_t Value) { if (Rel == ELF::R_LANAI_32) return (Value + getELFAddend(R)) & 0xFFFFFFFF; diff --git a/llvm/lib/Target/AVR/MCTargetDesc/AVRMCAsmInfo.cpp b/llvm/lib/Target/AVR/MCTargetDesc/AVRMCAsmInfo.cpp index 2830f94a5e4c..99b2172c562f 100644 --- a/llvm/lib/Target/AVR/MCTargetDesc/AVRMCAsmInfo.cpp +++ b/llvm/lib/Target/AVR/MCTargetDesc/AVRMCAsmInfo.cpp @@ -23,6 +23,7 @@ AVRMCAsmInfo::AVRMCAsmInfo(const Triple &TT) { PrivateGlobalPrefix = ".L"; UsesELFSectionDirectiveForBSS = true; UseIntegratedAssembler = true; + SupportsDebugInformation = true; } } // end of namespace llvm