Static ctors in wasm
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Fri Feb 16 05:02:46 UTC 2024
On 16/02/2024 5:45 PM, H. S. Teoh wrote:
> On Fri, Feb 16, 2024 at 03:08:06PM +1300, Richard (Rikki) Andrew Cattermole via Digitalmars-d wrote:
>> On 16/02/2024 2:57 PM, H. S. Teoh wrote:
>>> On Fri, Feb 16, 2024 at 02:28:25PM +1300, Richard (Rikki) Andrew Cattermole via Digitalmars-d wrote:
>>>> Start back at the basics, look at the object file dump, is
>>>> ModuleInfo being generated?
>>>
>>> It's missing from the object file.
>>>
>>>
>>>> If not, have you copied ModuleInfo over?
>>>
>>> Does it need to be defined in object.d?
> [...]
>> Yes.
>>
>> https://github.com/dlang/dmd/blob/a952831fdb2877199c8eda07292757a0c5c29a1a/compiler/src/dmd/dmsc.d#L82
>
> Figures! I was under the wrong impression that I only need to define it
> for code that actually needs to traverse it. Thanks for the tip!!
>
> I copy-n-pasted ModuleInfo from the real (non-wasm) object.d, and now
> I'm finally getting an address for __start___minfo. However,
> __end___minfo for some reason still shows up as 0x0? I must be missing
> something else?
>
>
> T
Great!
Unfortunately I don't know how the lists created by the linker work.
But I do know that they are linker specific.
More information about the Digitalmars-d
mailing list