Size of the Library/Executable is high in LINUX


 
Thread Tools Search this Thread
Operating Systems Linux Size of the Library/Executable is high in LINUX
# 1  
Old 05-19-2011
Size of the Library/Executable is high in LINUX

HI All,

We have a 32bit Gui application created using C++. We ported the application from Solaris to Linux. Issue we are facing is

the size of the library and executable is very large in LINUX compared to Solaris.

Red Hat Enterprise Linux 5.4 is the Linux version we using.

Please find a sample dynamic library created. We would like to know the following behavior of LINUX is normal or not.

Consider we created two files test1.cc and test2.cc. Both having a single line of code.

Code:
a-2720@N530 /data1/users/a-2720/samp :ls -lrt test1.cc test2.cc
-rw-rw-r-- 1 a-2720 mcs 21 May 18 06:16 test1.cc
-rw-rw-r-- 1 a-2720 mcs 21 May 18 06:16 test2.cc
 
 
a-2720@N530 /data1/users/a-2720/samp :cat test1.cc
#include<iostream.h>
 
 
a-2720@N530 /data1/users/a-2720/samp :cat test2.cc
#include<iostream.h>

Thus the files have only only one line inside them

I created a Shared library using these files.

SOLARIS
---
Code:
CC -c -library=iostream -g -mt test1.cc
CC -c -library=iostream -g -mt test2.cc
CC -G -h libtestsolaris.so test1.o test2.o -o libtestsolaris.so -library=iostream 
 
a-2720@N530 /data1/users/a-2720/samp :ls -lrt test1.o test2.o libtestsolaris.so
-rw-rw-r-- 1 a-2720 mcs 20944 May 18 06:16 test1.o
-rw-rw-r-- 1 a-2720 mcs 20944 May 18 06:16 test2.o
-rwxrwxr-x 1 a-2720 mcs 7384 May 18 06:16 libtestsolaris.so


LINUX
---
Code:
CC -m32 -c -library=iostream -g -mt test1.cc
CC -m32 -c -library=iostream -g -mt test2.cc
CC -m32 -G -h libtestlinux.so test1.o test2.o -o libtestlinux.so -library=iostream 
 
/data1/users/adarsh/samp :ls -lrt test1.o test2.o libtestlinux.so
-rw-r--r-- 1 adarsh ifo 20220 May 18 06:44 test1.o
-rw-r--r-- 1 adarsh ifo 20220 May 18 06:44 test2.o
-rwxr-xr-x 1 adarsh ifo 41680 May 18 06:44 libtestlinux.so


Here we can see that the Linux shared library are in much bigger size than solaris once. Please note that the source file

for these libraries are same.
Our application uses thousand of files having these header files and hence a notable difference in size occurs.

We would like to know this size difference is a normal behavior of LINUX.

System Details
------
Code:
/data1/users/adarsh/samp :cat /etc/*-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
 
/data1/users/adarsh/samp :uname -a
Linux N280 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

Thanks in advance.
Sanush Chacko

Last edited by pludi; 05-19-2011 at 01:55 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to make a .exe file executable in Linux?

Dear all, I download a .exe file in my current folder called: ukbmd5.exe. I was told to run the command below: ukbmd5 ukb25278.enc to verify the integrity of the files that you have downloaded and the program ukbmd5 has been made available to assist with decrpying ukb25278.enc. while when I run... (1 Reply)
Discussion started by: forevertl
1 Replies

2. Shell Programming and Scripting

Get the File name of perl executable in Linux

Hi All, I just want to know how to get the executable name of the perl script as i know "$0" will give me the script name but i want to know the executable name which i got it from the script using pp command. Regards Raj (1 Reply)
Discussion started by: kar_333
1 Replies

3. UNIX for Dummies Questions & Answers

[Solved] About commands for linux executable files

I have seen commands like this: (hello is the executable file or maybe script file) ./hello hello .hello So, anyone could tell me the differences among these commands? (2 Replies)
Discussion started by: icyfight
2 Replies

4. UNIX for Advanced & Expert Users

Figure out the minimum os version neede to run executable or link library.

Hello, I need to figure out the minimum OS version needed to run some executable. For the following OS: Linux, AIX, Solaris. For example how do I know the minimum OS version for /bin/ls ? "file" command does not give me much information. There are some tools that are helpful for understanding... (4 Replies)
Discussion started by: +Yan
4 Replies

5. Programming

after gmake size of library gets changes

Hello, I have source code of c. When i compiled it using gmake my library gets created on AIX. But without changing the source code, if i try to do gmake each and every time then every time size of created library gets changed. Can anyone tell me why it's happening? Am i missing something in my... (3 Replies)
Discussion started by: mustus
3 Replies

6. UNIX for Dummies Questions & Answers

Linux PHP Executable Output Issue with IE

I have developed a PHP web page that executes a batch file and pipes the output to a file. It works fine when using Firefox, Safari, etc. However, when using IE, it does not work. $execute = `batch.bat $var1 $var2 | tee /batch.output`; print "<pre>$execute</pre>"; When the page is run in... (1 Reply)
Discussion started by: dleblanc67
1 Replies

7. Shell Programming and Scripting

Linux Script to move executable to quarantine

Please help! I am preparing a Linux Script to move windows executable files from samba directory to quarantine directory. For safety, will use "file" command to determine if its executable. Anyone can help? Below is my trial script, but it just move everything, including non-executable.. any wrong... (2 Replies)
Discussion started by: gavintam
2 Replies

8. Solaris

Executable takes indefinite time to search for shared library

Hi, I have an executable that takes indefinitely long time to search for the libsendfile.so in particular solaris machines only. The library is actually in the /lib folder. Where as it works fine on few of the machines, it takes long time in few others. I have checked crle options. Its... (1 Reply)
Discussion started by: kk2202
1 Replies

9. Solaris

High Page In and Executable page In

Hi, Currently I'm experience very high page ins on my system running on solaris 10. From vmstat, the page ins figure is very high, further drill down shows the page ins are from file system and occassional spike in executable page ins. Details as follow: oracle@perch:/files>> vmstat 5... (9 Replies)
Discussion started by: srage
9 Replies
Login or Register to Ask a Question