Re: Average instruction length in x86-built kernel?

From: Ingo Oeser
Date: Sat Jul 30 2005 - 08:50:55 EST


Hi Karim,

On Friday 29 July 2005 23:32, Karim Yaghmour wrote:
> Googling around, I can find references claiming that the average
> instruction length on x86 is anywhere from 2.7 to 3.5 bytes, but I
> can't find anything studying Linux specifically.

This is not that hard to find out yourself:

Just study the output od objdump -d and average the differences
of the first hex number in a line printed, which are followed by a ":"

e.g.


scripts/kconfig/mconf.o: file format elf32-i386

Disassembly of section .text:

00000000 <init_wsize>:
0: 83 ec 1c sub $0x1c,%esp
3: 8d 44 24 10 lea 0x10(%esp),%eax
7: 89 44 24 08 mov %eax,0x8(%esp)

so avg(3-7, 3-0) = 2.5

and so on...


Happy analyzing!


Regards

Ingo Oeser

Attachment: pgp00000.pgp
Description: PGP signature