Commit Graph

1493 Commits

Author SHA1 Message Date
Alexey Samsonov 67dc3e9538 Fix lld build
llvm-svn: 204122
2014-03-18 07:24:10 +00:00
Rui Ueyama a7236598bb [PECOFF] Data type of SectionNumber is now unsigned (r203986).
So we don't need static_cast's to convert it from signed to unsigned.

llvm-svn: 203992
2014-03-15 00:39:12 +00:00
Rui Ueyama 39aa6af23f Remove redundant "virtual" keyword.
llvm-svn: 203903
2014-03-14 07:10:43 +00:00
Rui Ueyama 74af50134b [PECOFF] Handle large objects having more than 32768 sections.
The COFF spec says that the SectionNumber field in the symbol table is 16 bit
signed type, but MSVC treats the field as if it is unsigned.

llvm-svn: 203901
2014-03-14 07:04:01 +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
Rui Ueyama ebffa9b4be [PECOFF] Fix arguments passed to lib.exe.
llvm-svn: 203891
2014-03-14 05:04:08 +00:00
Rui Ueyama 516273ba99 [PECOFF] Make WinLinkDriver::parse() and allocate*() functions thread-safe.
Looks like a major cause of instability on Windows is this thread-safety bug.

llvm-svn: 203889
2014-03-14 04:28:38 +00:00
Rui Ueyama f88731f293 [PECOFF] Implement /lib option.
This option is not documented and seems weird, but yeah we need it anyway.

llvm-svn: 203884
2014-03-14 03:06:55 +00:00
Rui Ueyama f020bf7468 [PECOFF] Add one more test for r203875.
This is to make sure that the Windows-style command line tokenizer is
working as expected.

llvm-svn: 203877
2014-03-14 00:44:17 +00:00
Rui Ueyama 7d96f0cc38 Use short identifier, s/diagnostics/diag/.
llvm-svn: 203876
2014-03-14 00:38:34 +00:00
Rui Ueyama b3f679e1ab [PECOFF] Support response files.
If the driver finds a command line option in the form of "@filename", the
option will be replaced with the content of the given file. It's an error
if a response file cannot be read.

llvm-svn: 203875
2014-03-14 00:36:30 +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
Rui Ueyama 6ab29444b0 [docs][Windows] Document how to build using Ninja.
llvm-svn: 203756
2014-03-13 05:48:46 +00:00
Rui Ueyama 60b1a6d9e4 Fix Windows build.
llvm-svn: 203753
2014-03-13 05:22:23 +00:00
Rui Ueyama c83b4eb3a1 [PECOFF] Handle objects with unknown machine type header value.
An object whose machine type header value is unknown looks a bit odd but
is valid. If an object contains only machine-type-independent data, you
can leave the type field unspecified. Some files in oldname.lib are such
object files.

llvm-svn: 203752
2014-03-13 05:12:36 +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 ac1b1d7bfc [docs] Add some more information on missing relocations.
llvm-svn: 203744
2014-03-13 01:11:03 +00:00
Rui Ueyama 21f97ddb58 [docs] Document how to build LLD as a win64 app.
llvm-svn: 203736
2014-03-12 23:40:18 +00:00
Rui Ueyama b325b81138 [ELF] Fix MSVC warning on conversion from enum to bool.
This function returns a boolean value, so returning STT_COMMON does not
make sense.

llvm-svn: 203731
2014-03-12 23:04:27 +00:00
Ahmed Charles d6432c8aed [Cleanup] Sort includes.
llvm-svn: 203666
2014-03-12 15:55:13 +00:00
Rui Ueyama dcd25e31a7 [docs] Add a note on how to build LLD on Windows.
llvm-svn: 203613
2014-03-11 22:40:43 +00:00
Michael J. Spencer e1de2a39df [docs] Add list of missing GNU ld command line options.
llvm-svn: 203491
2014-03-10 21:25:43 +00:00
Simon Atanasyan fe3e0a2abf [Mips] Fix addendum reading for R_MIPS_26 relocation.
llvm-svn: 203412
2014-03-09 13:20:01 +00:00
Simon Atanasyan c146325b26 [Mips] Fix addendum reading for R_MIPS_32 relocation.
llvm-svn: 203411
2014-03-09 13:19:54 +00:00
Simon Atanasyan 0f96aca940 [Mips] Fix addendum reading for R_MIPS_HI16 / R_MIPS_LO16 relocations.
llvm-svn: 203410
2014-03-09 13:19:46 +00:00
Simon Atanasyan cfffe940a8 [Mips] Create ELF object reader for MIPS target.
llvm-svn: 203409
2014-03-09 13:19:36 +00:00
Simon Atanasyan 3af8664858 [ELF] Factor out the code creates a Reference for the specified symbol
and relocation entry into the two virtual functions.

