Commit Graph

227 Commits

Author SHA1 Message Date
Chandler Carruth b5f3bd956c Replace the 'final' keyword with 'LLVM_FINAL' as GCC 4.6 doesn't support
the keyword.

If anyone cares deeply about the final optimizations with GCC, we might
want to add a version test to the LLVM definition, but I'm perfectly
happy with this just only firing under Clang and modern MSVC builds.

llvm-svn: 172898
2013-01-19 09:57:51 +00:00
Chandler Carruth 8b95c03fca Allow the LLD CMake build to work with -std=gnu++0x and -std=gnu++11 as
well as c++0x and c++11. This can be especially useful when building
with GCC in C++11 mode.

llvm-svn: 172897
2013-01-19 09:41:42 +00:00
Chandler Carruth 058761266d Fix the build with libstdc++ v4.6 on Linux by supplying an explicit move
assignment operator. There is an issue where classes with deleted copy
constructors and user defined move constructors end up with an
implicitly deleted copy constructor that is selected instead of the
implicit move constructor. This is a bit of a hack, but it allows me to
build LLD in a bootstrap with libstdc++ which is my primary goal.

llvm-svn: 172896
2013-01-19 09:38:14 +00:00
Michael J. Spencer a17b72e7cf [Core] Fix passing an rvalue reference of ErrorOr.
llvm-svn: 172850
2013-01-18 21:42:01 +00:00
Michael J. Spencer 71c00f42bd [ELF] Use operator new(std::size_t, BumpPtrAllocator).
llvm-svn: 172675
2013-01-16 23:34:45 +00:00
Michael J. Spencer 84d3b01fb5 [ELF] clang-format ReaderELF.cpp
llvm-svn: 172674
2013-01-16 23:34:32 +00:00
Michael J. Spencer fe71a50494 Trailing whitespace.
llvm-svn: 172554
2013-01-15 21:13:14 +00:00
Michael J. Spencer 8b3898af26 [ELF] Never allocate content to weak symbols as they may be merged away.
This is done by creating a new non-weak anonymous symbol and creating
an atom with content for that symbol. This is added after the weak symbol
so that they have the same address.

llvm-svn: 172553
2013-01-15 21:13:02 +00:00
Michael J. Spencer 842885e06e [ELF] Refactoring and style cleanup. No functionality change.
llvm-svn: 172552
2013-01-15 21:12:45 +00:00
Michael J. Spencer b03f6c489a [ELF] Update for LLVM Object/ELF changes.
llvm-svn: 172516
2013-01-15 07:53:22 +00:00
Michael J. Spencer bb78a04088 [ELF] Replace [...] x_{begin,end}() with range<[...]> x().
llvm-svn: 172513
2013-01-15 06:55:37 +00:00
Michael J. Spencer aa3aa570dc [Core] Add iterator ranges.
This is based on code by Jeffrey Yasskin. It has been modified to compile
with MSVC and reformated to LLVM style.

llvm-svn: 172512
2013-01-15 06:55:25 +00:00
Michael J. Spencer 7fe77f8c61 [ELF] Fix use of LLVM RTTI.
llvm-svn: 172511
2013-01-15 06:55:11 +00:00
Shankar Easwaran f6dc082f91 remove const from FindByName
llvm-svn: 172507
2013-01-15 03:02:33 +00:00
Michael J. Spencer ed1950719b [docs] Add driver documentation.
This gives an overview of the driver and explains how to add options and driver flavors.

llvm-svn: 172502
2013-01-15 02:00:59 +00:00
Michael J. Spencer 31dffbb659 [docs] Update status.
llvm-svn: 172501
2013-01-15 02:00:48 +00:00
Nick Kledzik 233f537799 Add new merge-by-content Merge attribute for use by anonymous
constants and string literals which the linker should coalesce.

