diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 78 | ||||
-rw-r--r-- | bfd/Makefile.am | 62 | ||||
-rw-r--r-- | bfd/Makefile.in | 62 | ||||
-rw-r--r-- | bfd/coffcode.h | 4 | ||||
-rw-r--r-- | bfd/config.bfd | 14 | ||||
-rwxr-xr-x | bfd/configure | 10 | ||||
-rw-r--r-- | bfd/configure.in | 10 | ||||
-rw-r--r-- | bfd/efi-app-ia32.c | 36 | ||||
-rw-r--r-- | bfd/efi-app-x86_64.c | 36 | ||||
-rw-r--r-- | bfd/efi-bsdrv-ia32.c | 37 | ||||
-rw-r--r-- | bfd/efi-bsdrv-ia64.c | 38 | ||||
-rw-r--r-- | bfd/efi-bsdrv-x86_64.c | 38 | ||||
-rw-r--r-- | bfd/efi-rtdrv-ia32.c | 37 | ||||
-rw-r--r-- | bfd/efi-rtdrv-ia64.c | 38 | ||||
-rw-r--r-- | bfd/efi-rtdrv-x86_64.c | 38 | ||||
-rw-r--r-- | bfd/libcoff.h | 4 | ||||
-rw-r--r-- | bfd/libpei.h | 40 | ||||
-rw-r--r-- | bfd/peXXigen.c | 4 | ||||
-rw-r--r-- | bfd/pei-ia64.c (renamed from bfd/efi-app-ia64.c) | 9 | ||||
-rw-r--r-- | bfd/peicode.h | 130 | ||||
-rw-r--r-- | bfd/targets.c | 20 |
21 files changed, 114 insertions, 631 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 894c497e97..8f85d19b7c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,81 @@ +2009-04-17 H.J. Lu <hongjiu.lu@intel.com> + + PR binutils/10074 + * coffcode.h (bfd_pei_p): New. + + * config.bfd: Remove bfd_efi_bsdrv_ia32_vec, + bfd_efi_rtdrv_ia32_vec, bfd_efi_bsdrv_x86_64_vec, + bfd_efi_rtdrv_x86_64_vec, bfd_efi_bsdrv_ia64_vec and + bfd_efi_rtdrv_ia64_vec. Replace bfd_efi_app_ia32_vec, + bfd_efi_app_x86_64_vec and bfd_efi_app_ia64_vec with + i386pei_vec, x86_64pei_vec and bfd_pei_ia64_vec, respectively. + + * configure.in: Remove bfd_efi_bsdrv_ia32_vec, + bfd_efi_rtdrv_ia32_vec, bfd_efi_bsdrv_x86_64_vec, + bfd_efi_rtdrv_x86_64_vec, + bfd_efi_bsdrv_ia64_vec and bfd_efi_rtdrv_ia64_vec. Replace + bfd_efi_ia64_vec with bfd_pei_ia64_vec. + * targets.c: Likewise. + + * configure: Regenerated. + * libcoff.h: Likewise. + * Makefile.in: Likewise. + + * efi-app-ia32.c: Removed. + * efi-app-x86_64.c: Likewise. + * efi-bsdrv-ia32.c: Likewise. + * efi-bsdrv-ia64.c: Likewise. + * efi-bsdrv-x86_64.c: Likewise. + * efi-rtdrv-ia32.c: Likewise. + * efi-rtdrv-ia64.c: Likewise. + * efi-rtdrv-x86_64.c: Likewise. + * efi-rtdrv-ia32.c: Likewise. + + * efi-app-ia64.c: Moved to ... + * pei-ia64.c: This. + (TARGET_SYM): Set to bfd_pei_ia64_vec. + (TARGET_NAME): Set to pei-ia64. + + * libpei.h (bfd_target_pei_p): Removed. + (bfd_target_pei_arch): Likewise. + (bfd_target_efi_app_p): Likewise. + (bfd_target_efi_app_arch): Likewise. + (bfd_target_efi_bsdrv_p): Likewise. + (bfd_target_efi_bsdrv_arch): Likewise. + (bfd_target_efi_rtdrv_p): Likewise. + (bfd_target_efi_rtdrv_arch): Likewise. + (bfd_pe_executable_p): Likewise. + + * Makefile.am (BFD32_BACKENDS): Remove efi-app-ia32.lo, + efi-bsdrv-ia32.lo and efi-rtdrv-ia32.lo. + (BFD32_BACKENDS_CFILES): Remove efi-app-ia32.c, efi-bsdrv-ia32.c + and efi-rtdrv-ia32.c. + (BFD64_BACKENDS): Remove efi-app-ia64.lo, efi-bsdrv-ia64.lo, + efi-rtdrv-ia64.lo, efi-app-x86_64.lo, efi-bsdrv-x86_64.lo and + efi-rtdrv-x86_64.lo. Add pei-ia64.lo. + (BFD64_BACKENDS_CFILES): Remove efi-app-ia64.c, efi-bsdrv-ia64.c, + efi-rtdrv-ia64.c, efi-app-x86_64.c, efi-bsdrv-x86_64.c and + efi-rtdrv-x86_64.c. Add pei-ia64.c. + (efi-app-ia64.lo): Removed. + (efi-bsdrv-ia32.lo): Likewise. + (efi-rtdrv-ia32.lo): Likewise. + (efi-app-ia64.lo): Likewise. + (efi-bsdrv-ia64.lo): Likewise. + (efi-rtdrv-ia64.lo): Likewise. + (efi-app-x86_64.lo): Likewise. + (efi-bsdrv-x86_64.lo): Likewise. + (efi-rtdrv-x86_64.lo): Likewise. + (pei-ia64.lo): New. + + * peicode.h (coff_swap_scnhdr_in): Replace bfd_pe_executable_p + with bfd_pei_p. + (arch_type): Removed. + (pe_arch): Likewise. + (pe_bfd_object_p): Just return coff_object_p. + + * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Replace + bfd_pe_executable_p with bfd_pei_p. + 2009-04-17 Christophe Lyon <christophe.lyon@st.com> * elf32-arm.c (elf32_arm_size_stubs): Handle long branches through diff --git a/bfd/Makefile.am b/bfd/Makefile.am index 683599ada7..771d5557f8 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -242,9 +242,6 @@ BFD32_BACKENDS = \ dwarf1.lo \ ecoff.lo \ ecofflink.lo \ - efi-app-ia32.lo \ - efi-bsdrv-ia32.lo \ - efi-rtdrv-ia32.lo \ elf.lo \ elf32-am33lin.lo \ elf32-arc.lo \ @@ -425,9 +422,6 @@ BFD32_BACKENDS_CFILES = \ dwarf1.c \ ecoff.c \ ecofflink.c \ - efi-app-ia32.c \ - efi-bsdrv-ia32.c \ - efi-rtdrv-ia32.c \ elf.c \ elf32-am33lin.c \ elf32-arc.c \ @@ -573,12 +567,7 @@ BFD64_BACKENDS = \ coff-alpha.lo \ 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 \ + pei-ia64.lo \ elf64-x86-64.lo \ elf64-alpha.lo \ elf64-hppa.lo \ @@ -610,12 +599,7 @@ BFD64_BACKENDS_CFILES = \ coff-alpha.c \ 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 \ + pei-ia64.c \ elf64-x86-64.c \ elf64-alpha.c \ elf64-hppa.c \ @@ -1346,21 +1330,6 @@ ecofflink.lo: ecofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/stab.def $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \ $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h libcoff.h \ libecoff.h -efi-app-ia32.lo: efi-app-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-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/external.h $(INCDIR)/elf/internal.h $(INCDIR)/libiberty.h \ @@ -1909,36 +1878,11 @@ demo64.lo: demo64.c aoutf1.h $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h $(INCDIR)/aout/sun4.h libaout.h \ $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h -efi-app-ia64.lo: efi-app-ia64.c $(INCDIR)/filenames.h \ +pei-ia64.lo: pei-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-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/external.h $(INCDIR)/elf/internal.h bfd_stdint.h \ diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 24c8ee16b0..1a00c47cc7 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -509,9 +509,6 @@ BFD32_BACKENDS = \ dwarf1.lo \ ecoff.lo \ ecofflink.lo \ - efi-app-ia32.lo \ - efi-bsdrv-ia32.lo \ - efi-rtdrv-ia32.lo \ elf.lo \ elf32-am33lin.lo \ elf32-arc.lo \ @@ -692,9 +689,6 @@ BFD32_BACKENDS_CFILES = \ dwarf1.c \ ecoff.c \ ecofflink.c \ - efi-app-ia32.c \ - efi-bsdrv-ia32.c \ - efi-rtdrv-ia32.c \ elf.c \ elf32-am33lin.c \ elf32-arc.c \ @@ -841,12 +835,7 @@ BFD64_BACKENDS = \ coff-alpha.lo \ 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 \ + pei-ia64.lo \ elf64-x86-64.lo \ elf64-alpha.lo \ elf64-hppa.lo \ @@ -878,12 +867,7 @@ BFD64_BACKENDS_CFILES = \ coff-alpha.c \ 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 \ + pei-ia64.c \ elf64-x86-64.c \ elf64-alpha.c \ elf64-hppa.c \ @@ -1943,21 +1927,6 @@ ecofflink.lo: ecofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/stab.def $(INCDIR)/coff/internal.h $(INCDIR)/coff/sym.h \ $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h libcoff.h \ libecoff.h -efi-app-ia32.lo: efi-app-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-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/external.h $(INCDIR)/elf/internal.h $(INCDIR)/libiberty.h \ @@ -2506,36 +2475,11 @@ demo64.lo: demo64.c aoutf1.h $(INCDIR)/filenames.h \ $(INCDIR)/hashtab.h $(INCDIR)/aout/sun4.h libaout.h \ $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h aout-target.h -efi-app-ia64.lo: efi-app-ia64.c $(INCDIR)/filenames.h \ +pei-ia64.lo: pei-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-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/external.h $(INCDIR)/elf/internal.h bfd_stdint.h \ diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 11cc457f20..312aa7758c 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -1560,6 +1560,10 @@ Special entry points for gdb to swap in coff symbol table parts: .#define bfd_coff_print_pdata(a,p) \ . ((coff_backend_info (a)->_bfd_coff_print_pdata) (a, p)) . +.{* Macro: Returns true if the bfd is a PE executable as opposed to a +. PE object file. *} +.#define bfd_pei_p(abfd) \ +. (CONST_STRNEQ ((abfd)->xvec->name, "pei-")) */ /* See whether the magic number matches. */ diff --git a/bfd/config.bfd b/bfd/config.bfd index 9e9e021c15..56894ad558 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -179,7 +179,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 bfd_efi_bsdrv_ia64_vec bfd_efi_rtdrv_ia64_vec" + targ_selvecs="bfd_elf64_ia64_big_vec bfd_pei_ia64_vec" want64=true ;; ia64*-*-hpux*) @@ -556,8 +556,8 @@ case "${targ}" in ;; i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu | i[3-7]86-*-dragonfly*) targ_defvec=bfd_elf32_i386_freebsd_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" + targ_selvecs="bfd_elf32_i386_vec i386pei_vec i386coff_vec" + targ64_selvecs="bfd_elf64_x86_64_freebsd_vec bfd_elf64_x86_64_vec x86_64pei_vec" # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling. case "${targ}" in i[3-7]86-*-freebsd3* | i[3-7]86-*-freebsd4 | i[3-7]86-*-freebsd4.0*) @@ -594,7 +594,7 @@ case "${targ}" in ;; i[3-7]86-*-linux-*) targ_defvec=bfd_elf32_i386_vec - targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec bfd_efi_bsdrv_ia32_vec bfd_efi_rtdrv_ia32_vec" + targ_selvecs="i386linux_vec i386pei_vec" targ64_selvecs=bfd_elf64_x86_64_vec ;; #ifdef BFD64 @@ -616,17 +616,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_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" + targ_selvecs="bfd_elf32_i386_freebsd_vec i386coff_vec i386pei_vec x86_64pei_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_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" + targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec i386pei_vec x86_64pei_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_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" + targ_selvecs="bfd_elf32_i386_vec i386linux_vec i386pei_vec x86_64pei_vec" want64=true ;; x86_64-*-mingw*) diff --git a/bfd/configure b/bfd/configure index 41520b24fb..3f7c69cb0e 100755 --- a/bfd/configure +++ b/bfd/configure @@ -20936,15 +20936,7 @@ do armpei_little_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;; 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_pei_ia64_vec) tb="$tb pei-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 --git a/bfd/configure.in b/bfd/configure.in index 868730aa40..81255ddcf0 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -657,15 +657,7 @@ do armpei_little_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;; 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_pei_ia64_vec) tb="$tb pei-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 --git a/bfd/efi-app-ia32.c b/bfd/efi-app-ia32.c deleted file mode 100644 index aaa80c5f1a..0000000000 --- a/bfd/efi-app-ia32.c +++ /dev/null @@ -1,36 +0,0 @@ -/* BFD back-end for Intel IA-32 EFI application files. - Copyright 1999, 2000, 2001, 2002, 2007, 2009 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_app_ia32_vec -#define TARGET_NAME "efi-app-ia32" -#define COFF_IMAGE_WITH_PE -#define COFF_WITH_PE -#define PCRELOFFSET TRUE -#define TARGET_UNDERSCORE '_' -/* Long section names not allowed in executable images, only object files. */ -#define COFF_LONG_SECTION_NAMES 0 -#define PEI_TARGET_SUBSYSTEM IMAGE_SUBSYSTEM_EFI_APPLICATION -#define PEI_FORCE_MINIMUM_ALIGNMENT - -#include "coff-i386.c" diff --git a/bfd/efi-app-x86_64.c b/bfd/efi-app-x86_64.c deleted file mode 100644 index d2a04f3715..0000000000 --- a/bfd/efi-app-x86_64.c +++ /dev/null @@ -1,36 +0,0 @@ -/* BFD back-end for Intel64 UEFI application files. - Copyright 2007, 2009 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_app_x86_64_vec -#define TARGET_NAME "efi-app-x86_64" -#define COFF_IMAGE_WITH_PE -#define COFF_WITH_PE -#define COFF_WITH_pep -#define PCRELOFFSET TRUE -#define TARGET_UNDERSCORE '_' -/* Long section names not allowed in executable images, only object files. */ -#define COFF_LONG_SECTION_NAMES 0 -#define PEI_TARGET_SUBSYSTEM IMAGE_SUBSYSTEM_EFI_APPLICATION -#define PEI_FORCE_MINIMUM_ALIGNMENT - -#include "coff-x86_64.c" diff --git a/bfd/efi-bsdrv-ia32.c b/bfd/efi-bsdrv-ia32.c deleted file mode 100644 index 112b2b4cca..0000000000 --- a/bfd/efi-bsdrv-ia32.c +++ /dev/null @@ -1,37 +0,0 @@ -/* BFD back-end for Intel IA-32 EFI Boot Service driver files. - Copyright 1999, 2000, 2001, 2002, 2007, 2008, 2009 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 '_' -/* Long section names not allowed in executable images, only object files. */ -#define COFF_LONG_SECTION_NAMES 0 -#define PEI_TARGET_SUBSYSTEM IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER -#define PEI_FORCE_MINIMUM_ALIGNMENT - -#include "coff-i386.c" diff --git a/bfd/efi-bsdrv-ia64.c b/bfd/efi-bsdrv-ia64.c deleted file mode 100644 index f08c568b5a..0000000000 --- a/bfd/efi-bsdrv-ia64.c +++ /dev/null @@ -1,38 +0,0 @@ -/* BFD back-end for HP/Intel IA-64 EFI Boot Service driver files. - Copyright 1999, 2000, 2001, 2002, 2007, 2008, 2009 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 '_' -/* Long section names not allowed in executable images, only object files. */ -#define COFF_LONG_SECTION_NAMES 0 -#define PEI_TARGET_SUBSYSTEM IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER -#define PEI_FORCE_MINIMUM_ALIGNMENT - -#include "coff-ia64.c" diff --git a/bfd/efi-bsdrv-x86_64.c b/bfd/efi-bsdrv-x86_64.c deleted file mode 100644 index dfe00f4008..0000000000 --- a/bfd/efi-bsdrv-x86_64.c +++ /dev/null @@ -1,38 +0,0 @@ -/* BFD back-end for Intel64 UEFI Boot Service driver files. - Copyright 1999, 2000, 2001, 2002, 2007, 2008, 2009 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 '_' -/* Long section names not allowed in executable images, only object files. */ -#define COFF_LONG_SECTION_NAMES 0 -#define PEI_TARGET_SUBSYSTEM IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER -#define PEI_FORCE_MINIMUM_ALIGNMENT - -#include "coff-x86_64.c" diff --git a/bfd/efi-rtdrv-ia32.c b/bfd/efi-rtdrv-ia32.c deleted file mode 100644 index b127cbc66f..0000000000 --- a/bfd/efi-rtdrv-ia32.c +++ /dev/null @@ -1,37 +0,0 @@ -/* BFD back-end for Intel IA-32 EFI runtime driver files. - Copyright 1999, 2000, 2001, 2002, 2007, 2008, 2009 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 '_' -/* Long section names not allowed in executable images, only object files. */ -#define COFF_LONG_SECTION_NAMES 0 -#define PEI_TARGET_SUBSYSTEM IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER -#define PEI_FORCE_MINIMUM_ALIGNMENT - -#include "coff-i386.c" diff --git a/bfd/efi-rtdrv-ia64.c b/bfd/efi-rtdrv-ia64.c deleted file mode 100644 index d93416d2dd..0000000000 --- a/bfd/efi-rtdrv-ia64.c +++ /dev/null @@ -1,38 +0,0 @@ -/* BFD back-end for HP/Intel IA-64 EFI runtime driver files. - Copyright 1999, 2000, 2001, 2002, 2007, 2008, 2009 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 '_' -/* Long section names not allowed in executable images, only object files. */ -#define COFF_LONG_SECTION_NAMES 0 -#define PEI_TARGET_SUBSYSTEM IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER -#define PEI_FORCE_MINIMUM_ALIGNMENT - -#include "coff-ia64.c" diff --git a/bfd/efi-rtdrv-x86_64.c b/bfd/efi-rtdrv-x86_64.c deleted file mode 100644 index c66b63c0f5..0000000000 --- a/bfd/efi-rtdrv-x86_64.c +++ /dev/null @@ -1,38 +0,0 @@ -/* BFD back-end for Intel64 UEFI runtime driver files. - Copyright 1999, 2000, 2001, 2002, 2007, 2008, 2009 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 '_' -/* Long section names not allowed in executable images, only object files. */ -#define COFF_LONG_SECTION_NAMES 0 -#define PEI_TARGET_SUBSYSTEM IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER -#define PEI_FORCE_MINIMUM_ALIGNMENT - -#include "coff-x86_64.c" diff --git a/bfd/libcoff.h b/bfd/libcoff.h index a053f6bf9e..247f1c4cc7 100644 --- a/bfd/libcoff.h +++ b/bfd/libcoff.h @@ -950,3 +950,7 @@ typedef struct #define bfd_coff_print_pdata(a,p) \ ((coff_backend_info (a)->_bfd_coff_print_pdata) (a, p)) +/* Macro: Returns true if the bfd is a PE executable as opposed to a + PE object file. */ +#define bfd_pei_p(abfd) \ + (CONST_STRNEQ ((abfd)->xvec->name, "pei-")) diff --git a/bfd/libpei.h b/bfd/libpei.h index 2178d24f76..f5bfa4cac3 100644 --- a/bfd/libpei.h +++ b/bfd/libpei.h @@ -301,46 +301,6 @@ #endif /* !COFF_WITH_pep */ -/* Returns true if the target is a PE executable target. */ -#define bfd_target_pei_p(xvec) \ - (CONST_STRNEQ ((xvec)->name, "pei-")) - -/* Return the arch string of a PE executable target. */ -#define bfd_target_pei_arch(xvec) \ - ((xvec)->name + sizeof ("pei-") - 1) - -/* 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 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_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 int coff_swap_reloc_out diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c index 246de27c23..b3b39deda2 100644 --- a/bfd/peXXigen.c +++ b/bfd/peXXigen.c @@ -879,7 +879,7 @@ _bfd_XXi_swap_scnhdr_out (bfd * abfd, void * in, void * out) sometimes). */ if ((scnhdr_int->s_flags & IMAGE_SCN_CNT_UNINITIALIZED_DATA) != 0) { - if (bfd_pe_executable_p (abfd)) + if (bfd_pei_p (abfd)) { ps = scnhdr_int->s_size; ss = 0; @@ -892,7 +892,7 @@ _bfd_XXi_swap_scnhdr_out (bfd * abfd, void * in, void * out) } else { - if (bfd_pe_executable_p (abfd)) + if (bfd_pei_p (abfd)) ps = scnhdr_int->s_paddr; else ps = 0; diff --git a/bfd/efi-app-ia64.c b/bfd/pei-ia64.c index 449c4c7bab..dc1980d4ac 100644 --- a/bfd/efi-app-ia64.c +++ b/bfd/pei-ia64.c @@ -1,7 +1,10 @@ -/* BFD back-end for HP/Intel IA-64 EFI application files. +/* BFD back-end for HP/Intel IA-64 PE IMAGE COFF files. Copyright 1999, 2000, 2001, 2002, 2007, 2009 Free Software Foundation, Inc. Contributed by David Mosberger <davidm@hpl.hp.com> + This implementation only supports objcopy to ouput IA-64 PE IMAGE COFF + files. + This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify @@ -22,8 +25,8 @@ #include "sysdep.h" #include "bfd.h" -#define TARGET_SYM bfd_efi_app_ia64_vec -#define TARGET_NAME "efi-app-ia64" +#define TARGET_SYM bfd_pei_ia64_vec +#define TARGET_NAME "pei-ia64" #define COFF_IMAGE_WITH_PE #define COFF_WITH_PE #define COFF_WITH_pep diff --git a/bfd/peicode.h b/bfd/peicode.h index 357d1c881e..2e96f1263f 100644 --- a/bfd/peicode.h +++ b/bfd/peicode.h @@ -236,8 +236,8 @@ coff_swap_scnhdr_in (bfd * abfd, void * ext, void * in) use the virtual size (stored in s_paddr) instead. */ if (scnhdr_int->s_paddr > 0 && (((scnhdr_int->s_flags & IMAGE_SCN_CNT_UNINITIALIZED_DATA) != 0 - && (! bfd_pe_executable_p (abfd) || scnhdr_int->s_size == 0)) - || (bfd_pe_executable_p (abfd) && (scnhdr_int->s_size > scnhdr_int->s_paddr)))) + && (! bfd_pei_p (abfd) || scnhdr_int->s_size == 0)) + || (bfd_pei_p (abfd) && (scnhdr_int->s_size > scnhdr_int->s_paddr)))) /* This code used to set scnhdr_int->s_paddr to 0. However, coff_set_alignment_hook stores s_paddr in virt_size, which only works if it correctly holds the virtual size of the @@ -1236,25 +1236,6 @@ pe_ILF_object_p (bfd * abfd) return abfd->xvec; } -enum arch_type -{ - arch_type_unknown, - arch_type_i386, - arch_type_x86_64 -}; - -static enum arch_type -pe_arch (const char *arch) -{ - if (strcmp (arch, "i386") == 0 || strcmp (arch, "ia32") == 0) - return arch_type_i386; - - if (strcmp (arch, "x86_64") == 0 || strcmp (arch, "x86-64") == 0) - return arch_type_x86_64; - - return arch_type_unknown; -} - static const bfd_target * pe_bfd_object_p (bfd * abfd) { @@ -1262,8 +1243,6 @@ pe_bfd_object_p (bfd * abfd) struct external_PEI_DOS_hdr dos_hdr; struct external_PEI_IMAGE_hdr image_hdr; file_ptr offset; - const bfd_target *target; - struct bfd_preserve preserve; /* Detect if this a Microsoft Import Library Format element. */ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 @@ -1328,110 +1307,7 @@ pe_bfd_object_p (bfd * abfd) return NULL; } - preserve.marker = NULL; - if (! bfd_preserve_save (abfd, &preserve)) - return NULL; - - target = coff_object_p (abfd); - if (target) - { - 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 - || 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_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)); - - /* Don't check PE vs. EFI if arch is unknown. */ - if (arch == arch_type_unknown) - { - bfd_preserve_finish (abfd, &preserve); - return target; - } - - for (target_ptr = bfd_target_vector; *target_ptr != NULL; - target_ptr++) - { - if (*target_ptr == target - || (*target_ptr)->flavour != bfd_target_coff_flavour) - continue; - - if (bfd_target_efi_app_p (*target_ptr)) - { - /* Skip incompatible 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) - { -no_match: - /* TARGET_PTR is an EFI backend. Don't match - TARGET with a EFI file. */ - bfd_preserve_restore (abfd, &preserve); - bfd_set_error (bfd_error_wrong_format); - return NULL; - } - } - else if (bfd_target_pei_p (*target_ptr)) - { - /* Skip incompatible arch. */ - if (pe_arch (bfd_target_pei_arch (*target_ptr)) != arch) - continue; - - if (!efi) - { - /* TARGET_PTR is a PE backend. Don't match - TARGET with a PE file. */ - goto no_match; - } - } - } - - bfd_preserve_finish (abfd, &preserve); - } - else - bfd_preserve_restore (abfd, &preserve); - - return target; + return coff_object_p (abfd); } #define coff_object_p pe_bfd_object_p diff --git a/bfd/targets.c b/bfd/targets.c index c9d4c31fab..daca6158a4 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -565,15 +565,7 @@ extern const bfd_target armpei_big_vec; extern const bfd_target armpei_little_vec; 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_pei_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; @@ -893,16 +885,8 @@ static const bfd_target * const _bfd_target_vector[] = &armpei_little_vec, &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, + &bfd_pei_ia64_vec, #endif &bfd_elf32_avr_vec, &bfd_elf32_bfin_vec, |