[PATCH v2 07/13] ld/PE: adjust pe_detail_list[]

Jan Beulich jbeulich@suse.com
Fri Aug 29 12:01:20 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.

As I lack sufficient knowledge of the target, introduction of
jmp_mcore_bytes[] will need to be handled by someone else.
---
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.
---
v2: Re-base over the inclusion of the MIPS removal patch.

--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -250,6 +250,7 @@ static const autofilter_entry_type autof
 #define PE_ARCH_arm	 3
 #define PE_ARCH_arm_wince 4
 #define PE_ARCH_aarch64	 5
+#define PE_ARCH_mcore	 6
 
 /* Don't make it constant as underscore mode gets possibly overriden
    by target or -(no-)leading-underscore option.  */
@@ -304,7 +305,6 @@ static pe_details_type pe_detail_list[]
     true,
     autofilter_symbollist_i386
   },
-#endif
   {
     "pei-shl",
     "pe-shl",
@@ -316,6 +316,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-arm-little",
     "pe-arm-little",
     11 /* ARM_RVA32 */,
@@ -336,6 +356,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