This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] add EFI "boot services" and "runtime services" driver format


H.J. Lu wrote:
On Feb 6, 2008 2:50 PM, Peter Jones <pjones@redhat.com> wrote:
H.J. Lu wrote:
You need ChangeLog entries. Also are


I still didn't see ChangeLog entries.

Right you are; fixed in the attached.


--
  Peter
diff -U0 binutils-2.18.50.0.3/bfd/ChangeLog.efi-rtdrv binutils-2.18.50.0.3/bfd/ChangeLog
--- binutils-2.18.50.0.3/bfd/ChangeLog.efi-rtdrv	2008-02-08 15:33:16.000000000 -0500
+++ binutils-2.18.50.0.3/bfd/ChangeLog	2008-02-08 15:40:56.000000000 -0500
@@ -0,0 +1,20 @@
+2008-02-08  Peter Jones  <pjones@redhat.com>
+
+	* efi-rtdrv-ia32.c: New file.
+	* efi-bsdrv-ia32.c: New file.
+	* efi-rtdrv-ia64.c: New file.
+	* efi-bsdrv-ia64.c: New file.
+	* efi-rtdrv-x86_64.c: New file.
+	* efi-bsdrv-x86_64.c: New file.
+	* peicode.h (pe_bfd_object_p): Add support for boot service and
+	runtime service drivers.
+	* libpei.h: Add macros for EFI formats, and rename the efi application
+	format macros to disambiguate.
+	* targets.c: Add bfd_target _vec externs.
+	(_bfd_tar): Add EFI _vec entries.
+	* config.bfd: Add EFI vectors into the selection routines.
+	* configure.in: add EFI _vec entries.
+	* configure: Regenerate.
+	* Makefile.am: Add EFI files.
+	* Makefile.in: Regenerate.
+
diff -up binutils-2.18.50.0.3/bfd/config.bfd.efi-rtdrv binutils-2.18.50.0.3/bfd/config.bfd
--- binutils-2.18.50.0.3/bfd/config.bfd.efi-rtdrv	2008-02-06 17:20:58.000000000 -0500
+++ binutils-2.18.50.0.3/bfd/config.bfd	2008-02-06 17:20:58.000000000 -0500
@@ -178,7 +178,7 @@ case "${targ}" in
     ;;
   ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
     targ_defvec=bfd_elf64_ia64_little_vec
-    targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
+    targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec bfd_efi_bsdrv_ia64_vec bfd_efi_rtdrv_ia64_vec"
     want64=true
     ;;
   ia64*-*-hpux*)
@@ -536,8 +536,8 @@ case "${targ}" in
     ;;
   i[34567]86-*-freebsd* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-dragonfly*)
     targ_defvec=bfd_elf32_i386_freebsd_vec
-    targ_selvecs="bfd_elf32_i386_vec bfd_efi_app_ia32_vec i386coff_vec"
-    targ64_selvecs="bfd_elf64_x86_64_freebsd_vec bfd_elf64_x86_64_vec bfd_efi_app_x86_64_vec"
+    targ_selvecs="bfd_elf32_i386_vec bfd_efi_app_ia32_vec bfd_efi_bsdrv_ia32_vec bfd_efi_rtdrv_ia32_vec i386coff_vec"
+    targ64_selvecs="bfd_elf64_x86_64_freebsd_vec bfd_elf64_x86_64_vec bfd_efi_app_x86_64_vec bfd_efi_bsdrv_x86_64_vec bfd_efi_rtdrv_x86_64_vec"
     # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling.
     case "${targ}" in
       i[34567]86-*-freebsd3* | i[34567]86-*-freebsd4 | i[34567]86-*-freebsd4.0*)
@@ -574,7 +574,7 @@ case "${targ}" in
     ;;
   i[34567]86-*-linux-*)
     targ_defvec=bfd_elf32_i386_vec
-    targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
+    targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec bfd_efi_bsdrv_ia32_vec bfd_efi_rtdrv_ia32_vec"
     targ64_selvecs=bfd_elf64_x86_64_vec
     ;;
 #ifdef BFD64
@@ -585,17 +585,17 @@ case "${targ}" in
     ;;
   x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
     targ_defvec=bfd_elf64_x86_64_freebsd_vec
