[5/5] x86: TLS desc call relocs target zero-size fields

Message ID 51142f19-ebea-8ac4-7e58-7ead8918823d@suse.com
State New
Headers show
Series
  • x86: assorted relocation handling related adjustment (part I)
Related show

Commit Message

Alan Modra via Binutils April 22, 2021, 8:41 a.m.
These are marker relocations, so together with their bit size being zero
their byte size should be zero as well. This is expressed by a value of
3, not 0.

bfd/
2021-04-XX  Jan Beulich  <jbeulich@suse.com>

	* elf32-i386.c (elf_howto_table): R_386_TLS_DESC_CALL has zero
	size field.
	* elf64-x86-64.c (x86_64_elf_howto_table): R_X86_64_TLSDESC_CALL
	has zero size field.

Comments

Alan Modra via Binutils April 22, 2021, 11:53 a.m. | #1
On Thu, Apr 22, 2021 at 1:41 AM Jan Beulich <jbeulich@suse.com> wrote:
>

> These are marker relocations, so together with their bit size being zero

> their byte size should be zero as well. This is expressed by a value of

> 3, not 0.

>

> bfd/

> 2021-04-XX  Jan Beulich  <jbeulich@suse.com>

>

>         * elf32-i386.c (elf_howto_table): R_386_TLS_DESC_CALL has zero

>         size field.

>         * elf64-x86-64.c (x86_64_elf_howto_table): R_X86_64_TLSDESC_CALL

>         has zero size field.

>

> --- a/bfd/elf32-i386.c

> +++ b/bfd/elf32-i386.c

> @@ -130,7 +130,7 @@ static reloc_howto_type elf_howto_table[

>    HOWTO(R_386_TLS_GOTDESC, 0, 2, 32, false, 0, complain_overflow_bitfield,

>         bfd_elf_generic_reloc, "R_386_TLS_GOTDESC",

>         true, 0xffffffff, 0xffffffff, false),

> -  HOWTO(R_386_TLS_DESC_CALL, 0, 0, 0, false, 0, complain_overflow_dont,

> +  HOWTO(R_386_TLS_DESC_CALL, 0, 3, 0, false, 0, complain_overflow_dont,

>         bfd_elf_generic_reloc, "R_386_TLS_DESC_CALL",

>         false, 0, 0, false),

>    HOWTO(R_386_TLS_DESC, 0, 2, 32, false, 0, complain_overflow_bitfield,

> --- a/bfd/elf64-x86-64.c

> +++ b/bfd/elf64-x86-64.c

> @@ -146,7 +146,7 @@ static reloc_howto_type x86_64_elf_howto

>         complain_overflow_bitfield, bfd_elf_generic_reloc,

>         "R_X86_64_GOTPC32_TLSDESC",

>         false, 0xffffffff, 0xffffffff, true),

> -  HOWTO(R_X86_64_TLSDESC_CALL, 0, 0, 0, false, 0,

> +  HOWTO(R_X86_64_TLSDESC_CALL, 0, 3, 0, false, 0,

>         complain_overflow_dont, bfd_elf_generic_reloc,

>         "R_X86_64_TLSDESC_CALL",

>         false, 0, 0, false),

>


OK.

Thanks.

-- 
H.J.

Patch

--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -130,7 +130,7 @@  static reloc_howto_type elf_howto_table[
   HOWTO(R_386_TLS_GOTDESC, 0, 2, 32, false, 0, complain_overflow_bitfield,
 	bfd_elf_generic_reloc, "R_386_TLS_GOTDESC",
 	true, 0xffffffff, 0xffffffff, false),
-  HOWTO(R_386_TLS_DESC_CALL, 0, 0, 0, false, 0, complain_overflow_dont,
+  HOWTO(R_386_TLS_DESC_CALL, 0, 3, 0, false, 0, complain_overflow_dont,
 	bfd_elf_generic_reloc, "R_386_TLS_DESC_CALL",
 	false, 0, 0, false),
   HOWTO(R_386_TLS_DESC, 0, 2, 32, false, 0, complain_overflow_bitfield,
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -146,7 +146,7 @@  static reloc_howto_type x86_64_elf_howto
 	complain_overflow_bitfield, bfd_elf_generic_reloc,
 	"R_X86_64_GOTPC32_TLSDESC",
 	false, 0xffffffff, 0xffffffff, true),
-  HOWTO(R_X86_64_TLSDESC_CALL, 0, 0, 0, false, 0,
+  HOWTO(R_X86_64_TLSDESC_CALL, 0, 3, 0, false, 0,
 	complain_overflow_dont, bfd_elf_generic_reloc,
 	"R_X86_64_TLSDESC_CALL",
 	false, 0, 0, false),