From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70052.outbound.protection.outlook.com [40.107.7.52]) by sourceware.org (Postfix) with ESMTPS id D05C73858C60 for ; Thu, 7 Oct 2021 15:57:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D05C73858C60 Received: from AM6P192CA0072.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:82::49) by DBBPR08MB6234.eurprd08.prod.outlook.com (2603:10a6:10:202::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Thu, 7 Oct 2021 15:57:43 +0000 Received: from AM5EUR03FT063.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:82:cafe::ff) by AM6P192CA0072.outlook.office365.com (2603:10a6:209:82::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Thu, 7 Oct 2021 15:57:43 +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 AM5EUR03FT063.mail.protection.outlook.com (10.152.16.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Thu, 7 Oct 2021 15:57:43 +0000 Received: ("Tessian outbound e27daf245730:v103"); Thu, 07 Oct 2021 15:57:42 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ff7c5556a60f0075 X-CR-MTA-TID: 64aa7808 Received: from 50e1d1ba153c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id DE54473A-AA69-47C5-87D9-AF1D5F619F98.1; Thu, 07 Oct 2021 15:57:35 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 50e1d1ba153c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 07 Oct 2021 15:57:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z+dxfOtsxTd6915bJNRwoOedNhZmgepKToTR/NRAKD+PWeQf3ctVPEgU6HzhnwwD5YB6Q1WjTpEE4cbFdTx6ZMxpaY/3JzSrNX/mqhvasG6+Xc/4p5Bd2GSeZPCE/JZU3uoxuP3cyoLPqhFh2hybj8yOisT32wZeIzlISycRD4wtaPi/RQQ7/CYQOXhrmkiy1/Zq4WfwYLuqTpgDQncJ6MjWNBbBcQosqNRxiZ56WnE2K4JJVq3eL+ijbw+wVB64PL5riXGNMUAraIcEYtlFGXfLiTRf9euY5Wa3UNl1u48gKMUqDoEeVHK1ExUmtCtaUxlb4c2SDUXlltAhG5PvtQ== 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=eGpEHft9milkhaOJZF9ELwjKkpxmL6XiBuEvcsQ6Bv8=; b=VdQBecXMMlFIeBoPRHBzPxdaO7F9ddmxookQpCrrGXUs7OVVssjZ4AMt7Y2DVty1IkI1Oan18+AuY0MSMBnfZclTKYGSdHYs+f5jWUZcT/AKvE0uHgr8ECRZdVlK0fY8vjQ0gOL1fif5jhl5/vsJL1AH5A7q3pUcL1V27W2g14IgfJtg/dFfdIG4zH4ss7e2gubJ543jpciTXnLC+WsJ2Cp6ywTrepal59J3U6/PaBIlEw4L2C7wF7n7uTktuL2kaT7/CYrOjVVuLBjS6XfC2UcFMn/SEw7KJqAkF8/koRwBHFjmElfavZkL4WOBr8f//UYdMloZQgvH4t5sov4xJA== 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 VI1PR0801MB1854.eurprd08.prod.outlook.com (2603:10a6:800:5c::15) by VE1PR08MB4928.eurprd08.prod.outlook.com (2603:10a6:802:aa::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15; Thu, 7 Oct 2021 15:57:34 +0000 Received: from VI1PR0801MB1854.eurprd08.prod.outlook.com ([fe80::a592:9d43:f9d3:bad7]) by VI1PR0801MB1854.eurprd08.prod.outlook.com ([fe80::a592:9d43:f9d3:bad7%5]) with mapi id 15.20.4566.023; Thu, 7 Oct 2021 15:57:34 +0000 Date: Thu, 7 Oct 2021 16:57:30 +0100 From: Szabolcs Nagy To: "H.J. Lu" Cc: Adhemerval Zanella , Florian Weimer , libc-alpha , Andreas Schwab , Joseph Myers Subject: Re: [PATCH] dl: Use "adr" assembler command to get proper load address Message-ID: <20211007155730.GG2700@arm.com> References: <20210907174417.sctsswphsyae4mpc@google.com> <20211005094554.2f28d6bd@ktm> <20211006075721.qnv6qabroytcsido@google.com> <20211006110321.5f1a9610@ktm> <20211006134344.63395242@ktm> <20211006125517.GE2700@arm.com> <20211007111926.30db4c4f@ktm> <20211007120038.1445bbd3@ktm> <44bac775-3127-7bc7-c4ea-fa282ed277d3@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LNXP265CA0007.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5e::19) To VI1PR0801MB1854.eurprd08.prod.outlook.com (2603:10a6:800:5c::15) MIME-Version: 1.0 Received: from arm.com (217.140.106.52) by LNXP265CA0007.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Thu, 7 Oct 2021 15:57:33 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0d696fd6-30bd-411e-19b8-08d989ab3294 X-MS-TrafficTypeDiagnostic: VE1PR08MB4928:|DBBPR08MB6234: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6430;OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: odntpp2zDWJKblXXu3bhcWFrQh1E9uj7kDjJJB2knV4OJq3lOE6HOp4oYeFZa1+PCAcUJ3BKfkcB0UdNSooWWnKPQVDIM8A9qNDUR35Bwz3NeAFcsCAvKhf66DKbTb180TVYG38BLOfgoxiKOCzkMdg/hVSGpS0fhUncIRlXF7CAO1NIwm7+ubRtODecXGY/s+yuZ8ivdYwRUDbzUKGxYy7vG74c5Fu2XCWXUijxEdZMmF84OVlHuXIUM+jkJTcv0cIkisEUhgyKv76jV5oKXqQJfKVtT+ruQcyxVBC8f9mhTMeodmPtfkKsiJOGCLiGaw8oKbWqBMBx63zP0C8QqyktOITuTVPhxvI8LUFpeqLXSmrKA7fcWwUIpOfNUocP0hvxPeyq5QiZ1kK6NOnICqjY37QwyPbnS8y6Bj44uC4shqdHZtFxGWDtKbtVcsebYP0Sh3qZLv6w00i45FPsWeKEMm3wKWDU1vZPl7/neg/SXDJoqYdZcrsqIk6RLa2pWjGmscyp4upSB4hu6o8IEGTCgCVnMXYo4gH35TauHKGKAFB2vtqVk18/bgL+7lG+VvUZqvpQUHAQhpPVNJlGtu5dqOv6WEQq9NAgYC6yOleYcuzcaBz2Y91u+Bu17QrsYtrcV7D6OVhP63onuVjEfdYVkPogpA1o8cDVIJ0eN+vFLUwtayKGMOE6eNPsw8JRl2PWtDp577LJ7Arndu8bBA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0801MB1854.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(26005)(186003)(956004)(86362001)(2616005)(53546011)(33656002)(5660300002)(36756003)(1076003)(316002)(7696005)(52116002)(54906003)(6916009)(2906002)(66946007)(66556008)(66476007)(8886007)(8676002)(8936002)(38100700002)(508600001)(38350700002)(55016002)(4326008)(44832011); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4928 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: AM5EUR03FT063.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: c04a3f38-a872-44e0-b3c3-08d989ab2d05 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pFOy2y/mcsLUO73EzhVuOKE7JyQvT+J+mnPR/vCZJd3TtGt2pcrClee5N8G3CkM621MXlEvzBMg1JRwE7SBVZmTDSuJq5+/xosRDK8cLY9FPOiejVltkmWQb0KyFj979J3WXl3WqTGZVtF4A/KxmJCSV7ZNoH1C/5mUz+HP5N8PKlPpEt92wHQ9E8Y0V5nkAPwDyP3eqpaz26gNJIyTc6FBBh/fpSgojIOKO12tPPZZENPWKM7jlcwtCePgpYfiKSN3iajayBaVf9qGBrddcJ5m6KMAluk8hpPrvRjoyQ7u1wrk4vfxELcD8GWJrlkXYBO6zDgaGThvhUwCvkioAfxK66BWEcKYkFCHgiqjsCPEyYHmBXMG139fdAwO5Ijux3aHVT21hwe5/ZuGCj+dUJ8SPKm7KREJ5BlqThUSBdLEqRY1U0kzGytKBIG/xmTw7ia5EbqdutOig4Kwu/lPgh4s26G1CliRNs8H6KRAnJqWRf+fkHpR8c066skDbePHjB7kBlcV6v2SVLkLj8pfaXY/LtHFwU9p5aNxLZoVWkUuQt5kZEM8dwBOQq1hDp+7iyqzii0d6JMmNcNbg5zF23ComA30EyKG9CQ0iKzZz8Q9VPWYgVAJvNygaKpktZ0DzRHS8WBxHwVNez2Dj/DN8VeFg+R0Vopz7gO7xKcz6PoCQwDQyyIqS7ISE7MLUlcAZd/oSczVGvbe+qqvqI3MtEg== 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)(46966006)(36840700001)(508600001)(336012)(2616005)(107886003)(7696005)(55016002)(8936002)(956004)(53546011)(26005)(36756003)(8676002)(36860700001)(356005)(186003)(81166007)(44832011)(86362001)(47076005)(4326008)(1076003)(2906002)(54906003)(70586007)(70206006)(316002)(6862004)(5660300002)(8886007)(33656002)(82310400003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2021 15:57:43.0055 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0d696fd6-30bd-411e-19b8-08d989ab3294 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: AM5EUR03FT063.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6234 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 07 Oct 2021 15:57:48 -0000 The 10/07/2021 07:29, H.J. Lu via Libc-alpha wrote: > On Thu, Oct 7, 2021 at 7:18 AM Adhemerval Zanella via Libc-alpha > wrote: > > On 07/10/2021 07:00, Lukasz Majewski wrote: > > > On Thu, 7 Oct 2021 11:19:26 +0200 > > > Lukasz Majewski wrote: > > > And indeed it is the case. Yocto/OE by default perform prelinking (use > > > prelink program) to speedup start time of dynamic program. > > > > > > The prelink [1] itself assigns some virtual addresses to all required > > > shared objects (in our case for /sbin/init), so no clashes are > > > encountered. > > > > > > And using prelink is a _default_ behaviour in Yocto/OE poky distro. > > > > Does it work without prelink? Also, does it fail with prelink in real > > hardware? > > > > It indeed might be a prelink issue in fact. > > This will fail everywhere if prelink is used. i thought the point of prelinking is that the vaddr in the elf image is the runtime address so you don't have to process relative relocs or adjust pointers in the dynamic array with += l_addr at all (and then l_addr does not have to be correct, ld.so would still work). but here ld.so is loaded to some random offset on top of the static prelink offset. is this expected? does it make sense to prelink ld.so this way?