public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/5] Fix size of external_reloc for pe-aarch64
@ 2022-12-16  2:13 Mark Harmstone
  2022-12-16  2:13 ` [PATCH 2/5] Skip ELF-specific tests when targeting pe-aarch64 Mark Harmstone
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Mark Harmstone @ 2022-12-16  2:13 UTC (permalink / raw)
  To: binutils, wej22007, zac.walker; +Cc: Mark Harmstone

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


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-12-22  7:38 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-16  2:13 [PATCH 1/5] Fix size of external_reloc for pe-aarch64 Mark Harmstone
2022-12-16  2:13 ` [PATCH 2/5] Skip ELF-specific tests when targeting pe-aarch64 Mark Harmstone
2022-12-16  7:07   ` Jan Beulich
2022-12-21 20:19     ` Mark Harmstone
2022-12-22  7:38       ` Jan Beulich
2022-12-16  2:13 ` [PATCH 3/5] Add pe-aarch64 relocations Mark Harmstone
2022-12-16  2:13 ` [PATCH 4/5] Add .secrel32 for pe-aarch64 Mark Harmstone
2022-12-16  2:14 ` [PATCH 5/5] Add aarch64-w64-mingw32 target Mark Harmstone
2022-12-16  7:28   ` Jan Beulich
2022-12-18 22:44     ` Martin Storsjö
2022-12-20 13:18       ` Mark Harmstone
2022-12-16  7:03 ` [PATCH 1/5] Fix size of external_reloc for pe-aarch64 Jan Beulich
2022-12-16 10:47   ` Tamar Christina
2022-12-20 12:59     ` Mark Harmstone
2022-12-20 13:10       ` Jan Beulich
2022-12-20 13:38         ` Tamar Christina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).