From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00081.outbound.protection.outlook.com [40.107.0.81]) by sourceware.org (Postfix) with ESMTPS id 288733844054 for ; Mon, 11 Jan 2021 10:45:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 288733844054 Received: from AM5PR0402CA0024.eurprd04.prod.outlook.com (2603:10a6:203:90::34) by VI1PR08MB3101.eurprd08.prod.outlook.com (2603:10a6:803:45::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.8; Mon, 11 Jan 2021 10:45:53 +0000 Received: from VE1EUR03FT003.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:90:cafe::c0) by AM5PR0402CA0024.outlook.office365.com (2603:10a6:203:90::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Mon, 11 Jan 2021 10:45:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;sourceware.org; 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT003.mail.protection.outlook.com (10.152.18.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Mon, 11 Jan 2021 10:45:52 +0000 Received: ("Tessian outbound af289585f0f4:v71"); Mon, 11 Jan 2021 10:45:52 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 84e37b5852ac6b69 X-CR-MTA-TID: 64aa7808 Received: from d1e557a8832b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 91D2E504-9978-4164-A44D-46EC765150E4.1; Mon, 11 Jan 2021 10:45:47 +0000 Received: from EUR03-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d1e557a8832b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 11 Jan 2021 10:45:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WwHzXtkkMHdS7FjmLHOwc3zxs+XngG2JFhYyFC6vpPWl7PK6xzcJePmQfefsGtsJwhkiq6imOBJeg1oyEAHHPRkkRAlSyCedSCN+/9X39knxFUn9e/01jpgHCTfj07rOk/ARLaj5nZvtErQtdeNQznYq9uYW9tplDjtXpY4h3hMzMf/AO/2WkJxPZjfJWWl281ac2lGcji7RhMwyl4hEzma6xaKQzbBakqUTOHXolA39nIBcoWWDTjN445JX2J3KSUI+PwDmjYpfT0h76lXeihh3v0rmZJDDkzVCBCdDDMVXVKWle7G2epyhaeuEDEPFRwb9bNoqtu6YX1ZIWUxalA== 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-SenderADCheck; bh=FAfl2D348h2/lB/1oebeyo2UHmhYDPo/jjkwHr2ikGA=; b=RGbPaLcxQTxemva0b8v+/SLXKioUUWy+TmD5QdRZiwlRPowjsCRmx/MP7iBD6Le9wbt6HQOViiXaF/czE3b/kUQ2RrQTx64nD8+MpbeL65NOMk/BCq8hi47eols7rzIsJ1uVDUDd5QGmf2AZ+sXRdGDBoSatSIp3ccA/oM/JFjV0VUizq0GuIlMeToSC78TS/CFIDCC1IB85HWihVBh4p/gLIAj8eEErcCK37qQH3Jq3NV+kKQiL24TCBCEXu+aq8pDlnVekhmb53yGsvc8aiqQSaDGmiFe5yow/+1WzcSHyl0DE2CO2q4LgFWyLgubYCvHr6i2CqOTxJoyc7OhP0A== 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: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from PA4PR08MB6320.eurprd08.prod.outlook.com (2603:10a6:102:e5::9) by PAXPR08MB6350.eurprd08.prod.outlook.com (2603:10a6:102:15b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6; Mon, 11 Jan 2021 10:45:38 +0000 Received: from PA4PR08MB6320.eurprd08.prod.outlook.com ([fe80::700f:ddbe:a347:ee4f]) by PA4PR08MB6320.eurprd08.prod.outlook.com ([fe80::700f:ddbe:a347:ee4f%6]) with mapi id 15.20.3742.012; Mon, 11 Jan 2021 10:45:38 +0000 Date: Mon, 11 Jan 2021 10:45:36 +0000 From: Szabolcs Nagy To: libc-alpha@sourceware.org Subject: Re: [PATCH] aarch64: define PI_STATIC_AND_HIDDEN Message-ID: <20210111104536.GW2379@arm.com> References: <20210106133121.19286-1-szabolcs.nagy@arm.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210106133121.19286-1-szabolcs.nagy@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [217.140.106.52] X-ClientProxiedBy: LO4P123CA0234.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a6::23) To PA4PR08MB6320.eurprd08.prod.outlook.com (2603:10a6:102:e5::9) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from arm.com (217.140.106.52) by LO4P123CA0234.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a6::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Mon, 11 Jan 2021 10:45:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f2529f43-c4df-4e46-e7c2-08d8b61e1159 X-MS-TrafficTypeDiagnostic: PAXPR08MB6350:|VI1PR08MB3101: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:3276;OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: GFXxgZv6Hwkk04oSlcLm7a+3kh/7M/sHCyEW0STZUJQPkLvfmwIt0TP/o/L0oqFOfpybiPmxPU68AsTw9AiPdDEL+0ZVlFgk/F1B6AuUumfRD0/Ar1MB4ydwbV402EKh0anFbRTjlE6lEyF8ijEMw84/oOujUsyFuPAcBzPwd9vIcVQdYSXqirh8uKpSrvNDOaFNr3SUxNJ0hKnRGFbBizuYRPa6fdJ3h+q3nuIH09dt81VZTSQFbHYCWwbCdtTYgLpAhsJEEXZl4C37dTrCspgzHOHzd6QnuTxBINbiHnaN4uK4vXY4Jcg3utSe2t/77K3QJ6o4LU1Eq1cIetP81zIzy57EgUXD1Ju22gzL0C/eQaCc64WEablxaklX3ZYLPbsoYMAINXLQXLrYeK5MED+TMv7bN/eQFL8LyvbC5LhLZ5M05K2fz0XdHk4xGN+sl/O8uxuBC0WH/c7vQ4lFAA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR08MB6320.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(376002)(346002)(366004)(136003)(396003)(7696005)(16526019)(52116002)(186003)(55016002)(2906002)(36756003)(66556008)(966005)(5660300002)(478600001)(44832011)(316002)(33656002)(8886007)(66946007)(8936002)(6916009)(83380400001)(2616005)(956004)(86362001)(26005)(66476007)(1076003)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?QndNYnlxekx3NllVRHozemNTSDY0ckpTQmNzYW4wLzAwallpcktFRHh6UitR?= =?utf-8?B?MEVMRTA0aVUwWjM5bHhOdXkrWFdpWGxDMzhMWEhSejcyVkVnb2hTdFh5ZWdn?= =?utf-8?B?UXFMYWMzUmFlbHluSmJPakRCM2FEcWNUU3Jwa0tFdW1oUUZ5aVpYeC9GVXZL?= =?utf-8?B?SlJXOTcySnA3a3RxU1c5cHlJMzlHamlVS2RSN1ozMTBZNllyekZzeFRWMWVQ?= =?utf-8?B?Wm1qcWxkWnphdzR6V242WjFLY05QLzVMVTdXME5GRnF2VWt4NzJZcUVoYUxa?= =?utf-8?B?dHYxM0xFU1lKOFRqSVNCaTZoNjM5ZThJYjNwbHdvRGV3UFNoSVZqQngyYVZL?= =?utf-8?B?N3ZDUUFEaWQ5Y0J6M3MxdThuakMzRCtUK2szSDFLR2xTc01NZGFVWGVrTE0y?= =?utf-8?B?bGJ2M3lDdGwxa3lWYTR6MmhYSjZ6NjlGNmd2alNuWlZJbGpUQnA0azk2MEx0?= =?utf-8?B?MytSS25SNUkwbjBQdXQzTnd6K2w0UG5Td1psQ3phK045bmpIMHpJWjdQVE9J?= =?utf-8?B?ZkhPS1YxSlJNcVNYTGlGNnhDMEsyVWkrdTBGL0l1QlQxRWxFWXhLSXNlMmZa?= =?utf-8?B?dUlNeGxtT25zT0VQZkI3Zmh3NC8xUW9sTWFZVCtRTkcxbHVCcFR5b2RrbjVW?= =?utf-8?B?aDZUdDdvd09OYWdtYTArSnprTnk1UEVsSU1NbktxaVpJbU5IQkZ2UXpWY0ZT?= =?utf-8?B?bXllSWxnRDBzKyt5V3E4bHhRRGRDczJ3emE5N0hYVW9xVDJBMTRybmhycG1j?= =?utf-8?B?bUhHc0JqV285bEZzcXZEdzFNL1hrdENHTVZGYWQ5eHBoa1gva1plajRGQXdh?= =?utf-8?B?ZG9UbDMwdmZwV3NGZFZNQ0w0YWU5eXVkdnRoUVlkUXY0N20xbFFzWUUwYjk2?= =?utf-8?B?cGw0T1M3SlVKTlV5QlhscU5ma2xZMjh6QnhFcnAzeUFDUTVXUXdNTDNFOTRM?= =?utf-8?B?MUkycGVVSXd4aHlDdnJKV2htdEZCYjNqaXZvLzJESEJXdXlvL2QwQmQrS29v?= =?utf-8?B?UVk4a1FhSzFSOW1JbHNkdjdSMEw1cWJZVzJnNzBUSzZ5SEs1QkNuQVh4TUtm?= =?utf-8?B?aXFIb25HeEdISGIvV0lXTTY5bGtLMmJyRytoNmZFeEZlRnpKOER1OUVva3dr?= =?utf-8?B?eHNYVUlKZUl2ZDBCdzlUaXJSTW0vdmMvUTJ2NWtTc3J4aTZVVnV0RWEyME5a?= =?utf-8?B?S3kySzNqSGhXeG0xcWQ5M2RFSzNXTE90ZDJEclVOekEzUVlpYkUyeXppUVN3?= =?utf-8?B?eEpFQUk2Ty9xbTQ0VTd3MHUwOWQycTY5ak5nRUF5Vm92UU1nT3I5MXc1WXVy?= =?utf-8?Q?Qg7Vo3q5HZKVp898kJolINMQRPA+RQiuCW?= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6350 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT003.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 07a305c7-e391-4da5-a109-08d8b61e08c3 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QBauC/tVwe3OSkFy0yARTSAK48pYHcDHKR6PTtbnPadnfQFN+Qq87K7/ZRGWibUHMehdOy68pqv4NStbo5+UWDPnP3a+TWxE9MESNNc03ne5ZE0olfO5+2WsJL2nplruFkdtl4UXgJt1jE/ZNORjUKMbvi8Khm+xvrP6GnX1bXAsM6Yue3R0aKOMNYsbnjk79Rxpm/h3S6eqP1lAAYVjZFSEDLieHVxAfHjp8GzYiEzWjzqy/LlItPHveoKC32gPYWBdb4NmXPz1z5D2h88ijNnx5osMRRRM0wpQwmkhXR5ftlMu5iYx8nITZXZ7EmWarfCbyHMrxrkR09npZdig7TbO2EDh9K2AFu7TdFPeATqU/iwOl8kFQZjd4vZSLR+a0kUE6TYkfu5NPPEXGbyrrB0I9YVoHBy7Wr++IxUOI5xc0c71uOuZjj6DAHEUgKLrV8qqAqRpopekQGVnNDFCWIqxDLU6cNhJ41Va5Q8rz/oAf7Tjn4Xt0BecY3ewJQPoLaAO+KKy9W64MP2/nyNDdWhRxv7EIV+6iGPjIcQrsL7PCGourqn5dDNte4kp0Khc 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:(4636009)(376002)(39860400002)(346002)(136003)(396003)(46966006)(316002)(44832011)(8886007)(70206006)(2906002)(36756003)(966005)(33656002)(16526019)(956004)(26005)(34020700004)(55016002)(186003)(8936002)(336012)(82310400003)(2616005)(478600001)(47076005)(6916009)(7696005)(5660300002)(86362001)(1076003)(81166007)(70586007)(356005)(82740400003)(8676002)(83380400001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2021 10:45:52.8024 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f2529f43-c4df-4e46-e7c2-08d8b61e1159 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: VE1EUR03FT003.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3101 X-Spam-Status: No, score=-14.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_SHORT, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Mon, 11 Jan 2021 10:45:59 -0000 The 01/06/2021 13:31, Szabolcs Nagy via Libc-alpha wrote: > AArch64 always uses pc relative access to static and hidden object > symbols, but the config setting was previously missing. > > This affects ld.so start up code. > --- > it seems to me that this was missing because of an oversight. > i plan to commit this tomorrow unless there are comments. since this commit the aarch64 build is failing with gcc-8 or older. gcc -nostdlib -nostartfiles -shared -o /work/glibc-aarch64-linux/build/build/elf/ld.so.new \ -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs \ /work/glibc-aarch64-linux/build/build/elf/librtld.os -Wl,--version-script=/work/glibc-aarch64-linux/build/build/ld.map \ -Wl,-soname=ld-linux-aarch64.so.1 \ -Wl,-defsym=_begin=0 /usr/bin/ld: /work/glibc-aarch64-linux/build/build/elf/librtld.os: in function `elf_get_dynamic_info': /work/glibc-aarch64-linux/build/glibc/elf/get-dynamic-info.h:70:(.text+0xad8): relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against symbol `_rtld_local' defined in .data section in /work/glibc-aarch64-linux/build/build/elf/librtld.os /usr/bin/ld: /work/glibc-aarch64-linux/build/glibc/elf/get-dynamic-info.h:73:(.text+0xae8): relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against symbol `_rtld_local' defined in .data section in /work/glibc-aarch64-linux/build/build/elf/librtld.os /usr/bin/ld: /work/glibc-aarch64-linux/build/glibc/elf/get-dynamic-info.h:60:(.text+0xaf0): relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against symbol `_rtld_local' defined in .data section in /work/glibc-aarch64-linux/build/build/elf/librtld.os collect2: error: ld returned 1 exit status make[2]: *** [Makefile:580: /work/glibc-aarch64-linux/build/build/elf/ld.so] Error 1 this explains why PI_STATIC_AND_HIDDEN was not defined for aarch64 earlier, however i think this is a gcc bug, i opened https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98618 i'm trying to do a workaround in glibc now. > > my current plan for bug 27072 is to mark things hidden in > static pie libc and then if this macro is defined then > reorder the self reloc code after auxv, tunables etc are > set up (this requires that nothing depends on ifuncs and > global pointers up to that point). > > sysdeps/aarch64/configure | 5 +++++ > sysdeps/aarch64/configure.ac | 4 ++++ > 2 files changed, 9 insertions(+) > > diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure > index 1f8223725f..5f5f3cc44c 100644 > --- a/sysdeps/aarch64/configure > +++ b/sysdeps/aarch64/configure > @@ -1,6 +1,11 @@ > # This file is generated from configure.ac by Autoconf. DO NOT EDIT! > # Local configure fragment for sysdeps/aarch64. > > +# Static and hidden objects are accessed without dynamic relocations. > +# The exception is -mcmodel=large which is unsupported with PIC/PIE. > +$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h > + > + > # We check to see if the compiler and flags are > # selecting the big endian ABI and if they are then > # we set libc_cv_aarch64_be to yes which causes > diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac > index da2a8d81d0..180a16a29f 100644 > --- a/sysdeps/aarch64/configure.ac > +++ b/sysdeps/aarch64/configure.ac > @@ -1,6 +1,10 @@ > GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. > # Local configure fragment for sysdeps/aarch64. > > +# Static and hidden objects are accessed without dynamic relocations. > +# The exception is -mcmodel=large which is unsupported with PIC/PIE. > +AC_DEFINE(PI_STATIC_AND_HIDDEN) > + > # We check to see if the compiler and flags are > # selecting the big endian ABI and if they are then > # we set libc_cv_aarch64_be to yes which causes > -- > 2.17.1 > --