Browse Source

fix(linker): old 'ctors' won't be called

greatbridf 2 years ago
parent
commit
896023acbf
1 changed files with 2 additions and 0 deletions
  1. 2 0
      ldscript.ld

+ 2 - 0
ldscript.ld

@@ -48,6 +48,8 @@ SECTIONS
         start_ctors = .;
         KEEP(*(.init_array));
         KEEP(*(SORT_BY_INIT_PRIORITY(.init_array*)));
+        KEEP(*(.ctors));
+        KEEP(*(SORT_BY_INIT_PRIORITY(.ctors*)));
         end_ctors = .;
 
         *(.data)