#
0b50fa99 |
| 27-Jan-2021 |
Craig Topper <craig.topper@sifive.com> |
[FaultsMaps][llvm-objdump] Move FaultMapParser to Object/. Remove CodeGen dependency from llvm-objdump
FaultsMapParser lived in CodeGen and was forcing llvm-objdump to link CodeGen and everything Co
[FaultsMaps][llvm-objdump] Move FaultMapParser to Object/. Remove CodeGen dependency from llvm-objdump
FaultsMapParser lived in CodeGen and was forcing llvm-objdump to link CodeGen and everything CodeGen depends on.
This was previously attempted in r240364 to fix a link failure. The CodeGen dependency was independently added to fix the same link failure, and that ended up being kept.
Removing the dependency seems like the correct layering for llvm-objdump.
Reviewed By: MaskRay, jhenderson
Differential Revision: https://reviews.llvm.org/D95414
show more ...
|
#
48bdd676 |
| 27-Jan-2021 |
Kazu Hirata <kazu@google.com> |
[llvm-objdump] Use append_range (NFC)
|
#
a9a8caf2 |
| 07-Jan-2021 |
Simon Pilgrim <llvm-dev@redking.me.uk> |
[llvm-objdump] Pass Twine by const reference instead of by value. NFCI.
|
#
92310454 |
| 17-Dec-2020 |
Barry Revzin <barry.revzin@gmail.com> |
Make LLVM build in C++20 mode
Part of the <=> changes in C++20 make certain patterns of writing equality operators ambiguous with themselves (sorry!). This patch goes through and adjusts all the com
Make LLVM build in C++20 mode
Part of the <=> changes in C++20 make certain patterns of writing equality operators ambiguous with themselves (sorry!). This patch goes through and adjusts all the comparison operators such that they should work in both C++17 and C++20 modes. It also makes two other small C++20-specific changes (adding a constructor to a type that cases to be an aggregate, and adding casts from u8 literals which no longer have type const char*).
There were four categories of errors that this review fixes. Here are canonical examples of them, ordered from most to least common:
// 1) Missing const namespace missing_const { struct A { #ifndef FIXED bool operator==(A const&); #else bool operator==(A const&) const; #endif };
bool a = A{} == A{}; // error }
// 2) Type mismatch on CRTP namespace crtp_mismatch { template <typename Derived> struct Base { #ifndef FIXED bool operator==(Derived const&) const; #else // in one case changed to taking Base const& friend bool operator==(Derived const&, Derived const&); #endif };
struct D : Base<D> { };
bool b = D{} == D{}; // error }
// 3) iterator/const_iterator with only mixed comparison namespace iter_const_iter { template <bool Const> struct iterator { using const_iterator = iterator<true>;
iterator();
template <bool B, std::enable_if_t<(Const && !B), int> = 0> iterator(iterator<B> const&);
#ifndef FIXED bool operator==(const_iterator const&) const; #else friend bool operator==(iterator const&, iterator const&); #endif };
bool c = iterator<false>{} == iterator<false>{} // error || iterator<false>{} == iterator<true>{} || iterator<true>{} == iterator<false>{} || iterator<true>{} == iterator<true>{}; }
// 4) Same-type comparison but only have mixed-type operator namespace ambiguous_choice { enum Color { Red };
struct C { C(); C(Color); operator Color() const; bool operator==(Color) const; friend bool operator==(C, C); };
bool c = C{} == C{}; // error bool d = C{} == Red; }
Differential revision: https://reviews.llvm.org/D78938
show more ...
|
#
407d4200 |
| 15-Dec-2020 |
Georgii Rymar <grimar@accesssoftek.com> |
[lib/Object] - Make ELFObjectFile::getSymbol() return Expected<>.
This was requested in comments for D93209: https://reviews.llvm.org/D93209#inline-871192
D93209 fixes an issue with `ELFFile<ELFT>:
[lib/Object] - Make ELFObjectFile::getSymbol() return Expected<>.
This was requested in comments for D93209: https://reviews.llvm.org/D93209#inline-871192
D93209 fixes an issue with `ELFFile<ELFT>::getEntry`, after what `getSymbol` starts calling `report_fatal_error` for previously missed invalid cases.
This patch makes it return `Expected<>` and updates callers. For few of them I had to add new `report_fatal_error` calls. But I see no way to avoid it currently. The change would affects too many places, e.g: `getSymbolBinding` and other methods are used from `ELFSymbolRef` which is used in too many places across LLVM.
Differential revision: https://reviews.llvm.org/D93297
show more ...
|
#
aabaca33 |
| 30-Nov-2020 |
David Spickett <david.spickett@linaro.org> |
[llvm-objdump] Use "--" for long options in --help text
Single dash for these options is not recognised.
Changes found by running this on the --help output and the user guide: grep -e ' -[a-zA-Z]\{
[llvm-objdump] Use "--" for long options in --help text
Single dash for these options is not recognised.
Changes found by running this on the --help output and the user guide: grep -e ' -[a-zA-Z]\{2,\}'
The user guide was updated in https://reviews.llvm.org/D92305 so no change there.
Reviewed By: jhenderson, MaskRay
Differential Revision: https://reviews.llvm.org/D92310
show more ...
|
#
c2ead57c |
| 30-Nov-2020 |
David Spickett <david.spickett@linaro.org> |
[llvm-objdump] Document --mattr=help in --help output
This does the same as `--mcpu=help` but was only documented in the user guide.
* Added a test for both options. * Corrected the single dash in
[llvm-objdump] Document --mattr=help in --help output
This does the same as `--mcpu=help` but was only documented in the user guide.
* Added a test for both options. * Corrected the single dash in `-mcpu=help` text.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D92305
show more ...
|
#
e95f9a23 |
| 16-Oct-2020 |
Vinicius Tinti <viniciustinti@gmail.com> |
[llvm-objdump] Implement --prefix option
The prefix given to --prefix will be added to GNU absolute paths when used with --source option (source interleaved with the disassembly).
This matches GNU'
[llvm-objdump] Implement --prefix option
The prefix given to --prefix will be added to GNU absolute paths when used with --source option (source interleaved with the disassembly).
This matches GNU's objdump behavior.
GNU and C++17 rules for absolute paths are different.
Differential Revision: https://reviews.llvm.org/D85024
Fixes PR46368.
Differential Revision: https://reviews.llvm.org/D85024
show more ...
|
#
7d01bb8f |
| 08-Oct-2020 |
Simon Pilgrim <llvm-dev@redking.me.uk> |
[llvm-objdump] Ensure we consistently use the llvm::stable_sort wrappers.
We use this everywhere else in this file, these were just missed.
|
#
528057c1 |
| 07-Oct-2020 |
Ronak Chauhan <RonakNilesh.Chauhan@amd.com> |
[AMDGPU] Support disassembly for AMDGPU kernel descriptors
Decode AMDGPU Kernel descriptors as assembler directives.
Reviewed By: scott.linder, jhenderson, kzhuravl
Differential Revision: https://
[AMDGPU] Support disassembly for AMDGPU kernel descriptors
Decode AMDGPU Kernel descriptors as assembler directives.
Reviewed By: scott.linder, jhenderson, kzhuravl
Differential Revision: https://reviews.llvm.org/D80713
show more ...
|
#
f078577f |
| 09-Sep-2020 |
Ronak Chauhan <RonakNilesh.Chauhan@amd.com> |
Revert "[AMDGPU] Support disassembly for AMDGPU kernel descriptors"
This reverts commit 487a80531006add8102d50dbcce4b6fd729ab1f6.
Tests fail on big endian machines.
|
#
487a8053 |
| 07-Sep-2020 |
Ronak Chauhan <RonakNilesh.Chauhan@amd.com> |
[AMDGPU] Support disassembly for AMDGPU kernel descriptors
Decode AMDGPU Kernel descriptors as assembler directives.
Reviewed By: scott.linder, jhenderson, kzhuravl
Differential Revision: https://
[AMDGPU] Support disassembly for AMDGPU kernel descriptors
Decode AMDGPU Kernel descriptors as assembler directives.
Reviewed By: scott.linder, jhenderson, kzhuravl
Differential Revision: https://reviews.llvm.org/D80713
show more ...
|
#
3f1a9b7e |
| 04-Sep-2020 |
Daniel Sanders <daniel_l_sanders@apple.com> |
[objdump][macho] Emit segment names along with section names
I recently came across a MachO with multiple sections of the same name but different segments. We should emit the segment name alongside
[objdump][macho] Emit segment names along with section names
I recently came across a MachO with multiple sections of the same name but different segments. We should emit the segment name alongside the section name for MachO's.
Differential Revision: https://reviews.llvm.org/D87119
show more ...
|
#
fdf71d48 |
| 19-Aug-2020 |
Ronak Chauhan <RonakNilesh.Chauhan@amd.com> |
Revert "[AMDGPU] Support disassembly for AMDGPU kernel descriptors"
This reverts commit cacfb02d28a3cabd4e45d2535cb0686cef48a2c9.
Reverting due to buildbot failures.
|
Revision tags: llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2 |
|
#
cacfb02d |
| 19-Jun-2020 |
Ronak Chauhan <RonakNilesh.Chauhan@amd.com> |
[AMDGPU] Support disassembly for AMDGPU kernel descriptors
Decode AMDGPU Kernel descriptors as assembler directives.
Reviewed By: scott.linder
Differential Revision: https://reviews.llvm.org/D80713
|
#
e760e856 |
| 24-Jul-2020 |
Ronak Chauhan <RonakNilesh.Chauhan@amd.com> |
[llvm-objdump][AMDGPU] Detect CPU string
AMDGPU ISA isn't backwards compatible and hence -mcpu must always be specified during disassembly. However, the AMDGPU target CPU is stored in e_flags in the
[llvm-objdump][AMDGPU] Detect CPU string
AMDGPU ISA isn't backwards compatible and hence -mcpu must always be specified during disassembly. However, the AMDGPU target CPU is stored in e_flags in the ELF object.
This patch allows targets to implement CPU string detection, and also implements it for AMDGPU by looking at e_flags.
Reviewed By: scott.linder
Differential Revision: https://reviews.llvm.org/D84519
show more ...
|
#
819b2d9c |
| 20-Jul-2020 |
Hongtao Yu <hoy@fb.com> |
[llvm-objdump] Symbolize binary addresses for low-noisy asm diff.
When diffing disassembly dump of two binaries, I see lots of noises from mismatched jump target addresses and global data references
[llvm-objdump] Symbolize binary addresses for low-noisy asm diff.
When diffing disassembly dump of two binaries, I see lots of noises from mismatched jump target addresses and global data references, which unnecessarily causes diffs on every function, making it impractical. I'm trying to symbolize the raw binary addresses to minimize the diff noise. In this change, a local branch target is modeled as a label and the branch target operand will simply be printed as a label. Local labels are collected by a separate pre-decoding pass beforehand. A global data memory operand will be printed as a global symbol instead of the raw data address. Unfortunately, due to the way the disassembler is set up and to be less intrusive, a global symbol is always printed as the last operand of a memory access instruction. This is less than ideal but is probably acceptable from checking code quality point of view since on most targets an instruction can have at most one memory operand.
So far only the X86 disassemblers are supported.
Test Plan:
llvm-objdump -d --x86-asm-syntax=intel --no-show-raw-insn --no-leading-addr : ``` Disassembly of section .text:
<_start>: push rax mov dword ptr [rsp + 4], 0 mov dword ptr [rsp], 0 mov eax, dword ptr [rsp] cmp eax, dword ptr [rip + 4112] # 202182 <g> jge 0x20117e <_start+0x25> call 0x201158 <foo> inc dword ptr [rsp] jmp 0x201169 <_start+0x10> xor eax, eax pop rcx ret ```
llvm-objdump -d **--symbolize-operands** --x86-asm-syntax=intel --no-show-raw-insn --no-leading-addr : ``` Disassembly of section .text:
<_start>: push rax mov dword ptr [rsp + 4], 0 mov dword ptr [rsp], 0 <L1>: mov eax, dword ptr [rsp] cmp eax, dword ptr <g> jge <L0> call <foo> inc dword ptr [rsp] jmp <L1> <L0>: xor eax, eax pop rcx ret ```
Note that the jump instructions like `jge 0x20117e <_start+0x25>` without this work is printed as a real target address and an offset from the leading symbol. With a change in the optimizer that adds/deletes an instruction, the address and offset may shift for targets placed after the instruction. This will be a problem when diffing the disassembly from two optimizers where there are unnecessary false positives due to such branch target address changes. With `--symbolize-operand`, a label is printed for a branch target instead to reduce the false positives. Similarly, the disassemble of PC-relative global variable references is also prone to instruction insertion/deletion.
Reviewed By: jhenderson, MaskRay
Differential Revision: https://reviews.llvm.org/D84191
show more ...
|
#
7f8c49b0 |
| 13-Aug-2020 |
Fangrui Song <i@maskray.me> |
[llvm-objdump] Change symbol name/PLT decoding errors to warnings
If the referenced symbol of a J[U]MP_SLOT is invalid (e.g. symbol index 0), llvm-objdump -d will bail out:
``` error: 'a': st_name
[llvm-objdump] Change symbol name/PLT decoding errors to warnings
If the referenced symbol of a J[U]MP_SLOT is invalid (e.g. symbol index 0), llvm-objdump -d will bail out:
``` error: 'a': st_name (0x326600) is past the end of the string table of size 0x7 ```
where 0x326600 is the st_name field of the first entry past the end of .symtab
Change it to a warning to continue dumping. `X86/plt.test` uses a prebuilt executable, so I pick `ELF/AArch64/plt.test` which has a YAML input and can be easily modified.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D85623
show more ...
|
#
3514f58f |
| 09-Jul-2020 |
Simon Pilgrim <llvm-dev@redking.me.uk> |
Fix MSVC "not all control paths return a value" warning. NFC.
|
Revision tags: llvmorg-10.0.1-rc1, llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5 |
|
#
dc4a6f5d |
| 17-Mar-2020 |
Oliver Stannard <oliver.stannard@linaro.org> |
[llvm-objdump] Display locations of variables alongside disassembly
This adds the --debug-vars option to llvm-objdump, which prints locations (registers/memory) of source-level variables alongside t
[llvm-objdump] Display locations of variables alongside disassembly
This adds the --debug-vars option to llvm-objdump, which prints locations (registers/memory) of source-level variables alongside the disassembly based on DWARF info. A vertical line is printed for each live-range, with a label at the top giving the variable name and location, and the position and length of the line indicating the program counter range in which it is valid.
Differential revision: https://reviews.llvm.org/D70720
show more ...
|
#
5bd33de9 |
| 17-Jun-2020 |
Ronak Chauhan <RonakNilesh.Chauhan@amd.com> |
[MC] Pass the symbol rather than its name to onSymbolStart()
Summary: This allows targets to also consider the symbol's type and/or address if needed.
Reviewers: scott.linder, jhenderson, MaskRay,
[MC] Pass the symbol rather than its name to onSymbolStart()
Summary: This allows targets to also consider the symbol's type and/or address if needed.
Reviewers: scott.linder, jhenderson, MaskRay, aardappel
Reviewed By: scott.linder, MaskRay
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, aheejin, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82090
show more ...
|
#
480a16d5 |
| 12-Jun-2020 |
Ronak Chauhan <ronaknilesh.chauhan@amd.com> |
[MC] Changes to help improve target specific symbol disassembly
Summary: This commit slightly modifies the MCDisassembler, and llvm-objdump to allow targets to also decode entire symbols.
WebAssemb
[MC] Changes to help improve target specific symbol disassembly
Summary: This commit slightly modifies the MCDisassembler, and llvm-objdump to allow targets to also decode entire symbols.
WebAssembly uses the onSymbolStart hook it to decode preludes. WebAssembly partially disassembles the symbol in its target specific way; and then falls back to the normal flow of llvm-objdump.
AMDGPU needs it to decode kernel descriptors entirely, and move to the next symbol.
This commit is to split the above task into 2. - Changes to llvm-objdump and MC-layer without breaking WebAssembly code [ this commit ] - AMDGPU's implementation of onSymbolStart that decodes kernel descriptors. [ https://reviews.llvm.org/D80713 ]
Reviewers: scott.linder, t-tye, sunfish, arsenm, jhenderson, MaskRay, aardappel
Reviewed By: scott.linder, jhenderson, aardappel
Subscribers: bcain, dschuff, wdng, tpr, sbc100, jgravelle-google, hiraditya, aheejin, MaskRay, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80512
show more ...
|
#
1c03389c |
| 11-Jun-2020 |
Reid Kleckner <rnk@google.com> |
Re-land "Migrate the rest of COFFObjectFile to Error"
This reverts commit 101fbc01382edd89ea7b671104c68b30b2446cc0.
Remove leftover debugging attribute.
Update LLDB as well, which was missed befor
Re-land "Migrate the rest of COFFObjectFile to Error"
This reverts commit 101fbc01382edd89ea7b671104c68b30b2446cc0.
Remove leftover debugging attribute.
Update LLDB as well, which was missed before.
show more ...
|
#
5ee57173 |
| 11-Jun-2020 |
Fangrui Song <maskray@google.com> |
[llvm-objdump] Decrease instruction indentation for non-x86
Place the instruction at the 24th column (0-based indexing), matching GNU objdump ARM/AArch64/powerpc/etc when the address is low.
This i
[llvm-objdump] Decrease instruction indentation for non-x86
Place the instruction at the 24th column (0-based indexing), matching GNU objdump ARM/AArch64/powerpc/etc when the address is low.
This is beneficial for non-x86 targets which have short instruction lengths.
``` // GNU objdump AArch64 0: 91001062 add x2, x3, #0x4 400078: 91001062 add x2, x3, #0x4 // llvm-objdump, with this patch 0: 62 10 00 91 add x2, x3, #4 400078: 62 10 00 91 add x2, x3, #4 // llvm-objdump, if we change to print a word instead of bytes in the future 0: 91001062 add x2, x3, #4 400078: 91001062 add x2, x3, #4
// GNU objdump Thumb 0: bf00 nop
// GNU objdump Power ISA 3.1 64-bit instruction // 0: 00 00 10 04 plwa r3,0 // 4: 00 00 60 a4 ```
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D81590
show more ...
|
#
101fbc01 |
| 06-Jun-2020 |
Nico Weber <thakis@chromium.org> |
Revert "Migrate the rest of COFFObjectFile to Error"
This reverts commit b5289656b865d2a73cf90819e20a96fb8414ab0b. __attribute__((optnone)) doesn't build with msvc, see http://lab.llvm.org:8011/buil
Revert "Migrate the rest of COFFObjectFile to Error"
This reverts commit b5289656b865d2a73cf90819e20a96fb8414ab0b. __attribute__((optnone)) doesn't build with msvc, see http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/16326
show more ...
|