diff options
| author | James Morris <james.l.morris@oracle.com> | 2012-05-04 12:46:40 +1000 | 
|---|---|---|
| committer | James Morris <james.l.morris@oracle.com> | 2012-05-04 12:46:40 +1000 | 
| commit | 898bfc1d46bd76f8ea2a0fbd239dd2073efe2aa3 (patch) | |
| tree | e6e666085abe674dbf6292555961fe0a0f2e2d2f /arch/x86/boot/tools/build.c | |
| parent | 08162e6a23d476544adfe1164afe9ea8b34ab859 (diff) | |
| parent | 69964ea4c7b68c9399f7977aa5b9aa6539a6a98a (diff) | |
| download | olio-linux-3.10-898bfc1d46bd76f8ea2a0fbd239dd2073efe2aa3.tar.xz olio-linux-3.10-898bfc1d46bd76f8ea2a0fbd239dd2073efe2aa3.zip  | |
Merge tag 'v3.4-rc5' into next
Linux 3.4-rc5
Merge to pull in prerequisite change for Smack:
86812bb0de1a3758dc6c7aa01a763158a7c0638a
Requested by Casey.
Diffstat (limited to 'arch/x86/boot/tools/build.c')
| -rw-r--r-- | arch/x86/boot/tools/build.c | 15 | 
1 files changed, 11 insertions, 4 deletions
diff --git a/arch/x86/boot/tools/build.c b/arch/x86/boot/tools/build.c index ed549767a23..24443a33208 100644 --- a/arch/x86/boot/tools/build.c +++ b/arch/x86/boot/tools/build.c @@ -205,8 +205,13 @@ int main(int argc, char ** argv)  	put_unaligned_le32(file_sz, &buf[pe_header + 0x50]);  #ifdef CONFIG_X86_32 -	/* Address of entry point */ -	put_unaligned_le32(i, &buf[pe_header + 0x28]); +	/* +	 * Address of entry point. +	 * +	 * The EFI stub entry point is +16 bytes from the start of +	 * the .text section. +	 */ +	put_unaligned_le32(i + 16, &buf[pe_header + 0x28]);  	/* .text size */  	put_unaligned_le32(file_sz, &buf[pe_header + 0xb0]); @@ -217,9 +222,11 @@ int main(int argc, char ** argv)  	/*  	 * Address of entry point. startup_32 is at the beginning and  	 * the 64-bit entry point (startup_64) is always 512 bytes -	 * after. +	 * after. The EFI stub entry point is 16 bytes after that, as +	 * the first instruction allows legacy loaders to jump over +	 * the EFI stub initialisation  	 */ -	put_unaligned_le32(i + 512, &buf[pe_header + 0x28]); +	put_unaligned_le32(i + 528, &buf[pe_header + 0x28]);  	/* .text size */  	put_unaligned_le32(file_sz, &buf[pe_header + 0xc0]);  |