From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70078.outbound.protection.outlook.com [40.107.7.78]) by sourceware.org (Postfix) with ESMTPS id 00C44385480D for ; Thu, 14 Jan 2021 18:00:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 00C44385480D Received: from AM6P191CA0035.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8b::48) by DB6PR0801MB1749.eurprd08.prod.outlook.com (2603:10a6:4:3b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.11; Thu, 14 Jan 2021 18:00:04 +0000 Received: from AM5EUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8b:cafe::f0) by AM6P191CA0035.outlook.office365.com (2603:10a6:209:8b::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.10 via Frontend Transport; Thu, 14 Jan 2021 18:00:04 +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 AM5EUR03FT041.mail.protection.outlook.com (10.152.17.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Thu, 14 Jan 2021 18:00:04 +0000 Received: ("Tessian outbound 587c3d093005:v71"); Thu, 14 Jan 2021 18:00:04 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 12c2137f826ccd46 X-CR-MTA-TID: 64aa7808 Received: from 76cb31fe1a7e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4C344F9B-BA12-4E71-B3B4-292DA880185F.1; Thu, 14 Jan 2021 17:59:58 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 76cb31fe1a7e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Jan 2021 17:59:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ja4sKCRz8UPYtDafqDE1OehvfT/mFZBc/uxSbKfm+Wi9DumHxw7keH35x9RPyXJZ/HhSWu+cYZ/QzqSNyr0jM76NMcTRfvF79ni8RBm6S/VxtzTguL7dcDxkN4kVrr3MHd5jCFGVXr9bSnz00KYZdUbsNZijXmq2iKT8EMeMn70rKwYyidOKrPBLn4D60iPXRHIvOUKGejsU0spbkxMJh+NrqDwpKdKIWIkkCy44+DGq97ZhgUOLHZxsyFOss1qaGhSR3yt5u8x806F0+Fwy+ID9mi/qcFknjaSCVHopOI51dPsJRRzQLtfKZBvkCJ5N0TMiLYLuyuMhvKe3xHhulg== 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=Wn3+LYa/pAhHgK0slIcMFcbRvUIbBxNhe5ZGSBLX3Kk=; b=OG4z5CAiZfrO1w0rqVIuepKiDrEQyHdqpWt0D4n7AadNnWc9CiRnIRj80d3fjgA3+dBXWHlp5YHSU+oms4RXOXRgV5OqCxgPrVzbxtQCYP4xKqWF9ut3MT6Jb2DhgNELWWID9/OICjXPaAjG/TgRJjvGT/A8g5rIquUkr8BIPe07jyWF8ez1xqJK8f+GRe7tiN9X4Ci1UGf5pUegNZDNaIuwGtotMPiHFKA5UJx03be6RZGPjxUgBbiX7KLsWhmrl7c67H9rKQCwjFUyKJSfdh8bx45Zavv9bK+Q0Em9Ci2Y1EGbe7uF7MdSvOCoHlpoqNCS4LMZk18zlDKPFZQa9Q== 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: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=arm.com; Received: from PA4PR08MB6320.eurprd08.prod.outlook.com (2603:10a6:102:e5::9) by PAXPR08MB6544.eurprd08.prod.outlook.com (2603:10a6:102:157::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.10; Thu, 14 Jan 2021 17:59:57 +0000 Received: from PA4PR08MB6320.eurprd08.prod.outlook.com ([fe80::700f:ddbe:a347:ee4f]) by PA4PR08MB6320.eurprd08.prod.outlook.com ([fe80::700f:ddbe:a347:ee4f%7]) with mapi id 15.20.3763.011; Thu, 14 Jan 2021 17:59:57 +0000 Date: Thu, 14 Jan 2021 17:59:55 +0000 From: Szabolcs Nagy To: "H.J. Lu" , GNU C Library Subject: Re: [PATCH v3 5/5] csu: Move static pie self relocation later [BZ #27072] Message-ID: <20210114175955.GD11466@arm.com> References: <20210114171927.GC11466@arm.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210114171927.GC11466@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [217.140.106.49] X-ClientProxiedBy: LO2P265CA0248.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8a::20) 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.49) by LO2P265CA0248.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.9 via Frontend Transport; Thu, 14 Jan 2021 17:59:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 54280da1-3245-4b55-fe2f-08d8b8b63873 X-MS-TrafficTypeDiagnostic: PAXPR08MB6544:|DB6PR0801MB1749: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Q7OLqwFHEcrRcCpnspsaM9U6UHd2jae8KGonvHVY6uYukdJdpeKhxvk2nA2E23mMK2LwvxoXOHpPrk6GYlmPLe+PVJs3DtIpLX24+7CT7bAy5n0S45hnUdzv5JRPY58DlYlXV8D/zjwpR5+piAmLKYmTpTnfwH7fxE+SP/zEDniOyL2qBypGBQh9pXwocLzmD6JyUAS11sLwyI1KPjw6oYSZf5QwCoEq5xeUbrjzrng5uRkpocMERT6cmYmVOA8UX2286ZtgoJmA3WbozvKOvbE6aYQkIUlZ6x8xmZVbgJZNELfX/g2pQZmo0uTnvpPtBO3uR1Ax/osyjgONnlyAO9nDzCsIRhEeZBBLfjte8nEgh/GwRBjmUrfAc4Kz12xr6DMbbsd3epOMhWQv5lXLVA== 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)(366004)(376002)(396003)(39850400004)(136003)(346002)(66476007)(66556008)(86362001)(66946007)(33656002)(55016002)(956004)(44832011)(36756003)(8886007)(186003)(2906002)(26005)(52116002)(5660300002)(8676002)(8936002)(316002)(110136005)(478600001)(2616005)(16526019)(7696005)(1076003); DIR:OUT; SFP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U4wa25YbWdzOW01MndtbWdZTjlURGhwT0RpZG1JbkdIcFppUUNM?= =?utf-8?B?eXAyR2wrS0JuL3FmK1pkTkQrWkptQXN2anJRYVROMUc2YVZCRWMzM1RLUmFv?= =?utf-8?B?eTZuZFZJVjV3UnE0Zy9mMXNLcmtLRVFSL3VKWUdwSG1wNjZWYVVPcXFRR0R4?= =?utf-8?B?bFRUY0szMDBUTm1ua1F5aEQyc2JQOS95eFF2aXZQcWtKdnJMb1VMbnoxRTNs?= =?utf-8?B?N1MxOWxSQm5DTHFiYmRYSHNYTWRyb0kwLzNUd3laWFBQd28wMm9jZStrWlZn?= =?utf-8?B?bzYwSEtud0NJbnBlYXprTTJlYnBGQ2R2cG1TdVJTcTZOakgvYmV2T1IxWGNo?= =?utf-8?B?YXBQY3RxSmczdTNxaFkxQzIzUzhEVkJDNmN3anhVNyt0NnJOdVR2U0tBQkxH?= =?utf-8?B?bEhFS2V6Q2ZQUnhwK2pacGREV3ZrenNJSDBpMVA2aDFSOEc1MmpWQUM3SHcx?= =?utf-8?Q?pByNbUhuQOn/y0+jjrjInaq0e7hqM1m0Bk?= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6544 Original-Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 242c6857-24a8-416c-b23b-08d8b8b63448 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NvjXg9WanghFf+YHktjX+TCfS+I+3lwH81OfKlB6ZacdRqVdBVUXWKI/XgFKvHOd31Yrfm6TMPNbn/avABbLvIzmLd6SQYBbDIoHE4yQN/8pkIBEzs5ugUvpKp/vAeZNJ7CgLTYZdNfaYwLMgCxDr4zVXOTjt0HEXlU/yOXrKBIIYRA6eED0A7ibPy89zBh2+4IO7SqnHlqMXtqE1jmZEUDt7bUTjvqFNtHsEc2wmA7JcolrVQeBdDFf8PMuO30wckBCUQMUoegiGBpX59IVVYWU7DvpQ0vQiG1unX4WQ35aT53ZqQtUwJ7338DXpWFf5FYQfhuSuKw0ROhg4szerhUfyL4wkp27bvew2/+Jopx89OaiFurVMnnlBs39xLYKXyNr1zjMN+m7iZFC0Fbg0uoxLasRcimKKZZ18BXYi1EQS3J/t4PhEGxlCAJLY+eQTnGOfsvqkmuGYdsegJ7M/Jl3ZrtoBYzY2nWQuopxhYrLE/C4hrnBORUo/qcI+AnW 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)(39850400004)(346002)(396003)(136003)(376002)(46966006)(336012)(55016002)(34020700004)(36756003)(7696005)(82310400003)(5660300002)(110136005)(956004)(478600001)(47076005)(70206006)(81166007)(2616005)(70586007)(16526019)(8676002)(186003)(356005)(316002)(8886007)(8936002)(2906002)(33656002)(1076003)(86362001)(82740400003)(26005)(44832011); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2021 18:00:04.3019 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 54280da1-3245-4b55-fe2f-08d8b8b63873 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: AM5EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1749 X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, 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: Thu, 14 Jan 2021 18:00:09 -0000 The 01/14/2021 17:19, Szabolcs Nagy via Libc-alpha wrote: > The 01/14/2021 08:26, H.J. Lu wrote: > > > > We need to make sure that there are no RELATIVE relocations before > > _dl_relocate_static_pie is called. The problems with i386 are > > > > 1. All calls to IFUNC functions must go through PLT. > > 2. Calls to hidden functions CANNOT go through PLT in PIE since > > EBX used in PIE PLT may not be set up for local calls. > > > > I think we should add a new attribute, attribute_hidden_ifunc > > which should be defined as > > > > 1. __attribute__ ((visibility ("default"))) if in PIE on i386 > > 2. __attribute__ ((visibility ("hidden"))) else > > > > attribute_hidden_ifunc should be used on prototypes of all IFUNC > > functions. This is similar to NO_HIDDEN_EXTERN_FUNC_IN_PIE. > > so is it enough to declare ifuncs with such attribute? > > e.g. would it work if memcpy is default visibility > in PIE libc.a but user code is static linking that > with non-pie caller? hm no, i think the only inconsistency that can happen is if an ifunc function is marked hidden in non-pie libc.a, but user calls it with default visibility, but that is not a problem i guess. maybe this works: target gives a list of ifunc declarations with explicit visibility attribute (default vis for i686 PIE) in a header that is pre-included very early everywhere so later declarations keep the explicit visibility instead of the one specified by the gcc pragma. (but i don't yet see how to have the right prototypes in an early declaration) > > do we have a way to track which functions may be > defined as ifunc? should we do that manually? or add > the attribute to every extern function declaration > within the libc?