Changeset 1665
- Timestamp:
- 02/17/98 01:45:16 (11 years ago)
- Files:
-
- branches/GNU/src/unexw32.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/GNU/src/unexw32.c
r1651 r1665 100 100 extern void mainCRTStartup (void); 101 101 102 #if 1102 #if 0 103 103 /* Give us a way to debug problems with crashes on startup when 104 104 running under the MSVC profiler. */ … … 500 500 #define ROUND_UP_DST(align) \ 501 501 (dst = p_outfile->file_base + ROUND_UP (DST_TO_OFFSET (), (align))) 502 #define ROUND_UP_DST_AND_ZERO(align) \503 do { \504 unsigned char *newdst = p_outfile->file_base \505 + ROUND_UP (DST_TO_OFFSET (), (align)); \506 /* Zero the alignment slop; it may actually initialize real data. */ \507 memset (dst, 0, newdst - dst); \508 dst = newdst; \509 } while (0)510 502 511 503 /* Copy the source image sequentially, ie. section by section after … … 531 523 nt_header->FileHeader.NumberOfSections * sizeof (*section)); 532 524 533 /* Align the first section's raw data area, and set the header size534 field accordingly. */535 ROUND_UP_DST_AND_ZERO (dst_nt_header->OptionalHeader.FileAlignment);536 dst_nt_header->OptionalHeader.SizeOfHeaders = DST_TO_OFFSET ();537 538 525 for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++) 539 526 { … … 541 528 sprintf (msg, "Copying raw data for %s...", section->Name); 542 529 530 /* Align the section's raw data area. */ 531 ROUND_UP_DST (dst_nt_header->OptionalHeader.FileAlignment); 543 532 dst_save = dst; 544 533 … … 553 542 (msg, OFFSET_TO_PTR (section->PointerToRawData, p_infile), 554 543 section->SizeOfRawData); 555 /* Ensure alignment slop is zeroed. */556 ROUND_UP_DST_AND_ZERO (dst_nt_header->OptionalHeader.FileAlignment);557 544 558 545 /* Note that various sections below may be aliases. */ … … 622 609 } 623 610 624 /* Align the section's raw data area. */625 ROUND_UP_DST (dst_nt_header->OptionalHeader.FileAlignment);626 627 611 section++; 628 612 dst_section++; 629 613 } 614 615 /* Pad out the final section raw data area. */ 616 ROUND_UP_DST (dst_nt_header->OptionalHeader.FileAlignment); 630 617 631 618 /* Copy remainder of source image. */
