Commit Graph

289 Commits

Author SHA1 Message Date
Rui Ueyama 24a7f7eed8 [PECOFF] Ignore /maxilkfile option.
.ilk file is a file for incremental linking. We don't create nor use
that file.

/MAXILKFILE is an undocumented option to specify the maximum size
of the .ilk file, IIUC. We should just ignore the option.

llvm-svn: 222777
2014-11-25 19:51:28 +00:00
Rui Ueyama 0d9a181d9d [PECOFF] Create an empty PDB file if debug option is enabled.
There are many build files in the wild that depend on the fact that
link.exe produces a PDB file if /DEBUG option is given. They fail
if the file is not created.

This patch is to make LLD create an empty (dummy) file to satisfy
such build targets. This doesn't do anything other than "touching"
the file.

If a target depends on the content of the PDB file, this workaround
is no help, of course. Otherwise this patch should help build some
stuff.

llvm-svn: 222773
2014-11-25 19:01:01 +00:00
Rui Ueyama 4a259cf4a5 [PECOFF] Enable dead-stripping even if /debug option is given.
/debug makes MSVC link.exe to not remove unused sections from
the resulting executable. We did the same thing before. However,
I realized that the removal of associative section depends on
the dead-stripping pass in LLD, so we cannot disable that. Or
LLD may produce slightly broken executables that have too much
data in it (which could result in nasty subtle bugs).

This patch is a temporary measure to create correct executable.
Currently /debug does not have any real effect for LLD anyway.

I'll improve associative section handling in another patch, so that
they are removed from output without depending on the dead-stripping
pass.

llvm-svn: 222483
2014-11-20 23:59:40 +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
Rui Ueyama a81cb0594b Fix Mach-O unit tests breakage on Windows
Mach-O normalized file reader assumes that the entire file is aligned
to a large boundary. If the in-memory file is not aligned properly, it will
abort with an assertion failure in read32/read64. This patch forces the
in-memory file for the unit test to be aligned at 64-byte boundary.

I found these tests are failing on Windows, but theoretically they could
fail on other platform.

llvm-svn: 221508
2014-11-07 02:54:52 +00:00
Eric Christopher 6d10178ba3 Use LLVMLIBS here since these are produced by the
llvm build and not supposed to be resident on
the system.

llvm-svn: 221314
2014-11-04 23:27:52 +00:00
Rui Ueyama 2f28686ca0 [PECOFF] Fix /nodefaultlib option.
/nodefaultlib argument is a path name, so that needs to be compared
case-insensitive way. Also the ".lib" extension should be ignored.

llvm-svn: 220508
2014-10-23 20:42:07 +00:00
Shankar Easwaran 2b67fca033 Sort include files according to convention.
llvm-svn: 220131
2014-10-18 05:33:55 +00:00
Rui Ueyama ecbb309e5e [PECOFF] Remember DLL names given with /delayload option.
This is a step toward full support of /delayload.

llvm-svn: 219344
2014-10-08 21:38:10 +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
Nick Kledzik a4ff361c6f update library dependency
llvm-svn: 218646
2014-09-29 23:52:50 +00:00
Rui Ueyama 251d9a34e2 [PECOFF] Simplify /machine option handling
/machine:ebc was previously recognized but rejected. Unknown architecture
names were handled differently but eventually rejected too. We don't need
to distinguish them.

llvm-svn: 218344
2014-09-24 00:21:45 +00:00
Rui Ueyama 75c0127bb3 [PECOFF] Change export table type.
This patch changes the type of export table set from std::set to
std::vector. The new code is slightly inefficient, but because
export table elements are actually mutable, std::vector is better
here. No functionality change.

llvm-svn: 218343
2014-09-24 00:09:36 +00:00
Rui Ueyama 7ea46bab26 [PECOFF] Fix duplicate /export options
If two or more /export options are given for the same symbol, we should
always print a warning message and use the first one regardless of other
parameters.
Previously there was a case that the first parameter is not used.

llvm-svn: 218342
2014-09-23 23:49:41 +00:00
Saleem Abdulrasool c2c2937d55 Driver: accept /machine:arm for Windows linker
Accept /machine:arm as an argument.  This is changed to support ARM NT.
Although there is no way to differentiate between ARM (Windows CE) and ARM NT
(Windows on ARM), since LLVM currently only supports Windows on ARM, simply take
/machine:arm to mean Windows on ARM.

