0001-Fix-undefined-reference-to-__data_start-linker-error.patch 1.0 KB

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