From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bahamut.mc.pp.se (bahamut.mc.pp.se [IPv6:2001:470:dcd3:1:214:4fff:fe97:7322]) by sourceware.org (Postfix) with ESMTP id E9DC0381DCCB for ; Tue, 5 Jan 2021 21:50:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E9DC0381DCCB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=mc.pp.se Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=marcus@mc.pp.se Received: from hakua (hakua [192.168.42.40]) by bahamut.mc.pp.se (Postfix) with SMTP id B1C24A2565; Tue, 5 Jan 2021 22:50:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mc.pp.se; s=hedgehog; t=1609883452; bh=Cun+P/QoGm3GTWuoPWoSqfGGEKjxHs49qqwPPcNkNOw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; b=fQDUFZdO1AURDQbIjhIDkU2C HjM7BV70RLtaE4aUVGjT/bUEqLdEF27bGt1phtjAQ4SfnSsSKySHPEaK3Z3VOuw1g61 m/RCYRUEXconr1dqt8kYp2XGJHvyvXSTK98Y0YSIe1/RE433J3LOHxgpQZ0Ht7Rzed+ cM0NbZk6WYM6s= Received: by hakua (sSMTP sendmail emulation); Tue, 05 Jan 2021 22:50:51 +0100 From: "Marcus Comstedt" To: binutils@sourceware.org Cc: Marcus Comstedt Subject: [PATCH v4 7/8] RISC-V: Fix nop generation on big endian Date: Tue, 5 Jan 2021 22:50:38 +0100 Message-Id: <20210105215039.8053-8-marcus@mc.pp.se> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210105215039.8053-1-marcus@mc.pp.se> References: <20210105215039.8053-1-marcus@mc.pp.se> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2021 21:50:54 -0000 gas/ * config/tc-riscv.c: (riscv_make_nops): Use fixed little endian memory access functions for storing instructions. --- gas/config/tc-riscv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index d7b7ae1ffb..55d5f1b50d 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -3276,13 +3276,13 @@ riscv_make_nops (char *buf, bfd_vma bytes) /* Use at most one 2-byte NOP. */ if ((bytes - i) % 4 == 2) { - md_number_to_chars (buf + i, RVC_NOP, 2); + number_to_chars_littleendian (buf + i, RVC_NOP, 2); i += 2; } /* Fill the remainder with 4-byte NOPs. */ for ( ; i < bytes; i += 4) - md_number_to_chars (buf + i, RISCV_NOP, 4); + number_to_chars_littleendian (buf + i, RISCV_NOP, 4); } /* Called from md_do_align. Used to create an alignment frag in a -- 2.26.2