llvm-svn: 218105
2014-09-19 06:09:30 +00:00
Nick Kledzik 635f9c7158 [mach-o] Let darwin driver infer arch from .o files if -arch not used.
Mach-O has a "fat" (or "universal") variant where the same contents built for
different architectures are concatenated into one file with a table-of-contents
header at the start.  But this leaves a dilemma for the linker - which
architecture to use.

Normally, the linker command line -arch is used to force which slice of any fat
files are used.  The clang compiler always passes -arch to the linker when
invoking it.  But some Makefiles invoke the linker directly and don’t specify
the -arch option.  For those cases, the linker scans all input files in command
line order and finds the first non-fat object file.  Whatever architecture it
is becomes the architecture for the link.

llvm-svn: 217189
2014-09-04 20:08:30 +00:00
Nick Kledzik 54e0614efd Fix unit test now that 'ld' is host specific
llvm-svn: 217114
2014-09-04 00:16:04 +00:00
Nick Kledzik 77afc71426 [mach-o] Fix initial live atoms with -dead_strip
When -dead_strip is used with -exported_symbols_list the initial set of
live atoms are those in the export list.

llvm-svn: 216213
2014-08-21 20:25:50 +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
Rui Ueyama bff29b78b5 [PECOFF] Fix /profile option.
/profile implies /fixed:no -- so we had to *enable* base
relocations rather than disabling it.

llvm-svn: 215389
2014-08-11 21:31:07 +00:00
Rui Ueyama 55a6e762ee [PECOFF] Add /profile command line option.
llvm-svn: 213984
2014-07-25 22:28:49 +00:00
Rui Ueyama 7c60a98f16 [PECOFF] Add the entry point file at the right place.
The entry point file needs to be processed after all other
object files and before all .lib files. It was processed
after .lib files. That caused an issue that the entry point
function was not resolved from the standard library files.

llvm-svn: 213804
2014-07-23 21:41:20 +00:00
Rui Ueyama a27bb08e73 [PECOFF] Fix entry point functions selection
On Windows there are four "main" functions -- main, wmain, WinMain,
or wWinMain. Their parameter types are diffferent. The standard
library provides four different entry functions (i.e.
{w,}{WinMain,main}CRTStartup) for them. You need to use the right
entry routine for your "main" function.

If you give an /entry option, the specified name is used
unconditionally.

Otherwise, the linker needs to select the right one based on
user-supplied entry point function. This can be done after the
linker reads all the input files.

This patch moves the code to determine the entry point function
from the driver to a virtual input file. It also implements the
correct logic for the entry point function selection.

llvm-svn: 213713
2014-07-23 00:57:57 +00:00
Rui Ueyama 31fd9d09b2 [PECOFF] Invoke cvtres.exe in the driver.
Previously we invoked cvtres.exe for each compiled Windows
resource file. The generated files were then concatenated
and embedded to the executable.

That was not the correct way to merge compiled Windows
resource files. If you just concatenate generated files,
only the first file would be recognized and the rest would
be ignored as trailing garbage.

The right way to merge them is to call cvtres.exe with
multiple input files. In this patch we do that in the
Windows driver.

llvm-svn: 212763
2014-07-10 20:53:37 +00:00
Rafael Espindola c2199ecf1e Update for llvm api change.
llvm-svn: 212407
2014-07-06 17:43:22 +00:00
Iain Sandoe 9734a53cf0 Fix build of DriverTests for config & make.
This adjusts the USED library list following recent changes in the object
file heirarchy.

llvm-svn: 212400
2014-07-06 11:28:56 +00:00
Tim Northover d30a1f2cb2 MachO: rename _outputFileType to avoid shadowing parent field.
llvm-svn: 211367
2014-06-20 15:59:00 +00:00
Rafael Espindola 6400ed4e75 Refer to error_code with an std prefix.
llvm-svn: 210820
2014-06-12 20:42:12 +00:00
Rafael Espindola 54427ccef3 include system_error directly.
llvm-svn: 210801
2014-06-12 17:15:58 +00:00
Rafael Espindola 1675d51eac Run llvm/utils/sort_includes.py in a few files.
This will reduce the noise in a followup patch.

llvm-svn: 210800
2014-06-12 17:12:28 +00:00
Rafael Espindola 7264b0bf29 Uses #include "..." instead of #include <...> for llvm headers.
llvm-svn: 210799
2014-06-12 17:08:11 +00:00
Rafael Espindola 4956850fdc replace llvm::error_code with std::error_code.
llvm-svn: 210781
2014-06-12 14:04:54 +00:00
Rafael Espindola 28db74b2f0 Fix test build on windows.
llvm-svn: 210714
2014-06-11 22:23:45 +00:00
Rui Ueyama e05d380486 Move Simple.h and Alias.h to include/Core.
Because the files in Core actually depend on these files.

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

