|link-optimization in C email@example.com (S. Bochkarev) (1999-05-21)|
|Re: link-optimization in C firstname.lastname@example.org (Christopher Brian Colohan) (1999-05-22)|
|Re: link-optimization in C email@example.com (1999-05-22)|
|Re: link-optimization in C firstname.lastname@example.org (Jan Gray) (1999-05-22)|
|Re: link-optimization in C email@example.com (Bill A.) (1999-05-27)|
|Re: link-optimization in C firstname.lastname@example.org (Jeffrey A Law) (1999-05-27)|
|Re: link-optimization in C email@example.com (Bill Fahle) (1999-06-27)|
|From:||firstname.lastname@example.org (Ben Combee)|
|Date:||22 May 1999 02:57:15 -0400|
> [I've seen linkers that garbage collect unused procedures, but not on
> Windows systems. I suppose a compiler could put the code for each routine
> into a separate COFF section, then the linker could try to figure out what
> references what, but it'd be a mess. There is a provision for deleting
> duplicate expanded templates and the like, but that depends on all of the
> duplicates having an identical mangled name and deleting all but one
> of the identically named sections. -John]
Actually, CodeWarrior for Win32 (by default) and MS Visual C++ (when
used with the /Gy switch) both perform this procedure you mention --
we put each procedure in its own section, and the respective linkers
dead-strip out unused functions in the final executable.
In the CodeWarrior linker, we use a sweep-mark algorithm from all the
entry point and all the exported symbols to mark used section
contributions. We then allocate the sections to the final link,
ignoring those contributions that were missed by the sweep pass.
Without something like this, using template instantiations would incur
a huge final program size cost.
Ben Combee <email@example.com> -- x86/Win32/NetWare CompilerWarrior
Return to the
Search the comp.compilers archives again.