From 9f1803a2f91d59a9478ca4d8d93e1de5c62671e5 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 18 Mar 2015 00:55:53 +0000
Subject: [PATCH] eglibc: Resolve __fpscr_values on SH4

2010-09-29  Nobuhiro Iwamatsu  <iwamatsu@nigauri.org>
            Andrew Stubbs  <ams@codesourcery.com>

        Resolve SH's __fpscr_values to symbol in libc.so.

        * sysdeps/sh/sh4/fpu/fpu_control.h: Add C++ __set_fpscr prototype.
        * sysdeps/unix/sysv/linux/sh/Versions (GLIBC_2.2): Add __fpscr_values.
        * sysdeps/unix/sysv/linux/sh/sysdep.S (___fpscr_values): New constant.

Upstream-Status: Pending

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 sysdeps/unix/sysv/linux/sh/Versions |  1 +
 sysdeps/unix/sysv/linux/sh/sysdep.S | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/sh/Versions b/sysdeps/unix/sysv/linux/sh/Versions
index 9c734ff755..974e33b4b1 100644
--- a/sysdeps/unix/sysv/linux/sh/Versions
+++ b/sysdeps/unix/sysv/linux/sh/Versions
@@ -3,6 +3,7 @@ libc {
   GLIBC_2.2 {
     # functions used in other libraries
     __xstat64; __fxstat64; __lxstat64;
+    __fpscr_values;
 
     # a*
     alphasort64;
diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.S b/sysdeps/unix/sysv/linux/sh/sysdep.S
index c5e3a7a365..35120031c4 100644
--- a/sysdeps/unix/sysv/linux/sh/sysdep.S
+++ b/sysdeps/unix/sysv/linux/sh/sysdep.S
@@ -30,3 +30,14 @@ ENTRY (__syscall_error)
 
 #define __syscall_error __syscall_error_1
 #include <sysdeps/unix/sh/sysdep.S>
+
+       .data
+       .align 3
+       .globl ___fpscr_values
+       .type ___fpscr_values, @object
+       .size ___fpscr_values, 8
+___fpscr_values:
+       .long 0
+       .long 0x80000
+weak_alias (___fpscr_values, __fpscr_values)
+
