From 10efb593b775f1426395c4521a11c4ec2fe6bc19 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 30 Jun 2006 14:16:13 +0000 Subject: bfd/ 2006-06-30 H.J. Lu * elf32-i386.c (elf_i386_relocate_section): Use xchg %ax,%ax instead of 2 nops. * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. (elf64_x86_64_plt0_entry): Use nopl 0(%rax) instead of 4 nops. ld/testsuite/ 2006-06-30 H.J. Lu * ld-i386/tlsbindesc.dd: Updated to expect xchg %ax,%ax instead of 2 nops. * ld-i386/tlsdesc.dd: Likewise. * ld-i386/tlsgdesc.dd: Likewise. * ld-x86-64/tlsbindesc.dd: Likewise. * ld-x86-64/tlsdesc.dd: Likewise. * ld-x86-64/tlsdesc.pd: Likewise. * ld-x86-64/tlsgdesc.dd: Likewise. --- bfd/elf64-x86-64.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'bfd/elf64-x86-64.c') diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index c72a9947793..b9cf0a33318 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -350,7 +350,7 @@ static const bfd_byte elf64_x86_64_plt0_entry[PLT_ENTRY_SIZE] = { 0xff, 0x35, 8, 0, 0, 0, /* pushq GOT+8(%rip) */ 0xff, 0x25, 16, 0, 0, 0, /* jmpq *GOT+16(%rip) */ - 0x90, 0x90, 0x90, 0x90 /* pad out to 16 bytes with nops. */ + 0x0f, 0x1f, 0x40, 0x00 /* nopl 0(%rax) */ }; /* Subsequent entries in a procedure linkage table look like this. */ @@ -2617,8 +2617,9 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, val = bfd_get_8 (input_bfd, contents + roff + 1); BFD_ASSERT (val == 0x10); - /* Now modify the instruction as appropriate. */ - bfd_put_8 (output_bfd, 0x90, contents + roff); + /* Now modify the instruction as appropriate. Use + xchg %ax,%ax instead of 2 nops. */ + bfd_put_8 (output_bfd, 0x66, contents + roff); bfd_put_8 (output_bfd, 0x90, contents + roff + 1); continue; } @@ -2910,8 +2911,9 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info, val = bfd_get_8 (input_bfd, contents + roff + 1); BFD_ASSERT (val == 0x10); - /* Now modify the instruction as appropriate. */ - bfd_put_8 (output_bfd, 0x90, contents + roff); + /* Now modify the instruction as appropriate. Use + xchg %ax,%ax instead of 2 nops. */ + bfd_put_8 (output_bfd, 0x66, contents + roff); bfd_put_8 (output_bfd, 0x90, contents + roff + 1); continue; -- cgit v1.2.1