public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Register Usage
@ 2009-04-28 16:06 John Farmer
  2009-04-28 16:50 ` Ian Lance Taylor
  0 siblings, 1 reply; 14+ messages in thread
From: John Farmer @ 2009-04-28 16:06 UTC (permalink / raw)
  To: gcc-help


Hi,

I am trying to understand how the general purpose registers are used by the
GCC compiler. Most I have been able to work out but have these questions.

Register R12 is initialised in my startup code to the same value as the SP
(R13) but it never appears to be used for anything. Whats the purpose of
this register?

I have looked at the ARM and THUMB procedure call standard (briefly) and it
looks as though R7 is the Thumb-state Work register or variable register.
However, looking at the assembly code produced for functions it is clearly
being used as the frame pointer. Why is there a difference?

Is there a defining text somewhere that details GCC register usage when
compiling for a Cortex-M3 chip?

I am using GCC V4.1.1 and a STM32F103RB (Cortex-M3) microcontroller.

Regards


-- 
View this message in context: http://www.nabble.com/Register-Usage-tp23279910p23279910.html
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 14+ messages in thread
* gcc binary format output
@ 2006-07-12  1:27 Victor Roman Archidona
  2006-07-12  4:39 ` Ian Lance Taylor
  0 siblings, 1 reply; 14+ messages in thread
From: Victor Roman Archidona @ 2006-07-12  1:27 UTC (permalink / raw)
  To: gcc-help

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Hi all,

I'm porting FreeBSD to Gentoo for the Summer of Code project
"Gentoo/FreeBSD for Amd64", and I need a little help about gcc binary
output when compiling files.

I compiled by hand GCC, and when I compile some file the output format
is "UNIX - System V". I got this with `readelf -h program`. The
problem is that I need the default binary output must be "UNIX -
FreeBSD" and for now I can't fix it without help.

BTW, If the output is "UNIX - System V" I can't run static compiled
files, it shall be fixed changing the output behaviour. For example
with the following small C program:

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
        printf("it works!\n");
        exit(EXIT_SUCCESS);
}

root@localhost ~ # gcc -static test.c -o test
root@localhost ~ # readelf -h test | grep "OS/ABI"
  OS/ABI:                            UNIX - System V
root@localhost ~ # ./test
ELF binary type "0" not known.
- -su: ./test: cannot execute binary file
root@localhost ~ #

Any input in this topic will be very apreciated.

Thanks for all in advance,
- --
Victor Roman Archidona



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)
 
iD8DBQFEtFAPQ/ddYKMfqaARAt8ZAJ91m1qOK0ssqwkR73DGBrDnKG2wvQCff45s
nCeS6o2yvI4LF6s0O/6Bb7U=
=ELEo
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2009-04-29 13:34 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-28 16:06 Register Usage John Farmer
2009-04-28 16:50 ` Ian Lance Taylor
2009-04-28 22:06   ` John Farmer
2009-04-29  0:27     ` Ian Lance Taylor
2009-04-29  7:57       ` John Farmer
2009-04-29  9:27     ` Richard Earnshaw
2009-04-29 10:18       ` John Farmer
2009-04-29 10:38         ` Richard Earnshaw
2009-04-29 12:14           ` John Farmer
2009-04-29 13:34             ` Richard Earnshaw
  -- strict thread matches above, loose matches on Subject: below --
2006-07-12  1:27 gcc binary format output Victor Roman Archidona
2006-07-12  4:39 ` Ian Lance Taylor
2006-07-12  5:35   ` Victor Roman Archidona
2006-07-12  5:57     ` Ian Lance Taylor
2006-07-12  8:58       ` register usage Petar Bajic
2006-07-12 12:48         ` Andrew Haley
2006-07-13 12:33           ` Petar Bajic
2006-07-13 12:45             ` Andrew Haley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).