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

--- Comment #2 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Alan Modra <[email protected]>:

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

commit 646982f4295bf0a1e64867606d496c34c9a15a0c
Author: Alan Modra <[email protected]>
Date:   Sat Feb 21 10:56:57 2026 +1030

    PR 33917 Internal error in S_SET_SEGMENT

    Commit d4d05d13eba6 attempted to fix a similar error to that uncovered
    by the testcase in pr33917, but did so in a way that was wrong.
    Modifying an undefined_section symbol that is an equate breaks prior
    use of that symbol, as shown in the rewrite of the
    section-symbol-redef test.

    Another oddity found when poking at pr33917 is that gas allows
     x=0
     .sect x
     x=u
    while
     .sect x
     x=u
    fails with "Error: symbol `x' is already defined".

    Fix all of this by rewriting section_symbol to properly check for the
    only case where we want to redefine an existing symbol, a truly
    undefined symbol, and always use section_symbol in obj-elf rather than
    trying to handle undefined symbols there too.

            PR 33917
            * config/obj-elf.c (change_section): Always call section_symbol
            to set up sym.
            * subsegs.c (section_symbol): Rewrite.
            * testsuite/gas/elf/section-symbol-redef.d
            * testsuite/gas/elf/section-symbol-redef.s: Rewrite.
            * testsuite/gas/elf/section-symbol-redef-2.d,
            * testsuite/gas/elf/section-symbol-redef-2.s: New test.
            * testsuite/gas/elf/elf.exp: Run new test.

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

Reply via email to