Rafael Espindola
7d76847da3
Simplify. NFC.
...
llvm-svn: 249128
2015-10-02 13:23:29 +00:00
Rafael Espindola
98efd89e7e
Use ld.lld2 as a argv[0] alias.
...
The reason for the name is so that we can run
./build/bin/clang -fuse-ld=lld2 test.o -o t
llvm-svn: 249122
2015-10-02 12:57:34 +00:00
Rui Ueyama
43155d0d48
[LLD] Fix Clang-tidy modernize-use-nullptr warnings; other minor cleanups.
...
Patch from Eugene Zelenko!
llvm-svn: 249111
2015-10-02 00:36:00 +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
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
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
Rui Ueyama
1392d8b5fe
Fix memory leak in FileArchive::find().
...
Patch from George Rimar!
llvm-svn: 248525
2015-09-24 18:59:26 +00:00
Lang Hames
c803442890
[LLD][MachO] Fix a FIXME: Subtract base address from atom address when building
...
export trie.
llvm-svn: 248217
2015-09-21 22:06:02 +00:00
Simon Atanasyan
92480f9a20
[Mips] Rejects all --hash-style arguments except 'sysv' in case of MIPS target
...
MIPS ABI supports only --hash-style=sysv variant.
llvm-svn: 247796
2015-09-16 13:36:32 +00:00
Simon Atanasyan
49c67236f1
[Mips] Do not show an error if R_MIPS_GPREL32 relocation has a non-local target
...
This matches GNU linker behaviour.
llvm-svn: 247795
2015-09-16 13:36:24 +00:00
Rui Ueyama
9071e4a6fa
Fix Clang-tidy misc-use-override warnings, other minor fixes.
...
Patch from Eugene Zelenko!
llvm-svn: 247323
2015-09-10 18:51:36 +00:00
Rui Ueyama
6b0af3c832
Fix -Wcovered-switch-default warnings.
...
llvm-svn: 246419
2015-08-31 06:46:00 +00:00
Rui Ueyama
692f8683d7
ELF: Fix "not all control paths return a value" warning.
...
llvm-svn: 246417
2015-08-31 06:32:25 +00:00
Simon Atanasyan
e235d45026
[Mips] Support grouping of multiple consecutive relocations in case of N32 and 64-bit MIPS ABIs
...
llvm-svn: 246337
2015-08-28 21:39:21 +00:00
Simon Atanasyan
9638d7d162
[Mips] Support two more MIPS linking emulation options elf32btsmipn32/elf32ltsmipn32
...
llvm-svn: 246336
2015-08-28 21:39:13 +00:00
Simon Atanasyan
f12120cfe9
[Mips] Make "emulation" option less dependent on the "-target" option.
...
Now it is possible to have mips-linux-gnu-ld executable and link MIPS 64-bit
little-endian binaries providing -melf64ltsmip command line argument.
llvm-svn: 246335
2015-08-28 21:39:06 +00:00
Simon Atanasyan
6d39140b6e
[Mips] Initial support of the MIPS N32 ABI
...
llvm-svn: 246334
2015-08-28 21:39:00 +00:00
Tom Stellard
8251f978d3
ELF/AMDGPU: Add more misssing: using namespace lld;
...
Hopefully, this will resolve the remaining windows bot errors.
llvm-svn: 246181
2015-08-27 18:43:12 +00:00
Tom Stellard
39b3d71177
ELF/AMDGPU: Add missing: using namespace lld; to try to fix windows bot
...
llvm-svn: 246179
2015-08-27 18:27:52 +00:00
Tom Stellard
fbbbc01caa
ELF/AMDGPU: Remove another unused private member variable
...
llvm-svn: 246164
2015-08-27 17:11:10 +00:00
Tom Stellard
36c6f6b874
ELF/AMDGPU: Remove unused private member variable
...
This should fix the one of the failing bots.
llvm-svn: 246160
2015-08-27 16:52:58 +00:00
Tom Stellard
ff8dfbd965
ELF/AMDGPU: Attempt to fix windows bots
...
Broken by r246155.
llvm-svn: 246159
2015-08-27 16:48:46 +00:00
Tom Stellard
15d1fa1bcc
ELF: Add AMDGPU ReaderWriter
...
This is a basic implementation that allows lld to emit binaries
consumable by the HSA runtime.
Differential Revision: http://reviews.llvm.org/D11267
llvm-svn: 246155
2015-08-27 15:55:44 +00:00
Davide Italiano
b3c7fb7f24
[LinkerScript] Fix a crash when matching wildcards.
...
Submitted by: zan jyu via llvm-dev
llvm-svn: 245792
2015-08-22 20:36:19 +00:00
Simon Atanasyan
814b705984
[Mips] Use 'or' for move instead of [d]addu in PLT entries
...
Patch by Simon Dardis.
Differential Revision: http://reviews.llvm.org/D12103
llvm-svn: 245491
2015-08-19 20:20:10 +00:00
Rafael Espindola
f0461ba985
Update for llvm api change.
...
llvm-svn: 244856
2015-08-13 01:07:08 +00:00
Rafael Espindola
bdc8f2fb83
Update for llvm api change.
...
llvm-svn: 244849
2015-08-13 00:31:46 +00:00
David Blaikie
a3191ef66b
Wdeprecated: Remove unnecessary user-defined dtor that was getting in the way of the default ops (copy construction, assignment, etc)
...
llvm-svn: 244836
2015-08-12 23:26:58 +00:00
Denis Protivensky
90512d5440
[ELF] Remove TargetLayout::getCustomSegments methods
...
llvm-svn: 244747
2015-08-12 13:27:27 +00:00
Denis Protivensky
0c8beb1c95
[LinkerScript] Process program header in PHDRS command
...
Add PT_PHDR segment depending on its availability in linker script's
PHDRS command, fallback if no linker script is given.
Handle FILEHDR, PHDRS and FLAGS attributes of program header.
Differential Revision: http://reviews.llvm.org/D11589
llvm-svn: 244743
2015-08-12 12:31:35 +00:00
Rafael Espindola
b61d67cf89
Update for llvm api change.
...
llvm-svn: 244511
2015-08-10 21:30:13 +00:00
Rafael Espindola
d8340dae0c
Don't depend on getDotSymtabSec. It is going away.
...
llvm-svn: 244451
2015-08-10 15:12:17 +00:00
Rui Ueyama
8c484af217
COFF: Remove lld-link2 alias.
...
llvm-svn: 244358
2015-08-07 21:02:36 +00:00
Rafael Espindola
b6aa962e42
Avoid using getDotDynSymSec in lld. It is going away.
...
llvm-svn: 244350
2015-08-07 20:01:24 +00:00
Rafael Espindola
1a9344fa26
Use already available symbol tables. NFC.
...
llvm-svn: 244336
2015-08-07 17:16:28 +00:00
Tom Stellard
01da42d8db
ELF: Correctly identify SHT_NOTE sections with !SHF_ALLOC as type*Note
...
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11266
llvm-svn: 244317
2015-08-07 14:36:04 +00:00
Rui Ueyama
251b0e268b
COFF: Remove the old COFF linker and make link an alias to link2.
...
It's time to remove old COFF linker because the new one is now complete.
llvm-svn: 244226
2015-08-06 16:19:35 +00:00
Rafael Espindola
b835ae8e4a
Port the error functions from ELF to COFF.
...
This has a few advantages
* Less C++ code (about 300 lines less).
* Less machine code (about 14 KB of text on a linux x86_64 build).
* It is more debugger friendly. Just set a breakpoint on the exit function and
you get the complete lld stack trace of when the error was found.
* It is a more robust API. The errors are handled early and we don't get a
std::error_code hot potato being passed around.
* In most cases the error function in a better position to print diagnostics
(it has more context).
llvm-svn: 244215
2015-08-06 14:58:50 +00:00
Simon Atanasyan
7a400d9af4
[Mips] Implement definition of the DT_MIPS_RLD_MAP_REL dynamic tag
...
llvm-svn: 243835
2015-08-01 14:53:49 +00:00
Simon Atanasyan
98a857140b
[Mips] Implement definition of DT_MIPS_RLD_MAP dynamic tag, .rld_map section, and __RLD_MAP symbol
...
llvm-svn: 243626
2015-07-30 07:45:55 +00:00
Simon Atanasyan
9191a84392
[Mips] Define _DYNAMIC_LINKING symbol if output is a is dynamically linked executable file
...
llvm-svn: 243211
2015-07-25 10:18:52 +00:00
Simon Atanasyan
8e24577100
[Mips] Remove redundant separate functions to calculate relocations. Do
...
that inline.
No functional changes.
llvm-svn: 243210
2015-07-25 10:18:44 +00:00
Simon Atanasyan
4504791890
[Mips] Remove duplicated code by joining the same functions
...
llvm-svn: 243209
2015-07-25 10:18:39 +00:00
Simon Atanasyan
3b6ea7ab4a
[Mips] Do not sign-extend addends read from RELA relocation records
...
llvm-svn: 243208
2015-07-25 10:18:33 +00:00
Michael J. Spencer
84487f1174
[ELF2] Add a new ELF linker based on the new PE/COFF linker.
...
Differential Revision: http://reviews.llvm.org/D11188
llvm-svn: 243161
2015-07-24 21:03:07 +00:00
Rui Ueyama
8abca7e729
Fix -Wextra-semi.
...
Patch from Eugene.Zelenko!
llvm-svn: 243060
2015-07-23 23:03:55 +00:00
Rafael Espindola
5871bf30ac
Use the getSymbol with an explicit symbol table. NFC.
...
llvm-svn: 243014
2015-07-23 13:41:25 +00:00
Denis Protivensky
f84acb959b
[LinkerScript] Fix case when setting custom NONE segment
...
llvm-svn: 243006
2015-07-23 11:46:59 +00:00
Denis Protivensky
cdc1246750
[ELF] Apply segments from linker scripts
...
Put sections to segments according to linker scripts if available.
Rework the code of TargetLayout::assignSectionsToSegments so it operates
on the given list of segments, which can be either read from linker scripts
or constructed as before.
Handle NONE segments defined in linker scripts by putting corresponding sections
to PT_NULL segment.
Consider flags set for segments through linker scripts.
Differential Revision: http://reviews.llvm.org/D10918
llvm-svn: 243002
2015-07-23 10:34:30 +00:00
Simon Atanasyan
b6d60a69c0
[ELF] Protect write access to the ELFLinkingContext::_cidentSections by a mutex
...
The _cidentSections container is filled during files parsing so we need to
serialize a concurrent access to it.
llvm-svn: 242885
2015-07-22 10:32:19 +00:00