bug-binutils
[Top][All Lists]
Advanced

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

[Bug gas/25235] Forward-referencing ADR instructions generate wrong offs


From: cvs-commit at gcc dot gnu.org
Subject: [Bug gas/25235] Forward-referencing ADR instructions generate wrong offsets in Thumb code
Date: Tue, 25 May 2021 15:09:38 +0000

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

--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot 
gnu.org> ---
The binutils-2_36-branch branch has been updated by Tamar Christina
<tnfchris@sourceware.org>:

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

commit eaf6d3b360d2d4bd68acaebb80e40d5bb69a734d
Author: Tamar Christina <tamar.christina@arm.com>
Date:   Tue May 25 16:04:04 2021 +0100

    Arm: Fix forward thumb references [PR gas/25235]

    When assembling a forward reference the symbol will be unknown and so
during
    do_t_adr we cannot set the thumb bit.  The bit it set so early to prevent
    relaxations that are invalid. i.e. relaxing a Thumb2 to Thumb1 insn when
the
    symbol is Thumb.

    But because it's done so early we miss the case for forward references.
    This patch changes it so that we additionally check the thumb bit during
the
    internal relocation processing.

    In principle we should be able to only set the bit during reloc processing
but
    that would require changes to the other relocations that the instruction
could
    be relaxed to.

    This approach still allows early relaxations (which means that we have less
    iteration of internal reloc processing) while still fixing the forward
reference
    case.

    gas/ChangeLog:

    2021-05-24  Tamar Christina  <tamar.christina@arm.com>

            PR gas/25235
            * config/tc-arm.c (md_convert_frag): Set LSB when Thumb symbol.
            (relax_adr): Thumb symbols 4 bytes.
            * testsuite/gas/arm/pr25235.d: New test.
            * testsuite/gas/arm/pr25235.s: New test.

    (cherry picked from commit d3e52e120b68bf19552743fbc078e0a759f48cb7)

-- 
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]