[PATCH] D156772: [lld][LoongArch] Support the R_LARCH_PCREL20_S2 relocation type

WÁNG Xuěruì via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 21:32:48 PDT 2023


xen0n added a comment.

Thanks for the patch, actually I had this one in my local repo for a while but hadn't submitted just yet ;-) The code change is trivially correct and I only have a minor suggestion for the test case. Let's wait for @MaskRay's opinions though...



================
Comment at: lld/test/ELF/loongarch-pcrel20-s2.s:12-16
+# RUN: ld.lld %t.la32.o --section-start=.text=0x20008 --section-start=.data=0x20000 -o %t.la32.2
+# RUN: ld.lld %t.la64.o --section-start=.text=0x20008 --section-start=.data=0x20000 -o %t.la64.2
+# RUN: llvm-objdump --no-show-raw-insn -d %t.la32.2 | FileCheck --match-full-lines --check-prefix=CASE2 %s
+# RUN: llvm-objdump --no-show-raw-insn -d %t.la64.2 | FileCheck --match-full-lines --check-prefix=CASE2 %s
+# CASE2: 20008: pcaddi $t0, -2
----------------
I remember MaskRay once mentioned the desire to keep lld invocations to a minimum? To me this looks like two `pcaddi`'s pointing to two separate sections (one above `.text` and one below), then only one run for the positive cases would be enough. Let's see what he thinks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156772



More information about the llvm-commits mailing list