History log of /llvm-project/llvm/tools/llvm-readobj/llvm-readobj.cpp (Results 51 – 75 of 258)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3
# a5154ab9 28-Jan-2021 Georgii Rymar <grimar@accesssoftek.com>

[llvm-readobj/elf] - Report "bitcode files are not supported" warning for bitcode files.

Fixes https://bugs.llvm.org/show_bug.cgi?id=43543

Currently we report "The file was not recognized as a vali

[llvm-readobj/elf] - Report "bitcode files are not supported" warning for bitcode files.

Fixes https://bugs.llvm.org/show_bug.cgi?id=43543

Currently we report "The file was not recognized as a valid object file" for BC files.
Also, we terminate dumping.

Instead we could report a better warning and try to continue dumping other files.
This is what this patch implements.

Differential revision: https://reviews.llvm.org/D95605

show more ...


Revision tags: llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1
# 99a6401a 09-Nov-2020 Georgii Rymar <grimar@accesssoftek.com>

Recommit: [llvm-readelf/obj] - Allow dumping of ELF header even if some elements are corrupt.

This is recommit for D90903 with fixes for BB:
1) Used std::move<> when returning Expected<> (http://lab

Recommit: [llvm-readelf/obj] - Allow dumping of ELF header even if some elements are corrupt.

This is recommit for D90903 with fixes for BB:
1) Used std::move<> when returning Expected<> (http://lab.llvm.org:8011/#/builders/112/builds/913)
2) Fixed the name of temporarily file in the file-headers.test (http://lab.llvm.org:8011/#/builders/36/builds/1269)
(a local old temporarily file was used before)

For creating `ELFObjectFile` instances we have the factory method
`ELFObjectFile<ELFT>::create(MemoryBufferRef Object)`.

The problem of this method is that it scans the section header to locate some sections.
When a file is truncated or has broken fields in the ELF header, this approach does
not allow us to create the `ELFObjectFile` and dump the ELF header.

This is https://bugs.llvm.org/show_bug.cgi?id=40804

This patch suggests a solution - it allows to delay scaning sections in the
`ELFObjectFile<ELFT>::create`. It now allows user code to call an object
initialization (`initContent()`) later. With that it is possible,
for example, for dumpers just to dump the file header and exit.
By default initialization is still performed as before, what helps to keep
the logic of existent callers untouched.

I've experimented with different approaches when worked on this patch.
I think this approach is better than doing initialization of sections (i.e. scan of them)
on demand, because normally users of `ELFObjectFile` API expect to work with a valid object.
In most cases when a section header table can't be read (because of an error), we don't
have to continue to work with object. So we probably don't need to implement a more complex API.

Differential revision: https://reviews.llvm.org/D90903

show more ...


# f59216b5 09-Nov-2020 Georgii Rymar <grimar@accesssoftek.com>

Revert "[llvm-readelf/obj] - Allow dumping of ELF header even if some elements are corrupt."

This reverts commit ea8a0b8b29eb08d3f0f6ac40942a2d8e98ab57ee.

It broke BBots.
http://lab.llvm.org:8011/#

Revert "[llvm-readelf/obj] - Allow dumping of ELF header even if some elements are corrupt."

This reverts commit ea8a0b8b29eb08d3f0f6ac40942a2d8e98ab57ee.

It broke BBots.
http://lab.llvm.org:8011/#/builders/14/builds/1439
http://lab.llvm.org:8011/#/builders/112/builds/913

show more ...


# ea8a0b8b 03-Nov-2020 Georgii Rymar <grimar@accesssoftek.com>

[llvm-readelf/obj] - Allow dumping of ELF header even if some elements are corrupt.

For creating `ELFObjectFile` instances we have the factory method
`ELFObjectFile<ELFT>::create(MemoryBufferRef Obj

[llvm-readelf/obj] - Allow dumping of ELF header even if some elements are corrupt.

For creating `ELFObjectFile` instances we have the factory method
`ELFObjectFile<ELFT>::create(MemoryBufferRef Object)`.

The problem of this method is that it scans the section header to locate some sections.
When a file is truncated or has broken fields in the ELF header, this approach does
not allow us to create the `ELFObjectFile` and dump the ELF header.

This is https://bugs.llvm.org/show_bug.cgi?id=40804

This patch suggests a solution - it allows to delay scaning sections in the
`ELFObjectFile<ELFT>::create`. It now allows user code to call an object
initialization (`initContent()`) later. With that it is possible,
for example, for dumpers just to dump the file header and exit.
By default initialization is still performed as before, what helps to keep
the logic of existent callers untouched.

I've experimented with different approaches when worked on this patch.
I think this approach is better than doing initialization of sections (i.e. scan of them)
on demand, because normally users of `ELFObjectFile` API expect to work with a valid object.
In most cases when a section header table can't be read (because of an error), we don't
have to continue to work with object. So we probably don't need to implement a more complex API.

Differential revision: https://reviews.llvm.org/D90903

show more ...


# f855a553 13-Oct-2020 Georgii Rymar <grimar@accesssoftek.com>

[llvm-readelf] - Implement --section-details option.

--section-details/-t is a GNU readelf option that produce
an output that is an alternative to --sections.

Differential revision: https://reviews

[llvm-readelf] - Implement --section-details option.

--section-details/-t is a GNU readelf option that produce
an output that is an alternative to --sections.

Differential revision: https://reviews.llvm.org/D89304

show more ...


# 568035ac 08-Oct-2020 Luqman Aden <me@luqman.ca>

[llvm-readobj] Add --coff-tls-directory flag to print TLS Directory & test.

Akin to dumpbin's /TLS option, this will print out the TLS directory, if
present, in the image.

Example output:
```
> llv

[llvm-readobj] Add --coff-tls-directory flag to print TLS Directory & test.

Akin to dumpbin's /TLS option, this will print out the TLS directory, if
present, in the image.

Example output:
```
> llvm-readobj --coff-tls-directory test.exe
File: test.exe
Format: COFF-x86-64
Arch: x86_64
AddressSize: 64bit
TLSDirectory {
StartAddressOfRawData: 0x140004000
EndAddressOfRawData: 0x140004040
AddressOfIndex: 0x140002000
AddressOfCallBacks: 0x0
SizeOfZeroFill: 0x0
Characteristics [ (0x0)
]
}
```

Reviewed By: jhenderson, grimar

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

show more ...


Revision tags: llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3
# 310af42e 19-Sep-2020 Georgii Rymar <grimar@accesssoftek.com>

[llvm-readelf/obj] - Cleanup the code. NFCI.

This:
1) Replaces pointers with references in many places.
2) Adds few TODOs about fixing possible unhandled errors (in ARMEHABIPrinter.h).
3) Replaces `

[llvm-readelf/obj] - Cleanup the code. NFCI.

This:
1) Replaces pointers with references in many places.
2) Adds few TODOs about fixing possible unhandled errors (in ARMEHABIPrinter.h).
3) Replaces `auto`s with actual types.
4) Removes excessive arguments.
5) Adds `const ELFFile<ELFT> &Obj;` member to `ELFDumper` to simplify the code.

Differential revision: https://reviews.llvm.org/D88097

show more ...


# 3d90a61c 28-Aug-2020 Georgii Rymar <grimar@accesssoftek.com>

[llvm-readobj] - Remove Error.cpp,.h and drop dependencies in the code.

We have Error.cpp/.h which contains some code for working with error codes.
In fact we use Error/Expected<> almost everywhere

[llvm-readobj] - Remove Error.cpp,.h and drop dependencies in the code.

We have Error.cpp/.h which contains some code for working with error codes.
In fact we use Error/Expected<> almost everywhere already and we can get rid
of these files.

Note: a few places in the code used readobj specific error codes,
e.g. `return readobj_error::unknown_symbol`. But these codes are never really used,
i.e. the code checks the fact of a success/error call only.
So I've changes them to `return inconvertibleErrorCode()` for now.
It seems that these places probably should be converted to use `Error`/`Expected<>`.

Differential revision: https://reviews.llvm.org/D86772

show more ...


# 506f89ce 28-Aug-2020 Georgii Rymar <grimar@accesssoftek.com>

[llvm-readobj/elf] - Don't fail when dumping an archive with a member that can't be recognized.

Imagine we have an archive that has 3 objects in the following order:
<valid known object>,<unknown ob

[llvm-readobj/elf] - Don't fail when dumping an archive with a member that can't be recognized.

Imagine we have an archive that has 3 objects in the following order:
<valid known object>,<unknown object> and <valid known object>.

Currently llvm-readelf/obj report an error and stops dumping in the middle.
This patch changes the error reported to warning.

Differential revision: https://reviews.llvm.org/D86771

show more ...


# 3fe01f0e 27-Aug-2020 Georgii Rymar <grimar@accesssoftek.com>

[llvm-readobj] - Simplify the code that creates dumpers. NFCI.

We have a few helper functions like the following:
```
std::error_code create*Dumper(...)
```

In fact we do not need or want to use `s

