aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2023-06-30 10:45:20 +0100
committerNick Clifton <nickc@redhat.com>2023-06-30 10:45:20 +0100
commit7e3ca9a4afcc4ff2960d12eaad35c75a7abb84e9 (patch)
tree47dfd9b157c44e99eec00adf51c77a732f20667b /bfd
parent0d4d1e7653797686e6a3e4f1f579d1ae64d86e99 (diff)
downloadbinutils-7e3ca9a4afcc4ff2960d12eaad35c75a7abb84e9.zip
binutils-7e3ca9a4afcc4ff2960d12eaad35c75a7abb84e9.tar.gz
binutils-7e3ca9a4afcc4ff2960d12eaad35c75a7abb84e9.tar.bz2
Fix used-before-initialized warnings when compiling elf.c with Clang-16.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/elf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index e506721..d38e0af 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1904,6 +1904,8 @@ offset_from_vma (Elf_Internal_Phdr *phdrs, size_t phnum, bfd_vma vma,
return vma - seg->p_vaddr + seg->p_offset;
}
+ if (max_size_p)
+ *max_size_p = 0;
bfd_set_error (bfd_error_invalid_operation);
return (file_ptr) -1;
}
@@ -2001,8 +2003,8 @@ _bfd_elf_get_dynamic_symbols (bfd *abfd, Elf_Internal_Phdr *phdr,
bfd_byte *versym = NULL;
bfd_byte *verdef = NULL;
bfd_byte *verneed = NULL;
- size_t verdef_size;
- size_t verneed_size;
+ size_t verdef_size = 0;
+ size_t verneed_size = 0;
size_t extsym_size;
const struct elf_backend_data *bed;