#
b5289656 |
| 05-Jun-2020 |
Reid Kleckner <rnk@google.com> |
Migrate the rest of COFFObjectFile to Error
|
#
d04eb253 |
| 31-May-2020 |
Fangrui Song <maskray@google.com> |
[llvm-objdump] Delete unneeeded namespace llvm {}
|
#
439d27d7 |
| 31-May-2020 |
Fangrui Song <maskray@google.com> |
[llvm-objdump] Move llvm:: to llvm::objdump:: and qualifying definitions with objdump::
Or adding `static`.
Qualifying definitions with `objdump::` comforms to the coding standards https://llvm.org
[llvm-objdump] Move llvm:: to llvm::objdump:: and qualifying definitions with objdump::
Or adding `static`.
Qualifying definitions with `objdump::` comforms to the coding standards https://llvm.org/docs/CodingStandards.html#use-namespace-qualifiers-to-implement-previously-declared-functions
show more ...
|
#
a23d1e9a |
| 31-May-2020 |
Fangrui Song <maskray@google.com> |
[llvm-objdump] Simplify reportError() and prepend outs().flush()
As noticed by dblaikie.
I don't know what code paths using reportError can cause stdout output to be interleaved with stderr, so no
[llvm-objdump] Simplify reportError() and prepend outs().flush()
As noticed by dblaikie.
I don't know what code paths using reportError can cause stdout output to be interleaved with stderr, so no test is added now.
Also drop an unneeded use of errs().fflush() in reportWarning(). I requested this in D64165.
show more ...
|
#
ac9e8b3a |
| 02-May-2020 |
Fangrui Song <maskray@google.com> |
[llvm-objdump][ARM] Print inline relocations when dumping ARM data
Fixes PR44357
For ARM ELF, regions covered by data mapping symbols `$d` are dumped as `.byte`, `.short` or `.word` but inline relo
[llvm-objdump][ARM] Print inline relocations when dumping ARM data
Fixes PR44357
For ARM ELF, regions covered by data mapping symbols `$d` are dumped as `.byte`, `.short` or `.word` but inline relocations are not printed. This patch merges its loop into the normal instruction printing loop so that inline relocations are printed.
Reviewed By: nickdesaulniers
Differential Revision: https://reviews.llvm.org/D79284
show more ...
|
#
3c9c9c17 |
| 23-Apr-2020 |
Fangrui Song <maskray@google.com> |
[llvm-objdump] Print target address with evaluateMemoryOperandAddress()
D63847 added `MCInstrAnalysis::evaluateMemoryOperandAddress()`. This patch leverages the feature to print the target addresses
[llvm-objdump] Print target address with evaluateMemoryOperandAddress()
D63847 added `MCInstrAnalysis::evaluateMemoryOperandAddress()`. This patch leverages the feature to print the target addresses for evaluable instructions.
``` -400a: movl 4080(%rip), %eax +400a: movl 4080(%rip), %eax # 5000 <data1> ```
This patch also deletes `MIA->isCall(Inst) || MIA->isUnconditionalBranch(Inst) || MIA->isConditionalBranch(Inst)` which is used to guard `MCInstrAnalysis::evaluateBranch()`
Reviewed By: jhenderson, skan
Differential Revision: https://reviews.llvm.org/D78776
show more ...
|
#
2f9d1533 |
| 24-Apr-2020 |
Hubert Tong <hstong@ca.ibm.com> |
[llvm-objdump][ELF][NFC] Create ELFDump.h
Summary: Continuing from D77285, the external interfaces implemented by `ELFDump.cpp` are now declared in `ELFDump.h` and moved into the `llvm::objdump` nam
[llvm-objdump][ELF][NFC] Create ELFDump.h
Summary: Continuing from D77285, the external interfaces implemented by `ELFDump.cpp` are now declared in `ELFDump.h` and moved into the `llvm::objdump` namespace. Externs defined in `ELFDump.cpp` that are unreferenced externally are also made static.
Reviewers: jhenderson, MaskRay, DiggerLin, jasonliu, daltenty
Reviewed By: jhenderson, MaskRay
Subscribers: RKSimon, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78695
show more ...
|
#
bcca6ae3 |
| 21-Apr-2020 |
jasonliu <jasonliu.development@gmail.com> |
[llvm-objdump][XCOFF] Print more symbol info in relocation
Summary: Print more symbol info in relocation printing when --symbol-description is specified.
Differential Revision: https://reviews.llvm
[llvm-objdump][XCOFF] Print more symbol info in relocation
Summary: Print more symbol info in relocation printing when --symbol-description is specified.
Differential Revision: https://reviews.llvm.org/D78499
show more ...
|
#
e9aac2c3 |
| 20-Apr-2020 |
James Henderson <james.henderson@sony.com> |
[llvm-objdump] Look in all viable sections for call/branch targets
Prior to this patch, llvm-objdump would only look in the last section (according to the section header table order) that matched an
[llvm-objdump] Look in all viable sections for call/branch targets
Prior to this patch, llvm-objdump would only look in the last section (according to the section header table order) that matched an address for a symbol when identifying the target symbol of a call or branch operation. If there are multiple sections with the same address, due to some of them being empty, it did not look in those, even if the symbol couldn't be found in the first section looked in.
This patch causes llvm-objdump to look in all sections for possible candidate symbols. If there are multiple possible symbols, it picks one from a non-empty section, if possible (as that is more likely to be the "real" symbol since functions can't really be in emptiy sections), before falling back to those in empty sections. If all else fails, it falls back to absolute symbols as it did before.
Differential Revision: https://reviews.llvm.org/D78549
Reviewed by: grimar, Higuoxing
show more ...
|
#
cacf1b50 |
| 18-Apr-2020 |
Markus Böck <markus.boeck02@gmail.com> |
[llvm-objdump] Demangle C++ Symbols in branch and call targets
Currently C++ symbols are demangled in the symbol table as well as in the disassembly and relocations. This patch adds demangling of C+
[llvm-objdump] Demangle C++ Symbols in branch and call targets
Currently C++ symbols are demangled in the symbol table as well as in the disassembly and relocations. This patch adds demangling of C++ symbols in targets of calls and branches making it easier to decipher control flow in disassembly. This also matches up with GNUobjdump's behavior
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D77957
show more ...
|
#
ac00376a |
| 10-Apr-2020 |
vgxbj <higuoxing@gmail.com> |
[Object] Change uint32_t getSymbolFlags() to Expected<uint32_t> getSymbolFlags().
This change enables getSymbolFlags() to return errors which benefit error reporting in clients.
Differential Revisi
[Object] Change uint32_t getSymbolFlags() to Expected<uint32_t> getSymbolFlags().
This change enables getSymbolFlags() to return errors which benefit error reporting in clients.
Differential Revision: https://reviews.llvm.org/D77860
show more ...
|
#
5ea28196 |
| 14-Apr-2020 |
Hubert Tong <hubert.reinterpretcast@gmail.com> |
[llvm-objdump][Wasm][NFC] Create WasmDump.h
Summary: Continuing from D77285, the external interfaces implemented by `WasmDump.cpp` are now declared in `WasmDump.h` and moved into the `llvm::objdump`
[llvm-objdump][Wasm][NFC] Create WasmDump.h
Summary: Continuing from D77285, the external interfaces implemented by `WasmDump.cpp` are now declared in `WasmDump.h` and moved into the `llvm::objdump` namespace.
Reviewers: jhenderson, MaskRay, DiggerLin, jasonliu, daltenty
Reviewed By: jhenderson, MaskRay
Differential Revision: https://reviews.llvm.org/D77990
show more ...
|
#
40f7ab50 |
| 13-Apr-2020 |
jasonliu <jasonliu.development@gmail.com> |
[llvm-objdump] Fix incomplete relocation output for -D -r mode
This patch intends to fix incomplete relocation printing for XCOFF (potentially for other targets).
Differential Revision: https://rev
[llvm-objdump] Fix incomplete relocation output for -D -r mode
This patch intends to fix incomplete relocation printing for XCOFF (potentially for other targets).
Differential Revision: https://reviews.llvm.org/D77580
show more ...
|
#
c6f13ce5 |
| 09-Apr-2020 |
Hubert Tong <hubert.reinterpretcast@gmail.com> |
[llvm-objdump][NFC] MachODump.cpp interface cleanup
Continuing from D77388, this patch moves interface declarations associated with `MachODump.cpp` into the headers corresponding to the file that de
[llvm-objdump][NFC] MachODump.cpp interface cleanup
Continuing from D77388, this patch moves interface declarations associated with `MachODump.cpp` into the headers corresponding to the file that defines the variable. At the same time, these externs are moved into the `llvm::objdump` namespace. The externs defined in `MachODump.cpp` that are not referenced outside of it are given internal linkage.
This patch does not rename the external functions defined by `MachODump.cpp` that are not clearly named as being specific to Mach-O.
Reviewed By: jhenderson, MaskRay
Differential Revision: https://reviews.llvm.org/D77730
show more ...
|
#
abd335a3 |
| 07-Apr-2020 |
James Henderson <james.henderson@sony.com> |
[llvm-objdump] Fix unstable disassembly output for sections with same address
When two sections shared the same address, the disassembly code was using pointer values when sorting (see the SectionRe
[llvm-objdump] Fix unstable disassembly output for sections with same address
When two sections shared the same address, the disassembly code was using pointer values when sorting (see the SectionRef less than operator). Since those values aren't guaranteed to have a specific order, this meant the disassembly code would sometimes change which section to pick when finding symbols targeted by calls in fully linked objects.
This change fixes the non-determinism, so that the same section is always picked. This might have a negative impact in that now a section without any symbol might be picked over a section with symbols, but this will be addressed in a later commit.
Fixes https://bugs.llvm.org/show_bug.cgi?id=45411.
Reviewed by: grimar, MaskRay
Differential Revision: https://reviews.llvm.org/D77640
show more ...
|
#
076308a4 |
| 06-Apr-2020 |
Hubert Tong <hubert.reinterpretcast@gmail.com> |
[llvm-objdump][NFC] Declare command-line externs in headers with namespace
Summary: This patch moves the forward declarations of command-line `cl::*` externs in `MachODump.cpp` and `llvm-objdump.cpp
[llvm-objdump][NFC] Declare command-line externs in headers with namespace
Summary: This patch moves the forward declarations of command-line `cl::*` externs in `MachODump.cpp` and `llvm-objdump.cpp` into the headers corresponding to the file that defines the variable. At the same time, these externs are moved into the `llvm::objdump` namespace. The externs that are not referenced outside their defining translation unit are made static.
This does not factor out uses of the Mach-O options from `llvm-objdump.cpp`.
Reviewers: jhenderson, MaskRay, DiggerLin, jasonliu, daltenty
Reviewed By: jhenderson, MaskRay
Subscribers: rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77388
show more ...
|
#
a26a441b |
| 06-Apr-2020 |
diggerlin <digger.llvm@gmail.com> |
[llvm-objdump][XCOFF] Use symbol index+symbol name + storage mapping class as label for -D
SUMMARY:
For the llvm-objdump -D, the symbol name is used as a label in the disassembly for the specific a
[llvm-objdump][XCOFF] Use symbol index+symbol name + storage mapping class as label for -D
SUMMARY:
For the llvm-objdump -D, the symbol name is used as a label in the disassembly for the specific address (when a symbol address is equal to the virtual address in the dump).
In XCOFF, multiple symbols may have the same name, being differentiated by their storage mapping class. It is helpful to print the QualName and not just the name when forming the output label for a csect symbol. The symbol index further removes any ambiguity caused by duplicate names.
To maintain compatibility with the binutils objdump, the XCOFF-specific --symbol-description option is added to enable the enhanced format.
Reviewers: hubert.reinterpretcast, James Henderson, Jason Liu ,daltenty Subscribers: wuzish, nemanjai, hiraditya
Differential Revision: https://reviews.llvm.org/D72973
show more ...
|
#
86b97f00 |
| 05-Apr-2020 |
vgxbj <higuoxing@gmail.com> |
[llvm-objdump] Simplify conditional statements (isa<...>(Obj) => Obj->isSomeFile())
Summary: Simplify some conditional statements.
Reviewers: jhenderson, MaskRay, rupprecht
Reviewed By: MaskRay, r
[llvm-objdump] Simplify conditional statements (isa<...>(Obj) => Obj->isSomeFile())
Summary: Simplify some conditional statements.
Reviewers: jhenderson, MaskRay, rupprecht
Reviewed By: MaskRay, rupprecht
Subscribers: rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75899
show more ...
|
#
948ef5b1 |
| 05-Apr-2020 |
vgxbj <higuoxing@gmail.com> |
[llvm-objdump] Teach `llvm-objdump` dump dynamic symbols.
Summary: This patch is to teach `llvm-objdump` dump dynamic symbols (`-T` and `--dynamic-syms`). Currently, this patch is not fully compatib
[llvm-objdump] Teach `llvm-objdump` dump dynamic symbols.
Summary: This patch is to teach `llvm-objdump` dump dynamic symbols (`-T` and `--dynamic-syms`). Currently, this patch is not fully compatible with `gnu-objdump`, but I would like to continue working on this in next few patches. It has two issues.
1. Some symbols shouldn't be marked as global(g). (`-t/--syms` has same issue as well) (Fixed by D75659) 2. `gnu-objdump` can dump version information and *dynamically* insert before symbol name field.
`objdump -T a.out` gives:
``` DYNAMIC SYMBOL TABLE: 0000000000000000 w D *UND* 0000000000000000 _ITM_deregisterTMCloneTable 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 printf 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 __libc_start_main 0000000000000000 w D *UND* 0000000000000000 __gmon_start__ 0000000000000000 w D *UND* 0000000000000000 _ITM_registerTMCloneTable 0000000000000000 w DF *UND* 0000000000000000 GLIBC_2.2.5 __cxa_finalize ```
`llvm-objdump -T a.out` gives:
``` DYNAMIC SYMBOL TABLE: 0000000000000000 w D *UND* 0000000000000000 _ITM_deregisterTMCloneTable 0000000000000000 g DF *UND* 0000000000000000 printf 0000000000000000 g DF *UND* 0000000000000000 __libc_start_main 0000000000000000 w D *UND* 0000000000000000 __gmon_start__ 0000000000000000 w D *UND* 0000000000000000 _ITM_registerTMCloneTable 0000000000000000 w DF *UND* 0000000000000000 __cxa_finalize ```
Reviewers: jhenderson, grimar, MaskRay, espindola
Reviewed By: jhenderson, grimar
Subscribers: emaste, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75756
show more ...
|
#
2aab46ab |
| 02-Apr-2020 |
Hubert Tong <hubert.reinterpretcast@gmail.com> |
[llvm-objdump][COFF][NFC] Split format-specific interfaces; add namespace
Summary: This patch addresses, for the interfaces implemented by `COFFDump.cpp`, multiple issues identified with the current
[llvm-objdump][COFF][NFC] Split format-specific interfaces; add namespace
Summary: This patch addresses, for the interfaces implemented by `COFFDump.cpp`, multiple issues identified with the current structure of `llvm-objdump.h` in the review of D72973.
This patch moves implementation details of the tool into an `llvm::objdump` namespace for external linkage names, splits the implementation details into separate headers for each implementation file, and uses qualified names when declaring members of the `llvm::objdump` namespace in place of leaving the namespace definition open.
Reviewers: jhenderson, DiggerLin, jasonliu, daltenty, MaskRay
Reviewed By: jhenderson, MaskRay
Subscribers: MaskRay, rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77285
show more ...
|
#
d60d7d69 |
| 27-Mar-2020 |
jasonliu <jasonliu.development@gmail.com> |
[llvm-objdump][XCOFF][AIX] Implement -r option
Summary: Implement several XCOFF hooks to get '-r' option working for llvm-objdump -r.
Reviewer: DiggerLin, hubert.reinterpretcast, jhenderson, MaskRa
[llvm-objdump][XCOFF][AIX] Implement -r option
Summary: Implement several XCOFF hooks to get '-r' option working for llvm-objdump -r.
Reviewer: DiggerLin, hubert.reinterpretcast, jhenderson, MaskRay
Differential Revision: https://reviews.llvm.org/D75131
show more ...
|
#
579a7a19 |
| 26-Mar-2020 |
Fangrui Song <maskray@google.com> |
[llvm-objdump] Fix typo. NFC
|
#
87de9a07 |
| 22-Mar-2020 |
Fangrui Song <maskray@google.com> |
[X86InstPrinter] Change printPCRelImm to print the target address in hexadecimal form
``` // llvm-objdump -d output (before) 400000: e8 0b 00 00 00 callq 11 400005: e8 0b 00 00 00 callq 11
// l
[X86InstPrinter] Change printPCRelImm to print the target address in hexadecimal form
``` // llvm-objdump -d output (before) 400000: e8 0b 00 00 00 callq 11 400005: e8 0b 00 00 00 callq 11
// llvm-objdump -d output (after) 400000: e8 0b 00 00 00 callq 0x400010 400005: e8 0b 00 00 00 callq 0x400015
// GNU objdump -d. The lack of 0x is not ideal because the result cannot be re-assembled 400000: e8 0b 00 00 00 callq 400010 400005: e8 0b 00 00 00 callq 400015 ```
In llvm-objdump, we pass the address of the next MCInst. Ideally we should just thread the address of the current address, unfortunately we cannot call X86MCCodeEmitter::encodeInstruction (X86MCCodeEmitter requires MCInstrInfo and MCContext) to get the length of the MCInst.
MCInstPrinter::printInst has other callers (e.g llvm-mc -filetype=asm, llvm-mca) which set Address to 0. They leave MCInstPrinter::PrintBranchImmAsAddress as false and this change is a no-op for them.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D76580
show more ...
|
#
5fad05e8 |
| 22-Mar-2020 |
Fangrui Song <maskray@google.com> |
[MCInstPrinter] Pass `Address` parameter to MCOI::OPERAND_PCREL typed operands. NFC
Follow-up of D72172 and D72180
This patch passes `uint64_t Address` to print methods of PC-relative operands so t
[MCInstPrinter] Pass `Address` parameter to MCOI::OPERAND_PCREL typed operands. NFC
Follow-up of D72172 and D72180
This patch passes `uint64_t Address` to print methods of PC-relative operands so that subsequent target specific patches can change `*InstPrinter::print{Operand,PCRelImm,...}` to customize the output.
Add MCInstPrinter::PrintBranchImmAsAddress which is set to true by llvm-objdump.
``` // Current llvm-objdump -d output aarch64: 20000: bl #0 ppc: 20000: bl .+4 x86: 20000: callq 0
// Ideal output aarch64: 20000: bl 0x20000 ppc: 20000: bl 0x20004 x86: 20000: callq 0x20005
// GNU objdump -d. The lack of 0x is not ideal because the result cannot be re-assembled aarch64: 20000: bl 20000 ppc: 20000: bl 0x20004 x86: 20000: callq 20005 ```
In `lib/Target/X86/X86GenAsmWriter1.inc` (generated by `llvm-tblgen -gen-asm-writer`):
``` case 12: // CALL64pcrel32, CALLpcrel16, CALLpcrel32, EH_SjLj_Setup, JCXZ, JECXZ, J... - printPCRelImm(MI, 0, O); + printPCRelImm(MI, Address, 0, O); return; ```
Some targets have 2 `printOperand` overloads, one without `Address` and one with `Address`. They should annotate derived `Operand` properly with `let OperandType = "OPERAND_PCREL"`.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D76574
show more ...
|
#
5e7a42cf |
| 24-Mar-2020 |
Fangrui Song <maskray@google.com> |
[llvm-objdump] Replace array_pod_sort with llvm::stable_sort
llvm-objdump.cpp has 3 array_pod_sort() calls used for symbolization. array_pod_start() calls qsort() internally and can have different b
[llvm-objdump] Replace array_pod_sort with llvm::stable_sort
llvm-objdump.cpp has 3 array_pod_sort() calls used for symbolization. array_pod_start() calls qsort() internally and can have different behaviors across different libcs. Use llvm::stable_sort instead.
Reviewed By: davidb, thopre
Differential Revision: https://reviews.llvm.org/D76739
show more ...
|