From 49e182c7376b0fa30c18d0b7003a8e84624494c0 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 21 May 2021 22:35:01 +0200 Subject: nptl: Remove remaining code from libpthread Only the placeholder compatibility symbols are left now. The __errno_location symbol was removed (moved) using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella --- nptl/Makefile | 46 +++----------------------------------------- nptl/Versions | 12 +----------- nptl/libpthread-compat.c | 10 +++++++--- nptl/nptl-init.c | 46 -------------------------------------------- nptl/pt-crti.S | 50 ------------------------------------------------ nptl/pt-interp.c | 1 - nptl/version.c | 41 --------------------------------------- 7 files changed, 11 insertions(+), 195 deletions(-) delete mode 100644 nptl/nptl-init.c delete mode 100644 nptl/pt-crti.S delete mode 100644 nptl/pt-interp.c delete mode 100644 nptl/version.c (limited to 'nptl') diff --git a/nptl/Makefile b/nptl/Makefile index a6e3b615a8..64cd0dcbf6 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -207,16 +207,8 @@ routines = \ shared-only-routines = forward static-only-routines = pthread_atfork -libpthread-routines = \ - libpthread-compat \ - nptl-init \ - pt-interp \ - version \ - -libpthread-shared-only-routines = \ - pt-allocrtsig \ - pt-interp \ - version \ +libpthread-routines = libpthread-compat +libpthread-shared-only-routines = libpthread-compat # Since cancellation handling is in large parts handled using exceptions # we have to compile some files with exception handling enabled, some @@ -382,7 +374,7 @@ else tests-printers-libs := $(static-thread-library) endif -LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst +LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete tests += tst-cancelx7 tst-cancelx17 @@ -432,17 +424,6 @@ $(objpfx)multidir.mk: $(common-objpfx)config.make echo "multidir := $$dir" > $@T mv -f $@T $@ -crti-objs := crti.o -crtn-objs := crtn.o -ifneq (,$(patsubst .,,$(multidir))) -generated-dirs += $(firstword $(subst /, , $(multidir))) -crti-objs += $(multidir)/crti.o -crtn-objs += $(multidir)/crtn.o -$(objpfx)$(multidir): - mkdir -p $@ -endif -extra-objs += $(crti-objs) $(crtn-objs) -extra-objs += pt-crti.o endif CFLAGS-ftrylockfile.c += $(libio-mtsafe) @@ -577,11 +558,6 @@ $(objpfx)tst-cancelx17: $(librt) LDLIBS-tst-cancel24 = -Wl,--no-as-needed -lstdc++ LDLIBS-tst-cancel24-static = $(LDLIBS-tst-cancel24) -extra-B-pthread.so = -B$(common-objpfx)nptl/ -$(objpfx)libpthread.so: $(addprefix $(objpfx),$(crti-objs) $(crtn-objs)) -$(objpfx)libpthread.so: +preinit += $(addprefix $(objpfx),$(crti-objs)) -$(objpfx)libpthread.so: +postinit += $(addprefix $(objpfx),$(crtn-objs)) - # Make sure we link with the thread library. ifeq ($(build-shared),yes) $(addprefix $(objpfx), \ @@ -601,23 +577,7 @@ $(addprefix $(objpfx),$(tests) $(test-srcs)): $(objpfx)libpthread.a endif ifeq ($(build-shared),yes) -$(objpfx)crti.o: $(objpfx)pt-crti.o - ln -f $< $@ - -ifneq ($(multidir),.) -$(objpfx)$(multidir)/crti.o: $(objpfx)crti.o $(objpfx)$(multidir)/ - ln -f $< $@ - -$(objpfx)$(multidir)/crtn.o: $(objpfx)crtn.o $(objpfx)$(multidir)/ - ln -f $< $@ -endif - generated += multidir.mk tst-tls6.out - -# Give libpthread.so an entry point and make it directly runnable itself. -LDFLAGS-pthread.so += -e __nptl_main -# pt-interp.c exists just to get the runtime linker path into libpthread.so. -$(objpfx)pt-interp.os: $(common-objpfx)runtime-linker.h endif tst-exec4-ARGS = $(host-test-program-cmd) diff --git a/nptl/Versions b/nptl/Versions index 0db56bce29..af62a47cca 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -426,17 +426,7 @@ libc { libpthread { GLIBC_2.0 { - _Exit; - _IO_flockfile; - _IO_ftrylockfile; - _IO_funlockfile; - __errno_location; - _exit; - flockfile; - ftrylockfile; - funlockfile; - pthread_create; - pthread_sigmask; + __libpthread_version_placeholder; } GLIBC_2.1 { diff --git a/nptl/libpthread-compat.c b/nptl/libpthread-compat.c index 2dcf175f3f..fb336d0685 100644 --- a/nptl/libpthread-compat.c +++ b/nptl/libpthread-compat.c @@ -28,6 +28,11 @@ __libpthread_version_placeholder_1 (void) } #endif +#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34) +compat_symbol (libpthread, __libpthread_version_placeholder_1, + __libpthread_version_placeholder, GLIBC_2_0); +#endif + #if (SHLIB_COMPAT (libpthread, GLIBC_2_1, GLIBC_2_2)) compat_symbol (libpthread, __libpthread_version_placeholder_1, __libpthread_version_placeholder, GLIBC_2_1); @@ -42,7 +47,7 @@ compat_symbol (libpthread, __libpthread_version_placeholder_1, __libpthread_version_placeholder, GLIBC_2_1_2); #endif -#if SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_2_3) \ +#if SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_3) \ && ABI_libpthread_GLIBC_2_2 != ABI_libpthread_GLIBC_2_0 compat_symbol (libpthread, __libpthread_version_placeholder_1, __libpthread_version_placeholder, GLIBC_2_2); @@ -88,8 +93,7 @@ compat_symbol (libpthread, __libpthread_version_placeholder_1, __libpthread_version_placeholder, GLIBC_2_12); #endif -#if SHLIB_COMPAT (libpthread, GLIBC_2_18, GLIBC_2_19) \ - && ABI_libpthread_GLIBC_2_18 != ABI_libpthread_GLIBC_2_0 +#if SHLIB_COMPAT (libpthread, GLIBC_2_18, GLIBC_2_19) compat_symbol (libpthread, __libpthread_version_placeholder_1, __libpthread_version_placeholder, GLIBC_2_18); #endif diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c deleted file mode 100644 index 5a460aedba..0000000000 --- a/nptl/nptl-init.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (C) 2002-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void -__pthread_initialize_minimal_internal (void) -{ -} -strong_alias (__pthread_initialize_minimal_internal, - __pthread_initialize_minimal) diff --git a/nptl/pt-crti.S b/nptl/pt-crti.S deleted file mode 100644 index e618986f98..0000000000 --- a/nptl/pt-crti.S +++ /dev/null @@ -1,50 +0,0 @@ -/* Special .init and .fini section support for libpthread. - Copyright (C) 2012-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - In addition to the permissions in the GNU Lesser General Public - License, the Free Software Foundation gives you unlimited - permission to link the compiled version of this file with other - programs, and to distribute those programs without any restriction - coming from the use of this file. (The GNU Lesser General Public - License restrictions do apply in other respects; for example, they - cover modification of the file, and distribution when not linked - into another program.) - - Note that people who make modified versions of this file are not - obligated to grant this special exception for their modified - versions; it is their choice whether to do so. The GNU Lesser - General Public License gives permission to release a modified - version without this exception; this exception also makes it - possible to release a modified version which carries forward this - exception. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include - -/* Arrange for __pthread_initialize_minimal_internal to be called at - libpthread startup, instead of conditionally calling - __gmon_start__. */ - -#if ELF_INITFINI -# define PREINIT_FUNCTION __pthread_initialize_minimal_internal -# define PREINIT_FUNCTION_WEAK 0 - -# include -#else - .section .init_array,"a",%init_array - .dc.a __pthread_initialize_minimal_internal -#endif diff --git a/nptl/pt-interp.c b/nptl/pt-interp.c deleted file mode 100644 index ecf1fe70df..0000000000 --- a/nptl/pt-interp.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/nptl/version.c b/nptl/version.c deleted file mode 100644 index 25e3a0c872..0000000000 --- a/nptl/version.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Entry point for libpthread DSO. - Copyright (C) 2002-2021 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2002. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include - - -static const char banner[] = -"Native POSIX Threads Library\n\ -Copyright (C) 2021 Free Software Foundation, Inc.\n\ -This is free software; see the source for copying conditions.\n\ -There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\ -PARTICULAR PURPOSE.\n" -"Forced unwind support included.\n" -; - - -/* This is made the e_entry of libpthread.so by LDFLAGS-pthread.so. */ -__attribute__ ((noreturn)) -void -__nptl_main (void) -{ - write (STDOUT_FILENO, banner, sizeof banner - 1); - _exit (0); -} -- cgit v1.2.1