[PATCH] D50998: [LLD] [COFF] Check the instructions in ARM MOV32T relocations

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 21 03:11:56 PDT 2018


peter.smith added a comment.

For what it's worth I've checked that the bit-patterns used in the MOVT/MOVW instructions are correct. In assembler it seems like it is possible to create an error that isn't detectable at link time.

      .global main
      .global variable
      .global variable2
      .text
      .thumb
  main:
      movw r0, :lower16:variable
      movt r0, :upper16:variable2
      ldr  r0, [r0]
      bx   lr
      .data
  variable:
   .long 42

The assembler doesn't detect the different relocation targets and just emits a  0x0 IMAGE_REL_ARM_MOV32T variable relocation. It would be much better if this were caught at assembly time. I don't have any great ideas of how to solve it in MC though as that typically only presents Targets with one fixup at a time.


https://reviews.llvm.org/D50998





More information about the llvm-commits mailing list