Adding custom code to the .init section of a library

Priya Narasimhan <priya@alpha.ece.ucsb.edu>
16 Nov 1999 23:50:48 -0500

          From comp.compilers

Related articles
Adding custom code to the .init section of a library priya@alpha.ece.ucsb.edu (Priya Narasimhan) (1999-11-16)
Re: Adding custom code to the .init section of a library fjh@cs.mu.OZ.AU (1999-11-18)
Re: Adding custom code to the .init section of a library mwh@gradin.cis.upenn.edu (1999-11-18)
Re: Adding custom code to the .init section of a library zandy@cs.wisc.edu (Victor Zandy) (1999-11-18)
Re: Adding custom code to the .init section of a library plakal@cs.wisc.edu (1999-11-18)
| List of all articles for this month |
From: Priya Narasimhan <priya@alpha.ece.ucsb.edu>
Newsgroups: comp.compilers
Date: 16 Nov 1999 23:50:48 -0500
Organization: University of California, Santa Barbara
Keywords: C, question, linker, comment

Hi,


On a SPARC Solaris 2.x machine, I am able to add custom code
to the .init section of a library using


#pragma init (blah-blah)


where blah-blah() is written in C code. How can I do this on
an Intel machine running RedHatLinux 6.0 with gcc? I tried the
#pragma init, and it did not work. I really would like to add
something to the .init section so that every executable that
links with my library can take advantage of the custom code
within the library.


Thank you in advance.


-- Priya Narasimhan


------------------------------------------------------------------------
Priya Narasimhan
Graduate Student Researcher, Email: priya@alpha.ece.ucsb.edu
ECE Department, URL : http://alpha.ece.ucsb.edu/~priya
University of California, Tel : (805) 893-7788
Santa Barbara. CA 93106 Fax : (805) 893-3262
[I told him to use a C++ static constructor. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.