1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
Commit Graph

242 Commits

Author SHA1 Message Date
Steven Wu
7a47cbea30 [Object][MachO] Rewrite macho-invalid-fat-arch-size into YAML
Summary:
Rewrite one of the invalid macho test input file with YAML file. The
original invalid macho is breaking our internal test infrastusture
because it is too broken to be copy around.

Need to relax an assertion in the YAML/MachoEmitter to allow yaml2obj to
write an invalid object like this.

rdar://problem/56879982

Reviewers: beanz, mtrent

Reviewed By: beanz

Subscribers: hiraditya, jkorous, dexonsmith, ributzka, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69856
2019-11-06 11:26:25 -08:00
Steven Wu
dce4269ca7 Revert "[Object][MachO] Rewrite macho-invalid-fat-arch-size into YAML"
The invalid binary trying to construct triggers an assertion.
2019-11-05 09:34:26 -08:00
Steven Wu
4275ea1a33 [Object][MachO] Rewrite macho-invalid-fat-arch-size into YAML
Rewrite one of the invalid macho test input file with YAML file. The
original invalid macho is breaking our internal test infrastusture
because it is too broken to be copy around.

rdar://problem/56879982
2019-11-05 09:07:06 -08:00
Owen Reynolds
1fb005f144 [llvm-ar][test] Move MRI tests from "llvm/test/Object/"
llvm/test/Object/ contains tests for the ArchiveWriter library, however
support for MRI scripts is found in llvm-ar and not the library. This
diff moves the MRI related tests and removes those that are duplicates.

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

llvm-svn: 372973
2019-09-26 12:32:11 +00:00
Cyndy Ishida
c58a95b452 Revert [llvm-nm] Add tapi file support
This reverts r371576 (git commit f88f46358dbffa20af3b054a9346e5154789d50f)

llvm-svn: 371676
2019-09-11 21:35:28 +00:00
Cyndy Ishida
5c9f000ded [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

llvm-svn: 371576
2019-09-11 00:00:53 +00:00
George Rimar
aac454ba82 [test/Object] - Move/rewrite 2 more test cases.
This patch makes a change for test/Object tests responsible
for relocations.

* 2 tests were moved to llvm-readobj/llvm-objdump folders:
Object/elf-reloc-no-sym.test -> tools/llvm-readobj/elf-reloc-no-sym.test
Object/objdump-reloc-shared.test -> tools/llvm-objdump/relocations-in-nonreloc.test

* A prerecompiled binary was removed and these tests were refactored.

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

llvm-svn: 369342
2019-08-20 08:23:57 +00:00
George Rimar
fd5f9a7c78 [test] - Remove precomiled openbsd-phdrs.elf-x86-64 objects.
There are 2 similar openbsd-phdrs.elf-x86-64 objects committed and
used in test/Object and test/tools/llvm-objdump test cases.

There is no reason to have them, we can use YAML instead. Patch does that.

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

llvm-svn: 369189
2019-08-17 14:23:30 +00:00
George Rimar
971a9b1913 [llvm-objdump] - Add a relocation-xindex-symbol.test test case.
This rewrites the exitent test case to use YAML instead of the precompiled object
and moves it from test/Object to an appropriate llvm-objdump tests folder.

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

llvm-svn: 368811
2019-08-14 08:33:26 +00:00
George Rimar
b9df2d78c5 [test/Object] - Cleanup the Object\obj2yaml.test a bit.
This makes 2 changes:

1) Removes unwind-section.elf-x86-64 object and the corresponding test case,
because SHT_X86_64_UNWIND is already tested here:
https://github.com/llvm-mirror/llvm/blob/master/test/tools/obj2yaml/section-type.yaml

2) Removes/partially moves "No such file or directory" test, because we already have a similar test here:
https://github.com/llvm-mirror/llvm/blob/master/test/tools/obj2yaml/invalid_input_file.test

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

