Currently, llvm-readobj mistakenly decodes section type as section attribute.
This patch fixes the bug and affected tests.
Differential D66075
[llvm-readobj][MachO] Fix section type printing seiya on Aug 12 2019, 1:59 AM. Authored by
Details Currently, llvm-readobj mistakenly decodes section type as section attribute. This patch fixes the bug and affected tests.
Diff Detail
Event TimelineComment Actions The change looks fine to me, although I wasn't able to quickly find the list of section types anywhere to check against. Could you provide me some documentation? Also, are there test cases for each of the different permitted types? Comment Actions This was already committed to LLVM years ago in rL178679 (+echristo, the committer), but mistakenly removed in rL235863 due to being an unused variable, instead of the right fix, which is clearly the Attributes->Types typo fixed here Still, I can't find a reference for the original list, it would be good to cite one.
+1, would be nice to have a test in llvm-readobj that enumerates all section types in a yaml2obj case (otherwise, LGTM) Comment Actions The list looks about right from what I recall - we should get a link to where they're documented, but the Apple documentation site moves a bit more than I'd like so this might be the best we can do for now. Comment Actions Thank you for pointing out the related commits, @rupprecht! A list of section types in mach-o/loader.h (in Apple's binary utilities) or llvm/Binary/Format/MachO.h might be helpful.
It looks few of them are not used in these tests. I'll add a new testcase. Comment Actions Add llvm/test/tools/llvm-readobj/macho-sections.test, which exhaustively tests all section types.
Comment Actions
|