Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

a.out linux executable is of which program?

Tags:

c++

c

executable

Given a current directory with lots of files and let's say I compiled one file and generated executable a.out. Now, I want to find from which program this executable has been generated. How, can I do it?

like image 693
Aki008 Avatar asked Nov 17 '13 12:11

Aki008


1 Answers

You can use readelf:

readelf -a a.out | grep FILE

For instance:

$ gcc t.c
$ readelf -a a.out |grep FILE
    28: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff.c
    36: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff.c
    41: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS t.c
$ 

Alternatively, you can use

objdump -t a.out |grep df

Example:

$ objdump -t a.out |grep df
0000000000000000 l    df *ABS*  0000000000000000              crtstuff.c
0000000000000000 l    df *ABS*  0000000000000000              crtstuff.c
0000000000000000 l    df *ABS*  0000000000000000              t.c
like image 71
damienfrancois Avatar answered Sep 27 '22 23:09

damienfrancois