Hi LLVM developers,
Motivation:
- avr-ld supports directive, relax.s testcase
- arm-linux-gnu-ld supports that too, tls-gdlerelax.s testcase
But:
$ llvm-mc -filetype=obj -triple=avr-unknown-linux -mcpu=atmega328p relax.s -o relax.o relax.s:12:2: error: unknown directive .word L2 - L1 ^
So I simply override ParseDirective for llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp, please review it, thanks a lot!
Regards,
Leslie Zhai
These integers correspond to numeric ELF relocation codes.
Looking at binutils-gdb, the integers for R_AVR_DIFF{8,16,32} are 30, 31, and 32 respectively.
This is concerning because 30 and 31 are already occupied by R_AVR_SYM_DIFF and R_AVR_16_LDST in master.
It looks like the AVR backend doesn't actually generate fixups for either of these, so this will have never caused any problems in the past.
If you rename SYM_DIFF to DIFF8, and then change R_AVR_16_LDST to 33, and then change your new constants to their correct values, it should be fine. I can fix up the relocations in the future.