aboutsummaryrefslogtreecommitdiff
path: root/ld/scripttempl
diff options
context:
space:
mode:
authorDavid MacKenzie <djm@cygnus>1993-06-17 20:55:43 +0000
committerDavid MacKenzie <djm@cygnus>1993-06-17 20:55:43 +0000
commit8ddef5528d34f05ff9a492e23b15ef5c6c8eb5fb (patch)
treef921e9cedac5cd479f9954d6b30598061db2e93d /ld/scripttempl
parent21cc14d8505ad50143ea248c0de12bfa9eecf1e7 (diff)
downloadgdb-8ddef5528d34f05ff9a492e23b15ef5c6c8eb5fb.zip
gdb-8ddef5528d34f05ff9a492e23b15ef5c6c8eb5fb.tar.gz
gdb-8ddef5528d34f05ff9a492e23b15ef5c6c8eb5fb.tar.bz2
* ldfile.c (ldfile_open_command): Don't try .ld extension.
It wasn't documented (or likely used) and wastes time. (try_open): If EXTEN is empty, don't try it. * ldctor.c, lderror.c, ldexp.c, ldfile.c, ldindr.c, ldlang.c, ldlex.l, ldmain.c, ldmisc.c, ldsym.c, ldver.c, ldwarn.c, ldwrite.c, lexsup.c, mri.c, relax.c: Replace DEFUN macro calls with normal function declarations. * Move *.em to emultempl/*.em. Move *.sh to emulparams/*.sh. Move *.sc-sh to scripttempl/*.sc. * {emultempl,emulparams,scripttempl}/README: New files. * sh.em, st2000.em, z8ksim.em, h8300hms.em, h8500hms.em: Files removed, replaced with generic.em. * h8300.sh, h8500.sh, h8300.sc, h8500.sc: Renamed from h8[35]00hms.s[ch]. Change their contents to omit the "hms". * *.em (*_get_script): Return script name instead of script contents. * ldlang.c (lang_process): Change caller. * ldlex.l, ldgram.y: Recognize -m option. Check for input files after *all* options in grammar. * ldmain.c (main): Check for -m options. Add default directory for -m. * mkscript.c: File removed. * genscripts.sh: Take two more parameters, tooldirlib and libdir, to add to the default LIB_PATH. Look for input files in the new subdirectories. Create the scripts in emulations subdirectory and don't filter them through mkscript. * configure.in: Make the emulations subdirectory. * Makefile.in: Account for all of the above changes. Remove unused .SUFFIXES. Get libgcc.a path with gcc -print-libgcc-file-name instead of $(libdir)/libgcc.a. Put CFLAGS last in the compilation rules. Add -I../bfd to INCLUDES so sysdep.h is found. * ldfile.c (try_open): If opening without the extension fails, try with the extension even if -v or -V was given. had_script is imported (from ldgram.y), not exported.
Diffstat (limited to 'ld/scripttempl')
-rw-r--r--ld/scripttempl/.Sanitize53
-rw-r--r--ld/scripttempl/README4
-rw-r--r--ld/scripttempl/a29k.sc38
-rw-r--r--ld/scripttempl/ebmon29k.sc27
-rw-r--r--ld/scripttempl/h8500.sc43
-rw-r--r--ld/scripttempl/hppaosf.sc29
-rw-r--r--ld/scripttempl/i386coff.sc29
-rw-r--r--ld/scripttempl/i960.sc23
-rw-r--r--ld/scripttempl/mips.sc56
-rw-r--r--ld/scripttempl/mipsbsd.sc28
-rw-r--r--ld/scripttempl/sa29200.sc44
-rw-r--r--ld/scripttempl/sh.sc39
-rw-r--r--ld/scripttempl/st2000.sc26
-rw-r--r--ld/scripttempl/vanilla.sc1
-rw-r--r--ld/scripttempl/z8ksim.sc26
15 files changed, 466 insertions, 0 deletions
diff --git a/ld/scripttempl/.Sanitize b/ld/scripttempl/.Sanitize
new file mode 100644
index 0000000..01a4fd7
--- /dev/null
+++ b/ld/scripttempl/.Sanitize
@@ -0,0 +1,53 @@
+# .Sanitize for devo/ld/config
+
+# Each directory to survive its way into a release will need a file
+# like this one called "./.Sanitize". All keyword lines must exist,
+# and must exist in the order specified by this file. Each directory
+# in the tree will be processed, top down, in the following order.
+
+# Hash started lines like this one are comments and will be deleted
+# before anything else is done. Blank lines will also be squashed
+# out.
+
+# The lines between the "Do-first:" line and the "Things-to-keep:"
+# line are executed as a /bin/sh shell script before anything else is
+# done in this directory.
+
+Do-first:
+
+
+# All files listed between the "Things-to-keep:" line and the
+# "Do-last:" line will be kept. All other files will be removed.
+# Directories listed in this section will have their own Sanitize
+# called. Directories not listed will be removed in their entirety
+# with rm -rf.
+
+Things-to-keep:
+
+README
+a29k.sc
+aout.sc
+ebmon29k.sc
+h8300.sc
+h8500.sc
+hppaosf.sc
+i386coff.sc
+i960.sc
+m68kcoff.sc
+m88kbcs.sc
+mips.sc
+mipsbsd.sc
+sa29200.sc
+sh.sc
+st2000.sc
+vanilla.sc
+z8ksim.sc
+
+Things-to-lose:
+
+# The lines between the "Do-last:" line and the end of the file
+# are executed as a /bin/sh shell script after everything else is
+# done.
+
+Do-last:
+
diff --git a/ld/scripttempl/README b/ld/scripttempl/README
new file mode 100644
index 0000000..26ad2e9
--- /dev/null
+++ b/ld/scripttempl/README
@@ -0,0 +1,4 @@
+The files in this directory are linker script templates.
+genscripts.sh sets some shell variables, then sources
+EMULATION.sc, to generate EMULATION.{x,xr,xu,xn,xbn} -- the script
+files for default, -r, -Ur, -n, -N.
diff --git a/ld/scripttempl/a29k.sc b/ld/scripttempl/a29k.sc
new file mode 100644
index 0000000..a43a5eb
--- /dev/null
+++ b/ld/scripttempl/a29k.sc
@@ -0,0 +1,38 @@
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+INPUT(/lab3/u3/sym1/tools/usr/lib/segments.o) /* Has .rstack/.mstack */
+${LIB_SEARCH_DIRS}
+
+MEMORY {
+ text : ORIGIN = 0x1000000, LENGTH = 0x1000000
+ talias : ORIGIN = 0x2000000, LENGTH = 0x1000000
+ data : ORIGIN = 0x3000000, LENGTH = 0x1000000
+ mstack : ORIGIN = 0x4000000, LENGTH = 0x1000000
+ rstack : ORIGIN = 0x5000000, LENGTH = 0x1000000
+}
+SECTIONS
+{
+ .text : {
+ *(.text)
+ ${RELOCATING+ __etext = .};
+ *(.lit)
+ *(.shdata)
+ } ${RELOCATING+ > text}
+ .shbss SIZEOF(.text) + ADDR(.text) : {
+ *(.shbss)
+ }
+ .talias : { } ${RELOCATING+ > talias}
+ .data : {
+ *(.data)
+ ${RELOCATING+ __edata = .};
+ } ${RELOCATING+ > data}
+ .bss SIZEOF(.data) + ADDR(.data) :
+ {
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ __end = ALIGN(0x8)};
+ }
+ .mstack : { } ${RELOCATING+ > mstack}
+ .rstack : { } ${RELOCATING+ > rstack}
+}
+EOF
diff --git a/ld/scripttempl/ebmon29k.sc b/ld/scripttempl/ebmon29k.sc
new file mode 100644
index 0000000..62050ee
--- /dev/null
+++ b/ld/scripttempl/ebmon29k.sc
@@ -0,0 +1,27 @@
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+ENTRY(start)
+
+SECTIONS {
+ .text ${RELOCATING+${TEXT_START_ADDR}} :
+ {
+ *(.text);
+ ${RELOCATING+_etext = .};
+ }
+ data ${RELOCATING+0x80002000} :
+ {
+ *(.data);
+ *(.mstack);
+ *(.shbss);
+ *(.rstack);
+ *(.mstack);
+ ${CONSTRUCTING+CONSTRUCTORS}
+ }
+ .bss . :
+ {
+ *(COMMON)
+ *(.bss);
+ ${RELOCATING+_end = .};
+ }
+}
+EOF
diff --git a/ld/scripttempl/h8500.sc b/ld/scripttempl/h8500.sc
new file mode 100644
index 0000000..ed2d44f
--- /dev/null
+++ b/ld/scripttempl/h8500.sc
@@ -0,0 +1,43 @@
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH(${ARCH})
+
+MEMORY {
+ rom : o = 0x0000, l = 0x7fe0
+ duart : o = 0x7fe0, l = 16
+ ram : o = 0x8000, l = 28k
+ topram : o = 0x8000+28k, l = 1k
+ hmsram : o = 0xfb80, l = 512
+ }
+
+SECTIONS
+{
+.text :
+ {
+ *(.text)
+ *(.strings)
+ ${RELOCATING+ _etext = . ; }
+ } ${RELOCATING+ > ram}
+.data :
+ {
+ *(.data)
+ ${RELOCATING+ _edata = . ; }
+ } ${RELOCATING+ > ram}
+.bss :
+ {
+ ${RELOCATING+ _bss_start = . ;}
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ _end = . ; }
+ } ${RELOCATING+ >ram}
+.stack :
+ {
+ ${RELOCATING+ _stack = . ; }
+ *(.stack)
+ } ${RELOCATING+ > topram}
+}
+EOF
+
+
+
+
diff --git a/ld/scripttempl/hppaosf.sc b/ld/scripttempl/hppaosf.sc
new file mode 100644
index 0000000..30e3c6e
--- /dev/null
+++ b/ld/scripttempl/hppaosf.sc
@@ -0,0 +1,29 @@
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH(${ARCH})
+ENTRY("\$START\$")
+${RELOCATING+${LIB_SEARCH_DIRS}}
+SECTIONS
+{
+ .text ${RELOCATING+${TEXT_START_ADDR}}:
+ {
+ ${RELOCATING+__text_start = .};
+ CREATE_OBJECT_SYMBOLS
+ *(.text)
+ }
+ .data ${RELOCATING+ 0x40000000 } :
+ {
+ ${RELOCATING+__data_start = .};
+ ${RELOCATING+ . = . + 0x1000 };
+ *(.data)
+ ${CONSTRUCTING+CONSTRUCTORS}
+ }
+ .bss ${RELOCATING+SIZEOF(.data) + ADDR(.data)} :
+ {
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+_end = . };
+ ${RELOCATING+__end = . };
+ }
+}
+EOF
diff --git a/ld/scripttempl/i386coff.sc b/ld/scripttempl/i386coff.sc
new file mode 100644
index 0000000..d18fd24
--- /dev/null
+++ b/ld/scripttempl/i386coff.sc
@@ -0,0 +1,29 @@
+# Linker script for 386 COFF. This works on SVR3.2 and SCO Unix 3.2.2.
+# .data2 handles SCO, which uses two data sections.
+# Ian Taylor <ian@cygnus.com>.
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+${LIB_SEARCH_DIRS}
+
+ENTRY(_start)
+
+SECTIONS
+{
+ .text ${RELOCATING+ SIZEOF_HEADERS} : {
+ *(.init)
+ *(.text)
+ *(.fini)
+ ${RELOCATING+ etext = .};
+ }
+ .data ${RELOCATING+ 0x400000 + (. & 0xffc00fff)} : {
+ *(.data .data2)
+ ${RELOCATING+ edata = .};
+ }
+ .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
+ {
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ end = .};
+ }
+}
+EOF
diff --git a/ld/scripttempl/i960.sc b/ld/scripttempl/i960.sc
new file mode 100644
index 0000000..ed8ba8b
--- /dev/null
+++ b/ld/scripttempl/i960.sc
@@ -0,0 +1,23 @@
+cat <<EOF
+SECTIONS
+{
+ .text :
+ {
+ ${GLD_STYLE+ CREATE_OBJECT_SYMBOLS}
+ *(.text)
+ ${RELOCATING+ _etext = .};
+ }
+ .data SIZEOF(.text) + ADDR(.text):
+ {
+ *(.data)
+ ${RELOCATING+ _edata = .};
+ }
+ .bss SIZEOF(.data) + ADDR(.data):
+ {
+ ${RELOCATING+ _bss_start = .};
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ _end = .};
+ }
+}
+EOF
diff --git a/ld/scripttempl/mips.sc b/ld/scripttempl/mips.sc
new file mode 100644
index 0000000..0926db5
--- /dev/null
+++ b/ld/scripttempl/mips.sc
@@ -0,0 +1,56 @@
+# Linker script for MIPS systems.
+# Ian Lance Taylor <ian@cygnus.com>.
+# These variables may be overridden by the emulation file. The
+# defaults are appropriate for a DECstation running Ultrix.
+test -z "$ENTRY" && ENTRY=__start
+test -z "$TEXT_START_ADDR" && TEXT_START_ADDR="0x400000 + SIZEOF_HEADERS"
+test -z "$DATA_ADDR" && DATA_ADDR=0x10000000
+test -z "$BSS_VAR" && BSS_VAR=
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+${LIB_SEARCH_DIRS}
+
+ENTRY(${ENTRY})
+
+SECTIONS
+{
+ .text ${RELOCATING+ ${TEXT_START_ADDR}} : {
+ *(.init)
+ ${RELOCATING+ eprol = .};
+ *(.text)
+ *(.fini)
+ ${RELOCATING+ etext = .};
+ ${RELOCATING+ _etext = .};
+ }
+ .rdata ${RELOCATING+ ${DATA_ADDR}} : {
+ *(.rdata)
+ }
+ .data ${RELOCATING+ .} : {
+ *(.data)
+ ${CONSTRUCTING+CONSTRUCTORS}
+ }
+ ${RELOCATING+ _gp = . + 0x8000;}
+ .lit8 ${RELOCATING+ .} : {
+ *(.lit8)
+ }
+ .lit4 ${RELOCATING+ .} : {
+ *(.lit4)
+ }
+ .sdata ${RELOCATING+ .} : {
+ *(.sdata)
+ }
+ ${RELOCATING+ edata = .;}
+ ${RELOCATING+ _edata = .;}
+ ${RELOCATING+ ${BSS_VAR}}
+ .sbss ${RELOCATING+ .} : {
+ *(.sbss)
+ *(.scommon)
+ }
+ .bss ${RELOCATING+ .} : {
+ *(.bss)
+ *(COMMON)
+ }
+ ${RELOCATING+ end = .;}
+ ${RELOCATING+ _end = .;}
+}
+EOF
diff --git a/ld/scripttempl/mipsbsd.sc b/ld/scripttempl/mipsbsd.sc
new file mode 100644
index 0000000..6875794
--- /dev/null
+++ b/ld/scripttempl/mipsbsd.sc
@@ -0,0 +1,28 @@
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH(${ARCH})
+
+${RELOCATING+${LIB_SEARCH_DIRS}}
+${RELOCATING+__DYNAMIC = 0;}
+SECTIONS
+{
+ .text ${RELOCATING+${TEXT_START_ADDR}}:
+ {
+ CREATE_OBJECT_SYMBOLS
+ *(.text)
+ ${RELOCATING+etext = ${DATA_ALIGNMENT};}
+ }
+ .data ${RELOCATING+${DATA_ALIGNMENT}} :
+ {
+ *(.data)
+ ${CONSTRUCTING+CONSTRUCTORS}
+ ${RELOCATING+edata = .;}
+ }
+ .bss ${RELOCATING+SIZEOF(.data) + ADDR(.data)} :
+ {
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+end = . };
+ }
+}
+EOF
diff --git a/ld/scripttempl/sa29200.sc b/ld/scripttempl/sa29200.sc
new file mode 100644
index 0000000..6526614
--- /dev/null
+++ b/ld/scripttempl/sa29200.sc
@@ -0,0 +1,44 @@
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+ENTRY(start)
+
+SECTIONS {
+ .text ${RELOCATING+${TEXT_START_ADDR}} :
+ {
+ *(.text);
+ *(.text1);
+ *(.text2);
+ ${RELOCATING+_etext = .};
+ }
+ .lit . :
+ {
+ *(.lit);
+ ${RELOCATING+_elit = .};
+ }
+ .data . :
+ {
+ *(.data);
+ *(.data1);
+ *(.data2);
+ ${RELOCATING+_edata = .};
+ ${CONSTRUCTING+CONSTRUCTORS}
+ ${CONSTRUCTING+ ___CTOR_LIST__ = .;}
+ ${CONSTRUCTING+ LONG((___CTOR_END__ - ___CTOR_LIST__) / 4 - 2)}
+ *(.ctors)
+ ${CONSTRUCTING+ LONG(0)}
+ ${CONSTRUCTING+ ___CTOR_END__ = .;}
+ ${CONSTRUCTING+ ___DTOR_LIST__ = .;}
+ ${CONSTRUCTING+ LONG((___DTOR_END__ - ___DTOR_LIST__) / 4 - 2)}
+ *(.dtors)
+ ${CONSTRUCTING+ LONG(0)}
+ ${CONSTRUCTING+ ___DTOR_END__ = .;}
+ }
+
+ .bss . :
+ {
+ *(COMMON)
+ *(.bss)
+ ${RELOCATING+_end = .};
+ }
+}
+EOF
diff --git a/ld/scripttempl/sh.sc b/ld/scripttempl/sh.sc
new file mode 100644
index 0000000..b941359
--- /dev/null
+++ b/ld/scripttempl/sh.sc
@@ -0,0 +1,39 @@
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH(${ARCH})
+
+MEMORY {
+ ram : o = 0x1000, l = 512k
+ }
+
+SECTIONS
+{
+.text :
+ {
+ *(.text)
+ *(.strings)
+ ${RELOCATING+ _etext = . ; }
+ } ${RELOCATING+ > ram}
+.data :
+ {
+ *(.data)
+ ${RELOCATING+ _edata = . ; }
+ } ${RELOCATING+ > ram}
+.bss :
+ {
+ ${RELOCATING+ _bss_start = . ;}
+ *(.bss)
+ *(COMMON)
+ ${RELOCATING+ _end = . ; }
+ } ${RELOCATING+ >ram}
+.stack :
+ {
+ ${RELOCATING+ _stack = . ; }
+ *(.stack)
+ } ${RELOCATING+ > ram}
+}
+EOF
+
+
+
+
diff --git a/ld/scripttempl/st2000.sc b/ld/scripttempl/st2000.sc
new file mode 100644
index 0000000..7ee132a
--- /dev/null
+++ b/ld/scripttempl/st2000.sc
@@ -0,0 +1,26 @@
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH(${ARCH})
+
+
+SECTIONS
+{
+.text :
+ {
+ *(.text)
+ *(.strings)
+ _etext = .;
+ *(.data)
+ _edata = .;
+ *(.bss)
+ *(COMMON)
+ _end = .;
+
+}
+
+}
+EOF
+
+
+
+
diff --git a/ld/scripttempl/vanilla.sc b/ld/scripttempl/vanilla.sc
new file mode 100644
index 0000000..1798480
--- /dev/null
+++ b/ld/scripttempl/vanilla.sc
@@ -0,0 +1 @@
+# Nothing to do.
diff --git a/ld/scripttempl/z8ksim.sc b/ld/scripttempl/z8ksim.sc
new file mode 100644
index 0000000..7ee132a
--- /dev/null
+++ b/ld/scripttempl/z8ksim.sc
@@ -0,0 +1,26 @@
+cat <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH(${ARCH})
+
+
+SECTIONS
+{
+.text :
+ {
+ *(.text)
+ *(.strings)
+ _etext = .;
+ *(.data)
+ _edata = .;
+ *(.bss)
+ *(COMMON)
+ _end = .;
+
+}
+
+}
+EOF
+
+
+
+