diff mbox series

Change _IO_stderr_/_IO_stdin_/_IO_stdout to compat symbols [BZ #31766]

Message ID 20240521023058.1659308-1-hjl.tools@gmail.com
State New
Headers show
Series Change _IO_stderr_/_IO_stdin_/_IO_stdout to compat symbols [BZ #31766] | expand

Commit Message

H.J. Lu May 21, 2024, 2:30 a.m. UTC
Since Glibc never provides symbol binary compatibility for relocatable
files, fix BZ #31766 by changing _IO_stderr_/_IO_stdin_/_IO_stdout to
compat symbols.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
---
 libio/oldstdfiles.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Sunil Pandey May 21, 2024, 4:26 p.m. UTC | #1
On Mon, May 20, 2024 at 7:31 PM H.J. Lu <hjl.tools@gmail.com> wrote:

> Since Glibc never provides symbol binary compatibility for relocatable
> files, fix BZ #31766 by changing _IO_stderr_/_IO_stdin_/_IO_stdout to
> compat symbols.
>
> Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
> ---
>  libio/oldstdfiles.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/libio/oldstdfiles.c b/libio/oldstdfiles.c
> index 30581dfad4..a6a908a248 100644
> --- a/libio/oldstdfiles.c
> +++ b/libio/oldstdfiles.c
> @@ -48,6 +48,10 @@ DEF_STDFILE(_IO_stdin_, 0, 0, _IO_NO_WRITES);
>  DEF_STDFILE(_IO_stdout_, 1, &_IO_stdin_, _IO_NO_READS);
>  DEF_STDFILE(_IO_stderr_, 2, &_IO_stdout_, _IO_NO_READS+_IO_UNBUFFERED);
>
> +compat_symbol (libc, _IO_stdin_, _IO_stdin_, GLIBC_2_0);
> +compat_symbol (libc, _IO_stdout_, _IO_stdout_, GLIBC_2_0);
> +compat_symbol (libc, _IO_stderr_, _IO_stderr_, GLIBC_2_0);
> +
>  #if defined __GNUC__ && __GNUC__ >= 2
>
>  #include <stdio.h>
> --
> 2.45.1
>
>
LGTM
Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>

--Sunil
diff mbox series

Patch

diff --git a/libio/oldstdfiles.c b/libio/oldstdfiles.c
index 30581dfad4..a6a908a248 100644
--- a/libio/oldstdfiles.c
+++ b/libio/oldstdfiles.c
@@ -48,6 +48,10 @@  DEF_STDFILE(_IO_stdin_, 0, 0, _IO_NO_WRITES);
 DEF_STDFILE(_IO_stdout_, 1, &_IO_stdin_, _IO_NO_READS);
 DEF_STDFILE(_IO_stderr_, 2, &_IO_stdout_, _IO_NO_READS+_IO_UNBUFFERED);
 
+compat_symbol (libc, _IO_stdin_, _IO_stdin_, GLIBC_2_0);
+compat_symbol (libc, _IO_stdout_, _IO_stdout_, GLIBC_2_0);
+compat_symbol (libc, _IO_stderr_, _IO_stderr_, GLIBC_2_0);
+
 #if defined __GNUC__ && __GNUC__ >= 2
 
 #include <stdio.h>