Compare two executables


 
Thread Tools Search this Thread
Top Forums Programming Compare two executables
# 1  
Old 05-15-2009
Compare two executables

Hi - I have two complex (for me at least) make files. The older one creates a succesful executable. The later one uses if statements to conditionally make different versions of the executable. The 2nd produces an executable that fails. I have "eyeballed" the differences in the Make files and run make -n to try and spot the differences but cannot find my mistake. Is there a Unix command that will give me a summary of the contents of the two executables ie what libraries are linked etc..
Thank you

Mike
# 2  
Old 05-15-2009
try 'man nm'
# 3  
Old 05-15-2009
Do you mean conditional compilation using preprocessor #if or makefile if statements.
# 4  
Old 05-15-2009
Thanks gersh99.

Shamrock - at present Makefile ifeq and ifneq statements. Later I will be using preprocessor statements in my C++ code. But at present I just want to ensure I can reproduce the code as it stands. I'm linking a program that uses a third party API and there is a new version of the API. I need to be able to produce my executable for both the old and new versions of the api, hence the conditional makefile.

I set an environmental variable MYVERSN and then

ifeq ($(MYVERSN), 5000)
case new API detail
else
case B old API detail
endif

at various parts of the makefile

I know this mechanism is working by including echo statements in the target commands.

No, it's just in the detail of what include and library files and directories are used. I can't reduce that to a simple example and I wouldn't expect anyone else to plough through all the detail for me.

I was just hoping that there was some utility that would summaries the two executables so that I could spot the differences. I have looked at nm and concluded that this is probabably at too low level of detail to help me.

I think its back to manually inspecting the two make files. Ho hum!
# 5  
Old 05-15-2009
You can list dynamic dependencies with ldd...it shows all the shared libs loaded by the executable at runtime. If the new version is not running then maybe there is something wrong with the new APIs. So what errors you are getting and can you post them.
# 6  
Old 05-15-2009
I' confident that the API works because they supply example programs that I have compiled, linked and run

I ran ldd against the two executables
It listed 22 so's mainly in the same order. However the two that were not in the same order, although the left hand side and rhs text were identical the hex number at the end was different. Is that significant?
# 7  
Old 05-15-2009
I'd make sure your 'LD_LIBRARY_PATH' env var are set the same for both makefile-s AND the shells you're running your executables in.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Ubuntu

Gcc cannot create executables

https://www.unix.com/302461112-post1.html Thank you. It's still in Linux Mint 17 (3 Replies)
Discussion started by: jgt
3 Replies

2. Shell Programming and Scripting

Scripting with executables

Hi everyone, I am working with an executable (let's say work) in bash shell. When I run this work executable it asks the following information; 1- choose task a or b 2- input file 3- output file 4- some operational choices after it reads the given input file, does some algebraic... (17 Replies)
Discussion started by: hayreter
17 Replies

3. Shell Programming and Scripting

Help: Makefile with multiple executables

I am trying to create executables for the following files Currently, I am making 9 different directories for for each. I would like to make 1 directory but everytime I try it does not work. CROSS_COMPILE?= # CROSS_COMPILE used to = arm-arago-linux-gnueabi... (1 Reply)
Discussion started by: bpetersen
1 Replies

4. Shell Programming and Scripting

Searching for executables

Hello Unix users, this is my first post here. :) I want to search a directory (and subdirectories) for executable files (files with rwx------ permission) and move them to a different folder. What Unix commands can accomplish this? (2 Replies)
Discussion started by: Sagan_Radiation
2 Replies

5. Shell Programming and Scripting

Running executables in ksh

I am trying a set up a very simple korn shell script. It has 2 basic steps. Firstly I read the first line of a text file (which is a file name) Secondly I run a fortran executable using that line I must be doing something wring because it wouldn't work. I know that the executable wants the... (4 Replies)
Discussion started by: larangunn
4 Replies

6. Solaris

C compiler cannot create executables

Hi, I'm trying to compile Apache2.2 (I know it is available as a package) on a fresh install of Solaris Express 11. I've installed gcc-3 and gnu-bintutils via pkg. The config.log is attached (as config.txt). I don't see what I'm missing. Thanks, Doug (1 Reply)
Discussion started by: Doug_M
1 Replies

7. UNIX for Dummies Questions & Answers

Regarding shell scripts to executables

Hi, I have written a shell script for automating some of our repetitive activities. I want all my colleagues to use my script and do the activities automatically by just running the script. But I do not want them to see the code. Is there a way we can generate something like an executable... (16 Replies)
Discussion started by: lokachari
16 Replies

8. Programming

Error creating executables

hi, I am getting error when trying to create binaaries for Xerces C++ error is configure:error:installation:cofihuration error:compiler cant create executables ??????????? Thanks in advance im using AIX flavour of IBM Im using ./configure command to create binaries.Its saying c... (6 Replies)
Discussion started by: chetan2309
6 Replies

9. Programming

executables ending with *

Hi All, I m very new to unix. I have a basic doubt .. In unix I m seeing that there is a * at the end of by executable name (exe1*).. Wht is the significance of that Thanks a lot in advance (2 Replies)
Discussion started by: binums
2 Replies

10. UNIX for Dummies Questions & Answers

cannot create executables

I am trying to install PROFTPD-1.2.7 on a SCO OpenServer 5.0.6 Server with a gcc-2.95.2 installed the VOLS files from http://www.caldera.com/skunkware. The problem I am having is when I try to run ./configure in the proftpd directory I get this error: # ./configure checking build system... (6 Replies)
Discussion started by: stufine
6 Replies
Login or Register to Ask a Question