niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » *nix » HP-UX
aCC option to load all the symbols during linking
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
Bujji
*nix forums beginner


Joined: 29 Mar 2006
Posts: 8

PostPosted: Fri Jul 14, 2006 6:18 pm    Post subject: aCC option to load all the symbols during linking Reply with quote

Hi,
Is there any option for aCC compiler to load all the symbols during
linking (with +O2 option enable)?

When I create an executable with +O2 option, it is not loading all the
functions into the executable (Not loading functions that are not
called in the execution).

But I want to have all the functions(symbols) loaded during the
creation of the executable.

Thanks,
Bujji
Back to top
Paul Pluzhnikov
*nix forums Guru


Joined: 25 Mar 2005
Posts: 512

PostPosted: Fri Jul 14, 2006 8:55 pm    Post subject: Re: aCC option to load all the symbols during linking Reply with quote

"Bujji" <bujji55555@yahoo.com> writes:

Quote:
Is there any option for aCC compiler to load all the symbols during
linking (with +O2 option enable)?

No: aCC doesn't *do* linking; the system linker does that.

Quote:
When I create an executable with +O2 option, it is not loading all the
functions into the executable (Not loading functions that are not
called in the execution).

Presumably you are linking with archive libraries, and you want
the equivalent of the GNU-ld --whole-archive ...

AFAICT, there is no matching HP ld flag.

One way to achive that is to list all symbols you want to be included
in the link with '-u sym1 -u sym2 ...'

Another option is to "blow up" the archive:

mkdir tmp.$$ && cd tmp.$$ &&
ar x /path/to/archive.a &&
cd .. && aCC -o foo.exe main.o tmp.$$/*.o &&
rm -rf tmp.$$

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
Back to top
Dennis Handly
*nix forums beginner


Joined: 28 Jun 2005
Posts: 38

PostPosted: Sat Jul 15, 2006 8:25 am    Post subject: Re: aCC option to load all the symbols during linking Reply with quote

Paul Pluzhnikov wrote:
: AFAICT, there is no matching HP ld flag.

There is +[no]forceload for IPF and PA64. And -Fl for PA32.

: ... included in the link with '-u sym1 -u sym2 ...'
: Another option is to "blow up" the archive:

Yes.

"Bujji" got some answers in CXX-DEV.
http://h21007.www2.hp.com/dspp/comm/comm_Community_Home_IDX/1,1273,,00.html
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Mon Dec 01, 2008 10:15 pm | All times are GMT
navigation Forum index » *nix » HP-UX
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Is there a boot loader that can load a file a start up an... christopher.mcrorie@gmail Setup 1 Thu Jul 20, 2006 2:57 am
No new posts Linking Tables from 2 databases Pratik Shukla PostgreSQL 2 Wed Jul 19, 2006 5:54 pm
No new posts Load balancing outgoing messages Pierre VANNIER Postfix 2 Wed Jul 19, 2006 8:21 am
No new posts Announce: LBPool 1.0 beta1 (Load Balancing JDBC Connectio... Kevin Burton MySQL 2 Wed Jul 19, 2006 5:35 am
No new posts Advise on load Robert Fitzpatrick Postfix 5 Tue Jul 18, 2006 4:22 pm

Credit Cards | Personal Loans | Web Advertising | Project cars for sale | Secured Loans
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2807s ][ Queries: 16 (0.1877s) ][ GZIP on - Debug on ]