From: David Srbecky Date: Tue, 19 May 2015 15:30:51 +0000 (+0100) Subject: Fix build - large frame size of ElfWriterQuick::Write. X-Git-Tag: android-x86-7.1-r1~889^2~1226^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=90688ae398123b7a6c3752935fab0ebbb86d64cb;p=android-x86%2Fart.git Fix build - large frame size of ElfWriterQuick::Write. Change-Id: I0d1b7f6ca18a992bb7619a08a2cb0ed538578410 --- diff --git a/compiler/elf_builder.h b/compiler/elf_builder.h index 63d3a0dab..972bd0827 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 header_; Elf_Word section_index_; const std::string name_; const Section* const link_;