Commit Graph

8858 Commits

Author SHA1 Message Date
Martin Storsjo 405b5bcc36 [COFF] Correctly set the thumb bit in DLL export addresses
The same adjustment is already done for the entry point in
Writer.cpp and for relocations that point to executable code
in Chunks.cpp.

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

llvm-svn: 308953
2017-07-25 06:10:44 +00:00
Martin Storsjo 25712667cb [COFF] Add a test for producing DLLs and import libraries for ARM64
This is a test for LLVM SVN r308951.

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

llvm-svn: 308952
2017-07-25 06:08:25 +00:00
Rafael Espindola dc49af9d32 Make a function static. NFC.
llvm-svn: 308939
2017-07-24 23:55:33 +00:00
Tom Stellard 1d70d75f46 Fix ObjCPass on big-endian host
Summary:
This fixes test/mach-o/objc-image-info-pass-output.yaml on
big-endian hosts.

Reviewers: lhames, kledzik, ruiu

Reviewed By: ruiu

Subscribers: llvm-commits

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

llvm-svn: 308935
2017-07-24 23:13:31 +00:00
Dmitry Mikulin 97d6a80895 If user requested section alignment is greater than MaxPageSize, propagate it to segment headers correctly.
Differential Revision: https://reviews.llvm.org/D35813

llvm-svn: 308930
2017-07-24 21:27:02 +00:00
Davide Italiano 0a26c5738d [ELF] Fix a typo introduced in r308915.
Thanks to Rafael for finding it in a post-commit review.

llvm-svn: 308921
2017-07-24 20:18:16 +00:00
Davide Italiano 957f1206e9 [LTO] Make sure symbol ordering is honoured also for data.
Follow-up to r308915 suggested by Rafael and Peter.

llvm-svn: 308920
2017-07-24 20:15:07 +00:00
Davide Italiano 4deb97c377 [ELF] Fix a couple of typos in a test.
llvm-svn: 308916
2017-07-24 19:42:13 +00:00
Davide Italiano 1f4e29c71d [LTO] Make sure symbol ordering is honoured.
We do this emitting a section for every function when LTO is used.
Fixes PR33888.

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

llvm-svn: 308915
2017-07-24 19:38:13 +00:00
Rafael Espindola fae04ae44c Handle a section being more aligned than a page size.
llvm-svn: 308812
2017-07-22 00:17:57 +00:00
Rafael Espindola ca5740d95a Don't crash on an empty section with an ALIGN.
llvm-svn: 308809
2017-07-22 00:00:51 +00:00
Rui Ueyama 8940102671 Fix a test breakage caused by r308752.
llvm-svn: 308775
2017-07-21 20:15:46 +00:00
George Rimar 4f37d57547 [ELF] - Introduce multiclass Eq helper for Options.td
Eq helper allows to define `XXX` and `XXX=` options forms easily.
Patch adds testcases for few aliases.

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

llvm-svn: 308752
2017-07-21 16:27:26 +00:00
Igor Kudrin 7d2b15a7ab [ELF] Avoid data race in ObjectFile<ELFT>::getDILineInfo().
Differential Revision: https://reviews.llvm.org/D35537

llvm-svn: 308728
2017-07-21 11:26:08 +00:00
Petr Hosek 8b591f592b [ELF] Remove processNonSectionCommands
This method is no longer being used anywhere.

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

llvm-svn: 308706
2017-07-21 01:02:30 +00:00
Petr Hosek 039fb8c296 [ELF] Align the value if needed when computing the expression
Also add the test cases for the addition and subtraction both for
the relative and absolute case.

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

llvm-svn: 308692
2017-07-20 23:11:47 +00:00
Kevin Enderby b4c351dfd1 lld matching change for llvm change r308690 to add error handling to
the dyld compact export entries in libObject.

llvm-svn: 308691
2017-07-20 23:09:19 +00:00
Rui Ueyama 800cd3ec40 Add a missing tool dependency.
This dependency was introduced in r308681.

llvm-svn: 308686
2017-07-20 22:39:31 +00:00
Rafael Espindola 2bd185bcde Fix symbol type with icf.
We were not looking at Repl and so thinking there was no output
section associated with the merged symbol. Because of that it was
produced as absolute.

This was found by an internal round of testing.

llvm-svn: 308681
2017-07-20 21:55:40 +00:00
Rui Ueyama bc2c9e0278 Do not strip SHF_GROUP in elf::decompressAndMergeSections().
SHF_GROUP flag should have been removed when the control reaches here
because InputSectionBase turns the flag off. So this code should be
redundant.

