1999-09-11 Donn Terry <donn@interix.com>

* libpei.h: New file, broken out of peicode.h.
	* peigen.c: New file, broken out of peicode.h.
	* peicode.h: A bunch of code moved out to libpei.h and peigen.c.
	* configure.in: Add peigen.lo to list of files required for each
	PE target.
	* Makefile.am: Rebuild dependencies.
	(BFD32_BACKENDS): Add peigen.lo.
	(BFD32_BACKENDS_CFILES): Add peigen.c.
	(SOURCE_HFILES): Add libpei.h.
	* configure, Makefile.in: Rebuild.
This commit is contained in:
Ian Lance Taylor 1999-09-11 23:37:28 +00:00
parent e166a60fd9
commit 277d1b5e45
8 changed files with 2196 additions and 1997 deletions

View file

@ -7,6 +7,17 @@
1999-09-11 Donn Terry <donn@interix.com>
* libpei.h: New file, broken out of peicode.h.
* peigen.c: New file, broken out of peicode.h.
* peicode.h: A bunch of code moved out to libpei.h and peigen.c.
* configure.in: Add peigen.lo to list of files required for each
PE target.
* Makefile.am: Rebuild dependencies.
(BFD32_BACKENDS): Add peigen.lo.
(BFD32_BACKENDS_CFILES): Add peigen.c.
(SOURCE_HFILES): Add libpei.h.
* configure, Makefile.in: Rebuild.
* peicode.h (coff_swap_scnhdr_in): Don't check for a special
section name of _BSS; check IMAGE_SCN_CNT_UNINITIALIZED_DATA
instead. Don't clear the s_paddr field for an uninitialized data

View file

