table_base is know 64-bit, since in LLVM it represents a function pointer offset
table_base32 is a copy in wasm32 for use in elem init expr, since no truncation may be used there.
New reloc R_WASM_TABLE_INDEX_REL_SLEB64 added
Details
- Reviewers
sbc100 dschuff - Commits
- rG3a293cbf13a2: [WebAssembly] Fix PIC/GOT codegen for wasm64
Diff Detail
Event Timeline
lld/wasm/Driver.cpp | ||
---|---|---|
587–589 | Since config->is64.getValueOr(false) appears so often in the code I wonder if we could make config->is64 just work (less typing and easier to read.. less likely to cache in a local variable). I know we had a good reason for making it an optional... but maybe we should re-visit? (not blocking this change just mentioning it..) | |
680 | How about: if (config->is64.getValueOr(false)) WasmSym::definedTableBase32 = symtab->addOptionalDataSymbol("__table_base32"); | |
lld/wasm/InputElement.h | ||
55 | This seems a little out of place here... although I don't know if we have a better home for such utilities. If it was just used in one source file I would say move it out of the header. | |
lld/wasm/Symbols.h | ||
567 | Can we mention that this is workaround for lack or https://github.com/WebAssembly/extended-const and can potentially be removed if/wehn this lands? | |
lld/wasm/SyntheticSections.cpp | ||
343 | Maybe keep these spacer lines? Then seem harmless at worst. | |
llvm/test/MC/WebAssembly/reloc-pic64.s | ||
5 | "entries" .. which looks one of my spelling mistakes that you cargo culted :) |
lld/wasm/Driver.cpp | ||
---|---|---|
587–589 | We had a single boolean, until we decided we needed to know wether it was set or not, which is exactly in one place. We could also just add a second is64set boolean or whatever, that way the other 15 or so uses can be simplified. Up to you. | |
lld/wasm/InputElement.h | ||
55 | It's used in 3 source files. |
lld/test/wasm/data-layout.s | ||
---|---|---|
4 | --check-prefixes isn't needed anymore |
--check-prefixes isn't needed anymore