From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by sourceware.org (Postfix) with ESMTPS id 514743858D28 for ; Fri, 19 Aug 2022 01:11:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 514743858D28 Received: by mail-pj1-x102a.google.com with SMTP id s31-20020a17090a2f2200b001faaf9d92easo6195683pjd.3 for ; Thu, 18 Aug 2022 18:11:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc; bh=DepysJ5z2BQd4jLL+kO/6d+FugqdXS/6VjDXBQG6SuU=; b=fjKRhh8xRrFbcwdK37W9f9blu3Myn2eNoUs/v2zb9nGQ7XSV1UFXOUTo2SB6ahhfOT OFfowrBesbRohUTJYpvp/GjETByXMWIDMx/wmE6GaLZjX95zyU/0M1O1rQN0/UQ+OhNG 1dixzC3DMUFJ4/ppGJYGvgy7Y/j1XemuHdqTKZw4MoBuEdyRBgVZr2XAIgcVsJEPI+hY cIPFIHA6mDhbtp/gUFO77ykj0uQCz/zvhO+0l1bQ9WnUrtMjjliga54fPWxlOESl1ONM ZYp2k0LqXpKLkjhZBFpK0OnCSrDd4O1RoDcQ53CLyLeU1mU9R42TG2AJzYI6QYqeFmOa LCog== X-Gm-Message-State: ACgBeo1VgL9iI4QLtuM+fXeJb8ano5OFnY6gtUgc5M1rttXcuEYggrv0 nU/jTNuimZO9J0dsJJGW6+xhukzWEhA= X-Google-Smtp-Source: AA6agR4Yt3mNsiA0/LMGGLmKUBrxUkHZW+xRvoJ19+ChS3xkg2qwQivEEuisCj+2FeWuwzZfi12DZQ== X-Received: by 2002:a17:902:e750:b0:170:8891:83be with SMTP id p16-20020a170902e75000b00170889183bemr4883331plf.12.1660871468334; Thu, 18 Aug 2022 18:11:08 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:a3f:e5f6:9b90:2ecd]) by smtp.gmail.com with ESMTPSA id y9-20020a62ce09000000b0052e987c64efsm2286485pfg.174.2022.08.18.18.11.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 18:11:07 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 4E4191142EB2; Fri, 19 Aug 2022 10:41:05 +0930 (ACST) Date: Fri, 19 Aug 2022 10:41:05 +0930 From: Alan Modra To: binutils@sourceware.org Cc: Youling Tang Subject: loongarch64_pei_vec garbage in objcopy'd relocs Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3035.9 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: Fri, 19 Aug 2022 01:11:10 -0000 Like commit a9c09a3667cc, but for loongarch64. Note that I'm just making things consistent. I have no idea whether struct external_reloc in include/coff/loongarch64.h should have an r_offset field. If not, then this patch should be reverted at the same time the r_offset field is removed. * coff-loongarch64.c (SWAP_IN_RELOC_OFFSET): Define. (SWAP_OUT_RELOC_OFFSET): Define. diff --git a/bfd/coff-loongarch64.c b/bfd/coff-loongarch64.c index 8013737a08a..f752efbb51d 100644 --- a/bfd/coff-loongarch64.c +++ b/bfd/coff-loongarch64.c @@ -71,6 +71,10 @@ static reloc_howto_type pe_loongarch64_std_reloc_howto[] = #define bfd_pe_print_pdata NULL #endif +/* Handle include/coff/loongarch64.h external_reloc. */ +#define SWAP_IN_RELOC_OFFSET H_GET_32 +#define SWAP_OUT_RELOC_OFFSET H_PUT_32 + /* Return TRUE if this relocation should appear in the output .reloc section. */ -- Alan Modra Australia Development Lab, IBM