From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2047.outbound.protection.outlook.com [40.107.223.47]) by sourceware.org (Postfix) with ESMTPS id 5969C3858D33 for ; Wed, 27 Sep 2023 12:49:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5969C3858D33 Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ITfg/GKCITYv7UKR3dCtalN5fvOv0aTOduFBCYLLPn7CZAnYZWlRAYJmlG3qrv0SHOOACbLIEnQYVM+rhYBs0a+s19OcYxb2Ub715LX1toqX7OywXparxBW1uEMjkGmQ+RkT0Xg/ecllN3mgV4OhaMwSCokb/l3lx2GbhzRtAqjD3HbNPPky46kG5y+BPh+UVET1utED4zkEkSWkJv1or7di+Er+o7LYRp1bzXLznnwvXJZgyB9qmWigcomWQpL+qAZHrkebFugj2pZefM0LR1vHvWA1awsqbywoMScmyHUsaghshHd8tlMCeRwYk1ICQ5rxykLtwwi1j2sIrPxfyg== 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=vuNwNee1YuU0yWPwjJ9TakVzChNkdLf9r4yPXkxxDxQ=; b=aua3BsHQ6SPz92dncWdFig9oyGrWyeH/DIFVI0iAb8hter/b8EmqrFKZNXQyr2Cm+Xj2RdQ/DWNu0bczrOGsUWcEXulK+ML37S7XdbsVsKLQ4tmozrO6mYWE1HopYTRPKqI3A4zU+46mU58NBDVMgW4YdZBh3xeyDIbbp+SZzAQ3OIfJhbkxLzlsGwS92tBs9cOQ6aFr54D3738ryZLeVlHDPgk0CfXg4B3t4xEmEk25tfnfSiK8GwVF52Rtm/VV8oxmf7nwsKgvW7MJDs561Zv8DyyHpd1WlBpldmNCXjLr8sUURcSvIl5KaXUQw0nJkT0pTLvKCKo7nmHgqJY+ug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vuNwNee1YuU0yWPwjJ9TakVzChNkdLf9r4yPXkxxDxQ=; b=zQfT6fwdnLynXvobqvpbNiChntoo0gLcBTudWUyiXysQjYf5tL5tSISRcVprhxXSnryNJCQTI4zyzFpWzYaqx04yFNQ58qv/bnZa7mjligk3LWYTG5x/k12/63xARx84YjQDtWAAyVMy7Y9g7jVd22Qc5v8xzgRJXYA45ACBUzk= Received: from SA1P222CA0118.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:3c5::6) by CY5PR12MB6324.namprd12.prod.outlook.com (2603:10b6:930:f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.31; Wed, 27 Sep 2023 12:49:27 +0000 Received: from SA2PEPF00001508.namprd04.prod.outlook.com (2603:10b6:806:3c5:cafe::e2) by SA1P222CA0118.outlook.office365.com (2603:10b6:806:3c5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.22 via Frontend Transport; Wed, 27 Sep 2023 12:49:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by SA2PEPF00001508.mail.protection.outlook.com (10.167.242.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.14 via Frontend Transport; Wed, 27 Sep 2023 12:49:27 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 27 Sep 2023 07:49:27 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 27 Sep 2023 07:49:26 -0500 Received: from xirengwts09.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Wed, 27 Sep 2023 07:49:25 -0500 From: Neal Frager To: CC: , , , , , , , Neal Frager Subject: [PATCH v1 1/1] bfd: microblaze: Fix bug in TLSTPREL Relocation Date: Wed, 27 Sep 2023 13:49:18 +0100 Message-ID: <20230927124918.1584074-1-neal.frager@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001508:EE_|CY5PR12MB6324:EE_ X-MS-Office365-Filtering-Correlation-Id: a39f204e-226c-400f-995e-08dbbf582f74 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7bLgLDKFxODjjzWFYO7/zCCzZNQjM3nwQBppupUv0kRTy71HK7CZ1bwoCwRuxPB0To8pwxH59em38CnrpXK2GZ31veC+iueC8UDV7isRPfRcl1SvhuhpcY8jbYXECn/IvP7QJ7+qWlxgFGDfHB3giHZv1P0DK3R2mMkuP6PB0QcUx+9aEt2euj0AHV/EWuDlv/znBc7TYT8arP4hqmEfnz/VKl2GZA0NUHs0Vf4h+x9PQ3AhVrHAqnzkfhzLEayE+d7SUmqYCHVfvCqMxYSwTvvOlcmch5zkAZQgyGRH6a4AP92JHYXoZRyWKXL2/6KP7U292yGYI1PmbxLZqYbwqVVFIzbK6Fuq2rhVf+aYM0dfc7cDJyNQJrt6qnBrhivsrk0WEztqIWVp2wAqSCM9DGkd7U2zUNw3W31ngfAbPOSKyo7FAPmP5FcQ/VqW45pwuAbHjpuOG66Fk2MfphxD/IUY73mvtN2NVyPFY4VNJ09Sl2RlIjODJN1u36YNQidCk8i4qcZYgqOsOcj8utp7GhxjMNxHo4uP9K0vLuenWVG1awXhJI676W6StMXrScqQRd8MAcD508Y7fovwf/jy7epfEYBFvBYnc0WIFCMnHyjOgM2dSvgQt87shMQUxKpvKcHk32xEQXiyj7yQLNXtNCOE+n4YX2tEoayR9ZMUcVn3fk8HPjjxxTGWC5awrUYVBYo5wsYY3CS4c0VL88fd+JJ8KUPcCdyQI2pUeo6NS1Nq6u8yoCMB/JzdoMOptWVy X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(376002)(396003)(39860400002)(136003)(346002)(230922051799003)(451199024)(186009)(1800799009)(82310400011)(46966006)(36840700001)(40470700004)(86362001)(2616005)(6666004)(40460700003)(40480700001)(316002)(478600001)(2906002)(70586007)(6916009)(36860700001)(36756003)(966005)(47076005)(356005)(83380400001)(26005)(426003)(336012)(1076003)(54906003)(70206006)(82740400003)(81166007)(41300700001)(44832011)(8936002)(8676002)(4326008)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 12:49:27.6630 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a39f204e-226c-400f-995e-08dbbf582f74 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF00001508.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6324 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP 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: Fixed the problem related to the fixup/relocations TLSTPREL. When the fixup is applied the addend is not added at the correct offset of the instruction. The offset is hard coded considering its big endian and it fails for Little endian. This patch allows support for both big & little-endian compilers. This patch has been tested for years of AMD Xilinx Yocto releases as part of the following patch set: https://github.com/Xilinx/meta-xilinx/tree/master/meta-microblaze/recipes-devtools/binutils/binutils Signed-off-by: nagaraju Signed-off-by: Neal Frager --- bfd/elf32-microblaze.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c index bbc70fdf4e3..a7e81c70fc8 100644 --- a/bfd/elf32-microblaze.c +++ b/bfd/elf32-microblaze.c @@ -1467,9 +1467,9 @@ microblaze_elf_relocate_section (bfd *output_bfd, relocation += addend; relocation -= dtprel_base(info); bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff, - contents + offset + 2); + contents + offset + endian); bfd_put_16 (input_bfd, relocation & 0xffff, - contents + offset + 2 + INST_WORD_SIZE); + contents + offset + endian + INST_WORD_SIZE); break; case (int) R_MICROBLAZE_TEXTREL_64: case (int) R_MICROBLAZE_TEXTREL_32_LO: -- 2.25.1