This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Experimental ELF writer support
ClosedPublic

Authored by sunfish on Dec 15 2015, 7:02 PM.

Details

Summary

This creates the initial infrastructure for writing ELF output files. It doesn't yet have any implementation for encoding instructions.

Diff Detail

Repository
rL LLVM

Event Timeline

sunfish updated this revision to Diff 42956.Dec 15 2015, 7:02 PM
sunfish retitled this revision from to [WebAssembly] Experimental ELF writer support.
sunfish updated this object.
sunfish set the repository for this revision to rL LLVM.
sunfish added subscribers: llvm-commits, jfb, dschuff.
jfb added a comment.Dec 16 2015, 4:07 PM

A few minor comments, looks good overall since it'll allow us to try out ELF linking (instead of the hackier bitcode linking).

lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp
51 ↗(On Diff #42956)

Do like the other architectures, and return WebAssembly::Fixups::NumTargetFixupKinds from WebAssemblyFixupKinds.h? e.g. AMDGPU has fixup_si_rodata.

lib/Target/WebAssembly/MCTargetDesc/WebAssemblyELFObjectWriter.cpp
36 ↗(On Diff #42956)

Looks like generic-abi@googlegroups.com is the place to contact. Maybe leave it in the FIXME, and we'll email when we have a better idea of what we're going for?

lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp
42 ↗(On Diff #42956)

override

44 ↗(On Diff #42956)

New style drops the function prefix in the comment? (here and below)

50 ↗(On Diff #42956)

Typo "machine"

sunfish updated this revision to Diff 43086.Dec 16 2015, 4:33 PM

Address review comments; minor cleanups.

sunfish marked 5 inline comments as done.Dec 16 2015, 4:35 PM
sunfish added inline comments.
lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp
52 ↗(On Diff #43086)

We don't actually currently have any of our own fixups, as we can currently use the generic ones in MCFixup.h. I changed this to 0 and added a comment.

jfb accepted this revision.Dec 16 2015, 5:07 PM
jfb added a reviewer: jfb.
jfb added inline comments.
lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp
52 ↗(On Diff #43086)

Sounds good, thanks!

This revision is now accepted and ready to land.Dec 16 2015, 5:07 PM
This revision was automatically updated to reflect the committed changes.