mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-29 06:10:09 +08:00
Fix tcc -ar c symbol header size
tcc -ar t failed sometimes because the header size was not correct.
This commit is contained in:
parent
d15dec711d
commit
20a22cf3d6
@ -70,11 +70,11 @@ ST_FUNC int tcc_tool_ar(TCCState *s1, int argc, char **argv)
|
|||||||
{
|
{
|
||||||
static const ArHdr arhdr_init = {
|
static const ArHdr arhdr_init = {
|
||||||
"/ ",
|
"/ ",
|
||||||
" ",
|
"0 ",
|
||||||
"0 ",
|
"0 ",
|
||||||
"0 ",
|
"0 ",
|
||||||
"0 ",
|
"0 ",
|
||||||
" ",
|
"0 ",
|
||||||
ARFMAG
|
ARFMAG
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -308,7 +308,7 @@ finish:
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
goto the_end;
|
goto the_end;
|
||||||
}
|
}
|
||||||
sprintf(stmp, "%-10d", (int)(strpos + (funccnt+1) * sizeof(int)));
|
sprintf(stmp, "%-10d", (int)(strpos + (funccnt+1) * sizeof(int)) + fpos);
|
||||||
memcpy(&arhdr.ar_size, stmp, 10);
|
memcpy(&arhdr.ar_size, stmp, 10);
|
||||||
fwrite(&arhdr, sizeof(arhdr), 1, fh);
|
fwrite(&arhdr, sizeof(arhdr), 1, fh);
|
||||||
afpos[0] = le2belong(funccnt);
|
afpos[0] = le2belong(funccnt);
|
||||||
|
Loading…
Reference in New Issue
Block a user