This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Improve support for "needed" list in dylink section
ClosedPublic

Authored by sbc100 on Mar 11 2019, 5:04 PM.

Event Timeline

sbc100 created this revision.Mar 11 2019, 5:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 11 2019, 5:04 PM
sbc100 updated this revision to Diff 190188.Mar 11 2019, 5:06 PM
  • move to mono-repo
sbc100 edited the summary of this revision. (Show Details)Mar 11 2019, 5:07 PM
ruiu added a subscriber: ruiu.Mar 11 2019, 5:10 PM

Is this ready for review? It doesn't seem to create a valid executable though, as there's no code to emit filenames of shared object files.

sbc100 updated this revision to Diff 190209.Mar 11 2019, 11:36 PM
  • add test
sbc100 updated this revision to Diff 190210.Mar 11 2019, 11:38 PM
  • remove assert
sbc100 updated this revision to Diff 190211.Mar 11 2019, 11:40 PM
  • clang-format

This change is now ready for review. Please note that this is only the most simple support for .so file. All it does is add each library to the "needed" section, it doesn't do any symbol resolution against the shared libraries yet.

sbc100 added a reviewer: ruiu.Mar 12 2019, 4:06 PM
ruiu added inline comments.Mar 13 2019, 11:08 AM
lld/wasm/Writer.cpp
504 ↗(On Diff #190211)

Maybe it is better to avoid auto and make it explicit as SharedFile *

505 ↗(On Diff #190211)

nit: you can omit llvm::.

llvm/lib/Object/WasmObjectFile.cpp
327 ↗(On Diff #190211)

Is this dead code?

sbc100 marked an inline comment as done.Mar 13 2019, 11:17 AM
sbc100 added inline comments.
llvm/lib/Object/WasmObjectFile.cpp
327 ↗(On Diff #190211)

Its fixing a bug that isSharedLibrary(), which is only ever used by lld, was always returning false.

I guess at least some other tool such as objdump should probably be calling that and displaying different output for shared libs.

ruiu accepted this revision.Mar 13 2019, 1:10 PM

LGTM with the previous comments fixed.

llvm/lib/Object/WasmObjectFile.cpp
327 ↗(On Diff #190211)

Got it. We eventually need a test, but it doesn't have to be at this time.

This revision is now accepted and ready to land.Mar 13 2019, 1:10 PM
This revision was automatically updated to reflect the committed changes.