views:

48

answers:

1

We have recently installed RHEL 5.4 on some existing 6.2 OS and migrated our code from RH 6.2 to RHEL 5.4. We are facing a difficulty that given a binary (on both OS they have same name) how can we distinguish that which gcc and OS it was build as there are some minor differences in between binary respectively made.

Please help

A: 

Use the readelf command to get this information. For example for a binary called xtset, I would use:

$ readelf -a xtset  | grep comment
 [23] .comment          PROGBITS        00000000 0008fc 000132 00      0   0  1

From this result, I can see the compiler information if I read 0x132 bytes from location 0x8fc in the binary.

Suresh Krishnan