Subject: Re: src/gnu/usr.bin/egcs/common
To: None <>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-userlevel
Date: 12/21/1999 22:37:46
>> [W]e still won't be able to change the size of FILE for a long time
>> -- so long as we require backwards compatibility with NetBSD from
>> three years ago.

> If this is true, it's only true because of (dynamic) linker issues.
> (some would say "bugs.")

> if the data definitions of the variables are in the shared library,
> and nothing uses their fields directly (or their fields can be used
> in a 'safe' way directly), you should be fine.

Recall what the historical definitions - the ones with which we'd need
to be compatible - are:

#define stdin  (&__sF[0])
#define stdout (&__sF[1])
#define stderr (&__sF[2])

(The symbol name may vary; these are from stdio.h 1.30.)  This means
that an old executable will contain a reference to __sF, regardless of
which filehandle is being used - the code will simply include an offset
for stdout and stderr.

The point is, this offset depends on sizeof(FILE)!  The application's
compiled-in idea of sizeof(FILE) must match the layout of the __sF
array, or you're screwed.

And this is independent of the dynamic linker, as far as I can see.

					der Mouse

		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B