public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] PR28955 mips gas segfault
@ 2023-05-13 11:19 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-05-13 11:19 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=249d1bad51b568c74ea37e8b3e76c179eb53a733

commit 249d1bad51b568c74ea37e8b3e76c179eb53a733
Author: Alan Modra <amodra@gmail.com>
Date:   Sat May 13 15:44:09 2023 +0930

    PR28955 mips gas segfault
    
    Testing for NULL in pic_need_relax fixes the other call to this
    function in md_estimate_size_before_relax.
    
            PR 28955
            * config/tc-mips.c (mips_frob_file): Move NULL sym test to..
            (pic_need_relax): ..here.

Diff:
---
 gas/config/tc-mips.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 8a970ceada2..55a116ffd90 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -15449,8 +15449,7 @@ mips_frob_file (void)
 	 there isn't supposed to be a matching LO.  Ignore %gots against
 	 constants; we'll report an error for those later.  */
       if (got16_reloc_p (l->fixp->fx_r_type)
-	  && !(l->fixp->fx_addsy
-	       && pic_need_relax (l->fixp->fx_addsy)))
+	  && !pic_need_relax (l->fixp->fx_addsy))
 	continue;
 
       /* Check quickly whether the next fixup happens to be a matching %lo.  */
@@ -17705,6 +17704,9 @@ pic_need_relax (symbolS *sym)
 {
   asection *symsec;
 
+  if (!sym)
+    return false;
+
   /* Handle the case of a symbol equated to another symbol.  */
   while (symbol_equated_reloc_p (sym))
     {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-13 11:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-13 11:19 [binutils-gdb] PR28955 mips gas segfault Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).