[uClibc] vfork() wrapper in libpthread: BAD!

Alexandre Oliva aoliva at redhat.com
Wed May 5 19:49:02 UTC 2004


On May  5, 2004, Erik Andersen <andersen at codepoet.org> wrote:

> On Tue May 04, 2004 at 05:33:13PM +0800, Rogelio Serrano wrote:
>> I see. Is it feasible to fixup all the pointers in the child? 
>> Its easy for the code section i think but i dont know if it 
>> could be done for the data and bss sections and the stack.

> Exactly.  I think it would be difficult to get this correct.
> Perhaps using position independent executables (PIEs) would
> help, but I've not really thought through it.

It would help for the data segment and the GOT, but not for pointers
held in the stack or the heap.  Also, you can't just reapply
relocations in the data segment, since the program might have already
changed them to point elsewhere.

We'd need about as much information as a copying garbage collector
needs, and we don't have anywhere close to that information, even in a
program with debug information.

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}



More information about the uClibc mailing list