Commit Graph

76 Commits

Author SHA1 Message Date
Rui Ueyama 2c64aef35f Remove YAML/Native round-trip passes.
The round-trip passes were introduced in r193300. The intention of
the change was to make sure that LLD is capable of reading end
writing such file formats.

But that turned out to be yet another over-designed stuff that had
been slowing down everyday development.

The passes ran after the core linker and before the writer. If you
had an additional piece of information that needs to be passed from
front-end to the writer, you had to invent a way to save the data to
YAML/Native. These passes forced us to do that even if that data
was not needed to be represented neither in an object file nor in
an executable/DSO. It doesn't make sense. We don't need these passes.

http://reviews.llvm.org/D7480

llvm-svn: 230069
2015-02-20 22:10:28 +00:00
Greg Fitzgerald df0f5cd474 Remove PPC ELF target
Differential Revision: http://reviews.llvm.org/D7225

llvm-svn: 227320
2015-01-28 16:37:43 +00:00
Greg Fitzgerald 0dc86722f5 Fix shared library build
* Removed cyclic dependency between lldPECOFF and lldDriver
* Added missing dependencies in unit tests

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

llvm-svn: 227134
2015-01-26 20:46:47 +00:00
Greg Fitzgerald 77337ef798 Add ARM backend to the autotools build
From: Greg Fitzgerald <garious@gmail.com>
llvm-svn: 226782
2015-01-22 05:12:46 +00:00
Greg Fitzgerald 57c29ad223 add_lld_library -> add_llvm_library
* Works better for shared libraries (sets PRIVATE instead of INTERFACE)
* Fixes http://llvm.org/bugs/show_bug.cgi?id=22269
* Also, use build-target names instead of component names

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

From: Greg Fitzgerald <garious@gmail.com>
llvm-svn: 226702
2015-01-21 21:26:27 +00:00
Shankar Easwaran 48b9fc7981 Revert "Add support library."
This reverts commit r221583.

llvm-svn: 221649
2014-11-11 00:40:36 +00:00
Shankar Easwaran c937b4923e Add support library.
The parsing routines in the linker script to parse strings encoded in various
formats(hexadecimal, octal, decimal, etc), is needed by the GNU driver too. This
library provides helper functions for all flavors and flavors to add helper
functions which other flavors may make use of.

llvm-svn: 221583
2014-11-10 14:54:34 +00:00
Shankar Easwaran 2b67fca033 Sort include files according to convention.
llvm-svn: 220131
2014-10-18 05:33:55 +00:00
Shankar Easwaran 7862619076 Make lld-link symlink relative.
llvm-svn: 220130
2014-10-18 05:26:35 +00:00
Shankar Easwaran c3550f9231 Add support to print version.
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
2014-10-08 03:47:51 +00:00
Chad Rosier 69e2881070 [AArch64] Initial ELF/AArch64 Support
This patch adds the initial ELF/AArch64 support to lld. Only a basic "Hello
World" app has been successfully tested for both dynamic and static compiling.

Differential Revision: http://reviews.llvm.org/D4778
Patch by Daniel Stewart <stewartd@codeaurora.org>!

llvm-svn: 215544
2014-08-13 13:16:38 +00:00
Iain Sandoe c4d9bedcfc Initial set of Makefiles
This provides support for the autoconfing & make build style.
The format, style and implementation follows that used within the llvm and clang projects.

TODO: implement out-of-source documentation builds.
llvm-svn: 210177
2014-06-04 09:54:07 +00:00
Rui Ueyama 83ba74fa3f [PECOFF] Rename link.exe -> lld-link.exe.
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
2014-03-21 20:41:48 +00:00
Rui Ueyama 60b1a6d9e4 Fix Windows build.
llvm-svn: 203753
2014-03-13 05:22:23 +00:00
Rui Ueyama f7ada499f1 [Driver] Create "link[.exe]" symlink for the Windows driver.
Clang creates "clang-cl" as a symlink to (or a copy of) "clang" for the MSVC-
compatible driver. This patch is to do the same thing for "link" and "lld".

