This is the mail archive of the gcc-patches@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: ia64 crt files tweek


On Thu, 22 Feb 2001, Richard Henderson wrote:

> ia64-aix, like powerpc-aix, does not maintain a fixed link-time
> offset between text and data segments.  Thus you cannot use gp-
> relative offsets to text data.

I don't know too much about the ia64 toolchain, so maybe this isn't
corrent, but...

One implication of the above is that people who write

  extern int foo;

when they really want

  extern const int foo;

will find mysterious breakages, because the first implies a gprel data
segment reference, while the second is a text segment reference.

Can't you do something in the linker to detect a gprel reloc to a text
segment symbol and fix it magically?
eg. see bfd/elf32-hppa.c:final_link_relocate around line 3288.


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