History log of /llvm-project/llvm/tools/llvm-readobj/llvm-readobj.cpp (Results 76 – 100 of 258)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 2d92c884 01-Oct-2019 Fangrui Song <maskray@google.com>

[llvm-readobj/llvm-readelf] Delete --arm-attributes (alias for --arch-specific)

D68110 added --arch-specific (supported by GNU readelf) and made
--arm-attributes an alias for it. The tests were late

[llvm-readobj/llvm-readelf] Delete --arm-attributes (alias for --arch-specific)

D68110 added --arch-specific (supported by GNU readelf) and made
--arm-attributes an alias for it. The tests were later migrated to use
--arch-specific.

Note, llvm-readelf --arch-specific currently just uses llvm-readobj
style output for ARM attributes. The readelf-style output is not
implemented.

Reviewed By: compnerd, kongyi, rupprecht

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

llvm-svn: 373291

show more ...


# 121ef04f 27-Sep-2019 Yi Kong <yikong@google.com>

[llvm-readobj] Rename --arm-attributes to --arch-specific

This is for compatibility with GNU readobj. --arm-attributes option is
left as a hidden alias due to large number of tests using it.

Differ

[llvm-readobj] Rename --arm-attributes to --arch-specific

This is for compatibility with GNU readobj. --arm-attributes option is
left as a hidden alias due to large number of tests using it.

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

llvm-svn: 373125

show more ...


# 4e0faa33 23-Sep-2019 George Rimar <grimar@accesssoftek.com>

[llvm-readobj] - Implement LLVM-style dumping for .stack_sizes sections.

D65313 implemented GNU-style dumping (llvm-readelf).
This one implements LLVM-style dumping (llvm-readobj).

Differential rev

[llvm-readobj] - Implement LLVM-style dumping for .stack_sizes sections.

D65313 implemented GNU-style dumping (llvm-readelf).
This one implements LLVM-style dumping (llvm-readobj).

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

llvm-svn: 372576

show more ...


Revision tags: llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3
# e54d3715 22-Aug-2019 George Rimar <grimar@accesssoftek.com>

[llvm-readobj] - Remove `reportError(std::error_code EC, StringRef Input)` helper.

We do not need it, std::error_code is used mostly for COFF and
this patch rewrites the calls to use a different ove

[llvm-readobj] - Remove `reportError(std::error_code EC, StringRef Input)` helper.

We do not need it, std::error_code is used mostly for COFF and
this patch rewrites the calls to use a different overload.

