From 3f38a017be911b803f3a06d86dc77db6ccecc9f0 Mon Sep 17 00:00:00 2001 From: Steve Chamberlain Date: Fri, 12 May 1995 18:55:06 +0000 Subject: [PATCH] Fri May 12 11:03:55 1995 Steve Chamberlain Tom Griest Initial support for PE executables (eg NT, win32) * Makefile.in (configure.in, ei386pe): Add support. * ldmain.c (main): Initialize PE argument info. * ldwrite.c (print_file_stuff): Don't print out .drectve and .debug section info. * lexsup.c (set_subsystem, set_stack_heap, OPTION_HEAP, OPTION_SUBSYSTEM, parse_argsm set_subsystem, set_stack_heap): Handle new arguments. * config/i386-pe.mt, emultempl/i386pe.em, scripttempl/i386pe.sc: New files --- ld/config/.Sanitize | 17 +-- ld/config/i386-pe.mt | 1 + ld/emulparams/.Sanitize | 5 +- ld/emulparams/i386pe.sh | 3 + ld/emultempl/.Sanitize | 3 +- ld/emultempl/i386pe.em | 230 +++++++++++++++++++++++++++++++++++++++ ld/ldlang.c | 23 ++++ ld/scripttempl/.Sanitize | 1 + ld/scripttempl/i386pe.sc | 95 ++++++++++++++++ 9 files changed, 367 insertions(+), 11 deletions(-) create mode 100644 ld/config/i386-pe.mt create mode 100644 ld/emulparams/i386pe.sh create mode 100644 ld/emultempl/i386pe.em create mode 100644 ld/scripttempl/i386pe.sc diff --git a/ld/config/.Sanitize b/ld/config/.Sanitize index b83a01e9b3c..d0e688cc06e 100644 --- a/ld/config/.Sanitize +++ b/ld/config/.Sanitize @@ -41,17 +41,18 @@ Things-to-keep: alpha.mt alphaosf.mh +cf-h8300h.mt coff-a29k.mt coff-h8300.mt -cf-h8300h.mt coff-h8500.mt coff-sh.mt coff-sparc.mt +coff-w65.mt delta88.mh dgux.mh ebmon29k.mt -go32.mt go32.mh +go32.mt hp300.mh hp300bsd.mt hp300hpux.mt @@ -70,6 +71,7 @@ i386-lynx.mt i386-mach.mt i386-nbsd.mt i386-nw.mt +i386-pe.mt i386bsd.mh i386linux.mh i386lynx.mh @@ -82,21 +84,21 @@ i960coff.mt ieee-h8300.mt irix4.mh m68k-coff.mt -m68k.mt m68k-elf.mt m68k-lynx.mt m68k-nbsd.mt +m68k.mt m68klynx.mh m68kv.mt m88k-bcs.mt -mipsbsd.mh -mipsbsd.mt mips-big.mt mips-idt.mt +mips-lit.mt mipsb-elf32.mt +mipsbsd.mh +mipsbsd.mt mipsl-elf32.mt mipsl-idt.mt -mips-lit.mt news.mt ns32k-nbsd.mt ose68.mt @@ -108,10 +110,10 @@ riscix.mt rtbsd.mh sa29200.mt solaris2.mh -sparc64-elf.mt sparc-ll.mh sparc-lynx.mt sparc-nbsd.mt +sparc64-elf.mt st2000.mt sun3.mh sun3.mt @@ -121,7 +123,6 @@ vax.mt vsta.mt vxworks68.mt z8ksim.mt -coff-w65.mt Things-to-lose: diff --git a/ld/config/i386-pe.mt b/ld/config/i386-pe.mt new file mode 100644 index 00000000000..10d7f8374b3 --- /dev/null +++ b/ld/config/i386-pe.mt @@ -0,0 +1 @@ +EMUL=i386pe diff --git a/ld/emulparams/.Sanitize b/ld/emulparams/.Sanitize index b17b1afda59..326cd9f5d46 100644 --- a/ld/emulparams/.Sanitize +++ b/ld/emulparams/.Sanitize @@ -45,10 +45,10 @@ alpha.sh coff_sparc.sh ebmon29k.sh elf32_sparc.sh -elf64_sparc.sh elf32bmip.sh elf32lmip.sh elf32ppc.sh +elf64_sparc.sh elf32ppcle.sh elf_i386.sh gld960.sh @@ -59,8 +59,8 @@ h8300h.sh h8500.sh h8500b.sh h8500c.sh -h8500s.sh h8500m.sh +h8500s.sh hp300bsd.sh hp3hpux.sh hppaelf.sh @@ -73,6 +73,7 @@ i386lynx.sh i386mach.sh i386nbsd.sh i386nw.sh +i386pe.sh lnk960.sh m68kaout.sh m68kcoff.sh diff --git a/ld/emulparams/i386pe.sh b/ld/emulparams/i386pe.sh new file mode 100644 index 00000000000..df2e9d8dc77 --- /dev/null +++ b/ld/emulparams/i386pe.sh @@ -0,0 +1,3 @@ +ARCH=i386 +SCRIPT_NAME=i386pe +OUTPUT_FORMAT="pe-i386" diff --git a/ld/emultempl/.Sanitize b/ld/emultempl/.Sanitize index 8080c6896b8..e86e2044937 100644 --- a/ld/emultempl/.Sanitize +++ b/ld/emultempl/.Sanitize @@ -25,16 +25,17 @@ Do-first: Things-to-keep: README -stringify.sed elf32.em generic.em gld960.em gld960c.em hppaelf.em +i386pe.em linux.em lnk960.em m88kbcs.em mipsecoff.em +stringify.sed sunos.em vanilla.em diff --git a/ld/emultempl/i386pe.em b/ld/emultempl/i386pe.em new file mode 100644 index 00000000000..a27ed40b698 --- /dev/null +++ b/ld/emultempl/i386pe.em @@ -0,0 +1,230 @@ +# This shell script emits a C file. -*- C -*- +# It does some substitutions. +cat >e${EMULATION_NAME}.c <