From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id 7EE29382D3EB for ; Fri, 16 Dec 2022 02:14:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7EE29382D3EB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=harmstone.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-x336.google.com with SMTP id ja17so936678wmb.3 for ; Thu, 15 Dec 2022 18:14:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=RF+1W25QIo9y42E4xQl4Y4zUBqY/NC8+ZiWYZ01DBxY=; b=kHnJbdivEGtseWBz9YHkLm1C2MK/hrE9FXEmmDVcNZkt5/AUSTgP7uilUduQeH4+ap Vh/UPz9MiMEIxq2mroSEkmv3zShqknFNqll6D5tWwycRG0izdUoOMYFsHSFKBOOZ2Rzv OIBcM2ImXYhT6DxsEnShVAW07TYMttwZe09Q+rDQVGwlHdY63vME4Uii7m9xrqs8OxvH jgUYVl2kUURDOfHRYOLFVtmcNELaDnDJdj2FjR9AExX8GNFwMc+cCh4QIdXNV3zILAXM 8YrVPtQ7fy6hj9y/ygUsHCGYEKlPgK0ge52AxEhfCs0QcBs7eoBsqdXgOElN6lNIaTuE Q4ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=RF+1W25QIo9y42E4xQl4Y4zUBqY/NC8+ZiWYZ01DBxY=; b=asfkKtkip8xTzqM1lT1MGAMFia/GXvuga8albTxdjpJjcPs00wJkV5HwRnF3FbJ8VB obVhmfJcw1fayr6e1VpO79w87xR73uR+vqWO+2xKnjQZiFE6F6yY2dZFwlPDO50dsZW6 afSDFEFx1VoZBKVn6n4XIJJAyYoLIC0XLSDeT4GhkTX/P/3LVwvKqwFJ8C4wd6/55R3i ugn+JePFxls3uVRZA0Hf8xGLu3wHuxaXjhlVlaiD9jDQKXU3unEQjc739CSt7K0mE+ua 7p1bmNZhnS6On6Oi2tuU3IUrv/BtFgqfLFLB+gNpx6X5oi6unxi172RDOedCiAemKW6e rZCw== X-Gm-Message-State: ANoB5pk6d46zFVBGBcH4Ksi8B0dBe+rPfZcGpe0SEoix3KrhTkyY72Uz knHryK+07ZLt7O3LCc47Qp7+cJhJd6A= X-Google-Smtp-Source: AA0mqf5Ad+Hw8/4Nv7EBzn5JIq1rl6VLn7r1P6f8B9iV26SXmPrDpPwDMyABPehX3P7Xn43l4NL6aQ== X-Received: by 2002:a05:600c:2042:b0:3d2:3ae8:885b with SMTP id p2-20020a05600c204200b003d23ae8885bmr6868622wmg.28.1671156843781; Thu, 15 Dec 2022 18:14:03 -0800 (PST) Received: from beren.harmstone.com ([2a02:8010:64ea:0:8eb8:7eff:fe53:9d5f]) by smtp.gmail.com with ESMTPSA id s4-20020a5d5104000000b0024207ed4ce0sm883149wrt.58.2022.12.15.18.14.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 18:14:03 -0800 (PST) Sender: Mark Harmstone From: Mark Harmstone To: binutils@sourceware.org, wej22007@outlook.com, zac.walker@linaro.org Cc: Mark Harmstone Subject: [PATCH 1/5] Fix size of external_reloc for pe-aarch64 Date: Fri, 16 Dec 2022 02:13:56 +0000 Message-Id: <20221216021400.22309-1-mark@harmstone.com> X-Mailer: git-send-email 2.37.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,URI_TRY_3LD 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: This patch series finishes off the work by Jedidiah Thompson, and adds support for creating aarch64 PE images. This should be essentially complete: I've used this to create a "hello world" Windows program in asm, and (with GCC patches) a UEFI program in C. I think the only things missing are the .secidx relocation, which is needed for PDBs, and the SEH pseudos used for C++ exceptions. This first patch fixes the size of RELSZ; I'm not sure why it was 14 in the first place. This is the size of the "Base Relocation Block" in https://learn.microsoft.com/en-us/windows/win32/debug/pe-format, and AFAIK should be 10 for everything. --- bfd/coff-aarch64.c | 4 ---- include/coff/aarch64.h | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/bfd/coff-aarch64.c b/bfd/coff-aarch64.c index 2c3e225a222..0faa75c63d2 100644 --- a/bfd/coff-aarch64.c +++ b/bfd/coff-aarch64.c @@ -188,10 +188,6 @@ coff_aarch64_rtype_lookup (unsigned int code) #define bfd_pe_print_pdata NULL #endif -/* Handle include/coff/aarch64.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. */ diff --git a/include/coff/aarch64.h b/include/coff/aarch64.h index 100e08f18ef..b670f28bd3e 100644 --- a/include/coff/aarch64.h +++ b/include/coff/aarch64.h @@ -54,11 +54,10 @@ struct external_reloc char r_vaddr[4]; char r_symndx[4]; char r_type[2]; - char r_offset[4]; }; #define RELOC struct external_reloc -#define RELSZ 14 +#define RELSZ 10 /* ARM64 relocations types. */ -- 2.37.4