mirror of
https://github.com/morluto/rea.git
synced 2026-11-29 01:46:39 +00:00
* fix(elf): read eight-byte DT_HASH entries on 64-bit s390x and Alpha On ELF64 s390x and Alpha every SysV hash entry (nbucket, nchain, buckets and chains) is eight bytes wide; binutils readelf and glibc read them that way and ld writes .hash with sh_entsize 8. The shared DT_HASH walker always read 32-bit words, so on a big-endian s390x table it took the high half of nbucket as the bucket count and the low half as nchain. On Debian wheezy's s390x libz.so.1.2.7 (nbucket 97, nchain 105) this made inspect-elf-dependencies report a false ".dynsym section declares 105 symbols, past the DT_HASH dynamic symbol count of 97" issue with partial coverage, and inspect-native-exports refuse the same library without section headers because DT_HASH (97) and DT_GNU_HASH (105) disagreed. The walker now takes the entry layout from e_machine, the ELF class and the byte order, and the dependency parser and both PT_DYNAMIC export paths pass it. * test(elf): cover eight-byte DT_HASH reads from a file handle The s390x and Alpha .hash fixture now declares sh_entsize 8 to match the entries it writes, and the sectionless export cases also run through parseNativeExportsFromHandle, including a wide header that crosses the end of its load mapping. --------- Co-authored-by: gensokyo-dev <gensokyo-dev@users.noreply.github.com>