Fixes https://bugs.llvm.org/show_bug.cgi?id=42622.
(--hash-symbols switch is currently broken for 64-bit ELF files, due to r352630.)
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
test/tools/llvm-readobj/elf-hash-symbols.test | ||
---|---|---|
78 ↗ | (On Diff #210049) | I don't think it's the x86_64 bit that's important, if I'm not mistaken, merely the 64-bit nature of the ELF, so perhaps simplify the above i386 naming to simply "32" and this x86_64 to simply "64". |
120 ↗ | (On Diff #210049) | Why is this 0x2be, rather than 0x0 like in the 32-bit case? Worth a comment saying what "0x2b8" (and "0x2e4" below) represent. |
test/tools/llvm-readobj/elf-hash-symbols.test | ||
---|---|---|
120 ↗ | (On Diff #210049) | In this case I set Offset to 0 for PT_LOAD. And so 0x2b8 and 0x2e4 are the offsets of the hash sections:
In 32-bit case I did not set Offset, so it was not 0. I do not mind expanding the comment. |
test/tools/llvm-readobj/elf-hash-symbols.test | ||
---|---|---|
120 ↗ | (On Diff #210049) | I think I'd prefer the Offset to not be explicitly set, i.e. the 32-bit approach. By the way, the comment is slightly misleading, because the dynamic tag value is the address, not the offset, so really it should be referencing the program header's p_vaddr field. |
test/tools/llvm-readobj/elf-hash-symbols.test | ||
---|---|---|
120 ↗ | (On Diff #210049) | It is a bit more complex actually. Both are used to read the hash sections data: uint64_t Delta = VAddr - Phdr.p_vaddr; if (Delta >= Phdr.p_filesz) return createError("virtual address is not in any segment: 0x" + Twine::utohexstr(VAddr)); return base() + Phdr.p_offset + Delta; But program header's p_vaddr is null here, so I mentioned only p_offset field. |
test/tools/llvm-readobj/elf-hash-symbols.test | ||
---|---|---|
228 ↗ | (On Diff #210534) | I don't think you need 64-bit versions of the "ONLY-HASH/ONLY-GNUHASH" cases, as long as there's one for the main case. |
- Addressed review comments.
test/tools/llvm-readobj/elf-hash-symbols.test | ||
---|---|---|
228 ↗ | (On Diff #210534) | Removed. |