I've added a few tests that shows how the current code could overrun the section data
buffer while dumping. I had to rewrite the code to fix this.
Main problem was that the current code assumed that the section data is correct.
But when it is not - it failed.
Details
Diff Detail
Event Timeline
llvm/test/tools/llvm-readobj/elf-linker-options.test | ||
---|---|---|
32 | attemp -> attempt | |
39 | Should we make these INCOMPLETE-NEXT to show that nothing is printed for the entry? In that case, what do you think about adding a valid pair before to show that earlier valid entries are (not) printed? | |
56 | Same comments for this case as above (both comments and check). | |
llvm/tools/llvm-readobj/ELFDumper.cpp | ||
6038 | found, the -> found. The |
llvm/tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
6023 | Should this be continue? |
Thanks for all the comments. I am going to be off until the next week, so will update this patch after 18th of november.
- Addressed review comments and reimplemented.
llvm/test/tools/llvm-readobj/elf-linker-options.test | ||
---|---|---|
39 | Yeah, I had to significantly change the structure here. Using returns in the code was not correct I think, | |
llvm/tools/llvm-readobj/ELFDumper.cpp | ||
6023 | Right. I've changed all the logic here to continue dumping sections even after reporting an error. | |
6029 | Yes. |
'"c' -> "c"?