mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-06 08:58:40 +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;
|
||||
|
||||
seek(f,elfheader.e_shoff);
|
||||
status.codesize:=0;
|
||||
status.datasize:=0;
|
||||
for i:=0 to elfheader.e_shnum-1 do
|
||||
begin
|
||||
blockread(f,secheader,sizeof(secheader));
|
||||
secheader:=MaybeSwapSecHeader(secheader);
|
||||
secname:=ReadSectionName(stringoffset+secheader.sh_name);
|
||||
if secname='.text' then
|
||||
if pos('.text',secname)<>0 then
|
||||
begin
|
||||
Message1(execinfo_x_codesize,tostr(secheader.sh_size));
|
||||
status.codesize:=secheader.sh_size;
|
||||
inc(status.codesize,secheader.sh_size);
|
||||
end
|
||||
else if secname='.data' then
|
||||
else if pos('.data',secname)<>0 then
|
||||
begin
|
||||
Message1(execinfo_x_initdatasize,tostr(secheader.sh_size));
|
||||
inc(status.datasize,secheader.sh_size);
|
||||
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
|
||||
Message1(execinfo_x_uninitdatasize,tostr(secheader.sh_size));
|
||||
inc(status.datasize,secheader.sh_size);
|
||||
end;
|
||||
|
||||
end;
|
||||
close(f);
|
||||
{$pop}
|
||||
|
Loading…
Reference in New Issue
Block a user