Commit Graph

4053 Commits

Author SHA1 Message Date
Cameron Esfahani e211e204da NFC: Fix spelling error in comment.
llvm-svn: 248768
2015-09-29 00:21:38 +00:00
Rafael Espindola 2732235508 Try to fix gcc warning
llvm-svn: 248749
2015-09-28 22:12:54 +00:00
Rafael Espindola 5f19f1224c Delete dead code.
llvm-svn: 248747
2015-09-28 22:07:52 +00:00
Lang Hames 9a4c94ec5a [lld][MachO] Fix a think-o to get the twolevel/dynamic_lookup test passing.
llvm-svn: 248736
2015-09-28 20:52:21 +00:00
Rafael Espindola 4b2ca85c1a Implement --allow-multiple-definition.
Patch by George Rimar!

llvm-svn: 248733
2015-09-28 20:30:11 +00:00
Lang Hames 5c692009bc [lld][MachO] Initial implementation of -flat_namespace and -undefined.
This is a basic initial implementation of the -flat_namespace and
-undefined options for LLD-darwin. It ignores several subtlties,
but the result is close enough that we can now link LLVM (but not
clang) on Darwin and pass all regression tests.

llvm-svn: 248732
2015-09-28 20:25:14 +00:00
Rafael Espindola 085a8f5ea7 Don't include fully resolved relocations in the dynamic relocation table.
llvm-svn: 248731
2015-09-28 20:18:40 +00:00
Rafael Espindola 46e01554b1 Add support for got/ptl referring to symbols defined in .o files.
llvm-svn: 248730
2015-09-28 19:48:34 +00:00
Rafael Espindola dfc7200b18 Add support for local absolute symbols.
llvm-svn: 248726
2015-09-28 18:29:47 +00:00
Rui Ueyama c5e22d906b ELF2: Include file names in error messages.
llvm-svn: 248724
2015-09-28 18:20:41 +00:00
Igor Kudrin 1309fc0378 [ELF2] Add --sysroot command line switch
Reviewers: rafael, ruiu

Subscribers: llvm-commits

Projects: #lld

Differential Revision: http://reviews.llvm.org/D13209

llvm-svn: 248715
2015-09-28 15:01:59 +00:00
Rafael Espindola eb990af31e Trying to fix the windows build.
llvm-svn: 248709
2015-09-28 13:11:36 +00:00
Rafael Espindola abb7b28686 Add support for -L and -l command line switches.
Patch by Igor Kudrin!

llvm-svn: 248708
2015-09-28 12:52:21 +00:00
Rafael Espindola 83af95d927 Enable the aarch64 tests.
llvm-svn: 248707
2015-09-28 12:22:25 +00:00
Davide Italiano aabc45b5ad [ELF] Sort a list of cases alphabetically for consistency/clarity. NFC.
llvm-svn: 248680
2015-09-27 09:01:28 +00:00
Davide Italiano 1d750a6fc3 [ELF2/AArch64] Support for R_AARCH64_ADR_PREL_LO21 relocation.
llvm-svn: 248679
2015-09-27 08:45:38 +00:00
NAKAMURA Takumi 00eecb88a4 lld/test/elf2/basic-aarch64.s should not REQUIRE x86.
FIXME: The feature "arm64" is not activated in lit.cfg.
llvm-svn: 248664
2015-09-26 09:21:58 +00:00
Davide Italiano 6993ba4d3e [ELF2] Don't inline function and define it in OutputSection.cpp. NFC.
Reported/Requested by: Rafael Espindola

llvm-svn: 248643
2015-09-26 00:47:56 +00:00
Davide Italiano f096e10a47 [ELF2] Spell llvm-readobj correctly.
llvm-svn: 248642
2015-09-26 00:43:49 +00:00
Davide Italiano cde9336717 [ELF2] Add initial AArch64 support.
Differential Revision:	http://reviews.llvm.org/D13167

llvm-svn: 248641
2015-09-26 00:32:04 +00:00
Tom Stellard d0626804fc ELF/AMDGPU: Text section should be called .hsatext
Reviewers: atanasyan, ruiu

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D12447

llvm-svn: 248621
2015-09-25 21:42:30 +00:00
Rafael Espindola 84aff152d9 Simplify enumeration definition.
Thanks to Rui for the suggestion.

llvm-svn: 248615
2015-09-25 21:20:23 +00:00
Rafael Espindola 551dfd8818 Implement --noinhibit-exec.
Patch by George Rimar!

llvm-svn: 248605
2015-09-25 19:24:57 +00:00
Rafael Espindola 0e604f913a Add support for creating the symbols __init_array_start and __init_array_end.
llvm-svn: 248604
2015-09-25 18:56:53 +00:00
Rafael Espindola 5b197f0620 Fix the typedef.
Thanks to David Blaikie for noticing.

llvm-svn: 248602
2015-09-25 18:32:09 +00:00
Rafael Espindola cd076f0113 Move more logic to getSymVA to avoid code duplication.
llvm-svn: 248599
2015-09-25 18:19:03 +00:00
Rafael Espindola 25b0acb57e Move variables closer to use. NFC.
llvm-svn: 248590
2015-09-25 17:32:37 +00:00
Rafael Espindola 35c6af3c9c Move a few methods out of line. NFC.
llvm-svn: 248586
2015-09-25 17:19:10 +00:00
Rui Ueyama 548d22c073 COFF: ICF should not merge sectinos if their alignments are not the same.
There's actually a room to improve this patch. Instead of not merging
sections that have different alignements, we can choose the section that
has the largest alignment requirement among all sections that are otherwise
considered the same. Then all section alignments are satisfied, so we can
merge them.

