Skip to content
  • wolfgang's avatar
    [project @ 2005-01-14 22:12:54 by wolfgang] · acea64ed
    wolfgang authored
    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.
    acea64ed