This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


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

RFC: Hurd startup code in current glibc development version


Hi all,

The startup code in the current development version of glibc does not
work for statically linked Hurd binaries.  The problem is that AFAIK
the Hurd exec server starts a program with an empty stack, and one of
the first things the current ELF i386 ABI does, is popping the
argument count off the stack, which isn't there of course.

I see three possible solutions for this problem:

* Change the ELF i386 ABI startup code.  Uli doesn't want this, and I
  tend to agree with him.  ABI compliant startup code should be ABI
  comliant startup code, and nothing more.

* Change the Hurd exec server in such a way that it always passes the
  arguments on the stack.  Apart from changes in the exec server, this
  would need changes in the Hurd specific glibc startup code too.

* Create special startup code for statically linked Hurd binaries.
  This startup code would first setup a proper ABI compliant stack
  before jumping to the origional startup code.  Changes to the glibc
  would be minimal, but the gcc specs file needs to be changed.

The last option seems to be the cleanest solution to me.  A logical
choice for the startup code for statically linked binaries would be
crt0.o, but there may be something against this.

Anyway, I've got some patches lying around to implement this, and at
least a simple `Hello, World!' program works.

Mark


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