DMD 0.153 release

Jari-Matti Mäkelä jmjmak at utu.fi.invalid
Wed Apr 12 00:56:04 PDT 2006


Walter Bright wrote:
> Derek Parnell wrote:
>> On Tue, 11 Apr 2006 11:43:28 +1000, Derek Parnell wrote:
>>> On Mon, 10 Apr 2006 18:25:49 -0700, Walter Bright wrote:
>>>> Naw. "smart linking" is a marketing term that appeared in the 1980's
>>>> that refers to the linker discarding unreferenced code sections.
>>>> Since it's a bit of jargon, I italicized it. Optlink has been doing
>>>> it for 15+ years, ld only recently.
>>> Is a 'code section' equivalent to a D module? In other words, if I have
>>> three D modules, each one is in its own unique code section. And thus if
>>> I'm not referencing anything in one of those modules and I include the
>>> module.obj in the command line, the linker will discard that module from
>>> the resulting executable file?
>>>
>>> Or is 'code section' more finely grained than that, say down to the
>>> function level?
>>
>> Never mind, I just did a test and it seems to be at the function level.
>> That is, optlink discards functions that are not referenced even if other
>> functions in the same module are referenced.
> 
> Each module is made up of multiple sections. Smart linking relies on the
> compiler emitting a separate section for each function. You can see this
> by running obj2asm on it.

This is really impressive - the resulting Linux binaries now seem to be
several hundreds of kilobytes smaller! A big thanks.

-- 
Jari-Matti



More information about the Digitalmars-d-announce mailing list