Commit Graph

65 Commits

Author SHA1 Message Date
Michael J. Spencer 67f25272f1 [SymbolTable][Perf] Use hash_combine instead of a custom hash, also use memcmp.
ArrayRef<uint8_t>::equals(); lowers to a byte compare loop :(.

TODO: Figure out if we are getting hash collisions, or just have a lot of equal
content. Also test if crypto hashing the content instead of full compare is
better.

llvm-svn: 177588
2013-03-20 22:18:22 +00:00
Shankar Easwaran 8962feb915 [lld] remove trailing whitespace
llvm-svn: 177079
2013-03-14 16:09:49 +00:00
Michael J. Spencer a55e37f477 Add basic linker script parsing.
llvm-svn: 176309
2013-03-01 00:03:36 +00:00
Shankar Easwaran db74ffbe72 [ELF][Hexagon]add typeZeroFillFast
llvm-svn: 175983
2013-02-24 03:09:10 +00:00
Shankar Easwaran 873c9ffba0 add changes for typeDataFast
llvm-svn: 175901
2013-02-22 17:18:53 +00:00
Michael J. Spencer be1100e192 [Resolver] Improve undefined symbol error.
llvm-svn: 174277
2013-02-03 10:50:06 +00:00
Michael J. Spencer 280dadbbaf [Core] Only complain about undefined symbols if they are marked as canBeNullNever.
llvm-svn: 174107
2013-01-31 22:56:13 +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 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
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 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 80fe907903 fix typo
llvm-svn: 171916
2013-01-08 23:43:11 +00:00
Nick Kledzik 6b079f5e2f Removes files for separate ReaderYAML.cpp and WriterYAML.cpp
and adds a new file ReaderWriterYAML.cpp that uses YAML I/O.

Lots of tweaks to test suite for slightly different YAML encoding.

llvm-svn: 171592
2013-01-05 02:22:35 +00:00
Michael J. Spencer 552074f18e Style fixes.
llvm-svn: 171531
2013-01-04 21:18:34 +00:00
Michael J. Spencer 7f693c50db Slightly better diagnostics on duplicate symbols.
llvm-svn: 171528
2013-01-04 21:17:51 +00:00
Benjamin Kramer f7798e34c9 Add library dependencies to the lld cmake build.
llvm-svn: 169306
2012-12-04 21:09:04 +00:00
Hemant Kulkarni f828613945 Add absolute symbol scope recognition in lld/Core
llvm-svn: 167394
2012-11-05 19:13:54 +00:00
Nick Kledzik 751eb3d2b3 use llvm_unreachable() instead of assert(0) for invalid enum values in switch statements
llvm-svn: 158542
2012-06-15 20:37:24 +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
Filipe Cabecinhas 6f970e8458 Remove some compilation warnings.
llvm-svn: 157253
2012-05-22 14:45:44 +00:00
Nick Kledzik a3c24f447f remove completed items
llvm-svn: 156143
2012-05-04 01:14:02 +00:00
Nick Kledzik 3011259a85 Rework how YAMLReader is layered on top of YAMLParser. Turn hand written
recursive descent functions into one table driven parser.  Add proper
error recovery and reporting.  Add lots of test cases with semantics errors
and verify error messages.

llvm-svn: 156136
2012-05-03 23:55:34 +00:00
Michael J. Spencer d0d5ec4a38 Convert the YAMLReader to use LLVM/Support/YAMLParser.
llvm-svn: 155847
2012-04-30 21:20:13 +00:00
Michael J. Spencer 63d320064d Remove whitespace.
llvm-svn: 155846
2012-04-30 21:19:44 +00:00
Nick Kledzik 20e652d627 Add way to represent static archives in yaml test cases.
Add SharedLibraryFile and ArchiveLibraryFile subclasses of File.

Add command line options to lld-core to set various ResolverOptions settings
and added lots of test cases to verify the options work.

llvm-svn: 155183
2012-04-20 01:24:37 +00:00
Nick Kledzik bb963dfb7e Factor out core linking options from Platform in a new ResolverOptions
class.  Change Resolver to no longer use Platform.  Core linking
now issues errors directly.  We need to factor that out later.

Rework how Darwin executable writer finds "main" atom.  It now
adds to core linking an Atom  which has a Reference to "main".  

llvm-svn: 155060
2012-04-18 21:55:06 +00:00
Nick Kledzik 467209b1d4 Remove definedAtomsBegin() and co. so that C++11 range based for loops can be used
llvm-svn: 154302
2012-04-09 00:58:21 +00:00
Nick Kledzik 062a98cff0 Rename referencesBegin() to begin() so that C++11 range based for loops can be used
llvm-svn: 154301
2012-04-08 23:52:13 +00:00
Michael J. Spencer d73a53f158 [docs] Add more open projects.
llvm-svn: 154277
2012-04-08 03:47:49 +00:00
Michael J. Spencer f9bc125c5a [docs] Add open projects page that includes the TODO.txt files.
llvm-svn: 154274
2012-04-07 23:10:01 +00:00
Nick Kledzik 5a1528f49d Add to-do lists
llvm-svn: 154246
2012-04-07 01:54:17 +00:00
Nick Kledzik b334be1ed2 First implementation of Darwin Platform. It is rich enough to generate
a hello world executable from atoms.  There is still much to be flushed out.
Added one test case, test/darwin/hello-world.objtxt, which exercises the
darwin platform.

Added -platform option to lld-core tool to dynamically select platform.

llvm-svn: 154242
2012-04-07 01:31:00 +00:00
Michael J. Spencer 765792d5d1 Remove trailing whitespace.
llvm-svn: 153964
2012-04-03 18:40:27 +00:00
Michael J. Spencer e6203a57b5 Steal LLVM.h from Clang. This brings in very commonly used LLVM ADT/Support
types into the lld namespace.

llvm-svn: 153963
2012-04-03 18:39:40 +00:00
Michael J. Spencer b495562b5d Use the LLVM RTTI library.
llvm-svn: 153912
2012-04-02 23:56:36 +00:00
Michael J. Spencer c9d2506a76 Replace all uses of NULL with nullptr.
llvm-svn: 153677
2012-03-29 19:39:14 +00:00
Michael J. Spencer d58cf03cff llvm::OwningPtr -> std::unique_ptr.
llvm-svn: 153620
2012-03-29 00:49:50 +00:00
Michael J. Spencer cfd029fd91 Rearange header order to match llvm style. This exposed some missing types.
Also fix some Platform.h includes that somehow got missed last time.

llvm-svn: 153590
2012-03-28 19:04:02 +00:00
Nick Kledzik f4e2c73fa7 Add Pass to instantiate GOT entries
llvm-svn: 152874
2012-03-15 23:36:24 +00:00
Michael J. Spencer 166b090a46 Audit uses of StringRef::getAsInteger.
llvm-svn: 152565
2012-03-12 18:13:36 +00:00
Michael J. Spencer e753cbc685 Fix MSVC incompatibilities.
llvm-svn: 152389
2012-03-09 05:27:43 +00:00
Michael J. Spencer b5ef4df359 StringRef is not null terminated.
llvm-svn: 152388
2012-03-09 05:27:20 +00:00
Michael J. Spencer 9f91f958b1 Use llvm/Support/DataTypes instead of stdint.h
llvm-svn: 152387
2012-03-09 05:27:11 +00:00
Michael J. Spencer 4ff3c79998 Use nullptr instead of NULL, and remove use of VLA.
llvm-svn: 152386
2012-03-09 05:26:55 +00:00
Nick Kledzik 1a6615dc88 Sources now require C++11 to build.
Add first linker pass (StubsPass) which looks for calls to shared library
symbols and replaces them with calls to a StubAtom.  On ELF system, a "stub"
is a PLT entry.  Added a simple test case.

Pass a Platform object to YAML reader and writer for converting fixup kinds 
between names and values.

Change output of Resolver to be a File object instead of a vector of Atoms.
Thus, passes operate on a File instead of just Atoms.

Rework how to walk through a File's Atoms. Now iterator based instead of 
a method that visits each atom.  

llvm-svn: 152269
2012-03-08 00:18:30 +00:00
Nick Kledzik 6bc04c6904 Add support for SharedLibraryAtoms (proxy atoms for exported symbols from a
shared library) and AbsoluteAtoms (proxy atoms for absolute address (e.g. ROM)).
Redesign weak importing as can-be-null-at-runtime and can-be-null-at-build-time.
Add lots of test cases for all the above.

llvm-svn: 151204
2012-02-22 21:56:59 +00:00
Nick Kledzik af18a2b29f use llvm::DenseMap instead of std::map
llvm-svn: 150547
2012-02-15 00:50:07 +00:00
Nick Kledzik 49d6cc8457 (no commit message)
llvm-svn: 150539
2012-02-15 00:38:09 +00:00