1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
Commit Graph

11261 Commits

Author SHA1 Message Date
Peter Smith
eb6dba5c2d [ELF] Support for PT_GNU_PROPERTY in header and tools
The PT_GNU_PROPERTY is generated by a linker to describe the
.note.gnu.property section. The Linux kernel uses this program header to
locate the .note.gnu.property section.

It is described in "The Linux gABI extension"

Include support for llvm-readelf, llvm-readobj and the yaml reader and
writers.

Differential Revision: https://reviews.llvm.org/D70959
2019-12-04 15:38:12 +00:00
Georgii Rymar
4137addda1 [yaml2obj] - Make DynamicSymbols to be Optional<> too.
We already have Symbols property to list regular symbols and
it is currently Optional<>. This patch makes DynamicSymbols to be optional
too. With this there is no need to define a dummy symbol anymore to trigger
creation of the .dynsym and it is now possible to define an empty .dynsym using
just the following line:

DynamicSymbols: []
(it is important to have when you do not want to have dynamic symbols,
but want to have a .dynsym)

Now the code is consistent and it helped to fix a bug: previously we
did not report an error when both Content/Size and an empty
Symbols/DynamicSymbols list were specified.

Differential revision: https://reviews.llvm.org/D70956
2019-12-04 13:12:02 +03:00
Jonas Devlieghere
5315599528 [dsymutil] Support --out (NFC)
Seems like this got lost during the libOption conversion.
2019-12-03 17:08:32 -08:00
Saleem Abdulrasool
8f6040bced llvm-config: do not link absolute paths with -l
When dealing with system libraries which are absolute paths, use the
absolute path rather than the `-l` option.  This ensures that the system
library can be properly linked against.  This is needed to enable using
proper link dependencies in CMake.
2019-12-03 08:54:09 -08:00
Sam Parker
74f5838ee5 [CodeGen] Move ARMCodegenPrepare to TypePromotion
Convert ARMCodeGenPrepare into a generic type promotion pass by:
- Removing the insertion of arm specific intrinsics to handle narrow
  types as we weren't using this.
- Removing ARMSubtarget references.
- Now query a generic TLI object to know which types should be
  promoted and what they should be promoted to.
- Move all codegen tests into Transforms folder and testing using opt
  and not llc, which is how they should have been written in the
  first place...

The pass searches up from icmp operands in an attempt to safely
promote types so we can avoid generating unnecessary unsigned extends
during DAG ISel.

Differential Revision: https://reviews.llvm.org/D69556
2019-12-03 11:12:52 +00:00
Sourabh Singh Tomar
31018106ef Recommit "[DWARF5]Addition of alignment atrribute in typedef DIE."
This revision is revised to update Go-bindings and Release Notes.

The original commit message follows.

This patch, adds support for DW_AT_alignment[DWARF5] attribute, to be emitted with typdef DIE.
When explicit alignment is specified.

Patch by Awanish Pandey <Awanish.Pandey@amd.com>

Reviewers: aprantl, dblaikie, jini.susan.george, SouraVX, alok,
deadalinx

Differential Revision: https://reviews.llvm.org/D70111
2019-12-03 09:51:43 +05:30
Clement Courbet
e9195205b7 [llvm-exegesis] Fix 44b9942898c7.
Summary:
Add missing stack release instructions in
loadImplicitRegAndFinalize.

Reviewers: pengfei, gchatelet

Subscribers: tschuett, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70903
2019-12-02 16:13:27 +01:00
Wang, Pengfei
9effdb2d26 [X86] Add initialization of FPCW in llvm-exegesis
Summary: This is a following up to D70874. It adds the initialization of FPCW in llvm-exegesis.

Reviewers: craig.topper, RKSimon, courbet, gchatelet

Subscribers: tschuett, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70891
2019-12-02 20:18:35 +08:00
Georgii Rymar
8150e1e4ce [llvm-readobj/llvm-readelf] - Simplify the code that dumps versions.
After changes introduced in D70495 and D70826 its now possible
to significantly simplify the code we have.

This also fixes an issue: previous code assumed that version strings
should always be read from the dynamic string table. While it is
normally true, the string table should be taken from the corresponding
sh_link field.

