]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
x86: Fix comment typos in TLS relocation check
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 31 Aug 2024 11:56:48 +0000 (04:56 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 31 Aug 2024 12:07:19 +0000 (05:07 -0700)
R_386_TLS_IE is used only in

movl foo@indntpoff, %eax
movl foo@indntpoff, %reg
addl foo@indntpoff, %reg

R_386_TLS_DESC_CALL and R_X86_64_TLSDESC_CALL are used only in

call *x@tlscall(%[er]ax)

* elf32-i386.c (elf_i386_check_tls_transition): Use foo@indntpoff
in comments for R_386_TLS_IE check.
(elf_i386_tls_transition): Use @tlscall in comments for
R_386_TLS_DESC_CALL check.
* elf64-x86-64.c (elf_x86_64_tls_transition): Use @tlscall in
comments for R_X86_64_TLSDESC_CALL check.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
bfd/elf32-i386.c
bfd/elf64-x86-64.c

index b1d997b86f0db7de656ffda076bda3002caba2a2..f27c0621a9317b32524e1b197318578d42e36e53 100644 (file)
@@ -975,15 +975,15 @@ elf_i386_check_tls_transition (asection *sec,
 
     case R_386_TLS_IE:
       /* Check transition from IE access model:
-               movl foo@indntpoff(%rip), %eax
-               movl foo@indntpoff(%rip), %reg
-               addl foo@indntpoff(%rip), %reg
+               movl foo@indntpoff, %eax
+               movl foo@indntpoff, %reg
+               addl foo@indntpoff, %reg
        */
 
       if (offset < 1 || (offset + 4) > sec->size)
        return elf_x86_tls_error_yes;
 
-      /* Check "movl foo@tpoff(%rip), %eax" first.  */
+      /* Check "movl foo@indntpoff, %eax" first.  */
       val = bfd_get_8 (abfd, contents + offset - 1);
       if (val == 0xa1)
        return elf_x86_tls_error_none;
@@ -991,7 +991,7 @@ elf_i386_check_tls_transition (asection *sec,
       if (offset < 2)
        return elf_x86_tls_error_yes;
 
-      /* Check movl|addl foo@tpoff(%rip), %reg.   */
+      /* Check movl|addl foo@indntpoff, %reg.   */
       type = bfd_get_8 (abfd, contents + offset - 2);
       if (type != 0x8b && type != 0x03)
        return elf_x86_tls_error_add_mov;
@@ -1091,13 +1091,13 @@ elf_i386_tls_transition (struct bfd_link_info *info, bfd *abfd,
     {
     case R_386_TLS_DESC_CALL:
       /* Check valid GDesc call:
-               call *x@tlsdesc(%eax)
+               call *x@tlscall(%eax)
        */
       offset = rel->r_offset;
       call = NULL;
       if (offset + 2 <= sec->size)
        {
-         /* Make sure that it's a call *x@tlsdesc(%eax).  */
+         /* Make sure that it's a call *x@tlscall(%eax).  */
          call = contents + offset;
          if (call[0] != 0xff || call[1] != 0x10)
            call = NULL;
index cef5cbb27fbb14a4921ab4afb5189ba6b6ec20e0..4330bbd164846cef117e81dcaf1194ea8a039159 100644 (file)
@@ -1448,8 +1448,8 @@ elf_x86_64_tls_transition (struct bfd_link_info *info, bfd *abfd,
     {
     case R_X86_64_TLSDESC_CALL:
       /* Check valid GDesc call:
-               call *x@tlsdesc(%rax) <--- LP64 mode.
-               call *x@tlsdesc(%eax) <--- X32 mode.
+               call *x@tlscall(%rax) <--- LP64 mode.
+               call *x@tlscall(%eax) <--- X32 mode.
        */
       offset = rel->r_offset;
       call = NULL;
@@ -1460,7 +1460,7 @@ elf_x86_64_tls_transition (struct bfd_link_info *info, bfd *abfd,
          prefix = 0;
          if (!ABI_64_P (abfd))
            {
-             /* Check for call *x@tlsdesc(%eax).  */
+             /* Check for call *x@tlscall(%eax).  */
              if (call[0] == 0x67)
                {
                  prefix = 1;
@@ -1469,7 +1469,7 @@ elf_x86_64_tls_transition (struct bfd_link_info *info, bfd *abfd,
                }
            }
 
-         /* Make sure that it's a call *x@tlsdesc(%rax).  */
+         /* Make sure that it's a call *x@tlscall(%rax).  */
          if (call != NULL
              && (call[prefix] != 0xff || call[1 + prefix] != 0x10))
            call = NULL;
@@ -3842,7 +3842,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
                  unsigned int prefix = 0;
                  if (!ABI_64_P (input_bfd))
                    {
-                     /* Check for call *x@tlsdesc(%eax).  */
+                     /* Check for call *x@tlscall(%eax).  */
                      if (contents[roff] == 0x67)
                        prefix = 1;
                    }
@@ -4302,7 +4302,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
                  unsigned int prefix = 0;
                  if (!ABI_64_P (input_bfd))
                    {
-                     /* Check for call *x@tlsdesc(%eax).  */
+                     /* Check for call *x@tlscall(%eax).  */
                      if (contents[roff] == 0x67)
                        prefix = 1;
                    }