an annotation framework for dynamic binary manipulation on multi-cores speaker: wen-ren chen date:...
TRANSCRIPT
An Annotation Framework for Dynamic Binary Manipulation on Multi-cores
Speaker: Wen-Ren ChenDate: 2010/11/12 FriInstitute of Information Science
Goal
TranslatorOriginal ELF
content
Mem
Optimizer Annotation Annotated
ELF
ELF
Annotation can make translator and optimizer more efficient
Current Approach
• Add annotation into ELF can be done offline– objcopy --add-section sectionname=filename
perlbench_base.i386-m32-gcc44
• Retrieve annotation from ELF must be done at runtime– GNU libelf
Progress
• Constructing Control Flow Graph beyond sampling’s reach– Basic Block sampling ONLY on x86-64– Difficult to deduce edge probability
• Use profiling data as an initial guess to edge probability– Insert profiling data into ELF, i.e., an annotated
ELF
Discussion
• We have two annotation approached proposed in 11/05 meeting1. Use the first k bits of an instruction for
annotation2. Use XML to do the annotations
• We only have to convert string (hex) into integer (dec)
• Not particular parsing procedure needed at this time
src_head src_tail dst_head dst_tail edge_count0x40098b3b 0x40098b3f 0x4008204e 0x40082088 1 RET0x4008204e 0x40082088 0x40082088 0x40082090 1 COND_DIRECT_JMP0x40082088 0x40082090 0x400820a0 0x400820a5 1 UNCOND_DIRECT_JMP0x400820a0 0x400820a5 0x40082090 0x400820a0 14 COND_DIRECT_JMP0x400820a0 0x400820a5 0x400820a5 0x400820b5 6 COND_DIRECT_JMP
Original CFG profiling data
• The size of annotation might be a problemBenchmark ELF Annotated ELF Ratio
400.perlbench 1021K 1.2M 17.5%
401.bzip2 66K 94K 42.4%
429.mcf 17K 40K 135.3%
445.gobmk 3.6M 3.8M 5.6%
456.hmmer 275K 314K 14.2%
462.libquantum 44K 65K 47.7%
464.h264ref 556K 637K 14.6%
471.omnetpp 755K 841K 11.4%
473.astar 49K 80K 63.3%
ELF increased 39.1% averagely