11098 Commits

Author SHA1 Message Date
George Rimar
95e4c59cb3 [llvm-readobj/llvm-objdump] - Improve how tool locate the dynamic table and 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372122 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-17 13:58:46 +00:00
Fangrui Song
61474b8c87 [llvm-ar] Parse 'h' and '-h': display help and exit
Support `llvm-ar h` and `llvm-ar -h` because they may be what users try
at first. Note, operation 'h' is undocumented in GNU ar.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D67560

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372088 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-17 09:25:52 +00:00
George Rimar
18f599f81e [llvm-readobj] - Refactor the code.
It's a straightforward refactoring that allows to simplify and encapsulate the code.

Differential revision: https://reviews.llvm.org/D67624

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372083 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-17 08:53:18 +00:00
Florian Hahn
0facd33f64 [bugpoint] Add support for -Oz and properly enable -Os.
This patch adds -Oz as option and also properly enables support for -Os.
Currently, the existing check for -Os is dead, because the enclosing if
only checks of O1, O2 and O3.

There is still a difference between the -Oz pipeline compared to opt,
but I have not been able to track that down yet.

Reviewers: bogner, sebpop, efriedma

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D67593

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372079 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-17 08:14:09 +00:00
David Blaikie
4f436c1f27 llvm-reduce: Remove some string copies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372053 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-16 23:54:57 +00:00
David Blaikie
d632f745ef llvm-reduce: Make tests shell-independent by passing the interpreter on the command line rather than using #! in the test file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372049 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-16 23:41:19 +00:00
Steven Wu
1cb2400471 [LTO][Legacy] Add new C inferface to query libcall functions
Summary:
This is needed to implemented the same approach as lld (implemented in r338434)
for how to handling symbols that can be generated by LTO code generator
but not present in the symbol table for linker that uses legacy C APIs.

libLTO is in charge of providing the list of symbols. Linker is in
charge of implementing the eager loading from static libraries using
the list of symbols.

rdar://problem/52853974

Reviewers: tejohnson, bd1976llvm, deadalnix, espindola

Reviewed By: tejohnson

Subscribers: emaste, arichardson, hiraditya, MaskRay, dang, kledzik, mehdi_amini, inglorion, jkorous, dexonsmith, ributzka, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67568

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372021 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-16 18:49:54 +00:00
Sjoerd Meijer
2eb46d74d2 Added return statement to fix compile and build warning:
llvm-rtdyld.cpp:966:7: warning: variable ‘Result’ set but not used

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371972 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-16 10:30:37 +00:00
Fangrui Song
f6dc13fa4d [llvm-objcopy] Ignore -B --binary-architecture=
GNU objcopy documents that -B is only useful with architecture-less
input (i.e. "binary" or "ihex"). After D67144, -O defaults to -I, and
-B is essentially a NOP.

* If -O is binary/ihex, GNU objcopy ignores -B.
* If -O is elf*, -B provides the e_machine field in GNU objcopy.

So to convert a blob to an ELF, `-I binary -B i386:x86-64 -O elf64-x86-64` has to be specified.

`-I binary -B i386:x86-64 -O elf64-x86-64` creates an ELF with its
e_machine field set to EM_NONE in GNU objcopy, but a regular x86_64 ELF
in elftoolchain elfcopy. Follow the elftoolchain approach (ignoring -B)
to simplify code. Users that expect their command line portable should
specify -B.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D67215

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371914 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-14 01:36:31 +00:00
Fangrui Song
9c01fe0563 [llvm-objcopy] Default --output-target to --input-target when unspecified
Fixes PR42171.

In GNU objcopy, if -O (--output-target) is not specified, the value is
copied from -I (--input-target).

```
objcopy -I binary -B i386:x86-64 a.txt b       # b is copied from a.txt
llvm-objcopy -I binary -B i386:x86-64 a.txt b  # b is an x86-64 object file
```

This patch changes our behavior to match GNU. With this change, we can
delete code related to -B handling (D67215).

Reviewed By: jakehehrlich

