| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
I think it is clear by now that the new linker is viable.
llvm-svn: 262158
|
|
|
|
|
|
| |
elf32btsmipn32/elf32ltsmipn32
llvm-svn: 246336
|
|
|
|
|
|
|
| |
Now it is possible to have mips-linux-gnu-ld executable and link MIPS 64-bit
little-endian binaries providing -melf64ltsmip command line argument.
llvm-svn: 246335
|
|
|
|
|
|
| |
Patch from Eugene.Zelenko!
llvm-svn: 243060
|
|
|
|
| |
llvm-svn: 238034
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit implements the behaviour of the SECTIONS linker script directive,
used to not only define a custom mapping between input and output sections, but
also order input sections in the output file. To do this, we modify
DefaultLayout with hooks at important places that allow us to re-order input
sections according to a custom order. We also add a hook in SegmentChunk to
allow us to calculate linker script expressions while assigning virtual
addresses to the input sections that live in a segment.
Not all SECTIONS constructs are currently supported, but only the ones that do
not use special sort orders. It adds two LIT test as practical examples of
which sections directives are currently supported.
In terms of high-level changes, it creates a new class "script::Sema" that owns
all linker script ASTs and the logic for linker script semantics as well.
ELFLinkingContext owns a single copy of Sema, which will be used throughout
the object file writing process (to layout sections as proposed by the linker
script).
Other high-level change is that the writer no longer uses a "const" copy of
the linking context. This happens because linker script expressions must be
calculated *while* calculating final virtual addresses, which is a very late
step in object file writing. While calculating these expressions, we need to
update the linker script symbol table (inside the semantics object), and, thus,
we are "modifying our context" as we prepare to write the file.
http://reviews.llvm.org/D8157
llvm-svn: 232402
|
|
|
|
|
|
|
|
|
|
|
| |
The expression evaluation is needed when interpreting linker scripts, in order
to calculate the value for new symbols or to determine a new position to load
sections in memory. This commit extends Expression nodes from the linker script
AST with evaluation functions, and also contains a unit test.
http://reviews.llvm.org/D8156
llvm-svn: 231707
|
|
|
|
| |
llvm-svn: 228750
|
|
|
|
| |
llvm-svn: 228749
|
|
|
|
| |
llvm-svn: 228723
|
|
|
|
|
|
|
| |
This local variable name did not follow the style guide,
and it is not actually needed.
llvm-svn: 228722
|
|
|
|
|
|
| |
No change in functionality.
llvm-svn: 228379
|
|
|
|
|
|
|
|
|
| |
Only search library directories explicitly specified
on the command line. Library directories specified in linker
scripts (including linker scripts specified on the command
line) are ignored.
llvm-svn: 228375
|
|
|
|
|
|
|
|
|
|
| |
INPUT directive is a variant of GROUP in the sense that that specifies
a list of input files. The only difference is whether the entire file
list is wrapped with a --start-group/--end-group or not.
http://reviews.llvm.org/D7390
llvm-svn: 228060
|
|
|
|
|
|
|
| |
This patch is to enable to write unit tests for linker script with
less boilerplate code.
llvm-svn: 227902
|
|
|
|
|
|
| |
Reviewed by: ruiu, shankarke
llvm-svn: 227787
|
|
|
|
|
|
| |
Reviewed by: shankarke, ruiu
llvm-svn: 227708
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is needed, among others by the FreeBSD kernel linker script.
Patch by Davide Italiano!
Reviewers: ruiu, rafaelauler
Differential Revision: http://reviews.llvm.org/D7220
llvm-svn: 227694
|
|
|
|
| |
llvm-svn: 227367
|
|
|
|
| |
llvm-svn: 227341
|
|
|
|
|
|
|
| |
This change makes it easy to write unit tests for the GNU driver.
No more "empty group" hack is needed. No change in functionality.
llvm-svn: 226150
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The LLD linker searches initializer and finalizer function names
and emits DT_INIT/DT_FINI dynamic table tags to point to these symbols.
The -init/-fini command line options override initializer ("_init") and
finalizer ("_fini") function names used by default.
Now the -init/-fini options do not affect .init_array/.fini_array
sections. The corresponding code has been removed.
Differential Revision: http://reviews.llvm.org/D6578
llvm-svn: 223917
|
|
|
|
| |
llvm-svn: 220131
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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: 205735
|
|
|
|
| |
llvm-svn: 205694
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 205663
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 205654
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 204982
|
|
|
|
|
|
|
| |
For the record, I used clang-modernize to add "override" and perl to remove
"virtual".
llvm-svn: 203164
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
Also change some local variable names: "ti" -> "context" and
"_targetInfo" -> "_context".
Differential Revision: http://llvm-reviews.chandlerc.com/D1301
llvm-svn: 187823
|
|
|
|
|
|
| |
remove unneeded instance variables
llvm-svn: 186440
|
|
|
|
| |
llvm-svn: 186427
|
|
|
|
| |
llvm-svn: 182985
|
|
llvm-svn: 182980
|