[PATCH] x86: Report expected register for elf_x86_tls_error_indirect_call

Jan Beulich jbeulich@suse.com
Thu Aug 29 07:27:11 GMT 2024


On 28.08.2024 14:03, H.J. Lu wrote:
> @@ -3265,8 +3266,9 @@ _bfd_x86_elf_link_report_tls_transition_error
>        info->callbacks->einfo
>  	/* xgettext:c-format */
>  	(_("%pB(%pA+0x%v): relocation %s against `%s' must be used "
> -	   "in indirect CALL only\n"),
> -	 abfd, asect, rel->r_offset, from_reloc_name, name);
> +	   "in indirect CALL with %s register only\n"),
> +	 abfd, asect, rel->r_offset, from_reloc_name, name,
> +	 htab->ax_register);
>        break;

Since CALL is still a requirement, ...

> --- a/ld/testsuite/ld-i386/tlsgdesc2.s
> +++ b/ld/testsuite/ld-i386/tlsgdesc2.s
> @@ -1,8 +1,8 @@
>  	.text
>  	.globl _start
>  _start:
> -	leal	foo@tlsdesc(%ebx), %eax
> -	jmp	*foo@tlscall(%eax)
> +	leal	foo@tlsdesc(%ebx), %ecx
> +	call	*foo@tlscall(%ecx)

... why do you drop the JMP case? Imo you want to add the CALL+%ecx case here
(and then similarly in the 64-bit testcase). Or, if multiple diagnostics can't
be tested in a single testcase fdor some reason, add a new one.

That said, the limiting to just %eax / %rax seems overly restrictive to me.
This way multiple accesses can't be interleaved.

Jan


More information about the Binutils mailing list