[fpc-devel] A small wish for FPC
Marco van de Voort
marcov at stack.nl
Sat Jul 29 15:01:24 CEST 2006
> i'm sorry my lack of deeper knowledge...but can't strip solve the
> problem?!?!?!?
No. Strip only removes debug code. Linkers can do elimination of unused
symbols (structured constants, procedures and whole VMTs), but there is a
problem if a set of symbols are referenced in a table, and the table is
referenced itself.
Example: there are 1000 resourcestrings, and you only use one of them. Yet
you use them via a table lookup with all thousand in them, so all are linked
in. To remove entries from the table the linker must have a certain knowledge about
table (e.g. when removing entries, adapt the indexes in the table used in
the code)
If I understood Peter right, some support for this kind of stuff is also in
LD, but not for all targets (binary formats) and it is convuluted and hard
to use. With the internal linker it is way easier.
The same goes for elimination of unused VMT entries.
More information about the fpc-devel
mailing list