This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Function Prologue and epilogue


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]