mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 00:29:24 +02:00
* better code and data size info for FreeRTOS
This commit is contained in:
parent
56ab410705
commit
feb5bde09c
@ -1452,28 +1452,33 @@ function TlinkerFreeRTOS.postprocessexecutable(const fn : string;isdll:boolean):
|
|||||||
stringoffset:=secheader.sh_offset;
|
stringoffset:=secheader.sh_offset;
|
||||||
|
|
||||||
seek(f,elfheader.e_shoff);
|
seek(f,elfheader.e_shoff);
|
||||||
|
status.codesize:=0;
|
||||||
status.datasize:=0;
|
status.datasize:=0;
|
||||||
for i:=0 to elfheader.e_shnum-1 do
|
for i:=0 to elfheader.e_shnum-1 do
|
||||||
begin
|
begin
|
||||||
blockread(f,secheader,sizeof(secheader));
|
blockread(f,secheader,sizeof(secheader));
|
||||||
secheader:=MaybeSwapSecHeader(secheader);
|
secheader:=MaybeSwapSecHeader(secheader);
|
||||||
secname:=ReadSectionName(stringoffset+secheader.sh_name);
|
secname:=ReadSectionName(stringoffset+secheader.sh_name);
|
||||||
if secname='.text' then
|
if pos('.text',secname)<>0 then
|
||||||
begin
|
begin
|
||||||
Message1(execinfo_x_codesize,tostr(secheader.sh_size));
|
Message1(execinfo_x_codesize,tostr(secheader.sh_size));
|
||||||
status.codesize:=secheader.sh_size;
|
inc(status.codesize,secheader.sh_size);
|
||||||
end
|
end
|
||||||
else if secname='.data' then
|
else if pos('.data',secname)<>0 then
|
||||||
begin
|
begin
|
||||||
Message1(execinfo_x_initdatasize,tostr(secheader.sh_size));
|
Message1(execinfo_x_initdatasize,tostr(secheader.sh_size));
|
||||||
inc(status.datasize,secheader.sh_size);
|
inc(status.datasize,secheader.sh_size);
|
||||||
end
|
end
|
||||||
else if secname='.bss' then
|
else if pos('.rodata',secname)<>0 then
|
||||||
|
begin
|
||||||
|
Message1(execinfo_x_initdatasize,tostr(secheader.sh_size));
|
||||||
|
inc(status.datasize,secheader.sh_size);
|
||||||
|
end
|
||||||
|
else if pos('.bss',secname)<>0 then
|
||||||
begin
|
begin
|
||||||
Message1(execinfo_x_uninitdatasize,tostr(secheader.sh_size));
|
Message1(execinfo_x_uninitdatasize,tostr(secheader.sh_size));
|
||||||
inc(status.datasize,secheader.sh_size);
|
inc(status.datasize,secheader.sh_size);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
close(f);
|
close(f);
|
||||||
{$pop}
|
{$pop}
|
||||||
|
Loading…
Reference in New Issue
Block a user