tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] TCC and "smart" linking


From: Daniel Glöckner
Subject: Re: [Tinycc-devel] TCC and "smart" linking
Date: Wed, 24 Oct 2012 01:06:15 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Hi,

On Thu, Oct 11, 2012 at 01:14:57PM +0300, Oleg N. Cher wrote:
> Do you know Total Commander by /Christian Ghisler? /It is very
> powerful and widely functional product which is able to many
> possibilities. Its author is not specifically to save the code size,
> but the size of distribution is about 2 megabytes. I believe, if it
> was from Microsoft, it would have occupied 300-500 Mb.

just look at the size of the Sysinternals tools when Sysinternals
was bought by Microsoft. Their tools grew by several hundred
percent mainly because Microsoft thought it would be wise to
display an EULA on first use and to add this EULA in uncompressed
form to the binary.

> Milutin Jovanović wrote:
> >I cannot imagine that marking symbols as referenced to be
> >expensive... If it was as simple as not outputting into target
> >executable symbols that are not marked as used, this would be a
> >truly simple task. And fast, while we're on it. However, the
> >problem arises when linking with libraries, which is already
> >compiled code. When including a symbol from a library, a mechanism
> >needs to be created to determine which symbols this routine
> >references, and then recursively repeat the process.

I think what Oleg wants is implemented in GCC as
-ffunction-sections -fdata-section in combination with ld's
--gc-sections. Every global function and variable is placed in its
own section and the linker drops all sections which can't be
reached starting from the entry point.

  Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]