diff options
author | Samuel Huang <huangs@chromium.org> | 2018-06-26 14:47:02 +0000 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2021-07-25 20:00:46 -0700 |
commit | 8fdb8ba40fec579b42a7dc8bbd1475ee91e1aa42 (patch) | |
tree | 84e44e900bb34a13691345dfb4299caaeed9d1a8 /disassembler.h | |
parent | f35146e48edca6755e98749a2cb5cc00272d308b (diff) | |
download | zucchini-8fdb8ba40fec579b42a7dc8bbd1475ee91e1aa42.tar.gz |
[Zucchini] Fix underflow / overflow for extended forward-projection.
Forward-projection is how Zucchini uses the equivalence map to create
estimated "new" targets from "old" targets. Extended forward-projection
is defined to transform non-covered offsets: Given an offset, it finds
the equivalence unit with nearest "old" block, then applies the
"old"-to-"new" displacement to the offset. However, this makes it
possible to map an "old" offset to an offset outside "new" image.
Another issue is that Zucchini uses "dangling targets" that use "fake
offsets" outside the image file to represent .bss data. These targets
also undergo forward-projection, and should be properly handled.
This CL fixes the existing behavior, where underflow / overflow go
unchecked (although these values are rendered benign downstream, since
the nearest actual "new" target is found). The updated extended
forward-projection specifies:
- For "old" targets with real offsets: Take nearest equivalence unit,
clamp output to be inside [0, "new" image size).
- For "old" dangling targets with fake offsets: Use difference in
file size as displacement.
The main impact w.r.t. patch is to reduce possible variance in patch
sizes -- dangling targets are now handled better. Extensive unit tests
are also added.
Bug: 832572
Change-Id: I41fea175e4c13585d14a97a712a191afc2fcc6d6
Reviewed-on: https://chromium-review.googlesource.com/1111467
Reviewed-by: Samuel Huang <huangs@chromium.org>
Reviewed-by: Greg Thompson <grt@chromium.org>
Commit-Queue: Samuel Huang <huangs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570401}
NOKEYCHECK=True
GitOrigin-RevId: ad7a5c086f00de62997714b84d6d6b5817ccc9d8
Diffstat (limited to 'disassembler.h')
0 files changed, 0 insertions, 0 deletions