From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, PDS_RDNS_DYNAMIC_FP,RCVD_IN_DNSWL_MED,RDNS_DYNAMIC,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 5C2EC1F601 for ; Fri, 2 Dec 2022 03:54:06 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="DwgDSjm1"; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F29F63858428 for ; Fri, 2 Dec 2022 03:54:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F29F63858428 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669953245; bh=/IeDw8lnc6STu9WhbwcV55IBOS8Av+tFOK74xQC0Cs4=; h=To:CC:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=DwgDSjm1uFGyT5+udVENGQjPDHZ8bNfIgG07YusRMgolMbNeLQkFf8/FgQKxgXhH9 ZhquvKy31Y4NBmc9H+jmip2knBinu0eyL1FiOIdQ4IgCFR3smJBZgL0RfRXZa1i/2U /6y4IBqV8L0rgElSLKBbeP5+5yKNkklPQfmpSThA= Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by sourceware.org (Postfix) with ESMTPS id CC3053858D35 for ; Fri, 2 Dec 2022 03:53:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CC3053858D35 Received: from dggpeml500008.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NNfDC2ysSzmV6H for ; Fri, 2 Dec 2022 11:52:59 +0800 (CST) Received: from linux-suse12sp5.huawei.com (10.67.188.132) by dggpeml500008.china.huawei.com (7.185.36.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 2 Dec 2022 11:53:42 +0800 To: CC: , linzhuorong Subject: [PATCH] aarch64: fix elf_machine_dynamic compile error [BZ #29835] Date: Fri, 2 Dec 2022 11:53:20 +0800 Message-ID: <20221202035320.26785-1-linzhuorong@huawei.com> X-Mailer: git-send-email 2.12.3 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.188.132] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500008.china.huawei.com (7.185.36.147) X-CFilter-Loop: Reflected 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: , From: linzhuorong via Libc-alpha Reply-To: linzhuorong Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" elf_machine_dynamic compile error when compiling glibc with --enable-static-pie option turned on, static executables do not have symbol _DYNAMIC Fixes: bca0f5cbc9257c13322b99e55235c4f21ba0bd82("aarch64: Make elf_machine_{load_address,dynamic} robust [BZ #28203]") Signed-off-by linzhuorong --- sysdeps/aarch64/dl-machine.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h index ae8b14425a..49b1d1ea0e 100644 --- a/sysdeps/aarch64/dl-machine.h +++ b/sysdeps/aarch64/dl-machine.h @@ -53,8 +53,9 @@ elf_machine_load_address (void) static inline ElfW(Addr) __attribute__ ((unused)) elf_machine_dynamic (void) { - extern ElfW(Dyn) _DYNAMIC[] attribute_hidden; - return (ElfW(Addr)) _DYNAMIC - elf_machine_load_address (); + /* Declaring this hidden ensures that a PC-relative reference is uesed. */ + extern const ElfW(Addr) _GLOBAL_OFFSET_TABLE_[] attribute_hidden; + return _GLOBAL_OFFSET_TABLE_[0]; } /* Set up the loaded object described by L so its unrelocated PLT -- 2.12.3