summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-readobj
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm/Object] - Make ELFObjectFile::getRelocatedSection return ↵George Rimar2019-10-211-0/+23
| | | | | | | | | | | | | Expected<section_iterator> It returns just a section_iterator currently and have a report_fatal_error call inside. This change adds a way to return errors and handle them on caller sides. The patch also changes/improves current users and adds test cases. Differential revision: https://reviews.llvm.org/D69167 llvm-svn: 375408
* [yaml2obj][obj2yaml] - Do not create a symbol table by default.George Rimar2019-10-2016-24/+25
| | | | | | | | | | | | | | | | | | This patch tries to resolve problems faced in D68943 and uses some of the code written by Konrad Wilhelm Kleine in that patch. Previously, yaml2obj tool always created a .symtab section. This patch changes that. With it we only create it when have a "Symbols:" tag in the YAML document or when we need to create it because it is used by another section(s). obj2yaml follows the new behavior and does not print "Symbols:" anymore when there is no symbol table. Differential revision: https://reviews.llvm.org/D69041 llvm-svn: 375361
* [WebAssembly] Allow multivalue signatures in object filesThomas Lively2019-10-181-2/+3
| | | | | | | | | | | | | | | | | Summary: Also changes the wasm YAML format to reflect the possibility of having multiple return types and to put the returns after the params for consistency with the binary encoding. Reviewers: aheejin, sbc100 Subscribers: dschuff, jgravelle-google, hiraditya, sunfish, arphaman, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69156 llvm-svn: 375283
* [llvm-readobj] - Refine the LLVM-style output to be consistent.George Rimar2019-10-174-13/+15
| | | | | | | | | | | | | | Our LLVM-style output was inconsistent. This patch changes the output in the following way: SHT_GNU_verdef { -> VersionDefinitions [ SHT_GNU_verneed { -> VersionRequirements [ Version symbols [ -> VersionSymbols [ EH_FRAME Header [ -> EHFrameHeader { Differential revision: https://reviews.llvm.org/D68636 llvm-svn: 375095
* [XCOFF]implement parsing relocation information for 32-bit xcoff object fileDigger Lin2019-10-152-0/+157
| | | | | | | | | | | | | | Summary: Parsing the relocation entry information for 32-bit xcoff object file including deal with the relocation overflow. Reviewers: hubert.reinterpretcast, jasonliu, sfertile, xingxue. Subscribers: hiraditya, rupprecht, seiya Differential Revision: https://reviews.llvm.org/D67008 llvm-svn: 374946
* [llvm-readobj][xcoff] implement parsing overflow section header.Digger Lin2019-10-152-0/+47
| | | | | | | | | | | | | | | SUMMARY: in the xcoff, if the number of relocation entries or line number entries is overflow(large than or equal 65535) , there will be overflow section for it. The interpret of overflow section is different with generic section header, the patch implement parsing the overflow section. Reviewers: hubert.reinterpretcast,sfertile,jasonliu Subscribers: rupprecht, seiya Differential Revision: https://reviews.llvm.org/D68575 llvm-svn: 374941
* [llvm-readobj] - Remove excessive fields when dumping "Version symbols".George Rimar2019-10-112-33/+27
| | | | | | | | | | | This removes a few fields that are not useful: "Section Name", "Address", "Offset" and "Link" (they duplicated the information available under the "Sections [" tag). Differential revision: https://reviews.llvm.org/D68704 llvm-svn: 374541
* [llvm-readelf] - Do not enter an infinite loop when printing histogram.George Rimar2019-10-101-24/+67
| | | | | | | | | | This is similar to D68086. We are entering an infinite loop when dumping a histogram for a specially crafted .hash section with a loop in a chain. Differential revision: https://reviews.llvm.org/D68771 llvm-svn: 374344
* [llvm-readobj/llvm-readelf] - Add checks for GNU-style to "all.test" test case.George Rimar2019-10-081-17/+101
| | | | | | | | | We do not check the GNU-style output when -all is given. This patch does that. Differential revision: https://reviews.llvm.org/D68462 llvm-svn: 374028
* [llvm-readelf/llvm-objdump] - Improve/refactor the implementation of ↵George Rimar2019-10-072-0/+85
| | | | | | | | | | | | | | | | | 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
* [llvm-readobj][mips] Implement GNU-style printing of .MIPS.abiflags sectionSimon Atanasyan2019-10-041-0/+29
| | | | | | | | In this patch `llvm-readobj` prints ASEs flags on a single line separated by a comma. GNU `readelf` prints each ASEs flag on a separate line. It will be fixed later. llvm-svn: 373732
* Recommit r373598 "[yaml2obj/obj2yaml] - Add support for SHT_LLVM_ADDRSIG ↵George Rimar2019-10-031-0/+1
| | | | | | | | | | | | | | | | | sections." Fix: call `consumeError()` for a case missed. Original commit message: SHT_LLVM_ADDRSIG is described here: https://llvm.org/docs/Extensions.html#sht-llvm-addrsig-section-address-significance-table This patch teaches tools to dump them and to parse the YAML declarations of such sections. Differential revision: https://reviews.llvm.org/D68333 llvm-svn: 373606
* Revert r373598 "[yaml2obj/obj2yaml] - Add support for SHT_LLVM_ADDRSIG ↵George Rimar2019-10-031-1/+0
| | | | | | | | | sections." It broke BB: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/18655/steps/test/logs/stdio llvm-svn: 373599
* [yaml2obj/obj2yaml] - Add support for SHT_LLVM_ADDRSIG sections.George Rimar2019-10-031-0/+1
| | | | | | | | | | | SHT_LLVM_ADDRSIG is described here: https://llvm.org/docs/Extensions.html#sht-llvm-addrsig-section-address-significance-table This patch teaches tools to dump them and to parse the YAML declarations of such sections. Differential revision: https://reviews.llvm.org/D68333 llvm-svn: 373598
* [llvm-readobj] - Stop using a precompiled binary in all.testGeorge Rimar2019-10-031-15/+24
| | | | | | | | | Having a precompiled binary here is excessive. I also added a few missing tags. Differential revision: https://reviews.llvm.org/D68386 llvm-svn: 373594
* [mips] Use llvm-readobj `-A` flag in test cases. NFCSimon Atanasyan2019-10-031-2/+2
| | | | llvm-svn: 373589
* [llvm-readobj][mips] Display MIPS specific info under --arch-specific flagSimon Atanasyan2019-10-035-16/+16
| | | | | | | Old options `--mips-plt-got`, `--mips-abi-flags`, '--mips-reginfo`, and `--mips-options` wiil be deleted in a separate patch. llvm-svn: 373588
* [llvm-readobj][mips] Do not show an error if GOT is missedSimon Atanasyan2019-10-031-8/+0
| | | | | | It is not an error if a file does not contain GOT. llvm-svn: 373587
* [llvm-readelf] - Report a warning when .hash section contains a chain with a ↵George Rimar2019-10-021-0/+40
| | | | | | | | | | | | cycle. It is possible to craft a .hash section that triggers an infinite loop in llvm-readelf code. This patch fixes the issue and introduces a warning. Differential revision: https://reviews.llvm.org/D68086 llvm-svn: 373476
* [yaml2obj/obj2yaml] - Add support for SHT_HASH sections.George Rimar2019-10-011-0/+1
| | | | | | | | | | | | | | | SHT_HASH specification is: http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#hash In short the format is the following: it has 2 uint32 fields in its header: nbucket and nchain followed by (nbucket + nchain) uint32 values. This patch allows dumping and parsing such sections. Differential revision: https://reviews.llvm.org/D68085 llvm-svn: 373315
* [llvm-readobj/llvm-readelf] Delete --arm-attributes (alias for --arch-specific)Fangrui Song2019-10-012-4/+0
| | | | | | | | | | | | | | | | 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
* [llvm-readobj] Rename --arm-attributes to --arch-specificYi Kong2019-09-2723-21/+29
| | | | | | | | | 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
* [llvm-readobj/llvm-readelf] - .stack_sizes: demangle symbol names in ↵George Rimar2019-09-251-12/+20
| | | | | | | | | | | | | | | warnings reported. I started this patch as a refactoring, tried to make a helper for getting symbol names, similar to how we get section names used in warning messages. So this patch cleanups the code and fixes an issue: symbol names in warning messages were not demangled. Differential revision: https://reviews.llvm.org/D68012 llvm-svn: 372867
* [llvm-readobj] - Simplify stack-sizes.test test case.George Rimar2019-09-251-10/+20
| | | | | | | | | | This is a follow-up for D67757, which allows to describe .stack_sizes sections with a new YAML syntax. Differential revision: https://reviews.llvm.org/D67759 llvm-svn: 372855
* [llvm-readobj] - Don't crash when dumping .stack_sizes and unable to find a ↵George Rimar2019-09-251-0/+26
| | | | | | | | | | | | | | | relocation resolver. The crash might happen when we have either a broken or unsupported object and trying to resolve relocations when dumping the .stack_sizes section. For the test case I used a 32-bits ELF header and a 64-bit relocation. In this case a null pointer is returned by the code instead of the relocation resolver function and then we crash. Differential revision: https://reviews.llvm.org/D67962 llvm-svn: 372838
* [yaml2obj/obj2yaml] - Add support for .stack_sizes sections.George Rimar2019-09-241-3/+4
| | | | | | | | | | | .stack_sizes is a SHT_PROGBITS section that contains pairs of <address (4/8 bytes), stack size (uleb128)>. This patch teach tools to parse and dump it. Differential revision: https://reviews.llvm.org/D67757 llvm-svn: 372762
* [llvm-readobj] - Stop treating ".stack_sizes.*" sections as stack sizes ↵George Rimar2019-09-231-3/+3
| | | | | | | | | | | | | | | | sections. llvm-readobj currently handles .stack_sizes.* (e.g. .stack_sizes.foo) as a normal stack sizes section. Though MC does not produce sections with such names. Also, linkers do not combine .stack_sizes.* into .stack_sizes. A mini discussion about this correctness issue is here: https://reviews.llvm.org/D67757#inline-609274 This patch changes implementation so that only now only '.stack_sizes' name is accepted as a real stack sizes section. Differential revision: https://reviews.llvm.org/D67824 llvm-svn: 372578
* [llvm-readobj] - Implement LLVM-style dumping for .stack_sizes sections.George Rimar2019-09-233-68/+195
| | | | | | | | | 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
* [llvm-readobj/llvm-objdump] - Improve how tool locate the dynamic table and ↵George Rimar2019-09-173-44/+215
| | | | | | | | | | | | | | | | | | | | | report warnings about that. Before this patch we gave a priority to a dynamic table found from the section header. It was discussed (here: https://reviews.llvm.org/D67078?id=218356#inline-602082) that probably preferring the table from PT_DYNAMIC is better, because it is what runtime loader sees. This patch makes the table from PT_DYNAMIC be chosen at first place if it is available. But also it adds logic to fall back to SHT_DYNAMIC if the table from the dynamic segment is broken or fall back to use no table if both are broken. It adds a few more diagnostic warnings for the logic above. Differential revision: https://reviews.llvm.org/D67547 llvm-svn: 372122
* [llvm-readobj] - Test PPC64 relocations properly.George Rimar2019-09-172-3/+258
| | | | | | | | | We had a precompiled binary committed and not all of the relocations supported were tested. This patch fixes this. Differential revision: https://reviews.llvm.org/D67617 llvm-svn: 372110
* [llvm-readobj] - Fix BB after r372087.George Rimar2019-09-171-1/+1
| | | | | | Seems I forgot to update the number of bytes checked. llvm-svn: 372089
* [llvm-readobj] - Fix a TODO in elf-reloc-zero-name-or-value.test.George Rimar2019-09-171-6/+20
| | | | | | | | | | | | | The "TODO" mentioned was: "Add test for symbol with no name but with a value once yaml2obj allows referencing symbols with no name from relocations." We can do it now. Differential revision: https://reviews.llvm.org/D67609 llvm-svn: 372087
* [llvm-readelf] - Print unknown st_other value if present in GNU output.George Rimar2019-09-061-17/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a fix for https://bugs.llvm.org/show_bug.cgi?id=40785. llvm-readelf does not print the st_value of the symbol when st_value has any non-visibility bits set. This patch: * Aligns "Ndx" row for the default and a new cases. (it was 1 space character off for the case when "PROTECTED" visibility was printed) * Prints "[<other>: 0x??]" for symbols which has an additional st_other bits set. In compare with GNU, this logic is a bit simpler and seems to be more consistent. For MIPS GNU can print named flags, though can't print a mix of them: 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 NOTYPE GLOBAL DEFAULT [OPTIONAL] UND a1 2: 00000000 0 NOTYPE GLOBAL DEFAULT [MIPS PLT] UND a2 3: 00000000 0 NOTYPE GLOBAL DEFAULT [MIPS PIC] UND a3 4: 00000000 0 NOTYPE GLOBAL DEFAULT [MICROMIPS] UND a4 5: 00000000 0 NOTYPE GLOBAL DEFAULT [MIPS16] UND a5 6: 00000000 0 NOTYPE GLOBAL DEFAULT [<other>: c] UND b1 7: 00000000 0 NOTYPE GLOBAL DEFAULT [<other>: 28] UND b2 On PPC64 it can print a localentry value that is encoded in the high bits of st_other 63: 0000000000000850 208 FUNC GLOBAL DEFAULT [<localentry>: 8] 12 We chose to print the raw st_other field, prefixed with '0x'. Differential revision: https://reviews.llvm.org/D67094 llvm-svn: 371201
* Fix rL371162 againAlex Brachet2019-09-061-4/+4
| | | | llvm-svn: 371164
* Fix failing test from rL371162Alex Brachet2019-09-061-2/+2
| | | | llvm-svn: 371163
* [llvm-readobj][yaml2obj] Support SHT_LLVM_SYMPART, SHT_LLVM_PART_EHDR and ↵Fangrui Song2019-09-061-0/+20
| | | | | | | | | | | | | | | | | | | | | SHT_LLVM_PART_PHDR See http://lists.llvm.org/pipermail/llvm-dev/2019-February/130583.html and D60242 for the lld partition feature. This patch: * Teaches yaml2obj to parse the 3 section types. * Teaches llvm-readobj/llvm-readelf to dump the 3 section types. There is no test for SHT_LLVM_DEPENDENT_LIBRARIES in llvm-readobj. Add it as well. Reviewed By: thakis Differential Revision: https://reviews.llvm.org/D67228 llvm-svn: 371157
* [yaml2obj] Write the section header table after section contentsFangrui Song2019-09-0517-53/+53
| | | | | | | | | | | | | | | | | Linkers (ld.bfd/gold/lld) place the section header table at the very end. This allows tools to strip it, which is optional in executable/shared objects. In addition, if we add or section, the size of the section header table will change. Placing the section header table in the end keeps section offsets unchanged. yaml2obj currently places the section header table immediately after the program header. Follow what linkers do to make offset updating easier. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D67221 llvm-svn: 371074
* [llvm-readelf] - Allow dumping dynamic symbols when there is no program headers.George Rimar2019-09-051-6/+129
| | | | | | | | | | | | | | | | | | | | | | | | | D62179 introduced a regression. llvm-readelf lose the ability to dump the dynamic symbols when there is .dynamic section with a DT_SYMTAB, but there are no program headers: https://reviews.llvm.org/D62179#1652778 Below is a program flow before the D62179 change: 1) Find SHT_DYNSYM. 2) Find there is no PT_DYNAMIC => don't try to parse it. 3) Print dynamic symbols using information about them found on step (1). And after the change it became: 1) Find SHT_DYNSYM. 2) Find there is no PT_DYNAMIC => find SHT_DYNAMIC. 3) Parse dynamic table, but fail to handle the DT_SYMTAB because of the absence of the PT_LOAD. Report the "Virtual address is not in any segment" error. This patch fixes the issue. For doing this it checks that the value of DT_SYMTAB was mapped to a segment. If not - it ignores it. Differential revision: https://reviews.llvm.org/D67078 llvm-svn: 371071
* [yaml2obj][obj2yaml] - Use a single "Other" field instead of "Other", ↵George Rimar2019-08-301-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Visibility" and "StOther". Currenly we can encode the 'st_other' field of symbol using 3 fields. 'Visibility' is used to encode STV_* values. 'Other' is used to encode everything except the visibility, but it can't handle arbitrary values. 'StOther' is used to encode arbitrary values when 'Visibility'/'Other' are not helpfull enough. 'st_other' field is used to encode symbol visibility and platform-dependent flags and values. Problem to encode it is that it consists of Visibility part (STV_* values) which are enumeration values and the Other part, which is different and inconsistent. For MIPS the Other part contains flags for all STO_MIPS_* values except STO_MIPS_MIPS16. (Like comment in ELFDumper says: "Someones in their infinite wisdom decided to make STO_MIPS_MIPS16 flag overlapped with other ST_MIPS_xxx flags."...) And for PPC64 the Other part might actually encode any value. This patch implements custom logic for handling the st_other and removes 'Visibility' and 'StOther' fields. Here is an example of a new YAML style this patch allows: - Name: foo Other: [ 0x4 ] - Name: bar Other: [ STV_PROTECTED, 4 ] - Name: zed Other: [ STV_PROTECTED, STO_MIPS_OPTIONAL, 0xf8 ] Differential revision: https://reviews.llvm.org/D66886 llvm-svn: 370472
* [COFF] Add a ResourceSectionRef method for getting resource contentsMartin Storsjo2019-08-301-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows llvm-readobj to print the contents of each resource when printing resources from an object file or executable, like it already does for plain .res files. This requires providing the whole COFFObjectFile to ResourceSectionRef. This supports both object files and executables. For executables, the DataRVA field is used as is to look up the right section. For object files, ideally we would need to complete linking of them and fix up all relocations to know what the DataRVA field would end up being. In practice, the only thing that makes sense for an RVA field is an ADDR32NB relocation. Thus, find a relocation pointing at this field, verify that it has the expected type, locate the symbol it points at, look up the section the symbol points at, and read from the right offset in that section. This works both for GNU windres object files (which use one single .rsrc section, with all relocations against the base of the .rsrc section, with the original value of the DataRVA field being the offset of the data from the beginning of the .rsrc section) and cvtres object files (with two separate .rsrc$01 and .rsrc$02 sections, and one symbol per data entry, with the original pre-relocated DataRVA field being set to zero). Differential Revision: https://reviews.llvm.org/D66820 llvm-svn: 370433
* [llvm-readobj/llvm-readelf] - Report a proper warning when dumping a broken ↵George Rimar2019-08-291-0/+51
| | | | | | | | | | | | | dynamic relocation. When we have a dynamic relocation with a broken symbol's st_name, tools report a useless error: "Invalid data was encountered while parsing the file". After this change we report a warning + "<corrupt>" as a symbol name. Differential revision: https://reviews.llvm.org/D66734 llvm-svn: 370330
* [COFF] Add a ResourceSectionRef method for getting the data entry, print it ↵Martin Storsjo2019-08-291-0/+48
| | | | | | | | in llvm-readobj Differential Revision: https://reviews.llvm.org/D66819 llvm-svn: 370311
* [llvm-readobj] Print the resource type textually for .res filesMartin Storsjo2019-08-291-7/+7
| | | | | | | | This already is done when dumping resources from coff objects. Differential Revision: https://reviews.llvm.org/D66816 llvm-svn: 370308
* [XCOFF][AIX] Generate symbol table entries with llvm-readobjJason Liu2019-08-272-0/+446
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements main entry and auxiliary entries of symbol table generation for llvm-readobj on AIX. The source code of aix_xcoff_xlc_test8.o (compile with xlc) is: -bash-4.2$ cat test8.c extern int i; extern int TestforXcoff; extern int fun(int i); static int static_i; char* p="abcd"; int fun1(int j) { static_i++; j++; j=j+*p; return j; } int main() { i++; fun(i); return fun1(i); } Patch provided by DiggerLin Differential Revision: https://reviews.llvm.org/D65240 llvm-svn: 370097
* [yaml2obj] - Allow setting the symbol st_other field to any integer.George Rimar2019-08-231-17/+6
| | | | | | | | | | | | | | | | | st_other field of a symbol usually contains its visibility. Other bits are usually 0, though some targets, like MIPS can set them using the named bit field values. Problem is that there is no way to set an arbitrary value now, though that might be useful for our test cases. In this patch I introduced a way to set st_other to any numeric value using the new StOther field. I added a test and simplified the existent one to show the effect/benefit Differential revision: https://reviews.llvm.org/D66583 llvm-svn: 369742
* [yaml2obj] - Lookup relocation symbols in dynamic symbol when .dynsym ↵George Rimar2019-08-221-3/+1
| | | | | | | | | | | | | | | | referenced. This fixes https://bugs.llvm.org/show_bug.cgi?id=40337. Previously, it was always assumed that relocations referenced symbols in the static symbol table. Now, if the Link field references a section called ".dynsym" it will look up these symbols in the dynamic symbol table. This patch is heavily based on D59097 by James Henderson Differential revision: https://reviews.llvm.org/D66532 llvm-svn: 369645
* [llvm-readobj] Prepend argv[0] to error/warning messagesFangrui Song2019-08-201-0/+19
| | | | | | | | | | | | | | | | | | | | 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
* [test/Object] - Move/rewrite 2 more test cases.George Rimar2019-08-201-0/+26
| | | | | | | | | | | | | | | This patch makes a change for test/Object tests responsible for relocations. * 2 tests were moved to llvm-readobj/llvm-objdump folders: Object/elf-reloc-no-sym.test -> tools/llvm-readobj/elf-reloc-no-sym.test Object/objdump-reloc-shared.test -> tools/llvm-objdump/relocations-in-nonreloc.test * A prerecompiled binary was removed and these tests were refactored. Differential revision: https://reviews.llvm.org/D66291 llvm-svn: 369342
* Recommit r369190 "[llvm-readobj/llvm-readelf] - Improve/cleanup the error ↵George Rimar2019-08-179-48/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert r369190, r369192 ([llvm-readobj/llvm-readelf] - Improve/cleanup the ↵George Rimar2019-08-179-48/+48
| | | | | | | | | | | 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
OpenPOWER on IntegriCloud