summaryrefslogtreecommitdiffstats
path: root/lld/lib/Driver/GnuLdInputGraph.cpp
diff options
context:
space:
mode:
authorShankar Easwaran <shankarke@gmail.com>2014-04-02 03:57:39 +0000
committerShankar Easwaran <shankarke@gmail.com>2014-04-02 03:57:39 +0000
commit086f8a6ef5459ea30a688e82ca471d9a863ae898 (patch)
treea736a5ba920f746ec561c28784f5b590853ca8c3 /lld/lib/Driver/GnuLdInputGraph.cpp
parenta00abba152026a357adb4dfdd79d05a124b330b9 (diff)
downloadbcm5719-llvm-086f8a6ef5459ea30a688e82ca471d9a863ae898.tar.gz
bcm5719-llvm-086f8a6ef5459ea30a688e82ca471d9a863ae898.zip
[ELF] Create Attribute class associated with Input files.
The attribute class holds positional attributes for Input files specified on the command line for the Gnu flavor. llvm-svn: 205392
Diffstat (limited to 'lld/lib/Driver/GnuLdInputGraph.cpp')
-rw-r--r--lld/lib/Driver/GnuLdInputGraph.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lld/lib/Driver/GnuLdInputGraph.cpp b/lld/lib/Driver/GnuLdInputGraph.cpp
index cd3eb8787f2..f1c8b4e8ae0 100644
--- a/lld/lib/Driver/GnuLdInputGraph.cpp
+++ b/lld/lib/Driver/GnuLdInputGraph.cpp
@@ -25,7 +25,7 @@ error_code ELFFileNode::parse(const LinkingContext &ctx,
if (ctx.logInputFiles())
diagnostics << *filePath << "\n";
- if (_isWholeArchive) {
+ if (_attributes._isWholeArchive) {
std::vector<std::unique_ptr<File>> parsedFiles;
error_code ec = ctx.registry().parseFile(_buffer, parsedFiles);
if (ec)
@@ -75,6 +75,7 @@ error_code GNULdScript::parse(const LinkingContext &ctx,
error_code ELFGNULdScript::parse(const LinkingContext &ctx,
raw_ostream &diagnostics) {
int64_t index = 0;
+ ELFFileNode::Attributes attributes;
if (error_code ec = GNULdScript::parse(ctx, diagnostics))
return ec;
for (const auto &c : _linkerScript->_commands) {
@@ -82,9 +83,10 @@ error_code ELFGNULdScript::parse(const LinkingContext &ctx,
std::unique_ptr<Group> groupStart(new Group(index++));
for (auto &path : group->getPaths()) {
// TODO : Propagate Set WholeArchive/dashlPrefix
+ attributes.setAsNeeded(path._asNeeded);
auto inputNode = new ELFFileNode(
_elfLinkingContext, _elfLinkingContext.allocateString(path._path),
- index++, false, path._asNeeded, false);
+ index++, attributes);
std::unique_ptr<InputElement> inputFile(inputNode);
cast<Group>(groupStart.get())->addFile(
std::move(inputFile));
OpenPOWER on IntegriCloud