[PATCH] D87258: [WebAssembly, LowerTypeTests] Fix control-flow integrity support
Dominic Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 10 22:31:18 PDT 2020
ddcc added a comment.
In D87258#2262409 <https://reviews.llvm.org/D87258#2262409>, @ddcc wrote:
> In D87258#2261903 <https://reviews.llvm.org/D87258#2261903>, @sbc100 wrote:
>
>> So is the idea that the table indexes would be reserved also by the linker?
>>
>> Right now wasm-ld completely ignores the table elements in the object files and generates contiguous table entries when if finds TABLE_INDEX relocations.
>
> Ah, so under LTO, the output from WasmObjectWriter is linked by lld with libc, etc, which writes the final output? I was hoping to avoid changing the object format to explicitly assign table element indices, since that would involve amending the specification, by just emitting the table elements in the correct order. Would it be sufficient to have `WasmObjectWriter::recordRelocation` also ensure that TABLE_INDEX relocations are inserted into `CodeRelocations` in the correct assigned order? Right now I only push them to the front of `CodeRelocations` to avoid conflicts when assigning indices with subsequent elements.
@sbc100 I have a local prototype that reorders CodeRelocations such that symbols with an assigned index appear first, but it seems that there's a conflicting object format requirement that relocations appear in offset order. What would be the best way to propagate assigned indices through to wasm-ld, either implicitly or explicitly?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87258/new/
https://reviews.llvm.org/D87258
More information about the llvm-commits
mailing list