cat > xxx.s <<EOF
gas/as-new -o xxx.o xxx.s
binutils/objdump -d xxx.o
The abort is this one:
if ((size_t) res >= sizeof (staging_area))
Doubling the buffer size fixes this particular test case.
The master branch has been updated by H.J. Lu <email@example.com>:
Author: H.J. Lu <firstname.lastname@example.org>
Date: Tue Aug 16 08:25:49 2022 -0700
i386: Add MAX_OPERAND_BUFFER_SIZE
When displaying operands, invalid opcodes may overflow operand buffer
due to additional styling characters. Each style is encoded with 3
bytes. Define MAX_OPERAND_BUFFER_SIZE for operand buffer size and
increase it from 100 bytes to 128 bytes to accommodate 9 sets of styles
in an operand.
* testsuite/gas/i386/i386.exp: Run pr29483.
* testsuite/gas/i386/pr29483.d: New file.
* testsuite/gas/i386/pr29483.s: Likewise.
* i386-dis.c (MAX_OPERAND_BUFFER_SIZE): New.
(obuf): Replace 100 with MAX_OPERAND_BUFFER_SIZE.
Fixed for 2.40.
The master branch has been updated by Jan Beulich <email@example.com>:
Author: Jan Beulich <firstname.lastname@example.org>
Date: Mon Sep 12 08:19:55 2022 +0200
x86: avoid i386_dis_printf()'s staging area for a fair part of output
While PR binutils/29483 has now been addressed differently, this
originally proposed change still has its merits: Avoiding vsnprintf()
for typically far more than half of the overall output results in a 2-3%
performance gain in my testing (with debug builds of objdump, libbfd,
With that part of output no longer using staging_area, the array also
doesn't need to be quite as large anymore (the largest presently used
size is 27, from "64-bit address is disabled").
While limiting the scope of "res" it became apparent that
- no caller cares about the function's return value,
- the comment about the return value was wrong,
- a particular positive return value would have been meaningless to the
Therefore convert the function to return "void" at the same time.