From 41d83a92776e77bf82461d0219ad9720702b20c4 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 3ad702e165..931985b5d6 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 db898e9e39..6e2972e814 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)
+
