If dynamic table is missing, output "dynamic strtab not found'. If the index is
out of range, output "Invalid Offset<..>".
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
I already gave this an LGTM offline, and that still applies. Somebody else should give this a quick look through though too.
As you've got D63115 in flight which fixes the FIXME in the test, maybe it would be better holding off committing this until that lands, and then you can avoid having the FIXME at all. What do you think?
Few comments are below. James, what do you think?
llvm/test/tools/llvm-readobj/elf-dynamic-malformed.test | ||
---|---|---|
157 ↗ | (On Diff #203863) | <not found> is inconsistent with library name not found below. |
llvm/tools/llvm-readobj/ELFDumper.cpp | ||
1779 ↗ | (On Diff #203863) | It is a bit inconsistent. I would also probably rewrite to "String table is empty or was not found" or something like that. |
llvm/test/tools/llvm-readobj/elf-dynamic-malformed.test | ||
---|---|---|
162 ↗ | (On Diff #203863) | Perhaps it should use different forms too? Shared library: [valid_library_name.so] |
llvm/test/tools/llvm-readobj/elf-dynamic-malformed.test | ||
---|---|---|
157 ↗ | (On Diff #203863) | As we might change the below output based on GNU, let's make it consistent with that style, if it makes sense. If GNU doesn't print with any markers, then I'm happy with either style, but consistency would be good. |
162 ↗ | (On Diff #203863) | What does GNU's output look like? If it produces an inline message here, we should probably mirror that, thinking about it. |
- Match GNU output for DT_RPATH and DT_RUNPATH.
- All diagnose messages enclosed with <>.
- Test updated accordingly.
My instinct is to say that the RPATH change should be a separate change, since it's not just about the improved error/warning. Please could you split it off (we still want it, just not in a commit to do with error messages). LGTM, aside from that.
llvm/tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
1998 ↗ | (On Diff #204158) | I think not found is not entirely accurate. The issue is that the index into the string table is invalid (out of range). Do other reviewers have suggestion for the message used here? |
llvm/tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
1998 ↗ | (On Diff #204158) | You're probably right. It should probably be something like <library name index out of range> or <library name index invalid> like you suggest. |
Address reviewer's comments.
- capitalize first char of diagnose strings.
- split out DT_RPATH & DT_RUNPATH code.
Looks good, with the suggested changes to the if statements.
llvm/tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
1794 ↗ | (On Diff #204335) | LLVM standard has the body of an if on a new line, I believe, i.e. if (WithBracket) OS << "["; |
1796 ↗ | (On Diff #204335) | Ditto |
1942 ↗ | (On Diff #204158) | Tip: you can mark individual comments as "Done" by clicking the "Done" button in the comment box header. I find it quite useful when reviewing code if that has been done. |
Yes, I agree with that, although it's debatable as to whether these are the same, since they aren't independent error messages printed on stderr, so the guidelines might not be the same. I don't really know though!
Thank you @jhenderson @MaskRay. If this looks good, could you commit it for me?
llvm/tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
1942 ↗ | (On Diff #204158) | Oh, that's much better. |