public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Harmstone <mark@harmstone.com>
To: wej22007@outlook.com, zac.walker@linaro.org,
	tamar.christina@arm.com, binutils@sourceware.org
Cc: Mark Harmstone <mark@harmstone.com>
Subject: [PATCH 1/8] ld: Rename aarch64pe emulation target to arm64pe
Date: Fri, 30 Dec 2022 02:40:48 +0000	[thread overview]
Message-ID: <20221230024055.31841-1-mark@harmstone.com> (raw)

The second version of my aarch64-w64-mingw32 patches. With this, I'm now
able to compile a workable version of GCC, including the CRT (before it
was EFI-only).

Changes from last time:

* The aarch64pe emulation target is renamed to arm64pe. This is the name
that LLVM is already using, even though as a rule we call this arch aarch64.
Without this clang won't work with ld. Another possibility would be to
change the -m parameter if it's "arm64", but that seems to me like it's
making things more complicated than they need to be.

* The PE big-obj test is split into a separate patch, as per Jan's request

* Added support for BFD_RELOC_AARCH64_LDST128_LO12 relocations

* Relocations against absolute sections now work

* Added error for IMAGE_REL_ARM64_PAGEOFFSET_12L truncation

* Added pdb_vec to aarch64-w64-mingw32, now that it's complete

* Restored tc_pe_dwarf2_emit_offset in tc-aarch64.c, which is needed to
make sure that DWARF offsets are encoded correctly (they're secrels in
COFF). There were remnants of this there before, but they were removed
by Jedidiah's original patch - presumably because we didn't yet have
.secrel32.

Mark

---
 ld/Makefile.am                             | 4 ++--
 ld/Makefile.in                             | 6 +++---
 ld/configure.tgt                           | 2 +-
 ld/emulparams/{aarch64pe.sh => arm64pe.sh} | 0
 ld/emultempl/pep.em                        | 4 ++--
 ld/po/BLD-POTFILES.in                      | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)
 rename ld/emulparams/{aarch64pe.sh => arm64pe.sh} (100%)

diff --git a/ld/Makefile.am b/ld/Makefile.am
index 65fef4e1690..b066b9d7323 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -388,7 +388,7 @@ ALL_64_EMULATION_SOURCES = \
 	eaarch64linux32.c \
 	eaarch64linux32b.c \
 	eaarch64linuxb.c \
-	eaarch64pe.c \
+	earm64pe.c \
 	eelf32_x86_64.c \
 	eelf32b4300.c \
 	eelf32bmip.c \
@@ -879,7 +879,7 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linux32.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linux32b.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linuxb.Pc@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64pe.Pc@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earm64pe.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_x86_64.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32b4300.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32bmip.Pc@am__quote@
diff --git a/ld/Makefile.in b/ld/Makefile.in
index ff4c916c27b..edbdd06c705 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -888,7 +888,7 @@ ALL_64_EMULATION_SOURCES = \
 	eaarch64linux32.c \
 	eaarch64linux32b.c \
 	eaarch64linuxb.c \
-	eaarch64pe.c \
+	earm64pe.c \
 	eelf32_x86_64.c \
 	eelf32b4300.c \
 	eelf32bmip.c \
@@ -1264,7 +1264,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linux32.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linux32b.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linuxb.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64pe.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earm64pe.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaix5ppc.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaix5rs6.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaixppc.Po@am__quote@
@@ -2553,7 +2553,7 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linux32.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linux32b.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linuxb.Pc@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64pe.Pc@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earm64pe.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32_x86_64.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32b4300.Pc@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32bmip.Pc@am__quote@
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 741b246f67e..6b833f26248 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -119,7 +119,7 @@ aarch64-*-haiku*)	targ_emul=aarch64haiku
 			targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb armelf_haiku $targ_extra_libpath"
 			;;
 aarch64-*-pe*)
-			targ_emul=aarch64pe
+			targ_emul=arm64pe
 			targ_extra_ofiles="deffilep.o pep-dll-aarch64.o"
 			;;
 alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
