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: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.5 required=3.0 tests=AWL,BAYES_00,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 E06DD1F601 for ; Thu, 8 Dec 2022 09:27:32 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="ruhxDPKK"; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BB52B382E1BA for ; Thu, 8 Dec 2022 09:27:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB52B382E1BA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670491651; bh=hNfDw9Jb9ZBwPCc/Y15ZxTcBstgmxSUnz+zbFN4NJiw=; h=Date:To:Cc:Subject:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=ruhxDPKKVdbXxpI240NRuaoPMv/dFyU5BxPj0kagvlRWapODf4s7UkpRizhJRV62x s0LisgMrI/9LTsv7ntSsBni2cglfmVG5aH8VmiAssMJz3ZQGa0XAgivjUOQKJ2v0NA rD1HxeHdl4OFmEHLAEGdQfyFWiLPBvTOmPzlTfR4= Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2052.outbound.protection.outlook.com [40.107.6.52]) by sourceware.org (Postfix) with ESMTPS id 15F983884CB1 for ; Thu, 8 Dec 2022 09:27:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 15F983884CB1 Received: from DB8PR04CA0018.eurprd04.prod.outlook.com (2603:10a6:10:110::28) by PA4PR08MB5903.eurprd08.prod.outlook.com (2603:10a6:102:e9::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Thu, 8 Dec 2022 09:26:57 +0000 Received: from DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:110:cafe::f2) by DB8PR04CA0018.outlook.office365.com (2603:10a6:10:110::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.8 via Frontend Transport; Thu, 8 Dec 2022 09:26:57 +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 DBAEUR03FT008.mail.protection.outlook.com (100.127.142.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5901.16 via Frontend Transport; Thu, 8 Dec 2022 09:26:57 +0000 Received: ("Tessian outbound 73ab5f36653e:v130"); Thu, 08 Dec 2022 09:26:57 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b32d74a26c007838 X-CR-MTA-TID: 64aa7808 Received: from 51494209b12d.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 255BD16E-DDA3-45CB-9D9F-F3DB5C38358B.1; Thu, 08 Dec 2022 09:26:50 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 51494209b12d.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 08 Dec 2022 09:26:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SJgkb3hX10ClfQjINRhlhHen0Iuf2QRPrZ+o7YSIKq/pYLWDIHZJTedAtAg3qrg/ADkO6fLKCQmqsAB2DLZotOI1VOljWEXUel2MAyRYnjoEGDZI8mwQIYsjqu7zE/r3HnfxrNgC3RpwaMYFRXq15yCjydSIkjcI6CUNc1qlCL15z1LkIusKFE96p6Hfydg8k45WdGnI/XUbodlS1a58P53sv5tScbig/l16m50gCXDV9AjzRqJHdFfVJoeDfrP8mRiFaTRc8JoJfowqQG+j6m19wWgOEl+zUPc9nM8E3nsG6AePNPvvjeHPvr1FV5U7vweJyS7gWtFgMaGr8AvB6A== 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=hNfDw9Jb9ZBwPCc/Y15ZxTcBstgmxSUnz+zbFN4NJiw=; b=Xe0n3vHA+vhvxz7nUh/oSYvyIjN3e+oQ6HrLTlSJ/Np24kjsgPc/922PAiVrlXJGROHdPfwab5bZ9Qi9HLaJBHF71aG7YUh8VwgDs6Fr8ipfhzj5xMavUuy13CqEH0c08nAnkcM78h6VsyNhwfvzGhMNUuJ42AwVGpHC5d3Jt38bmEriClVdrNbtteuAKTxJfT6LzWdedKhhJrN+pG6XgZM/A1IYOGR8Kk0zs6ngKwf7ZEUtmZVRBOFmeE9U+RteoJpooyui9ZD62zIhk9v63c5Y9Go6yTZSowrnEEkq1tD9hwghFFG2SqtWO8CQFwUJtHHmrP7MEqZU9rBflwN6CQ== 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 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 PAVPR08MB9436.eurprd08.prod.outlook.com (2603:10a6:102:316::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.11; Thu, 8 Dec 2022 09:26:47 +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; Thu, 8 Dec 2022 09:26:47 +0000 Date: Thu, 8 Dec 2022 09:26:32 +0000 To: linzhuorong Cc: "libc-alpha@sourceware.org" , xiaojiangfeng , Nixiaoming , zhongjubin , "Wangbing(wangbing,RTOS/Poincare Lab)" , "zhenghuadong (A)" , "liqingqing (C)" Subject: Re: =?utf-8?B?562U5aSNOiDnrZTlpI06IFtQQVRD?= =?utf-8?Q?H=5D?= aarch64: fix elf_machine_dynamic compile error [BZ #29835] Message-ID: References: <20221202035902.27063-1-linzhuorong@huawei.com> <9002f8c2ba144c3bbe5b788d806cdb85@huawei.com> <7c86f967e58941acacf384269494cc14@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7c86f967e58941acacf384269494cc14@huawei.com> X-ClientProxiedBy: LO4P123CA0679.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:351::12) To DB9PR08MB7179.eurprd08.prod.outlook.com (2603:10a6:10:2cc::19) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: DB9PR08MB7179:EE_|PAVPR08MB9436:EE_|DBAEUR03FT008:EE_|PA4PR08MB5903:EE_ X-MS-Office365-Filtering-Correlation-Id: 5cd0463a-fb96-4b0f-3901-08dad8fe5a59 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: ls2G9RkM6uLnQiQ3UzfIACu0SlGpZrwEn4ySfY+BH6D4xyuRSE98a3K8xL86M5q6xxes5esVa1V5Gv3sO1kkfFKbD5v7oW0g7qBo81QZAqrH/63+GpF4m2iHgnR46CpNzFNPlPPh2cQ/BEcy3SGylEMcweXPOfrZt9eQqbR47tDnCkgE/LuVK90EXND/+LpqHezasln8fwazGNXsm23NQpR2FAZ6cFeARmqw3LU+DC2/mB774VQqcH4ybgbmjxg7Xs01P79vz7MFyxNVKzezd+g6Gy1ADa5gYmmT93OGS83AdFhSltnrfhBfOqiYAuoUkrtM/15rNIH5vALjOKUVswPOKKb1NBr2UAYEV0a0q5LPS8drECbTHc5W6oCDLx2ZyZ5TnQPLiBHh5POA+OFKVlAQCGV5pOIk2W7hkqn6LdGfan3kxercL1254mB/CKcD06lAYi8uhNqzmI279XtXBYsKkSaf6MY9a7eT2gkcrlc8JDOdKZw4l4kHmrKI5v0Uvi6IYOgveO/mYdstlDeLXFkvOPFUYjqu2aa+C0qJ0Xdmm2XddvwcU6H5bQxqbWXxSSbE37+u/bQPa1ClST9qo7McZHH5dLpBReqT+wCly4EbYMtaT9HF089VFnMJesaBpUUADtefyBNA4tslLxKUbw== 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)(346002)(366004)(396003)(39860400002)(376002)(136003)(451199015)(2616005)(54906003)(186003)(224303003)(83380400001)(86362001)(36756003)(6916009)(38100700002)(316002)(66556008)(2906002)(66476007)(41300700001)(66946007)(8936002)(478600001)(44832011)(4326008)(5660300002)(6506007)(26005)(6512007)(6486002)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9436 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: DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: edc46c60-a8b8-4f2e-7c8b-08dad8fe5427 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qUvlL140QzFrlakVgosgPAZ7yFGw8mOdiOImAYDBQofxeahpn5bbD4iyIkyx/YAEo67bIyY8nUbLU/B3+l1XQk6t3N4m2xLkXiZJHuFX4wCsO2k8RQOVxfiiOgpuutnUJJ5ze0z8HeBLYCzXueQFeLDYj4W3R5aWlDWejN43ipORYaGYJgckRRegUv+r3nD2Jhr6aXsKa7nSQ6+y69Ovi2rz1yKygYTtHIRyZVj0glff8sLrZtmbaz+ExkHOwXpDs5IuO4LWnjEth5XPrfIXanve5FjYMbt14UZWYbOt5Amk1lpxV8sYwD/6inZvhPKMjky6Xc2/n9AXyyBMIpFBsEiPImPnUI17PiFnQ376Xbc5+Oclq2jqqy9QWT0jvmCqCj6UDD2eJ4NiZoWYPO9JZjrtWc6xYiiBNmYq/k3TloXGwtuHJ4mzEQc+yTfbjE+Pj4ldjwAGHIudAoKxZA0885M7GnFw7tC0pZT5GVUdK0rLsGFFCiBXeeDeWvLowzfFGllkTUdhKrTBiDrWCUczhwsFWW9Kz9wzUrLPsmoNHV2KPRwtANA4REnaCQng855PcGNnfq1KAKM86XygXGEaxa/1SjW26gWqJO6m0BFXTo86iFqqStRj4FFsO845jRZHnLbFN/KlqYQy2DRcY3pu80c+H069BVX3Y6sqEw36ORyeamb13oraNq4NCBDAMjDEWzHvF3BJLPAU7eKRknmj3g== 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)(376002)(396003)(346002)(136003)(39860400002)(451199015)(46966006)(36840700001)(40470700004)(107886003)(6506007)(2906002)(6512007)(6666004)(83380400001)(6486002)(36756003)(86362001)(478600001)(47076005)(81166007)(40460700003)(26005)(6862004)(2616005)(36860700001)(336012)(8936002)(186003)(224303003)(82310400005)(356005)(44832011)(5660300002)(70586007)(70206006)(41300700001)(82740400003)(4326008)(316002)(54906003)(40480700001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2022 09:26:57.5279 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5cd0463a-fb96-4b0f-3901-08dad8fe5a59 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: DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB5903 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: Szabolcs Nagy via Libc-alpha Reply-To: Szabolcs Nagy Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" The 12/07/2022 12:52, linzhuorong wrote: > The version of binutils is 2.38 > Use gcc 7.3.0 just for testing, if there is no --static-pie, it may give ignore, I found only i386, arm, aarch64, loongarch use _DYNAMIC way to get, other are use GOT, > what if I only fix arm? what is the issue you want to fix? so far we haven't seen any. you just misconfigure the glibc build. > > -----邮件原件----- > 发件人: Szabolcs Nagy > 发送时间: 2022年12月7日 17:14 > 收件人: 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/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 > > >