1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

libio: Eliminate _IO_stdin, _IO_stdout, _IO_stderr

These variables are only used to determine if a stdio stream is
a pre-allocated stream, but it is possible to do so by comparing
a FILE * to all pre-allocated stream objects.  As a result, it is
not necessary to keep those pointers in separate variables.

Behavior with symbol interposition is unchanged because _IO_stdin_,
_IO_stdout_, _IO_stderr_ are exported, and refer to objects outside of
libc if symbol interposition or copy relocations are involved.  (The
removed variables _IO_stdin, _IO_stdout, _IO_stderr were not exported,
of course.)
This commit is contained in:
Florian Weimer
2019-02-18 11:49:54 +01:00
parent 6c29942cbf
commit a5406364ac
11 changed files with 65 additions and 51 deletions

View File

@ -33,14 +33,3 @@
FILE *stdin = (FILE *) &_IO_2_1_stdin_;
FILE *stdout = (FILE *) &_IO_2_1_stdout_;
FILE *stderr = (FILE *) &_IO_2_1_stderr_;
#undef _IO_stdin
#undef _IO_stdout
#undef _IO_stderr
#define AL(name) AL2 (name, _IO_##name)
#define AL2(name, al) \
extern __typeof (name) al __attribute__ ((alias (#name), \
visibility ("hidden")))
AL(stdin);
AL(stdout);
AL(stderr);