0 Members and 1 Guest are viewing this topic.
The bFLT loader in Linux and QEMU, and the ELF -> bFLT converters, are full-featured, open source, standard and maintainable, and explicitly support dynamic, shared libraries
FWIW, I had started to look at porting a bFLT loader to the Nspire platform: http://ourl.ca/14975/284471 . bFLT is simple, can easily be converted from ELF, and does the job we need, AFAICT. It can handle dynamic libraries, too.But as I mentioned in that topic, I can't handle the port alone
[edit]One thing I would like to be improved: the relocator currently replaces Ndless's crt0.S. Which means any startup feature non-related to relocation (such as __crt0_savedsp's initialization) will be lost when switching to ndless-standalone-relocator. What could be done to keep Ndless's crt0.S, and use startup.S as the program entry point?Looking closer: is crt0.s actually kept, and startup.S added before it?[edit2]I'm trying to use it on my Windows computer, but I'm always getting the error:makeself.exe: Unable to parse ELF file "testlibm.elf".I'm using libelf v0.8.13 and GNU v2.21. How can we diagnose this?
P R G \0 [ branch instruction ] [number of relocation entries ] [relocation code ] (startup.S finishes here) [array of relocations ] [ original tns file ]
Would it be easier just to write a bFLT loader from scratch?
Most likely, this will be abandoned at one point for bFLT anyway
@edit2If you could send me the ELF file you're trying to link, I can take a look at it for you.
Quote from: tangrs on March 31, 2012, 08:05:53 am@edit2If you could send me the ELF file you're trying to link, I can take a look at it for you.Here it is, I'm just trying to troubleshoot this: http://ourl.ca/14975/294135
QuoteWould it be easier just to write a bFLT loader from scratch?I don't know.QuoteMost likely, this will be abandoned at one point for bFLT anyway Maybe, but for this to happen, other people than ExtendeD or I need to work on the task Neither ExtendeD nor I have enough time to move bFLT forward at the required rate.
I looked at the specifications for bFLT and it's insanely simple.
It's not worth trying to port a loader. I spent a few hours today and wrote a basic bFLT loader from scratch.
It's really a trivial task compared to ELF loading. Spend a little extra time on it and dynamic libraries should be easily supported too.
I put up the source code on Github (https://github.com/tangrs/ndless-bflt-loader) with a README with all the information needed to get the loader and a elf2flt toolchain working.
@edit: if there's a place with comprehensive documentation about the structure of bFLT files, please do tell me. Most of the 'documentation' I've read are header files and comments in code of existing implementations.
QuoteI looked at the specifications for bFLT and it's insanely simple.Indeed, which is several of us had thought about it QuoteIt's not worth trying to port a loader. I spent a few hours today and wrote a basic bFLT loader from scratch.Good job, as usual QuoteIt's really a trivial task compared to ELF loading. Spend a little extra time on it and dynamic libraries should be easily supported too.And compressed files would be the icing on the cake.QuoteI put up the source code on Github (https://github.com/tangrs/ndless-bflt-loader) with a README with all the information needed to get the loader and a elf2flt toolchain working.Cloned and watched.I'm sure this will get a lot of testing soon Quote@edit: if there's a place with comprehensive documentation about the structure of bFLT files, please do tell me. Most of the 'documentation' I've read are header files and comments in code of existing implementations.The main source of information I know of is http://retired.beyondlogic.org/uClinux/bflt.htm .EDIT: I created a news about the topic of loading programs at http://tiplanet.org/forum/viewtopic.php?t=8978
Good job tangrs. You may want to create a new topic for the bFLT loader and leave this for you standalone relocator.Also I know this is going to sound newbish but what exactly do things like bFLT and relocators let you do?
Quote from: ExtendeD on March 31, 2012, 10:53:06 amQuote from: tangrs on March 31, 2012, 08:05:53 am@edit2If you could send me the ELF file you're trying to link, I can take a look at it for you.Here it is, I'm just trying to troubleshoot this: http://ourl.ca/14975/294135That's really weird, it works perfectly on my machine.I added some extra debugging lines into the latest commit. Could you check it out and recompile and see where it conks out?
ELF: call to elf_begin() failedmakeself.exe: Unable to parse ELF file "testlibm.elf"