llvm-svn: 210710
2014-06-11 21:47:51 +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 551aacd6bc Add observers to Input Graph
Make it possible to add observers to an Input Graph, so that files
returned from an Input Graph can be examined before they are
passed to Resolver.

To implement some PE/COFF features we need to know all the symbols
that *can* be solved, including ones in archive files that are not
yet to be read.

Currently, Resolver only maintains a set of symbols that are
already read. It has no knowledge on symbols in skipped files in
an archive file.

There are many ways to implement that. I chose to apply the
observer pattern here because it seems most non-intrusive. We don't
want to mess up Resolver with architecture specific features.
Even in PE/COFF, the feature that needs this mechanism is minor.
So I chose not to modify Resolver, but add a hook to Input Graph.

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

llvm-svn: 208753
2014-05-14 05:31:54 +00:00
Rui Ueyama 1127fe4704 [PECOFF] DLL extension can be omitted in .def file.
llvm-svn: 208428
2014-05-09 16:35:26 +00:00
Rui Ueyama 3608609339 Expand nested input elements.
Previously only the toplevel elements were expanded by expandElements().
Now we recursively call getReplacements() to expand input elements even
if they are in, say, in a group.

llvm-svn: 208144
2014-05-06 23:52:19 +00:00
Rui Ueyama 2fa41d1817 Add a test for notifyProgress().
llvm-svn: 208123
2014-05-06 19:26:21 +00:00
Rui Ueyama aa30ccffa8 Remove unused variable.
llvm-svn: 208121
2014-05-06 19:11:39 +00:00
Rui Ueyama b51711b356 Fix copypaste error.
llvm-svn: 208120
2014-05-06 19:05:14 +00:00
Rui Ueyama b12dcb6095 s/My/Test/ as these classes are for tests.
llvm-svn: 208119
2014-05-06 19:01:56 +00:00
Rui Ueyama fd5c70d0ec Make the test even more readable.
llvm-svn: 208118
2014-05-06 18:58:24 +00:00
Rui Ueyama 48a1727e6f Simplify unit test code.
llvm-svn: 208116
2014-05-06 18:41:12 +00:00
Rui Ueyama d976941704 Remove meaningless return value in test.
llvm-svn: 208112
2014-05-06 18:27:37 +00:00
Rui Ueyama 27169ce309 Replace copypasta with function calls to make tests intelligible.
llvm-svn: 208111
2014-05-06 18:24:27 +00:00
Rui Ueyama 1fe682cf37 Don't return value rather than always returning true.
addInputElement() never fails, and no one checks its return value
except tests. Let's simplify the signature.

llvm-svn: 208109
2014-05-06 17:33:14 +00:00
Rui Ueyama b340f0117c Remove a method that no one is using.
llvm-svn: 208101
2014-05-06 16:22:04 +00:00
Rui Ueyama 8620d933f4 Remove operator[] that was used only in tests.
llvm-svn: 208020
2014-05-06 00:50:46 +00:00
Rui Ueyama f33946d51d [PECOFF] Allow multiple directives in one module-definition file.
I'm a bit surprised that I have not implemented this yet. This is
definitely needed to handle real-world module definition files.
This patch contains a unit test for r207294.

llvm-svn: 207297
2014-04-26 00:25:02 +00:00
Rui Ueyama 409ac186bb [PECOFF] Add /IMPLIB command line option.
This option is to override the default import file path.

llvm-svn: 207175
2014-04-25 03:35:13 +00:00
Rui Ueyama 0e32610fb5 [PECOFF] Better handling of /OPT option.
Previously LLD would fail if /OPT:icf, /OPT:lbr or such are specified,
because these command line flags would be handled as unknown ones. We
rather want LLD to ignore these known but yet-to-be-implemented options
for now.

Added tests for the driver as well.

llvm-svn: 206863
2014-04-22 03:57:07 +00:00
Rui Ueyama 311a162f26 [PECOFF] Win64 DLL entry function name is _DllMainCRTStartup.
Unlike Win32/x86, it has no "@12" suffix.

llvm-svn: 206648
2014-04-18 21:05:59 +00:00
Rui Ueyama 28da676709 [PECOFF] Ignore /ignore option.
/ignore:<number> is a linker option to disable warning specified by
the number. We ignore the option because it does not make sense for
LLD.

