This is an archive of the discontinued LLVM Phabricator instance.

[lld][WebAssembly] Don't define indirect function table in relocatable output
ClosedPublic

Authored by sbc100 on Jan 19 2021, 12:26 PM.

Details

Summary

Object files (and the output --relocatable) should never define
__indirect_function_table. It should always be linker synthesized
with the final output executable.

Diff Detail

Event Timeline

sbc100 created this revision.Jan 19 2021, 12:26 PM
sbc100 requested review of this revision.Jan 19 2021, 12:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2021, 12:26 PM

I verified this fixes the crash we are seeing on the emscripten CI with the use of -r.

dschuff added inline comments.Jan 19 2021, 12:48 PM
lld/test/wasm/locals-duplicate.test
241

is this elemtype correct? do we just not distinguish right now?

dschuff accepted this revision.Jan 19 2021, 12:57 PM
dschuff added inline comments.
lld/test/wasm/locals-duplicate.test
241

Looks like the answer is that we only have FUNCREF and EXTERNREF right now. Maybe doesn't matter for this case, I guess that's something we can fix in the future.

This revision is now accepted and ready to land.Jan 19 2021, 12:57 PM
sbc100 added inline comments.Jan 19 2021, 12:57 PM
lld/test/wasm/locals-duplicate.test
241

This is correct I think yes. This is the only possible elem type today I think. What else would you expect it to say here?

dschuff added inline comments.Jan 19 2021, 12:58 PM
lld/test/wasm/locals-duplicate.test
241

Actually nevermind, I was confused: this is the type of the element, not the type of the imported ref. So this is right.

sbc100 retitled this revision from [lld][WebAssembly] Don't defined indirect function table in relocatable output to [lld][WebAssembly] Don't define indirect function table in relocatable output.Jan 19 2021, 1:23 PM

Thank you for the patch and apologies for messing this up!