diff options
author | Simon Atanasyan <simon@atanasyan.com> | 2014-07-15 17:17:30 +0000 |
---|---|---|
committer | Simon Atanasyan <simon@atanasyan.com> | 2014-07-15 17:17:30 +0000 |
commit | 64c0ac2b35df65e38c966089f9a7ab9075bf7f58 (patch) | |
tree | c2093bee27114d037493703dc539241db0ab021e /lld/include | |
parent | bc94c94be40d289948b4043fe4d973295061e484 (diff) | |
download | bcm5719-llvm-64c0ac2b35df65e38c966089f9a7ab9075bf7f58.tar.gz bcm5719-llvm-64c0ac2b35df65e38c966089f9a7ab9075bf7f58.zip |
[ELF] Implement parsing `-l` prefixed items in the `GROUP` linker script command.
There are two forms of `-l` prefixed expression:
* -l<libname>
* -l:<filename>
In the first case a linker should construct a full library name
`lib + libname + .[so|a]` and search this library as usual. In the second case
a linker should use the `<filename>` as is and search this file through library
search directories.
The patch reviewed by Shankar Easwaran.
llvm-svn: 213077
Diffstat (limited to 'lld/include')
-rw-r--r-- | lld/include/lld/ReaderWriter/LinkerScript.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lld/include/lld/ReaderWriter/LinkerScript.h b/lld/include/lld/ReaderWriter/LinkerScript.h index 7d52f596fd5..ede0e350b92 100644 --- a/lld/include/lld/ReaderWriter/LinkerScript.h +++ b/lld/include/lld/ReaderWriter/LinkerScript.h @@ -34,6 +34,7 @@ public: unknown, eof, identifier, + libname, comma, l_paren, r_paren, @@ -145,10 +146,11 @@ private: struct Path { StringRef _path; bool _asNeeded; + bool _isDashlPrefix; - Path() : _asNeeded(false) {} - explicit Path(StringRef path, bool asNeeded = false) - : _path(path), _asNeeded(asNeeded) {} + Path() : _asNeeded(false), _isDashlPrefix(false) {} + explicit Path(StringRef path, bool asNeeded = false, bool isLib = false) + : _path(path), _asNeeded(asNeeded), _isDashlPrefix(isLib) {} }; class Group : public Command { @@ -169,6 +171,8 @@ public: first = false; if (path._asNeeded) os << "AS_NEEDED("; + if (path._isDashlPrefix) + os << "-l"; os << path._path; if (path._asNeeded) os << ")"; |