Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1612)

Delta Between Two Patch Sets: src/cmd/ld/pe.c

Issue 915041: code review 915041: ld: Add DOS stub to PE binaries (Closed)
Left Patch Set: Created 14 years, 11 months ago
Right Patch Set: code review 915041: ld: Add DOS stub to PE binaries Created 14 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // PE (Portable Executable) file writing 5 // PE (Portable Executable) file writing
6 // http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx 6 // http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx
7 7
8 #include <time.h> 8 #include <time.h>
9 9
10 #include "l.h" 10 #include "l.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 default: 79 default:
80 break; 80 break;
81 } 81 }
82 } 82 }
83 83
84 static void 84 static void
85 pewrite(void) 85 pewrite(void)
86 { 86 {
87 int i, j; 87 int i, j;
88 88
89 » for (i=0; i<sizeof(dosstub); i++) 89 » write(cout, dosstub, sizeof dosstub);
90 » » cput(dosstub[i]);
91 strnput("PE", 4); 90 strnput("PE", 4);
92 91
93 for (i=0; i<sizeof(fh); i++) 92 for (i=0; i<sizeof(fh); i++)
94 cput(((char*)&fh)[i]); 93 cput(((char*)&fh)[i]);
95 for (i=0; i<sizeof(oh); i++) 94 for (i=0; i<sizeof(oh); i++)
96 cput(((char*)&oh)[i]); 95 cput(((char*)&oh)[i]);
97 for (i=0; i<nsect; i++) 96 for (i=0; i<nsect; i++)
98 for (j=0; j<sizeof(sh[i]); j++) 97 for (j=0; j<sizeof(sh[i]); j++)
99 cput(((char*)&sh[i])[j]); 98 cput(((char*)&sh[i])[j]);
100 } 99 }
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 oh.SizeOfHeaders = PERESERVE; 243 oh.SizeOfHeaders = PERESERVE;
245 oh.Subsystem = 3; // WINDOWS_CUI 244 oh.Subsystem = 3; // WINDOWS_CUI
246 oh.SizeOfStackReserve = 0x00200000; 245 oh.SizeOfStackReserve = 0x00200000;
247 oh.SizeOfStackCommit = 0x00001000; 246 oh.SizeOfStackCommit = 0x00001000;
248 oh.SizeOfHeapReserve = 0x00100000; 247 oh.SizeOfHeapReserve = 0x00100000;
249 oh.SizeOfHeapCommit = 0x00001000; 248 oh.SizeOfHeapCommit = 0x00001000;
250 oh.NumberOfRvaAndSizes = 16; 249 oh.NumberOfRvaAndSizes = 16;
251 250
252 pewrite(); 251 pewrite();
253 } 252 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b