HomePhabricator

[llvm-readobj] Fix bugs with unrecognized types in switch statements

Description

[llvm-readobj] Fix bugs with unrecognized types in switch statements

Summary:
Add missing breaks. Several functions used nested switch statements,
where the outer switch branches based on the architecture, and the inner
switch handles architecture-specific types. If the type isn't
architecture-specific, break out to the generic types rather than fall
through.

getElfPtType: For GNU-style output, llvm-readobj prints
"<unknown>: 0xnnnnnnnn" for an unrecognized segment type, unless the
architecture is EM_ARM, EM_MIPS, or EM_MIPS_RS3_LE, in which case it
prints "". This behavior appears accidental, so instead, always print
the "<unknown>: 0xnnnnnnnn" string.

Reviewers: pcc, grimar

Reviewed By: grimar

Subscribers: sdardis, javed.absar, arichardson, kristof.beyls, atanasyan, llvm-commits

Differential Revision: https://reviews.llvm.org/D53730

Details

Committed
rprichardOct 26 2018, 4:01 PM
Reviewer
grimar
Differential Revision
D53730: [llvm-readobj] Fix bugs with unrecognized types in switch statements
Parents
rL345435: Fix and rename broken test for `settings write`.
Branches
Unknown
Tags
Unknown