summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2016-08-11 21:00:02 +0000
committerRui Ueyama <ruiu@google.com>2016-08-11 21:00:02 +0000
commitdd81fe3156d52524b862aadb7fae8b2f918eb87f (patch)
tree599392b535b5a9d0bac865cbb7f77e3b61969205
parent1ed8f1f6e5d5c6f4a1591de0e872f35a611c7f59 (diff)
downloadbcm5719-llvm-dd81fe3156d52524b862aadb7fae8b2f918eb87f.tar.gz
bcm5719-llvm-dd81fe3156d52524b862aadb7fae8b2f918eb87f.zip
Add comments.
llvm-svn: 278408
-rw-r--r--lld/ELF/LinkerScript.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index ab2ce70840e..f924d8cb054 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -137,6 +137,16 @@ LinkerScript<ELFT>::getInputSections(const InputSectionDescription *I) {
}
namespace {
+
+// You can define new symbols using linker scripts. For example,
+// ".text { abc.o(.text); foo = .; def.o(.text); }" defines symbol
+// foo just after abc.o's text section contents. This class is to
+// handle such symbol definitions.
+//
+// In order to handle scripts like the above one, we want to
+// keep symbol definitions in output sections. Because output sections
+// can contain only input sections, we wrap symbol definitions
+// with dummy input sections. This class serves that purpose.
template <class ELFT> class LayoutInputSection : public InputSection<ELFT> {
public:
LayoutInputSection(SymbolAssignment *Cmd);
@@ -174,7 +184,8 @@ private:
template <class ELFT>
std::vector<std::unique_ptr<LayoutInputSection<ELFT>>>
OutputSectionBuilder<ELFT>::OwningSections;
-}
+
+} // anonymous namespace
template <class T> static T *zero(T *Val) {
memset(Val, 0, sizeof(*Val));
OpenPOWER on IntegriCloud