]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
x86: constrain and fix use of the "nojumps" .arch modifier
authorJan Beulich <jbeulich@suse.com>
Mon, 8 Sep 2025 09:11:51 +0000 (11:11 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 8 Sep 2025 09:11:51 +0000 (11:11 +0200)
commit5d0ac9ee8fd007e90ba3fef3b95fd756cc191401
tree5b9a93db059bec77dba68c720592286a02ad88e6
parent149e0b44f3d1d4b6a55e63bb4631ed7b66861ed0
x86: constrain and fix use of the "nojumps" .arch modifier

As said by the paragraph of the description that isn't modified here (a
few lines up), this was only ever supposed to be used with 16-bit
architectures. Actually enforcing this allows code in
md_estimate_size_before_relax() to move to a less frequently used code
path. (For backwards compatibility, keep accepting "jumps" also with 32-
or 64-bit architectures.)

Repeat the constraint also in the 2nd paragraph of the doc on this
subject. And while there also insert a missing insn in the related
i386-Jumps section.

Furthermore checking a global variable during late processing is wrong. We
need to record the state in the fragment, and use that rather than the
state of the variable at the end of parsing all input.

Seeing that there's no testing of the functionality at all, add a testcase
as well.
gas/config/tc-i386.c
gas/config/tc-i386.h
gas/doc/c-i386.texi
gas/testsuite/gas/i386/i386.exp
gas/testsuite/gas/i386/nojumps.d [new file with mode: 0644]
gas/testsuite/gas/i386/nojumps.e [new file with mode: 0644]
gas/testsuite/gas/i386/nojumps.s [new file with mode: 0644]