[llvm-readobj] - Simplify the code that creates dumpers. NFCI.

We have a few helper functions like the following:
```
std::error_code create*Dumper(...)
```

In fact we do not need or want to use `std::error_code` and the code
can be simpler if we just return `std::unique_ptr<ObjDumper>`.

This patch does this change and refines the signature of `createDumper`
as well.

Differential revision: https://reviews.llvm.org/D86718

show more ...


Revision tags: llvmorg-11.0.0-rc2
# 936ba7ee 12-Aug-2020 Georgii Rymar <grimar@accesssoftek.com>

[llvm-readobj/elf][test] - Refine --headers testing and the related code comment.

Specifying --headers is equivalent to setting --file-headers,
--program-headers and --section-headers at the same ti

[llvm-readobj/elf][test] - Refine --headers testing and the related code comment.

Specifying --headers is equivalent to setting --file-headers,
--program-headers and --section-headers at the same time.

The existent test case uses a precompiled object and doesn't test the
output properly. This patch fixes it.

Differential revision: https://reviews.llvm.org/D85832

show more ...


Revision tags: llvmorg-11.0.0-rc1
# eee7cc95 25-Jul-2020 Yuanfang Chen <yuanfang.chen@sony.com>

[llvm-readobj] NFC. Add -help description of --hex-dump and
--string-dump


