[fpc-pascal] Re: -Xg flag and lineinfo/lnfodwrf support

Fabio Dell'Aria fabio.dellaria at gmail.com
Mon Jan 21 09:31:51 CET 2008


Hi Peter,

2008/1/20, Peter Vreman <peter at freepascal.org>:
> > Ok Peter,
> > I'm waiting for your news.
>
> Finished, see r9813

I think to have found a best method to implement -Xg flag on Linux:

To explain my method I need compare your currently method with my new.

To do this I use an example:

We have a compiled file with debug info (ex: using -gl flag) of 10Mb (about
8Mb are Debug).

Currently you use:

objcopy --only-keep-debug $EXE $DBG     (read from disk 10Mb from $EXE and
write 8Mb for create $DBG)
objcopy --add-gnu-debuglink=$DBG $EXE     (read from disk 10Mb from $EXE and
8Mb from $DBG, for calculate CRC32, and wrote 10Mb of modifyed $EXE)
strip --strip-unneeded $EXE     (read from disk $10Mb from $EXE and write to
disk 2Mb of modified $EXE)

TOTAL:
Read from disk: 10+10+8+10 = 38 Mb
Write to disk : 8+10+2 = 20 Mb

--

My new method is:

mv $EXE $DBG     (read 0, write 0)
strip --strip-unneeded $DBG -o $EXE     (read from disk 10Mb from $DBG and
write 2Mb to create stripped $EXE)
objcopy --only-keep-debug $DBG $DBG     (read from disk 10Mb from $DBG and
write 8Mb of stripped $DBG)
objcopy --add-gnu-debuglink=$DBG $EXE     (read from disk 2Mb from $EXE and
8Mb from $DBG, for calculate CRC32, and wrote 2Mb of modifyed $EXE)

TOTAL:
Read from disk: 10+10+2+8 = 30 Mb
Write to disk : 2+8+2 = 12 Mb


As you can see using my new method is possible reduce the read access of
about 20% and the write access of about the 40% (the great improvement).


What do you think about? ;)

-- 
Best regards...

Fabio Dell'Aria.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20080121/676dfd68/attachment.html>


More information about the fpc-pascal mailing list