mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-15 05:20:06 +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 = {
|
||||
"/ ",
|
||||
" ",
|
||||
"0 ",
|
||||
"0 ",
|
||||
"0 ",
|
||||
"0 ",
|
||||
" ",
|
||||
"0 ",
|
||||
ARFMAG
|
||||
};
|
||||
|
||||
@ -308,7 +308,7 @@ finish:
|
||||
ret = 0;
|
||||
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);
|
||||
fwrite(&arhdr, sizeof(arhdr), 1, fh);
|
||||
afpos[0] = le2belong(funccnt);
|
||||
|
Loading…
Reference in New Issue
Block a user