This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Add explict TLS symbol flag
ClosedPublic

Authored by sbc100 on Sep 8 2021, 2:50 AM.

Details

Summary

As before we maintain backwards compat with older object files
by also infering the TLS flag based on the name of the segment.

This change is was split out from https://reviews.llvm.org/D108877.

Diff Detail

Event Timeline

sbc100 created this revision.Sep 8 2021, 2:50 AM
sbc100 requested review of this revision.Sep 8 2021, 2:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 8 2021, 2:50 AM
sbc100 updated this revision to Diff 371295.Sep 8 2021, 2:53 AM
  • remove debugging
tlively accepted this revision.Sep 8 2021, 3:07 PM

I have to say that I don't quite understand all the MCStreamer stuff, especially what fixSymbolsInTLSFixups is for, but the code looks good to me. Do we have a plan for when we will be able to remove the name-based implicit TLS?

This revision is now accepted and ready to land.Sep 8 2021, 3:07 PM
sbc100 added a comment.Sep 9 2021, 1:08 AM

I have to say that I don't quite understand all the MCStreamer stuff, especially what fixSymbolsInTLSFixups is for, but the code looks good to me. Do we have a plan for when we will be able to remove the name-based implicit TLS?

No plan as yet. I imagine we can do it fairly safely since I won't think anyone outside of emscripten is using WebAssembly + threads yet and emscripten does not provide any object file compatibility between releases.

sbc100 added a comment.Sep 9 2021, 1:10 AM

I have to say that I don't quite understand all the MCStreamer stuff, especially what fixSymbolsInTLSFixups is for, but the code looks good to me. Do we have a plan for when we will be able to remove the name-based implicit TLS?

I should have mentioned that this code is lifted fairly directly from MCELFStreamer.cpp, at least the pattern:

https://github.com/llvm/llvm-project/blob/9d4896f50e441ea5b9e8ae78ebe328e006cb6b67/llvm/lib/MC/MCELFStreamer.cpp#L395

This revision was landed with ongoing or failed builds.Sep 9 2021, 7:12 AM
This revision was automatically updated to reflect the committed changes.