Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Issue 878043002: Add support for RIP relative addresses on x86_64. (Closed)

Created:
5 years, 11 months ago by Will Harris
Modified:
5 years, 9 months ago
CC:
chromium-reviews, Niels Werensteijn
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add support for RIP relative addresses on x86_64. Visual studio uses rip-relative addressing (rra) extensively in 64 bit binaries. ParseRel32RelocsFromSection does not find these addresses, which causes courgette to miss a lot of rva pointers, and thus missing a lot of compresssion opportunities. This patch makes the ParseRel32RelocsFromSection find rip relative call/jmp/lea. It also finds mov's that load from memory using rra's. Based on CL by niels.werensteijn.teamspeak@gmail.com in crrev.com/212563003 This change gives a noticeable improvement on 64-bit binaries. Against test binaries (64-bit chrome.dll 40.0.2214.115->43.0.2317.0) the patch sizes were: Uncompressed: before: 10,948,152 after: 9,948,442 (9.1% reduction) Compressed (7z ultra): before: 6,084,670 after: 5,581,502 (8.3% reduction) BUG=459064 TEST=courgette_unittests Committed: https://crrev.com/4f4f19d78bb91ba7af7e79f86b75d1f67aa1caf6 Cr-Commit-Position: refs/heads/master@{#321524}

Patch Set 1 #

Patch Set 2 : rebase merge 212563003 #

Total comments: 11

Patch Set 3 : code review changes #

Patch Set 4 : fix test #

Patch Set 5 : rebase #

Patch Set 6 : fix clang build #

Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -5 lines) Patch
M AUTHORS View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M courgette/disassembler_win32_x64.cc View 1 2 3 4 5 2 chunks +23 lines, -4 lines 0 comments Download
M courgette/encode_decode_unittest.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 26 (9 generated)
Will Harris
CL necro the CL that Niels originally wrote. PTAL.
5 years, 9 months ago (2015-02-28 21:05:57 UTC) #2
Will Harris
ping dgarrett@
5 years, 9 months ago (2015-03-05 17:51:00 UTC) #3
Will Harris
On 2015/03/05 17:51:00, Will Harris wrote: > ping dgarrett@ rickyz says he will take a ...
5 years, 9 months ago (2015-03-09 23:02:34 UTC) #5
dgarrett
This generally looks good, though I have no idea about the assembly parsing. Deferring to ...
5 years, 9 months ago (2015-03-10 03:03:48 UTC) #6
rickyz (no longer on Chrome)
https://codereview.chromium.org/878043002/diff/20001/courgette/disassembler_win32_x64.cc File courgette/disassembler_win32_x64.cc (right): https://codereview.chromium.org/878043002/diff/20001/courgette/disassembler_win32_x64.cc#newcode469 courgette/disassembler_win32_x64.cc:469: is_rip_relative = false; Fine if you prefer it this ...
5 years, 9 months ago (2015-03-10 05:13:50 UTC) #7
Will Harris
Thanks for the reviews! Ricky - supporting r8-r15 gave an extra 1% reduction in patch ...
5 years, 9 months ago (2015-03-12 05:33:28 UTC) #8
rickyz (no longer on Chrome)
lgtm
5 years, 9 months ago (2015-03-12 05:36:25 UTC) #9
dgarrett
https://codereview.chromium.org/878043002/diff/20001/courgette/disassembler_win32_x64.cc File courgette/disassembler_win32_x64.cc (right): https://codereview.chromium.org/878043002/diff/20001/courgette/disassembler_win32_x64.cc#newcode466 courgette/disassembler_win32_x64.cc:466: if (p + 5 <= end_pointer) { On 2015/03/12 ...
5 years, 9 months ago (2015-03-12 16:40:54 UTC) #10
dgarrett
lgtm
5 years, 9 months ago (2015-03-12 16:55:56 UTC) #11
Will Harris
Holding off committing this CL until teamspeak sign the Chromium CLA.
5 years, 9 months ago (2015-03-12 17:00:47 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/878043002/60001
5 years, 9 months ago (2015-03-18 23:32:18 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/6752) ios_rel_device_ninja on tryserver.chromium.mac (JOB_FAILED, ...
5 years, 9 months ago (2015-03-18 23:36:14 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/878043002/80001
5 years, 9 months ago (2015-03-20 05:00:56 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/7202) ios_rel_device_ninja on tryserver.chromium.mac (JOB_FAILED, ...
5 years, 9 months ago (2015-03-20 05:06:13 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/878043002/100001
5 years, 9 months ago (2015-03-20 05:16:56 UTC) #24
commit-bot: I haz the power
Committed patchset #6 (id:100001)
5 years, 9 months ago (2015-03-20 06:23:24 UTC) #25
commit-bot: I haz the power
5 years, 9 months ago (2015-03-20 06:24:41 UTC) #26
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/4f4f19d78bb91ba7af7e79f86b75d1f67aa1caf6
Cr-Commit-Position: refs/heads/master@{#321524}

Powered by Google App Engine
This is Rietveld 408576698