[PATCH] D105761: [lld][AMDGPU] Handle R_AMDGPU_REL16 relocation.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 11 11:13:38 PDT 2021


MaskRay added inline comments.


================
Comment at: lld/ELF/Arch/AMDGPU.cpp:144
+    int64_t sval = static_cast<int64_t>(val);
+    checkInt(loc, ((sval - 4) / 4), 16, rel);
+    write16le(loc, (sval - 4) / 4);
----------------
define the local variable as `((sval - 4) / 4)` instead (with a variable rename)


================
Comment at: lld/test/ELF/amdgpu-relocs2.s:3
+# RUN: llvm-mc -filetype=obj -triple=amdgcn--amdhsa -mcpu=fiji %s -o %t.o
+# RUN: echo "SECTIONS { \
+# RUN:       . = 0x1000;                             \
----------------
See split-file in newer tests and avoid echo for long files.


================
Comment at: lld/test/ELF/amdgpu-relocs2.s:25
+.section .text.unlikely
+cold1:
+  s_add_i32 s15, s15, 1
----------------
unused .text.unlikely?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105761



More information about the llvm-commits mailing list