aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Bucur <stefanb@zytor.com>2008-08-14 15:58:48 +0300
committerStefan Bucur <stefan@stefan-ubumac.(none)>2009-03-15 10:10:51 +0200
commit83955ce691dfcf8afaccb4c36d800ae7ab50a1e0 (patch)
tree178429db45661ff063ba75ad5c2ce1550f19c6f3
parent9cc1f4a28bc3abca591528b2a6b9c939c80e6552 (diff)
downloadsyslinux-elf-83955ce691dfcf8afaccb4c36d800ae7ab50a1e0.tar.gz
syslinux-elf-83955ce691dfcf8afaccb4c36d800ae7ab50a1e0.tar.xz
syslinux-elf-83955ce691dfcf8afaccb4c36d800ae7ab50a1e0.zip
Cleaned up some files in the elflink module dir.
-rw-r--r--com32/elflink/Makefile.user57
-rw-r--r--com32/elflink/README24
-rw-r--r--com32/elflink/TODO1
-rw-r--r--com32/elflink/hello_def.c16
-rw-r--r--com32/elflink/hello_ref.c26
-rw-r--r--com32/elflink/test_user.c101
6 files changed, 0 insertions, 225 deletions
diff --git a/com32/elflink/Makefile.user b/com32/elflink/Makefile.user
deleted file mode 100644
index 296f6185..00000000
--- a/com32/elflink/Makefile.user
+++ /dev/null
@@ -1,57 +0,0 @@
-## Builds a simple user-space application that tests the basic functionality
-## of the ELF linking routines.
-
-## License would go here
-
-########
-# Tools
-
-CC = gcc
-
-RM = rm -f
-
-################
-# Build options
-
-CFLAGS = -g3 -O0 -Wall -DELF_DEBUG
-
-LDFLAGS =
-
-##################
-# Generated files
-
-# Test executable name
-TESTPROG = test_user
-
-
-###############
-# Make targets
-.PHONY: all test-prog test-module clean
-
-all: test-prog test-module
-
-
-# The testing user-space application
-test-prog: $(TESTPROG)
-
-$(TESTPROG): test_user.o elf_module.o elf_utils.o
- $(CC) -o $@ $^
-
-
-# The shared module to test on
-test-module: hello_def.so hello_ref.so
-
-
-hello_def.so: hello_def.o
- $(CC) -shared -o $@ $^
-
-hello_ref.so: hello_ref.o
- $(CC) -shared -o $@ $^
-
-
-# Cleanup target
-clean:
- -$(RM) *.o
- -$(RM) $(TESTPROG)
- -$(RM) *.so
-
diff --git a/com32/elflink/README b/com32/elflink/README
deleted file mode 100644
index 324a8c25..00000000
--- a/com32/elflink/README
+++ /dev/null
@@ -1,24 +0,0 @@
-SYSLINUX ELF Module Loading Support
-===================================
-
-This file will contain any relevant information regarding building, integrating
-and testing ELF module loading support in SYSLINUX.
-
-
-Initial Development
-===================
-
-As the ELF modules handling code matures, building and testing will be done
-separately from the main SYSLINUX building flow. I have created a Makefile
-target that build an user space executable that tests the ELF loading code on
-a given ELF object.
-
-Run:
-
- make test
-
-in the current directory to build the test application, then run:
-
- ./elftest
-
-to perform the testing.
diff --git a/com32/elflink/TODO b/com32/elflink/TODO
deleted file mode 100644
index 19cc04ac..00000000
--- a/com32/elflink/TODO
+++ /dev/null
@@ -1 +0,0 @@
-* Create a macro for reporting debugging information.
diff --git a/com32/elflink/hello_def.c b/com32/elflink/hello_def.c
deleted file mode 100644
index 2ad60233..00000000
--- a/com32/elflink/hello_def.c
+++ /dev/null
@@ -1,16 +0,0 @@
-
-int undef_symbol;
-
-void undef_func(int param) {
- undef_symbol = 100;
-}
-
-static int hello_init(void) {
- // Do nothing
-
- return 0;
-}
-
-static void hello_exit(void) {
- // Do nothing
-}
diff --git a/com32/elflink/hello_ref.c b/com32/elflink/hello_ref.c
deleted file mode 100644
index f7b798b4..00000000
--- a/com32/elflink/hello_ref.c
+++ /dev/null
@@ -1,26 +0,0 @@
-// A simple Hello World ELF module
-
-// TODO: Define some macros that would put the initialization and termination
-// functions in a separate section (suggestion: .init and .fini)
-
-// Undefined symbol
-extern int undef_symbol;
-
-int exported_symbol;
-
-// Undefined function
-extern void undef_func(int param);
-
-int test_func(void) {
- return undef_symbol++;
-}
-
-static int hello_init(void) {
- undef_symbol++;
-
- return 0;
-}
-
-static void hello_exit(void) {
- undef_func(undef_symbol);
-}
diff --git a/com32/elflink/test_user.c b/com32/elflink/test_user.c
deleted file mode 100644
index 0a38bbe6..00000000
--- a/com32/elflink/test_user.c
+++ /dev/null
@@ -1,101 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include "elf_module.h"
-
-void print_usage() {
- fprintf(stderr, "Usage:\n");
- fprintf(stderr, "\telftest objfile ...\n");
-}
-
-void test_hello() {
- int i;
-
- struct elf_module *module;
- Elf32_Sym *symbol;
-
- symbol = global_find_symbol("undef_func", &module);
-
- void (*undef_func)(int) = module_get_absolute(symbol->st_value, module);
-
- symbol = global_find_symbol("test_func", &module);
-
- int (*test_func)(void) = module_get_absolute(symbol->st_value, module);
-
- undef_func(0);
-
- for (i=0; i < 10; i++) {
- printf("%d\n", test_func());
- }
-}
-
-int main(int argc, char **argv) {
- int res;
- int i;
- struct elf_module *module;
- const char *module_name = NULL;
-
- // Skip program name
- argc--;
- argv++;
-
- if (argc < 1) {
- print_usage();
- return 1;
- }
-
- res = modules_init();
-
- if (res < 0) {
- fprintf(stderr, "Could not initialize module subsystem\n");
- exit(1);
- }
-
- for (i=0; i < argc; i++){
- module_name = argv[i];
-
- module = module_alloc(module_name);
-
- if (module == NULL) {
- fprintf(stderr, "Could not allocate the module\n");
- goto error;
- }
-
- res = module_load(module);
-
- if (res < 0) {
- fprintf(stderr, "Could not load the module\n");
- goto error;
- }
-
- }
-
- test_hello();
-
- for (i=argc-1; i >= 0; i--) {
- module_name = argv[i];
- module = module_find(module_name);
-
- res = module_unload(module);
-
- if (res < 0) {
- fprintf(stderr, "Could not unload the module\n");
- goto error;
- }
- }
-
- modules_term();
-
- return 0;
-
-error:
- modules_term();
-
- return 1;
-}