WebAssembly / tool-conventions

Conventions supporting interoperatibility between tools working with WebAssembly.
Artistic License 2.0
306 stars 66 forks source link

Add documentation on COMDATs, add COMDAT sections #157

Closed dschuff closed 3 years ago

dschuff commented 3 years ago

@sbc100 questions here: I assume a live reference to any of the elements in the group prevents all of the elements from being GCed? (Across all objects? e.g. a live function from one object will keep a section from another object?) Is there any interesting thing to document about naming, e.g. data segment names?

sbc100 commented 3 years ago

Its not so much that the comdat element are either all live all all not live, its more that the entire group always comes from the same object file IIUC. i.e. a a given object ends up being the defining object for a given group, all elements on that comdat in other object are ignored. But some elements within the comdat group could still be exlucded if they are not needed. I think of it more a weak group... once one object defines a given group no other object gets a look in. But I could be wrong in my thinking..

dschuff commented 3 years ago

Updated the sentence. Does that look right?

dschuff commented 3 years ago

The new section is pretty short now; is it worth keeping or should it just be folded somewhere else?