llvm.org GIT mirror llvm / 8d803db
[AVR] Enable emission of debug information Prior to this, the code was missing AVR-specific relocation logic in RelocVisitor.h. This patch teaches RelocVisitor about R_AVR_16 and R_AVR_32. Debug information is emitted in the final object file, and understood by 'avr-readelf --debug-dump' from AVR-GCC. llvm-dwarfdump is yet to understand how to dump AVR DWARF symbols. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351720 91177308-0d34-0410-b5e6-96231b3b80d8 Dylan McKay 1 year, 10 months ago
2 changed file(s) with 13 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
9999 case Triple::arm:
100100 case Triple::armeb:
101101 return visitARM(Rel, R, Value);
102 case Triple::avr:
103 return visitAVR(Rel, R, Value);
102104 case Triple::lanai:
103105 return visitLanai(Rel, R, Value);
104106 case Triple::mipsel:
252254 if ((int64_t)Value < INT32_MIN || (int64_t)Value > UINT32_MAX)
253255 HasError = true;
254256 return static_cast(Value);
257 }
258 HasError = true;
259 return 0;
260 }
261
262 uint64_t visitAVR(uint32_t Rel, RelocationRef R, uint64_t Value) {
263 if (Rel == ELF::R_AVR_16) {
264 return (Value + getELFAddend(R)) & 0xFFFF;
265 } else if (Rel == ELF::R_AVR_32) {
266 return (Value + getELFAddend(R)) & 0xFFFFFFFF;
255267 }
256268 HasError = true;
257269 return 0;
2222 PrivateGlobalPrefix = ".L";
2323 UsesELFSectionDirectiveForBSS = true;
2424 UseIntegratedAssembler = true;
25 SupportsDebugInformation = true;
2526 }
2627
2728 } // end of namespace llvm