This is an archive of the discontinued LLVM Phabricator instance.

[lld][WebAssembly] Don't apply data relocations at static constructor time
ClosedPublic

Authored by sbc100 on Jun 24 2022, 4:32 AM.

Details

Summary

Instead, export __wasm_apply_data_relocs and __wasm_call_ctors
separately.

This is required since user code in a shared library (such as static
constructors) should not be run until relocations have been applied to
all loaded libraries.

See: https://github.com/emscripten-core/emscripten/issues/17295

Diff Detail

Event Timeline

sbc100 created this revision.Jun 24 2022, 4:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2022, 4:32 AM
Herald added subscribers: pmatos, asb, wingo and 4 others. · View Herald Transcript
sbc100 requested review of this revision.Jun 24 2022, 4:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2022, 4:32 AM
tlively accepted this revision.Jun 27 2022, 12:27 PM
tlively added inline comments.
lld/test/wasm/data-segments.ll
164
This revision is now accepted and ready to land.Jun 27 2022, 12:27 PM