From patchwork Mon Oct 16 17:40:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Frager, Neal" X-Patchwork-Id: 734033 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp86848wro; Mon, 16 Oct 2023 10:40:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEW/pXzPOC5qR9X5srQdNvgfegcESaANNG0v/hZKZOiG5qgTLotjFc3xUpgq2zLZbkUm4sg X-Received: by 2002:a05:622a:190e:b0:417:8f2e:4e2d with SMTP id w14-20020a05622a190e00b004178f2e4e2dmr22553qtc.31.1697478048187; Mon, 16 Oct 2023 10:40:48 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1697478048; cv=pass; d=google.com; s=arc-20160816; b=qLY6BbuanWXTDRvNPyu/G+maA6drkTHtSyw9MLC74H8XfYXjawe/mJhbEb1jzUnUrw ptiz4NStCxX2TrnKpnWnqh4fYfv426m8RTrafFhBey/E/bR/3JPVVl90Bbm7c8A79O5y /s0uiWJtNTe3NgY0Vx4GBVx0ifYF0mz9SVu3TnZy0XMC3ZFqKJhx+RJDi6IaYE6MyoDD V/CmIgyrnQLlHj6DXNzqAIhERtaegjHxQLs/j3Z3NlozmFTuuJfFtgepcIW2Q9yz+OOY /l4zs16vJwD2WR6TWd7Ro6uVZ4ok/YzlgLRQidFt/FFuUu+SCUxGIJUAuDg5b9I44er8 z3Ew== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=u+OOqXecKh/9Q78t8vo9YLs4LKYW3YTH2CKw+21SMW4=; fh=/0ocx1M6cHTR3KB+bGfXUXybkgXfoO1YLoV283rAUaA=; b=qOp8YL02gXceqgaAD9xK+yZPkJgSySQ/JsjWhzR7DY4Br/R7EKTq6kfbqJR//WB710 LBTCwhduEu7dgLvKnax+2IFw4HKfxH/FJKzzAtQ5MQMszRkupKaLcB0e3GcELmwp6WZj DPHwGLRHSZPYHB1tpYs/4BVJfvnYPdQ5cBXJwbi+djUaMkbLdFlZa+SY4SXlPE5+WXfX NKaqMGL82eJxS6ZCOV5a8p6uwsadhpcE3U93QYq15CBvkiM67zwzIL91tZ+5UttKjSfO GawEyKPlj63kzGkOPnTMc/q0zguGQQck6GC46F877JeZ5Kw6ybRQF+hcDOV5g6AZFWtS xmrw== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=KW3Vwc3Z; arc=pass (i=2); spf=pass (google.com: domain of binutils-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id bp31-20020a05622a1b9f00b0041959043686si5634360qtb.250.2023.10.16.10.40.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 10:40:48 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=KW3Vwc3Z; arc=pass (i=2); spf=pass (google.com: domain of binutils-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9183F385840B for ; Mon, 16 Oct 2023 17:40:47 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2042.outbound.protection.outlook.com [40.107.243.42]) by sourceware.org (Postfix) with ESMTPS id 936EE3858C33 for ; Mon, 16 Oct 2023 17:40:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 936EE3858C33 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-Filter: OpenARC Filter v1.0.0 sourceware.org 936EE3858C33 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.243.42 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1697478040; cv=pass; b=HcZVaLk0hqMbzoRLFKxhxRnU4crH74gBDTnJ3cOUJvwDouMGYyDnrm54JRryeVIvFKIToEuPlmnJrRrCjT1gnW1r3uoq+xN2z4gAwO7ade47qL+D21irBsAfItmF0ieFMAfqOQLc0JgqvVISdvCKZuVI7n/y5l3wRSdw3YSnNo0= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1697478040; c=relaxed/simple; bh=TVB2bzlU0X1go2pRR3EoEnQsKlvBXotAlBRr2abbABs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=dOV/3Ec9t+P7oU2shTl+nuEglabztCIHWT1qQw9LbWApmDO3peXaUZ1rNFyuydDEvS/4l33QdqI1dfxb79XCMldJPAItTM7DG+gRgZUBLiciCFJsEDRtK13jCJ3mLI8UJmGfW1ueVNxR4BqOBuA2dWe0PlWHSZS0xFSeIbY1774= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kDTDs5irhwy70owy4PK6PlxmPniiEeXNMjEXXNNVOXPl1ldG1oOpnLNriF2XliJ3793OpdbpbozVqDp6wzQuZZb/QygmeDTbWSI8UwIxDeUIMPvC3E3YVgo2dLcgio5+zHQysRXSwxwoX0ffZf+4lLmASLHyiyH/7JhkBExBKBqIrf9q9VFeVtpEDOPbJM2y1Zg/X0S/f4MThM6IjpdhKUMmv/vYx6brUWAkrxAe8PSZAhu/S7mP7zraQlc2d/yvjPdQhXEAhGDEpoDZYnKj0alfLURX+yARmJCXLqn6boGgptTwXcJIDO6dv76Q1sDHArVjxp+2mzOHFZ48arqxQQ== 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=u+OOqXecKh/9Q78t8vo9YLs4LKYW3YTH2CKw+21SMW4=; b=MQxZX2FU04eriLm8yTrzZUsYuGbDsHipJVECYQBgMtED0WG3VXFsVp3Q3PUOfR8CKwe42OXPLjHvi5kyvmDnwTV601tZYbn63EJGTq3WwibZqnGJSb5yIrcvs+sBiwSi1ijvZ9K0q+1kADyB3EXn56DlCujDHWnJqXW/GBjXobq+xNoVZbV4PArQgxFPiAvqlxNkTVqi+R9oj8xRF6GfhqXjIo1aAsaOCElH/VFYP1cYPrt+2TyVSTlbsKfADXcuMXDQQxmMMvYTBEQ8Y+eBtVMIB2KHxYxOSLbMkVNHGpRZHTh+jKmtG+0TTMvi6Pc1jLxmScPMDIPLCsEQ2RqwRA== 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=u+OOqXecKh/9Q78t8vo9YLs4LKYW3YTH2CKw+21SMW4=; b=KW3Vwc3Zq4EVo4RJVh4l4pCpN6B+wjJMMq2whNsiSEpe/G8nW5UJfbUzYsSm+w+J2i7LKScED6tQcan4I8XEfpMuiuW5jbQqqWIibD7AwoN9DJ6RFE3srVbIpNLXb/VS2Ooz9XocZT5ZcZByWhU7RnLkjEf/Kf4nTTJpua9V008= Received: from QB1P288CA0033.CANP288.PROD.OUTLOOK.COM (2603:10b6:c00:2d::46) by CH3PR12MB7643.namprd12.prod.outlook.com (2603:10b6:610:152::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35; Mon, 16 Oct 2023 17:40:34 +0000 Received: from CO1PEPF000044F5.namprd05.prod.outlook.com (2603:10b6:c00:2d:cafe::ca) by QB1P288CA0033.outlook.office365.com (2603:10b6:c00:2d::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36 via Frontend Transport; Mon, 16 Oct 2023 17:40:34 +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=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1PEPF000044F5.mail.protection.outlook.com (10.167.241.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.22 via Frontend Transport; Mon, 16 Oct 2023 17:40:34 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 16 Oct 2023 12:40:31 -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; Mon, 16 Oct 2023 12:40:30 -0500 From: Neal Frager To: , , CC: , , , , , , , , Neal Frager Subject: [PATCH v1 1/1] bfd: microblaze: Add 32_NONE reloc type Date: Mon, 16 Oct 2023 18:40:27 +0100 Message-ID: <20231016174027.3178781-1-neal.frager@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044F5:EE_|CH3PR12MB7643:EE_ X-MS-Office365-Filtering-Correlation-Id: d7045d56-df4c-4e5d-9742-08dbce6f0031 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IhXSdSxiADGJZa90Z2kDaBTdqxOgqQApwHksRtdEXiqY8CP5qwFT93EweudcD9PNxa0tVJIbU5HmCkcMfWYKBv9itMciWosaXpnZQBe37SaCe/Wti9Ugfr4ceqAgsIRenWQR22Ru9BMSb6cKn1FyBbOOb63TXIceX5ywoX0iW//1IuIdLuMjy6Hr01rYEVb6/US0xNxSqUCPNZFk1aOcU+TxjxVcfJ8Y7QOpm9aIx9G6UUGEP/SBlxFO1bl52PPVJXrv7iKzpeoaQVVLzGA6bkqG11c91SKLyykv57m8QKbaLBgtvGs7aectcHvFYrPpQLVw4BskEf2tC1ZMzleFDFXdiuBHASm5LmietC27ah13hlt3hl8qjNWHAR0DHNZPyX9oTZxtuy58jvvpfAH41bLrpPF+uIMB45Cgl1xPAFtpUIKOElOP6qj4c2shYMf51FPy9yZSt59cRRJNfMn80JcRXSaZeAqjKkoouBkGXnCWz1t8t5NaObLkz4qKOn7Maz6aRjMNO8F4JM+jQzRYGessv64TEaRck75Dj/kFT+pbLoCFueEY7DMmhVxh3f+QM3nVe7uaIzXSrRpOapRbt3Xp3qsnveFifY3urxyh5/BIffEAQNEzRltPihk7Lks/PIBYOS9oR+gHzUUeYHDLEl8EZJMSCxXnxoPUZjBXsNBs7GyveNHln88h6E+c2KtEee8x1tu6bgFIHwHJS8VEPtmStx/iYVzhxoC0bg5h+StY+bKDuryyST1I8Z1nF7cAW3tOjQ2beAq3btjnXUW+MVl7nkLPc9q1HCkwU6ZL4lU= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(39860400002)(136003)(396003)(346002)(376002)(230922051799003)(186009)(64100799003)(82310400011)(451199024)(1800799009)(36840700001)(40470700004)(46966006)(40460700003)(40480700001)(478600001)(2616005)(1076003)(6666004)(426003)(26005)(336012)(41300700001)(316002)(5660300002)(110136005)(70206006)(70586007)(54906003)(356005)(36756003)(82740400003)(86362001)(47076005)(83380400001)(36860700001)(81166007)(4326008)(8676002)(8936002)(44832011)(2906002)(2101003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2023 17:40:34.1436 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d7045d56-df4c-4e5d-9742-08dbce6f0031 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=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000044F5.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7643 X-Spam-Status: No, score=-10.6 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, KAM_STOCKGEN, 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+patch=linaro.org@sourceware.org This patch adds the R_MICROBLAZE_32_NONE relocation type. This is a 32-bit reloc that stores the 32-bit pc relative value in two words (with an imm instruction). This patch does not cause any regressions. Below are the testsuite results before and after application of this patch: ./configure --disable-nls --disable-gdb --disable-gdbserver \ --disable-gprofng --disable-libbacktrace \ --disable-libdecnumber --disable-readline \ --disable-sim --enable-obsolete --enable-plugins \ --build=powerpc64le-linux --target=microblaze-xilinx-elf === binutils Summary === # of expected passes 220 # of expected failures 2 # of untested testcases 17 # of unsupported tests 14 === gas Summary === # of expected passes 272 # of unexpected failures 1 # of expected failures 1 # of unsupported tests 8 === ld Summary === # of expected passes 379 # of unexpected failures 4 # of expected failures 13 # of untested testcases 26 # of unsupported tests 217 === libctf Summary === # of expected passes 5 # of unsupported tests 3 === libsframe Summary === # of expected passes 57 Signed-off-by: Neal Frager --- bfd/bfd-in2.h | 5 +++++ bfd/elf32-microblaze.c | 25 +++++++++++++++++++++++-- bfd/libbfd.h | 1 + bfd/reloc.c | 6 ++++++ binutils/readelf.c | 4 ++++ gas/config/tc-microblaze.c | 3 +++ include/elf/microblaze.h | 1 + 7 files changed, 43 insertions(+), 2 deletions(-) diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index c1fe48bb2f1..fb0ead46aba 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -6463,6 +6463,11 @@ value relative to the read-write small data area anchor */ expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, +/* This is a 32 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction).No relocation is +done here - only used for relaxing */ + BFD_RELOC_MICROBLAZE_32_NONE, + /* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c index a7e81c70fc8..c10278cde31 100644 --- a/bfd/elf32-microblaze.c +++ b/bfd/elf32-microblaze.c @@ -174,6 +174,21 @@ static reloc_howto_type microblaze_elf_howto_raw[] = 0x0000ffff, /* Dest Mask. */ false), /* PC relative offset? */ + /* This reloc does nothing. Used for relaxation. */ + HOWTO (R_MICROBLAZE_32_NONE, /* Type. */ + 0, /* Rightshift. */ + 2, /* Size (0 = byte, 1 = short, 2 = long). */ + 32, /* Bitsize. */ + true, /* PC_relative. */ + 0, /* Bitpos. */ + complain_overflow_bitfield, /* Complain on overflow. */ + NULL, /* Special Function. */ + "R_MICROBLAZE_32_NONE", /* Name. */ + false, /* Partial Inplace. */ + 0, /* Source Mask. */ + 0, /* Dest Mask. */ + false), /* PC relative offset? */ + /* This reloc does nothing. Used for relaxation. */ HOWTO (R_MICROBLAZE_64_NONE, /* Type. */ 0, /* Rightshift. */ @@ -560,6 +575,9 @@ microblaze_elf_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, case BFD_RELOC_NONE: microblaze_reloc = R_MICROBLAZE_NONE; break; + case BFD_RELOC_MICROBLAZE_32_NONE: + microblaze_reloc = R_MICROBLAZE_32_NONE; + break; case BFD_RELOC_MICROBLAZE_64_NONE: microblaze_reloc = R_MICROBLAZE_64_NONE; break; @@ -1954,6 +1972,7 @@ microblaze_elf_relax_section (bfd *abfd, } break; case R_MICROBLAZE_NONE: + case R_MICROBLAZE_32_NONE: { /* This was a PC-relative instruction that was completely resolved. */ @@ -2009,7 +2028,9 @@ microblaze_elf_relax_section (bfd *abfd, irelscanend = irelocs + o->reloc_count; for (irelscan = irelocs; irelscan < irelscanend; irelscan++) { - if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32) + if ((ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32) || + (ELF32_R_TYPE (irelscan->r_info) == + (int) R_MICROBLAZE_32_NONE)) { isym = isymbuf + ELF32_R_SYM (irelscan->r_info); @@ -2068,7 +2089,7 @@ microblaze_elf_relax_section (bfd *abfd, elf_section_data (o)->this_hdr.contents = ocontents; } } - irelscan->r_addend -= calc_fixup (irel->r_addend + irelscan->r_addend -= calc_fixup (irelscan->r_addend + isym->st_value, 0, sec); diff --git a/bfd/libbfd.h b/bfd/libbfd.h index d5f42f22c08..d729dc48e7c 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -3010,6 +3010,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_MICROBLAZE_32_ROSDA", "BFD_RELOC_MICROBLAZE_32_RWSDA", "BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM", + "BFD_RELOC_MICROBLAZE_32_NONE", "BFD_RELOC_MICROBLAZE_64_NONE", "BFD_RELOC_MICROBLAZE_64_GOTPC", "BFD_RELOC_MICROBLAZE_64_GOT", diff --git a/bfd/reloc.c b/bfd/reloc.c index 2ac883d0eac..3ea2afc0d4e 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -6694,6 +6694,12 @@ ENUM ENUMDOC This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" +ENUM + BFD_RELOC_MICROBLAZE_32_NONE +ENUMDOC + This is a 32 bit reloc that stores the 32 bit pc relative + value in two words (with an imm instruction). No relocation is + done here - only used for relaxing ENUM BFD_RELOC_MICROBLAZE_64_NONE ENUMDOC diff --git a/binutils/readelf.c b/binutils/readelf.c index c9b6210e229..17fd7066b83 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -15279,6 +15279,10 @@ is_8bit_abs_reloc (Filedata * filedata, unsigned int reloc_type) return reloc_type == 54; /* R_RISCV_SET8. */ case EM_Z80: return reloc_type == 1; /* R_Z80_8. */ + case EM_MICROBLAZE: + return reloc_type == 33 /* R_MICROBLAZE_32_NONE. */ + || reloc_type == 0 /* R_MICROBLAZE_NONE. */ + || reloc_type == 9; /* R_MICROBLAZE_64_NONE. */ default: return false; } diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c index b510da95024..604cc935da9 100644 --- a/gas/config/tc-microblaze.c +++ b/gas/config/tc-microblaze.c @@ -2290,6 +2290,8 @@ md_apply_fix (fixS * fixP, moves code around due to relaxing. */ if (fixP->fx_r_type == BFD_RELOC_64_PCREL) fixP->fx_r_type = BFD_RELOC_MICROBLAZE_64_NONE; + else if (fixP->fx_r_type == BFD_RELOC_32) + fixP->fx_r_type = BFD_RELOC_MICROBLAZE_32_NONE; else fixP->fx_r_type = BFD_RELOC_NONE; fixP->fx_addsy = section_symbol (absolute_section); @@ -2513,6 +2515,7 @@ tc_gen_reloc (asection * section ATTRIBUTE_UNUSED, fixS * fixp) switch (fixp->fx_r_type) { case BFD_RELOC_NONE: + case BFD_RELOC_MICROBLAZE_32_NONE: case BFD_RELOC_MICROBLAZE_64_NONE: case BFD_RELOC_32: case BFD_RELOC_MICROBLAZE_32_LO: diff --git a/include/elf/microblaze.h b/include/elf/microblaze.h index fecdd7e4831..164b36d0978 100644 --- a/include/elf/microblaze.h +++ b/include/elf/microblaze.h @@ -61,6 +61,7 @@ START_RELOC_NUMBERS (elf_microblaze_reloc_type) RELOC_NUMBER (R_MICROBLAZE_TEXTPCREL_64, 30) /* PC-relative TEXT offset. */ RELOC_NUMBER (R_MICROBLAZE_TEXTREL_64, 31) /* TEXT Entry offset 64-bit. */ RELOC_NUMBER (R_MICROBLAZE_TEXTREL_32_LO, 32) /* TEXT Entry offset 32-bit. */ + RELOC_NUMBER (R_MICROBLAZE_32_NONE, 33) END_RELOC_NUMBERS (R_MICROBLAZE_max) /* Global base address names. */