llvm-svn: 308680
2017-07-20 21:42:30 +00:00
Rui Ueyama 875ae82b0b Add the --chroot option for --reproduce.
Summary:
If the linker is invoked with `--chroot /foo` and `/bar/baz.o`, it
tries to read the file from `/foo/bar/baz.o`. This feature is useful
when you are dealing with files created by the --reproduce option.

Reviewers: grimar

Subscribers: llvm-commits, emaste

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

llvm-svn: 308646
2017-07-20 18:17:55 +00:00
Rafael Espindola 4b1008af73 Add test from pr33173.
It was fixed by r308544.

llvm-svn: 308634
2017-07-20 17:14:52 +00:00
Martin Storsjo 5ae7649a4e [COFF] Support 128 bit SIMD/FP ldr/str in IMAGE_REL_ARM64_PAGEOFFSET_12L
Also extend the tests for IMAGE_REL_ARM64_PAGEOFFSET_12L to test
all 8/16/32/64 bit GPR and 8/16/32/64/128 SIMD/FP bit ldr/str variants,
and a ldr with an existing offset.

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

llvm-svn: 308631
2017-07-20 16:48:33 +00:00
Martin Storsjo dd62dffbcb [COFF] Minor tweaks to ARM64 relocation code. NFC.
Fix issues found in existing code, while reviewing other changes.

Change the data type of a variable to uint32_t, to avoid potential issues
with signedness in shifts.

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

llvm-svn: 308586
2017-07-20 05:49:58 +00:00
Martin Storsjo b3c97b9623 [COFF] Align import address chunks to the pointer size
This fixes cases on ARM64 when importing from more than one DLL,
in case the imports from the first DLL ended up unaligned.

When fixing up a IMAGE_REL_ARM64_PAGEOFFSET_12L, which shifts the
offset by the load/store size, check that the shift doesn't discard
any bits. (This would also detect if the import address chunks were
unaligned.)

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

llvm-svn: 308585
2017-07-20 05:49:54 +00:00
Rafael Espindola 8b1afd59c3 Speed up gdb index creation.
With that in place we can use lld's own infrastructure for the low
level detail of dwarf parsing.

With this we don't decompress sections twice, we don't scan all
realocations and even with this simplistic implementation linking
clang with gdb index goes from 34.09 seconds to 20.80 seconds.

llvm-svn: 308544
2017-07-19 22:27:35 +00:00
Rui Ueyama 0deaacb95a Call StringRef::contains only once for each StringRef.
llvm-svn: 308529
2017-07-19 21:49:01 +00:00
Rui Ueyama 12234f8093 Use StringRef::contains().
llvm-svn: 308526
2017-07-19 21:40:26 +00:00
Rui Ueyama 7eaf3d4b31 Fix one more occurrence of getOption().getID().
llvm-svn: 308523
2017-07-19 21:06:46 +00:00
Rui Ueyama 38b0f4a1f2 Handle option aliases in a better way.
In this way, we don't need to know which options have aliases.

llvm-svn: 308519
2017-07-19 20:30:04 +00:00
Rafael Espindola aca2afcc55 Don't depend on these symbols being implicitly global.
This might change in llvm-mc and it is nice to be explicit in a test.

llvm-svn: 308506
2017-07-19 18:24:38 +00:00
Reid Kleckner d91ca7666f [PDB] Emit TPI and IPI hashes
llvm-svn: 308497
2017-07-19 17:26:07 +00:00
Rafael Espindola 3ddf2110d5 Bring back r307364.
In addition this includes a change to prefer symbols with a default
version @@ over unversioned symbols.

Original commit message:

[ELF] - Handle symbols with default version early.

This fixes last testcase provided in PR28414.
In short issue is next: when we had X@@Version symbol in object A,
we did not resolve it to X early. Then when in another object B
we had reference to undefined X, symbol X from archive was fetched.
Since both archive and object A contains another symbol Z, duplicate
symbol definition was triggered as a result.

Correct behavior is to use X@@Version from object A instead and do not fetch
any symbols from archive.

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