llvm-svn: 203408
2014-03-09 13:19:29 +00:00
Simon Atanasyan 305c864756 [Mips] Rename R_MIPS_26 relocation handling test case.
llvm-svn: 203407
2014-03-09 13:05:39 +00:00
Simon Atanasyan 6928b38c99 [Mips] Remove redundant 'mips' prefix from names of MipsELFWriter class
fields.

llvm-svn: 203406
2014-03-09 13:05:33 +00:00
Simon Atanasyan 8d8e340c61 [Mips] Reduce the code indentation.
llvm-svn: 203405
2014-03-09 13:05:26 +00:00
Simon Atanasyan 82381f97b9 [Mips] Change unused return type from 'bool' to 'void'.
llvm-svn: 203404
2014-03-09 13:05:20 +00:00
Simon Atanasyan 0784422520 [Mips] Remove unnecessary LLVM_ATTRIBUTE_UNUSED attribute.
llvm-svn: 203403
2014-03-09 13:05:15 +00:00
Simon Atanasyan 6af34b9661 [Mips] Do not inherit MipsDynamicLibraryWriter and MipsExecutableWriter
from MipsELFWriter class. MipsELFWriter is just a helper.

llvm-svn: 203402
2014-03-09 13:05:09 +00:00
Simon Atanasyan 16c425e985 [Mips] Mark class by 'final' keyword.
llvm-svn: 203401
2014-03-09 13:05:03 +00:00
Simon Atanasyan 8801c45110 [Mips] Remove redundant 'mips' prefix from names of MipsTargetHandler
and MipsDynamicSymbolTable classes fields.

llvm-svn: 203400
2014-03-09 13:04:56 +00:00
Simon Atanasyan 4881a93b73 [Mips] Remove redundant call to the unique_ptr::get() method followed
by the returned pointer dereferencing.

llvm-svn: 203399
2014-03-09 13:04:50 +00:00
Simon Atanasyan f08deab395 [Mips] Remove unused class field.
llvm-svn: 203398
2014-03-09 13:04:45 +00:00
Rui Ueyama 0b87794f2b Remove extra space.
llvm-svn: 203331
2014-03-08 01:45:39 +00:00
Rui Ueyama 2348be8b6d Add one more test for r203308.
llvm-svn: 203328
2014-03-08 01:27:22 +00:00
Rui Ueyama 7caea31189 Fix a bug that mergeCases table does not match the merge constants.
MergeCases table should not have an entry for MergeContents because atoms with
MergeContents attribute should never have name. This issue was not caught by a
test because getting a value of 6th element of an array of array actually gets
the first element's value of the next array, and that happened to be a valid
value. Added asserts to catch that error.

llvm-svn: 203322
2014-03-08 00:44:01 +00:00
Michael J. Spencer 95a90099fa [docs] Add missing features for the x86-64 ELF backend.
llvm-svn: 203313
2014-03-07 23:54:27 +00:00
Rui Ueyama c79dd2f80a [PECOFF] Support a new type of weak symbol.
Summary:
COMDAT_SELECT_SAME_SIZE is a COMDAT type that I presume exist only in COFF.
The semantics of the type is that linker should merge such COMDAT sections if
their sizes are the same. Otherwise it's an error.

Reviewers: Bigcheese, shankarke, kledzik

CC: llvm-commits

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

llvm-svn: 203308
2014-03-07 23:05:10 +00:00
Benjamin Kramer 68f8699031 Add missing std:: qualifiers.
llvm-svn: 203244
2014-03-07 14:50:15 +00:00
Simon Atanasyan e9ba661696 [Mips] Removed extra space. Thanks to dexonsmith's eagle eye.
llvm-svn: 203201
2014-03-07 04:50:53 +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
Michael J. Spencer 1dd276672f [docs] Update current status.
llvm-svn: 203188
2014-03-07 01:42:19 +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
Simon Atanasyan 54f6f7bd77 [Mips] Replace "virtual" by "override" in member function declarations
where it is appropriate.

llvm-svn: 203102
2014-03-06 10:29:45 +00:00
Rui Ueyama 3e37326166 Add a document about Windows support.
llvm-svn: 203017
2014-03-05 22:35:32 +00:00
Rui Ueyama b63570ecb6 Fix broken link.
llvm-svn: 203004
2014-03-05 20:39:57 +00:00