Differential Revision: https://reviews.llvm.org/D67144

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371913 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-14 01:36:16 +00:00
Fangrui Song
c66dffe703 [llvm-ar] Uncapitalize error messages and delete full stop
Most GNU binutils don't append full stops in error messages. This
convention has been adopted by a bunch of LLVM binary utilities. Make
llvm-ar follow the convention as well.

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D67558

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371912 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-14 01:18:47 +00:00
Michael Pozulp
78308f70b2 [llvm-objcopy] Add support for response files in llvm-strip and llvm-objcopy
Summary: Addresses https://bugs.llvm.org/show_bug.cgi?id=42671

Reviewers: jhenderson, espindola, alexshap, rupprecht

Reviewed By: jhenderson

Subscribers: seiya, emaste, arichardson, jakehehrlich, MaskRay, abrachet, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65372

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371911 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-14 01:14:43 +00:00
David Blaikie
5ca8fbd7ef Bugpoint: Remove some unnecessary c_str conversions on the journey to StringRef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371910 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-14 00:32:13 +00:00
Francis Visoiu Mistrih
7ab0a1882b [llvm-opt-report] Improve error handling
* std::move the error extracted from the parsing creation to avoid asserts
* print a newline after the error message
* create the parser from the metadata

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371895 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 20:52:04 +00:00
George Rimar
04c501607e [yaml2obj/ObjectYAML] - Cleanup the error reporting API, add custom errors handlers.
This is a continuation of the YAML library error reporting
refactoring/improvement and the idea by itself was mentioned
in the following thread:
https://reviews.llvm.org/D67182?id=218714#inline-603404

This performs a cleanup of all object emitters in the library.
It allows using the custom one provided by the caller.

One of the nice things is that each tool can now print its tool name,
e.g: "yaml2obj: error: <text>"

Also, the code became a bit simpler.

Differential revision: https://reviews.llvm.org/D67445

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371865 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 16:00:16 +00:00
James Henderson
7563f172e2 [llvm-size] Fix spelling errors (Berkely -> Berkeley)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371845 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 12:00:42 +00:00
Guillaume Chatelet
171a74f197 [Alignment] Introduce llvm::Align to MCSection
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet, JDevlieghere

Subscribers: arsenm, sdardis, jvesely, nhaehnle, sbc100, hiraditya, aheejin, jrtc27, atanasyan, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67486

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371831 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 09:29:59 +00:00
George Rimar
9b7a447e5a [llvm-objdump] Fix llvm-objdump --all-headers output order
Patch by Justice Adams!

Made llvm-objdump --all-headers output match the order of GNU objdump for compatibility reasons.

Old order of the headers output:
* file header
* section header table
* symbol table
* program header table
* dynamic section

New order of the headers output (GNU compatible):
* file header information
* program header table
* dynamic section
* section header table
* symbol table

