Static ctors in wasm

H. S. Teoh hsteoh at qfbox.info
Fri Feb 16 04:45:15 UTC 2024


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

-- 
Famous last words: I *think* this will work...


More information about the Digitalmars-d mailing list