Index: src/CodeGen/LinkOnce.cc
===================================================================
--- src/CodeGen/LinkOnce.cc	(revision d2afe17c25e7b92a47ed55721e2c16042c6f28d2)
+++ src/CodeGen/LinkOnce.cc	(revision d2afe17c25e7b92a47ed55721e2c16042c6f28d2)
@@ -0,0 +1,65 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2021 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// LinkOnce.cc -- Translate the cfa_linkonce attribute.
+//
+// Author           : Andrew Beach
+// Created On       : Thur May 13 10:10:00 2021
+// Last Modified By : Andrew Beach
+// Last Modified On : Thur May 13 14:39:00 2021
+// Update Count     : 0
+//
+
+#include "LinkOnce.h"
+
+#include <algorithm>
+
+#include "Common/PassVisitor.h"       // for PassVisitor, WithShortCircuiting
+
+namespace CodeGen {
+
+static bool is_cfa_linkonce( Attribute const * attr ) {
+	return std::string("cfa_linkonce") == attr->name;
+}
+
+static bool is_section_attribute( Attribute const * attr ) {
+	return std::string("section") == attr->name;
+}
+
+class LinkOnceVisitorCore : public WithShortCircuiting {
+public:
+	void previsit( Declaration * ) {
+		visit_children = false;
+	}
+
+	void previsit( DeclarationWithType * decl ) {
+		std::list< Attribute * > & attributes = decl->attributes;
+		// See if we can find the element:
+		auto found = std::find_if(attributes.begin(), attributes.end(), is_cfa_linkonce );
+		if ( attributes.end() != found ) {
+			// Remove any other sections:
+			attributes.remove_if( is_section_attribute );
+			// Iterator to the cfa_linkonce attribute should still be valid.
+			Attribute * attribute = *found;
+			assert( attribute->parameters.empty() );
+			assert( !decl->mangleName.empty() );
+			// Overwrite the attribute in place.
+			const std::string section_name = ".gnu.linkonce." + decl->mangleName;
+			attribute->name = "section";
+			attribute->parameters.push_back(
+				new ConstantExpr( Constant::from_string( section_name ) )
+			);
+		}
+		visit_children = false;
+	}
+};
+
+void translateLinkOnce( std::list< Declaration *> & translationUnit ) {
+	PassVisitor<LinkOnceVisitorCore> translator;
+	acceptAll( translationUnit, translator );
+}
+
+}
Index: src/CodeGen/LinkOnce.h
===================================================================
--- src/CodeGen/LinkOnce.h	(revision d2afe17c25e7b92a47ed55721e2c16042c6f28d2)
+++ src/CodeGen/LinkOnce.h	(revision d2afe17c25e7b92a47ed55721e2c16042c6f28d2)
@@ -0,0 +1,34 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2021 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// LinkOnce.h -- Translate the cfa_linkonce attribute.
+//
+// Author           : Andrew Beach
+// Created On       : Thur May 13 10:06:00 2021
+// Last Modified By : Andrew Beach
+// Last Modified On : Thur May 13 14:38:00 2021
+// Update Count     : 0
+//
+
+#pragma once
+
+// This could either be an early step in code-generation or a step of the
+// Cforall to C lowering. It could also be part of attribute handling but
+// for now its almost the only attribute we handle.
+
+#include <list>  // for list
+
+class Declaration;
+
+namespace CodeGen {
+
+void translateLinkOnce( std::list< Declaration *> & translationUnit );
+/* Convert the cfa_linkonce attribute on top level declaration into
+ * a special section declaration (.gnu.linkonce) so that it may be defined
+ * multiple times (same name and same type, must have the same value).
+ */
+
+}
Index: src/CodeGen/module.mk
===================================================================
--- src/CodeGen/module.mk	(revision 2d019af1e5dc0df0ad2bbe9c215b4c34968890c0)
+++ src/CodeGen/module.mk	(revision d2afe17c25e7b92a47ed55721e2c16042c6f28d2)
@@ -25,4 +25,6 @@
 	CodeGen/GenType.cc \
 	CodeGen/GenType.h \
+	CodeGen/LinkOnce.cc \
+	CodeGen/LinkOnce.h \
 	CodeGen/OperatorTable.cc \
 	CodeGen/OperatorTable.h \
