diff options
Diffstat (limited to 'bfd/elfxx-mips.c')
-rw-r--r-- | bfd/elfxx-mips.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 478a471..c585ae4 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -826,13 +826,16 @@ mips_elf_link_hash_newfunc (struct bfd_hash_entry *entry, bfd_boolean _bfd_mips_elf_new_section_hook (bfd *abfd, asection *sec) { - struct _mips_elf_section_data *sdata; - bfd_size_type amt = sizeof (*sdata); + if (!sec->used_by_bfd) + { + struct _mips_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); - sdata = bfd_zalloc (abfd, amt); - if (sdata == NULL) - return FALSE; - sec->used_by_bfd = sdata; + sdata = bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = sdata; + } return _bfd_elf_new_section_hook (abfd, sec); } |