[PATCH] D94355: [Passes] Add relative lookup table converter pass

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 30 02:04:12 PDT 2021


mstorsjo added a comment.

It looks like this is breaking the Windows/ARM(64) target - it doesn't produce the right relative relocations for symbol differences. It can be reproduced with a testcase like this:

  $ cat test.s
          .text
  func1:
          ret
  func2:
          ret
  
          .section        .rdata,"dr"
          .p2align        2
  table:
          .long   func1-table
          .long   func2-table
  $ clang -target aarch64-windows -c -o - test.s | llvm-objdump -r -s -
  
  <stdin>:        file format coff-arm64
  
  RELOCATION RECORDS FOR [.rdata]:
  OFFSET           TYPE                     VALUE
  0000000000000000 IMAGE_REL_ARM64_ADDR32   func1
  0000000000000004 IMAGE_REL_ARM64_ADDR32   func2
  
  Contents of section .text:
   0000 c0035fd6 c0035fd6                    .._..._.
  Contents of section .rdata: 
   0000 00000000 04000000                    ........

Those relocations would need to be IMAGE_REL_ARM64_REL32. It looks like the arm/windows target has got the same issue as well.

Would you be ok with reverting this change until I can sort that out, or can we disable the pass for those targets until then?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94355/new/

https://reviews.llvm.org/D94355



More information about the cfe-commits mailing list