From patchwork Sun Aug 20 14:12:35 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: 22244 Received: (qmail 95791 invoked by alias); 20 Aug 2017 14:12:42 -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 94618 invoked by uid 89); 20 Aug 2017 14:12:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=53, 4, Hx-languages-length:3194, 3311 X-HELO: mail-pg0-f67.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:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=iHY7oM8QL01GfChSep2ewPJaCUVV59E4pwCZ55ZuRj8=; b=NtCEax5Q/J6XJJ1ljA5QUbJ/BV+2WpKn6q02mti0P5dp/UWh0rt8PwQhedxSvQggTu z7Z5yv1qhUVt8NyhbwLBD6rC8bDxyIE8sHes23ZVql1LShlW6wMc1P3qS9CkowT7Qka2 gL2H0B3F2kXAgOZni0gEDB/SgdmilbmGEdbWOzWn7sjBDmxnRqhgS0ioBcvQdHR0osK8 s2WFtse+hLJt2Zq/H+p15gr+xC+G6xXS+kE/DsY6QvvuQ61Fe9oWuwOe4xtnLgbHVtd9 h7I1P0umD8ml6QiBS+ggXWGPYeOtc8a7kQpMxTfVfRrJ3ZCs1WEP/bo9TB7cQq0kmQ/j 6aWQ== X-Gm-Message-State: AHYfb5hdLIWUw44JPV2he2fU/EOvE0NbBc3QlQ8575Y37JduHjIRapZm 8WRhEMWUIl9yBEU4 X-Received: by 10.84.229.11 with SMTP id b11mr12456654plk.430.1503238356699; Sun, 20 Aug 2017 07:12:36 -0700 (PDT) Date: Sun, 20 Aug 2017 07:12:35 -0700 From: "H.J. Lu" To: Florian Weimer Cc: GNU C Library Subject: Re: [PATCH 1/3] Mark __libc_multiple_libcs with attribute_hidden [BZ #18822] Message-ID: <20170820141235.GA14485@gmail.com> References: <20170818203021.GA15188@gmail.com> <87mv6uoes1.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87mv6uoes1.fsf@mid.deneb.enyo.de> User-Agent: Mutt/1.8.3 (2017-05-23) On Sun, Aug 20, 2017 at 09:54:22AM +0200, Florian Weimer wrote: > * H. J. Lu: > > > [BZ #18822] > > * csu/libc-start.c (__libc_multiple_libcs): Add attribute_hidden. > > * elf/dl-open.c (__libc_multiple_libcs): Likewise. > > Please put a hidden declaration into a header file instead. Done. Here is the updated patch. OK for master? H.J. --- Since __libc_multiple_libcs is defined as hidden symbol in init-first.c, it should be always marked with attribute_hidden. [BZ #18822] * csu/libc-start.c (__libc_multiple_libcs): Removed. * elf/dl-open.c: Include . (__libc_multiple_libcs): Removed. * elf/dl-sysdep.c: Include instead of . * include/libc-internal.h (__libc_multiple_libcs): New. * misc/sbrk.c: Include . (__libc_multiple_libcs): Removed. --- csu/libc-start.c | 2 -- elf/dl-open.c | 3 +-- elf/dl-sysdep.c | 2 +- include/libc-internal.h | 4 ++++ misc/sbrk.c | 4 +--- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/csu/libc-start.c b/csu/libc-start.c index 6720617188..24c63be02f 100644 --- a/csu/libc-start.c +++ b/csu/libc-start.c @@ -27,8 +27,6 @@ extern void __libc_init_first (int argc, char **argv, char **envp); -extern int __libc_multiple_libcs; - #include #ifndef SHARED # include diff --git a/elf/dl-open.c b/elf/dl-open.c index 2d8948aab1..c539f10cf3 100644 --- a/elf/dl-open.c +++ b/elf/dl-open.c @@ -33,12 +33,11 @@ #include #include #include +#include #include -extern int __libc_multiple_libcs; /* Defined in init-first.c. */ - /* We must be careful not to leave us in an inconsistent state. Thus we catch any error and re-raise it after cleaning up. */ diff --git a/elf/dl-sysdep.c b/elf/dl-sysdep.c index 4053ff3c07..c4ff8b2937 100644 --- a/elf/dl-sysdep.c +++ b/elf/dl-sysdep.c @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include diff --git a/include/libc-internal.h b/include/libc-internal.h index cd2f2622ed..252d7d80c3 100644 --- a/include/libc-internal.h +++ b/include/libc-internal.h @@ -53,4 +53,8 @@ extern void __init_misc (int, char **, char **); extern __typeof (__profile_frequency) __profile_frequency attribute_hidden; # endif +/* Set nonzero if we have to be prepared for more than one libc being + used in the process. */ +extern int __libc_multiple_libcs attribute_hidden; + #endif /* _LIBC_INTERNAL */ diff --git a/misc/sbrk.c b/misc/sbrk.c index 965c0ef879..158399d2ed 100644 --- a/misc/sbrk.c +++ b/misc/sbrk.c @@ -18,14 +18,12 @@ #include #include #include +#include /* Defined in brk.c. */ extern void *__curbrk; extern int __brk (void *addr); -/* Defined in init-first.c. */ -extern int __libc_multiple_libcs attribute_hidden; - /* Extend the process's data space by INCREMENT. If INCREMENT is negative, shrink data space by - INCREMENT. Return start of new space allocated, or -1 for errors. */