From 70b39fd13f380ff0a238ca2984c3f4f270be1080 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 19 Oct 2011 23:02:47 +0000 Subject: * elf32-i386.c (i386_opcode16): Delete. (elf_i386_check_tls_transition): Use memcmp to compare contents. * elf64-x86-64.c (x86_64_opcode16, x86_64_opcode32): Delete. (elf_x86_64_check_tls_transition): Use memcmp to compare contents. --- bfd/elf32-i386.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'bfd/elf32-i386.c') diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 74343560fd..7ef1fc1ec5 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1094,13 +1094,6 @@ elf_i386_copy_indirect_symbol (struct bfd_link_info *info, _bfd_elf_link_hash_copy_indirect (info, dir, ind); } -typedef union - { - unsigned char c[2]; - uint16_t i; - } -i386_opcode16; - /* Return TRUE if the TLS access code sequence support transition from R_TYPE. */ @@ -1271,8 +1264,8 @@ elf_i386_check_tls_transition (bfd *abfd, asection *sec, if (offset + 2 <= sec->size) { /* Make sure that it's a call *x@tlsdesc(%rax). */ - static i386_opcode16 call = { { 0xff, 0x10 } }; - return bfd_get_16 (abfd, contents + offset) == call.i; + static const unsigned char call[] = { 0xff, 0x10 }; + return memcmp (contents + offset, call, 2) == 0; } return FALSE; -- cgit v1.2.1