summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGwenolé Beauchesne <gbeauchesne@mandriva.org>2003-02-18 18:43:28 +0000
committerGwenolé Beauchesne <gbeauchesne@mandriva.org>2003-02-18 18:43:28 +0000
commit4b7feaf574461932fa0255a1cb6454d2afba760c (patch)
treee48a3332d51ff702f50c37be197efb7fc3fa0d0b
parentf40d43ad1a8690cf3ad71a7e4e81f6a3312c3e3c (diff)
downloaddrakx-backup-do-not-use-4b7feaf574461932fa0255a1cb6454d2afba760c.tar
drakx-backup-do-not-use-4b7feaf574461932fa0255a1cb6454d2afba760c.tar.gz
drakx-backup-do-not-use-4b7feaf574461932fa0255a1cb6454d2afba760c.tar.bz2
drakx-backup-do-not-use-4b7feaf574461932fa0255a1cb6454d2afba760c.tar.xz
drakx-backup-do-not-use-4b7feaf574461932fa0255a1cb6454d2afba760c.zip
Add missing files, remove extra files/dirs (dynlinker)
-rw-r--r--mdk-stage1/dietlibc/include/asm/alpha-sigcontext.h29
-rw-r--r--mdk-stage1/dietlibc/include/asm/arm-sigcontext.h32
-rw-r--r--mdk-stage1/dietlibc/include/asm/i386-sigcontext.h66
-rw-r--r--mdk-stage1/dietlibc/include/asm/ia64-sigcontext.h25
-rw-r--r--mdk-stage1/dietlibc/include/asm/mips-sigcontext.h23
-rw-r--r--mdk-stage1/dietlibc/include/asm/parisc-sigcontext.h16
-rw-r--r--mdk-stage1/dietlibc/include/asm/ppc-sigcontext.h76
-rw-r--r--mdk-stage1/dietlibc/include/asm/sigcontext.h36
-rw-r--r--mdk-stage1/dietlibc/include/asm/sparc-sigcontext.h50
-rw-r--r--mdk-stage1/dietlibc/include/asm/statfs.h1
-rw-r--r--mdk-stage1/dietlibc/include/asm/types.h32
-rw-r--r--mdk-stage1/dietlibc/include/linux/loop.h47
-rw-r--r--mdk-stage1/dietlibc/include/linux/nfs.h88
-rw-r--r--mdk-stage1/dietlibc/include/linux/types.h6
-rw-r--r--mdk-stage1/dietlibc/include/netpacket/packet.h41
-rw-r--r--mdk-stage1/dietlibc/libdl/test/test.c20
-rw-r--r--mdk-stage1/dietlibc/libdl/test/test_so.c11
17 files changed, 599 insertions, 0 deletions
diff --git a/mdk-stage1/dietlibc/include/asm/alpha-sigcontext.h b/mdk-stage1/dietlibc/include/asm/alpha-sigcontext.h
new file mode 100644
index 000000000..13faab0b5
--- /dev/null
+++ b/mdk-stage1/dietlibc/include/asm/alpha-sigcontext.h
@@ -0,0 +1,29 @@
+struct sigcontext {
+ /*
+ * What should we have here? I'd probably better use the same
+ * stack layout as OSF/1, just in case we ever want to try
+ * running their binaries..
+ *
+ * This is the basic layout, but I don't know if we'll ever
+ * actually fill in all the values..
+ */
+ long sc_onstack;
+ long sc_mask;
+ long sc_pc;
+ long sc_ps;
+ long sc_regs[32];
+ long sc_ownedfp;
+ long sc_fpregs[32];
+ unsigned long sc_fpcr;
+ unsigned long sc_fp_control;
+ unsigned long sc_reserved1, sc_reserved2;
+ unsigned long sc_ssize;
+ char * sc_sbase;
+ unsigned long sc_traparg_a0;
+ unsigned long sc_traparg_a1;
+ unsigned long sc_traparg_a2;
+ unsigned long sc_fp_trap_pc;
+ unsigned long sc_fp_trigger_sum;
+ unsigned long sc_fp_trigger_inst;
+};
+
diff --git a/mdk-stage1/dietlibc/include/asm/arm-sigcontext.h b/mdk-stage1/dietlibc/include/asm/arm-sigcontext.h
new file mode 100644
index 000000000..26fa04e64
--- /dev/null
+++ b/mdk-stage1/dietlibc/include/asm/arm-sigcontext.h
@@ -0,0 +1,32 @@
+
+#define PC(ctx) (ctx.arm_pc)
+
+/*
+ * Signal context structure - contains all info to do with the state
+ * before the signal handler was invoked. Note: only add new entries
+ * to the end of the structure.
+ */
+struct sigcontext {
+ unsigned long trap_no;
+ unsigned long error_code;
+ unsigned long oldmask;
+ unsigned long arm_r0;
+ unsigned long arm_r1;
+ unsigned long arm_r2;
+ unsigned long arm_r3;
+ unsigned long arm_r4;
+ unsigned long arm_r5;
+ unsigned long arm_r6;
+ unsigned long arm_r7;
+ unsigned long arm_r8;
+ unsigned long arm_r9;
+ unsigned long arm_r10;
+ unsigned long arm_fp;
+ unsigned long arm_ip;
+ unsigned long arm_sp;
+ unsigned long arm_lr;
+ unsigned long arm_pc;
+ unsigned long arm_cpsr;
+ unsigned long fault_address;
+};
+
diff --git a/mdk-stage1/dietlibc/include/asm/i386-sigcontext.h b/mdk-stage1/dietlibc/include/asm/i386-sigcontext.h
new file mode 100644
index 000000000..e830b9b97
--- /dev/null
+++ b/mdk-stage1/dietlibc/include/asm/i386-sigcontext.h
@@ -0,0 +1,66 @@
+
+struct _fpreg {
+ unsigned short significand[4];
+ unsigned short exponent;
+};
+
+struct _fpxreg {
+ unsigned short significand[4];
+ unsigned short exponent;
+ unsigned short padding[3];
+};
+
+struct _xmmreg {
+ unsigned long element[4];
+};
+
+struct _fpstate {
+ /* Regular FPU environment */
+ unsigned long cw;
+ unsigned long sw;
+ unsigned long tag;
+ unsigned long ipoff;
+ unsigned long cssel;
+ unsigned long dataoff;
+ unsigned long datasel;
+ struct _fpreg _st[8];
+ unsigned short status;
+ unsigned short magic; /* 0xffff = regular FPU data only */
+
+ /* FXSR FPU environment */
+ unsigned long _fxsr_env[6]; /* FXSR FPU env is ignored */
+ unsigned long mxcsr;
+ unsigned long reserved;
+ struct _fpxreg _fxsr_st[8]; /* FXSR FPU reg data is ignored */
+ struct _xmmreg _xmm[8];
+ unsigned long padding[56];
+};
+
+#define X86_FXSR_MAGIC 0x0000
+#define PC(ctx) (ctx.eip)
+
+struct sigcontext {
+ unsigned short gs, __gsh;
+ unsigned short fs, __fsh;
+ unsigned short es, __esh;
+ unsigned short ds, __dsh;
+ unsigned long edi;
+ unsigned long esi;
+ unsigned long ebp;
+ unsigned long esp;
+ unsigned long ebx;
+ unsigned long edx;
+ unsigned long ecx;
+ unsigned long eax;
+ unsigned long trapno;
+ unsigned long err;
+ unsigned long eip;
+ unsigned short cs, __csh;
+ unsigned long eflags;
+ unsigned long esp_at_signal;
+ unsigned short ss, __ssh;
+ struct _fpstate * fpstate;
+ unsigned long oldmask;
+ unsigned long cr2;
+};
+
diff --git a/mdk-stage1/dietlibc/include/asm/ia64-sigcontext.h b/mdk-stage1/dietlibc/include/asm/ia64-sigcontext.h
new file mode 100644
index 000000000..ebab3c8f4
--- /dev/null
+++ b/mdk-stage1/dietlibc/include/asm/ia64-sigcontext.h
@@ -0,0 +1,25 @@
+#include <sys/ptrace.h>
+
+#define PC(ctx) (ctx.sc_ip)
+
+struct sigcontext {
+ unsigned long sc_flags;
+ unsigned long sc_nat;
+ stack_t sc_stack;
+ unsigned long sc_ip;
+ unsigned long sc_cfm;
+ unsigned long sc_um;
+ unsigned long sc_ar_rsc;
+ unsigned long sc_ar_bsp;
+ unsigned long sc_ar_rnat;
+ unsigned long sc_ar_ccv;
+ unsigned long sc_ar_unat;
+ unsigned long sc_ar_fpsr;
+ unsigned long sc_ar_pfs;
+ unsigned long sc_ar_lc;
+ unsigned long sc_pr;
+ unsigned long sc_br[8];
+ unsigned long sc_gr[32];
+ struct ia64_fpreg sc_fr[128];
+ sigset_t sc_mask;
+};
diff --git a/mdk-stage1/dietlibc/include/asm/mips-sigcontext.h b/mdk-stage1/dietlibc/include/asm/mips-sigcontext.h
new file mode 100644
index 000000000..1210abf31
--- /dev/null
+++ b/mdk-stage1/dietlibc/include/asm/mips-sigcontext.h
@@ -0,0 +1,23 @@
+
+/*
+ * Keep this struct definition in sync with the sigcontext fragment
+ * in arch/mips/tools/offset.c
+ */
+struct sigcontext {
+ unsigned int sc_regmask; /* Unused */
+ unsigned int sc_status;
+ unsigned long long sc_pc;
+ unsigned long long sc_regs[32];
+ unsigned long long sc_fpregs[32]; /* Unused */
+ unsigned int sc_ownedfp;
+ unsigned int sc_fpc_csr; /* Unused */
+ unsigned int sc_fpc_eir; /* Unused */
+ unsigned int sc_ssflags; /* Unused */
+ unsigned long long sc_mdhi;
+ unsigned long long sc_mdlo;
+
+ unsigned int sc_cause; /* Unused */
+ unsigned int sc_badvaddr; /* Unused */
+
+ unsigned long sc_sigset[4]; /* kernel's sigset_t */
+};
diff --git a/mdk-stage1/dietlibc/include/asm/parisc-sigcontext.h b/mdk-stage1/dietlibc/include/asm/parisc-sigcontext.h
new file mode 100644
index 000000000..9428dd3e5
--- /dev/null
+++ b/mdk-stage1/dietlibc/include/asm/parisc-sigcontext.h
@@ -0,0 +1,16 @@
+
+#define PARISC_SC_FLAG_ONSTACK 1<<0
+#define PARISC_SC_FLAG_IN_SYSCALL 1<<1
+
+/* We will add more stuff here as it becomes necessary, until we know
+ it works. */
+struct sigcontext {
+ unsigned long sc_flags;
+
+ unsigned long sc_gr[32]; /* PSW in sc_gr[0] */
+ unsigned long long sc_fr[32]; /* FIXME, do we need other state info? */
+ unsigned long sc_iasq[2];
+ unsigned long sc_iaoq[2];
+ unsigned long sc_sar; /* cr11 */
+};
+
diff --git a/mdk-stage1/dietlibc/include/asm/ppc-sigcontext.h b/mdk-stage1/dietlibc/include/asm/ppc-sigcontext.h
new file mode 100644
index 000000000..1d9704f3a
--- /dev/null
+++ b/mdk-stage1/dietlibc/include/asm/ppc-sigcontext.h
@@ -0,0 +1,76 @@
+
+struct pt_regs {
+ unsigned long gpr[32];
+ unsigned long nip;
+ unsigned long msr;
+ unsigned long orig_gpr3; /* Used for restarting system calls */
+ unsigned long ctr;
+ unsigned long link;
+ unsigned long xer;
+ unsigned long ccr;
+ unsigned long mq; /* 601 only (not used at present) */
+ /* Used on APUS to hold IPL value. */
+ unsigned long trap; /* Reason for being here */
+ unsigned long dar; /* Fault registers */
+ unsigned long dsisr;
+ unsigned long result; /* Result of a system call */
+};
+
+/*
+ * Offsets used by 'ptrace' system call interface.
+ * These can't be changed without breaking binary compatibility
+ * with MkLinux, etc.
+ */
+#define PT_R0 0
+#define PT_R1 1
+#define PT_R2 2
+#define PT_R3 3
+#define PT_R4 4
+#define PT_R5 5
+#define PT_R6 6
+#define PT_R7 7
+#define PT_R8 8
+#define PT_R9 9
+#define PT_R10 10
+#define PT_R11 11
+#define PT_R12 12
+#define PT_R13 13
+#define PT_R14 14
+#define PT_R15 15
+#define PT_R16 16
+#define PT_R17 17
+#define PT_R18 18
+#define PT_R19 19
+#define PT_R20 20
+#define PT_R21 21
+#define PT_R22 22
+#define PT_R23 23
+#define PT_R24 24
+#define PT_R25 25
+#define PT_R26 26
+#define PT_R27 27
+#define PT_R28 28
+#define PT_R29 29
+#define PT_R30 30
+#define PT_R31 31
+
+#define PT_NIP 32
+#define PT_MSR 33
+#define PT_CTR 35
+#define PT_LNK 36
+#define PT_XER 37
+#define PT_CCR 38
+#define PT_MQ 39
+
+#define PT_FPR0 48 /* each FP reg occupies 2 slots in this space */
+#define PT_FPR31 (PT_FPR0 + 2*31)
+#define PT_FPSCR (PT_FPR0 + 2*32 + 1)
+
+#define sigcontext_struct sigcontext
+struct sigcontext {
+ unsigned long _unused[4];
+ int signal;
+ unsigned long handler;
+ unsigned long oldmask;
+ struct pt_regs *regs;
+};
diff --git a/mdk-stage1/dietlibc/include/asm/sigcontext.h b/mdk-stage1/dietlibc/include/asm/sigcontext.h
new file mode 100644
index 000000000..c4a720cc0
--- /dev/null
+++ b/mdk-stage1/dietlibc/include/asm/sigcontext.h
@@ -0,0 +1,36 @@
+#ifndef _ASM_SIGCONTEXT_H
+#define _ASM_SIGCONTEXT_H
+
+#if defined(__i386__) || defined(__x86_64__)
+#include <asm/i386-sigcontext.h>
+#endif
+
+#ifdef __sparc__
+#include <asm/sparc-sigcontext.h>
+#endif
+
+#ifdef __mips__
+#include <asm/mips-sigcontext.h>
+#endif
+
+#ifdef __powerpc__
+#include <asm/ppc-sigcontext.h>
+#endif
+
+#ifdef __alpha__
+#include <asm/alpha-sigcontext.h>
+#endif
+
+#ifdef __arm__
+#include <asm/arm-sigcontext.h>
+#endif
+
+#ifdef __hppa__
+#include <asm/parisc-sigcontext.h>
+#endif
+
+#ifdef __ia64__
+#include <asm/ia64-sigcontext.h>
+#endif
+
+#endif
diff --git a/mdk-stage1/dietlibc/include/asm/sparc-sigcontext.h b/mdk-stage1/dietlibc/include/asm/sparc-sigcontext.h
new file mode 100644
index 000000000..98e4e09ce
--- /dev/null
+++ b/mdk-stage1/dietlibc/include/asm/sparc-sigcontext.h
@@ -0,0 +1,50 @@
+
+#define __SUNOS_MAXWIN 31
+
+/* This is what SunOS does, so shall I. */
+struct sigcontext {
+ int sigc_onstack; /* state to restore */
+ int sigc_mask; /* sigmask to restore */
+ int sigc_sp; /* stack pointer */
+ int sigc_pc; /* program counter */
+ int sigc_npc; /* next program counter */
+ int sigc_psr; /* for condition codes etc */
+ int sigc_g1; /* User uses these two registers */
+ int sigc_o0; /* within the trampoline code. */
+
+ /* Now comes information regarding the users window set
+ * at the time of the signal.
+ */
+ int sigc_oswins; /* outstanding windows */
+
+ /* stack ptrs for each regwin buf */
+ char *sigc_spbuf[__SUNOS_MAXWIN];
+
+ /* Windows to restore after signal */
+ struct {
+ unsigned long locals[8];
+ unsigned long ins[8];
+ } sigc_wbuf[__SUNOS_MAXWIN];
+};
+
+typedef struct {
+ struct {
+ unsigned long psr;
+ unsigned long pc;
+ unsigned long npc;
+ unsigned long y;
+ unsigned long u_regs[16]; /* globals and ins */
+ } si_regs;
+ int si_mask;
+} __siginfo_t;
+
+typedef struct {
+ unsigned long si_float_regs [32];
+ unsigned long si_fsr;
+ unsigned long si_fpqdepth;
+ struct {
+ unsigned long *insn_addr;
+ unsigned long insn;
+ } si_fpqueue [16];
+} __siginfo_fpu_t;
+
diff --git a/mdk-stage1/dietlibc/include/asm/statfs.h b/mdk-stage1/dietlibc/include/asm/statfs.h
new file mode 100644
index 000000000..53b3b5e4d
--- /dev/null
+++ b/mdk-stage1/dietlibc/include/asm/statfs.h
@@ -0,0 +1 @@
+#include <sys/vfs.h>
diff --git a/mdk-stage1/dietlibc/include/asm/types.h b/mdk-stage1/dietlibc/include/asm/types.h
new file mode 100644
index 000000000..aafa80f16
--- /dev/null
+++ b/mdk-stage1/dietlibc/include/asm/types.h
@@ -0,0 +1,32 @@
+#ifndef _ASM_TYPES_H
+#define _ASM_TYPES_H
+
+#include <sys/types.h>
+
+#ifdef __alpha__
+typedef unsigned int umode_t;
+#else
+typedef unsigned short umode_t;
+#endif
+
+typedef uint8_t __u8;
+typedef uint16_t __u16;
+typedef uint32_t __u32;
+#ifndef __STRICT_ANSI__
+typedef uint64_t __u64;
+#endif
+
+typedef int8_t __s8;
+typedef int16_t __s16;
+typedef int32_t __s32;
+#ifndef __STRICT_ANSI__
+typedef int64_t __s64;
+#endif
+
+#if defined(__alpha__)
+typedef unsigned long __kernel_size_t;
+#else
+typedef unsigned int __kernel_size_t;
+#endif
+
+#endif
diff --git a/mdk-stage1/dietlibc/include/linux/loop.h b/mdk-stage1/dietlibc/include/linux/loop.h
new file mode 100644
index 000000000..1366f1877
--- /dev/null
+++ b/mdk-stage1/dietlibc/include/linux/loop.h
@@ -0,0 +1,47 @@
+#ifndef _LINUX_LOOP_H
+#define _LINUX_LOOP_H
+
+/* stolen form kernel */
+
+#define LO_NAME_SIZE 64
+#define LO_KEY_SIZE 32
+
+/* Loop flags */
+#define LO_FLAGS_DO_BMAP 1
+#define LO_FLAGS_READ_ONLY 2
+#define LO_FLAGS_BH_REMAP 4
+
+struct loop_info {
+ int lo_number; /* ioctl r/o */
+ dev_t lo_device; /* ioctl r/o */
+ unsigned long lo_inode; /* ioctl r/o */
+ dev_t lo_rdevice; /* ioctl r/o */
+ int lo_offset;
+ int lo_encrypt_type;
+ int lo_encrypt_key_size; /* ioctl w/o */
+ int lo_flags; /* ioctl r/o */
+ char lo_name[LO_NAME_SIZE];
+ unsigned char lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
+ unsigned long lo_init[2];
+ char reserved[4];
+};
+
+/* Loop filter types */
+#define LO_CRYPT_NONE 0
+#define LO_CRYPT_XOR 1
+#define LO_CRYPT_DES 2
+#define LO_CRYPT_FISH2 3 /* Brand new Twofish encryption */
+#define LO_CRYPT_BLOW 4
+#define LO_CRYPT_CAST128 5
+#define LO_CRYPT_IDEA 6
+#define LO_CRYPT_DUMMY 9
+#define LO_CRYPT_SKIPJACK 10
+#define MAX_LO_CRYPT 20
+
+/* IOCTL commands --- we will commandeer 0x4C ('L') */
+#define LOOP_SET_FD 0x4C00
+#define LOOP_CLR_FD 0x4C01
+#define LOOP_SET_STATUS 0x4C02
+#define LOOP_GET_STATUS 0x4C03
+
+#endif
diff --git a/mdk-stage1/dietlibc/include/linux/nfs.h b/mdk-stage1/dietlibc/include/linux/nfs.h
new file mode 100644
index 000000000..9be6db37e
--- /dev/null
+++ b/mdk-stage1/dietlibc/include/linux/nfs.h
@@ -0,0 +1,88 @@
+/*
+ * NFS protocol definitions
+ *
+ * This file contains constants mostly for Version 2 of the protocol,
+ * but also has a couple of NFSv3 bits in (notably the error codes).
+ */
+#ifndef _LINUX_NFS_H
+#define _LINUX_NFS_H
+
+#define NFS_PROGRAM 100003
+#define NFS_PORT 2049
+#define NFS_MAXDATA 8192
+#define NFS_MAXPATHLEN 1024
+#define NFS_MAXNAMLEN 255
+#define NFS_MAXGROUPS 16
+#define NFS_FHSIZE 32
+#define NFS_COOKIESIZE 4
+#define NFS_FIFO_DEV (-1)
+#define NFSMODE_FMT 0170000
+#define NFSMODE_DIR 0040000
+#define NFSMODE_CHR 0020000
+#define NFSMODE_BLK 0060000
+#define NFSMODE_REG 0100000
+#define NFSMODE_LNK 0120000
+#define NFSMODE_SOCK 0140000
+#define NFSMODE_FIFO 0010000
+
+#define NFS_MNT_PROGRAM 100005
+#define NFS_MNT_PORT 627
+
+/*
+ * NFS stats. The good thing with these values is that NFSv3 errors are
+ * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which
+ * no-one uses anyway), so we can happily mix code as long as we make sure
+ * no NFSv3 errors are returned to NFSv2 clients.
+ * Error codes that have a `--' in the v2 column are not part of the
+ * standard, but seem to be widely used nevertheless.
+ */
+ enum nfs_stat {
+ NFS_OK = 0, /* v2 v3 */
+ NFSERR_PERM = 1, /* v2 v3 */
+ NFSERR_NOENT = 2, /* v2 v3 */
+ NFSERR_IO = 5, /* v2 v3 */
+ NFSERR_NXIO = 6, /* v2 v3 */
+ NFSERR_EAGAIN = 11, /* v2 v3 */
+ NFSERR_ACCES = 13, /* v2 v3 */
+ NFSERR_EXIST = 17, /* v2 v3 */
+ NFSERR_XDEV = 18, /* v3 */
+ NFSERR_NODEV = 19, /* v2 v3 */
+ NFSERR_NOTDIR = 20, /* v2 v3 */
+ NFSERR_ISDIR = 21, /* v2 v3 */
+ NFSERR_INVAL = 22, /* v2 v3 that Sun forgot */
+ NFSERR_FBIG = 27, /* v2 v3 */
+ NFSERR_NOSPC = 28, /* v2 v3 */
+ NFSERR_ROFS = 30, /* v2 v3 */
+ NFSERR_MLINK = 31, /* v3 */
+ NFSERR_OPNOTSUPP = 45, /* v2 v3 */
+ NFSERR_NAMETOOLONG = 63, /* v2 v3 */
+ NFSERR_NOTEMPTY = 66, /* v2 v3 */
+ NFSERR_DQUOT = 69, /* v2 v3 */
+ NFSERR_STALE = 70, /* v2 v3 */
+ NFSERR_REMOTE = 71, /* v2 v3 */
+ NFSERR_WFLUSH = 99, /* v2 */
+ NFSERR_BADHANDLE = 10001, /* v3 */
+ NFSERR_NOT_SYNC = 10002, /* v3 */
+ NFSERR_BAD_COOKIE = 10003, /* v3 */
+ NFSERR_NOTSUPP = 10004, /* v3 */
+ NFSERR_TOOSMALL = 10005, /* v3 */
+ NFSERR_SERVERFAULT = 10006, /* v3 */
+ NFSERR_BADTYPE = 10007, /* v3 */
+ NFSERR_JUKEBOX = 10008 /* v3 */
+ };
+
+/* NFSv2 file types - beware, these are not the same in NFSv3 */
+
+enum nfs_ftype {
+ NFNON = 0,
+ NFREG = 1,
+ NFDIR = 2,
+ NFBLK = 3,
+ NFCHR = 4,
+ NFLNK = 5,
+ NFSOCK = 6,
+ NFBAD = 7,
+ NFFIFO = 8
+};
+
+#endif /* _LINUX_NFS_H */
diff --git a/mdk-stage1/dietlibc/include/linux/types.h b/mdk-stage1/dietlibc/include/linux/types.h
new file mode 100644
index 000000000..1cd33bd41
--- /dev/null
+++ b/mdk-stage1/dietlibc/include/linux/types.h
@@ -0,0 +1,6 @@
+#ifndef _LINUX_TYPES_H
+#define _LINUX_TYPES_H
+
+#include <asm/types.h>
+
+#endif
diff --git a/mdk-stage1/dietlibc/include/netpacket/packet.h b/mdk-stage1/dietlibc/include/netpacket/packet.h
new file mode 100644
index 000000000..b265094c6
--- /dev/null
+++ b/mdk-stage1/dietlibc/include/netpacket/packet.h
@@ -0,0 +1,41 @@
+#ifndef __NETPACKET_PACKET_H
+#define __NETPACKET_PACKET_H
+
+struct sockaddr_ll {
+ unsigned short int sll_family;
+ unsigned short int sll_protocol;
+ int sll_ifindex;
+ unsigned short int sll_hatype;
+ unsigned char sll_pkttype;
+ unsigned char sll_halen;
+ unsigned char sll_addr[8];
+};
+
+#define PACKET_HOST 0 /* To us. */
+#define PACKET_BROADCAST 1 /* To all. */
+#define PACKET_MULTICAST 2 /* To group. */
+#define PACKET_OTHERHOST 3 /* To someone else. */
+#define PACKET_OUTGOING 4 /* Originated by us. */
+#define PACKET_LOOPBACK 5
+#define PACKET_FASTROUTE 6
+
+/* Packet socket options. */
+
+#define PACKET_ADD_MEMBERSHIP 1
+#define PACKET_DROP_MEMBERSHIP 2
+#define PACKET_RECV_OUTPUT 3
+#define PACKET_RX_RING 5
+#define PACKET_STATISTICS 6
+
+struct packet_mreq {
+ int mr_ifindex;
+ unsigned short int mr_type;
+ unsigned short int mr_alen;
+ unsigned char mr_address[8];
+};
+
+#define PACKET_MR_MULTICAST 0
+#define PACKET_MR_PROMISC 1
+#define PACKET_MR_ALLMULTI 2
+
+#endif
diff --git a/mdk-stage1/dietlibc/libdl/test/test.c b/mdk-stage1/dietlibc/libdl/test/test.c
new file mode 100644
index 000000000..d467134ba
--- /dev/null
+++ b/mdk-stage1/dietlibc/libdl/test/test.c
@@ -0,0 +1,20 @@
+#include <dlfcn.h>
+
+int main(int argc, char **argv)
+{
+ void *Hlib;
+
+// if (Hlib=dlopen("libtest.so", RTLD_LAZY)) {
+ if (Hlib=dlopen("libtest.so", RTLD_NOW)) {
+ void (*t)(void) = dlsym(Hlib,"test");
+ if (t) {
+ printf("test @ %08lx\n",(long)t);
+ t();
+ }
+ dlclose(Hlib);
+ }
+ else {
+ printf("%s\n",dlerror());
+ }
+ return 0;
+}
diff --git a/mdk-stage1/dietlibc/libdl/test/test_so.c b/mdk-stage1/dietlibc/libdl/test/test_so.c
new file mode 100644
index 000000000..09d243c56
--- /dev/null
+++ b/mdk-stage1/dietlibc/libdl/test/test_so.c
@@ -0,0 +1,11 @@
+
+int* test();
+
+int err
+=(int)test
+;
+
+int* test() {
+ write(1,"helo\n",5);
+ return &err;
+}