Index: uspace/lib/c/arch/abs32le/_link.ld.in
===================================================================
--- uspace/lib/c/arch/abs32le/_link.ld.in	(revision d62d2c67607ae1bff7597845bd82b7669c37c0f7)
+++ uspace/lib/c/arch/abs32le/_link.ld.in	(revision c12d5673ded38542c8a95d5447b9ca636fa3f120)
@@ -55,4 +55,20 @@
 	} :data
 
+    __dso_handle = .;
+
+	.init_array : {
+		PROVIDE_HIDDEN (__init_array_start = .);
+		KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
+		KEEP (*(.init_array .ctors))
+		PROVIDE_HIDDEN (__init_array_end = .);
+	}
+
+	.fini_array : {
+		PROVIDE_HIDDEN (__fini_array_start = .);
+		KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
+		KEEP (*(.fini_array .dtors))
+		PROVIDE_HIDDEN (__fini_array_end = .);
+	}
+
 	_end = .;
 
Index: uspace/lib/c/arch/arm32/_link.ld.in
===================================================================
--- uspace/lib/c/arch/arm32/_link.ld.in	(revision d62d2c67607ae1bff7597845bd82b7669c37c0f7)
+++ uspace/lib/c/arch/arm32/_link.ld.in	(revision c12d5673ded38542c8a95d5447b9ca636fa3f120)
@@ -53,4 +53,20 @@
 	} :data
 
+    __dso_handle = .;
+
+	.init_array : {
+		PROVIDE_HIDDEN (__init_array_start = .);
+		KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
+		KEEP (*(.init_array .ctors))
+		PROVIDE_HIDDEN (__init_array_end = .);
+	}
+
+	.fini_array : {
+		PROVIDE_HIDDEN (__fini_array_start = .);
+		KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
+		KEEP (*(.fini_array .dtors))
+		PROVIDE_HIDDEN (__fini_array_end = .);
+	}
+
 	_end = .;
 
Index: uspace/lib/c/arch/ia32/_link.ld.in
===================================================================
--- uspace/lib/c/arch/ia32/_link.ld.in	(revision d62d2c67607ae1bff7597845bd82b7669c37c0f7)
+++ uspace/lib/c/arch/ia32/_link.ld.in	(revision c12d5673ded38542c8a95d5447b9ca636fa3f120)
@@ -114,4 +114,20 @@
 	} :data
 
+    __dso_handle = .;
+
+	.init_array : {
+		PROVIDE_HIDDEN (__init_array_start = .);
+		KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
+		KEEP (*(.init_array .ctors))
+		PROVIDE_HIDDEN (__init_array_end = .);
+	}
+
+	.fini_array : {
+		PROVIDE_HIDDEN (__fini_array_start = .);
+		KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
+		KEEP (*(.fini_array .dtors))
+		PROVIDE_HIDDEN (__fini_array_end = .);
+	}
+
 	_end = .;
 
Index: uspace/lib/c/arch/ia64/_link.ld.in
===================================================================
--- uspace/lib/c/arch/ia64/_link.ld.in	(revision d62d2c67607ae1bff7597845bd82b7669c37c0f7)
+++ uspace/lib/c/arch/ia64/_link.ld.in	(revision c12d5673ded38542c8a95d5447b9ca636fa3f120)
@@ -62,4 +62,20 @@
 	} :data
 
+    __dso_handle = .;
+
+	.init_array : {
+		PROVIDE_HIDDEN (__init_array_start = .);
+		KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
+		KEEP (*(.init_array .ctors))
+		PROVIDE_HIDDEN (__init_array_end = .);
+	}
+
+	.fini_array : {
+		PROVIDE_HIDDEN (__fini_array_start = .);
+		KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
+		KEEP (*(.fini_array .dtors))
+		PROVIDE_HIDDEN (__fini_array_end = .);
+	}
+
 	_end = .;
 
Index: uspace/lib/c/arch/mips32/_link.ld.in
===================================================================
--- uspace/lib/c/arch/mips32/_link.ld.in	(revision d62d2c67607ae1bff7597845bd82b7669c37c0f7)
+++ uspace/lib/c/arch/mips32/_link.ld.in	(revision c12d5673ded38542c8a95d5447b9ca636fa3f120)
@@ -60,4 +60,20 @@
 	} :data
 
