This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Update to match llvm change to SYM_INFO section
AbandonedPublic

Authored by sbc100 on Jan 18 2018, 7:28 PM.

Details

Reviewers
ncw
sunfish
Summary

See D42279

Event Timeline

sbc100 created this revision.Jan 18 2018, 7:28 PM
ncw added inline comments.Jan 19 2018, 1:45 AM
wasm/Writer.cpp
397

Does this really work? I had to introduce the concept of "output symbol index" (getOutputSymbolIndex) for writing out the relocations and syminfo in LLD.

That's because LLD doesn't have (and never has had) the duplicate-import fiddle that WasmObjectWriter has (LLD uses the "alt indexes" when it reads in the files, but it can't write them out).

So how can the function's output index work here - when it's not the same concept as the symbol output index? The function and symbol indexes can diverge.

It's very very close to being correct, but I don't think it is fully correct.

The #5 changes do need to come first for this to be "right".

Once it's fixed, relocatable.ll should gain some tests for aliases, since it looks like it doesn't have any, oops.

ncw added a comment.Jan 19 2018, 1:48 AM

I suppose this could be merged, since it doesn't make things worse. LLD --relocatable output is already broken for aliases, but it doesn't feel great to be introducing another place where it comes unstuck.

At the very least, it needs a comment added to the getOutputIndex() call saying // TODO fixme once we have symbol indexes.

sbc100 abandoned this revision.Jan 19 2018, 10:56 AM