This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Write out undefined symbol addresses as zero
ClosedPublic

Authored by sbc100 on Jan 8 2018, 3:11 PM.

Details

Summary

The addresses of undefined symbols that make it into the final
executable (i.e. weak references to non-existant symbols) should
resolve to zero.

Also, make sure to not include function in the indirect function
table if they are not included in the output.

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

sbc100 created this revision.Jan 8 2018, 3:11 PM
sbc100 added a reviewer: ruiu.Jan 8 2018, 3:22 PM
ruiu added a comment.Jan 8 2018, 3:29 PM

Resolving undefined symbols to address zero seems reasonable, but ignoring addends for such symbols seems a bit odd. What is the rationale for doing that?

sbc100 updated this revision to Diff 128994.Jan 8 2018, 3:34 PM
  • don't ignore addends
sbc100 edited the summary of this revision. (Show Details)Jan 8 2018, 3:35 PM
ruiu accepted this revision.Jan 8 2018, 3:36 PM

LGTM

This revision is now accepted and ready to land.Jan 8 2018, 3:36 PM
sbc100 added a comment.Jan 8 2018, 3:36 PM

You're right. Not sure what I thought that was necessary.

This revision was automatically updated to reflect the committed changes.
test/wasm/relocatable.ll