This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.
See the CrossGCC FAQ for lots more information.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
OK.I'm also wondering how other people handle applications that will be stored on a flash, i.e. how they are linked, how data is moved to RAM etc. That's still for a standalone (no OS) arm-coff application with no and debug monitor support. Some questions:
1. Should I use a separate "loader" program, or have the app do the
load itself?
Either one. I've done both in the past. If you've got plenty
of flash, I'd lean towards the separate loader program -- IMO
it's easier to maintain things that way, and I think it's
easier to disaster-recovery stuff into the loader.
Yes, of course...
2. Do I need to move the entire program, or just the data section?
It depends. I've done it both ways in the past. Running with
text/const in ROM is convenient, but often slow. On some
platforms RAM is much, much faster than flash ROM.
I think what I *really* want is to keep the default routines in these files, but execute additional pieces of code *before* they are loaded (see below). It's probably not that much work to write a custom version of it all, though...3. How can I override the default "start" behaviour (if that's what I
want)? I tried specifying an alternative entry-point via the
linker script, but the start code from crt0.S would still end up
first in the output file (at least, it has the lowest address in
disassembly output.)
Tell gcc you don't want start files linked in. IIRC, it's
-nostartfiles.
Fair enough.4. What does "entry point" in the context of linker scripts/linker
options mean anyway?
It set's the "entry point" field in the ojbect file. This is
used by things like gdb (set's the initial PC value) and
objcopy sets the "entry-point" record in hex files.
Yeah, I knew ELF had this.Does the COFF format know of such a concept,
Yes. So do ELF and most hex file formats.
I should have said a proper COFF loader, or something.or will it just execute the first instruction found in the file?
Depends. To what does "it" refer to your question?
Here's a question for you:Well, I'm assuming that it's simpler than ELF, and we're talking about a very plain setup, so ELF might just introduce more complexity without giving me anything extra that I need.
Why are you using COFF instead of ELF?
------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |