1From 301ef15aefa6764466c374d07efb511b1c3862cc Mon Sep 17 00:00:00 2001
2From: Nikita Ermakov <coffe92@gmail.com>
3Date: Wed, 20 May 2020 17:57:17 +0300
4Subject: [PATCH] Fix 'undefined reference to __data_start' linker error on
5 RISC-V
6
7Issue #294 (bdwgc).
8
9* include/private/gcconfig.h [RISCV && LINUX] (__data_start): Add
10attribute(weak).
11
12(cherry picked from commit 538562ad01b181f4cc3913da1ac06a77945cd9b9)
13Signed-off-by: Romain Naour <romain.naour@gmail.com>
14---
15 include/private/gcconfig.h | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
19index d9d45da1..d6cefa6f 100644
20--- a/include/private/gcconfig.h
21+++ b/include/private/gcconfig.h
22@@ -2943,7 +2943,7 @@ EXTERN_C_BEGIN
23 #   define ALIGNMENT (CPP_WORDSZ/8)
24 #   ifdef LINUX
25 #     define OS_TYPE "LINUX"
26-      extern int __data_start[];
27+      extern int __data_start[] __attribute__((__weak__));
28 #     define DATASTART ((ptr_t)__data_start)
29 #     define LINUX_STACKBOTTOM
30 #     define DYNAMIC_LOADING
31--
322.30.2
33
34