Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
This patch LGTM but there's a quirk that we may need to worry about in some LLVM components (e.g. CodeGen, MCJIT, etc.) that I should mention.
This relocation and some of of the other new R_MICROMIPS_PC*_S* relocations have a slightly different concept of 'PC' compared to the relocations that came before. The difference is that the PC is rounded down to the specified alignment first whereas other relocations will happily use an unaligned PC. So the PC for R_MICROMIPS_PC18_S3 is 'PC & ~0x7'. I doubt there's much practical difference for the *_PC*_S2's and *_PC*_S1's because code needs to be correctly aligned anyway, but R_MICROMIPS_PC18_S3 requires a greater alignment than code does and may expose the difference more easily.
Another slight difference is that both the symbol and addend must be correctly aligned rather than merely that the sum of the two is correctly aligned. I'm told this is so that REL and RELA have the same constraints.
lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp | ||
---|---|---|
137 ↗ | (On Diff #41259) | Thinking about it a bit more, we should check the alignment here for the micromips case. |