Rafael Espíndola writes:
 > > because that is what the language standard says.
 > >
 > > In general, the difference between two global pointers is something
 > > known only to the linker -- too late to evaluate as constant
 > > expression.
 > 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.
 > 
 > The reason why I want to do this is to avoid relocations when a dso is
 > loaded. Using the difference of two pointer I could build a constant
 > table and add one of the pointers at runtime.

This isn't possible with global symbols in a DSO because some other
DSO (or indeed the exe) might also define one of the symbols.

Andrew.

Reply via email to