0

I'm using Linaro GCC version 6.3.1 to compile my C++ program.

When debugging instruction by instruction, in eclipse (Xilinx SDK 2017.1), I get an undefined instruction fault at the instruction address 0x1090d8 as below: enter image description here

This instruction is part of the __libc_init_array function which is called before my main.

I already tried calling the arm-eabi-g++ with the linker flags -mthumb and -marm but the result is the same. I always get the same fault (despite at different locations) and I'm not able to jump to my main function.

I'm using a Zybo Zynq-7000 with two Cortex-A9 processors

Thanks

Clifford
  • 88,407
  • 13
  • 85
  • 165
JonAlmos
  • 31
  • 5
  • Do not run the program before setting a break point on `start`. Use `b start` and then use `run`. This should break immediately before any libc startup code is run. Some static constructor and or other pre-main code is causing a memory or stack corruption. The function may be `_start` depending. – artless noise Jun 06 '17 at 16:26
  • @artlessnoise Forgot to mention that I also use the -nodefaultlibs -nostdlib options so I think I don't call the start function or libc code. – JonAlmos Jun 06 '17 at 16:55
  • Ah, but that start code initializes C++ static constructors and other things (zero BSS, etc). If you have `linaro`, you use Linux? Then your executable entry point is traditionally 'start'. Use `readelf -h $1 | grep Entry` to check what your start is. – artless noise Jun 07 '17 at 14:55

0 Answers0