On Saturday, 1 March 2014 at 12:53:14 UTC, Johannes Pfau wrote:


However, someone also had this problem on this german site:
http://www.mikrocontroller.net/topic/312956

and the solution was that -mcpu alone was not good enough, he had to specify -march flags as well so please double-check your flags. It's possible that binutils doesn't work properly with -mcpu so I'd do this:

-march=armv7e-m -mcpu=cortex-m4 -mthumb -mtune=cortex-m4

Or better at configure time:

--with-arch=armv7e-m --with-cpu=cortex-m4 --with-mode=thumb --with-tune=cortex-m4

I read somewhere that -march is ignored when the more specific -mcpu is present. On the other hand, ld has no cpu option, only --architecture. That did not have any effect.

A little background: I have the main makefile and all definitions in toplevel directory. Libraries and projects are in subdirs. Any subdir makefile includes settings from topdir. In topdir I just give export projectdir=xxx and then run make. Any project in any language is run from the same makefile with the same settings. I use separate compiling and pass myself options to gcc, as and ld. A reduced version of this toolset is in the minlibd repo in tools directory.

I decided to rebuild all my apps and libs. Now I have lots of blx instructions in my code. So this is not related to exceptions. I just triggered this when playing with deh.d.

I have not been able to confirm this, but this may be something like when linking libraries that have unresolved symbols. If the symbol is already available, the call is bl, but if the symbol will be resolved from a later library, the call will be blx. Libgcc is always the last so any call to its functions will be blx.

When I compile my c only project, I will not get these calls. I have compared the object list files but I can not find any meaningful difference. Could it be possible that gdc generated asm files have some attribute/directive/segment name/whatever that changes the behavior in ld. Obviously there are more segments in d executable, like unwind and debug info. What is the thing that makes it different for ld?

Reply via email to