-    targ_selvecs="bfd_elf32_i386_freebsd_vec i386coff_vec bfd_efi_app_ia32_vec bfd_efi_app_x86_64_vec bfd_elf32_i386_vec bfd_elf64_x86_64_vec"
+    targ_selvecs="bfd_elf32_i386_freebsd_vec i386coff_vec bfd_efi_app_ia32_vec bfd_efi_bsdrv_ia32_vec bfd_efi_rtdrv_ia32_vec bfd_efi_app_x86_64_vec bfd_efi_bsdrv_x86_64_vec bfd_efi_rtdrv_x86_64_vec bfd_elf32_i386_vec bfd_elf64_x86_64_vec"
     want64=true
     ;;
   x86_64-*-netbsd* | x86_64-*-openbsd*)
     targ_defvec=bfd_elf64_x86_64_vec
-    targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec bfd_efi_app_x86_64_vec"
+    targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec bfd_efi_bsdrv_ia32_vec bfd_efi_rtdrv_ia32_vec bfd_efi_app_x86_64_vec bfd_efi_bsdrv_x86_64_vec bfd_efi_rtdrv_x86_64_vec"
     want64=true
     ;;
   x86_64-*-linux-*)
     targ_defvec=bfd_elf64_x86_64_vec
-    targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec bfd_efi_app_x86_64_vec"
+    targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec bfd_efi_bsdrv_ia32_vec bfd_efi_rtdrv_ia32_vec bfd_efi_app_x86_64_vec bfd_efi_bsdrv_x86_64_vec bfd_efi_rtdrv_x86_64_vec"
     want64=true
     ;;
   x86_64-*-mingw*)
diff -up binutils-2.18.50.0.3/bfd/configure.efi-rtdrv binutils-2.18.50.0.3/bfd/configure
--- binutils-2.18.50.0.3/bfd/configure.efi-rtdrv	2008-02-06 17:21:00.000000000 -0500
+++ binutils-2.18.50.0.3/bfd/configure	2008-02-06 17:21:02.000000000 -0500
@@ -19032,8 +19032,14 @@ do
     b_out_vec_big_host)		tb="$tb bout.lo aout32.lo" ;;
     b_out_vec_little_host)	tb="$tb bout.lo aout32.lo" ;;
     bfd_efi_app_ia32_vec)	tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;;
+    bfd_efi_bsdrv_ia32_vec)	tb="$tb efi-bsdrv-ia32.lo peigen.lo cofflink.lo" ;;
+    bfd_efi_rtdrv_ia32_vec)	tb="$tb efi-rtdrv-ia32.lo peigen.lo cofflink.lo" ;;
     bfd_efi_app_x86_64_vec)	tb="$tb efi-app-x86_64.lo pex64igen.lo cofflink.lo" ;target_size=64;;
+    bfd_efi_bsdrv_x86_64_vec)	tb="$tb efi-bsdrv-x86_64.lo pex64igen.lo cofflink.lo" ;target_size=64;;
+    bfd_efi_rtdrv_x86_64_vec)	tb="$tb efi-rtdrv-x86_64.lo pex64igen.lo cofflink.lo" ;target_size=64;;
     bfd_efi_app_ia64_vec)	tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;;
+    bfd_efi_bsdrv_ia64_vec)	tb="$tb efi-bsdrv-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;;
+    bfd_efi_rtdrv_ia64_vec)	tb="$tb efi-rtdrv-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;;
     bfd_elf32_am33lin_vec)	tb="$tb elf32-am33lin.lo elf32.lo $elf" ;;
     bfd_elf32_avr_vec)		tb="$tb elf32-avr.lo elf32.lo $elf" ;;
     bfd_elf32_bfin_vec)		tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
diff -up binutils-2.18.50.0.3/bfd/configure.in.efi-rtdrv binutils-2.18.50.0.3/bfd/configure.in
--- binutils-2.18.50.0.3/bfd/configure.in.efi-rtdrv	2008-02-06 17:21:00.000000000 -0500
+++ binutils-2.18.50.0.3/bfd/configure.in	2008-02-06 17:21:00.000000000 -0500
@@ -627,8 +627,14 @@ do
     b_out_vec_big_host)		tb="$tb bout.lo aout32.lo" ;;
     b_out_vec_little_host)	tb="$tb bout.lo aout32.lo" ;;
     bfd_efi_app_ia32_vec)	tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;;
+    bfd_efi_bsdrv_ia32_vec)	tb="$tb efi-bsdrv-ia32.lo peigen.lo cofflink.lo" ;;
+    bfd_efi_rtdrv_ia32_vec)	tb="$tb efi-rtdrv-ia32.lo peigen.lo cofflink.lo" ;;
     bfd_efi_app_x86_64_vec)	tb="$tb efi-app-x86_64.lo pex64igen.lo cofflink.lo" ;target_size=64;;