@ -216,6 +216,7 @@ BFD32_BACKENDS = \
pei-mcore.lo \
pe-ppc.lo \
pei-ppc.lo \
peigen.lo \
ppcboot.lo \
reloc16.lo \
riscix.lo \
@ -340,6 +341,7 @@ BFD32_BACKENDS_CFILES = \
pei-mcore.c \
pe-ppc.c \
pei-ppc.c \
peigen.c \
ppcboot.c \
reloc16.c \
riscix.c \
@ -426,8 +428,8 @@ SOURCE_HFILES = \
ecoffswap.h elf32-arm.h elf32-hppa.h elfcode.h elfcore.h \
elflink.h freebsd.h genlink.h go32stub.h hppa_stubs.h libaout.h \
libbfd.h libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h \
libnlm.h liboasys.h netbsd.h nlm-target.h nlmcode.h nlmswap.h \
ns32k.h peicode.h som.h vms.h
libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h nlmcode.h \
nlmswap.h ns32k.h peicode.h som.h vms.h
HFILES = \
elf32-target.h elf64-target.h targmatch.h \
@ -912,10 +914,11 @@ elflink.lo: elflink.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
epoc-pei-arm.lo: epoc-pei-arm.c pei-arm.c coff-arm.c \
$(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h
libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \
libpei.h
hp300bsd.lo: hp300bsd.c libaout.h $(INCDIR)/bfdlink.h \
aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
@ -996,28 +999,30 @@ pc532-mach.lo: pc532-mach.c libaout.h $(INCDIR)/bfdlink.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
pe-arm.lo: pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pei-arm.lo: pei-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pe-i386.lo: pe-i386.c coff-i386.c $(INCDIR)/coff/i386.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pei-i386.lo: pei-i386.c coff-i386.c $(INCDIR)/coff/i386.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pe-mcore.lo: pe-mcore.c coff-mcore.c $(INCDIR)/coff/mcore.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pei-mcore.lo: pei-mcore.c coff-mcore.c $(INCDIR)/coff/mcore.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pe-ppc.lo: pe-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pei-ppc.lo: pei-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
peigen.lo: peigen.c $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h
ppcboot.lo: ppcboot.c
reloc16.lo: reloc16.c $(INCDIR)/bfdlink.h genlink.h \
$(INCDIR)/coff/internal.h libcoff.h

View file

@ -335,6 +335,7 @@ BFD32_BACKENDS = \
pei-mcore.lo \
pe-ppc.lo \
pei-ppc.lo \
peigen.lo \
ppcboot.lo \
reloc16.lo \
riscix.lo \
@ -460,6 +461,7 @@ BFD32_BACKENDS_CFILES = \
pei-mcore.c \
pe-ppc.c \
pei-ppc.c \
peigen.c \
ppcboot.c \
reloc16.c \
riscix.c \
@ -551,8 +553,8 @@ SOURCE_HFILES = \
ecoffswap.h elf32-arm.h elf32-hppa.h elfcode.h elfcore.h \
elflink.h freebsd.h genlink.h go32stub.h hppa_stubs.h libaout.h \
libbfd.h libcoff.h libecoff.h elf-bfd.h libhppa.h libieee.h \
libnlm.h liboasys.h netbsd.h nlm-target.h nlmcode.h nlmswap.h \
ns32k.h peicode.h som.h vms.h
libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h nlmcode.h \
nlmswap.h ns32k.h peicode.h som.h vms.h
HFILES = \
@ -1442,10 +1444,11 @@ elflink.lo: elflink.c $(INCDIR)/bfdlink.h elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h
epoc-pe-arm.lo: epoc-pe-arm.c pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
epoc-pei-arm.lo: epoc-pei-arm.c pei-arm.c coff-arm.c \
$(INCDIR)/coff/arm.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h \
libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h
libcoff.h $(INCDIR)/bfdlink.h coffcode.h peicode.h \
libpei.h
hp300bsd.lo: hp300bsd.c libaout.h $(INCDIR)/bfdlink.h \
aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
@ -1526,28 +1529,30 @@ pc532-mach.lo: pc532-mach.c libaout.h $(INCDIR)/bfdlink.h \
$(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h
pe-arm.lo: pe-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pei-arm.lo: pei-arm.c coff-arm.c $(INCDIR)/coff/arm.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pe-i386.lo: pe-i386.c coff-i386.c $(INCDIR)/coff/i386.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pei-i386.lo: pei-i386.c coff-i386.c $(INCDIR)/coff/i386.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pe-mcore.lo: pe-mcore.c coff-mcore.c $(INCDIR)/coff/mcore.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pei-mcore.lo: pei-mcore.c coff-mcore.c $(INCDIR)/coff/mcore.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pe-ppc.lo: pe-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
pei-ppc.lo: pei-ppc.c coff-ppc.c $(INCDIR)/coff/powerpc.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/pe.h libcoff.h \
$(INCDIR)/bfdlink.h coffcode.h peicode.h
$(INCDIR)/bfdlink.h coffcode.h peicode.h libpei.h
peigen.lo: peigen.c $(INCDIR)/coff/internal.h $(INCDIR)/coff/i386.h \
$(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h libpei.h
ppcboot.lo: ppcboot.c
reloc16.lo: reloc16.c $(INCDIR)/bfdlink.h genlink.h \
$(INCDIR)/coff/internal.h libcoff.h

36
bfd/configure vendored
View file

@ -5367,14 +5367,14 @@ do
armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;;
armpe_little_vec) tb="$tb pe-arm.lo cofflink.lo " ;;
armpe_big_vec) tb="$tb pe-arm.lo cofflink.lo " ;;
armpei_little_vec) tb="$tb pei-arm.lo cofflink.lo " ;;
armpei_big_vec) tb="$tb pei-arm.lo cofflink.lo " ;;
arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo cofflink.lo " ;;
arm_epoc_pe_big_vec) tb="$tb epoc-pe-arm.lo cofflink.lo " ;;
arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo cofflink.lo " ;;
arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo cofflink.lo " ;;
armpe_little_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
armpe_big_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
armpei_little_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
armpei_big_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
arm_epoc_pe_big_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;;
aout_arm_big_vec) tb="$tb aout-arm.lo aout32.lo" ;;
aout_arm_little_vec) tb="$tb aout-arm.lo aout32.lo" ;;
@ -5448,8 +5448,8 @@ do
i386dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;;
i386freebsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;;
i386msdos_vec) tb="$tb i386msdos.lo" ;;
i386pe_vec) tb="$tb pe-i386.lo cofflink.lo " ;;
i386pei_vec) tb="$tb pei-i386.lo cofflink.lo" ;;
i386pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;
i386pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;
i386linux_vec) tb="$tb i386linux.lo aout32.lo" ;;
i386lynx_aout_vec) tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
i386lynx_coff_vec) tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;;
@ -5470,10 +5470,10 @@ do
m68kaux_coff_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;;
m88kbcs_vec) tb="$tb coff-m88k.lo" ;;
mcore_pe_big_vec) tb="$tb pe-mcore.lo cofflink.lo" ;;
mcore_pe_little_vec) tb="$tb pe-mcore.lo cofflink.lo" ;;
mcore_pei_big_vec) tb="$tb pei-mcore.lo cofflink.lo" ;;
mcore_pei_little_vec) tb="$tb pei-mcore.lo cofflink.lo" ;;
mcore_pe_big_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
mcore_pe_little_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
mcore_pei_big_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
mcore_pei_little_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;;
nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
@ -5485,10 +5485,10 @@ do
pc532machaout_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
pmac_xcoff_vec) tb="$tb coff-pmac.lo xcofflink.lo" ;;
rs6000coff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo cofflink.lo" ;;
bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo cofflink.lo" ;;
bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo cofflink.lo" ;;
bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo cofflink.lo" ;;
bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
ppcboot_vec) tb="$tb ppcboot.lo" ;;
shcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
shlcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;

