Line 1703... |
Line 1703... |
else
|
else
|
{
|
{
|
// For an incremental update, find an available slot.
|
// For an incremental update, find an available slot.
|
off_t got_offset = this->free_list_.allocate(size / 8, size / 8, 0);
|
off_t got_offset = this->free_list_.allocate(size / 8, size / 8, 0);
|
if (got_offset == -1)
|
if (got_offset == -1)
|
gold_fatal(_("out of patch space (GOT);"
|
gold_fallback(_("out of patch space (GOT);"
|
" relink with --incremental-full"));
|
" relink with --incremental-full"));
|
unsigned int got_index = got_offset / (size / 8);
|
unsigned int got_index = got_offset / (size / 8);
|
gold_assert(got_index < this->entries_.size());
|
gold_assert(got_index < this->entries_.size());
|
this->entries_[got_index] = got_entry;
|
this->entries_[got_index] = got_entry;
|
return static_cast<unsigned int>(got_offset);
|
return static_cast<unsigned int>(got_offset);
|
Line 1733... |
Line 1733... |
else
|
else
|
{
|
{
|
// For an incremental update, find an available pair of slots.
|
// For an incremental update, find an available pair of slots.
|
off_t got_offset = this->free_list_.allocate(2 * size / 8, size / 8, 0);
|
off_t got_offset = this->free_list_.allocate(2 * size / 8, size / 8, 0);
|
if (got_offset == -1)
|
if (got_offset == -1)
|
gold_fatal(_("out of patch space (GOT);"
|
gold_fallback(_("out of patch space (GOT);"
|
" relink with --incremental-full"));
|
" relink with --incremental-full"));
|
unsigned int got_index = got_offset / (size / 8);
|
unsigned int got_index = got_offset / (size / 8);
|
gold_assert(got_index < this->entries_.size());
|
gold_assert(got_index < this->entries_.size());
|
this->entries_[got_index] = got_entry_1;
|
this->entries_[got_index] = got_entry_1;
|
this->entries_[got_index + 1] = got_entry_2;
|
this->entries_[got_index + 1] = got_entry_2;
|
Line 2268... |
Line 2268... |
{
|
{
|
// For incremental updates, find a chunk of unused space in the section.
|
// For incremental updates, find a chunk of unused space in the section.
|
offset_in_section = this->free_list_.allocate(input_section_size,
|
offset_in_section = this->free_list_.allocate(input_section_size,
|
addralign, 0);
|
addralign, 0);
|
if (offset_in_section == -1)
|
if (offset_in_section == -1)
|
gold_fatal(_("out of patch space; relink with --incremental-full"));
|
gold_fallback(_("out of patch space; relink with --incremental-full"));
|
aligned_offset_in_section = offset_in_section;
|
aligned_offset_in_section = offset_in_section;
|
}
|
}
|
else
|
else
|
{
|
{
|
offset_in_section = this->current_data_size_for_child();
|
offset_in_section = this->current_data_size_for_child();
|
Line 2372... |
Line 2372... |
{
|
{
|
// For incremental updates, find a chunk of unused space.
|
// For incremental updates, find a chunk of unused space.
|
offset_in_section = this->free_list_.allocate(posd->data_size(),
|
offset_in_section = this->free_list_.allocate(posd->data_size(),
|
posd->addralign(), 0);
|
posd->addralign(), 0);
|
if (offset_in_section == -1)
|
if (offset_in_section == -1)
|
gold_fatal(_("out of patch space; relink with --incremental-full"));
|
gold_fallback(_("out of patch space; "
|
|
"relink with --incremental-full"));
|
// Finalize the address and offset now.
|
// Finalize the address and offset now.
|
uint64_t addr = this->address();
|
uint64_t addr = this->address();
|
off_t offset = this->offset();
|
off_t offset = this->offset();
|
posd->set_address_and_file_offset(addr + offset_in_section,
|
posd->set_address_and_file_offset(addr + offset_in_section,
|
offset + offset_in_section);
|
offset + offset_in_section);
|
Line 3724... |
Line 3725... |
this->has_fixed_layout_ = true;
|
this->has_fixed_layout_ = true;
|
}
|
}
|
|
|
// Reserve space within the fixed layout for the section. Used for
|
// Reserve space within the fixed layout for the section. Used for
|
// incremental update links.
|
// incremental update links.
|
|
|
void
|
void
|
Output_section::reserve(uint64_t sh_offset, uint64_t sh_size)
|
Output_section::reserve(uint64_t sh_offset, uint64_t sh_size)
|
{
|
{
|
this->free_list_.remove(sh_offset, sh_offset + sh_size);
|
this->free_list_.remove(sh_offset, sh_offset + sh_size);
|
}
|
}
|
|
|
|
// Allocate space from the free list for the section. Used for
|
|
// incremental update links.
|
|
|
|
off_t
|
|
Output_section::allocate(off_t len, uint64_t addralign)
|
|
{
|
|
return this->free_list_.allocate(len, addralign, 0);
|
|
}
|
|
|
// Output segment methods.
|
// Output segment methods.
|
|
|
Output_segment::Output_segment(elfcpp::Elf_Word type, elfcpp::Elf_Word flags)
|
Output_segment::Output_segment(elfcpp::Elf_Word type, elfcpp::Elf_Word flags)
|
: vaddr_(0),
|
: vaddr_(0),
|
paddr_(0),
|
paddr_(0),
|
Line 4144... |
Line 4155... |
|
|
*in_tls = false;
|
*in_tls = false;
|
}
|
}
|
}
|
}
|
|
|
// FIXME: Need to handle TLS and .bss with incremental update.
|
if (!parameters->incremental_update())
|
if (!parameters->incremental_update()
|
|
|| (*p)->is_section_flag_set(elfcpp::SHF_TLS)
|
|
|| (*p)->is_section_type(elfcpp::SHT_NOBITS))
|
|
{
|
{
|
off = align_address(off, align);
|
off = align_address(off, align);
|
(*p)->set_address_and_file_offset(addr + (off - startoff), off);
|
(*p)->set_address_and_file_offset(addr + (off - startoff), off);
|
}
|
}
|
else
|
else
|
Line 4161... |
Line 4169... |
off_t current_size = (*p)->current_data_size();
|
off_t current_size = (*p)->current_data_size();
|
off = layout->allocate(current_size, align, startoff);
|
off = layout->allocate(current_size, align, startoff);
|
if (off == -1)
|
if (off == -1)
|
{
|
{
|
gold_assert((*p)->output_section() != NULL);
|
gold_assert((*p)->output_section() != NULL);
|
gold_fatal(_("out of patch space for section %s; "
|
gold_fallback(_("out of patch space for section %s; "
|
"relink with --incremental-full"),
|
"relink with --incremental-full"),
|
(*p)->output_section()->name());
|
(*p)->output_section()->name());
|
}
|
}
|
(*p)->set_address_and_file_offset(addr + (off - startoff), off);
|
(*p)->set_address_and_file_offset(addr + (off - startoff), off);
|
if ((*p)->data_size() > current_size)
|
if ((*p)->data_size() > current_size)
|
{
|
{
|
gold_assert((*p)->output_section() != NULL);
|
gold_assert((*p)->output_section() != NULL);
|
gold_fatal(_("%s: section changed size; "
|
gold_fallback(_("%s: section changed size; "
|
"relink with --incremental-full"),
|
"relink with --incremental-full"),
|
(*p)->output_section()->name());
|
(*p)->output_section()->name());
|
}
|
}
|
}
|
}
|
}
|
}
|