diff options
author | Zack Weinberg <zackw@panix.com> | 2017-12-27 12:56:04 -0500 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2017-12-27 12:56:04 -0500 |
commit | db922eaf0d7df3b917b6b693081219ca6065ec9e (patch) | |
tree | f1320cf66747a8554eeddf2503ff1f14abe578da /sysdeps | |
parent | 7959f855a7c739602a2227c85563650b28d8a0cf (diff) | |
download | glibc-zack/libio-minimization.tar.gz |
Fix problems found by build-many-glibcs.zack/libio-minimization
Most of these have something to do with either old stdio or ldbl-opt.
The changes surrounding PLT bypass for ldbl-affected symbols are a bit
of a bodge but at least they seem to preserve the ABI expectations.
* include/libc-symbols.h (hidden_weak_ver, libc_hidden_weak_ver):
New macros.
* sysdeps/generic/math_ldbl_opt.h (ldbl_hidden_weak): New macro.
* sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h: Also add it.
* libio/iovsprintf.c: Use ldbl_hidden_weak to define vsprintf.
* libio/iovsscanf.c: Use ldbl_hidden_weak to define __vsscanf.
* libio/vasprintf.c: Use strong_alias + ldbl_hidden_def to define
__vasprintf.
* libio/vsnprintf.c: Use ldbl_hidden_weak to define __vsnprintf.
* libio/iolibio.h: Add a multiple inclusion guard. Use FILE
instead of _IO_FILE, __fpos_t instead of _IO_fpos_t, __fpos64_t
instead of _IO_fpos64_t, size_t instead of _IO_size_t, BUFSIZ
instead of _IO_BUFSIZ, and __gnuc_va_list instead of _IO_va_list.
Move the definitions of _IO_pos_BAD, _IO_fileno, _IO_clearerr,
_IO_fseek, and _IO_rewind...
* libio/libioP.h: ...here.
* conform/data/stdio.h-data: Use __gnuc_va_list instead of _G_va_list.
* sysdeps/ieee754/ldbl-opt/nldbl-compat.c: Include libioP.h.
* sysdeps/ieee754/ldbl-opt/nldbl-compat.h: Use va_list instead
of _G_va_list. Declare __nldbl__IO_vfscanf by hand.
* sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c: Use __gnuc_va_list
instead of _IO_va_list.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/generic/math_ldbl_opt.h | 1 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h | 2 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-opt/nldbl-compat.c | 1 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-opt/nldbl-compat.h | 19 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c | 2 |
5 files changed, 15 insertions, 10 deletions
diff --git a/sysdeps/generic/math_ldbl_opt.h b/sysdeps/generic/math_ldbl_opt.h index 8a5d8ba107..a4b3806a10 100644 --- a/sysdeps/generic/math_ldbl_opt.h +++ b/sysdeps/generic/math_ldbl_opt.h @@ -9,6 +9,7 @@ #define LONG_DOUBLE_COMPAT(lib, introduced) 0 #define long_double_symbol(lib, local, symbol) #define ldbl_hidden_def(local, name) libc_hidden_def (name) +#define ldbl_hidden_weak(local, name) libc_hidden_weak (name) #define ldbl_strong_alias(name, aliasname) strong_alias (name, aliasname) #define ldbl_weak_alias(name, aliasname) weak_alias (name, aliasname) #define __ldbl_is_dbl 0 diff --git a/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h b/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h index af861c11ea..5994240aab 100644 --- a/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h +++ b/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h @@ -12,6 +12,7 @@ long_double_symbol_1 (lib, local, symbol, LONG_DOUBLE_COMPAT_VERSION) #ifdef SHARED # define ldbl_hidden_def(local, name) libc_hidden_ver (local, name) +# define ldbl_hidden_weak(local, name) libc_hidden_weak_ver (local, name) # define ldbl_strong_alias(name, aliasname) \ strong_alias (name, __GL_##name##_##aliasname) \ long_double_symbol (libc, __GL_##name##_##aliasname, aliasname); @@ -22,6 +23,7 @@ versioned_symbol (lib, local, symbol, version) #else # define ldbl_hidden_def(local, name) libc_hidden_def (name) +# define ldbl_hidden_weak(local, name) libc_hidden_weak (name) # define ldbl_strong_alias(name, aliasname) strong_alias (name, aliasname) # define ldbl_weak_alias(name, aliasname) weak_alias (name, aliasname) # ifndef __ASSEMBLER__ diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c index 3e0143529a..db51822f90 100644 --- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c +++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c @@ -25,6 +25,7 @@ #include <locale/localeinfo.h> #include <sys/syslog.h> #include <libc-lock.h> +#include <libio/libioP.h> #include "nldbl-compat.h" diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h index 72ec0db390..64dfa7906b 100644 --- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h +++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h @@ -36,7 +36,6 @@ /* Declare the __nldbl_NAME function the wrappers call that's in libc.so. */ #define NLDBL_DECL(name) extern __typeof (name) __nldbl_##name -NLDBL_DECL (_IO_vfscanf); NLDBL_DECL (vfscanf); NLDBL_DECL (vfwscanf); NLDBL_DECL (obstack_vprintf); @@ -82,23 +81,25 @@ extern ssize_t __nldbl___vstrfmon (char *, size_t, const char *, va_list) /* These don't use __typeof because they were not declared by the headers, since we don't compile with _FORTIFY_SOURCE. */ extern int __nldbl___vfprintf_chk (FILE *__restrict, int, - const char *__restrict, _G_va_list); + const char *__restrict, va_list); extern int __nldbl___vfwprintf_chk (FILE *__restrict, int, - const wchar_t *__restrict, __gnuc_va_list); + const wchar_t *__restrict, va_list); extern int __nldbl___vsprintf_chk (char *__restrict, int, size_t, - const char *__restrict, _G_va_list) __THROW; + const char *__restrict, va_list) __THROW; extern int __nldbl___vsnprintf_chk (char *__restrict, size_t, int, size_t, - const char *__restrict, _G_va_list) + const char *__restrict, va_list) __THROW; extern int __nldbl___vswprintf_chk (wchar_t *__restrict, size_t, int, size_t, - const wchar_t *__restrict, __gnuc_va_list) + const wchar_t *__restrict, va_list) __THROW; -extern int __nldbl___vasprintf_chk (char **, int, const char *, _G_va_list) +extern int __nldbl___vasprintf_chk (char **, int, const char *, va_list) __THROW; -extern int __nldbl___vdprintf_chk (int, int, const char *, _G_va_list); +extern int __nldbl___vdprintf_chk (int, int, const char *, va_list); extern int __nldbl___obstack_vprintf_chk (struct obstack *, int, const char *, - _G_va_list) __THROW; + va_list) __THROW; extern void __nldbl___vsyslog_chk (int, int, const char *, va_list); +/* This function is not declared by stdio.h anymore. */ +extern int __nldbl__IO_vfscanf (FILE *, const char *, va_list, int *); #endif /* __NLDBL_COMPAT_H */ diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c b/sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c index 05581c0354..ffb7d788fe 100644 --- a/sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c +++ b/sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c @@ -2,7 +2,7 @@ int attribute_hidden -_IO_vfscanf (FILE *s, const char *fmt, _IO_va_list ap, int *errp) +_IO_vfscanf (FILE *s, const char *fmt, __gnuc_va_list ap, int *errp) { return __nldbl__IO_vfscanf (s, fmt, ap, errp); } |