<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Nov 3, 2017 at 9:06 PM, Rafael Avila de Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Rui Ueyama via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> writes:<br>
<br>
> Modified: lld/trunk/ELF/InputFiles.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=316863&r1=316862&r2=316863&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/ELF/<wbr>InputFiles.cpp?rev=316863&r1=<wbr>316862&r2=316863&view=diff</a><br>
> ==============================<wbr>==============================<wbr>==================<br>
> --- lld/trunk/ELF/InputFiles.cpp (original)<br>
> +++ lld/trunk/ELF/InputFiles.cpp Sun Oct 29 09:49:42 2017<br>
> @@ -763,7 +763,9 @@ template <class ELFT> void SharedFile<EL<br>
> // files because the loader takes care of it. However, if we promote a<br>
> // DSO symbol to point to .bss due to copy relocation, we need to keep<br>
> // the original alignment requirements. We infer it here.<br>
> - uint32_t Alignment = 1ULL << countTrailingZeros((uint64_t)<wbr>Sym.st_value);<br>
> + uint32_t Alignment = 1;<br>
> + if (Sym.st_value)<br>
> + Alignment = 1ULL << countTrailingZeros((uint64_t)<wbr>Sym.st_value);<br>
<br>
</span>This still implicitly discard information if st_value is aligned to more<br>
than 32 bits, no? Should Alignment be a uint_64?<br></blockquote><div><br></div><div>Yes, but we use uint32_t to represent alignments everywhere in lld. In practice, I don't think there's a point to support alignments larger than 4 GiB because I've never seen such large alignments. (If we really need it, we probably should consider representing alignments in the form of N in 2^N to save bits to store alignments.) </div></div></div></div>