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.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to