This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re:Re: gcc Cortex M4 bug ?
- From: matti h <matti at henttunen dot se>
- To: gcc-help at gcc dot gnu dot org <gcc-help at gcc dot gnu dot org>
- Date: Fri, 14 Jun 2013 10:43:10 +0200
- Subject: Re:Re: gcc Cortex M4 bug ?
- Reply-to: matti at henttunen dot se
Not sure what you think looks insane?
the instructions or the code I use ?
Anyway's Ive tried to compile the same code on linux-eabi aswell
with the same incorrect results.
/Matias
13.6.2013 12:25, matti h kirjoitti:
Hi,
Im trying to implement a dynamic linker for M4 mcu's.
But the generated code from gcc seems incorrect to me: im compiling using
arm-none-eabi-gcc: -mcpu=cortex-m4 -mthumb -O2 -ggdb -Wstrict-prototypes
-Wunused-parameter -lmylib main.c -o test
For me this all looks insane :(
I would expect the 'arm-eabi' target being purely static and not knowing anything about shared libraries and dynamic linking, something equivalent to the 'arm-elf' target but with somehow different object format. Meanwhile targets like 'arm-linux*', 'arm-*bsd' etc. will
support dynamic linking. If we look at the Wikipedia page :
http://en.wikipedia.org/wiki/Application_binary_interface
there is told :
"The main differences of an EABI with respect to an ABI for general purpose operating systems are that privileged instructions are allowed in application code, dynamic linking is not required (sometimes it is completely disallowed), and a more compact stack frame
organization is used to save memory."
So if you change your target choice for instance to 'arm-linux-gnueabi' then you of course can produce shared libraries (.so files) etc. for some "equivalent" own operating system
which uses the same object format...