summaryrefslogtreecommitdiffstats
path: root/bfd/elf32-sh64.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-sh64.c')
-rw-r--r--bfd/elf32-sh64.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c
index afafcfde88..219f7533f1 100644
--- a/bfd/elf32-sh64.c
+++ b/bfd/elf32-sh64.c
@@ -1,5 +1,5 @@
/* SuperH SH64-specific support for 32-bit ELF
- Copyright 2000, 2001, 2002, 2003, 2004, 2005
+ Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -115,13 +115,16 @@ static void sh64_find_section_for_address
static bfd_boolean
sh64_elf_new_section_hook (bfd *abfd, asection *sec)
{
- struct _sh64_elf_section_data *sdata;
- bfd_size_type amt = sizeof (*sdata);
+ if (!sec->used_by_bfd)
+ {
+ struct _sh64_elf_section_data *sdata;
+ bfd_size_type amt = sizeof (*sdata);
- sdata = (struct _sh64_elf_section_data *) 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);
}
OpenPOWER on IntegriCloud