The relocation 'R_AVR_LDS_STS_16' is introduced for the compact
16-bit 'LDS/STS' instructions on AVRTiny devices.
Details
Diff Detail
Event Timeline
lld/ELF/Arch/AVR.cpp | ||
---|---|---|
175 | The assembler won't emit R_AVR_LDS_STS_16 for AVRTiny devices. And this check is hard to be tested in the unit tests. | |
lld/test/ELF/avr-reloc.s | ||
84 | lds/sts are 32-bit instructions on non avrtiny devices. | |
lld/test/ELF/avrtiny-reloc.s | ||
3 | The reasons why I create a new avrtiny-reloc.s, other than add my tests into the existing avr-reloc.s, are
| |
59 | lds/sts are 16-bit instructions on avrtiny devices, while they are 32-bit on ordinary avr devices. |
lld/test/ELF/avr-reloc.s | ||
---|---|---|
84 | Why does the comment say R_AVR_LDS_STS_16 for atmega328p? (Sounds like a copy/paste error) |
lld/test/ELF/avr-reloc.s | ||
---|---|---|
84 | Thanks. I have corrected them. llvm emits relocation R_AVR_16 for lds/sts on AVR while R_AVR_LDS_STS_16 on AVRTiny. |
lld/ELF/Arch/AVR.cpp | ||
---|---|---|
175 | calcEFlags is costly. I don't think any other arch has such an eflags based relocation check. Is it really necessary? I suggest that you remove it, at the very least, there is no trailing dot in all lld/ELF diagnostics. | |
lld/test/ELF/avrtiny-reloc.s | ||
1 | avr-tiny* Can avr-reloc.s be augmented to test -mcpu=attiny10? |
lld/ELF/Arch/AVR.cpp | ||
---|---|---|
175 | Thanks. I have removed this unnecessary check. | |
lld/test/ELF/avr-reloc.s | ||
53 | Currently the disassembler can correctly decode those instructions. | |
lld/test/ELF/avrtiny-reloc.s | ||
1 | I would like to do that, but it is impossible. Since avr-reloc.s contains instructions which are invalid on AVRTiny, the assembler will report errors, so I have to create a seperate file for AVRTiny. |
lld/test/ELF/avrtiny-reloc.s | ||
---|---|---|
1 | Actually avrtiny is not a subset of avr, though their common part is quite large, they each have own specific stuff (instruction mnemonics, instruction formats, instruction encodings, relocations, etc.). |
lld/test/ELF/avrtiny-reloc.s | ||
---|---|---|
3 | You can use --defsym as used by llvm/test/MC/ELF/relocation-alias.s |
lld/test/ELF/avrtiny-reloc.s | ||
---|---|---|
3 | Thanks. I have used --defsym=tiny=1 to distinguish avr and avrtiny instructions. |
The assembler won't emit R_AVR_LDS_STS_16 for AVRTiny devices. And this check is hard to be tested in the unit tests.