llvm-svn: 368044
2019-08-06 14:34:39 +00:00
George Rimar
38ab2e9c2f [llvm/test/Object] - Cleanup and move out the yaml2obj tests.
There are multiple yaml2obj-* tests in llvm/test/Object
folder. This is not correct place to have them and my intention
was to move them out to test\tools\yaml2obj folder. I reviewed
them, made some changes, and my comments are below.

For all tests I:

Added comments when needed.
Moved them from llvm/test/Object to yaml2obj tests.
Another changes performed:

1) yaml2obj-invalid.yaml. It was a test for an invalid YAML input.
I just moved it.

2) yaml2obj-coff-multi-doc.test/yaml2obj-elf-multi-doc.test:
these were a tests for testing --docnum=x functionality,
one was for COFF and one for ELF. I merged them into one.

3) yaml2obj-elf-bits-endian.test:
I removed its 4 YAML inputs (merged into the main test).

4) yaml2obj-readobj.test:
This file has a long history. It was added to check the
"parsing of header charactestics" initially. Then was used to test
how yaml2obj writes the relocations. Then was upgraded to check how
yaml2obj handle "-o" option. I think it should be heavily splitted
and refactored in a separate patch. For now I leaved it as is, but restyled
to reduce the changes in a follow-ups.

5) yaml2obj-elf-alignment.yaml: its intention was to check we
can set sh-addralign field. I moved, renamed (to elf-sh-addralign.yaml)
and updated this test.

6) yaml2obj-elf-file-headers.yaml: I removed it.
It's intention was to check that
yaml2obj handles OS/ABI and ELF type (e.g Relocatable).
We are testing this already, for example in D64800. We might want
to add a better (more complete) test, but keeping the existent test
does not have much sense I think.

7) yaml2obj-elf-file-headers-with-e_flags.yaml: I would describe its intention
as "testing MIPS e_flags". It is far from being complete and tests only
a few flags. I leaved it alone for now.

8) yaml2obj-elf-rel.yaml: its intention is to check the MIPS32 relocations.
We have a version for MIPS64 here: test\Object\Mips\elf-mips64-rel.yaml
Seems them both are incomplete. I leaved them alone for now.

9) yaml2obj-elf-rel-noref.yaml: was introduced to check the support of arm32
R_ARM_V4BX relocatiion. I leaved it alone for now.

10) yaml2obj-elf-section-basic.yaml: it just checked that we are able to recognise
trivial fields like section 'Name', 'Type', 'Flags' and others. All of our yaml2obj
tests are heavily using it. I just removed this test.

