diff options
| author | 2015-05-19 16:30:51 +0100 | |
|---|---|---|
| committer | 2015-05-19 16:30:51 +0100 | |
| commit | 90688ae398123b7a6c3752935fab0ebbb86d64cb (patch) | |
| tree | a77edf6807c1b3598432b59139cb2e4ee034733b /compiler | |
| parent | dc23a3882b82a7a3dd5078cda3f4b4706e172617 (diff) | |
Fix build - large frame size of ElfWriterQuick<ElfTypes>::Write.
Change-Id: I0d1b7f6ca18a992bb7619a08a2cb0ed538578410
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/elf_builder.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/compiler/elf_builder.h b/compiler/elf_builder.h index 63d3a0dabb..972bd08270 100644 --- a/compiler/elf_builder.h +++ b/compiler/elf_builder.h @@ -56,12 +56,12 @@ class ElfBuilder FINAL { public: Section(const std::string& name, Elf_Word type, Elf_Word flags, const Section* link, Elf_Word info, Elf_Word align, Elf_Word entsize) - : header_(), section_index_(0), name_(name), link_(link) { - header_.sh_type = type; - header_.sh_flags = flags; - header_.sh_info = info; - header_.sh_addralign = align; - header_.sh_entsize = entsize; + : header_(new Elf_Shdr()), section_index_(0), name_(name), link_(link) { + header_->sh_type = type; + header_->sh_flags = flags; + header_->sh_info = info; + header_->sh_addralign = align; + header_->sh_entsize = entsize; } virtual ~Section() {} @@ -79,11 +79,11 @@ class ElfBuilder FINAL { } const Elf_Shdr* GetHeader() const { - return &header_; + return header_.get(); } Elf_Shdr* GetHeader() { - return &header_; + return header_.get(); } Elf_Word GetSectionIndex() const { @@ -100,7 +100,9 @@ class ElfBuilder FINAL { } private: - Elf_Shdr header_; + // Elf_Shdr is somewhat large so allocate it on the heap. + // Otherwise we get in trouble with stack frame sizes. + std::unique_ptr<Elf_Shdr> header_; Elf_Word section_index_; const std::string name_; const Section* const link_; |