From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1062) id 1BA2B385222F; Mon, 21 Nov 2022 21:49:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1BA2B385222F Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Alan Modra To: bfd-cvs@sourceware.org Subject: [binutils-gdb] PR29807, SIGSEGV when linking fuzzed PE object X-Act-Checkin: binutils-gdb X-Git-Author: Alan Modra X-Git-Refname: refs/heads/master X-Git-Oldrev: e9a20a419b66431766e59dec75265ccdc0bf1046 X-Git-Newrev: 38c917d808fdb570ddb1215ccf8233a10484ba91 Message-Id: <20221121214911.1BA2B385222F@sourceware.org> Date: Mon, 21 Nov 2022 21:49:11 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2022 21:49:11 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D38c917d808fd= b570ddb1215ccf8233a10484ba91 commit 38c917d808fdb570ddb1215ccf8233a10484ba91 Author: Alan Modra Date: Sat Nov 19 08:33:20 2022 +1030 PR29807, SIGSEGV when linking fuzzed PE object =20 PR 29807 * cofflink.c (_bfd_coff_generic_relocate_section): Skip relocs against symbols with a NULL section. Diff: --- bfd/cofflink.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bfd/cofflink.c b/bfd/cofflink.c index a5b936fd7c1..cd117a445c6 100644 --- a/bfd/cofflink.c +++ b/bfd/cofflink.c @@ -2961,8 +2961,10 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd, sec =3D sections[symndx]; =20 /* PR 19623: Relocations against symbols in - the absolute sections should ignored. */ - if (bfd_is_abs_section (sec)) + the absolute sections should ignored. + PR 29807: Also ignore relocs against file symbols or + other such nonsense in fuzzed objects. */ + if (sec =3D=3D NULL || bfd_is_abs_section (sec)) continue; =20 val =3D (sec->output_section->vma