Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: ADS to GNU

2004-02-04 by Peter

--- In lpc2100@yahoogroups.com, "Lewin A.R.W. Edwards" <larwe@l...> 
wrote:
> Okay... The information I'm about to give you is two? three? years 
old, 
> so take it with a grain of salt:
> 
> ADS uses, or used to use, the COFF object format. This is strongly 
> deprecated in the GNU world, in favor of ELF. It is however 
possible to 

ADS does use ELF, the old SDT used an Acorn standard, AOF. However 
I've had limited success mixing GNU ELF and ARM ELF.

If I assemble a GNU asm file using the GNU tools, I can link the 
object file into an ADS build, but in the AXD debugger the GNU code 
is displayed as a set of 32-bit constants rather than a disassembly. 
It still executes ok of course.

If I build a complete program in GNU, I can't load the built ELF 
image into AXD - it complains about an error in a debug table.

Another thing to bear in mind is that GNU seems to use frame 
pointers by default, but ARM dispensed with frame pointers years 
ago - so GNU code will corrupt a register that ARM code expects to 
be preserved. I suspect it'll take a lot of jiggling to get ADS 
libraries to work with GNU.

Just goes to show, as old programmers know: "All constants are 
variable, all variables won't, all standards aren't".

Oh... in case it helps, this is a perl script I've started to hack a 
gnu assembler file to a form that can be read by the ARM assembler.

while (<>)
{
    s/@/ ;@/;
    s/^(\w+):/$1/;
    s/\.section.*/ AREA |x|,code,readonly/;
    s/\.equ ([^\s]+),\s+([^\s]+)/$1 equ $2/;
    s/\.global\s+([^\s]+)/ EXPORT $1/;
    
    print ;
}
    print "\n END\n";

Yep, it's crude, but its a start ;)

Peter.

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.