Commit Graph

11 Commits

Author SHA1 Message Date
Rui Ueyama 5d380682fb Create a vector containing all input sections.
Previously, we do this piece of code to iterate over all input sections.

  for (elf::ObjectFile<ELFT> *F : Symtab.getObjectFiles())
    for (InputSectionBase<ELFT> *S : F->getSections())

It turned out that this mechanisms doesn't work well with synthetic
input sections because synthetic input sections don't belong to any
input file.

This patch defines a vector that contains all input sections including
synthetic ones.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@286051 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-05 22:37:59 +00:00
Eugene Zelenko 3c5c20aa2e Fix some Clang-tidy modernize-use-default and Include What You Use warnings; other minor fixes.
Differential revision: https://reviews.llvm.org/D26320


git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@286030 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-05 01:00:56 +00:00
Rafael Espindola da338b7d42 Delete more ELF bits from the old linker.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@262181 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-28 16:03:37 +00:00
Rafael Espindola 34cda6e0db Use MemoryBufferRef instead of MemoryBuffer&. NFC.
This just reduces the noise from another patch.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@235776 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-24 21:10:50 +00:00
Rafael Espindola 17d70bfdbf Return ErrorOr<std::unique_ptr<File>>. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@235744 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-24 18:51:30 +00:00
Rafael Espindola 1ef8568c0b Return an ErrorOr<std::unique_ptr<File>>. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@235741 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-24 18:33:50 +00:00
Rafael Espindola 2ab75af78a Delete unnecessary generality in loadFile.
loadFile could load mulitple files just because yaml has a feature for
putting multiple documents in one file.

Designing a linker around what yaml can do seems like a bad idea to
me. This patch changes it to read a single file.

There are further improvements to be done to the api and they
will follow shortly.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@235724 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-24 15:51:45 +00:00
Rui Ueyama 0d9505de7b Remove a parameter for file extension from canParse.
canParse took three parameters -- file magic, filename extension and
memory buffer. All but YAMLReader ignored the second parameter.
This patch removes the parameter.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@234080 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-04 02:44:36 +00:00
Rui Ueyama 95712f49fd Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@231688 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-09 18:59:55 +00:00
Rui Ueyama a67d65ab9a Remove kindInGroup reference.
That kind of reference was used only in ELFFile, and the use of
that reference there didn't seem to make sense. All test still
pass (after adjusting symbol names) without that code. LLD is
still be able to link LLD and Clang. Looks like we just don't
need this.

http://reviews.llvm.org/D7189

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@227259 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-27 22:55:29 +00:00
Greg Fitzgerald 3f4f811cd5 Fix five of the shared library build targets
Before this patch there was a cyclic dependency between lldCore and
lldReaderWriter.  Only lldConfig could be built as a shared library.

* Moved Reader and Writer base classes into lldCore.
* The following shared libraries can now be built:
     lldCore
     lldYAML
     lldNative
     lldPasses
     lldReaderWriter

Differential Revision: http://reviews.llvm.org/D7105

From: Greg Fitzgerald <garious@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@226732 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-21 22:54:56 +00:00