General
cancel
Showing results for 
Search instead for 
Did you mean: 

executable size 4 times greater than in linux

SOLVED
Go to solution
uiqbal
Advisor

executable size 4 times greater than in linux

Hi,

I just wanted to know that why are hp ux binaries bigger in size? I have red hat linux and hp pa-risc machine and all the binaries are 4 times that of linux. I have done strip on all the binaries for both linux and hp ux.

Can someone assist me on this -- whether something is fixed in hp to be of greater size than actually be utilized i.e. code, data, stack or bss etc?

Any help in this matter would be greatly appreciated.

Best regards,
Raj
8 REPLIES
Dennis Handly
Acclaimed Contributor

Re: executable size 4 times greater than in linux

As mentioned in my replies in the threads that JRF mentioned, it helps to compare just the important parts of your executables.
What does size(1) show for you on HP-UX vs linux?

Note: That Integrity may be another 2 X bigger than PA.
uiqbal
Advisor

Re: executable size 4 times greater than in linux

Hi,

Yes I have checked with the size command -- Here are my analysis on the portable code binaries.

On suse linux the size command gives this.

-----------------
suse01> size cr_api
14724952(text)
919444(data)
239856(bss)
15884252= 15 MB (dec)
f25fdc (hex)
cr_api.linux (filename)

14 mb TEXT SIZE
-----------------
hpparisc>size cr_api

23738645 + 4586336 + 188380 = (total)28513361 = 27 MB

22 MB TEXT
-----------------
Total difference in text size is 8 MB which is almost the main difference.

Can you let me know how to reduce the text size -- I have tried using -O for optimization on space but doesn't give anything.

strip is run on both the binaries.

For hp my compile and link flags are this using aCC

CSPEC_COPTS = +Z +DAportable -L.
-L$(BUILD_DIR) -AA -O2 -mt -DCR_BIG_ENDIAN -DCR_INLINE_NOT_SUPPORTED -D_LARGEFILE64_SOURCE

CSPEC_LOPTS = +DAportable -Wl,+s -L. -L$(BUILD_DIR) -AA -mt -lm -lsec -lpthread

Best regards,
Raj
James R. Ferguson
Acclaimed Contributor

Re: executable size 4 times greater than in linux

HI (again) Raj:

Why do you care whether a binary for one architecture is larger or smaller than a binary executable for another?

What matters to me is optimization at runtime together with clarity and maintainablity of the source.

Regards!

...JRF...
uiqbal
Advisor

Re: executable size 4 times greater than in linux

Dear JRF,

Ok fine i will do with the optimization and clarity but i just wanted to know why is the size different -- can i do some steps to reduce the text(code) size?

This will help me in making my installer smaller which is the main reason.

Where is the size increasing, what can i do to decrease it?

Best regards,
Raja
Dennis Handly
Acclaimed Contributor
Solution

Re: executable size 4 times greater than in linux

>Can you let me know how to reduce the text size?

Why? Text size is free. Only data matters, especially if you have lots of users of the program.

The increase of instructions is related to PA-RISC vs CISC.
Also using -AA may bloat it with templates.

>This will help me in making my installer smaller which is the main reason.

Does it fit on a CD?

>Where is the size increasing, what can I do to decrease it?

Basically you are asking something that has no easy answers. I suppose you could use nm(1) and look at the sizes of each function.
uiqbal
Advisor

Re: executable size 4 times greater than in linux

Hi,

Ok settled -- it has to do something with the RISC architecture but what's the thing with intel itanium binaries being even bigger?
Does it have even bigger instruction set than RISC


Cheers,
Raja
Dennis Handly
Acclaimed Contributor

Re: executable size 4 times greater than in linux

>Does it have even bigger instruction set than RISC?

Yes, each instruction bundle is 128 bits. And if not optimized, lots of NOPs.
But the size of data should be the similar to PA's.
Also objects and executables contain lots more fluff.