Problems with glibc startup code on the Hurd

Mark Kettenis kettenis@phys.uva.nl
Wed Jun 3 05:31:00 GMT 1998


Hi!

The current i386/elf startup code doesn't work for the Hurd.  The
problem is that on the Hurd `__libc_init_first' has to be called from
the initial stack frame.  Since the introduction of the
`__libc_start_main' function this no longer is the case.

I don't think it is possible to change the Hurd specific
`__libc_init_first' function since it does some non-trivial stack
manipulations.  So we need to change `sysdeps/i386/elf/start.S'.

One solution is to revert the changes made on 1998-03-08, but this is
probably not a good idea, since on all other architectures
`__libc_start_main' is used too.

An other solution is to introduce a new function, let's say
`__libc_setup_stack', that is called early from `_start'.  On the Hurd
this function would setup the stack (and most if not all Hurd-specific
initializations). For Linux(and other ports) it would do nothing.
`__libc_init_first' would then do the initialization of the library.

I can provide a patch for such a change, but since changing the
startup code has a high risk of introducing binary
incompatibilities. we should really think this over before applying it.

Mark





More information about the Libc-hacker mailing list