aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-07-10 19:28:40 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-07-10 19:28:40 +0000
commit752fdaeb911e28d139baf4f04f019cf56e6cb7e9 (patch)
treec7d318bbddba47d86b110255c8178dc73586c283
parent34711f941c4a212e3bdf3b993ff6bfe1d21e4594 (diff)
downloadupstream-752fdaeb911e28d139baf4f04f019cf56e6cb7e9.tar.gz
upstream-752fdaeb911e28d139baf4f04f019cf56e6cb7e9.tar.bz2
upstream-752fdaeb911e28d139baf4f04f019cf56e6cb7e9.zip
gcc: backport a fix for issues with accessing weak data references
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41569 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--toolchain/gcc/patches/4.8-linaro/002-weak_data_fix.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/toolchain/gcc/patches/4.8-linaro/002-weak_data_fix.patch b/toolchain/gcc/patches/4.8-linaro/002-weak_data_fix.patch
new file mode 100644
index 0000000000..a740b4ce9e
--- /dev/null
+++ b/toolchain/gcc/patches/4.8-linaro/002-weak_data_fix.patch
@@ -0,0 +1,42 @@
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/visibility-21.c
+@@ -0,0 +1,14 @@
++/* PR target/32219 */
++/* { dg-do run } */
++/* { dg-require-visibility "" } */
++/* { dg-options "-fPIC" { target fpic } } */
++
++extern void f() __attribute__((weak,visibility("hidden")));
++extern int puts( char const* );
++int main()
++{
++ if (f)
++ f();
++ return 0;
++}
++
+--- a/gcc/varasm.c
++++ b/gcc/varasm.c
+@@ -6677,6 +6677,10 @@ default_binds_local_p_1 (const_tree exp,
+ /* Static variables are always local. */
+ else if (! TREE_PUBLIC (exp))
+ local_p = true;
++ /* hidden weak can't be overridden by something non-local, all
++ that is possible is that it is not defined at all. */
++ else if (DECL_WEAK (exp))
++ local_p = false;
+ /* A variable is local if the user has said explicitly that it will
+ be. */
+ else if ((DECL_VISIBILITY_SPECIFIED (exp)
+@@ -6690,11 +6694,6 @@ default_binds_local_p_1 (const_tree exp,
+ local. */
+ else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
+ local_p = true;
+- /* Default visibility weak data can be overridden by a strong symbol
+- in another module and so are not local. */
+- else if (DECL_WEAK (exp)
+- && !resolved_locally)
+- local_p = false;
+ /* If PIC, then assume that any global name can be overridden by
+ symbols resolved from other modules. */
+ else if (shlib)