<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 24, 2017 at 12:18 AM, Minseong Kim via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On 23 March 2017 at 21:35, Peter Smith <span dir="ltr"><<a href="mailto:peter.smith@linaro.org" target="_blank">peter.smith@linaro.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Min,<br>
<br>
This error message occurs when the linker would have to create a<br>
dynamic relocation in a read-only part of the program, which isn't<br>
usually allowed when making a position independent shared-library or<br>
position independent executable. In practice this usually means that<br>
one or more of the objects hasn't been compiled to be position<br>
independent -fPIC.<br></blockquote><div><br></div></span><div>OK~ I will check the objects to be linked, if they are compiled (with -fPIC or not). </div><span class=""><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It is difficult to tell much more without knowing the compiler and<br>
linker options. The R_AARCH64_PREL64 relocation is a relative<br>
relocation, this can require a dynamic relocation if the symbol it<br>
refers to is preemptible (i.e another definition of the symbol could<br>
potentially override it at load-time).<br>
<br>
Given that the file sha1-armv8.S is an assembler file, and I assume<br>
that the link with the same inputs works on ld.bfd and ld.gold, I can<br>
only think that it will either be lld is selecting a different object,<br>
or ld.bfd and ld.gold are resolving the R_AARCH64_PREL64 relocation in<br>
this case and lld is not.<br></blockquote><div><br></div></span><div>Yes, both ld.bfd and ld.gold works with the same inputs. I will keep looking for the cause with your suggestions in mind.</div></div></div></div></blockquote><div><br></div><div>If you can run the LLD link with `--reproduce repro.tar` and then uploading repro.tar somewhere, it will be easier for us to take a look at it (e.g. file a bug in llvm's bugzilla).</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Thanks again, Peter.</div><div><br></div><div>cheers,</div><div>-- Min</div><span class=""><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Peter<br>
<br>
On 23 March 2017 at 04:29, Minseong Kim via llvm-dev<br>
<div><div class="m_4654281078469783879h5"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> It would be great if anyone can share your thoughts about the cause and<br>
> possibly fix of the error below ?<br>
><br>
> I would like to know why it is caused and how it can be fixed (if possible)<br>
> ?<br>
><br>
> The error message is:<br>
><br>
> ~/llvm/build/install_android/l<wbr>inux-x86/clang-3688880/bin/ld.<wbr>lld: error:<br>
> external/boringssl/linux-aarch<wbr>64/crypto/sha/sha1-armv8.S:<wbr>1202: can't create<br>
> dynamic relocation R_AARCH64_PREL64 against symbol 'OPENSSL_armcap_P'<br>
> defined in<br>
> out/target/product/hikey/obj/S<wbr>TATIC_LIBRARIES/libcrypto_inte<wbr>rmediates/libcrypto.a(sha1-<wbr>armv8.o)<br>
> clang-5.0: error: linker command failed with exit code 1 (use -v to see<br>
> invocation)<br>
><br>
> cheers,<br>
> -- Min<br>
><br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
><br>
</blockquote></span></div><br></div></div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div></div>