Hi all
The coreboot project uses a ROMCC which is a C compiler which does not use
stack. This is needed if you want to write raminit in C and you have no memory
for the stack.
You can find it here:
http://review.coreboot.org/gitweb?p=coreboot.git;a=tree;f=util/romcc;hb=HEAD
The romcc is kind of fragile beast, I was wondering if tinycc could be changed
to handle everything just with the CPU registers.
The romcc uses SSE/MMX registers for this. I started to look into that and I
think it could go.
While at it, I started experimenting with tinycc and I wanted to change the way
how the subroutines are called. (something like doing jmp fn and storing return
addrress somewhere in register, this is just for a test (of course if
subsubroutine is called we must push it somewhere)
So, I added following into
static void gcall_or_jmp(int is_jmp)
This is just for a call:
This generates still a call to fn
oad(0xe8, vtop->c.ul - 4);
I think I need anonymous symbol to get actual address of "EIP" after function
call.
Sym *sym = get_sym_ref(&char_pointer_type, cur_text_section, 0, 0);
greloc(cur_text_section, sym,
ind + 1, R_386_PC32);
oad(0xb8, ind); /* call/jmp im */
This just tries to put the current "EIP" address into EAX. If compiled I receive
allthetime just 0xfffffff in the eax... Not even sure if it is good way.
I spent some hours with that but I'm kind of stuck. Any help welcome.
Thanks
Rudolf
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel