This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Function Prologue and epilogue
- To: <fhsu at ic dot sunysb dot edu>
- Subject: Re: Function Prologue and epilogue
- From: "Christian Häggström" <97nv46 at skola dot kiruna dot se>
- Date: Fri, 12 May 2000 13:13:48 +0200
- Cc: <gcc at gcc dot gnu dot org>
> Now I want to add some instrutions into each prologue and epilogue
> Does any one know where is the correct place to add the instructions?
Look at ix86_propogue() and ix86_epilogue() in i386.c
> Does gcc always allocate addresses for global initialized variables
> according to the file order, in which the variables are defined, in
> the command line? (ie. Does global initialized variable in the files
> appearing earlier in the command line will be assigned lower addresses
> in the virtual memory address space?)
Staightforward is the fastest way to go. But I think you should not depend on this, the compiler is free to rearrange variables, for example to hit a cache line boundary.
If your application really depends on this, you should compile with -fdata-sections,
and then move around the sections in a linker script (or similar) to your like.