Differential Revision: http://llvm-reviews.chandlerc.com/D3066

llvm-svn: 203751
2014-03-13 05:12:31 +00:00
Michael J. Spencer dae078f341 [docs] Option parsing driver work is pretty much done.
llvm-svn: 203189
2014-03-07 01:42:35 +00:00
Rui Ueyama 8db1eddc07 Make Driver::link and LinkingContext::validate return true on success.
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
2013-09-24 23:26:34 +00:00
Shankar Easwaran c8858b3469 [lld]remove lld-core
llvm-svn: 181244
2013-05-06 20:24:39 +00:00
Nick Kledzik c314b46e71 This is my Driver refactoring patch.
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
2013-04-04 18:59:24 +00:00
Shankar Easwaran 8962feb915 [lld] remove trailing whitespace
llvm-svn: 177079
2013-03-14 16:09:49 +00:00
Michael J. Spencer be03e2a861 [Core,Driver,ELF] Differentiate static and dynamic executables.
This also adds a simple relocation change for dynamic executables to
x86-64 ELF.

llvm-svn: 175208
2013-02-14 20:32:00 +00:00
Shankar Easwaran 96d594b14e add merge strings option, this temporarily fixes the problem bringing up helloworld with glibc on x86_64
llvm-svn: 175038
2013-02-13 06:12:52 +00:00
Shankar Easwaran 34ab70f1e6 add changes for layoutafter/layoutbefore/ingroup/layoutpass and test cases
llvm-svn: 174658
2013-02-07 20:16:12 +00:00
Michael J. Spencer cfe59fd0d3 [Driver] Replace Target with TargetInfo. Simplify LinkerInput.
This removes Target and moves the functionality it had over to TargetInfo.

This also simplifies LinkerInput by removing the InputKind. This will be handled elsewhere.

llvm-svn: 174589
2013-02-07 06:46:48 +00:00
Michael J. Spencer 990ec2b223 [ELF] Use entry point from LinkerOptions.
Patch by Ahmed Bougacha!

llvm-svn: 173655
2013-01-28 04:15:44 +00:00
Shankar Easwaran 3256d4ff62 add elf targethandler
llvm-svn: 173430
2013-01-25 07:39:18 +00:00
Nick Kledzik 36293f6512 Add SectionPosition and OrderPass
llvm-svn: 173300
2013-01-23 22:32:56 +00:00
Michael J. Spencer c0d3c4efe6 Add PassManager.
It owns and manages passes.

llvm-svn: 173287
2013-01-23 20:03:10 +00:00
Michael J. Spencer 64afcb4c6b Move everything over to TargetInfo.
I really would have liked to split this patch up, but it would greatly
complicate the lld-core and lld drivers having to deal with both
{Reader,Writer}Option and TargetInfo.

llvm-svn: 173217
2013-01-23 01:18:43 +00:00
Michael J. Spencer 4586fbcbad [Core] Move Resolver and SymbolTable over to TargetInfo.
No functionality change.

llvm-svn: 173192
2013-01-22 20:49:42 +00:00
Michael J. Spencer 57752dc56e Factor File::addAtom out to MutableFile::addAtom.
This removes a bunch of llvm_unreachables and makes a File's mutability part of the type system.

llvm-svn: 172297
2013-01-12 02:45:54 +00:00
Michael J. Spencer 6047163a24 [lld] Add support for -mllvm.
There is no way to test this at the moment because the options are not
processed until the link starts, and we can't pass an empty file.