+    bfd_efi_bsdrv_x86_64_vec)	tb="$tb efi-bsdrv-x86_64.lo pex64igen.lo cofflink.lo" ;target_size=64;;
+    bfd_efi_rtdrv_x86_64_vec)	tb="$tb efi-rtdrv-x86_64.lo pex64igen.lo cofflink.lo" ;target_size=64;;
     bfd_efi_app_ia64_vec)	tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;;
+    bfd_efi_bsdrv_ia64_vec)	tb="$tb efi-bsdrv-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;;
+    bfd_efi_rtdrv_ia64_vec)	tb="$tb efi-rtdrv-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;;
     bfd_elf32_am33lin_vec)	tb="$tb elf32-am33lin.lo elf32.lo $elf" ;;
     bfd_elf32_avr_vec)		tb="$tb elf32-avr.lo elf32.lo $elf" ;;
     bfd_elf32_bfin_vec)		tb="$tb elf32-bfin.lo elf32.lo $elf" ;;
diff -up /dev/null binutils-2.18.50.0.3/bfd/efi-bsdrv-ia32.c
--- /dev/null	2008-02-07 18:40:08.986017165 -0500
+++ binutils-2.18.50.0.3/bfd/efi-bsdrv-ia32.c	2008-02-06 17:25:26.000000000 -0500
@@ -0,0 +1,36 @@
+/* BFD back-end for Intel IA-32 EFI Boot Service driver files.
+   Copyright 1999, 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+   Contributed by Peter Jones <pjones@redhat.com>
+   Based on efi-app-ia32.c by David Mosberger <davidm@hpl.hp.com>
+
+   This file is part of BFD, the Binary File Descriptor library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#include "sysdep.h"
+#include "bfd.h"
+
+#define TARGET_SYM bfd_efi_bsdrv_ia32_vec
+#define TARGET_NAME "efi-bsdrv-ia32"
+#define COFF_IMAGE_WITH_PE
+#define COFF_WITH_PE
+#define PCRELOFFSET TRUE
+#define TARGET_UNDERSCORE '_'
+#define COFF_LONG_SECTION_NAMES
+#define PEI_TARGET_SUBSYSTEM	IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER
+#define PEI_FORCE_MINIMUM_ALIGNMENT
+
+#include "coff-i386.c"
diff -up /dev/null binutils-2.18.50.0.3/bfd/efi-bsdrv-ia64.c
--- /dev/null	2008-02-07 18:40:08.986017165 -0500
+++ binutils-2.18.50.0.3/bfd/efi-bsdrv-ia64.c	2008-02-06 17:23:42.000000000 -0500
@@ -0,0 +1,37 @@
+/* BFD back-end for HP/Intel IA-64 EFI Boot Service driver files.
+   Copyright 1999, 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+   Contributed by Peter Jones <pjones@redhat.com>
+   Based on efi-app-ia64.c by David Mosberger <davidm@hpl.hp.com>
+
+   This file is part of BFD, the Binary File Descriptor library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#include "sysdep.h"
+#include "bfd.h"
+
+#define TARGET_SYM bfd_efi_bsdrv_ia64_vec
+#define TARGET_NAME "efi-bsdrv-ia64"
+#define COFF_IMAGE_WITH_PE
+#define COFF_WITH_PE
+#define COFF_WITH_pep
+#define PCRELOFFSET TRUE
+#define TARGET_UNDERSCORE '_'
+#define COFF_LONG_SECTION_NAMES
+#define PEI_TARGET_SUBSYSTEM		IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER
+#define PEI_FORCE_MINIMUM_ALIGNMENT
+
+#include "coff-ia64.c"
diff -up /dev/null binutils-2.18.50.0.3/bfd/efi-bsdrv-x86_64.c
--- /dev/null	2008-02-07 18:40:08.986017165 -0500
+++ binutils-2.18.50.0.3/bfd/efi-bsdrv-x86_64.c	2008-02-06 17:24:11.000000000 -0500
@@ -0,0 +1,37 @@
+/* BFD back-end for Intel64 UEFI Boot Service driver files.
+   Copyright 1999, 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+   Contributed by Peter Jones <pjones@redhat.com>
+   Based on efi-app-x86_64.c by David Mosberger <davidm@hpl.hp.com>
+
+   This file is part of BFD, the Binary File Descriptor library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#include "sysdep.h"
+#include "bfd.h"
+
+#define TARGET_SYM bfd_efi_bsdrv_x86_64_vec
+#define TARGET_NAME "efi-bsdrv-x86_64"
+#define COFF_IMAGE_WITH_PE
+#define COFF_WITH_PE
+#define COFF_WITH_pep
+#define PCRELOFFSET TRUE
+#define TARGET_UNDERSCORE '_'
+#define COFF_LONG_SECTION_NAMES
+#define PEI_TARGET_SUBSYSTEM	IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER
+#define PEI_FORCE_MINIMUM_ALIGNMENT
+
+#include "coff-x86_64.c"
diff -up /dev/null binutils-2.18.50.0.3/bfd/efi-rtdrv-ia32.c
--- /dev/null	2008-02-07 18:40:08.986017165 -0500
+++ binutils-2.18.50.0.3/bfd/efi-rtdrv-ia32.c	2008-02-06 17:24:32.000000000 -0500
@@ -0,0 +1,36 @@
+/* BFD back-end for Intel IA-32 EFI runtime driver files.
+   Copyright 1999, 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+   Contributed by Peter Jones <pjones@redhat.com>
+   Based on efi-app-ia32.c by David Mosberger <davidm@hpl.hp.com>
+
+   This file is part of BFD, the Binary File Descriptor library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#include "sysdep.h"
+#include "bfd.h"
+
+#define TARGET_SYM bfd_efi_rtdrv_ia32_vec
+#define TARGET_NAME "efi-rtdrv-ia32"
+#define COFF_IMAGE_WITH_PE
+#define COFF_WITH_PE
+#define PCRELOFFSET TRUE
+#define TARGET_UNDERSCORE '_'
+#define COFF_LONG_SECTION_NAMES
+#define PEI_TARGET_SUBSYSTEM	IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER
+#define PEI_FORCE_MINIMUM_ALIGNMENT
+
+#include "coff-i386.c"
diff -up /dev/null binutils-2.18.50.0.3/bfd/efi-rtdrv-ia64.c
--- /dev/null	2008-02-07 18:40:08.986017165 -0500
+++ binutils-2.18.50.0.3/bfd/efi-rtdrv-ia64.c	2008-02-06 17:24:53.000000000 -0500
@@ -0,0 +1,37 @@
+/* BFD back-end for HP/Intel IA-64 EFI runtime driver files.
+   Copyright 1999, 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+   Contributed by Peter Jones <pjones@redhat.com>
+   Based on efi-app-ia64.c by David Mosberger <davidm@hpl.hp.com>
+
+   This file is part of BFD, the Binary File Descriptor library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#include "sysdep.h"
+#include "bfd.h"
+
+#define TARGET_SYM bfd_efi_rtdrv_ia64_vec
+#define TARGET_NAME "efi-rtdrv-ia64"
+#define COFF_IMAGE_WITH_PE
+#define COFF_WITH_PE
+#define COFF_WITH_pep
+#define PCRELOFFSET TRUE
+#define TARGET_UNDERSCORE '_'
+#define COFF_LONG_SECTION_NAMES
+#define PEI_TARGET_SUBSYSTEM		IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER
+#define PEI_FORCE_MINIMUM_ALIGNMENT
+
+#include "coff-ia64.c"
diff -up /dev/null binutils-2.18.50.0.3/bfd/efi-rtdrv-x86_64.c
--- /dev/null	2008-02-07 18:40:08.986017165 -0500
+++ binutils-2.18.50.0.3/bfd/efi-rtdrv-x86_64.c	2008-02-06 17:25:23.000000000 -0500
@@ -0,0 +1,37 @@
+/* BFD back-end for Intel64 UEFI runtime driver files.
+   Copyright 1999, 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+   Contributed by Peter Jones <pjones@redhat.com>
+   Based on efi-app-x86_64.c by David Mosberger <davidm@hpl.hp.com>
+
+   This file is part of BFD, the Binary File Descriptor library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#include "sysdep.h"
+#include "bfd.h"
+
+#define TARGET_SYM bfd_efi_rtdrv_x86_64_vec
+#define TARGET_NAME "efi-rtdrv-x86_64"
+#define COFF_IMAGE_WITH_PE
+#define COFF_WITH_PE
+#define COFF_WITH_pep
+#define PCRELOFFSET TRUE
+#define TARGET_UNDERSCORE '_'
+#define COFF_LONG_SECTION_NAMES
+#define PEI_TARGET_SUBSYSTEM	IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER
+#define PEI_FORCE_MINIMUM_ALIGNMENT
+
+#include "coff-x86_64.c"
diff -up binutils-2.18.50.0.3/bfd/libpei.h.efi-rtdrv binutils-2.18.50.0.3/bfd/libpei.h
--- binutils-2.18.50.0.3/bfd/libpei.h.efi-rtdrv	2007-08-01 09:11:48.000000000 -0400
+++ binutils-2.18.50.0.3/bfd/libpei.h	2008-02-06 17:20:58.000000000 -0500
@@ -309,19 +309,37 @@
 #define bfd_target_pei_arch(xvec)				\
   ((xvec)->name + sizeof ("pei-") - 1)
 
-/* Returns true if the target is an EFI target.  */
-#define bfd_target_efi_p(xvec)				\
+/* Returns true if the target is an EFI application target.  */
+#define bfd_target_efi_app_p(xvec)				\
    (CONST_STRNEQ ((xvec)->name, "efi-app-"))
 
