- Jan 16, 2019
-
-
Armando Montanez authored
This change gives the llvm-elfabi tool the ability to read DT_SONAME from a binary ELF file into an ELFStub. Added: - DynamicEntries struct for storing dynamic entries that are relevant to elfabi. - terminatedSubstr() retrieves a null-terminated substring from a StringRef. - appendToError() appends a string to an error, allowing more specific error messages. Differential Revision: https://reviews.llvm.org/D55629 llvm-svn: 351361
-
Sid Manning authored
Differential Revision: https://reviews.llvm.org/D56369 llvm-svn: 351356
-
Saurabh Badhwar authored
Summary: When llvm-nm is passed only the --size-sort option for an object file, there is no output generated. The commit modifies the behavior to print the symbols sorted and their size which is also inline with the output of the GNU nm tool. Signed-off-by:
Saurabh Badhwar <sbsaurabhbadhwar9@gmail.com> Reviewers: enderby, rupprecht Reviewed By: rupprecht Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D56063 llvm-svn: 351347
-
Pavel Labath authored
Summary: The version of make_absolute which accepted a specific directory to use as the "base" for the computation could never fail, even though it returned a std::error_code. The reason for that seems to be historical -- the CWD flavour (which can fail due to failure to retrieve CWD) was there first, and the new version was implemented by extending that. This removes the error return value from the non-CWD overload and reimplements the CWD version on top of that. This enables us to remove some dead code where people were pessimistically trying to handle the errors returned from this function. Reviewers: zturner, sammccall Subscribers: hiraditya, kristina, llvm-commits Differential Revision: https://reviews.llvm.org/D56599 llvm-svn: 351317
-
Martin Storsjö authored
This allows avoiding conflicts between paths that begin with the same chars as some llvm-rc options (which can be used with either slashes or dashes). Differential Revision: https://reviews.llvm.org/D56743 llvm-svn: 351305
-
Dmitry Venikov authored
Summary: Provides -C as alias to -demangle. Motivation: https://bugs.llvm.org/show_bug.cgi?id=40069. Reviewers: jhenderson, ruiu, rnk, fjricci Reviewed By: jhenderson, ruiu Subscribers: rupprecht, erik.pilkington, llvm-commits Differential Revision: https://reviews.llvm.org/D56591 llvm-svn: 351300
-
- Jan 15, 2019
-
-
Jordan Rupprecht authored
[llvm-ar] Resubmit recursive thin archive test with fix for full path names and better error messages llvm-svn: 351256
-
Michael Trent authored
Summary: When running llvm-objdump with the -macho option objdump will by default disassemble only the __TEXT,__text section (or __TEXT_EXEC,__text when disassembling MH_KEXT_BUNDLE files). The -disassemble-all option is treated no diferently than -disassemble. This change upates llvm-objdump's MachO parsing code to disassemble all __text sections found in a file when -disassemble-all is specified. This is useful for disassembling files with more than one __text section, or when disassembling files whose __text section is not present in __TEXT. I added a lit test case that verifies "llvm-objdump -m -d" and "llvm-objdump -m -D" produce the expected results on a reference binary. I also updated the CommandGuide documentation for llvm-objdump.rst and verified it renders correctly as man and html. rdar://42899338 Reviewers: ab, pete, lhames Reviewed By: lhames Subscribers: rupprecht, llvm-commits Differential Revision: https://reviews.llvm.org/D56649 llvm-svn: 351238
-
Jordan Rupprecht authored
Summary: This patch adds support for merged arguments (e.g. -SW == -S -W) for llvm-readelf. No changes are intended for llvm-readobj. There are a few short flags (-sd, -sr, -st, -dt) that would conflict with grouped single letter flags, and having only some grouped flags might be confusing. So, allow merged flags for readelf compatibility, but force separate args for llvm-readobj. From what I can tell, these two-letter flags are only used with llvm-readobj, not llvm-readelf. This fixes PR40064. Reviewers: jhenderson, kristina, echristo, phosek Reviewed By: jhenderson Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D56629 llvm-svn: 351205
-
Jordan Rupprecht authored
Summary: Fix llvm-objcopy to add .note sections as SHT_NOTEs. GNU objcopy overrides section flags for special sections. For `.note` sections (with the exception of `.note.GNU-stack`), SHT_NOTE is used. Many other sections are special cased by libbfd, but `.note` is the only special section I can seem to find being used with objcopy --add-section. See `.note` in context of the full list of special sections here: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=bfd/elf.c;h=eb3e1828e9c651678b95a1dcbc3b124783d1d2be;hb=HEAD#l2675 Reviewers: jhenderson, alexshap, jakehehrlich, espindola Reviewed By: jhenderson Subscribers: emaste, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D56570 llvm-svn: 351204
-
George Rimar authored
It was broken by me by mistake in r350823 during addressing the review comment before committing (changed not the right text line). llvm-svn: 351192
-
Martin Storsjö authored
Differential Revision: https://reviews.llvm.org/D56481 llvm-svn: 351174
-
George Rimar authored
This is a cosmetic cleanup for the llvm-objdump code. This patch: * Renames things to match the official LLVM code style (lower case -> upper case). * Removes few obviously excessive variables. * Moves a few lines closer to the place of use, reorders the code a bit to simplify it, to avoid doing excessive returns and to avoid using 'else` after returns. I focused only on a llvm-objdump.h/llvm-objdump.cpp files. Few changes in the MachODump.cpp and COFFDump.cpp are a result of llvm-objdump.h modification. Differential revision: https://reviews.llvm.org/D56637 llvm-svn: 351171
-
- Jan 14, 2019
-
-
Jordan Rupprecht authored
Summary: Normal behavior for GNU ar is to flatten thin archives when adding them to another thin archive, i.e. add the members directly instead of nesting the archive. Some refactoring done as part of this patch to ease things: - Consolidate `addMember`/`addLibMember` methods - Rename `addMember` to `addChildMember` to make it more visibly different at the call site that an archive child is passed instead of a regular member - Pass in a separate vector and splice it back into position instead of passing a vector + optional Pos (which makes expanding libs tricky) This fixes PR37530 as raised by https://github.com/ClangBuiltLinux/linux/issues/279. Reviewers: mstorsjo, pcc, ruiu Reviewed By: mstorsjo Subscribers: llvm-commits, tpimh, nickdesaulniers Differential Revision: https://reviews.llvm.org/D56508 llvm-svn: 351120
-
Martin Storsjö authored
Differential Revision: https://reviews.llvm.org/D56660 llvm-svn: 351099
-
Tom Stellard authored
Summary: This patch drops install targets for LLVMHello.so, TestPlugin.so, and BugpointPasses.so. Reviewers: chandlerc, beanz, thakis, philip.pfaffe Reviewed By: chandlerc Subscribers: SquallATF, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D55965 llvm-svn: 351087
-
Dmitry Venikov authored
Summary: Provides -addresses, -a as aliases for -print-address. Motivation: https://bugs.llvm.org/show_bug.cgi?id=40067. Reviewers: jhenderson, ruiu, rnk, fjricci Reviewed By: jhenderson Subscribers: rupprecht, llvm-commits Differential Revision: https://reviews.llvm.org/D56635 llvm-svn: 351043
-
- Jan 13, 2019
-
-
James Y Knight authored
This shortcut mechanism for creating types was added 10 years ago, but has seen almost no uptake since then, neither internally nor in external projects. The very small number of characters saved by using it does not seem worth the mental overhead of an additional type-creation API, so, delete it. Differential Revision: https://reviews.llvm.org/D56573 llvm-svn: 351020
-
- Jan 12, 2019
-
-
George Rimar authored
This is for https://bugs.llvm.org/show_bug.cgi?id=40008, it starts printing the file headers when --all-headers is given and do a minor cosmetic change. Differential revision: https://reviews.llvm.org/D56588 llvm-svn: 351006
-
Martin Storsjö authored
These were copied as part of the original design from the ELF backend, but aren't necessary at the moment. Differential Revision: https://reviews.llvm.org/D56431 llvm-svn: 350996
-
- Jan 11, 2019
-
-
Teresa Johnson authored
Summary: Records in the module summary index whether the bitcode was compiled with the option necessary to enable splitting the LTO unit (e.g. -fsanitize=cfi, -fwhole-program-vtables, or -fsplit-lto-unit). The information is passed down to the ModuleSummaryIndex builder via a new module flag "EnableSplitLTOUnit", which is propagated onto a flag on the summary index. This is then used during the LTO link to check whether all linked summaries were built with the same value of this flag. If not, an error is issued when we detect a situation requiring whole program visibility of the class hierarchy. This is the case when both of the following conditions are met: 1) We are performing LowerTypeTests or Whole Program Devirtualization. 2) There are type tests or type checked loads in the code. Note I have also changed the ThinLTOBitcodeWriter to also gate the module splitting on the value of this flag. Reviewers: pcc Subscribers: ormris, mehdi_amini, Prazek, inglorion, eraman, steven_wu, dexonsmith, arphaman, dang, llvm-commits Differential Revision: https://reviews.llvm.org/D53890 llvm-svn: 350948
-
Martin Storsjö authored
Differential Revision: https://reviews.llvm.org/D56480 llvm-svn: 350927
-
Martin Storsjö authored
Previously, this was broken - by setting PointerToSymbolTable to zero but still actually writing the string table length, the object file header was corrupted. Differential Revision: https://reviews.llvm.org/D56584 llvm-svn: 350926
-
Dmitry Venikov authored
Summary: Provides -exe, -e as aliases to -obj. Motivation: https://bugs.llvm.org/show_bug.cgi?id=40071 Reviewers: ruiu, rnk, fjricci, jhenderson Reviewed By: jhenderson Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D56580 llvm-svn: 350925
-
- Jan 10, 2019
-
-
Martin Storsjö authored
llvm-svn: 350898
-
Martin Storsjö authored
Differential Revision: https://reviews.llvm.org/D55881 llvm-svn: 350893
-
Francis Visoiu Mistrih authored
llvm-svn: 350851
-
Francis Visoiu Mistrih authored
Instead of using the binary filename. llvm-svn: 350849
-
Francis Visoiu Mistrih authored
In an assert build, the Error gets destroyed and we get "Program aborted due to an unhandled Error:". In release, we get an empty message. llvm-svn: 350848
-
James Y Knight authored
Apparently it doesn't get built by 'ninja check'. :( llvm-svn: 350843
-
George Rimar authored
This is https://bugs.llvm.org/show_bug.cgi?id=26892, GNU objdump hides the special symbol entry: SYMBOL TABLE: 000000000000a7e0 l F .text 00000000000003f9 bi_copymodules while llvm-objdump does not: SYMBOL TABLE: 0000000000000000 *UND* 00000000 000000000000a7e0 l F .text 000003f9 bi_copymodules Patch makes the behavior of the llvm-objdump to be consistent with the GNU objdump. Differential revision: https://reviews.llvm.org/D56076 llvm-svn: 350840
-
James Y Knight authored
That is, remove many of the calls to Type::getNumContainedTypes(), Type::subtypes(), and Type::getContainedType(N). I'm not intending to remove these accessors -- they are useful/necessary in some cases. However, removing the pointee type from pointers would potentially break some uses, and reducing the number of calls makes it easier to audit. llvm-svn: 350835
-
Dmitry Venikov authored
Summary: Provides -p as a short alias for -pretty-print. Motivation: https://bugs.llvm.org/show_bug.cgi?id=40076 Reviewers: samsonov, khemant, ruiu, rnk, fjricci, jhenderson Reviewed By: jhenderson Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D56542 llvm-svn: 350832
-
George Rimar authored
This is https://bugs.llvm.org/show_bug.cgi?id=37151, GNU objdump spec says that "Normally the disassembly output will skip blocks of zeroes.", but currently, llvm-objdump prints them. The patch implements the -z/--disassemble-zeroes option and switches the default to always skip blocks of zeroes. Differential revision: https://reviews.llvm.org/D56083 llvm-svn: 350823
-
James Henderson authored
See https://bugs.llvm.org/show_bug.cgi?id=40070. GNU addr2line accepts input addresses both on the command-line and via stdin. llvm-symbolizer previously only supported the latter. This change adds support for the former. As with addr2line, the new behaviour is to only look for addresses on stdin if no positional arguments were provided to llvm-symbolizer. Reviewed by: ruiu Differential Revision: https://reviews.llvm.org/D56272 llvm-svn: 350821
-
Andrea Di Biagio authored
Field ResourceUnitMask was incorrectly defined as a 'const unsigned' mask. It should have been a 64 bit quantity instead. That means, ResourceUnitMask was always implicitly truncated to a 32 bit quantity. This issue has been found by inspection. Surprisingly, that bug was latent, and it never negatively affected any existing upstream targets. This patch fixes the wrong definition of ResourceUnitMask, and adds a bunch of extra debug prints to help debugging potential issues related to invalid processor resource masks. llvm-svn: 350820
-
- Jan 09, 2019
-
-
George Rimar authored
When GNU objdump dumps the input with -d it prints the symbol addresses, for example: 0000000000000031 <foo>: 31: 00 00 add %al,(%rax) ... llvm-objdump currently does not do that. Patch changes the behavior to match the GNU objdump. That is useful for implementing -z/--disassemble-zeroes (D56083), it allows omitting first zero bytes and keep the information about the symbol address in the output. Differential revision: https://reviews.llvm.org/D56123 llvm-svn: 350726
-
- Jan 08, 2019
-
-
Rong Xu authored
This patch improves llvm-profdata show command: (1) add -value-cutoff=<N> option: Show only those functions whose max count values are greater or equal to N. (2) add -list-below-cutoff option: Only output names of functions whose max count value are below the cutoff. (3) formats value-profile counts and prints out percentage. Differential Revision: https://reviews.llvm.org/D56342 llvm-svn: 350673
-
Rong Xu authored
Will re-commit it using the correct commit message. llvm-svn: 350670
-
https://reviews.llvm.org/D56084.Adrian Prantl authored
This reverts commit r350650 llvm-svn: 350653
-