# df952cb9 20-Jul-2020 Elvina Yakubova <elvina.yakubova@huawei.com>

[llvm-readobj] Print error when executed with no input files

This patch changes llvm-readelf (and llvm-readobj for consistency)
behavior to print an error when executed with no input files.

Reading

[llvm-readobj] Print error when executed with no input files

This patch changes llvm-readelf (and llvm-readobj for consistency)
behavior to print an error when executed with no input files.

Reading from stdin can be achieved via a '-' for the input
object.

Fixes https://bugs.llvm.org/show_bug.cgi?id=46400

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

Reviewed by: jhenderson, MaskRay, sbc, jyknight

show more ...


Revision tags: llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2
# 79d7e9c7 15-Jun-2020 Zequan Wu <zequanwu@google.com>

[llvm-readobj][COFF] add .llvm.call-graph-profile section dump

Summary: Dumping contents of `.llvm.call-graph-profile` section of COFF in the same format as ELF.

Reviewers: jhenderson, MaskRay, han

[llvm-readobj][COFF] add .llvm.call-graph-profile section dump

Summary: Dumping contents of `.llvm.call-graph-profile` section of COFF in the same format as ELF.

Reviewers: jhenderson, MaskRay, hans

Reviewed By: jhenderson

Subscribers: grimar, rupprecht, llvm-commits

Tags: #llvm

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

show more ...


# bbf89644 15-Jun-2020 Zequan Wu <zequanwu@google.com>

