[PATCH] D77200: [LLD][ELF][ARM] use reloc directive for Thumb assembler tests

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 01:40:51 PDT 2020


psmith created this revision.
psmith added reviewers: MaskRay, ruiu, grimar.
Herald added subscribers: danielkiss, kristof.beyls, emaste.
Herald added a reviewer: espindola.

In the near future llvm-mc will resolve the fixups that generate R_ARM_THUMB_PC8 and R_ARM_THUMB_PC12 at assembly time (see comments in D72892 <https://reviews.llvm.org/D72892>), and forbid inter-section references. Change the LLD tests for these relocations to use .inst and .reloc to avoid LLD tests failing when this happens. The tests generate the same instructions, relocations and symbols.

I will need to make equivalent changes for D75349 <https://reviews.llvm.org/D75349> Arm equivalent relocations, but this is still in review so these don't need changing before llvm-mc.

As the adr and ldr instructions have fixups with special cases for irregular addends, attempts at manipulating the instructions to create the initial addends I needed failed. It was simpler to use .inst to encode the bit-pattern I needed without any relocations.

I noticed that .reloc wasn't behaving well when an Alignment or Padding fragment had been inserted. I've replaced the few inline .balign directives with nops in this case. Will need to look into MC and raise a PR if there is a problem.


https://reviews.llvm.org/D77200

Files:
  lld/test/ELF/arm-thumb-adr-err.s
  lld/test/ELF/arm-thumb-adr.s
  lld/test/ELF/arm-thumb-ldrlit-err.s
  lld/test/ELF/arm-thumb-ldrlit.s
  lld/test/ELF/arm-thumb2-adr-err.s
  lld/test/ELF/arm-thumb2-adr.s
  lld/test/ELF/arm-thumb2-ldrlit-err.s
  lld/test/ELF/arm-thumb2-ldrlit.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77200.254108.patch
Type: text/x-patch
Size: 10778 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200401/b93cdb2b/attachment.bin>


More information about the llvm-commits mailing list