This is an archive of the discontinued LLVM Phabricator instance.

[lld][WebAssembly] Keep data in `foo` segments alive if `__start_foo` is referenced
Needs ReviewPublic

Authored by sbc100 on Sep 14 2022, 11:54 AM.

Details

Reviewers
dschuff
Summary

In emscripten we use named segments and export __start/__stop symbols
to extract data after the linker has run. In some cases that data is
not otherwise alive. For example:

https://github.com/emscripten-core/emscripten/pull/17854

The ELF linker already does this but is currently behind the `-z
nostart-stop-gc` flag. We could do that here to, but I'm not sure its
necessary.

Diff Detail

Event Timeline

sbc100 created this revision.Sep 14 2022, 11:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 14 2022, 11:54 AM
Herald added subscribers: pmatos, asb, wingo and 4 others. · View Herald Transcript
sbc100 requested review of this revision.Sep 14 2022, 11:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 14 2022, 11:54 AM

Still need to write a test for this..