It is possible to craft a .hash section that triggers an infinite loop
in llvm-readelf code. This patch fixes the issue and introduces
a warning.
Details
Diff Detail
Event Timeline
test/tools/llvm-readobj/elf-hash-symbols.test | ||
---|---|---|
365 | an entry of the bucket array points to a cycle | |
391 | Suggested wording: llvm-readelf will read the hash table from the file offset p_offset + (p_vaddr - DT_HASH) = p_offset + (0 - 0) = p_offset, which is the start of PT_LOAD, i.e. the file offset of .hash |
test/tools/llvm-readobj/elf-hash-symbols.test | ||
---|---|---|
365 | Also "when a hash table" or similar. I think combining the two suggests: "Show that we report a warning for a hash table which contains an entry of the bucket array pointing to a cycle." | |
tools/llvm-readobj/ELFDumper.cpp | ||
3446 | Perhaps worth giving more context to this message, i.e. something about a cycle being detected linking which buckets. |
LGTM, with one nit.
test/tools/llvm-readobj/elf-hash-symbols.test | ||
---|---|---|
393 | Nit: missing trailing full stop. |
an entry of the bucket array points to a cycle