I am compiling a project for armv6-m cortex-m1 in C ++ (gcc). I use the -nostdlib flag (as needed). ld does not find _start. I understand that you need to attach crt0 from newlib. I cling. Does not find exit and something else. I cling. And so on ... Prompt the Orthodox way to pick up everything you need. I do not use startup.s. Interrupt vectors in a C ++ header file. Is it C ++ or not? Why ctr0 and so on does not cling to the machine?

  • You can run g ++ instead of the linker, passing all the object files to it. He will understand that he needs to start the linker, and he will attach the necessary dependencies to it. To do this, in the Makefile you need to find something like ld=($toolchain)ld and replace it with ld=($toolchain)g++ . I do not remember the Makefile syntax, but the essence is this. - maestro
  • I write the makefile myself and don't touch ld directly - cipher_web
  • The question is closed. Added -nostartfiles and to reset, among other things, call main. I did not understand the _start () function, but something she would not do - I do not need it. Thank you all for participating! - cipher_web

1 answer 1

-nostartfiles and on reset, among other things, call main. I did not understand the _start () function, but that she wouldn’t do that