llvm-svn: 171910
2013-01-08 22:59:27 +00:00
Michael J. Spencer 18225e7be1 [Driver] Add -flavor core support. This will be tested by other tests using -flavor core.
llvm-svn: 171577
2013-01-05 00:46:45 +00:00
Michael J. Spencer 552074f18e Style fixes.
llvm-svn: 171531
2013-01-04 21:18:34 +00:00
Andy Gibbs d02bf1d232 Fix build issue when building lld against libstdc++ 4.7
llvm-svn: 170983
2012-12-22 09:46:10 +00:00
Michael J. Spencer 3825760550 [Driver] Add -### support for printing out the core command line.
llvm-svn: 169717
2012-12-09 23:56:26 +00:00
Michael J. Spencer 9ff4be240a Add the core architecture for the lld driver.
This includes selecting which driver to emulate, option parsing, invocation
building, and running the link. This currently only supports a very basic
subset of ld for x86_64-linux.

lld -flavor ld obj.o -o obj

or symlink lld as (ld , link, ld64, core) to get the desired behavior without
-flavor.

llvm-svn: 169659
2012-12-08 00:47:36 +00:00
Shankar Easwaran 70b4dcfbcd Adding support to resolve symbols with archive libraries in lld
llvm-svn: 167854
2012-11-13 18:39:10 +00:00
Sid Manning 42064e5b60 * Add relocation reference support for Hexagon and PowerPC.
- Hexagon has many relocation types, this patch covers just
      a subset, more will be added.
    - PowerPC support was added so that we can verify mixed endian
      environments.
  * Add some basic test cases
  * Update ldd-core to accept -endian flag

llvm-svn: 165477
2012-10-09 02:20:47 +00:00
Sid Manning e861d43f65 This change:
* Updates ReaderELF.cpp contentType method to match ELF.h's logic and now handle
    typeData
  * Add -arch to ldd-core testdriver
  * Add testcase to check typeData
  * Update others to stay in sync with this change.

llvm-svn: 164976
2012-10-01 23:23:05 +00:00
Hemant Kulkarni 927bbc2871 ELF support for LLD writer. The writer at present emits ELF header and section
table header. Skeleton code for ReferenceKinds.
Credits:
Doxygen by  Michael Spencer.
Origianl implementation from Macho by Sidney Manning.
Templatization, implementation of section header chunks, string table, ELF header by Hemant Kulkarni.

llvm-svn: 163906
2012-09-14 16:11:34 +00:00
Michael J. Spencer 69ed53ab5f Fix warnings.
llvm-svn: 163573
2012-09-10 23:46:58 +00:00
Nick Kledzik 7243b89459 PR13467: Fix mach-o writer to handle case of zero stubs. Renumber TestingHelpers kind values
llvm-svn: 160982
2012-07-30 20:10:46 +00:00
Sid Manning 556d84fe03 Add a new option, -reader which will select formats other than YAML for
reading.  YAML is still the default.

llvm-svn: 160736
2012-07-25 17:13:13 +00:00
Nick Kledzik 686eec102c Add missing LLVMSupport
llvm-svn: 159702
2012-07-04 02:16:35 +00:00
Michael J. Spencer e1db0daf25 Fix CMake build to use target_link_libraries. Patch by Sidney Manning!
llvm-svn: 159165
2012-06-25 21:42:38 +00:00
Michael J. Spencer 26f5a62712 Fix link order. Patch by Sidney Manning.
llvm-svn: 158945
2012-06-21 22:42:00 +00:00
Nick Kledzik abb6981f68 Major refactoring: Remove Platform concept. In its place there are
now Reader and Writer subclasses for each file format.  Each Reader and
Writer subclass defines an "options" class which controls how that Reader
or Writer operates.

llvm-svn: 157774
2012-05-31 22:34:00 +00:00
Michael J. Spencer 60d835fa59 Add COFF reader.
There are no tests for this yet because I still need to finish the
YAML -> COFF converter so we don't get binary files checked in.

llvm-svn: 156100
2012-05-03 20:52:22 +00:00
Michael J. Spencer 729e234828 Add some docs on the type of flags link.exe has that our driver will need to support.
llvm-svn: 155861
2012-04-30 23:45:49 +00:00