forked from Imagelibrary/binutils-gdb
bfd/
2005-04-04 H.J. Lu <hongjiu.lu@intel.com> * elf.c (bfd_elf_set_group_contents): Ignore linker created group section. (assign_section_numbers): Accept link_info. Check SHT_GROUP sections for relocatable files only. Remove the linker created group sections. (_bfd_elf_compute_section_file_positions): Pass link_info to assign_section_numbers. * elfxx-ia64.c (elfNN_ia64_object_p): New. (elf_backend_object_p): Defined. gas/ 2005-04-04 H.J. Lu <hongjiu.lu@intel.com> * config/tc-ia64.c (start_unwind_section): Undo the change of 2004-08-18. (generate_unwind_image, dot_endp): Likewise.
This commit is contained in:
37
bfd/elf.c
37
bfd/elf.c
@@ -2728,7 +2728,7 @@ bfd_elf_set_group_contents (bfd *abfd, asection *sec, void *failedptrarg)
|
||||
in here too, while we're at it. */
|
||||
|
||||
static bfd_boolean
|
||||
assign_section_numbers (bfd *abfd)
|
||||
assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
|
||||
{
|
||||
struct elf_obj_tdata *t = elf_tdata (abfd);
|
||||
asection *sec;
|
||||
@@ -2741,16 +2741,35 @@ assign_section_numbers (bfd *abfd)
|
||||
|
||||
_bfd_elf_strtab_clear_all_refs (elf_shstrtab (abfd));
|
||||
|
||||
/* Put SHT_GROUP sections first. */
|
||||
for (sec = abfd->sections; sec; sec = sec->next)
|
||||
/* SHT_GROUP sections are in relocatable files only. */
|
||||
if (link_info == NULL || link_info->relocatable)
|
||||
{
|
||||
d = elf_section_data (sec);
|
||||
asection **secp;
|
||||
|
||||
if (d->this_hdr.sh_type == SHT_GROUP)
|
||||
/* Put SHT_GROUP sections first. */
|
||||
secp = &abfd->sections;
|
||||
while (*secp)
|
||||
{
|
||||
if (section_number == SHN_LORESERVE)
|
||||
section_number += SHN_HIRESERVE + 1 - SHN_LORESERVE;
|
||||
d->this_idx = section_number++;
|
||||
d = elf_section_data (*secp);
|
||||
|
||||
if (d->this_hdr.sh_type == SHT_GROUP)
|
||||
{
|
||||
if ((*secp)->flags & SEC_LINKER_CREATED)
|
||||
{
|
||||
/* Remove the linker created SHT_GROUP sections. */
|
||||
bfd_section_list_remove (abfd, secp);
|
||||
abfd->section_count--;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (section_number == SHN_LORESERVE)
|
||||
section_number += SHN_HIRESERVE + 1 - SHN_LORESERVE;
|
||||
d->this_idx = section_number++;
|
||||
}
|
||||
}
|
||||
|
||||
secp = &(*secp)->next;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3277,7 +3296,7 @@ _bfd_elf_compute_section_file_positions (bfd *abfd,
|
||||
if (failed)
|
||||
return FALSE;
|
||||
|
||||
if (!assign_section_numbers (abfd))
|
||||
if (!assign_section_numbers (abfd, link_info))
|
||||
return FALSE;
|
||||
|
||||
/* The backend linker builds symbol table information itself. */
|
||||
|
||||
Reference in New Issue
Block a user