From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by sourceware.org (Postfix) with ESMTPS id 063603AA88A1 for ; Wed, 8 Jun 2022 11:56:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 063603AA88A1 Received: by mail-pg1-x536.google.com with SMTP id d129so18656135pgc.9 for ; Wed, 08 Jun 2022 04:56:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=ZaJEMV3R8OzRyRDdxy/0J6Xjqbxu29YVMos3nEEG4ow=; b=o4GpaJqtv99sOi5WITBxaw1/wgqkKIdmvv5884A29hcCq87NIeyVMAkg3aTrvsb/rX U5b7E6apT/8coXm9LsKP/jRwg+EjpyRUyHpoIu2gyijfd98TNNFw/SBH4h0kiFOzDIqI hiUS8pzVCmS1F1fb9R7RRhKAZw3eoH2m3vKdrE0faOdAcRD+6Ull3j110YqG4EeN1QMO XE6BWr1tb2DymRiJYtLpD0CTxY+BwOgm40XVv88r5zHcOk1/N//uTt3fOG419mZ6jOHn mfIN4BXfYbnlicyTHappaHK06HA3/ZuW7MrwMQfvee2p6LqeDf38n4FX3RrWRsCXbNpg t1Zw== X-Gm-Message-State: AOAM533GE+V6h2bUYOChCLGw3/TzcqnfFLYhQuDqnqfX1vpGg2c/V0fa +XjGvfCXvdhC2AdC3ipqGsu6QK/Ck80= X-Google-Smtp-Source: ABdhPJybjlDAJEMzxpwRh1QLxHBkf1jvz6uuI0i9YT3oTxIb+Ep8JeBihTSLMqdEeZAXR2PkIKx8XA== X-Received: by 2002:a05:6a00:2310:b0:4fa:7eb1:e855 with SMTP id h16-20020a056a00231000b004fa7eb1e855mr34863900pfh.14.1654689390754; Wed, 08 Jun 2022 04:56:30 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:4668:12ef:9cb6:92d8]) by smtp.gmail.com with ESMTPSA id j12-20020a170902c3cc00b00163ebd0f16asm14550395plj.78.2022.06.08.04.56.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 04:56:30 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 55635114046E; Wed, 8 Jun 2022 21:26:27 +0930 (ACST) Date: Wed, 8 Jun 2022 21:26:27 +0930 From: Alan Modra To: binutils@sourceware.org Subject: coff-z80 reloc howto fixes Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3036.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2022 11:56:33 -0000 Mostly cosmetic unless attempting to link coff-z80 into another output format. * coff-z80.c (howto_table ): Correct size. (extra_case): Use bfd_{get,put}_24 when applying R_IMM24. diff --git a/bfd/coff-z80.c b/bfd/coff-z80.c index 1fefee44b13..fd3c84a196e 100644 --- a/bfd/coff-z80.c +++ b/bfd/coff-z80.c @@ -60,7 +60,7 @@ static bfd_howto_type howto_table[] = BFD_HOWTO (BFD_RELOC_24, R_IMM24, /* type */ 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ + 5, /* size (0 = byte, 1 = short, 2 = long) */ 24, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ @@ -195,7 +195,7 @@ static bfd_howto_type howto_table[] = BFD_HOWTO (BFD_RELOC_Z80_WORD0, R_WORD0, /* type */ 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ @@ -210,7 +210,7 @@ static bfd_howto_type howto_table[] = BFD_HOWTO (BFD_RELOC_Z80_WORD1, R_WORD1, /* type */ 16, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ @@ -405,11 +405,9 @@ extra_case (bfd *in_abfd, case R_IMM24: if (reloc->howto->partial_inplace) - val += (bfd_get_16 ( in_abfd, data+*src_ptr) - + (bfd_get_8 ( in_abfd, data+*src_ptr+2) << 16)) - & reloc->howto->src_mask; - bfd_put_16 (in_abfd, val, data + *dst_ptr); - bfd_put_8 (in_abfd, val >> 16, data + *dst_ptr+2); + val += (bfd_get_24 (in_abfd, data + *src_ptr) + & reloc->howto->src_mask); + bfd_put_24 (in_abfd, val, data + *dst_ptr); (*dst_ptr) += 3; (*src_ptr) += 3; break; -- Alan Modra Australia Development Lab, IBM