This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[COMMITTED PATCH] fix i386-nacl PIC PLT0 padding


The i386-nacl variant's PIC PLT0 entry left its tail end of unreached
padding default-initialized to zero, but it needs to be all nop insns.

Committed as obviously correct.


Thanks,
Roland

2012-03-14  Roland McGrath  <mcgrathr@google.com>

	* elf32-i386.c (elf_i386_nacl_pic_plt0_entry): Initialize up
	to the full size, padding out with nop instructions.

diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 3014a0a..4ae2166 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -5109,7 +5109,10 @@ elf_i386_nacl_pic_plt0_entry[sizeof (elf_i386_nacl_plt0_entry)] =
     0x8b, 0x4b, 0x08,		/* mov 0x8(%ebx), %ecx */
     0x83, 0xe1, 0xe0,		/* and $NACLMASK, %ecx */
     0xff, 0xe1,			/* jmp *%ecx */
-    0x90                        /* nop */
+
+    /* This is expected to be the same size as elf_i386_nacl_plt0_entry,
+       so pad to that size with nop instructions.  */
+    0x90, 0x90, 0x90, 0x90, 0x90, 0x90
   };
 
 static const bfd_byte elf_i386_nacl_pic_plt_entry[NACL_PLT_ENTRY_SIZE] =


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]