[PATCH] D87381: [LLD][PowerPC][test] Add test cases for all pc-rel based stubs when the offset not fit in 34 bits

Victor Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 13:41:32 PDT 2020


NeHuang marked 2 inline comments as done.
NeHuang added inline comments.


================
Comment at: lld/ELF/Thunks.cpp:913
   if (!isInt<34>(offset))
-    fatal("offset must fit in 34 bits to encode in the instruction");
+    fatal("offset overflow 34 bits, please compile using the large code model");
   uint64_t paddi = PADDI_R12_NO_DISP | (((offset >> 16) & 0x3ffff) << 32) |
----------------
MaskRay wrote:
> We have an existing diagnostic like
> 
> `error: relocation R_AARCH64_ABS32 cannot be used against symbol hidden; recompile with -fPIC`
Just want to clarify, are you suggesting to follow the same error message print format as `error: relocation R_AARCH64_ABS32 cannot be used against symbol hidden; recompile with -fPIC` ? 


================
Comment at: lld/test/ELF/ppc64-pcrel-call-to-extern-error.s:1
+# REQUIRES: ppc, linux
+# RUN: echo 'SECTIONS { \
----------------
MaskRay wrote:
> Delete `linux`
We want to keep the `linux` to run the test on ppc-linux only since writing to an allocated file will cause time error for this case on freebsd bots. Will add some comments in the tests


================
Comment at: lld/test/ELF/ppc64-pcrel-call-to-extern-error.s:9
+# RUN: llvm-mc -filetype=obj -triple=powerpc64le %s -o %t2.o
+# RUN: lld.lld --shared %t2.o -o %t2.so
+# RUN: not ld.lld -T %t.script %t1.o %t2.so -o %t 2>&1 | FileCheck %s
----------------
MaskRay wrote:
> If a linked .so is used by another link, add -soname to avoid a gotcha
> 
> See commit  c2a5459d52b94a50581dec7a542ef00915b8d2b2
Will do.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87381



More information about the llvm-commits mailing list