* incremental.cc (can_incremental_update): New function.

* incremental.h (can_incremental_update): New function.
	* layout.cc (Layout::init_fixed_output_section): Call it.
	(Layout::make_output_section): Don't allow patch space in .eh_frame.
	* object.cc (Sized_relobj_file::do_layout): Call
	can_incremental_update.
This commit is contained in:
Cary Coutant 2011-09-18 15:06:28 +00:00
parent 3451853062
commit aa06ae28f1
5 changed files with 35 additions and 7 deletions

View file

@ -898,11 +898,10 @@ Layout::init_fixed_output_section(const char* name,
{
unsigned int sh_type = shdr.get_sh_type();
// We preserve the layout of PROGBITS, NOBITS, and NOTE sections.
// We preserve the layout of PROGBITS, NOBITS, INIT_ARRAY, FINI_ARRAY,
// PRE_INIT_ARRAY, and NOTE sections.
// All others will be created from scratch and reallocated.
if (sh_type != elfcpp::SHT_PROGBITS
&& sh_type != elfcpp::SHT_NOBITS
&& sh_type != elfcpp::SHT_NOTE)
if (!can_incremental_update(sh_type))
return NULL;
typename elfcpp::Elf_types<size>::Elf_Addr sh_addr = shdr.get_sh_addr();
@ -1442,6 +1441,7 @@ Layout::make_output_section(const char* name, elfcpp::Elf_Word type,
&& order != ORDER_FINI
&& order != ORDER_RELRO_LAST
&& order != ORDER_NON_RELRO_FIRST
&& strcmp(name, ".eh_frame") != 0
&& strcmp(name, ".ctors") != 0
&& strcmp(name, ".dtors") != 0
&& strcmp(name, ".jcr") != 0)