From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x92d.google.com (mail-ua1-x92d.google.com [IPv6:2607:f8b0:4864:20::92d]) by sourceware.org (Postfix) with ESMTPS id 0DB5C385BF9B for ; Tue, 16 Nov 2021 19:05:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0DB5C385BF9B Received: by mail-ua1-x92d.google.com with SMTP id w23so372104uao.5 for ; Tue, 16 Nov 2021 11:05:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=NbwtMWykMZe2NC9f+DVeZdvCa3b97hP9JcOE42pG8V8=; b=oxyDdKvG0keRzBkeL+pswGmMwTPzVQwS1LMZvsXKEZpQpSBrzHY2RCZ2rpr0ISjs96 x1uYVyNUJmNihUWjiQWqeglLdflA7iDieO3jOOPa5DQ/RvJQ8hZYIBPL82yy8+FYdwmY iK+8tNboSkRUN7X2Jp5aikX9Lsxqpx8ohRssAMcy8Jrfd2/WHv2RqfcQ4OCiwQjHLKSd RiPFd2yKR8ApLkPODdQ+iC0swsAAbOtl29e6OYn/CI/EZr0zZkYKrRCnk0RjZWPqVu8Z MCeAf+rH0f9zByf0HW4Qofz5qeqejMeFXr2/anoNiZdXwud4ZphrknEu9V5P9HCmKGq8 ey0Q== X-Gm-Message-State: AOAM5309ayAfqo+TbWn3p1KiuDlKKyTmNWIP4v+Ae31ircIDA/+BlFIf Z37erX9Qt/IH5OlkrF/o5RbIc5Gjf7IvlQ== X-Google-Smtp-Source: ABdhPJxu+rOPFCMeH3CDlxRBwwTQOc6JL6TSMTgHV1A43eAOLKqIePoQO5iOSaLFFHKm2HHNSsbsDg== X-Received: by 2002:ab0:1c4c:: with SMTP id o12mr14178227uaj.136.1637089502447; Tue, 16 Nov 2021 11:05:02 -0800 (PST) Received: from birita.. ([2804:431:c7ca:66dc:190:a0a5:4184:e499]) by smtp.gmail.com with ESMTPSA id v8sm10506502vkc.52.2021.11.16.11.05.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Nov 2021 11:05:02 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [COMMITTED] elf: hidden visibility for __minimal_malloc functions Date: Tue, 16 Nov 2021 16:04:58 -0300 Message-Id: <20211116190458.2332378-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2021 19:05:05 -0000 Since b05fae4d8e34, __minimal malloc code is used during static startup before PIE self-relocation (_dl_relocate_static_pie). So it requires the same fix done for other objects by 47618209d05a. Checked on aarch64, x86_64, and i686 with and without static-pie. --- elf/dl-minimal-malloc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/elf/dl-minimal-malloc.c b/elf/dl-minimal-malloc.c index 939b5271ca..ea9bca26cf 100644 --- a/elf/dl-minimal-malloc.c +++ b/elf/dl-minimal-malloc.c @@ -17,6 +17,11 @@ License along with the GNU C Library; if not, see . */ +/* Mark symbols hidden in static PIE for early self relocation to work. + Note: string.h may have ifuncs which cannot be hidden on i686. */ +#if BUILD_PIE_DEFAULT +# pragma GCC visibility push(hidden) +#endif #include #include #include -- 2.32.0