[PATCH v2 24/28] gnu directives: readelf detects "gnu" as public subsection

Jan Beulich jbeulich@suse.com
Fri May 2 13:54:34 GMT 2025


On 02.05.2025 12:32, Matthieu Longo wrote:
> ---
>  binutils/readelf.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/binutils/readelf.c b/binutils/readelf.c
> index f18f3527387..7aadeaea74a 100644
> --- a/binutils/readelf.c
> +++ b/binutils/readelf.c
> @@ -19645,7 +19645,9 @@ elf_parse_attrs_subsection_v2 (unsigned char *cursor,
>        const char *subsec_name = (const char *) cursor;
>        printf (_(" - Name:	%s\n"), subsec_name);
>        bool public_subsection =
> -	strncmp (subsec_name, public_name, strlen (public_name)) == 0;
> +	strncmp (subsec_name, public_name, strlen (public_name)) == 0
> +	|| (strncmp (subsec_name, "gnu", 3) == 0
> +	    && strncmp (subsec_name + 3, "-testing", 8) != 0);

All of my lack of understanding here aside - how do these two comparisons
fit with the patch title (and the absence of any description)?

Jan


More information about the Binutils mailing list