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]
Other format: [Raw text]

Re: why the difference of two global pointers is not a constant?


On Tue, 2006-07-25 at 10:49 -0700, Mike Stump wrote:
> On Jul 25, 2006, at 5:00 AM, Rafael Espíndola wrote:
> > In the particular case of two static functions or two static global
> > pointers, it is possible for the compiler to compute it. Isn't it? I
> > think that the linker will reorder the sections, but not the functions
> > inside a section.
> 
> :-)  Your assumption would not be accurate for all the machines gcc  
> targets.  darwin in particular can and does such reordering.
As does HP-UX as can Solaris, Linux and anything using ELF in
conjunction with -ffunction-sections.

jeff


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