llvm-svn: 206636
2014-04-18 19:49:24 +00:00
Rui Ueyama 38cf6ddc30 [PECOFF] Support /manifestuac:NO.
If the value for /manifestuac is "NO", LLD will create a manifest XM
file but won't emit <trustinfo> element.

llvm-svn: 206633
2014-04-18 19:43:07 +00:00
Rui Ueyama 327db80dd5 [ELF] Support --defsym=<symbol>=<symbol>.
Currently LLD supports --defsym only in the form of
--defsym=<symbol>=<integer>, where the integer is interpreted as the
absolute address of the symbol. This patch extends it to allow other
symbol name to be given as an RHS value. If a RHS value is a symbol
name, the LHS symbol will be defined as an alias for the RHS symbol.

Internally, a LHS symbol is represented as a zero-size defined atom
who has an LayoutAfter reference to an undefined atom, whose name is
the RHS value. Everything else is already implemented -- Resolver
will resolve the undefined symbol, and the layout pass will layout
the two atoms at the same location. Looks like it's working fine.

Note that GNU LD supports --defsym=<symbol>=<symbol>+<addend>. That
feature is out of scope of this patch.

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

llvm-svn: 206417
2014-04-16 20:58:57 +00:00
Rui Ueyama feab78785b [ELF] Unit tests for -o and --noinhibit-exec.
llvm-svn: 205735
2014-04-07 20:52:48 +00:00
Rui Ueyama 595026e071 [ELF] Accept "-rpath=<foo>" as well as "-rpath <foo>".
llvm-svn: 205694
2014-04-06 21:23:24 +00:00
Rui Ueyama c141c8c59a [ELF] Fix driver bug.
GNU LD-comptaible driver wrongly requires a space after '=' for a few
options such as "-init=<symbol>" or "-entry=<symbol>". This patch is
to fix that bug and add a few tests for it.

llvm-svn: 205693
2014-04-06 21:15:05 +00:00
Rui Ueyama 7088e3470c [ELF] Add a test for -rpath.
llvm-svn: 205663
2014-04-05 02:15:23 +00:00
Rui Ueyama ac0f7ca3a8 [ELF] Fix --soname option.
Currently LLD accepts only "-soname <string>", but all the following
options are actually valid.

  --soname=foo
  --soname foo
  -soname=foo
  -soname foo
  -h foo

This patch fixes that issue.

llvm-svn: 205662
2014-04-05 02:07:04 +00:00
Rui Ueyama e36fbea175 [ELF] Diagnose malformed --dynsym option.
llvm-svn: 205654
2014-04-04 22:36:30 +00:00
Rui Ueyama 8bd093b1e5 Rename getInputGraph() and getNextFile().
Seems getSomething() is more common naming scheme than just a noun
to get something, so renaming these members.

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

llvm-svn: 205589
2014-04-04 00:14:04 +00:00
Rui Ueyama fb44f5e278 Fix comments.
llvm-svn: 205568
2014-04-03 21:06:23 +00:00
Rui Ueyama b0e3b66fa5 Remove ordinals from Input Graph elements.
An ordinal is set to each child of Input Graph, but no one actually
uses it. The only piece of code that gets ordinaly values is
sortInputElements in InputGraph.cpp, but it does not actually do
anything -- we assign ordinals in increasing order just before
calling sort, so when sort is called it's already sorted. It's no-op.
We can simply remove it. No functionality change.

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

llvm-svn: 205501
2014-04-03 02:21:44 +00:00
Rui Ueyama 88c8599de9 Remove unused fields/member functions from unit test.
llvm-svn: 205469
2014-04-02 21:49:27 +00:00
Rui Ueyama d33a3d8892 Remove unused include.
llvm-svn: 205466
2014-04-02 21:39:44 +00:00
Rui Ueyama edd5c0a9ea Simplify communication between Resolver and Input Graph.
Resolver is sending too much information to Input Graph than Input
Graph actually needs. In order to collect the detailed information,
which wouldn't be consumed by anyone, we have a good amount of code
in Resolver, Input Graph and Input Elements. This patch is to
simplify it. No functionality change.

Specifically, this patch replaces ResolverState enum with a boolean
value. The enum defines many bits to notify the progress about
linking to Input Graph using bit masks, however, what Input Graph
actually does is to compare a given value with 0. The details of
the bit mask is simply being ignored, so the efforts to collect
such data is wasted.