+    __dso_handle = .;
+
+	.init_array : {
+		PROVIDE_HIDDEN (__init_array_start = .);
+		KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
+		KEEP (*(.init_array .ctors))
+		PROVIDE_HIDDEN (__init_array_end = .);
+	}
+
+	.fini_array : {
+		PROVIDE_HIDDEN (__fini_array_start = .);
+		KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
+		KEEP (*(.fini_array .dtors))
+		PROVIDE_HIDDEN (__fini_array_end = .);
+	}
+
 	_end = .;
 
Index: uspace/lib/c/arch/ppc32/_link.ld.in
===================================================================
--- uspace/lib/c/arch/ppc32/_link.ld.in	(revision d62d2c67607ae1bff7597845bd82b7669c37c0f7)
+++ uspace/lib/c/arch/ppc32/_link.ld.in	(revision c12d5673ded38542c8a95d5447b9ca636fa3f120)
@@ -52,4 +52,20 @@
 	} :data
 
+    __dso_handle = .;
+
+	.init_array : {
+		PROVIDE_HIDDEN (__init_array_start = .);
+		KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
+		KEEP (*(.init_array .ctors))
+		PROVIDE_HIDDEN (__init_array_end = .);
+	}
+
+	.fini_array : {
+		PROVIDE_HIDDEN (__fini_array_start = .);
+		KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
+		KEEP (*(.fini_array .dtors))
+		PROVIDE_HIDDEN (__fini_array_end = .);
+	}
+
 	_end = .;
 
Index: uspace/lib/c/arch/riscv64/_link.ld.in
===================================================================
--- uspace/lib/c/arch/riscv64/_link.ld.in	(revision d62d2c67607ae1bff7597845bd82b7669c37c0f7)
+++ uspace/lib/c/arch/riscv64/_link.ld.in	(revision c12d5673ded38542c8a95d5447b9ca636fa3f120)
@@ -51,4 +51,20 @@
 	} :data
 
+    __dso_handle = .;
+
+	.init_array : {
+		PROVIDE_HIDDEN (__init_array_start = .);
+		KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
+		KEEP (*(.init_array .ctors))
+		PROVIDE_HIDDEN (__init_array_end = .);
+	}
+
+	.fini_array : {
+		PROVIDE_HIDDEN (__fini_array_start = .);
+		KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
+		KEEP (*(.fini_array .dtors))
+		PROVIDE_HIDDEN (__fini_array_end = .);
+	}
+
 	_end = .;
 
Index: uspace/lib/c/arch/sparc64/_link.ld.in
===================================================================
--- uspace/lib/c/arch/sparc64/_link.ld.in	(revision d62d2c67607ae1bff7597845bd82b7669c37c0f7)
+++ uspace/lib/c/arch/sparc64/_link.ld.in	(revision c12d5673ded38542c8a95d5447b9ca636fa3f120)
@@ -56,4 +56,20 @@
 	} :data
 
+    __dso_handle = .;
+
+	.init_array : {
+		PROVIDE_HIDDEN (__init_array_start = .);
+		KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
+		KEEP (*(.init_array .ctors))
+		PROVIDE_HIDDEN (__init_array_end = .);
+	}
+
+	.fini_array : {
+		PROVIDE_HIDDEN (__fini_array_start = .);
+		KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
+		KEEP (*(.fini_array .dtors))
+		PROVIDE_HIDDEN (__fini_array_end = .);
+	}
+
 	_end = .;
 
Index: uspace/lib/cpp/include/__bits/string/string.hpp
===================================================================
--- uspace/lib/cpp/include/__bits/string/string.hpp	(revision d62d2c67607ae1bff7597845bd82b7669c37c0f7)
+++ uspace/lib/cpp/include/__bits/string/string.hpp	(revision c12d5673ded38542c8a95d5447b9ca636fa3f120)
@@ -1495,5 +1495,5 @@
                     return max(capacity_ * 2, hint);
                 else
-                    return max(capacity_ * 2, 2ul);
+                    return max(capacity_ * 2, size_type{2u});
             }
 
Index: uspace/lib/cpp/src/__bits/runtime.cpp
===================================================================
--- uspace/lib/cpp/src/__bits/runtime.cpp	(revision d62d2c67607ae1bff7597845bd82b7669c37c0f7)
+++ uspace/lib/cpp/src/__bits/runtime.cpp	(revision c12d5673ded38542c8a95d5447b9ca636fa3f120)
@@ -194,3 +194,7 @@
         return nullptr;
     }
+
+    // Needed on arm.
+    extern "C" void __cxa_end_cleanup()
+    { /* DUMMY BODY */ }
 }
