[lld] r298934 - Do not set entsize for .gnu.hash.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 08:27:37 PDT 2017


>.gnu.hash happen to contain only 32-bit integers for 32-bit arch,
>but the section contents are not uniform array members, so setting
>entsize doesn't make much sense. This behavior seems to have been
>blindly copied from GNU linkers.

I do not thing it was blindly copied, it was explicitly mentioned in oracle blog that:

"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."
(https://blogs.oracle.com/ali/entry/gnu_hash_elf_sections)

George.


More information about the llvm-commits mailing list