aboutsummaryrefslogtreecommitdiff
path: root/libctf/ctf-dedup.c
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2025-01-17 15:03:47 +0000
committerRichard Earnshaw <rearnsha@arm.com>2025-01-20 10:07:15 +0000
commitc3190b22b03ab147a048395546a8abfa7a4c47de (patch)
treee8665d8f704a0f5fc9d8daf6ce7a1715ef9bdc6b /libctf/ctf-dedup.c
parentbf2da5d57d7532855e56538a4a7242c705b1d27d (diff)
downloadbinutils-c3190b22b03ab147a048395546a8abfa7a4c47de.zip
binutils-c3190b22b03ab147a048395546a8abfa7a4c47de.tar.gz
binutils-c3190b22b03ab147a048395546a8abfa7a4c47de.tar.bz2
gas: elf: Relax rules for SHF_STRING sections
Commit af3394d97a8c5187085c0eec5fb03e8da88db5fb allowed sections declared with "S" (SHF_STRING) to specify the entity size, but then would warn if the entity size was omitted, as with the old syntax. Unfortunately, since specifying the entity size is incompatible with binutils 2.43 or earlier, this makes it impossible to specify a strings section in source code without generating an assembly warning (the new syntax isn't supported in older assemblers and the old syntax generates warnings). Nevertheless, the old code was wrong in that it did not set the entity size at all, in contravention of the ELF specification (though to date there are no known cases where this mattered outside of mergeable sections). Fix this by permitting the original syntax without a warning again, but by defaulting the entity size to 1. This is compatible with the most common case of strings being byte-based. Added some tests for the various flavours of declaration that we support.
Diffstat (limited to 'libctf/ctf-dedup.c')
0 files changed, 0 insertions, 0 deletions