summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.9/0024-PR-target-32219.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.9/0024-PR-target-32219.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.9/0024-PR-target-32219.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0024-PR-target-32219.patch b/meta/recipes-devtools/gcc/gcc-4.9/0024-PR-target-32219.patch
new file mode 100644
index 0000000000..45acf7fd23
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0024-PR-target-32219.patch
@@ -0,0 +1,62 @@
1From e0d15f4f8bf28c351b9215ca37f1caa24df0e1fd Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 09:18:54 +0400
4Subject: [PATCH 24/35] PR target/32219
5
6* varasm.c (default_binds_local_p_1): Weak data is not local.
7
8Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
11Upstream-Status: Backport
12---
13 gcc/testsuite/gcc.dg/visibility-21.c | 14 ++++++++++++++
14 gcc/varasm.c | 9 ++++-----
15 2 files changed, 18 insertions(+), 5 deletions(-)
16 create mode 100644 gcc/testsuite/gcc.dg/visibility-21.c
17
18Index: gcc-4.9-20140316/gcc/varasm.c
19===================================================================
20--- gcc-4.9-20140316.orig/gcc/varasm.c
21+++ gcc-4.9-20140316/gcc/varasm.c
22@@ -6771,6 +6771,10 @@ default_binds_local_p_1 (const_tree exp,
23 /* Static variables are always local. */
24 else if (! TREE_PUBLIC (exp))
25 local_p = true;
26+ /* hidden weak can't be overridden by something non-local, all
27+ that is possible is that it is not defined at all. */
28+ else if (DECL_WEAK (exp))
29+ local_p = false;
30 /* A variable is local if the user has said explicitly that it will
31 be. */
32 else if ((DECL_VISIBILITY_SPECIFIED (exp)
33@@ -6784,11 +6788,6 @@ default_binds_local_p_1 (const_tree exp,
34 local. */
35 else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
36 local_p = true;
37- /* Default visibility weak data can be overridden by a strong symbol
38- in another module and so are not local. */
39- else if (DECL_WEAK (exp)
40- && !resolved_locally)
41- local_p = false;
42 /* If PIC, then assume that any global name can be overridden by
43 symbols resolved from other modules. */
44 else if (shlib)
45Index: gcc-4.9-20140316/gcc/testsuite/gcc.dg/visibility-22.c
46===================================================================
47--- /dev/null
48+++ gcc-4.9-20140316/gcc/testsuite/gcc.dg/visibility-22.c
49@@ -0,0 +1,13 @@
50+/* PR target/32219 */
51+/* { dg-do run } */
52+/* { dg-require-visibility "" } */
53+/* { dg-options "-fPIC" { target fpic } } */
54+
55+extern void f() __attribute__((weak,visibility("hidden")));
56+extern int puts( char const* );
57+int main()
58+{
59+ if (f)
60+ f();
61+ return 0;
62+}