This patch also changes the name of the notification interface from
setResolverState to notifyProgress, to make it sounds more like
message passing style. It's not a setter but something to notify of
an update, so the new name should be more appropriate than before.

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

llvm-svn: 205463
2014-04-02 21:02:44 +00:00
Rui Ueyama b461b1c785 s/llvm::dyn_cast/dyn_cast/
llvm-svn: 205404
2014-04-02 06:54:46 +00:00
Rui Ueyama 2243015825 Merge ELFGroup with Group.
Group class is designed for GNU LD's --start-group and --end-group. There's
no obvious need to have two classes for it -- one as an abstract base class
and the other as a concrete class.

llvm-svn: 205375
2014-04-01 23:55:20 +00:00
Rui Ueyama 804b1b9965 Remove duplicate code in unit tests carried in from main code.
llvm-svn: 205371
2014-04-01 23:10:14 +00:00
Rui Ueyama 04afaeff52 Simplify InputGraphTest.
llvm-svn: 205369
2014-04-01 22:42:38 +00:00
Rui Ueyama 5632e26d36 Greatly simplify InputGraph.
InputGraph has too many knobs and controls that are not being used. This
patch is to remove dead code, unused features and a class. There are two
things that worth noting, besides simple dead code removal:

1. ControlNode class is removed. We had it as the base class of Group
class, but it provides no functionality particularly meaningful. We now
have shallower class hierarchy that is easier to understand.

2. InputGraph provides a feature to replace a node with its internal data.
It is being used to "expand" some type of node, such as a Linker Script
node, with its actual files. We used to have two options when replacing
it -- ExpandOnly or ExpandAndReplace. ExpandOnly was to expand it but not
remove the node from the tree. There is no use of that option in the code,
so it was a dead feature.

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

llvm-svn: 205363
2014-04-01 21:55:36 +00:00
Rui Ueyama 46fd56d0df s/dyn_cast/cast/ where return value should never be null.
cast<X> asserts the type is correct and does not return null on failure.
So we should use cast<X> rather than dyn_cast<X> at such places where we
don't expect type conversion could fail.

llvm-svn: 205332
2014-04-01 18:04:56 +00:00
Rui Ueyama 3907f2a802 [ELF] Support --defsym option to define an absolute symbol.
This patch is to support --defsym option for ELF file format/GNU-compatible
driver. Currently it takes a symbol name followed by '=' and a number. If such
option is given, the driver sets up an absolute symbol with the specified
address. You can specify multiple --defsym options to define multiple symbols.

GNU LD's --defsym provides many more features. For example, it allows users to
specify another symbol name instead of a number to define a symbol alias, or it
even allows a symbol plus an offset (e.g. --defsym=foo+3) to define symbol-
relative alias. This patch does not support that, but will be supported in
subsequent patches.

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

llvm-svn: 205029
2014-03-28 19:02:06 +00:00
Rui Ueyama 9024c36f5a Make anonymous namespace as small as possible.
llvm-svn: 204982
2014-03-27 23:34:32 +00:00
Simon Atanasyan e7e8b26f93 Remove extra semicolon for -Wpedantic.
llvm-svn: 204224
2014-03-19 11:06:07 +00:00
Rui Ueyama aca3c7c6f4 [PECOFF] Fix link order.
LLD fails to link symbol "_main" if the symbol is in a library file and
the library file is given as a bare argument (i.e. not with /defaultlib
option). It's because library files given as bare arguments are processed
before other libraries given with /defaultlib, so when Linker finds msvcrtd
needs a definition for "_main", the file providing the main function has
already been processed and skipped. Linker don't revisit libraries if it's
not given with /defaultlib.

To fix it this patch change the way of command line handling; files end with
".lib" are treated as if they are given with /defaultlib. I don't believe
it's 100% correct behavior but it's better than before.

llvm-svn: 203892
2014-03-14 05:59:16 +00:00
Ahmed Charles 13c70b6d4b Replace OwningPtr with std::unique_ptr.
This results in some simplifications to the code where an OwningPtr had to
be used with the previous api and then ownership moved to a unique_ptr for
the rest of lld.

llvm-svn: 203809
2014-03-13 16:20:38 +00:00
Ahmed Charles d6432c8aed [Cleanup] Sort includes.
llvm-svn: 203666
2014-03-12 15:55:13 +00:00
Rui Ueyama 16e543bc02 Add "override" and remove "virtual" where appropriate.
For the record, I used clang-modernize to add "override" and perl to remove
"virtual".

