Override assert handler
Johan
j at j.nl
Sun Aug 18 20:29:57 UTC 2024
On Sunday, 18 August 2024 at 17:22:44 UTC, Richard (Rikki) Andrew
Cattermole wrote:
> On 18/08/2024 1:53 PM, Walter Bright wrote:
>> Allow me to explain how a library works.
>>
>> The linker resolves all the symbols in the object files given
>> to it. When there are references to symbols, but no symbols,
>> then (and only then) does the linker consult the library. The
>> linker will pull in modules from the library that export those
>> missing symbols.
>>
>> Therefore, the easiest way to override a function that's in
>> the library is to write your own and put it in the list of
>> object files for the linker to incorporate.
>
> This needs some context.
>
> It only applies to object files and executables, the moment
> shared libraries enter the picture (such as druntime) this no
> longer is the full story.
And there is of course inlining that needs to be disabled for an
"overridable" function. @weak does that too.
-Johan
More information about the Digitalmars-d
mailing list