Is the issue just that the data segment needs to have a bunch of zeros ...
14 years, 8 months ago
(2010-10-20 01:22:37 UTC)
#3
Is the issue just that the data segment needs to
have a bunch of zeros on the end so that the file
is big enough? datblk is just going to write extra
zeros.
Russ
> Is the issue just that the data segment needs to > have a bunch ...
14 years, 8 months ago
(2010-10-20 01:28:01 UTC)
#4
> Is the issue just that the data segment needs to
> have a bunch of zeros on the end so that the file
> is big enough?
Yes, that is the rule. But we have another section after ".data", it is for
linker to find and load all required dlls, the section has to be aligned on
INITRND.
> ... datblk is just going to write extra
> zeros.
That is OK.
> Yes, that is the rule. But we have another section after ".data", it is ...
14 years, 8 months ago
(2010-10-20 01:33:58 UTC)
#5
> Yes, that is the rule. But we have another section after ".data", it is
> for linker to find and load all required dlls, the section has to be
> aligned on INITRND.
I see. Maybe what writes that section could seek to
the right place instead of changing the datblk call?
Russ
http://codereview.appspot.com/2595041/diff/10001/src/cmd/ld/pe.c File src/cmd/ld/pe.c (right): http://codereview.appspot.com/2595041/diff/10001/src/cmd/ld/pe.c#newcode209 src/cmd/ld/pe.c:209: strnput("", rnd(eof, INITRND) - eof); > please put the ...
14 years, 8 months ago
(2010-10-20 02:49:17 UTC)
#9
http://codereview.appspot.com/2595041/diff/10001/src/cmd/ld/pe.c
File src/cmd/ld/pe.c (right):
http://codereview.appspot.com/2595041/diff/10001/src/cmd/ld/pe.c#newcode209
src/cmd/ld/pe.c:209: strnput("", rnd(eof, INITRND) - eof);
> please put the variable declaration (vlong eof;) at top of function, followed
by
> a blank line.
Done.
> but you probably don't need the strnput or eof. instead:
>
> // seek to INITRND-aligned boundary at or past end of file.
> seek(cout, rnd(seek(cout, 0, 2), INITRND), 0);
>
Tried that before, but I have another seek(cout, 0, 2) in add_import_table that
erase any effect of this seek, so my end of file doesn't get adjusted. Or if we
decide to drop add_import_table altogether. I don't want my program to be
dependent on what happens somewhere else.
Issue 2595041: code review 2595041: 8l: fix windows build
(Closed)
Created 14 years, 8 months ago by brainman
Modified 14 years, 8 months ago
Reviewers:
Base URL:
Comments: 2