Re: Adding custom code to the .init section of a library

Victor Zandy <zandy@cs.wisc.edu>
18 Nov 1999 02:48:09 -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: Victor Zandy <zandy@cs.wisc.edu>
Newsgroups: comp.compilers
Date: 18 Nov 1999 02:48:09 -0500
Organization: CS Department, University of Wisconsin
References: 99-11-082
Keywords: linker

Priya Narasimhan <priya@alpha.ece.ucsb.edu> writes:
> #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


Define the function void _init() in your library, and put your init
code in it.


Add -nostartfiles to the link command for your library (this is a GNU
flag).


Vic
[Again, this seems specific to some versions of the GNU linker. -John]





Post a followup to this message

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