From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7904) id 70F1F3858D33; Tue, 10 Jan 2023 23:32:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 70F1F3858D33 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Mark Harmstone To: bfd-cvs@sourceware.org Subject: [binutils-gdb] Fix size of external_reloc for pe-aarch64 X-Act-Checkin: binutils-gdb X-Git-Author: Mark Harmstone X-Git-Refname: refs/heads/master X-Git-Oldrev: 38190b2f01051795b15867359a4273e6cb0ade12 X-Git-Newrev: 5093b5a5e7e3e51116207eb2dec81846140fc604 Message-Id: <20230110233236.70F1F3858D33@sourceware.org> Date: Tue, 10 Jan 2023 23:32:36 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2023 23:32:36 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D5093b5a5e7e3= e51116207eb2dec81846140fc604 commit 5093b5a5e7e3e51116207eb2dec81846140fc604 Author: Mark Harmstone Date: Wed Dec 14 00:51:57 2022 +0000 Fix size of external_reloc for pe-aarch64 =20 This patch series finishes off the work by Jedidiah Thompson, and adds support for creating aarch64 PE images. =20 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. =20 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. Diff: --- 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 8a514b278ee..236cbb79ffb 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 =20 -/* 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. */ =20 diff --git a/include/coff/aarch64.h b/include/coff/aarch64.h index 7592661553f..4616cfef2b8 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]; }; =20 #define RELOC struct external_reloc -#define RELSZ 14 +#define RELSZ 10 =20 /* ARM64 relocations types. */