[llvm-readobj] set --elf-cg-profile as alias of --cg-profile

Summary: Rename --elf-cg-profile to --cg-profile and keep --elf-cg-profile as an alias of --cg-profile.

Reviewers: jhenderson, MaskRay,

[llvm-readobj] set --elf-cg-profile as alias of --cg-profile

Summary: Rename --elf-cg-profile to --cg-profile and keep --elf-cg-profile as an alias of --cg-profile.

Reviewers: jhenderson, MaskRay, espindola, hans

Reviewed By: jhenderson, MaskRay

Subscribers: emaste, rupprecht, llvm-commits

Tags: #llvm

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

show more ...


# d804b334 26-May-2020 Georgii Rymar <grimar@accesssoftek.com>

[llvm-readelf] - Split GNUStyle<ELFT>::printHashHistogram. NFC.

As was mentioned in review comments for D80204,
`printHashHistogram` has 2 lambdas that are probably too large
and deserves splitting

[llvm-readelf] - Split GNUStyle<ELFT>::printHashHistogram. NFC.

As was mentioned in review comments for D80204,
`printHashHistogram` has 2 lambdas that are probably too large
and deserves splitting into member functions.

This patch does it.

Differential revision: https://reviews.llvm.org/D80546

show more ...


Revision tags: llvmorg-10.0.1-rc1
# 56970ec6 13-May-2020 Georgii Rymar <grimar@accesssoftek.com>

[llvm-readobj] - --gnu-hash-table: do not crash when the GNU hash table goes past the EOF.

