Developments - ELF and others
nick at dsvr.net
Fri Oct 3 06:20:34 PDT 2003
Peter Naulls wrote:
> Following a lively debate on drobe.co.uk:
> I've started looking at adding ELF to GCCSDK. I've already ported a
> version of gas from binutils which seems to work fine. Using it, I
> compiled a C hello world to assembler in ARM Linux, assembled in RISC
> OS, linked with Acorn link (which supports ELF), and ran with ELFLoader
> (by John Bell).
> I've also got a port of "ld", which seems to work, but getting anything
> useful out of it involves having an ELF C library.
Hmm. Not particularly bad. Doesn't this involve just porting UnixLib
assembler source to a syntax that 'gas' can read ?
> There are various issues here of course - gas doesn't support the RISC
> OS assembler format. Adding ELF output to 'as' remains a possibility.
I'm not sure whether I see this as a concern or not. I've always
considered that the ELF toolset would be a very different beast to the
AOF toolset. I'd rather see an ELF toolchain that worked and at least
proved the concept rather than trying to fix 'as' to work with ELF.
> Equally, drlink doesn't support ELF, and we really want to have
> interworking with AOF for lots of reasons, even if that results in
> static code. (I'm not really considering the shared library aspects
> right now).
This just ain't gonna happen.
> GCC's backend supports outputting GNU format assembler (notionally
> "riscos-elf"), which I'm going to try compiling, and see how that goes.
> Code from ARM Linux/NetBSD isn't entirely suitable, lacking chunked
> stacks, and on non-Debian will have half-word loads. Although it's not
> like Unixlib didn't have a non-chunked stack for a long time :-)
The stuff in 2.95.4 should work. The 3.3 stuff probably won't. I've
made a number of changes to riscos-aof.h which haven't been committed
yet which would need to be ported across.
> The upshot is that I may be able to shortly put together a full RISC OS
> ELF toolchain, albeit with several limitations.
This should be a fairly easy task.
Once upon a time, I used to have GCC 2.6.1 and GAS running on RISC OS
writing ELF object files. Then I realised just how much work it would
be to write AOF support for GAS and gave up.
Network Engineer, Designer Servers Ltd. http://www.dsvr.co.uk
More information about the gcc