From patchwork Sun Oct 18 17:25:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 9216 Received: (qmail 108098 invoked by alias); 18 Oct 2015 17:26:03 -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 108084 invoked by uid 89); 18 Oct 2015 17:26:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_FROM, SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mga14.intel.com X-ExtLoop1: 1 From: "H.J. Lu" To: libc-alpha@sourceware.org Cc: "H.J. Lu" Subject: [PATCH 1/3] Mark ld.so internel mmap functions hidden Date: Sun, 18 Oct 2015 10:25:39 -0700 Message-Id: <1445189141-18068-1-git-send-email-hjl.tools@gmail.com> Since ld.so internel mmap functions are only used internally in ld.so, they can be made hidden. [BZ #19122] * include/sys/mman.h [IS_IN (rtld)] (__mmap): Add attribute_hidden if not compiling for Hurd. [IS_IN (rtld)] (__mprotect): Add attribute_hidden. [IS_IN (rtld)] (__munmap): Likewise. --- include/sys/mman.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/sys/mman.h b/include/sys/mman.h index fd125ec..65fe3ff 100644 --- a/include/sys/mman.h +++ b/include/sys/mman.h @@ -16,6 +16,16 @@ libc_hidden_proto (__madvise) /* This one is Linux specific. */ extern void *__mremap (void *__addr, size_t __old_len, size_t __new_len, int __flags, ...); + +# if IS_IN (rtld) +# ifndef __gnu_hurd__ +/* On Hurd, __mmap in ld.so will be preempted by the one in libc.so after + bootstrap. */ +extern __typeof (__mmap) __mmap attribute_hidden; +# endif +extern __typeof (__mprotect) __mprotect attribute_hidden; +extern __typeof (__munmap) __munmap attribute_hidden; +# endif #endif #endif