We might have a scenario where a the `GbuHashTable` variable correctly points
to a place inside the file (w

[llvm-readobj] - --gnu-hash-table: do not crash when the GNU hash table goes past the EOF.

We might have a scenario where a the `GbuHashTable` variable correctly points
to a place inside the file (we validate this fact early in `parseDynamicTable`),
but nbuckets/maskwords fields are broken in the way the code tries
to read the data past the EOF. This patch fixes the issue.

Differential revision: https://reviews.llvm.org/D79853

show more ...


Revision tags: llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3
# 9e1319df 04-Mar-2020 Fangrui Song <maskray@google.com>

[llvm-readelf] Make --all output order closer to GNU readelf

https://bugs.llvm.org/show_bug.cgi?id=43403

The new order makes it easy to compare the two tools' --all.

Reviewed By: grimar, rupprecht

[llvm-readelf] Make --all output order closer to GNU readelf

https://bugs.llvm.org/show_bug.cgi?id=43403

The new order makes it easy to compare the two tools' --all.

Reviewed By: grimar, rupprecht

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

show more ...


Revision tags: llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1
# adcd0268 28-Jan-2020 Benjamin Kramer <benny.kra@googlemail.com>

Make llvm::StringRef to std::string conversions explicit.

This is how it should've been and brings it more in line with
std::string_view. There should be no functional change here.

This is mostly m

Make llvm::StringRef to std::string conversions explicit.

This is how it should've been and brings it more in line with
std::string_view. There should be no functional change here.

This is mostly mechanical from a custom clang-tidy check, with a lot of
manual fixups. It uncovers a lot of minor inefficiencies.

This doesn't actually modify StringRef yet, I'll do that in a follow-up.

show more ...


Revision tags: llvmorg-11-init, llvmorg-9.0.1, llvmorg-9.0.1-rc3
# 9a5c8499 10-Dec-2019 Georgii Rymar <grimar@accesssoftek.com>

[llvm-readobj][llvm-readelf] - Remove excessive empty lines when reporting errors and warnings.

After recent changes it is now seems possible to get rid of
printing '\n' before each error and warnin

[llvm-readobj][llvm-readelf] - Remove excessive empty lines when reporting errors and warnings.

After recent changes it is now seems possible to get rid of
printing '\n' before each error and warning. This makes the output
cleaner.

Differential revision: https://reviews.llvm.org/D71246

show more ...


Revision tags: llvmorg-9.0.1-rc2
# cd2c409c 25-Nov-2019 Georgii Rymar <grimar@accesssoftek.com>

[llvm-readobj] - Implement --dependent-libraries flag.

There is no way to dump SHT_LLVM_DEPENDENT_LIBRARIES sections
currently. This patch implements this.

The section is described here:
https://ll

[llvm-readobj] - Implement --dependent-libraries flag.

There is no way to dump SHT_LLVM_DEPENDENT_LIBRARIES sections
currently. This patch implements this.

The section is described here:
https://llvm.org/docs/Extensions.html#sht-llvm-dependent-libraries-section-dependent-libraries

Differential revision: https://reviews.llvm.org/D70665

show more ...


Revision tags: llvmorg-9.0.1-rc1
# 5ce8c391 07-Oct-2019 George Rimar <grimar@accesssoftek.com>

[llvm-readelf/llvm-objdump] - Improve/refactor the implementation of SHT_LLVM_ADDRSIG section dumping.

This patch:

* Adds a llvm-readobj/llvm-readelf test file for SHT_LLVM_ADDRSIG sections. (we do

[llvm-readelf/llvm-objdump] - Improve/refactor the implementation of SHT_LLVM_ADDRSIG section dumping.

This patch:

* Adds a llvm-readobj/llvm-readelf test file for SHT_LLVM_ADDRSIG sections. (we do not have any)
* Enables dumping of SHT_LLVM_ADDRSIG with --all.
* Changes the logic to report a warning instead of an error when something goes wrong during dumping
(allows to continue dumping SHT_LLVM_ADDRSIG and other sections on error).
* Refactors a piece of logic to a new toULEB128Array helper which might be used for GNU-style
dumping implementation.

Differential revision: https://reviews.llvm.org/D68383

llvm-svn: 373890

show more ...


# 57e764f9 04-Oct-2019 Simon Atanasyan <simon@atanasyan.com>

[llvm-readobj] Replace arch-specific ObjDumper methods by the single `printArchSpecificInfo`

Initially llvm-readobj supports multiple command line options like
`--arm-attributes` and `--mips-plt-got

[llvm-readobj] Replace arch-specific ObjDumper methods by the single `printArchSpecificInfo`

Initially llvm-readobj supports multiple command line options like
`--arm-attributes` and `--mips-plt-got` for display ELF arch-specific
information. Now all these options are superseded by the
`--arch-specific` one. It makes sense to have a single `printArchSpecificInfo`
method in the base `ObjDumper`, and hide all ELF/target specific details
in the `ELFDumper::printArchSpecificInfo` override.

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

llvm-svn: 373731

show more ...


# bf333421 03-Oct-2019 Simon Atanasyan <simon@atanasyan.com>

[llvm-readobj][mips] Remove non-standard --misp-xxx flags

llvm-readobj "non-standard" flags `--mips-plt-got`, `--mips-abi-flags`,
`--mips-reginfo`, and `--mips-options` are superseded by the `--arch

[llvm-readobj][mips] Remove non-standard --misp-xxx flags

llvm-readobj "non-standard" flags `--mips-plt-got`, `--mips-abi-flags`,
`--mips-reginfo`, and `--mips-options` are superseded by the `--arch-specific`
flag and can be removed now.

llvm-svn: 373590

show more ...


# 952d71b7 03-Oct-2019 Simon Atanasyan <simon@atanasyan.com>

[llvm-readobj][mips] Display MIPS specific info under --arch-specific flag

Old options `--mips-plt-got`, `--mips-abi-flags`, '--mips-reginfo`,
and `--mips-options` wiil be deleted in a separate patc

[llvm-readobj][mips] Display MIPS specific info under --arch-specific flag

Old options `--mips-plt-got`, `--mips-abi-flags`, '--mips-reginfo`,
and `--mips-options` wiil be deleted in a separate patch.

llvm-svn: 373588

show more ...


1234567891011