summaryrefslogtreecommitdiff
path: root/meta-xilinx/meta-microblaze/recipes-devtools/binutils/binutils/0031-ldlang.c-Workaround-for-improper-address-mapping-cau.patch
blob: fda23a1a5fc4754cfdb4ee395b7cdbbce4becae0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 23f0f6e8281b5cd481ef7636739c07b446828f7e Mon Sep 17 00:00:00 2001
From: Mahesh Bodapati <mbodapat@xilinx.com>
Date: Wed, 17 Jun 2020 21:20:26 +0530
Subject: [PATCH 31/40] ldlang.c: Workaround for improper address mapping
 causing runtime loops

[Patch,MicroBlaze] : improper address mapping of PROVIDE directive
symbols[DTOR_END] are causing runtime loops and we don't need to override
PROVIDE symbols if symbols are defined in libraries and linker so I am
disabling override for PROVIDE symbols.
---
 ld/ldlang.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/ld/ldlang.c b/ld/ldlang.c
index 9977195074a..9e2c1da066e 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -3657,9 +3657,15 @@ open_input_bfds (lang_statement_union_type *s, enum open_bfd_mode mode)
 	    plugin_insert = NULL;
 #endif
 	  break;
+	/* This is from a --defsym on the command line.  */
 	case lang_assignment_statement_enum:
 	  if (s->assignment_statement.exp->type.node_class != etree_assert)
-	    exp_fold_tree_no_dot (s->assignment_statement.exp);
+	    {
+	      if(!(s->assignment_statement.exp->assign.defsym) && (s->assignment_statement.exp->type.node_class == etree_provide))
+		;
+	      else
+		exp_fold_tree_no_dot (s->assignment_statement.exp);
+	    }
 	  break;
 	default:
 	  break;
-- 
2.17.1