[PATCH] D38029: [AVR] Override ParseDirective

Dylan McKay via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 15:30:41 PDT 2017


dylanmckay added inline comments.


================
Comment at: include/llvm/BinaryFormat/ELFRelocs/AVR.def:41
 ELF_RELOC(R_AVR_PORT5,                35)
+ELF_RELOC(R_AVR_DIFF8,                36)
+ELF_RELOC(R_AVR_DIFF16,               37)
----------------
These integers correspond to numeric ELF relocation codes.

Looking at [binutils-gdb](https://github.com/xiangzhai/binutils-gdb/blob/master/include/elf/avr.h#L84-L86), 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.




Repository:
  rL LLVM

https://reviews.llvm.org/D38029





More information about the llvm-commits mailing list