| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 204293
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 203891
|
|
|
|
|
|
| |
Looks like a major cause of instability on Windows is this thread-safety bug.
llvm-svn: 203889
|
|
|
|
|
|
| |
This option is not documented and seems weird, but yeah we need it anyway.
llvm-svn: 203884
|
|
|
|
| |
llvm-svn: 203876
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 203666
|
|
|
|
| |
llvm-svn: 203491
|
|
|
|
|
|
| |
Allows removing #include's in LLVM while switching to std::unique_ptr.
llvm-svn: 202679
|
|
|
|
| |
llvm-svn: 202645
|
|
|
|
| |
llvm-svn: 202054
|
|
|
|
| |
llvm-svn: 202039
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 200599
|
|
|
|
|
|
|
|
| |
The target machine type affects the meaning of other options, in particular
how to mangle symbols. So we want to handle the option first and then parse
all the other options.
llvm-svn: 200589
|
|
|
|
| |
llvm-svn: 200182
|
|
|
|
|
|
| |
No change in functionality.
llvm-svn: 200175
|
|
|
|
| |
llvm-svn: 199170
|
|
|
|
| |
llvm-svn: 199022
|
|
|
|
| |
llvm-svn: 199021
|
|
|
|
| |
llvm-svn: 199020
|
|
|
|
| |
llvm-svn: 199019
|
|
|
|
|
|
| |
directive.
llvm-svn: 199018
|
|
|
|
| |
llvm-svn: 198994
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Module-definition (.def) files are the file containing linker directives,
such as export symbols. Because link.exe supports the same features as command
line options, just as some Linker Script commands overlaps with command line
options, use of module-definition file is not really necessary. It provides
an alternative way to specify some linker options.
This patch implements EXPORTS directive. Other directives will be implemented
in the future.
llvm-svn: 198925
|
|
|
|
| |
llvm-svn: 198797
|
|
|
|
| |
llvm-svn: 198634
|
|
|
|
|
|
| |
Differential Revision: http://llvm-reviews.chandlerc.com/D2501
llvm-svn: 198535
|
|
|
|
| |
llvm-svn: 198396
|
|
|
|
|
|
|
| |
Add basic emulation mapping for NetBSD/amd64, so that clang -m32 works
as expected.
llvm-svn: 198337
|
|
|
|
|
|
|
|
|
| |
I'm not 100% sure but it looks like DLL entry symbol (DLL initializer function
name) should be _DllMainCRTStartup@12. The reason why I'm not very sure is
because I have no idea what "@12" suffix is, but without it the symbol won't
be resolved...
llvm-svn: 198072
|
|
|
|
| |
llvm-svn: 198066
|
|
|
|
|
|
|
|
| |
Command line argument separator on Windows is colon. We used to accept space
as a separator, but we removed most of the code for that. This patch is to
delete the remaining code.
llvm-svn: 198032
|
|
|
|
| |
llvm-svn: 197990
|
|
|
|
|
|
|
| |
/EXPORT option has slightly different semantics if it appears in the .drectve
section. This patch implements it.
llvm-svn: 197970
|
|
|
|
|
|
|
|
|
| |
It will configure resonable defaults for other settings in the
MachOLinkingContext object based on the parameters.
Patch by Joe Ranieri
llvm-svn: 197851
|
|
|
|
| |
llvm-svn: 197834
|
|
|
|
| |
llvm-svn: 197788
|
|
|
|
|
|
| |
This removes a lot of duplicated code.
llvm-svn: 197751
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main changes are in:
include/lld/Core/Reference.h
include/lld/ReaderWriter/Reader.h
Everything else is details to support the main change.
1) Registration based Readers
Previously, lld had a tangled interdependency with all the Readers. It would
have been impossible to make a streamlined linker (say for a JIT) which
just supported one file format and one architecture (no yaml, no archives, etc).
The old model also required a LinkingContext to read an object file, which
would have made .o inspection tools awkward.
The new model is that there is a global Registry object. You programmatically
register the Readers you want with the registry object. Whenever you need to
read/parse a file, you ask the registry to do it, and the registry tries each
registered reader.
For ease of use with the existing lld code base, there is one Registry
object inside the LinkingContext object.
2) Changing kind value to be a tuple
Beside Readers, the registry also keeps track of the mapping for Reference
Kind values to and from strings. Along with that, this patch also fixes
an ambiguity with the previous Reference::Kind values. The problem was that
we wanted to reuse existing relocation type values as Reference::Kind values.
But then how can the YAML write know how to convert a value to a string? The
fix is to change the 32-bit Reference::Kind into a tuple with an 8-bit namespace
(e.g. ELF, COFFF, etc), an 8-bit architecture (e.g. x86_64, PowerPC, etc), and
a 16-bit value. This tuple system allows conversion to and from strings with
no ambiguities.
llvm-svn: 197727
|
|
|
|
| |
llvm-svn: 197365
|
|
|
|
|
|
|
| |
/EXPORT command line option can take an ordinal, NONAME flag, and DATA flag.
This patch is to parse these optional arguments.
llvm-svn: 197217
|
|
|
|
| |
llvm-svn: 197123
|
|
|
|
|
|
|
|
|
|
| |
/DLLEXPORT is a command line option to export a symbol. __declspec(dllexport)
uses that to make the linker to export DLLExport'ed functions, by adding the
option to .drectve section.
This patch implements the parser of the command line option.
llvm-svn: 197122
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
/ALTERNATENAME is a rarely-used, undocumented command line option that is
needed to link LLD for release build. It seems that the option is for defining
an weak alias; /alternatename:foo=bar defines weak symbol "foo" for "bar".
If "foo" is defined in an input file, it'll be linked normally and the command
line option will have no effect. If it's not defined, "foo" will be handled
as an alias for "bar".
This patch implements the parser for the option. The actual weak alias handling
will be implemented in a separate patch.
llvm-svn: 196743
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently we do not de-duplicate library files specified by /defaultlib option.
As a result, the same files are added multiple times to the input graph. In
particular, some popular files, such as kernel32.lib or oldnames.lib, are added
more than 10 times during linking of LLD. That makes the linker slower, as it
needs to parse the same file again and again.
This patch solves the issue by de-duplicating. The same file will be added only
once to the input graph. This patch improved the LLD linking time from 10.5
seconds to 7.7 seconds on my 4-core Core i7 Macbook Pro.
llvm-svn: 196504
|
|
|
|
|
|
|
|
|
| |
If /functionpadmin is specified, the linker is supposed to make room at the
beginning of each function, so that self-modifying program would easily
hotpatch existing functions. Since I'm not sure if this feature is really used,
I'll make LLD to ignore the option for now.
llvm-svn: 196363
|