Differential revision: https://reviews.llvm.org/D70855
2019-12-02 15:14:30 +03:00
Wang, Pengfei
bc5e31e993 [X86] Add initialization of MXCSR in llvm-exegesis
Summary: This patch is used to initialize the new added register MXCSR.

Reviewers: craig.topper, RKSimon

Subscribers: tschuett, courbet, llvm-commits, LiuChen3

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70874
2019-12-02 18:19:32 +08:00
Georgii Rymar
1ce68f67b9 [llvm-readelf/llvm-readobj] - Check the version of SHT_GNU_verneed section entries.
It is a follow-up for D70826 and it is similar to D70810.

SHT_GNU_verneed contains the following fields:
`vn_version`: Version of structure. This value is currently set to 1, and will be reset
if the versioning implementation is incompatibly altered.
(https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/symversion.html)

We should check it for correctness.

Differential revision: https://reviews.llvm.org/D70842
2019-12-02 12:57:23 +03:00
Lang Hames
2134d2b597 [ORC] Add a runAsMain utility function to ExecutionUtils.
The runAsMain function takes a pointer to a function with a standard C main
signature, int(*)(int, char*[]), and invokes it using the given arguments and
program name. The arguments are copied into writable temporary storage as
required by the C and C++ specifications, so runAsMain safe to use when calling
main functions that modify their arguments in-place.

This patch also uses the new runAsMain function to replace hand-rolled versions
in lli, llvm-jitlink, and the SpeculativeJIT example.
2019-12-02 01:52:52 -08:00
Georgii Rymar
7c3b5b40df [llvm-readobj/llvm-readelf] - Reimplement dumping of the SHT_GNU_verneed section.
This is similar to D70495, but for SHT_GNU_verneed section.
It solves the same problems: different implementations, lack of error reporting
and no test coverage.

DIfferential revision: https://reviews.llvm.org/D70826
2019-12-02 12:27:31 +03:00
Florian Hahn
975db73f36 Revert "[Examples] Add IRTransformations directory to examples."
This breaks LLVMExports.cmake in some build configurations.

PR44197

This reverts commits ceb72d07b004af9c428c4a3c73a98ea97d49a713
                     7d0b1d77b3d4d47df477519fd1bf099b3df6f899.
2019-12-01 22:20:20 +00:00
Georgii Rymar
ca244599d2 [llvm-readelf/llvm-readobj] - Check version of SHT_GNU_verdef section entries when dumping.
Elfxx_Verdef contains the following field:

vd_version
Version revision. This field shall be set to 1.
(https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/symversion.html)

Our code should check the struct version for correctness. This patch does that.
(This will help to simplify or eliminate ELFDumper<ELFT>::LoadVersionDefs() which
has it's own logic to parse version definitions for no reason. It checks the
struct version currently).

Differential revision: https://reviews.llvm.org/D70810
2019-11-29 11:09:56 +03:00
Georgii Rymar
de6e418176 [yaml2obj] - Add a way to describe content of the SHT_GNU_verneed section with "Content".
There is no way to set raw content for SHT_GNU_verneed section.
This patch implements it.

Differential revision: https://reviews.llvm.org/D70816
2019-11-29 10:50:00 +03:00
Lang Hames
ded5c52882 [ORC][JITLink] Add support for weak references, and improve handling of static
libraries.

This patch substantially updates ORCv2's lookup API in order to support weak
references, and to better support static archives. Key changes:

-- Each symbol being looked for is now associated with a SymbolLookupFlags
   value. If the associated value is SymbolLookupFlags::RequiredSymbol then
   the symbol must be defined in one of the JITDylibs being searched (or be
   able to be generated in one of these JITDylibs via an attached definition
   generator) or the lookup will fail with an error. If the associated value is
   SymbolLookupFlags::WeaklyReferencedSymbol then the symbol is permitted to be
   undefined, in which case it will simply not appear in the resulting
   SymbolMap if the rest of the lookup succeeds.

   Since lookup now requires these flags for each symbol, the lookup method now
   takes an instance of a new SymbolLookupSet type rather than a SymbolNameSet.
   SymbolLookupSet is a vector-backed set of (name, flags) pairs. Clients are
   responsible for ensuring that the set property (i.e. unique elements) holds,
   though this is usually simple and SymbolLookupSet provides convenience
   methods to support this.