Having reportError(std::error_code EC, ... is excessive by itself,
because API that use error codes actually needs refactoring to
use Error/Expected<> instead.

DIfferential revision: https://reviews.llvm.org/D66521

llvm-svn: 369630

show more ...


# f1337028 20-Aug-2019 Fangrui Song <maskray@google.com>

[llvm-readobj] Prepend argv[0] to error/warning messages

Summary:
Currently, we report:

error: ...

Prepend argv[0] (tool name):

llvm-readobj: error: ...

This is consistent with most GNU

[llvm-readobj] Prepend argv[0] to error/warning messages

Summary:
Currently, we report:

error: ...

Prepend argv[0] (tool name):

llvm-readobj: error: ...

This is consistent with most GNU binutils/clang/lld, and gives a bit
more context in a long build log.

Reviewed By: grimar, jhenderson, rupprecht

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

llvm-svn: 369377

show more ...


# e3fb2d54 17-Aug-2019 George Rimar <grimar@accesssoftek.com>

Recommit r369190 "[llvm-readobj/llvm-readelf] - Improve/cleanup the error reporting API."

Fix: Add a `consumeError` call removed by mistake to 'printStackSize',
this should fix the "Expected<T> must

Recommit r369190 "[llvm-readobj/llvm-readelf] - Improve/cleanup the error reporting API."

Fix: Add a `consumeError` call removed by mistake to 'printStackSize',
this should fix the "Expected<T> must be checked before access or destruction." reported by following bot:
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/9743/steps/stage%201%20check/logs/stdio

Original commit message:
Currently we have the following functions for error reporting:

LLVM_ATTRIBUTE_NORETURN void reportError(Twine Msg);
void reportError(Error Err, StringRef Input);
void reportWarning(Twine Msg);
void reportWarning(StringRef Input, Error Err);
void warn(llvm::Error Err);
void error(std::error_code EC);

Problems are: naming is inconsistent, arguments order is inconsistent,
some of the functions looks excessive.

After applying this patch we have:

void reportError(Error Err, StringRef Input);
void reportError(std::error_code EC, StringRef Input);
void reportWarning(Error Err, StringRef Input);

I'd be happy to remove reportError(std::error_code EC, StringRef Input) too, but it
is used by COFF heavily.

Test cases were updated, they show an improvement introduced.

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

llvm-svn: 369194

show more ...


# c35d4c90 17-Aug-2019 George Rimar <grimar@accesssoftek.com>

Revert r369190, r369192 ([llvm-readobj/llvm-readelf] - Improve/cleanup the error reporting API.)

It caused multiple BB failtures:

http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/974

Revert r369190, r369192 ([llvm-readobj/llvm-readelf] - Improve/cleanup the error reporting API.)

It caused multiple BB failtures:

http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/9743/steps/stage%201%20check/logs/stdio
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/26042/steps/ninja%20check%201/logs/FAIL%3A%20LLVM%3A%3Astack-sizes.test

llvm-svn: 369193

show more ...


# e9f28133 17-Aug-2019 George Rimar <grimar@accesssoftek.com>

[llvm-readobj] - An attemp to fix BB after r369191.

Few BB failed with the following error:

Command Output (stderr):
--
/home/buildbots/ppc64be-clang-lnt-test/clang-ppc64be-lnt/llvm/test/tools/llvm

[llvm-readobj] - An attemp to fix BB after r369191.

Few BB failed with the following error:

Command Output (stderr):
--
/home/buildbots/ppc64be-clang-lnt-test/clang-ppc64be-lnt/llvm/test/tools/llvm-readobj/stack-sizes.test:263:19: error: BADSECTION-OUT: expected string not found in input
# BADSECTION-OUT: 8 ?
^
<stdin>:4:1: note: scanning from here

^

It doesn't reproduce on ubuntu/windows I have. Also, seems many of the bots
are happy too.

This slightly reorders the code to make fouts().flush() call earlier,
like it was before the r369191.

llvm-svn: 369192

show more ...


# bb56755f 17-Aug-2019 George Rimar <grimar@accesssoftek.com>

[llvm-readobj/llvm-readelf] - Improve/cleanup the error reporting API.

urrently we have the following functions for error reporting:

--
LLVM_ATTRIBUTE_NORETURN void reportError(Twine Msg);
void rep

[llvm-readobj/llvm-readelf] - Improve/cleanup the error reporting API.

urrently we have the following functions for error reporting:

--
LLVM_ATTRIBUTE_NORETURN void reportError(Twine Msg);
void reportError(Error Err, StringRef Input);
void reportWarning(Twine Msg);
void reportWarning(StringRef Input, Error Err);
void warn(llvm::Error Err);
void error(std::error_code EC);
---

Problems are: naming is inconsistent, arguments order is inconsistent,
some of the functions looks excessive.

After applying this patch we have:

---
LLVM_ATTRIBUTE_NORETURN void reportError(Error Err, StringRef Input);
LLVM_ATTRIBUTE_NORETURN void reportError(std::error_code EC, StringRef Input);
void reportWarning(Error Err, StringRef Input);
---

I'd be happy to remove reportError(std::error_code EC, StringRef Input) too, but it
is used by COFF heavily.

Test cases were updated, they show an improvement introduced.

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

llvm-svn: 369190

show more ...


Revision tags: llvmorg-9.0.0-rc2
# 36f23182 13-Aug-2019 George Rimar <grimar@accesssoftek.com>

[llvm-readobj] - Remove 'error(Error EC)' helper.

We do not need it. I replaced it with
reportError(StringRef Input, Error Err).

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

llvm-svn: 36

[llvm-readobj] - Remove 'error(Error EC)' helper.

We do not need it. I replaced it with
reportError(StringRef Input, Error Err).

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

llvm-svn: 368677

show more ...


# be39e398 09-Aug-2019 James Henderson <jh7370@my.bristol.ac.uk>

[llvm-readelf]Print filename for multiple inputs and fix formatting regression

This patch addresses two closely related bugs:
https://bugs.llvm.org/show_bug.cgi?id=42930 and
https://bugs.llvm.org/sh

[llvm-readelf]Print filename for multiple inputs and fix formatting regression

This patch addresses two closely related bugs:
https://bugs.llvm.org/show_bug.cgi?id=42930 and
https://bugs.llvm.org/show_bug.cgi?id=42931.

GNU readelf prints the file name for every input unless there is only
one input and that input is not an archive. This patch adds the printing
for multiple inputs. A previous change did it for archives, but
introduced a regression with GNU compatibility for single-output
formatting, resulting in a spurious initial blank line. This is fixed in
this patch too.

Reviewed by: grimar, MaskRay

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

llvm-svn: 368435

show more ...


# 67ea32a0 08-Aug-2019 George Rimar <grimar@accesssoftek.com>

[llvm-readobj/libObject] - Introduce a custom warning handler for `ELFFile<ELFT>` methods.

Currently, we have a code duplication in llvm-readobj which was introduced in D63266.
The duplication was i

[llvm-readobj/libObject] - Introduce a custom warning handler for `ELFFile<ELFT>` methods.

Currently, we have a code duplication in llvm-readobj which was introduced in D63266.
The duplication was introduced to allow llvm-readobj to dump the partially
broken object. Methods in ELFFile<ELFT> perform a strict validation of the inputs,
what is itself good, but not for dumper tools, that might want to dump the information,
even if some pieces are broken/unexpected.

This patch introduces a warning handler which can be passed to ELFFile<ELFT> methods
and can allow skipping the non-critical errors when needed/possible.

For demonstration, I removed the duplication from llvm-readobj and implemented a warning using
the new custom warning handler. It also deduplicates the strings printed, making the output less verbose.

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

llvm-svn: 368260

show more ...


# c71c6299 05-Aug-2019 Wolfgang Pieb <Wolfgang.Pieb@sony.com>

[llvm-readelf] Support dumping of stack sizes sections with readelf --stack-sizes

Reviewers: jhenderson, grimar, rupprecht

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

llvm-svn: 367942


Revision tags: llvmorg-9.0.0-rc1, llvmorg-10-init
# a1370877 16-Jul-2019 George Rimar <grimar@accesssoftek.com>

[Object/llvm-readelf/llvm-readobj] - Improve error reporting when e_shstrndx is broken.

When e_shstrndx is broken, it is impossible to get a section name.
In this patch I improved the error message

[Object/llvm-readelf/llvm-readobj] - Improve error reporting when e_shstrndx is broken.

When e_shstrndx is broken, it is impossible to get a section name.
In this patch I improved the error message we show and
added tests for Object and for llvm-readelf/llvm-readobj

Message was changed in two places:
1) llvm-readelf/llvm-readobj previously used a code from Object/ELF.h,
now they have a modified version of it (it has less checks and allows
dumping broken things).
2) Code in Object/ELF.h is still used for generic cases.

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

