diff options
-rw-r--r-- | com32/elflink/Makefile | 4 | ||||
-rw-r--r-- | com32/elflink/modules/MCONFIG | 6 | ||||
-rw-r--r-- | com32/elflink/modules/Makefile | 8 | ||||
-rw-r--r-- | com32/include/sys/exec.h | 15 | ||||
-rw-r--r-- | com32/include/sys/module.h | 2 | ||||
-rw-r--r-- | com32/lib/Makefile | 6 | ||||
-rw-r--r-- | com32/lib/sys/module/exec.c | 20 |
7 files changed, 20 insertions, 41 deletions
diff --git a/com32/elflink/Makefile b/com32/elflink/Makefile index 011e18d3..85a36511 100644 --- a/com32/elflink/Makefile +++ b/com32/elflink/Makefile @@ -25,13 +25,13 @@ test_memalign.elf : test_memalign.o $(LIBS) $(C_LIBS) test_com32.elf: CFLAGS += -DELF_DEBUG test_com32.elf: test_com32.o ../libutil/libutil_com.a ../lib/libcom32min.a $(LIBGCC) $(LD) -n $(LDFLAGS) -o $@ test_com32.o ../libutil/libutil_com.a $(LIBGCC) --whole-archive ../lib/libcom32min.a -Map test_com32.map - $(OBJCOPY) --extract-symbol $@ _root_.dyn + $(OBJCOPY) --extract-symbol $@ _root_.c32 tidy dist: rm -f *.o *.lo *.a *.lst *.elf .*.d *.map clean: tidy - rm -f *.lss *.c32 *.lnx *.com *.dyn + rm -f *.lss *.c32 *.lnx *.com spotless: clean rm -f *~ \#* diff --git a/com32/elflink/modules/MCONFIG b/com32/elflink/modules/MCONFIG index 18845877..7117c57b 100644 --- a/com32/elflink/modules/MCONFIG +++ b/com32/elflink/modules/MCONFIG @@ -35,7 +35,7 @@ LNXCFLAGS = -I$(com32)/libutil/include -W -Wall -O -g -D_GNU_SOURCE LNXSFLAGS = -g LNXLDFLAGS = -g -.SUFFIXES: .lss .c .o .dyn +.SUFFIXES: .lss .c .o .PRECIOUS: %.o %.o: %.S @@ -44,10 +44,6 @@ LNXLDFLAGS = -g .PRECIOUS: %.o %.o: %.c $(CC) $(CFLAGS) -c -o $@ $< - -.PRECIOUS: %.dyn -%.dyn: %.o $(LIBS) - $(LD) $(LDFLAGS) -o $@ $^ .PRECIOUS: %.lo %.lo: %.S diff --git a/com32/elflink/modules/Makefile b/com32/elflink/modules/Makefile index 6bf17e3c..8b3d286d 100644 --- a/com32/elflink/modules/Makefile +++ b/com32/elflink/modules/Makefile @@ -13,23 +13,23 @@ topdir = ../../.. include MCONFIG -MODULES = hello.dyn sort.dyn +MODULES = hello.c32 sort.c32 TESTFILES = all: $(MODULES) $(TESTFILES) -hello.dyn : hello.o +hello.c32 : hello.o $(LD) $(LDFLAGS) -o $@ $^ -sort.dyn : sort.o +sort.c32 : sort.o $(LD) $(LDFLAGS) -o $@ $^ tidy dist: rm -f *.o *.lo *.a *.lst .*.d clean: tidy - rm -f *.lss *.lnx *.com *.dyn + rm -f *.lss *.lnx *.com spotless: clean rm -f *~ \#* diff --git a/com32/include/sys/exec.h b/com32/include/sys/exec.h index 24379d96..44b1e741 100644 --- a/com32/include/sys/exec.h +++ b/com32/include/sys/exec.h @@ -17,12 +17,7 @@ * This is a shallow ELF module, that contains only the symbol table for * the code and data sections of the loaded COM32 root module. */ -#define EXEC_ROOT_NAME "_root_.dyn" - -/** - * EXEC_DIRECTORY - The base path for all dynamic linked modules. - */ -#define EXEC_DIRECTORY "/dyn/" +#define EXEC_ROOT_NAME "_root_.c32" /** * exec_init - Initialize the dynamic execution environment. @@ -48,7 +43,7 @@ extern int exec_init(); /** * load_library - Loads a dynamic library into the environment. * @name: the name of the library to load, including the extension - * (e.g. 'sort.dyn') + * (e.g. 'sort.c32') * * A dynamic library is an ELF module that may contain initialization and * termination routines, but not a main routine. At the same time, any memory @@ -61,7 +56,7 @@ extern int load_library(const char *name); /** * unload_library - unloads a library from the environment. * @name: the name of the library to unload, including the extension - * (e.g. 'sort.dyn') + * (e.g. 'sort.c32') * * Note that no memory allocated by the library code is cleaned up, as the * allocations belong to the innermost calling program in the call stack. @@ -71,7 +66,7 @@ extern int unload_library(const char *name); /** * spawnv - Executes a program in the current environment. * @name: the name of the program to spawn, including the extension - * (e.g. 'hello.dyn') + * (e.g. 'hello.c32') * @argv: a NULL-terminated vector of string arguments, starting with * the program name. * @@ -94,7 +89,7 @@ extern int spawnv(const char *name, const char **argv); /** * spawnl - Executes a program in the current environment. * @name: the name of the program to spawn, including the extension - * (e.g. 'hello.dyn') + * (e.g. 'hello.c32') * @arg: the first argument (argv[0]) to be passed to the main function * of the program * @...: optional subsequent arguments that are passed o the main function diff --git a/com32/include/sys/module.h b/com32/include/sys/module.h index 4de57105..93269550 100644 --- a/com32/include/sys/module.h +++ b/com32/include/sys/module.h @@ -18,7 +18,7 @@ * The maximum length of the module file name (including path), stored * in the struct module descriptor. */ -#define MODULE_NAME_SIZE 64 +#define MODULE_NAME_SIZE 256 /* * Initialization and finalization function signatures diff --git a/com32/lib/Makefile b/com32/lib/Makefile index 50862e00..fd08b25f 100644 --- a/com32/lib/Makefile +++ b/com32/lib/Makefile @@ -183,7 +183,7 @@ AUXDIR = $(DATADIR)/syslinux INCDIR = /usr/include COM32DIR = $(AUXDIR)/com32 -all: libcom32.a libcom32min.a klibc.dyn +all: libcom32.a libcom32min.a klibc.c32 libcom32.a : $(LIBOBJS) rm -f $@ @@ -196,7 +196,7 @@ libcom32min.a : $(MINLIBOBJS) $(AR) cq $@ $^ $(RANLIB) $@ -klibc.dyn : $(DYNLIBOBJS) +klibc.c32 : $(DYNLIBOBJS) rm -f $@ $(LD) -shared -T elf32.ld -o $@ $(DYNLIBOBJS) @@ -206,7 +206,7 @@ tidy dist: xargs -0r rm -f clean: tidy - rm -f *.a *.dyn + rm -f *.a spotless: clean rm -f *.a diff --git a/com32/lib/sys/module/exec.c b/com32/lib/sys/module/exec.c index cbd81d42..e545fb10 100644 --- a/com32/lib/sys/module/exec.c +++ b/com32/lib/sys/module/exec.c @@ -21,18 +21,6 @@ extern char _start[]; static struct elf_module *mod_root = NULL; -static char *module_get_fullname(const char *name) { - static char name_buff[MODULE_NAME_SIZE]; - - if (name == NULL) - return NULL; - - strcpy(name_buff, EXEC_DIRECTORY); - strcat(name_buff, name); - - return name_buff; -} - int exec_init() { int res; @@ -42,7 +30,7 @@ int exec_init() { return res; // Load the root module - mod_root = module_alloc(module_get_fullname(EXEC_ROOT_NAME)); + mod_root = module_alloc(EXEC_ROOT_NAME); if (mod_root == NULL) return -1; @@ -59,7 +47,7 @@ int exec_init() { int load_library(const char *name) { int res; - struct elf_module *module = module_alloc(module_get_fullname(name)); + struct elf_module *module = module_alloc(name); if (module == NULL) return -1; @@ -95,7 +83,7 @@ int load_library(const char *name) { int unload_library(const char *name) { int res; - struct elf_module *module = module_find(module_get_fullname(name)); + struct elf_module *module = module_find(name); if (module == NULL) return -1; @@ -116,7 +104,7 @@ int unload_library(const char *name) { int spawnv(const char *name, const char **argv) { int res, ret_val = 0; - struct elf_module *module = module_alloc(module_get_fullname(name)); + struct elf_module *module = module_alloc(name); if (module == NULL) return -1; |