-- Lookups now have an associated LookupKind value, which is either
   LookupKind::Static or LookupKind::DLSym. Definition generators can inspect
   the lookup kind when determining whether or not to generate new definitions.
   The StaticLibraryDefinitionGenerator is updated to only pull in new objects
   from the archive if the lookup kind is Static. This allows lookup to be
   re-used to emulate dlsym for JIT'd symbols without pulling in new objects
   from archives (which would not happen in a normal dlsym call).

-- JITLink is updated to allow externals to be assigned weak linkage, and
   weak externals now use the SymbolLookupFlags::WeaklyReferencedSymbol value
   for lookups. Unresolved weak references will be assigned the default value of
   zero.

Since this patch was modifying the lookup API anyway, it alo replaces all of the
"MatchNonExported" boolean arguments with a "JITDylibLookupFlags" enum for
readability. If a JITDylib's associated value is
JITDylibLookupFlags::MatchExportedSymbolsOnly then the lookup will only
match against exported (non-hidden) symbols in that JITDylib. If a JITDylib's
associated value is JITDylibLookupFlags::MatchAllSymbols then the lookup will
match against any symbol defined in the JITDylib.
2019-11-28 13:30:49 -08:00
Georgii Rymar
63432001d0 [llvm-readelf] - Make GNU style dumping of invalid SHT_GNU_verdef be consistent with LLVM style.
When we dump SHT_GNU_verdef section that has sh_link that references a non-existent section,
llvm-readobj reports a warning and continues dump, but llvm-readelf fails with a error.

This patch fixes the issue and opens road for futher follow-ups for
improving the printGNUVersionSectionProlog().

Differential revision: https://reviews.llvm.org/D70776
2019-11-28 12:41:29 +03:00
Georgii Rymar
d849bd18c8 [llvm-readobj] - Always print "Predecessors" for version definition sections.
This is a follow-up discussed in D70495 thread.

The current logic is unusual for llvm-readobj. It doesn't print predecessors
list when it is empty. This is not good for machine parsers.
D70495 had to add this condition during refactoring to reduce amount of changes,
in tests, because the original code also had a similar logic.

Now seems it is time to get rid of it. This patch does it.

Differential revision: https://reviews.llvm.org/D70717
2019-11-27 12:29:55 +03:00
Martin Storsjö
f5d4be5727 [llvm-objcopy] [COFF] Fix a typo in a comment. NFC. 2019-11-27 10:44:42 +02:00
Georgii Rymar
39d296957d [llvm-readobj/llvm-readelf] - Reimplement dumping of the SHT_GNU_verdef section.
Currently we have following issues:
1) We have 2 different implementations with a different behaviors for GNU/LLVM styles.
2) Errors are either not handled at all or we call report_fatal_error with not helpfull messages.
3) There is no test coverage even for those errors that are reported.

This patch reimplements parsing of the SHT_GNU_verdef section entries
in a single place, adds a few error messages and test coverage.

Differential revision: https://reviews.llvm.org/D70495
2019-11-26 17:15:39 +03:00
Georgii Rymar
cefce787ca [yaml2obj] - Teach tool to describe SHT_GNU_verdef section with a "Content" property.
There is no way to set raw content for SHT_GNU_verdef section.
This patch implements it.

Differential revision: https://reviews.llvm.org/D70710
2019-11-26 15:35:05 +03:00
Georgii Rymar
19ffcd1328 [yaml2obj/obj2yaml] - Add support for SHT_LLVM_DEPENDENT_LIBRARIES sections.
This section contains strings specifying libraries to be added to the link by the linker.
The strings are encoded as standard null-terminated UTF-8 strings.

This patch adds a way to describe and dump SHT_LLVM_DEPENDENT_LIBRARIES sections.

I introduced a new YAMLFlowString type here. That used to teach obj2yaml to dump
them like:

```
Libraries: [ foo, bar ]
```

instead of the following (if StringRef would be used):

```
Libraries:
  - foo
  - bar
```

Differential revision: https://reviews.llvm.org/D70598
2019-11-25 12:57:53 +03:00
Seiya Nuta
2619b4d02e [llvm-objcopy][MachO] Implement --dump-section
Reviewers: alexshap, rupprecht, jhenderson

Reviewed By: alexshap, rupprecht, jhenderson

