Skip to content
This repository has been archived by the owner on Jun 28, 2020. It is now read-only.

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hyln9 committed Jun 11, 2017
0 parents commit bf46551
Show file tree
Hide file tree
Showing 7 changed files with 1,892 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.[oa]
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
TARGET_LIB = libdl.a
OBJS = source/dl.o
INCLUDES = include

PREFIX ?= ${VITASDK}/arm-vita-eabi
CC = arm-vita-eabi-gcc
AR = arm-vita-eabi-ar
CFLAGS = -Wl,-q -Wall -O2 -I$(INCLUDES)
ASFLAGS = $(CFLAGS)

all: $(TARGET_LIB)

$(TARGET_LIB): $(OBJS)
$(AR) -rc $@ $^

clean:
rm -rf $(TARGET_LIB) $(OBJS)

install: $(TARGET_LIB)
@mkdir -p $(DESTDIR)$(PREFIX)/lib/
cp $(TARGET_LIB) $(DESTDIR)$(PREFIX)/lib/
@mkdir -p $(DESTDIR)$(PREFIX)/include/
cp include/dlfcn.h $(DESTDIR)$(PREFIX)/include/
3 changes: 3 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vita-libdl

See sample/db.txt for dldbadd format. Currently 3 library entry format is supported: preloaded module, sysmodule and suprx file module.
33 changes: 33 additions & 0 deletions include/dlfcn.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#ifndef _DLFCN_H_
#define _DLFCN_H_

/* Flags for dlopen(). */
#define RTLD_LAZY 0x1 /* Lazy relocation. */
#define RTLD_NOW 0x2 /* Immediate relocations. */
#define RTLD_GLOBAL 0x4 /* Symbols are globally available. */
#define RTLD_LOCAL 0 /* Opposite of RTLD_GLOBAL, and the default. */

/* Predefined handles. */
#define RTLD_DEFAULT NULL /* Global library. */

#ifdef __cplusplus
extern "C" {
#endif

/* POSIX standard functions. */
int dlclose(void *);
char *dlerror(void);
void *dlopen(const char *, int);
void *dlsym(void * __restrict, const char * __restrict);

/* Non-standard functions. */
int dlinit();
void dlfree();
int dldbadd(const char *); /* NID database initialization. */
int dldbfreeall(void); /* NID database destruction. */

#ifdef __cplusplus
}
#endif

#endif
1,100 changes: 1,100 additions & 0 deletions include/uthash.h

Large diffs are not rendered by default.

Loading

0 comments on commit bf46551

Please sign in to comment.