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]

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


This is a patch to add support for EFI driver formats to binutils. EFI applications are already supported, and the entire difference is really just a few ID bytes.

I've tested the "boot services" format on x86_64 and i386, and the resulting binary loads and executes correctly. I haven't tested that the "runtime services" output produces a working binary, but it does produce one that appears to match the specification upon manual examination. It is completely analogous to the "boot services" case, so the odds are pretty good. I can probably figure out a test case if absolutely necessary.

The attached patch was written by me, so it's covered by the Red Hat copyright assignment agreement.

--
  Peter
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-01-07 11:39:49.000000000 -0500
+++ binutils-2.18.50.0.3/bfd/config.bfd	2008-01-07 11:46:41.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/efi-rtdrv-ia64.c.efi-rtdrv binutils-2.18.50.0.3/bfd/efi-rtdrv-ia64.c
--- binutils-2.18.50.0.3/bfd/efi-rtdrv-ia64.c.efi-rtdrv	2008-01-07 11:39:49.000000000 -0500
+++ binutils-2.18.50.0.3/bfd/efi-rtdrv-ia64.c	2008-01-07 11:46:45.000000000 -0500
@@ -0,0 +1,36 @@
+/* BFD back-end for HP/Intel IA-64 EFI driver files.
+   Copyright 1999, 2000, 2001, 2002, 2007 Free Software Foundation, Inc.
+   Contributed 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 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-01-07 11:50:44.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/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-01-07 11:53:51.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-01-07 11:54:28.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,
diff -up binutils-2.18.50.0.3/bfd/efi-bsdrv-x86_64.c.efi-rtdrv binutils-2.18.50.0.3/bfd/efi-bsdrv-x86_64.c
--- binutils-2.18.50.0.3/bfd/efi-bsdrv-x86_64.c.efi-rtdrv	2008-01-07 11:47:50.000000000 -0500
+++ binutils-2.18.50.0.3/bfd/efi-bsdrv-x86_64.c	2008-01-07 11:49:40.000000000 -0500
@@ -0,0 +1,35 @@
+/* BFD back-end for Intel64 UEFI Boot Service driver files.
+   Copyright 2007 Free Software Foundation, Inc.
+
+   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 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-01-07 11:39:49.000000000 -0500
+++ binutils-2.18.50.0.3/bfd/Makefile.in	2008-01-07 11:55:25.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 \
@@ -944,7 +956,7 @@ OFILES = $(BFD_BACKENDS) $(BFD_MACHINES)
 libbfd_la_SOURCES = $(BFD32_LIBS_CFILES)
 libbfd_la_DEPENDENCIES = $(OFILES) ofiles
 libbfd_la_LIBADD = `cat ofiles` @WIN32LIBADD@
-libbfd_la_LDFLAGS = -release `cat libtool-soversion` @WIN32LDFLAGS@
+libbfd_la_LDFLAGS = -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -release `cat libtool-soversion` @WIN32LDFLAGS@
 
 # libtool will build .libs/libbfd.a.  We create libbfd.a in the build
 # directory so that we don't have to convert all the programs that use
@@ -1562,8 +1574,8 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
 	report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
 	if test "x$(RELEASE)" = x ; then \
 	  bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\
-	  bfd_version_string="\"$(VERSION)-%{release} $${bfd_version_date}\"" ;\
-	  bfd_soversion="$(VERSION)-%{release}" ;\
+	  bfd_version_string="\"$(VERSION)-1.1 $${bfd_version_date}\"" ;\
+	  bfd_soversion="$(VERSION)-1.1" ;\
 	fi ;\
 	sed -e "s,@bfd_version@,$$bfd_version," \
 	    -e "s,@bfd_version_string@,$$bfd_version_string," \
@@ -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/efi-bsdrv-ia64.c.efi-rtdrv binutils-2.18.50.0.3/bfd/efi-bsdrv-ia64.c
--- binutils-2.18.50.0.3/bfd/efi-bsdrv-ia64.c.efi-rtdrv	2008-01-07 11:47:35.000000000 -0500
+++ binutils-2.18.50.0.3/bfd/efi-bsdrv-ia64.c	2008-01-07 11:49:23.000000000 -0500
@@ -0,0 +1,36 @@
+/* BFD back-end for HP/Intel IA-64 EFI Boot Service driver files.
+   Copyright 1999, 2000, 2001, 2002, 2007 Free Software Foundation, Inc.
+   Contributed 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 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-01-07 11:39:49.000000000 -0500
+++ binutils-2.18.50.0.3/bfd/Makefile.am	2008-01-07 11:56:01.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 \
@@ -752,7 +764,7 @@ ofiles: stamp-ofiles ; @true
 libbfd_la_SOURCES = $(BFD32_LIBS_CFILES)
 libbfd_la_DEPENDENCIES = $(OFILES) ofiles
 libbfd_la_LIBADD = `cat ofiles` @WIN32LIBADD@
-libbfd_la_LDFLAGS = -release `cat libtool-soversion` @WIN32LDFLAGS@
+libbfd_la_LDFLAGS = -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -release `cat libtool-soversion` @WIN32LDFLAGS@
 
 # libtool will build .libs/libbfd.a.  We create libbfd.a in the build
 # directory so that we don't have to convert all the programs that use
@@ -982,8 +994,8 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/
 	report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
 	if test "x$(RELEASE)" = x ; then \
 	  bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\
-	  bfd_version_string="\"$(VERSION)-%{release} $${bfd_version_date}\"" ;\
-	  bfd_soversion="$(VERSION)-%{release}" ;\
+	  bfd_version_string="\"$(VERSION)-1.1 $${bfd_version_date}\"" ;\
+	  bfd_soversion="$(VERSION)-1.1" ;\
 	fi ;\
 	sed -e "s,@bfd_version@,$$bfd_version," \
 	    -e "s,@bfd_version_string@,$$bfd_version_string," \
@@ -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/efi-rtdrv-x86_64.c.efi-rtdrv binutils-2.18.50.0.3/bfd/efi-rtdrv-x86_64.c
--- binutils-2.18.50.0.3/bfd/efi-rtdrv-x86_64.c.efi-rtdrv	2008-01-07 11:39:49.000000000 -0500
+++ binutils-2.18.50.0.3/bfd/efi-rtdrv-x86_64.c	2008-01-07 11:56:04.000000000 -0500
@@ -0,0 +1,35 @@
+/* BFD back-end for Intel64 UEFI runtime driver files.
+   Copyright 2007 Free Software Foundation, Inc.
+
+   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/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-01-07 11:39:52.000000000 -0500
+++ binutils-2.18.50.0.3/bfd/configure.in	2008-01-07 11:56:34.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 binutils-2.18.50.0.3/bfd/efi-rtdrv-ia32.c.efi-rtdrv binutils-2.18.50.0.3/bfd/efi-rtdrv-ia32.c
--- binutils-2.18.50.0.3/bfd/efi-rtdrv-ia32.c.efi-rtdrv	2008-01-07 11:39:49.000000000 -0500
+++ binutils-2.18.50.0.3/bfd/efi-rtdrv-ia32.c	2008-01-07 11:39:49.000000000 -0500
@@ -0,0 +1,35 @@
+/* BFD back-end for Intel IA-32 EFI runtime driver files.
+   Copyright 1999, 2000, 2001, 2002, 2007 Free Software Foundation, Inc.
+   Contributed 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 binutils-2.18.50.0.3/bfd/efi-bsdrv-ia32.c.efi-rtdrv binutils-2.18.50.0.3/bfd/efi-bsdrv-ia32.c
--- binutils-2.18.50.0.3/bfd/efi-bsdrv-ia32.c.efi-rtdrv	2008-01-07 11:47:12.000000000 -0500
+++ binutils-2.18.50.0.3/bfd/efi-bsdrv-ia32.c	2008-01-07 11:49:20.000000000 -0500
@@ -0,0 +1,35 @@
+/* BFD back-end for Intel IA-32 EFI Boot Service driver files.
+   Copyright 1999, 2000, 2001, 2002, 2007 Free Software Foundation, Inc.
+   Contributed 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 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-01-07 11:39:51.000000000 -0500
+++ binutils-2.18.50.0.3/bfd/configure	2008-01-07 11:57:03.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" ;;

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