-/* Return the arch string of an EFI target.  */
-#define bfd_target_efi_arch(xvec)				\
+/* Return the arch string of an EFI application target.  */
+#define bfd_target_efi_app_arch(xvec)				\
   ((xvec)->name + sizeof ("efi-app-") - 1)
 
+/* Returns true if the target is an EFI Boot Service driver target.  */
+#define bfd_target_efi_bsdrv_p(xvec)				\
+   (CONST_STRNEQ ((xvec)->name, "efi-bsdrv-"))
+
+/* Return the arch string of an EFI Boot Service driver target.  */
+#define bfd_target_efi_bsdrv_arch(xvec)				\
+  ((xvec)->name + sizeof ("efi-bsdrv-") - 1)
+
+/* Returns true if the target is an EFI runtime driver target.  */
+#define bfd_target_efi_rtdrv_p(xvec)				\
+   (CONST_STRNEQ ((xvec)->name, "efi-rtdrv-"))
+
+/* Return the arch string of an EFI runtime driver target.  */
+#define bfd_target_efi_rtdrv_arch(xvec)				\
+  ((xvec)->name + sizeof ("efi-rtdrv-") - 1)
+
 /* Macro: Returns true if the bfd is a PE executable as opposed to a
    PE object file.  */
 #define bfd_pe_executable_p(abfd)			\
   (bfd_target_pei_p ((abfd)->xvec)			\
-   || bfd_target_efi_p ((abfd)->xvec))
+   || bfd_target_efi_app_p ((abfd)->xvec)		\
+   || bfd_target_efi_bsdrv_p ((abfd)->xvec))		\
+   || bfd_target_efi_rtdrv_p ((abfd)->xvec)
 
 /* These functions are architecture dependent, and are in peicode.h:
    coff_swap_reloc_in
diff -up binutils-2.18.50.0.3/bfd/Makefile.am.efi-rtdrv binutils-2.18.50.0.3/bfd/Makefile.am
--- binutils-2.18.50.0.3/bfd/Makefile.am.efi-rtdrv	2008-02-06 17:20:58.000000000 -0500
+++ binutils-2.18.50.0.3/bfd/Makefile.am	2008-02-06 17:21:02.000000000 -0500
@@ -238,6 +238,8 @@ BFD32_BACKENDS = \
 	ecoff.lo \
 	ecofflink.lo \
 	efi-app-ia32.lo \
+	efi-bsdrv-ia32.lo \
+	efi-rtdrv-ia32.lo \
 	elf.lo \
 	elf32-am33lin.lo \
 	elf32-arc.lo \
@@ -417,6 +419,8 @@ BFD32_BACKENDS_CFILES = \
 	ecoff.c \
 	ecofflink.c \
 	efi-app-ia32.c \
+	efi-bsdrv-ia32.c \
+	efi-rtdrv-ia32.c \
 	elf.c \
 	elf32-am33lin.c \
 	elf32-arc.c \
@@ -561,7 +565,11 @@ BFD64_BACKENDS = \
 	coff64-rs6000.lo \
 	demo64.lo \
 	efi-app-ia64.lo \
+	efi-bsdrv-ia64.lo \
+	efi-rtdrv-ia64.lo \
 	efi-app-x86_64.lo \
+	efi-bsdrv-x86_64.lo \
+	efi-rtdrv-x86_64.lo \
 	elf64-x86-64.lo \
 	elf64-alpha.lo \
 	elf64-hppa.lo \
@@ -592,7 +600,11 @@ BFD64_BACKENDS_CFILES = \
 	coff64-rs6000.c \
 	demo64.c \
 	efi-app-ia64.c \
+	efi-bsdrv-ia64.c \
+	efi-rtdrv-ia64.c \
 	efi-app-x86_64.c \
+	efi-bsdrv-x86_64.c \
+	efi-rtdrv-x86_64.c \
 	elf64-x86-64.c \
 	elf64-alpha.c \
 	elf64-hppa.c \
@@ -1298,6 +1310,16 @@ efi-app-ia32.lo: efi-app-ia32.c $(INCDIR
   $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
   $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
   peicode.h libpei.h
+efi-bsdrv-ia32.lo: efi-bsdrv-ia32.c $(INCDIR)/filenames.h \
+  coff-i386.c $(INCDIR)/hashtab.h $(INCDIR)/coff/i386.h \
+  $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
+  $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
+  peicode.h libpei.h
+efi-rtdrv-ia32.lo: efi-rtdrv-ia32.c $(INCDIR)/filenames.h \
+  coff-i386.c $(INCDIR)/hashtab.h $(INCDIR)/coff/i386.h \
+  $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
+  $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
+  peicode.h libpei.h
 elf.lo: elf.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/libiberty.h \
@@ -1834,11 +1856,31 @@ efi-app-ia64.lo: efi-app-ia64.c $(INCDIR
   $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
   $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
   peicode.h libpei.h
+efi-bsdrv-ia64.lo: efi-bsdrv-ia64.c $(INCDIR)/filenames.h \
+  coff-ia64.c $(INCDIR)/hashtab.h $(INCDIR)/coff/ia64.h \
+  $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
+  $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
+  peicode.h libpei.h
+efi-rtdrv-ia64.lo: efi-rtdrv-ia64.c $(INCDIR)/filenames.h \
+  coff-ia64.c $(INCDIR)/hashtab.h $(INCDIR)/coff/ia64.h \
+  $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
+  $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
+  peicode.h libpei.h
 efi-app-x86_64.lo: efi-app-x86_64.c $(INCDIR)/filenames.h \
   coff-x86_64.c $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h \
   $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
   $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h \
   coffcode.h peicode.h libpei.h
+efi-bsdrv-x86_64.lo: efi-bsdrv-x86_64.c $(INCDIR)/filenames.h \
+  coff-x86_64.c $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h \
+  $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
+  $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h \
+  coffcode.h peicode.h libpei.h
+efi-rtdrv-x86_64.lo: efi-rtdrv-x86_64.c $(INCDIR)/filenames.h \
+  coff-x86_64.c $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h \
+  $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
+  $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h \
+  coffcode.h peicode.h libpei.h
 elf64-x86-64.lo: elf64-x86-64.c $(INCDIR)/filenames.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h bfd_stdint.h \
diff -up binutils-2.18.50.0.3/bfd/Makefile.in.efi-rtdrv binutils-2.18.50.0.3/bfd/Makefile.in
--- binutils-2.18.50.0.3/bfd/Makefile.in.efi-rtdrv	2008-02-06 17:20:58.000000000 -0500
+++ binutils-2.18.50.0.3/bfd/Makefile.in	2008-02-06 17:21:02.000000000 -0500
@@ -488,6 +488,8 @@ BFD32_BACKENDS = \
 	ecoff.lo \
 	ecofflink.lo \
 	efi-app-ia32.lo \
+	efi-bsdrv-ia32.lo \
+	efi-rtdrv-ia32.lo \
 	elf.lo \
 	elf32-am33lin.lo \
 	elf32-arc.lo \
@@ -667,6 +669,8 @@ BFD32_BACKENDS_CFILES = \
 	ecoff.c \
 	ecofflink.c \
 	efi-app-ia32.c \
+	efi-bsdrv-ia32.c \
+	efi-rtdrv-ia32.c \
 	elf.c \
 	elf32-am33lin.c \
 	elf32-arc.c \
@@ -812,7 +816,11 @@ BFD64_BACKENDS = \
 	coff64-rs6000.lo \
 	demo64.lo \
 	efi-app-ia64.lo \
+	efi-bsdrv-ia64.lo \
+	efi-rtdrv-ia64.lo \
 	efi-app-x86_64.lo \
+	efi-bsdrv-x86_64.lo \
+	efi-rtdrv-x86_64.lo \
 	elf64-x86-64.lo \
 	elf64-alpha.lo \
 	elf64-hppa.lo \
@@ -843,7 +851,11 @@ BFD64_BACKENDS_CFILES = \
 	coff64-rs6000.c \
 	demo64.c \
 	efi-app-ia64.c \
+	efi-bsdrv-ia64.c \
+	efi-rtdrv-ia64.c \
 	efi-app-x86_64.c \
+	efi-bsdrv-x86_64.c \
+	efi-rtdrv-x86_64.c \
 	elf64-x86-64.c \
 	elf64-alpha.c \
 	elf64-hppa.c \
@@ -1878,6 +1890,16 @@ efi-app-ia32.lo: efi-app-ia32.c $(INCDIR
   $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
   $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
   peicode.h libpei.h
+efi-bsdrv-ia32.lo: efi-bsdrv-ia32.c $(INCDIR)/filenames.h \
+  coff-i386.c $(INCDIR)/hashtab.h $(INCDIR)/coff/i386.h \
+  $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
+  $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
+  peicode.h libpei.h
+efi-rtdrv-ia32.lo: efi-rtdrv-ia32.c $(INCDIR)/filenames.h \
+  coff-i386.c $(INCDIR)/hashtab.h $(INCDIR)/coff/i386.h \
+  $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
+  $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
+  peicode.h libpei.h
 elf.lo: elf.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/libiberty.h \
@@ -2414,11 +2436,31 @@ efi-app-ia64.lo: efi-app-ia64.c $(INCDIR
   $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
   $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
   peicode.h libpei.h
+efi-bsdrv-ia64.lo: efi-bsdrv-ia64.c $(INCDIR)/filenames.h \
+  coff-ia64.c $(INCDIR)/hashtab.h $(INCDIR)/coff/ia64.h \
+  $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
+  $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
+  peicode.h libpei.h
+efi-rtdrv-ia64.lo: efi-rtdrv-ia64.c $(INCDIR)/filenames.h \
+  coff-ia64.c $(INCDIR)/hashtab.h $(INCDIR)/coff/ia64.h \
+  $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
+  $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \
+  peicode.h libpei.h
 efi-app-x86_64.lo: efi-app-x86_64.c $(INCDIR)/filenames.h \
   coff-x86_64.c $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h \
   $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
   $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h \
   coffcode.h peicode.h libpei.h
+efi-bsdrv-x86_64.lo: efi-bsdrv-x86_64.c $(INCDIR)/filenames.h \
+  coff-x86_64.c $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h \
+  $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
+  $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h \
+  coffcode.h peicode.h libpei.h
+efi-rtdrv-x86_64.lo: efi-rtdrv-x86_64.c $(INCDIR)/filenames.h \
+  coff-x86_64.c $(INCDIR)/hashtab.h $(INCDIR)/coff/x86_64.h \
+  $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \
+  $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h \
+  coffcode.h peicode.h libpei.h
 elf64-x86-64.lo: elf64-x86-64.c $(INCDIR)/filenames.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h bfd_stdint.h \
diff -up binutils-2.18.50.0.3/bfd/peicode.h.efi-rtdrv binutils-2.18.50.0.3/bfd/peicode.h
--- binutils-2.18.50.0.3/bfd/peicode.h.efi-rtdrv	2007-08-01 09:11:48.000000000 -0400
+++ binutils-2.18.50.0.3/bfd/peicode.h	2008-02-06 17:20:58.000000000 -0500
@@ -1332,13 +1332,19 @@ pe_bfd_object_p (bfd * abfd)
     {
       pe_data_type *pe = pe_data (abfd);
       struct internal_extra_pe_aouthdr *i = &pe->pe_opthdr;
-      bfd_boolean efi = i->Subsystem == IMAGE_SUBSYSTEM_EFI_APPLICATION;
+      bfd_boolean efi = i->Subsystem == IMAGE_SUBSYSTEM_EFI_APPLICATION
+                     || i->Subsystem == IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER
+                     || i->Subsystem == IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER;
       enum arch_type arch;
       const bfd_target * const *target_ptr;
 
       /* Get the machine.  */