diff --git a/ld/emulparams/aarch64pe.sh b/ld/emulparams/arm64pe.sh
similarity index 100%
rename from ld/emulparams/aarch64pe.sh
rename to ld/emulparams/arm64pe.sh
diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
index e2c538e6d99..e20339fa874 100644
--- a/ld/emultempl/pep.em
+++ b/ld/emultempl/pep.em
@@ -48,7 +48,7 @@ fragment <<EOF
 
 #define COFF_IMAGE_WITH_PE
 #define COFF_WITH_PE
-#ifdef TARGET_IS_aarch64pe
+#ifdef TARGET_IS_arm64pe
 #define COFF_WITH_peAArch64
 #elif defined (TARGET_IS_i386pep)
 #define COFF_WITH_pex64
@@ -79,7 +79,7 @@ fragment <<EOF
    header in generic PE code.  */
 #ifdef TARGET_IS_i386pep
 # include "coff/x86_64.h"
-#elif defined TARGET_IS_aarch64pe
+#elif defined TARGET_IS_arm64pe
 # include "coff/aarch64.h"
 #endif
 #include "coff/pe.h"
diff --git a/ld/po/BLD-POTFILES.in b/ld/po/BLD-POTFILES.in
index ff820172b98..cbd445b33e8 100644
--- a/ld/po/BLD-POTFILES.in
+++ b/ld/po/BLD-POTFILES.in
@@ -11,7 +11,7 @@ eaarch64linux.c
 eaarch64linux32.c
 eaarch64linux32b.c
 eaarch64linuxb.c
-eaarch64pe.c
+earm64pe.c
 eaix5ppc.c
 eaix5rs6.c
 eaixppc.c
-- 
2.37.4


             reply	other threads:[~2022-12-30  2:40 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-30  2:40 Mark Harmstone [this message]
2022-12-30  2:40 ` [PATCH 2/8] Fix size of external_reloc for pe-aarch64 Mark Harmstone
2022-12-30  2:40 ` [PATCH 3/8] Skip ELF-specific tests when targeting pe-aarch64 Mark Harmstone
2022-12-30  2:40 ` [PATCH 4/8] Skip big-obj test for pe-aarch64 Mark Harmstone
2022-12-30  2:40 ` [PATCH 5/8] Add pe-aarch64 relocations Mark Harmstone
2022-12-30  2:40 ` [PATCH 6/8] Add .secrel32 for pe-aarch64 Mark Harmstone
2022-12-30  2:40 ` [PATCH 7/8] Add aarch64-w64-mingw32 target Mark Harmstone
2022-12-30  2:40 ` [PATCH 8/8] gas: Restore tc_pe_dwarf2_emit_offset for pe-aarch64 Mark Harmstone
2023-01-03 11:54 ` [PATCH 1/8] ld: Rename aarch64pe emulation target to arm64pe Nick Clifton
2023-01-03 11:59 ` NightStrike
2023-01-03 12:09   ` Tamar Christina
2023-01-03 14:08     ` Richard Earnshaw
2023-01-03 14:13       ` Martin Storsjö
2023-01-03 14:54         ` Tamar Christina
2023-01-03 15:51           ` Martin Storsjö
2023-01-03 15:57             ` Tamar Christina
2023-01-03 18:21           ` Mark Harmstone
2023-01-03 18:33             ` Andrew Pinski
2023-01-03 19:07               ` Mark Harmstone
2023-01-03 19:41               ` Tamar Christina
2023-01-03 20:05                 ` Martin Storsjö
2023-01-04  2:38                   ` Mark Harmstone
2023-01-04  9:51                     ` Nick Clifton
2023-01-04 10:25                       ` Martin Storsjö
2023-01-04 10:35                         ` Tamar Christina
2023-01-04 11:00                           ` Martin Storsjö
2023-01-04 11:08                             ` Tamar Christina
2023-01-04 11:36                               ` Martin Storsjö
2023-01-04 15:02                                 ` Nick Clifton
2023-01-05  2:33                                   ` Mark Harmstone
2023-01-05 11:01                                     ` Nick Clifton
2023-01-05 10:45                                   ` Tamar Christina
2023-01-03 14:14       ` Tamar Christina
2023-01-03 12:53   ` Martin Storsjö

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221230024055.31841-1-mark@harmstone.com \
    --to=mark@harmstone.com \
    --cc=binutils@sourceware.org \
    --cc=tamar.christina@arm.com \
    --cc=wej22007@outlook.com \
    --cc=zac.walker@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).