mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-13 02:45:02 +08:00
* elfcode.h (elf_object_p): Preserve and clear abfd section
information. Restore at error.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2000-09-26 Hans-Peter Nilsson <hp@axis.com>
|
||||||
|
|
||||||
|
* elfcode.h (elf_object_p): Preserve and clear abfd section
|
||||||
|
information. Restore at error.
|
||||||
|
|
||||||
2000-09-26 Paul Sokolovsky <Paul.Sokolovsky@technologist.com>
|
2000-09-26 Paul Sokolovsky <Paul.Sokolovsky@technologist.com>
|
||||||
|
|
||||||
* peigen.c (_bfd_pei_swap_aouthdr_in): If some DataDirectory
|
* peigen.c (_bfd_pei_swap_aouthdr_in): If some DataDirectory
|
||||||
|
@ -500,9 +500,16 @@ elf_object_p (abfd)
|
|||||||
char *shstrtab; /* Internal copy of section header stringtab */
|
char *shstrtab; /* Internal copy of section header stringtab */
|
||||||
struct elf_backend_data *ebd;
|
struct elf_backend_data *ebd;
|
||||||
struct elf_obj_tdata *preserved_tdata = elf_tdata (abfd);
|
struct elf_obj_tdata *preserved_tdata = elf_tdata (abfd);
|
||||||
|
struct sec *preserved_sections = abfd->sections;
|
||||||
|
unsigned int preserved_section_count = abfd->section_count;
|
||||||
struct elf_obj_tdata *new_tdata = NULL;
|
struct elf_obj_tdata *new_tdata = NULL;
|
||||||
asection *s;
|
asection *s;
|
||||||
|
|
||||||
|
/* Clear section information, since there might be a recognized bfd that
|
||||||
|
we now check if we can replace, and we don't want to append to it. */
|
||||||
|
abfd->sections = NULL;
|
||||||
|
abfd->section_count = 0;
|
||||||
|
|
||||||
/* Read in the ELF header in external format. */
|
/* Read in the ELF header in external format. */
|
||||||
|
|
||||||
if (bfd_read ((PTR) & x_ehdr, sizeof (x_ehdr), 1, abfd) != sizeof (x_ehdr))
|
if (bfd_read ((PTR) & x_ehdr, sizeof (x_ehdr), 1, abfd) != sizeof (x_ehdr))
|
||||||
@ -745,6 +752,8 @@ elf_object_p (abfd)
|
|||||||
if (new_tdata != NULL)
|
if (new_tdata != NULL)
|
||||||
bfd_release (abfd, new_tdata);
|
bfd_release (abfd, new_tdata);
|
||||||
elf_tdata (abfd) = preserved_tdata;
|
elf_tdata (abfd) = preserved_tdata;
|
||||||
|
abfd->sections = preserved_sections;
|
||||||
|
abfd->section_count = preserved_section_count;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user