| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
We don't have to use a MapVector here. Instead, just std::vector suffices.
llvm-svn: 260724
|
|
|
|
| |
llvm-svn: 260598
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we had code for linker scripts in Writer. This patch
separates that as LinkerScript class. The class provides a few
functions to query linker scripts and is also a container of some
linker-script-specific information.
Hopefully, Writer will only implement the default behavior and let
the new class handle gotchas regarding linker scripts.
llvm-svn: 260591
|
|
|
|
|
|
| |
This reverts r259395 which reverted r259143.
llvm-svn: 259572
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds "Error" field to LinkerScript class. That field
is false by default, and set to true if there is a syntax error
in an input file. The linker script parser is a recursive-descedent
parser. Each function returns if Error is true -- so that
eventually the whole parser returns to a caller.
http://reviews.llvm.org/D16667
llvm-svn: 259557
|
|
|
|
| |
llvm-svn: 259395
|
|
|
|
|
|
|
|
|
| |
This patch let the driver keep going until it parses all
command line options.
http://reviews.llvm.org/D16645
llvm-svn: 259143
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In many situations, we don't want to exit at the first error even in the
process model. For example, it is better to report all undefined symbols
rather than reporting the first one that the linker picked up randomly.
In order to handle such errors, we don't need to wrap everything with
ErrorOr (thanks for David Blaikie for pointing this out!) Instead, we
can set a flag to record the fact that we found an error and keep it
going until it reaches a reasonable checkpoint.
This idea should be applicable to other places. For example, we can
ignore broken relocations and check for errors after visiting all relocs.
In this patch, I rename error to fatal, and introduce another version of
error which doesn't call exit. That function instead sets HasError to true.
Once HasError becomes true, it stays true, so that we know that there
was an error if it is true.
I think introducing a non-noreturn error reporting function is by itself
a good idea, and it looks to me that this also provides a gradual path
towards lld-as-a-library (or at least embed-lld-to-your-program) without
sacrificing code readability with lots of ErrorOr's.
http://reviews.llvm.org/D16641
llvm-svn: 259069
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There was an off by one error because the StringRef.substr functions
second argument is a length, not the end index.
Also updated a few ELF files which failed when run on Jenkins with paths
including the @ character. This is often used in Jenkins for shared
workspace plugin.
Reviewed by Rui Ueyama
llvm-svn: 258583
|
|
|
|
| |
llvm-svn: 256970
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If an argument of the INPUT directive is a regular path, linker should
lookup it in the current folder first.
The fix does not contain any test cases because I think it is not a good
idea to pollute a current folder (which in general might be arbitrary)
by test files.
Differential Revision: http://reviews.llvm.org/D15027
llvm-svn: 254178
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In case a sysroot prefix is configured, and the filename starts with
the '/' character, and the script being processed was located inside
the sysroot prefix, the file's name will be looked for in the sysroot
prefix. Otherwise, the linker falls to the common lookup scheme.
It is slightly modified version of the commit r254031. The problem of
the initial commit was in the `is_absolute` call. On Windows 'C:\' is
absolute path but we do not need to find it under sysroot. In this patch
linker looks up a path under sysroot only if the paths starts with '/'
character.
llvm-svn: 254135
|
|
|
|
| |
llvm-svn: 254052
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The test fails on Windows:
Command 34: "ld.lld" "-o" "D:\src\llvm\build.release\tools\lld\test\ELF\Output\l
inkerscript.s.tmp2" "D:\src\llvm\build.release\tools\lld\test\ELF\Output\linkers
cript.s.tmp.dir/xyz.script" "--sysroot=D:\src\llvm\build.release\tools\lld\test\
ELF\Output\linkerscript.s.tmp.dir"
Command 34 Result: 1
Command 34 Output:
Command 34 Stderr:
Unable to find /libxyz.a
llvm-svn: 254049
|
|
|
|
| |
llvm-svn: 254032
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In case a sysroot prefix is configured, and the filename starts with the
'/' character, and the script being processed was located inside the
sysroot prefix, the file's name will be looked for in the sysroot
prefix. Otherwise, the linker falls to the common lookup scheme.
https://www.sourceware.org/binutils/docs-2.24/ld/File-Commands.html
Differential Revision: http://reviews.llvm.org/D14916
llvm-svn: 254031
|
|
|
|
|
|
|
|
|
|
| |
* determine output section by input section name
* discard input sections
* order output sections accordingly
Differential Revision: http://reviews.llvm.org/D14140
llvm-svn: 252868
|
|
|
|
|
|
|
|
| |
The reason of collecting all undefines in vector is that during reading files we already need to have Symtab created. Or like was done in that patch - to put undefines from scripts somewhere to delay Symtab.addUndefinedOpt() call.
Differential Revision: http://reviews.llvm.org/D13870
llvm-svn: 250711
|
|
|
|
|
|
|
|
|
| |
The documentation says: "You may separate commands using semicolons",
so they seem to be optional.
Differential Revision: http://reviews.llvm.org/D13703
llvm-svn: 250223
|
|
|
|
| |
llvm-svn: 250215
|
|
|
|
| |
llvm-svn: 250161
|
|
|
|
| |
llvm-svn: 250133
|
|
|
|
| |
llvm-svn: 250127
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D13675
llvm-svn: 250115
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D13668
llvm-svn: 250106
|
|
|
|
| |
llvm-svn: 250055
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds AsNeeded and IsUsed bool fields to SharedFile. AsNeeded bit
is set if the DSO is enclosed with --as-needed and --no-as-needed. IsUsed
bit is off by default. When we adds a symbol to the symbol table for dynamic
linking, we set its SharedFile's IsUsed bit.
If AsNeeded is set but IsUsed is not set, we don't want to write that
file's SO name to DT_NEEDED field.
http://reviews.llvm.org/D13579
llvm-svn: 249998
|
|
|
|
|
|
|
|
| |
In the linker script, -l and = have the same meaning as in the command line.
In addition to that, if a path is not absolute, the path needs to be searched
from the search paths. This patch implements them.
llvm-svn: 249967
|
|
|
|
| |
llvm-svn: 249962
|
|
|
|
|
|
|
| |
In our name resolution algorithm, --start-group and --end-group have
no special meaning.
llvm-svn: 249961
|
|
|
|
| |
llvm-svn: 249960
|
|
|
|
| |
llvm-svn: 249707
|
|
|
|
|
|
|
|
| |
Set ENTRY as an entry point if -e is not specified.
Differential Revision: http://reviews.llvm.org/D13509
llvm-svn: 249661
|
|
|
|
| |
llvm-svn: 249491
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Opening a file and dispatching to readLinkerScript() or createFile()
is a common operation. We want to use that at least from Driver and
from LinkerScript. In COFF, we had the same problem. This patch
resolves the problem in the same way as we did for COFF.
Now, if you have a path that you want to open, just call
Driver->addFile(StringRef). That function opens the file and handles
that as if that were given by command line. This function is the
only place we call identify_magic().
llvm-svn: 249023
|
|
llvm-svn: 248920
|