llvm-svn: 172495
2013-01-15 00:17:57 +00:00
Nick Kledzik 343ecbd6ba Fix shadowed variable warning
llvm-svn: 172482
2013-01-14 22:10:22 +00:00
Michael J. Spencer ca20ffbab2 [test] Fix tests on Windows.
llvm-svn: 172339
2013-01-13 01:09:51 +00:00
Michael J. Spencer 74ba722be1 [YAML] Fix undefined behavior.
llvm-svn: 172338
2013-01-13 01:09:39 +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 3756852d62 [ELF] Fix comment.
llvm-svn: 172266
2013-01-11 22:39:56 +00:00
Michael J. Spencer 4ffbd608cd [ELF] Add AtomLayout instead of using pair<Atom, pair<uint64_t, uint64_t>>.
llvm-svn: 172265
2013-01-11 22:39:44 +00:00
Michael J. Spencer 2a5763cd86 [ELF] Use the correct cast.
llvm-svn: 172264
2013-01-11 22:39:31 +00:00
Michael J. Spencer bbe4b9812b [ELF] Simplify assert.
llvm-svn: 172255
2013-01-11 21:38:36 +00:00
Shankar Easwaran b1d09c07f1 better implementation for findOutputSection
llvm-svn: 172236
2013-01-11 18:56:11 +00:00
Shankar Easwaran 7381db059a add noinhibit exec option
llvm-svn: 172204
2013-01-11 15:11:47 +00:00
Shankar Easwaran d127d8169a add hexagon target to lld
llvm-svn: 172202
2013-01-11 15:01:04 +00:00
Michael J. Spencer ecd5f4062f [ELF] Add support for __init_array_{start,end}.
With this change c++ global constructors and destructors work.

llvm-svn: 172133
2013-01-10 22:41:42 +00:00
Michael J. Spencer 36b9b8f945 [ELF] Fix leading 0 count. Matches change in llvm.
llvm-svn: 172132
2013-01-10 22:41:19 +00:00
Michael J. Spencer aa8a5a2ab2 [ELF] Fixed -Wunused in -asserts mode.
llvm-svn: 172131
2013-01-10 22:41:05 +00:00
Shankar Easwaran 37c528259a style changes
llvm-svn: 172080
2013-01-10 18:16:10 +00:00
Shankar Easwaran 2ca8e7d733 support for adding linker defined symbols
llvm-svn: 172040
2013-01-10 03:16:27 +00:00
Michael J. Spencer ad5f00ea2d [Archive] Use a hash map to lookup symbols in archives. Increases performance of linking lua by ~6x.
llvm-svn: 172028
2013-01-10 01:27:45 +00:00
Michael J. Spencer 41d9dc56d3 Style fixes.
llvm-svn: 171997
2013-01-09 20:39:07 +00:00
Michael J. Spencer cf2306fe2b Fix the elf/rodata.objtext test to work when first run.
llvm-svn: 171992
2013-01-09 20:10:30 +00:00
Nick Kledzik cc3d2dca60 Better tie together ContentType and Permissions.
Since most content types (e.g. typeCode) have a 
preferred Permission, add a function to do that mapping.
Then hook up to YAML Reader and Writer such that
the 'permissions:' key does not need to be specified unless
overriding what the content type prefers.

llvm-svn: 171929
2013-01-09 01:17:12 +00:00
Nick Kledzik bd49198409 add extra namespace for gcc-4.7 compatibility
llvm-svn: 171918
2013-01-08 23:51:03 +00:00
Nick Kledzik 80fe907903 fix typo
llvm-svn: 171916
2013-01-08 23:43:11 +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 79fafccb5e [Driver] Fix indentation.
llvm-svn: 171909
2013-01-08 22:59:01 +00:00
Nick Kledzik 8a3052eab0 Rename YAML key 'fixups:' to 'references:'
llvm-svn: 171898
2013-01-08 21:12:13 +00:00
Nick Kledzik 809b9955e8 Fix to work with style of new YAML writer
llvm-svn: 171897
2013-01-08 21:05:47 +00:00
Michael J. Spencer d2a4ccf8f9 [ELF] Add R_X86_64_64 relocation.
llvm-svn: 171836
2013-01-08 02:12:15 +00:00
Michael J. Spencer 8f80cd92d9 [lld] Add and ignore some flags for ld compat.
llvm-svn: 171835
2013-01-08 02:12:01 +00:00
Michael J. Spencer 8de8364753 [ELF] Properly handle constant data.
With this hello world works with dietlibc on x86-64 Linux.

llvm-svn: 171711
2013-01-07 08:00:42 +00:00
Michael J. Spencer 956b03618c [lld] Add -emit-yaml option. This outputs yaml instead of a binary.
llvm-svn: 171710
2013-01-07 08:00:25 +00:00
Michael J. Spencer 1ac382f0c5 [ELF] Emit the file header and program headers at the beginning of the first segment.
This is required for the loader to correctly set AT_PHDR.

With this lld can correctly link against dietlibc and get to main.

llvm-svn: 171709
2013-01-07 08:00:04 +00:00
Michael J. Spencer 00b702c95c [ELF] Change Segment to hold Chunks instead of Sections. No functionality change.
llvm-svn: 171708
2013-01-07 07:59:46 +00:00
Michael J. Spencer c8a12cce98 [ELF] Remove dead variable.
llvm-svn: 171707
2013-01-07 07:59:34 +00:00