View file

@ -415,14 +415,14 @@ do
armcoff_little_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
armcoff_big_vec) tb="$tb coff-arm.lo cofflink.lo " ;;
armnetbsd_vec) tb="$tb armnetbsd.lo aout32.lo" ;;
armpe_little_vec) tb="$tb pe-arm.lo cofflink.lo " ;;
armpe_big_vec) tb="$tb pe-arm.lo cofflink.lo " ;;
armpei_little_vec) tb="$tb pei-arm.lo cofflink.lo " ;;
armpei_big_vec) tb="$tb pei-arm.lo cofflink.lo " ;;
arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo cofflink.lo " ;;
arm_epoc_pe_big_vec) tb="$tb epoc-pe-arm.lo cofflink.lo " ;;
arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo cofflink.lo " ;;
arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo cofflink.lo " ;;
armpe_little_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
armpe_big_vec) tb="$tb pe-arm.lo peigen.lo cofflink.lo " ;;
armpei_little_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
armpei_big_vec) tb="$tb pei-arm.lo peigen.lo cofflink.lo " ;;
arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
arm_epoc_pe_big_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
arm_epoc_pei_little_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
arm_epoc_pei_big_vec) tb="$tb epoc-pei-arm.lo peigen.lo cofflink.lo " ;;
aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;;
aout_arm_big_vec) tb="$tb aout-arm.lo aout32.lo" ;;
aout_arm_little_vec) tb="$tb aout-arm.lo aout32.lo" ;;
@ -496,8 +496,8 @@ do
i386dynix_vec) tb="$tb i386dynix.lo aout32.lo" ;;
i386freebsd_vec) tb="$tb i386freebsd.lo aout32.lo" ;;
i386msdos_vec) tb="$tb i386msdos.lo" ;;
i386pe_vec) tb="$tb pe-i386.lo cofflink.lo " ;;
i386pei_vec) tb="$tb pei-i386.lo cofflink.lo" ;;
i386pe_vec) tb="$tb pe-i386.lo peigen.lo cofflink.lo" ;;
i386pei_vec) tb="$tb pei-i386.lo peigen.lo cofflink.lo" ;;
i386linux_vec) tb="$tb i386linux.lo aout32.lo" ;;
i386lynx_aout_vec) tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;;
i386lynx_coff_vec) tb="$tb cf-i386lynx.lo cofflink.lo lynx-core.lo" ;;
@ -518,10 +518,10 @@ do
m68kaux_coff_vec) tb="$tb coff-aux.lo coff-m68k.lo cofflink.lo" ;;
m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;;
m88kbcs_vec) tb="$tb coff-m88k.lo" ;;
mcore_pe_big_vec) tb="$tb pe-mcore.lo cofflink.lo" ;;
mcore_pe_little_vec) tb="$tb pe-mcore.lo cofflink.lo" ;;
mcore_pei_big_vec) tb="$tb pei-mcore.lo cofflink.lo" ;;
mcore_pei_little_vec) tb="$tb pei-mcore.lo cofflink.lo" ;;
mcore_pe_big_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
mcore_pe_little_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;;
mcore_pei_big_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
mcore_pei_little_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;;
newsos3_vec) tb="$tb newsos3.lo aout32.lo" ;;
nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;;
nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;;
@ -533,10 +533,10 @@ do
pc532machaout_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;;
pmac_xcoff_vec) tb="$tb coff-pmac.lo xcofflink.lo" ;;
rs6000coff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo cofflink.lo" ;;
bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo cofflink.lo" ;;
bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo cofflink.lo" ;;
bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo cofflink.lo" ;;
bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
bfd_powerpcle_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
bfd_powerpcle_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
ppcboot_vec) tb="$tb ppcboot.lo" ;;
shcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;
shlcoff_vec) tb="$tb coff-sh.lo cofflink.lo" ;;

