| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
UniversalDriver was used as a dispatcher to each platform-specific driver.
It had its own Options.td file. It was not just too much to parse only a
few options (we only want to parse -core, -flavor or argv[0]),
but also interpreted arguments too early. For example, if you invoke lld as
"lld -flavor gnu ... -help", then you'd get the UniversalDriver's help
message instead of GnuDriver's. This patch eliminates the use of Options
from the dispatcher.
http://reviews.llvm.org/D17686
llvm-svn: 262190
|
|
|
|
| |
llvm-svn: 262159
|
|
|
|
|
|
| |
I think it is clear by now that the new linker is viable.
llvm-svn: 262158
|
|
|
|
|
|
| |
http://reviews.llvm.org/D16668
llvm-svn: 259597
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In many situations, we don't want to exit at the first error even in the
process model. For example, it is better to report all undefined symbols
rather than reporting the first one that the linker picked up randomly.
In order to handle such errors, we don't need to wrap everything with
ErrorOr (thanks for David Blaikie for pointing this out!) Instead, we
can set a flag to record the fact that we found an error and keep it
going until it reaches a reasonable checkpoint.
This idea should be applicable to other places. For example, we can
ignore broken relocations and check for errors after visiting all relocs.
In this patch, I rename error to fatal, and introduce another version of
error which doesn't call exit. That function instead sets HasError to true.
Once HasError becomes true, it stays true, so that we know that there
was an error if it is true.
I think introducing a non-noreturn error reporting function is by itself
a good idea, and it looks to me that this also provides a gradual path
towards lld-as-a-library (or at least embed-lld-to-your-program) without
sacrificing code readability with lots of ErrorOr's.
http://reviews.llvm.org/D16641
llvm-svn: 259069
|
|
|
|
| |
llvm-svn: 253437
|
|
|
|
|
|
| |
With this the only way to get the old elf linker is "-flavor old-elf".
llvm-svn: 253318
|
|
|
|
|
|
| |
This is the second step in making ELF2 the default.
llvm-svn: 253270
|
|
|
|
|
|
| |
This is the first step in making ELF2 the default.
llvm-svn: 253188
|
|
|
|
|
|
| |
ArrayRef. NFC
llvm-svn: 250904
|
|
|
|
|
|
|
|
| |
The reason for the name is so that we can run
./build/bin/clang -fuse-ld=lld2 test.o -o t
llvm-svn: 249122
|
|
|
|
| |
llvm-svn: 244358
|
|
|
|
|
|
| |
It's time to remove old COFF linker because the new one is now complete.
llvm-svn: 244226
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D11188
llvm-svn: 243161
|
|
|
|
| |
llvm-svn: 242118
|
|
|
|
|
|
|
|
| |
This is a direct port of the new PE/COFF linker to ELF.
It can take a single object file and generate a valid executable that executes at the first byte in the text section.
llvm-svn: 242088
|
|
|
|
|
|
| |
by pointer) from ParseArgs
llvm-svn: 240347
|
|
|
|
|
|
| |
whitespace around *)
llvm-svn: 240346
|
|
|
|
| |
llvm-svn: 240236
|
|
|
|
| |
llvm-svn: 240235
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is an initial patch for a section-based COFF linker.
The patch has 2300 lines of code including comments and blank lines.
Before diving into details, you want to start from reading README
because it should give you an overview of the design.
All important things are written in the README file, so I write
summary here.
- The linker is already able to self-link on Windows.
- It's significantly faster than the existing implementation.
The existing one takes 5 seconds to link LLD on my machine,
while the new one only takes 1.2 seconds, even though the new
one is not multi-threaded yet. (And a proof-of-concept multi-
threaded version was able to link it in 0.5 seconds.)
- It uses much less memory (250MB vs. 2GB virtual memory space
to self-host).
- IMHO the new code is much simpler and easier to read than
the existing PE/COFF port.
http://reviews.llvm.org/D10036
llvm-svn: 238458
|
|
|
|
| |
llvm-svn: 220131
|
|
|
|
| |
llvm-svn: 219326
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Add support in the universal driver to print the lld version and the
repository version.
Test Plan: A driver test is added
Reviewers: kledzik, ruiu
Reviewed By: ruiu
Subscribers: llvm-commits
Projects: #lld
Differential Revision: http://reviews.llvm.org/D5641
llvm-svn: 219277
|
|
|
|
|
|
|
|
|
| |
Also allows -core/flavor to appear at any position in the command line.
Patch from Oleg Ranevskyy!
http://reviews.llvm.org/D5384
llvm-svn: 218321
|
|
|
|
|
|
|
| |
The dangling "else" at the end of #if looked a bit error-prone.
Make it a separate function. No functionality change.
llvm-svn: 217568
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The existing system linkers on Darwin and Linux are called "ld". We'd like to
eventually drop in lld as "ld" and have it just work. But lld is a universal
linker that requires the first option to be -flavor to know which command line
mode to emulate (gnu or darwin).
This change tests if argv[0] is "ld" and if so, if the tool was built on MacOSX
then assume the darwin flavor otherwise the gnu flavor. There are two test
cases which copy lld to "ld" and then run it. One for darwin and one for linux.
llvm-svn: 217566
|
|
|
|
| |
llvm-svn: 217112
|
|
|
|
| |
llvm-svn: 206113
|
|
|
|
| |
llvm-svn: 204982
|
|
|
|
|
|
|
| |
Creating the file "link.exe" made some confusion, so it's better to
name it lld-link.exe, as we did for CL (clang-cl.exe).
llvm-svn: 204509
|
|
|
|
|
|
|
|
| |
Easier to add new options such as -version, and easy to parse.
Now displays a help message with -help
llvm-svn: 193301
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch inverts the return value of these functions, so that they return
"true" on success and "false" on failure. The meaning of boolean return value
was mixed in LLD; for example, InputGraph::validate() returns true on success.
With this patch they'll become consistent.
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1748
llvm-svn: 191341
|
|
|
|
|
|
|
|
| |
stderr."
This reverts commit 185657. It will be used by unit tests.
llvm-svn: 186366
|
|
|
|
| |
llvm-svn: 185657
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add WinLinkDriver and connect it to the existing COFF reader. Remaining
parts are still stubs, so while it can now read a COFF file, it still
cannot link or output PE/COFF files yet.
Reviewers: Bigcheese
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D865
llvm-svn: 182784
|
|
|
|
| |
llvm-svn: 181655
|
|
|
|
| |
llvm-svn: 181547
|
|
|
|
|
|
| |
Suggested by Nick Kledzik in reference to r179590.
llvm-svn: 179617
|
|
|
|
|
|
| |
end of non-void function" warning.
llvm-svn: 179590
|
|
|
|
| |
llvm-svn: 178798
|
|
The major changes are:
1) LinkerOptions has been merged into TargetInfo
2) LinkerInvocation has been merged into Driver
3) Drivers no longer convert arguments into an intermediate (core) argument
list, but instead create a TargetInfo object and call setter methods on
it. This is only how in-process linking would work. That is, you can
programmatically set up a TargetInfo object which controls the linking.
4) Lots of tweaks to test suite to work with driver changes
5) Add the DarwinDriver
6) I heavily doxygen commented TargetInfo.h
Things to do after this patch is committed:
a) Consider renaming TargetInfo, given its new roll.
b) Consider pulling the list of input files out of TargetInfo. This will
enable in-process clients to create one TargetInfo the re-use it with
different input file lists.
c) Work out a way for Drivers to format the warnings and error done in
core linking.
llvm-svn: 178776
|