https://sourceware.org/bugzilla/show_bug.cgi?id=17141

            Bug ID: 17141
           Summary: Incorrect result check of _bfd_elf_strtab_add() in
                    bfd/elf.c
           Product: binutils
           Version: 2.25 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: maksqwe1 at ukr dot net

bfd/elf.c 5255

  elf_tdata (abfd)->symtab_hdr.sh_name =
    (unsigned int) _bfd_elf_strtab_add (shstrtab, ".symtab", FALSE);
  elf_tdata (abfd)->strtab_hdr.sh_name =
    (unsigned int) _bfd_elf_strtab_add (shstrtab, ".strtab", FALSE);
  elf_tdata (abfd)->shstrtab_hdr.sh_name =
    (unsigned int) _bfd_elf_strtab_add (shstrtab, ".shstrtab", FALSE);

  if (elf_tdata (abfd)->symtab_hdr.sh_name == (unsigned int) -1 // <===
   || elf_tdata (abfd)->symtab_hdr.sh_name == (unsigned int) -1 // <===
   || elf_tdata (abfd)->shstrtab_hdr.sh_name == (unsigned int) -1)
    return FALSE;

Copy/paste typo. Should be:
  if (elf_tdata (abfd)->symtab_hdr.sh_name == (unsigned int) -1
   || elf_tdata (abfd)->strtab_hdr.sh_name == (unsigned int) -1
   || elf_tdata (abfd)->shstrtab_hdr.sh_name == (unsigned int) -1)
    return FALSE;

-- 
You are receiving this mail because:
You are on the CC list for the bug.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to