public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: "Martin Storsjö" <martin@martin.st>,
	"Tamar Christina" <Tamar.Christina@arm.com>
Cc: Mark Harmstone <mark@harmstone.com>,
	Andrew Pinski <pinskia@gmail.com>,
	Richard Earnshaw <Richard.Earnshaw@foss.arm.com>,
	NightStrike <nightstrike@gmail.com>,
	"wej22007@outlook.com" <wej22007@outlook.com>,
	"zac.walker@linaro.org" <zac.walker@linaro.org>,
	binutils <binutils@sourceware.org>
Subject: Re: [PATCH 1/8] ld: Rename aarch64pe emulation target to arm64pe
Date: Wed, 4 Jan 2023 15:02:10 +0000	[thread overview]
Message-ID: <4fc03dbf-106c-aef9-f9b6-734956458446@redhat.com> (raw)
In-Reply-To: <b140734-145f-db27-1a7a-c5f4c852aae7@martin.st>

[-- Attachment #1: Type: text/plain, Size: 380 bytes --]

Hi Guys,

   I am not sure what this talk of changing gcc is about, but this attached
   is the patch that I am suggesting as a solution to this problem.

   With it applied a linker configured as --target=aarch64pe will support
   both aarch64pe and arm64pe emulations.  Either can be used and they
   will produce the same output.

   Have I missed something ?

Cheers
   Nick


[-- Attachment #2: arm64pe.patch --]
[-- Type: text/x-patch, Size: 2267 bytes --]

diff --git a/ld/Makefile.am b/ld/Makefile.am
index 12b2c3c453f..bfc24537a01 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -389,6 +389,7 @@ ALL_64_EMULATION_SOURCES = \
 	eaarch64linux32b.c \
 	eaarch64linuxb.c \
 	eaarch64pe.c \
+	earm64pe.c \
 	eelf32_x86_64.c \
 	eelf32b4300.c \
 	eelf32bmip.c \
@@ -881,6 +882,7 @@ $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
 @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 eeaad476647..aa74d2521bf 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -120,6 +120,7 @@ aarch64-*-haiku*)	targ_emul=aarch64haiku
 			;;
 aarch64-*-pe*)
 			targ_emul=aarch64pe
+			targ_extra_emuls="arm64pe"
 			targ_extra_ofiles="deffilep.o pep-dll-aarch64.o"
 			;;
 alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em
index 4f281cab609..d61cab86d75 100644
--- a/ld/emultempl/pep.em
+++ b/ld/emultempl/pep.em
@@ -57,6 +57,8 @@ fragment <<EOF
 #define COFF_WITH_PE
 #ifdef TARGET_IS_aarch64pe
 #define COFF_WITH_peAArch64
+#elif defined TARGET_IS_arm64pe
+#define COFF_WITH_peAArch64
 #elif defined (TARGET_IS_i386pep)
 #define COFF_WITH_pex64
 #endif
@@ -88,6 +90,8 @@ ${pdb_support+#include \"pdb.h\"}
 # include "coff/x86_64.h"
 #elif defined TARGET_IS_aarch64pe
 # include "coff/aarch64.h"
+#elif defined TARGET_IS_arm64pe
+# include "coff/aarch64.h"
 #endif
 #include "coff/pe.h"
 
--- /dev/null	2023-01-04 08:12:27.071001981 +0000
+++ current/ld/emulparams/arm64pe.sh	2023-01-04 14:53:11.272412233 +0000
@@ -0,0 +1,4 @@
+# The "arm64pe" emulation is used as an alias for "aarch64pe".
+# It is provided for compatibility with Clang, which uses this name when invoking the linker.
+
+. ${srcdir}/emulparams/aarch64pe.sh

  reply	other threads:[~2023-01-04 15:02 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-30  2:40 Mark Harmstone
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 [this message]
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=4fc03dbf-106c-aef9-f9b6-734956458446@redhat.com \
    --to=nickc@redhat.com \
    --cc=Richard.Earnshaw@foss.arm.com \
    --cc=Tamar.Christina@arm.com \
    --cc=binutils@sourceware.org \
    --cc=mark@harmstone.com \
    --cc=martin@martin.st \
    --cc=nightstrike@gmail.com \
    --cc=pinskia@gmail.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).