(Relevant BugZilla Bug: https://bugs.llvm.org/show_bug.cgi?id=41830)

Differential revision: https://reviews.llvm.org/D67357


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371826 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-13 08:56:28 +00:00
David Blaikie
c8a342337b llvm-reduce: Remove unused plugin support/requirements
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371755 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 18:52:31 +00:00
Guillaume Chatelet
fff5baa19a [Alignment] Move OffsetToAlignment to Alignment.h
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet, JDevlieghere, alexshap, rupprecht, jhenderson

Subscribers: sdardis, nemanjai, hiraditya, kbarton, jakehehrlich, jrtc27, MaskRay, atanasyan, jsji, seiya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D67499

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371742 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 15:20:36 +00:00
David Blaikie
ccef81bf70 Reapply llvm-reduce: Add pass to reduce parameters""
Fixing a couple of asan-identified bugs
* use of an invalid "Use" iterator after the element was removed
* use of StringRef to Function name after the Function was erased

This reapplies r371567, which was reverted in r371580.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371700 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 01:20:48 +00:00
David Blaikie
bce2802386 PR43278: llvm-reduce: Use temporary file names (and ToolOutputFile) rather than unique ones - to ensure they're cleaned up
This modifies the tool somewhat to only create files when about to run
the "interestingness" test, and delete them immediately after - this
means some more files will be created sometimes (when "double checking"
work - which should probably be fixed/avoided anyway).

This now creates temporary files, rather than only unique ones, and also
uses ToolOutputFile (without ever calling "keep") to ensure the files
are deleted as soon as the interestingness test is run.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371696 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-12 00:31:57 +00:00
Cyndy Ishida
c50052e27b Revert [llvm-nm] Add tapi file support
This reverts r371576 (git commit f88f46358dbffa20af3b054a9346e5154789d50f)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371676 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-11 21:35:28 +00:00
Reid Kleckner
e57ff882da [llvm-reduce] Fix a bug, improve error handling when running test
llvm::sys::ExecuteAndWait can report errors, so let's make use of that.

Second, while iterating uses of functions to remove, a call can appear
multiple times. Use a SetVector so we don't attempt to erase such a call
twice.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371653 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-11 20:29:22 +00:00
Simon Pilgrim
8ea51586a9 Fix -Wdocumentation warning - void function doesn't need a @returns. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371606 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-11 11:12:00 +00:00
Fangrui Song
0cf7863817 [llvm-objcopy] Simplify --prefix-alloc-sections
Handle --prefix-alloc-sections after --rename-sections so that --prefix-alloc-sections code
does not have to check if renaming has been performed.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D66931

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371591 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-11 07:23:35 +00:00
Fangrui Song
660e804c70 [llvm-nm] Fix -DBUILD_SHARED_LIBS=ON builds after D66160/r371576
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371585 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-11 01:49:00 +00:00
David Blaikie
efbc850369 Revert "llvm-reduce: Add pass to reduce parameters"
Looks to be failing on asan buildbots

This reverts commit r371567.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371580 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-11 00:44:17 +00:00
Cyndy Ishida
cc8f11d844 [llvm-nm] Add tapi file support
Summary:
This commit is the final one for adding tapi support to the llvm-nm implementation.
This commit also has accompanying tests the additions to lib/Object

Reviewers: ributzka, steven_wu

Reviewed By: ributzka

Subscribers: hiraditya, plotfi, dexonsmith, rupprecht, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66160

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371576 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-11 00:00:53 +00:00
David Blaikie
c74403f9b4 llvm-reduce: Add pass to reduce parameters
Patch by Diego Treviño!

Differential Revision: https://reviews.llvm.org/D65479

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371567 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-10 23:10:10 +00:00
David Blaikie
fb9efd7dc8 llvm-reduce: Remove some unused headers/more narrowly include them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371564 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-10 22:31:35 +00:00
David Blaikie
da0892bd0d llvm-remove: Remove "using namespace" in header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371563 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-10 22:10:00 +00:00
David Blaikie
5fbb26ea5f llvm-reduce: Add pass to reduce Metadata
Patch by Diego Treviño!

Differential Revision: https://reviews.llvm.org/D65026

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371562 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-10 22:09:58 +00:00
David Blaikie
63f3f17e15 llvm-reduce: Simplify testing using -implicit-check-not
Also fix llvm-reduce to use the specified output file name directly,
without appending '.ll' to the name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371555 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-10 20:52:14 +00:00
Dmitri Gribenko
be9f44f943 Revert "Reland "r364412 [ExpandMemCmp][MergeICmps] Move passes out of CodeGen into opt pipeline.""
This reverts commit r371502, it broke tests
(clang/test/CodeGenCXX/auto-var-init.cpp).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371507 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-10 10:39:09 +00:00
Djordje Todorovic
1b050aba65 [llvm-dwarfdump] Add additional stats fields
The additional fields will be parsed by the llvm-locstats tool in order to
produce more human readable output of the DWARF debug location quality
generated.

Differential Revision: https://reviews.llvm.org/D66525

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371506 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-10 10:37:28 +00:00
Clement Courbet
9f23a59130 Reland "r364412 [ExpandMemCmp][MergeICmps] Move passes out of CodeGen into opt pipeline."
With a fix for sanitizer breakage (see explanation in D60318).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371502 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-10 09:18:00 +00:00
Francis Visoiu Mistrih
b68f7fd8cd [Remarks] Add parser for bitstream remarks
The bitstream remark serializer landed in r367372.

This adds a bitstream remark parser that parser bitstream remark files
to llvm::remarks::Remark objects through the RemarkParser interface.

A few interesting things to point out:

* There are parsing helpers to parse the different types of blocks
* The main parsing helper allows us to parse remark metadata and open an
external file containing the encoded remarks
* This adds a dependency from the Remarks library to the BitstreamReader
library
* The testing strategy is to create a remark entry through YAML, parse
it, serialize it to bitstream, parse that back and compare the objects.
* There are close to no tests for malformed bitstream remarks, due to
the lack of textual format for the bitstream format.
* This adds a new C API for parsing bitstream remarks:
LLVMRemarkParserCreateBitstream.
* This bumps the REMARKS_API_VERSION to 1.

Differential Revision: https://reviews.llvm.org/D67134

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371429 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-09 17:43:50 +00:00
George Rimar
d745f4ffa6 [llvm-nm] - Fix a bug and unbreak ASan BB.
BB: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/13820/steps/check-llvm%20asan/logs/stdio

rL371074 revealed a bug in llvm-nm.

This patch fixes it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371318 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-07 19:45:27 +00:00
Fangrui Song
2ce639442f [llvm-objcopy] Rename SHOffset (e_shoff) field to SHOff. NFC
Similar to D67254.

`struct Elf*_Shdr` has a field `sh_offset`. Rename SHOffset to SHOff to
avoid confusion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371281 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-07 01:38:56 +00:00
Puyan Lotfi
2687a636d1 [llvm-ifs] Improving detection of PlatformKind from triple for TBD generation.
It was pointed out that I had hard-coded PlatformKind. This is rectifying that.

Differential Revision: https://reviews.llvm.org/D67255




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371248 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-06 19:59:59 +00:00
Lang Hames
afaf30acaa [llvm-jitlink] Add optional slab allocator for testing locality optimizations.
The llvm-jitlink utility now accepts a '-slab-allocate <size>' option. If given,
llvm-jitlink will use a slab-based memory manager rather than the default
InProcessMemoryManager. Using a slab allocator will allow reliable testing of
future locality based optimizations (e.g. PLT and GOT elimination) in JITLink.

The <size> argument is a number, optionally followed by a units specifier (Kb,
Mb, or Gb). If the units are not given then the number is assumed to be in Kb.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371244 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-06 19:21:55 +00:00
George Rimar
b2ce6ced2f [llvm-readelf] - Print unknown st_other value if present in GNU output.
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371201 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-06 13:05:34 +00:00
Fangrui Song
de4cabecba [yaml2obj] Rename SHOffset (e_shoff) field to SHOff. NFC
`struct Elf*_Shdr` has a field `sh_offset`, named `ShOffset` in
llvm::ELFYAML::Section. Rename SHOffset (e_shoff) to SHOff to prevent confusion.

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D67254

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371185 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-06 09:23:17 +00:00
Fangrui Song
9af852afd5 [llvm-readobj][yaml2obj] Support SHT_LLVM_SYMPART, SHT_LLVM_PART_EHDR and 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371157 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-06 00:53:28 +00:00
George Rimar
5cae5103d0 [llvm-readelf] - Allow dumping dynamic symbols when there is no program headers.
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371071 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-05 14:02:58 +00:00
Lang Hames
72fff241b6 [llvm-rtdyld][llvm-jitlink] Rename struct member to remove ambiguity.
This ambiguity (struct member name matching struct name) was causing errors on
a few of the MSVC bots. Hopefully this should fix it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370969 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 20:26:26 +00:00
Lang Hames
7cb1eef902 [llvm-rtdyld] Add timers to match llvm-jitlink.
When using llvm-rtdyld to execute code, -show-times will now show the time
taken to load the object files, apply relocations, and execute the
rtdyld-linked code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370968 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 20:26:25 +00:00
Lang Hames
d196ef224c [JITLink] Fix the show-timers option on llvm-jitlink.
No longer constantly shows times (even when -show-times=false). When shown,
times are now correctly grouped.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370951 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 18:38:29 +00:00
Simon Pilgrim
43264f371c Fix "enumeral and non-enumeral type in conditional expression" warnings. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370892 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-04 12:51:40 +00:00