aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1995-08-17 22:53:56 +0000
committerSteve Chamberlain <sac@cygnus>1995-08-17 22:53:56 +0000
commiteb7f87c5c840602725dd013935eb6a558624f16a (patch)
tree312789d44a4d07287104c98d85f466165f021ff4
parented67cfa226fd66fb72d996b08eaf95cd229a2270 (diff)
downloadgdb-eb7f87c5c840602725dd013935eb6a558624f16a.zip
gdb-eb7f87c5c840602725dd013935eb6a558624f16a.tar.gz
gdb-eb7f87c5c840602725dd013935eb6a558624f16a.tar.bz2
Thu Aug 17 13:35:49 1995 steve chamberlain <sac@slash.cygnus.com>
* emultempl/{armpe.sc, i386pe.sc}: Deleted. * emultempl/pe.sc: New file performs generic PE support and sorts archive members. * emulparams/{armpe.sh,i386pe.sh}: Use new file. * scripttempl/{armpe.sc, i386pe.sc}: Deleted * scripttempl/pe.sc: New. * Makefile.in: Use new files. b
-rw-r--r--ld/ChangeLog11
-rw-r--r--ld/emulparams/armpe.sh5
-rw-r--r--ld/emultempl/.Sanitize3
-rw-r--r--ld/emultempl/armpe.em230
-rw-r--r--ld/emultempl/i386pe.em231
-rw-r--r--ld/scripttempl/.Sanitize3
-rw-r--r--ld/scripttempl/armpe.sc107
-rw-r--r--ld/scripttempl/pe.sc (renamed from ld/scripttempl/i386pe.sc)4
8 files changed, 20 insertions, 574 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 9e4f6cd..f0d18a3 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,14 @@
+Thu Aug 17 13:35:49 1995 steve chamberlain <sac@slash.cygnus.com>
+
+
+ * emultempl/{armpe.sc, i386pe.sc}: Deleted.
+ * emultempl/pe.sc: New file performs generic PE support and sorts
+ archive members.
+ * emulparams/{armpe.sh,i386pe.sh}: Use new file.
+ * scripttempl/{armpe.sc, i386pe.sc}: Deleted
+ * scripttempl/pe.sc: New.
+ * Makefile.in: Use new files.
+
Thu Aug 17 14:46:34 1995 Doug Evans <dje@canuck.cygnus.com>
* scripttempl/h8500s.sc (.rdata): All data must go in data segment.
diff --git a/ld/emulparams/armpe.sh b/ld/emulparams/armpe.sh
new file mode 100644
index 0000000..3903075
--- /dev/null
+++ b/ld/emulparams/armpe.sh
@@ -0,0 +1,5 @@
+ARCH=arm
+SCRIPT_NAME=pe
+OUTPUT_FORMAT="pei-arm-little"
+LITTLE_OUTPUT_FORMAT="pei-arm-little"
+BIG_OUTPUT_FORMAT="pei-arm-big"
diff --git a/ld/emultempl/.Sanitize b/ld/emultempl/.Sanitize
index c4c059f..e57e332 100644
--- a/ld/emultempl/.Sanitize
+++ b/ld/emultempl/.Sanitize
@@ -25,17 +25,16 @@ Do-first:
Things-to-keep:
README
-armpe.em
elf32.em
generic.em
gld960.em
gld960c.em
hppaelf.em
-i386pe.em
linux.em
lnk960.em
m88kbcs.em
mipsecoff.em
+pe.em
stringify.sed
sunos.em
vanilla.em
diff --git a/ld/emultempl/armpe.em b/ld/emultempl/armpe.em
deleted file mode 100644
index 4e29a0b..0000000
--- a/ld/emultempl/armpe.em
+++ /dev/null
@@ -1,230 +0,0 @@
-# This shell script emits a C file. -*- C -*-
-# It does some substitutions.
-cat >e${EMULATION_NAME}.c <<EOF
-/* For WINDOWS_NT */
-/* This file is a copy of ei385coff which was originally generated on a Linux
- system. It has been modified to provide a decent default script file
- for the NT PE format. */
-
-/* The original file generated returned different default scripts depending
- on whether certain switches were set, but these switches pertain to the
- Linux system and that particular version of coff. In the NT case, we
- only determine if the subsystem is console or windows in order to select
- the correct entry point by default. */
-
-
-/* emulate the original gld for the given armpe
- Copyright (C) 1991, 1993 Free Software Foundation, Inc.
- Written by Steve Chamberlain steve@cygnus.com
-
-This file is part of GLD, the Gnu Linker.
-
-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. */
-
-#define TARGET_IS_armpe
-
-#include "bfd.h"
-#include "sysdep.h"
-#include "bfdlink.h"
-
-#include "ld.h"
-#include "config.h"
-#include "ldmain.h"
-#include "ldemul.h"
-#include "ldfile.h"
-#include "ldmisc.h"
-
-static void gldarmpe_before_parse PARAMS ((void));
-static char *gldarmpe_get_script PARAMS ((int *isfile));
-
-static void
-gldarmpe_before_parse()
-{
-#ifndef TARGET_ /* I.e., if not generic. */
- ldfile_output_architecture = bfd_arch_arm;
-#endif /* not TARGET_ */
-}
-
-static char *
-gldarmpe_get_script(isfile)
- int *isfile;
-{
- *isfile = 0;
-
- if (link_info.subsystem == windows)
- return
-"OUTPUT_FORMAT(\"coff-arm\")\n\
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/arm-coff/lib);\n\
-ENTRY(_WinMainCRTStartup)\n\
-SECTIONS\n\
-{\n\
- .text 0x401000 : {\n\
- *(.text)\n\
- ;\n\
- }\n\
- .bss BLOCK(0x1000) :\n\
- { \n\
- *(.bss)\n\
- *(COMMON)\n\
- ;\n\
- }\n\
- .rdata BLOCK(0x1000) :\n\
- { \n\
- *(.rdata)\n\
- ;\n\
- }\n\
- .data BLOCK(0x1000) : {\n\
- *(.data)\n\
- *(.data2)\n\
- ;\n\
- }\n\
- .idata BLOCK(0x1000) :\n\
- { \n\
- *(.idata\$\2)\n\
- *(.idata\$\3)\n\
- *(.idata\$\4)\n\
- *(.idata\$\5)\n\
- *(.idata\$\6)\n\
- *(.idata\$\7)\n\
- ;\n\
- }\n\
- .CRT BLOCK(0x1000) :\n\
- { \n\
- *(".CRT\$XCA")\n\
- *(fucl .CRT\$XCC)\n\
- *(.CRT\$XCZ)\n\
- *(.CRT\$XIA)\n\
- *(.CRT\$XIC)\n\
- *(.CRT\$XIZ)\n\
- *(.CRT\$XLA)\n\
- *(.CRT\$XLZ)\n\
- *(.CRT\$XPA)\n\
- *(.CRT\$XPX)\n\
- *(.CRT\$XPZ)\n\
- *(.CRT\$XTA)\n\
- *(.CRT\$XTZ)\n\
- ;\n\
- }\n\
- .rsrc BLOCK(0x1000) :\n\
- { \n\
- *(.rsrc\$01)\n\
- *(.rsrc\$02)\n\
- ;\n\
- }\n\
- .reloc BLOCK(0x1000) :\n\
- { \n\
- *(.reloc)\n\
- ;\n\
- }\n\
- .junk BLOCK(0x1000) :\n\
- { \n\
- *(.debug\$S)\n\
- *(.debug\$T)\n\
- *(.debug\$F)\n\
- *(.drectve)\n\
- ;\n\
- }\n\
-}\n\n"
- ; else return
-"OUTPUT_FORMAT(\"coff-arm\")\n\
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/arm-coff/lib);\n\
-ENTRY(_mainCRTStartup)\n\
-SECTIONS\n\
-{\n\
- .text 0x401000 : {\n\
- *(.text)\n\
- ;\n\
- }\n\
- .bss BLOCK(0x1000) :\n\
- { \n\
- *(.bss)\n\
- *(COMMON)\n\
- ;\n\
- }\n\
- .rdata BLOCK(0x1000) :\n\
- { \n\
- *(.rdata)\n\
- ;\n\
- }\n\
- .data BLOCK(0x1000) : {\n\
- *(.data)\n\
- *(.data2)\n\
- ;\n\
- }\n\
- .idata BLOCK(0x1000) :\n\
- { \n\
- *(.idata\$\2)\n\
- *(.idata\$\3)\n\
- *(.idata\$\4)\n\
- *(.idata\$\5)\n\
- *(.idata\$\6)\n\
- *(.idata\$\7)\n\
- ;\n\
- }\n\
- .CRT BLOCK(0x1000) :\n\
- { \n\
- *(.CRT\$XCA)\n\
- *(.CRT\$XCC)\n\
- *(.CRT\$XCZ)\n\
- *(.CRT\$XIA)\n\
- *(.CRT\$XIC)\n\
- *(.CRT\$XIZ)\n\
- *(.CRT\$XLA)\n\
- *(.CRT\$XLZ)\n\
- *(.CRT\$XPA)\n\
- *(.CRT\$XPX)\n\
- *(.CRT\$XPZ)\n\
- *(.CRT\$XTA)\n\
- *(.CRT\$XTZ)\n\
- ;\n\
- }\n\
- .rsrc BLOCK(0x1000) :\n\
- { \n\
- *(.rsrc\$01)\n\
- *(.rsrc\$02)\n\
- ;\n\
- }\n\
- .reloc BLOCK(0x1000) :\n\
- { \n\
- *(.reloc)\n\
- ;\n\
- }\n\
- .junk BLOCK(0x1000) :\n\
- { \n\
- *(.debug\$S)\n\
- *(.debug\$T)\n\
- *(.debug\$F)\n\
- *(.drectve)\n\
- ;\n\
- }\n\
-}\n\n"
- ;
-}
-
-struct ld_emulation_xfer_struct ld_armpe_emulation =
-{
- gldarmpe_before_parse,
- syslib_default,
- hll_default,
- after_parse_default,
- after_allocation_default,
- set_output_arch_default,
- ldemul_default_target,
- before_allocation_default,
- gldarmpe_get_script,
- "armpe",
- "pei-arm"
-};
-EOF
diff --git a/ld/emultempl/i386pe.em b/ld/emultempl/i386pe.em
deleted file mode 100644
index 4b18cbd..0000000
--- a/ld/emultempl/i386pe.em
+++ /dev/null
@@ -1,231 +0,0 @@
-# This shell script emits a C file. -*- C -*-
-# It does some substitutions.
-cat >e${EMULATION_NAME}.c <<EOF
-/* For WINDOWS_NT */
-/* This file is a copy of ei385coff which was originally generated on a Linux
- system. It has been modified to provide a decent default script file
- for the NT PE format. */
-
-/* The original file generated returned different default scripts depending
- on whether certain switches were set, but these switches pertain to the
- Linux system and that particular version of coff. In the NT case, we
- only determine if the subsystem is console or windows in order to select
- the correct entry point by default. */
-
-
-/* emulate the original gld for the given i386pe
- Copyright (C) 1991, 1993 Free Software Foundation, Inc.
- Written by Steve Chamberlain steve@cygnus.com
-
-This file is part of GLD, the Gnu Linker.
-
-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. */
-
-#define TARGET_IS_i386pe
-
-#include "bfd.h"
-#include "sysdep.h"
-#include "bfdlink.h"
-
-#include "ld.h"
-#include "config.h"
-#include "ldmain.h"
-#include "ldemul.h"
-#include "ldfile.h"
-#include "ldmisc.h"
-
-static void gldi386pe_before_parse PARAMS ((void));
-static char *gldi386pe_get_script PARAMS ((int *isfile));
-
-static void
-gldi386pe_before_parse()
-{
-#ifndef TARGET_ /* I.e., if not generic. */
- ldfile_output_architecture = bfd_arch_i386;
-#endif /* not TARGET_ */
-}
-
-static char *
-gldi386pe_get_script(isfile)
- int *isfile;
-{
- *isfile = 0;
-
- if (link_info.subsystem == windows)
- return
-"OUTPUT_FORMAT(\"coff-i386\")\n\
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/i386-coff/lib);\n\
-ENTRY(_WinMainCRTStartup)\n\
-SECTIONS\n\
-{\n\
- .text 0x401000 : {\n\
- *(.text)\n\
- ;\n\
- }\n\
- .bss BLOCK(0x1000) :\n\
- { \n\
- *(.bss)\n\
- *(COMMON)\n\
- ;\n\
- }\n\
- .rdata BLOCK(0x1000) :\n\
- { \n\
- *(.rdata)\n\
- ;\n\
- }\n\
- .data BLOCK(0x1000) : {\n\
- *(.data)\n\
- *(.data2)\n\
- ;\n\
- }\n\
- .idata BLOCK(0x1000) :\n\
- { \n\
- *(.idata$2)\n\
- *(.idata$3)\n\
- *(.idata$4)\n\
- *(.idata$5)\n\
- *(.idata$6)\n\
- *(.idata$7)\n\
- ;\n\
- }\n\
- .CRT BLOCK(0x1000) :\n\
- { \n\
- *(.CRT$XCA)\n\
- *(.CRT$XCC)\n\
- *(.CRT$XCZ)\n\
- *(.CRT$XIA)\n\
- *(.CRT$XIC)\n\
- *(.CRT$XIZ)\n\
- *(.CRT$XLA)\n\
- *(.CRT$XLZ)\n\
- *(.CRT$XPA)\n\
- *(.CRT$XPX)\n\
- *(.CRT$XPZ)\n\
- *(.CRT$XTA)\n\
- *(.CRT$XTZ)\n\
- ;\n\
- }\n\
- .rsrc BLOCK(0x1000) :\n\
- { \n\
- *(.rsrc$01)\n\
- *(.rsrc$02)\n\
- ;\n\
- }\n\
- .reloc BLOCK(0x1000) :\n\
- { \n\
- *(.reloc)\n\
- ;\n\
- }\n\
- .junk BLOCK(0x1000) :\n\
- { \n\
- *(.debug$S)\n\
- *(.debug$T)\n\
- *(.debug$F)\n\
- *(.drectve)\n\
- ;\n\
- }\n\
-}\n\n"
- ; else return
-"OUTPUT_FORMAT(\"coff-i386\")\n\
-SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/i386-coff/lib);\n\
-ENTRY(_mainCRTStartup)\n\
-SECTIONS\n\
-{\n\
- .text 0x401000 : {\n\
- *(.text)\n\
- ;\n\
- }\n\
- .bss BLOCK(0x1000) :\n\
- { \n\
- *(.bss)\n\
- *(COMMON)\n\
- ;\n\
- }\n\
- .rdata BLOCK(0x1000) :\n\
- { \n\
- *(.rdata)\n\
- ;\n\
- }\n\
- .data BLOCK(0x1000) : {\n\
- *(.data)\n\
- *(.data2)\n\
- ;\n\
- }\n\
- .idata BLOCK(0x1000) :\n\
- { \n\
- *(.idata$2)\n\
- *(.idata$3)\n\
- *(.idata$4)\n\
- *(.idata$5)\n\
- *(.idata$6)\n\
- *(.idata$7)\n\
- ;\n\
- }\n\
- .CRT BLOCK(0x1000) :\n\
- { \n\
- *(.CRT$XCA)\n\
- *(.CRT$XCC)\n\
- *(.CRT$XCZ)\n\
- *(.CRT$XIA)\n\
- *(.CRT$XIC)\n\
- *(.CRT$XIZ)\n\
- *(.CRT$XLA)\n\
- *(.CRT$XLZ)\n\
- *(.CRT$XPA)\n\
- *(.CRT$XPX)\n\
- *(.CRT$XPZ)\n\
- *(.CRT$XTA)\n\
- *(.CRT$XTZ)\n\
- ;\n\
- }\n\
- .rsrc BLOCK(0x1000) :\n\
- { \n\
- *(.rsrc$01)\n\
- *(.rsrc$02)\n\
- ;\n\
- }\n\
- .reloc BLOCK(0x1000) :\n\
- { \n\
- *(.reloc)\n\
- ;\n\
- }\n\
- .junk BLOCK(0x1000) :\n\
- { \n\
- *(.debug$S)\n\
- *(.debug$T)\n\
- *(.debug$F)\n\
- *(.drectve)\n\
- ;\n\
- }\n\
-}\n\n"
- ;
-}
-
-struct ld_emulation_xfer_struct ld_i386pe_emulation =
-{
- gldi386pe_before_parse,
- syslib_default,
- hll_default,
- after_parse_default,
- after_allocation_default,
- set_output_arch_default,
- ldemul_default_target,
- before_allocation_default,
- gldi386pe_get_script,
- "i386pe",
- "pe-i386"
-};
-EOF
-
diff --git a/ld/scripttempl/.Sanitize b/ld/scripttempl/.Sanitize
index 0cb1172..dfdada5 100644
--- a/ld/scripttempl/.Sanitize
+++ b/ld/scripttempl/.Sanitize
@@ -34,7 +34,6 @@ Things-to-keep:
README
a29k.sc
alpha.sc
-armpe.sc
armaout.sc
aout.sc
ebmon29k.sc
@@ -50,7 +49,6 @@ h8500m.sc
h8500s.sc
hppaelf.sc
i386coff.sc
-i386pe.sc
i386go32.sc
i386lynx.sc
i386msdos.sc
@@ -61,6 +59,7 @@ m88kbcs.sc
mips.sc
mipsbsd.sc
nw.sc
+pe.sc
riscix.sc
sa29200.sc
sh.sc
diff --git a/ld/scripttempl/armpe.sc b/ld/scripttempl/armpe.sc
deleted file mode 100644
index 2f642ac..0000000
--- a/ld/scripttempl/armpe.sc
+++ /dev/null
@@ -1,107 +0,0 @@
-# Linker script for ARM PE.
-# These are substituted in as variables in order to get '}' in a shell
-# conditional expansion.
-INIT='.init : { *(.init) }'
-FINI='.fini : { *(.fini) }'
-cat <<EOF
-OUTPUT_FORMAT($OUTPUT_FORMAT)
-${LIB_SEARCH_DIRS}
-
-ENTRY(_mainCRTStartup)
-
-SECTIONS
-{
- .text 0x401000 :
- {
- ${RELOCATING+ *(.init);}
- *(.text)
- ${RELOCATING+ *(.fini);}
- ${RELOCATING+ etext = .};
- }
-
-
- .rdata BLOCK(0x1000) :
- {
- *(.rdata)
- ${CONSTRUCTING+ __CTOR_LIST__ = .; LONG (-1); *(.ctors); LONG (0); }
- ${CONSTRUCTING+ __DTOR_LIST__ = .; LONG (-1); *(.dtors); LONG (0); }
- ;
- }
- .data BLOCK(0x1000) : {
- *(.data)
- *(.data2)
- ;
- }
- .idata BLOCK(0x1000) :
- {
- *(.idata\$2)
- *(.idata\$3)
- *(.idata\$4)
- *(.idata\$5)
- *(.idata\$6)
- *(.idata\$7)
- ;
- }
-
- .CRT BLOCK(0x1000) :
- {
- *(.CRT\$XCA)
- *(.CRT\$XCC)
- *(.CRT\$XCZ)
- *(.CRT\$XIA)
- *(.CRT\$XIC)
- *(.CRT\$XIZ)
- *(.CRT\$XLA)
- *(.CRT\$XLZ)
- *(.CRT\$XPA)
- *(.CRT\$XPX)
- *(.CRT\$XPZ)
- *(.CRT\$XTA)
- *(.CRT\$XTZ)
- ;
- }
- .rsrc BLOCK(0x1000) :
- {
- *(.rsrc\$01)
- *(.rsrc\$02)
- ;
- }
- .reloc BLOCK(0x1000) :
- {
- *(.reloc)
- ;
- }
-
- .drectve BLOCK (0x1000) :
- {
- ${RELOCATING+ *(.drectve); }
- }
- .junk BLOCK(0x1000) :
- {
- *(.debug\$S)
- *(.debug\$T)
- *(.debug\$F)
- ;
- }
-
-
- .bss BLOCK(0x1000) :
- {
- *(.bss)
- *(COMMON);
- end = . ;
- }
-
- .stab 0 :
- {
- [ .stab ]
- }
-
- .stabstr 0 :
- {
- [ .stabstr ]
- }
-
-${RELOCATING+ stack = 0x800000 ;}
-}
-EOF
diff --git a/ld/scripttempl/i386pe.sc b/ld/scripttempl/pe.sc
index 4219736..cc9e78e 100644
--- a/ld/scripttempl/i386pe.sc
+++ b/ld/scripttempl/pe.sc
@@ -1,10 +1,10 @@
-# Linker script for 386 PE.
+# Linker script for PE.
# These are substituted in as variables in order to get '}' in a shell
# conditional expansion.
INIT='.init : { *(.init) }'
FINI='.fini : { *(.fini) }'
cat <<EOF
-OUTPUT_FORMAT(pei-i386)
+OUTPUT_FORMAT(${OUTPUT_FORMAT})
${LIB_SEARCH_DIRS}
ENTRY(_mainCRTStartup)