Date: Thu, 24 Oct 2019 22:34:49 +0000 (UTC) From: Brooks Davis <brooks@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354057 - in head/contrib/binutils: bfd binutils Message-ID: <201910242234.x9OMYn8g026143@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: brooks Date: Thu Oct 24 22:34:48 2019 New Revision: 354057 URL: https://svnweb.freebsd.org/changeset/base/354057 Log: binutils: Fix bugs found by -Wpointer-compare The MIPS bug was introduced by upstream commit 7403cb630, which failed to account for the additional indirection introduced and also dropped one of the checks; change it to the standard "NULL-or-empty" check as used elsewhere in BFD, which is also what upstream now has. Submitted by: James Clarke <jrtc27@jrtc27.com> Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D21911 Modified: head/contrib/binutils/bfd/elfxx-mips.c head/contrib/binutils/binutils/stabs.c Modified: head/contrib/binutils/bfd/elfxx-mips.c ============================================================================== --- head/contrib/binutils/bfd/elfxx-mips.c Thu Oct 24 22:33:46 2019 (r354056) +++ head/contrib/binutils/bfd/elfxx-mips.c Thu Oct 24 22:34:48 2019 (r354057) @@ -3966,7 +3966,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_b *namep = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name); - if (*namep == '\0') + if (*namep == NULL || **namep == '\0') *namep = bfd_section_name (input_bfd, sec); target_is_16_bit_code_p = (sym->st_other == STO_MIPS16); Modified: head/contrib/binutils/binutils/stabs.c ============================================================================== --- head/contrib/binutils/binutils/stabs.c Thu Oct 24 22:33:46 2019 (r354056) +++ head/contrib/binutils/binutils/stabs.c Thu Oct 24 22:34:48 2019 (r354057) @@ -2668,7 +2668,7 @@ parse_stab_members (void *dhandle, struct stab_handle ++*pp; voffset &= 0x7fffffff; - if (**pp == ';' || *pp == '\0') + if (**pp == ';' || **pp == '\0') { /* Must be g++ version 1. */ context = DEBUG_TYPE_NULL;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910242234.x9OMYn8g026143>