-      if (bfd_target_efi_p (abfd->xvec))
-	arch = pe_arch (bfd_target_efi_arch (abfd->xvec));
+      if (bfd_target_efi_app_p (abfd->xvec))
+	arch = pe_arch (bfd_target_efi_app_arch (abfd->xvec));
+      else if (bfd_target_efi_bsdrv_p (abfd->xvec))
+        arch = pe_arch (bfd_target_efi_bsdrv_arch (abfd->xvec));
+      else if (bfd_target_efi_rtdrv_p (abfd->xvec))
+        arch = pe_arch (bfd_target_efi_rtdrv_arch (abfd->xvec));
       else
 	arch = pe_arch (bfd_target_pei_arch (abfd->xvec));
 
@@ -1353,10 +1359,38 @@ pe_bfd_object_p (bfd * abfd)
 	      || (*target_ptr)->flavour != bfd_target_coff_flavour)
 	    continue;
 
-	  if (bfd_target_efi_p (*target_ptr))
+	  if (bfd_target_efi_app_p (*target_ptr))
 	    {
 	      /* Skip incompatible arch.  */
-	      if (pe_arch (bfd_target_efi_arch (*target_ptr)) != arch)
+	      if (pe_arch (bfd_target_efi_app_arch (*target_ptr)) != arch)
+		continue;
+
+	      if (efi)
+		{
+		  /* TARGET_PTR is an EFI backend.  Don't match
+		     TARGET with a EFI file.  */
+		  bfd_set_error (bfd_error_wrong_format);
+		  return NULL;
+		}
+	    }
+          else if (bfd_target_efi_bsdrv_p (*target_ptr))
+	    {
+	      /* Skip incompatible arch.  */
+	      if (pe_arch (bfd_target_efi_bsdrv_arch (*target_ptr)) != arch)
+		continue;
+
+	      if (efi)
+		{
+		  /* TARGET_PTR is an EFI backend.  Don't match
+		     TARGET with a EFI file.  */
+		  bfd_set_error (bfd_error_wrong_format);
+		  return NULL;
+		}
+	    }
+          else if (bfd_target_efi_rtdrv_p (*target_ptr))
+	    {
+	      /* Skip incompatible arch.  */
+	      if (pe_arch (bfd_target_efi_rtdrv_arch (*target_ptr)) != arch)
 		continue;
 
 	      if (efi)
diff -up binutils-2.18.50.0.3/bfd/targets.c.efi-rtdrv binutils-2.18.50.0.3/bfd/targets.c
--- binutils-2.18.50.0.3/bfd/targets.c.efi-rtdrv	2007-08-01 09:11:48.000000000 -0400
+++ binutils-2.18.50.0.3/bfd/targets.c	2008-02-06 17:20:58.000000000 -0500
@@ -561,8 +561,14 @@ extern const bfd_target armpei_little_ve
 extern const bfd_target b_out_vec_big_host;
 extern const bfd_target b_out_vec_little_host;
 extern const bfd_target bfd_efi_app_ia32_vec;
+extern const bfd_target bfd_efi_bsdrv_ia32_vec;
+extern const bfd_target bfd_efi_rtdrv_ia32_vec;
 extern const bfd_target bfd_efi_app_x86_64_vec;
+extern const bfd_target bfd_efi_bsdrv_x86_64_vec;
+extern const bfd_target bfd_efi_rtdrv_x86_64_vec;
 extern const bfd_target bfd_efi_app_ia64_vec;
+extern const bfd_target bfd_efi_bsdrv_ia64_vec;
+extern const bfd_target bfd_efi_rtdrv_ia64_vec;
 extern const bfd_target bfd_elf32_avr_vec;
 extern const bfd_target bfd_elf32_bfin_vec;
 extern const bfd_target bfd_elf32_bfinfdpic_vec;
@@ -879,9 +885,15 @@ static const bfd_target * const _bfd_tar
 	&b_out_vec_big_host,
 	&b_out_vec_little_host,
 	&bfd_efi_app_ia32_vec,
+	&bfd_efi_bsdrv_ia32_vec,
+	&bfd_efi_rtdrv_ia32_vec,
 #ifdef BFD64
 	&bfd_efi_app_x86_64_vec,
+	&bfd_efi_bsdrv_x86_64_vec,
+	&bfd_efi_rtdrv_x86_64_vec,
 	&bfd_efi_app_ia64_vec,
+	&bfd_efi_bsdrv_ia64_vec,
+	&bfd_efi_rtdrv_ia64_vec,
 #endif
 	&bfd_elf32_avr_vec,
 	&bfd_elf32_bfin_vec,

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]