llvm-svn: 366203

show more ...


# a28dcf69 15-Jul-2019 Yuanfang Chen <yuanfang.chen@sony.com>

[llvm-readelf] Print "File: lib.a(file.o)" info when dumping archive files.

Match GNU readelf.

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

Reviewers: jhenderson, grimar, MaskRay, rupprecht

Review

[llvm-readelf] Print "File: lib.a(file.o)" info when dumping archive files.

Match GNU readelf.

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

Reviewers: jhenderson, grimar, MaskRay, rupprecht

Reviewed by: jhenderson, MaskRay, grimar

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

llvm-svn: 366147

show more ...


# badece02 11-Jul-2019 George Rimar <grimar@accesssoftek.com>

[llvm-readobj/llvm-readelf] - Report a warning instead of a error when dumping a broken dynamic section.

It does not make sence to stop dumping the object if the broken
dynamic section was found. In

[llvm-readobj/llvm-readelf] - Report a warning instead of a error when dumping a broken dynamic section.

It does not make sence to stop dumping the object if the broken
dynamic section was found. In this patch I changed the behavior from
"report an error" to "report a warning". This matches GNU.

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

llvm-svn: 365762

show more ...


Revision tags: llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3
# 9485b265 21-Jun-2019 James Henderson <jh7370@my.bristol.ac.uk>

[binutils] Add response file option to help and docs

Many LLVM-based tools already support response files (i.e. files
containing a list of options, specified with '@'). This change simply
updates th

[binutils] Add response file option to help and docs

Many LLVM-based tools already support response files (i.e. files
containing a list of options, specified with '@'). This change simply
updates the documentation and help text for some of these tools to
include it. I haven't attempted to fix all tools, just a selection that
I am interested in.

I've taken the opportunity to add some tests for --help behaviour, where
they were missing. We could expand these tests, but I don't think that's
within scope of this patch.

This fixes https://bugs.llvm.org/show_bug.cgi?id=42233 and
https://bugs.llvm.org/show_bug.cgi?id=42236.

Reviewed by: grimar, MaskRay, jkorous

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

llvm-svn: 364036

show more ...


# 67742399 18-Jun-2019 Fangrui Song <maskray@google.com>

[llvm-readobj] Allow --hex-dump/--string-dump to dump multiple sections

1) `-x foo` currently dumps one `foo`. This change makes it dump all `foo`.
2) `-x foo -x foo` currently dumps `foo` twice. Th

[llvm-readobj] Allow --hex-dump/--string-dump to dump multiple sections

1) `-x foo` currently dumps one `foo`. This change makes it dump all `foo`.
2) `-x foo -x foo` currently dumps `foo` twice. This change makes it dump `foo` once.
In addition, if foo has section index 9, `-x foo -x 9` dumps `foo` once.
3) Give a warning instead of an error if `foo` does not exist.

The new behaviors match GNU readelf.

