2009-01-21 Ulrich Drepper <drepper@redhat.com>
+ * elf32_updatefile.c (elfXX_updatemmap): Skip most of the loop to
+ handle sections for NOBITS sections.
+ (elfXX_updatefile): Likewise.
+
* elf32_updatefile.c (elfXX_updatemmap): When skipping non-NOBITS
sections we haven't loaded, update last_position based on scn_start,
not based on old value. Don't run the loop for the dummy section 0.
}
ElfW2(LIBELFBITS,Shdr) *shdr = scn->shdr.ELFW(e,LIBELFBITS);
+ if (shdr->sh_type == SHT_NOBITS)
+ goto next;
char *scn_start = ((char *) elf->map_address
+ elf->start_offset + shdr->sh_offset);
Elf_Data_List *dl = &scn->data_list;
- if (shdr->sh_type != SHT_NOBITS && scn->data_list_rear != NULL)
+ if (scn->data_list_rear != NULL)
do
{
assert (dl->data.d.d_off >= 0);
dl = dl->next;
}
while (dl != NULL);
- else if (shdr->sh_type != SHT_NOBITS)
+ else
/* We have to trust the existing section header information. */
last_position = scn_start + shdr->sh_size;
+ next:
scn->flags &= ~ELF_F_DIRTY;
}
}
ElfW2(LIBELFBITS,Shdr) *shdr = scn->shdr.ELFW(e,LIBELFBITS);
+ if (shdr->sh_type == SHT_NOBITS)
+ goto next;
off_t scn_start = elf->start_offset + shdr->sh_offset;
Elf_Data_List *dl = &scn->data_list;
- if (shdr->sh_type != SHT_NOBITS && scn->data_list_rear != NULL
- && scn->index != 0)
+ if (scn->data_list_rear != NULL)
do
{
if ((scn->flags | dl->flags | elf->flags) & ELF_F_DIRTY)
dl = dl->next;
}
while (dl != NULL);
- else if (shdr->sh_type != SHT_NOBITS)
+ else
last_offset = scn_start + shdr->sh_size;
+ next:
/* Collect the section header table information. */
if (unlikely (change_bo))
(*shdr_fctp) (&shdr_data[scn->index],