Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 8622 → Rev 8625

/contrib/kolibri-libc/linuxtools/clink
Cannot display: file marked as a binary type.
svn:mime-type = application/x-executable
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/x-executable
\ No newline at end of property
/contrib/kolibri-libc/linuxtools/kld
21,4 → 21,4
FLAGS="-m elf_i386 -nostdlib"
 
# And, execute ld:
ld $FLAGS -L $KLIBC/bin/lib -T $KLIBC/tests/static.lds $KLIBC/bin/lib/crt0.o $*
ld $FLAGS -L $KLIBC/lib -T $KLIBC/static.lds $KLIBC/lib/crt0.o $*
/contrib/kolibri-libc/linuxtools/mklib
Cannot display: file marked as a binary type.
svn:mime-type = application/x-executable
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:mime-type
+application/x-executable
\ No newline at end of property
/contrib/kolibri-libc/linuxtools/mklib.c
0,0 → 1,46
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
typedef struct List_s {
char *this;
struct List_s *next;
} List;
 
int main() {
List *root;
for (List **pitem = &root;; pitem = &(*pitem)->next) {
size_t n = 1024;
*pitem = calloc(1, sizeof(List));
List *item = *pitem;
item->this = calloc(1, n);
fgets(item->this, n, stdin);
if (item->this[0] == '\n') {
free(*pitem);
*pitem = NULL;
break;
} else {
item->this[strlen(item->this) - 1] = '\0';
}
}
 
for (List *item = root; item; item = item->next) {
char asm_name[255];
sprintf(asm_name, "%s.asm", item->this);
FILE *out = fopen(asm_name, "wb");
 
fprintf(out, "format ELF\n");
fprintf(out, "include \"__lib__.inc\"\n");
fprintf(out, "fun equ __func@%s\n", item->this);
fprintf(out, "fun_str equ '%s'\n", item->this);
fprintf(out, "section '.text'\n");
fprintf(out, "fun_name db fun_str, 0\n");
fprintf(out, "section '.data'\n");
fprintf(out, "extrn lib_name\n");
fprintf(out, "public fun as fun_str\n");
fprintf(out, "fun dd fun_name\n");
fprintf(out, "lib dd lib_name\n");
 
fclose(out);
}
}