11) yaml2obj-elf-section-invalid-size.yaml: its intention was to check the
"Section size must be greater than or equal to the content size" error.
I moved this test to `tools\yaml2obj\section-size-content.yaml'

12) yaml2obj-elf-symbol-basic.yaml: its intention seems was to support declarations
of the symbols in yaml2obj. I removed it. We use this in almost each test we already have.

13) yaml2obj-elf-symbol-LocalGlobalWeak.yaml: its intention was to check that we can
declare different symbol bindings. I moved it to tools\yaml2obj\elf-symbol-binding.yaml.

14) yaml2obj-coff-invalid-alignment.test: check that error is reported for a too large coff
section alignment. Moved it to tools\yaml2obj\coff-invalid-alignment.test

15) yaml2obj-elf-symbol-visibility.yaml: tests ELF symbols visibility. I improved it and
moved to tools\yaml2obj\elf-symbol-visibility.yaml and tools\obj2yaml\elf-symbol-visibility.yaml

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

llvm-svn: 367988
2019-08-06 08:02:25 +00:00
George Rimar
a8667d4414 [llvm-objdump] - Import the test/Object/X86/no-start-symbol.test test case and rewrite it to use YAML.
This patch removes test/Object/X86/no-start-symbol.test (rewrites
it to use YAML and moves it to llvm-objdump tests folder).

(This test was initially introduced in rL239039, but now there
is no reason to keep the precompiled binary it seems).

DIfferential revision: https://reviews.llvm.org/D65136

llvm-svn: 366896
2019-07-24 12:24:43 +00:00
George Rimar
00b2899f15 [test/Object, obj2yaml] - Move test cases from test/Object and cleanup.
test/Object is not correct place to have tests that check obj2yaml
functionality, because we have test/tools/obj2yaml folder for that.

In this patch I merged a few test cases with their YAMLs from Inputs
folder, converted one of binary inputs and moved them to
tools/obj2yaml folder.

There are still another tests that might need the same, so it is initial step. 

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

llvm-svn: 365891
2019-07-12 10:29:29 +00:00
George Rimar
6dff12ccb5 [test/Object/nm-trivial-object.test] - Remove 4 precompiled binaries.
This converts 5 precompiled binaries to YAMLs,
removes 4 from inputs and performs a cleanup.

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

llvm-svn: 365601
2019-07-10 08:40:11 +00:00
George Rimar
25d3a37aab [llvm\test\Object] - An initial step to cleanup the test cases.
This patch removes trivial-object-test.elf-i386,
trivial-object-test.elf-x86-64 and trivial-object-test2.elf-x86-64
precompiled objects from test/Object/Inputs folder.

I adjusted the existent test cases to use YAML instead.

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

llvm-svn: 365348
2019-07-08 16:53:39 +00:00
George Rimar
fab1cebcb8 [Object/invalid.test] - Convert Object/corrupt.test to YAML and merge the result into invalid.test
Object/corrupt.test has the same purpose as Object/invalid.test:
it tests the behavior on invalid inputs.

In this patch I converted it to YAML, merged into invalid.test, 
added comments and removed a few precompiled binaries.

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

llvm-svn: 364916
2019-07-02 12:58:37 +00:00
George Rimar
74eddae7ef [Object/invalid.test] - Convert 3 more sub-tests to YAML
This allows to remove 3 more precompiled binaries from the inputs.

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

llvm-svn: 364903
2019-07-02 10:30:06 +00:00
George Rimar
834e65d5fb [Object/invalid.test] - Convert most of the sub tests to YAML.
Object/invalid.test is a test case that is used to check the behavior of tools
when broken inputs are used.

The most often tool tested there is llvm-readobj. I think we might want to move
such tests to test\tools\llvm-readobj. For now this patch converts
many sub-tests to use YAML and removes 12 binaries from the inputs.

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

llvm-svn: 364522
2019-06-27 11:31:43 +00:00
James Henderson
7d7dfda2cc [llvm-readobj] Don't abort printing of dynamic table if string reference is invalid
If dynamic table is missing, output "dynamic strtab not found'. If the index is
out of range, output "Invalid Offset<..>".

https://bugs.llvm.org/show_bug.cgi?id=40807

Reviewed by: jhenderson, grimar, MaskRay

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

Patch by Yuanfang Chen.

llvm-svn: 363374
2019-06-14 12:02:01 +00:00
Nico Weber
7e1f295d71 Attempt to fix nm-archive.test after r362798
llvm-lib now needs a `target triple` for bitcode, so add a new file
that's like trivial.ll but has one, and use that in the test.
(trivial.ll had a comment that looked like it wasn't supposed to be used
in tests directly, so I don't want to change that file.)

llvm-svn: 362809
2019-06-07 16:06:27 +00:00
George Rimar
96e8534d94 [llvm-readelf] - Rework how we parse the .dynamic section.
This is a result of what I found during my work on https://bugs.llvm.org/show_bug.cgi?id=41679.

Previously LLVM readelf took the information about .dynamic section
from its PT_DYNAMIC segment only. GNU tools have a bit different logic.
They also use the information from the .dynamic section header if it is available.
This patch changes the code to improve the compatibility with the GNU Binutils.

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

llvm-svn: 361165
2019-05-20 15:41:48 +00:00
Tim Northover
18a8d29140 AArch64: support binutils-like things on arm64_32.
This adds support for the arm64_32 watchOS ABI to LLVM's low level tools,
teaching them about the specific MachO choices and constants needed to
disassemble things.

llvm-svn: 360663
2019-05-14 11:25:44 +00:00
Philip Reames
689c7c0532 [StackMaps] Update llvm-readobj to parse V3 Stackmaps
This updates the StackMap parser in the llvm-readobj tool to parse version 3 StackMaps, which were bumped in https://reviews.llvm.org/D32629.

Version 3 StackMaps differ in that they have a uint16 sized "location size" field which was added to the Location block in a StackMap record. The record has additional padding for alignment. This was a backwards incompatible change resulting in a StackMap version bump.

Patch By: jacob.hughes@kcl.ac.uk (with a rewrite of tests by me)
Differential Revision: https://reviews.llvm.org/D59020

llvm-svn: 358325
2019-04-13 03:55:13 +00:00
Steven Wu
81b4af3e73 [Object] Fix reading objects created with -fembed-bitcode-marker
Currently, this fails with many tools, e.g.

$ clang -fembed-bitcode-marker -c -o test.o test.c
$ nm test.o
nm: test.o The file was not recognized as a valid object file

-fembed-bitcode-marker creates a LLVM,bitcode section consisting of a single
byte. When reading the object file, IRObjectFile::findBitcodeInObject succeeds,
causing SymbolicFile::createSymbolicFile to try to read the "bitcode" rather
than using the outer Mach-O data - when then fails.

Fix this by making findBitcodeInObject return an error if the section size <= 1.

Patched by: Nicholas Allegra

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

llvm-svn: 356718
2019-03-21 21:01:31 +00:00
Michael Trent
45c98f5090 Limit dyld image suffixes guessed by guessLibraryShortName()
Summary:
guessLibraryShortName() separates a full Mach-O dylib install name path
into a short name and a dyld image suffix. The short name is the name
of the dylib without its path or extension. The dyld image suffix is a
string used by dyld to load variants of dylibs if available at runtime;
for example, "when binding this process, load 'debug' variants of all
required dylibs." dyld knows exactly what the image suffix is, but
by convention diagnostic tools such as llvm-nm attempt to guess suffix
names by looking at the install name path. 

These dyld image suffixes are separated from the short name by a '_'
character. Because the '_' character is commonly used to separate words
in filenames guessLibraryShortName() cannot reliably separate a dylib's
short name from an arbitrary image suffix; imagine if both the short
name and the suffix contains an '_' character! To better deal with this
ambiguity, guessLibraryShortName() will recognize only "_debug" and
"_profile" as valid Suffix values. Calling code needs to be tolerant of
guessLibraryShortName() guessing incorrectly.

The previous implementation of guessLibraryShortName() did not allow
'_' characters to appear in short names. When present, the short name
would be  truncated, e.g., "libcompiler_rt" => "libcompiler". This
change allows "libcompiler_rt" and "libcompiler_rt_debug" to both be
recognized as "libcompiler_rt".

rdar://47412244

Reviewers: kledzik, lhames, pete

Reviewed By: pete

Subscribers: llvm-commits

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

llvm-svn: 352104
2019-01-24 20:59:44 +00:00
Sam Clegg
7bc608206a [WebAssembly] Store section alignment as a power of 2
This change bumps for version number of the wasm object file
metadata.

See https://github.com/WebAssembly/tool-conventions/pull/92

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

llvm-svn: 351285
2019-01-16 01:34:48 +00:00
Heejin Ahn
bd36255223 [WebAssembly] Check if the section order is correct
Summary:
This patch checks if the section order is correct when reading a wasm
object file in `WasmObjectFile` and converting YAML to wasm object in
yaml2wasm. (It is not possible to check when reading YAML because it is
handled exclusively by the YAML reader.)

This checks the ordering of all known sections (core sections + known
custom sections). This also adds section ID DataCount section that will
be scheduled to be added in near future.

Reviewers: sbc100

Subscribers: dschuff, mgorny, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 349221
2018-12-15 00:58:12 +00:00
Heejin Ahn
58e7365bdd [WebAssembly] Update test cases after FixFunctionBitcasts
Summary:
This updates generated binaries and corresponding test cases up to date
after applying FixFunctionBitcasts pass.

Reviewers: sbc100

Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 346286
2018-11-07 01:58:50 +00:00
Jonas Devlieghere
b42f11290d [WASM] Fix overflow when reading custom section
When reading a custom WASM section, it was possible that its name
extended beyond the size of the section. This resulted in a bogus value
for the section size due to the size overflowing.

Fixes heap buffer overflow detected by OSS-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8190

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

llvm-svn: 339269
2018-08-08 16:34:03 +00:00
Sam Clegg
753387b3f6 [WebAsembly] Update default triple in test files to wasm32-unknown-unkown.
Summary: The final -wasm component has been the default for some time now.

Subscribers: jfb, dschuff, jgravelle-google, eraman, aheejin, JDevlieghere, sunfish, llvm-commits

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

llvm-svn: 332007
2018-05-10 17:49:11 +00:00
Hans Wennborg
9973a40707 Add a test for r331746.
Thanks to pcc for creating the test file!

llvm-svn: 331854
2018-05-09 08:20:14 +00:00
Sam Clegg
417ceeda60 typo
llvm-svn: 331006
2018-04-27 00:17:24 +00:00
Sam Clegg
cb06f48d01 [WebAssembly] Section symbols must have local binding
Summary: Also test for symbols information in test/MC/WebAssembly/debug-info.ll.

Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, JDevlieghere, llvm-commits

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

llvm-svn: 331005
2018-04-27 00:17:21 +00:00
Sam Clegg
33666d525d [WebAssembly] Add version to object file metadata
Summary: See https://github.com/WebAssembly/tool-conventions/issues/54

Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits

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

llvm-svn: 330969
2018-04-26 18:15:32 +00:00
Sam Clegg
7ccbb03639 [WebAssembly] Use section index in relocation section header
Rather than referring to sections my their code, use the
absolute index of the target section within the module.

See https://github.com/WebAssembly/tool-conventions/issues/52

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

llvm-svn: 330749
2018-04-24 18:11:36 +00:00
Nicholas Wilson
b8ac3c4437 [WebAssembly] Reorder reloc sections to come between symtab and name
This is required in order to enable relocs to be validated
as they are read in.

Also update tests with new section ordering.

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

llvm-svn: 326694
2018-03-05 12:59:03 +00:00
Nicholas Wilson
741f2ab6c7 [WebAssembly] Update pre-generated test files to match latest llc output. NFC.
The ordering of llc's output was changed in rL326334.

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

llvm-svn: 326445
2018-03-01 15:55:59 +00:00
Sam Clegg
6ed66fd14e [WebAssembly] Add first claass symbol table to wasm objects
This is combination of two patches by Nicholas Wilson:
  1. https://reviews.llvm.org/D41954
  2. https://reviews.llvm.org/D42495

Along with a few local modifications:
- One change I made was to add the UNDEFINED bit to the binary format
  to avoid the extra byte used when writing data symbols.  Although this
  bit is redundant for other symbols types (i.e. undefined can be
  implied if a function or global is a wasm import)
- I prefer to be explicit and consistent and not have derived flags.
- Some field renaming.
- Some reverting of unrelated minor changes.
- No test output differences.

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

llvm-svn: 325860
2018-02-23 05:08:34 +00:00
Rui Ueyama
18bbb959e4 Allow unaligned access to ELF file data structures.
The ELF specification says that all ELF data structures are aligned to
their natural alignments both in memory and file. That means when we
access mmap'ed ELF files, we could assume that all data structures are
aligned properly.

However, in reality, we assume that the data structures are aligned only
to two bytes because .a files only guarantee that their member files are
aligned to two bytes in archive files. So the data access is already
unaligned.

This patch relaxes the alignment requirement even more, so that we
accept unaligned access to all ELF data structures.

This patch in particular makes lld bug-compatible with icc. Intel C
compiler doesn't seem to care about data alignment and generates unaligned
relocation sections (https://bugs.llvm.org/show_bug.cgi?id=35854).
I also saw another instance of compatibility issues with our internal tool
which creates unaligned section headers.

Because GNU linkers are not picky about alignment, looks like it is
not uncommon that ELF-generating tools create unaligned files.

There is a performance penalty with this patch on host machines on which
unaligned access is expensive. x86 and AArch64 are fine. ARMv6 is a
problem, but I don't think using ARMv6 machines as hosts is common, so I
believe it's not a real problem.

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

llvm-svn: 322407
2018-01-12 22:09:19 +00:00
Martin Storsjo
f618dfb123 [test] Add test files that were missed from SVN r317459
llvm-svn: 317461
2017-11-06 07:36:17 +00:00
Rafael Espindola
4d7e642f7d Fix buffer overflow.
We were reading past the end of the buffer.

llvm-svn: 316143
2017-10-19 01:25:48 +00:00
Rafael Espindola
0ca347c3b8 Make the ELFFile constructor private.
With this all clients have to use the new create method which returns
an Expected.

Fixes a crash on invalid input.

llvm-svn: 315376
2017-10-10 22:17:49 +00:00
Rafael Espindola
e505531600 Added phdr upper bound checks to ElfObject.
Ensure the program_headers call will fail correctly if the program
headers are larger than the underlying buffer.

Patch by Parker Thompson!

llvm-svn: 315012
2017-10-05 20:01:32 +00:00
Jonas Devlieghere
f2155ac157 [MachO] Prevent heap overflow when load command extends past EOF
This patch fixes a heap-buffer-overflow when a malformed Mach-O has a
load command who's size extends past the end of the binary.

Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3225

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

llvm-svn: 313145
2017-09-13 13:43:01 +00:00
Jonas Devlieghere
7617e37e4f [WebAssembly] Fix overflow for input with missing version
Differential revision: https://reviews.llvm.org/D37070

llvm-svn: 311605
2017-08-23 21:36:04 +00:00
Sam Clegg
d0915607d8 [WebAssembly] Be consistent in generating trivial test input files
For each checked-in wasm file, make sure the there is
corresponding .ll file that can be used to regenerate it
if needed.

Add test/Object/Inputs/trivial-object-test.wasm to match other
formats and add some new wasm tests in test/Object.

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

llvm-svn: 307585
2017-07-10 20:43:26 +00:00
Shoaib Meenai
3230d2780d [COFF] Gracefully handle empty .drectve sections
Running `llvm-readobj -coff-directives msvcrt.lib` resulted in this error:

    Invalid data was encountered while parsing the file

This happened because some of the object files in the archive have empty
`.drectve` sections. These empty sections result in a `parse_failed` error being
returned from `COFFObjectFile::getSectionContents()`, which in turn caused
`llvm-readobj` to stop. With this change, `getSectionContents` now returns
success, and like before the resulting array is empty.

Patch by Dave Lee.

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

llvm-svn: 303014
2017-05-14 18:34:56 +00:00
Rafael Espindola
208332c2a4 Archives require a symbol table on Solaris, even if empty.
On Solaris ld (and some other tools that use the underlying utility
libraries, such as elfdump) chokes on an archive library that has no
symbol table. The Solaris tools always create one, even if it's empty.

That bug has been fixed in the latest development line, and can
probably be backported to a supported release, but it would be nice if
LLVM's archiver could emit the empty symbol table, too.

Patch by Danek Duvall!

llvm-svn: 297773
2017-03-14 19:57:13 +00:00
Davide Italiano
d5a8d17b60 [obj2yaml] Produce correct output for invalid relocations.
R_X86_64_NONE can be emitted without a symbol associated (well,
in theory it should never be emitted in an ABI-compliant relocatable
object). So, if there's no symbol associated to a reloc, emit one
with an empty name, instead of crashing.

Ack'ed by Michael Spencer offline.

PR: 31768
llvm-svn: 293224
2017-01-26 23:12:53 +00:00
Kevin Enderby
59a3f7063b Add support for the new LC_NOTE load command.
It describes a region of arbitrary data included in a Mach-O file.
Its initial use is to record extra data in MH_CORE files.

rdar://30001545
rdar://30001731

llvm-svn: 292500
2017-01-19 17:36:31 +00:00