summaryrefslogtreecommitdiffstats
path: root/lld/ELF/OutputSections.h
diff options
context:
space:
mode:
authorIgor Kudrin <ikudrin.dev@gmail.com>2015-10-05 10:29:46 +0000
committerIgor Kudrin <ikudrin.dev@gmail.com>2015-10-05 10:29:46 +0000
commitb1f2b51a896e561397aa4ef2620b37ed02c03a58 (patch)
tree67a956eeee946c230793ce83f92e6fbae68a87cc /lld/ELF/OutputSections.h
parent9ed154f9213acaa34fd79aa4a274e9162bf3bf77 (diff)
downloadbcm5719-llvm-b1f2b51a896e561397aa4ef2620b37ed02c03a58.tar.gz
bcm5719-llvm-b1f2b51a896e561397aa4ef2620b37ed02c03a58.zip
[ELF2] Add DT_INIT and DT_FINI dynamic table entries
The entries are added if there are "_init" or "_fini" entries in the symbol table respectively. According to the behavior of ld, entries are inserted even for undefined symbols. Symbol names can be overridden by using -init and -fini command line switches. If used, these switches neither add new symbol table entries nor require those symbols to be resolved. Differential Revision: http://reviews.llvm.org/D13385 llvm-svn: 249297
Diffstat (limited to 'lld/ELF/OutputSections.h')
-rw-r--r--lld/ELF/OutputSections.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h
index e36ac9eee7c..5e2119630d7 100644
--- a/lld/ELF/OutputSections.h
+++ b/lld/ELF/OutputSections.h
@@ -320,7 +320,8 @@ class DynamicSection final : public OutputSectionBase<ELFT::Is64Bits> {
public:
DynamicSection(SymbolTable &SymTab, HashTableSection<ELFT> &HashSec,
- RelocationSection<ELFT> &RelaDynSec);
+ RelocationSection<ELFT> &RelaDynSec,
+ const OutputSection<ELFT> &BssSec);
void finalize() override;
void writeTo(uint8_t *Buf) override;
@@ -333,7 +334,10 @@ private:
SymbolTableSection<ELFT> &DynSymSec;
StringTableSection<ELFT::Is64Bits> &DynStrSec;
RelocationSection<ELFT> &RelaDynSec;
+ const OutputSection<ELFT> &BssSec;
SymbolTable &SymTab;
+ const ELFSymbolBody<ELFT> *InitSym = nullptr;
+ const ELFSymbolBody<ELFT> *FiniSym = nullptr;
};
}
}
OpenPOWER on IntegriCloud