This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 1/2] x86: Support Intel IBT with IBT property and IBT-enable PLT
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: <binutils at sourceware dot org>
- Cc: <hjl dot tools at gmail dot com>
- Date: Thu, 22 Jun 2017 22:52:49 +0200
- Subject: Re: [PATCH 1/2] x86: Support Intel IBT with IBT property and IBT-enable PLT
- Authentication-results: sourceware.org; auth=none
- Authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=ericsson.com;
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Hi,
clang shows this warning for the code added by this patch. I am not familiar with this
code, but it seems to me like it's not a false positive.
/home/emaisin/src/binutils-gdb/bfd/elf64-x86-64.c:7408:8: error: variable 'htab' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
if (!bfd_set_section_alignment (ebfd, sec, 2))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/emaisin/src/binutils-gdb/bfd/elf64-x86-64.c:7574:9: note: uninitialized use occurs here
sec = htab->elf.sgotplt;
^~~~
/home/emaisin/src/binutils-gdb/bfd/elf64-x86-64.c:7408:4: note: remove the 'if' if its condition is always false
if (!bfd_set_section_alignment (ebfd, sec, 2))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/emaisin/src/binutils-gdb/bfd/elf64-x86-64.c:7351:42: note: initialize the variable 'htab' to silence this warning
struct elf_x86_64_link_hash_table *htab;
^
= NULL
/home/emaisin/src/binutils-gdb/bfd/elf64-x86-64.c:7408:8: error: variable 'dynobj' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
if (!bfd_set_section_alignment (ebfd, sec, 2))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/emaisin/src/binutils-gdb/bfd/elf64-x86-64.c:7575:35: note: uninitialized use occurs here
if (!bfd_set_section_alignment (dynobj, sec, 3))
^~~~~~
/home/emaisin/src/binutils-gdb/bfd/elf64-x86-64.c:7408:4: note: remove the 'if' if its condition is always false
if (!bfd_set_section_alignment (ebfd, sec, 2))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/emaisin/src/binutils-gdb/bfd/elf64-x86-64.c:7348:14: note: initialize the variable 'dynobj' to silence this warning
bfd *dynobj;
^
= NULL
Thanks,
Simon