diff options
author | Nick Clifton <nickc@redhat.com> | 2016-02-09 16:34:24 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2016-02-09 16:34:24 +0000 |
commit | 609332f15cc2ad651d0ebd573010595a4593e89a (patch) | |
tree | ae02dcac97f08c1001e9032db4e07b9329c335d0 /bfd/oasys.c | |
parent | 1e94266c4db633f7defaf4bb68c74fd09a9cf9e2 (diff) | |
download | gdb-609332f15cc2ad651d0ebd573010595a4593e89a.zip gdb-609332f15cc2ad651d0ebd573010595a4593e89a.tar.gz gdb-609332f15cc2ad651d0ebd573010595a4593e89a.tar.bz2 |
Fix compile time warnings building the binutils with a gcc6 compiler.
include * opcode/metag.h (metag_scondtab): Mark as possibly unused.
* opcode/nds32.h (nds32_r45map): Likewise.
(nds32_r54map): Likewise.
* opcode/visium.h (gen_reg_table): Likewise.
(fp_reg_table, cc_table, opcode_table): Likewise.
bfd * oasys.c (oasys_archive_p): Fix indentation.
* elf32-nds32.c (nds32_elf_relax_section): Use an unsigned
constant for left shifting.
Diffstat (limited to 'bfd/oasys.c')
-rw-r--r-- | bfd/oasys.c | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/bfd/oasys.c b/bfd/oasys.c index 791ad2a..f7791d2 100644 --- a/bfd/oasys.c +++ b/bfd/oasys.c @@ -272,37 +272,35 @@ oasys_archive_p (bfd *abfd) filepos = header.mod_tbl_offset; for (i = 0; i < header.mod_count; i++) { + oasys_extmodule_table_type_b_type record_ext; + if (bfd_seek (abfd, filepos, SEEK_SET) != 0) return NULL; /* There are two ways of specifying the archive header. */ - { - oasys_extmodule_table_type_b_type record_ext; - - amt = sizeof (record_ext); - if (bfd_bread ((void *) &record_ext, amt, abfd) != amt) - return NULL; - - record.mod_size = H_GET_32 (abfd, record_ext.mod_size); - record.file_offset = H_GET_32 (abfd, record_ext.file_offset); - - record.dep_count = H_GET_32 (abfd, record_ext.dep_count); - record.depee_count = H_GET_32 (abfd, record_ext.depee_count); - record.sect_count = H_GET_32 (abfd, record_ext.sect_count); - record.module_name_size = H_GET_32 (abfd, - record_ext.mod_name_length); - - amt = record.module_name_size; - module[i].name = bfd_alloc (abfd, amt + 1); - if (!module[i].name) - return NULL; - if (bfd_bread ((void *) module[i].name, amt, abfd) != amt) - return NULL; - module[i].name[record.module_name_size] = 0; - filepos += (sizeof (record_ext) - + record.dep_count * 4 - + record.module_name_size + 1); - } + amt = sizeof (record_ext); + if (bfd_bread ((void *) &record_ext, amt, abfd) != amt) + return NULL; + + record.mod_size = H_GET_32 (abfd, record_ext.mod_size); + record.file_offset = H_GET_32 (abfd, record_ext.file_offset); + + record.dep_count = H_GET_32 (abfd, record_ext.dep_count); + record.depee_count = H_GET_32 (abfd, record_ext.depee_count); + record.sect_count = H_GET_32 (abfd, record_ext.sect_count); + record.module_name_size = H_GET_32 (abfd, + record_ext.mod_name_length); + + amt = record.module_name_size; + module[i].name = bfd_alloc (abfd, amt + 1); + if (!module[i].name) + return NULL; + if (bfd_bread ((void *) module[i].name, amt, abfd) != amt) + return NULL; + module[i].name[record.module_name_size] = 0; + filepos += (sizeof (record_ext) + + record.dep_count * 4 + + record.module_name_size + 1); module[i].size = record.mod_size; module[i].pos = record.file_offset; |