From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2047.outbound.protection.outlook.com [40.107.22.47]) by sourceware.org (Postfix) with ESMTPS id 9228A383A0D3 for ; Wed, 7 Dec 2022 09:14:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9228A383A0D3 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K/w7DLFBP4PYICP0CW3tr11zf9U179yXF0xHv9dJEWI=; b=3zN9jP4vtOq9Uz8p44gFLsqXSfmWr5Gi01uiS2ZsrROpVhTeBzKUZMUc/Zgd0q+EoW1UBk9TjUt3xucaZcs6Wii9HVbADQSYNdhIYQu8GK6uOI+1Mp1MUrA4jRnfsQTw/qBvRB66q/M78z+jHEbR/dxyu2TD+AdJEhtjS6tRAEc= Received: from ZR0P278CA0115.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:20::12) by PA4PR08MB6222.eurprd08.prod.outlook.com (2603:10a6:102:e9::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Wed, 7 Dec 2022 09:14:40 +0000 Received: from VI1EUR03FT019.eop-EUR03.prod.protection.outlook.com (2603:10a6:910:20:cafe::13) by ZR0P278CA0115.outlook.office365.com (2603:10a6:910:20::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14 via Frontend Transport; Wed, 7 Dec 2022 09:14:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VI1EUR03FT019.mail.protection.outlook.com (100.127.144.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5901.14 via Frontend Transport; Wed, 7 Dec 2022 09:14:39 +0000 Received: ("Tessian outbound 0800d254cb3b:v130"); Wed, 07 Dec 2022 09:14:39 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5c1ba77a49fa2602 X-CR-MTA-TID: 64aa7808 Received: from 17a589412489.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id CC6A8694-6562-4EC8-B72F-9F03B4BB4EB3.1; Wed, 07 Dec 2022 09:14:31 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 17a589412489.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 07 Dec 2022 09:14:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bRmRV0sNtFZDz9omYUQrDqjUR4zH/N3zJOTLtEku5TsYW95eLT5Jt8RNRh5IbhFy0KPVFcULT+UJbYd4vS1hWxFTricl0huDunm1GedrPbsQvJ321tYoE/sfNK6Awv3z4H/h1pC1125CHps3MH7GxQ274MaeK3OTTFJG3upTnJhAuJkExZI0lMfaUneztB4hcWZROwRDcDMlYErnhtsr8XtYD1pULOezY+T5gyrqhhzb7fzN1nxpCTLlpOvo7eoEGo74aTfCzkimJBlrwIgSHM/wq4ECZ2hevdLprxN/0SnPuNM0j64VkCNMCr65SDhLxBpD9Kb5oaPTrJ8VNcIJ+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=K/w7DLFBP4PYICP0CW3tr11zf9U179yXF0xHv9dJEWI=; b=NyIDzqkSGufPLO9if23MVpxBDiAlhCTDF0qHtOG313JFrOMydFRQnPxI4iiWlF3uiVVBx4PDqtVd2gKv/RJXiDbAvqYkGWnr4cxhmpxZs29Zr/SZEfKZGYfLN3Jxu9IhNTiAU+ICP4HE5udZ/1qcYUxwDgnbDRbrv4VDgQF7tGj1LenzIyTfH02RXQ5P+Z0Fhi7XYdu8EggW2u/eDjdzy0Pr7R7cnye1d7yC/UBP+66JjCwN9UtpEorhuxHaVi7SmteQEvRkF8bv0HAEhnsJmY1ZgdjbsVyGSNXvvQz+R/zdCGZA4OCqEL7reXcRH8HGs78GHDQFp8txmRvVrnAB3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K/w7DLFBP4PYICP0CW3tr11zf9U179yXF0xHv9dJEWI=; b=3zN9jP4vtOq9Uz8p44gFLsqXSfmWr5Gi01uiS2ZsrROpVhTeBzKUZMUc/Zgd0q+EoW1UBk9TjUt3xucaZcs6Wii9HVbADQSYNdhIYQu8GK6uOI+1Mp1MUrA4jRnfsQTw/qBvRB66q/M78z+jHEbR/dxyu2TD+AdJEhtjS6tRAEc= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DB9PR08MB7179.eurprd08.prod.outlook.com (2603:10a6:10:2cc::19) by AS8PR08MB9979.eurprd08.prod.outlook.com (2603:10a6:20b:633::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.8; Wed, 7 Dec 2022 09:14:29 +0000 Received: from DB9PR08MB7179.eurprd08.prod.outlook.com ([fe80::81ce:94a0:632d:7016]) by DB9PR08MB7179.eurprd08.prod.outlook.com ([fe80::81ce:94a0:632d:7016%3]) with mapi id 15.20.5880.014; Wed, 7 Dec 2022 09:14:29 +0000 Date: Wed, 7 Dec 2022 09:14:14 +0000 From: Szabolcs Nagy To: linzhuorong Cc: "libc-alpha@sourceware.org" , Nixiaoming , xiaojiangfeng , douzhaolei , "Wangbing(wangbing,RTOS/Poincare Lab)" , "wangfangpeng (A)" , "Liuyang (Young,C)" Subject: Re: =?utf-8?B?562U5aSNOiBbUEFUQ0g=?= =?utf-8?Q?=5D?= aarch64: fix elf_machine_dynamic compile error [BZ #29835] Message-ID: References: <20221202035902.27063-1-linzhuorong@huawei.com> <9002f8c2ba144c3bbe5b788d806cdb85@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9002f8c2ba144c3bbe5b788d806cdb85@huawei.com> X-ClientProxiedBy: LO2P265CA0127.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9f::19) To DB9PR08MB7179.eurprd08.prod.outlook.com (2603:10a6:10:2cc::19) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR08MB7179:EE_|AS8PR08MB9979:EE_|VI1EUR03FT019:EE_|PA4PR08MB6222:EE_ X-MS-Office365-Filtering-Correlation-Id: 7484d82f-f06a-485f-dbe1-08dad833784f x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: uX2pdxRm+0otC6E5xRjzrevbr1sivP3iXCuYjBa4v8owWEOKZiRMp1BCy15tzneN4Lp4kZUe9/WZ5OJL2oOQKszLfFrkOxUXd4F3Z/t3ohCBjpwUGmDj7C5jRhY8xdtnFammUPA9oI6r/ErbGnbTGcemlSmxhrJJboO1OL6TCjM4X5VhJaHmoezyeySTBIS6ZX0OIyN32MhymG3FsS0JvnyoU6ZyoZNIjTnKZ/rtHlCYIhqUvSLh7OddgnMFcG9yb0FtFTUJxYjuZjyrqCFYH2Njn75cs3njaXRT4HNpfvNeSppbtr2grJr0OzbILzT3o0hNzNrXNeHx1+8ttGinCMXTfb0wtJup4PV//V2djTFbD2iCXyHiUjzt5lmVm3S5Hnq9rd/Bilg+P0agWnI9jZlwD2psT8JktMk0RoxT7zm7YQWWlNse8JnlldZbok723HmfPxnqOmVPOk2q/QVzhGy432/K6np699ZGqhatPHgKo/J7WMeLuvCfoimW+flycfU0Ot/DIkuZNtDdW12MvQNvtJQNBYXoCfmjI5c5+iQLlu+DlhhlW0KJzICFXGYWPu3p5VGQ1JnfvNU1vuEXtrqWBIGWlOR9KNDVxncu3yOTCeNh0cuMm5mR3qk+uNMqLvNY1Tisj9uwVRA/9sH1Zg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR08MB7179.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(39860400002)(136003)(346002)(396003)(366004)(451199015)(6512007)(186003)(26005)(44832011)(4326008)(2616005)(316002)(224303003)(5660300002)(6916009)(66946007)(6506007)(86362001)(36756003)(54906003)(41300700001)(2906002)(38100700002)(66476007)(8936002)(83380400001)(6486002)(478600001)(66556008)(6666004);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9979 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT019.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: cb65bf07-21b5-4e9c-bc1f-08dad8337187 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kOTxefJO/PX+hnOs/7szu2hXUKSpe+m3KpVgajV8AQctohF2SbD0bCMWl1rMggwZh9O1X47cTVkJ8EYt2rhEOgAtn42K07SmK9mbsRgJ9Xe16slLGC0YAzNBwJ35UEWtW6UuJrigBfhe4acvaAxN4lNl3w61pTGnaQkna+pLS8On58kfAmf85d8Pb/Ap4KvBbkQYfK0UCquNw/vsQBuPW0V03JmCTYZ52wVFLuMe5Qse0CSxEhVN7g6l6HetxdoyAMVyjTiSXsyJPKKsO7bjXae6SaknrBC9Xrx0qQ/qEvvbXyQpeLSw1NF3Qj05QDdPKm7JBDhAddCmMthK/9ahn1ERrZE+MMLd2ICrQ+emIY5wVT84SOGccYtFuKw90VTZjuhr3QDCm+82vlZ3gOmFfxnB8huYzG9ljSeB+Jgx7Hhl42YoZpDltEVWwJTpe+ox7M5I2Xa0YMr3voNdEanvSRTuoio4t1wITTbgCMFrID6kU/Ay5v3xwnDjs25MQI7lAXAiOyAOeArX1aUKblR9WZYlW4Hab7fuOdjKB8PmlO3aiZi4zrtAq4xPMVMsKYz83qlUyPn+OiT1QuI/PzkhMDZxPm8yhrQBR2zqOD/ICqDaMhcte/xSEpCPn7U5BqLexW+vj2IKflAu3cGqOeqgbSKIoOVgE1acSYoT9UencCy+o6955QXOze5UW+wq6ujgI9YcZDfw/RYOSdSd/3SrBw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(396003)(376002)(346002)(136003)(39860400002)(451199015)(46966006)(40470700004)(36840700001)(47076005)(2616005)(186003)(336012)(2906002)(36860700001)(224303003)(6512007)(478600001)(107886003)(82740400003)(6506007)(26005)(40460700003)(86362001)(81166007)(82310400005)(40480700001)(356005)(83380400001)(6486002)(6666004)(5660300002)(70586007)(41300700001)(70206006)(36756003)(6862004)(8936002)(54906003)(44832011)(4326008)(316002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2022 09:14:39.8684 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7484d82f-f06a-485f-dbe1-08dad833784f X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR03FT019.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6222 X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,KAM_STOCKGEN,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: The 12/07/2022 08:34, linzhuorong wrote: > disable-default-pie compile out different results > > The problem is why --enable-static-pie works in 7.3.0, but compiles error in 10.3.0? -static-pie support was added in gcc 8 so this likely works with gcc 7 because the configure option is just ignored then (and the static linked executables are not PIE) there can be linker issues causing gcc 10 to fail so the binutils version matters too, not just the gcc version. (on aarch64 you need at least version 2.30) the compiler target seems to be arm-linux-gnueabi which is not aarch64, so an aarch64 patch won't fix the issue. > > Error log: > /home/XXXX/workspace/compiler/gcc/build/arm-linux-glibc/arm_linux_glibc_build_dir/arm-linux-glibc/lib/gcc/arm-linux-gnueabi/10.3.0/../../../../arm-linux-gnueabi/bin/ld: /home/XXXX/workspace/compiler/gcc/build/arm-linux-glibc/arm_linux_glibc_build_dir/obj/build-glibc/libc.a(dl-reloc-static-pie.o): in function elf_machine_rel': /home/XXXX/workspace/compiler/gcc/open_source/arm-linux-glibc-build_src/glibc-2.34/elf/../sysdeps/arm/dl-machine.h:440: undefined reference to _DYNAMIC' > /home/XXXX/workspace/compiler/gcc/build/arm-linux-glibc/arm_linux_glibc_build_dir/arm-linux-glibc/lib/gcc/arm-linux-gnueabi/10.3.0/../../../../arm-linux-gnueabi/bin/ld: /home/XXXX/workspace/compiler/gcc/open_source/arm-linux-glibc-build_src/glibc-2.34/elf/../sysdeps/arm/dl-machine.h:440: undefined reference to _DYNAMIC' > > > -----邮件原件----- > 发件人: Szabolcs Nagy > 发送时间: 2022年12月5日 22:55 > 收件人: linzhuorong > 抄送: libc-alpha@sourceware.org; Nixiaoming ; xiaojiangfeng ; douzhaolei ; Wangbing(wangbing,RTOS/Poincare Lab) ; wangfangpeng (A) ; Liuyang (Young,C) > 主题: Re: [PATCH] aarch64: fix elf_machine_dynamic compile error [BZ #29835] > > The 12/02/2022 11:59, linzhuorong via Libc-alpha wrote: > > elf_machine_dynamic compile error when compiling glibc with > > --enable-static-pie option turned on, static executables do not have > > symbol _DYNAMIC > > glibc no longer has --enable-static-pie, instead it has --disable-default-pie . > > static pie should have _DYNAMIC symbol since it has dynamic relocations (relative relocs), what is the binutils version? > > maybe glibc should disable default pie if old binutils is detected. > > > > > 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 > >