summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2006-06-30 14:16:13 +0000
committerH.J. Lu <hjl@lucon.org>2006-06-30 14:16:13 +0000
commitd1504b9febfad50f87c02033259cd63b8818c84d (patch)
tree69db87d3a3817970b6b2438f4a1beb4a40a44f45
parenta8da6005e780436f6552334408cf094b7c6f4156 (diff)
downloadgdb-d1504b9febfad50f87c02033259cd63b8818c84d.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.
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf32-i386.c9
-rw-r--r--bfd/elf64-x86-64.c12
3 files changed, 19 insertions, 9 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 0367406379d..760e5d4a8b3 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
2006-06-29 Jakub Jelinek <jakub@redhat.com>
PR ld/2513
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index bb2ee1533f3..35b0525f296 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -2821,8 +2821,9 @@ elf_i386_relocate_section (bfd *output_bfd,
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;
}
@@ -3227,8 +3228,8 @@ elf_i386_relocate_section (bfd *output_bfd,
/* Now modify the instruction as appropriate. */
if (tls_type != GOT_TLS_IE_NEG)
{
- /* nop; nop */
- bfd_put_8 (output_bfd, 0x90, contents + roff);
+ /* xchg %ax,%ax */
+ bfd_put_8 (output_bfd, 0x66, contents + roff);
bfd_put_8 (output_bfd, 0x90, contents + roff + 1);
}
else
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;