]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
LD/PE: Make arch identifiers enumeration constants
authorMaciej W. Rozycki <macro@orcam.me.uk>
Mon, 13 Oct 2025 21:02:30 +0000 (22:02 +0100)
committerMaciej W. Rozycki <macro@orcam.me.uk>
Mon, 13 Oct 2025 21:02:30 +0000 (22:02 +0100)
Convert internal PE architecture identifiers from macros to enumeration
constants so as to make any further updates less disruptive to code.

Add a PE_ARCH_none dummy placeholder so as to start the numbering of
actual architectures from 1 without the need to specify the numeric
value for any of the constants.

No functional change.  Suggested by Richard Earnshaw.

ld/pe-dll.c

index bbf16e713974b4c2cbc8cce025c1397b28d40fc2..d10838293a090e7a45a020294ff539684b3974b5 100644 (file)
@@ -245,13 +245,18 @@ static const autofilter_entry_type autofilter_symbollist_i386[] =
   { NULL, 0 }
 };
 
-#define PE_ARCH_i386    1
-#define PE_ARCH_sh      2
-#define PE_ARCH_mips    3
-#define PE_ARCH_arm     4
-#define PE_ARCH_arm_wince 5
-#define PE_ARCH_aarch64  6
-#define PE_ARCH_mcore   7
+/* Internal identification of PE architectures.  */
+enum
+{
+  PE_ARCH_none,
+  PE_ARCH_i386,
+  PE_ARCH_sh,
+  PE_ARCH_mips,
+  PE_ARCH_arm,
+  PE_ARCH_arm_wince,
+  PE_ARCH_aarch64,
+  PE_ARCH_mcore,
+};
 
 /* Don't make it constant as underscore mode gets possibly overriden
    by target or -(no-)leading-underscore option.  */