[PATCH 06/17] ld/PE: adjust pe_detail_list[]

Jan Beulich jbeulich@suse.com
Mon Aug 4 09:19:10 GMT 2025


M*Core uses pe-dll.c, but has no entry in the table. Add both big and
little endian ones. Many of the entries aren't relevant when targeting
PE+; move the #endif accordingly. The MIPS entry is actually
questionable altogether: No mips*-*-* target uses pe-dll.c or pep-dll.c.
---
MIPS maintainers: Please confirm whether removing the MIPS entry is
going to be okay. From what I can tell, e8044f355dc9 removed the use,
without removing the table entry here. Whether that was actually correct
to do I'm unclear about, considering that it was 344a211f9995 ("Add
support for WinCE based toolchains") which added it, having - afaict -
nothing to do with ECOFF.

Of course having all kinds of targets' entries present irrespective of
the configured one(s) is bogus, but sorting that is left for another
day.

Having only little-endian Arm entries is also suspicious, when
emulparams/armpe.sh has at least mention of pei-arm-big, and when the
corresponding assembler also supports -EB.

--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -251,6 +251,7 @@ static const autofilter_entry_type autof
 #define PE_ARCH_arm	 4
 #define PE_ARCH_arm_wince 5
 #define PE_ARCH_aarch64  6
+#define PE_ARCH_mcore	 7
 
 /* Don't make it constant as underscore mode gets possibly overriden
    by target or -(no-)leading-underscore option.  */
@@ -305,7 +306,6 @@ static pe_details_type pe_detail_list[]
     true,
     autofilter_symbollist_i386
   },
-#endif
   {
     "pei-shl",
     "pe-shl",
@@ -317,6 +317,26 @@ static pe_details_type pe_detail_list[]
     autofilter_symbollist_generic
   },
   {
+    "pei-mcore-little",
+    "pe-mcore-little",
+    7 /* IMAGE_REL_MCORE_RVA */,
+    ~0, 0, ~0, /* none */
+    PE_ARCH_mcore,
+    bfd_arch_mcore,
+    false,
+    autofilter_symbollist_generic
+  },
+  {
+    "pei-mcore-big",
+    "pe-mcore-big",
+    7 /* IMAGE_REL_MCORE_RVA */,
+    ~0, 0, ~0, /* none */
+    PE_ARCH_mcore,
+    bfd_arch_mcore,
+    false,
+    autofilter_symbollist_generic
+  },
+  {
     "pei-mips",
     "pe-mips",
     34 /* MIPS_R_RVA */,
@@ -347,6 +367,7 @@ static pe_details_type pe_detail_list[]
     false,
     autofilter_symbollist_generic
   },
+#endif
   {
     "pei-aarch64-little",
     "pe-aarch64-little",



More information about the Binutils mailing list