[PATCH] D16201: [ELF/AArch64] - Implemented set of R_AARCH64_TLSDESC_* relocations.

Adhemerval Zanella via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 21 09:07:53 PDT 2016


zatrazz added a comment.

In http://reviews.llvm.org/D16201#379217, @emaste wrote:

> > So since Ed is ready to start investigating lld on FreeBSD/arm64, I think it is reasonable to keep that in rebased state for him. I`ll rebase this in a few hours.
>
>
> Thank you!
>
> Current status, I've applied this and http://reviews.llvm.org/D18031 and the build fails early on, when linking libc, with:
>
>   relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used when making a shared object; recompile with -fPIC.
>   relocation R_AARCH64_LDST64_ABS_LO12_NC cannot be used when making a shared object; recompile with -fPIC.
>   relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used when making a shared object; recompile with -fPIC.
>   relocation R_AARCH64_LDST64_ABS_LO12_NC cannot be used when making a shared object; recompile with -fPIC.
>   relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used when making a shared object; recompile with -fPIC.
>   relocation R_AARCH64_LDST64_ABS_LO12_NC cannot be used when making a shared object; recompile with -fPIC.
>   relocation R_AARCH64_LDST64_ABS_LO12_NC cannot be used when making a shared object; recompile with -fPIC.
>   relocation R_AARCH64_LDST64_ABS_LO12_NC cannot be used when making a shared object; recompile with -fPIC.
>   cc: error: linker command failed with exit code 1 (use -v to see invocation)
>   *** [libc.so.7.full] Error code 1
>
>
> I'll move on to trying self-hosted clang/llvm/lld builds on FreeBSD first.


Yes, with master you will hit this issue. I fixed with http://reviews.llvm.org/D18031 and you will also need http://reviews.llvm.org/D17980 and http://reviews.llvm.org/D18026 (which are not rebased yet).

I plan to resend all the patches mentioned (including this one) today rebased against master (I am currently bootstrapping  and checking the test-suite on aarch64).


================
Comment at: ELF/OutputSections.cpp:294
@@ +293,3 @@
+  Relocs.insert(Relocs.end() - Tail, Reloc);
+}
+
----------------
Although I did use a vector of ints, if you check the push_back is dominated by internal libc++ calls where insert it is dominated by memmove. And if you use the same benchmark and increase the total number of elements  you will see that it still somewhat faster. It is due for general usage of lld, bulk memmove yields much more CPI and performance than pointer chasing and function call from std::list.


http://reviews.llvm.org/D16201





More information about the llvm-commits mailing list