[PATCH] TIC6X/GAS: Fix array bounds compilation error
Jan Beulich
jbeulich@suse.com
Thu Aug 7 08:39:57 GMT 2025
On 07.08.2025 00:01, Maciej W. Rozycki wrote:
> Fix a compilation error:
>
> .../gas/config/tc-tic6x.c: In function 'tic6x_start_unwind_section':
> .../gas/config/tc-tic6x.c:4632:17: error: offset '16' outside bounds of constant string [-Werror=array-bounds]
> 4632 | text_name += strlen (".gnu.linkonce.t.");
> | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> observed with GCC 10.
Same as for the IA-64 patch: The compiler clearly isn't using all information
it has available, i.e. ...
> --- binutils-gdb.orig/gas/config/tc-tic6x.c
> +++ binutils-gdb/gas/config/tc-tic6x.c
> @@ -4625,8 +4625,7 @@ tic6x_start_unwind_section (const segT t
> text_name = segment_name (text_seg);
> if (streq (text_name, ".text"))
> text_name = "";
> -
> - if (startswith (text_name, ".gnu.linkonce.t."))
... this fact. If at least the diagnostic said only "may be outside", in saying
so could be acceptable. But the way it is the compiler is simply wrong, and
what is done here ...
> + else if (startswith (text_name, ".gnu.linkonce.t."))
... is merely a workaround. (We've had discussions around in particular issues
like the one here with compiler folks. Views on certain aspects differ, but the
one thing I got back was that the overly strong wording is understood to not be
quite appropriate.)
Jan
More information about the Binutils
mailing list