Index: src/InitTweak/FixGlobalInit.cc
===================================================================
--- src/InitTweak/FixGlobalInit.cc	(revision 0b18db76df6d17b47d855d5c56769c62d063e6ea)
+++ src/InitTweak/FixGlobalInit.cc	(revision f1791a44d781391f73246886d5da188e94e3110a)
@@ -112,20 +112,5 @@
 			} // if
 			if ( Statement * ctor = ctorInit->ctor ) {
-				// Translation 1: Add this attribute on the global declaration:
-				//    __attribute__((section (".data#")))
-				// which makes gcc put the global in the data section,
-				// so that the global is writeable (via a const cast) in the init function.
-				// The trailing # is an injected assembly comment, to suppress the "a" in
-				//    .section .data,"a"
-				//    .section .data#,"a"
-				// to avoid assembler warning "ignoring changed section attributes for .data"
-				Type *strLitT = new PointerType( Type::Qualifiers( ),
-					new BasicType( Type::Qualifiers( ), BasicType::Char ) );
-				std::list< Expression * > attr_params;
-				attr_params.push_back( 
-					new ConstantExpr( Constant( strLitT, "\".data#\"", std::nullopt ) ) );
-				objDecl->attributes.push_back(new Attribute("section", attr_params));
-				// Translation 2: Move the initizliation off the global declaration,
-				// into the startup function.
+				addDataSectonAttribute( objDecl );
 				initStatements.push_back( ctor );
 				objDecl->init = nullptr;
Index: src/InitTweak/FixInit.cc
===================================================================
--- src/InitTweak/FixInit.cc	(revision 0b18db76df6d17b47d855d5c56769c62d063e6ea)
+++ src/InitTweak/FixInit.cc	(revision f1791a44d781391f73246886d5da188e94e3110a)
@@ -802,4 +802,10 @@
 				if ( Statement * ctor = ctorInit->get_ctor() ) {
 					if ( objDecl->get_storageClasses().is_static ) {
+
+						// The ojbect needs to go in the data section, regardless of dtor complexity below.
+						// The attribute works, and is meant to apply, both for leaving the static local alone,
+						// and for hoisting it out as a static global.
+						addDataSectonAttribute( objDecl );
+
 						// originally wanted to take advantage of gcc nested functions, but
 						// we get memory errors with this approach. To remedy this, the static
Index: src/InitTweak/InitTweak.cc
===================================================================
--- src/InitTweak/InitTweak.cc	(revision 0b18db76df6d17b47d855d5c56769c62d063e6ea)
+++ src/InitTweak/InitTweak.cc	(revision f1791a44d781391f73246886d5da188e94e3110a)
@@ -1055,3 +1055,13 @@
 		return isCopyFunction( decl, "?{}" );
 	}
+
+	void addDataSectonAttribute( ObjectDecl * objDecl ) {
+		Type *strLitT = new PointerType( Type::Qualifiers( ),
+			new BasicType( Type::Qualifiers( ), BasicType::Char ) );
+		std::list< Expression * > attr_params;
+		attr_params.push_back( 
+			new ConstantExpr( Constant( strLitT, "\".data#\"", std::nullopt ) ) );
+		objDecl->attributes.push_back(new Attribute("section", attr_params));
+	}
+
 }
Index: src/InitTweak/InitTweak.h
===================================================================
--- src/InitTweak/InitTweak.h	(revision 0b18db76df6d17b47d855d5c56769c62d063e6ea)
+++ src/InitTweak/InitTweak.h	(revision f1791a44d781391f73246886d5da188e94e3110a)
@@ -103,4 +103,15 @@
 	bool isConstExpr( Initializer * init );
 
+	/// Modifies objDecl to have:
+	///    __attribute__((section (".data#")))
+	/// which makes gcc put the declared variable in the data section,
+	/// which is helpful for global constants on newer gcc versions,
+	/// so that CFA's generated initialization won't segfault when writing it via a const cast.
+	/// The trailing # is an injected assembly comment, to suppress the "a" in
+	///    .section .data,"a"
+	///    .section .data#,"a"
+	/// to avoid assembler warning "ignoring changed section attributes for .data"
+	void addDataSectonAttribute( ObjectDecl * objDecl );
+
 	class InitExpander_old {
 	public:
Index: tests/.expect/const-init.txt
===================================================================
--- tests/.expect/const-init.txt	(revision 0b18db76df6d17b47d855d5c56769c62d063e6ea)
+++ tests/.expect/const-init.txt	(revision f1791a44d781391f73246886d5da188e94e3110a)
@@ -1,1 +1,2 @@
-done
+almost done
+dtor
Index: tests/const-init.cfa
===================================================================
--- tests/const-init.cfa	(revision 0b18db76df6d17b47d855d5c56769c62d063e6ea)
+++ tests/const-init.cfa	(revision f1791a44d781391f73246886d5da188e94e3110a)
@@ -16,11 +16,11 @@
 /*
 
-This test shows non-crashing of generated code for constants with interesting initizers.
+These tests show non-crashing of generated code for constants with interesting initializers.
 The potential for these to crash is compiler dependent.
 
 There are two cases:
-1. static constants in one compilation unit (tested here)
+1. static constants in one compilation unit (tested here, in a few sub-cases)
 2. extern constants across compilation units (tested by libcfa being loadable, specifically
-   the constant declarations in libcfa/src/limits.cfa, which almost every test exercises,
+   the constant definitions in libcfa/src/limits.cfa, which almost every test exercises,
    including "hello;" but notably, the "limits" test does not exercise it because that test
    is compile-only)
@@ -37,12 +37,24 @@
 GCC-10 on Ubuntu 20.04    Has crashed      Has crashed
 
-For this test case to fail, with most other tests passing, would be a situation only ever
+For this test to fail, with most other tests passing, would be a situation only ever
 observed with GCC-8.
 
 */
 
+// initailized by generated function, called before main
 static const char foo = -1;
 
+struct thing{};
+void ^?{}( thing & ) { printf("dtor\n"); }
+
 int main() {
-    printf("done\n");
+    // foo is already initialized
+
+    // no dtor => stays a (static) local, initialized here
+    static const char bar = -1;
+
+    // has dtor => becomes a global, ctor called here, dtor called at exit
+    static const thing it;
+
+    printf("almost done\n");
 }
