Commit Graph

176 Commits

Author SHA1 Message Date
Michael J. Spencer 866e0f8a8c [ELF][X86-64] Use the correct base address.
llvm-svn: 173527
2013-01-25 23:23:24 +00:00
Michael J. Spencer 385f312686 [CMake] Setup include dirs properly.
llvm-svn: 173488
2013-01-25 20:50:01 +00:00
Shankar Easwaran 4277c2d6bf change all occurences of File to FileELF
llvm-svn: 173449
2013-01-25 15:19:02 +00:00
Shankar Easwaran 3256d4ff62 add elf targethandler
llvm-svn: 173430
2013-01-25 07:39:18 +00:00
Michael J. Spencer 88f4d24e4a [Driver] Run the pass manager.
llvm-svn: 173381
2013-01-24 22:52:42 +00:00
Michael J. Spencer 19c4756ff2 Move SimpleAtoms.h to ReaderWriter.
llvm-svn: 173380
2013-01-24 22:52:25 +00:00
Nick Kledzik 36293f6512 Add SectionPosition and OrderPass
llvm-svn: 173300
2013-01-23 22:32:56 +00:00
Michael J. Spencer 563d33a6f1 [ELF] Read IFUNC symbols correctly as typeResolver.
llvm-svn: 173299
2013-01-23 22:08:46 +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 d68d6196af Add {,ELF,MachO}TargetInfo.
llvm-svn: 173117
2013-01-22 02:15:30 +00:00
Shankar Easwaran 6d9921fc53 no functionality changes(split WriterELF into multiple files)
llvm-svn: 173082
2013-01-21 20:09:55 +00:00
Michael J. Spencer 8af48f3864 [Core] Use LLVM's ErrorOr<T>.
llvm-svn: 172993
2013-01-20 21:27:05 +00:00
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
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 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 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
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 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 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
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
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