llvm-svn: 203164
2014-03-06 21:14:04 +00:00
Rui Ueyama d9e7c22ee4 [PECOFF] Driver support for /SAFESEH option.
Syntactically /SAFESEH is a boolean flag -- you can pass /SAFESEH or /SAFESEH:no.

The meaning of /SAFESEH is as follows.

 - If /SAFESEH is specified, the linker will produce an executable with SEH table.
   If any input files are not compatible with SEH, it's an error.
 - If /SAFESEH:no is specified, the linker will not emit SEH table even if all
   input files are compatible with SEH.
 - If no option is specified, the linker emits SEH table if all input files are
   compatible with SEH.

llvm-svn: 201895
2014-02-21 22:30:43 +00:00
Joey Gouly cf466800b7 [MachO] Add undefined atoms.
llvm-svn: 200649
2014-02-02 19:34:55 +00:00
Rui Ueyama 49bfd5032d [PECOFF] Accept /machine:x64 option.
This is the first patch to support PE32+ format, which is the image format
to use 64 bit address space on Windows/x86-64.

llvm-svn: 200029
2014-01-24 19:17:05 +00:00
Joey Gouly 010b37691d [MachO] Begin support for reading fat binaries.
llvm-svn: 199259
2014-01-14 22:32:38 +00:00
Rui Ueyama ab9deb5466 [PECOFF] Support STACKSIZE module-definition file directive.
llvm-svn: 199170
2014-01-14 00:48:25 +00:00
Rui Ueyama ca9e99fe50 Add a function to verify an ExportDesc.
llvm-svn: 199167
2014-01-14 00:29:26 +00:00
Rui Ueyama 37f5273773 Do not use "auto" where actual type is obvious and short.
llvm-svn: 199166
2014-01-14 00:06:50 +00:00
Rui Ueyama 1c1487494d Reduce even more boilerplate.
llvm-svn: 199165
2014-01-13 23:54:49 +00:00
Rui Ueyama 7c13c4459b Whitespace.
llvm-svn: 199164
2014-01-13 23:21:33 +00:00
Rui Ueyama 1090434d39 Reduce the boilerplate in the test cases for the module-definition file.
llvm-svn: 199163
2014-01-13 23:13:21 +00:00
Rui Ueyama cbc6eb3e99 Use bettter names for the tests.
llvm-svn: 199161
2014-01-13 23:02:03 +00:00
Rui Ueyama 69c26e903b [PECOFF] Add another test for the module-definition file parser.
llvm-svn: 199159
2014-01-13 22:55:09 +00:00
Joey Gouly d2215375a8 [MachO] Add basic support for local symbols.
llvm-svn: 199155
2014-01-13 22:28:02 +00:00
Rui Ueyama 415625028c [PECOFF] Support VERSION directive.
llvm-svn: 199022
2014-01-11 22:45:00 +00:00
Rui Ueyama b214e1aba2 [PECOFF] Support NAME directive.
llvm-svn: 199020
2014-01-11 21:53:46 +00:00
Rui Ueyama 6a5f7c22ad [PECOFF] Support HEAPSIZE directive.
llvm-svn: 198994
2014-01-11 01:58:21 +00:00
Rui Ueyama f98a18acb7 [PECOFF] Refactor module-defintion file parser.
Refactor the parser so that the parser can return arbitrary type of parse
result other than a vector of ExportDesc. Parsers for non-EXPORTS directives
will be implemented in different patches. No functionality change.

llvm-svn: 198993
2014-01-11 01:33:42 +00:00
Nick Kledzik 6edd722a2c [mach-o] enable mach-o and native yaml to be intermixed
The main goal of this patch is to allow "mach-o encoded as yaml" and "native
encoded as yaml" documents to be intermixed.  They are distinguished via 
yaml tags at the start of the document.  This will enable all mach-o test cases
to be written using yaml instead of checking in object files.

The Registry was extend to allow yaml tag handlers to be registered.  The
mach-o Reader adds a yaml tag handler for the tag "!mach-o". 

Additionally, this patch fixes some buffer ownership issues.  When parsing
mach-o binaries, the mach-o atoms can have pointers back into the memory 
mapped .o file.  But with yaml encoded mach-o, name and content are ephemeral, 
so a copyRefs parameter was added to cause the mach-o atoms to make their
own copy.  

llvm-svn: 198986
2014-01-11 01:07:43 +00:00