std library hooks
Manu
turkeyman at gmail.com
Sat Apr 14 03:56:37 PDT 2012
On 14 April 2012 11:36, Walter Bright <newshound2 at digitalmars.com> wrote:
> On 4/14/2012 1:01 AM, Vladimir Panteleev wrote:
>
>> On Saturday, 14 April 2012 at 02:46:03 UTC, Walter Bright wrote:
>>
>>> all assert(exp) does when it trips is call a function in the library. If
>>> you
>>> provide your own version of that function, the one in the library won't
>>> be
>>> linked in.
>>>
>>
>> This indeed works, but how exactly? In what case does the linker pick one
>> function (which?) and in what case does it complain about duplicate symbol
>> definitions? Do they have to be in different libraries?
>>
>
> The linker works by looking in the library for any unresolved symbols. The
> symbol is not unresolved if you supply your own explicitly in an object
> file explicitly supplied to the linker.
>
> The linker knows nothing about D, C, assembler, or anything but resolving
> symbols.
>
How do you define 'the' linker? Is this also how ld and link.exe works?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120414/8c4e0440/attachment.html>
More information about the Digitalmars-d
mailing list