| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 203666
|
|
|
|
|
|
| |
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: 199022
|
|
|
|
| |
llvm-svn: 199021
|
|
|
|
| |
llvm-svn: 199020
|
|
|
|
| |
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: 198634
|
|
|
|
| |
llvm-svn: 198396
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
/EXPORT option has slightly different semantics if it appears in the .drectve
section. This patch implements it.
llvm-svn: 197970
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 196196
|
|
|
|
| |
llvm-svn: 196092
|
|
|
|
|
|
|
| |
/DEBUG option is to make the linker to emit debug information to the resulting
executable. It's not for enable debugging of the linker itself.
llvm-svn: 196040
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
/MERGE option is a bit complicated for many reasons. Firstly, it takes both
positive and negative arguments. That means we have to have one of three
distinctive values (set, clear or unchange) for each permission bit. In this
patch we represent the three values using two bitmasks.
Secondly, the permissions specified by the parameter is bitwise or-ed with the
default permissions of a section. There is an exception for that rule; if one
of READ, WRITE or EXECUTE bit is specified, unspecified bits need to be
cleared. (So if you specify only WRITE for example, the resulting section will
not have WRITE nor EXECUTE bits.)
Lastly, multiple /merge options are allowed.
llvm-svn: 195882
|
|
|
|
|
|
|
| |
The current mapping for /section one character options is really bogus.
Map to the correct flags.
llvm-svn: 195774
|
|
|
|
|
|
|
| |
This is the first step towards DLL creation support. Resource-only DLLs
don't have entry point address.
llvm-svn: 195510
|
|
|
|
|
|
|
|
|
| |
It's allowed to specify library files *before* object files in the command
line. Object files seems to be processed first, and then their undefined
symbols are resolved from the libraries. This patch implements the compatible
behavior.
llvm-svn: 195295
|
|
|
|
| |
llvm-svn: 195289
|
|
|
|
| |
llvm-svn: 195284
|
|
|
|
| |
llvm-svn: 195281
|
|
|
|
|
|
| |
Also slightly reduces PECOFFLinkingContext's memory footprint (~128B).
llvm-svn: 194787
|
|
|
|
| |
llvm-svn: 194757
|
|
|
|
| |
llvm-svn: 194556
|
|
|
|
|
|
| |
This reverts commit r194551 because it broke the buildbot.
llvm-svn: 194552
|
|
|
|
| |
llvm-svn: 194551
|
|
|
|
| |
llvm-svn: 194545
|
|
|
|
|
|
|
|
| |
These fields are for /align option. Section alignment can be set per-section
basis with /section option too. In order to avoid name conflicts, rename the
existing identifiers to become more specific. No functionality change.
llvm-svn: 194160
|
|
|
|
|
|
|
|
|
|
|
| |
/section command line option is to set/reset attributes of the Characteristics
field in the section header. You can set non-default values with this option.
You can make .data section executable with this, for example.
This patch implements the parser of the command line option. The code to use
the parsed values will be committed in a separate patch.
llvm-svn: 194133
|
|
|
|
| |
llvm-svn: 194130
|
|
|
|
|
|
|
|
| |
/defaultlib options can be specified implicitly via the .drectve section, and
it's pretty common that multiple object files add the same library, such as
user32.lib, to the input. We shouldn't add the same library multiple times.
llvm-svn: 194129
|
|
|
|
|
|
| |
Errors in .drectve section were silently ignored. This patch fixes the issue.
llvm-svn: 194110
|
|
|
|
| |
llvm-svn: 193883
|
|
|
|
| |
llvm-svn: 193797
|
|
|
|
| |
llvm-svn: 193712
|