Skip to content
Snippets Groups Projects
Commit a02cb5b1 authored by rtoy's avatar rtoy
Browse files

Change how Solaris executables set up builtin_image_flag. Instead of

having the address of builtin_image_flag set to some (random) address
of mapped memory that is non-zero, we add a special file to lisp.a
that defines builtin_image_flag to 1.

lisp/Config.sparc_common:
o Define EXEC_FINAL_OBJ

lisp/GNUmakefile:
o Make lisp.a depend on EXEC_FINAL_OBJ
o On Solaris, add EXEC_FINAL_OBJ to lisp.a.

tools/SunOS-cmucl-linker-script:
o Remove the line setting the address of builtin_image_flag.

tools/linker.sh:
o For Solaris, we don't need to define BIFLAG; the builtin_image_flag
  is automatically set correctly by linking in lisp.a
parent 7b90b522
No related branches found
No related tags found
No related merge requests found
......@@ -45,3 +45,4 @@ DEPEND=$(CC)
OS_SRC = solaris-os.c os-common.c undefineds.c elf.c k_rem_pio2.c
OS_LINK_FLAGS=
OS_LIBS= -lsocket -lnsl -ldl
EXEC_FINAL_OBJ = exec-final.o
# $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/GNUmakefile,v 1.35 2010/07/12 14:02:49 rtoy Exp $
# $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/GNUmakefile,v 1.36 2010/07/29 01:51:12 rtoy Exp $
all: lisp.nm
......@@ -34,11 +34,14 @@ lisp: ${OBJS} version.o
# Create a library out of all the object files so we can build an
# executable. However, for Solaris, we need to remove exec-init.o
# because the linker will add the write symbols in.
lisp.a: version.o ${OBJS}
ar crs lisp.a version.o ${OBJS}
# because the linker will define symbols with the correct addresses.
# Also, we need to add EXEC_FINAL on Solaris to define
# builtin_image_flag with the correct value.
lisp.a: version.o ${OBJS} ${EXEC_FINAL_OBJ}
ar crs lisp.a ${OBJS} version.o
ifdef FEATURE_SOLARIS
ar d lisp.a exec-init.o
ar r lisp.a ${EXEC_FINAL_OBJ}
endif
version:
......
/*
* Variables for executable support.
*
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/exec-final.c,v 1.1 2010/07/29 01:51:12 rtoy Rel $
*
*/
/*
* See lisp.c for documentation, but basically this is linked in for
* Solaris executables to indicate that the image is builtin. We must
* not define initial_function_addr here because the linker script
* will set the value appropriately.
*/
int builtin_image_flag = 1;
......@@ -18,7 +18,6 @@ cordyn : CORDYN : CORDYN.o;
{
global:
builtin_image_flag = data V@BIFLAG@ S4;
initial_function_addr = data V@IFADDR@ S4;
};
#!/bin/sh -x
# $Id: linker.sh,v 1.12 2010/07/28 01:21:31 rtoy Exp $
# $Id: linker.sh,v 1.13 2010/07/29 01:51:12 rtoy Exp $
# This file was written by Fred Gilham and is placed in the public domain.
# It comes without warranty of any kind.
......@@ -115,11 +115,10 @@ case "$OPSYS" in
LINKER="/usr/ccs/bin/ld"
OBJS="-z allextract $CMUCLLIB/lisp.a CORRO.o CORSTA.o CORDYN.o -z defaultextract"
SCRIPT="$CMUCLLIB/$OPSYS$VER-cmucl-linker-script"
# Is this right? I just made this point to &main, and the
# first word of main isn't all zeros.
BIFLAG=$2
# Don't need BIFLAG on Solaris. The lisp.a archive has the
# correct value for it.
IFADDR=$1
sed -e "s;@BIFLAG@;$BIFLAG;" -e "s;@IFADDR@;$IFADDR;" $SCRIPT > $OUTDIR/sunos-map-file
sed -e "s;@IFADDR@;$IFADDR;" $SCRIPT > $OUTDIR/sunos-map-file
SCRIPT="-M sunos-map-file"
# Remove the sunos-map-file when the script exits.
trap 'rm -f $OUTDIR/sunos-map-file' 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment