<div dir="ltr">Yes, that is my point. It doesn't make much sense to set entsize for sections in which all contents are coincidentally the same size. Setting entsize makes sense only when contents are uniform same-sized elements. Setting it to 4 only for 32-bit arch seems a cargo cult.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 29, 2017 at 8:35 AM, 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"><div>It still looks like a stretch, no?<br>
<br>
Most things with a entsize have independent items that are x bytes each. This section has a complex structure where each member is 32 bits.<br>
<br>
Cheers,<br>
Rafael<br><br><div class="gmail_quote"><div><div class="h5">On March 29, 2017 11:27:37 AM EDT, George Rimar via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:</div></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<pre class="m_-3948919960394862388k9mail"><div><div class="h5"><blockquote class="gmail_quote" style="margin:0pt 0pt 1ex 0.8ex;border-left:1px solid #729fcf;padding-left:1ex">.gnu.hash happen to contain only 32-bit integers for 32-bit arch,<br>but the section contents are not uniform array members, so setting<br>entsize doesn't make much sense. This behavior seems to have been<br>blindly copied from GNU linkers.<br></blockquote><br>I do not thing it was blindly copied, it was explicitly mentioned in oracle blog that:<br><br>"The header, hash buckets, and hash chains are always 32-bit words, while the Bloom filter words can be 32 or 64-bit depending on the class of object. This means that ELFCLASS32 GNU_HASH sections consist of only 32-bit words, and therefore have their section header sh_entsize field set to 4. ELFCLASS64 GNU_HASH sections have mixed element size, and therefore set sh_entsize to 0."<br>(<a href="https://blogs.oracle.com/ali/entry/gnu_hash_elf_sections" target="_blank">https://blogs.oracle.com/ali/<wbr>entry/gnu_hash_elf_sections</a>)<br><br>George.<br></div></div><span class=""><hr><br>llvm-commits mailing list<br><a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br></span></pre></blockquote></div><span class="HOEnZb"><font color="#888888"><br>
-- <br>
Sent from my Android device with K-9 Mail. Please excuse my brevity.</font></span></div></blockquote></div><br></div>