From patchwork Tue Oct 17 08:40:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Frager, Neal" X-Patchwork-Id: 734366 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp366555wro; Tue, 17 Oct 2023 01:40:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGHKjo9rqxMuHIEIchAvIMUVXwYX64wIOne4L3z2lVVfQnj9PdMoEPqrYWY9tyD1QcPKUij X-Received: by 2002:a05:622a:1ce:b0:418:797:20b6 with SMTP id t14-20020a05622a01ce00b00418079720b6mr1905203qtw.5.1697532029039; Tue, 17 Oct 2023 01:40:29 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1697532029; cv=pass; d=google.com; s=arc-20160816; b=RH9Pa0qERYryMoi1F3XoGP8ivrFq+6/ZeW302mAocHUnZZS3xKQuBW1FUORKuv49vs nDA468XxhftG6Hs1ieMlwM7go3cw2iQuQ5GrnMME0+FzMSKBSwAKxEyN33G9Vuh9qTrj evKhLOTpsyajTcsanzPF4aGGLyT5NeJDkmqav9qiQtiLD19SRKvuP9Mpee6BrQbxh9BJ TRmLOiGENymGVThenvjAzOMxvluKSNCb+PztuJLBN3FM6PNc1zBtzuzOKMoqdkMKxyuX SW4jZXB7N8BLxQ/T7eEgHLgpGG/5Bg3RVragBI1nO5RQgW3tp2h4dw1iJRyR7PSjHDTb 64iw== 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=hqVjpj4iTnCYPZGVVbYzSdWhwjiG6uNls1kTfGk5twVQjYR5mStbUdXlpHft8h5OhM yJjTjdle05MCmzvp7djfUiXV8te+/jOeS82HsecwoYPTEKxox92dZDm1GulegKu2tb4J dsZGlud9OzvBxh8Xr0VXcIMBD67rTllNO216NvleTvlo/rgO9p7Yw+nOgVrx7Fy09b+L gbNThFo4XXKoUSV7+AhpVus29t153ATCtwVh82bbHXYcGxjO7C0/3SHVoFBJ9UezxouM GuFvmPazh0mTIXamN2+irpENYLuCh0pg6DE1BEqUg+pfsWgvKTjXAcfgWzoWLq+BaM+2 mUgg== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=H4xkKtxJ; 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 e4-20020ac85984000000b00417bb85e45csi758214qte.541.2023.10.17.01.40.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 01:40:29 -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=H4xkKtxJ; 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 A8EC1385773F for ; Tue, 17 Oct 2023 08:40:28 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2049.outbound.protection.outlook.com [40.107.223.49]) by sourceware.org (Postfix) with ESMTPS id 7205E3858C33 for ; Tue, 17 Oct 2023 08:40:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7205E3858C33 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 7205E3858C33 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.223.49 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1697532018; cv=pass; b=lXh3lElNN1P8WQtixIWWsB2DuRIMAwgvfahBhvavWZtxl5TnDPdk0BxIE2ITDbT7jqzMLXV8m8rJ8kgS5xO1041qocPhlTM69uHuH9364F1zV7RBPFsIpcsENR/eW2+YKL1AMyQMfNx5knsWgC3xRPJU3uC9do/DYd4pAfzLdDk= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1697532018; c=relaxed/simple; bh=TVB2bzlU0X1go2pRR3EoEnQsKlvBXotAlBRr2abbABs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=B/d4Yqsik8xZq/cxFyv6VV0mlVuXA0T3BrB/z3dy+7KKCwbweZZ9yjvjARFvaKNADBO74BlcAD4UkPdLKlmvywMVdkJkm47KrYr7bp3DjoPXMXs42XQoRuPd/a5chTupodAmOoI1Lm+aMup8A46S7rqeQAnk/MrRo4USyoFe0fg= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H1cuwb6nGnlLsJOIFF6sEkWzYqt/o2lQbrgO8dwQ5Nr8uZUfRD2bJWEmgLxtSyYtkyAn/wA6SPgG/goYh2fIcZYHjVhau/VngqT6O+/cMaqTwxSugXZB4/yirzJ++VctkbJIAUozYYN0wq1M0rtawAtI8Rq8uXs52oI3caPXIr321IKT53GGL2giAbRgJMM9/oyo1t7KE/jjtWLHzwNRWPzFMwj2CTicSeIP3Fo7k/I2LBrkpJ7KNKx2bGKNx0PPxaA6twMs9LpdcfctYYYh1xlbXS7xs/dpN/id+o0CH4UyGAAyWhqXgYy85hKSrRWNlYGa5OPGe6v9Q3FQrZA1XA== 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=f0x8g7bdtlzz25Y8trYsv+GGA1vPKdaJK+N//mjtAzHU8902k1DlBhCRs/eww8z0E9t/XBMNJgYDYkcpJWmQFpJKfdxit0supwMtkbOS3XR+tdAwZAnPFWeHRRilLs4ZAqwqtTfoeNJ856NKoEHsAFaJEVdqCWAKS6dQT3dyZ63X2skdFfltSPE1/216WsfMTCIlMBwOPmri5pdMG2Dt/mYm5XvBI9k4CaPPWlcIEi4rb95EVdqn7t61e9T/N+uTceaUD9bMQ48BLkrs1AO+99zW58aKt7eS4JzN1eDb9Kv/nbRq3anbJULarBjtJdFMtW8U2BCBmsoYYp/BaGklEA== 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=H4xkKtxJSfHdNnDYmYx3PKeqP9wli3KhRX1Hs/cbpFrMcbR2GnZbkDaylo3D4z9BNKdmKh13HWamZX+eqv6TPxA6MLxdB6ZENMCbAEdWjXXiuURFaG4oZ5YGDnc7L9sF/hPskKf3JR8kcpCGBQJzFspuO0UBaN1HoOlSsszeXg8= Received: from MW2PR16CA0005.namprd16.prod.outlook.com (2603:10b6:907::18) by DM4PR12MB5868.namprd12.prod.outlook.com (2603:10b6:8:67::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.46; Tue, 17 Oct 2023 08:40:12 +0000 Received: from MWH0EPF000989EA.namprd02.prod.outlook.com (2603:10b6:907:0:cafe::33) by MW2PR16CA0005.outlook.office365.com (2603:10b6:907::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35 via Frontend Transport; Tue, 17 Oct 2023 08:40:12 +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 MWH0EPF000989EA.mail.protection.outlook.com (10.167.241.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.22 via Frontend Transport; Tue, 17 Oct 2023 08:40:12 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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; Tue, 17 Oct 2023 03:40:12 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 17 Oct 2023 03:40:11 -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; Tue, 17 Oct 2023 03:40:09 -0500 From: Neal Frager To: , , CC: , , , , , , , , Neal Frager Subject: [PATCH v2 1/2] bfd: microblaze: Add 32_NONE reloc type Date: Tue, 17 Oct 2023 09:40:06 +0100 Message-ID: <20231017084007.229397-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: MWH0EPF000989EA:EE_|DM4PR12MB5868:EE_ X-MS-Office365-Filtering-Correlation-Id: f49b4a52-cdd2-4e0d-9569-08dbceecadd5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4AZPRxoAeVVGISufDuNkCFXyXhjblhAxbrt9xLepB79zkFygBTLDZlu53KrP5Pxsugso60UDQH/BD+fcEXScUzl5UkcQAO3sTJ6Xk4/q1C0e9wY7+in7sGSAsJ3C/vjeFTMVZYSkzGzupCGvRcST0yxvp0D4m2WPd4hdtKTKmmWoGiUn84QGt7LSiwfkIn+T7QLH8Cx46gxf0h/1GHvV5cNd4BS6NWfXsadL/v/4Ygvnom73cb+vyPPRhl7d0+eydzGXNWriYdXfkCNUN9YhaSkAh0DHh98D3kC94236zFoLxc9HZmlzG4woKyD/iawXse6j24bfzVESFzlHU98IJKYbBLsuKTVCNcCnoCYzPdQHlpR/6LNLF37uG9W6V+7BhoR/Uel7/M7zug7t/2Tj6U7+oLCmrjw+Dz+2m7w3OZT4SxKY3/oyBq+0gbK2jjQGZVResj/hdnzAI73QPME4U+M82zBiNtvwCtfLDu16yC+tztwZSDpvbh/SjwFz3m6LGI5rhYP4sviiV9yfE+faD7hcalnsjI0k/RiRyxIIZ9Uk1Rv4/e5/fGgEQRXR+iyaLWoFHB1ePrhF59a2k8At3yd02Scv9dIzNkiDmcZ20NGelxSPq/neS8sgXpwgwa7X3W7I/uxrURRLcA8O9XCI59YeiL8+D/SrXx1w4mwDo+jYNGif4Ja625kWuNxFKHbsbYLSq0MqCTprp6VwO2W9LiWuvPs0IseLiqZn1vbyWzViBDLMugUPmgrAFdZKb6vfuyx4rUKRfScr6pdPpQUKN5Hu68U2M3j4S0KKFohm7so= 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)(346002)(376002)(396003)(136003)(39860400002)(230922051799003)(1800799009)(64100799003)(186009)(451199024)(82310400011)(46966006)(36840700001)(40470700004)(1076003)(47076005)(83380400001)(36860700001)(26005)(40460700003)(336012)(81166007)(426003)(40480700001)(2906002)(44832011)(86362001)(5660300002)(4326008)(8676002)(82740400003)(6666004)(110136005)(70586007)(41300700001)(54906003)(316002)(70206006)(8936002)(36756003)(356005)(2616005)(478600001)(2101003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2023 08:40:12.5710 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f49b4a52-cdd2-4e0d-9569-08dbceecadd5 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: MWH0EPF000989EA.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5868 X-Spam-Status: No, score=-10.7 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. */