From 5568e69d92d9097db69f1342c46112532b97ae5a Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Mon, 9 Nov 2020 09:14:58 +0900 Subject: [PATCH] Start implementing .dynamic section --- mold.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mold.h b/mold.h index 68912003..0d3a69ab 100644 --- a/mold.h +++ b/mold.h @@ -452,6 +452,16 @@ private: std::string contents; }; +class DynamicSection : public OutputChunk { +public: + DynamicSection() : OutputChunk(SYNTHETIC) { + this->name = ".dynamic"; + shdr.sh_flags = llvm::ELF::SHF_ALLOC | llvm::ELF::SHF_WRITE; + shdr.sh_type = llvm::ELF::SHT_DYNAMIC; + shdr.sh_addralign = 8; + } +}; + class SymtabSection : public OutputChunk { public: SymtabSection() : OutputChunk(SYNTHETIC) { @@ -507,6 +517,7 @@ inline GotSection *got; inline GotSection *gotplt; inline PltSection *plt; inline RelPltSection *relplt; +inline DynamicSection *dynamic; inline ShstrtabSection *shstrtab; inline SymtabSection *symtab; inline StrtabSection *strtab;