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 | ||
|---|---|---|
| 61 | attemp -> attempt | |
| 68 | 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? | |
| 85 | Same comments for this case as above (both comments and check). | |
| llvm/tools/llvm-readobj/ELFDumper.cpp | ||
| 6042 | found, the -> found. The | |
| llvm/tools/llvm-readobj/ELFDumper.cpp | ||
|---|---|---|
| 6025 | 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 | ||
|---|---|---|
| 68 | 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 | ||
| 6025 | Right. I've changed all the logic here to continue dumping sections even after reporting an error. | |
| 6031 | Yes. | |
'"c' -> "c"?