cvs commit: fptools/ghc/compiler/nativeGen
wolfgang at haskell.org
Fri Jan 14 17:12:57 EST 2005
wolfgang 2005/01/14 14:12:57 PST
ghc/compiler/nativeGen PositionIndependentCode.hs PprMach.hs
When -dynamic is specified but -fPIC is not, generate code that works around
the ELF dynamic linker's misguided attempts to keep the main program unaware
of dynamic linking.
This involves generating indirect references and computed jumps for position
dependent code, too, and making all constant data sections writable in order
to persuade ld to not use "COPY" relocations.
Tested on powerpc-linux; in theory, it also applies to i386-linux, but other
parts of the PIC story are missing there.
Note that the writable-const-data hack could be improved a bit by
distinguishing between "really" constant data and "relocatable" constant data,
which would be a nice thing to do anyway.
Revision Changes Path
1.6 +61 -37 fptools/ghc/compiler/nativeGen/PositionIndependentCode.hs
1.4 +10 -1 fptools/ghc/compiler/nativeGen/PprMach.hs
More information about the Cvs-ghc