llvm-svn: 308492
2017-07-19 16:45:05 +00:00
Hans Wennborg 884e84533d Clear release notes for 6.0.0
llvm-svn: 308475
2017-07-19 14:09:52 +00:00
Hans Wennborg 7e9b4784a6 Bump docs version to 6.0
llvm-svn: 308463
2017-07-19 13:47:08 +00:00
Saleem Abdulrasool 2334adeb02 test: remove duplicated test
This test is folded into implib-name.  Don't bother with the racy test.
The use of %T results in left-overs from previous tests which write out
the same import library as this test.

llvm-svn: 308409
2017-07-19 02:39:00 +00:00
Saleem Abdulrasool ace2fa7da4 COFF: improve link conformance for import names
Improve the link conformance for the import name embedded into the
import library.  This requires the associated change to the LLVM portion
for the DEF file parser.  The import file generation embeds a different
name based on whether the driver is invoked as "link" or "lib".
Furthermore, the LIBRARY keyword in the DEF file influences the import
name.  The behaviour can be summarised according to the following table:

      | LIBRARY w/ ext |   LIBRARY w/o ext   | no LIBRARY
 -----+----------------+---------------------+------------------
 LINK | {value}        | {value}.{.dll/.exe} | {output name}
  LIB | {value}        | {value}.dll         | {output name}.dll

llvm-svn: 308407
2017-07-19 02:01:27 +00:00
Rafael Espindola 2b84fa418b Make the test more precise.
The real issue was the missing explicit versions.

llvm-svn: 308391
2017-07-18 23:26:16 +00:00
Rafael Espindola 483506562c Add a test for PR33820.
This would have found the issue.

llvm-svn: 308389
2017-07-18 22:52:44 +00:00
Saleem Abdulrasool 08c83ea0f3 test: add COFF test for library extension handling
Ensure that an extension other than .dll, .exe is preserved as per the
behaviour of link.

llvm-svn: 308386
2017-07-18 22:25:07 +00:00
Rafael Espindola a4148c6eed Fix REQUIRES line.
llvm-svn: 308385
2017-07-18 22:14:26 +00:00
Rafael Espindola afbb7be6d5 Fix a crash.
This is PR33821.

What we really want to check in here is if the output section was
created, not if the command was empty.

llvm-svn: 308382
2017-07-18 21:46:27 +00:00
Rui Ueyama ede4c7ecbc Fix errors in r308335 and add "REQUIRES: x86" to one more file.
llvm-svn: 308339
2017-07-18 18:51:43 +00:00
Jon Chesterfield e0ca2ff070 [LLD] Mark a number of x86 only tests to require x86
Noticed while testing for an out of tree target. There are probably more tests that should be so marked.
I'm not sure who owns these tests so I've added a few names I recognise from the recent history.

With advice from probinson, ruiu, rafael and dramatically improved by davidb. Thank you all!

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

llvm-svn: 308335
2017-07-18 18:40:50 +00:00
Shoaib Meenai 9a61a791ac [COFF] Accept discarded relocations in DWARF debug sections
DWARF debug sections can also contain relocations against symbols in
discared segments. LLD should accept such relocations.

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

llvm-svn: 308315
2017-07-18 15:11:05 +00:00
George Rimar b939d32f53 [ELF] - Fix member name: alignment -> Alignment. NFC.
llvm-svn: 308300
2017-07-18 11:59:19 +00:00
George Rimar 67c60727ce [ELF] - Apply clang-format. NFC.
llvm-svn: 308297
2017-07-18 11:55:35 +00:00
Reid Kleckner f8522d81c3 Fix pdb-type-server-simple test on non-Windows
Assume that the LF_TYPESERVER2 record contains Windows-style paths.  In
any case, 'sys::path::filename(Path, Style::windows)' will work on
Unix-style paths.

llvm-svn: 308241
2017-07-18 00:33:53 +00:00
Rui Ueyama 0e0369e535 Revert r307364: [ELF] - Handle symbols with default version early.
This reverts commit r307364 because that change is likely to have
caused https://bugs.llvm.org/show_bug.cgi?id=33820.

llvm-svn: 308239
2017-07-18 00:33:14 +00:00
Reid Kleckner 651db91c2d [PDB] Merge in types and items from type servers (/Zi)
Summary:
Object files compiled with /Zi emit type information into a type server
PDB. The .debug$S section will contain a single TypeServer2Record with
the absolute path and GUID of the type server. LLD needs to load the
type server PDB and merge all types and items it finds in it into the
destination PDB.

Depends on D35495

Reviewers: ruiu, inglorion

Subscribers: zturner, llvm-commits

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

llvm-svn: 308235
2017-07-18 00:21:25 +00:00