bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/24365] Crash due to RISC-V relocation


From: wilson at gcc dot gnu.org
Subject: [Bug binutils/24365] Crash due to RISC-V relocation
Date: Wed, 20 Mar 2019 23:15:03 +0000

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

Jim Wilson <wilson at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-03-20
           Assignee|unassigned at sourceware dot org   |wilson at gcc dot 
gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Jim Wilson <wilson at gcc dot gnu.org> ---
I never tried this with a global symbol.  This only works for local symbols.

sym is only set for local symbols.  h is only set for global symbols.  Gas
won't let me create a global section symbol, but bfd appears to have some
support for that, and I can't rule out that other assemblers might do this.  So
we need to support both.  Looks like the right fix is
-         if ((ELF_ST_TYPE (sym->st_info) == STT_SECTION) && rel->r_addend)
+         if (((sym != NULL && (ELF_ST_TYPE (sym->st_info) == STT_SECTION))
+              || (h != NULL && h->type == STT_SECTION))
+             && rel->r_addend)

I had to hack gas to let me create a global section symbol to test that, which
means I can't easily add a testcase to verify this case.

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]