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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 1 08:02:35 PDT 2023


MaskRay added inline comments.


================
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
----------------
xen0n wrote:
> 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.
Yes, we should reduce the number of invocations. If a linker script can test multiple edge cases, we should use that.


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