Subzero: fix external function calls on x86-32
On x86-32, the CALL instruction takes an IP-relative target address.
These are emitted as relocatable addresses, which we fix up in
rr::loadImage in SubzeroReactor.cpp. The problem is that we were calling
loadImage multiple times when compiling Coroutine functions - three
times, in fact, since there are three Coroutine functions (create,
await, destroy). As such, we would fixup the same relocatable addresses
multiple times, but the fixup uses the existing value, so it would
become invalid after the second fixup. To fix this, we now only call
loadImage once, collecting all entry points at once.
Also opportunistically fixed a missing argument to coro::isDone, and
added a static_assert to sz::Call to avoid this happening again.
Bug: angleproject:4482
Change-Id: If847d02649152abc1a9d8476023dd240465fa736
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/42448
Presubmit-Ready: Antonio Maiorano <amaiorano@google.com>
Tested-by:
Antonio Maiorano <amaiorano@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
Showing
Please
register
or
sign in
to comment