diff --git a/bfd/coff-x86_64.c b/bfd/coff-x86_64.c
index 67f2ee5e07a..9bd1c573834 100644
--- a/bfd/coff-x86_64.c
+++ b/bfd/coff-x86_64.c
@@ -20,10 +20,6 @@
 
    Written by Kai Tietz, OneVision Software GmbH&CoKg.  */
 
-#ifndef COFF_WITH_pex64
-#define COFF_WITH_pex64
-#endif
-
 /* Note we have to make sure not to include headers twice.
    Not all headers are wrapped in #ifdef guards, so we define
    PEI_HEADERS to prevent double including here.  */
@@ -33,7 +29,6 @@
 #include "libbfd.h"
 #include "coff/x86_64.h"
 #include "coff/internal.h"
-#include "coff/pe.h"
 #include "libcoff.h"
 #include "libiberty.h"
 #endif
diff --git a/bfd/pe-x86_64.c b/bfd/pe-x86_64.c
index 5a777bbf4c8..1c1b23fb8c5 100644
--- a/bfd/pe-x86_64.c
+++ b/bfd/pe-x86_64.c
@@ -20,9 +20,14 @@
 
    Written by Kai Tietz, OneVision Software GmbH&CoKg.  */
 
+#define PEI_HEADERS
 #include "sysdep.h"
 #include "bfd.h"
+#include "libbfd.h"
+#include "libiberty.h"
+#include "coff/x86_64.h"
 #include "coff/internal.h"
+#include "coff/pe.h"
 #include "libcoff.h"
 
 #define TARGET_SYM		x86_64_pe_vec