2
Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa
4
This file is part of GNU Common Lisp, herein referred to as GCL
6
GCL is free software; you can redistribute it and/or modify it under
7
the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by
8
the Free Software Foundation; either version 2, or (at your option)
11
GCL is distributed in the hope that it will be useful, but WITHOUT
12
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14
License for more details.
16
You should have received a copy of the GNU Library General Public License
17
along with GCL; see the file COPYING. If not, write to the Free Software
18
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
28
/* cc -DVOL=volatile -G 0 -c foo.c ; ld -shared foo.o -o jim.o ; cat foo.data >> jim.o */
29
int did_a_dynamic_load;
39
char filename[MAXPATHLEN];
40
coerce_to_filename(truename(faslfile), filename);
41
sprintf(buf,"./ufas%dxXXXXXX",count++);
42
/* this is just to allow reloading in the same file twice.
46
dlp = dlopen(buf,RTLD_NOW);
48
FEerror("Cant open for dynamic link ~a",1,faslfile);
49
fptr = (int (*)())dlsym(dlp, "init_code");
51
{ FEerror("Cant find init_code in ~a",1,make_simple_string(faslfile));}
52
faslfile = open_stream(faslfile, smm_input, Cnil, sKerror);
53
SEEK_TO_END_OFILE(faslfile->sm.sm_fp);
54
data = read_fasl_vector(faslfile);
55
memory = alloc_object(t_cfdata);
56
memory->cfd.cfd_self = NULL;
57
memory->cfd.cfd_start = NULL;
58
memory->cfd.cfd_size = 0;
59
if(symbol_value(sLAload_verboseA)!=Cnil)
60
printf(" start address (dynamic) 0x%x ",fptr);
61
call_init(0,memory,data,fptr);
63
did_a_dynamic_load = 1;
64
return memory->cfd.cfd_size;