246
bfd/libpei.h Normal file
View file

@ -0,0 +1,246 @@
/* Support for the generic parts of PE/PEI; common header information.
Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
Written by Cygnus Solutions.
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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/*
Most of this hacked by Steve Chamberlain,
sac@cygnus.com
PE/PEI rearrangement (and code added): Donn Terry
Softway Systems, Inc.
*/
/* Hey look, some documentation [and in a place you expect to find it]!
The main reference for the pei format is "Microsoft Portable Executable
and Common Object File Format Specification 4.1". Get it if you need to
do some serious hacking on this code.
Another reference:
"Peering Inside the PE: A Tour of the Win32 Portable Executable
File Format", MSJ 1994, Volume 9.
The *sole* difference between the pe format and the pei format is that the
latter has an MSDOS 2.0 .exe header on the front that prints the message
"This app must be run under Windows." (or some such).
(FIXME: Whether that statement is *really* true or not is unknown.
Are there more subtle differences between pe and pei formats?
For now assume there aren't. If you find one, then for God sakes
document it here!)
The Microsoft docs use the word "image" instead of "executable" because
the former can also refer to a DLL (shared library). Confusion can arise
because the `i' in `pei' also refers to "image". The `pe' format can
also create images (i.e. executables), it's just that to run on a win32
system you need to use the pei format.
FIXME: Please add more docs here so the next poor fool that has to hack
on this code has a chance of getting something accomplished without
wasting too much time.
*/
#ifndef GET_FCN_LNNOPTR
#define GET_FCN_LNNOPTR(abfd, ext) \
bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr)
#endif
#ifndef GET_FCN_ENDNDX
#define GET_FCN_ENDNDX(abfd, ext) \
bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx)
#endif
#ifndef PUT_FCN_LNNOPTR
#define PUT_FCN_LNNOPTR(abfd, in, ext) bfd_h_put_32(abfd, in, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr)
#endif
#ifndef PUT_FCN_ENDNDX
#define PUT_FCN_ENDNDX(abfd, in, ext) bfd_h_put_32(abfd, in, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx)
#endif
#ifndef GET_LNSZ_LNNO
#define GET_LNSZ_LNNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_misc.x_lnsz.x_lnno)
#endif
#ifndef GET_LNSZ_SIZE
#define GET_LNSZ_SIZE(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) ext->x_sym.x_misc.x_lnsz.x_size)
#endif
#ifndef PUT_LNSZ_LNNO
#define PUT_LNSZ_LNNO(abfd, in, ext) bfd_h_put_16(abfd, in, (bfd_byte *)ext->x_sym.x_misc.x_lnsz.x_lnno)
#endif
#ifndef PUT_LNSZ_SIZE
#define PUT_LNSZ_SIZE(abfd, in, ext) bfd_h_put_16(abfd, in, (bfd_byte*) ext->x_sym.x_misc.x_lnsz.x_size)
#endif
#ifndef GET_SCN_SCNLEN
#define GET_SCN_SCNLEN(abfd, ext) bfd_h_get_32(abfd, (bfd_byte *) ext->x_scn.x_scnlen)
#endif
#ifndef GET_SCN_NRELOC
#define GET_SCN_NRELOC(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *)ext->x_scn.x_nreloc)
#endif
#ifndef GET_SCN_NLINNO
#define GET_SCN_NLINNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *)ext->x_scn.x_nlinno)
#endif
#ifndef PUT_SCN_SCNLEN
#define PUT_SCN_SCNLEN(abfd,in, ext) bfd_h_put_32(abfd, in, (bfd_byte *) ext->x_scn.x_scnlen)
#endif
#ifndef PUT_SCN_NRELOC
#define PUT_SCN_NRELOC(abfd,in, ext) bfd_h_put_16(abfd, in, (bfd_byte *)ext->x_scn.x_nreloc)
#endif
#ifndef PUT_SCN_NLINNO
#define PUT_SCN_NLINNO(abfd,in, ext) bfd_h_put_16(abfd,in, (bfd_byte *) ext->x_scn.x_nlinno)
#endif
#ifndef GET_LINENO_LNNO
#define GET_LINENO_LNNO(abfd, ext) bfd_h_get_16(abfd, (bfd_byte *) (ext->l_lnno));
#endif
#ifndef PUT_LINENO_LNNO
#define PUT_LINENO_LNNO(abfd,val, ext) bfd_h_put_16(abfd,val, (bfd_byte *) (ext->l_lnno));
#endif
/* The f_symptr field in the filehdr is sometimes 64 bits. */
#ifndef GET_FILEHDR_SYMPTR
#define GET_FILEHDR_SYMPTR bfd_h_get_32
#endif
#ifndef PUT_FILEHDR_SYMPTR
#define PUT_FILEHDR_SYMPTR bfd_h_put_32
#endif
/* Some fields in the aouthdr are sometimes 64 bits. */
#ifndef GET_AOUTHDR_TSIZE
#define GET_AOUTHDR_TSIZE bfd_h_get_32
#endif
#ifndef PUT_AOUTHDR_TSIZE
#define PUT_AOUTHDR_TSIZE bfd_h_put_32
#endif
#ifndef GET_AOUTHDR_DSIZE
#define GET_AOUTHDR_DSIZE bfd_h_get_32
#endif
#ifndef PUT_AOUTHDR_DSIZE
#define PUT_AOUTHDR_DSIZE bfd_h_put_32
#endif
#ifndef GET_AOUTHDR_BSIZE
#define GET_AOUTHDR_BSIZE bfd_h_get_32
#endif
#ifndef PUT_AOUTHDR_BSIZE
#define PUT_AOUTHDR_BSIZE bfd_h_put_32
#endif
#ifndef GET_AOUTHDR_ENTRY
#define GET_AOUTHDR_ENTRY bfd_h_get_32
#endif
#ifndef PUT_AOUTHDR_ENTRY
#define PUT_AOUTHDR_ENTRY bfd_h_put_32
#endif
#ifndef GET_AOUTHDR_TEXT_START
#define GET_AOUTHDR_TEXT_START bfd_h_get_32
#endif
#ifndef PUT_AOUTHDR_TEXT_START
#define PUT_AOUTHDR_TEXT_START bfd_h_put_32
#endif
#ifndef GET_AOUTHDR_DATA_START
#define GET_AOUTHDR_DATA_START bfd_h_get_32
#endif
#ifndef PUT_AOUTHDR_DATA_START
#define PUT_AOUTHDR_DATA_START bfd_h_put_32
#endif
/* Some fields in the scnhdr are sometimes 64 bits. */
#ifndef GET_SCNHDR_PADDR
#define GET_SCNHDR_PADDR bfd_h_get_32
#endif
#ifndef PUT_SCNHDR_PADDR
#define PUT_SCNHDR_PADDR bfd_h_put_32
#endif
#ifndef GET_SCNHDR_VADDR
#define GET_SCNHDR_VADDR bfd_h_get_32
#endif
#ifndef PUT_SCNHDR_VADDR
#define PUT_SCNHDR_VADDR bfd_h_put_32
#endif
#ifndef GET_SCNHDR_SIZE
#define GET_SCNHDR_SIZE bfd_h_get_32
#endif
#ifndef PUT_SCNHDR_SIZE
#define PUT_SCNHDR_SIZE bfd_h_put_32
#endif
#ifndef GET_SCNHDR_SCNPTR
#define GET_SCNHDR_SCNPTR bfd_h_get_32
#endif
#ifndef PUT_SCNHDR_SCNPTR
#define PUT_SCNHDR_SCNPTR bfd_h_put_32
#endif
#ifndef GET_SCNHDR_RELPTR
#define GET_SCNHDR_RELPTR bfd_h_get_32
#endif
#ifndef PUT_SCNHDR_RELPTR
#define PUT_SCNHDR_RELPTR bfd_h_put_32
#endif
#ifndef GET_SCNHDR_LNNOPTR
#define GET_SCNHDR_LNNOPTR bfd_h_get_32
#endif
#ifndef PUT_SCNHDR_LNNOPTR
#define PUT_SCNHDR_LNNOPTR bfd_h_put_32
#endif
/* These functions are architecture dependent, and are in peicode.h:
coff_swap_reloc_in
int coff_swap_reloc_out
coff_swap_filehdr_in
coff_swap_scnhdr_in
pe_mkobject
pe_mkobject_hook */
/* The functions described below are common across all PE/PEI
implementations architecture types, and actually appear in
peigen.c. */
void _bfd_pei_swap_sym_in PARAMS ((bfd*, PTR, PTR));
#define coff_swap_sym_in _bfd_pei_swap_sym_in
unsigned int _bfd_pei_swap_sym_out PARAMS ((bfd*, PTR, PTR));
#define coff_swap_sym_out _bfd_pei_swap_sym_out
void _bfd_pei_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR));
#define coff_swap_aux_in _bfd_pei_swap_aux_in
unsigned int _bfd_pei_swap_aux_out \
PARAMS ((bfd *, PTR, int, int, int, int, PTR));
#define coff_swap_aux_out _bfd_pei_swap_aux_out
void _bfd_pei_swap_lineno_in PARAMS ((bfd*, PTR, PTR));
#define coff_swap_lineno_in _bfd_pei_swap_lineno_in
unsigned int _bfd_pei_swap_lineno_out PARAMS ((bfd*, PTR, PTR));
#define coff_swap_lineno_out _bfd_pei_swap_lineno_out
void _bfd_pei_swap_aouthdr_in PARAMS ((bfd*, PTR, PTR));
#define coff_swap_aouthdr_in _bfd_pei_swap_aouthdr_in
unsigned int _bfd_pei_swap_aouthdr_out PARAMS ((bfd *, PTR, PTR));
#define coff_swap_aouthdr_out _bfd_pei_swap_aouthdr_out
unsigned int _bfd_pei_swap_scnhdr_out PARAMS ((bfd *, PTR, PTR));
#define coff_swap_scnhdr_out _bfd_pei_swap_scnhdr_out
boolean _bfd_pe_print_private_bfd_data_common PARAMS ((bfd *, PTR));
boolean _bfd_pe_bfd_copy_private_bfd_data_common PARAMS ((bfd*, bfd*));
/* The following are needed only for ONE of pe or pei, but don't
otherwise vary; peicode.h fixes up ifdefs but we provide the
prototype. */
unsigned int _bfd_pe_only_swap_filehdr_out PARAMS ((bfd*, PTR, PTR));
unsigned int _bfd_pei_only_swap_filehdr_out PARAMS ((bfd*, PTR, PTR));
boolean _bfd_pe_bfd_copy_private_section_data
PARAMS ((bfd *, asection *, bfd *, asection *));

File diff suppressed because it is too large Load diff

1810
bfd/peigen.c Normal file

File diff suppressed because it is too large Load diff