summaryrefslogtreecommitdiff
path: root/sys/lib
diff options
context:
space:
mode:
authormatt <matt@NetBSD.org>2013-08-12 23:22:12 +0000
committermatt <matt@NetBSD.org>2013-08-12 23:22:12 +0000
commit0cfee468ec5b3bafcb515ec0b0ecbcba3ab641e7 (patch)
treefc71a98549ff22fc1dd23021db16cc9b006ace98 /sys/lib
parent66c60ee4406ce58f65104f0350250c467bb864c2 (diff)
Add EHABI unwind stubs to libkern so prevent errors in linking if unwind
tables are present.
Diffstat (limited to 'sys/lib')
-rw-r--r--sys/lib/libkern/arch/arm/Makefile.inc3
-rw-r--r--sys/lib/libkern/arch/arm/unwind_stub.c44
2 files changed, 46 insertions, 1 deletions
diff --git a/sys/lib/libkern/arch/arm/Makefile.inc b/sys/lib/libkern/arch/arm/Makefile.inc
index bb3634998fa..8df02399dcb 100644
--- a/sys/lib/libkern/arch/arm/Makefile.inc
+++ b/sys/lib/libkern/arch/arm/Makefile.inc
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.18 2013/06/21 05:06:24 matt Exp $
+# $NetBSD: Makefile.inc,v 1.19 2013/08/12 23:22:12 matt Exp $
SRCS+= byte_swap_2.S byte_swap_4.S
SRCS+= ffs.S
@@ -8,5 +8,6 @@ SRCS+= modsi3.S umodsi3.S
.if !empty(MACHINE_ARCH:Mearm*)
SRCS+= __aeabi_ldivmod.S __aeabi_uldivmod.S __aeabi_lcmp.c __aeabi_ulcmp.c
+SRCS+= unwind_stub.c
.else
.endif
diff --git a/sys/lib/libkern/arch/arm/unwind_stub.c b/sys/lib/libkern/arch/arm/unwind_stub.c
new file mode 100644
index 00000000000..7522d33fbdd
--- /dev/null
+++ b/sys/lib/libkern/arch/arm/unwind_stub.c
@@ -0,0 +1,44 @@
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(1, "$NetBSD: unwind_stub.c,v 1.1 2013/08/12 23:22:12 matt Exp $");
+
+#include <arm/ehabi.h>
+
+static _Unwind_Reason_Code __used
+__aeabi_unwind_cpp_stub(_Unwind_State state, _Unwind_Control_Block *ucbp,
+ _Unwind_Context *context)
+{
+ return _URC_FAILURE;
+}
+
+__weak_alias(__aeabi_unwind_cpp_cp0, __aeabi_unwind_cpp_stub)
+__weak_alias(__aeabi_unwind_cpp_cp1, __aeabi_unwind_cpp_stub)
+__weak_alias(__aeabi_unwind_cpp_cp2, __aeabi_unwind_cpp_stub)