summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* Speeding up llvm-cov export with multithreaded renderFiles implementation.Max Moroz2019-03-142-0/+13
| | | | | | | | | | | | | | | | | | | | | Summary: CoverageExporterJson::renderFiles accounts for most of the execution time given a large profdata file with multiple binaries. Proposed solution is to generate JSON for each file in parallel and sort at the end to preserve deterministic output. Also added flags to skip generating parts of the output to trim the output size. Patch by Sajjad Mirza (@sajjadm). Reviewers: Dor1s, vsk Reviewed By: Dor1s, vsk Subscribers: liaoyuke, mgrang, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59277 llvm-svn: 356178
* [llvm-objcopy]Don't implicitly strip sections in segmentsJames Henderson2019-03-145-6/+95
| | | | | | | | | | | | | | | | | | | | | | | | | This patch changes llvm-objcopy's behaviour to not strip sections that are in segments, if they otherwise would be due to a stripping operation (--strip-all, --strip-sections, --strip-non-alloc). This preserves the segment contents. It does not change the behaviour of --strip-all-gnu (although we could choose to do so), because GNU objcopy's behaviour in this case seems to be to strip the section, nor does it prevent removing of sections in segments with --remove-section (if a user REALLY wants to remove a section, we should probably let them, although I could be persuaded that warning might be appropriate). Tests have been added to show this latter behaviour. This fixes https://bugs.llvm.org/show_bug.cgi?id=41006. Reviewed by: grimar, rupprecht, jakehehrlich Differential Revision: https://reviews.llvm.org/D59293 This is a reland of r356129, attempting to fix greendragon failures due to a suspected compatibility issue with od on the greendragon bots versus other versions. llvm-svn: 356136
* Revert r356129 due to greendragon bot failuresJames Henderson2019-03-145-95/+6
| | | | llvm-svn: 356133
* [llvm-objcopy]Don't implicitly strip sections in segmentsJames Henderson2019-03-145-6/+95
| | | | | | | | | | | | | | | | | | | | | This patch changes llvm-objcopy's behaviour to not strip sections that are in segments, if they otherwise would be due to a stripping operation (--strip-all, --strip-sections, --strip-non-alloc). This preserves the segment contents. It does not change the behaviour of --strip-all-gnu (although we could choose to do so), because GNU objcopy's behaviour in this case seems to be to strip the section, nor does it prevent removing of sections in segments with --remove-section (if a user REALLY wants to remove a section, we should probably let them, although I could be persuaded that warning might be appropriate). Tests have been added to show this latter behaviour. This fixes https://bugs.llvm.org/show_bug.cgi?id=41006. Reviewed by: grimar, rupprecht, jakehehrlich Differential Revision: https://reviews.llvm.org/D59293 llvm-svn: 356129
* [llvm-objcopy] Cleanup errors from CopyConfig and remove llvm-objcopy.h ↵Jordan Rupprecht2019-03-131-3/+5
| | | | | | | | | | dependency error() was previously cleaned up from CopyConfig, but new uses were introduced. This also tweaks the error message for --add-symbol to report all invalid flags. llvm-svn: 356105
* [ELF] Fix GCC8 warnings about "fall through", NFCIJonas Hahnfeld2019-03-133-193/+301
| | | | | | | | | | | | | | | Add break statements in Object/ELF.cpp since the code should consider the generic tags for Hexagon, MIPS, and PPC. Add a test (copied from llvm-readobj) to show that this works correctly (earlier versions of this patch would have asserted). The warnings in X86ELFObjectWriter.cpp are actually false-positives since the nested switch() handles all possible values and returns in all cases. Make this explicit by adding llvm_unreachable's. Differential Revision: https://reviews.llvm.org/D58837 llvm-svn: 356037
* Revert "[llvm] Skip over empty line table entries."Evgeniy Stepanov2019-03-133-216/+3
| | | | | | | This reverts commit r355972. See the discussion at https://reviews.llvm.org/D58952. llvm-svn: 356001
* [llvm] Skip over empty line table entries.Mircea Trofin2019-03-123-3/+216
| | | | | | | | | | | | | | | | | | Summary: This is similar to how addr2line handles consecutive entries with the same address - pick the last one. Reviewers: dblaikie, friss, JDevlieghere Reviewed By: dblaikie Subscribers: ormris, echristo, JDevlieghere, probinson, aprantl, hiraditya, rupprecht, jdoerfert, llvm-commits Tags: #llvm, #debug-info Differential Revision: https://reviews.llvm.org/D58952 llvm-svn: 355972
* [yaml2obj]Allow explicit symbol indexes in relocations and emit error for ↵James Henderson2019-03-124-17/+63
| | | | | | | | | | | | | | | | | | | | | bad names Prior to this change, the "Symbol" field of a relocation would always be assumed to be a symbol name, and if no such symbol existed, the relocation would reference index 0. This confused me when I tried to use a literal symbol index in the field: since "0x1" was not a known symbol name, the symbol index was set as 0. This change falls back to treating unknown symbol names as integers, and emits an error if the name is not found and the string is not an integer. Note that the Symbol field is optional, so if a relocation doesn't reference a symbol, it shouldn't be specified. The new error required a number of test updates. Reviewed by: grimar, ruiu Differential Revision: https://reviews.llvm.org/D58510 llvm-svn: 355938
* [llvm-cxxfilt]Add test to show that empty lines can be handledJames Henderson2019-03-121-0/+9
| | | | | | | | | | | | | | | | I recently discovered a bug in llvm-cxxfilt introduced in r353743 but was fixed later incidentally due to r355031. Specifically, llvm-cxxfilt was attempting to call .back() on an empty string any time there was a new line in the input. This was causing a crash in my debug builds only. This patch simply adds a test that explicitly tests that llvm-cxxfilt handles empty lines correctly. It may pass under release builds under the broken behaviour, but it fails at least in debug builds. Reviewed by: mattd Differential Revision: https://reviews.llvm.org/D58785 llvm-svn: 355929
* [llvm-readobj] Print symbol version when dumping relocations (PR31564)Xing GUO2019-03-121-0/+100
| | | | | | | | | | | | | | | | Summary: This helps resolve https://bugs.llvm.org/show_bug.cgi?id=31564 Reviewers: jhenderson, grimar Reviewed By: jhenderson Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59175 llvm-svn: 355922
* Detect malformed LC_LINKER_COMMANDs in Mach-O binariesMichael Trent2019-03-112-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | Summary: llvm-objdump can be tricked into reading beyond valid memory and segfaulting if LC_LINKER_COMMAND strings are not null terminated. libObject does have code to validate the integrity of the LC_LINKER_COMMAND struct, but this validator improperly assumes linker command strings are null terminated. The solution is to report an error if a string extends beyond the end of the LC_LINKER_COMMAND struct. Reviewers: lhames, pete Reviewed By: pete Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59179 llvm-svn: 355851
* [llvm-objcopy] - Fix --compress-debug-sections when there are relocations.George Rimar2019-03-113-3/+15
| | | | | | | | | | | | | | | When --compress-debug-sections is given, llvm-objcopy removes the uncompressed sections and adds compressed to the section list. This makes all the pointers to old sections to be outdated. Currently, code already has logic for replacing the target sections of the relocation sections. But we also have to update the relocations by themselves. This fixes https://bugs.llvm.org/show_bug.cgi?id=40885. Differential revision: https://reviews.llvm.org/D58960 llvm-svn: 355821
* Improve "llvm-nm -f sysv" output for Elf filesSunil Srivastava2019-03-082-5/+6
| | | | | | | | | | Specifically, compute and Print Type and Section columns. This is a re-commit of rL354833, after fixing the Asan problem found a a buildbot. Differential Revision: https://reviews.llvm.org/D59060 llvm-svn: 355742
* [llvm-readelf]Don't lose negative-ness of negative addends for no symbol ↵James Henderson2019-03-081-0/+74
| | | | | | | | | | | | | | | | | | | | relocations llvm-readelf prints relocation addends as: <symbol value>[+-]<absolute addend> where [+-] is determined from whether addend is less than zero or not. However, it does not print the +/- if there is no symbol, which meant that negative addends became their positive value with no indication that this had happened. This patch stops the absolute conversion when addends are negative and there is no associated symbol. Reviewed by: Higuoxing, mattd, MaskRay Differential Revision: https://reviews.llvm.org/D59095 llvm-svn: 355696
* [X86] Correct scheduler information for rotate by constant for Haswell, ↵Craig Topper2019-03-074-68/+68
| | | | | | | | | | | | | | Broadwell, and Skylake. Rotate with explicit immediate is a single uop from Haswell on. An immediate of 1 has a dependency on the previous writer of flags, but the other immediate values do not. The implicit rotate by 1 instruction is 2 uops. But the flags are merged after the rotate uop so the data result does not see the flag dependency. But I don't think we have any way of modeling that. RORX is 1 uop without the load. 2 uops with the load. We currently model these with WriteShift/WriteShiftLd. Differential Revision: https://reviews.llvm.org/D59077 llvm-svn: 355636
* [X86] Model ADC/SBB with immediate 0 more accurately in the Haswell ↵Craig Topper2019-03-071-13/+13
| | | | | | | | | | scheduler model Haswell and possibly Sandybridge have an optimization for ADC/SBB with immediate 0 to use a single uop flow. This only applies GR16/GR32/GR64 with an 8-bit immediate. It does not apply to GR8. It also does not apply to the implicit AX/EAX/RAX forms. Differential Revision: https://reviews.llvm.org/D59058 llvm-svn: 355635
* [llvm-mca] Emit a message when no bottlenecks are identified.Matt Davis2019-03-071-0/+16
| | | | | | | | | | | | | | | | | | | | Summary: Since bottleneck hints are enabled via user request, it can be confusing if no bottleneck information is presented. Such is the case when no bottlenecks are identified. This patch emits a message in that case. Reviewers: andreadb Reviewed By: andreadb Subscribers: tschuett, gbedwell, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59098 llvm-svn: 355628
* [DebugInfo] Fix the type of the formated variablePetar Jovanovic2019-03-071-2/+2
| | | | | | | | | | | | | Change the format type of *Personality and *LSDAAddress to PRIx64 since they are of type uint64_t. The problem was detected on mips builds, where it was printing junk values and causing test failure. Patch by Milos Stojanovic. Differential Revision: https://reviews.llvm.org/D58451 llvm-svn: 355607
* [llvm-readobj] Dump DT_USED value as string like GNU readelf doesXing GUO2019-03-071-2/+6
| | | | | | | | | | | | | | Reviewers: jhenderson Reviewed By: jhenderson Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59089 llvm-svn: 355600
* [yaml2obj] - Allow producing ELFDATANONE ELFsGeorge Rimar2019-03-071-0/+15
| | | | | | | | | I need this to remove a binary from LLD test suite. The patch also simplifies the code a bit. Differential revision: https://reviews.llvm.org/D59082 llvm-svn: 355591
* [PGO] Context sensitive PGO (part 4)Rong Xu2019-03-067-0/+293
| | | | | | | | | | | Part 4 of CSPGO changes: (1) add support in cmake for cspgo build. (2) fix an issue in big endian. (3) test cases. Differential Revision: https://reviews.llvm.org/D54175 llvm-svn: 355541
* [llvm-mca][X86] Add ADC/SBB with zero test casesSimon Pilgrim2019-03-0611-11/+803
| | | | | | Some targets have fast-path handling for these patterns that we should model. llvm-svn: 355498
* [BinaryFormat] Add DT_USED tag into dynamic section.Xing GUO2019-03-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This tag is documented in https://docs.oracle.com/cd/E19253-01/817-1984/chapter6-42444/index.html Though I could not find some docs that describe it in detail, I found some code snippets. 1. ``` /* * Look up the string in the string table and get its offset. If * this succeeds, then it is possible that there is a DT_NEEDED * dynamic entry that references it. */ have_string = elfedit_sec_findstr(argstate->str.sec, strpad_elt.dn_dyn.d_un.d_val, arg, &str_offset) != 0; if (have_string) { dyn = argstate->dynamic.data; for (ndx = 0; ndx < numdyn; dyn++, ndx++) { if (((dyn->d_tag == DT_NEEDED) || (dyn->d_tag == DT_USED)) && (dyn->d_un.d_val == str_offset)) goto done; } } ``` https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/cmd/sgs/elfedit/modules/common/syminfo.c#L512 2. ``` case DT_USED: case DT_INIT_ARRAY: case DT_FINI_ARRAY: if (do_dynamic) { if (entry->d_tag == DT_USED && VALID_DYNAMIC_NAME (entry->d_un.d_val)) { char *name = GET_DYNAMIC_NAME (entry->d_un.d_val); if (*name) { printf (_("Not needed object: [%s]\n"), name); break; } } print_vma (entry->d_un.d_val, PREFIX_HEX); putchar ('\n'); } break; ``` http://web.mit.edu/freebsd/head/contrib/binutils/binutils/readelf.c 3. ``` #define DT_USED 0x7ffffffe /* ignored - same as needed */ ``` https://github.com/switchbrew/switch-tools/blob/master/src/elf_common.h Reviewers: jhenderson, grimar Reviewed By: jhenderson, grimar Subscribers: emaste, krytarowski, fedor.sergeev, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58762 llvm-svn: 355468
* [DWARFFormValue] Don't consider DW_FORM_data4/8 to be section offsets.Jonas Devlieghere2019-03-052-0/+646
| | | | | | | | | | | | | | | | | | | | | | | | | | | When dumping ToT clan's debug info with dwarfdump, we were seeing an error saying that that the location list overflows the debug_loc section. After reducing the testcase we figured out that we were interpreting the DW_FORM_data4 as a section offset. In DWARF3 DW_FORM_data4 and DW_FORM_data8 served also as a section offset. Until now we didn't check check for the DWARF version, because some producers (read old versions of clang) were still emitting this. The relevant code/comment was added in 2013, and I believe it's now reasonable to start checking the version. The FormValue class is a little bit of a mess because it cashes the DWARF unit and context when it extracted the value itself. Several methods of the class rely on it being present, or return an Optional for the code path that needs it. At the same time the FormValue class also used in places where there's no DWARF unit. For this patch I went with the least invasive change: checking the version from the CU when it's available. If it's not (because the form value was created from a value directly) we default to the old behavior. Differential revision: https://reviews.llvm.org/D58698 llvm-svn: 355456
* [llvm-objcopy] - Simplify `isCompressable` and fix the issue relative.George Rimar2019-03-051-0/+41
| | | | | | | | | | | | When --compress-debug-sections is given, llvm-objcopy do not compress sections that have "ZLIB" header in data. Normally this signature is used in zlib-gnu compression format. But if zlib-gnu used then the name of the compressed section should start from .z* (e.g .zdebug_info). If it does not, then it is not a zlib-gnu format and section should be treated as a normal uncompressed section. Differential revision: https://reviews.llvm.org/D58908 llvm-svn: 355399
* [MCA] Highlight kernel bottlenecks in the summary view.Andrea Di Biagio2019-03-043-0/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new flag named -bottleneck-analysis to print out information about throughput bottlenecks. MCA knows how to identify and classify dynamic dispatch stalls. However, it doesn't know how to analyze and highlight kernel bottlenecks. The goal of this patch is to teach MCA how to correlate increases in backend pressure to backend stalls (and therefore, the loss of throughput). From a Scheduler point of view, backend pressure is a function of the scheduler buffer usage (i.e. how the number of uOps in the scheduler buffers changes over time). Backend pressure increases (or decreases) when there is a mismatch between the number of opcodes dispatched, and the number of opcodes issued in the same cycle. Since buffer resources are limited, continuous increases in backend pressure would eventually leads to dispatch stalls. So, there is a strong correlation between dispatch stalls, and how backpressure changed over time. This patch teaches how to identify situations where backend pressure increases due to: - unavailable pipeline resources. - data dependencies. Data dependencies may delay execution of instructions and therefore increase the time that uOps have to spend in the scheduler buffers. That often translates to an increase in backend pressure which may eventually lead to a bottleneck. Contention on pipeline resources may also delay execution of instructions, and lead to a temporary increase in backend pressure. Internally, the Scheduler classifies instructions based on whether register / memory operands are available or not. An instruction is marked as "ready to execute" only if data dependencies are fully resolved. Every cycle, the Scheduler attempts to execute all instructions that are ready to execute. If an instruction cannot execute because of unavailable pipeline resources, then the Scheduler internally updates a BusyResourceUnits mask with the ID of each unavailable resource. ExecuteStage is responsible for tracking changes in backend pressure. If backend pressure increases during a cycle because of contention on pipeline resources, then ExecuteStage sends a "backend pressure" event to the listeners. That event would contain information about instructions delayed by resource pressure, as well as the BusyResourceUnits mask. Note that ExecuteStage also knows how to identify situations where backpressure increased because of delays introduced by data dependencies. The SummaryView observes "backend pressure" events and prints out a "bottleneck report". Example of bottleneck report: ``` Cycles with backend pressure increase [ 99.89% ] Throughput Bottlenecks: Resource Pressure [ 0.00% ] Data Dependencies: [ 99.89% ] - Register Dependencies [ 0.00% ] - Memory Dependencies [ 99.89% ] ``` A bottleneck report is printed out only if increases in backend pressure eventually caused backend stalls. About the time complexity: Time complexity is linear in the number of instructions in the Scheduler::PendingSet. The average slowdown tends to be in the range of ~5-6%. For memory intensive kernels, the slowdown can be significant if flag -noalias=false is specified. In the worst case scenario I have observed a slowdown of ~30% when flag -noalias=false was specified. We can definitely recover part of that slowdown if we optimize class LSUnit (by doing extra bookkeeping to speedup queries). For now, this new analysis is disabled by default, and it can be enabled via flag -bottleneck-analysis. Users of MCA as a library can enable the generation of pressure events through the constructor of ExecuteStage. This patch partially addresses https://bugs.llvm.org/show_bug.cgi?id=37494 Differential Revision: https://reviews.llvm.org/D58728 llvm-svn: 355308
* [llvm-objdump] Should print unknown d_tag in hex formatXing GUO2019-03-021-0/+3
| | | | | | | | | | | | | | | | | | Summary: Currently, `llvm-objdump` prints "unknown" instead of d_tag value in hex format. Because getDynamicTagAsString returns "unknown" rather than empty string. Reviewers: grimar, jhenderson Reviewed By: jhenderson Subscribers: rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58763 llvm-svn: 355262
* llvm-dwarfdump: Add new variable, parameter and inlining statistics; also ↵Caroline Tice2019-03-013-1/+1244
| | | | | | | | | | | | | function source location statistics. Add statistics for abstract origins, function, variable and parameter locations; break the 'variable' counts down into variables and parameters. Also update call site counting to check for DW_AT_call_{file,line} in addition to DW_TAG_call_site. Differential revision: https://reviews.llvm.org/D58849 llvm-svn: 355243
* [llvm-readobj] Display section names for STT_SECTION symbols.Matt Davis2019-03-012-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch will obtain the section name for symbols that refer to a section. Prior to this patch the Name field for STT_SECTIONs was blank, now it is populated. Before: ``` Symbol table '.symtab' contains 6 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 SECTION LOCAL DEFAULT 1 2: 0000000000000000 0 SECTION LOCAL DEFAULT 3 3: 0000000000000000 0 SECTION LOCAL DEFAULT 4 4: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND _GLOBAL_OFFSET_TABLE_ 5: 0000000000000000 0 TLS GLOBAL DEFAULT UND sym ``` With this patch: ``` Symbol table '.symtab' contains 6 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 SECTION LOCAL DEFAULT 1 .text 2: 0000000000000000 0 SECTION LOCAL DEFAULT 3 .data 3: 0000000000000000 0 SECTION LOCAL DEFAULT 4 .bss 4: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND _GLOBAL_OFFSET_TABLE_ 5: 0000000000000000 0 TLS GLOBAL DEFAULT UND sym ``` This fixes PR40788 Reviewers: jhenderson, rupprecht, espindola Reviewed By: rupprecht Subscribers: emaste, javed.absar, arichardson, MaskRay, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58796 llvm-svn: 355207
* [yaml2obj] - Allow setting custom sh_info for RawContentSection sections.George Rimar2019-03-013-0/+84
| | | | | | | | | | | This is for tweaking SHT_SYMTAB sections. Their sh_info contains the (number of symbols + 1) usually. But for creating invalid inputs for test cases it would be convenient to allow explicitly override this field from YAML. Differential revision: https://reviews.llvm.org/D58779 llvm-svn: 355193
* [llvm-readobj]Add test showing behaviour of thin archive member path printingJames Henderson2019-03-011-0/+33
| | | | | | | | | | This was a test requested in https://reviews.llvm.org/D58677. Reviewed by: rupprecht, grimar, Higuoxing Differential Revision: https://reviews.llvm.org/D5877 llvm-svn: 355183
* llvm-readobj: Try the DWARF CFI dumper on all machines.Peter Collingbourne2019-02-283-0/+55
| | | | | | | | | | | | There's no reason to limit the DWARF CFI dumper to EM_386 and EM_X86_64; ELF files could contain DWARF CFI on almost any platform (even 32-bit ARM; NetBSD uses DWARF CFI on that platform). So start using the DWARF CFI dumper unconditionally so that we can dump .eh_frame sections on the remaining ELF platforms as well as in NetBSD binaries. Differential Revision: https://reviews.llvm.org/D58761 llvm-svn: 355151
* dsymutil support for DW_OP_convertAdrian Prantl2019-02-283-0/+78
| | | | | | | | | | | Add support for cloning DWARF expressions that contain base type DIE references in dsymutil. <rdar://problem/48167812> Differential Revision: https://reviews.llvm.org/D58534 llvm-svn: 355148
* [AArch64] [Windows] Fix llvm-readobj -unwind output with many epilogs.Eli Friedman2019-02-281-0/+26
| | | | | | | | | | The number of epilog scopes may not fit into a uint8_t. Fixes https://bugs.llvm.org/show_bug.cgi?id=40855 Differential Revision: https://reviews.llvm.org/D58693 llvm-svn: 355135
* [WebAssembly] Remove uses of ThreadModelThomas Lively2019-02-282-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In the clang UI, replaces -mthread-model posix with -matomics as the source of truth on threading. In the backend, replaces -thread-model=posix with the atomics target feature, which is now collected on the WebAssemblyTargetMachine along with all other used features. These collected features will also be used to emit the target features section in the future. The default configuration for the backend is thread-model=posix and no atomics, which was previously an invalid configuration. This change makes the default valid because the thread model is ignored. A side effect of this change is that objects are never emitted with passive segments. It will instead be up to the linker to decide whether sections should be active or passive based on whether atomics are used in the final link. Reviewers: aheejin, sbc100, dschuff Subscribers: mehdi_amini, jgravelle-google, hiraditya, sunfish, steven_wu, dexonsmith, rupprecht, jfb, jdoerfert, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D58742 llvm-svn: 355112
* [llvm-objdump] - Improve the error message for "removing a section that is ↵George Rimar2019-02-281-1/+1
| | | | | | | | | | used by relocation" case. This refines/improves the error message introduced in D58625 Differential revision: https://reviews.llvm.org/D58709 llvm-svn: 355074
* [llvm-readobj] - Fix the invalid dumping of the dynamic sections without ↵George Rimar2019-02-281-0/+78
| | | | | | | | | | | | | | | | terminating DT_NULL entry. This is https://bugs.llvm.org/show_bug.cgi?id=40861, Previously llvm-readobj would print the DT_NULL sometimes for the dynamic section that has no terminator entry. The logic of printDynamicTable was a bit overcomplicated. I rewrote it slightly to fix the issue and commented. Differential revision: https://reviews.llvm.org/D58716 llvm-svn: 355073
* Fixup compilation/test failures after r354960 and r355013.James Y Knight2019-02-271-0/+1
| | | | llvm-svn: 355034
* [llvm-cxxfilt] Re-enable split and demangle stdin input on certain ↵Matt Davis2019-02-271-0/+63
| | | | | | | | | | | | | | | | non-alphanumerics. This restores the patch that splits demangled stdin input on non-alphanumerics. I had reverted this patch earlier because it broke Windows build-bots. I have updated the test so that it passes on Windows. I was running the test from powershell and never saw the issue until I switched to the mingw shell. This reverts commit 628ab5c6820bdf3bb5a8e494b0fd9e7312ce7150. llvm-svn: 355031
* Revert "[llvm-cxxfilt] Split and demangle stdin input on certain ↵Matt Davis2019-02-271-63/+0
| | | | | | | | | | | | | non-alphanumerics." This reverts commit 5cd5f8f2563395f8767f94604eb4c4bea8dcbea0. The test passes on linux, but fails on the windows build-bots. This test failure seems to be a quoting issue between my test and FileCheck on Windows. I'm reverting this patch until I can replicate and fix in my Windows environment. llvm-svn: 355021
* [llvm-readobj] Print section type values for unknown sections.Matt Davis2019-02-271-6/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch displays a hexadecimal section value (Elf_Shdr::sh_type) or section-relative offset when printing unknown sections. Here is a subset of the output (ignoring the fields following "Type" when dumping an ELF's GNU `--section-headers` table). Section Headers: ``` [Nr] Name Type [16] android_rel LOOS+0x1 [17] android_rela LOOS+0x2 [27] unknown 0x1000: <unknown> [28] loos LOOS+0 [30] hios VERSYM [31] loproc LOPROC+0 [33] hiproc LOPROC+0xFFFFFFF [34] louser LOUSER+0 [36] hiuser LOUSER+0x7FFFFFFF ``` As a comparison, the previous output looked something like the above, but with a blank "Type" field: ``` [Nr] Name Type [27] unknown [28] loos [30] hios VERSYM [31] loproc [33] hiproc [34] louser [36] hiuser ``` This fixes PR40773 Reviewers: jhenderson, rupprecht, Bigcheese Reviewed By: jhenderson, rupprecht, Bigcheese Subscribers: MaskRay, Bigcheese, srhines, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58701 llvm-svn: 355014
* [llvm-cxxfilt] Re-enable the delimiters test on Windows.Matt Davis2019-02-271-1/+0
| | | | | | | | | | The original intent was to enable this test for Windows; however, that initial patch broke one of the build-bots. I temporarily disabled this test on Windows until that issue was resolved. It was resolved in my previous patch (cfd1d9742ee2d1b8dd6b7), and now I am re-enabling this test. llvm-svn: 355011
* Clean up the delimiters test.Matt Davis2019-02-271-30/+30
| | | | | | | | | | | | Ideally this is a NFCI, used single quotes in most cases. Hopefully this will make the Windows bot happy. I've marked this unsupported on windows, until I get my windows box setup with this patch to test. I'll remove that constraint after I'm confident this will pass on windows. I just want to silence the buildbots for now. llvm-svn: 355007
* [llvm-readobj]Add additional testing for various ELF featuresJames Henderson2019-02-2711-0/+1152
| | | | | | | | | | | | | This patch adds testing of areas of the code that are not fully tested, in particular dynamic table printing, ELF type printing, handling of edge cases where things are missing/empty (relocations/program header tables/section header table), and the --string-dump switch. Reviewed by: grimar, higuoxing, rupprecht Differential Revision: https://reviews.llvm.org/D58677 llvm-svn: 355003
* [llvm-objdump] Should print strings when dumping DT_RPATH, DT_RUNPATH, ↵Xing GUO2019-02-271-0/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DT_SONAME, DT_AUXILIARY and DT_FILTER tags in dynamic section. Summary: Before: ``` Dynamic Section: NEEDED libpthread.so.0 ... NEEDED ld-linux-x86-64.so.2 RPATH 0x00000000001c2e61 ``` After: ``` Dynamic Section: NEEDED libpthread.so.0 ... NEEDED ld-linux-x86-64.so.2 RPATH $ORIGIN/../lib ``` Only a small problem here, I have no idea on choosing test case. I see there's a test file(test/tools/llvm-objdump/private-headers-dynamic-section.test). But it has no DT_RPATH and DT_RUNPATH tags. Shall I replace the ELF file in the Inputs dir by a new one? Reviewers: jhenderson, grimar Reviewed By: jhenderson Subscribers: srhines, rupprecht, jfb, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58707 llvm-svn: 355001
* [llvm-cxxfilt] Split and demangle stdin input on certain non-alphanumerics.Matt Davis2019-02-271-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch attempts to replicate GNU c++-filt behavior when splitting stdin input for demangling. Previously, cxx-filt would split input only on spaces. Each delimited item is then demangled. From what I have tested, GNU c++filt also splits input on any character that does not make up the mangled name (notably commas, but also a large set of non-alphanumeric characters). This patch splits stdin input on any character that does not belong to the Itanium mangling format (since Itanium is currently the only supported format in llvm-cxxfilt). This is an update to PR39990 Reviewers: jhenderson, tejohnson, compnerd Reviewed By: compnerd Subscribers: erik.pilkington, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D58416 llvm-svn: 354998
* [DebugInfo] add SectionedAddress to DebugInfo interfaces.Alexey Lapshin2019-02-271-0/+221
| | | | | | | | | | | | | | | | | That patch is the fix for https://bugs.llvm.org/show_bug.cgi?id=40703 "wrong line number info for obj file compiled with -ffunction-sections" bug. The problem happened with only .o files. If object file contains several .text sections then line number information showed incorrectly. The reason for this is that DwarfLineTable could not detect section which corresponds to specified address(because address is the local to the section). And as the result it could not select proper sequence in the line table. The fix is to pass SectionIndex with the address. So that it would be possible to differentiate addresses from various sections. With this fix llvm-objdump shows correct line numbers for disassembled code. Differential review: https://reviews.llvm.org/D58194 llvm-svn: 354972
* [llvm-objcopy] - Check for invalidated relocations when removing a section.George Rimar2019-02-271-0/+51
| | | | | | | | | | | This is https://bugs.llvm.org/show_bug.cgi?id=40818 Removing a section that is used by relocation is an error we did not report. The patch fixes that. Differential revision: https://reviews.llvm.org/D58625 llvm-svn: 354962
* [llvm-readobj]Fix error messages for bad archive members and add testing for ↵James Henderson2019-02-272-0/+111
| | | | | | | | | | | | | | archive handling llvm-readobj's error messages were broken for bad archive members. This patch fixes them, and also adds testing for archive and thin archive handling within llvm-readobj. Reviewed by: rupprecht, grimar, higuoxing Differential Revision: https://reviews.llvm.org/D58681 llvm-svn: 354960
OpenPOWER on IntegriCloud