[llvm-readelf] Support dumping the BB address map section with --bb-addr-map.
authorRahman Lavaee <rahmanl@google.com>
Tue, 9 Mar 2021 00:02:00 +0000 (16:02 -0800)
committerRahman Lavaee <rahmanl@google.com>
Tue, 9 Mar 2021 00:20:11 +0000 (16:20 -0800)
commitc245c21c436b5d29da62a7c416f08f8631f5df95
tree8c306350a91b578e6bffe7d47663d45c47485e61
parente08f278f5b5aa506f3f4ff46fff51a1e8336a6e1
[llvm-readelf] Support dumping the BB address map section with --bb-addr-map.

This patch lets llvm-readelf dump the content of the BB address map
section in the following format:
```
Function {
  At: <address>
  BB entries [
    {
      Offset:   <offset>
      Size:     <size>
      Metadata: <metadata>
    },
    ...
  ]
}
...
```

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D95511
llvm/docs/CommandGuide/llvm-readelf.rst
llvm/docs/CommandGuide/llvm-readobj.rst
llvm/include/llvm/Object/ELF.h
llvm/include/llvm/Object/ELFTypes.h
llvm/include/llvm/ObjectYAML/ELFYAML.h
llvm/lib/Object/ELF.cpp
llvm/test/tools/llvm-readobj/ELF/bb-addr-map.test [new file with mode: 0644]
llvm/tools/llvm-readobj/ELFDumper.cpp
llvm/tools/llvm-readobj/ObjDumper.h
llvm/tools/llvm-readobj/llvm-readobj.cpp
llvm/unittests/Object/ELFObjectFileTest.cpp