| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
When dynamic libraries are built, undefined symbols should always be allowed and
the linker should not exit with an error.
llvm-svn: 217356
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Some of those loops were pretty monstrous.
llvm-svn: 212616
|
|
|
|
| |
llvm-svn: 210919
|
|
|
|
| |
llvm-svn: 210785
|
|
|
|
|
|
| |
This is an update for a llvm api change.
llvm-svn: 210689
|
|
|
|
|
|
|
| |
There is no std::error_code::success, so this removes much of the noise
in transitioning to std::error_code.
llvm-svn: 209948
|
|
|
|
|
|
|
|
|
|
|
| |
Previously only GNU driver calls InputGraph::normalize, but its
functionality is not and should not be limited to GNU ld. Other
driver should be able to use it.
Currently only linker scripts use the feature, so this change
won't change the existing behavior.
llvm-svn: 208266
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In general the linker scripts's GROUP command works like a pair
of command line options --start-group/--end-group. But there is
a difference in the files look up algorithm.
The --start-group/--end-group commands use a trivial approach:
a) If the path has '-l' prefix, add 'lib' prefix and '.a'/'.so'
suffix and search the path through library search directories.
b) Otherwise, use the path 'as-is'.
The GROUP command implements more compicated approach:
a) If the path has '-l' prefix, add 'lib' prefix and '.a'/'.so'
suffix and search the path through library search directories.
b) If the path does not have '-l' prefix, and sysroot is configured,
and the path starts with the / character, and the script being
processed is located inside the sysroot, search the path under
the sysroot. Otherwise, try to open the path in the current
directory. If it is not found, search through library search
directories.
https://www.sourceware.org/binutils/docs-2.24/ld/File-Commands.html
The patch reviewed by Shankar Easwaran, Rui Ueyama.
llvm-svn: 207769
|
|
|
|
| |
llvm-svn: 207687
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 205654
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 205490
|
|
|
|
| |
llvm-svn: 205486
|
|
|
|
|
|
|
| |
The attribute class holds positional attributes for Input files specified on the
command line for the Gnu flavor.
llvm-svn: 205392
|
|
|
|
|
|
|
|
|
| |
This adds -z muldefs option which is widely used over
--allow-multiple-definition.
This option is supported by the GNU linker.
llvm-svn: 205391
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
Asserting with cast<T> did not actually make much sense because there was no
need to use dynamic casting in the first place. We could make the compiler to
statically type check these objects.
llvm-svn: 205350
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Also remove unused vector.
llvm-svn: 205052
|
|
|
|
|
|
|
|
|
| |
Response file is a command line argument in the form of @file. The GNU-
compatible driver expands the file contents, replacing @file argument.
Differential Revision: http://llvm-reviews.chandlerc.com/D3210
llvm-svn: 205038
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
If --allow-multiple-definition option is given, LLD does not treat duplicate
symbol error as a fatal error. GNU LD supports this option.
Differential Revision: http://llvm-reviews.chandlerc.com/D3211
llvm-svn: 205015
|
|
|
|
| |
llvm-svn: 204987
|
|
|
|
| |
llvm-svn: 204986
|
|
|
|
| |
llvm-svn: 204982
|
|
|
|
| |
llvm-svn: 204293
|
|
|
|
|
|
| |
No change in functionality.
llvm-svn: 200175
|
|
|
|
|
|
| |
Differential Revision: http://llvm-reviews.chandlerc.com/D2501
llvm-svn: 198535
|
|
|
|
|
|
|
| |
Add basic emulation mapping for NetBSD/amd64, so that clang -m32 works
as expected.
llvm-svn: 198337
|
|
|
|
| |
llvm-svn: 197788
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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: 196056
|
|
|
|
|
|
| |
Comment from Rui Ueyema.
llvm-svn: 195598
|
|
|
|
| |
llvm-svn: 195597
|
|
|
|
|
|
| |
This is needed before any of the search paths are searched for.
llvm-svn: 195596
|
|
|
|
|
|
|
| |
Looks like -L paths are not positional. They need to be added to a list of
search paths and those needs to be searched when lld looks for a library.
llvm-svn: 195594
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds LinkerScript support by creating a type Script which is of type
FileNode in the InputGraph. Once the LinkerScript Parser converts the
LinkerScript into a sequence of command, the commands are handled by the
equivalent LinkerScript node for the current Flavor/Target. For ELF, a
ELFGNULdScript gets created which converts the commands to ELF nodes and ELF
control nodes(ELFGroup for handling Group nodes).
Since the Inputfile type has to be determined in the Driver, the Driver needs
to determine the complete path of the file that needs to be processed by the
Linker. Due to this, few tests have been removed since the Driver uses paths
that doesnot exist.
llvm-svn: 195583
|
|
|
|
| |
llvm-svn: 194089
|
|
|
|
| |
llvm-svn: 194037
|
|
|
|
| |
llvm-svn: 192427
|
|
|
|
|
|
|
|
|
|
| |
This associates resolveState to FileNodes. The control node derive
their resolution state from the inputElements that are contained in
it.
This makes --start-group/--end-group to work with ELF linking.
llvm-svn: 192269
|
|
|
|
| |
llvm-svn: 192169
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changes :-
a) Functionality in InputGraph to insert Input elements at any position
b) Functionality in the Resolver to use nextFile
c) Move the functionality of assigning file ordinals to InputGraph
d) Changes all inputs to MemoryBuffers
e) Remove LinkerInput, InputFiles, ReaderArchive
llvm-svn: 192081
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch inverts the return value of these functions, so that they return
"true" on success and "false" on failure. The meaning of boolean return value
was mixed in LLD; for example, InputGraph::validate() returns true on success.
With this patch they'll become consistent.
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1748
llvm-svn: 191341
|
|
|
|
|
|
|
|
|
|
| |
This adds an option --output-filetype that can be set to either
YAML/Native(case insensitive). The linker would create the outputs
associated with the type specified by the user.
Changes all the tests to use the new option.
llvm-svn: 191183
|
|
|
|
|
|
|
|
|
|
| |
message.
GNU LD driver only understood no_such_file_or_directory error and was showing
just "Unknown Error" for any other type of error. With this patch, the driver
now prints file name and error message string by default.
llvm-svn: 191070
|
|
|
|
| |
llvm-svn: 190758
|