I'm at maybe 50% for "_javascript_-gen.c" outputting functional _javascript_ from C. I'm finding this to be a useful learning mechanism to see how calls are made to/from the internals of TCC. I think it's gonna be well good enough to make a youtube video explaining a chunk of how TCC works!
I'm completely stuck at this final output stage, though.
I'm not sure how to tell the elf engine where functions begin+end, or how to tell it about other important symbols. I don't see anything in the existing *_gen.c files that would indicate how this is done.
Additionally, since I'm not outputting any, the elf engine just crashes because s1->got->reloc is null in "for_each_elem(s1->got->reloc, 0, rel, ElfW_Rel)" is that a bug?
TL;DR:
(1) GOTs are needed on non-x86 arch's are they? Regardless, "should" TCC be able to compile without any GOT entries?
(2) How do I mark off function start/end to the elf subsystem?
(3) What, other than functions do I need to tell the elf subsystem?
(4) I am hoping to make two of my own symbol types, instead of piggybacking off another arch's. Can I do this? Or is there reason to use many more types of symbols?
Charles