/branches/dynload/uspace/app/iloader/elf_load.c |
---|
171,11 → 171,14 |
} |
/* The run-time dynamic linker is loaded with a bias */ |
printf("Object type: %d\n", header->e_type); |
if (header->e_type == ET_DYN) |
elf->bias = RTLD_BIAS; |
else |
elf->bias = 0; |
printf("Bias set to 0x%d\n", elf->bias); |
printf("parse segments\n"); |
/* Walk through all segment headers and process them. */ |
/branches/dynload/uspace/app/iramfs/data.h |
---|
45,6 → 45,10 |
extern const size_t dltest_size; |
extern const char dltest_filename[]; |
extern const uint8_t libtest[]; |
extern const size_t libtest_size; |
extern const char libtest_filename[]; |
#endif |
/** @} |
/branches/dynload/uspace/app/iramfs/main.c |
---|
88,6 → 88,7 |
if (write_file(rtld, rtld_size, rtld_filename) < 0) return 1; |
if (write_file(dltest, dltest_size, dltest_filename) < 0) return 1; |
if (write_file(libtest, libtest_size, libtest_filename) < 0) return 1; |
printf("done\n"); |
getchar(); |
/branches/dynload/uspace/app/iramfs/Makefile |
---|
87,6 → 87,7 |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
data.c: ../../lib/rtld/rtld.so ../dltest/dltest |
data.c: ../../lib/rtld/rtld.so ../dltest/dltest ../../lib/libtest/libtest.so |
../../../tools/bin2c.py ../../lib/rtld/rtld.so rtld.so rtld >$@ |
../../../tools/bin2c.py ../dltest/dltest dltest dltest >>$@ |
../../../tools/bin2c.py ../../lib/libtest/libtest.so libtest.so.0 libtest >>$@ |
/branches/dynload/uspace/lib/rtld/Makefile |
---|
40,7 → 40,7 |
CFLAGS += -I../../app/iloader/include -Iinclude -fPIC -O0 -ggdb |
LFLAGS = -shared --no-undefined |
LIBS = $(LIBC_PREFIX)/libc.pic.a |
LIBS = $(LIBC_PREFIX)/libc.pic.a $(SOFTINT_PREFIX)/libsoftint.pic.a |
DEFS += -DRELEASE=\"$(RELEASE)\" |
ifdef REVISION |
/branches/dynload/uspace/lib/rtld/arch/ia32/src/runtime.c |
---|
78,18 → 78,6 |
return tls + ti->ti_offset; |
} |
void __umoddi3(void) |
{ |
kputint(0x101); |
*(int *)0 = 0; /* cause a page fault */ |
} |
void __udivdi3(void) |
{ |
kputint(0x102); |
*(int *)0 = 0; /* cause a page fault */ |
} |
void _putint(int i) |
{ |
} |
/branches/dynload/uspace/lib/softint/Makefile |
---|
1,5 → 1,6 |
# |
# Copyright (c) 2005 Martin Decky |
# Copyright (c) 2008 Jiri Svoboda |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
36,6 → 37,7 |
include $(LIBC_PREFIX)/Makefile.toolchain |
CFLAGS += -Iinclude |
PIC_CFLAGS := $(CFLAGS) -fPIC -D__PIC__ |
## Sources |
# |
47,22 → 49,29 |
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
OBJECTS := $(GENERIC_OBJECTS) |
PIC_OBJECTS := $(addsuffix .pio,$(basename $(OBJECTS))) |
.PHONY: all clean depend |
all: libsoftint.a |
all: libsoftint.a libsoftint.pic.a |
-include Makefile.depend |
clean: |
-rm -f libsoftint.a Makefile.depend |
find generic/ -name '*.o' -follow -exec rm \{\} \; |
-rm -f libsoftint.a libsoftint.pic.a Makefile.depend |
find generic/ \( -name '*.o' -o -name '*.pio' \) -follow -exec rm \{\} \; |
depend: |
-makedepend $(DEFS) $(CFLAGS) -f - $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null |
-makedepend $(DEFS) $(PIC_CFLAGS) -o.pio -f - $(GENERIC_SOURCES) >> Makefile.depend 2> /dev/null |
libsoftint.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS) |
$(AR) rc libsoftint.a $(ARCH_OBJECTS) $(GENERIC_OBJECTS) |
libsoftint.a: depend $(OBJECTS) |
$(AR) rc $@ $(OBJECTS) |
libsoftint.pic.a: depend $(PIC_OBJECTS) |
$(AR) rc $@ $(PIC_OBJECTS) |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
71,3 → 80,12 |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
%.pio: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.pio: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.pio: %.c |
$(CC) $(DEFS) $(PIC_CFLAGS) -c $< -o $@ |