From: Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
To: libc-alpha@sourceware.org, Fangrui Song <maskray@google.com>
Subject: [PATCH 0/7] Fixing remaining lld issues
Date: Tue, 15 Nov 2022 16:31:52 -0300 [thread overview]
Message-ID: <20221115193159.173838-1-adhemerval.zanella@linaro.org> (raw)
There are still some issue while trying to build and check glibc
with lld:
- The vtables hardening are not enabled with --with-default-link=no
(tst-relro-libc fails [1]) and with --with-default-link=yes also
requires ld.bfd to be available [2]. Furthermore, only lld 15
supports custom RELRO sections in linker script.
- elf/tst-audit25 assumes a specific symbol order, where lld and bfd
differs slight.
First patch fixes an issue with --with-binutils, where the specified
linker is not used for some early checks. It trigger additional
test failures with lld if --with-binutils is used to override the
default linker.
Second patch fixes tst-audit25 symbol order.
Third, forth, and fifth removes the --with-default-link by moving the
_IO_cleanup (used on exit) to call_function_static_weak, by replacing
libc_freeres_ptrs and libc_subfreeres with weak function calls, and by
refactoring the vtables hardening with a array placed directly on
RELRO segment.
Finally --with-default-link is removed and set-hooks.h mechanism
(which is a clunky interface) is moved to be Hurd-only.
I checked on all affected ABIs and did a full test on both x86_64
and aarch64.
[1] https://sourceware.org/bugzilla/show_bug.cgi?id=25812
[2] https://sourceware.org/git/?p=glibc.git;a=commit;h=2ae7990542e1955097aa21943e416dec70f867fa
Adhemerval Zanella (7):
configure: Move locale tools early
elf: Do not assume symbol order on tst-audit25{a,b}
stdlib: Move _IO_cleanup to call_function_static_weak
Move libc_freeres_ptrs and libc_subfreeres to weak functions
libio: Remove the usage of __libc_IO_vtables
Remove --with-default-link configure option
Remove set-hooks.h from generic includes
INSTALL | 6 -
Makerules | 55 +-
config.make.in | 1 -
configure | 2169 ++++++++---------
configure.ac | 245 +-
crypt/md5-crypt.c | 10 +-
crypt/sha256-crypt.c | 10 +-
crypt/sha512-crypt.c | 10 +-
elf/Makefile | 23 +-
elf/dl-libc.c | 4 +-
elf/tst-audit25.h | 46 +
elf/tst-audit25a.c | 38 +-
elf/tst-audit25b.c | 39 +-
grp/fgetgrent.c | 8 +-
gshadow/fgetsgent.c | 2 +-
{include => hurd}/set-hooks.h | 0
iconv/gconv_cache.c | 3 +-
iconv/gconv_conf.c | 3 +-
iconv/gconv_db.c | 6 +-
iconv/gconv_dl.c | 5 +-
iconvdata/extra-module.mk | 2 +-
include/libc-symbols.h | 91 +-
inet/getnameinfo.c | 8 +-
inet/getnetgrent.c | 8 +-
inet/rcmd.c | 8 +-
inet/rexec.c | 8 +-
intl/dcigettext.c | 3 +-
intl/finddomain.c | 2 +-
intl/loadmsgcat.c | 1 -
intl/localealias.c | 15 +-
libio/Makefile | 2 +
libio/fileops.c | 81 +-
libio/genops.c | 10 +-
libio/iofopncook.c | 60 +-
libio/iopopen.c | 25 -
libio/iovsprintf.c | 26 +-
libio/libio-macros.sym | 7 +
libio/libioP.h | 312 ++-
libio/memstream.c | 32 +-
libio/obprintf.c | 34 +-
libio/oldfileops.c | 23 -
libio/oldiopopen.c | 23 -
libio/stdio.c | 3 +
libio/strfile.h | 5 -
libio/strops.c | 24 -
libio/tst-vtables-interposed.c | 5 +
libio/vsnprintf.c | 29 +-
libio/vswprintf.c | 30 +-
libio/vtables.c | 502 ++++
libio/wfileops.c | 79 +-
libio/wmemstream.c | 32 +-
libio/wstrops.c | 24 -
locale/loadarchive.c | 2 +-
locale/localeinfo.h | 4 +-
locale/setlocale.c | 4 +-
login/getutent.c | 8 +-
login/getutid.c | 8 +-
login/getutline.c | 8 +-
malloc/set-freeres.c | 222 +-
malloc/thread-freeres.c | 2 +-
manual/install.texi | 6 -
misc/efgcvt-template.c | 8 +-
misc/efgcvt.c | 1 +
misc/fstab.c | 3 +-
misc/hsearch.c | 4 -
misc/mntent.c | 8 +-
misc/qefgcvt.c | 1 +
misc/unwind-link.c | 2 +-
nptl/nptlfreeres.c | 1 -
nscd/nscd_getgr_r.c | 3 +-
nscd/nscd_gethst_r.c | 3 +-
nscd/nscd_getpw_r.c | 3 +-
nscd/nscd_getserv_r.c | 3 +-
nscd/nscd_netgroup.c | 3 +-
nss/getXXbyYY.c | 10 +-
nss/getXXent.c | 10 +-
nss/nss_action.c | 2 +-
nss/nss_database.c | 2 +-
nss/nss_module.c | 2 +-
posix/regcomp.c | 3 +-
posix/register-atfork.c | 3 +-
pwd/fgetpwent.c | 8 +-
resolv/gai_misc.c | 3 +-
resolv/res-close.c | 2 -
resolv/res_hconf.c | 9 +-
resolv/resolv_conf.c | 3 +-
resolv/tst-leaks2.c | 2 +
rt/aio_misc.c | 3 +-
shadow/fgetspent.c | 8 +-
stdio-common/reg-modifier.c | 3 +-
stdio-common/reg-printf.c | 9 +-
stdio-common/reg-type.c | 9 +-
stdio-common/vfprintf-internal.c | 60 +-
stdlib/exit.c | 6 +-
stdlib/fmtmsg.c | 3 +-
stdlib/setenv.c | 3 +-
sunrpc/clnt_perr.c | 4 +-
sunrpc/rpc_thread.c | 1 -
sunrpc/tst-svc_register.c | 6 +-
sysdeps/generic/set-freeres-fp.h | 19 +
sysdeps/generic/set-freeres-os.h | 19 +
sysdeps/generic/set-freeres-system.h | 27 +
.../ldbl-128ibm-compat/ieee128-qefgcvt.c | 1 +
.../ldbl-128ibm-compat/set-freeres-fp.h | 22 +
sysdeps/mach/hurd/bits/errno.h | 1 -
sysdeps/posix/getaddrinfo.c | 5 +-
sysdeps/posix/ttyname.c | 8 +-
sysdeps/unix/sysv/linux/check_pf.c | 3 +-
sysdeps/unix/sysv/linux/set-freeres-os.h | 24 +
sysdeps/unix/sysv/linux/ttyname.c | 3 +-
time/tzfile.c | 8 +-
time/tzset.c | 3 +-
112 files changed, 2618 insertions(+), 2203 deletions(-)
create mode 100644 elf/tst-audit25.h
rename {include => hurd}/set-hooks.h (100%)
create mode 100644 libio/libio-macros.sym
create mode 100644 sysdeps/generic/set-freeres-fp.h
create mode 100644 sysdeps/generic/set-freeres-os.h
create mode 100644 sysdeps/generic/set-freeres-system.h
create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/set-freeres-fp.h
create mode 100644 sysdeps/unix/sysv/linux/set-freeres-os.h
--
2.34.1
next reply other threads:[~2022-11-15 19:32 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-15 19:31 Adhemerval Zanella via Libc-alpha [this message]
2022-11-15 19:31 ` [PATCH 1/7] configure: Move locale tools early Adhemerval Zanella via Libc-alpha
2022-11-15 19:31 ` [PATCH 2/7] elf: Do not assume symbol order on tst-audit25{a,b} Adhemerval Zanella via Libc-alpha
2022-12-12 12:36 ` Adhemerval Zanella Netto via Libc-alpha
2022-11-15 19:31 ` [PATCH 3/7] stdlib: Move _IO_cleanup to call_function_static_weak Adhemerval Zanella via Libc-alpha
2022-12-12 10:52 ` Florian Weimer via Libc-alpha
2022-12-13 16:52 ` Joseph Myers
2022-11-15 19:31 ` [PATCH 4/7] Move libc_freeres_ptrs and libc_subfreeres to weak functions Adhemerval Zanella via Libc-alpha
2022-12-12 10:55 ` Florian Weimer via Libc-alpha
2022-12-12 13:14 ` Adhemerval Zanella Netto via Libc-alpha
2022-12-12 10:58 ` Florian Weimer via Libc-alpha
2022-12-12 13:16 ` Adhemerval Zanella Netto via Libc-alpha
2022-12-12 11:00 ` Florian Weimer via Libc-alpha
2022-12-12 13:49 ` Adhemerval Zanella Netto via Libc-alpha
2022-12-12 14:05 ` Florian Weimer via Libc-alpha
2022-12-12 14:16 ` Adhemerval Zanella Netto via Libc-alpha
2022-12-12 15:39 ` Florian Weimer via Libc-alpha
2022-12-12 11:05 ` Andreas Schwab via Libc-alpha
2022-12-12 13:49 ` Adhemerval Zanella Netto via Libc-alpha
2022-12-12 11:08 ` Florian Weimer via Libc-alpha
2022-12-12 13:51 ` Adhemerval Zanella Netto via Libc-alpha
2022-11-15 19:31 ` [PATCH 5/7] libio: Remove the usage of __libc_IO_vtables Adhemerval Zanella via Libc-alpha
2022-12-12 11:40 ` Florian Weimer via Libc-alpha
2022-11-15 19:31 ` [PATCH 6/7] Remove --with-default-link configure option Adhemerval Zanella via Libc-alpha
2022-11-15 19:31 ` [PATCH 7/7] Remove set-hooks.h from generic includes Adhemerval Zanella via Libc-alpha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221115193159.173838-1-adhemerval.zanella@linaro.org \
--to=libc-alpha@sourceware.org \
--cc=adhemerval.zanella@linaro.org \
--cc=maskray@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).