getElfSegmentType and getElfPtType are methods that are used for printing
segment types for LLVM and GNU styles accordingly.
This patch does a cleanup and simplification that allows to avoid
the code duplication and to get rid of one macro.
Paths
| Differential D85830
[llvm-readobj/elf] - Cleanup helpers that are used to print segment types. NFCI. ClosedPublic Authored by grimar on Aug 12 2020, 5:06 AM.
Details Summary getElfSegmentType and getElfPtType are methods that are used for printing This patch does a cleanup and simplification that allows to avoid
Diff Detail
Event TimelineComment Actions
Comment Actions
"get rid of one macro" LGTM, since we're not making the behaviour worse, but it would be nice to add support for the PT_OPENBSD versions in GNU mode too, unless there's a compelling reason not to. That can be a separate change though.
This revision is now accepted and ready to land.Aug 13 2020, 1:26 AM
Closed by commit rG02e2bd8c4b93: [llvm-readobj/elf] - Cleanup helpers that are used to print segment types. NFCI. (authored by grimar). · Explain WhyAug 13 2020, 4:07 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 285327 llvm/tools/llvm-readobj/ELFDumper.cpp
|
I'm curious what others here think, but I don't think we need to emulate GNU's behaviour where they simply don't recognise a specific PT_* value (unless it clashes with another value). It seems to me like the better thing to do would be to ask GNU to add support for it in binutils.