From patchwork Sat Nov 25 00:13:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 24521 Received: (qmail 121399 invoked by alias); 25 Nov 2017 00:13:34 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 121387 invoked by uid 89); 25 Nov 2017 00:13:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, KB_WAM_FROM_NAME_SINGLEWORD, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-pl0-f68.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=YY5UMm/VpZbxioK4IcKHqZbG6JrLznWJZWycpLEKaxs=; b=PD8bbGU8teOy8TdRm7+qk1mwc3X3Ij4BAZoCoNdi5g7C+FsTojh3ICPUaun2c8pA3h rcCc/ALJyATJP82JKJw+0sLz921aJc/HscsX6FyjlD63XDXZ6OMODRvPM4y4e/TrbDwK 7jitt4qEFzaheIZ95yuJjUzk8IFmzc1TzfuzWZDz9wbkFbngZw0BlLo6lM9kXUWdOhki he+P1lzhGD7IzSbtYLvhDZQpERq8CvPjXWI8dUj5TkNxRAFHN0LOBAFmCGhqdRvHr/0H NeWgrX4EcOkPRPjmzNsv/5Y0kE6Ihjv0hBMJXsRJb36JDyj5pfMgbKgNDh4+QPOGg8wk MOdA== X-Gm-Message-State: AJaThX7eIbLjdfB1TBYDq7PU47f5IEDSOKh1JynZlLGX/xu+HulAuXai oSdoZvnL5NAY/yCV415Qrem0Yw== X-Google-Smtp-Source: AGs4zMaz/ZTsoGGU6j6MiDu/v2IAsMMUV6PfZA9/RYq6BuPO87PMlKNIptErswsWSF+tSZMtNjNTLA== X-Received: by 10.84.128.36 with SMTP id 33mr31564915pla.329.1511568809529; Fri, 24 Nov 2017 16:13:29 -0800 (PST) Date: Fri, 24 Nov 2017 16:13:27 -0800 From: "H.J. Lu" To: GNU C Library Subject: [PATCH] Add wcharP.h to hide internal wchar functions [BZ #18822] Message-ID: <20171125001327.GA17465@gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.1 (2017-09-22) For some targets, like i386 and s390, internal IFUNC functions must be called via PLT with a special register. Add to allow targets, which don't need a special register to call internal IFUNC functions via PLT or have internal non-IFUNC wchar functions, to allow direct access to internal wchar functions within libc.so and libc.a without using GOT nor PLT. Tested on i686 and x86-64. It removed 11 PLT relocations on i686 and 29 PLT relocations on x86-64. Any comments? H.J. --- [BZ #18822] * include/wchar.h: Include . * sysdeps/generic/wcharP.h: New file. * sysdeps/i386/wcharP.h: Likewise. * sysdeps/x86_64/wcharP.h: Likewise. --- include/wchar.h | 1 + sysdeps/generic/wcharP.h | 18 ++++++++++++++++++ sysdeps/i386/wcharP.h | 24 ++++++++++++++++++++++++ sysdeps/x86_64/wcharP.h | 25 +++++++++++++++++++++++++ 4 files changed, 68 insertions(+) create mode 100644 sysdeps/generic/wcharP.h create mode 100644 sysdeps/i386/wcharP.h create mode 100644 sysdeps/x86_64/wcharP.h diff --git a/include/wchar.h b/include/wchar.h index 1db0ac8278..4160322234 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -2,6 +2,7 @@ # include # ifndef _ISOMAC +#include #include extern __typeof (wcscasecmp_l) __wcscasecmp_l; diff --git a/sysdeps/generic/wcharP.h b/sysdeps/generic/wcharP.h new file mode 100644 index 0000000000..1a37283bf1 --- /dev/null +++ b/sysdeps/generic/wcharP.h @@ -0,0 +1,18 @@ +/* Internal prototrypes for multibyte and wide character functions. + Generic version. + Copyright (C) 2017 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. + + 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 + . */ diff --git a/sysdeps/i386/wcharP.h b/sysdeps/i386/wcharP.h new file mode 100644 index 0000000000..deac12e352 --- /dev/null +++ b/sysdeps/i386/wcharP.h @@ -0,0 +1,24 @@ +/* Internal prototrypes for multibyte and wide character functions. + i386 version. + Copyright (C) 2017 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. + + 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 + . */ + +extern __typeof (wcpncpy) __wcpncpy attribute_hidden; +extern __typeof (wcscat) __wcscat attribute_hidden __attribute_pure__; +extern __typeof (wcschrnul) __wcschrnul attribute_hidden __attribute_pure__; +extern __typeof (wcsncpy) __wcsncpy attribute_hidden; +extern __typeof (wcsnlen) __wcsnlen attribute_hidden __attribute_pure__; diff --git a/sysdeps/x86_64/wcharP.h b/sysdeps/x86_64/wcharP.h new file mode 100644 index 0000000000..bd6272db9d --- /dev/null +++ b/sysdeps/x86_64/wcharP.h @@ -0,0 +1,25 @@ +/* Internal prototrypes for multibyte and wide character functions. + x86-64 version. + Copyright (C) 2017 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. + + 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 + . */ + +extern __typeof (wcpncpy) __wcpncpy attribute_hidden; +extern __typeof (wcscat) __wcscat attribute_hidden __attribute_pure__; +extern __typeof (wcschrnul) __wcschrnul attribute_hidden __attribute_pure__; +extern __typeof (wcsncpy) __wcsncpy attribute_hidden; +extern __typeof (wcslen) __wcslen attribute_hidden __attribute_pure__; +extern __typeof (wcsnlen) __wcsnlen attribute_hidden __attribute_pure__;