GCC behavior for unresolved weak functions
问题 Consider the simple program below: __attribute__((weak)) void weakf(void); int main(int argc, char *argv[]) { weakf(); } When compiling this with gcc and running it on a Linux PC, it segfaults. When running it on ARM CM0 (arm-none-eabi-gcc), the linker replace the undefined symbol by a jump to the following instruction and a nop. Where is this behavior documented? Is there possible ways to change it through command line options? I have been through GCC and LD documentations, there is no