Also, print a new line as a separator between two section dumps.
GNU readelf uses two lines, but one seems good enough.

Reviewed By: grimar, jhenderson

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

llvm-svn: 363683

show more ...


# 565f1e22 12-Jun-2019 Jordan Rupprecht <rupprecht@google.com>

[llvm-readobj] Fix output interleaving issue caused by using multiple streams at the same time.

Summary:
Use llvm::fouts() as the default stream for outputing. No new stream
should be constructed to

[llvm-readobj] Fix output interleaving issue caused by using multiple streams at the same time.

Summary:
Use llvm::fouts() as the default stream for outputing. No new stream
should be constructed to output at the same time.

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

Reviewers: jhenderson, grimar, MaskRay, phosek, rupprecht

Reviewed By: rupprecht

Subscribers: llvm-commits

Tags: #llvm

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

Patch by Yuanfang Chen!

llvm-svn: 363198

show more ...


Revision tags: llvmorg-8.0.1-rc2
# dd4f253c 10-Jun-2019 George Rimar <grimar@accesssoftek.com>

[llvm-readobj/llvm-readelf] - Don't fail to dump the object if .dynsym has broken sh_link field.

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

GNU readelf allows to dump the objects in that

[llvm-readobj/llvm-readelf] - Don't fail to dump the object if .dynsym has broken sh_link field.

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

GNU readelf allows to dump the objects in that case,
but llvm-readobj/llvm-readelf reports an error and stops.

The patch fixes that.

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

llvm-svn: 362938

show more ...


# 72f821d3 20-May-2019 George Rimar <grimar@accesssoftek.com>

[llvm-readelf] - Rework how we parse the .dynamic section.

This is a result of what I found during my work on https://bugs.llvm.org/show_bug.cgi?id=41679.

Previously LLVM readelf took the informati

[llvm-readelf] - Rework how we parse the .dynamic section.

This is a result of what I found during my work on https://bugs.llvm.org/show_bug.cgi?id=41679.

Previously LLVM readelf took the information about .dynamic section
from its PT_DYNAMIC segment only. GNU tools have a bit different logic.
They also use the information from the .dynamic section header if it is available.
This patch changes the code to improve the compatibility with the GNU Binutils.

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

llvm-svn: 361165

show more ...


Revision tags: llvmorg-8.0.1-rc1
# fd75ee91 03-May-2019 Sean Fertile <sfertile@ca.ibm.com>

[Object][XCOFF] Add an XCOFF dumper for llvm-readobj.

Patch adds support for dumping of file headers with llvm-readobj. XCOFF
object files are added to test dumping a well formed file, and dumping
b

[Object][XCOFF] Add an XCOFF dumper for llvm-readobj.

Patch adds support for dumping of file headers with llvm-readobj. XCOFF
object files are added to test dumping a well formed file, and dumping
both negative timestamps and negative symbol counts, both of which are
allowed in the XCOFF definition.

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

llvm-svn: 359878

show more ...


# facbfe06 02-May-2019 Fangrui Song <maskray@google.com>

[llvm-readobj] Delete and inline relocAddressLess

It is used only once in COFFDumper.cpp. Deleting it from the public
interface seems better.

llvm-svn: 359775


# e29e30b1 01-May-2019 Fangrui Song <maskray@google.com>

[llvm-readobj] Change -long-option to --long-option in tests. NFC

We use both -long-option and --long-option in tests. Switch to --long-option for consistency.

In the "llvm-readelf" mode, -long-opt

[llvm-readobj] Change -long-option to --long-option in tests. NFC

We use both -long-option and --long-option in tests. Switch to --long-option for consistency.

In the "llvm-readelf" mode, -long-option is discouraged as it conflicts with grouped short options and it is not accepted by GNU readelf.

While updating the tests, change llvm-readobj -s to llvm-readobj -S to reduce confusion ("s" is --section-headers in llvm-readobj but --symbols in llvm-readelf).

llvm-svn: 359649

show more ...


# 19bb1d57 15-Apr-2019 Stephen Tozer <stephen.tozer@sony.com>

[llvm-readobj] Reapply: Improve error message for --string-dump

This is a resubmission of a previous patch that caused test failures,
with the fixes for the relevant tests included.

Fixes bug 40630

[llvm-readobj] Reapply: Improve error message for --string-dump

This is a resubmission of a previous patch that caused test failures,
with the fixes for the relevant tests included.

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

This patch changes the error message when the section specified by
--string-dump cannot be found by including the name of the section in
the error message and changing the prefix text to not imply that the
file itself was invalid. As part of this change some uses of
std::error_code have been replaced with the llvm Error class to better
encapsulate the error info (rather than passing File strings around),
and the WithColor class replaces string literal error prefixes.

llvm-svn: 358395

show more ...


1234567891011