[PATCH] D66542: R_HEX_B15_PCREL_X/R_HEX_B9_PCREL_X can be in shared objects
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 25 21:35:33 PDT 2019
MaskRay added a comment.
In D66542#1683283 <https://reviews.llvm.org/D66542#1683283>, @sidneym wrote:
> Any comments, ABI is here:
> http://lists.llvm.org/pipermail/llvm-dev/2019-September/135177.html
>
> Thanks
Thank you for making it public!
The test here is for the `-shared` case. STB_GLOBAL STV_DEFAULT symbols are preemptable in an object file, so R_PLT_PC relocations to them can not be optimized to R_PC even if the definitions are local.
Do you need a `-no-pie` or `-pie` test that checks if the target symbol is a locally defined symbol, it can be optimized to not use the PLT?
Other than the test request (or clarification if this ELF rule is not applicable on Hexagon), this patch looks good to me.
================
Comment at: lld/test/ELF/hexagon-shared.s:47
# PLT: { immext(#131008
+# PLT: r28 = add(pc,##131016) }
----------------
Can some of the `PLT:` checks be changed to `PLT-NEXT:`? That improves the error messages of FileCheck. It will make layout change easier which can change section addresses. There are several layout changes in the past, e.g. making .gnu.hash enabled by default, reordering readonly sections before .text, allowing PT_LOAD segments to overlap (D66542), etc. Many people are unfamiliar with Hexagon and thus any `-NEXT:` convenience here will be very useful.
Repository:
rLLD LLVM Linker
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66542/new/
https://reviews.llvm.org/D66542
More information about the llvm-commits
mailing list