diff options
author | paulgazz@chromium.org <paulgazz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-06 00:11:54 +0000 |
---|---|---|
committer | paulgazz@chromium.org <paulgazz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-06 00:11:54 +0000 |
commit | 9dc8e30aa56830051d4c3a940aa3c5a59bc59f94 (patch) | |
tree | 0294f5f07f19d9976d04cc9f1a09bac580e9053b /courgette/courgette.h | |
parent | 3ecbf2da233bfef0b92eadbbeac11ff1af6a1ce1 (diff) | |
download | chromium_src-9dc8e30aa56830051d4c3a940aa3c5a59bc59f94.zip chromium_src-9dc8e30aa56830051d4c3a940aa3c5a59bc59f94.tar.gz chromium_src-9dc8e30aa56830051d4c3a940aa3c5a59bc59f94.tar.bz2 |
ARM binaries seen by Courgette have three ISAs, ARM, thumb, and thumb-2. Courgette currently identified branch instructions from these ISAs heuristically, which leads to false positives. This patch improves on the heuristic by ignoring branches to addresses that aren't used very much in the binary.
Currently, the lower threshold for the number of times an address is used is 5, which was found empirically. ARM versions of chrome OS from daisy_3701.98.0 to daisy_4206.0.0 double the bytes saved by Courgette.
BUG=266019
Review URL: https://chromiumcodereview.appspot.com/21428006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215737 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'courgette/courgette.h')
-rw-r--r-- | courgette/courgette.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/courgette/courgette.h b/courgette/courgette.h index 4831228..542c43f 100644 --- a/courgette/courgette.h +++ b/courgette/courgette.h @@ -48,6 +48,7 @@ enum Status { C_DISASSEMBLY_FAILED = 25, // C_ASSEMBLY_FAILED = 26, // C_ADJUSTMENT_FAILED = 27, // + C_TRIM_FAILED = 28, // TrimLabels failed }; // What type of executable is something @@ -107,6 +108,10 @@ Status DetectExecutableType(const void* buffer, size_t length, Status ParseDetectedExecutable(const void* buffer, size_t length, AssemblyProgram** output); +// Trims labels used fewer than a given number of times from an +// assembly program in-place. +Status TrimLabels(AssemblyProgram* program); + // Converts |program| into encoded form, returning it as |*output|. // Returns C_OK if succeeded, otherwise returns an error status and // sets |*output| to NULL |