This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/2] x86: Support Intel IBT with IBT property and IBT-enable PLT


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]