For consistency with the output of lld.
This is useful in runnable binaries as can them be sure the
null function pointer will never be a valid argument
call_indirect.
Paths
| Differential D42284
[WebAssembly] MC: Start table at offset 1 rather than 0 ClosedPublic Authored by sbc100 on Jan 18 2018, 7:56 PM.
Details Summary For consistency with the output of lld. This is useful in runnable binaries as can them be sure the
Diff Detail
Event TimelineHerald added subscribers: llvm-commits, sunfish, aheejin and 3 others. · View Herald TranscriptJan 18 2018, 7:56 PM Comment Actions I can't see that anything would break by landing this and D42285 first. There are some other changes in D42095 as well, because even with this offset-by-one change, the indexes written out by Clang still don't match the indexes LLD would write out for the same Symbols (for weak and aliased functions, of course!). But, the rest of #3 (D42095) definitely can't land before #2. Until the actual symbol indexes are being written out for the table relocations (#2), we can't alter the ELEM section to use exactly the same rules in Clang as it does in LLD. This revision is now accepted and ready to land.Jan 19 2018, 1:11 AM Comment Actions I was trying to tease out this part that could land without and ABI change (that TABLE_INDEX relocation change). Hopefully we can do the ABI changes this week too though. Closed by commit rL322978: [WebAssembly] MC: Start table at offset 1 rather than 0 (authored by sbc). · Explain WhyJan 19 2018, 11:00 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 130663 llvm/trunk/lib/MC/WasmObjectWriter.cpp
llvm/trunk/test/MC/WebAssembly/external-func-address.ll
llvm/trunk/test/MC/WebAssembly/func-address.ll
llvm/trunk/test/MC/WebAssembly/global-ctor-dtor.ll
llvm/trunk/test/MC/WebAssembly/weak-alias.ll
|