summaryrefslogtreecommitdiff
path: root/bfd/elf64-x86-64.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2006-06-30 14:16:13 +0000
committerH.J. Lu <hjl.tools@gmail.com>2006-06-30 14:16:13 +0000
commit10efb593b775f1426395c4521a11c4ec2fe6bc19 (patch)
tree3c5f51d8afcfb9971ecf887285fcffa974c1289b /bfd/elf64-x86-64.c
parent53b8873bef9753edf97fa8ef2bcabefd566bcd48 (diff)
downloadbinutils-gdb-10efb593b775f1426395c4521a11c4ec2fe6bc19.tar.gz
bfd/
2006-06-30 H.J. Lu <hongjiu.lu@intel.com> * 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 <hongjiu.lu@intel.com> * 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.
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r--bfd/elf64-x86-64.c12
1 files changed, 7 insertions, 5 deletions
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;