Subscribers: MaskRay, jakehehrlich, abrachet, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66408
2019-11-25 12:30:37 +09:00
Alexander Shaposhnikov
8300cbdb12 [llvm-lipo] Add support for -extract
This diff adds support for -extract.

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D70522
2019-11-21 16:11:48 -08:00
Tom Stellard
28bf7f3536 [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries"
Summary:
Most libraries are defined in the lib/ directory but there are also a
few libraries defined in tools/ e.g. libLLVM, libLTO.  I'm defining
"Component Libraries" as libraries defined in lib/ that may be included in
libLLVM.so.  Explicitly marking the libraries in lib/ as component
libraries allows us to remove some fragile checks that attempt to
differentiate between lib/ libraries and tools/ libraires:

1. In tools/llvm-shlib, because
llvm_map_components_to_libnames(LIB_NAMES "all") returned a list of
all libraries defined in the whole project, there was custom code
needed to filter out libraries defined in tools/, none of which should
be included in libLLVM.so.  This code assumed that any library
defined as static was from lib/ and everything else should be
excluded.

With this change, llvm_map_components_to_libnames(LIB_NAMES, "all")
only returns libraries that have been added to the LLVM_COMPONENT_LIBS
global cmake property, so this custom filtering logic can be removed.
Doing this also fixes the build with BUILD_SHARED_LIBS=ON
and LLVM_BUILD_LLVM_DYLIB=ON.

2. There was some code in llvm_add_library that assumed that
libraries defined in lib/ would not have LLVM_LINK_COMPONENTS or
ARG_LINK_COMPONENTS set.  This is only true because libraries
defined lib lib/ use LLVMBuild.txt and don't set these values.
This code has been fixed now to check if the library has been
explicitly marked as a component library, which should now make it
easier to remove LLVMBuild at some point in the future.

I have tested this patch on Windows, MacOS and Linux with release builds
and the following combinations of CMake options:

- "" (No options)
- -DLLVM_BUILD_LLVM_DYLIB=ON
- -DLLVM_LINK_LLVM_DYLIB=ON
- -DBUILD_SHARED_LIBS=ON
- -DBUILD_SHARED_LIBS=ON -DLLVM_BUILD_LLVM_DYLIB=ON
- -DBUILD_SHARED_LIBS=ON -DLLVM_LINK_LLVM_DYLIB=ON

Reviewers: beanz, smeenai, compnerd, phosek

Reviewed By: beanz

Subscribers: wuzish, jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, mgorny, mehdi_amini, sbc100, jgravelle-google, hiraditya, aheejin, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, steven_wu, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, PkmX, jocewei, jsji, dang, Jim, lenary, s.egerton, pzheng, sameer.abuasal, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70179
2019-11-21 10:48:08 -08:00
Fangrui Song
bea58c62af [llvm-objcopy][MachO] Implement --strip-debug
Reviewed By: alexshap

Differential Revision: https://reviews.llvm.org/D70476
2019-11-21 09:40:34 -08:00
Fangrui Song
9ff9aa5480 [llvm-objcopy][MachO] Fix symbol order in the symbol table
Only consider isUndefinedSymbol() when the symbol is not local. This
fixes an assert failure when copying the symbol table, if a n_type=0x20
symbol is followed by a n_type=0x64 symbol.

Reviewed By: alexshap, seiya

Differential Revision: https://reviews.llvm.org/D70475
2019-11-21 09:30:46 -08:00
Ilya Biryukov
a1512ae17b Reland 9f3fdb0d7fab: [Driver] Use VFS to check if sanitizer blacklists exist
With updates to various LLVM tools that use SpecialCastList.

It was tempting to use RealFileSystem as the default, but that makes it
too easy to accidentally forget passing VFS in clang code.
2019-11-21 11:56:09 +01:00
Pavel Labath
290efde9ec dwarfdump --statistics: Use new location list api
Summary:
This patch removes manual location list handling in the statistics code
and replaces it with the new DWARFDie api, which provides access to a
"cooked" location list. This has the following effects:
- the code now properly handles split-dwarf location lists
- it will automatically support dwarf5 location lists once support for
  those is added
- it properly handles location lists with base address selection entries
- it fixes a bug where the location list code was using the first
  DW_AT_ranges range as a "base address" of the compile unit (it should
  have used DW_AT_low_pc instead. The effect of this was that the
  computation of the start address of a variable in its scope was broken
  for these kinds of compile units. This only manifested itself on
  linked files, since in object files the first DW_AT_ranges range
  normally starts at 0.

Since pretty much every kind of location list was broken in some way,
it's hard to verify that the new implementation is correct -- the output
will be different in all non-trivial cases, and mostly with good reason.

Most of the existing statistics tests continue to pass though, and a
visual inspection of the statistics for non-trivial inputs shows that
the data is more "reasonable" now. I have updated the "dwo statistics"
test to include the new numbers, as the previous ones were completely
bogus, and I have added a targeted test for the "base address" bug.

Reviewers: dblaikie, cmtice, vsk

Subscribers: aprantl, SouraVX, JDevlieghere, djtodoro, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70444
2019-11-21 11:55:21 +01:00
Georgii Rymar
d833762862 [llvm-readobj] - Improve dumping of the SHT_LLVM_LINKER_OPTIONS sections.
I've added a few tests that shows how the current code could overrun the section data
buffer while dumping. I had to rewrite the code to fix this.

Differential revision: https://reviews.llvm.org/D70112
2019-11-20 12:11:13 +03:00
Georgii Rymar
ca203ebeb8 [llvm-readobj/llvm-readelf] - Improve dumping of versioning sections.
Our elf-versioninfo.test is not perfect. It does not properly test how
flags are dumped and also we have a bug: they are dumped as enums in
LLVM style now, i.e not dumped properly.

GNU style uses a `versionFlagToString` method to build a string from flags
which seems is consistent with GNU readelf.

In this patch I fixed the issues mentioned.

Differential revision: https://reviews.llvm.org/D70399
2019-11-20 11:55:55 +03:00
Alexander Shaposhnikov
c942981326 Introduce llvm-install-name-tool
This diff adds a new "driver" for llvm-objcopy
which is supposed to emulate the behavior of install-name-tool.
This is a recommit of b5913e6 with ubsan, test dependencies issues fixed.

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

Test plan: make check-all
2019-11-19 23:42:37 -08:00
Francis Visoiu Mistrih
2123c1f2ec [LTO][Legacy] Add API for passing LLVM options separately
In order to correctly pass options to LLVM, including options containing
spaces which are used as delimiters for multiple options in
lto_codegen_debug_options, add a new API:
lto_codegen_debug_options_array.

Unfortunately, tools/lto has no testing infrastructure yet, so there are
no tests associated with this patch.

Differential Revision: https://reviews.llvm.org/D70463
2019-11-19 16:30:37 -08:00
Alexander Shaposhnikov
fee138cf10 Revert "Introduce llvm-install-name-tool"
This temporarily reverts the commit 88f00aef684ff84a6494e1f17d5466c5678f703d.
The change broke the buildbot http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/36836
2019-11-19 16:22:36 -08:00
Alexander Shaposhnikov
42ca846668 Introduce llvm-install-name-tool
This diff adds a new "driver" for llvm-objcopy
which is supposed to emulate the behavior of install-name-tool.
This is a recommit of b5913e6d2 with ubsan issues fixed.

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

Test plan: make check-all
2019-11-19 15:16:32 -08:00
David Bozier
02d3efaf7f [llvm-objdump] Print relocation addends in hexadecimal
Summary: Matches GNU objdump. Makes debugging easier for me as I'm working out addresses from symbol+addend, so it would be good to be calculating in a single format.

Reviewers: MaskRay, grimar, jhenderson, bd1976llvm

Reviewed By: jhenderson

Subscribers: sdardis, jrtc27, atanasyan, rupprecht, seiya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69997
2019-11-19 12:27:18 +00:00
Matt Arsenault
257a3ea8c8 bugpoint: Add option to disable attribute removal
This takes a long time and never reduces anything useful for me
(e.g. I've been waiting for 3 hours on a testcase and it hasn't found
any attributes to remove yet). This should probably start by assuming
no attributes matter, and adding back.
2019-11-19 11:11:00 +05:30
Steven Wu
a7bce70eed [llvm-cxxfilt] Improve strip-underscore behavior
Summary:
For platform that uses macho format, c++filt should be stripping the
leading underscore by default. Introduce the binutil compatible "-n"
option to control strip-undercore behaivor together with the existing
"-_" option and fallback to system default if none of them are set.

rdar://problem/57173514

Reviewers: compnerd, erik.pilkington, dexonsmith, mattd

Reviewed By: compnerd, erik.pilkington

Subscribers: jkorous, ributzka, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70250
2019-11-18 15:05:41 -08:00
Sam McCall
7131c18f0e Revert "[DWARF5]Addition of alignment atrribute in typedef DIE."
This reverts commit 423f541c1a322963cf482683fe9777ef0692082d, which
breaks llvm-c ABI.
2019-11-18 15:53:22 +01:00
Simon Pilgrim
27ccb8f693 Fix cppcheck shadow variable warning. NFC. 2019-11-18 13:57:34 +00:00
Simon Pilgrim
4578f78374 llvm-objcopy - fix uninitialized variable warnings. NFC. 2019-11-18 13:57:34 +00:00
Simon Pilgrim
4880637d79 llvm-rc - fix uninitialized variable warnings. NFC. 2019-11-18 13:26:50 +00:00
Sourabh Singh Tomar
2e2c6d3540 [DWARF5]Addition of alignment atrribute in typedef DIE.
This patch, adds support for DW_AT_alignment[DWARF5] attribute, to be emitted with typdef DIE.
When explicit alignment is specified.

Patch by Awanish Pandey <Awanish.Pandey@amd.com>

Reviewers: aprantl, dblaikie, jini.susan.george, SouraVX, alok,
deadalinx

Differential Revision: https://reviews.llvm.org/D70111
2019-11-16 21:56:53 +05:30
Sajjad Mirza
562529aa88 [llvm-cov] Fix illegal cast from uint64_t to int64_t
Summary:
Counters are stored as uint64_t in the coverage mapping, but
exporting in JSON requires signed integers. Clamp the values to the
smaller range to make the conversion safe.

Reviewers: Dor1s, vsk

Reviewed By: Dor1s

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70200
2019-11-15 18:13:45 -08:00
Fangrui Song
921a5808d7 [llvm-objcopy][MachO] Implement --redefine-sym and --redefine-syms
Similar to D46029 (ELF) and D70036 (COFF), but for MachO.
Note, when --strip-symbol (not implemented for MachO) is also specified,
--redefine-sym executes before --strip-symbol.

Reviewed By: jhenderson, seiya

Differential Revision: https://reviews.llvm.org/D70212
2019-11-15 10:05:36 -08:00
Pavel Labath
96888349a9 DWARFDebugLoc(v4): Add an incremental parsing function
Summary:
This adds a visitLocationList function to the DWARF v4 location lists,
similar to what already exists for DWARF v5. It follows the approach
outlined in previous patches (D69672), where the parsed form is always
stored in the DWARF v5 format, which makes it easier for generic code to
be built on top of that. v4 location lists are "upgraded" during
parsing, and then this upgrade is undone while dumping.

Both "inline" and section-based dumping is rewritten to reuse the
existing "generic" location list dumper. This means that the output
format is consistent for all location lists (the only thing one needs to
implement is the function which prints the "raw" form of a location
list), and that debug_loc dumping correctly processes base address
selection entries, etc.

The previous existing debug_loc functionality (e.g.,
parseOneLocationList) is rewritten on top of the new API, but it is not
removed as there is still code which uses them. This will be done in
follow-up patches, after I build the API to access the "interpreted"
location lists in a generic way (as that is what those users really
want).

Reviewers: dblaikie, probinson, JDevlieghere, aprantl, SouraVX

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69847
2019-11-15 13:38:00 +01:00
Seiya Nuta
466f12f007 [llvm-objcopy][MachO] Implement --remove-section
Reviewers: alexshap, rupprecht, jhenderson

Reviewed By: rupprecht, jhenderson

Subscribers: jakehehrlich, abrachet, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66282
2019-11-15 14:20:11 +09:00
Matthew Voss
75810d03fe [llvm-dis] Fix the disable-output flag
My change in llvmorg-10-init-9872-g141bb5f308f broke this flag.

Thanks to @rsmith for the bug.
2019-11-14 13:35:21 -08:00
Matthew Voss
d01e45a895 Add support for multi-module bitcode files to llvm-dis
Summary:
This change allows llvm-dis to disassemble multi-module bitcode
files, including the associated module summary.

Reviewers: tejohnson, pcc, mehdi_amini

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70153
2019-11-14 10:40:41 -08:00