{"id":808892,"url":"http://patchwork.ozlabs.org/api/1.0/patches/808892/?format=json","project":{"id":41,"url":"http://patchwork.ozlabs.org/api/1.0/projects/41/?format=json","name":"GNU C Library","link_name":"glibc","list_id":"libc-alpha.sourceware.org","list_email":"libc-alpha@sourceware.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20170901180029.9527-28-hjl.tools@gmail.com>","date":"2017-09-01T17:59:58","name":"[27/58] Hide internal __ioctl function [BZ #18822]","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"66b149a1ce495c97dfd137695a829a8fd608456f","submitter":{"id":4387,"url":"http://patchwork.ozlabs.org/api/1.0/people/4387/?format=json","name":"H.J. Lu","email":"hjl.tools@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/glibc/patch/20170901180029.9527-28-hjl.tools@gmail.com/mbox/","series":[{"id":1088,"url":"http://patchwork.ozlabs.org/api/1.0/series/1088/?format=json","date":"2017-09-01T18:00:21","name":"Hide internal functions in libc.so","version":1,"mbox":"http://patchwork.ozlabs.org/series/1088/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/808892/checks/","tags":{},"headers":{"Return-Path":"<libc-alpha-return-84083-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84083-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"K5Zoy0Gi\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xkRzN50Kcz9s3w\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  2 Sep 2017 04:07:28 +1000 (AEST)","(qmail 88632 invoked by alias); 1 Sep 2017 18:01:08 -0000","(qmail 88602 invoked by uid 89); 1 Sep 2017 18:01:08 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:from:to:subject:date:message-id:in-reply-to\n\t:references; q=dns; s=default; b=kJcjGOOzANpBOHiu04+sgQirLuXXxnr\n\tSI90m/AH4p7FoOep7wtivVd3dl9EOhMRjhPvGiEbnEh4WUGpZQn3cDrlIVR+nhok\n\t3PaFBaTFQQOXqM0HqPkU8FMmZlVNzKPIiA7+wyRdGqvL9HynJHOG+X4gmuYu41u6\n\tXiY3IHFnpixA=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:from:to:subject:date:message-id:in-reply-to\n\t:references; s=default; bh=Q+4Y+m/mpYcjJpKhr2oIImOT7aI=; b=K5Zoy\n\t0GiiqTDcg/vXxFX6aLM+lDQjaCpeQ3xv5JP/2l33M2GUg29YcVeXHjfaLGWz7/oZ\n\t7moBDPoOtSNmsv4EfBWP8cT4S5EuEfQPTsfcbq8nFkZiDN1foH8oql2lyd/YzgR5\n\t78z08ghoKF0/mGGh2iVuoGSYvZWLnsG4hia+go=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-26.2 required=5.0 tests=BAYES_00,\n\tFREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2,\n\tGIT_PATCH_3,\n\tSPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=H*m:gmail","X-HELO":"mga02.intel.com","X-ExtLoop1":"1","From":"\"H.J. Lu\" <hjl.tools@gmail.com>","To":"libc-alpha@sourceware.org","Subject":"[PATCH 27/58] Hide internal __ioctl function [BZ #18822]","Date":"Fri,  1 Sep 2017 10:59:58 -0700","Message-Id":"<20170901180029.9527-28-hjl.tools@gmail.com>","In-Reply-To":"<20170901180029.9527-1-hjl.tools@gmail.com>","References":"<20170901180029.9527-1-hjl.tools@gmail.com>"},"content":"Hide internal __ioctl function to allow direct access within libc.so and\nlibc.a without using GOT nor PLT.\n\n__GI___ioctl is defined when sysdeps/unix/syscalls.list is used to\ngenerate ioctl.  Otherwise libc_hidden_def is needed explicitly.\n\n\t[BZ #18822]\n\t* include/sys/ioctl.h (__ioctl): Add libc_hidden_proto.\n\t* misc/ioctl.c (__ioctl): Add libc_hidden_def.\n\t* sysdeps/mach/hurd/ioctl.c (__ioctl): Likewise.\n\t* sysdeps/unix/sysv/linux/aarch64/ioctl.S (__ioctl): Likewise.\n\t* sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S (__ioctl):\n\tLikewise.\n\t* sysdeps/unix/sysv/linux/powerpc/ioctl.c (__ioctl): Likewise.\n\t* sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S (__ioctl): Likewise.\n---\n include/sys/ioctl.h                             | 1 +\n misc/ioctl.c                                    | 1 +\n sysdeps/mach/hurd/ioctl.c                       | 1 +\n sysdeps/unix/sysv/linux/aarch64/ioctl.S         | 1 +\n sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S | 1 +\n sysdeps/unix/sysv/linux/powerpc/ioctl.c         | 1 +\n sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S     | 1 +\n 7 files changed, 7 insertions(+)","diff":"diff --git a/include/sys/ioctl.h b/include/sys/ioctl.h\nindex bfc6909dbc..dd7c3c7c9c 100644\n--- a/include/sys/ioctl.h\n+++ b/include/sys/ioctl.h\n@@ -5,6 +5,7 @@\n \n /* Now define the internal interfaces.  */\n extern int __ioctl (int __fd, unsigned long int __request, ...);\n+libc_hidden_proto (__ioctl)\n \n # endif /* !_ISOMAC */\n #endif\ndiff --git a/misc/ioctl.c b/misc/ioctl.c\nindex 9b90102544..7e1c8cc4d7 100644\n--- a/misc/ioctl.c\n+++ b/misc/ioctl.c\n@@ -28,4 +28,5 @@ __ioctl (int fd, unsigned long int request, ...)\n }\n stub_warning (ioctl)\n \n+libc_hidden_def (__ioctl)\n weak_alias (__ioctl, ioctl)\ndiff --git a/sysdeps/mach/hurd/ioctl.c b/sysdeps/mach/hurd/ioctl.c\nindex 7ce521c4fa..d6b4583a6f 100644\n--- a/sysdeps/mach/hurd/ioctl.c\n+++ b/sysdeps/mach/hurd/ioctl.c\n@@ -323,4 +323,5 @@ __ioctl (int fd, unsigned long int request, ...)\n     }\n }\n \n+libc_hidden_def (__ioctl)\n weak_alias (__ioctl, ioctl)\ndiff --git a/sysdeps/unix/sysv/linux/aarch64/ioctl.S b/sysdeps/unix/sysv/linux/aarch64/ioctl.S\nindex 866d6ef12d..61b3804e1b 100644\n--- a/sysdeps/unix/sysv/linux/aarch64/ioctl.S\n+++ b/sysdeps/unix/sysv/linux/aarch64/ioctl.S\n@@ -28,4 +28,5 @@ ENTRY(__ioctl)\n \tret\n PSEUDO_END (__ioctl)\n \n+libc_hidden_def (__ioctl)\n weak_alias (__ioctl, ioctl)\ndiff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S b/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S\nindex ee5d11d240..54d186666d 100644\n--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S\n+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/ioctl.S\n@@ -38,4 +38,5 @@ L(error):\n \n PSEUDO_END (__ioctl)\n \n+libc_hidden_def (__ioctl)\n weak_alias (__ioctl, ioctl)\ndiff --git a/sysdeps/unix/sysv/linux/powerpc/ioctl.c b/sysdeps/unix/sysv/linux/powerpc/ioctl.c\nindex 1437d1dccc..9efccbd2c5 100644\n--- a/sysdeps/unix/sysv/linux/powerpc/ioctl.c\n+++ b/sysdeps/unix/sysv/linux/powerpc/ioctl.c\n@@ -61,4 +61,5 @@ __ioctl (int fd, unsigned long int request, ...)\n \n   return result;\n }\n+libc_hidden_def (__ioctl)\n weak_alias (__ioctl, ioctl)\ndiff --git a/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S b/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S\nindex e2bf44c75d..43f956399e 100644\n--- a/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S\n+++ b/sysdeps/unix/sysv/linux/tile/tilegx/ioctl.S\n@@ -38,4 +38,5 @@ ENTRY (__ioctl)\n \tBNEZ r1, 0f\n \tjrp lr\n PSEUDO_END (__ioctl)\n+libc_hidden_def (__ioctl)\n weak_alias (__ioctl, ioctl)\n","prefixes":["27/58"]}