I don't know if that improvement could make any difference for real-world
input, so I'll leave it alone. Would be interesting to revisit later.

llvm-svn: 248581
2015-09-25 16:50:12 +00:00
Rui Ueyama c9e746b9e6 COFF: Fix local varaible type.
This is intended to be 64-bit integer, but size_t is not guranteed
to be the same or larger type than uint64_t.

llvm-svn: 248580
2015-09-25 16:38:13 +00:00
Rui Ueyama de88072a00 COFF: Rename Ptr -> Repl.
This pointer points to a replacement for this chunk. Ptr was not a good name.

llvm-svn: 248579
2015-09-25 16:20:24 +00:00
Rui Ueyama eeb22f8251 ELF2: Support reponse files.
http://reviews.llvm.org/D13148

llvm-svn: 248575
2015-09-25 15:37:33 +00:00
Rafael Espindola 38af127c6a Fix the parent class of SharedSymbol.
It is a defined symbol according to classof. Found by inspection.

llvm-svn: 248573
2015-09-25 15:34:03 +00:00
Rafael Espindola d13d9606fb Inline function into only use.
llvm-svn: 248572
2015-09-25 15:08:44 +00:00
Davide Italiano b558b79c88 [ELF2] Make buildbot happy again.
llvm-svn: 248560
2015-09-25 04:22:13 +00:00
Davide Italiano 85121bbf24 [ELF2] Use static non-member function when it suffices.
Pointed out by Rui Ueyama.

llvm-svn: 248559
2015-09-25 03:56:11 +00:00
Rui Ueyama 3f4ec66624 ELF2: Use lambdas instead of named functions.
They are short and used only once, so writing them where they are used
is better.

llvm-svn: 248558
2015-09-25 03:48:25 +00:00
Rui Ueyama 4c4993bba6 Remove dead code.
llvm-svn: 248557
2015-09-25 03:38:56 +00:00
Davide Italiano aa7c533ec3 [ELF2] Fix binaries so they actually run on FreeBSD.
Since FreeBSD 4.1, the kernel expects binaries to be marked with
ELFOSABI_FREEBSD in the ELF header to exec() them. LLD unconditionally 
sets OSABI to ELF_OSABINONE, and everything linked with it won't run 
on FreeBSD (unless explicitly rebranded).

Example:
% ./aarch64-hello
ELF binary type "0" not known.
zsh: exec format error: ./aarch64-hello

FreeBSD could be modified to accept ELF_OSABINONE, but that would break all
existing binaries, so the kernel needs to support both ABINONE and ABIFREEBSD.
I plan to push this change in FreeBSD one day, which, unfortunately, is 
not today. This code patches lld so it sets the header field correctly.

For completeness, the rationale of this change is explained in the FreeBSD 
commit message, and it's apparently to pleasee binutils maintainers at the time.
https://svnweb.freebsd.org/base?view=revision&revision=59342

Differential Revision:	 http://reviews.llvm.org/D13140

llvm-svn: 248554
2015-09-25 01:59:13 +00:00
Chris Bieneman 77456efcb1 [CMake] Move LLD to the new style for symlink generation, and make the links list overridable.
Reviewers: lhames, rafael

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D13136

llvm-svn: 248544
2015-09-24 21:53:18 +00:00
Rui Ueyama c28a08b8d2 COFF: Remove duplicate parameter from hash value calculation.
llvm-svn: 248526
2015-09-24 19:00:42 +00:00
Rui Ueyama 1392d8b5fe Fix memory leak in FileArchive::find().
Patch from George Rimar!

llvm-svn: 248525
2015-09-24 18:59:26 +00:00
Rui Ueyama d5b5ab7638 [ELF2] Output of all unknown arguments instead of only one.
Patch from George Rimar!

llvm-svn: 248524
2015-09-24 18:55:33 +00:00
Davide Italiano bf37cdec28 [ELF2] Remove ignored options handling.
This was prematurely committed (and I take the blame for that).
Ideally, we want to support only ignored options that are really used
by somebody. Some of the options listed are not even supported by gold
(but only by ld.bfd), which says a lot about their "real-world" usefulness.

llvm-svn: 248503
2015-09-24 15:12:34 +00:00
Rafael Espindola e1901cc33d Simplify memory management by having ELFData contain a ELFObj.
llvm-svn: 248502
2015-09-24 15:11:50 +00:00
Davide Italiano d75d3b94fd [ELF2] Add support for -discard-none.
Differential Revision:	http://reviews.llvm.org/D13083

llvm-svn: 248499
2015-09-24 15:08:23 +00:00
Rafael Espindola e0f09fac78 Add a test covering ELFFile's constructor failing.
llvm-svn: 248498
2015-09-24 14:55:25 +00:00
Rafael Espindola 0872ea3954 Simplify with some ideas from COFF:
* add using namespace llvm::support::endian.
* create a add32le static helper.

Thanks to Rui for the suggestion.

llvm-svn: 248491
2015-09-24 14:16:02 +00:00
Rafael Espindola d27adc42e6 Add support for the _GLOBAL_OFFSET_TABLE_ symbol.
llvm-svn: 248490
2015-09-24 13:34:01 +00:00
Rafael Espindola 5a5fdf7f73 Fix typo.
Thanks to Sean Silva for noticing.

llvm-svn: 248488
2015-09-24 12:58:44 +00:00