Compacting ARM binaries with the Diablo framework – Dominique Chanet & Ludo Van Put Compacting ARM binaries with the Diablo framework Dominique Chanet Ludo Van Put
Compacting ARM binaries with the Diablo framework – Dominique Chanet & Ludo Van Put Introduction Embedded systems: emphasis on compact programs How? –assembly language programming –compilers optimizing for code size –specially tweaked libraries –smart linkers e.g. Squeeze, Squeeze++: developed for Compaq Alpha not yet evaluated for a real embedded architecture!
Compacting ARM binaries with the Diablo framework – Dominique Chanet & Ludo Van Put ARM Widely used in embedded systems: –StrongArm, XScale (PDAs) –OMAP (cell phones) in 2001: 76% of all RISC processors shipped were based on the ARM instruction set Low power consumption Special attention for compact code –Thumb instruction set –ISA features like conditional execution of all instructions, pipeline with integrated barrel shifter,...
Compacting ARM binaries with the Diablo framework – Dominique Chanet & Ludo Van Put Diablo Binary rewriting framework: useful for compaction, instrumentation, obfuscation, … Retargetable: ports for ARM, MIPS, x86, Alpha, … At link time –Inputs: object files, libraries –Output: a statically linked executable
Compacting ARM binaries with the Diablo framework – Dominique Chanet & Ludo Van Put Impact of libraries
Compacting ARM binaries with the Diablo framework – Dominique Chanet & Ludo Van Put Major compaction opportunities initial unreachable code removal results of interprocedural constant propagation –at link time addresses are propagated optimize address calculations disambiguate indirect jumps –combined with dead code elimination: discard parts of functions that can never be executed results of interprocedural liveness analysis –unused function results,...
Compacting ARM binaries with the Diablo framework – Dominique Chanet & Ludo Van Put Results
Compacting ARM binaries with the Diablo framework – Dominique Chanet & Ludo Van Put Conclusions & Future Work on average 8-11% compaction of the code section (depending on platform) mostly thanks to unreachable code removal and interprocedural constant propagation Future work: more advanced techniques (e.g. factorization, stack analysis,...) support for Thumb instruction set