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
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
test/tools/llvm-readobj/elf-hash-symbols.test | ||
---|---|---|
365 ↗ | (On Diff #221941) | an entry of the bucket array points to a cycle |
391 ↗ | (On Diff #221941) | 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 ↗ | (On Diff #221941) | 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 ↗ | (On Diff #221941) | Perhaps worth giving more context to this message, i.e. something about a cycle being detected linking which buckets. |
Comment Actions
LGTM, with one nit.
test/tools/llvm-readobj/elf-hash-symbols.test | ||
---|---|---|
393 ↗ | (On Diff #222589) | Nit: missing trailing full stop. |