<div dir="ltr">It sounds like a bit overkill. There are bunch of other cases in which the linker silently creates broken outputs. As long as creating broken executables is a natural consequence of providing broken inputs, I wouldn't try to catch that. My concern is achieving a right balance -- this patch introduces the concept of "isNonzeroAddendSupported" just for checking some specific type of error.<br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 25, 2015 at 10:30 AM, Igor Kudrin <span dir="ltr"><<a href="mailto:ikudrin.dev@gmail.com" target="_blank">ikudrin.dev@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">ikudrin added a comment.<br>
<span class=""><br>
In <a href="http://reviews.llvm.org/D14991#296701" rel="noreferrer" target="_blank">http://reviews.llvm.org/D14991#296701</a>, @ruiu wrote:<br>
<br>
> Do we really want to have this check? We don't have to check all possible ABI violations of input files. This is a kind of ABI violation that if you set an addend to a relocation, the output will have a value with that addend, which is a natural consequence.<br>
<br>
<br>
</span>As far as I can understand, it's not a violation of ABI rules in input files. See section "4.6.3 Relocation types" in <a href="http://infocenter.arm.com/help/topic/com.arm.doc.ihi0056b/IHI0056B_aaelf64.pdf" rel="noreferrer" target="_blank">http://infocenter.arm.com/help/topic/com.arm.doc.ihi0056b/IHI0056B_aaelf64.pdf</a>:<br>
<br>
> - GDAT(S+A) represents a 64-bit entry in the GOT for address S+A. The entry will be relocated at run time with relocation R_AARCH64_GLOB_DAT(S+A).<br>
<br>
> - G(expr) is the address of the GOT entry for the expression expr.<br>
<br>
<br>
And in section "4.6.6 Static AArch64 relocations", "Table 4-14, GOT-relative instruction relocations":<br>
<br>
> R_AARCH64_ADR_GOT_PAGE: Page(G(GDAT(S+A))) - Page(P)<br>
<br>
>  R_AARCH64_LD64_GOT_LO12_NC: G(GDAT(S+A))<br>
<br>
<br>
So, the input is valid, but I'm doubt if it is in use or not. If we don't detect the situation we will //silently// produce broken executable file with bugs which are very hard to be caught. But if we print a message, it'll clearly point to the problem case.<br>
<br>
<br>
<a href="http://reviews.llvm.org/D14991" rel="noreferrer" target="_blank">http://reviews.llvm.org/D14991</a><br>
<br>
<br>
<br>
</blockquote></div><br></div></div>