Which OS Binary was build

 
Thread Tools Search this Thread
Homework and Emergencies Emergency UNIX and Linux Support Which OS Binary was build
# 1  
Old 04-17-2010
Which OS Binary was build

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
# 2  
Old 04-17-2010
Try using 'strings', it displays all the character strings in a binary file.
# 3  
Old 04-17-2010
Hello,

you can check the dependancy libraries which can distinguish the binaries

Code:
ldd binary_file

If their versions match that of the current version of the libs.

apparently you can check out the external libs they are using another way too.
Code:
 nm -o binary_file | grep '\bU\b'

The binary file alone cannot give you the information about which version of gcc was used to build it.

If there is a difference b/w the kernel version they are using then you can check the binaries that are made for 2.4 or 2.6 . I suppose redhat-6.2 uses 2.4 while rhel uses 2.6.18.

example :

Code:
 file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, not stripped

So it lists 2.6 on mine

So in order to distinguish you can rename all lthe binaries depending on the kernel version to later distinguish them

Code:
#!/bin/bash

for fil in $DIR/*;do if file $fil | grep -q '2.6' ;then echo "2.6-${fil}";else echo "2.4-${fil}";fi;done

Apparently you can rename the files with the kernel version to find out which OS it was built.

Hope this helps,

Regards,
gaurav.

Last edited by gaurav1086; 04-18-2010 at 02:34 AM.. Reason: correct variable names
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

(VS 2008) New build config looking files from other folder build config

Hi Team, My new build configuration always looking for the files from the build where i copied from. please help me to resolve this. I am using Visual studio 2008.It has Qt 4.8. plugins,qml,C++ development I created new debug_new build configuration with additional preprocessor from the... (1 Reply)
Discussion started by: SA_Palani
1 Replies

2. Shell Programming and Scripting

Build using scons

I have a tree structure as follows: /vik/build/sc/botoh.sc /vik/lib/endian.f /vik/utils/botoh.f Then I run the build script as cd vik/build/sc scons -f botoh.sc The above shows that the SConstruct botoh.sc is down a few levels, and it may be easiest to have the main... (6 Replies)
Discussion started by: kristinu
6 Replies

3. Shell Programming and Scripting

Build.xml invocation by Build Script

Hi I have a build.xml file and I can run it on Windows via cmd. Now I want to write a script to invoke the same. Is there a way to do this? (1 Reply)
Discussion started by: ankur328
1 Replies

4. Shell Programming and Scripting

Convert binary file to csv and then back to the binary format

Hello *nix specialists, Im working for a non profit organisation in Germany to transport DSL over WLAN to people in areas without no DSL. We are using Linksys WRT 54 router with DD-WRT firmware There are at the moment over 180 router running but we have to change some settings next time. So my... (7 Replies)
Discussion started by: digidax
7 Replies

5. UNIX for Dummies Questions & Answers

Adding SDK Build on Kernel Source Build

Hi, So I downloaded this kernel source and was able to build it successfully. But I want to add this SDK source code inside, can anyone help me how to do this? Note that the SDK source can be built by itself. I added the SDK in the main Makefile: init-y := init/ #added SDK... (0 Replies)
Discussion started by: h0ujun
0 Replies

6. Solaris

Build the apache binary centrally.

Hi, Generally we will run to install, configure apache 2.x on Solaris machine, but dont want to follow these on the remaining machines. I want to build the apache binary centrally, so that i can untar the tar file on remaining machines. Please suggest on how to prepare this file and when i... (12 Replies)
Discussion started by: prash358
12 Replies

7. AIX

Vio Build

I am planning carving out dual VIO servers on a P750 based and would like to know how to allocate internal disks to the VIOS. This has 4 internal disks and I would to assign 2 disks to each VIO. This is what I was thinking of assigning . Any advise? vio1 U5802.001.9K8H757-P1-C1 PCI-E x8... (17 Replies)
Discussion started by: mk8570
17 Replies

8. UNIX for Advanced & Expert Users

Problem during build

Hi, When i'm compiling my C files, I'm getting an error saying that the file name i've defined is undeclared. Could someone tell me how to solve this error. I've defined the file name as #define _FILE_CODE_ _XYZ_C_ The error is "_XYZ_C undeclared". Thanks in advance (1 Reply)
Discussion started by: laxmi
1 Replies

9. Solaris

build error

dears i working in solaris and when i type make for report it gives me the error kindly can you help me what is the reason -bash-3.00$ make BPSEXT130 make: Warning: File `BPSEXT130.rc' has modification time 12 s in the future make BPSEXT130.c make: Entering directory... (3 Replies)
Discussion started by: murad.jaber
3 Replies

10. Solaris

compiled binary file gives "cannot execute binary file"

Hi, I have two Solaris machines. 1. SunOS X 5.8 Generic_108528-29 sun4u sparc SUNW,Sun-Blade-1500 2. SunOS Y 5.8 Generic_108528-13 sun4u sparc SUNW,Ultra-60 I am trying to buiild a project on both these machines. The Binary output file compiled on machine 2 runs on both the machines. Where... (0 Replies)
Discussion started by: scgupta
0 Replies
Login or Register to Ask a Question