From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id 96DDF3858D28 for ; Wed, 24 Jan 2024 23:38:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 96DDF3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 96DDF3858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::530 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706139527; cv=none; b=r87oQBsxPdKLAY1zPq7IrinIIHr4T5/u2upk4qXSPi123LhlC7c+tn9aysz/IHZ6WbhqQW2Y1NqbtwL5eZAkhSjna4NnJURbDECaZvGwbRaRBodKZQ1joCmPkr7/5cegMh1x6ByLlvz7mVPOnBnC2qvxv+7S610aqvElreNkc64= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706139527; c=relaxed/simple; bh=BMC+K/aJxItN8ozKWLl+36+AfrqQ94KlQ2a0Rk+SUL0=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=GDU1AmRBbaXqBhbzArPm0QGPWqebNlKra75DmhK4XQXI4NZlsmghz/VbcLU+6PpyG0/I16AjdRYJrv1O+jduYn+1z8DxZg3e2OVuiI85I7UNdZTgjdMDuYZrE5D1Mxcozly97fUle02oHC9P/zxCngnO5Ss9pPManDn5nTnxkgc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-5cde7afa1d7so3156797a12.1 for ; Wed, 24 Jan 2024 15:38:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706139524; x=1706744324; darn=sourceware.org; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=oA3Fmgw7HIIJ3Nt7oXxMkfO6bTH/eDQA0w4E7a/Butw=; b=HHTI5SKMEVhPaXNRxtzvf//T36KxE/zubLYjDB7ZikULHwhWqaUiXH07UxdVk/z5EA Dz2DTDB3pineT6f74oZYPVCopQDxFcsYhn0IL+5JNbgAeoeZT7q0b/Bv5ZR0HxxnGA5Y 7Fsj/GlX+ppRc8KVqTZY4Gbe60EOQaPJVsthc9N37qZI34gnHVA9VgIeB1Bm5lpSYK/p GXGPdpWzWMKZfr5bIvF3u6Hc42gNQ0ga7p01pvINZae+YXBwFPgEQKpNaUj0DEAobIKq JnQAP82Ws5ec/oscTkWF8vm1TRrUfefAzLPeTg525pPndv75h7s8wE4Fbc4bMlDNFmqj /+hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706139524; x=1706744324; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oA3Fmgw7HIIJ3Nt7oXxMkfO6bTH/eDQA0w4E7a/Butw=; b=PladnhyJNW0xp+/a8L3HRqBGwS/Sldqg7t9NyOXxYZc6LQu8SoJNf2cag+gItHA3/T oy7drpqpU4xZFnS4/2OpbnbPRp+3zP3wwcDE6F7TEt0e6lTzv9ulYp3copHqbuR3VH9c ZxGMGGeOylr5iTTQ3pCHpYTIIDCERFsbqPXPuCs6n7bV7srdQcWUHt23iaoGXFjwHOND lKwjnIPcrBMuQbyjvCW1CHF5mrZ4FjbMqgvf5ekE1W3g/IHQdLZHxbL6Qn53WNWan62z CaldqnBlUtC1ksDwsOv4ly4C5gzTri+D3Lw7nJWJOE8gNoBS/HmGogPSrtLgP3plAHr2 LZXg== X-Gm-Message-State: AOJu0YxJIKsRhCxrJaHTZckTerYgQWYtVrIIR0LTsdW4j8XZl25SEueX Gzx9yh+HISJIGNWLAhZVeTSPVVUE0Dn6dgC3tIMHiYrtOtgp8+w6RSku9RQ8 X-Google-Smtp-Source: AGHT+IEYoDb5Aqt6pRpnMqTD0botDcXmN0vxo9NjdSOf1TUk1KWVBhJY8YCMo/6TXBRmd04euCpnwA== X-Received: by 2002:a05:6a20:2587:b0:19a:2c7d:abcf with SMTP id k7-20020a056a20258700b0019a2c7dabcfmr218509pzd.54.1706139524096; Wed, 24 Jan 2024 15:38:44 -0800 (PST) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:6c61:e7da:d5b4:4994]) by smtp.gmail.com with ESMTPSA id c5-20020a170902c1c500b001d781dc0f4bsm1734263plc.239.2024.01.24.15.38.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 15:38:42 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 36AD11140198; Thu, 25 Jan 2024 10:08:40 +1030 (ACDT) Date: Thu, 25 Jan 2024 10:08:40 +1030 From: Alan Modra To: binutils@sourceware.org Subject: riscv64-pei uninitialised data writing relocs Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3033.5 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 List-Id: Without this patch the r_offset field of struct external_reloc is uninitialised when using objcopy. Please note that riscv64-pei is only useful for obcopy, objump, nm and the other tools in the binutils directory. gas and ld are not supported. * coff/riscv64.h (SWAP_IN_RELOC_OFFSET): Define. (SWAP_OUT_RELOC_OFFSET): Define. diff --git a/include/coff/riscv64.h b/include/coff/riscv64.h index 1a1d6f37c7d..dfff497bc1b 100644 --- a/include/coff/riscv64.h +++ b/include/coff/riscv64.h @@ -60,5 +60,7 @@ struct external_reloc #define RELOC struct external_reloc #define RELSZ 14 +#define SWAP_IN_RELOC_OFFSET H_GET_32 +#define SWAP_OUT_RELOC_OFFSET H_PUT_32 #endif /* COFF_RISCV64_H */ -- Alan Modra Australia Development Lab, IBM