From: H.J. Lu Date: Thu, 12 Mar 2009 17:13:41 +0000 (+0000) Subject: 2009-03-12 H.J. Lu X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c4fb387b7c34ff560a22e719f4c0ca53242b2409;p=binutils-gdb.git 2009-03-12 H.J. Lu PR ld/9938 * elf32-i386.c (elf_i386_check_tls_transition): Use strncmp to check ___tls_get_addr. * elf64-x86-64.c (elf64_x86_64_check_tls_transition): Use strncmp to check __tls_get_addr. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 3cc217a5dc6..9841e5d6d58 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,12 @@ +2009-03-12 H.J. Lu + + PR ld/9938 + * elf32-i386.c (elf_i386_check_tls_transition): Use strncmp + to check ___tls_get_addr. + + * elf64-x86-64.c (elf64_x86_64_check_tls_transition): Use + strncmp to check __tls_get_addr. + 2009-03-12 Andrew Stubbs * dwarf2.c (read_section): Always check the offset, even when the diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 1cba8967b5f..3c56685f133 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1007,11 +1007,14 @@ elf_i386_check_tls_transition (bfd *abfd, asection *sec, return FALSE; h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + /* Use strncmp to check ___tls_get_addr since ___tls_get_addr + may be versioned. */ return (h != NULL && h->root.root.string != NULL && (ELF32_R_TYPE (rel[1].r_info) == R_386_PC32 || ELF32_R_TYPE (rel[1].r_info) == R_386_PLT32) - && (strcmp (h->root.root.string, "___tls_get_addr") == 0)); + && (strncmp (h->root.root.string, "___tls_get_addr", + 15) == 0)); case R_386_TLS_IE: /* Check transition from IE access model: diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 7e8a0fd980f..58be143f066 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -810,11 +810,14 @@ elf64_x86_64_check_tls_transition (bfd *abfd, asection *sec, return FALSE; h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + /* Use strncmp to check __tls_get_addr since __tls_get_addr + may be versioned. */ return (h != NULL && h->root.root.string != NULL && (ELF64_R_TYPE (rel[1].r_info) == R_X86_64_PC32 || ELF64_R_TYPE (rel[1].r_info) == R_X86_64_PLT32) - && (strcmp (h->root.root.string, "__tls_get_addr") == 0)); + && (strncmp (h->root.root.string, + "__tls_get_addr", 14) == 0)); case R_X86_64_GOTTPOFF: /* Check transition from IE access model: