With this patch lld recognizes ARM SBREL relocations.
R_ARM*_MOVW_BREL relocations are not tested because they are not used.
Details
Diff Detail
Event Timeline
The code changes look good to me. I'm unfortunately going to have be a pain and ask that you split the additional tests not related to the new relocation support into a separate change, something like "[LLD][ELF][ARM] add missing test cases for ... " that I'd be happy to approve. This helps keep tracking down failures via bisection easier.
I've added a couple more frequent reviewers to see if they have any additional comments.
For the benefit of other reviewers, reference to ELF for the ARM Architecture for definitions of the relocations https://static.docs.arm.com/ihi0044/g/aaelf32.pdf
lld/test/ELF/arm-mov-relocs.s | ||
---|---|---|
32 | Another convention is where the address isn't significant to the line and follows on from the previous instruction is to only put the address on the first instruction. I think it is also the trend to remove the early indentation. For example: // CHECK: 12000: movw r0, #0 // CHECK: movw r1, #4 // CHECK: movw r2, #12 // CHECK: movw r3, #65532 // CHECK: movw r4, #0 |
Peter has mentioned most points I wanted to say. If we can think of a good category name, we can place new tests in arm-reloc-$category.s.
Use CHECK-LABEL: instead of CHECK: for section .R_* (see ppc32-reloc-addr.s). They can improve FileCheck diagnostics when something changes.
Don't just write // 0x20000 - . = 56832. It is unclear what 0x20000 refers to. In riscv-tls-*, you can see I write ## rv32: &.got[0] - . = 0x2214 - . = 4096*1+112
lld/test/ELF/arm-mov-relocs.s | ||
---|---|---|
23 | Is the overalignment (8) significant? |
lld/test/ELF/arm-mov-relocs.s | ||
---|---|---|
23 | Technically it is not. |
Thanks for the update. Apart from the extra / needed in some of the comment strings this looks good to me. Happy for you to add those prior to commit.
lld/test/ELF/arm-mov-relocs.s | ||
---|---|---|
9–17 | The comment doesn't involve lit commands so these should start with /// for example: /// * R_ARM_MOVW_ABS_NC and R_ARM_MOVT_ABS /// * R_ARM_MOVW_PREL_NC and R_ARM_MOVT_PREL /// * R_ARM_MOVW_BREL_NC and R_ARM_MOVT_BREL /// /// * R_ARM_THM_MOVW_BREL_NC and R_ARM_THM_MOVT_BREL | |
50 | This type of explanatory comment would need the extra / |
Thank you, Peter.
Yes, add the missing /-es and commit this change on my behalf, please.
I will add the missing test cases shortly after.
The comment doesn't involve lit commands so these should start with /// for example: