unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v4 00/11] nds32 glibc port, v4
@ 2019-06-05 11:56 Vincent Chen
  2019-06-05 11:56 ` [PATCH v4 01/11] nds32: Build Infastructure Vincent Chen
                   ` (12 more replies)
  0 siblings, 13 replies; 28+ messages in thread
From: Vincent Chen @ 2019-06-05 11:56 UTC (permalink / raw
  To: libc-alpha, joseph; +Cc: deanbo422, cnoize, vincentc

  This is the fourth version of the nds32 port. I am sorry that one year has
passed since the previous submission. The most obvious modification in this
version patchset is that FPU extension is supported now.In addition,
the mainline of gcc and binutils has contained the nds32 ports.Hence, the
nds32 toolchain without FPU extension support can be derived through
build-many-glibcs.py. The toolchain with FPU extension needs an extra kernel
patchset to successfully compile. This patchset has been pulled and may be
released in 5.2 rc-4. The implementations for nds32 FPU extension are like
other architecture except for the following two parts.

Part 1. The calling convention for variable argument function.
          The ABI of nds32 FPU is different to the original ABI, especially
        in the transmission of variable arguments.In nds32 original ABI, if
        the summation of the number of variable arguments and the constant
        arguments are lesser than 6, the caller function still uses general
        purpose register to pass the variable argument.However, in nds32 FPU
        extension ABI, the caller function directly places the variable
        arguments to stack no matter what the number of argument. This causes
        these functions with variable arguments cannot use internal_syscallX
        macro to issue syscall. Hence the generic builds from syscalls.list
        cannot be used for nds32 FPU extension ABI.
Part 2. Overcome the limitation of nds32 FPU on denormalize output.
          For most floating point instructions, the denormalized output is
        treated as an underflow case.Hence, if the underflow trap is not
        enabled, the output is rounded to a normalized number according to
        the rounding mode. The accuracy loss from the approximation is
        possibly not acceptable for some applications. Hence we added an nds32
        specific feature that the kernel can intervene in this kind of
        floating point operation and recalculate it by kernel's soft-fp
        module.In order for the kernel to capture each denormalized output,
        the underflow and inexact bit in $fpcsr, floating pointer control
        status register, should be set when this feature is enabled in the
        kernel. In addition, a new kernel parameter, UDF_IEX_trap, replaces
        $fpcsr to control the state of the user's inexact and underflow trap.
        Hence each operation as regard the floating point environment needs to
        issue a syscall with the number NR_fp_udfiex_crtl to access the
        parameter UDF_IEX_trap to get the state of inexact and underflow trap.
        In this mechanism, kernel uses the initial value of $fpcsr to notify
        glibc whether this feature is enable or not. To avoid overriding the
        initial value of $fpcsr, nds32 specific function __setfpucw is defined.

  From the recent discussions in mailing list, I know that the functions such as
clock_settime for Y2038-proof syscall are under development, and I guess that
these functions may not ready before glibc-2.30 code freeze. If nds32 port is
approved by maintainers to the upstream in glibc-2.30 release, does it mean
nds32 ports need to support Y2038-incompatiable functions ? Please correct me
if I have wrong understanding.


The patchest has been cross-tested on the FPGA board based on Linux 5.2 rc-2
and glibc commit 004e52f ebf30012ab (May 21).

The detail result
https://github.com/andestech/glibc/blob/nds32-glibc-2.29-v4/nds32_v3_glibc_test_result.tar.gz
https://github.com/andestech/glibc/blob/nds32-glibc-2.29-v4/nds32_v3f_glibc_test_result.tar.gz

A. Summarize for test results

   A1. nds32 port with FP extension toolchain
     53 FAIL (15 XFAIL cases are not included)
     4983 PASS
     34 UNSUPPORTED
   A2. nds32 port
     32 FAIL (15 XFAIL cases are not included)
     5003 PASS
     34 UNSUPPORTED

   The FAIL cases of nds32 FP extension toolchain are same to the nds32
   toolchain except for 20 FAIL cases in math and stdlib/tst-tininess.
   nds32 toolchain pass these 21 testcases.

B. The analysis of FAIL cases: 
   1. The following 20 cases have same error behevior, namespace violation:
      "SIOCGSTAMP_OLD", "SIOCGSTAMPNSD", "fds_bits" and "val". The cause of 
      the first two cases, "SIOCGSTAMP_OLD" and "SIOCGSTAMPNSD", is the same
      that Linux kernel recently added the definition of these two macros in
      asm-generic/sockios.h. For the last two cases, kernel header
      uapi/asm-generic/socket.h includes linux/posix_types.h instead of
      asm/bitsperlong.h. This change introduces the two variables "fds_bits"
      and "val" declared in the linux/posix_types.h and
      asm-generic/posix_types.h.
      conform/XOPEN2K/netinet/in.h/conform
      conform/XOPEN2K/sys/socket.h/conform
      conform/XOPEN2K/netdb.h/conform
      conform/XOPEN2K/arpa/inet.h/conform
      conform/XPG42/netinet/in.h/conform
      conform/XPG42/sys/socket.h/conform
      conform/XPG42/netdb.h/conform
      conform/XPG42/arpa/inet.h/conform
      conform/POSIX2008/netinet/in.h/conform
      conform/POSIX2008/sys/socket.h/conform
      conform/POSIX2008/netdb.h/conform
      conform/POSIX2008/arpa/inet.h/conform
      conform/UNIX98/netinet/in.h/conform
      conform/UNIX98/sys/socket.h/conform
      conform/UNIX98/netdb.h/conform
      conform/UNIX98/arpa/inet.h/conform
      conform/XOPEN2K8/netinet/in.h/conform
      conform/XOPEN2K8/sys/socket.h/conform
      conform/XOPEN2K8/netdb.h/conform
      conform/XOPEN2K8/arpa/inet.h/conform

   2. locale/tst-locale-locpath
        I found that the failure is caused by missing the environment parameter
      when this testcase is executed on FPGA through cross-test-ssh.sh. I try
      to modify the Makefile rule of tst-locale-locpath.out to "$(SHELL) $<
      '$(common-objpfx)' '$(test-wrapper-env)' '$(run_program_env)' > $ @;"
      .However, the content of $ (run_program_env) is empty so that the
      environment parameter is still empty.
        The testcase passed if I set the environment parameters by manually.

   3. libio/tst-wfile-sync.test-result
        The testcases will try to operate the standard input file by lseek
      function. However, the standard input is pipe instead of file if this
      testcase run on FPGA through cross-test-ssh.sh. This causes testcase gets
      an unexpected error ESPIPE from the return of the lseek function.
        The testcase passed if it was directly executed on FPGA board.

   4. sysvipc/test-sysvsem.test-result
	This testcase fails due to unexpected error number, EINVAL, from
      function semtimedop. The bug is due to wrong syscall handler of
      NR_semtimedop for native 32bit architecture. In Linux 5.2 rc2, the syscall
      handler selection of NR_semtimedop is through 
      __SC_COMP(__NR_semtimedop, sys_semtimedop, sys_semtimedop_time32). It
      makes the native 32-bit architecture always select the function
      sys_semtimedop as the syscall handler, which uses a 64-bit timespec to
      parse the input parameter timeout. I had sent a mail to check the
      correctness of above deductions with Arnd Bergmann before submitting this
      patchset.

   6. The soft-fp module in Linux kernel is too old to the following 21 cases
      cannot pass.
      FAIL: math/test-double-finite-lround
      FAIL: math/test-double-lround
      FAIL: math/test-float-double-add
      FAIL: math/test-float-double-sub
      FAIL: math/test-float-ldouble-add
      FAIL: math/test-float-ldouble-sub
      FAIL: math/test-float32-float32x-add
      FAIL: math/test-float32-float32x-sub
      FAIL: math/test-float32-float64-add
      FAIL: math/test-float32-float64-sub
      FAIL: math/test-float32x-finite-lround
      FAIL: math/test-float32x-lround
      FAIL: math/test-float64-finite-lround
      FAIL: math/test-float64-lround
      FAIL: math/test-ldouble-finite-lround
      FAIL: math/test-ldouble-lround
      FAIL: math/test-float32-fma
      FAIL: math/test-float-fma
      FAIL: math/test-float32-finite-fma
      FAIL: math/test-float-finite-fma
      FAIL: stdlib/tst-tininess

        The cause of failure can be divided to two parts.
      Part 1. If the value can be rounded to most negative integer, the result
              of FP_TO_INT_D or FP_TO_INT_ROUND_D is incorrect. The example
              case is lround (-0x80000000.4p0). In this case, FP_TO_INT_D
              returns most negative integer 0x80000000 and raises the Invalid
              exception flag.
      Part 2. To Overcome the limitation of nds32 FPU on denormalize output,
              any underflow and inexact case will issue a FPU trap that
              notifies the kernel to recalculate the floating point operation
              through kernel's soft-fp module. However, the soft-fp module in
              Linux kernel does not support TININESS_AFTER_ROUNDING but nds32
              FPU is TININESS_AFTER_ROUNDING. This mismatch causes some
              testcases to fail because the underflow exception flag is raised,
              such as  stdlib/tst-tininess, add_double (-0x4p-1024, 0x4p-128)
              and fma (-0x7.ffffep-128, 0x8.00001p-4, -0x8p-152).
        I tried to port the latest soft-fp module from glibc to kernel, and the
      above 21 failed testcases turned into PASS based on the latest soft-fp
      module. By the way, I found that Joseph tried to update the soft-fp
      module in Linux kernel in 2015, but the last status of the patchset seems
      to remain pending due to the lack of ACK from sparc maintainer. Does
      Joseph have any plans to resend the patchset?

   7. misc/tst-syscall-list
        This case turns to PASS if I add NR_fp_udfiex_crtl to 
      linux/syscall-names.list  

   The remaining FAIL cases are same with v3 patchest

   8.  The following 6 testcase fail because the testing environment lacks
       native python: 
      ./nptl/test-condattr-printers
      ./nptl/test-cond-printers
      ./nptl/test-mutexattr-printers
      ./nptl/test-mutex-printers
      ./nptl/test-rwlockattr-printers
      ./nptl/test-rwlock-printers

   9.  stdio-common/bug22 
         The required memory size for this testcase is more than 2 GB but
       the DRAM size on our FPGA is just 2GB. Therefore, the errno is set as
       ENOMEM instead of EOVERFLOW.

  10.  bug20790.test-result
         It fails because the testing environment lacks native cpp

The short log of the changes since our v3 includes:
* Add FP extension support
* Use init_array to call PREINIT_FUNCTION
* Modify ports to meet current program flow. 
* Update Copyright


[v3] The highlight of the changes since our v2 includes:
* Add MAP_FIXED_NOREPLACE definition to mman.h
* Mark _init and _fini as hidden in nds32 crti.S
* Replace u_long with unsigned long int
* Add a space between __attribute__ and '((' in sysdeps/nds32/bits/setjmp.h.
* Remove fno-isolate-erroneous-paths-dereference option from nds32 Makefile
  after adding __builtin_trap support to gcc
* Set arch_minimum_kernel as 4.17.0
* Replace 'long' and 'unsigned long' with 'long int' and 'unsigned long int'
* Remove the comma which is after the last element of an enum in
  sysdeps/nds32/bits/fenv.h
* Correct copyright
* Remove empty ABI test baselines
* Code cleanup for syscall.c
* Code cleanup for sysdeps/nds32/tls-macros.h

[v2] The highlight of the changes since our v1 includes:
* Update ABI list.
* Upadate libm-test-ulps file.
* Add fno-isolate-erroneous-paths-dereference compile option to
  CFLAGS-divrem.c to avoid compiler calling abort() function for
  divde-by-zero case.
* Update the list of register preservation and move the list from
  sysdeps/nds32/__longjmp.S to sysdeps/nds32/setjmp.h.
* Remove sysdeps/nds32/backtrace.c.
* Remove big endian support.
* Add description for compile option -minline-asm-r15 to configure file.
* Refine sysdeps/nds32/dl-machine.h.
* Remove sysdeps/nds32/math_private.h
* Refine memcpy and memset function of nds32 version
* Define THREAD_GSCOPE_IN_TCB in sysdeps/nds32/nptl/tls.h to fix compiler
  error
* Rename dynamic linker based on supported ABI.
* Remove big endian support
* To use generic fork function, define __ASSUME_CLONE_BACKWARDS and remove
  nds32 arch-fork.h
* Remove nds32 kernel_sigaction.h
* Remove nds32 readahead.c
* Remove unused macro from sigcontextinfo.h
* Refine nds32 syscall.c
* Add MAP_SYNC from Linux 4.15
* Add change log to the end of each commit.




CheWei Chunang (1):
  Add nds32 port to build-many-glibcs.py

Vincent Chen (10):
  nds32: Build Infastructure
  nds32: ABI Implementation
  nds32: Thread-Local Storage Support
  nds32: Startup and Dynamic Loader
  nds32: Generic <math.h>, soft-fp and hard-fp Routines
  nds32: Atomic and Locking Routines
  nds32: Linux Syscall Interface
  nds32: Linux ABI
  nds32: Add ABI list
  Add nds32 entries to config.h.in

 config.h.in                                        |    3 +
 locale/Makefile                                    |    2 +-
 scripts/build-many-glibcs.py                       |   13 +
 sysdeps/nds32/Implies                              |    4 +
 sysdeps/nds32/Makefile                             |   12 +
 sysdeps/nds32/__longjmp.S                          |   67 +
 sysdeps/nds32/atomic-machine.h                     |  162 ++
 sysdeps/nds32/bits/endian.h                        |   29 +
 sysdeps/nds32/bits/fenv.h                          |   96 +
 sysdeps/nds32/bits/link.h                          |   54 +
 sysdeps/nds32/bits/setjmp.h                        |   60 +
 sysdeps/nds32/bsd-_setjmp.S                        |    1 +
 sysdeps/nds32/bsd-setjmp.S                         |    1 +
 sysdeps/nds32/configure                            |   10 +
 sysdeps/nds32/configure.ac                         |   10 +
 sysdeps/nds32/dl-machine.h                         |  405 ++++
 sysdeps/nds32/dl-sysdep.h                          |   22 +
 sysdeps/nds32/dl-tls.h                             |   28 +
 sysdeps/nds32/dl-tlsdesc.S                         |  104 +
 sysdeps/nds32/dl-tlsdesc.h                         |   62 +
 sysdeps/nds32/dl-trampoline.S                      |  164 ++
 sysdeps/nds32/fpu/e_sqrt.c                         |   27 +
 sysdeps/nds32/fpu/e_sqrtf.c                        |   26 +
 sysdeps/nds32/fpu/fclrexcpt.c                      |   42 +
 sysdeps/nds32/fpu/fedisblxcpt.c                    |   58 +
 sysdeps/nds32/fpu/feenablxcpt.c                    |   57 +
 sysdeps/nds32/fpu/fegetenv.c                       |   44 +
 sysdeps/nds32/fpu/fegetexcept.c                    |   41 +
 sysdeps/nds32/fpu/fegetmode.c                      |   39 +
 sysdeps/nds32/fpu/fegetround.c                     |   29 +
 sysdeps/nds32/fpu/feholdexcpt.c                    |   29 +
 sysdeps/nds32/fpu/fenv_private.h                   |  229 +++
 sysdeps/nds32/fpu/fesetenv.c                       |   30 +
 sysdeps/nds32/fpu/fesetexcept.c                    |   34 +
 sysdeps/nds32/fpu/fesetmode.c                      |   53 +
 sysdeps/nds32/fpu/fesetround.c                     |   35 +
 sysdeps/nds32/fpu/feupdateenv.c                    |   31 +
 sysdeps/nds32/fpu/fgetexcptflg.c                   |   27 +
 sysdeps/nds32/fpu/fix-fp-int-compare-invalid.h     |   25 +
 sysdeps/nds32/fpu/fix-fp-int-convert-overflow.h    |   34 +
 sysdeps/nds32/fpu/fpu_control.h                    |  104 +
 sysdeps/nds32/fpu/fraiseexcpt.c                    |  100 +
 sysdeps/nds32/fpu/fsetexcptflg.c                   |   39 +
 sysdeps/nds32/fpu/ftestexcept.c                    |   27 +
 sysdeps/nds32/fpu/get-rounding-mode.h              |   39 +
 sysdeps/nds32/fpu/libm-test-ulps                   | 1643 ++++++++++++++++
 sysdeps/nds32/fpu/libm-test-ulps-name              |    1 +
 sysdeps/nds32/fpu/math-barriers.h                  |   27 +
 sysdeps/nds32/gccframe.h                           |   21 +
 sysdeps/nds32/jmpbuf-offsets.h                     |   34 +
 sysdeps/nds32/jmpbuf-unwind.h                      |   47 +
 sysdeps/nds32/ldsodefs.h                           |   44 +
 sysdeps/nds32/linkmap.h                            |   25 +
 sysdeps/nds32/machine-gmon.h                       |   34 +
 sysdeps/nds32/memcpy.S                             |  101 +
 sysdeps/nds32/memset.S                             |  120 ++
 sysdeps/nds32/memusage.h                           |   21 +
 sysdeps/nds32/nofpu/Implies                        |    1 +
 sysdeps/nds32/nofpu/libm-test-ulps                 |  390 ++++
 sysdeps/nds32/nofpu/libm-test-ulps-name            |    1 +
 sysdeps/nds32/nptl/Makefile                        |    4 +
 sysdeps/nds32/nptl/bits/pthreadtypes-arch.h        |   71 +
 sysdeps/nds32/nptl/bits/semaphore.h                |   32 +
 sysdeps/nds32/nptl/pthread-offsets.h               |   23 +
 sysdeps/nds32/nptl/pthreaddef.h                    |   33 +
 sysdeps/nds32/nptl/tcb-offsets.sym                 |    7 +
 sysdeps/nds32/nptl/tls.h                           |  155 ++
 sysdeps/nds32/preconfigure                         |   37 +
 sysdeps/nds32/setjmp.S                             |  103 +
 sysdeps/nds32/sfp-machine.h                        |   68 +
 sysdeps/nds32/sotruss-lib.c                        |   50 +
 sysdeps/nds32/stackinfo.h                          |   32 +
 sysdeps/nds32/start.S                              |  124 ++
 sysdeps/nds32/strcmp.S                             |  105 +
 sysdeps/nds32/strcpy.S                             |   75 +
 sysdeps/nds32/sysdep.h                             |   70 +
 sysdeps/nds32/tininess.h                           |    1 +
 sysdeps/nds32/tls-macros.h                         |   75 +
 sysdeps/nds32/tlsdesc.c                            |   38 +
 sysdeps/nds32/tlsdesc.sym                          |   16 +
 sysdeps/nds32/tst-audit.h                          |   23 +
 sysdeps/unix/sysv/linux/nds32/Implies              |    3 +
 sysdeps/unix/sysv/linux/nds32/Makefile             |   16 +
 sysdeps/unix/sysv/linux/nds32/Versions             |   11 +
 sysdeps/unix/sysv/linux/nds32/bits/fcntl.h         |   53 +
 sysdeps/unix/sysv/linux/nds32/bits/procfs.h        |   40 +
 sysdeps/unix/sysv/linux/nds32/bits/shmlba.h        |   24 +
 sysdeps/unix/sysv/linux/nds32/c++-types.data       |   67 +
 sysdeps/unix/sysv/linux/nds32/clone.S              |   70 +
 sysdeps/unix/sysv/linux/nds32/configure            |    4 +
 sysdeps/unix/sysv/linux/nds32/configure.ac         |    4 +
 sysdeps/unix/sysv/linux/nds32/dl-static.c          |   84 +
 sysdeps/unix/sysv/linux/nds32/fpu/Makefile         |    3 +
 sysdeps/unix/sysv/linux/nds32/fpu/ioctl.c          |   37 +
 sysdeps/unix/sysv/linux/nds32/fpu/mremap.c         |   37 +
 sysdeps/unix/sysv/linux/nds32/fpu/prctl.c          |   40 +
 sysdeps/unix/sysv/linux/nds32/fpu/setfpucw.c       |   50 +
 sysdeps/unix/sysv/linux/nds32/getcontext.S         |  102 +
 sysdeps/unix/sysv/linux/nds32/init-first.c         |   48 +
 sysdeps/unix/sysv/linux/nds32/ipc_priv.h           |   22 +
 sysdeps/unix/sysv/linux/nds32/jmp_buf-macros.h     |   33 +
 sysdeps/unix/sysv/linux/nds32/kernel-features.h    |   31 +
 sysdeps/unix/sysv/linux/nds32/ld.abilist           |    9 +
 sysdeps/unix/sysv/linux/nds32/ldconfig.h           |   27 +
 sysdeps/unix/sysv/linux/nds32/ldsodefs.h           |   32 +
 .../unix/sysv/linux/nds32/libBrokenLocale.abilist  |    1 +
 sysdeps/unix/sysv/linux/nds32/libanl.abilist       |    4 +
 sysdeps/unix/sysv/linux/nds32/libc-vdso.h          |   32 +
 sysdeps/unix/sysv/linux/nds32/libc.abilist         | 2080 ++++++++++++++++++++
 sysdeps/unix/sysv/linux/nds32/libcrypt.abilist     |    2 +
 sysdeps/unix/sysv/linux/nds32/libdl.abilist        |    9 +
 sysdeps/unix/sysv/linux/nds32/libm.abilist         |  753 +++++++
 sysdeps/unix/sysv/linux/nds32/libpthread.abilist   |  235 +++
 sysdeps/unix/sysv/linux/nds32/libresolv.abilist    |   79 +
 sysdeps/unix/sysv/linux/nds32/librt.abilist        |   35 +
 sysdeps/unix/sysv/linux/nds32/libthread_db.abilist |   40 +
 sysdeps/unix/sysv/linux/nds32/libutil.abilist      |    6 +
 sysdeps/unix/sysv/linux/nds32/localplt.data        |   19 +
 sysdeps/unix/sysv/linux/nds32/makecontext.c        |   57 +
 sysdeps/unix/sysv/linux/nds32/profil-counter.h     |   31 +
 sysdeps/unix/sysv/linux/nds32/pt-vfork.S           |    1 +
 sysdeps/unix/sysv/linux/nds32/setcontext.S         |  111 ++
 sysdeps/unix/sysv/linux/nds32/shlib-versions       |    9 +
 sysdeps/unix/sysv/linux/nds32/sigcontextinfo.h     |   35 +
 sysdeps/unix/sysv/linux/nds32/swapcontext.S        |  154 ++
 sysdeps/unix/sysv/linux/nds32/sys/cachectl.h       |   33 +
 sysdeps/unix/sysv/linux/nds32/sys/ucontext.h       |   88 +
 sysdeps/unix/sysv/linux/nds32/sys/user.h           |   22 +
 sysdeps/unix/sysv/linux/nds32/syscall.c            |   39 +
 sysdeps/unix/sysv/linux/nds32/syscalls.list        |    3 +
 sysdeps/unix/sysv/linux/nds32/sysctl.mk            |    1 +
 sysdeps/unix/sysv/linux/nds32/sysdep.c             |   29 +
 sysdeps/unix/sysv/linux/nds32/sysdep.h             |  340 ++++
 sysdeps/unix/sysv/linux/nds32/ucontext_i.sym       |   28 +
 sysdeps/unix/sysv/linux/nds32/vfork.S              |   46 +
 135 files changed, 11328 insertions(+), 1 deletion(-)
 create mode 100644 sysdeps/nds32/Implies
 create mode 100644 sysdeps/nds32/Makefile
 create mode 100644 sysdeps/nds32/__longjmp.S
 create mode 100644 sysdeps/nds32/atomic-machine.h
 create mode 100644 sysdeps/nds32/bits/endian.h
 create mode 100644 sysdeps/nds32/bits/fenv.h
 create mode 100644 sysdeps/nds32/bits/link.h
 create mode 100644 sysdeps/nds32/bits/setjmp.h
 create mode 100644 sysdeps/nds32/bsd-_setjmp.S
 create mode 100644 sysdeps/nds32/bsd-setjmp.S
 create mode 100755 sysdeps/nds32/configure
 create mode 100644 sysdeps/nds32/configure.ac
 create mode 100644 sysdeps/nds32/dl-machine.h
 create mode 100644 sysdeps/nds32/dl-sysdep.h
 create mode 100644 sysdeps/nds32/dl-tls.h
 create mode 100644 sysdeps/nds32/dl-tlsdesc.S
 create mode 100644 sysdeps/nds32/dl-tlsdesc.h
 create mode 100644 sysdeps/nds32/dl-trampoline.S
 create mode 100644 sysdeps/nds32/fpu/e_sqrt.c
 create mode 100644 sysdeps/nds32/fpu/e_sqrtf.c
 create mode 100644 sysdeps/nds32/fpu/fclrexcpt.c
 create mode 100644 sysdeps/nds32/fpu/fedisblxcpt.c
 create mode 100644 sysdeps/nds32/fpu/feenablxcpt.c
 create mode 100644 sysdeps/nds32/fpu/fegetenv.c
 create mode 100644 sysdeps/nds32/fpu/fegetexcept.c
 create mode 100644 sysdeps/nds32/fpu/fegetmode.c
 create mode 100644 sysdeps/nds32/fpu/fegetround.c
 create mode 100644 sysdeps/nds32/fpu/feholdexcpt.c
 create mode 100644 sysdeps/nds32/fpu/fenv_private.h
 create mode 100644 sysdeps/nds32/fpu/fesetenv.c
 create mode 100644 sysdeps/nds32/fpu/fesetexcept.c
 create mode 100644 sysdeps/nds32/fpu/fesetmode.c
 create mode 100644 sysdeps/nds32/fpu/fesetround.c
 create mode 100644 sysdeps/nds32/fpu/feupdateenv.c
 create mode 100644 sysdeps/nds32/fpu/fgetexcptflg.c
 create mode 100644 sysdeps/nds32/fpu/fix-fp-int-compare-invalid.h
 create mode 100644 sysdeps/nds32/fpu/fix-fp-int-convert-overflow.h
 create mode 100644 sysdeps/nds32/fpu/fpu_control.h
 create mode 100644 sysdeps/nds32/fpu/fraiseexcpt.c
 create mode 100644 sysdeps/nds32/fpu/fsetexcptflg.c
 create mode 100644 sysdeps/nds32/fpu/ftestexcept.c
 create mode 100644 sysdeps/nds32/fpu/get-rounding-mode.h
 create mode 100644 sysdeps/nds32/fpu/libm-test-ulps
 create mode 100644 sysdeps/nds32/fpu/libm-test-ulps-name
 create mode 100644 sysdeps/nds32/fpu/math-barriers.h
 create mode 100644 sysdeps/nds32/gccframe.h
 create mode 100644 sysdeps/nds32/jmpbuf-offsets.h
 create mode 100644 sysdeps/nds32/jmpbuf-unwind.h
 create mode 100644 sysdeps/nds32/ldsodefs.h
 create mode 100644 sysdeps/nds32/linkmap.h
 create mode 100644 sysdeps/nds32/machine-gmon.h
 create mode 100644 sysdeps/nds32/memcpy.S
 create mode 100644 sysdeps/nds32/memset.S
 create mode 100644 sysdeps/nds32/memusage.h
 create mode 100644 sysdeps/nds32/nofpu/Implies
 create mode 100644 sysdeps/nds32/nofpu/libm-test-ulps
 create mode 100644 sysdeps/nds32/nofpu/libm-test-ulps-name
 create mode 100644 sysdeps/nds32/nptl/Makefile
 create mode 100644 sysdeps/nds32/nptl/bits/pthreadtypes-arch.h
 create mode 100644 sysdeps/nds32/nptl/bits/semaphore.h
 create mode 100644 sysdeps/nds32/nptl/pthread-offsets.h
 create mode 100644 sysdeps/nds32/nptl/pthreaddef.h
 create mode 100644 sysdeps/nds32/nptl/tcb-offsets.sym
 create mode 100644 sysdeps/nds32/nptl/tls.h
 create mode 100644 sysdeps/nds32/preconfigure
 create mode 100644 sysdeps/nds32/setjmp.S
 create mode 100644 sysdeps/nds32/sfp-machine.h
 create mode 100644 sysdeps/nds32/sotruss-lib.c
 create mode 100644 sysdeps/nds32/stackinfo.h
 create mode 100644 sysdeps/nds32/start.S
 create mode 100644 sysdeps/nds32/strcmp.S
 create mode 100644 sysdeps/nds32/strcpy.S
 create mode 100644 sysdeps/nds32/sysdep.h
 create mode 100644 sysdeps/nds32/tininess.h
 create mode 100644 sysdeps/nds32/tls-macros.h
 create mode 100644 sysdeps/nds32/tlsdesc.c
 create mode 100644 sysdeps/nds32/tlsdesc.sym
 create mode 100644 sysdeps/nds32/tst-audit.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/Implies
 create mode 100644 sysdeps/unix/sysv/linux/nds32/Makefile
 create mode 100644 sysdeps/unix/sysv/linux/nds32/Versions
 create mode 100644 sysdeps/unix/sysv/linux/nds32/bits/fcntl.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/bits/procfs.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/bits/shmlba.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/c++-types.data
 create mode 100644 sysdeps/unix/sysv/linux/nds32/clone.S
 create mode 100755 sysdeps/unix/sysv/linux/nds32/configure
 create mode 100644 sysdeps/unix/sysv/linux/nds32/configure.ac
 create mode 100644 sysdeps/unix/sysv/linux/nds32/dl-static.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/fpu/Makefile
 create mode 100644 sysdeps/unix/sysv/linux/nds32/fpu/ioctl.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/fpu/mremap.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/fpu/prctl.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/fpu/setfpucw.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/getcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/nds32/init-first.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/ipc_priv.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/kernel-features.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/ld.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/ldconfig.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/ldsodefs.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libBrokenLocale.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libanl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libc-vdso.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libc.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libcrypt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libdl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libm.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libpthread.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libresolv.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/librt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libthread_db.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libutil.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/localplt.data
 create mode 100644 sysdeps/unix/sysv/linux/nds32/makecontext.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/profil-counter.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/pt-vfork.S
 create mode 100644 sysdeps/unix/sysv/linux/nds32/setcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/nds32/shlib-versions
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sigcontextinfo.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/swapcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sys/cachectl.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sys/ucontext.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sys/user.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/syscall.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/syscalls.list
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sysctl.mk
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sysdep.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sysdep.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/ucontext_i.sym
 create mode 100644 sysdeps/unix/sysv/linux/nds32/vfork.S

-- 
1.9.5


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v4 01/11] nds32: Build Infastructure
  2019-06-05 11:56 [PATCH v4 00/11] nds32 glibc port, v4 Vincent Chen
@ 2019-06-05 11:56 ` Vincent Chen
  2019-06-05 12:18   ` Andreas Schwab
  2019-06-05 11:56 ` [PATCH v4 02/11] nds32: ABI Implementation Vincent Chen
                   ` (11 subsequent siblings)
  12 siblings, 1 reply; 28+ messages in thread
From: Vincent Chen @ 2019-06-05 11:56 UTC (permalink / raw
  To: libc-alpha, joseph; +Cc: deanbo422, cnoize, vincentc

This patch contains all needed Implies, configure and Makefile for nds32
port.

2019-06-03  Vincent Chen  <vincentc@andestech.com>
2019-06-03  CheWei Chuang  <cnoize@andestech.com>

        * sysdeps/nds32/Implies: New file.
        * sysdeps/nds32/Makefile: Likewise.
        * sysdeps/nds32/configure: Likewise.
        * sysdeps/nds32/configure.ac: Likewise.
        * sysdeps/nds32/nofpu/Implies: Likewise.
        * sysdeps/nds32/nptl/Makefile: Likewise.
        * sysdeps/nds32/preconfigure: Likewise.
        * sysdeps/unix/sysv/linux/nds32/Implies: Likewise.
        * sysdeps/unix/sysv/linux/nds32/Makefile: Likewise.
        * sysdeps/unix/sysv/linux/nds32/Versions: Likewise.
        * sysdeps/unix/sysv/linux/nds32/configure: Likewise.
        * sysdeps/unix/sysv/linux/nds32/configure.ac: Likewise.
        * sysdeps/unix/sysv/linux/nds32/shlib-versions: Likewise.
---
 sysdeps/nds32/Implies                        |  4 +++
 sysdeps/nds32/Makefile                       | 12 +++++++++
 sysdeps/nds32/configure                      | 10 ++++++++
 sysdeps/nds32/configure.ac                   | 10 ++++++++
 sysdeps/nds32/nofpu/Implies                  |  1 +
 sysdeps/nds32/nptl/Makefile                  |  4 +++
 sysdeps/nds32/preconfigure                   | 37 ++++++++++++++++++++++++++++
 sysdeps/unix/sysv/linux/nds32/Implies        |  3 +++
 sysdeps/unix/sysv/linux/nds32/Makefile       | 16 ++++++++++++
 sysdeps/unix/sysv/linux/nds32/Versions       | 11 +++++++++
 sysdeps/unix/sysv/linux/nds32/configure      |  4 +++
 sysdeps/unix/sysv/linux/nds32/configure.ac   |  4 +++
 sysdeps/unix/sysv/linux/nds32/shlib-versions |  9 +++++++
 13 files changed, 125 insertions(+)
 create mode 100644 sysdeps/nds32/Implies
 create mode 100644 sysdeps/nds32/Makefile
 create mode 100755 sysdeps/nds32/configure
 create mode 100644 sysdeps/nds32/configure.ac
 create mode 100644 sysdeps/nds32/nofpu/Implies
 create mode 100644 sysdeps/nds32/nptl/Makefile
 create mode 100644 sysdeps/nds32/preconfigure
 create mode 100644 sysdeps/unix/sysv/linux/nds32/Implies
 create mode 100644 sysdeps/unix/sysv/linux/nds32/Makefile
 create mode 100644 sysdeps/unix/sysv/linux/nds32/Versions
 create mode 100755 sysdeps/unix/sysv/linux/nds32/configure
 create mode 100644 sysdeps/unix/sysv/linux/nds32/configure.ac
 create mode 100644 sysdeps/unix/sysv/linux/nds32/shlib-versions

diff --git a/sysdeps/nds32/Implies b/sysdeps/nds32/Implies
new file mode 100644
index 0000000..ff699c7
--- /dev/null
+++ b/sysdeps/nds32/Implies
@@ -0,0 +1,4 @@
+init_array
+wordsize-32
+ieee754/dbl-64
+ieee754/flt-32
diff --git a/sysdeps/nds32/Makefile b/sysdeps/nds32/Makefile
new file mode 100644
index 0000000..5dc46c2
--- /dev/null
+++ b/sysdeps/nds32/Makefile
@@ -0,0 +1,12 @@
+
+long-double-fcts = no
+
+ifeq ($(subdir),elf)
+sysdep-dl-routines += tlsdesc dl-tlsdesc
+sysdep_routines += tlsdesc dl-tlsdesc
+sysdep-rtld-routines += tlsdesc dl-tlsdesc
+endif
+
+ifeq ($(subdir),csu)
+gen-as-const-headers += tlsdesc.sym
+endif
diff --git a/sysdeps/nds32/configure b/sysdeps/nds32/configure
new file mode 100755
index 0000000..8ece006
--- /dev/null
+++ b/sysdeps/nds32/configure
@@ -0,0 +1,10 @@
+# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/nds32.
+
+# For nds32 ABI for linux toolchain, the $r15 register is not only an
+# assembler reserved register but also used to passing the sysem call
+# number. In order to ensure the data safety, $r15 is included in
+# clobber list by default. Using the option -minline-asm-r15 can
+# avoid the conflict between asm-specifier for syscall number and
+# clobber list when issuing system call by inline assembly.
+CFLAGS="$CFLAGS -minline-asm-r15"
diff --git a/sysdeps/nds32/configure.ac b/sysdeps/nds32/configure.ac
new file mode 100644
index 0000000..c0e2494
--- /dev/null
+++ b/sysdeps/nds32/configure.ac
@@ -0,0 +1,10 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/nds32.
+
+# For nds32 ABI for linux toolchain, the $r15 register is not only an 
+# assembler reserved register but also used to passing the sysem call
+# number. In order to ensure the data safety, $r15 is included in
+# clobber list by default. Using the option -minline-asm-r15 can
+# avoid the conflict between asm-specifier for syscall number and
+# clobber list when issuing system call by inline assembly.
+CFLAGS="$CFLAGS -minline-asm-r15"
diff --git a/sysdeps/nds32/nofpu/Implies b/sysdeps/nds32/nofpu/Implies
new file mode 100644
index 0000000..abcbadb
--- /dev/null
+++ b/sysdeps/nds32/nofpu/Implies
@@ -0,0 +1 @@
+ieee754/soft-fp
diff --git a/sysdeps/nds32/nptl/Makefile b/sysdeps/nds32/nptl/Makefile
new file mode 100644
index 0000000..6f553d6
--- /dev/null
+++ b/sysdeps/nds32/nptl/Makefile
@@ -0,0 +1,4 @@
+
+ifeq ($(subdir),csu)
+gen-as-const-headers += tcb-offsets.sym
+endif
diff --git a/sysdeps/nds32/preconfigure b/sysdeps/nds32/preconfigure
new file mode 100644
index 0000000..a7acac9
--- /dev/null
+++ b/sysdeps/nds32/preconfigure
@@ -0,0 +1,37 @@
+case "$machine" in
+nds32*)
+    endian_abi_type=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __NDS32_E\([B|L]*\)__ 1/\1/p'`
+    case "$endian_abi_type" in
+    L)
+       endian_abi_type=0
+       ;;
+    B)
+       echo "glibc does not yet support big-endian configuration" >&2
+       exit 1
+       ;;
+    esac
+
+    float_abi_type=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | grep ^"#define __NDS32_ABI_2FP_PLUS__" | wc -l`
+    case "$float_abi_type" in
+    0)
+       with_fp_cond=0
+       ;;
+    *)
+       flen=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | grep ^"#define __NDS32_EXT_FPU_DP__" | wc -l`
+       case "$flen" in
+       0)
+	  echo "glibc does not yet support nds32 v3s extension" >&2
+          exit 1
+          ;;
+       1)
+          float_abi_type=1
+          ;;
+       esac
+    esac
+
+    base_machine=nds32
+    machine=nds32
+
+    $as_echo "#define NDS32_ABI_TYPE 0x$float_abi_type$endian_abi_type" >>confdefs.h
+    ;;
+esac
diff --git a/sysdeps/unix/sysv/linux/nds32/Implies b/sysdeps/unix/sysv/linux/nds32/Implies
new file mode 100644
index 0000000..91b4e1e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/Implies
@@ -0,0 +1,3 @@
+nds32/nptl
+unix/sysv/linux/generic/wordsize-32
+unix/sysv/linux/generic
diff --git a/sysdeps/unix/sysv/linux/nds32/Makefile b/sysdeps/unix/sysv/linux/nds32/Makefile
new file mode 100644
index 0000000..c9bb589
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/Makefile
@@ -0,0 +1,16 @@
+ifeq ($(subdir),misc)
+sysdep_headers += sys/cachectl.h
+sysdep_routines += cacheflush prctl mremap
+endif
+
+ifeq ($(subdir),stdlib)
+gen-as-const-headers += ucontext_i.sym
+endif
+
+ifeq ($(subdir),elf)
+sysdep_routines += dl-vdso
+ifeq ($(build-shared),yes)
+# This is needed for DSO loading from static binaries.
+sysdep-dl-routines += dl-static
+endif
+endif
diff --git a/sysdeps/unix/sysv/linux/nds32/Versions b/sysdeps/unix/sysv/linux/nds32/Versions
new file mode 100644
index 0000000..abe47ce
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/Versions
@@ -0,0 +1,11 @@
+ld {
+  GLIBC_PRIVATE {
+  # used for loading by static libraries
+    _dl_var_init;
+  }
+}
+libc {
+  GLIBC_2.28 {
+    cacheflush;
+  }
+}
diff --git a/sysdeps/unix/sysv/linux/nds32/configure b/sysdeps/unix/sysv/linux/nds32/configure
new file mode 100755
index 0000000..ceb6c90
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/configure
@@ -0,0 +1,4 @@
+# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/unix/sysv/linux/nds32.
+
+arch_minimum_kernel=4.17.0
diff --git a/sysdeps/unix/sysv/linux/nds32/configure.ac b/sysdeps/unix/sysv/linux/nds32/configure.ac
new file mode 100644
index 0000000..91bf889
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/configure.ac
@@ -0,0 +1,4 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/unix/sysv/linux/nds32.
+
+arch_minimum_kernel=4.17.0
diff --git a/sysdeps/unix/sysv/linux/nds32/shlib-versions b/sysdeps/unix/sysv/linux/nds32/shlib-versions
new file mode 100644
index 0000000..21fcaba
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/shlib-versions
@@ -0,0 +1,9 @@
+DEFAULT			GLIBC_2.30
+
+%if NDS32_ABI_TYPE == 0
+ld=ld-linux-nds32le.so.1
+%elif NDS32_ABI_TYPE == 0x10
+ld=ld-linux-nds32lef.so.1
+%else
+%error cannot determine ABI
+%endif
-- 
1.9.5


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v4 02/11] nds32: ABI Implementation
  2019-06-05 11:56 [PATCH v4 00/11] nds32 glibc port, v4 Vincent Chen
  2019-06-05 11:56 ` [PATCH v4 01/11] nds32: Build Infastructure Vincent Chen
@ 2019-06-05 11:56 ` Vincent Chen
  2019-06-06 22:37   ` Joseph Myers
  2019-06-05 11:56 ` [PATCH v4 03/11] nds32: Thread-Local Storage Support Vincent Chen
                   ` (10 subsequent siblings)
  12 siblings, 1 reply; 28+ messages in thread
From: Vincent Chen @ 2019-06-05 11:56 UTC (permalink / raw
  To: libc-alpha, joseph; +Cc: deanbo422, cnoize, vincentc

The implementation of these files in this patch is dependent
on nds32-ABI convention.

2019-06-03  Vincent Chen  <vincentc@andestech.com>
2019-06-03  CheWei Chuang  <cnoize@andestech.com>

	* sysdeps/nds32/__longjmp.S: New file.
	* sysdeps/nds32/bits/endian.h: Likewise.
	* sysdeps/nds32/bits/link.h: Likewise.
	* sysdeps/nds32/bits/setjmp.h: Likewise.
	* sysdeps/nds32/bsd-_setjmp.S: Likewise.
	* sysdeps/nds32/bsd-setjmp.S: Likewise.
	* sysdeps/nds32/gccframe.h: Likewise.
	* sysdeps/nds32/jmpbuf-offsets.h: Likewise.
	* sysdeps/nds32/jmpbuf-unwind.h: Likewise.
	* sysdeps/nds32/linkmap.h: Likewise.
	* sysdeps/nds32/machine-gmon.h: Likewise.
	* sysdeps/nds32/memcpy.S: Likewise.
	* sysdeps/nds32/memset.S: Likewise.
	* sysdeps/nds32/memusage.h: Likewise.
	* sysdeps/nds32/nptl/pthreaddef.h: Likewise.
	* sysdeps/nds32/setjmp.S: Likewise.
	* sysdeps/nds32/sotruss-lib.c: Likewise.
	* sysdeps/nds32/stackinfo.h: Likewise.
	* sysdeps/nds32/strcmp.S: Likewise.
	* sysdeps/nds32/strcpy.S: Likewise.
	* sysdeps/nds32/sysdep.h: Likewise.
	* sysdeps/nds32/tst-audit.h: Likewise.
	* sysdeps/unix/sysv/linux/nds32/jmp_buf-macros.h: Likewise.
	* sysdeps/unix/sysv/linux/nds32/localplt.data: Likewise.
---
 locale/Makefile                                |   2 +-
 sysdeps/nds32/__longjmp.S                      |  67 ++++++++++++++
 sysdeps/nds32/bits/endian.h                    |  29 ++++++
 sysdeps/nds32/bits/link.h                      |  54 +++++++++++
 sysdeps/nds32/bits/setjmp.h                    |  60 +++++++++++++
 sysdeps/nds32/bsd-_setjmp.S                    |   1 +
 sysdeps/nds32/bsd-setjmp.S                     |   1 +
 sysdeps/nds32/gccframe.h                       |  21 +++++
 sysdeps/nds32/jmpbuf-offsets.h                 |  34 +++++++
 sysdeps/nds32/jmpbuf-unwind.h                  |  47 ++++++++++
 sysdeps/nds32/linkmap.h                        |  25 ++++++
 sysdeps/nds32/machine-gmon.h                   |  34 +++++++
 sysdeps/nds32/memcpy.S                         | 101 +++++++++++++++++++++
 sysdeps/nds32/memset.S                         | 120 +++++++++++++++++++++++++
 sysdeps/nds32/memusage.h                       |  21 +++++
 sysdeps/nds32/nptl/pthreaddef.h                |  33 +++++++
 sysdeps/nds32/setjmp.S                         | 103 +++++++++++++++++++++
 sysdeps/nds32/sotruss-lib.c                    |  50 +++++++++++
 sysdeps/nds32/stackinfo.h                      |  32 +++++++
 sysdeps/nds32/strcmp.S                         | 105 ++++++++++++++++++++++
 sysdeps/nds32/strcpy.S                         |  75 ++++++++++++++++
 sysdeps/nds32/sysdep.h                         |  70 +++++++++++++++
 sysdeps/nds32/tst-audit.h                      |  23 +++++
 sysdeps/unix/sysv/linux/nds32/jmp_buf-macros.h |  33 +++++++
 sysdeps/unix/sysv/linux/nds32/localplt.data    |  19 ++++
 25 files changed, 1159 insertions(+), 1 deletion(-)
 create mode 100644 sysdeps/nds32/__longjmp.S
 create mode 100644 sysdeps/nds32/bits/endian.h
 create mode 100644 sysdeps/nds32/bits/link.h
 create mode 100644 sysdeps/nds32/bits/setjmp.h
 create mode 100644 sysdeps/nds32/bsd-_setjmp.S
 create mode 100644 sysdeps/nds32/bsd-setjmp.S
 create mode 100644 sysdeps/nds32/gccframe.h
 create mode 100644 sysdeps/nds32/jmpbuf-offsets.h
 create mode 100644 sysdeps/nds32/jmpbuf-unwind.h
 create mode 100644 sysdeps/nds32/linkmap.h
 create mode 100644 sysdeps/nds32/machine-gmon.h
 create mode 100644 sysdeps/nds32/memcpy.S
 create mode 100644 sysdeps/nds32/memset.S
 create mode 100644 sysdeps/nds32/memusage.h
 create mode 100644 sysdeps/nds32/nptl/pthreaddef.h
 create mode 100644 sysdeps/nds32/setjmp.S
 create mode 100644 sysdeps/nds32/sotruss-lib.c
 create mode 100644 sysdeps/nds32/stackinfo.h
 create mode 100644 sysdeps/nds32/strcmp.S
 create mode 100644 sysdeps/nds32/strcpy.S
 create mode 100644 sysdeps/nds32/sysdep.h
 create mode 100644 sysdeps/nds32/tst-audit.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/localplt.data

diff --git a/locale/Makefile b/locale/Makefile
index 0ad99ec..803a3a5 100644
--- a/locale/Makefile
+++ b/locale/Makefile
@@ -113,5 +113,5 @@ lib := locale-programs
 include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
 
 $(objpfx)tst-locale-locpath.out : tst-locale-locpath.sh $(objpfx)locale
-	$(SHELL) $< '$(common-objpfx)' '$(test-wrapper)' '$(test-wrapper-env)' > $@; \
+	$(SHELL) $< '$(common-objpfx)' '$(test-wrapper-env)' '$(run_program_env)'> $@; \
 	$(evaluate-test)
diff --git a/sysdeps/nds32/__longjmp.S b/sysdeps/nds32/__longjmp.S
new file mode 100644
index 0000000..abf86d2
--- /dev/null
+++ b/sysdeps/nds32/__longjmp.S
@@ -0,0 +1,67 @@
+/* longjmp, Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+	.section .text
+
+ENTRY(__longjmp)
+	/* Restore registers.  */
+	lmw.bim  $r6, [$r0], $r14, #0xf
+
+#ifdef __NDS32_ABI_2FP_PLUS__
+	lwi.bi	$r20, [$r0], #4	/* Load $fpcfg.freg to $r20.  */
+
+	/* Case switch for $r20 as $fpcfg.freg.  */
+	beqz    $r20, .LCFG0         /* Branch if $fpcfg.freg = 0b00.  */
+	xori    $r15, $r20, #0b10
+	beqz    $r15, .LCFG2         /* Branch if $fpcfg.freg = 0b10.  */
+	srli    $r20, $r20, #0b01
+	beqz    $r20, .LCFG1         /* Branch if $fpcfg.freg = 0b01.  */
+	/* Fall-through if $fpcfg.freg = 0b11.  */
+.LCFG3:
+	fldi.bi	$fd31, [$r0], #8
+	fldi.bi	$fd30, [$r0], #8
+	fldi.bi	$fd29, [$r0], #8
+	fldi.bi	$fd28, [$r0], #8
+	fldi.bi	$fd27, [$r0], #8
+	fldi.bi	$fd26, [$r0], #8
+	fldi.bi	$fd25, [$r0], #8
+	fldi.bi	$fd24, [$r0], #8
+.LCFG2:
+	fldi.bi	$fd10, [$r0], #8
+	fldi.bi	$fd9, [$r0], #8
+	fldi.bi	$fd8, [$r0], #8
+.LCFG1:
+	fldi.bi	$fd7, [$r0], #8
+	fldi.bi	$fd6, [$r0], #8
+	fldi.bi	$fd5, [$r0], #8
+	fldi.bi	$fd4, [$r0], #8
+.LCFG0:
+	fldi.bi	$fd3, [$r0], #8
+#endif /* __NDS32_ABI_2FP_PLUS__.  */
+
+	/* Return error code. Make sure error code is not 0.  */
+	bnez  $r1, .Ldone
+	movi  $r1, #1
+.Ldone:
+	addi  $r0, $r1, #0
+	ret
+END(__longjmp)
diff --git a/sysdeps/nds32/bits/endian.h b/sysdeps/nds32/bits/endian.h
new file mode 100644
index 0000000..37f4d81
--- /dev/null
+++ b/sysdeps/nds32/bits/endian.h
@@ -0,0 +1,29 @@
+/* Define __BYTE_ORDER. Andes nds32 version
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+
+
+#if defined __NDS32_EB__
+# error "Big-endian is un-supported."
+#else
+# define __BYTE_ORDER __LITTLE_ENDIAN
+#endif
diff --git a/sysdeps/nds32/bits/link.h b/sysdeps/nds32/bits/link.h
new file mode 100644
index 0000000..463bad2
--- /dev/null
+++ b/sysdeps/nds32/bits/link.h
@@ -0,0 +1,54 @@
+/* Machine-specific declarations for dynamic linker interface.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef	_LINK_H
+# error "Never include <bits/link.h> directly; use <link.h> instead."
+#endif
+
+/* Registers for entry into PLT on NDS32.  */
+typedef struct La_nds32_regs
+{
+  uint32_t lr_reg[6];
+  uint32_t lr_gp;
+  uint32_t lr_lp;
+  uint32_t lr_sp;
+} La_nds32_regs;
+
+/* Return values for calls from PLT on NDS32.  */
+typedef struct La_nds32_retval
+{
+  uint32_t lrv_reg[2];
+} La_nds32_retval;
+
+__BEGIN_DECLS
+
+extern ElfW(Addr) la_nds32_gnu_pltenter (ElfW(Sym) *__sym, unsigned int __ndx,
+					 uintptr_t *__refcook,
+					 uintptr_t *__defcook,
+					 La_nds32_regs *__regs,
+					 unsigned int *__flags,
+					 const char *__symname,
+					 long int *__framesizep);
+extern unsigned int la_nds32_gnu_pltexit (ElfW(Sym) *__sym, unsigned int __ndx,
+					  uintptr_t *__refcook,
+					  uintptr_t *__defcook,
+					  const La_nds32_regs *__inregs,
+					  La_nds32_retval *__outregs,
+					  const char *__symname);
+
+__END_DECLS
diff --git a/sysdeps/nds32/bits/setjmp.h b/sysdeps/nds32/bits/setjmp.h
new file mode 100644
index 0000000..80703ae
--- /dev/null
+++ b/sysdeps/nds32/bits/setjmp.h
@@ -0,0 +1,60 @@
+/* Define the machine-dependent type `jmp_buf'.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef _BITS_SETJMP_H
+#define _BITS_SETJMP_H  1
+
+#if !defined _SETJMP_H && !defined _PTHREAD_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
+#ifndef _ASM
+
+/* For nds32, there are 32 general purpose registers.
+  1. Caller saved register for parameter passing: $r0 - $r5
+  2. Callee saved register: $r6 - $r14
+  3. Assembler reserved register: $r15
+  4. Caller saved register: $r6 - $r24
+  5. Thread pointer register: $r25
+  6. Reserved register for kernel space: $r26 - $27
+  7. Frame pointer: $r28
+  8. Global pointer: $r29
+  9. Link register: $r30
+  10.Stack pointer: $r31
+
+  Only callee saved register and $r28-$r31 needs to store in jmp_buf.
+  Reserved(For 8-byte align if needed).  */
+
+typedef struct __jmp_buf_internal_tag
+  {
+    /* Callee-saved registers: $r6 - $r14, $fp, $gp, $lp, $sp: $r28 - $r31.  */
+    int __regs[13];
+#ifdef __NDS32_ABI_2FP_PLUS__
+    /* Floating-Point Configuration Register.  */
+    int __fpcfg;
+
+    /* Callee-saved fp registers pointer.  */
+    int __fpregs[32];
+#endif /* __NDS32_ABI_2FP_PLUS__.  */
+
+  } __jmp_buf[1] __attribute__((__aligned__ (8)));
+
+#endif /* _ASM.  */
+
+#endif  /* _BITS_SETJMP_H.  */
diff --git a/sysdeps/nds32/bsd-_setjmp.S b/sysdeps/nds32/bsd-_setjmp.S
new file mode 100644
index 0000000..90b99cd
--- /dev/null
+++ b/sysdeps/nds32/bsd-_setjmp.S
@@ -0,0 +1 @@
+/* _setjmp is in setjmp.S.  */
diff --git a/sysdeps/nds32/bsd-setjmp.S b/sysdeps/nds32/bsd-setjmp.S
new file mode 100644
index 0000000..d3b823c
--- /dev/null
+++ b/sysdeps/nds32/bsd-setjmp.S
@@ -0,0 +1 @@
+/* setjmp is in setjmp.S.  */
diff --git a/sysdeps/nds32/gccframe.h b/sysdeps/nds32/gccframe.h
new file mode 100644
index 0000000..04f01c4
--- /dev/null
+++ b/sysdeps/nds32/gccframe.h
@@ -0,0 +1,21 @@
+/* Definition of object in frame unwind info.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define FIRST_PSEUDO_REGISTER 34
+
+#include <sysdeps/generic/gccframe.h>
diff --git a/sysdeps/nds32/jmpbuf-offsets.h b/sysdeps/nds32/jmpbuf-offsets.h
new file mode 100644
index 0000000..8a02f43
--- /dev/null
+++ b/sysdeps/nds32/jmpbuf-offsets.h
@@ -0,0 +1,34 @@
+/* Private macros for accessing __jmp_buf contents.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define JB_R6   0
+#define JB_R7   1
+#define JB_R8   2
+#define JB_R9   3
+#define JB_R10  4
+#define JB_R11  5
+#define JB_R12  6
+#define JB_R13  7
+#define JB_R14  8
+#define JB_FP   9
+#define JB_GP   10
+#define JB_LP   11
+#define JB_SP   12
+
+#define JB_FRAME_ADDRESS(buf) \
+	 ((void *)buf[0].__regs[JB_SP])
diff --git a/sysdeps/nds32/jmpbuf-unwind.h b/sysdeps/nds32/jmpbuf-unwind.h
new file mode 100644
index 0000000..f4cc3db
--- /dev/null
+++ b/sysdeps/nds32/jmpbuf-unwind.h
@@ -0,0 +1,47 @@
+/* Examine __jmp_buf for unwinding frames.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <setjmp.h>
+#include <jmpbuf-offsets.h>
+#include <stdint.h>
+#include <unwind.h>
+#include <sysdep.h>
+
+/* Test if longjmp to JMPBUF would unwind the frame
+   containing a local variable at ADDRESS.  */
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+  ((void *) (address) < &(jmpbuf)[0].__regs[JB_SP])
+
+#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
+  _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
+
+static inline uintptr_t __attribute__ ((unused))
+_jmpbuf_sp (__jmp_buf regs)
+{
+  uintptr_t sp = (uintptr_t) &(regs)[0].__regs[JB_SP];
+#ifdef PTR_DEMANGLE
+  PTR_DEMANGLE (sp);
+#endif
+  return sp;
+}
+
+#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
+  ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
+
+/* We use the normal longjmp for unwinding.  */
+#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
diff --git a/sysdeps/nds32/linkmap.h b/sysdeps/nds32/linkmap.h
new file mode 100644
index 0000000..34e1cef
--- /dev/null
+++ b/sysdeps/nds32/linkmap.h
@@ -0,0 +1,25 @@
+/* Define nds32 link_map_machine
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+struct link_map_machine
+  {
+    ElfW(Addr) plt; /* Address of .plt.  */
+    ElfW(Addr) gotplt; /* Address of .got.  */
+    void *tlsdesc_table;
+  };
+
diff --git a/sysdeps/nds32/machine-gmon.h b/sysdeps/nds32/machine-gmon.h
new file mode 100644
index 0000000..17a29f2
--- /dev/null
+++ b/sysdeps/nds32/machine-gmon.h
@@ -0,0 +1,34 @@
+/* profiling support for Andes nds32 version
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+static void __attribute_used__ __mcount_internal (unsigned long int frompc,
+						  unsigned long int selfpc);
+
+#define _MCOUNT_DECL(frompc, selfpc) \
+static void __mcount_internal (unsigned long int frompc, \
+unsigned long int selfpc)
+
+
+#define MCOUNT								\
+void _mcount (unsigned long int frompc)		      			\
+{									\
+  __mcount_internal (frompc, (unsigned long int) RETURN_ADDRESS (0));	\
+}
+
diff --git a/sysdeps/nds32/memcpy.S b/sysdeps/nds32/memcpy.S
new file mode 100644
index 0000000..2fd9b82
--- /dev/null
+++ b/sysdeps/nds32/memcpy.S
@@ -0,0 +1,101 @@
+/* Memory copy.  Andes nds32 version
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+/* void *memcpy(void *dst, const void *src, int n);
+
+   dst: $r0
+   src: $r1
+   n  : $r2
+   ret: $r0 - pointer to the memory area dst.  */
+
+ENTRY (memcpy)
+	/* Set $r3 as the dest. Keep value of $r0.  */
+	move    $r3, $r0
+	/* if len<4, go to byte-mode.  */
+	slti	$ta, $r2, 4
+	bnez	$ta, .Lbyte_mode
+	andi	$r4, $r3, 0x3
+	andi	$r5, $r1, 0x3
+
+	/* handle unligned leading bytes.  */
+	beqz	$r5, .LWord_aligned
+	subri	$r5, $r5, #4
+	sub	$r2, $r2, $r5
+	add	$r5, $r5, $r1
+
+.align	2
+1:
+	/* byte-mode copy loop.  */
+	lbi.bi	$r4, [$r1], 1
+	sbi.bi	$r4, [$r3], 1
+	bne	$r1, $r5, 1b
+
+.align  2
+.LWord_aligned:
+	/* assume cache-line size is 32 bytes.  */
+	srli	$r5, $r2, 5
+	beqz	$r5, .Lword_mode
+	slli	$r5, $r5, 5
+	add	$r5, $r5, $r1
+	andi	$r2, $r2, 0x1f
+
+	/* cache-line-mode copy loop.  */
+.align	2
+5:
+	lmw.bim	$r16, [$r1], $r23, #0
+	smw.bim	$r16, [$r3], $r23, #0
+	/* Next cache-line.  */
+	bne	$r1, $r5, 5b
+
+.align  2
+.Lword_mode:
+	srli	$r5, $r2, 2
+	beqz	$r5, .Lbyte_mode
+	slli	$r5, $r5, 2
+	add	$r5, $r5, $r1
+	andi	$r2, $r2, 0x3
+
+	/* word-mode copy loop.  */
+.align	2
+3:
+	lmw.bim	$r4, [$r1], $r4, #0
+	smw.bim	$r4, [$r3], $r4, #0
+	/* Next word.  */
+	bne	$r1, $r5, 3b
+
+.align  2
+.Lbyte_mode:
+	beqz	$r2, .Lend
+	add	$r5, $r1, $r2
+
+.align	2
+4:
+	/* byte-mode copy loop.  */
+	lbi.bi	$r4, [$r1], #1
+	sbi.bi	$r4, [$r3], #1
+	bne	$r1, $r5, 4b
+
+.align  2
+.Lend:
+	ret
+
+END (memcpy)
+libc_hidden_builtin_def (memcpy)
+
diff --git a/sysdeps/nds32/memset.S b/sysdeps/nds32/memset.S
new file mode 100644
index 0000000..e853804
--- /dev/null
+++ b/sysdeps/nds32/memset.S
@@ -0,0 +1,120 @@
+/* Optimized version for Andes nds32.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+/* void *memset(void *dst, int val, int len);
+ 
+         dst: $r0
+         val: $r1
+         len: $r2
+         ret: $r0 - pointer to the memory area dst.  */
+
+ENTRY(memset)
+	/* Set $r3 as the dest. Keep value of $r0.  */
+	move	$r3, $r0
+	/* if len<4, go to byte-mode.  */
+	slti	$ta, $r2, 4
+	bnez	$ta, .Lbyte_mode
+	andi	$r5, $r3, 0x3
+	beqz	$r5, .Lword_prepare
+	/* size to next word-aligned addres.  */
+	subri	$r5, $r5, #4
+	/* $r2: bytes left.  */
+	sub	$r2, $r2, $r5
+	add	$r5, $r5, $r0
+
+.align	2
+1:
+	/* byte-mode set loop.  */
+	sbi.bi	$r1, [$r3], 1
+	bne	$r3, $r5, 1b
+
+.align  2
+.Lword_prepare:
+	/* prepare word.  */
+
+	/* $r1  <- 0x000000ab.  */
+	andi    $r1, $r1, 0xff
+	/* $r4  <- 0x0000ab00.  */
+	slli    $r4, $r1, 8
+	/* $r1  <- 0x0000abab.  */
+	or      $r1, $r1, $r4
+	/* $r4  <- 0xabab0000.  */
+	slli    $r4, $r1, 16
+	/* $r1  <- 0xabababab.  */
+	or      $r1, $r1, $r4
+
+	/* assume cache-line size is 32 bytes.  */
+	srli	$r5, $r2, 5
+	beqz	$r5, .Lword_mode
+	slli	$r5, $r5, 5
+	add	$r5, $r5, $r3
+	andi	$r2, $r2, 0x1f
+
+	/* cache-line-mode set loop.  */
+	move $r16,$r1
+	move $r17,$r1
+	move $r18,$r1
+	move $r19,$r1
+	move $r20,$r1
+	move $r21,$r1
+	move $r22,$r1
+	move $r23,$r1
+
+.align	2
+4:
+	/* $r3 is dst.  */
+	smw.bim	$r16, [$r3], $r23, #0
+	/* Next cache-line.  */
+	bne	$r3, $r5, 4b
+
+.align  2
+.Lword_mode:
+	/* $r5 <- n words to set.  */
+	srli	$r5, $r2, 2
+	beqz	$r5, .Lbyte_mode
+	slli	$r5, $r5, 2
+	add	$r5, $r5, $r3
+	andi	$r2, $r2, 0x3
+
+	/* word-mode set loop.  */
+.align	2
+2:
+	smw.bim	$r1, [$r3], $r1, #0
+	/* Next word.  */
+	bne $r3, $r5, 2b
+
+.align  2
+.Lbyte_mode:
+	beqz	$r2, .Lend
+	add	$r5, $r3, $r2
+
+.align	2
+3:
+	/* byte-mode set loops.  */
+	sbi.bi	$r1, [$r3], #1
+	bne	$r3, $r5, 3b
+.align  2
+.Lend:
+	ret
+
+END(memset)
+libc_hidden_builtin_def (memset)
+
diff --git a/sysdeps/nds32/memusage.h b/sysdeps/nds32/memusage.h
new file mode 100644
index 0000000..b346a0a
--- /dev/null
+++ b/sysdeps/nds32/memusage.h
@@ -0,0 +1,21 @@
+/* Machine-specific definitions for memory usage profiling, Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define GETSP() ({ register uintptr_t stack_ptr asm ("$sp"); stack_ptr; })
+
+#include <sysdeps/generic/memusage.h>
diff --git a/sysdeps/nds32/nptl/pthreaddef.h b/sysdeps/nds32/nptl/pthreaddef.h
new file mode 100644
index 0000000..23d5581
--- /dev/null
+++ b/sysdeps/nds32/nptl/pthreaddef.h
@@ -0,0 +1,33 @@
+/* pthread machine parameter definitions,  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* Default stack size.  */
+#define ARCH_STACK_DEFAULT_SIZE	(2 * 1024 * 1024)
+
+/* Required stack pointer alignment at beginning.  */
+#define STACK_ALIGN		16
+
+/* Minimal stack size after allocating thread descriptor and guard size.  */
+#define MINIMAL_REST_STACK	2048
+
+/* Alignment requirement for TCB.  */
+#define TCB_ALIGNMENT		16
+
+
+/* Location of current stack frame.  */
+#define CURRENT_STACK_FRAME	__builtin_frame_address (0)
diff --git a/sysdeps/nds32/setjmp.S b/sysdeps/nds32/setjmp.S
new file mode 100644
index 0000000..7bcdd92
--- /dev/null
+++ b/sysdeps/nds32/setjmp.S
@@ -0,0 +1,103 @@
+/* setjmp for Andes nds32.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+
+#include <sysdep.h>
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+	.section .text
+#ifdef PIC
+# define JMP_BY_R2(symbol)						\
+	sethi   $r3, hi20(symbol@PLT);					\
+	ori     $r3, $r3, lo12(symbol@PLT);				\
+	add     $r3, $r3, $r2;						\
+	jr      $r3
+# define TCALL_SIGJMP_SAVE						\
+	GET_GTABLE ($r2);						\
+	JMP_BY_R2 (__sigjmp_save)
+#else
+# define JMP_BY_R2(symbol)						\
+	la	$r15, C_SYMBOL_NAME(symbol);				\
+	jr	$r15
+# define TCALL_SIGJMP_SAVE						\
+	JMP_BY_R2 (__sigjmp_save)
+#endif
+
+ENTRY(_setjmp)
+	move	$r1, #0
+	/* Initialize $r2 as $gp value.  */
+	GET_GTABLE ($r2)
+        /* Make a tail call to __sigsetjmp.  */
+	JMP_BY_R2 (HIDDEN_JUMPTARGET (__sigsetjmp))
+END(_setjmp)
+ENTRY(setjmp)
+	move	$r1, #1
+	/* Initialize $r2 as $gp value.  */
+	GET_GTABLE ($r2)
+        /* Make a tail call to __sigsetjmp.  */
+	JMP_BY_R2 (HIDDEN_JUMPTARGET (__sigsetjmp))
+END(setjmp)
+
+ENTRY(__sigsetjmp)
+	move	$r2, $r0
+	/* Save callee-saved registers into buffer.  */
+	smw.bim	$r6, [$r2], $r14, #0xf
+
+#ifdef __NDS32_ABI_2FP_PLUS__
+/* Process for FPU registers.  */
+        fmfcfg  $r20    /* Keep $fpcfg in $r20.  */
+        slli    $r20, $r20, #28
+        srli    $r20, $r20, #30 /* Set $r20 as $fpcfg.freg.  */
+        swi.bi  $r20, [$r2], #4
+
+        /* Case switch for $r20 as $fpcfg.freg.  */
+        beqz    $r20, .LCFG0            /* Branch if $fpcfg.freg = 0b00.  */
+        xori    $r15, $r20, #0b10
+        beqz    $r15, .LCFG2            /* Branch if $fpcfg.freg = 0b10.  */
+        srli    $r20, $r20, #0b01
+        beqz    $r20, .LCFG1            /* Branch if $fpcfg.freg = 0b01.  */
+        /* Fall-through if $fpcfg.freg = 0b11.  */
+.LCFG3:
+        fsdi.bi $fd31, [$r2], #8
+        fsdi.bi $fd30, [$r2], #8
+        fsdi.bi $fd29, [$r2], #8
+        fsdi.bi $fd28, [$r2], #8
+        fsdi.bi $fd27, [$r2], #8
+        fsdi.bi $fd26, [$r2], #8
+        fsdi.bi $fd25, [$r2], #8
+        fsdi.bi $fd24, [$r2], #8
+.LCFG2:
+        fsdi.bi $fd10, [$r2], #8
+        fsdi.bi $fd9, [$r2], #8
+        fsdi.bi $fd8, [$r2], #8
+.LCFG1:
+        fsdi.bi $fd7, [$r2], #8
+        fsdi.bi $fd6, [$r2], #8
+        fsdi.bi $fd5, [$r2], #8
+        fsdi.bi $fd4, [$r2], #8
+.LCFG0:
+        fsdi.bi $fd3, [$r2], #8
+#endif /* __NDS32_ABI_2FP_PLUS__ */
+
+        /* Make a tail call to __sigjmp_save.  */
+	TCALL_SIGJMP_SAVE
+
+END(__sigsetjmp)
+hidden_def(__sigsetjmp)
+weak_alias (_setjmp, __GI__setjmp)
diff --git a/sysdeps/nds32/sotruss-lib.c b/sysdeps/nds32/sotruss-lib.c
new file mode 100644
index 0000000..afa1acb
--- /dev/null
+++ b/sysdeps/nds32/sotruss-lib.c
@@ -0,0 +1,50 @@
+/* Override generic sotruss-lib.c to define actual functions.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define HAVE_ARCH_PLTENTER
+#define HAVE_ARCH_PLTEXIT
+
+#include <elf/sotruss-lib.c>
+
+
+ElfW(Addr)
+la_nds32_gnu_pltenter (ElfW(Sym) *sym __attribute__ ((unused)),
+		       unsigned int ndx __attribute__ ((unused)),
+		       uintptr_t *refcook, uintptr_t *defcook,
+		       La_nds32_regs *regs, unsigned int *flags,
+		       const char *symname, long int *framesizep)
+{
+  print_enter (refcook, defcook, symname,
+	       regs->lr_reg[0], regs->lr_reg[1], regs->lr_reg[2],
+	       *flags);
+
+  /* No need to copy anything, we will not need the parameters in any case.  */
+  *framesizep = 0;
+
+  return sym->st_value;
+}
+
+unsigned int
+la_nds32_gnu_pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
+		      uintptr_t *defcook, const struct La_nds32_regs *inregs,
+		      struct La_nds32_retval *outregs, const char *symname)
+{
+  print_exit (refcook, defcook, symname, outregs->lrv_reg[0]);
+
+  return 0;
+}
diff --git a/sysdeps/nds32/stackinfo.h b/sysdeps/nds32/stackinfo.h
new file mode 100644
index 0000000..e1d1813
--- /dev/null
+++ b/sysdeps/nds32/stackinfo.h
@@ -0,0 +1,32 @@
+/* Stack environment definitions.  Andes nds32.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains a bit of information about the stack allocation
+   of the processor.  */
+
+#ifndef _STACKINFO_H
+#define _STACKINFO_H 1
+
+#include <elf.h>
+
+#define _STACK_GROWS_DOWN 1
+
+/* Default to a non-executable stack.  */
+#define DEFAULT_STACK_PERMS (PF_R|PF_W)
+
+#endif /* _STACKINFO_H.  */
diff --git a/sysdeps/nds32/strcmp.S b/sysdeps/nds32/strcmp.S
new file mode 100644
index 0000000..7136391
--- /dev/null
+++ b/sysdeps/nds32/strcmp.S
@@ -0,0 +1,105 @@
+/* Optimized version for Andes nds32.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/*
+    Function:
+       strcmp - compare two strings.
+    Syntax:
+       int strcmp(const char *s1, const char *s2);
+    Description:
+       The strcmp function compares the string pointed to by s1 to the string
+       pointed to by s2.
+    Return value:
+       Return n integer greater than, equal to, or less than zero, accordingly
+       as the string pointed to by s1 is greater than, equal to, or less than
+       the string pointed to by s2.
+*/
+#include <sysdep.h>
+        .text
+
+ENTRY(strcmp)
+#if defined (__NDS32_EXT_STRING__)
+1:
+	lmwzb.bm	$r2, [$r0], $r2, #0
+	lmwzb.bm	$r3, [$r1], $r3, #0
+	ffzmism	$r4, $r2, $r3
+	beqz	$r4, 1b
+	lb	$r2, [$r0+$r4]
+	lb	$r3, [$r1+$r4]
+	sub	$r0, $r2, $r3
+	ret $lp
+#else /* not (__NDS32_EXT_STRING__) */
+	/* If s1 or s2 are unaligned, then compare bytes.  */
+	or	$r5, $r1, $r0
+	andi    $r5, $r5, #3
+	bnez    $r5, .Lbyte_mode
+
+	/* If s1 and s2 are word-aligned, compare them a word at a time.  */
+	lwi	$r5, [$r0+(0)]
+	lwi	$r3, [$r1+(0)]
+.off_16bit	/* Dedicate 4-byte to eliminate NOP caused by ".align 2".  */
+        /* A difference was detected, so search bytewise.  */
+	bne	$r5, $r3, .Lbyte_mode
+.restore_16bit
+
+
+	/* It's more efficient to set bit mask outside the word_mode loop.  */
+	sethi	$r4, hi20(0xFEFEFEFF)	/* Set $r4 as -0x01010101.  */
+	ori	$r4, $r4, lo12(0xFEFEFEFF)
+	sethi	$r2, hi20(0x80808080)	/* Set $r2 as 0x80808080.  */
+	ori	$r2, $r2, lo12(0x80808080)
+
+.align	2
+.Lword_mode_loop:
+	/* #define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
+	   DETECTNULL returns nonzero if (long)X contains a NULL byte.  */
+
+/* Force 32-bit instruction to gain better performance.  */
+.off_16bit
+	nor	$r3, $r5, $r5		/* $r3 = ~(X).  */
+	add	$r5, $r5, $r4		/* $r5 = ((X) - 0x01010101).  */
+	and	$r5, $r5, $r3		/* $r5 = ~(X) & ((X) - 0x01010101).  */
+	and	$r5, $r5, $r2		/* $r5= r5 & 0x80808080.  */
+.restore_16bit
+
+	bnez	$r5, .Lfound_null	/* Branch if $r5 is nonzero.  */
+	lmw.aim	$r5, [$r0], $r5, 0
+	lmw.aim	$r3, [$r1], $r3, 0
+	beq	$r5, $r3, .Lword_mode_loop
+
+.align	2
+.Lbyte_mode:
+	/* Byte-mode compare.  */
+	lbi.bi	$r5, [$r0], #1
+	lbi.bi	$r3, [$r1], #1
+	bne	$r5, $r3, 1f	/* Mismatch, done.  */
+	bnez	$r5, .Lbyte_mode
+1:
+	sub $r0, $r5, $r3
+	ret $lp
+
+.align	2
+.Lfound_null:
+	/* To get here, *a1 == *a2, thus if we find a null in *a1,
+	   then the strings must be equal, so return zero.  */
+	movi	$r0, #0
+	ret $lp
+
+#endif /* not (__NDS32_EXT_STRING__) */
+END(strcmp)
+libc_hidden_builtin_def (strcmp)
diff --git a/sysdeps/nds32/strcpy.S b/sysdeps/nds32/strcpy.S
new file mode 100644
index 0000000..9189172
--- /dev/null
+++ b/sysdeps/nds32/strcpy.S
@@ -0,0 +1,75 @@
+/* Optimized version for Andes nds32.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/*  Function:
+       strcpy - copy a string.
+    Syntax:
+       char *strcpy(char *dest, const char *src);
+    Description:
+       This function copies the string pointed to by src into the array
+       point to by dest (include the teminating null character).
+    Return value:
+       strcpy returns the dest as given.  */
+#include <sysdep.h>
+        .text
+
+ENTRY(strcpy)
+	move	$r3, $r0	/* Keep $r0 as reture value.  */
+#if defined (__NDS32_EXT_STRING__)
+1:
+	lmwzb.bm	$r4, [$r1], $r4, #0
+	smwzb.bm	$r4, [$r3], $r4, #0
+	ffzmism	$r2, $r4, $r4
+	beqz	$r2, 1b		/* $r2 = 0, no zero byte exist.  */
+	ret $lp
+
+#else /* not (__NDS32_EXT_STRING__) */
+	GET_GTABLE ($gp)
+	/* If SRC or DEST is unaligned, then copy bytes.  */
+	or	$r2, $r1, $r0
+	andi	$r2, $r2, #3
+	bnez	$r2, .Lbyte_mode
+
+.Lword_mode:
+	/* SRC and DEST are both "long int" aligned, try to do "long int"
+	   sized copies.  */
+	/* #define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
+	   DETECTNULL returns nonzero if (long)X contains a NULL byte.  */
+	lwi	$r2, [$r1+(0)]		/* $r2 is X.  */
+	sethi	$r4, hi20(0xFEFEFEFF)
+	ori	$r4, $r4, lo12(0xFEFEFEFF)
+	add	$r4, $r2, $r4		/* $r4 = ((X) - 0x01010101).  */
+	nor	$r5, $r2, $r2		/* $r5 = ~(X).  */
+	and	$r4, $r5, $r4		/* $r4 = ~(X) & ((X) - 0x01010101).  */
+	sethi	$r5, hi20(0x80808080)
+	ori	$r5, $r5, lo12(0x80808080)
+	and	$r4, $r4, $r5		/* $r4 = $r4 & 0x80808080.  */
+	bnez	$r4, .Lbyte_mode	/* Contains a NULL byte.  */
+	swi.bi	$r2, [$r3], #4
+	addi	$r1, $r1, #4
+	b	.Lword_mode
+
+.Lbyte_mode:
+	lbi.bi	$r4, [$r1], #1		/* $r4  <- *src++.  */
+	sbi.bi	$r4, [$r3], #1		/* $r4  -> *dest++.  */
+	bnez	$r4, .Lbyte_mode
+	ret $lp
+#endif /* not (__NDS32_EXT_STRING__) */
+END(strcpy)
+libc_hidden_builtin_def (strcpy)
diff --git a/sysdeps/nds32/sysdep.h b/sysdeps/nds32/sysdep.h
new file mode 100644
index 0000000..8e853a4
--- /dev/null
+++ b/sysdeps/nds32/sysdep.h
@@ -0,0 +1,70 @@
+/* Assembler macros.  Andes nds32.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdeps/generic/sysdep.h>
+
+#ifdef	__ASSEMBLER__
+
+/* Define an entry point visible from C.  */
+# ifdef PIC
+#  define ENTRY(name)                     \
+   .pic					  \
+   .align 2;                              \
+   .globl C_SYMBOL_NAME(name);            \
+   .func  C_SYMBOL_NAME(name);            \
+   .type  C_SYMBOL_NAME(name), @function; \
+   C_SYMBOL_NAME(name):			  \
+   cfi_startproc;
+# else
+#  define ENTRY(name)                     \
+   .align 2;                              \
+   .globl C_SYMBOL_NAME(name);            \
+   .func  C_SYMBOL_NAME(name);            \
+   .type  C_SYMBOL_NAME(name), @function; \
+   C_SYMBOL_NAME(name):			  \
+   cfi_startproc;
+# endif
+
+
+# undef END
+# define END(name)    \
+  cfi_endproc;	      \
+  .endfunc;           \
+  .size C_SYMBOL_NAME(name), .-C_SYMBOL_NAME(name)
+
+/* If compiled for profiling, call `mcount' at the start of each function.  */
+# ifdef HAVE_ELF
+#  undef NO_UNDERSCORES
+#  define NO_UNDERSCORES
+# endif
+
+# ifdef NO_UNDERSCORES
+#  define syscall_error __syscall_error
+# endif
+
+
+# define GET_GTABLE(reg)					\
+	sethi	reg,	hi20(_GLOBAL_OFFSET_TABLE_ - 8);	\
+	ori	reg,	reg,	lo12(_GLOBAL_OFFSET_TABLE_ - 4);\
+	add5.pc reg;
+
+
+
+#endif	/* __ASSEMBLER__ */
+  
+
diff --git a/sysdeps/nds32/tst-audit.h b/sysdeps/nds32/tst-audit.h
new file mode 100644
index 0000000..0ef3791
--- /dev/null
+++ b/sysdeps/nds32/tst-audit.h
@@ -0,0 +1,23 @@
+/* Definitions for testing PLT entry/exit auditing.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define pltenter la_nds32_gnu_pltenter
+#define pltexit la_nds32_gnu_pltexit
+#define La_regs La_nds32_regs
+#define La_retval La_nds32_retval
+#define int_retval lrv_reg[0]
diff --git a/sysdeps/unix/sysv/linux/nds32/jmp_buf-macros.h b/sysdeps/unix/sysv/linux/nds32/jmp_buf-macros.h
new file mode 100644
index 0000000..20e7b9c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/jmp_buf-macros.h
@@ -0,0 +1,33 @@
+/* jump buffer constants.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+#ifdef __NDS32_ABI_2FP_PLUS__
+# define JMP_BUF_SIZE 320
+# define SIGJMP_BUF_SIZE 320
+# define JMP_BUF_ALIGN 8
+# define SIGJMP_BUF_ALIGN 8
+# define MASK_WAS_SAVED_OFFSET 184
+# define SAVED_MASK_OFFSET 188
+#else
+# define JMP_BUF_SIZE 184
+# define SIGJMP_BUF_SIZE 184
+# define JMP_BUF_ALIGN 8
+# define SIGJMP_BUF_ALIGN 8
+# define MASK_WAS_SAVED_OFFSET 52
+# define SAVED_MASK_OFFSET 56
+#endif
diff --git a/sysdeps/unix/sysv/linux/nds32/localplt.data b/sysdeps/unix/sysv/linux/nds32/localplt.data
new file mode 100644
index 0000000..14c02cb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/localplt.data
@@ -0,0 +1,19 @@
+# See scripts/check-localplt.awk for how this file is processed.
+# PLT use is required for the malloc family and for matherr because
+# users can define their own functions and have library internals call them.
+libc.so: calloc
+libc.so: free
+libc.so: malloc
+libc.so: memalign
+libc.so: realloc
+# The main malloc is interposed into the dynamic linker, for
+# allocations after the initial link (when dlopen is used).
+ld.so: malloc
+ld.so: calloc
+ld.so: realloc
+ld.so: free
+# The TLS-enabled version of these functions is interposed from libc.so.
+ld.so: _dl_signal_error
+ld.so: _dl_catch_error
+ld.so: _dl_signal_exception
+ld.so: _dl_catch_exception
-- 
1.9.5


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v4 03/11] nds32: Thread-Local Storage Support
  2019-06-05 11:56 [PATCH v4 00/11] nds32 glibc port, v4 Vincent Chen
  2019-06-05 11:56 ` [PATCH v4 01/11] nds32: Build Infastructure Vincent Chen
  2019-06-05 11:56 ` [PATCH v4 02/11] nds32: ABI Implementation Vincent Chen
@ 2019-06-05 11:56 ` Vincent Chen
  2019-06-05 11:56 ` [PATCH v4 04/11] nds32: Startup and Dynamic Loader Vincent Chen
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 28+ messages in thread
From: Vincent Chen @ 2019-06-05 11:56 UTC (permalink / raw
  To: libc-alpha, joseph; +Cc: deanbo422, cnoize, vincentc

This patch implements TLS mechanism for nds32. 4 TLS addressing mode
(LE, IE, LD, GD) is supported when running on Linux via NPTL.

2019-06-03  Vincent Chen  <vincentc@andestech.com>
2019-06-03  CheWei Chuang  <cnoize@andestech.com>

        * sysdeps/nds32/dl-tls.h: New file.
        * sysdeps/nds32/dl-tlsdesc.S: Likewise.
        * sysdeps/nds32/dl-tlsdesc.h: Likewise.
        * sysdeps/nds32/nptl/tcb-offsets.sym: Likewise.
        * sysdeps/nds32/nptl/tls.h: Likewise.
        * sysdeps/nds32/tls-macros.h: Likewise.
        * sysdeps/nds32/tlsdesc.c: Likewise.
        * sysdeps/nds32/tlsdesc.sym: Likewise.
---
 sysdeps/nds32/dl-tls.h             |  28 +++++++
 sysdeps/nds32/dl-tlsdesc.S         | 104 +++++++++++++++++++++++++
 sysdeps/nds32/dl-tlsdesc.h         |  62 +++++++++++++++
 sysdeps/nds32/nptl/tcb-offsets.sym |   7 ++
 sysdeps/nds32/nptl/tls.h           | 155 +++++++++++++++++++++++++++++++++++++
 sysdeps/nds32/tls-macros.h         |  75 ++++++++++++++++++
 sysdeps/nds32/tlsdesc.c            |  38 +++++++++
 sysdeps/nds32/tlsdesc.sym          |  16 ++++
 8 files changed, 485 insertions(+)
 create mode 100644 sysdeps/nds32/dl-tls.h
 create mode 100644 sysdeps/nds32/dl-tlsdesc.S
 create mode 100644 sysdeps/nds32/dl-tlsdesc.h
 create mode 100644 sysdeps/nds32/nptl/tcb-offsets.sym
 create mode 100644 sysdeps/nds32/nptl/tls.h
 create mode 100644 sysdeps/nds32/tls-macros.h
 create mode 100644 sysdeps/nds32/tlsdesc.c
 create mode 100644 sysdeps/nds32/tlsdesc.sym

diff --git a/sysdeps/nds32/dl-tls.h b/sysdeps/nds32/dl-tls.h
new file mode 100644
index 0000000..a5e37b7
--- /dev/null
+++ b/sysdeps/nds32/dl-tls.h
@@ -0,0 +1,28 @@
+/* Thread-local storage handling in the ELF dynamic linker.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+
+/* Type used for the representation of TLS information in the GOT.  */
+typedef struct
+{
+  unsigned long int ti_module;
+  unsigned long int ti_offset;
+} tls_index;
+
+
+extern void *__tls_get_addr (tls_index *ti);
diff --git a/sysdeps/nds32/dl-tlsdesc.S b/sysdeps/nds32/dl-tlsdesc.S
new file mode 100644
index 0000000..981d1b8
--- /dev/null
+++ b/sysdeps/nds32/dl-tlsdesc.S
@@ -0,0 +1,104 @@
+/* Thread-local storage handling in the ELF dynamic linker, Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <tls.h>
+#include "tlsdesc.h"
+
+	.text
+	.hidden _dl_tlsdesc_return
+	.global	_dl_tlsdesc_return
+	.type	_dl_tlsdesc_return,#function
+	cfi_startproc
+	.align 2
+_dl_tlsdesc_return:
+	lwi	$r0,	[$r0	+ 4]
+	add	$r0,	$r0,	$r25
+	ret
+	cfi_endproc
+	.size   _dl_tlsdesc_return, .-_dl_tlsdesc_return
+
+	.hidden _dl_tlsdesc_undefweak
+	.global	_dl_tlsdesc_undefweak
+	.type	_dl_tlsdesc_undefweak,#function
+	cfi_startproc
+	.align 2
+_dl_tlsdesc_undefweak:
+	ret
+	cfi_endproc
+	.size   _dl_tlsdesc_undefweak, .-_dl_tlsdesc_undefweak
+
+#ifdef SHARED
+	/* Handler for dynamic TLS symbols.
+	   Prototype:
+	   _dl_tlsdesc_dynamic (tlsdesc *) ;
+
+	  ptrdiff_t
+	  _dl_tlsdesc_dynamic(struct tlsdesc *tdp)
+	  {
+            struct tlsdesc_dynamic_arg *td = tdp->argument.pointer;
+            dtv_t *dtv = (dtv_t *)THREAD_DTV();
+            if (__builtin_expect (td->gen_count <= dtv[0].counter
+               && (dtv[td->tlsinfo.ti_module].pointer.val
+                  != TLS_DTV_UNALLOCATED),
+               1))
+               return dtv[td->tlsinfo.ti_module].pointer.val +
+                       td->tlsinfo.ti_offset;
+
+             return __tls_get_addr (&td->tlsinfo);
+           }
+	*/
+	.hidden _dl_tlsdesc_dynamic
+	.global	_dl_tlsdesc_dynamic
+	.type	_dl_tlsdesc_dynamic,#function
+	cfi_startproc
+	.pic
+	.align 2
+
+_dl_tlsdesc_dynamic:
+	lwi	$r0,	[$r0 + 4]                  /* $r0 = td.  */
+	lwi	$r1,	[$r0 + #TLSDESC_GEN_COUNT] /* $r1 = td->gen_count.  */
+	lwi	$r2,	[$r25 +	#DTV_OFFSET]	   /* $r2 = &dtv[0].  */
+	lwi	$r3,	[$r2]                      /* $r3 = module id.  */
+	sub	$r1,	$r1,	$r3
+	bgtz	$r1,	2f
+	lwi	$r3,	[$r0 + #TLSDESC_MODID]
+	slli	$r3,	$r3,	#3  /* $r3 = module offset = ID * 8.  */
+	lw	$r3,	[$r2 + $r3] /* $r3 = &dtc[ID] = &dtv[0]+ module offset.  */
+	movi	$r1,	#TLS_DTV_UNALLOCATED
+	beq	$r3,	$r1,	2f
+	lwi	$r1,	[$r0 + #TLSDESC_MODOFF]
+	add	$r0,	$r3,	$r1
+1:
+	ret
+2:
+	smw.adm $sp,[$sp],$sp,#0x6
+	.cfi_adjust_cfa_offset 8
+	.cfi_rel_offset gp, 0
+	.cfi_rel_offset lp, 4
+	GET_GTABLE ($gp)
+	la	$r15, HIDDEN_JUMPTARGET (__tls_get_addr@PLT)
+	jral 	$r15
+	lmw.bim $sp,[$sp],$sp,#0x6
+	.cfi_adjust_cfa_offset -8
+	.cfi_restore gp
+	.cfi_restore lp
+	j	1b
+	cfi_endproc
+	.size   _dl_tlsdesc_dynamic, .-_dl_tlsdesc_dynamic
+#endif /* SHARED.  */
diff --git a/sysdeps/nds32/dl-tlsdesc.h b/sysdeps/nds32/dl-tlsdesc.h
new file mode 100644
index 0000000..605327d
--- /dev/null
+++ b/sysdeps/nds32/dl-tlsdesc.h
@@ -0,0 +1,62 @@
+/* Thread-local storage descriptor handling in the ELF dynamic linker.
+   Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; witout even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _NDS32_DL_TLSDESC_H
+# define _NDS32_DL_TLSDESC_H 1
+
+/* Type used to represent a TLS descriptor in the GOT.  */
+struct tlsdesc
+{
+  ptrdiff_t (*entry)(struct tlsdesc *);
+  union
+    {
+      void *pointer;
+      long int value;
+    } argument;
+};
+
+
+typedef struct dl_tls_index
+{
+  unsigned long int ti_module;
+  unsigned long int ti_offset;
+} tls_index;
+
+/* Type used as the argument in a TLS descriptor for a symbol that
+   needs dynamic TLS offsets.  */
+struct tlsdesc_dynamic_arg
+{
+  tls_index tlsinfo;
+  size_t gen_count;
+};
+
+extern ptrdiff_t attribute_hidden
+_dl_tlsdesc_return(struct tlsdesc *);
+
+extern ptrdiff_t attribute_hidden
+_dl_tlsdesc_undefweak(struct tlsdesc *);
+
+# ifdef SHARED
+extern void *_dl_make_tlsdesc_dynamic (struct link_map *map, size_t ti_offset);
+
+extern ptrdiff_t attribute_hidden
+_dl_tlsdesc_dynamic(struct tlsdesc *);
+# endif
+
+#endif /* nds32/dl-tlsdesc.h.  */
diff --git a/sysdeps/nds32/nptl/tcb-offsets.sym b/sysdeps/nds32/nptl/tcb-offsets.sym
new file mode 100644
index 0000000..333dd53
--- /dev/null
+++ b/sysdeps/nds32/nptl/tcb-offsets.sym
@@ -0,0 +1,7 @@
+#include <sysdep.h>
+#include <tls.h>
+
+#define thread_offsetof(mem)    (long)(offsetof (struct pthread, mem) - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)
+
+MULTIPLE_THREADS_OFFSET         thread_offsetof (header.multiple_threads)
+TID_OFFSET                      thread_offsetof (tid)
diff --git a/sysdeps/nds32/nptl/tls.h b/sysdeps/nds32/nptl/tls.h
new file mode 100644
index 0000000..f391370
--- /dev/null
+++ b/sysdeps/nds32/nptl/tls.h
@@ -0,0 +1,155 @@
+/* Definition for thread-local data handling.  Andes NPTL/nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _NDS32_TLS_H
+#define _NDS32_TLS_H	1
+
+#include <dl-sysdep.h>
+
+#ifdef __ASSEMBLER__
+# include <tcb-offsets.h>
+#else
+# include <stdbool.h>
+# include <stddef.h>
+# include <stdint.h>
+# include <dl-dtv.h>
+/* Get system call information.  */
+# include <sysdep.h>
+
+/* The TP points to the start of the thread blocks.  */
+# define TLS_DTV_AT_TP	1
+# define TLS_TCB_AT_TP	0
+
+/* We use the multiple_threads field in the pthread struct.  */
+# define TLS_MULTIPLE_THREADS_IN_TCB	1
+
+/* Get the thread descriptor definition.  */
+# include <nptl/descr.h>
+
+typedef struct
+{
+  dtv_t *dtv;
+  void *private;
+} tcbhead_t;
+
+/* This is the size of the initial TCB.  */
+# define TLS_INIT_TCB_SIZE      0
+
+/* Alignment requirements for the initial TCB.  */
+# define TLS_INIT_TCB_ALIGN     __alignof__ (struct pthread)
+
+/* This is the size of the TCB.  */
+# define TLS_TCB_SIZE           0
+
+/* Alignment requirements for the TCB.  */
+# define TLS_TCB_ALIGN          __alignof__ (struct pthread)
+
+
+
+/* This is the size we need before TCB - actually, it includes the TCB.  */
+# define TLS_PRE_TCB_SIZE \
+  (sizeof (struct pthread)						      \
+   + ((sizeof (tcbhead_t) + TLS_TCB_ALIGN - 1) & ~(TLS_TCB_ALIGN - 1)))
+
+/* Return the thread descriptor (tp) for the current thread.  */
+register void *__thread_pointer asm ("$r25");
+
+
+/* The thread pointer tp points to the end of the TCB.
+ * The pthread_descr structure is immediately in front of the TCB.  */
+# define TLS_TCB_OFFSET	0
+
+/* Install the dtv pointer.  The pointer passed is to the element with
+   index -1 which contain the length.  */
+# define INSTALL_DTV(tcbp, dtvp) \
+  (((tcbhead_t *) (tcbp))[-1].dtv = (dtvp) + 1)
+
+/* Install new dtv for current thread.  */
+# define INSTALL_NEW_DTV(dtv) (THREAD_DTV() = (dtv))
+
+/* Return dtv of given thread descriptor.  */
+# define GET_DTV(tcbp)	(((tcbhead_t *) (tcbp))[-1].dtv)
+
+/* Code to initially initialize the thread pointer (tp).  */
+# define TLS_INIT_TP(tcbp) \
+    (__thread_pointer = (char *)(tcbp) + TLS_TCB_OFFSET, NULL)
+
+/* Value passed to 'clone' for initialization of the thread register.  */
+# define TLS_DEFINE_INIT_TP(tp, pd) \
+  void *tp = (void *) (pd) + TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE
+
+/* Return the address of the dtv for the current thread.  */
+# define THREAD_DTV() \
+    (((tcbhead_t *) (__thread_pointer - TLS_TCB_OFFSET))[-1].dtv)
+
+/* Return the thread descriptor for the current thread.  */
+# define THREAD_SELF \
+    ((struct pthread *) (__thread_pointer \
+			 - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE))
+
+/* Magic for libthread_db to know how to do THREAD_SELF.  */
+# define DB_THREAD_SELF \
+  REGISTER (32, 32, 26 * 4, - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)
+
+/* Read member of the thread descriptor directly.  */
+# define THREAD_GETMEM(descr, member) (descr->member)
+
+/* Same as THREAD_GETMEM, but the member offset can be non-constant.  */
+# define THREAD_GETMEM_NC(descr, member, idx) \
+    (descr->member[idx])
+
+/* Set member of the thread descriptor directly.  */
+# define THREAD_SETMEM(descr, member, value) \
+    (descr->member = (value))
+
+/* Same as THREAD_SETMEM, but the member offset can be non-constant.  */
+# define THREAD_SETMEM_NC(descr, member, idx, value) \
+    (descr->member[idx] = (value))
+
+
+/* l_tls_offset == 0 is perfectly valid, so we have to use some different
+    value to mean unset l_tls_offset.  */
+# define NO_TLS_OFFSET		-1
+
+/* Get and set the global scope generation counter in struct pthread.  */
+# define THREAD_GSCOPE_IN_TCB      1
+# define THREAD_GSCOPE_FLAG_UNUSED 0
+# define THREAD_GSCOPE_FLAG_USED   1
+# define THREAD_GSCOPE_FLAG_WAIT   2
+# define THREAD_GSCOPE_RESET_FLAG() \
+  do									     \
+    { int __res								     \
+	= atomic_exchange_rel (&THREAD_SELF->header.gscope_flag,	     \
+			       THREAD_GSCOPE_FLAG_UNUSED);		     \
+      if (__res == THREAD_GSCOPE_FLAG_WAIT)				     \
+	lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE);   \
+    }									     \
+  while (0)
+# define THREAD_GSCOPE_SET_FLAG() \
+  do									     \
+    {									     \
+      THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED;	     \
+      atomic_write_barrier ();						     \
+    }									     \
+  while (0)
+# define THREAD_GSCOPE_WAIT() \
+  GL(dl_wait_lookup_done) ()
+
+#endif /* __ASSEMBLER__.  */
+
+#endif /* _NDS32_TLS_H.  */
diff --git a/sysdeps/nds32/tls-macros.h b/sysdeps/nds32/tls-macros.h
new file mode 100644
index 0000000..104fdf6
--- /dev/null
+++ b/sysdeps/nds32/tls-macros.h
@@ -0,0 +1,75 @@
+/* Macros to support TLS testing in times of missing compiler support.
+   Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define TLS_LE(x) 						\
+({	int *__l;						\
+	asm("sethi	%0, hi20("#x"@TPOFF)\n\t"		\
+            "ori	%0, %0, lo12("#x"@TPOFF)\n\t"		\
+            "add	%0, %0, $r25\n\t"			\
+	    : "=r" (__l));					\
+	__l;})
+
+#ifdef PIC
+# define TLS_IE(x)						\
+({	int *__l;						\
+	asm(".relax_hint begin\n\t"				\
+            "sethi	%0, hi20("#x"@GOTTPOFF)\n\t"		\
+            ".relax_hint\n\t"					\
+            "ori	%0, %0, lo12("#x"@GOTTPOFF)\n\t"	\
+            ".relax_hint end\n\t"				\
+            "lw	%0, [%0 + $gp]\n\t"				\
+            "add	%0, %0, $r25\n\t"			\
+            : "=r" (__l));					\
+	__l;})
+#else
+# define TLS_IE(x) 						\
+({	int *__l;						\
+	asm(".relax_hint begin\n\t"				\
+            "sethi 	%0, hi20("#x"@GOTTPOFF)\n\t"		\
+            ".relax_hint end\n\t"				\
+            "lwi 	%0, [%0 + lo12("#x"@GOTTPOFF)]\n\t"	\
+            "add	%0, %0, $r25\n\t"			\
+            : "=r" (__l));					\
+	__l;})
+#endif
+
+#define TLS_LD(x) TLS_GD(x)
+
+#define TLS_GD(x)						\
+({	int *__l;	                                        \
+	asm("smw.adm $r1,[$sp],$r5,#0\n\t"			\
+            "smw.adm $r16,[$sp],$r24,#0\n\t"			\
+            ".relax_hint begin\n\t"				\
+            "sethi	$r0, hi20("#x"@TLSDESC)\n\t"		\
+            ".relax_hint\n\t"					\
+            "ori	$r0, $r0, lo12("#x"@TLSDESC)\n\t"	\
+            ".relax_hint\n\t"					\
+            "lw 	$r15, [$r0 + $gp]\n\t"			\
+            ".relax_hint\n\t"					\
+            "add 	$r0, $r0, $gp\n\t"			\
+            ".relax_hint end\n\t"				\
+            "jral 	$r15\n\t"	        		\
+            "lmw.bim $r16,[$sp],$r24,#0\n\t"                	\
+            "lmw.bim $r1,[$sp],$r5,#0\n\t"                  	\
+            "move	%0, $r0\n\t"				\
+            : "=r" (__l)					\
+            :							\
+            : "$r0", "$r15");					\
+	__l;})
diff --git a/sysdeps/nds32/tlsdesc.c b/sysdeps/nds32/tlsdesc.c
new file mode 100644
index 0000000..2e61ce3
--- /dev/null
+++ b/sysdeps/nds32/tlsdesc.c
@@ -0,0 +1,38 @@
+/* Manage TLS descriptors, Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <ldsodefs.h>
+#include <tls.h>
+#include <dl-tlsdesc.h>
+#include <dl-unmap-segments.h>
+#define _dl_tlsdesc_resolve_hold 0
+#include <tlsdeschtab.h>
+
+/* Unmap the dynamic object, but also release its TLS descriptor table
+   if there is one.  */
+
+void
+_dl_unmap (struct link_map *map)
+{
+  _dl_unmap_segments (map);
+
+#ifdef SHARED
+  if (map->l_mach.tlsdesc_table)
+    htab_delete (map->l_mach.tlsdesc_table);
+#endif
+}
diff --git a/sysdeps/nds32/tlsdesc.sym b/sysdeps/nds32/tlsdesc.sym
new file mode 100644
index 0000000..0a34a74
--- /dev/null
+++ b/sysdeps/nds32/tlsdesc.sym
@@ -0,0 +1,16 @@
+#include <stddef.h>
+#include <sysdep.h>
+#include <tls.h>
+#include <link.h>
+#include <dl-tlsdesc.h>
+
+#define dtv_offsetof(dtv)   (offsetof (tcbhead_t, dtv) - TLS_TCB_OFFSET - sizeof (tcbhead_t))
+
+DTV_OFFSET          dtv_offsetof (dtv)
+
+TLSDESC_ARG         offsetof (struct tlsdesc, argument.pointer)
+
+TLSDESC_GEN_COUNT   offsetof (struct tlsdesc_dynamic_arg, gen_count)
+TLSDESC_MODID       offsetof (struct tlsdesc_dynamic_arg, tlsinfo.ti_module)
+TLSDESC_MODOFF      offsetof (struct tlsdesc_dynamic_arg, tlsinfo.ti_offset)
+TLS_DTV_UNALLOCATED     TLS_DTV_UNALLOCATED
-- 
1.9.5


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v4 04/11] nds32: Startup and Dynamic Loader
  2019-06-05 11:56 [PATCH v4 00/11] nds32 glibc port, v4 Vincent Chen
                   ` (2 preceding siblings ...)
  2019-06-05 11:56 ` [PATCH v4 03/11] nds32: Thread-Local Storage Support Vincent Chen
@ 2019-06-05 11:56 ` Vincent Chen
  2019-06-05 11:56 ` [PATCH v4 05/11] nds32: Generic <math.h>, soft-fp and hard-fp Routines Vincent Chen
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 28+ messages in thread
From: Vincent Chen @ 2019-06-05 11:56 UTC (permalink / raw
  To: libc-alpha, joseph; +Cc: deanbo422, cnoize, vincentc

This patch contains crti.S, crtn.S and the dynamic loader
for nds32 system.

2019-06-03  Vincent Chen  <vincentc@andestech.com>
2019-06-03  CheWei Chuang  <cnoize@andestech.com>

        * sysdeps/nds32/dl-machine.h: New file.
        * sysdeps/nds32/dl-sysdep.h: Likewise.
        * sysdeps/nds32/dl-trampoline.S: Likewise.
        * sysdeps/nds32/ldsodefs.h: Likewise.
        * sysdeps/nds32/start.S: Likewise.
        * sysdeps/unix/sysv/linux/nds32/dl-static.c: Likewise.
        * sysdeps/unix/sysv/linux/nds32/ldconfig.h: Likewise.
        * sysdeps/unix/sysv/linux/nds32/ldsodefs.h: Likewise.
---
 sysdeps/nds32/dl-machine.h                | 405 ++++++++++++++++++++++++++++++
 sysdeps/nds32/dl-sysdep.h                 |  22 ++
 sysdeps/nds32/dl-trampoline.S             | 164 ++++++++++++
 sysdeps/nds32/ldsodefs.h                  |  44 ++++
 sysdeps/nds32/start.S                     | 124 +++++++++
 sysdeps/unix/sysv/linux/nds32/dl-static.c |  84 +++++++
 sysdeps/unix/sysv/linux/nds32/ldconfig.h  |  27 ++
 sysdeps/unix/sysv/linux/nds32/ldsodefs.h  |  32 +++
 8 files changed, 902 insertions(+)
 create mode 100644 sysdeps/nds32/dl-machine.h
 create mode 100644 sysdeps/nds32/dl-sysdep.h
 create mode 100644 sysdeps/nds32/dl-trampoline.S
 create mode 100644 sysdeps/nds32/ldsodefs.h
 create mode 100644 sysdeps/nds32/start.S
 create mode 100644 sysdeps/unix/sysv/linux/nds32/dl-static.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/ldconfig.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/ldsodefs.h

diff --git a/sysdeps/nds32/dl-machine.h b/sysdeps/nds32/dl-machine.h
new file mode 100644
index 0000000..21ba52a
--- /dev/null
+++ b/sysdeps/nds32/dl-machine.h
@@ -0,0 +1,405 @@
+/* Machine-dependent ELF dynamic relocation inline functions, Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef dl_machine_h
+#define dl_machine_h
+
+#define ELF_MACHINE_NAME "NDS32"
+
+#include <tls.h>
+#include <dl-tlsdesc.h>
+#include <ldsodefs.h>
+
+/* Return nonzero iff ELF header is compatible with the running host.  */
+static inline int __attribute__ ((unused))
+elf_machine_matches_host(const ElfW(Ehdr) *ehdr)
+{
+  return ehdr->e_machine == EM_NDS32;
+}
+
+
+/* Return the link-time address of _DYNAMIC.  Conveniently, this is the
+   first element of the GOT, a special entry that is never relocated.  */
+static inline ElfW(Addr) __attribute__ ((unused, const))
+elf_machine_dynamic (void)
+{
+  /* This produces a GOTOFF reloc that resolves to some offset at link time, so in
+     fact just loads from the GOT register directly.  By doing it without
+     an asm we can let the compiler choose any register.  */
+  extern const ElfW(Addr) _GLOBAL_OFFSET_TABLE_[] attribute_hidden;
+  return _GLOBAL_OFFSET_TABLE_[0];
+}
+
+/* Return the run-time load address of the shared object.  */
+static inline ElfW(Addr) __attribute__ ((unused))
+elf_machine_load_address (void)
+{
+  /* Compute the difference between the runtime address of _DYNAMIC as seen
+     by a GOTOFF reference, and the link-time address found in the special
+     unrelocated first GOT entry.  */
+  extern ElfW(Dyn) bygotoff[] asm ("_DYNAMIC") attribute_hidden;
+  return (ElfW(Addr)) &bygotoff - elf_machine_dynamic ();
+}
+
+
+
+/* Set up the loaded object described by L so its unrelocated PLT
+   entries will jump to the on-demand fixup code in dl-runtime.c.  */
+
+static inline int __attribute__ ((unused, always_inline))
+elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
+{
+
+  if (l->l_info[DT_JMPREL] && lazy)
+    {
+      ElfW(Addr) *got;
+      extern void _dl_runtime_resolve (ElfW(Word)) attribute_hidden;
+      extern void _dl_runtime_profile (ElfW(Word)) attribute_hidden;
+      /* The GOT entries for functions in the PLT have not yet been filled
+	 in.  Their initial contents will arrange when called to push an
+	 offset into the .rel.plt section, push _GLOBAL_OFFSET_TABLE_[1],
+	 and then jump to _GLOBAL_OFFSET_TABLE[2].  */
+      got = (ElfW(Addr) *) D_PTR (l, l_info[DT_PLTGOT]);
+      /* If a library is prelinked but we have to relocate anyway,
+	 we have to be able to undo the prelinking of .got.plt.
+	 The prelinker saved us here address of .plt + 0x28.  */
+      if (got[1])
+	{
+	  l->l_mach.plt = got[1] + l->l_addr;
+	  l->l_mach.gotplt = (ElfW(Addr)) &got[3];
+	}
+      got[1] = (ElfW(Addr)) l;	/* Identify this shared object.  */
+
+      /* The got[2] entry contains the address of a function which gets
+	 called to get the address of a so far unresolved function and
+	 jump to it.  The profiling extension of the dynamic linker allows
+	 to intercept the calls to collect information.  In this case we
+	 don't store the address in the GOT so that all future calls also
+	 end in this function.  */
+      if (__builtin_expect (profile, 0))
+	{
+	  got[2] = (ElfW(Addr)) &_dl_runtime_profile;
+
+	  if (GLRO(dl_profile) != NULL && _dl_name_match_p (GLRO(dl_profile), l))
+	    /* This is the object we are looking for.  Say that we really
+	       want profiling and the timers are started.  */
+	    GL(dl_profile_map) = l;
+	}
+      else
+	/* This function will get called to fix up the GOT entry indicated by
+	   the offset on the stack, and then jump to the resolved address.  */
+	got[2] = (ElfW(Addr)) &_dl_runtime_resolve;
+    }
+
+  return lazy;
+}
+
+/* Initial entry point code for the dynamic linker.
+   The C function `_dl_start' is the real entry point;
+   its return value is the user program's entry point.  */
+#define RTLD_START asm ("						\
+	.text								\n\
+	.globl _start							\n\
+	.align	4							\n\
+_start:									\n\
+	/* We are PIC code, so get global offset table.  */		\n\
+	mfusr 	$r15, $PC 						\n\
+	sethi	$gp, HI20(_GLOBAL_OFFSET_TABLE_ + 4)			\n\
+	ori	$gp, $gp, LO12(_GLOBAL_OFFSET_TABLE_ + 8)		\n\
+	add	$gp, $r15, $gp						\n\
+									\n\
+	/* At start time, all the args are on the stack.  */		\n\
+	addi	$r0,	$sp,	0					\n\
+	bal	_dl_start@PLT						\n\
+	/* Save user entry point in $r6 which is callee saved.  */	\n\
+	addi	$r6,	$r0,	0					\n\
+	/* See if we were run as a command with the executable file	\n\
+	   name as an extra leading argument.				\n\
+	   skip these arguments.  */					\n\
+	l.w	$r2,	_dl_skip_args@GOTOFF	/* Args to skip.  */	\n\
+	bnez	$r2,	2f						\n\
+	/* Prepare args to call _dl_init.  */				\n\
+	addi	$r2,	$sp,	4		/* argv.  */		\n\
+1:									\n\
+	l.w	$r0,	_rtld_local@GOTOFF				\n\
+	lwi	$r1,	[$sp+0]			/* argc.  */		\n\
+	/* envp =sp +argc * 4 + 8.  */					\n\
+	slli	$r3,	$r1,	2                                       \n\
+	addi	$r3,	$r3,	8					\n\
+	add	$r3,	$r3,	$sp		/* envp.  */		\n\
+	bal	_dl_init@PLT						\n\
+									\n\
+	/* Load address of _dl_fini finalizer function.  */		\n\
+	la		$r5, _dl_fini@GOTOFF				\n\
+	/* Jump to the user_s entry point.  */				\n\
+	jr	$r6							\n\
+2:									\n\
+	lwi	$r0,	[$sp+0]			/* Original argc.  */	\n\
+	/* Offset for new $sp.  */					\n\
+	slli	$r1,	$r2,	2					\n\
+	/* Adjust sp to skip args.  */					\n\
+	add	$sp,	$sp,	$r1					\n\
+	sub	$r0,	$r0,	$r2		/* Set new argc.  */	\n\
+	swi	$r0,	[$sp+0]			/* Save new argc.  */	\n\
+	andi	$r0,	$sp,	7					\n\
+	beqz	$r0,	1b						\n\
+									\n\
+	/* Make stack 8-byte aligned.  */				\n\
+	bitci	$sp,	$sp,	7					\n\
+	move	$r2,	$sp						\n\
+3:	/* argc and argv.  */						\n\
+	lwi	$r0,	[$r2+4]						\n\
+	smw.bim $r0,[$r2],$r0,#0					\n\
+	bnez	$r0,	3b						\n\
+									\n\
+3:	/* envp.  */							\n\
+	lwi	$r0,	[$r2+4]						\n\
+	smw.bim $r0,[$r2],$r0,#0					\n\
+	bnez	$r0,	3b						\n\
+									\n\
+3:	/* auxv.  */							\n\
+	lmw.ai	$r0,[$r2],$r1,#0					\n\
+	smw.bim	$r0,[$r2],$r1,#0					\n\
+	bnez	$r0,	3b						\n\
+									\n\
+	/* Update _dl_argv.  */						\n\
+	addi	$r2,	$sp,	4					\n\
+	s.w	$r2,	_dl_argv@GOTOFF		/* Args to skip.  */	\n\
+	j	1b							\n\
+	.previous							\n\
+");
+
+# define elf_machine_type_class(type) 					\
+  (((((type) == R_NDS32_JMP_SLOT) 					\
+      || ((type)== R_NDS32_TLS_TPOFF) 					\
+      || ((type)== R_NDS32_TLS_DESC)) * ELF_RTYPE_CLASS_PLT)		\
+   | (((type) == R_NDS32_COPY) * ELF_RTYPE_CLASS_COPY) 			\
+   | (((type) == R_NDS32_GLOB_DAT) * ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA))
+
+
+/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries.  */
+#define ELF_MACHINE_JMP_SLOT	R_NDS32_JMP_SLOT
+
+/* nds32 uses ElfW(Rela) no ElfW(Rel).  */
+#define ELF_MACHINE_NO_REL 1
+#define ELF_MACHINE_NO_RELA 0
+
+/* We define an initialization functions.  This is called very early in
+   _dl_sysdep_start.  */
+#define DL_PLATFORM_INIT dl_platform_init ()
+
+static inline void __attribute__ ((unused))
+dl_platform_init (void)
+{
+  if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0')
+    /* Avoid an empty string which would disturb us.  */
+    GLRO(dl_platform) = NULL;
+}
+
+/* Fixup a PLT entry to bounce directly to the function at VALUE.  */
+static inline ElfW(Addr)
+elf_machine_fixup_plt (struct link_map *map, lookup_t t,
+		       const ElfW(Sym) *refsym, const ElfW(Sym) *sym,
+		       const ElfW(Rela) *reloc,
+		       ElfW(Addr) *reloc_addr, ElfW(Addr) value)
+{
+  return *reloc_addr = value;
+}
+
+static inline ElfW(Addr)
+elf_machine_plt_value (struct link_map *map, const ElfW(Rela) *reloc,
+		       ElfW(Addr) value)
+{
+  return value + reloc->r_addend ;
+}
+
+/* Names of the architecture-specific auditing callback functions.  */
+#define ARCH_LA_PLTENTER nds32_gnu_pltenter
+#define ARCH_LA_PLTEXIT nds32_gnu_pltexit
+
+#endif /* dl_machine_h.  */
+
+
+#ifdef RESOLVE_MAP
+
+# define COPY_UNALIGNED_WORD(swp, twp) \
+  { \
+    unsigned int __tmp = __builtin_nds32_unaligned_load_w (swp); \
+    __builtin_nds32_unaligned_store_w (twp, __tmp); \
+  }
+/* Perform the relocation specified by RELOC and SYM (which is fully resolved).
+   MAP is the object containing the reloc.  */
+
+auto inline void
+elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
+                  const ElfW(Sym) *sym, const struct r_found_version *version,
+                  void *const reloc_addr_arg, int skip_ifunc)
+{
+
+  ElfW(Addr) *const reloc_addr = reloc_addr_arg;
+  const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
+  ElfW(Addr) value = 0;
+
+  const ElfW(Sym) *const refsym = sym;
+  struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
+  if (sym_map != NULL)
+    value = SYMBOL_ADDRESS (sym_map, sym, true) + reloc->r_addend;
+  switch (r_type)
+    {
+    case R_NDS32_COPY:
+      if (__glibc_unlikely (sym == NULL))
+	/* This can happen in trace mode if an object could not be found.  */
+	    break;
+      if (sym->st_size > refsym->st_size
+	      || (sym->st_size < refsym->st_size && GLRO(dl_verbose)))
+	{
+	  const char *strtab;
+
+	  strtab = (const char *) D_PTR (map, l_info[DT_STRTAB]);
+	  _dl_error_printf ("\
+  %s: Symbol `%s' has different size in shared object, consider re-linking\n",
+	                        rtld_progname ?: "<program name unknown>",
+				strtab + refsym->st_name);
+	}
+      memcpy (reloc_addr_arg, (void *) value,
+                MIN (sym->st_size, refsym->st_size));
+      break;
+    case R_NDS32_GLOB_DAT:
+    case R_NDS32_JMP_SLOT:
+	/* These addresses are always aligned.  */
+      *reloc_addr = value;
+      break;
+    case R_NDS32_32_RELA:
+      COPY_UNALIGNED_WORD (&value, reloc_addr);
+      break;
+    case R_NDS32_TLS_TPOFF:
+      {
+# ifdef RTLD_BOOTSTRAP
+	*reloc_addr = map->l_tls_offset + sym->st_value + reloc->r_addend;
+# else
+	if (sym != NULL)
+	  {
+            CHECK_STATIC_TLS (map, sym_map);
+            *reloc_addr = sym_map->l_tls_offset + sym->st_value + reloc->r_addend;
+          }
+        else
+          _dl_error_printf ("sym is NULL in R_NDS32_TLS_TPOFF\n");
+# endif
+      }
+      break;
+
+    case R_NDS32_TLS_DESC:
+      {
+        struct tlsdesc volatile *td = (struct tlsdesc volatile *) reloc_addr;
+# ifndef RTLD_BOOTSTRAP
+	if (!sym)
+	  {
+	    td->argument.value = reloc->r_addend;
+	    td->entry = _dl_tlsdesc_undefweak;
+	  }
+	else
+# endif
+	  {
+	    value = sym->st_value + reloc->r_addend;
+# ifndef RTLD_BOOTSTRAP
+#   ifndef SHARED
+	    CHECK_STATIC_TLS (map, sym_map);
+#   else
+	    if (!TRY_STATIC_TLS (map, sym_map))
+	      {
+	        td->argument.pointer = _dl_make_tlsdesc_dynamic(sym_map, value);
+	        td->entry = _dl_tlsdesc_dynamic;
+	      }
+	    else
+#   endif
+# endif
+	      {
+	        td->argument.value = value + sym_map->l_tls_offset;
+	        td->entry = _dl_tlsdesc_return;
+	      }
+	  }
+      }
+      break;
+# if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
+    case R_NDS32_RELATIVE:
+      {
+#  if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
+        /* This is defined in rtld.c, but nowhere in the static libc.a;
+	   make the reference weak so static programs can still link.
+	   This declaration cannot be done when compiling rtld.c
+	   (i.e. #ifdef RTLD_BOOTSTRAP) because rtld.c contains the
+	   common defn for _dl_rtld_map, which is incompatible with a
+	   weak decl in the same file.  */
+#   ifndef SHARED
+        weak_extern (_dl_rtld_map);
+#   endif
+	if (map != &GL(dl_rtld_map)) /* Already done in rtld itself.  */
+#  endif
+	  *reloc_addr = map->l_addr + reloc->r_addend;
+      }
+# endif
+    case R_NDS32_NONE:
+      break;
+    default:
+      _dl_reloc_bad_type (map, r_type, 0);
+      break;
+    }
+}
+
+auto inline void
+__attribute__ ((always_inline))
+elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
+			   void *const reloc_addr_arg)
+{
+  ElfW(Addr) value;
+
+  if (reloc->r_addend)
+    value = l_addr + reloc->r_addend;
+  else
+    {
+      COPY_UNALIGNED_WORD (reloc_addr_arg, &value);
+      value += l_addr;
+    }
+  COPY_UNALIGNED_WORD (&value, reloc_addr_arg);
+
+# undef COPY_UNALIGNED_WORD
+}
+
+auto inline void
+__attribute__ ((always_inline))
+elf_machine_lazy_rel (struct link_map *map,
+		      ElfW(Addr) l_addr, const ElfW(Rela) *reloc, int skip_ifunc)
+{
+  ElfW(Addr) *const reloc_addr = (void *) (l_addr + reloc->r_offset);
+  /* Check for unexpected PLT reloc type.  */
+  if (ELF32_R_TYPE (reloc->r_info) == R_NDS32_JMP_SLOT)
+    {
+      if (__builtin_expect (map->l_mach.plt, 0) == 0)
+	*reloc_addr += l_addr;
+      else
+	*reloc_addr =
+	  map->l_mach.plt
+	  + (((ElfW(Addr)) reloc_addr) - map->l_mach.gotplt) * 6;
+    }
+  else if (ELF32_R_TYPE (reloc->r_info) == R_NDS32_NONE) {
+    }
+  else
+    _dl_reloc_bad_type (map, ELF32_R_TYPE (reloc->r_info), 1);
+}
+#endif /* RESOLVE_MAP.  */
+
diff --git a/sysdeps/nds32/dl-sysdep.h b/sysdeps/nds32/dl-sysdep.h
new file mode 100644
index 0000000..c7fc3d0
--- /dev/null
+++ b/sysdeps/nds32/dl-sysdep.h
@@ -0,0 +1,22 @@
+/* System-specific settings for dynamic linker code.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include_next <dl-sysdep.h>
+
+#define DL_ARGV_NOT_RELRO 1
+#define DL_EXTERN_PROTECTED_DATA
diff --git a/sysdeps/nds32/dl-trampoline.S b/sysdeps/nds32/dl-trampoline.S
new file mode 100644
index 0000000..3b7a4ea
--- /dev/null
+++ b/sysdeps/nds32/dl-trampoline.S
@@ -0,0 +1,164 @@
+/* PLT trampolines.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <libc-symbols.h>
+
+ENTRY(_dl_runtime_resolve)
+
+	/* We get called with:
+	   $lp contains the return address from this call.
+	   $r16 contains offset to target reloc entry.
+	   $r17 contains GOT[1] (identity of taget lib).
+	   $r15 is GOT[2] (starting address of _dl_runtime_resolve).  */
+
+	/* Save arguments $r0 - $r3.  */
+	smw.adm $r0,	[$sp],	$r5,	6
+	.cfi_adjust_cfa_offset 32
+	.cfi_rel_offset lp, 28 
+	.cfi_rel_offset gp, 24
+
+	GET_GTABLE ($gp)
+
+	move	$r0,	$r17
+	/* Sizeof (ElfW(Rela)) is 12.  */
+	slli    $r1,    $r16,   2
+	slli    $r16,   $r16,   3
+	add     $r1,    $r1,    $r16
+	addi	$r2,	$lp,	0
+	bal	_dl_fixup
+	/* Save the return.  */
+	addi	$r15,	$r0,	0
+	
+	lmw.bim	$r0,	[$sp],	$r5,	6
+	.cfi_adjust_cfa_offset -32
+	.cfi_restore lp
+	.cfi_restore gp
+
+	/* Jump to the newly found address.  */
+	jr		$r15
+END(_dl_runtime_resolve)
+ENTRY(_dl_runtime_profile)
+
+	/* We get called with:
+	   $lp contains the return address from this call.
+	   $r16 contains offset to target reloc entry.
+	   $r17 contains GOT[1] (identity of taget lib).
+	   $r15 is GOT[2] (starting address of this function).
+
+	   Stack layout:
+	   12 - La_nds32_regs (9 registers).
+	   4 - Saved two arguments to _dl_profile_fixup.
+	   0 - framesize returned from pltenter.  */
+
+	/* Save La_nds32_regs arguments: $r0 - $r5, $gp, $lp, $sp.  */
+	move 	$r15,	$sp
+	smw.adm $r0,	[$r15],	$r5,	7
+	move	$sp,	$r15
+	.cfi_adjust_cfa_offset 36
+	.cfi_rel_offset gp, 24
+	.cfi_rel_offset lp, 28
+
+	GET_GTABLE ($gp)
+
+	addi	$r0,	$r17,	0
+	slli	$r1,	$r16,	2
+	slli	$r16,	$r16,	3
+	add	$r1,	$r1,	$r16
+
+	smw.adm $r0,    [$sp],  $r1,    0
+	.cfi_adjust_cfa_offset 4
+
+	xor	$r4,	$r4,	$r4
+	push	$r4
+
+	move	$r2,	$lp
+	addi	$r3,	$sp,	12
+	move	$r4,	$sp
+
+	bal	_dl_profile_fixup
+	lw	$r2,	[$sp]
+	sw	$r0,	[$sp]
+	bgez	$r2,	1f
+	cfi_remember_state
+
+	addi	$r15,	$sp,	12
+	lmw.bim	$r0,	[$r15],	$r5,	7
+	.cfi_adjust_cfa_offset -48
+	.cfi_restore gp
+	.cfi_restore lp
+	lwi	$r15,	[$sp + (-48)]
+
+	/* Jump to the newly found address.  */
+	jr	$r15
+1:
+	/* The new frame size is in $r2.
+
+	   New stack layout:
+	   16 - La_nds32_regs (9 registers).
+	   8 - Saved two arguments to _dl_profile_fixup.
+	   4 - Saved result of _dl_profile_fixup.
+	   0 - saved $r6.  */
+
+	cfi_restore_state
+	push	$r6
+
+	/* Make new frame size 8-byte aligned.  */
+	bitci	$r6,	$r2,	7
+
+
+	/* Copy stack argument.  */
+	sub	$r0,	$sp,	$r6
+	addi	$r1,	$sp,	48
+	bal	memcpy
+
+	/* Jump to the newly found address.  */
+	addi	$r15,	$sp,	16
+	lmw.bim	$r0,	[$r15],	$r5,	0
+	lwi	$r15,	[$sp +4]
+	sub	$sp,	$sp,	$r6
+	jral	$r15
+	add	$sp,	$sp,	$r6
+	pop	$r6	
+	cfi_def_cfa_register (sp)
+	/* New stack layout:
+	   24 - La_nds32_regs (9 registers).
+	   16 - Saved two arguments to _dl_profile_fixup.
+	   12 - Saved result of _dl_profile_fixup.
+	   8 - one dummy word for stack aligned.
+	   0 - La_nds32_retval.  */
+	
+	/* Push $r0, $r1 for La_nds32_retval.  */
+	/* Push $r2 for dummy word.  */
+	smw.adm	$r0,	[$sp],	$r2
+	.cfi_adjust_cfa_offset 12
+	addi	$r15,	$sp,	16
+	lmw.bim $r0,    [$r15],  $r1	
+	addi	$r2,	$sp,	24
+	/* $r3 contains outregs.  */
+	move	$r3,	$sp
+	bal	_dl_call_pltexit
+
+	lmw.bim $r0,    [$sp],  $r1
+	addi	$r15,	$sp,	24
+	lmw.bim	$r2,	[$r15],	$r5,	7
+	.cfi_adjust_cfa_offset -48
+	.cfi_restore gp
+	.cfi_restore lp
+	ret
+END(_dl_runtime_profile)
diff --git a/sysdeps/nds32/ldsodefs.h b/sysdeps/nds32/ldsodefs.h
new file mode 100644
index 0000000..8df2ac8
--- /dev/null
+++ b/sysdeps/nds32/ldsodefs.h
@@ -0,0 +1,44 @@
+/* Run-time dynamic linker data structures for loaded ELF shared objects.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+
+#ifndef	_NDS32_LDSODEFS_H
+#define	_NDS32_LDSODEFS_H	1
+
+#include <elf.h>
+
+struct La_nds32_regs;
+struct La_nds32_retval;
+
+#define ARCH_PLTENTER_MEMBERS						\
+    ElfW(Addr) (*nds32_gnu_pltenter) (ElfW(Sym) *, unsigned int, 	\
+				      uintptr_t *, uintptr_t *,		\
+				      struct La_nds32_regs *,		\
+				      unsigned int *, const char *name,	\
+				      long int *framesizep)
+
+#define ARCH_PLTEXIT_MEMBERS						\
+    unsigned int (*nds32_gnu_pltexit) (ElfW(Sym) *, unsigned int,	\
+				       uintptr_t *, uintptr_t *,	\
+				       const struct La_nds32_regs *,	\
+				       struct La_nds32_retval *, 	\
+				       const char *)
+
+#include_next <ldsodefs.h>
+
+#endif /* _NDS32_LDSODEFS_H.  */
diff --git a/sysdeps/nds32/start.S b/sysdeps/nds32/start.S
new file mode 100644
index 0000000..4b8cae6
--- /dev/null
+++ b/sysdeps/nds32/start.S
@@ -0,0 +1,124 @@
+/* Startup code compliant to the ELF nds32 ABI.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file with other
+   programs, and to distribute those programs without any restriction
+   coming from the use of this file. (The GNU Lesser General Public
+   License restrictions do apply in other respects; for example, they
+   cover modification of the file, and distribution when not linked
+   into another program.)
+
+   Note that people who make modified versions of this file are not
+   obligated to grant this special exception for their modified
+   versions; it is their choice whether to do so. The GNU Lesser
+   General Public License gives permission to release a modified
+   version without this exception; this exception also makes it
+   possible to release a modified version which carries forward this
+   exception.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This is the canonical entry point, usually the first thing in the text
+   segment.
+
+	Note that the code in the .init section has already been run.
+	This includes _init and _libc_init
+
+
+	At this entry point, most registers' values are unspecified, except:
+
+   $r5		Contains a function pointer to be registered with `atexit'.
+		This is how the dynamic linker arranges to have DT_FINI
+		functions called for shared libraries that have been loaded
+		before this code runs.
+
+   sp		The stack contains the arguments and environment:
+		0(sp)			argc
+		4(sp)			argv[0]
+		...
+		(4*argc)(sp)		NULL
+		(4*(argc+1))(sp)	envp[0]
+		...
+					NULL
+*/
+#include <sysdep.h>
+	.text
+	.align	4
+	.globl _start
+	.type  _start, @function
+#ifdef SHARED
+	.pic
+#endif
+_start:
+	/* clear FP.  */
+	movi    $fp,	0
+	/* $r1 = argc.  */
+	lwi	$r1,	[$sp + 0]
+	/* $r2 = argv.  */
+	addi	$r2,	$sp,	4
+	
+	/* align sp to 8-byte boundary.  */
+	movi	$r0,	-8
+	and	$sp,	$sp,	$r0
+	/* $r6 = stack top.  */
+	addi	$r6,	$sp,	0
+	
+#ifdef SHARED
+	/* set $gp register.  */
+	GET_GTABLE ($gp)
+	
+	la	$r3,	__libc_csu_init@GOTOFF
+	la	$r4,	__libc_csu_fini@GOTOFF
+	la	$r0,	main@GOT
+	
+	/* push everything to stack.
+           $r5 is rtld_fini, $r7 is used to keep stack align.  */
+	pushm	$r0,	$r7
+	
+	/* now start it up.  */
+	bal	__libc_start_main@PLT
+	
+	/* should never get here.  */
+	bal	abort@PLT
+#else
+	/* init $gp for small data access.  */
+	la	$gp, _SDA_BASE_
+	
+	la	$r3,	__libc_csu_init
+	la 	$r4,	__libc_csu_fini
+	la	$r0,	main
+	
+	/* push everything to stack, $r5 is rtld_fini, $r7 is dummy a word.  */
+	pushm	$r0,	$r7
+	
+	/* now start it up.  */
+	bal	__libc_start_main
+	
+	/* should never get here.  */
+	bal	abort
+#endif
+
+	ret
+	
+	/* Define a symbol for the first piece of initialized data.  */
+	.data
+	.globl __data_start
+__data_start:
+	.long	0
+	.weak data_start
+	data_start = __data_start
diff --git a/sysdeps/unix/sysv/linux/nds32/dl-static.c b/sysdeps/unix/sysv/linux/nds32/dl-static.c
new file mode 100644
index 0000000..09864a7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/dl-static.c
@@ -0,0 +1,84 @@
+/* Variable initialization, Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <ldsodefs.h>
+
+#ifdef SHARED
+
+void
+_dl_var_init (void *array[])
+{
+  /* It has to match "variables" below.  */
+  enum
+    {
+      DL_PAGESIZE = 0
+    };
+
+  GLRO(dl_pagesize) = *((size_t *) array[DL_PAGESIZE]);
+}
+
+#else
+
+static void *variables[] =
+{
+  &GLRO(dl_pagesize)
+};
+
+static void
+_dl_unprotect_relro (struct link_map *l)
+{
+  ElfW(Addr) start = ((l->l_addr + l->l_relro_addr)
+		      & ~(GLRO(dl_pagesize) - 1));
+  ElfW(Addr) end = ((l->l_addr + l->l_relro_addr + l->l_relro_size)
+		    & ~(GLRO(dl_pagesize) - 1));
+
+  if (start != end)
+    __mprotect ((void *) start, end - start, PROT_READ | PROT_WRITE);
+}
+
+void
+_dl_static_init (struct link_map *l)
+{
+  struct link_map *rtld_map = l;
+  struct r_scope_elem **scope;
+  const ElfW(Sym) *ref = NULL;
+  lookup_t loadbase;
+  void (*f) (void *[]);
+  size_t i;
+
+  loadbase = _dl_lookup_symbol_x ("_dl_var_init", l, &ref, l->l_local_scope,
+				  NULL, 0, 1, NULL);
+
+  for (scope = l->l_local_scope; *scope != NULL; scope++)
+    for (i = 0; i < (*scope)->r_nlist; i++)
+      if ((*scope)->r_list[i] == loadbase)
+	{
+	  rtld_map = (*scope)->r_list[i];
+	  break;
+	}
+
+  if (ref != NULL)
+    {
+      f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref);
+      _dl_unprotect_relro (rtld_map);
+      f (variables);
+      _dl_protect_relro (rtld_map);
+    }
+}
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/nds32/ldconfig.h b/sysdeps/unix/sysv/linux/nds32/ldconfig.h
new file mode 100644
index 0000000..cef84ec
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/ldconfig.h
@@ -0,0 +1,27 @@
+/* ldconfig default paths and libraries, Andes Linux/nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdeps/generic/ldconfig.h>
+
+
+#define SYSDEP_KNOWN_INTERPRETER_NAMES				\
+  { "ld-linux-nds32.so.1", FLAG_ELF_LIBC6 }
+
+#define SYSDEP_KNOWN_LIBRARY_NAMES	\
+  { "libc.so.6", FLAG_ELF_LIBC6 },	\
+  { "libm.so.6", FLAG_ELF_LIBC6 },
diff --git a/sysdeps/unix/sysv/linux/nds32/ldsodefs.h b/sysdeps/unix/sysv/linux/nds32/ldsodefs.h
new file mode 100644
index 0000000..01d6d77
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/ldsodefs.h
@@ -0,0 +1,32 @@
+/* Andes nds32 dynamic linker data structures for loaded ELF shared objects.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _LDSODEFS_H
+
+/* Get the real definitions.  */
+#include_next <ldsodefs.h>
+
+/* Now define our stuff.  */
+
+/* We need special support to initialize DSO loaded for statically linked
+   binaries.  */
+extern void _dl_static_init (struct link_map *map);
+#undef DL_STATIC_INIT
+#define DL_STATIC_INIT(map) _dl_static_init (map)
+
+#endif /* _LDSODEFS_H.  */
-- 
1.9.5


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v4 05/11] nds32: Generic <math.h>, soft-fp and hard-fp Routines
  2019-06-05 11:56 [PATCH v4 00/11] nds32 glibc port, v4 Vincent Chen
                   ` (3 preceding siblings ...)
  2019-06-05 11:56 ` [PATCH v4 04/11] nds32: Startup and Dynamic Loader Vincent Chen
@ 2019-06-05 11:56 ` Vincent Chen
  2019-06-06 22:41   ` Joseph Myers
  2019-06-05 11:56 ` [PATCH v4 06/11] nds32: Atomic and Locking Routines Vincent Chen
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 28+ messages in thread
From: Vincent Chen @ 2019-06-05 11:56 UTC (permalink / raw
  To: libc-alpha, joseph; +Cc: deanbo422, cnoize, vincentc

nds32 ports support hard-fp and soft-fp operation. This patch contains
the requried files and ulps file.

2019-06-03  Vincent Chen  <vincentc@andestech.com>
2019-06-03  CheWei Chuang  <cnoize@andestech.com>

	* sysdeps/nds32/bits/fenv.h: New file.
	* sysdeps/nds32/fpu/e_sqrt.c: Likewise.
	* sysdeps/nds32/fpu/e_sqrtf.c: Likewise.
	* sysdeps/nds32/fpu/fclrexcpt.c: Likewise.
	* sysdeps/nds32/fpu/fedisblxcpt.c: Likewise.
	* sysdeps/nds32/fpu/feenablxcpt.c: Likewise.
	* sysdeps/nds32/fpu/fegetenv.c: Likewise.
	* sysdeps/nds32/fpu/fegetexcept.c: Likewise.
	* sysdeps/nds32/fpu/fegetmode.c: Likewise.
	* sysdeps/nds32/fpu/fegetround.c: Likewise.
	* sysdeps/nds32/fpu/feholdexcpt.c: Likewise.
	* sysdeps/nds32/fpu/fenv_private.h: Likewise.
	* sysdeps/nds32/fpu/fesetenv.c: Likewise.
	* sysdeps/nds32/fpu/fesetexcept.c: Likewise.
	* sysdeps/nds32/fpu/fesetmode.c: Likewise.
	* sysdeps/nds32/fpu/fesetround.c: Likewise.
	* sysdeps/nds32/fpu/feupdateenv.c: Likewise.
	* sysdeps/nds32/fpu/fgetexcptflg.c: Likewise.
	* sysdeps/nds32/fpu/fix-fp-int-compare-invalid.h: Likewise.
	* sysdeps/nds32/fpu/fix-fp-int-convert-overflow.h: Likewise.
	* sysdeps/nds32/fpu/fpu_control.h: Likewise.
	* sysdeps/nds32/fpu/fraiseexcpt.c: Likewise.
	* sysdeps/nds32/fpu/fsetexcptflg.c: Likewise.
	* sysdeps/nds32/fpu/ftestexcept.c: Likewise.
	* sysdeps/nds32/fpu/get-rounding-mode.h: Likewise.
	* sysdeps/nds32/fpu/libm-test-ulps: Likewise.
	* sysdeps/nds32/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/nds32/fpu/math-barriers.h: Likewise.
	* sysdeps/nds32/nofpu/libm-test-ulps: Likewise.
	* sysdeps/nds32/nofpu/libm-test-ulps-name: Likewise.
	* sysdeps/nds32/sfp-machine.h: Likewise.
	* sysdeps/nds32/tininess.h: Likewise.
---
 sysdeps/nds32/bits/fenv.h                       |   96 ++
 sysdeps/nds32/fpu/e_sqrt.c                      |   27 +
 sysdeps/nds32/fpu/e_sqrtf.c                     |   26 +
 sysdeps/nds32/fpu/fclrexcpt.c                   |   42 +
 sysdeps/nds32/fpu/fedisblxcpt.c                 |   58 +
 sysdeps/nds32/fpu/feenablxcpt.c                 |   57 +
 sysdeps/nds32/fpu/fegetenv.c                    |   44 +
 sysdeps/nds32/fpu/fegetexcept.c                 |   41 +
 sysdeps/nds32/fpu/fegetmode.c                   |   39 +
 sysdeps/nds32/fpu/fegetround.c                  |   29 +
 sysdeps/nds32/fpu/feholdexcpt.c                 |   29 +
 sysdeps/nds32/fpu/fenv_private.h                |  229 ++++
 sysdeps/nds32/fpu/fesetenv.c                    |   30 +
 sysdeps/nds32/fpu/fesetexcept.c                 |   34 +
 sysdeps/nds32/fpu/fesetmode.c                   |   53 +
 sysdeps/nds32/fpu/fesetround.c                  |   35 +
 sysdeps/nds32/fpu/feupdateenv.c                 |   31 +
 sysdeps/nds32/fpu/fgetexcptflg.c                |   27 +
 sysdeps/nds32/fpu/fix-fp-int-compare-invalid.h  |   25 +
 sysdeps/nds32/fpu/fix-fp-int-convert-overflow.h |   34 +
 sysdeps/nds32/fpu/fpu_control.h                 |  104 ++
 sysdeps/nds32/fpu/fraiseexcpt.c                 |  100 ++
 sysdeps/nds32/fpu/fsetexcptflg.c                |   39 +
 sysdeps/nds32/fpu/ftestexcept.c                 |   27 +
 sysdeps/nds32/fpu/get-rounding-mode.h           |   39 +
 sysdeps/nds32/fpu/libm-test-ulps                | 1643 +++++++++++++++++++++++
 sysdeps/nds32/fpu/libm-test-ulps-name           |    1 +
 sysdeps/nds32/fpu/math-barriers.h               |   27 +
 sysdeps/nds32/nofpu/libm-test-ulps              |  390 ++++++
 sysdeps/nds32/nofpu/libm-test-ulps-name         |    1 +
 sysdeps/nds32/sfp-machine.h                     |   68 +
 sysdeps/nds32/tininess.h                        |    1 +
 32 files changed, 3426 insertions(+)
 create mode 100644 sysdeps/nds32/bits/fenv.h
 create mode 100644 sysdeps/nds32/fpu/e_sqrt.c
 create mode 100644 sysdeps/nds32/fpu/e_sqrtf.c
 create mode 100644 sysdeps/nds32/fpu/fclrexcpt.c
 create mode 100644 sysdeps/nds32/fpu/fedisblxcpt.c
 create mode 100644 sysdeps/nds32/fpu/feenablxcpt.c
 create mode 100644 sysdeps/nds32/fpu/fegetenv.c
 create mode 100644 sysdeps/nds32/fpu/fegetexcept.c
 create mode 100644 sysdeps/nds32/fpu/fegetmode.c
 create mode 100644 sysdeps/nds32/fpu/fegetround.c
 create mode 100644 sysdeps/nds32/fpu/feholdexcpt.c
 create mode 100644 sysdeps/nds32/fpu/fenv_private.h
 create mode 100644 sysdeps/nds32/fpu/fesetenv.c
 create mode 100644 sysdeps/nds32/fpu/fesetexcept.c
 create mode 100644 sysdeps/nds32/fpu/fesetmode.c
 create mode 100644 sysdeps/nds32/fpu/fesetround.c
 create mode 100644 sysdeps/nds32/fpu/feupdateenv.c
 create mode 100644 sysdeps/nds32/fpu/fgetexcptflg.c
 create mode 100644 sysdeps/nds32/fpu/fix-fp-int-compare-invalid.h
 create mode 100644 sysdeps/nds32/fpu/fix-fp-int-convert-overflow.h
 create mode 100644 sysdeps/nds32/fpu/fpu_control.h
 create mode 100644 sysdeps/nds32/fpu/fraiseexcpt.c
 create mode 100644 sysdeps/nds32/fpu/fsetexcptflg.c
 create mode 100644 sysdeps/nds32/fpu/ftestexcept.c
 create mode 100644 sysdeps/nds32/fpu/get-rounding-mode.h
 create mode 100644 sysdeps/nds32/fpu/libm-test-ulps
 create mode 100644 sysdeps/nds32/fpu/libm-test-ulps-name
 create mode 100644 sysdeps/nds32/fpu/math-barriers.h
 create mode 100644 sysdeps/nds32/nofpu/libm-test-ulps
 create mode 100644 sysdeps/nds32/nofpu/libm-test-ulps-name
 create mode 100644 sysdeps/nds32/sfp-machine.h
 create mode 100644 sysdeps/nds32/tininess.h

diff --git a/sysdeps/nds32/bits/fenv.h b/sysdeps/nds32/bits/fenv.h
new file mode 100644
index 0000000..ea72fa4
--- /dev/null
+++ b/sysdeps/nds32/bits/fenv.h
@@ -0,0 +1,96 @@
+/* Floating point environment, Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _FENV_H
+# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
+#endif
+
+#ifdef __NDS32_ABI_2FP_PLUS__ 
+/* Define bits representing exceptions in the FPCSR status word.  */
+enum
+  {
+    FE_INVALID =
+# define FE_INVALID      (0x4)
+      FE_INVALID,
+    FE_DIVBYZERO =
+# define FE_DIVBYZERO    (0x8)
+      FE_DIVBYZERO,
+    FE_OVERFLOW =
+# define FE_OVERFLOW     (0x10)
+      FE_OVERFLOW,
+    FE_UNDERFLOW =
+# define FE_UNDERFLOW    (0x20)
+      FE_UNDERFLOW,
+    FE_INEXACT =
+# define FE_INEXACT      (0x40)
+      FE_INEXACT
+  };
+
+
+# define FE_ALL_EXCEPT   \
+        (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
+enum
+  {
+    FE_TONEAREST =
+# define FE_TONEAREST    (0x0)
+      FE_TONEAREST,
+    FE_UPWARD =
+# define FE_UPWARD       (0x1)
+      FE_UPWARD,
+    FE_DOWNWARD =
+# define FE_DOWNWARD     (0x2)
+      FE_DOWNWARD,
+    FE_TOWARDZERO =
+# define FE_TOWARDZERO   (0x3)
+      FE_TOWARDZERO
+
+  };
+# define FE_NOMASK_ENV  ((const fenv_t *) -2)
+
+#else
+
+# define FE_ALL_EXCEPT	0
+
+enum
+  {
+    __FE_UNDEFINED = 0,
+
+    FE_TONEAREST =
+# define FE_TONEAREST	1
+      FE_TONEAREST,
+  };
+
+
+#endif
+/* Type representing exception flags.  */
+typedef unsigned int fexcept_t;
+
+/* Type representing floating-point environment.  */
+typedef unsigned int fenv_t;
+
+/* If the default argument is used we use this value.  */
+#define FE_DFL_ENV	((const fenv_t *) -1)
+
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes.  */
+typedef unsigned int femode_t;
+
+/* Default floating-point control modes.  */
+# define FE_DFL_MODE	((const femode_t *) -1L)
+#endif
diff --git a/sysdeps/nds32/fpu/e_sqrt.c b/sysdeps/nds32/fpu/e_sqrt.c
new file mode 100644
index 0000000..19a2a23
--- /dev/null
+++ b/sysdeps/nds32/fpu/e_sqrt.c
@@ -0,0 +1,27 @@
+/* Double precision floating point square root.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+      
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+
+
+double __ieee754_sqrt (double x)
+{
+  double z;
+  __asm__ ("fsqrtd %0,%1" : "=f" (z) : "f" (x));
+  return z;
+}
+strong_alias (__ieee754_sqrt, __sqrt_finite)
diff --git a/sysdeps/nds32/fpu/e_sqrtf.c b/sysdeps/nds32/fpu/e_sqrtf.c
new file mode 100644
index 0000000..0428559
--- /dev/null
+++ b/sysdeps/nds32/fpu/e_sqrtf.c
@@ -0,0 +1,26 @@
+/* Single precision floating point square root.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+
+float __ieee754_sqrtf (float x)
+{
+  float z;
+  __asm__ ("fsqrts %0,%1" : "=f" (z) : "f" (x));
+  return z;
+}
+strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/sysdeps/nds32/fpu/fclrexcpt.c b/sysdeps/nds32/fpu/fclrexcpt.c
new file mode 100644
index 0000000..87d5ba0
--- /dev/null
+++ b/sysdeps/nds32/fpu/fclrexcpt.c
@@ -0,0 +1,42 @@
+/* Clear given exceptions in current floating-point environment.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+feclearexcept (int excepts)
+{
+  int temp;
+
+  /* Mask out unsupported bits/exceptions.  */
+  excepts &= FE_ALL_EXCEPT;
+
+  /* Get the current floating point status.  */
+  _FPU_GETCW (temp);
+
+  /* Clear the relevant bits.  */
+  temp &= ~excepts;
+
+  /* Put the new data in effect.  */
+  _FPU_SETCW (temp);
+
+  /* Success.  */
+  return 0;
+}
+libm_hidden_def (feclearexcept)
diff --git a/sysdeps/nds32/fpu/fedisblxcpt.c b/sysdeps/nds32/fpu/fedisblxcpt.c
new file mode 100644
index 0000000..f8ca5a8
--- /dev/null
+++ b/sysdeps/nds32/fpu/fedisblxcpt.c
@@ -0,0 +1,58 @@
+/* Disable floating-point exceptions.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_private.h>
+
+int
+fedisableexcept (int excepts)
+{
+  unsigned long int new_fpcsr, fpcsr, old_exc;
+  unsigned long int act = 0, cmd = GET_UDF_IEX_TRAP;
+  int old_udfiex_trap;
+
+  _FPU_GETCW(fpcsr);
+
+  new_fpcsr = fpcsr & (~ENABLE_MASK);
+
+  excepts = (excepts & FE_ALL_EXCEPT) << ENABLE_SHIFT;
+
+  if (__KERNEL_SUPPORT_SUBNOR_OUTPUT) {
+    old_exc = fpcsr & ENABLE_MASK_SUBOUT;
+    new_fpcsr |= FPU_MASK_SUBOUT;
+
+    if (excepts & FPU_MASK_SUBOUT) {
+      cmd = DISABLE_UDF_IEX_TRAP;
+      act = excepts & FPU_MASK_SUBOUT;
+    }
+    old_udfiex_trap = __fp_udfiex_crtl(cmd, act);
+    if (old_udfiex_trap < 0)
+      return -1;
+
+    old_exc |= old_udfiex_trap;
+  } else
+    old_exc = fpcsr & ENABLE_MASK;
+
+  new_fpcsr |= (old_exc & (~excepts));
+
+  _FPU_SETCW (new_fpcsr);
+
+
+  return old_exc >> ENABLE_SHIFT;
+}
diff --git a/sysdeps/nds32/fpu/feenablxcpt.c b/sysdeps/nds32/fpu/feenablxcpt.c
new file mode 100644
index 0000000..5500843
--- /dev/null
+++ b/sysdeps/nds32/fpu/feenablxcpt.c
@@ -0,0 +1,57 @@
+/* Enable floating-point exceptions.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_private.h>
+
+int
+feenableexcept (int excepts)
+{
+  unsigned long int new_fpcsr, fpcsr, old_exc;
+  unsigned long int cmd = GET_UDF_IEX_TRAP, act = 0;
+  int old_udfiex_trap;
+
+  _FPU_GETCW(fpcsr);
+
+  new_fpcsr = fpcsr & (~ENABLE_MASK);
+
+  excepts = (excepts & FE_ALL_EXCEPT) << ENABLE_SHIFT;
+
+  if (__KERNEL_SUPPORT_SUBNOR_OUTPUT) {
+    old_exc = fpcsr & ENABLE_MASK_SUBOUT;
+    new_fpcsr |= FPU_MASK_SUBOUT;
+
+    if(excepts & FPU_MASK_SUBOUT) {
+      cmd = ENABLE_UDF_IEX_TRAP;
+      act = excepts & FPU_MASK_SUBOUT;
+    }
+    old_udfiex_trap = __fp_udfiex_crtl (cmd, act);
+    if (old_udfiex_trap < 0)
+      return -1;
+
+    old_exc |= old_udfiex_trap;
+  } else
+    old_exc = fpcsr & ENABLE_MASK;
+
+  new_fpcsr |= (old_exc | excepts);
+
+  _FPU_SETCW (new_fpcsr);
+
+  return old_exc >> ENABLE_SHIFT;
+}
diff --git a/sysdeps/nds32/fpu/fegetenv.c b/sysdeps/nds32/fpu/fegetenv.c
new file mode 100644
index 0000000..9f497ea
--- /dev/null
+++ b/sysdeps/nds32/fpu/fegetenv.c
@@ -0,0 +1,44 @@
+/* get current floating-point environment.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_private.h>
+
+int
+__fegetenv (fenv_t *envp)
+{
+  unsigned long int temp;
+  unsigned int udfiex_trap;
+
+  _FPU_GETCW (temp);
+
+  if (__KERNEL_SUPPORT_SUBNOR_OUTPUT) {
+    udfiex_trap = __fp_udfiex_crtl (GET_UDF_IEX_TRAP, 0);
+    if (udfiex_trap < 0)
+      return -1;
+
+    temp = (temp & (~FPU_MASK_SUBOUT)) | udfiex_trap;
+  }
+  *envp = temp;
+  /* Success.  */
+  return 0;
+}
+libm_hidden_def (__fegetenv)
+weak_alias (__fegetenv, fegetenv)
+libm_hidden_weak (fegetenv)
diff --git a/sysdeps/nds32/fpu/fegetexcept.c b/sysdeps/nds32/fpu/fegetexcept.c
new file mode 100644
index 0000000..f9e4f34
--- /dev/null
+++ b/sysdeps/nds32/fpu/fegetexcept.c
@@ -0,0 +1,41 @@
+/* Get enabled floating-point exceptions.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_private.h>
+
+int
+fegetexcept (void)
+{
+  unsigned long int exec;
+  int old_udfiex_trap;
+
+  _FPU_GETCW(exec);
+
+  if (__KERNEL_SUPPORT_SUBNOR_OUTPUT) {
+    old_udfiex_trap = __fp_udfiex_crtl (GET_UDF_IEX_TRAP, 0);
+    if (old_udfiex_trap < 0)
+      return -1;
+    exec = (exec & ENABLE_MASK_SUBOUT) | old_udfiex_trap;
+  } else
+    exec &= ENABLE_MASK;
+
+  return exec >> ENABLE_SHIFT;
+
+}
diff --git a/sysdeps/nds32/fpu/fegetmode.c b/sysdeps/nds32/fpu/fegetmode.c
new file mode 100644
index 0000000..d02134c
--- /dev/null
+++ b/sysdeps/nds32/fpu/fegetmode.c
@@ -0,0 +1,39 @@
+/* Store current floating-point control modes.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_private.h>
+
+int
+fegetmode (femode_t *modep)
+{
+  _FPU_GETCW (*modep);
+
+  if (__KERNEL_SUPPORT_SUBNOR_OUTPUT) {
+    int old_udfiex_trap;
+
+    old_udfiex_trap = __fp_udfiex_crtl (GET_UDF_IEX_TRAP, 0);
+    if (old_udfiex_trap < 0)
+      return -1;
+
+    *modep = (*modep & (~FPU_MASK_SUBOUT)) | old_udfiex_trap;
+  }
+
+  return 0;
+}
diff --git a/sysdeps/nds32/fpu/fegetround.c b/sysdeps/nds32/fpu/fegetround.c
new file mode 100644
index 0000000..a2a1792
--- /dev/null
+++ b/sysdeps/nds32/fpu/fegetround.c
@@ -0,0 +1,29 @@
+/* Return current rounding direction.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <get-rounding-mode.h>
+
+int
+__fegetround (void)
+{
+  return get_rounding_mode ();
+}
+libm_hidden_def (__fegetround)
+weak_alias (__fegetround, fegetround)
+libm_hidden_weak (fegetround)
diff --git a/sysdeps/nds32/fpu/feholdexcpt.c b/sysdeps/nds32/fpu/feholdexcpt.c
new file mode 100644
index 0000000..c157c25
--- /dev/null
+++ b/sysdeps/nds32/fpu/feholdexcpt.c
@@ -0,0 +1,29 @@
+/* Store current floating-point environment and clear exceptions.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_private.h>
+
+int
+__feholdexcept (fenv_t *envp)
+{
+  return libc_feholdexcept_nds32 (envp);
+}
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/nds32/fpu/fenv_private.h b/sysdeps/nds32/fpu/fenv_private.h
new file mode 100644
index 0000000..45c13f6
--- /dev/null
+++ b/sysdeps/nds32/fpu/fenv_private.h
@@ -0,0 +1,229 @@
+/* Private floating point rounding and exceptions handling.
+   Andes NDS32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef NDS32_MATH_PRIVATE_H
+#define NDS32_MATH_PRIVATE_H 1
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+extern long int __fp_udfiex_crtl(int cmd, int act);
+
+static __always_inline int
+libc_feholdexcept_nds32 (fenv_t *envp)
+{
+  int fpcsr, old_udfiex_trap;
+
+  _FPU_GETCW(fpcsr);
+
+  if (__KERNEL_SUPPORT_SUBNOR_OUTPUT) {
+    /* Store the environment.  */
+    *envp = (fpcsr & (~FPU_MASK_SUBOUT));
+
+    /* Get underflow trap status and disable underflow trap.  */
+    old_udfiex_trap = __fp_udfiex_crtl (DISABLE_UDF_IEX_TRAP, FPU_MASK_SUBOUT);
+    if (old_udfiex_trap >= 0)
+       *envp |= old_udfiex_trap;
+
+    /* Now set left exceptions to non-stop and clear all exception flags.  */
+    fpcsr &= ~(ENABLE_MASK_SUBOUT | FE_ALL_EXCEPT);
+  } else {
+    *envp = fpcsr;
+    fpcsr &= ~(ENABLE_MASK | FE_ALL_EXCEPT);
+  }
+  _FPU_SETCW (fpcsr);
+  return 0;
+}
+
+#define libc_feholdexcept  libc_feholdexcept_nds32
+#define libc_feholdexceptf libc_feholdexcept_nds32
+#define libc_feholdexceptl libc_feholdexcept_nds32
+
+static __always_inline void
+libc_fesetround_nds32 (int round)
+{
+  int temp;
+
+  _FPU_GETCW (temp);
+  temp = (temp & ~ROUND_MOD_MASK) | round;
+  _FPU_SETCW (temp);
+}
+
+#define libc_fesetround  libc_fesetround_nds32
+#define libc_fesetroundf libc_fesetround_nds32
+#define libc_fesetroundl libc_fesetround_nds32
+
+static __always_inline void
+libc_feholdexcept_setround_nds32 (fenv_t *envp, int round)
+{
+  libc_feholdexcept_nds32 (envp);
+  libc_fesetround_nds32 (round);
+}
+
+#define libc_feholdexcept_setround  libc_feholdexcept_setround_nds32
+#define libc_feholdexcept_setroundf libc_feholdexcept_setround_nds32
+#define libc_feholdexcept_setroundl libc_feholdexcept_setround_nds32
+
+static __always_inline int
+libc_fetestexcept_nds32 (int excepts)
+{
+  fexcept_t temp;
+
+  /* Get current exceptions.  */
+  _FPU_GETCW(temp);
+
+  return temp & excepts & FE_ALL_EXCEPT;
+}
+
+#define libc_fetestexcept  libc_fetestexcept_nds32
+#define libc_fetestexceptf libc_fetestexcept_nds32
+#define libc_fetestexceptl libc_fetestexcept_nds32
+
+static __always_inline int
+libc_fesetenv_nds32 (const fenv_t *envp)
+{
+  fpu_control_t fpcsr, fpcsr_new;
+  unsigned long int cmd = DISABLE_UDF_IEX_TRAP, act = FPU_MASK_SUBOUT;
+
+  _FPU_GETCW (fpcsr);
+
+  fpcsr_new = (fpcsr & (_FPU_ENV_RESERVED));
+
+  if (envp == FE_DFL_ENV)
+    fpcsr_new |= _FPU_DEFAULT;
+  else if (envp == FE_NOMASK_ENV) {
+    fpcsr_new |= _FPU_IEEE;
+    cmd = ENABLE_UDF_IEX_TRAP;
+  } else {
+    fpcsr_new |= (*envp & ~(_FPU_ENV_RESERVED));
+    /* At first, disable UDF and IEX trap.  */
+    if (__KERNEL_SUPPORT_SUBNOR_OUTPUT) {
+      if (__fp_udfiex_crtl (cmd, act) < 0)
+        return -1;
+    }
+    /* Then, follow requirements to enable UDF and IEX trap.  */
+    cmd = ENABLE_UDF_IEX_TRAP;
+    act = *envp & FPU_MASK_SUBOUT;
+  }
+
+  if (__KERNEL_SUPPORT_SUBNOR_OUTPUT) {
+    fpcsr_new |= FPU_MASK_SUBOUT;
+    if (__fp_udfiex_crtl (cmd, act) < 0)
+      return -1;
+  }
+  _FPU_SETCW (fpcsr_new);
+  return 0;
+}
+
+#define libc_fesetenv  libc_fesetenv_nds32
+#define libc_fesetenvf libc_fesetenv_nds32
+#define libc_fesetenvl libc_fesetenv_nds32
+#define libc_feresetround_noex  libc_fesetenv_nds32
+#define libc_feresetround_noexf libc_fesetenv_nds32
+#define libc_feresetround_noexl libc_fesetenv_nds32
+
+static __always_inline int
+libc_feupdateenv_test_nds32 (const fenv_t *envp, int ex)
+{
+  fpu_control_t fpcsr, fpcsr_new, old_exc;
+  unsigned long int cmd = DISABLE_UDF_IEX_TRAP, act = FPU_MASK_SUBOUT;
+  unsigned long int raise_exc;
+
+  _FPU_GETCW (fpcsr);
+  old_exc = fpcsr & FE_ALL_EXCEPT;
+  fpcsr_new = fpcsr & (_FPU_ENV_RESERVED | FE_ALL_EXCEPT);
+
+
+  if (envp == FE_DFL_ENV)
+    fpcsr_new |= _FPU_DEFAULT;
+  else if (envp == FE_NOMASK_ENV) {
+    fpcsr_new |= _FPU_IEEE;
+    cmd = ENABLE_UDF_IEX_TRAP;
+  } else {
+    fpcsr_new |= (*envp & ~_FPU_ENV_RESERVED);
+    /* At first, disable UDF and IEX trap.  */
+    if (__KERNEL_SUPPORT_SUBNOR_OUTPUT) {
+      if (__fp_udfiex_crtl (cmd, act) < 0)
+        return -1;
+    }
+    /* Then, follow requirements to enable UDF and IEX trap.  */
+    cmd = ENABLE_UDF_IEX_TRAP;
+    act = *envp & FPU_MASK_SUBOUT;
+  }
+
+  raise_exc = old_exc & (fpcsr_new >> ENABLE_SHIFT);
+
+  if (__KERNEL_SUPPORT_SUBNOR_OUTPUT) {
+    fpcsr_new |= FPU_MASK_SUBOUT;
+    if (__fp_udfiex_crtl (cmd, act) < 0)
+      return -1;
+  }
+
+  _FPU_SETCW (fpcsr_new);
+  if (raise_exc)
+    __feraiseexcept (raise_exc);
+  return old_exc & ex;
+}
+#define libc_feupdateenv_test  libc_feupdateenv_test_nds32
+#define libc_feupdateenv_testf libc_feupdateenv_test_nds32
+#define libc_feupdateenv_testl libc_feupdateenv_test_nds32
+
+static __always_inline int
+libc_feupdateenv_nds32 (const fenv_t *envp)
+{
+  return libc_feupdateenv_test_nds32(envp, 0);
+}
+
+#define libc_feupdateenv  libc_feupdateenv_nds32
+#define libc_feupdateenvf libc_feupdateenv_nds32
+#define libc_feupdateenvl libc_feupdateenv_nds32
+
+static __always_inline void
+libc_feholdsetround_nds32 (fenv_t *envp, int round)
+{
+  fpu_control_t fpcsr;
+  
+  _FPU_GETCW (fpcsr);
+  *envp = fpcsr & ROUND_MOD_MASK;
+  fpcsr = (fpcsr & ~ROUND_MOD_MASK) | (round & ROUND_MOD_MASK);
+  _FPU_SETCW (fpcsr);
+}
+
+#define libc_feholdsetround  libc_feholdsetround_nds32
+#define libc_feholdsetroundf libc_feholdsetround_nds32
+#define libc_feholdsetroundl libc_feholdsetround_nds32
+
+static __always_inline void
+libc_feresetround_nds32 (fenv_t *envp)
+{
+  int temp;
+
+  _FPU_GETCW (temp);
+  temp = (temp & ~ROUND_MOD_MASK) | (*envp & ROUND_MOD_MASK);
+  _FPU_SETCW (temp);
+}
+
+#define libc_feresetround  libc_feresetround_nds32
+#define libc_feresetroundf libc_feresetround_nds32
+#define libc_feresetroundl libc_feresetround_nds32
+
+
+#include_next <fenv_private.h>
+
+#endif
diff --git a/sysdeps/nds32/fpu/fesetenv.c b/sysdeps/nds32/fpu/fesetenv.c
new file mode 100644
index 0000000..0885b5a
--- /dev/null
+++ b/sysdeps/nds32/fpu/fesetenv.c
@@ -0,0 +1,30 @@
+/* Install given floating-point environment.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_private.h>
+
+int
+__fesetenv (const fenv_t *envp)
+{
+  return libc_fesetenv_nds32(envp);
+}
+libm_hidden_def (__fesetenv)
+weak_alias (__fesetenv, fesetenv)
+libm_hidden_weak (fesetenv)
diff --git a/sysdeps/nds32/fpu/fesetexcept.c b/sysdeps/nds32/fpu/fesetexcept.c
new file mode 100644
index 0000000..0999902
--- /dev/null
+++ b/sysdeps/nds32/fpu/fesetexcept.c
@@ -0,0 +1,34 @@
+/* Set given exception flags.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetexcept (int excepts)
+{
+  int fpsr;
+  int fpsr_new;
+
+  _FPU_GETCW (fpsr);
+  fpsr_new = fpsr | (excepts & FE_ALL_EXCEPT);
+  if (fpsr != fpsr_new)
+    _FPU_SETCW (fpsr_new);
+
+  return 0;
+}
diff --git a/sysdeps/nds32/fpu/fesetmode.c b/sysdeps/nds32/fpu/fesetmode.c
new file mode 100644
index 0000000..698f71c
--- /dev/null
+++ b/sysdeps/nds32/fpu/fesetmode.c
@@ -0,0 +1,53 @@
+/* Install given floating-point control modes.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_private.h>
+
+int
+fesetmode (const femode_t *modep)
+{
+  fpu_control_t fpcsr, new_fpcsr;
+  int cmd = DISABLE_UDF_IEX_TRAP, act = FPU_MASK_SUBOUT;
+
+  _FPU_GETCW (fpcsr);
+  new_fpcsr = fpcsr & _FPU_MOD_RESERVED;
+
+  if (modep == FE_DFL_MODE)
+    new_fpcsr |= _FPU_DEFAULT;
+  else {
+    new_fpcsr |= (*modep & ~_FPU_MOD_RESERVED);
+    /* At first, disable UDF and IEX trap.  */
+    if (__KERNEL_SUPPORT_SUBNOR_OUTPUT) {
+      if (__fp_udfiex_crtl (cmd, act) < 0)
+        return -1;
+    }
+    cmd = ENABLE_UDF_IEX_TRAP;
+    act = *modep & FPU_MASK_SUBOUT;
+  }
+
+  if (__KERNEL_SUPPORT_SUBNOR_OUTPUT) {
+    new_fpcsr |= FPU_MASK_SUBOUT;
+    if (__fp_udfiex_crtl (cmd, act) < 0)
+      return -1;
+  }
+
+  _FPU_SETCW (new_fpcsr);
+  return 0;
+}
diff --git a/sysdeps/nds32/fpu/fesetround.c b/sysdeps/nds32/fpu/fesetround.c
new file mode 100644
index 0000000..d3ac176
--- /dev/null
+++ b/sysdeps/nds32/fpu/fesetround.c
@@ -0,0 +1,35 @@
+/* Set current rounding direction.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_private.h>
+#include <fpu_control.h>
+
+int
+__fesetround (int round)
+{
+  if ((round & ~0x3) != 0)
+    /* ROUND is no valid rounding mode.  */
+	return 1;
+
+  libc_fesetround_nds32 (round);
+  return 0;
+}
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
diff --git a/sysdeps/nds32/fpu/feupdateenv.c b/sysdeps/nds32/fpu/feupdateenv.c
new file mode 100644
index 0000000..95d2e2a
--- /dev/null
+++ b/sysdeps/nds32/fpu/feupdateenv.c
@@ -0,0 +1,31 @@
+/* Install given floating-point environment and raise exceptions.
+   Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <fenv_private.h>
+
+int
+__feupdateenv (const fenv_t *envp)
+{
+  return libc_feupdateenv_nds32 (envp);
+}
+libm_hidden_def (__feupdateenv)
+weak_alias (__feupdateenv, feupdateenv)
+libm_hidden_weak (feupdateenv)
diff --git a/sysdeps/nds32/fpu/fgetexcptflg.c b/sysdeps/nds32/fpu/fgetexcptflg.c
new file mode 100644
index 0000000..f8e2332
--- /dev/null
+++ b/sysdeps/nds32/fpu/fgetexcptflg.c
@@ -0,0 +1,27 @@
+/* Store current representation for exceptions.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_private.h>
+
+int
+fegetexceptflag (fexcept_t *flagp, int excepts)
+{
+  *flagp = libc_fetestexcept_nds32 (excepts);
+  return 0;
+}
diff --git a/sysdeps/nds32/fpu/fix-fp-int-compare-invalid.h b/sysdeps/nds32/fpu/fix-fp-int-compare-invalid.h
new file mode 100644
index 0000000..81e086a
--- /dev/null
+++ b/sysdeps/nds32/fpu/fix-fp-int-compare-invalid.h
@@ -0,0 +1,25 @@
+/* Fix for missing "invalid" exceptions from floating-point comparisons.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef FIX_FP_INT_COMPARE_INVALID_H
+#define FIX_FP_INT_COMPARE_INVALID_H	1
+
+#define FIX_COMPARE_INVALID 1
+
+#endif /* FIX_FP_INT_COMPARE_INVALID_H.  */
+
diff --git a/sysdeps/nds32/fpu/fix-fp-int-convert-overflow.h b/sysdeps/nds32/fpu/fix-fp-int-convert-overflow.h
new file mode 100644
index 0000000..8b393e3
--- /dev/null
+++ b/sysdeps/nds32/fpu/fix-fp-int-convert-overflow.h
@@ -0,0 +1,34 @@
+/* Fix for conversion of floating point to integer overflow.
+   Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef FIX_FP_INT_CONVERT_OVERFLOW_H
+#define FIX_FP_INT_CONVERT_OVERFLOW_H	1
+
+/* Define these macros to 1 to workaround conversions of out-of-range
+   floating-point numbers to integer types failing to raise the
+   "invalid" exception, or raising spurious "inexact" or other
+   exceptions.  */
+#define FIX_FLT_LONG_CONVERT_OVERFLOW 1
+#define FIX_FLT_LLONG_CONVERT_OVERFLOW 1
+#define FIX_DBL_LONG_CONVERT_OVERFLOW 1
+#define FIX_DBL_LLONG_CONVERT_OVERFLOW 1
+#define FIX_LDBL_LONG_CONVERT_OVERFLOW 0
+#define FIX_LDBL_LLONG_CONVERT_OVERFLOW 0
+
+#endif /* fix-fp-int-convert-overflow.h */
diff --git a/sysdeps/nds32/fpu/fpu_control.h b/sysdeps/nds32/fpu/fpu_control.h
new file mode 100644
index 0000000..8a3989d
--- /dev/null
+++ b/sysdeps/nds32/fpu/fpu_control.h
@@ -0,0 +1,104 @@
+/* FPU control word bits.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _FPU_CONTROL_H
+
+#include <asm/fp_udfiex_crtl.h>
+/*
+ * Andes Floating-Point Control Status Register
+ * 31-20 -> Reserved
+ * 19	 -> RIT (RO)
+ * 18	 -> DNIT(RO)
+ * 17	 -> IEXT(RO)
+ * 16	 -> UDFT(RO)
+ * 15	 -> OVFT(RO)
+ * 14	 -> DBZT(RO)
+ * 13	 -> IVOT(RO)
+ * 12	 -> DNZ(RW),Denormalized flush-to-Zero mode.
+ * 11	 -> IEXE(RW),IEEE Ineaxct (IEX) exception trapping enable.
+ * 10	 -> UDFE(RW),IEEE Underflow (UDF) exception trapping enable.
+ * 9	 -> OVFE(RW),IEEE Overflow (OVF) exception trapping enable.
+ * 8	 -> DBZE(RW),IEEE Divide by Zero (DBZ) exception trapping enable.
+ * 7	 -> IVOE(RW),IEEE Invalid Operation (IVO) exception trapping enable.
+ * 6	 -> IEX(RW),IEEE Inexact (IEX) cumulative exception flag.
+ * 5	 -> UDF(RW),IEEE Underflow (UDF) cumulative exception flag.
+ * 4	 -> OVF(RW),IEEE Overflow (OVF) cumulative exception flag.
+ * 3	 -> DBZ(RW),IEEE Divide by Zero (DBZ) cumulative exception flag.
+ * 2	 -> IVO(RW),IEEE Invalid Operation (IVO) cumulative exception flag.
+ * 1-0	 -> Rounding modes.
+ *
+ * Rounding modes.
+ * 00 - rounding to nearest (RN)
+ * 01 - rounding (up) toward plus infinity (RP)
+ * 10 - rounding (down)toward minus infinity (RM)
+ * 11 - rounding toward zero (RZ)
+ *
+ */
+
+#define ROUND_MOD_MASK 	0x3
+
+/* Mask for enabling exceptions and for the CAUSE bits.  */
+#define ENABLE_MASK	(_FPU_MASK_IEX | _FPU_MASK_OVF | \
+			 _FPU_MASK_DBZ | _FPU_MASK_IVO | \
+			 _FPU_MASK_UDF)
+
+
+/* Shift for FE_* flags to get up to the ENABLE bits.  */
+#define	ENABLE_SHIFT	5
+
+
+/* masking of interrupts.  */
+#define _FPU_MASK_IEX  	0x0800  /* Invalid operation.  */
+#define _FPU_MASK_UDF  	0x0400  /* Underflow.  */
+#define _FPU_MASK_OVF  	0x0200  /* Overflow.  */
+#define _FPU_MASK_DBZ  	0x0100  /* Division by zero.  */
+#define _FPU_MASK_IVO 	0x0080  /* Invalid operation.  */
+
+
+#define _FPU_ENV_RESERVED	(0xffffe000 | __fpu_control)
+#define _FPU_MOD_RESERVED	(0xffffe07c | __fpu_control)
+#define _FPU_RESERVED   _FPU_MOD_RESERVED
+#define _FPU_DEFAULT    0x00000000
+
+/* Default + exceptions enabled.  */
+#define _FPU_IEEE	(_FPU_DEFAULT | 0x00000f80)
+
+/* Type of the control word.  */
+typedef unsigned int fpu_control_t;
+
+/* Default control word set at startup.  */
+extern fpu_control_t __fpu_control;
+
+
+
+
+#define ENABLE_MASK_SUBOUT (_FPU_MASK_OVF | _FPU_MASK_DBZ | _FPU_MASK_IVO)
+#define FPU_MASK_SUBOUT   (_FPU_MASK_IEX | _FPU_MASK_UDF)
+#define _FPU_DEFAULT_SUPPORT_SUBNORMAL_OUTPUT	FPU_MASK_SUBOUT
+#define __KERNEL_SUPPORT_SUBNOR_OUTPUT \
+  (__fpu_control == _FPU_DEFAULT_SUPPORT_SUBNORMAL_OUTPUT)
+
+/* Macros for accessing the hardware control word.  */
+/* This is fmrx %0, fpscr.  */
+#define _FPU_GETCW(cw) \
+  __asm__ __volatile__ ("fmfcsr\t %0\n\t" : "=r" (cw))
+/* This is fmxr fpscr, %0.  */
+#define _FPU_SETCW(cw) \
+  __asm__ __volatile__ ("fmtcsr\t %0\n\t": : "r" (cw))
+
+#endif /* _FPU_CONTROL_H.  */
diff --git a/sysdeps/nds32/fpu/fraiseexcpt.c b/sysdeps/nds32/fpu/fraiseexcpt.c
new file mode 100644
index 0000000..daaf246
--- /dev/null
+++ b/sysdeps/nds32/fpu/fraiseexcpt.c
@@ -0,0 +1,100 @@
+/* Raise given exceptions.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <float.h>
+
+int
+__feraiseexcept (int excepts)
+{
+  float temp1 = 0.0, temp2 = 1.0;
+  if (FE_INVALID & excepts)
+  {
+  	asm volatile(
+  		"fmtsr\t %0, $fs0\n\t"
+  		"fdivs\t $fs0, $fs0, $fs0\n\t"
+  		:
+  		:"r"(temp1)
+  		:"$fs0"
+  		);
+  }
+  if (FE_DIVBYZERO & excepts)
+  {
+  	asm volatile(
+  		"fmtsr\t %0, $fs0\n\t"
+  		"fmtsr\t %1, $fs1\n\t"
+  		"fdivs\t $fs0, $fs1, $fs0\n\t"
+  		:
+  		:"r"(temp1),"r"(temp2)
+  		:"$fs0"
+  		);
+  }
+  if (FE_OVERFLOW & excepts)
+  {
+  /* There's no way to raise overflow without also raising inexact.  */
+  	unsigned int fpcsr;
+  	temp1 = FLT_MAX;
+  	asm volatile(
+  		"fmfcsr\t %0\n\t"
+  		"fmtsr\t %1, $fs0\n\t"
+  		"fadds\t $fs0, $fs0, $fs0\n\t"
+  		"ori\t %0,%0,0x10\n\t"
+  		"fmtcsr\t %0\n\t"
+  		:"=&r"(fpcsr)
+  		:"r"(temp1)
+  		:"$fs0"
+  		);
+  }
+  if (FE_UNDERFLOW & excepts)
+  {
+  /* There's no way to raise underflow without also raising inexact.  */
+  	unsigned int fpcsr;
+  	temp1 = FLT_MIN;
+	temp2 = 3.0;
+  	asm volatile(
+  		"fmfcsr\t %0\n\t"
+  		"fmtsr\t %1, $fs0\n\t"
+  		"fmtsr\t %2, $fs1\n\t"
+  		"fdivs\t $fs1, $fs0, $fs1\n\t"
+  		"ori\t %0,%0,0x20\n\t"
+  		"fmtcsr\t %0\n\t"
+  		:"=&r"(fpcsr)
+  		:"r"(temp1),"r"(temp2)
+  		:"$fs0","$fs1"
+  		);
+  }
+  if (FE_INEXACT & excepts)
+  {
+  	temp1 = 1.0;
+	temp2 = 3.0;
+  	asm volatile(
+  		"fmtsr\t %0, $fs0\n\t"
+  		"fmtsr\t %1, $fs1\n\t"
+  		"fdivs\t $fs1, $fs0, $fs1\n\t"
+  		:
+  		:"r"(temp1),"r"(temp2)
+  		:"$fs0","$fs1"
+  		);
+  }
+
+  return 0;
+}
+libm_hidden_def (__feraiseexcept)
+weak_alias (__feraiseexcept, feraiseexcept)
+libm_hidden_weak (feraiseexcept)
diff --git a/sysdeps/nds32/fpu/fsetexcptflg.c b/sysdeps/nds32/fpu/fsetexcptflg.c
new file mode 100644
index 0000000..d13365b
--- /dev/null
+++ b/sysdeps/nds32/fpu/fsetexcptflg.c
@@ -0,0 +1,39 @@
+/* Set floating-point environment exception handling.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetexceptflag (const fexcept_t *flagp, int excepts)
+{
+  fexcept_t temp;
+  
+  /* Get the current environment.  */
+  _FPU_GETCW (temp);
+  
+  /* Set the desired exception mask.  */
+  temp &= ~(excepts & FE_ALL_EXCEPT);
+  temp |= (*flagp & excepts & FE_ALL_EXCEPT);
+  
+  /* Save state back to the FPU.  */
+  _FPU_SETCW (temp);
+  
+  /* Success.  */
+  return 0;
+}
diff --git a/sysdeps/nds32/fpu/ftestexcept.c b/sysdeps/nds32/fpu/ftestexcept.c
new file mode 100644
index 0000000..287685d
--- /dev/null
+++ b/sysdeps/nds32/fpu/ftestexcept.c
@@ -0,0 +1,27 @@
+/* Test exception in current environment.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_private.h>
+
+int
+fetestexcept (int excepts)
+{
+  return libc_fetestexcept_nds32 (excepts);
+}
+libm_hidden_def (fetestexcept)
diff --git a/sysdeps/nds32/fpu/get-rounding-mode.h b/sysdeps/nds32/fpu/get-rounding-mode.h
new file mode 100644
index 0000000..c0d25d9
--- /dev/null
+++ b/sysdeps/nds32/fpu/get-rounding-mode.h
@@ -0,0 +1,39 @@
+/* Determine floating-point rounding mode within libc.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _NDS32_GET_ROUNDING_MODE_H
+#define _NDS32_GET_ROUNDING_MODE_H	1
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+/* Return the floating-point rounding mode.  */
+
+static inline int
+get_rounding_mode (void)
+{
+  unsigned int temp;
+
+  /* Get the current environment.  */
+  _FPU_GETCW (temp);
+
+  return temp & 0x3;
+
+}
+
+#endif /* _NDS32_GET_ROUNDING_MODE_H.  */
diff --git a/sysdeps/nds32/fpu/libm-test-ulps b/sysdeps/nds32/fpu/libm-test-ulps
new file mode 100644
index 0000000..e596401
--- /dev/null
+++ b/sysdeps/nds32/fpu/libm-test-ulps
@@ -0,0 +1,1643 @@
+# Begin of automatic generation
+
+# Maximal error of functions:
+Function: "acos":
+float: 1
+ifloat: 1
+
+Function: "acos_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "acos_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "acos_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "acosh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "acosh_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "acosh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "acosh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "asin":
+float: 1
+ifloat: 1
+
+Function: "asin_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "asin_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "asin_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "asinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "asinh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "asinh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "asinh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "atan":
+float: 1
+ifloat: 1
+
+Function: "atan2":
+float: 1
+ifloat: 1
+
+Function: "atan2_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "atan2_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "atan2_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "atan_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "atan_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "atan_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "atanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "atanh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "atanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "atanh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "cabs":
+double: 1
+idouble: 1
+
+Function: "cabs_downward":
+double: 1
+idouble: 1
+
+Function: "cabs_towardzero":
+double: 1
+idouble: 1
+
+Function: "cabs_upward":
+double: 1
+idouble: 1
+
+Function: Real part of "cacos":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "cacos":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "cacos_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: Imaginary part of "cacos_downward":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Real part of "cacos_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: Imaginary part of "cacos_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+
+Function: Real part of "cacos_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "cacos_upward":
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+
+Function: Real part of "cacosh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "cacosh":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "cacosh_downward":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+
+Function: Imaginary part of "cacosh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Real part of "cacosh_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+
+Function: Imaginary part of "cacosh_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: Real part of "cacosh_upward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Imaginary part of "cacosh_upward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "carg":
+float: 1
+ifloat: 1
+
+Function: "carg_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "carg_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "carg_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "casin":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "casin":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "casin_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: Imaginary part of "casin_downward":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Real part of "casin_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: Imaginary part of "casin_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+
+Function: Real part of "casin_upward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: Imaginary part of "casin_upward":
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+
+Function: Real part of "casinh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "casinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "casinh_downward":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Imaginary part of "casinh_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: Real part of "casinh_towardzero":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+
+Function: Imaginary part of "casinh_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: Real part of "casinh_upward":
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+
+Function: Imaginary part of "casinh_upward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: Real part of "catan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "catan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "catan_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "catan_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "catan_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "catan_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "catan_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "catan_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "catanh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "catanh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "catanh_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "catanh_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "catanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "catanh_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "catanh_upward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: Imaginary part of "catanh_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cbrt":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: "cbrt_downward":
+double: 4
+float: 1
+idouble: 4
+ifloat: 1
+
+Function: "cbrt_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: "cbrt_upward":
+double: 5
+float: 1
+idouble: 5
+ifloat: 1
+
+Function: Real part of "ccos":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "ccos":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "ccos_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "ccos_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Real part of "ccos_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "ccos_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Real part of "ccos_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "ccos_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "ccosh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "ccosh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "ccosh_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "ccosh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Real part of "ccosh_towardzero":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: Imaginary part of "ccosh_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Real part of "ccosh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "ccosh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "cexp":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: Imaginary part of "cexp":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "cexp_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "cexp_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Real part of "cexp_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "cexp_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Real part of "cexp_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "cexp_upward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: Real part of "clog":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Imaginary part of "clog":
+float: 1
+ifloat: 1
+
+Function: Real part of "clog10":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+
+Function: Imaginary part of "clog10":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "clog10_downward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: Imaginary part of "clog10_downward":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+
+Function: Real part of "clog10_towardzero":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: Imaginary part of "clog10_towardzero":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+
+Function: Real part of "clog10_upward":
+double: 6
+float: 5
+idouble: 6
+ifloat: 5
+
+Function: Imaginary part of "clog10_upward":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+
+Function: Real part of "clog_downward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Imaginary part of "clog_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "clog_towardzero":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: Imaginary part of "clog_towardzero":
+double: 1
+float: 3
+idouble: 1
+ifloat: 3
+
+Function: Real part of "clog_upward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Imaginary part of "clog_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "cos":
+double: 1
+idouble: 1
+
+Function: "cos_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cos_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cos_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cosh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cosh_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "cosh_towardzero":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "cosh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "cpow":
+double: 2
+float: 5
+idouble: 2
+ifloat: 5
+
+Function: Imaginary part of "cpow":
+float: 2
+ifloat: 2
+
+Function: Real part of "cpow_downward":
+double: 5
+float: 8
+idouble: 5
+ifloat: 8
+
+Function: Imaginary part of "cpow_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "cpow_towardzero":
+double: 5
+float: 8
+idouble: 5
+ifloat: 8
+
+Function: Imaginary part of "cpow_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "cpow_upward":
+double: 4
+float: 1
+idouble: 4
+ifloat: 1
+
+Function: Imaginary part of "cpow_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "csin":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "csin_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Imaginary part of "csin_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "csin_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Imaginary part of "csin_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "csin_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "csin_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "csinh":
+float: 1
+ifloat: 1
+
+Function: Imaginary part of "csinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "csinh_downward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: Imaginary part of "csinh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Real part of "csinh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "csinh_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Real part of "csinh_upward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "csinh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "csqrt":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "csqrt":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "csqrt_downward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: Imaginary part of "csqrt_downward":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Real part of "csqrt_towardzero":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Imaginary part of "csqrt_towardzero":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: Real part of "csqrt_upward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: Imaginary part of "csqrt_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Real part of "ctan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "ctan":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "ctan_downward":
+double: 6
+float: 5
+idouble: 6
+ifloat: 5
+
+Function: Imaginary part of "ctan_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "ctan_towardzero":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Imaginary part of "ctan_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "ctan_upward":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+
+Function: Imaginary part of "ctan_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: Real part of "ctanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "ctanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "ctanh_downward":
+double: 4
+float: 2
+idouble: 4
+ifloat: 2
+
+Function: Imaginary part of "ctanh_downward":
+double: 6
+float: 5
+idouble: 6
+ifloat: 5
+
+Function: Real part of "ctanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "ctanh_towardzero":
+double: 5
+float: 3
+idouble: 5
+ifloat: 3
+
+Function: Real part of "ctanh_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "ctanh_upward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: "erf":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "erf_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "erf_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "erf_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "erfc":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "erfc_downward":
+double: 5
+float: 6
+idouble: 5
+ifloat: 6
+
+Function: "erfc_towardzero":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+
+Function: "erfc_upward":
+double: 5
+float: 6
+idouble: 5
+ifloat: 6
+
+Function: "exp10":
+double: 2
+idouble: 2
+
+Function: "exp10_downward":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: "exp10_towardzero":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: "exp10_upward":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "exp2":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "exp2_downward":
+double: 1
+idouble: 1
+
+Function: "exp2_towardzero":
+double: 1
+idouble: 1
+
+Function: "exp2_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "exp_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "exp_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "exp_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "expm1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "expm1_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "expm1_towardzero":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "expm1_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "gamma":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: "gamma_downward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "gamma_towardzero":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "gamma_upward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "hypot":
+double: 1
+float: 1
+idouble: 1
+
+Function: "hypot_downward":
+double: 1
+idouble: 1
+
+Function: "hypot_towardzero":
+double: 1
+idouble: 1
+
+Function: "hypot_upward":
+double: 1
+idouble: 1
+
+Function: "j0":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "j0_downward":
+double: 2
+float: 4
+idouble: 2
+ifloat: 4
+
+Function: "j0_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "j0_upward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "j1":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "j1_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "j1_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "j1_upward":
+double: 3
+float: 5
+idouble: 3
+ifloat: 5
+
+Function: "jn":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: "jn_downward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "jn_towardzero":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "jn_upward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "lgamma":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: "lgamma_downward":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "lgamma_towardzero":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "lgamma_upward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "log10":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "log10_downward":
+double: 2
+float: 3
+idouble: 2
+ifloat: 3
+
+Function: "log10_towardzero":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "log10_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "log1p":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "log1p_downward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "log1p_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "log1p_upward":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "log2":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "log2_downward":
+double: 3
+idouble: 3
+
+Function: "log2_towardzero":
+double: 2
+idouble: 2
+
+Function: "log2_upward":
+double: 3
+idouble: 3
+
+Function: "pow":
+double: 1
+idouble: 1
+
+Function: "pow_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "pow_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "pow_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sin":
+double: 1
+idouble: 1
+
+Function: "sin_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sin_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sin_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sincos":
+double: 1
+idouble: 1
+
+Function: "sincos_downward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sincos_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sincos_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sinh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "sinh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "sinh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "sinh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "tan":
+float: 1
+ifloat: 1
+
+Function: "tan_downward":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "tan_towardzero":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "tan_upward":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "tanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "tanh_downward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "tanh_towardzero":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "tanh_upward":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "tgamma":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "tgamma_downward":
+double: 5
+float: 5
+idouble: 5
+ifloat: 5
+
+Function: "tgamma_towardzero":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "tgamma_upward":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: "y0":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "y0_downward":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+
+Function: "y0_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "y0_upward":
+double: 3
+float: 5
+idouble: 3
+ifloat: 5
+
+Function: "y1":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "y1_downward":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "y1_towardzero":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "y1_upward":
+double: 7
+float: 2
+idouble: 7
+ifloat: 2
+
+Function: "yn":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "yn_downward":
+double: 3
+float: 4
+idouble: 3
+ifloat: 4
+
+Function: "yn_towardzero":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: "yn_upward":
+double: 4
+float: 5
+idouble: 4
+ifloat: 5
+
+# end of automatic generation
diff --git a/sysdeps/nds32/fpu/libm-test-ulps-name b/sysdeps/nds32/fpu/libm-test-ulps-name
new file mode 100644
index 0000000..14413f6
--- /dev/null
+++ b/sysdeps/nds32/fpu/libm-test-ulps-name
@@ -0,0 +1 @@
+nds32
diff --git a/sysdeps/nds32/fpu/math-barriers.h b/sysdeps/nds32/fpu/math-barriers.h
new file mode 100644
index 0000000..aba7ff0
--- /dev/null
+++ b/sysdeps/nds32/fpu/math-barriers.h
@@ -0,0 +1,27 @@
+/* Control when floating-point expressions are evaluated.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef NDS32_MATH_BARRIERS_H
+#define NDS32_MATH_BARRIERS_H 1
+
+#define math_opt_barrier(x)					\
+  ({ __typeof (x) __x = (x); __asm ("" : "+f" (__x)); __x; })
+#define math_force_eval(x)						\
+  ({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "f" (__x)); })
+
+#endif
diff --git a/sysdeps/nds32/nofpu/libm-test-ulps b/sysdeps/nds32/nofpu/libm-test-ulps
new file mode 100644
index 0000000..d753dbe
--- /dev/null
+++ b/sysdeps/nds32/nofpu/libm-test-ulps
@@ -0,0 +1,390 @@
+# Begin of automatic generation
+
+# Maximal error of functions:
+Function: "acos":
+float: 1
+ifloat: 1
+
+Function: "acosh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "asin":
+float: 1
+ifloat: 1
+
+Function: "asinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "atan":
+float: 1
+ifloat: 1
+
+Function: "atan2":
+float: 1
+ifloat: 1
+
+Function: "atanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "cabs":
+double: 1
+idouble: 1
+
+Function: Real part of "cacos":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "cacos":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "cacosh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "cacosh":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "carg":
+float: 1
+ifloat: 1
+
+Function: Real part of "casin":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "casin":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "casinh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "casinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "catan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "catan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "catanh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "catanh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cbrt":
+double: 3
+float: 1
+idouble: 3
+ifloat: 1
+
+Function: Real part of "ccos":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "ccos":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "ccosh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "ccosh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "cexp":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: Imaginary part of "cexp":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Real part of "clog":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+Function: Imaginary part of "clog":
+float: 1
+ifloat: 1
+
+Function: Real part of "clog10":
+double: 3
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: Imaginary part of "clog10":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "cos":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "cosh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "cpow":
+double: 2
+float: 5
+idouble: 2
+ifloat: 5
+
+Function: Imaginary part of "cpow":
+float: 2
+ifloat: 2
+
+Function: Real part of "csin":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "csinh":
+float: 1
+ifloat: 1
+
+Function: Imaginary part of "csinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "csqrt":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "csqrt":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "ctan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "ctan":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "ctanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "ctanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "erf":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "erfc":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "exp10":
+double: 2
+idouble: 2
+
+Function: "exp2":
+double: 1
+idouble: 1
+
+Function: "expm1":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "gamma":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: "hypot":
+double: 1
+idouble: 1
+
+Function: "j0":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "j1":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "jn":
+double: 4
+float: 4
+idouble: 4
+ifloat: 4
+
+Function: "lgamma":
+double: 4
+float: 3
+idouble: 4
+ifloat: 3
+
+Function: "log10":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "log1p":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "log2":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "pow":
+double: 1
+idouble: 1
+
+Function: "sin":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sincos":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "sinh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "tan":
+float: 1
+ifloat: 1
+
+Function: "tanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "tgamma":
+double: 5
+float: 4
+idouble: 5
+ifloat: 4
+
+Function: "y0":
+double: 2
+float: 1
+idouble: 2
+ifloat: 1
+
+Function: "y1":
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
+
+Function: "yn":
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
+
+# end of automatic generation
diff --git a/sysdeps/nds32/nofpu/libm-test-ulps-name b/sysdeps/nds32/nofpu/libm-test-ulps-name
new file mode 100644
index 0000000..e136775
--- /dev/null
+++ b/sysdeps/nds32/nofpu/libm-test-ulps-name
@@ -0,0 +1 @@
+nds32 soft-fp
diff --git a/sysdeps/nds32/sfp-machine.h b/sysdeps/nds32/sfp-machine.h
new file mode 100644
index 0000000..4db8a9c
--- /dev/null
+++ b/sysdeps/nds32/sfp-machine.h
@@ -0,0 +1,68 @@
+/* Andes nds32 softfloat definitions
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define _FP_W_TYPE_SIZE		32
+#define _FP_W_TYPE		unsigned long
+#define _FP_WS_TYPE		signed long
+#define _FP_I_TYPE		long
+
+#define _FP_MUL_MEAT_S(R,X,Y)				\
+  _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_D(R,X,Y)				\
+  _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_Q(R,X,Y)				\
+  _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
+#define _FP_MUL_MEAT_DW_S(R,X,Y)			\
+  _FP_MUL_MEAT_DW_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_D(R,X,Y)			\
+  _FP_MUL_MEAT_DW_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_DW_Q(R,X,Y)			\
+  _FP_MUL_MEAT_DW_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
+#define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_loop(S,R,X,Y)
+#define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_2_udiv(D,R,X,Y)
+#define _FP_DIV_MEAT_Q(R,X,Y)	_FP_DIV_MEAT_4_udiv(Q,R,X,Y)
+
+#define _FP_NANFRAC_S		((_FP_QNANBIT_S << 1) - 1)
+#define _FP_NANFRAC_D		((_FP_QNANBIT_D << 1) - 1), -1
+#define _FP_NANFRAC_Q		((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
+#define _FP_NANSIGN_S		0
+#define _FP_NANSIGN_D		0
+#define _FP_NANSIGN_Q		0
+
+#define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
+
+#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)			\
+  do {								\
+    if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)		\
+	&& !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs))	\
+      {								\
+	R##_s = Y##_s;						\
+	_FP_FRAC_COPY_##wc(R,Y);				\
+      }								\
+    else							\
+      {								\
+	R##_s = X##_s;						\
+	_FP_FRAC_COPY_##wc(R,X);				\
+      }								\
+    R##_c = FP_CLS_NAN;						\
+  } while (0)
+
+#define _FP_TININESS_AFTER_ROUNDING 1
diff --git a/sysdeps/nds32/tininess.h b/sysdeps/nds32/tininess.h
new file mode 100644
index 0000000..1db3779
--- /dev/null
+++ b/sysdeps/nds32/tininess.h
@@ -0,0 +1 @@
+#define TININESS_AFTER_ROUNDING	1
-- 
1.9.5


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v4 06/11] nds32: Atomic and Locking Routines
  2019-06-05 11:56 [PATCH v4 00/11] nds32 glibc port, v4 Vincent Chen
                   ` (4 preceding siblings ...)
  2019-06-05 11:56 ` [PATCH v4 05/11] nds32: Generic <math.h>, soft-fp and hard-fp Routines Vincent Chen
@ 2019-06-05 11:56 ` Vincent Chen
  2019-06-05 11:56 ` [PATCH v4 07/11] nds32: Linux Syscall Interface Vincent Chen
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 28+ messages in thread
From: Vincent Chen @ 2019-06-05 11:56 UTC (permalink / raw
  To: libc-alpha, joseph; +Cc: deanbo422, cnoize, vincentc

All atomic and locking routines on nds32 are implemented in this patch.

2019-06-03  Vincent Chen  <vincentc@andestech.com>
2019-06-03  CheWei Chuang  <cnoize@andestech.com>

        * sysdeps/nds32/atomic-machine.h: New file.
        * sysdeps/nds32/nptl/bits/pthreadtypes-arch.h: Likewise.
        * sysdeps/nds32/nptl/bits/semaphore.h: Likewise.
        * sysdeps/nds32/nptl/pthread-offsets.h: Likewise.
---
 sysdeps/nds32/atomic-machine.h              | 162 ++++++++++++++++++++++++++++
 sysdeps/nds32/nptl/bits/pthreadtypes-arch.h |  71 ++++++++++++
 sysdeps/nds32/nptl/bits/semaphore.h         |  32 ++++++
 sysdeps/nds32/nptl/pthread-offsets.h        |  23 ++++
 4 files changed, 288 insertions(+)
 create mode 100644 sysdeps/nds32/atomic-machine.h
 create mode 100644 sysdeps/nds32/nptl/bits/pthreadtypes-arch.h
 create mode 100644 sysdeps/nds32/nptl/bits/semaphore.h
 create mode 100644 sysdeps/nds32/nptl/pthread-offsets.h

diff --git a/sysdeps/nds32/atomic-machine.h b/sysdeps/nds32/atomic-machine.h
new file mode 100644
index 0000000..18120a9
--- /dev/null
+++ b/sysdeps/nds32/atomic-machine.h
@@ -0,0 +1,162 @@
+/* Atomic machine setting.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _NDS32_ATOMIC_MACHINE_H
+#define _NDS32_ATOMIC_MACHINE_H 1
+
+#include <stdint.h>
+
+typedef int8_t  atomic8_t;
+typedef int16_t atomic16_t;
+typedef int32_t atomic32_t;
+typedef int64_t atomic64_t;
+
+typedef uint8_t  uatomic8_t;
+typedef uint16_t uatomic16_t;
+typedef uint32_t uatomic32_t;
+typedef uint64_t uatomic64_t;
+
+typedef intptr_t atomicptr_t;
+typedef uintptr_t uatomicptr_t;
+typedef intmax_t atomic_max_t;
+typedef uintmax_t uatomic_max_t;
+
+#define __HAVE_64B_ATOMICS 0
+#define USE_ATOMIC_COMPILER_BUILTINS 1
+#define ATOMIC_EXCHANGE_USES_CAS 0
+
+void __nds32_link_error (void);
+
+#ifndef atomic_full_barrier
+# define atomic_full_barrier() __asm ("dsb" ::: "memory")
+#endif
+
+/* Atomic exchange (without compare).  */
+
+#define __arch_exchange_8_int(mem, newval, model)	\
+  __atomic_exchange_n (mem, newval, model)
+
+#define __arch_exchange_16_int(mem, newval, model)	\
+  __atomic_exchange_n (mem, newval, model)
+
+#define __arch_exchange_32_int(mem, newval, model)	\
+  __atomic_exchange_n (mem, newval, model)
+
+#define __arch_exchange_64_int(mem, newval, model)	\
+  (__nds32_link_error (), (typeof (*mem)) 0)
+
+#define atomic_exchange_acq(mem, value)				\
+  __atomic_val_bysize (__arch_exchange, int, mem, value, __ATOMIC_ACQUIRE)
+
+#define atomic_exchange_rel(mem, value)				\
+  __atomic_val_bysize (__arch_exchange, int, mem, value, __ATOMIC_RELEASE)
+
+
+/* Compare and exchange.
+   For all "bool" routines, we return FALSE if exchange succesful.  */
+
+#define __arch_compare_and_exchange_bool_8_int(mem, newval, oldval, model) \
+  ({									\
+    typeof (*mem) __oldval = (oldval);					\
+    (int)!__atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,	\
+				  model, __ATOMIC_RELAXED);		\
+  })
+
+#define __arch_compare_and_exchange_bool_16_int(mem, newval, oldval, model) \
+  ({									\
+    typeof (*mem) __oldval = (oldval);					\
+    (int)!__atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,	\
+				  model, __ATOMIC_RELAXED);		\
+  })
+
+#define __arch_compare_and_exchange_bool_32_int(mem, newval, oldval, model) \
+  ({									\
+    typeof (*mem) __oldval = (oldval);					\
+    (int)!__atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,	\
+				  model, __ATOMIC_RELAXED);		\
+  })
+
+#define __arch_compare_and_exchange_bool_64_int(mem, newval, oldval, model) \
+  ({__nds32_link_error (); (int) 0;})
+
+#define __arch_compare_and_exchange_val_8_int(mem, newval, oldval, model) \
+  ({									\
+    typeof (*mem) __oldval = (oldval);					\
+    __atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,	\
+				 model, __ATOMIC_RELAXED);		\
+    __oldval;								\
+  })
+
+#define __arch_compare_and_exchange_val_16_int(mem, newval, oldval, model) \
+  ({									\
+    typeof (*mem) __oldval = (oldval);					\
+    __atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,	\
+				 model, __ATOMIC_RELAXED);		\
+    __oldval;								\
+  })
+
+#define __arch_compare_and_exchange_val_32_int(mem, newval, oldval, model) \
+  ({									\
+    typeof (*mem) __oldval = (oldval);					\
+    __atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,	\
+				 model, __ATOMIC_RELAXED);		\
+    __oldval;								\
+  })
+
+#define __arch_compare_and_exchange_val_64_int(mem, newval, oldval, model) \
+  ({__nds32_link_error (); (typeof (*mem)) 0;})
+
+
+/* Compare and exchange with "acquire" semantics, ie barrier after.  */
+
+#define atomic_compare_and_exchange_bool_acq(mem, new, old)	\
+  __atomic_bool_bysize (__arch_compare_and_exchange_bool, int,	\
+			mem, new, old, __ATOMIC_ACQUIRE)
+
+#define atomic_compare_and_exchange_val_acq(mem, new, old)	\
+  __atomic_val_bysize (__arch_compare_and_exchange_val, int,	\
+		       mem, new, old, __ATOMIC_ACQUIRE)
+
+/* Compare and exchange with "release" semantics, ie barrier before.  */
+
+#define atomic_compare_and_exchange_val_rel(mem, new, old)	 \
+  __atomic_val_bysize (__arch_compare_and_exchange_val, int,    \
+                       mem, new, old, __ATOMIC_RELEASE)
+
+/* Atomically add value and return the previous (unincremented) value.  */
+
+#define __arch_exchange_and_add_8_int(mem, value, model)	\
+  __atomic_fetch_add (mem, value, model)
+
+#define __arch_exchange_and_add_16_int(mem, value, model)	\
+  __atomic_fetch_add (mem, value, model)
+
+#define __arch_exchange_and_add_32_int(mem, value, model)	\
+  __atomic_fetch_add (mem, value, model)
+
+#define __arch_exchange_and_add_64_int(mem, value, model)	\
+  (__nds32_link_error (), (typeof (*mem)) 0)
+
+#define atomic_exchange_and_add_acq(mem, value)			\
+  __atomic_val_bysize (__arch_exchange_and_add, int, mem, value,	\
+		       __ATOMIC_ACQUIRE)
+
+#define atomic_exchange_and_add_rel(mem, value)			\
+  __atomic_val_bysize (__arch_exchange_and_add, int, mem, value,	\
+		       __ATOMIC_RELEASE)
+#endif /* _NDS32_ATOMIC_MACHINE_H.  */
diff --git a/sysdeps/nds32/nptl/bits/pthreadtypes-arch.h b/sysdeps/nds32/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index 0000000..c8d11aa
--- /dev/null
+++ b/sysdeps/nds32/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,71 @@
+/* Machine-specific pthread type layouts, Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _BITS_PTHREADTYPES_H
+#define _BITS_PTHREADTYPES_H	1
+
+#include <endian.h>
+
+#define __SIZEOF_PTHREAD_ATTR_T 32
+#define __SIZEOF_PTHREAD_MUTEX_T 32
+#define __SIZEOF_PTHREAD_MUTEXATTR_T 4
+#define __SIZEOF_PTHREAD_COND_T 48
+#define __SIZEOF_PTHREAD_CONDATTR_T 4
+#define __SIZEOF_PTHREAD_RWLOCK_T 32
+#define __SIZEOF_PTHREAD_RWLOCKATTR_T 8
+#define __SIZEOF_PTHREAD_BARRIER_T 20
+#define __SIZEOF_PTHREAD_BARRIERATTR_T 4
+
+
+
+#define __PTHREAD_COMPAT_PADDING_MID
+#define __PTHREAD_COMPAT_PADDING_END
+#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0
+#define __PTHREAD_MUTEX_USE_UNION 0
+#define __PTHREAD_MUTEX_LOCK_ELISION 0
+
+
+#define __LOCK_ALIGNMENT
+#define __ONCE_ALIGNMENT
+
+struct __pthread_rwlock_arch_t
+{
+  unsigned int __readers;
+  unsigned int __writers;
+  unsigned int __wrphase_futex;
+  unsigned int __writers_futex;
+  unsigned int __pad3;
+  unsigned int __pad4;
+#if __BYTE_ORDER == __BIG_ENDIAN
+  unsigned char __pad1;
+  unsigned char __pad2;
+  unsigned char __shared;
+  unsigned char __flags;
+#else
+  unsigned char __flags;
+  unsigned char __shared;
+  unsigned char __pad1;
+  unsigned char __pad2;
+#endif
+  int __cur_writer;
+};
+
+#define __PTHREAD_RWLOCK_ELISION_EXTRA 0
+
+
+#endif	/* _BITS_PTHREADTYPES_H.  */
diff --git a/sysdeps/nds32/nptl/bits/semaphore.h b/sysdeps/nds32/nptl/bits/semaphore.h
new file mode 100644
index 0000000..afc8d52
--- /dev/null
+++ b/sysdeps/nds32/nptl/bits/semaphore.h
@@ -0,0 +1,32 @@
+/* Machine-specific POSIX semaphore type layouts, Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _SEMAPHORE_H
+# error "Never use <bits/semaphore.h> directly; include <semaphore.h> instead."
+#endif
+
+#define __SIZEOF_SEM_T 16
+
+/* Value returned if `sem_open' failed.  */
+#define SEM_FAILED      ((sem_t *) 0)
+
+typedef union
+{
+  char __size[__SIZEOF_SEM_T];
+  long int __align;
+} sem_t;
diff --git a/sysdeps/nds32/nptl/pthread-offsets.h b/sysdeps/nds32/nptl/pthread-offsets.h
new file mode 100644
index 0000000..51be9c1
--- /dev/null
+++ b/sysdeps/nds32/nptl/pthread-offsets.h
@@ -0,0 +1,23 @@
+/* pthread offsets.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define __PTHREAD_MUTEX_NUSERS_OFFSET   12
+#define __PTHREAD_MUTEX_KIND_OFFSET     16
+#define __PTHREAD_MUTEX_SPINS_OFFSET    20
+#define __PTHREAD_MUTEX_ELISION_OFFSET  22
+#define __PTHREAD_MUTEX_LIST_OFFSET     24
-- 
1.9.5


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v4 07/11] nds32: Linux Syscall Interface
  2019-06-05 11:56 [PATCH v4 00/11] nds32 glibc port, v4 Vincent Chen
                   ` (5 preceding siblings ...)
  2019-06-05 11:56 ` [PATCH v4 06/11] nds32: Atomic and Locking Routines Vincent Chen
@ 2019-06-05 11:56 ` Vincent Chen
  2019-06-05 11:56 ` [PATCH v4 08/11] nds32: Linux ABI Vincent Chen
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 28+ messages in thread
From: Vincent Chen @ 2019-06-05 11:56 UTC (permalink / raw
  To: libc-alpha, joseph; +Cc: deanbo422, cnoize, vincentc

This patch contains the Linux system call interface, as well as the
definitions of a handful of system calls.

2019-06-03  Vincent Chen  <vincentc@andestech.com>
2019-06-03  CheWei Chuang  <cnoize@andestech.com>

        * sysdeps/unix/sysv/linux/nds32/clone.S: New file.
        * sysdeps/unix/sysv/linux/nds32/profil-counter.h: Likewise.
        * sysdeps/unix/sysv/linux/nds32/pt-vfork.S: Likewise.
        * sysdeps/unix/sysv/linux/nds32/syscall.c: Likewise.
        * sysdeps/unix/sysv/linux/nds32/syscalls.list: Likewise.
        * sysdeps/unix/sysv/linux/nds32/sysdep.c: Likewise.
        * sysdeps/unix/sysv/linux/nds32/sysdep.h: Likewise.
---
 sysdeps/unix/sysv/linux/nds32/clone.S          |  70 +++++
 sysdeps/unix/sysv/linux/nds32/profil-counter.h |  31 +++
 sysdeps/unix/sysv/linux/nds32/pt-vfork.S       |   1 +
 sysdeps/unix/sysv/linux/nds32/syscall.c        |  39 +++
 sysdeps/unix/sysv/linux/nds32/syscalls.list    |   3 +
 sysdeps/unix/sysv/linux/nds32/sysdep.c         |  29 +++
 sysdeps/unix/sysv/linux/nds32/sysdep.h         | 340 +++++++++++++++++++++++++
 7 files changed, 513 insertions(+)
 create mode 100644 sysdeps/unix/sysv/linux/nds32/clone.S
 create mode 100644 sysdeps/unix/sysv/linux/nds32/profil-counter.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/pt-vfork.S
 create mode 100644 sysdeps/unix/sysv/linux/nds32/syscall.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/syscalls.list
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sysdep.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sysdep.h

diff --git a/sysdeps/unix/sysv/linux/nds32/clone.S b/sysdeps/unix/sysv/linux/nds32/clone.S
new file mode 100644
index 0000000..086ea87
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/clone.S
@@ -0,0 +1,70 @@
+/* Wrapper around clone system call, Andes LINUX/nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* clone() is even more special than fork() as it mucks with stacks
+   and invokes a function in the right context after its all over.  */
+
+#include <sysdep.h>
+#define _ERRNO_H	1
+#include <bits/errno.h>
+
+/* int clone(int (*fn)(void *), void *child_stack, int flags, void *arg,
+	    void *parent_tidptr, void *tls, void *child_tidptr).  */
+
+ENTRY(__clone)
+	/* Sanity check arguments.  */
+	beqz	$r0, 1f
+	bnez	$r1, 2f
+1:
+	movi	$r0, -EINVAL
+5:
+	j	SYSCALL_ERROR_LABEL
+2:
+	/* Child's $sp will be $r1, push to child's stack only.  */
+	addi	$r1, $r1, -4
+	swi.p	$r3, [$r1], -4
+	swi	$r0, [$r1]
+
+	/* Do the system call.  */
+	move	$r0, $r2
+#ifdef __NDS32_ABI_2FP_PLUS__
+	lmw.bi  $r2, [$sp], $r4, 0x0	
+#else
+	move    $r2, $r4
+	move    $r3, $r5
+        lwi     $r4, [$sp]
+#endif
+	__do_syscall (clone)
+
+	beqz    $r0, 4f
+	bltz    $r0, 5b
+	ret
+4:
+	.cfi_undefined lp
+        /* Restore the arg for user's function.  */
+	pop	$r1	/* Function pointer.  */
+	pop	$r0	/* Argument pointer.  */
+
+        /* Call the user's function.  */
+	bral	$r1
+
+	__do_syscall (exit)
+
+PSEUDO_END (__clone)
+libc_hidden_def (__clone)
+weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/nds32/profil-counter.h b/sysdeps/unix/sysv/linux/nds32/profil-counter.h
new file mode 100644
index 0000000..43c8f36
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/profil-counter.h
@@ -0,0 +1,31 @@
+/* Low-level statistical profiling support function, Andes Linux/nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <signal.h>
+#include <sigcontextinfo.h>
+
+static void
+__profil_counter (int signo, struct ucontext_t * scp)
+{
+  profil_count ((void *) GET_PC (scp));
+
+  /* This is a hack to prevent the compiler from implementing the
+   * above function call as a sibcall.  The sibcall would overwrite
+   * the signal context.  */
+  asm volatile ("");
+}
diff --git a/sysdeps/unix/sysv/linux/nds32/pt-vfork.S b/sysdeps/unix/sysv/linux/nds32/pt-vfork.S
new file mode 100644
index 0000000..1cc8931
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/pt-vfork.S
@@ -0,0 +1 @@
+/* Not needed.  */
diff --git a/sysdeps/unix/sysv/linux/nds32/syscall.c b/sysdeps/unix/sysv/linux/nds32/syscall.c
new file mode 100644
index 0000000..27cb1a1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/syscall.c
@@ -0,0 +1,39 @@
+/* System call interface.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <stdarg.h>
+#include <sysdep.h>
+long int
+syscall (long int __sysno, ...)
+{
+  int result;
+  unsigned long int arg1, arg2, arg3, arg4, arg5, arg6;
+  va_list arg;
+  va_start (arg, __sysno);
+  arg1 = va_arg (arg, unsigned long int);
+  arg2 = va_arg (arg, unsigned long int);
+  arg3 = va_arg (arg, unsigned long int);
+  arg4 = va_arg (arg, unsigned long int);
+  arg5 = va_arg (arg, unsigned long int);
+  arg6 = va_arg (arg, unsigned long int);
+  va_end (arg);
+  result = INLINE_SYSCALL_NCS (__sysno, 6,
+                               arg1, arg2, arg3, arg4, arg5, arg6);
+  return result;
+}
diff --git a/sysdeps/unix/sysv/linux/nds32/syscalls.list b/sysdeps/unix/sysv/linux/nds32/syscalls.list
new file mode 100644
index 0000000..269c24e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/syscalls.list
@@ -0,0 +1,3 @@
+# File name	Caller	Syscall name	Args	Strong name      Weak names
+cacheflush	-	cacheflush	i:pii	__cacheflush	 cacheflush
+fp_udfiex_crtl	-	fp_udfiex_crtl	i:ii	__fp_udfiex_crtl fp_udfiex_crtl
diff --git a/sysdeps/unix/sysv/linux/nds32/sysdep.c b/sysdeps/unix/sysv/linux/nds32/sysdep.c
new file mode 100644
index 0000000..30e1a5c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/sysdep.c
@@ -0,0 +1,29 @@
+/* Fill error number to errno.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <errno.h>
+
+/* This routine is jumped to by all the syscall handlers, to stash
+   an error number into errno.  */
+long int
+__syscall_error (long int err)
+{
+  __set_errno (-err);
+  return -1;
+}
diff --git a/sysdeps/unix/sysv/linux/nds32/sysdep.h b/sysdeps/unix/sysv/linux/nds32/sysdep.h
new file mode 100644
index 0000000..12f39de
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/sysdep.h
@@ -0,0 +1,340 @@
+/* Assembly macros.  Andes nds32 version.
+   Copyright (C) 2018-2019  Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+
+#ifndef _LINUX_NDS32_SYSDEP_H
+#define _LINUX_NDS32_SYSDEP_H 1
+
+
+/* Always enable vsyscalls on nds32.  */
+#define ALWAYS_USE_VSYSCALL 1
+
+#include <sysdeps/unix/sysdep.h>
+#include <sysdeps/nds32/sysdep.h>
+#include <sysdeps/unix/sysv/linux/generic/sysdep.h>
+
+#include <dl-sysdep.h>
+
+#include <tls.h>
+
+/* In order to get __set_errno() definition in INLINE_SYSCALL.  */
+#ifndef __ASSEMBLER__
+# include <errno.h>
+#endif
+
+#undef SYS_ify
+#define SYS_ify(syscall_name) __NR_##syscall_name
+
+#ifdef __ASSEMBLER__
+
+# define __do_syscall(syscall_name)		\
+  movi	$r15,	SYS_ify (syscall_name);		\
+  syscall	0x0;
+
+# define ADJUST_GP				\
+	smw.adm $sp,[$sp],$sp,#0x6;		\
+	cfi_startproc;				\
+	.cfi_adjust_cfa_offset 8;		\
+	.cfi_rel_offset gp, 0;			\
+	.cfi_rel_offset lp, 4;			\
+	GET_GTABLE ($gp)
+
+# define RECOVER_GP				\
+	lmw.bim $sp,[$sp],$sp,#0x6;		\
+	.cfi_adjust_cfa_offset -8;		\
+	.cfi_restore gp;			\
+	.cfi_restore lp;			\
+	cfi_endproc;
+
+# undef PSEUDO
+# define PSEUDO(name, syscall_name, args)	\
+  .align 2;					\
+	ENTRY(name);                          	\
+	__do_syscall (syscall_name);            \
+	bgez $r0, 2f;				\
+	sltsi	$r1, $r0, -4096;		\
+	beqz	$r1, SYSCALL_ERROR_LABEL;	\
+  2:
+
+# undef PSEUDO_END
+# define PSEUDO_END(sym)			\
+	cfi_endproc;				\
+	SYSCALL_ERROR_HANDLER			\
+	cfi_startproc;				\
+	END(sym)
+
+/* Performs a system call, not setting errno.  */
+# define PSEUDO_NOERRNO(name, syscall_name, args) \
+  ENTRY (name);					  \
+  __do_syscall (syscall_name);
+
+# undef PSEUDO_END_NOERRNO
+# define PSEUDO_END_NOERRNO(name)		  \
+  END (name)
+
+/* Perfroms a system call, returning the error code.  */
+# undef PSEUDO_ERRVAL
+# define PSEUDO_ERRVAL(name, syscall_name, args) \
+  PSEUDO_NOERRNO (name, syscall_name, args)	 \
+  neg $r0, $r0;
+
+# undef PSEUDO_END_ERRVAL
+# define PSEUDO_END_ERRVAL(sym) END (sym)
+
+# define ret_ERRVAL ret
+
+# define ret_NOERRNO ret
+
+# if !IS_IN (libc)
+#  if RTLD_PRIVATE_ERRNO
+#   define SYSCALL_ERROR_HANDLER			\
+SYSCALL_ERROR_LABEL:					\
+	ADJUST_GP					\
+	la	$r1,	(rtld_errno@GOT);		\
+	neg	$r0, 	$r0;				\
+	sw 	$r0,	[$r1];				\
+	li	$r0, 	-1;				\
+	RECOVER_GP					\
+	ret;
+#  else
+#   ifdef PIC
+#    define SYSCALL_ERROR_HANDLER			\
+SYSCALL_ERROR_LABEL:					\
+	ADJUST_GP					\
+	neg	$r0,	$r0;				\
+        sethi   $r15, 	hi20(errno@GOTTPOFF);		\
+        ori     $r15, 	$r15, lo12(errno@GOTTPOFF);	\
+	lw	$r15,	[$r15 + $gp];			\
+	sw	$r0,	[$r25 + $r15];			\
+	li	$r0,	-1;				\
+	RECOVER_GP					\
+	ret;
+#   else
+#    define SYSCALL_ERROR_HANDLER			\
+SYSCALL_ERROR_LABEL:					\
+	neg	$r0,	$r0;				\
+        sethi 	$r15, 	hi20(errno@GOTTPOFF);		\
+        lwi 	$r15, 	[$r15 + lo12(errno@GOTTPOFF)];	\
+	sw	$r0,	[$r25 + $r15];			\
+	li	$r0,	-1;				\
+	ret;
+#   endif /* !PIC.  */
+#  endif
+# else
+#  ifdef PIC
+#   define SYSCALL_ERROR_HANDLER			\
+SYSCALL_ERROR_LABEL:					\
+	ADJUST_GP					\
+	bal	__syscall_error;			\
+	RECOVER_GP					\
+	ret;
+#  else
+#   define SYSCALL_ERROR_HANDLER			\
+SYSCALL_ERROR_LABEL:					\
+	b	__syscall_error;
+#  endif /* !PIC.  */
+# endif /* In LIBC.  */
+
+#else
+
+/* List of system calls which are supported as vsyscalls.  */
+# define HAVE_GETTIMEOFDAY_VSYSCALL	1
+# define HAVE_CLOCK_GETRES_VSYSCALL	1
+# define HAVE_CLOCK_GETTIME_VSYSCALL	1
+
+# define __issue_syscall(syscall_name) "syscall  0x0;\n"
+
+/* Define a macro which expands into the inline wrapper code for a system
+   call.  */
+# undef INLINE_SYSCALL
+# define INLINE_SYSCALL(name, nr, args...)                           \
+  ({                                                                 \
+     INTERNAL_SYSCALL_DECL (err);                                    \
+     long int result_var = INTERNAL_SYSCALL (name, err, nr, args);   \
+     if (INTERNAL_SYSCALL_ERROR_P (result_var, err))                 \
+       {                                                             \
+         __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err));     \
+	 result_var = -1;					     \
+       }                                                             \
+     result_var;                                                     \
+  })
+
+# undef INLINE_SYSCALL_NC
+# define INLINE_SYSCALL_NCS(name, nr, args...)                         \
+  ({                                                                   \
+     INTERNAL_SYSCALL_DECL (err);                                      \
+     long int result_var = INTERNAL_SYSCALL_NCS (name, err, nr, args); \
+     if (INTERNAL_SYSCALL_ERROR_P (result_var, err))                   \
+       {                                                               \
+         __set_errno (INTERNAL_SYSCALL_ERRNO (result_var, err));       \
+	 result_var = -1;					       \
+       }                                                               \
+     result_var;                                                       \
+  })
+# undef INTERNAL_SYSCALL_DECL
+# define INTERNAL_SYSCALL_DECL(err) do { } while (0)
+
+# undef INTERNAL_SYSCALL_ERROR_P
+# define INTERNAL_SYSCALL_ERROR_P(val, err) \
+       ((unsigned int) (val) >= 0xfffff001u)
+
+# undef INTERNAL_SYSCALL_ERRNO
+# define INTERNAL_SYSCALL_ERRNO(val, err) (-(val))
+
+# undef INTERNAL_SYSCALL
+# define INTERNAL_SYSCALL(name, err, nr, args...) \
+       internal_syscall##nr (__NR_##name, err, args)
+
+# undef INTERNAL_SYSCALL_NCS
+# define INTERNAL_SYSCALL_NCS(syscallno, err, nr, args...) \
+       internal_syscall##nr (syscallno, err, args)
+
+# define internal_syscall0(name, err, dummy...)                  \
+  ({                                                             \
+       register long int __res  asm ("$r0");                     \
+       register long int __num asm ("$r15") = (long) (name);   	 \
+       __asm__ volatile (                                        \
+       __issue_syscall (name)                                    \
+       : "=r" (__res)                                            \
+       : "r" (__num)                                             \
+       : __SYSCALL_CLOBBERS);                                    \
+       __res;							 \
+  })
+
+# define internal_syscall1(name, err, arg1)                      \
+  ({                                                             \
+       register long int __res  asm ("$r0");                     \
+       register long int __num asm ("$r15") = (long) (name);   	 \
+       register long int __arg1 asm ("$r0") = (long) (arg1);     \
+       __asm__ volatile (                                        \
+       __issue_syscall (name)                                    \
+       : "=r" (__res)                                            \
+       : "r" (__num)                                             \
+       , "r" (__arg1)                                            \
+       : __SYSCALL_CLOBBERS);                                    \
+        __res;                                                   \
+  })
+
+# define internal_syscall2(name, err, arg1, arg2)                \
+  ({                                                             \
+       register long int __res  asm ("$r0");                     \
+       register long int __num asm ("$r15") = (long) (name);   	 \
+       register long int __arg1 asm ("$r0") = (long) (arg1);     \
+       register long int __arg2 asm ("$r1") = (long) (arg2);     \
+       __asm__ volatile (                                        \
+       __issue_syscall (name)                                    \
+       : "=r" (__res)                                            \
+       : "r" (__num)                                             \
+       , "r" (__arg1)                                            \
+       , "r" (__arg2)                                            \
+       : __SYSCALL_CLOBBERS);                                    \
+        __res;                                                   \
+  })
+
+# define internal_syscall3(name, err, arg1, arg2, arg3)          \
+  ({                                                             \
+       register long int __res  asm ("$r0");                     \
+       register long int __num asm ("$r15") = (long) (name);   	 \
+       register long int __arg1 asm ("$r0") = (long) (arg1);     \
+       register long int __arg2 asm ("$r1") = (long) (arg2);     \
+       register long int __arg3 asm ("$r2") = (long) (arg3);     \
+       __asm__ volatile (                                        \
+       __issue_syscall (name)                                    \
+       : "=r" (__res)                                            \
+       : "r" (__num)                                             \
+       , "r" (__arg1)                                            \
+       , "r" (__arg2)                                            \
+       , "r" (__arg3)                                            \
+       : __SYSCALL_CLOBBERS);                                    \
+        __res;                                                   \
+  })
+
+# define internal_syscall4(name, err, arg1, arg2, arg3, arg4)    \
+  ({                                                             \
+       register long int __res  asm ("$r0");                     \
+       register long int __num asm ("$r15") = (long) (name);   	 \
+       register long int __arg1 asm ("$r0") = (long) (arg1);     \
+       register long int __arg2 asm ("$r1") = (long) (arg2);     \
+       register long int __arg3 asm ("$r2") = (long) (arg3);     \
+       register long int __arg4 asm ("$r3") = (long) (arg4);     \
+       __asm__ volatile (                                        \
+       __issue_syscall (name)                                    \
+       : "=r" (__res)                                            \
+       : "r" (__num)                                             \
+       , "r" (__arg1)                                            \
+       , "r" (__arg2)                                            \
+       , "r" (__arg3)                                            \
+       , "r" (__arg4)                                            \
+       : __SYSCALL_CLOBBERS);                                    \
+        __res;                                                   \
+  })
+
+# define internal_syscall5(name, err, arg1, arg2, arg3, arg4, arg5) \
+  ({                                                             \
+       register long int __res  asm ("$r0");                     \
+       register long int __num asm ("$r15") = (long) (name);   	 \
+       register long int __arg1 asm ("$r0") = (long) (arg1);     \
+       register long int __arg2 asm ("$r1") = (long) (arg2);     \
+       register long int __arg3 asm ("$r2") = (long) (arg3);     \
+       register long int __arg4 asm ("$r3") = (long) (arg4);     \
+       register long int __arg5 asm ("$r4") = (long) (arg5);     \
+       __asm__ volatile (                                        \
+       __issue_syscall (name)                                    \
+       : "=r" (__res)                                            \
+       : "r" (__num)                                             \
+       , "r" (__arg1)                                            \
+       , "r" (__arg2)                                            \
+       , "r" (__arg3)                                            \
+       , "r" (__arg4)                                            \
+       , "r" (__arg5)                                            \
+       : __SYSCALL_CLOBBERS);                                    \
+        __res;                                                   \
+  })
+
+# define internal_syscall6(name, err, arg1, arg2, arg3, arg4, arg5, arg6) \
+  ({                                                             \
+       register long int __res  asm ("$r0");                     \
+       register long int __num asm ("$r15") = (long) (name);   	 \
+       register long int __arg1 asm ("$r0") = (long) (arg1);     \
+       register long int __arg2 asm ("$r1") = (long) (arg2);     \
+       register long int __arg3 asm ("$r2") = (long) (arg3);     \
+       register long int __arg4 asm ("$r3") = (long) (arg4);     \
+       register long int __arg5 asm ("$r4") = (long) (arg5);     \
+       register long int __arg6 asm ("$r5") = (long) (arg6);     \
+       __asm__ volatile (                                        \
+       __issue_syscall (name)                                    \
+       : "=r" (__res)                                            \
+       : "r" (__num)                                             \
+       , "r" (__arg1)                                            \
+       , "r" (__arg2)                                            \
+       , "r" (__arg3)                                            \
+       , "r" (__arg4)                                            \
+       , "r" (__arg5)                                            \
+       , "r" (__arg6)                                            \
+       : __SYSCALL_CLOBBERS);                                    \
+        __res;                                                   \
+  })
+
+# define __SYSCALL_CLOBBERS "memory"
+
+#endif /* !__ASSEMBLER__.   */
+
+#define PTR_MANGLE(var) (void) (var)
+#define PTR_DEMANGLE(var) (void) (var)
+
+#endif /* _LINUX_NDS32_SYSDEP_H.  */
-- 
1.9.5


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v4 08/11] nds32: Linux ABI
  2019-06-05 11:56 [PATCH v4 00/11] nds32 glibc port, v4 Vincent Chen
                   ` (6 preceding siblings ...)
  2019-06-05 11:56 ` [PATCH v4 07/11] nds32: Linux Syscall Interface Vincent Chen
@ 2019-06-05 11:56 ` Vincent Chen
  2019-06-06 22:45   ` Joseph Myers
  2019-06-05 11:56 ` [PATCH v4 09/11] nds32: Add ABI list Vincent Chen
                   ` (4 subsequent siblings)
  12 siblings, 1 reply; 28+ messages in thread
From: Vincent Chen @ 2019-06-05 11:56 UTC (permalink / raw
  To: libc-alpha, joseph; +Cc: deanbo422, cnoize, vincentc

Linux-specific code that is required for maintaining ABI compatibility.
This doesn't contain the actual system call interface, that is split out
in order to avoid having a patch that's too big.

2019-06-03  Vincent Chen  <vincentc@andestech.com>
2019-06-03  CheWei Chuang  <cnoize@andestech.com>

	* sysdeps/unix/sysv/linux/nds32/bits/fcntl.h: New file.
	* sysdeps/unix/sysv/linux/nds32/bits/procfs.h: Likewise.
	* sysdeps/unix/sysv/linux/nds32/bits/shmlba.h: Likewise.
	* sysdeps/unix/sysv/linux/nds32/fpu/Makefile: Likewise.
	* sysdeps/unix/sysv/linux/nds32/fpu/ioctl.c: Likewise.
	* sysdeps/unix/sysv/linux/nds32/fpu/mremap.c: Likewise.
	* sysdeps/unix/sysv/linux/nds32/fpu/prctl.c: Likewise.
	* sysdeps/unix/sysv/linux/nds32/fpu/setfpucw.c: Likewise.
	* sysdeps/unix/sysv/linux/nds32/getcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/nds32/init-first.c: Likewise.
	* sysdeps/unix/sysv/linux/nds32/ipc_priv.h: Likewise.
	* sysdeps/unix/sysv/linux/nds32/kernel-features.h: Likewise.
	* sysdeps/unix/sysv/linux/nds32/libc-vdso.h: Likewise.
	* sysdeps/unix/sysv/linux/nds32/makecontext.c: Likewise.
	* sysdeps/unix/sysv/linux/nds32/setcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/nds32/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/nds32/swapcontext.S: Likewise.
	* sysdeps/unix/sysv/linux/nds32/sys/cachectl.h: Likewise.
	* sysdeps/unix/sysv/linux/nds32/sys/ucontext.h: Likewise.
	* sysdeps/unix/sysv/linux/nds32/sys/user.h: Likewise.
	* sysdeps/unix/sysv/linux/nds32/sysctl.mk: Likewise.
	* sysdeps/unix/sysv/linux/nds32/ucontext_i.sym: Likewise.
	* sysdeps/unix/sysv/linux/nds32/vfork.S: Likewise.
---
 sysdeps/unix/sysv/linux/nds32/bits/fcntl.h      |  53 ++++++++
 sysdeps/unix/sysv/linux/nds32/bits/procfs.h     |  40 ++++++
 sysdeps/unix/sysv/linux/nds32/bits/shmlba.h     |  24 ++++
 sysdeps/unix/sysv/linux/nds32/fpu/Makefile      |   3 +
 sysdeps/unix/sysv/linux/nds32/fpu/ioctl.c       |  37 ++++++
 sysdeps/unix/sysv/linux/nds32/fpu/mremap.c      |  37 ++++++
 sysdeps/unix/sysv/linux/nds32/fpu/prctl.c       |  40 ++++++
 sysdeps/unix/sysv/linux/nds32/fpu/setfpucw.c    |  50 ++++++++
 sysdeps/unix/sysv/linux/nds32/getcontext.S      | 102 ++++++++++++++++
 sysdeps/unix/sysv/linux/nds32/init-first.c      |  48 ++++++++
 sysdeps/unix/sysv/linux/nds32/ipc_priv.h        |  22 ++++
 sysdeps/unix/sysv/linux/nds32/kernel-features.h |  31 +++++
 sysdeps/unix/sysv/linux/nds32/libc-vdso.h       |  32 +++++
 sysdeps/unix/sysv/linux/nds32/makecontext.c     |  57 +++++++++
 sysdeps/unix/sysv/linux/nds32/setcontext.S      | 111 +++++++++++++++++
 sysdeps/unix/sysv/linux/nds32/sigcontextinfo.h  |  35 ++++++
 sysdeps/unix/sysv/linux/nds32/swapcontext.S     | 154 ++++++++++++++++++++++++
 sysdeps/unix/sysv/linux/nds32/sys/cachectl.h    |  33 +++++
 sysdeps/unix/sysv/linux/nds32/sys/ucontext.h    |  88 ++++++++++++++
 sysdeps/unix/sysv/linux/nds32/sys/user.h        |  22 ++++
 sysdeps/unix/sysv/linux/nds32/sysctl.mk         |   1 +
 sysdeps/unix/sysv/linux/nds32/ucontext_i.sym    |  28 +++++
 sysdeps/unix/sysv/linux/nds32/vfork.S           |  46 +++++++
 23 files changed, 1094 insertions(+)
 create mode 100644 sysdeps/unix/sysv/linux/nds32/bits/fcntl.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/bits/procfs.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/bits/shmlba.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/fpu/Makefile
 create mode 100644 sysdeps/unix/sysv/linux/nds32/fpu/ioctl.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/fpu/mremap.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/fpu/prctl.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/fpu/setfpucw.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/getcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/nds32/init-first.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/ipc_priv.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/kernel-features.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libc-vdso.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/makecontext.c
 create mode 100644 sysdeps/unix/sysv/linux/nds32/setcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sigcontextinfo.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/swapcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sys/cachectl.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sys/ucontext.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sys/user.h
 create mode 100644 sysdeps/unix/sysv/linux/nds32/sysctl.mk
 create mode 100644 sysdeps/unix/sysv/linux/nds32/ucontext_i.sym
 create mode 100644 sysdeps/unix/sysv/linux/nds32/vfork.S

diff --git a/sysdeps/unix/sysv/linux/nds32/bits/fcntl.h b/sysdeps/unix/sysv/linux/nds32/bits/fcntl.h
new file mode 100644
index 0000000..1b27ebe
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/bits/fcntl.h
@@ -0,0 +1,53 @@
+/* O_*, F_*, FD_* bit values.  Andes Linux/nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+#include <sys/types.h>
+
+typedef struct flock
+  {
+    short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
+    short int l_whence;	/* Where `l_start' is relative to (like `lseek').  */
+#ifndef __USE_FILE_OFFSET64
+    __off_t l_start;	/* Offset where the lock begins.  */
+    __off_t l_len;	/* Size of the locked area; zero means until EOF.  */
+#else
+    __off64_t l_start;	/* Offset where the lock begins.  */
+    __off64_t l_len;	/* Size of the locked area; zero means until EOF.  */
+#endif
+    __pid_t l_pid;	/* Process holding the lock.  */
+} flock_t;
+
+#ifdef __USE_LARGEFILE64
+struct flock64
+  {
+    short int l_type;	/* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
+    short int l_whence;	/* Where `l_start' is relative to (like `lseek').  */
+    __off64_t l_start;	/* Offset where the lock begins.  */
+    __off64_t l_len;	/* Size of the locked area; zero means until EOF.  */
+    __pid_t l_pid;	/* Process holding the lock.  */
+  };
+#endif
+
+
+/* Include generic Linux declarations.  */
+#include <bits/fcntl-linux.h>
+
diff --git a/sysdeps/unix/sysv/linux/nds32/bits/procfs.h b/sysdeps/unix/sysv/linux/nds32/bits/procfs.h
new file mode 100644
index 0000000..94a3893
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/bits/procfs.h
@@ -0,0 +1,40 @@
+/* Types for registers for sys/procfs.h.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _SYS_PROCFS_H
+# error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
+#endif
+
+#include <asm/ptrace.h>
+
+/* Type for a general-purpose register.  */
+typedef unsigned long elf_greg_t;
+/* Type for a floating-point registers.  */
+typedef long long elf_fpreg_t;
+
+/* And the whole bunch of them.  We could have used `struct
+   user_regs' directly in the typedef, but tradition says that
+   the register set is an array, which does have some peculiar
+   semantics, so leave it that way.  */
+
+#define ELF_NGREG       (sizeof(struct user_pt_regs)/sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+/* Register set for the floating-point registers.  */
+#define ELF_NFPREG 	33
+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
diff --git a/sysdeps/unix/sysv/linux/nds32/bits/shmlba.h b/sysdeps/unix/sysv/linux/nds32/bits/shmlba.h
new file mode 100644
index 0000000..2a1e0d6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/bits/shmlba.h
@@ -0,0 +1,24 @@
+/* Define SHMLBA.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _SYS_SHM_H
+# error "Never use <bits/shmlba.h> directly; include <sys/shm.h> instead."
+#endif
+
+/* Segment low boundary address multiple.  */
+#define SHMLBA		0x8000
diff --git a/sysdeps/unix/sysv/linux/nds32/fpu/Makefile b/sysdeps/unix/sysv/linux/nds32/fpu/Makefile
new file mode 100644
index 0000000..7d96145
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/fpu/Makefile
@@ -0,0 +1,3 @@
+ifeq ($(subdir),math)
+libm-support += fp_udfiex_crtl
+endif
diff --git a/sysdeps/unix/sysv/linux/nds32/fpu/ioctl.c b/sysdeps/unix/sysv/linux/nds32/fpu/ioctl.c
new file mode 100644
index 0000000..bb8268b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/fpu/ioctl.c
@@ -0,0 +1,37 @@
+/* Control device.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+
+#include <errno.h>
+#include <stdarg.h>
+#include <sysdep.h>
+
+#include <sys/ioctl.h>
+#include <sys/syscall.h>
+
+int __ioctl (int __fd, unsigned long int __request, ...)
+{
+	unsigned long arg1;
+	va_list arg;
+	va_start (arg, __request);
+	arg1 = va_arg (arg, unsigned long);
+	va_end (arg);
+	return INLINE_SYSCALL(ioctl,3,__fd,__request,arg1);
+}
+libc_hidden_def (__ioctl)
+weak_alias (__ioctl, ioctl)
diff --git a/sysdeps/unix/sysv/linux/nds32/fpu/mremap.c b/sysdeps/unix/sysv/linux/nds32/fpu/mremap.c
new file mode 100644
index 0000000..21dc5f2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/fpu/mremap.c
@@ -0,0 +1,37 @@
+/* Re-map a virtual memory address.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+
+
+#include <errno.h>
+#include <stdarg.h>
+#include <sysdep.h>
+#include <sys/mman.h>
+#include <sys/syscall.h>
+
+void *__mremap (void *__addr, size_t __old_len, size_t __new_len, int __flags, ...)
+{
+	unsigned long arg1;
+	va_list arg;
+	va_start (arg, __flags);
+	arg1 = va_arg (arg, int);
+	va_end (arg);
+	return (void *)INLINE_SYSCALL(mremap,5,__addr,__old_len,__new_len,__flags,arg1);
+}
+weak_alias (__mremap, mremap)
+libc_hidden_def (__mremap)
diff --git a/sysdeps/unix/sysv/linux/nds32/fpu/prctl.c b/sysdeps/unix/sysv/linux/nds32/fpu/prctl.c
new file mode 100644
index 0000000..150a453
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/fpu/prctl.c
@@ -0,0 +1,40 @@
+/* Operations on a process.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <stdarg.h>
+#include <sysdep.h>
+#include <sys/prctl.h>
+#include <sys/syscall.h>
+int prctl (int __option, ...);
+libc_hidden_proto(prctl)
+
+int __prctl (int __option, ...)
+{
+	unsigned long arg1,arg2,arg3,arg4;
+	va_list arg;
+	va_start (arg, __option);
+	arg1 = va_arg (arg, unsigned long);
+	arg2 = va_arg (arg, unsigned long);
+	arg3 = va_arg (arg, unsigned long);
+	arg4 = va_arg (arg, unsigned long);
+	va_end (arg);
+	return INLINE_SYSCALL(prctl,5,__option,arg1,arg2,arg3,arg4);
+}
+weak_alias( __prctl,prctl)
+libc_hidden_weak (prctl)
diff --git a/sysdeps/unix/sysv/linux/nds32/fpu/setfpucw.c b/sysdeps/unix/sysv/linux/nds32/fpu/setfpucw.c
new file mode 100644
index 0000000..dfc1aac
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/fpu/setfpucw.c
@@ -0,0 +1,50 @@
+/* Set the FPU control word.  Andes nds32 version
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <math.h>
+#include <ldsodefs.h>
+#include <fpu_control.h>
+#include <libc-internal.h>
+
+void
+__setfpucw (fpu_control_t set)
+{
+
+  fpu_control_t cw;
+  /* Fetch the current control word.  */
+  _FPU_GETCW (cw);
+
+  /* Preserve the reserved bits, and set the rest as the user
+     specified (or the default, if the user gave zero).  */
+  cw &= _FPU_RESERVED;
+  cw |= set & ~_FPU_RESERVED;
+
+
+  /* GLRO(dl_fpu_control) == _FPU_DEFAULT_SUPPORT_SUBNORMAL_OUTPUT indicates
+   * Kernel will recalculate the underflow operation to support denormalize
+   * output. To ensure each that an underflow exception is issued each time a
+   * denormalize output occurs, the enable bit of underflow exception in
+   * $fpcsr shall be set by default.
+   */
+  if (GLRO(dl_fpu_control) == _FPU_DEFAULT_SUPPORT_SUBNORMAL_OUTPUT) {
+    __fpu_control = GLRO(dl_fpu_control);
+    cw |= FPU_MASK_SUBOUT;
+  }
+  _FPU_SETCW (cw);
+
+}
diff --git a/sysdeps/unix/sysv/linux/nds32/getcontext.S b/sysdeps/unix/sysv/linux/nds32/getcontext.S
new file mode 100644
index 0000000..8d29096
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/getcontext.S
@@ -0,0 +1,102 @@
+/* Save current context.  Andes LINUX/nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <asm/fp_udfiex_crtl.h>
+
+#include "ucontext_i.h"
+
+/*  __getcontext (const ucontext_t *ucp).  */
+
+ENTRY(__getcontext)
+        swi     $lp, [$r0 + UCONTEXT_PC]
+        addi    $r15, $r0, UCONTEXT_GREGS
+        xor     $r1, $r1, $r1
+	smw.bim	$r1, [$r15], $r1
+        addi    $r15, $r15, 20
+	smw.bim	$r6, [$r15], $r14
+        addi    $r15, $r15, 4
+	smw.bim	$r16, [$r15], $r25, #0xf
+#ifdef __NDS32_ABI_2FP_PLUS__
+	move	$r4, $r0
+#endif
+
+/* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8).  */
+	move	$r3, _NSIG8
+	addi	$r2, $r0, UCONTEXT_SIGMASK
+	movi	$r1, 0
+	movi    $r0, SIG_BLOCK
+	movi	$r15, SYS_ify(rt_sigprocmask)
+	syscall 0x0
+        bnez    $r0, .err
+
+
+#ifdef __NDS32_ABI_2FP_PLUS__
+	addi	$r2, $r4, UCONTEXT_FDREGS
+/* Process for FPU registers.  */
+	fmfcfg	$r20	/* Keep $fpcfg in $r20.  */
+	slli	$r20, $r20, #28
+	srli	$r20, $r20, #30	/* Set $r20 as $fpcfg.freg.  */
+
+	/* Case switch for $r20 as $fpcfg.freg.  */
+	beqz	$r20, .LCFG0		/* Branch if $fpcfg.freg = 0b00.  */
+	xori	$r15, $r20, #0b10
+	beqz	$r15, .LCFG2		/* Branch if $fpcfg.freg = 0b10.  */
+	srli	$r20, $r20, #0b01
+	beqz	$r20, .LCFG1		/* Branch if $fpcfg.freg = 0b01.  */
+	/* Fall-through if $fpcfg.freg = 0b11.  */
+.LCFG3:
+	fsdi $fd31, [$r2 + 248]
+	fsdi $fd30, [$r2 + 240]
+	fsdi $fd29, [$r2 + 232]
+	fsdi $fd28, [$r2 + 224]
+	fsdi $fd27, [$r2 + 216]
+	fsdi $fd26, [$r2 + 208]
+	fsdi $fd25, [$r2 + 200]
+	fsdi $fd24, [$r2 + 192]
+.LCFG2:
+	fsdi $fd10, [$r2 + 80]
+	fsdi $fd9, [$r2 + 72]
+	fsdi $fd8, [$r2 + 64]
+.LCFG1:
+	fsdi $fd7, [$r2 + 56]
+	fsdi $fd6, [$r2 + 48]
+	fsdi $fd5, [$r2 + 40]
+	fsdi $fd4, [$r2 + 32]
+.LCFG0:
+	fsdi $fd3, [$r2 + 24]
+	/* save fpcsr.  */
+	fmfcsr $r1
+	swi $r1, [$r2 + 0x100]
+	/* save the status of udf and iex trap.  */
+	movi 	$r0, GET_UDF_IEX_TRAP
+	movi	$r15, SYS_ify(fp_udfiex_crtl)
+	syscall SYS_ify(fp_udfiex_crtl)
+	bltz	$r0, .err
+	swi $r0, [$r2 + 0x104]
+	movi	$r0, 0
+#endif /* __NDS32_ABI_2FP_PLUS__.  */
+        ret
+
+.err:
+	j 	SYSCALL_ERROR_LABEL
+
+PSEUDO_END(__getcontext)
+
+weak_alias (__getcontext, getcontext)
+
diff --git a/sysdeps/unix/sysv/linux/nds32/init-first.c b/sysdeps/unix/sysv/linux/nds32/init-first.c
new file mode 100644
index 0000000..aada091
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/init-first.c
@@ -0,0 +1,48 @@
+/* VDSO initialization. Andes Nds32 version
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+# include <dl-vdso.h>
+# include <libc-vdso.h>
+
+int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *) attribute_hidden;
+int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *);
+int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *);
+
+static inline void
+_libc_vdso_platform_setup (void)
+{
+  PREPARE_VERSION (linux4, "LINUX_4", 14921332);
+
+  void *p = _dl_vdso_vsym ("__vdso_gettimeofday", &linux4);
+  PTR_MANGLE (p);
+  VDSO_SYMBOL(gettimeofday) = p;
+
+  p = _dl_vdso_vsym ("__vdso_clock_getres", &linux4);
+  PTR_MANGLE (p);
+  VDSO_SYMBOL(clock_getres) = p;
+
+  p = _dl_vdso_vsym ("__vdso_clock_gettime", &linux4);
+  PTR_MANGLE (p);
+  VDSO_SYMBOL(clock_gettime) = p;
+
+}
+
+# define VDSO_SETUP _libc_vdso_platform_setup
+
+#include <csu/init-first.c>
diff --git a/sysdeps/unix/sysv/linux/nds32/ipc_priv.h b/sysdeps/unix/sysv/linux/nds32/ipc_priv.h
new file mode 100644
index 0000000..c88bbb1
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/ipc_priv.h
@@ -0,0 +1,22 @@
+/* Old SysV permission definition for Linux.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sys/ipc.h>  /* For __key_t.  */
+
+#define __IPC_64	0x0
+
diff --git a/sysdeps/unix/sysv/linux/nds32/kernel-features.h b/sysdeps/unix/sysv/linux/nds32/kernel-features.h
new file mode 100644
index 0000000..4ab663e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/kernel-features.h
@@ -0,0 +1,31 @@
+/* Set flags signalling availability of kernel features based on given
+   kernel version number.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include_next <kernel-features.h>
+
+
+#undef __ASSUME_CLONE_DEFAULT
+#define __ASSUME_CLONE_BACKWARDS 1
+
+/* Define this if your 32-bit syscall API requires 64-bit register
+   pairs to start with an even-number register.  */
+#define __ASSUME_ALIGNED_REGISTER_PAIRS	1
+
+/* nds32 fadvise64_64 reorganize the syscall arguments.  */
+#define __ASSUME_FADVISE64_64_6ARG 1
diff --git a/sysdeps/unix/sysv/linux/nds32/libc-vdso.h b/sysdeps/unix/sysv/linux/nds32/libc-vdso.h
new file mode 100644
index 0000000..3247e09
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/libc-vdso.h
@@ -0,0 +1,32 @@
+/* VDSO function declaration, Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC_VDSO_H
+#define _LIBC_VDSO_H
+
+# include <sysdep-vdso.h>
+
+extern int (*VDSO_SYMBOL (gettimeofday)) (struct timeval *, void *)
+    attribute_hidden;
+extern int (*VDSO_SYMBOL (clock_gettime)) (clockid_t, struct timespec *)
+    attribute_hidden;
+extern int (*VDSO_SYMBOL (clock_getres)) (clockid_t, struct timespec *)
+    attribute_hidden;
+
+#endif /* _LIBC_VDSO_H.  */
diff --git a/sysdeps/unix/sysv/linux/nds32/makecontext.c b/sysdeps/unix/sysv/linux/nds32/makecontext.c
new file mode 100644
index 0000000..de01d16
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/makecontext.c
@@ -0,0 +1,57 @@
+/* Create new context.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stdarg.h>
+#include <stdint.h>
+#include <sys/ucontext.h>
+
+void
+__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
+{
+  extern void __startcontext (void);
+  unsigned long int *sp;
+  unsigned long int *regptr;
+  va_list ap;
+  int i;
+
+  sp = (unsigned long int *)
+    ((uintptr_t) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size);
+
+  /* Allocate stack for 7-th, 8-th, ..., n-th arguments.  */
+  sp -= argc <= 6 ? 0 : argc - 6;
+
+  /* Keep the stack aligned.  */
+  sp = (unsigned long int *) (((uintptr_t) sp) & -8L);
+
+  ucp->uc_mcontext.nds32_r6 = (uintptr_t) ucp->uc_link;
+  ucp->uc_mcontext.nds32_sp = (uintptr_t) sp;
+  ucp->uc_mcontext.nds32_ipc = (uintptr_t) func;
+  ucp->uc_mcontext.nds32_lp = (uintptr_t) &__startcontext;
+
+  va_start (ap, argc);
+  regptr = &ucp->uc_mcontext.nds32_r0;
+  for (i = 0; i < argc; ++i)
+    if (i < 6)
+      *regptr++ = va_arg (ap, unsigned long int);
+    else
+      sp[i - 6] = va_arg (ap, unsigned long int);
+
+  va_end (ap);
+
+}
+weak_alias (__makecontext, makecontext)
diff --git a/sysdeps/unix/sysv/linux/nds32/setcontext.S b/sysdeps/unix/sysv/linux/nds32/setcontext.S
new file mode 100644
index 0000000..f1d2fd7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/setcontext.S
@@ -0,0 +1,111 @@
+/* Set current context.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+#include "ucontext_i.h"
+
+/* int __setcontext (const ucontext_t *ucp).  */
+
+ENTRY(__setcontext)
+        move    $r4, $r0
+
+/* sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, NULL, _NSIG8).  */
+	move    $r0, SIG_SETMASK
+	addi	$r1, $r4, UCONTEXT_SIGMASK
+	movi	$r2, 0
+	movi	$r3, _NSIG8
+	movi	$r15, SYS_ify(rt_sigprocmask)
+	syscall SYS_ify(rt_sigprocmask)
+        bnez    $r0, .err
+
+#ifdef __NDS32_ABI_2FP_PLUS__
+        addi    $r3,  $r4, UCONTEXT_FDREGS
+
+        fmfcfg  $r20    /* Keep $fpcfg in $r20.  */
+        slli    $r20, $r20, #28
+        srli    $r20, $r20, #30 /* Set $r20 as $fpcfg.freg.  */
+
+
+        /* Case switch for $r20 as $fpcfg.freg.  */
+        beqz    $r20, .LCFG0         /* Branch if $fpcfg.freg = 0b00.  */
+        xori    $r15, $r20, #0b10
+        beqz    $r15, .LCFG2         /* Branch if $fpcfg.freg = 0b10.  */
+        srli    $r20, $r20, #0b01
+        beqz    $r20, .LCFG1         /* Branch if $fpcfg.freg = 0b01.  */
+        /* Fall-through if $fpcfg.freg = 0b11.  */
+.LCFG3:
+        fldi $fd31, [$r3 + 248]
+        fldi $fd30, [$r3 + 240]
+        fldi $fd29, [$r3 + 232]
+        fldi $fd28, [$r3 + 224]
+        fldi $fd27, [$r3 + 216]
+        fldi $fd26, [$r3 + 208]
+        fldi $fd25, [$r3 + 200]
+        fldi $fd24, [$r3 + 192]
+.LCFG2:
+        fldi $fd10, [$r3 + 80]
+        fldi $fd9, [$r3 + 72]
+        fldi $fd8, [$r3 + 64]
+.LCFG1:
+        fldi $fd7, [$r3 + 56]
+        fldi $fd6, [$r3 + 48]
+        fldi $fd5, [$r3 + 40]
+        fldi $fd4, [$r3 + 32]
+.LCFG0:
+        fldi $fd3, [$r3 + 24]
+        /* save fpcsr.  */
+        lwi $r1, [$r3 + 0x100]
+        fmtcsr $r1
+	/* save the status of udf and iex trap.  */
+	lwi 	$r0, [$r3 + 0x104]
+	bltz	$r0, 1f
+	movi	$r15, SYS_ify(fp_udfiex_crtl)
+	syscall SYS_ify(fp_udfiex_crtl)
+1:
+#endif /* __NDS32_ABI_2FP_PLUS__.  */
+
+        move    $r0,  $r4
+        addi    $r15, $r0, UCONTEXT_GREGS + 4
+	lmw.bim	$r1,  [$r15], $r14
+        addi    $r15, $r15, 4
+	lmw.bim	$r16, [$r15], $r25, #0xf
+        lwi     $r15, [$r0 + UCONTEXT_PC]
+        lwi     $r0,  [$r0 + UCONTEXT_GREGS]
+        jr      $r15
+.err:
+	j 	SYSCALL_ERROR_LABEL
+PSEUDO_END(__setcontext)
+
+weak_alias (__setcontext, setcontext)
+
+        cfi_startproc
+        cfi_undefined (lp)
+        nop16
+        cfi_endproc
+ENTRY (__startcontext)
+	beqz $r6, 1f
+        move $r0, $r6
+	jal __setcontext
+1:	
+	move $r0, 0
+	j HIDDEN_JUMPTARGET(exit)
+END (__startcontext)
+
+.hidden __startcontext
+ 
diff --git a/sysdeps/unix/sysv/linux/nds32/sigcontextinfo.h b/sysdeps/unix/sysv/linux/nds32/sigcontextinfo.h
new file mode 100644
index 0000000..b3faade
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/sigcontextinfo.h
@@ -0,0 +1,35 @@
+/* Definitions for signal handling calling conventions.  Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sys/ucontext.h>
+
+#define SIGCONTEXT siginfo_t *_si, struct ucontext_t *
+#define GET_PC(ctx)	((void *) (ctx)->uc_mcontext.nds32_ipc)
+
+
+/* There is no reliable way to get the sigcontext unless we use a
+   three-argument signal handler.  */
+#define __sigaction(sig, act, oact) ({ \
+  (act)->sa_flags |= SA_SIGINFO; \
+  (__sigaction) (sig, act, oact); \
+})
+
+#define sigaction(sig, act, oact) ({ \
+  (act)->sa_flags |= SA_SIGINFO; \
+  (sigaction) (sig, act, oact); \
+})
diff --git a/sysdeps/unix/sysv/linux/nds32/swapcontext.S b/sysdeps/unix/sysv/linux/nds32/swapcontext.S
new file mode 100644
index 0000000..9f489fd
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/swapcontext.S
@@ -0,0 +1,154 @@
+/* Save and set current context.  Andes nds32 version
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <asm/fp_udfiex_crtl.h>
+#include "ucontext_i.h"
+
+/* int swapcontext (ucontext_t *oucp, const ucontext_t *ucp).  */
+
+ENTRY(__swapcontext)
+	move	$r5, $r1
+        swi     $lp, [$r0 + UCONTEXT_PC]
+        addi    $r15, $r0, UCONTEXT_GREGS
+        xor     $r1, $r1, $r1
+	smw.bim $r1, [$r15], $r1
+	addi    $r15, $r15, 20
+	smw.bim	$r6, [$r15], $r14
+        addi    $r15, $r15, 4
+	smw.bim	$r16, [$r15], $r25, #0xf
+#ifdef __NDS32_ABI_2FP_PLUS__
+	addi	$r4, $r0, UCONTEXT_FDREGS
+#endif /* __NDS32_ABI_2FP_PLUS__.  */
+
+/* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, &oucp->uc_sigmask, _NSIG8).  */
+	move	$r3, _NSIG8
+	addi	$r2, $r0, UCONTEXT_SIGMASK
+	addi	$r1, $r5, UCONTEXT_SIGMASK
+	move    $r0, SIG_SETMASK
+	movi	$r15, SYS_ify(rt_sigprocmask)
+	syscall SYS_ify(rt_sigprocmask)
+        bnez    $r0, .err
+
+#ifdef __NDS32_ABI_2FP_PLUS__
+/* Process for FPU registers.  */
+	fmfcfg	$r20	/* Keep $fpcfg in $r20.  */
+	slli	$r20, $r20, #28
+	srli	$r20, $r20, #30	/* Set $r20 as $fpcfg.freg.  */
+
+	/* Case switch for $r20 as $fpcfg.freg.  */
+	beqz	$r20, .LCFG0		/* Branch if $fpcfg.freg = 0b00.  */
+	xori	$r15, $r20, #0b10
+	beqz	$r15, .LCFG2		/* Branch if $fpcfg.freg = 0b10.  */
+	srli	$r20, $r20, #0b01
+	beqz	$r20, .LCFG1		/* Branch if $fpcfg.freg = 0b01.  */
+	/* Fall-through if $fpcfg.freg = 0b11.  */
+.LCFG3:
+	fsdi $fd31, [$r4 + 248]
+	fsdi $fd30, [$r4 + 240]
+	fsdi $fd29, [$r4 + 232]
+	fsdi $fd28, [$r4 + 224]
+	fsdi $fd27, [$r4 + 216]
+	fsdi $fd26, [$r4 + 208]
+	fsdi $fd25, [$r4 + 200]
+	fsdi $fd24, [$r4 + 192]
+.LCFG2:
+	fsdi $fd10, [$r4 + 80]
+	fsdi $fd9, [$r4 + 72]
+	fsdi $fd8, [$r4 + 64]
+.LCFG1:
+	fsdi $fd7, [$r4 + 56]
+	fsdi $fd6, [$r4 + 48]
+	fsdi $fd5, [$r4 + 40]
+	fsdi $fd4, [$r4 + 32]
+.LCFG0:
+	fsdi $fd3, [$r4 + 24]
+	/* save fpcsr.  */
+	fmfcsr $r1
+	swi $r1, [$r4 + 0x100]
+	/* save the status of udf and iex trap.  */
+	movi 	$r0, GET_UDF_IEX_TRAP
+	movi	$r15, SYS_ify(fp_udfiex_crtl)
+	syscall SYS_ify(fp_udfiex_crtl)
+	swi $r0, [$r4 + 0x104]
+#endif /* __NDS32_ABI_2FP_PLUS__.  */
+
+
+
+#ifdef __NDS32_ABI_2FP_PLUS__
+	addi	$r0,  $r5, UCONTEXT_FDREGS
+	fmfcfg  $r20    /* Keep $fpcfg in $r20.  */
+	slli    $r20, $r20, #28
+	srli    $r20, $r20, #30 /* Set $r20 as $fpcfg.freg.  */
+
+	fmfcfg  $r20    /* Keep $fpcfg in $r20.  */
+	slli    $r20, $r20, #28
+	srli    $r20, $r20, #30 /* Set $r20 as $fpcfg.freg.  */
+
+	/* Case switch for $r20 as $fpcfg.freg.  */
+	beqz    $r20, .LCFG4         /* Branch if $fpcfg.freg = 0b00.  */
+	xori    $r15, $r20, #0b10
+	beqz    $r15, .LCFG6         /* Branch if $fpcfg.freg = 0b10.  */
+	srli    $r20, $r20, #0b01
+	beqz    $r20, .LCFG5         /* Branch if $fpcfg.freg = 0b01.  */
+	/* Fall-through if $fpcfg.freg = 0b11.  */
+.LCFG7:
+	fldi $fd31, [$r0 + 248]
+	fldi $fd30, [$r0 + 240]
+	fldi $fd29, [$r0 + 232]
+	fldi $fd28, [$r0 + 224]
+	fldi $fd27, [$r0 + 216]
+	fldi $fd26, [$r0 + 208]
+	fldi $fd25, [$r0 + 200]
+	fldi $fd24, [$r0 + 192]
+.LCFG6:
+	fldi $fd10, [$r0 + 80]
+	fldi $fd9, [$r0 + 72]
+	fldi $fd8, [$r0 + 64]
+.LCFG5:
+	fldi $fd7, [$r0 + 56]
+	fldi $fd6, [$r0 + 48]
+	fldi $fd5, [$r0 + 40]
+	fldi $fd4, [$r0 + 32]
+.LCFG4:
+	fldi $fd3, [$r0 + 24]
+	/* save fpcsr.  */
+	lwi $r1, [$r0 + 0x100]
+	fmtcsr $r1
+	/* save the status of udf and iex trap.  */
+	lwi 	$r0, [$r0 + 0x104]
+	bltz	$r0, 1f
+	movi	$r15, SYS_ify(fp_udfiex_crtl)
+	syscall SYS_ify(fp_udfiex_crtl)
+1:
+#endif /* __NDS32_ABI_2FP_PLUS__.  */
+
+        move    $r0, $r5
+        addi    $r15, $r5, UCONTEXT_GREGS + 4
+	lmw.bim	$r1, [$r15], $r14
+        addi    $r15, $r15, 4
+	lmw.bim	$r16, [$r15], $r25, #0xf
+        lwi     $r15, [$r0 + UCONTEXT_PC]
+        lwi     $r0, [$r0 + UCONTEXT_GREGS]
+        jr      $r15
+
+.err:
+	j 	SYSCALL_ERROR_LABEL
+PSEUDO_END(__swapcontext)
+
+weak_alias (__swapcontext, swapcontext)
diff --git a/sysdeps/unix/sysv/linux/nds32/sys/cachectl.h b/sysdeps/unix/sysv/linux/nds32/sys/cachectl.h
new file mode 100644
index 0000000..412b46f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/sys/cachectl.h
@@ -0,0 +1,33 @@
+/* Andes nds32 cache flushing interface
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _SYS_CACHECTL_H
+#define _SYS_CACHECTL_H 1
+
+#include <features.h>
+
+/* Get the kernel definition for the __op argument.  */
+#include <asm/cachectl.h>
+
+__BEGIN_DECLS
+
+extern int cacheflush (void *__addr, const int __end, const int __op) __THROW;
+
+__END_DECLS
+
+#endif /* sys/cachectl.h */
diff --git a/sysdeps/unix/sysv/linux/nds32/sys/ucontext.h b/sysdeps/unix/sysv/linux/nds32/sys/ucontext.h
new file mode 100644
index 0000000..dc6bab4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/sys/ucontext.h
@@ -0,0 +1,88 @@
+/* struct ucontext definition, Andes nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H	1
+
+#include <features.h>
+#include <bits/types/sigset_t.h>
+#include <bits/types/stack_t.h>
+
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
+
+/* Context to describe whole processor state.  */
+
+typedef struct {
+        unsigned long int __ctx(trap_no);
+        unsigned long int __ctx(error_code);
+        unsigned long int __ctx(oldmask);
+        unsigned long int __ctx(nds32_r0);
+        unsigned long int __ctx(nds32_r1);
+        unsigned long int __ctx(nds32_r2);
+        unsigned long int __ctx(nds32_r3);
+        unsigned long int __ctx(nds32_r4);
+        unsigned long int __ctx(nds32_r5);
+        unsigned long int __ctx(nds32_r6);
+        unsigned long int __ctx(nds32_r7);
+        unsigned long int __ctx(nds32_r8);
+        unsigned long int __ctx(nds32_r9);
+        unsigned long int __ctx(nds32_r10);
+        unsigned long int __ctx(nds32_r11);
+        unsigned long int __ctx(nds32_r12);
+        unsigned long int __ctx(nds32_r13);
+        unsigned long int __ctx(nds32_r14);
+        unsigned long int __ctx(nds32_r15);
+        unsigned long int __ctx(nds32_r16);
+        unsigned long int __ctx(nds32_r17);
+        unsigned long int __ctx(nds32_r18);
+        unsigned long int __ctx(nds32_r19);
+        unsigned long int __ctx(nds32_r20);
+        unsigned long int __ctx(nds32_r21);
+        unsigned long int __ctx(nds32_r22);
+        unsigned long int __ctx(nds32_r23);
+        unsigned long int __ctx(nds32_r24);
+        unsigned long int __ctx(nds32_r25);
+        unsigned long int __ctx(nds32_fp);
+        unsigned long int __ctx(nds32_gp);
+        unsigned long int __ctx(nds32_lp);
+        unsigned long int __ctx(nds32_sp);
+        unsigned long int __ctx(nds32_ipc);
+        unsigned long int __ctx(fault_address);
+        unsigned long int __ctx(used_math_flag);
+        unsigned long long __ctx(fd_regs)[32];
+        unsigned long int __ctx(fpcsr);
+        unsigned long int __ctx(UDF_trap);
+        unsigned long int __ctx(zol)[3];
+} mcontext_t;
+
+
+/* Userlevel context.  */
+typedef struct ucontext_t
+  {
+    unsigned long int __ctx(uc_flags);
+    struct ucontext_t *uc_link;
+    stack_t uc_stack;
+    mcontext_t uc_mcontext;
+    __sigset_t uc_sigmask;
+  } ucontext_t;
+#endif /* _SYS_UCONTEXT_H.  */
diff --git a/sysdeps/unix/sysv/linux/nds32/sys/user.h b/sysdeps/unix/sysv/linux/nds32/sys/user.h
new file mode 100644
index 0000000..b529a0b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/sys/user.h
@@ -0,0 +1,22 @@
+/* Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _SYS_USER_H
+#define _SYS_USER_H	1
+
+
+#endif  /* _SYS_USER_H.  */
diff --git a/sysdeps/unix/sysv/linux/nds32/sysctl.mk b/sysdeps/unix/sysv/linux/nds32/sysctl.mk
new file mode 100644
index 0000000..cd10656
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/sysctl.mk
@@ -0,0 +1 @@
+# nds32 doesn't support sysctl.
diff --git a/sysdeps/unix/sysv/linux/nds32/ucontext_i.sym b/sysdeps/unix/sysv/linux/nds32/ucontext_i.sym
new file mode 100644
index 0000000..266a158
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/ucontext_i.sym
@@ -0,0 +1,28 @@
+#include <stddef.h>
+#include <signal.h>
+#include <sys/ucontext.h>
+
+--
+
+SIG_BLOCK
+SIG_SETMASK
+
+_NSIG8          (_NSIG / 8)
+
+-- Offsets of the fields in the ucontext_t structure.
+#define ucontext(member)	offsetof (ucontext_t, member)
+#define mcontext(member)	ucontext (uc_mcontext.member)
+
+
+UCONTEXT_GREGS                  mcontext (nds32_r0)
+#ifdef __NDS32_ABI_2FP_PLUS__
+UCONTEXT_FDREGS                 mcontext (fd_regs)
+#endif
+UCONTEXT_PC                     mcontext (nds32_ipc)
+
+
+UCONTEXT_FLAGS                  ucontext (uc_flags)
+UCONTEXT_LINK                   ucontext (uc_link)
+UCONTEXT_STACK                  ucontext (uc_stack)
+UCONTEXT_MCONTEXT               ucontext (uc_mcontext)
+UCONTEXT_SIGMASK                ucontext (uc_sigmask)
diff --git a/sysdeps/unix/sysv/linux/nds32/vfork.S b/sysdeps/unix/sysv/linux/nds32/vfork.S
new file mode 100644
index 0000000..412706f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/vfork.S
@@ -0,0 +1,46 @@
+/* vfork for Linux.  Andes Linux/nds32 version.
+   Copyright (C) 2018-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#define _ERRNO_H    1
+#include <bits/errno.h>
+
+
+ENTRY (__libc_vfork)
+#ifdef PIC
+.pic
+#endif	
+
+        movi $r0, #0x4111 /* 0x4111 = CLONE_VM | CLONE_VFORK | SIGCHLD.  */
+        move $r1, $sp
+        movi $r15, __NR_clone
+        syscall #0x0
+        bltz $r0, 2f
+1:
+        ret
+2:
+        sltsi $r1, $r0, -4096
+        bnez $r1, 1b;
+
+        j SYSCALL_ERROR_LABEL
+
+PSEUDO_END (__libc_vfork)
+
+weak_alias (__libc_vfork, vfork)
+strong_alias (__libc_vfork, __vfork)
+libc_hidden_def (__vfork)
-- 
1.9.5


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v4 09/11] nds32: Add ABI list
  2019-06-05 11:56 [PATCH v4 00/11] nds32 glibc port, v4 Vincent Chen
                   ` (7 preceding siblings ...)
  2019-06-05 11:56 ` [PATCH v4 08/11] nds32: Linux ABI Vincent Chen
@ 2019-06-05 11:56 ` Vincent Chen
  2019-06-05 11:56 ` [PATCH v4 10/11] Add nds32 entries to config.h.in Vincent Chen
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 28+ messages in thread
From: Vincent Chen @ 2019-06-05 11:56 UTC (permalink / raw
  To: libc-alpha, joseph; +Cc: deanbo422, cnoize, vincentc

2019-06-03  Vincent Chen  <vincentc@andestech.com>
2019-06-03  CheWei Chuang  <cnoize@andestech.com>

	* sysdeps/unix/sysv/linux/nds32/c++-types.data New file.
	* sysdeps/unix/sysv/linux/nds32/ld.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nds32/libBrokenLocale.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nds32/libanl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nds32/libc.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nds32/libcrypt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nds32/libdl.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nds32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nds32/libpthread.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nds32/libresolv.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nds32/librt.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nds32/libthread_db.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nds32/libutil.abilist: Likewise.
---
 sysdeps/unix/sysv/linux/nds32/c++-types.data       |   67 +
 sysdeps/unix/sysv/linux/nds32/ld.abilist           |    9 +
 .../unix/sysv/linux/nds32/libBrokenLocale.abilist  |    1 +
 sysdeps/unix/sysv/linux/nds32/libanl.abilist       |    4 +
 sysdeps/unix/sysv/linux/nds32/libc.abilist         | 2080 ++++++++++++++++++++
 sysdeps/unix/sysv/linux/nds32/libcrypt.abilist     |    2 +
 sysdeps/unix/sysv/linux/nds32/libdl.abilist        |    9 +
 sysdeps/unix/sysv/linux/nds32/libm.abilist         |  753 +++++++
 sysdeps/unix/sysv/linux/nds32/libpthread.abilist   |  235 +++
 sysdeps/unix/sysv/linux/nds32/libresolv.abilist    |   79 +
 sysdeps/unix/sysv/linux/nds32/librt.abilist        |   35 +
 sysdeps/unix/sysv/linux/nds32/libthread_db.abilist |   40 +
 sysdeps/unix/sysv/linux/nds32/libutil.abilist      |    6 +
 13 files changed, 3320 insertions(+)
 create mode 100644 sysdeps/unix/sysv/linux/nds32/c++-types.data
 create mode 100644 sysdeps/unix/sysv/linux/nds32/ld.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libBrokenLocale.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libanl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libc.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libcrypt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libdl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libm.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libpthread.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libresolv.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/librt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libthread_db.abilist
 create mode 100644 sysdeps/unix/sysv/linux/nds32/libutil.abilist

diff --git a/sysdeps/unix/sysv/linux/nds32/c++-types.data b/sysdeps/unix/sysv/linux/nds32/c++-types.data
new file mode 100644
index 0000000..303f457
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/c++-types.data
@@ -0,0 +1,67 @@
+blkcnt64_t:x
+blkcnt_t:l
+blksize_t:i
+caddr_t:Pc
+clockid_t:i
+clock_t:l
+daddr_t:i
+dev_t:y
+fd_mask:l
+fsblkcnt64_t:y
+fsblkcnt_t:m
+fsfilcnt64_t:y
+fsfilcnt_t:m
+fsid_t:8__fsid_t
+gid_t:j
+id_t:j
+ino64_t:y
+ino_t:m
+int16_t:s
+int32_t:i
+int64_t:x
+int8_t:a
+intptr_t:i
+key_t:i
+loff_t:x
+mode_t:j
+nlink_t:j
+off64_t:x
+off_t:l
+pid_t:i
+pthread_attr_t:14pthread_attr_t
+pthread_barrier_t:17pthread_barrier_t
+pthread_barrierattr_t:21pthread_barrierattr_t
+pthread_cond_t:14pthread_cond_t
+pthread_condattr_t:18pthread_condattr_t
+pthread_key_t:j
+pthread_mutex_t:15pthread_mutex_t
+pthread_mutexattr_t:19pthread_mutexattr_t
+pthread_once_t:i
+pthread_rwlock_t:16pthread_rwlock_t
+pthread_rwlockattr_t:20pthread_rwlockattr_t
+pthread_spinlock_t:i
+pthread_t:m
+quad_t:x
+register_t:i
+rlim64_t:y
+rlim_t:m
+sigset_t:10__sigset_t
+size_t:j
+socklen_t:j
+ssize_t:i
+suseconds_t:l
+time_t:l
+u_char:h
+uid_t:j
+uint:j
+u_int:j
+u_int16_t:t
+u_int32_t:j
+u_int64_t:y
+u_int8_t:h
+ulong:m
+u_long:m
+u_quad_t:y
+useconds_t:j
+ushort:t
+u_short:t
diff --git a/sysdeps/unix/sysv/linux/nds32/ld.abilist b/sysdeps/unix/sysv/linux/nds32/ld.abilist
new file mode 100644
index 0000000..41183d7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/ld.abilist
@@ -0,0 +1,9 @@
+GLIBC_2.30 __libc_stack_end D 0x4
+GLIBC_2.30 __stack_chk_guard D 0x4
+GLIBC_2.30 __tls_get_addr F
+GLIBC_2.30 _dl_mcount F
+GLIBC_2.30 _r_debug D 0x14
+GLIBC_2.30 calloc F
+GLIBC_2.30 free F
+GLIBC_2.30 malloc F
+GLIBC_2.30 realloc F
diff --git a/sysdeps/unix/sysv/linux/nds32/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/nds32/libBrokenLocale.abilist
new file mode 100644
index 0000000..c6253c0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/libBrokenLocale.abilist
@@ -0,0 +1 @@
+GLIBC_2.30 __ctype_get_mb_cur_max F
diff --git a/sysdeps/unix/sysv/linux/nds32/libanl.abilist b/sysdeps/unix/sysv/linux/nds32/libanl.abilist
new file mode 100644
index 0000000..d3b7532
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/libanl.abilist
@@ -0,0 +1,4 @@
+GLIBC_2.30 gai_cancel F
+GLIBC_2.30 gai_error F
+GLIBC_2.30 gai_suspend F
+GLIBC_2.30 getaddrinfo_a F
diff --git a/sysdeps/unix/sysv/linux/nds32/libc.abilist b/sysdeps/unix/sysv/linux/nds32/libc.abilist
new file mode 100644
index 0000000..0261d56
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/libc.abilist
@@ -0,0 +1,2080 @@
+GLIBC_2.30 _Exit F
+GLIBC_2.30 _IO_2_1_stderr_ D 0xa0
+GLIBC_2.30 _IO_2_1_stdin_ D 0xa0
+GLIBC_2.30 _IO_2_1_stdout_ D 0xa0
+GLIBC_2.30 _IO_adjust_column F
+GLIBC_2.30 _IO_adjust_wcolumn F
+GLIBC_2.30 _IO_default_doallocate F
+GLIBC_2.30 _IO_default_finish F
+GLIBC_2.30 _IO_default_pbackfail F
+GLIBC_2.30 _IO_default_uflow F
+GLIBC_2.30 _IO_default_xsgetn F
+GLIBC_2.30 _IO_default_xsputn F
+GLIBC_2.30 _IO_do_write F
+GLIBC_2.30 _IO_doallocbuf F
+GLIBC_2.30 _IO_fclose F
+GLIBC_2.30 _IO_fdopen F
+GLIBC_2.30 _IO_feof F
+GLIBC_2.30 _IO_ferror F
+GLIBC_2.30 _IO_fflush F
+GLIBC_2.30 _IO_fgetpos F
+GLIBC_2.30 _IO_fgetpos64 F
+GLIBC_2.30 _IO_fgets F
+GLIBC_2.30 _IO_file_attach F
+GLIBC_2.30 _IO_file_close F
+GLIBC_2.30 _IO_file_close_it F
+GLIBC_2.30 _IO_file_doallocate F
+GLIBC_2.30 _IO_file_finish F
+GLIBC_2.30 _IO_file_fopen F
+GLIBC_2.30 _IO_file_init F
+GLIBC_2.30 _IO_file_jumps D 0x54
+GLIBC_2.30 _IO_file_open F
+GLIBC_2.30 _IO_file_overflow F
+GLIBC_2.30 _IO_file_read F
+GLIBC_2.30 _IO_file_seek F
+GLIBC_2.30 _IO_file_seekoff F
+GLIBC_2.30 _IO_file_setbuf F
+GLIBC_2.30 _IO_file_stat F
+GLIBC_2.30 _IO_file_sync F
+GLIBC_2.30 _IO_file_underflow F
+GLIBC_2.30 _IO_file_write F
+GLIBC_2.30 _IO_file_xsputn F
+GLIBC_2.30 _IO_flockfile F
+GLIBC_2.30 _IO_flush_all F
+GLIBC_2.30 _IO_flush_all_linebuffered F
+GLIBC_2.30 _IO_fopen F
+GLIBC_2.30 _IO_fprintf F
+GLIBC_2.30 _IO_fputs F
+GLIBC_2.30 _IO_fread F
+GLIBC_2.30 _IO_free_backup_area F
+GLIBC_2.30 _IO_free_wbackup_area F
+GLIBC_2.30 _IO_fsetpos F
+GLIBC_2.30 _IO_fsetpos64 F
+GLIBC_2.30 _IO_ftell F
+GLIBC_2.30 _IO_ftrylockfile F
+GLIBC_2.30 _IO_funlockfile F
+GLIBC_2.30 _IO_fwrite F
+GLIBC_2.30 _IO_getc F
+GLIBC_2.30 _IO_getline F
+GLIBC_2.30 _IO_getline_info F
+GLIBC_2.30 _IO_gets F
+GLIBC_2.30 _IO_init F
+GLIBC_2.30 _IO_init_marker F
+GLIBC_2.30 _IO_init_wmarker F
+GLIBC_2.30 _IO_iter_begin F
+GLIBC_2.30 _IO_iter_end F
+GLIBC_2.30 _IO_iter_file F
+GLIBC_2.30 _IO_iter_next F
+GLIBC_2.30 _IO_least_wmarker F
+GLIBC_2.30 _IO_link_in F
+GLIBC_2.30 _IO_list_all D 0x4
+GLIBC_2.30 _IO_list_lock F
+GLIBC_2.30 _IO_list_resetlock F
+GLIBC_2.30 _IO_list_unlock F
+GLIBC_2.30 _IO_marker_delta F
+GLIBC_2.30 _IO_marker_difference F
+GLIBC_2.30 _IO_padn F
+GLIBC_2.30 _IO_peekc_locked F
+GLIBC_2.30 _IO_popen F
+GLIBC_2.30 _IO_printf F
+GLIBC_2.30 _IO_proc_close F
+GLIBC_2.30 _IO_proc_open F
+GLIBC_2.30 _IO_putc F
+GLIBC_2.30 _IO_puts F
+GLIBC_2.30 _IO_remove_marker F
+GLIBC_2.30 _IO_seekmark F
+GLIBC_2.30 _IO_seekoff F
+GLIBC_2.30 _IO_seekpos F
+GLIBC_2.30 _IO_seekwmark F
+GLIBC_2.30 _IO_setb F
+GLIBC_2.30 _IO_setbuffer F
+GLIBC_2.30 _IO_setvbuf F
+GLIBC_2.30 _IO_sgetn F
+GLIBC_2.30 _IO_sprintf F
+GLIBC_2.30 _IO_sputbackc F
+GLIBC_2.30 _IO_sputbackwc F
+GLIBC_2.30 _IO_sscanf F
+GLIBC_2.30 _IO_str_init_readonly F
+GLIBC_2.30 _IO_str_init_static F
+GLIBC_2.30 _IO_str_overflow F
+GLIBC_2.30 _IO_str_pbackfail F
+GLIBC_2.30 _IO_str_seekoff F
+GLIBC_2.30 _IO_str_underflow F
+GLIBC_2.30 _IO_sungetc F
+GLIBC_2.30 _IO_sungetwc F
+GLIBC_2.30 _IO_switch_to_get_mode F
+GLIBC_2.30 _IO_switch_to_main_wget_area F
+GLIBC_2.30 _IO_switch_to_wbackup_area F
+GLIBC_2.30 _IO_switch_to_wget_mode F
+GLIBC_2.30 _IO_un_link F
+GLIBC_2.30 _IO_ungetc F
+GLIBC_2.30 _IO_unsave_markers F
+GLIBC_2.30 _IO_unsave_wmarkers F
+GLIBC_2.30 _IO_vfprintf F
+GLIBC_2.30 _IO_vsprintf F
+GLIBC_2.30 _IO_wdefault_doallocate F
+GLIBC_2.30 _IO_wdefault_finish F
+GLIBC_2.30 _IO_wdefault_pbackfail F
+GLIBC_2.30 _IO_wdefault_uflow F
+GLIBC_2.30 _IO_wdefault_xsgetn F
+GLIBC_2.30 _IO_wdefault_xsputn F
+GLIBC_2.30 _IO_wdo_write F
+GLIBC_2.30 _IO_wdoallocbuf F
+GLIBC_2.30 _IO_wfile_jumps D 0x54
+GLIBC_2.30 _IO_wfile_overflow F
+GLIBC_2.30 _IO_wfile_seekoff F
+GLIBC_2.30 _IO_wfile_sync F
+GLIBC_2.30 _IO_wfile_underflow F
+GLIBC_2.30 _IO_wfile_xsputn F
+GLIBC_2.30 _IO_wmarker_delta F
+GLIBC_2.30 _IO_wsetb F
+GLIBC_2.30 ___brk_addr D 0x4
+GLIBC_2.30 __adjtimex F
+GLIBC_2.30 __after_morecore_hook D 0x4
+GLIBC_2.30 __argz_count F
+GLIBC_2.30 __argz_next F
+GLIBC_2.30 __argz_stringify F
+GLIBC_2.30 __asprintf F
+GLIBC_2.30 __asprintf_chk F
+GLIBC_2.30 __assert F
+GLIBC_2.30 __assert_fail F
+GLIBC_2.30 __assert_perror_fail F
+GLIBC_2.30 __backtrace F
+GLIBC_2.30 __backtrace_symbols F
+GLIBC_2.30 __backtrace_symbols_fd F
+GLIBC_2.30 __bsd_getpgrp F
+GLIBC_2.30 __bzero F
+GLIBC_2.30 __check_rhosts_file D 0x4
+GLIBC_2.30 __chk_fail F
+GLIBC_2.30 __clone F
+GLIBC_2.30 __close F
+GLIBC_2.30 __cmsg_nxthdr F
+GLIBC_2.30 __confstr_chk F
+GLIBC_2.30 __connect F
+GLIBC_2.30 __ctype_b_loc F
+GLIBC_2.30 __ctype_get_mb_cur_max F
+GLIBC_2.30 __ctype_tolower_loc F
+GLIBC_2.30 __ctype_toupper_loc F
+GLIBC_2.30 __curbrk D 0x4
+GLIBC_2.30 __cxa_at_quick_exit F
+GLIBC_2.30 __cxa_atexit F
+GLIBC_2.30 __cxa_finalize F
+GLIBC_2.30 __cxa_thread_atexit_impl F
+GLIBC_2.30 __cyg_profile_func_enter F
+GLIBC_2.30 __cyg_profile_func_exit F
+GLIBC_2.30 __daylight D 0x4
+GLIBC_2.30 __dcgettext F
+GLIBC_2.30 __default_morecore F
+GLIBC_2.30 __dgettext F
+GLIBC_2.30 __dprintf_chk F
+GLIBC_2.30 __dup2 F
+GLIBC_2.30 __duplocale F
+GLIBC_2.30 __endmntent F
+GLIBC_2.30 __environ D 0x4
+GLIBC_2.30 __errno_location F
+GLIBC_2.30 __explicit_bzero_chk F
+GLIBC_2.30 __fbufsize F
+GLIBC_2.30 __fcntl F
+GLIBC_2.30 __fdelt_chk F
+GLIBC_2.30 __fdelt_warn F
+GLIBC_2.30 __ffs F
+GLIBC_2.30 __fgets_chk F
+GLIBC_2.30 __fgets_unlocked_chk F
+GLIBC_2.30 __fgetws_chk F
+GLIBC_2.30 __fgetws_unlocked_chk F
+GLIBC_2.30 __finite F
+GLIBC_2.30 __finitef F
+GLIBC_2.30 __flbf F
+GLIBC_2.30 __fork F
+GLIBC_2.30 __fpending F
+GLIBC_2.30 __fprintf_chk F
+GLIBC_2.30 __fpu_control D 0x4
+GLIBC_2.30 __fpurge F
+GLIBC_2.30 __fread_chk F
+GLIBC_2.30 __fread_unlocked_chk F
+GLIBC_2.30 __freadable F
+GLIBC_2.30 __freading F
+GLIBC_2.30 __free_hook D 0x4
+GLIBC_2.30 __freelocale F
+GLIBC_2.30 __fsetlocking F
+GLIBC_2.30 __fwprintf_chk F
+GLIBC_2.30 __fwritable F
+GLIBC_2.30 __fwriting F
+GLIBC_2.30 __fxstat F
+GLIBC_2.30 __fxstat64 F
+GLIBC_2.30 __fxstatat F
+GLIBC_2.30 __fxstatat64 F
+GLIBC_2.30 __getauxval F
+GLIBC_2.30 __getcwd_chk F
+GLIBC_2.30 __getdelim F
+GLIBC_2.30 __getdomainname_chk F
+GLIBC_2.30 __getgroups_chk F
+GLIBC_2.30 __gethostname_chk F
+GLIBC_2.30 __getlogin_r_chk F
+GLIBC_2.30 __getmntent_r F
+GLIBC_2.30 __getpagesize F
+GLIBC_2.30 __getpgid F
+GLIBC_2.30 __getpid F
+GLIBC_2.30 __gets_chk F
+GLIBC_2.30 __gettimeofday F
+GLIBC_2.30 __getwd_chk F
+GLIBC_2.30 __gmtime_r F
+GLIBC_2.30 __h_errno_location F
+GLIBC_2.30 __isalnum_l F
+GLIBC_2.30 __isalpha_l F
+GLIBC_2.30 __isascii_l F
+GLIBC_2.30 __isblank_l F
+GLIBC_2.30 __iscntrl_l F
+GLIBC_2.30 __isctype F
+GLIBC_2.30 __isdigit_l F
+GLIBC_2.30 __isgraph_l F
+GLIBC_2.30 __isinf F
+GLIBC_2.30 __isinff F
+GLIBC_2.30 __islower_l F
+GLIBC_2.30 __isnan F
+GLIBC_2.30 __isnanf F
+GLIBC_2.30 __isoc99_fscanf F
+GLIBC_2.30 __isoc99_fwscanf F
+GLIBC_2.30 __isoc99_scanf F
+GLIBC_2.30 __isoc99_sscanf F
+GLIBC_2.30 __isoc99_swscanf F
+GLIBC_2.30 __isoc99_vfscanf F
+GLIBC_2.30 __isoc99_vfwscanf F
+GLIBC_2.30 __isoc99_vscanf F
+GLIBC_2.30 __isoc99_vsscanf F
+GLIBC_2.30 __isoc99_vswscanf F
+GLIBC_2.30 __isoc99_vwscanf F
+GLIBC_2.30 __isoc99_wscanf F
+GLIBC_2.30 __isprint_l F
+GLIBC_2.30 __ispunct_l F
+GLIBC_2.30 __isspace_l F
+GLIBC_2.30 __isupper_l F
+GLIBC_2.30 __iswalnum_l F
+GLIBC_2.30 __iswalpha_l F
+GLIBC_2.30 __iswblank_l F
+GLIBC_2.30 __iswcntrl_l F
+GLIBC_2.30 __iswctype F
+GLIBC_2.30 __iswctype_l F
+GLIBC_2.30 __iswdigit_l F
+GLIBC_2.30 __iswgraph_l F
+GLIBC_2.30 __iswlower_l F
+GLIBC_2.30 __iswprint_l F
+GLIBC_2.30 __iswpunct_l F
+GLIBC_2.30 __iswspace_l F
+GLIBC_2.30 __iswupper_l F
+GLIBC_2.30 __iswxdigit_l F
+GLIBC_2.30 __isxdigit_l F
+GLIBC_2.30 __ivaliduser F
+GLIBC_2.30 __key_decryptsession_pk_LOCAL D 0x4
+GLIBC_2.30 __key_encryptsession_pk_LOCAL D 0x4
+GLIBC_2.30 __key_gendes_LOCAL D 0x4
+GLIBC_2.30 __libc_allocate_rtsig F
+GLIBC_2.30 __libc_calloc F
+GLIBC_2.30 __libc_current_sigrtmax F
+GLIBC_2.30 __libc_current_sigrtmin F
+GLIBC_2.30 __libc_free F
+GLIBC_2.30 __libc_freeres F
+GLIBC_2.30 __libc_init_first F
+GLIBC_2.30 __libc_mallinfo F
+GLIBC_2.30 __libc_malloc F
+GLIBC_2.30 __libc_mallopt F
+GLIBC_2.30 __libc_memalign F
+GLIBC_2.30 __libc_pvalloc F
+GLIBC_2.30 __libc_realloc F
+GLIBC_2.30 __libc_sa_len F
+GLIBC_2.30 __libc_start_main F
+GLIBC_2.30 __libc_valloc F
+GLIBC_2.30 __longjmp_chk F
+GLIBC_2.30 __lseek F
+GLIBC_2.30 __lxstat F
+GLIBC_2.30 __lxstat64 F
+GLIBC_2.30 __malloc_hook D 0x4
+GLIBC_2.30 __mbrlen F
+GLIBC_2.30 __mbrtowc F
+GLIBC_2.30 __mbsnrtowcs_chk F
+GLIBC_2.30 __mbsrtowcs_chk F
+GLIBC_2.30 __mbstowcs_chk F
+GLIBC_2.30 __memalign_hook D 0x4
+GLIBC_2.30 __memcpy_chk F
+GLIBC_2.30 __memmove_chk F
+GLIBC_2.30 __mempcpy F
+GLIBC_2.30 __mempcpy_chk F
+GLIBC_2.30 __memset_chk F
+GLIBC_2.30 __monstartup F
+GLIBC_2.30 __morecore D 0x4
+GLIBC_2.30 __nanosleep F
+GLIBC_2.30 __newlocale F
+GLIBC_2.30 __nl_langinfo_l F
+GLIBC_2.30 __nss_configure_lookup F
+GLIBC_2.30 __nss_hostname_digits_dots F
+GLIBC_2.30 __obstack_printf_chk F
+GLIBC_2.30 __obstack_vprintf_chk F
+GLIBC_2.30 __open F
+GLIBC_2.30 __open64 F
+GLIBC_2.30 __open64_2 F
+GLIBC_2.30 __open_2 F
+GLIBC_2.30 __openat64_2 F
+GLIBC_2.30 __openat_2 F
+GLIBC_2.30 __overflow F
+GLIBC_2.30 __pipe F
+GLIBC_2.30 __poll F
+GLIBC_2.30 __poll_chk F
+GLIBC_2.30 __posix_getopt F
+GLIBC_2.30 __ppoll_chk F
+GLIBC_2.30 __pread64 F
+GLIBC_2.30 __pread64_chk F
+GLIBC_2.30 __pread_chk F
+GLIBC_2.30 __printf_chk F
+GLIBC_2.30 __printf_fp F
+GLIBC_2.30 __profile_frequency F
+GLIBC_2.30 __progname D 0x4
+GLIBC_2.30 __progname_full D 0x4
+GLIBC_2.30 __ptsname_r_chk F
+GLIBC_2.30 __pwrite64 F
+GLIBC_2.30 __rawmemchr F
+GLIBC_2.30 __rcmd_errstr D 0x4
+GLIBC_2.30 __read F
+GLIBC_2.30 __read_chk F
+GLIBC_2.30 __readlink_chk F
+GLIBC_2.30 __readlinkat_chk F
+GLIBC_2.30 __realloc_hook D 0x4
+GLIBC_2.30 __realpath_chk F
+GLIBC_2.30 __recv_chk F
+GLIBC_2.30 __recvfrom_chk F
+GLIBC_2.30 __register_atfork F
+GLIBC_2.30 __res_init F
+GLIBC_2.30 __res_nclose F
+GLIBC_2.30 __res_ninit F
+GLIBC_2.30 __res_randomid F
+GLIBC_2.30 __res_state F
+GLIBC_2.30 __rpc_thread_createerr F
+GLIBC_2.30 __rpc_thread_svc_fdset F
+GLIBC_2.30 __rpc_thread_svc_max_pollfd F
+GLIBC_2.30 __rpc_thread_svc_pollfd F
+GLIBC_2.30 __sbrk F
+GLIBC_2.30 __sched_cpualloc F
+GLIBC_2.30 __sched_cpucount F
+GLIBC_2.30 __sched_cpufree F
+GLIBC_2.30 __sched_get_priority_max F
+GLIBC_2.30 __sched_get_priority_min F
+GLIBC_2.30 __sched_getparam F
+GLIBC_2.30 __sched_getscheduler F
+GLIBC_2.30 __sched_setscheduler F
+GLIBC_2.30 __sched_yield F
+GLIBC_2.30 __select F
+GLIBC_2.30 __send F
+GLIBC_2.30 __setmntent F
+GLIBC_2.30 __setpgid F
+GLIBC_2.30 __sigaction F
+GLIBC_2.30 __signbit F
+GLIBC_2.30 __signbitf F
+GLIBC_2.30 __sigpause F
+GLIBC_2.30 __sigsetjmp F
+GLIBC_2.30 __sigsuspend F
+GLIBC_2.30 __snprintf_chk F
+GLIBC_2.30 __sprintf_chk F
+GLIBC_2.30 __stack_chk_fail F
+GLIBC_2.30 __statfs F
+GLIBC_2.30 __stpcpy F
+GLIBC_2.30 __stpcpy_chk F
+GLIBC_2.30 __stpncpy F
+GLIBC_2.30 __stpncpy_chk F
+GLIBC_2.30 __strcasecmp F
+GLIBC_2.30 __strcasecmp_l F
+GLIBC_2.30 __strcasestr F
+GLIBC_2.30 __strcat_chk F
+GLIBC_2.30 __strcoll_l F
+GLIBC_2.30 __strcpy_chk F
+GLIBC_2.30 __strdup F
+GLIBC_2.30 __strerror_r F
+GLIBC_2.30 __strfmon_l F
+GLIBC_2.30 __strftime_l F
+GLIBC_2.30 __strncasecmp_l F
+GLIBC_2.30 __strncat_chk F
+GLIBC_2.30 __strncpy_chk F
+GLIBC_2.30 __strndup F
+GLIBC_2.30 __strsep_g F
+GLIBC_2.30 __strtod_internal F
+GLIBC_2.30 __strtod_l F
+GLIBC_2.30 __strtof_internal F
+GLIBC_2.30 __strtof_l F
+GLIBC_2.30 __strtok_r F
+GLIBC_2.30 __strtol_internal F
+GLIBC_2.30 __strtol_l F
+GLIBC_2.30 __strtold_internal F
+GLIBC_2.30 __strtold_l F
+GLIBC_2.30 __strtoll_internal F
+GLIBC_2.30 __strtoll_l F
+GLIBC_2.30 __strtoul_internal F
+GLIBC_2.30 __strtoul_l F
+GLIBC_2.30 __strtoull_internal F
+GLIBC_2.30 __strtoull_l F
+GLIBC_2.30 __strverscmp F
+GLIBC_2.30 __strxfrm_l F
+GLIBC_2.30 __swprintf_chk F
+GLIBC_2.30 __sysconf F
+GLIBC_2.30 __syslog_chk F
+GLIBC_2.30 __sysv_signal F
+GLIBC_2.30 __timezone D 0x4
+GLIBC_2.30 __toascii_l F
+GLIBC_2.30 __tolower_l F
+GLIBC_2.30 __toupper_l F
+GLIBC_2.30 __towctrans F
+GLIBC_2.30 __towctrans_l F
+GLIBC_2.30 __towlower_l F
+GLIBC_2.30 __towupper_l F
+GLIBC_2.30 __ttyname_r_chk F
+GLIBC_2.30 __tzname D 0x8
+GLIBC_2.30 __uflow F
+GLIBC_2.30 __underflow F
+GLIBC_2.30 __uselocale F
+GLIBC_2.30 __vasprintf_chk F
+GLIBC_2.30 __vdprintf_chk F
+GLIBC_2.30 __vfork F
+GLIBC_2.30 __vfprintf_chk F
+GLIBC_2.30 __vfscanf F
+GLIBC_2.30 __vfwprintf_chk F
+GLIBC_2.30 __vprintf_chk F
+GLIBC_2.30 __vsnprintf F
+GLIBC_2.30 __vsnprintf_chk F
+GLIBC_2.30 __vsprintf_chk F
+GLIBC_2.30 __vsscanf F
+GLIBC_2.30 __vswprintf_chk F
+GLIBC_2.30 __vsyslog_chk F
+GLIBC_2.30 __vwprintf_chk F
+GLIBC_2.30 __wait F
+GLIBC_2.30 __waitpid F
+GLIBC_2.30 __wcpcpy_chk F
+GLIBC_2.30 __wcpncpy_chk F
+GLIBC_2.30 __wcrtomb_chk F
+GLIBC_2.30 __wcscasecmp_l F
+GLIBC_2.30 __wcscat_chk F
+GLIBC_2.30 __wcscoll_l F
+GLIBC_2.30 __wcscpy_chk F
+GLIBC_2.30 __wcsftime_l F
+GLIBC_2.30 __wcsncasecmp_l F
+GLIBC_2.30 __wcsncat_chk F
+GLIBC_2.30 __wcsncpy_chk F
+GLIBC_2.30 __wcsnrtombs_chk F
+GLIBC_2.30 __wcsrtombs_chk F
+GLIBC_2.30 __wcstod_internal F
+GLIBC_2.30 __wcstod_l F
+GLIBC_2.30 __wcstof_internal F
+GLIBC_2.30 __wcstof_l F
+GLIBC_2.30 __wcstol_internal F
+GLIBC_2.30 __wcstol_l F
+GLIBC_2.30 __wcstold_internal F
+GLIBC_2.30 __wcstold_l F
+GLIBC_2.30 __wcstoll_internal F
+GLIBC_2.30 __wcstoll_l F
+GLIBC_2.30 __wcstombs_chk F
+GLIBC_2.30 __wcstoul_internal F
+GLIBC_2.30 __wcstoul_l F
+GLIBC_2.30 __wcstoull_internal F
+GLIBC_2.30 __wcstoull_l F
+GLIBC_2.30 __wcsxfrm_l F
+GLIBC_2.30 __wctomb_chk F
+GLIBC_2.30 __wctrans_l F
+GLIBC_2.30 __wctype_l F
+GLIBC_2.30 __wmemcpy_chk F
+GLIBC_2.30 __wmemmove_chk F
+GLIBC_2.30 __wmempcpy_chk F
+GLIBC_2.30 __wmemset_chk F
+GLIBC_2.30 __woverflow F
+GLIBC_2.30 __wprintf_chk F
+GLIBC_2.30 __write F
+GLIBC_2.30 __wuflow F
+GLIBC_2.30 __wunderflow F
+GLIBC_2.30 __xmknod F
+GLIBC_2.30 __xmknodat F
+GLIBC_2.30 __xpg_basename F
+GLIBC_2.30 __xpg_sigpause F
+GLIBC_2.30 __xpg_strerror_r F
+GLIBC_2.30 __xstat F
+GLIBC_2.30 __xstat64 F
+GLIBC_2.30 _authenticate F
+GLIBC_2.30 _dl_mcount_wrapper F
+GLIBC_2.30 _dl_mcount_wrapper_check F
+GLIBC_2.30 _environ D 0x4
+GLIBC_2.30 _exit F
+GLIBC_2.30 _flushlbf F
+GLIBC_2.30 _libc_intl_domainname D 0x5
+GLIBC_2.30 _longjmp F
+GLIBC_2.30 _mcleanup F
+GLIBC_2.30 _mcount F
+GLIBC_2.30 _nl_default_dirname D 0x12
+GLIBC_2.30 _nl_domain_bindings D 0x4
+GLIBC_2.30 _nl_msg_cat_cntr D 0x4
+GLIBC_2.30 _null_auth D 0xc
+GLIBC_2.30 _obstack_allocated_p F
+GLIBC_2.30 _obstack_begin F
+GLIBC_2.30 _obstack_begin_1 F
+GLIBC_2.30 _obstack_free F
+GLIBC_2.30 _obstack_memory_used F
+GLIBC_2.30 _obstack_newchunk F
+GLIBC_2.30 _res D 0x200
+GLIBC_2.30 _res_hconf D 0x30
+GLIBC_2.30 _rpc_dtablesize F
+GLIBC_2.30 _seterr_reply F
+GLIBC_2.30 _setjmp F
+GLIBC_2.30 _sys_errlist D 0x21c
+GLIBC_2.30 _sys_nerr D 0x4
+GLIBC_2.30 _sys_siglist D 0x104
+GLIBC_2.30 _tolower F
+GLIBC_2.30 _toupper F
+GLIBC_2.30 a64l F
+GLIBC_2.30 abort F
+GLIBC_2.30 abs F
+GLIBC_2.30 accept F
+GLIBC_2.30 accept4 F
+GLIBC_2.30 access F
+GLIBC_2.30 acct F
+GLIBC_2.30 addmntent F
+GLIBC_2.30 addseverity F
+GLIBC_2.30 adjtime F
+GLIBC_2.30 adjtimex F
+GLIBC_2.30 alarm F
+GLIBC_2.30 aligned_alloc F
+GLIBC_2.30 alphasort F
+GLIBC_2.30 alphasort64 F
+GLIBC_2.30 argp_err_exit_status D 0x4
+GLIBC_2.30 argp_error F
+GLIBC_2.30 argp_failure F
+GLIBC_2.30 argp_help F
+GLIBC_2.30 argp_parse F
+GLIBC_2.30 argp_program_bug_address D 0x4
+GLIBC_2.30 argp_program_version D 0x4
+GLIBC_2.30 argp_program_version_hook D 0x4
+GLIBC_2.30 argp_state_help F
+GLIBC_2.30 argp_usage F
+GLIBC_2.30 argz_add F
+GLIBC_2.30 argz_add_sep F
+GLIBC_2.30 argz_append F
+GLIBC_2.30 argz_count F
+GLIBC_2.30 argz_create F
+GLIBC_2.30 argz_create_sep F
+GLIBC_2.30 argz_delete F
+GLIBC_2.30 argz_extract F
+GLIBC_2.30 argz_insert F
+GLIBC_2.30 argz_next F
+GLIBC_2.30 argz_replace F
+GLIBC_2.30 argz_stringify F
+GLIBC_2.30 asctime F
+GLIBC_2.30 asctime_r F
+GLIBC_2.30 asprintf F
+GLIBC_2.30 atof F
+GLIBC_2.30 atoi F
+GLIBC_2.30 atol F
+GLIBC_2.30 atoll F
+GLIBC_2.30 authdes_create F
+GLIBC_2.30 authdes_getucred F
+GLIBC_2.30 authdes_pk_create F
+GLIBC_2.30 authnone_create F
+GLIBC_2.30 authunix_create F
+GLIBC_2.30 authunix_create_default F
+GLIBC_2.30 backtrace F
+GLIBC_2.30 backtrace_symbols F
+GLIBC_2.30 backtrace_symbols_fd F
+GLIBC_2.30 basename F
+GLIBC_2.30 bcmp F
+GLIBC_2.30 bcopy F
+GLIBC_2.30 bind F
+GLIBC_2.30 bind_textdomain_codeset F
+GLIBC_2.30 bindresvport F
+GLIBC_2.30 bindtextdomain F
+GLIBC_2.30 brk F
+GLIBC_2.30 bsd_signal F
+GLIBC_2.30 bsearch F
+GLIBC_2.30 btowc F
+GLIBC_2.30 bzero F
+GLIBC_2.30 c16rtomb F
+GLIBC_2.30 c32rtomb F
+GLIBC_2.30 cacheflush F
+GLIBC_2.30 calloc F
+GLIBC_2.30 callrpc F
+GLIBC_2.30 canonicalize_file_name F
+GLIBC_2.30 capget F
+GLIBC_2.30 capset F
+GLIBC_2.30 catclose F
+GLIBC_2.30 catgets F
+GLIBC_2.30 catopen F
+GLIBC_2.30 cbc_crypt F
+GLIBC_2.30 cfgetispeed F
+GLIBC_2.30 cfgetospeed F
+GLIBC_2.30 cfmakeraw F
+GLIBC_2.30 cfsetispeed F
+GLIBC_2.30 cfsetospeed F
+GLIBC_2.30 cfsetspeed F
+GLIBC_2.30 chdir F
+GLIBC_2.30 chflags F
+GLIBC_2.30 chmod F
+GLIBC_2.30 chown F
+GLIBC_2.30 chroot F
+GLIBC_2.30 clearenv F
+GLIBC_2.30 clearerr F
+GLIBC_2.30 clearerr_unlocked F
+GLIBC_2.30 clnt_broadcast F
+GLIBC_2.30 clnt_create F
+GLIBC_2.30 clnt_pcreateerror F
+GLIBC_2.30 clnt_perrno F
+GLIBC_2.30 clnt_perror F
+GLIBC_2.30 clnt_spcreateerror F
+GLIBC_2.30 clnt_sperrno F
+GLIBC_2.30 clnt_sperror F
+GLIBC_2.30 clntraw_create F
+GLIBC_2.30 clnttcp_create F
+GLIBC_2.30 clntudp_bufcreate F
+GLIBC_2.30 clntudp_create F
+GLIBC_2.30 clntunix_create F
+GLIBC_2.30 clock F
+GLIBC_2.30 clock_adjtime F
+GLIBC_2.30 clock_getcpuclockid F
+GLIBC_2.30 clock_getres F
+GLIBC_2.30 clock_gettime F
+GLIBC_2.30 clock_nanosleep F
+GLIBC_2.30 clock_settime F
+GLIBC_2.30 clone F
+GLIBC_2.30 close F
+GLIBC_2.30 closedir F
+GLIBC_2.30 closelog F
+GLIBC_2.30 confstr F
+GLIBC_2.30 connect F
+GLIBC_2.30 copy_file_range F
+GLIBC_2.30 copysign F
+GLIBC_2.30 copysignf F
+GLIBC_2.30 copysignl F
+GLIBC_2.30 creat F
+GLIBC_2.30 creat64 F
+GLIBC_2.30 ctermid F
+GLIBC_2.30 ctime F
+GLIBC_2.30 ctime_r F
+GLIBC_2.30 cuserid F
+GLIBC_2.30 daemon F
+GLIBC_2.30 daylight D 0x4
+GLIBC_2.30 dcgettext F
+GLIBC_2.30 dcngettext F
+GLIBC_2.30 delete_module F
+GLIBC_2.30 des_setparity F
+GLIBC_2.30 dgettext F
+GLIBC_2.30 difftime F
+GLIBC_2.30 dirfd F
+GLIBC_2.30 dirname F
+GLIBC_2.30 div F
+GLIBC_2.30 dl_iterate_phdr F
+GLIBC_2.30 dngettext F
+GLIBC_2.30 dprintf F
+GLIBC_2.30 drand48 F
+GLIBC_2.30 drand48_r F
+GLIBC_2.30 dup F
+GLIBC_2.30 dup2 F
+GLIBC_2.30 dup3 F
+GLIBC_2.30 duplocale F
+GLIBC_2.30 dysize F
+GLIBC_2.30 eaccess F
+GLIBC_2.30 ecb_crypt F
+GLIBC_2.30 ecvt F
+GLIBC_2.30 ecvt_r F
+GLIBC_2.30 endaliasent F
+GLIBC_2.30 endfsent F
+GLIBC_2.30 endgrent F
+GLIBC_2.30 endhostent F
+GLIBC_2.30 endmntent F
+GLIBC_2.30 endnetent F
+GLIBC_2.30 endnetgrent F
+GLIBC_2.30 endprotoent F
+GLIBC_2.30 endpwent F
+GLIBC_2.30 endrpcent F
+GLIBC_2.30 endservent F
+GLIBC_2.30 endsgent F
+GLIBC_2.30 endspent F
+GLIBC_2.30 endttyent F
+GLIBC_2.30 endusershell F
+GLIBC_2.30 endutent F
+GLIBC_2.30 endutxent F
+GLIBC_2.30 environ D 0x4
+GLIBC_2.30 envz_add F
+GLIBC_2.30 envz_entry F
+GLIBC_2.30 envz_get F
+GLIBC_2.30 envz_merge F
+GLIBC_2.30 envz_remove F
+GLIBC_2.30 envz_strip F
+GLIBC_2.30 epoll_create F
+GLIBC_2.30 epoll_create1 F
+GLIBC_2.30 epoll_ctl F
+GLIBC_2.30 epoll_pwait F
+GLIBC_2.30 epoll_wait F
+GLIBC_2.30 erand48 F
+GLIBC_2.30 erand48_r F
+GLIBC_2.30 err F
+GLIBC_2.30 error F
+GLIBC_2.30 error_at_line F
+GLIBC_2.30 error_message_count D 0x4
+GLIBC_2.30 error_one_per_line D 0x4
+GLIBC_2.30 error_print_progname D 0x4
+GLIBC_2.30 errx F
+GLIBC_2.30 ether_aton F
+GLIBC_2.30 ether_aton_r F
+GLIBC_2.30 ether_hostton F
+GLIBC_2.30 ether_line F
+GLIBC_2.30 ether_ntoa F
+GLIBC_2.30 ether_ntoa_r F
+GLIBC_2.30 ether_ntohost F
+GLIBC_2.30 euidaccess F
+GLIBC_2.30 eventfd F
+GLIBC_2.30 eventfd_read F
+GLIBC_2.30 eventfd_write F
+GLIBC_2.30 execl F
+GLIBC_2.30 execle F
+GLIBC_2.30 execlp F
+GLIBC_2.30 execv F
+GLIBC_2.30 execve F
+GLIBC_2.30 execvp F
+GLIBC_2.30 execvpe F
+GLIBC_2.30 exit F
+GLIBC_2.30 explicit_bzero F
+GLIBC_2.30 faccessat F
+GLIBC_2.30 fallocate F
+GLIBC_2.30 fallocate64 F
+GLIBC_2.30 fanotify_init F
+GLIBC_2.30 fanotify_mark F
+GLIBC_2.30 fchdir F
+GLIBC_2.30 fchflags F
+GLIBC_2.30 fchmod F
+GLIBC_2.30 fchmodat F
+GLIBC_2.30 fchown F
+GLIBC_2.30 fchownat F
+GLIBC_2.30 fclose F
+GLIBC_2.30 fcloseall F
+GLIBC_2.30 fcntl F
+GLIBC_2.30 fcntl64 F
+GLIBC_2.30 fcvt F
+GLIBC_2.30 fcvt_r F
+GLIBC_2.30 fdatasync F
+GLIBC_2.30 fdopen F
+GLIBC_2.30 fdopendir F
+GLIBC_2.30 feof F
+GLIBC_2.30 feof_unlocked F
+GLIBC_2.30 ferror F
+GLIBC_2.30 ferror_unlocked F
+GLIBC_2.30 fexecve F
+GLIBC_2.30 fflush F
+GLIBC_2.30 fflush_unlocked F
+GLIBC_2.30 ffs F
+GLIBC_2.30 ffsl F
+GLIBC_2.30 ffsll F
+GLIBC_2.30 fgetc F
+GLIBC_2.30 fgetc_unlocked F
+GLIBC_2.30 fgetgrent F
+GLIBC_2.30 fgetgrent_r F
+GLIBC_2.30 fgetpos F
+GLIBC_2.30 fgetpos64 F
+GLIBC_2.30 fgetpwent F
+GLIBC_2.30 fgetpwent_r F
+GLIBC_2.30 fgets F
+GLIBC_2.30 fgets_unlocked F
+GLIBC_2.30 fgetsgent F
+GLIBC_2.30 fgetsgent_r F
+GLIBC_2.30 fgetspent F
+GLIBC_2.30 fgetspent_r F
+GLIBC_2.30 fgetwc F
+GLIBC_2.30 fgetwc_unlocked F
+GLIBC_2.30 fgetws F
+GLIBC_2.30 fgetws_unlocked F
+GLIBC_2.30 fgetxattr F
+GLIBC_2.30 fileno F
+GLIBC_2.30 fileno_unlocked F
+GLIBC_2.30 finite F
+GLIBC_2.30 finitef F
+GLIBC_2.30 finitel F
+GLIBC_2.30 flistxattr F
+GLIBC_2.30 flock F
+GLIBC_2.30 flockfile F
+GLIBC_2.30 fmemopen F
+GLIBC_2.30 fmtmsg F
+GLIBC_2.30 fnmatch F
+GLIBC_2.30 fopen F
+GLIBC_2.30 fopen64 F
+GLIBC_2.30 fopencookie F
+GLIBC_2.30 fork F
+GLIBC_2.30 fpathconf F
+GLIBC_2.30 fprintf F
+GLIBC_2.30 fputc F
+GLIBC_2.30 fputc_unlocked F
+GLIBC_2.30 fputs F
+GLIBC_2.30 fputs_unlocked F
+GLIBC_2.30 fputwc F
+GLIBC_2.30 fputwc_unlocked F
+GLIBC_2.30 fputws F
+GLIBC_2.30 fputws_unlocked F
+GLIBC_2.30 fread F
+GLIBC_2.30 fread_unlocked F
+GLIBC_2.30 free F
+GLIBC_2.30 freeaddrinfo F
+GLIBC_2.30 freeifaddrs F
+GLIBC_2.30 freelocale F
+GLIBC_2.30 fremovexattr F
+GLIBC_2.30 freopen F
+GLIBC_2.30 freopen64 F
+GLIBC_2.30 frexp F
+GLIBC_2.30 frexpf F
+GLIBC_2.30 frexpl F
+GLIBC_2.30 fscanf F
+GLIBC_2.30 fseek F
+GLIBC_2.30 fseeko F
+GLIBC_2.30 fseeko64 F
+GLIBC_2.30 fsetpos F
+GLIBC_2.30 fsetpos64 F
+GLIBC_2.30 fsetxattr F
+GLIBC_2.30 fstatfs F
+GLIBC_2.30 fstatfs64 F
+GLIBC_2.30 fstatvfs F
+GLIBC_2.30 fstatvfs64 F
+GLIBC_2.30 fsync F
+GLIBC_2.30 ftell F
+GLIBC_2.30 ftello F
+GLIBC_2.30 ftello64 F
+GLIBC_2.30 ftime F
+GLIBC_2.30 ftok F
+GLIBC_2.30 ftruncate F
+GLIBC_2.30 ftruncate64 F
+GLIBC_2.30 ftrylockfile F
+GLIBC_2.30 fts64_children F
+GLIBC_2.30 fts64_close F
+GLIBC_2.30 fts64_open F
+GLIBC_2.30 fts64_read F
+GLIBC_2.30 fts64_set F
+GLIBC_2.30 fts_children F
+GLIBC_2.30 fts_close F
+GLIBC_2.30 fts_open F
+GLIBC_2.30 fts_read F
+GLIBC_2.30 fts_set F
+GLIBC_2.30 ftw F
+GLIBC_2.30 ftw64 F
+GLIBC_2.30 funlockfile F
+GLIBC_2.30 futimens F
+GLIBC_2.30 futimes F
+GLIBC_2.30 futimesat F
+GLIBC_2.30 fwide F
+GLIBC_2.30 fwprintf F
+GLIBC_2.30 fwrite F
+GLIBC_2.30 fwrite_unlocked F
+GLIBC_2.30 fwscanf F
+GLIBC_2.30 gai_strerror F
+GLIBC_2.30 gcvt F
+GLIBC_2.30 get_avphys_pages F
+GLIBC_2.30 get_current_dir_name F
+GLIBC_2.30 get_myaddress F
+GLIBC_2.30 get_nprocs F
+GLIBC_2.30 get_nprocs_conf F
+GLIBC_2.30 get_phys_pages F
+GLIBC_2.30 getaddrinfo F
+GLIBC_2.30 getaliasbyname F
+GLIBC_2.30 getaliasbyname_r F
+GLIBC_2.30 getaliasent F
+GLIBC_2.30 getaliasent_r F
+GLIBC_2.30 getauxval F
+GLIBC_2.30 getc F
+GLIBC_2.30 getc_unlocked F
+GLIBC_2.30 getchar F
+GLIBC_2.30 getchar_unlocked F
+GLIBC_2.30 getcontext F
+GLIBC_2.30 getcpu F
+GLIBC_2.30 getcwd F
+GLIBC_2.30 getdate F
+GLIBC_2.30 getdate_err D 0x4
+GLIBC_2.30 getdate_r F
+GLIBC_2.30 getdelim F
+GLIBC_2.30 getdirentries F
+GLIBC_2.30 getdirentries64 F
+GLIBC_2.30 getdomainname F
+GLIBC_2.30 getdtablesize F
+GLIBC_2.30 getegid F
+GLIBC_2.30 getentropy F
+GLIBC_2.30 getenv F
+GLIBC_2.30 geteuid F
+GLIBC_2.30 getfsent F
+GLIBC_2.30 getfsfile F
+GLIBC_2.30 getfsspec F
+GLIBC_2.30 getgid F
+GLIBC_2.30 getgrent F
+GLIBC_2.30 getgrent_r F
+GLIBC_2.30 getgrgid F
+GLIBC_2.30 getgrgid_r F
+GLIBC_2.30 getgrnam F
+GLIBC_2.30 getgrnam_r F
+GLIBC_2.30 getgrouplist F
+GLIBC_2.30 getgroups F
+GLIBC_2.30 gethostbyaddr F
+GLIBC_2.30 gethostbyaddr_r F
+GLIBC_2.30 gethostbyname F
+GLIBC_2.30 gethostbyname2 F
+GLIBC_2.30 gethostbyname2_r F
+GLIBC_2.30 gethostbyname_r F
+GLIBC_2.30 gethostent F
+GLIBC_2.30 gethostent_r F
+GLIBC_2.30 gethostid F
+GLIBC_2.30 gethostname F
+GLIBC_2.30 getifaddrs F
+GLIBC_2.30 getipv4sourcefilter F
+GLIBC_2.30 getitimer F
+GLIBC_2.30 getline F
+GLIBC_2.30 getloadavg F
+GLIBC_2.30 getlogin F
+GLIBC_2.30 getlogin_r F
+GLIBC_2.30 getmntent F
+GLIBC_2.30 getmntent_r F
+GLIBC_2.30 getnameinfo F
+GLIBC_2.30 getnetbyaddr F
+GLIBC_2.30 getnetbyaddr_r F
+GLIBC_2.30 getnetbyname F
+GLIBC_2.30 getnetbyname_r F
+GLIBC_2.30 getnetent F
+GLIBC_2.30 getnetent_r F
+GLIBC_2.30 getnetgrent F
+GLIBC_2.30 getnetgrent_r F
+GLIBC_2.30 getnetname F
+GLIBC_2.30 getopt F
+GLIBC_2.30 getopt_long F
+GLIBC_2.30 getopt_long_only F
+GLIBC_2.30 getpagesize F
+GLIBC_2.30 getpass F
+GLIBC_2.30 getpeername F
+GLIBC_2.30 getpgid F
+GLIBC_2.30 getpgrp F
+GLIBC_2.30 getpid F
+GLIBC_2.30 getppid F
+GLIBC_2.30 getpriority F
+GLIBC_2.30 getprotobyname F
+GLIBC_2.30 getprotobyname_r F
+GLIBC_2.30 getprotobynumber F
+GLIBC_2.30 getprotobynumber_r F
+GLIBC_2.30 getprotoent F
+GLIBC_2.30 getprotoent_r F
+GLIBC_2.30 getpt F
+GLIBC_2.30 getpublickey F
+GLIBC_2.30 getpw F
+GLIBC_2.30 getpwent F
+GLIBC_2.30 getpwent_r F
+GLIBC_2.30 getpwnam F
+GLIBC_2.30 getpwnam_r F
+GLIBC_2.30 getpwuid F
+GLIBC_2.30 getpwuid_r F
+GLIBC_2.30 getrandom F
+GLIBC_2.30 getresgid F
+GLIBC_2.30 getresuid F
+GLIBC_2.30 getrlimit F
+GLIBC_2.30 getrlimit64 F
+GLIBC_2.30 getrpcbyname F
+GLIBC_2.30 getrpcbyname_r F
+GLIBC_2.30 getrpcbynumber F
+GLIBC_2.30 getrpcbynumber_r F
+GLIBC_2.30 getrpcent F
+GLIBC_2.30 getrpcent_r F
+GLIBC_2.30 getrpcport F
+GLIBC_2.30 getrusage F
+GLIBC_2.30 gets F
+GLIBC_2.30 getsecretkey F
+GLIBC_2.30 getservbyname F
+GLIBC_2.30 getservbyname_r F
+GLIBC_2.30 getservbyport F
+GLIBC_2.30 getservbyport_r F
+GLIBC_2.30 getservent F
+GLIBC_2.30 getservent_r F
+GLIBC_2.30 getsgent F
+GLIBC_2.30 getsgent_r F
+GLIBC_2.30 getsgnam F
+GLIBC_2.30 getsgnam_r F
+GLIBC_2.30 getsid F
+GLIBC_2.30 getsockname F
+GLIBC_2.30 getsockopt F
+GLIBC_2.30 getsourcefilter F
+GLIBC_2.30 getspent F
+GLIBC_2.30 getspent_r F
+GLIBC_2.30 getspnam F
+GLIBC_2.30 getspnam_r F
+GLIBC_2.30 getsubopt F
+GLIBC_2.30 gettext F
+GLIBC_2.30 gettid F
+GLIBC_2.30 gettimeofday F
+GLIBC_2.30 getttyent F
+GLIBC_2.30 getttynam F
+GLIBC_2.30 getuid F
+GLIBC_2.30 getusershell F
+GLIBC_2.30 getutent F
+GLIBC_2.30 getutent_r F
+GLIBC_2.30 getutid F
+GLIBC_2.30 getutid_r F
+GLIBC_2.30 getutline F
+GLIBC_2.30 getutline_r F
+GLIBC_2.30 getutmp F
+GLIBC_2.30 getutmpx F
+GLIBC_2.30 getutxent F
+GLIBC_2.30 getutxid F
+GLIBC_2.30 getutxline F
+GLIBC_2.30 getw F
+GLIBC_2.30 getwc F
+GLIBC_2.30 getwc_unlocked F
+GLIBC_2.30 getwchar F
+GLIBC_2.30 getwchar_unlocked F
+GLIBC_2.30 getwd F
+GLIBC_2.30 getxattr F
+GLIBC_2.30 glob F
+GLIBC_2.30 glob64 F
+GLIBC_2.30 glob_pattern_p F
+GLIBC_2.30 globfree F
+GLIBC_2.30 globfree64 F
+GLIBC_2.30 gmtime F
+GLIBC_2.30 gmtime_r F
+GLIBC_2.30 gnu_dev_major F
+GLIBC_2.30 gnu_dev_makedev F
+GLIBC_2.30 gnu_dev_minor F
+GLIBC_2.30 gnu_get_libc_release F
+GLIBC_2.30 gnu_get_libc_version F
+GLIBC_2.30 grantpt F
+GLIBC_2.30 group_member F
+GLIBC_2.30 gsignal F
+GLIBC_2.30 gtty F
+GLIBC_2.30 h_errlist D 0x14
+GLIBC_2.30 h_nerr D 0x4
+GLIBC_2.30 hasmntopt F
+GLIBC_2.30 hcreate F
+GLIBC_2.30 hcreate_r F
+GLIBC_2.30 hdestroy F
+GLIBC_2.30 hdestroy_r F
+GLIBC_2.30 herror F
+GLIBC_2.30 host2netname F
+GLIBC_2.30 hsearch F
+GLIBC_2.30 hsearch_r F
+GLIBC_2.30 hstrerror F
+GLIBC_2.30 htonl F
+GLIBC_2.30 htons F
+GLIBC_2.30 iconv F
+GLIBC_2.30 iconv_close F
+GLIBC_2.30 iconv_open F
+GLIBC_2.30 if_freenameindex F
+GLIBC_2.30 if_indextoname F
+GLIBC_2.30 if_nameindex F
+GLIBC_2.30 if_nametoindex F
+GLIBC_2.30 imaxabs F
+GLIBC_2.30 imaxdiv F
+GLIBC_2.30 in6addr_any D 0x10
+GLIBC_2.30 in6addr_loopback D 0x10
+GLIBC_2.30 index F
+GLIBC_2.30 inet6_opt_append F
+GLIBC_2.30 inet6_opt_find F
+GLIBC_2.30 inet6_opt_finish F
+GLIBC_2.30 inet6_opt_get_val F
+GLIBC_2.30 inet6_opt_init F
+GLIBC_2.30 inet6_opt_next F
+GLIBC_2.30 inet6_opt_set_val F
+GLIBC_2.30 inet6_option_alloc F
+GLIBC_2.30 inet6_option_append F
+GLIBC_2.30 inet6_option_find F
+GLIBC_2.30 inet6_option_init F
+GLIBC_2.30 inet6_option_next F
+GLIBC_2.30 inet6_option_space F
+GLIBC_2.30 inet6_rth_add F
+GLIBC_2.30 inet6_rth_getaddr F
+GLIBC_2.30 inet6_rth_init F
+GLIBC_2.30 inet6_rth_reverse F
+GLIBC_2.30 inet6_rth_segments F
+GLIBC_2.30 inet6_rth_space F
+GLIBC_2.30 inet_addr F
+GLIBC_2.30 inet_aton F
+GLIBC_2.30 inet_lnaof F
+GLIBC_2.30 inet_makeaddr F
+GLIBC_2.30 inet_netof F
+GLIBC_2.30 inet_network F
+GLIBC_2.30 inet_nsap_addr F
+GLIBC_2.30 inet_nsap_ntoa F
+GLIBC_2.30 inet_ntoa F
+GLIBC_2.30 inet_ntop F
+GLIBC_2.30 inet_pton F
+GLIBC_2.30 init_module F
+GLIBC_2.30 initgroups F
+GLIBC_2.30 initstate F
+GLIBC_2.30 initstate_r F
+GLIBC_2.30 innetgr F
+GLIBC_2.30 inotify_add_watch F
+GLIBC_2.30 inotify_init F
+GLIBC_2.30 inotify_init1 F
+GLIBC_2.30 inotify_rm_watch F
+GLIBC_2.30 insque F
+GLIBC_2.30 ioctl F
+GLIBC_2.30 iruserok F
+GLIBC_2.30 iruserok_af F
+GLIBC_2.30 isalnum F
+GLIBC_2.30 isalnum_l F
+GLIBC_2.30 isalpha F
+GLIBC_2.30 isalpha_l F
+GLIBC_2.30 isascii F
+GLIBC_2.30 isatty F
+GLIBC_2.30 isblank F
+GLIBC_2.30 isblank_l F
+GLIBC_2.30 iscntrl F
+GLIBC_2.30 iscntrl_l F
+GLIBC_2.30 isctype F
+GLIBC_2.30 isdigit F
+GLIBC_2.30 isdigit_l F
+GLIBC_2.30 isfdtype F
+GLIBC_2.30 isgraph F
+GLIBC_2.30 isgraph_l F
+GLIBC_2.30 isinf F
+GLIBC_2.30 isinff F
+GLIBC_2.30 isinfl F
+GLIBC_2.30 islower F
+GLIBC_2.30 islower_l F
+GLIBC_2.30 isnan F
+GLIBC_2.30 isnanf F
+GLIBC_2.30 isnanl F
+GLIBC_2.30 isprint F
+GLIBC_2.30 isprint_l F
+GLIBC_2.30 ispunct F
+GLIBC_2.30 ispunct_l F
+GLIBC_2.30 isspace F
+GLIBC_2.30 isspace_l F
+GLIBC_2.30 isupper F
+GLIBC_2.30 isupper_l F
+GLIBC_2.30 iswalnum F
+GLIBC_2.30 iswalnum_l F
+GLIBC_2.30 iswalpha F
+GLIBC_2.30 iswalpha_l F
+GLIBC_2.30 iswblank F
+GLIBC_2.30 iswblank_l F
+GLIBC_2.30 iswcntrl F
+GLIBC_2.30 iswcntrl_l F
+GLIBC_2.30 iswctype F
+GLIBC_2.30 iswctype_l F
+GLIBC_2.30 iswdigit F
+GLIBC_2.30 iswdigit_l F
+GLIBC_2.30 iswgraph F
+GLIBC_2.30 iswgraph_l F
+GLIBC_2.30 iswlower F
+GLIBC_2.30 iswlower_l F
+GLIBC_2.30 iswprint F
+GLIBC_2.30 iswprint_l F
+GLIBC_2.30 iswpunct F
+GLIBC_2.30 iswpunct_l F
+GLIBC_2.30 iswspace F
+GLIBC_2.30 iswspace_l F
+GLIBC_2.30 iswupper F
+GLIBC_2.30 iswupper_l F
+GLIBC_2.30 iswxdigit F
+GLIBC_2.30 iswxdigit_l F
+GLIBC_2.30 isxdigit F
+GLIBC_2.30 isxdigit_l F
+GLIBC_2.30 jrand48 F
+GLIBC_2.30 jrand48_r F
+GLIBC_2.30 key_decryptsession F
+GLIBC_2.30 key_decryptsession_pk F
+GLIBC_2.30 key_encryptsession F
+GLIBC_2.30 key_encryptsession_pk F
+GLIBC_2.30 key_gendes F
+GLIBC_2.30 key_get_conv F
+GLIBC_2.30 key_secretkey_is_set F
+GLIBC_2.30 key_setnet F
+GLIBC_2.30 key_setsecret F
+GLIBC_2.30 kill F
+GLIBC_2.30 killpg F
+GLIBC_2.30 klogctl F
+GLIBC_2.30 l64a F
+GLIBC_2.30 labs F
+GLIBC_2.30 lchmod F
+GLIBC_2.30 lchown F
+GLIBC_2.30 lckpwdf F
+GLIBC_2.30 lcong48 F
+GLIBC_2.30 lcong48_r F
+GLIBC_2.30 ldexp F
+GLIBC_2.30 ldexpf F
+GLIBC_2.30 ldexpl F
+GLIBC_2.30 ldiv F
+GLIBC_2.30 lfind F
+GLIBC_2.30 lgetxattr F
+GLIBC_2.30 link F
+GLIBC_2.30 linkat F
+GLIBC_2.30 listen F
+GLIBC_2.30 listxattr F
+GLIBC_2.30 llabs F
+GLIBC_2.30 lldiv F
+GLIBC_2.30 llistxattr F
+GLIBC_2.30 localeconv F
+GLIBC_2.30 localtime F
+GLIBC_2.30 localtime_r F
+GLIBC_2.30 lockf F
+GLIBC_2.30 lockf64 F
+GLIBC_2.30 longjmp F
+GLIBC_2.30 lrand48 F
+GLIBC_2.30 lrand48_r F
+GLIBC_2.30 lremovexattr F
+GLIBC_2.30 lsearch F
+GLIBC_2.30 lseek F
+GLIBC_2.30 lseek64 F
+GLIBC_2.30 lsetxattr F
+GLIBC_2.30 lutimes F
+GLIBC_2.30 madvise F
+GLIBC_2.30 makecontext F
+GLIBC_2.30 mallinfo F
+GLIBC_2.30 malloc F
+GLIBC_2.30 malloc_info F
+GLIBC_2.30 malloc_stats F
+GLIBC_2.30 malloc_trim F
+GLIBC_2.30 malloc_usable_size F
+GLIBC_2.30 mallopt F
+GLIBC_2.30 mallwatch D 0x4
+GLIBC_2.30 mblen F
+GLIBC_2.30 mbrlen F
+GLIBC_2.30 mbrtoc16 F
+GLIBC_2.30 mbrtoc32 F
+GLIBC_2.30 mbrtowc F
+GLIBC_2.30 mbsinit F
+GLIBC_2.30 mbsnrtowcs F
+GLIBC_2.30 mbsrtowcs F
+GLIBC_2.30 mbstowcs F
+GLIBC_2.30 mbtowc F
+GLIBC_2.30 mcheck F
+GLIBC_2.30 mcheck_check_all F
+GLIBC_2.30 mcheck_pedantic F
+GLIBC_2.30 memalign F
+GLIBC_2.30 memccpy F
+GLIBC_2.30 memchr F
+GLIBC_2.30 memcmp F
+GLIBC_2.30 memcpy F
+GLIBC_2.30 memfd_create F
+GLIBC_2.30 memfrob F
+GLIBC_2.30 memmem F
+GLIBC_2.30 memmove F
+GLIBC_2.30 mempcpy F
+GLIBC_2.30 memrchr F
+GLIBC_2.30 memset F
+GLIBC_2.30 mincore F
+GLIBC_2.30 mkdir F
+GLIBC_2.30 mkdirat F
+GLIBC_2.30 mkdtemp F
+GLIBC_2.30 mkfifo F
+GLIBC_2.30 mkfifoat F
+GLIBC_2.30 mkostemp F
+GLIBC_2.30 mkostemp64 F
+GLIBC_2.30 mkostemps F
+GLIBC_2.30 mkostemps64 F
+GLIBC_2.30 mkstemp F
+GLIBC_2.30 mkstemp64 F
+GLIBC_2.30 mkstemps F
+GLIBC_2.30 mkstemps64 F
+GLIBC_2.30 mktemp F
+GLIBC_2.30 mktime F
+GLIBC_2.30 mlock F
+GLIBC_2.30 mlock2 F
+GLIBC_2.30 mlockall F
+GLIBC_2.30 mmap F
+GLIBC_2.30 mmap64 F
+GLIBC_2.30 modf F
+GLIBC_2.30 modff F
+GLIBC_2.30 modfl F
+GLIBC_2.30 moncontrol F
+GLIBC_2.30 monstartup F
+GLIBC_2.30 mount F
+GLIBC_2.30 mprobe F
+GLIBC_2.30 mprotect F
+GLIBC_2.30 mrand48 F
+GLIBC_2.30 mrand48_r F
+GLIBC_2.30 mremap F
+GLIBC_2.30 msgctl F
+GLIBC_2.30 msgget F
+GLIBC_2.30 msgrcv F
+GLIBC_2.30 msgsnd F
+GLIBC_2.30 msync F
+GLIBC_2.30 mtrace F
+GLIBC_2.30 munlock F
+GLIBC_2.30 munlockall F
+GLIBC_2.30 munmap F
+GLIBC_2.30 muntrace F
+GLIBC_2.30 name_to_handle_at F
+GLIBC_2.30 nanosleep F
+GLIBC_2.30 netname2host F
+GLIBC_2.30 netname2user F
+GLIBC_2.30 newlocale F
+GLIBC_2.30 nftw F
+GLIBC_2.30 nftw64 F
+GLIBC_2.30 ngettext F
+GLIBC_2.30 nice F
+GLIBC_2.30 nl_langinfo F
+GLIBC_2.30 nl_langinfo_l F
+GLIBC_2.30 nrand48 F
+GLIBC_2.30 nrand48_r F
+GLIBC_2.30 ntohl F
+GLIBC_2.30 ntohs F
+GLIBC_2.30 ntp_adjtime F
+GLIBC_2.30 ntp_gettime F
+GLIBC_2.30 ntp_gettimex F
+GLIBC_2.30 obstack_alloc_failed_handler D 0x4
+GLIBC_2.30 obstack_exit_failure D 0x4
+GLIBC_2.30 obstack_free F
+GLIBC_2.30 obstack_printf F
+GLIBC_2.30 obstack_vprintf F
+GLIBC_2.30 on_exit F
+GLIBC_2.30 open F
+GLIBC_2.30 open64 F
+GLIBC_2.30 open_by_handle_at F
+GLIBC_2.30 open_memstream F
+GLIBC_2.30 open_wmemstream F
+GLIBC_2.30 openat F
+GLIBC_2.30 openat64 F
+GLIBC_2.30 opendir F
+GLIBC_2.30 openlog F
+GLIBC_2.30 optarg D 0x4
+GLIBC_2.30 opterr D 0x4
+GLIBC_2.30 optind D 0x4
+GLIBC_2.30 optopt D 0x4
+GLIBC_2.30 parse_printf_format F
+GLIBC_2.30 passwd2des F
+GLIBC_2.30 pathconf F
+GLIBC_2.30 pause F
+GLIBC_2.30 pclose F
+GLIBC_2.30 perror F
+GLIBC_2.30 personality F
+GLIBC_2.30 pipe F
+GLIBC_2.30 pipe2 F
+GLIBC_2.30 pivot_root F
+GLIBC_2.30 pkey_alloc F
+GLIBC_2.30 pkey_free F
+GLIBC_2.30 pkey_get F
+GLIBC_2.30 pkey_mprotect F
+GLIBC_2.30 pkey_set F
+GLIBC_2.30 pmap_getmaps F
+GLIBC_2.30 pmap_getport F
+GLIBC_2.30 pmap_rmtcall F
+GLIBC_2.30 pmap_set F
+GLIBC_2.30 pmap_unset F
+GLIBC_2.30 poll F
+GLIBC_2.30 popen F
+GLIBC_2.30 posix_fadvise F
+GLIBC_2.30 posix_fadvise64 F
+GLIBC_2.30 posix_fallocate F
+GLIBC_2.30 posix_fallocate64 F
+GLIBC_2.30 posix_madvise F
+GLIBC_2.30 posix_memalign F
+GLIBC_2.30 posix_openpt F
+GLIBC_2.30 posix_spawn F
+GLIBC_2.30 posix_spawn_file_actions_addchdir_np F
+GLIBC_2.30 posix_spawn_file_actions_addclose F
+GLIBC_2.30 posix_spawn_file_actions_adddup2 F
+GLIBC_2.30 posix_spawn_file_actions_addfchdir_np F
+GLIBC_2.30 posix_spawn_file_actions_addopen F
+GLIBC_2.30 posix_spawn_file_actions_destroy F
+GLIBC_2.30 posix_spawn_file_actions_init F
+GLIBC_2.30 posix_spawnattr_destroy F
+GLIBC_2.30 posix_spawnattr_getflags F
+GLIBC_2.30 posix_spawnattr_getpgroup F
+GLIBC_2.30 posix_spawnattr_getschedparam F
+GLIBC_2.30 posix_spawnattr_getschedpolicy F
+GLIBC_2.30 posix_spawnattr_getsigdefault F
+GLIBC_2.30 posix_spawnattr_getsigmask F
+GLIBC_2.30 posix_spawnattr_init F
+GLIBC_2.30 posix_spawnattr_setflags F
+GLIBC_2.30 posix_spawnattr_setpgroup F
+GLIBC_2.30 posix_spawnattr_setschedparam F
+GLIBC_2.30 posix_spawnattr_setschedpolicy F
+GLIBC_2.30 posix_spawnattr_setsigdefault F
+GLIBC_2.30 posix_spawnattr_setsigmask F
+GLIBC_2.30 posix_spawnp F
+GLIBC_2.30 ppoll F
+GLIBC_2.30 prctl F
+GLIBC_2.30 pread F
+GLIBC_2.30 pread64 F
+GLIBC_2.30 preadv F
+GLIBC_2.30 preadv2 F
+GLIBC_2.30 preadv64 F
+GLIBC_2.30 preadv64v2 F
+GLIBC_2.30 printf F
+GLIBC_2.30 printf_size F
+GLIBC_2.30 printf_size_info F
+GLIBC_2.30 prlimit F
+GLIBC_2.30 prlimit64 F
+GLIBC_2.30 process_vm_readv F
+GLIBC_2.30 process_vm_writev F
+GLIBC_2.30 profil F
+GLIBC_2.30 program_invocation_name D 0x4
+GLIBC_2.30 program_invocation_short_name D 0x4
+GLIBC_2.30 pselect F
+GLIBC_2.30 psiginfo F
+GLIBC_2.30 psignal F
+GLIBC_2.30 pthread_attr_destroy F
+GLIBC_2.30 pthread_attr_getdetachstate F
+GLIBC_2.30 pthread_attr_getinheritsched F
+GLIBC_2.30 pthread_attr_getschedparam F
+GLIBC_2.30 pthread_attr_getschedpolicy F
+GLIBC_2.30 pthread_attr_getscope F
+GLIBC_2.30 pthread_attr_init F
+GLIBC_2.30 pthread_attr_setdetachstate F
+GLIBC_2.30 pthread_attr_setinheritsched F
+GLIBC_2.30 pthread_attr_setschedparam F
+GLIBC_2.30 pthread_attr_setschedpolicy F
+GLIBC_2.30 pthread_attr_setscope F
+GLIBC_2.30 pthread_cond_broadcast F
+GLIBC_2.30 pthread_cond_destroy F
+GLIBC_2.30 pthread_cond_init F
+GLIBC_2.30 pthread_cond_signal F
+GLIBC_2.30 pthread_cond_timedwait F
+GLIBC_2.30 pthread_cond_wait F
+GLIBC_2.30 pthread_condattr_destroy F
+GLIBC_2.30 pthread_condattr_init F
+GLIBC_2.30 pthread_equal F
+GLIBC_2.30 pthread_exit F
+GLIBC_2.30 pthread_getschedparam F
+GLIBC_2.30 pthread_mutex_destroy F
+GLIBC_2.30 pthread_mutex_init F
+GLIBC_2.30 pthread_mutex_lock F
+GLIBC_2.30 pthread_mutex_unlock F
+GLIBC_2.30 pthread_self F
+GLIBC_2.30 pthread_setcancelstate F
+GLIBC_2.30 pthread_setcanceltype F
+GLIBC_2.30 pthread_setschedparam F
+GLIBC_2.30 ptrace F
+GLIBC_2.30 ptsname F
+GLIBC_2.30 ptsname_r F
+GLIBC_2.30 putc F
+GLIBC_2.30 putc_unlocked F
+GLIBC_2.30 putchar F
+GLIBC_2.30 putchar_unlocked F
+GLIBC_2.30 putenv F
+GLIBC_2.30 putgrent F
+GLIBC_2.30 putpwent F
+GLIBC_2.30 puts F
+GLIBC_2.30 putsgent F
+GLIBC_2.30 putspent F
+GLIBC_2.30 pututline F
+GLIBC_2.30 pututxline F
+GLIBC_2.30 putw F
+GLIBC_2.30 putwc F
+GLIBC_2.30 putwc_unlocked F
+GLIBC_2.30 putwchar F
+GLIBC_2.30 putwchar_unlocked F
+GLIBC_2.30 pvalloc F
+GLIBC_2.30 pwrite F
+GLIBC_2.30 pwrite64 F
+GLIBC_2.30 pwritev F
+GLIBC_2.30 pwritev2 F
+GLIBC_2.30 pwritev64 F
+GLIBC_2.30 pwritev64v2 F
+GLIBC_2.30 qecvt F
+GLIBC_2.30 qecvt_r F
+GLIBC_2.30 qfcvt F
+GLIBC_2.30 qfcvt_r F
+GLIBC_2.30 qgcvt F
+GLIBC_2.30 qsort F
+GLIBC_2.30 qsort_r F
+GLIBC_2.30 quick_exit F
+GLIBC_2.30 quotactl F
+GLIBC_2.30 raise F
+GLIBC_2.30 rand F
+GLIBC_2.30 rand_r F
+GLIBC_2.30 random F
+GLIBC_2.30 random_r F
+GLIBC_2.30 rawmemchr F
+GLIBC_2.30 rcmd F
+GLIBC_2.30 rcmd_af F
+GLIBC_2.30 re_comp F
+GLIBC_2.30 re_compile_fastmap F
+GLIBC_2.30 re_compile_pattern F
+GLIBC_2.30 re_exec F
+GLIBC_2.30 re_match F
+GLIBC_2.30 re_match_2 F
+GLIBC_2.30 re_search F
+GLIBC_2.30 re_search_2 F
+GLIBC_2.30 re_set_registers F
+GLIBC_2.30 re_set_syntax F
+GLIBC_2.30 re_syntax_options D 0x4
+GLIBC_2.30 read F
+GLIBC_2.30 readahead F
+GLIBC_2.30 readdir F
+GLIBC_2.30 readdir64 F
+GLIBC_2.30 readdir64_r F
+GLIBC_2.30 readdir_r F
+GLIBC_2.30 readlink F
+GLIBC_2.30 readlinkat F
+GLIBC_2.30 readv F
+GLIBC_2.30 realloc F
+GLIBC_2.30 reallocarray F
+GLIBC_2.30 realpath F
+GLIBC_2.30 reboot F
+GLIBC_2.30 recv F
+GLIBC_2.30 recvfrom F
+GLIBC_2.30 recvmmsg F
+GLIBC_2.30 recvmsg F
+GLIBC_2.30 regcomp F
+GLIBC_2.30 regerror F
+GLIBC_2.30 regexec F
+GLIBC_2.30 regfree F
+GLIBC_2.30 register_printf_function F
+GLIBC_2.30 register_printf_modifier F
+GLIBC_2.30 register_printf_specifier F
+GLIBC_2.30 register_printf_type F
+GLIBC_2.30 registerrpc F
+GLIBC_2.30 remap_file_pages F
+GLIBC_2.30 remove F
+GLIBC_2.30 removexattr F
+GLIBC_2.30 remque F
+GLIBC_2.30 rename F
+GLIBC_2.30 renameat F
+GLIBC_2.30 renameat2 F
+GLIBC_2.30 revoke F
+GLIBC_2.30 rewind F
+GLIBC_2.30 rewinddir F
+GLIBC_2.30 rexec F
+GLIBC_2.30 rexec_af F
+GLIBC_2.30 rexecoptions D 0x4
+GLIBC_2.30 rindex F
+GLIBC_2.30 rmdir F
+GLIBC_2.30 rpc_createerr D 0x10
+GLIBC_2.30 rpmatch F
+GLIBC_2.30 rresvport F
+GLIBC_2.30 rresvport_af F
+GLIBC_2.30 rtime F
+GLIBC_2.30 ruserok F
+GLIBC_2.30 ruserok_af F
+GLIBC_2.30 ruserpass F
+GLIBC_2.30 sbrk F
+GLIBC_2.30 scalbn F
+GLIBC_2.30 scalbnf F
+GLIBC_2.30 scalbnl F
+GLIBC_2.30 scandir F
+GLIBC_2.30 scandir64 F
+GLIBC_2.30 scandirat F
+GLIBC_2.30 scandirat64 F
+GLIBC_2.30 scanf F
+GLIBC_2.30 sched_get_priority_max F
+GLIBC_2.30 sched_get_priority_min F
+GLIBC_2.30 sched_getaffinity F
+GLIBC_2.30 sched_getcpu F
+GLIBC_2.30 sched_getparam F
+GLIBC_2.30 sched_getscheduler F
+GLIBC_2.30 sched_rr_get_interval F
+GLIBC_2.30 sched_setaffinity F
+GLIBC_2.30 sched_setparam F
+GLIBC_2.30 sched_setscheduler F
+GLIBC_2.30 sched_yield F
+GLIBC_2.30 secure_getenv F
+GLIBC_2.30 seed48 F
+GLIBC_2.30 seed48_r F
+GLIBC_2.30 seekdir F
+GLIBC_2.30 select F
+GLIBC_2.30 semctl F
+GLIBC_2.30 semget F
+GLIBC_2.30 semop F
+GLIBC_2.30 semtimedop F
+GLIBC_2.30 send F
+GLIBC_2.30 sendfile F
+GLIBC_2.30 sendfile64 F
+GLIBC_2.30 sendmmsg F
+GLIBC_2.30 sendmsg F
+GLIBC_2.30 sendto F
+GLIBC_2.30 setaliasent F
+GLIBC_2.30 setbuf F
+GLIBC_2.30 setbuffer F
+GLIBC_2.30 setcontext F
+GLIBC_2.30 setdomainname F
+GLIBC_2.30 setegid F
+GLIBC_2.30 setenv F
+GLIBC_2.30 seteuid F
+GLIBC_2.30 setfsent F
+GLIBC_2.30 setfsgid F
+GLIBC_2.30 setfsuid F
+GLIBC_2.30 setgid F
+GLIBC_2.30 setgrent F
+GLIBC_2.30 setgroups F
+GLIBC_2.30 sethostent F
+GLIBC_2.30 sethostid F
+GLIBC_2.30 sethostname F
+GLIBC_2.30 setipv4sourcefilter F
+GLIBC_2.30 setitimer F
+GLIBC_2.30 setjmp F
+GLIBC_2.30 setlinebuf F
+GLIBC_2.30 setlocale F
+GLIBC_2.30 setlogin F
+GLIBC_2.30 setlogmask F
+GLIBC_2.30 setmntent F
+GLIBC_2.30 setnetent F
+GLIBC_2.30 setnetgrent F
+GLIBC_2.30 setns F
+GLIBC_2.30 setpgid F
+GLIBC_2.30 setpgrp F
+GLIBC_2.30 setpriority F
+GLIBC_2.30 setprotoent F
+GLIBC_2.30 setpwent F
+GLIBC_2.30 setregid F
+GLIBC_2.30 setresgid F
+GLIBC_2.30 setresuid F
+GLIBC_2.30 setreuid F
+GLIBC_2.30 setrlimit F
+GLIBC_2.30 setrlimit64 F
+GLIBC_2.30 setrpcent F
+GLIBC_2.30 setservent F
+GLIBC_2.30 setsgent F
+GLIBC_2.30 setsid F
+GLIBC_2.30 setsockopt F
+GLIBC_2.30 setsourcefilter F
+GLIBC_2.30 setspent F
+GLIBC_2.30 setstate F
+GLIBC_2.30 setstate_r F
+GLIBC_2.30 settimeofday F
+GLIBC_2.30 setttyent F
+GLIBC_2.30 setuid F
+GLIBC_2.30 setusershell F
+GLIBC_2.30 setutent F
+GLIBC_2.30 setutxent F
+GLIBC_2.30 setvbuf F
+GLIBC_2.30 setxattr F
+GLIBC_2.30 sgetsgent F
+GLIBC_2.30 sgetsgent_r F
+GLIBC_2.30 sgetspent F
+GLIBC_2.30 sgetspent_r F
+GLIBC_2.30 shmat F
+GLIBC_2.30 shmctl F
+GLIBC_2.30 shmdt F
+GLIBC_2.30 shmget F
+GLIBC_2.30 shutdown F
+GLIBC_2.30 sigaction F
+GLIBC_2.30 sigaddset F
+GLIBC_2.30 sigaltstack F
+GLIBC_2.30 sigandset F
+GLIBC_2.30 sigblock F
+GLIBC_2.30 sigdelset F
+GLIBC_2.30 sigemptyset F
+GLIBC_2.30 sigfillset F
+GLIBC_2.30 siggetmask F
+GLIBC_2.30 sighold F
+GLIBC_2.30 sigignore F
+GLIBC_2.30 siginterrupt F
+GLIBC_2.30 sigisemptyset F
+GLIBC_2.30 sigismember F
+GLIBC_2.30 siglongjmp F
+GLIBC_2.30 signal F
+GLIBC_2.30 signalfd F
+GLIBC_2.30 sigorset F
+GLIBC_2.30 sigpause F
+GLIBC_2.30 sigpending F
+GLIBC_2.30 sigprocmask F
+GLIBC_2.30 sigqueue F
+GLIBC_2.30 sigrelse F
+GLIBC_2.30 sigreturn F
+GLIBC_2.30 sigset F
+GLIBC_2.30 sigsetmask F
+GLIBC_2.30 sigstack F
+GLIBC_2.30 sigsuspend F
+GLIBC_2.30 sigtimedwait F
+GLIBC_2.30 sigwait F
+GLIBC_2.30 sigwaitinfo F
+GLIBC_2.30 sleep F
+GLIBC_2.30 snprintf F
+GLIBC_2.30 sockatmark F
+GLIBC_2.30 socket F
+GLIBC_2.30 socketpair F
+GLIBC_2.30 splice F
+GLIBC_2.30 sprintf F
+GLIBC_2.30 sprofil F
+GLIBC_2.30 srand F
+GLIBC_2.30 srand48 F
+GLIBC_2.30 srand48_r F
+GLIBC_2.30 srandom F
+GLIBC_2.30 srandom_r F
+GLIBC_2.30 sscanf F
+GLIBC_2.30 ssignal F
+GLIBC_2.30 sstk F
+GLIBC_2.30 statfs F
+GLIBC_2.30 statfs64 F
+GLIBC_2.30 statvfs F
+GLIBC_2.30 statvfs64 F
+GLIBC_2.30 statx F
+GLIBC_2.30 stderr D 0x4
+GLIBC_2.30 stdin D 0x4
+GLIBC_2.30 stdout D 0x4
+GLIBC_2.30 stime F
+GLIBC_2.30 stpcpy F
+GLIBC_2.30 stpncpy F
+GLIBC_2.30 strcasecmp F
+GLIBC_2.30 strcasecmp_l F
+GLIBC_2.30 strcasestr F
+GLIBC_2.30 strcat F
+GLIBC_2.30 strchr F
+GLIBC_2.30 strchrnul F
+GLIBC_2.30 strcmp F
+GLIBC_2.30 strcoll F
+GLIBC_2.30 strcoll_l F
+GLIBC_2.30 strcpy F
+GLIBC_2.30 strcspn F
+GLIBC_2.30 strdup F
+GLIBC_2.30 strerror F
+GLIBC_2.30 strerror_l F
+GLIBC_2.30 strerror_r F
+GLIBC_2.30 strfmon F
+GLIBC_2.30 strfmon_l F
+GLIBC_2.30 strfromd F
+GLIBC_2.30 strfromf F
+GLIBC_2.30 strfromf32 F
+GLIBC_2.30 strfromf32x F
+GLIBC_2.30 strfromf64 F
+GLIBC_2.30 strfroml F
+GLIBC_2.30 strfry F
+GLIBC_2.30 strftime F
+GLIBC_2.30 strftime_l F
+GLIBC_2.30 strlen F
+GLIBC_2.30 strncasecmp F
+GLIBC_2.30 strncasecmp_l F
+GLIBC_2.30 strncat F
+GLIBC_2.30 strncmp F
+GLIBC_2.30 strncpy F
+GLIBC_2.30 strndup F
+GLIBC_2.30 strnlen F
+GLIBC_2.30 strpbrk F
+GLIBC_2.30 strptime F
+GLIBC_2.30 strptime_l F
+GLIBC_2.30 strrchr F
+GLIBC_2.30 strsep F
+GLIBC_2.30 strsignal F
+GLIBC_2.30 strspn F
+GLIBC_2.30 strstr F
+GLIBC_2.30 strtod F
+GLIBC_2.30 strtod_l F
+GLIBC_2.30 strtof F
+GLIBC_2.30 strtof32 F
+GLIBC_2.30 strtof32_l F
+GLIBC_2.30 strtof32x F
+GLIBC_2.30 strtof32x_l F
+GLIBC_2.30 strtof64 F
+GLIBC_2.30 strtof64_l F
+GLIBC_2.30 strtof_l F
+GLIBC_2.30 strtoimax F
+GLIBC_2.30 strtok F
+GLIBC_2.30 strtok_r F
+GLIBC_2.30 strtol F
+GLIBC_2.30 strtol_l F
+GLIBC_2.30 strtold F
+GLIBC_2.30 strtold_l F
+GLIBC_2.30 strtoll F
+GLIBC_2.30 strtoll_l F
+GLIBC_2.30 strtoq F
+GLIBC_2.30 strtoul F
+GLIBC_2.30 strtoul_l F
+GLIBC_2.30 strtoull F
+GLIBC_2.30 strtoull_l F
+GLIBC_2.30 strtoumax F
+GLIBC_2.30 strtouq F
+GLIBC_2.30 strverscmp F
+GLIBC_2.30 strxfrm F
+GLIBC_2.30 strxfrm_l F
+GLIBC_2.30 stty F
+GLIBC_2.30 svc_exit F
+GLIBC_2.30 svc_fdset D 0x80
+GLIBC_2.30 svc_getreq F
+GLIBC_2.30 svc_getreq_common F
+GLIBC_2.30 svc_getreq_poll F
+GLIBC_2.30 svc_getreqset F
+GLIBC_2.30 svc_max_pollfd D 0x4
+GLIBC_2.30 svc_pollfd D 0x4
+GLIBC_2.30 svc_register F
+GLIBC_2.30 svc_run F
+GLIBC_2.30 svc_sendreply F
+GLIBC_2.30 svc_unregister F
+GLIBC_2.30 svcauthdes_stats D 0xc
+GLIBC_2.30 svcerr_auth F
+GLIBC_2.30 svcerr_decode F
+GLIBC_2.30 svcerr_noproc F
+GLIBC_2.30 svcerr_noprog F
+GLIBC_2.30 svcerr_progvers F
+GLIBC_2.30 svcerr_systemerr F
+GLIBC_2.30 svcerr_weakauth F
+GLIBC_2.30 svcfd_create F
+GLIBC_2.30 svcraw_create F
+GLIBC_2.30 svctcp_create F
+GLIBC_2.30 svcudp_bufcreate F
+GLIBC_2.30 svcudp_create F
+GLIBC_2.30 svcudp_enablecache F
+GLIBC_2.30 svcunix_create F
+GLIBC_2.30 svcunixfd_create F
+GLIBC_2.30 swab F
+GLIBC_2.30 swapcontext F
+GLIBC_2.30 swapoff F
+GLIBC_2.30 swapon F
+GLIBC_2.30 swprintf F
+GLIBC_2.30 swscanf F
+GLIBC_2.30 symlink F
+GLIBC_2.30 symlinkat F
+GLIBC_2.30 sync F
+GLIBC_2.30 sync_file_range F
+GLIBC_2.30 syncfs F
+GLIBC_2.30 sys_errlist D 0x21c
+GLIBC_2.30 sys_nerr D 0x4
+GLIBC_2.30 sys_sigabbrev D 0x104
+GLIBC_2.30 sys_siglist D 0x104
+GLIBC_2.30 syscall F
+GLIBC_2.30 sysconf F
+GLIBC_2.30 sysinfo F
+GLIBC_2.30 syslog F
+GLIBC_2.30 system F
+GLIBC_2.30 sysv_signal F
+GLIBC_2.30 tcdrain F
+GLIBC_2.30 tcflow F
+GLIBC_2.30 tcflush F
+GLIBC_2.30 tcgetattr F
+GLIBC_2.30 tcgetpgrp F
+GLIBC_2.30 tcgetsid F
+GLIBC_2.30 tcsendbreak F
+GLIBC_2.30 tcsetattr F
+GLIBC_2.30 tcsetpgrp F
+GLIBC_2.30 tdelete F
+GLIBC_2.30 tdestroy F
+GLIBC_2.30 tee F
+GLIBC_2.30 telldir F
+GLIBC_2.30 tempnam F
+GLIBC_2.30 textdomain F
+GLIBC_2.30 tfind F
+GLIBC_2.30 tgkill F
+GLIBC_2.30 thrd_current F
+GLIBC_2.30 thrd_equal F
+GLIBC_2.30 thrd_sleep F
+GLIBC_2.30 thrd_yield F
+GLIBC_2.30 time F
+GLIBC_2.30 timegm F
+GLIBC_2.30 timelocal F
+GLIBC_2.30 timerfd_create F
+GLIBC_2.30 timerfd_gettime F
+GLIBC_2.30 timerfd_settime F
+GLIBC_2.30 times F
+GLIBC_2.30 timespec_get F
+GLIBC_2.30 timezone D 0x4
+GLIBC_2.30 tmpfile F
+GLIBC_2.30 tmpfile64 F
+GLIBC_2.30 tmpnam F
+GLIBC_2.30 tmpnam_r F
+GLIBC_2.30 toascii F
+GLIBC_2.30 tolower F
+GLIBC_2.30 tolower_l F
+GLIBC_2.30 toupper F
+GLIBC_2.30 toupper_l F
+GLIBC_2.30 towctrans F
+GLIBC_2.30 towctrans_l F
+GLIBC_2.30 towlower F
+GLIBC_2.30 towlower_l F
+GLIBC_2.30 towupper F
+GLIBC_2.30 towupper_l F
+GLIBC_2.30 tr_break F
+GLIBC_2.30 truncate F
+GLIBC_2.30 truncate64 F
+GLIBC_2.30 tsearch F
+GLIBC_2.30 ttyname F
+GLIBC_2.30 ttyname_r F
+GLIBC_2.30 ttyslot F
+GLIBC_2.30 twalk F
+GLIBC_2.30 twalk_r F
+GLIBC_2.30 tzname D 0x8
+GLIBC_2.30 tzset F
+GLIBC_2.30 ualarm F
+GLIBC_2.30 ulckpwdf F
+GLIBC_2.30 ulimit F
+GLIBC_2.30 umask F
+GLIBC_2.30 umount F
+GLIBC_2.30 umount2 F
+GLIBC_2.30 uname F
+GLIBC_2.30 ungetc F
+GLIBC_2.30 ungetwc F
+GLIBC_2.30 unlink F
+GLIBC_2.30 unlinkat F
+GLIBC_2.30 unlockpt F
+GLIBC_2.30 unsetenv F
+GLIBC_2.30 unshare F
+GLIBC_2.30 updwtmp F
+GLIBC_2.30 updwtmpx F
+GLIBC_2.30 uselocale F
+GLIBC_2.30 user2netname F
+GLIBC_2.30 usleep F
+GLIBC_2.30 utime F
+GLIBC_2.30 utimensat F
+GLIBC_2.30 utimes F
+GLIBC_2.30 utmpname F
+GLIBC_2.30 utmpxname F
+GLIBC_2.30 valloc F
+GLIBC_2.30 vasprintf F
+GLIBC_2.30 vdprintf F
+GLIBC_2.30 verr F
+GLIBC_2.30 verrx F
+GLIBC_2.30 versionsort F
+GLIBC_2.30 versionsort64 F
+GLIBC_2.30 vfork F
+GLIBC_2.30 vfprintf F
+GLIBC_2.30 vfscanf F
+GLIBC_2.30 vfwprintf F
+GLIBC_2.30 vfwscanf F
+GLIBC_2.30 vhangup F
+GLIBC_2.30 vlimit F
+GLIBC_2.30 vmsplice F
+GLIBC_2.30 vprintf F
+GLIBC_2.30 vscanf F
+GLIBC_2.30 vsnprintf F
+GLIBC_2.30 vsprintf F
+GLIBC_2.30 vsscanf F
+GLIBC_2.30 vswprintf F
+GLIBC_2.30 vswscanf F
+GLIBC_2.30 vsyslog F
+GLIBC_2.30 vtimes F
+GLIBC_2.30 vwarn F
+GLIBC_2.30 vwarnx F
+GLIBC_2.30 vwprintf F
+GLIBC_2.30 vwscanf F
+GLIBC_2.30 wait F
+GLIBC_2.30 wait3 F
+GLIBC_2.30 wait4 F
+GLIBC_2.30 waitid F
+GLIBC_2.30 waitpid F
+GLIBC_2.30 warn F
+GLIBC_2.30 warnx F
+GLIBC_2.30 wcpcpy F
+GLIBC_2.30 wcpncpy F
+GLIBC_2.30 wcrtomb F
+GLIBC_2.30 wcscasecmp F
+GLIBC_2.30 wcscasecmp_l F
+GLIBC_2.30 wcscat F
+GLIBC_2.30 wcschr F
+GLIBC_2.30 wcschrnul F
+GLIBC_2.30 wcscmp F
+GLIBC_2.30 wcscoll F
+GLIBC_2.30 wcscoll_l F
+GLIBC_2.30 wcscpy F
+GLIBC_2.30 wcscspn F
+GLIBC_2.30 wcsdup F
+GLIBC_2.30 wcsftime F
+GLIBC_2.30 wcsftime_l F
+GLIBC_2.30 wcslen F
+GLIBC_2.30 wcsncasecmp F
+GLIBC_2.30 wcsncasecmp_l F
+GLIBC_2.30 wcsncat F
+GLIBC_2.30 wcsncmp F
+GLIBC_2.30 wcsncpy F
+GLIBC_2.30 wcsnlen F
+GLIBC_2.30 wcsnrtombs F
+GLIBC_2.30 wcspbrk F
+GLIBC_2.30 wcsrchr F
+GLIBC_2.30 wcsrtombs F
+GLIBC_2.30 wcsspn F
+GLIBC_2.30 wcsstr F
+GLIBC_2.30 wcstod F
+GLIBC_2.30 wcstod_l F
+GLIBC_2.30 wcstof F
+GLIBC_2.30 wcstof32 F
+GLIBC_2.30 wcstof32_l F
+GLIBC_2.30 wcstof32x F
+GLIBC_2.30 wcstof32x_l F
+GLIBC_2.30 wcstof64 F
+GLIBC_2.30 wcstof64_l F
+GLIBC_2.30 wcstof_l F
+GLIBC_2.30 wcstoimax F
+GLIBC_2.30 wcstok F
+GLIBC_2.30 wcstol F
+GLIBC_2.30 wcstol_l F
+GLIBC_2.30 wcstold F
+GLIBC_2.30 wcstold_l F
+GLIBC_2.30 wcstoll F
+GLIBC_2.30 wcstoll_l F
+GLIBC_2.30 wcstombs F
+GLIBC_2.30 wcstoq F
+GLIBC_2.30 wcstoul F
+GLIBC_2.30 wcstoul_l F
+GLIBC_2.30 wcstoull F
+GLIBC_2.30 wcstoull_l F
+GLIBC_2.30 wcstoumax F
+GLIBC_2.30 wcstouq F
+GLIBC_2.30 wcswcs F
+GLIBC_2.30 wcswidth F
+GLIBC_2.30 wcsxfrm F
+GLIBC_2.30 wcsxfrm_l F
+GLIBC_2.30 wctob F
+GLIBC_2.30 wctomb F
+GLIBC_2.30 wctrans F
+GLIBC_2.30 wctrans_l F
+GLIBC_2.30 wctype F
+GLIBC_2.30 wctype_l F
+GLIBC_2.30 wcwidth F
+GLIBC_2.30 wmemchr F
+GLIBC_2.30 wmemcmp F
+GLIBC_2.30 wmemcpy F
+GLIBC_2.30 wmemmove F
+GLIBC_2.30 wmempcpy F
+GLIBC_2.30 wmemset F
+GLIBC_2.30 wordexp F
+GLIBC_2.30 wordfree F
+GLIBC_2.30 wprintf F
+GLIBC_2.30 write F
+GLIBC_2.30 writev F
+GLIBC_2.30 wscanf F
+GLIBC_2.30 xdecrypt F
+GLIBC_2.30 xdr_accepted_reply F
+GLIBC_2.30 xdr_array F
+GLIBC_2.30 xdr_authdes_cred F
+GLIBC_2.30 xdr_authdes_verf F
+GLIBC_2.30 xdr_authunix_parms F
+GLIBC_2.30 xdr_bool F
+GLIBC_2.30 xdr_bytes F
+GLIBC_2.30 xdr_callhdr F
+GLIBC_2.30 xdr_callmsg F
+GLIBC_2.30 xdr_char F
+GLIBC_2.30 xdr_cryptkeyarg F
+GLIBC_2.30 xdr_cryptkeyarg2 F
+GLIBC_2.30 xdr_cryptkeyres F
+GLIBC_2.30 xdr_des_block F
+GLIBC_2.30 xdr_double F
+GLIBC_2.30 xdr_enum F
+GLIBC_2.30 xdr_float F
+GLIBC_2.30 xdr_free F
+GLIBC_2.30 xdr_getcredres F
+GLIBC_2.30 xdr_hyper F
+GLIBC_2.30 xdr_int F
+GLIBC_2.30 xdr_int16_t F
+GLIBC_2.30 xdr_int32_t F
+GLIBC_2.30 xdr_int64_t F
+GLIBC_2.30 xdr_int8_t F
+GLIBC_2.30 xdr_key_netstarg F
+GLIBC_2.30 xdr_key_netstres F
+GLIBC_2.30 xdr_keybuf F
+GLIBC_2.30 xdr_keystatus F
+GLIBC_2.30 xdr_long F
+GLIBC_2.30 xdr_longlong_t F
+GLIBC_2.30 xdr_netnamestr F
+GLIBC_2.30 xdr_netobj F
+GLIBC_2.30 xdr_opaque F
+GLIBC_2.30 xdr_opaque_auth F
+GLIBC_2.30 xdr_pmap F
+GLIBC_2.30 xdr_pmaplist F
+GLIBC_2.30 xdr_pointer F
+GLIBC_2.30 xdr_quad_t F
+GLIBC_2.30 xdr_reference F
+GLIBC_2.30 xdr_rejected_reply F
+GLIBC_2.30 xdr_replymsg F
+GLIBC_2.30 xdr_rmtcall_args F
+GLIBC_2.30 xdr_rmtcallres F
+GLIBC_2.30 xdr_short F
+GLIBC_2.30 xdr_sizeof F
+GLIBC_2.30 xdr_string F
+GLIBC_2.30 xdr_u_char F
+GLIBC_2.30 xdr_u_hyper F
+GLIBC_2.30 xdr_u_int F
+GLIBC_2.30 xdr_u_long F
+GLIBC_2.30 xdr_u_longlong_t F
+GLIBC_2.30 xdr_u_quad_t F
+GLIBC_2.30 xdr_u_short F
+GLIBC_2.30 xdr_uint16_t F
+GLIBC_2.30 xdr_uint32_t F
+GLIBC_2.30 xdr_uint64_t F
+GLIBC_2.30 xdr_uint8_t F
+GLIBC_2.30 xdr_union F
+GLIBC_2.30 xdr_unixcred F
+GLIBC_2.30 xdr_vector F
+GLIBC_2.30 xdr_void F
+GLIBC_2.30 xdr_wrapstring F
+GLIBC_2.30 xdrmem_create F
+GLIBC_2.30 xdrrec_create F
+GLIBC_2.30 xdrrec_endofrecord F
+GLIBC_2.30 xdrrec_eof F
+GLIBC_2.30 xdrrec_skiprecord F
+GLIBC_2.30 xdrstdio_create F
+GLIBC_2.30 xencrypt F
+GLIBC_2.30 xprt_register F
+GLIBC_2.30 xprt_unregister F
diff --git a/sysdeps/unix/sysv/linux/nds32/libcrypt.abilist b/sysdeps/unix/sysv/linux/nds32/libcrypt.abilist
new file mode 100644
index 0000000..8d83578
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/libcrypt.abilist
@@ -0,0 +1,2 @@
+GLIBC_2.30 crypt F
+GLIBC_2.30 crypt_r F
diff --git a/sysdeps/unix/sysv/linux/nds32/libdl.abilist b/sysdeps/unix/sysv/linux/nds32/libdl.abilist
new file mode 100644
index 0000000..3fc6d95
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/libdl.abilist
@@ -0,0 +1,9 @@
+GLIBC_2.30 dladdr F
+GLIBC_2.30 dladdr1 F
+GLIBC_2.30 dlclose F
+GLIBC_2.30 dlerror F
+GLIBC_2.30 dlinfo F
+GLIBC_2.30 dlmopen F
+GLIBC_2.30 dlopen F
+GLIBC_2.30 dlsym F
+GLIBC_2.30 dlvsym F
diff --git a/sysdeps/unix/sysv/linux/nds32/libm.abilist b/sysdeps/unix/sysv/linux/nds32/libm.abilist
new file mode 100644
index 0000000..43f3a97
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/libm.abilist
@@ -0,0 +1,753 @@
+GLIBC_2.30 __acos_finite F
+GLIBC_2.30 __acosf_finite F
+GLIBC_2.30 __acosh_finite F
+GLIBC_2.30 __acoshf_finite F
+GLIBC_2.30 __asin_finite F
+GLIBC_2.30 __asinf_finite F
+GLIBC_2.30 __atan2_finite F
+GLIBC_2.30 __atan2f_finite F
+GLIBC_2.30 __atanh_finite F
+GLIBC_2.30 __atanhf_finite F
+GLIBC_2.30 __clog10 F
+GLIBC_2.30 __clog10f F
+GLIBC_2.30 __clog10l F
+GLIBC_2.30 __cosh_finite F
+GLIBC_2.30 __coshf_finite F
+GLIBC_2.30 __exp10_finite F
+GLIBC_2.30 __exp10f_finite F
+GLIBC_2.30 __exp2_finite F
+GLIBC_2.30 __exp2f_finite F
+GLIBC_2.30 __exp_finite F
+GLIBC_2.30 __expf_finite F
+GLIBC_2.30 __finite F
+GLIBC_2.30 __finitef F
+GLIBC_2.30 __fmod_finite F
+GLIBC_2.30 __fmodf_finite F
+GLIBC_2.30 __fpclassify F
+GLIBC_2.30 __fpclassifyf F
+GLIBC_2.30 __gamma_r_finite F
+GLIBC_2.30 __gammaf_r_finite F
+GLIBC_2.30 __hypot_finite F
+GLIBC_2.30 __hypotf_finite F
+GLIBC_2.30 __iseqsig F
+GLIBC_2.30 __iseqsigf F
+GLIBC_2.30 __issignaling F
+GLIBC_2.30 __issignalingf F
+GLIBC_2.30 __j0_finite F
+GLIBC_2.30 __j0f_finite F
+GLIBC_2.30 __j1_finite F
+GLIBC_2.30 __j1f_finite F
+GLIBC_2.30 __jn_finite F
+GLIBC_2.30 __jnf_finite F
+GLIBC_2.30 __lgamma_r_finite F
+GLIBC_2.30 __lgammaf_r_finite F
+GLIBC_2.30 __log10_finite F
+GLIBC_2.30 __log10f_finite F
+GLIBC_2.30 __log2_finite F
+GLIBC_2.30 __log2f_finite F
+GLIBC_2.30 __log_finite F
+GLIBC_2.30 __logf_finite F
+GLIBC_2.30 __pow_finite F
+GLIBC_2.30 __powf_finite F
+GLIBC_2.30 __remainder_finite F
+GLIBC_2.30 __remainderf_finite F
+GLIBC_2.30 __scalb_finite F
+GLIBC_2.30 __scalbf_finite F
+GLIBC_2.30 __signbit F
+GLIBC_2.30 __signbitf F
+GLIBC_2.30 __signgam D 0x4
+GLIBC_2.30 __sinh_finite F
+GLIBC_2.30 __sinhf_finite F
+GLIBC_2.30 __sqrt_finite F
+GLIBC_2.30 __sqrtf_finite F
+GLIBC_2.30 __y0_finite F
+GLIBC_2.30 __y0f_finite F
+GLIBC_2.30 __y1_finite F
+GLIBC_2.30 __y1f_finite F
+GLIBC_2.30 __yn_finite F
+GLIBC_2.30 __ynf_finite F
+GLIBC_2.30 acos F
+GLIBC_2.30 acosf F
+GLIBC_2.30 acosf32 F
+GLIBC_2.30 acosf32x F
+GLIBC_2.30 acosf64 F
+GLIBC_2.30 acosh F
+GLIBC_2.30 acoshf F
+GLIBC_2.30 acoshf32 F
+GLIBC_2.30 acoshf32x F
+GLIBC_2.30 acoshf64 F
+GLIBC_2.30 acoshl F
+GLIBC_2.30 acosl F
+GLIBC_2.30 asin F
+GLIBC_2.30 asinf F
+GLIBC_2.30 asinf32 F
+GLIBC_2.30 asinf32x F
+GLIBC_2.30 asinf64 F
+GLIBC_2.30 asinh F
+GLIBC_2.30 asinhf F
+GLIBC_2.30 asinhf32 F
+GLIBC_2.30 asinhf32x F
+GLIBC_2.30 asinhf64 F
+GLIBC_2.30 asinhl F
+GLIBC_2.30 asinl F
+GLIBC_2.30 atan F
+GLIBC_2.30 atan2 F
+GLIBC_2.30 atan2f F
+GLIBC_2.30 atan2f32 F
+GLIBC_2.30 atan2f32x F
+GLIBC_2.30 atan2f64 F
+GLIBC_2.30 atan2l F
+GLIBC_2.30 atanf F
+GLIBC_2.30 atanf32 F
+GLIBC_2.30 atanf32x F
+GLIBC_2.30 atanf64 F
+GLIBC_2.30 atanh F
+GLIBC_2.30 atanhf F
+GLIBC_2.30 atanhf32 F
+GLIBC_2.30 atanhf32x F
+GLIBC_2.30 atanhf64 F
+GLIBC_2.30 atanhl F
+GLIBC_2.30 atanl F
+GLIBC_2.30 cabs F
+GLIBC_2.30 cabsf F
+GLIBC_2.30 cabsf32 F
+GLIBC_2.30 cabsf32x F
+GLIBC_2.30 cabsf64 F
+GLIBC_2.30 cabsl F
+GLIBC_2.30 cacos F
+GLIBC_2.30 cacosf F
+GLIBC_2.30 cacosf32 F
+GLIBC_2.30 cacosf32x F
+GLIBC_2.30 cacosf64 F
+GLIBC_2.30 cacosh F
+GLIBC_2.30 cacoshf F
+GLIBC_2.30 cacoshf32 F
+GLIBC_2.30 cacoshf32x F
+GLIBC_2.30 cacoshf64 F
+GLIBC_2.30 cacoshl F
+GLIBC_2.30 cacosl F
+GLIBC_2.30 canonicalize F
+GLIBC_2.30 canonicalizef F
+GLIBC_2.30 canonicalizef32 F
+GLIBC_2.30 canonicalizef32x F
+GLIBC_2.30 canonicalizef64 F
+GLIBC_2.30 canonicalizel F
+GLIBC_2.30 carg F
+GLIBC_2.30 cargf F
+GLIBC_2.30 cargf32 F
+GLIBC_2.30 cargf32x F
+GLIBC_2.30 cargf64 F
+GLIBC_2.30 cargl F
+GLIBC_2.30 casin F
+GLIBC_2.30 casinf F
+GLIBC_2.30 casinf32 F
+GLIBC_2.30 casinf32x F
+GLIBC_2.30 casinf64 F
+GLIBC_2.30 casinh F
+GLIBC_2.30 casinhf F
+GLIBC_2.30 casinhf32 F
+GLIBC_2.30 casinhf32x F
+GLIBC_2.30 casinhf64 F
+GLIBC_2.30 casinhl F
+GLIBC_2.30 casinl F
+GLIBC_2.30 catan F
+GLIBC_2.30 catanf F
+GLIBC_2.30 catanf32 F
+GLIBC_2.30 catanf32x F
+GLIBC_2.30 catanf64 F
+GLIBC_2.30 catanh F
+GLIBC_2.30 catanhf F
+GLIBC_2.30 catanhf32 F
+GLIBC_2.30 catanhf32x F
+GLIBC_2.30 catanhf64 F
+GLIBC_2.30 catanhl F
+GLIBC_2.30 catanl F
+GLIBC_2.30 cbrt F
+GLIBC_2.30 cbrtf F
+GLIBC_2.30 cbrtf32 F
+GLIBC_2.30 cbrtf32x F
+GLIBC_2.30 cbrtf64 F
+GLIBC_2.30 cbrtl F
+GLIBC_2.30 ccos F
+GLIBC_2.30 ccosf F
+GLIBC_2.30 ccosf32 F
+GLIBC_2.30 ccosf32x F
+GLIBC_2.30 ccosf64 F
+GLIBC_2.30 ccosh F
+GLIBC_2.30 ccoshf F
+GLIBC_2.30 ccoshf32 F
+GLIBC_2.30 ccoshf32x F
+GLIBC_2.30 ccoshf64 F
+GLIBC_2.30 ccoshl F
+GLIBC_2.30 ccosl F
+GLIBC_2.30 ceil F
+GLIBC_2.30 ceilf F
+GLIBC_2.30 ceilf32 F
+GLIBC_2.30 ceilf32x F
+GLIBC_2.30 ceilf64 F
+GLIBC_2.30 ceill F
+GLIBC_2.30 cexp F
+GLIBC_2.30 cexpf F
+GLIBC_2.30 cexpf32 F
+GLIBC_2.30 cexpf32x F
+GLIBC_2.30 cexpf64 F
+GLIBC_2.30 cexpl F
+GLIBC_2.30 cimag F
+GLIBC_2.30 cimagf F
+GLIBC_2.30 cimagf32 F
+GLIBC_2.30 cimagf32x F
+GLIBC_2.30 cimagf64 F
+GLIBC_2.30 cimagl F
+GLIBC_2.30 clog F
+GLIBC_2.30 clog10 F
+GLIBC_2.30 clog10f F
+GLIBC_2.30 clog10f32 F
+GLIBC_2.30 clog10f32x F
+GLIBC_2.30 clog10f64 F
+GLIBC_2.30 clog10l F
+GLIBC_2.30 clogf F
+GLIBC_2.30 clogf32 F
+GLIBC_2.30 clogf32x F
+GLIBC_2.30 clogf64 F
+GLIBC_2.30 clogl F
+GLIBC_2.30 conj F
+GLIBC_2.30 conjf F
+GLIBC_2.30 conjf32 F
+GLIBC_2.30 conjf32x F
+GLIBC_2.30 conjf64 F
+GLIBC_2.30 conjl F
+GLIBC_2.30 copysign F
+GLIBC_2.30 copysignf F
+GLIBC_2.30 copysignf32 F
+GLIBC_2.30 copysignf32x F
+GLIBC_2.30 copysignf64 F
+GLIBC_2.30 copysignl F
+GLIBC_2.30 cos F
+GLIBC_2.30 cosf F
+GLIBC_2.30 cosf32 F
+GLIBC_2.30 cosf32x F
+GLIBC_2.30 cosf64 F
+GLIBC_2.30 cosh F
+GLIBC_2.30 coshf F
+GLIBC_2.30 coshf32 F
+GLIBC_2.30 coshf32x F
+GLIBC_2.30 coshf64 F
+GLIBC_2.30 coshl F
+GLIBC_2.30 cosl F
+GLIBC_2.30 cpow F
+GLIBC_2.30 cpowf F
+GLIBC_2.30 cpowf32 F
+GLIBC_2.30 cpowf32x F
+GLIBC_2.30 cpowf64 F
+GLIBC_2.30 cpowl F
+GLIBC_2.30 cproj F
+GLIBC_2.30 cprojf F
+GLIBC_2.30 cprojf32 F
+GLIBC_2.30 cprojf32x F
+GLIBC_2.30 cprojf64 F
+GLIBC_2.30 cprojl F
+GLIBC_2.30 creal F
+GLIBC_2.30 crealf F
+GLIBC_2.30 crealf32 F
+GLIBC_2.30 crealf32x F
+GLIBC_2.30 crealf64 F
+GLIBC_2.30 creall F
+GLIBC_2.30 csin F
+GLIBC_2.30 csinf F
+GLIBC_2.30 csinf32 F
+GLIBC_2.30 csinf32x F
+GLIBC_2.30 csinf64 F
+GLIBC_2.30 csinh F
+GLIBC_2.30 csinhf F
+GLIBC_2.30 csinhf32 F
+GLIBC_2.30 csinhf32x F
+GLIBC_2.30 csinhf64 F
+GLIBC_2.30 csinhl F
+GLIBC_2.30 csinl F
+GLIBC_2.30 csqrt F
+GLIBC_2.30 csqrtf F
+GLIBC_2.30 csqrtf32 F
+GLIBC_2.30 csqrtf32x F
+GLIBC_2.30 csqrtf64 F
+GLIBC_2.30 csqrtl F
+GLIBC_2.30 ctan F
+GLIBC_2.30 ctanf F
+GLIBC_2.30 ctanf32 F
+GLIBC_2.30 ctanf32x F
+GLIBC_2.30 ctanf64 F
+GLIBC_2.30 ctanh F
+GLIBC_2.30 ctanhf F
+GLIBC_2.30 ctanhf32 F
+GLIBC_2.30 ctanhf32x F
+GLIBC_2.30 ctanhf64 F
+GLIBC_2.30 ctanhl F
+GLIBC_2.30 ctanl F
+GLIBC_2.30 daddl F
+GLIBC_2.30 ddivl F
+GLIBC_2.30 dmull F
+GLIBC_2.30 drem F
+GLIBC_2.30 dremf F
+GLIBC_2.30 dreml F
+GLIBC_2.30 dsubl F
+GLIBC_2.30 erf F
+GLIBC_2.30 erfc F
+GLIBC_2.30 erfcf F
+GLIBC_2.30 erfcf32 F
+GLIBC_2.30 erfcf32x F
+GLIBC_2.30 erfcf64 F
+GLIBC_2.30 erfcl F
+GLIBC_2.30 erff F
+GLIBC_2.30 erff32 F
+GLIBC_2.30 erff32x F
+GLIBC_2.30 erff64 F
+GLIBC_2.30 erfl F
+GLIBC_2.30 exp F
+GLIBC_2.30 exp10 F
+GLIBC_2.30 exp10f F
+GLIBC_2.30 exp10f32 F
+GLIBC_2.30 exp10f32x F
+GLIBC_2.30 exp10f64 F
+GLIBC_2.30 exp10l F
+GLIBC_2.30 exp2 F
+GLIBC_2.30 exp2f F
+GLIBC_2.30 exp2f32 F
+GLIBC_2.30 exp2f32x F
+GLIBC_2.30 exp2f64 F
+GLIBC_2.30 exp2l F
+GLIBC_2.30 expf F
+GLIBC_2.30 expf32 F
+GLIBC_2.30 expf32x F
+GLIBC_2.30 expf64 F
+GLIBC_2.30 expl F
+GLIBC_2.30 expm1 F
+GLIBC_2.30 expm1f F
+GLIBC_2.30 expm1f32 F
+GLIBC_2.30 expm1f32x F
+GLIBC_2.30 expm1f64 F
+GLIBC_2.30 expm1l F
+GLIBC_2.30 f32addf32x F
+GLIBC_2.30 f32addf64 F
+GLIBC_2.30 f32divf32x F
+GLIBC_2.30 f32divf64 F
+GLIBC_2.30 f32mulf32x F
+GLIBC_2.30 f32mulf64 F
+GLIBC_2.30 f32subf32x F
+GLIBC_2.30 f32subf64 F
+GLIBC_2.30 f32xaddf64 F
+GLIBC_2.30 f32xdivf64 F
+GLIBC_2.30 f32xmulf64 F
+GLIBC_2.30 f32xsubf64 F
+GLIBC_2.30 fabs F
+GLIBC_2.30 fabsf F
+GLIBC_2.30 fabsf32 F
+GLIBC_2.30 fabsf32x F
+GLIBC_2.30 fabsf64 F
+GLIBC_2.30 fabsl F
+GLIBC_2.30 fadd F
+GLIBC_2.30 faddl F
+GLIBC_2.30 fdim F
+GLIBC_2.30 fdimf F
+GLIBC_2.30 fdimf32 F
+GLIBC_2.30 fdimf32x F
+GLIBC_2.30 fdimf64 F
+GLIBC_2.30 fdiml F
+GLIBC_2.30 fdiv F
+GLIBC_2.30 fdivl F
+GLIBC_2.30 feclearexcept F
+GLIBC_2.30 fedisableexcept F
+GLIBC_2.30 feenableexcept F
+GLIBC_2.30 fegetenv F
+GLIBC_2.30 fegetexcept F
+GLIBC_2.30 fegetexceptflag F
+GLIBC_2.30 fegetmode F
+GLIBC_2.30 fegetround F
+GLIBC_2.30 feholdexcept F
+GLIBC_2.30 feraiseexcept F
+GLIBC_2.30 fesetenv F
+GLIBC_2.30 fesetexcept F
+GLIBC_2.30 fesetexceptflag F
+GLIBC_2.30 fesetmode F
+GLIBC_2.30 fesetround F
+GLIBC_2.30 fetestexcept F
+GLIBC_2.30 fetestexceptflag F
+GLIBC_2.30 feupdateenv F
+GLIBC_2.30 finite F
+GLIBC_2.30 finitef F
+GLIBC_2.30 finitel F
+GLIBC_2.30 floor F
+GLIBC_2.30 floorf F
+GLIBC_2.30 floorf32 F
+GLIBC_2.30 floorf32x F
+GLIBC_2.30 floorf64 F
+GLIBC_2.30 floorl F
+GLIBC_2.30 fma F
+GLIBC_2.30 fmaf F
+GLIBC_2.30 fmaf32 F
+GLIBC_2.30 fmaf32x F
+GLIBC_2.30 fmaf64 F
+GLIBC_2.30 fmal F
+GLIBC_2.30 fmax F
+GLIBC_2.30 fmaxf F
+GLIBC_2.30 fmaxf32 F
+GLIBC_2.30 fmaxf32x F
+GLIBC_2.30 fmaxf64 F
+GLIBC_2.30 fmaxl F
+GLIBC_2.30 fmaxmag F
+GLIBC_2.30 fmaxmagf F
+GLIBC_2.30 fmaxmagf32 F
+GLIBC_2.30 fmaxmagf32x F
+GLIBC_2.30 fmaxmagf64 F
+GLIBC_2.30 fmaxmagl F
+GLIBC_2.30 fmin F
+GLIBC_2.30 fminf F
+GLIBC_2.30 fminf32 F
+GLIBC_2.30 fminf32x F
+GLIBC_2.30 fminf64 F
+GLIBC_2.30 fminl F
+GLIBC_2.30 fminmag F
+GLIBC_2.30 fminmagf F
+GLIBC_2.30 fminmagf32 F
+GLIBC_2.30 fminmagf32x F
+GLIBC_2.30 fminmagf64 F
+GLIBC_2.30 fminmagl F
+GLIBC_2.30 fmod F
+GLIBC_2.30 fmodf F
+GLIBC_2.30 fmodf32 F
+GLIBC_2.30 fmodf32x F
+GLIBC_2.30 fmodf64 F
+GLIBC_2.30 fmodl F
+GLIBC_2.30 fmul F
+GLIBC_2.30 fmull F
+GLIBC_2.30 frexp F
+GLIBC_2.30 frexpf F
+GLIBC_2.30 frexpf32 F
+GLIBC_2.30 frexpf32x F
+GLIBC_2.30 frexpf64 F
+GLIBC_2.30 frexpl F
+GLIBC_2.30 fromfp F
+GLIBC_2.30 fromfpf F
+GLIBC_2.30 fromfpf32 F
+GLIBC_2.30 fromfpf32x F
+GLIBC_2.30 fromfpf64 F
+GLIBC_2.30 fromfpl F
+GLIBC_2.30 fromfpx F
+GLIBC_2.30 fromfpxf F
+GLIBC_2.30 fromfpxf32 F
+GLIBC_2.30 fromfpxf32x F
+GLIBC_2.30 fromfpxf64 F
+GLIBC_2.30 fromfpxl F
+GLIBC_2.30 fsub F
+GLIBC_2.30 fsubl F
+GLIBC_2.30 gamma F
+GLIBC_2.30 gammaf F
+GLIBC_2.30 gammal F
+GLIBC_2.30 getpayload F
+GLIBC_2.30 getpayloadf F
+GLIBC_2.30 getpayloadf32 F
+GLIBC_2.30 getpayloadf32x F
+GLIBC_2.30 getpayloadf64 F
+GLIBC_2.30 getpayloadl F
+GLIBC_2.30 hypot F
+GLIBC_2.30 hypotf F
+GLIBC_2.30 hypotf32 F
+GLIBC_2.30 hypotf32x F
+GLIBC_2.30 hypotf64 F
+GLIBC_2.30 hypotl F
+GLIBC_2.30 ilogb F
+GLIBC_2.30 ilogbf F
+GLIBC_2.30 ilogbf32 F
+GLIBC_2.30 ilogbf32x F
+GLIBC_2.30 ilogbf64 F
+GLIBC_2.30 ilogbl F
+GLIBC_2.30 j0 F
+GLIBC_2.30 j0f F
+GLIBC_2.30 j0f32 F
+GLIBC_2.30 j0f32x F
+GLIBC_2.30 j0f64 F
+GLIBC_2.30 j0l F
+GLIBC_2.30 j1 F
+GLIBC_2.30 j1f F
+GLIBC_2.30 j1f32 F
+GLIBC_2.30 j1f32x F
+GLIBC_2.30 j1f64 F
+GLIBC_2.30 j1l F
+GLIBC_2.30 jn F
+GLIBC_2.30 jnf F
+GLIBC_2.30 jnf32 F
+GLIBC_2.30 jnf32x F
+GLIBC_2.30 jnf64 F
+GLIBC_2.30 jnl F
+GLIBC_2.30 ldexp F
+GLIBC_2.30 ldexpf F
+GLIBC_2.30 ldexpf32 F
+GLIBC_2.30 ldexpf32x F
+GLIBC_2.30 ldexpf64 F
+GLIBC_2.30 ldexpl F
+GLIBC_2.30 lgamma F
+GLIBC_2.30 lgamma_r F
+GLIBC_2.30 lgammaf F
+GLIBC_2.30 lgammaf32 F
+GLIBC_2.30 lgammaf32_r F
+GLIBC_2.30 lgammaf32x F
+GLIBC_2.30 lgammaf32x_r F
+GLIBC_2.30 lgammaf64 F
+GLIBC_2.30 lgammaf64_r F
+GLIBC_2.30 lgammaf_r F
+GLIBC_2.30 lgammal F
+GLIBC_2.30 lgammal_r F
+GLIBC_2.30 llogb F
+GLIBC_2.30 llogbf F
+GLIBC_2.30 llogbf32 F
+GLIBC_2.30 llogbf32x F
+GLIBC_2.30 llogbf64 F
+GLIBC_2.30 llogbl F
+GLIBC_2.30 llrint F
+GLIBC_2.30 llrintf F
+GLIBC_2.30 llrintf32 F
+GLIBC_2.30 llrintf32x F
+GLIBC_2.30 llrintf64 F
+GLIBC_2.30 llrintl F
+GLIBC_2.30 llround F
+GLIBC_2.30 llroundf F
+GLIBC_2.30 llroundf32 F
+GLIBC_2.30 llroundf32x F
+GLIBC_2.30 llroundf64 F
+GLIBC_2.30 llroundl F
+GLIBC_2.30 log F
+GLIBC_2.30 log10 F
+GLIBC_2.30 log10f F
+GLIBC_2.30 log10f32 F
+GLIBC_2.30 log10f32x F
+GLIBC_2.30 log10f64 F
+GLIBC_2.30 log10l F
+GLIBC_2.30 log1p F
+GLIBC_2.30 log1pf F
+GLIBC_2.30 log1pf32 F
+GLIBC_2.30 log1pf32x F
+GLIBC_2.30 log1pf64 F
+GLIBC_2.30 log1pl F
+GLIBC_2.30 log2 F
+GLIBC_2.30 log2f F
+GLIBC_2.30 log2f32 F
+GLIBC_2.30 log2f32x F
+GLIBC_2.30 log2f64 F
+GLIBC_2.30 log2l F
+GLIBC_2.30 logb F
+GLIBC_2.30 logbf F
+GLIBC_2.30 logbf32 F
+GLIBC_2.30 logbf32x F
+GLIBC_2.30 logbf64 F
+GLIBC_2.30 logbl F
+GLIBC_2.30 logf F
+GLIBC_2.30 logf32 F
+GLIBC_2.30 logf32x F
+GLIBC_2.30 logf64 F
+GLIBC_2.30 logl F
+GLIBC_2.30 lrint F
+GLIBC_2.30 lrintf F
+GLIBC_2.30 lrintf32 F
+GLIBC_2.30 lrintf32x F
+GLIBC_2.30 lrintf64 F
+GLIBC_2.30 lrintl F
+GLIBC_2.30 lround F
+GLIBC_2.30 lroundf F
+GLIBC_2.30 lroundf32 F
+GLIBC_2.30 lroundf32x F
+GLIBC_2.30 lroundf64 F
+GLIBC_2.30 lroundl F
+GLIBC_2.30 modf F
+GLIBC_2.30 modff F
+GLIBC_2.30 modff32 F
+GLIBC_2.30 modff32x F
+GLIBC_2.30 modff64 F
+GLIBC_2.30 modfl F
+GLIBC_2.30 nan F
+GLIBC_2.30 nanf F
+GLIBC_2.30 nanf32 F
+GLIBC_2.30 nanf32x F
+GLIBC_2.30 nanf64 F
+GLIBC_2.30 nanl F
+GLIBC_2.30 nearbyint F
+GLIBC_2.30 nearbyintf F
+GLIBC_2.30 nearbyintf32 F
+GLIBC_2.30 nearbyintf32x F
+GLIBC_2.30 nearbyintf64 F
+GLIBC_2.30 nearbyintl F
+GLIBC_2.30 nextafter F
+GLIBC_2.30 nextafterf F
+GLIBC_2.30 nextafterf32 F
+GLIBC_2.30 nextafterf32x F
+GLIBC_2.30 nextafterf64 F
+GLIBC_2.30 nextafterl F
+GLIBC_2.30 nextdown F
+GLIBC_2.30 nextdownf F
+GLIBC_2.30 nextdownf32 F
+GLIBC_2.30 nextdownf32x F
+GLIBC_2.30 nextdownf64 F
+GLIBC_2.30 nextdownl F
+GLIBC_2.30 nexttoward F
+GLIBC_2.30 nexttowardf F
+GLIBC_2.30 nexttowardl F
+GLIBC_2.30 nextup F
+GLIBC_2.30 nextupf F
+GLIBC_2.30 nextupf32 F
+GLIBC_2.30 nextupf32x F
+GLIBC_2.30 nextupf64 F
+GLIBC_2.30 nextupl F
+GLIBC_2.30 pow F
+GLIBC_2.30 powf F
+GLIBC_2.30 powf32 F
+GLIBC_2.30 powf32x F
+GLIBC_2.30 powf64 F
+GLIBC_2.30 powl F
+GLIBC_2.30 remainder F
+GLIBC_2.30 remainderf F
+GLIBC_2.30 remainderf32 F
+GLIBC_2.30 remainderf32x F
+GLIBC_2.30 remainderf64 F
+GLIBC_2.30 remainderl F
+GLIBC_2.30 remquo F
+GLIBC_2.30 remquof F
+GLIBC_2.30 remquof32 F
+GLIBC_2.30 remquof32x F
+GLIBC_2.30 remquof64 F
+GLIBC_2.30 remquol F
+GLIBC_2.30 rint F
+GLIBC_2.30 rintf F
+GLIBC_2.30 rintf32 F
+GLIBC_2.30 rintf32x F
+GLIBC_2.30 rintf64 F
+GLIBC_2.30 rintl F
+GLIBC_2.30 round F
+GLIBC_2.30 roundeven F
+GLIBC_2.30 roundevenf F
+GLIBC_2.30 roundevenf32 F
+GLIBC_2.30 roundevenf32x F
+GLIBC_2.30 roundevenf64 F
+GLIBC_2.30 roundevenl F
+GLIBC_2.30 roundf F
+GLIBC_2.30 roundf32 F
+GLIBC_2.30 roundf32x F
+GLIBC_2.30 roundf64 F
+GLIBC_2.30 roundl F
+GLIBC_2.30 scalb F
+GLIBC_2.30 scalbf F
+GLIBC_2.30 scalbl F
+GLIBC_2.30 scalbln F
+GLIBC_2.30 scalblnf F
+GLIBC_2.30 scalblnf32 F
+GLIBC_2.30 scalblnf32x F
+GLIBC_2.30 scalblnf64 F
+GLIBC_2.30 scalblnl F
+GLIBC_2.30 scalbn F
+GLIBC_2.30 scalbnf F
+GLIBC_2.30 scalbnf32 F
+GLIBC_2.30 scalbnf32x F
+GLIBC_2.30 scalbnf64 F
+GLIBC_2.30 scalbnl F
+GLIBC_2.30 setpayload F
+GLIBC_2.30 setpayloadf F
+GLIBC_2.30 setpayloadf32 F
+GLIBC_2.30 setpayloadf32x F
+GLIBC_2.30 setpayloadf64 F
+GLIBC_2.30 setpayloadl F
+GLIBC_2.30 setpayloadsig F
+GLIBC_2.30 setpayloadsigf F
+GLIBC_2.30 setpayloadsigf32 F
+GLIBC_2.30 setpayloadsigf32x F
+GLIBC_2.30 setpayloadsigf64 F
+GLIBC_2.30 setpayloadsigl F
+GLIBC_2.30 signgam D 0x4
+GLIBC_2.30 significand F
+GLIBC_2.30 significandf F
+GLIBC_2.30 significandl F
+GLIBC_2.30 sin F
+GLIBC_2.30 sincos F
+GLIBC_2.30 sincosf F
+GLIBC_2.30 sincosf32 F
+GLIBC_2.30 sincosf32x F
+GLIBC_2.30 sincosf64 F
+GLIBC_2.30 sincosl F
+GLIBC_2.30 sinf F
+GLIBC_2.30 sinf32 F
+GLIBC_2.30 sinf32x F
+GLIBC_2.30 sinf64 F
+GLIBC_2.30 sinh F
+GLIBC_2.30 sinhf F
+GLIBC_2.30 sinhf32 F
+GLIBC_2.30 sinhf32x F
+GLIBC_2.30 sinhf64 F
+GLIBC_2.30 sinhl F
+GLIBC_2.30 sinl F
+GLIBC_2.30 sqrt F
+GLIBC_2.30 sqrtf F
+GLIBC_2.30 sqrtf32 F
+GLIBC_2.30 sqrtf32x F
+GLIBC_2.30 sqrtf64 F
+GLIBC_2.30 sqrtl F
+GLIBC_2.30 tan F
+GLIBC_2.30 tanf F
+GLIBC_2.30 tanf32 F
+GLIBC_2.30 tanf32x F
+GLIBC_2.30 tanf64 F
+GLIBC_2.30 tanh F
+GLIBC_2.30 tanhf F
+GLIBC_2.30 tanhf32 F
+GLIBC_2.30 tanhf32x F
+GLIBC_2.30 tanhf64 F
+GLIBC_2.30 tanhl F
+GLIBC_2.30 tanl F
+GLIBC_2.30 tgamma F
+GLIBC_2.30 tgammaf F
+GLIBC_2.30 tgammaf32 F
+GLIBC_2.30 tgammaf32x F
+GLIBC_2.30 tgammaf64 F
+GLIBC_2.30 tgammal F
+GLIBC_2.30 totalorder F
+GLIBC_2.30 totalorderf F
+GLIBC_2.30 totalorderf32 F
+GLIBC_2.30 totalorderf32x F
+GLIBC_2.30 totalorderf64 F
+GLIBC_2.30 totalorderl F
+GLIBC_2.30 totalordermag F
+GLIBC_2.30 totalordermagf F
+GLIBC_2.30 totalordermagf32 F
+GLIBC_2.30 totalordermagf32x F
+GLIBC_2.30 totalordermagf64 F
+GLIBC_2.30 totalordermagl F
+GLIBC_2.30 trunc F
+GLIBC_2.30 truncf F
+GLIBC_2.30 truncf32 F
+GLIBC_2.30 truncf32x F
+GLIBC_2.30 truncf64 F
+GLIBC_2.30 truncl F
+GLIBC_2.30 ufromfp F
+GLIBC_2.30 ufromfpf F
+GLIBC_2.30 ufromfpf32 F
+GLIBC_2.30 ufromfpf32x F
+GLIBC_2.30 ufromfpf64 F
+GLIBC_2.30 ufromfpl F
+GLIBC_2.30 ufromfpx F
+GLIBC_2.30 ufromfpxf F
+GLIBC_2.30 ufromfpxf32 F
+GLIBC_2.30 ufromfpxf32x F
+GLIBC_2.30 ufromfpxf64 F
+GLIBC_2.30 ufromfpxl F
+GLIBC_2.30 y0 F
+GLIBC_2.30 y0f F
+GLIBC_2.30 y0f32 F
+GLIBC_2.30 y0f32x F
+GLIBC_2.30 y0f64 F
+GLIBC_2.30 y0l F
+GLIBC_2.30 y1 F
+GLIBC_2.30 y1f F
+GLIBC_2.30 y1f32 F
+GLIBC_2.30 y1f32x F
+GLIBC_2.30 y1f64 F
+GLIBC_2.30 y1l F
+GLIBC_2.30 yn F
+GLIBC_2.30 ynf F
+GLIBC_2.30 ynf32 F
+GLIBC_2.30 ynf32x F
+GLIBC_2.30 ynf64 F
+GLIBC_2.30 ynl F
diff --git a/sysdeps/unix/sysv/linux/nds32/libpthread.abilist b/sysdeps/unix/sysv/linux/nds32/libpthread.abilist
new file mode 100644
index 0000000..64a8670
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/libpthread.abilist
@@ -0,0 +1,235 @@
+GLIBC_2.30 _IO_flockfile F
+GLIBC_2.30 _IO_ftrylockfile F
+GLIBC_2.30 _IO_funlockfile F
+GLIBC_2.30 __close F
+GLIBC_2.30 __connect F
+GLIBC_2.30 __errno_location F
+GLIBC_2.30 __h_errno_location F
+GLIBC_2.30 __libc_allocate_rtsig F
+GLIBC_2.30 __libc_current_sigrtmax F
+GLIBC_2.30 __libc_current_sigrtmin F
+GLIBC_2.30 __lseek F
+GLIBC_2.30 __nanosleep F
+GLIBC_2.30 __open F
+GLIBC_2.30 __open64 F
+GLIBC_2.30 __pread64 F
+GLIBC_2.30 __pthread_cleanup_routine F
+GLIBC_2.30 __pthread_getspecific F
+GLIBC_2.30 __pthread_key_create F
+GLIBC_2.30 __pthread_mutex_destroy F
+GLIBC_2.30 __pthread_mutex_init F
+GLIBC_2.30 __pthread_mutex_lock F
+GLIBC_2.30 __pthread_mutex_trylock F
+GLIBC_2.30 __pthread_mutex_unlock F
+GLIBC_2.30 __pthread_mutexattr_destroy F
+GLIBC_2.30 __pthread_mutexattr_init F
+GLIBC_2.30 __pthread_mutexattr_settype F
+GLIBC_2.30 __pthread_once F
+GLIBC_2.30 __pthread_register_cancel F
+GLIBC_2.30 __pthread_register_cancel_defer F
+GLIBC_2.30 __pthread_rwlock_destroy F
+GLIBC_2.30 __pthread_rwlock_init F
+GLIBC_2.30 __pthread_rwlock_rdlock F
+GLIBC_2.30 __pthread_rwlock_tryrdlock F
+GLIBC_2.30 __pthread_rwlock_trywrlock F
+GLIBC_2.30 __pthread_rwlock_unlock F
+GLIBC_2.30 __pthread_rwlock_wrlock F
+GLIBC_2.30 __pthread_setspecific F
+GLIBC_2.30 __pthread_unregister_cancel F
+GLIBC_2.30 __pthread_unregister_cancel_restore F
+GLIBC_2.30 __pthread_unwind_next F
+GLIBC_2.30 __pwrite64 F
+GLIBC_2.30 __read F
+GLIBC_2.30 __res_state F
+GLIBC_2.30 __send F
+GLIBC_2.30 __sigaction F
+GLIBC_2.30 __wait F
+GLIBC_2.30 __write F
+GLIBC_2.30 _pthread_cleanup_pop F
+GLIBC_2.30 _pthread_cleanup_pop_restore F
+GLIBC_2.30 _pthread_cleanup_push F
+GLIBC_2.30 _pthread_cleanup_push_defer F
+GLIBC_2.30 accept F
+GLIBC_2.30 call_once F
+GLIBC_2.30 close F
+GLIBC_2.30 cnd_broadcast F
+GLIBC_2.30 cnd_destroy F
+GLIBC_2.30 cnd_init F
+GLIBC_2.30 cnd_signal F
+GLIBC_2.30 cnd_timedwait F
+GLIBC_2.30 cnd_wait F
+GLIBC_2.30 connect F
+GLIBC_2.30 flockfile F
+GLIBC_2.30 fsync F
+GLIBC_2.30 ftrylockfile F
+GLIBC_2.30 funlockfile F
+GLIBC_2.30 lseek F
+GLIBC_2.30 lseek64 F
+GLIBC_2.30 msync F
+GLIBC_2.30 mtx_destroy F
+GLIBC_2.30 mtx_init F
+GLIBC_2.30 mtx_lock F
+GLIBC_2.30 mtx_timedlock F
+GLIBC_2.30 mtx_trylock F
+GLIBC_2.30 mtx_unlock F
+GLIBC_2.30 nanosleep F
+GLIBC_2.30 open F
+GLIBC_2.30 open64 F
+GLIBC_2.30 pause F
+GLIBC_2.30 pread F
+GLIBC_2.30 pread64 F
+GLIBC_2.30 pthread_attr_destroy F
+GLIBC_2.30 pthread_attr_getaffinity_np F
+GLIBC_2.30 pthread_attr_getdetachstate F
+GLIBC_2.30 pthread_attr_getguardsize F
+GLIBC_2.30 pthread_attr_getinheritsched F
+GLIBC_2.30 pthread_attr_getschedparam F
+GLIBC_2.30 pthread_attr_getschedpolicy F
+GLIBC_2.30 pthread_attr_getscope F
+GLIBC_2.30 pthread_attr_getstack F
+GLIBC_2.30 pthread_attr_getstackaddr F
+GLIBC_2.30 pthread_attr_getstacksize F
+GLIBC_2.30 pthread_attr_init F
+GLIBC_2.30 pthread_attr_setaffinity_np F
+GLIBC_2.30 pthread_attr_setdetachstate F
+GLIBC_2.30 pthread_attr_setguardsize F
+GLIBC_2.30 pthread_attr_setinheritsched F
+GLIBC_2.30 pthread_attr_setschedparam F
+GLIBC_2.30 pthread_attr_setschedpolicy F
+GLIBC_2.30 pthread_attr_setscope F
+GLIBC_2.30 pthread_attr_setstack F
+GLIBC_2.30 pthread_attr_setstackaddr F
+GLIBC_2.30 pthread_attr_setstacksize F
+GLIBC_2.30 pthread_barrier_destroy F
+GLIBC_2.30 pthread_barrier_init F
+GLIBC_2.30 pthread_barrier_wait F
+GLIBC_2.30 pthread_barrierattr_destroy F
+GLIBC_2.30 pthread_barrierattr_getpshared F
+GLIBC_2.30 pthread_barrierattr_init F
+GLIBC_2.30 pthread_barrierattr_setpshared F
+GLIBC_2.30 pthread_cancel F
+GLIBC_2.30 pthread_cond_broadcast F
+GLIBC_2.30 pthread_cond_destroy F
+GLIBC_2.30 pthread_cond_init F
+GLIBC_2.30 pthread_cond_signal F
+GLIBC_2.30 pthread_cond_timedwait F
+GLIBC_2.30 pthread_cond_wait F
+GLIBC_2.30 pthread_condattr_destroy F
+GLIBC_2.30 pthread_condattr_getclock F
+GLIBC_2.30 pthread_condattr_getpshared F
+GLIBC_2.30 pthread_condattr_init F
+GLIBC_2.30 pthread_condattr_setclock F
+GLIBC_2.30 pthread_condattr_setpshared F
+GLIBC_2.30 pthread_create F
+GLIBC_2.30 pthread_detach F
+GLIBC_2.30 pthread_equal F
+GLIBC_2.30 pthread_exit F
+GLIBC_2.30 pthread_getaffinity_np F
+GLIBC_2.30 pthread_getattr_default_np F
+GLIBC_2.30 pthread_getattr_np F
+GLIBC_2.30 pthread_getconcurrency F
+GLIBC_2.30 pthread_getcpuclockid F
+GLIBC_2.30 pthread_getname_np F
+GLIBC_2.30 pthread_getschedparam F
+GLIBC_2.30 pthread_getspecific F
+GLIBC_2.30 pthread_join F
+GLIBC_2.30 pthread_key_create F
+GLIBC_2.30 pthread_key_delete F
+GLIBC_2.30 pthread_kill F
+GLIBC_2.30 pthread_kill_other_threads_np F
+GLIBC_2.30 pthread_mutex_consistent F
+GLIBC_2.30 pthread_mutex_consistent_np F
+GLIBC_2.30 pthread_mutex_destroy F
+GLIBC_2.30 pthread_mutex_getprioceiling F
+GLIBC_2.30 pthread_mutex_init F
+GLIBC_2.30 pthread_mutex_lock F
+GLIBC_2.30 pthread_mutex_setprioceiling F
+GLIBC_2.30 pthread_mutex_timedlock F
+GLIBC_2.30 pthread_mutex_trylock F
+GLIBC_2.30 pthread_mutex_unlock F
+GLIBC_2.30 pthread_mutexattr_destroy F
+GLIBC_2.30 pthread_mutexattr_getkind_np F
+GLIBC_2.30 pthread_mutexattr_getprioceiling F
+GLIBC_2.30 pthread_mutexattr_getprotocol F
+GLIBC_2.30 pthread_mutexattr_getpshared F
+GLIBC_2.30 pthread_mutexattr_getrobust F
+GLIBC_2.30 pthread_mutexattr_getrobust_np F
+GLIBC_2.30 pthread_mutexattr_gettype F
+GLIBC_2.30 pthread_mutexattr_init F
+GLIBC_2.30 pthread_mutexattr_setkind_np F
+GLIBC_2.30 pthread_mutexattr_setprioceiling F
+GLIBC_2.30 pthread_mutexattr_setprotocol F
+GLIBC_2.30 pthread_mutexattr_setpshared F
+GLIBC_2.30 pthread_mutexattr_setrobust F
+GLIBC_2.30 pthread_mutexattr_setrobust_np F
+GLIBC_2.30 pthread_mutexattr_settype F
+GLIBC_2.30 pthread_once F
+GLIBC_2.30 pthread_rwlock_destroy F
+GLIBC_2.30 pthread_rwlock_init F
+GLIBC_2.30 pthread_rwlock_rdlock F
+GLIBC_2.30 pthread_rwlock_timedrdlock F
+GLIBC_2.30 pthread_rwlock_timedwrlock F
+GLIBC_2.30 pthread_rwlock_tryrdlock F
+GLIBC_2.30 pthread_rwlock_trywrlock F
+GLIBC_2.30 pthread_rwlock_unlock F
+GLIBC_2.30 pthread_rwlock_wrlock F
+GLIBC_2.30 pthread_rwlockattr_destroy F
+GLIBC_2.30 pthread_rwlockattr_getkind_np F
+GLIBC_2.30 pthread_rwlockattr_getpshared F
+GLIBC_2.30 pthread_rwlockattr_init F
+GLIBC_2.30 pthread_rwlockattr_setkind_np F
+GLIBC_2.30 pthread_rwlockattr_setpshared F
+GLIBC_2.30 pthread_setaffinity_np F
+GLIBC_2.30 pthread_setattr_default_np F
+GLIBC_2.30 pthread_setcancelstate F
+GLIBC_2.30 pthread_setcanceltype F
+GLIBC_2.30 pthread_setconcurrency F
+GLIBC_2.30 pthread_setname_np F
+GLIBC_2.30 pthread_setschedparam F
+GLIBC_2.30 pthread_setschedprio F
+GLIBC_2.30 pthread_setspecific F
+GLIBC_2.30 pthread_sigmask F
+GLIBC_2.30 pthread_sigqueue F
+GLIBC_2.30 pthread_spin_destroy F
+GLIBC_2.30 pthread_spin_init F
+GLIBC_2.30 pthread_spin_lock F
+GLIBC_2.30 pthread_spin_trylock F
+GLIBC_2.30 pthread_spin_unlock F
+GLIBC_2.30 pthread_testcancel F
+GLIBC_2.30 pthread_timedjoin_np F
+GLIBC_2.30 pthread_tryjoin_np F
+GLIBC_2.30 pthread_yield F
+GLIBC_2.30 pwrite F
+GLIBC_2.30 pwrite64 F
+GLIBC_2.30 raise F
+GLIBC_2.30 read F
+GLIBC_2.30 recv F
+GLIBC_2.30 recvfrom F
+GLIBC_2.30 recvmsg F
+GLIBC_2.30 sem_close F
+GLIBC_2.30 sem_destroy F
+GLIBC_2.30 sem_getvalue F
+GLIBC_2.30 sem_init F
+GLIBC_2.30 sem_open F
+GLIBC_2.30 sem_post F
+GLIBC_2.30 sem_timedwait F
+GLIBC_2.30 sem_trywait F
+GLIBC_2.30 sem_unlink F
+GLIBC_2.30 sem_wait F
+GLIBC_2.30 send F
+GLIBC_2.30 sendmsg F
+GLIBC_2.30 sendto F
+GLIBC_2.30 sigaction F
+GLIBC_2.30 sigwait F
+GLIBC_2.30 tcdrain F
+GLIBC_2.30 thrd_create F
+GLIBC_2.30 thrd_detach F
+GLIBC_2.30 thrd_exit F
+GLIBC_2.30 thrd_join F
+GLIBC_2.30 tss_create F
+GLIBC_2.30 tss_delete F
+GLIBC_2.30 tss_get F
+GLIBC_2.30 tss_set F
+GLIBC_2.30 wait F
+GLIBC_2.30 waitpid F
+GLIBC_2.30 write F
diff --git a/sysdeps/unix/sysv/linux/nds32/libresolv.abilist b/sysdeps/unix/sysv/linux/nds32/libresolv.abilist
new file mode 100644
index 0000000..ca745f5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/libresolv.abilist
@@ -0,0 +1,79 @@
+GLIBC_2.30 __b64_ntop F
+GLIBC_2.30 __b64_pton F
+GLIBC_2.30 __dn_comp F
+GLIBC_2.30 __dn_count_labels F
+GLIBC_2.30 __dn_expand F
+GLIBC_2.30 __dn_skipname F
+GLIBC_2.30 __fp_nquery F
+GLIBC_2.30 __fp_query F
+GLIBC_2.30 __fp_resstat F
+GLIBC_2.30 __hostalias F
+GLIBC_2.30 __loc_aton F
+GLIBC_2.30 __loc_ntoa F
+GLIBC_2.30 __p_cdname F
+GLIBC_2.30 __p_cdnname F
+GLIBC_2.30 __p_class F
+GLIBC_2.30 __p_class_syms D 0x54
+GLIBC_2.30 __p_fqname F
+GLIBC_2.30 __p_fqnname F
+GLIBC_2.30 __p_option F
+GLIBC_2.30 __p_query F
+GLIBC_2.30 __p_rcode F
+GLIBC_2.30 __p_time F
+GLIBC_2.30 __p_type F
+GLIBC_2.30 __p_type_syms D 0x228
+GLIBC_2.30 __putlong F
+GLIBC_2.30 __putshort F
+GLIBC_2.30 __res_close F
+GLIBC_2.30 __res_dnok F
+GLIBC_2.30 __res_hnok F
+GLIBC_2.30 __res_hostalias F
+GLIBC_2.30 __res_isourserver F
+GLIBC_2.30 __res_mailok F
+GLIBC_2.30 __res_mkquery F
+GLIBC_2.30 __res_nameinquery F
+GLIBC_2.30 __res_nmkquery F
+GLIBC_2.30 __res_nquery F
+GLIBC_2.30 __res_nquerydomain F
+GLIBC_2.30 __res_nsearch F
+GLIBC_2.30 __res_nsend F
+GLIBC_2.30 __res_ownok F
+GLIBC_2.30 __res_queriesmatch F
+GLIBC_2.30 __res_query F
+GLIBC_2.30 __res_querydomain F
+GLIBC_2.30 __res_search F
+GLIBC_2.30 __res_send F
+GLIBC_2.30 __sym_ntop F
+GLIBC_2.30 __sym_ntos F
+GLIBC_2.30 __sym_ston F
+GLIBC_2.30 _getlong F
+GLIBC_2.30 _getshort F
+GLIBC_2.30 inet_net_ntop F
+GLIBC_2.30 inet_net_pton F
+GLIBC_2.30 inet_neta F
+GLIBC_2.30 ns_datetosecs F
+GLIBC_2.30 ns_format_ttl F
+GLIBC_2.30 ns_get16 F
+GLIBC_2.30 ns_get32 F
+GLIBC_2.30 ns_initparse F
+GLIBC_2.30 ns_makecanon F
+GLIBC_2.30 ns_msg_getflag F
+GLIBC_2.30 ns_name_compress F
+GLIBC_2.30 ns_name_ntol F
+GLIBC_2.30 ns_name_ntop F
+GLIBC_2.30 ns_name_pack F
+GLIBC_2.30 ns_name_pton F
+GLIBC_2.30 ns_name_rollback F
+GLIBC_2.30 ns_name_skip F
+GLIBC_2.30 ns_name_uncompress F
+GLIBC_2.30 ns_name_unpack F
+GLIBC_2.30 ns_parse_ttl F
+GLIBC_2.30 ns_parserr F
+GLIBC_2.30 ns_put16 F
+GLIBC_2.30 ns_put32 F
+GLIBC_2.30 ns_samedomain F
+GLIBC_2.30 ns_samename F
+GLIBC_2.30 ns_skiprr F
+GLIBC_2.30 ns_sprintrr F
+GLIBC_2.30 ns_sprintrrf F
+GLIBC_2.30 ns_subdomain F
diff --git a/sysdeps/unix/sysv/linux/nds32/librt.abilist b/sysdeps/unix/sysv/linux/nds32/librt.abilist
new file mode 100644
index 0000000..8d39a08
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/librt.abilist
@@ -0,0 +1,35 @@
+GLIBC_2.30 __mq_open_2 F
+GLIBC_2.30 aio_cancel F
+GLIBC_2.30 aio_cancel64 F
+GLIBC_2.30 aio_error F
+GLIBC_2.30 aio_error64 F
+GLIBC_2.30 aio_fsync F
+GLIBC_2.30 aio_fsync64 F
+GLIBC_2.30 aio_init F
+GLIBC_2.30 aio_read F
+GLIBC_2.30 aio_read64 F
+GLIBC_2.30 aio_return F
+GLIBC_2.30 aio_return64 F
+GLIBC_2.30 aio_suspend F
+GLIBC_2.30 aio_suspend64 F
+GLIBC_2.30 aio_write F
+GLIBC_2.30 aio_write64 F
+GLIBC_2.30 lio_listio F
+GLIBC_2.30 lio_listio64 F
+GLIBC_2.30 mq_close F
+GLIBC_2.30 mq_getattr F
+GLIBC_2.30 mq_notify F
+GLIBC_2.30 mq_open F
+GLIBC_2.30 mq_receive F
+GLIBC_2.30 mq_send F
+GLIBC_2.30 mq_setattr F
+GLIBC_2.30 mq_timedreceive F
+GLIBC_2.30 mq_timedsend F
+GLIBC_2.30 mq_unlink F
+GLIBC_2.30 shm_open F
+GLIBC_2.30 shm_unlink F
+GLIBC_2.30 timer_create F
+GLIBC_2.30 timer_delete F
+GLIBC_2.30 timer_getoverrun F
+GLIBC_2.30 timer_gettime F
+GLIBC_2.30 timer_settime F
diff --git a/sysdeps/unix/sysv/linux/nds32/libthread_db.abilist b/sysdeps/unix/sysv/linux/nds32/libthread_db.abilist
new file mode 100644
index 0000000..94220c9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/libthread_db.abilist
@@ -0,0 +1,40 @@
+GLIBC_2.30 td_init F
+GLIBC_2.30 td_log F
+GLIBC_2.30 td_symbol_list F
+GLIBC_2.30 td_ta_clear_event F
+GLIBC_2.30 td_ta_delete F
+GLIBC_2.30 td_ta_enable_stats F
+GLIBC_2.30 td_ta_event_addr F
+GLIBC_2.30 td_ta_event_getmsg F
+GLIBC_2.30 td_ta_get_nthreads F
+GLIBC_2.30 td_ta_get_ph F
+GLIBC_2.30 td_ta_get_stats F
+GLIBC_2.30 td_ta_map_id2thr F
+GLIBC_2.30 td_ta_map_lwp2thr F
+GLIBC_2.30 td_ta_new F
+GLIBC_2.30 td_ta_reset_stats F
+GLIBC_2.30 td_ta_set_event F
+GLIBC_2.30 td_ta_setconcurrency F
+GLIBC_2.30 td_ta_thr_iter F
+GLIBC_2.30 td_ta_tsd_iter F
+GLIBC_2.30 td_thr_clear_event F
+GLIBC_2.30 td_thr_dbresume F
+GLIBC_2.30 td_thr_dbsuspend F
+GLIBC_2.30 td_thr_event_enable F
+GLIBC_2.30 td_thr_event_getmsg F
+GLIBC_2.30 td_thr_get_info F
+GLIBC_2.30 td_thr_getfpregs F
+GLIBC_2.30 td_thr_getgregs F
+GLIBC_2.30 td_thr_getxregs F
+GLIBC_2.30 td_thr_getxregsize F
+GLIBC_2.30 td_thr_set_event F
+GLIBC_2.30 td_thr_setfpregs F
+GLIBC_2.30 td_thr_setgregs F
+GLIBC_2.30 td_thr_setprio F
+GLIBC_2.30 td_thr_setsigpending F
+GLIBC_2.30 td_thr_setxregs F
+GLIBC_2.30 td_thr_sigsetmask F
+GLIBC_2.30 td_thr_tls_get_addr F
+GLIBC_2.30 td_thr_tlsbase F
+GLIBC_2.30 td_thr_tsd F
+GLIBC_2.30 td_thr_validate F
diff --git a/sysdeps/unix/sysv/linux/nds32/libutil.abilist b/sysdeps/unix/sysv/linux/nds32/libutil.abilist
new file mode 100644
index 0000000..f745157
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/nds32/libutil.abilist
@@ -0,0 +1,6 @@
+GLIBC_2.30 forkpty F
+GLIBC_2.30 login F
+GLIBC_2.30 login_tty F
+GLIBC_2.30 logout F
+GLIBC_2.30 logwtmp F
+GLIBC_2.30 openpty F
-- 
1.9.5


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v4 10/11] Add nds32 entries to config.h.in
  2019-06-05 11:56 [PATCH v4 00/11] nds32 glibc port, v4 Vincent Chen
                   ` (8 preceding siblings ...)
  2019-06-05 11:56 ` [PATCH v4 09/11] nds32: Add ABI list Vincent Chen
@ 2019-06-05 11:56 ` Vincent Chen
  2019-06-05 11:56 ` [PATCH v4 11/11] Add nds32 port to build-many-glibcs.py Vincent Chen
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 28+ messages in thread
From: Vincent Chen @ 2019-06-05 11:56 UTC (permalink / raw
  To: libc-alpha, joseph; +Cc: deanbo422, cnoize, vincentc

2019-06-03  Vincent Chen  <vincentc@andestech.com>
2019-06-03  CheWei Chuang  <cnoize@andestech.com>

        * config.h.in: Regenerate.
---
 config.h.in | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/config.h.in b/config.h.in
index 824dfe8..83ad56c 100644
--- a/config.h.in
+++ b/config.h.in
@@ -124,6 +124,9 @@
 /* RISC-V floating-point ABI for ld.so.  */
 #undef RISCV_ABI_FLEN
 
+/* NDS32 floating-point ABI for ld.so.  */
+#undef NDS32_ABI_TYPE
+
 /* Linux specific: minimum supported kernel version.  */
 #undef	__LINUX_KERNEL_VERSION
 
-- 
1.9.5


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v4 11/11] Add nds32 port to build-many-glibcs.py
  2019-06-05 11:56 [PATCH v4 00/11] nds32 glibc port, v4 Vincent Chen
                   ` (9 preceding siblings ...)
  2019-06-05 11:56 ` [PATCH v4 10/11] Add nds32 entries to config.h.in Vincent Chen
@ 2019-06-05 11:56 ` Vincent Chen
  2019-06-06 22:47   ` Joseph Myers
  2019-06-05 12:28 ` [PATCH v4 00/11] nds32 glibc port, v4 Florian Weimer
  2019-06-06 22:34 ` Joseph Myers
  12 siblings, 1 reply; 28+ messages in thread
From: Vincent Chen @ 2019-06-05 11:56 UTC (permalink / raw
  To: libc-alpha, joseph; +Cc: deanbo422, cnoize, vincentc

From: CheWei Chunang <cnoize@andestech.com>

The nds32 toochain cannot be generated successfully by this patch because
the nds32 port of Binutils and GCC on upstream is too old. This patch is
used to help reviewer to review the glibc port for Andes nds32 ISA.

2019-06-03  Vincent Chen  <vincentc@andestech.com>
2019-06-03  CheWei Chuang  <cnoize@andestech.com>

        * scripts/build-many-glibcs.py (Context): Add nds32 targets.
---
 scripts/build-many-glibcs.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index c5821df..4bde3fa 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -299,6 +299,18 @@ class Context(object):
                                  'ccopts': '-mabi=32'},
                                 {'variant': 'n64-nan2008-soft',
                                  'ccopts': '-mabi=64'}])
+        self.add_config(arch='nds32le',
+                        os_name='linux-gnu',
+			variant='v3',
+                        gcc_cfg=['--with-arch=v3', '--with-cpu=n13',
+                                 '--enable-default-relax=no',
+                                 '--disable-multilib'])
+        self.add_config(arch='nds32le',
+                        os_name='linux-gnu',
+			variant='v3f',
+                        gcc_cfg=['--with-arch=v3f', '--with-cpu=n13',
+                                 '--enable-default-relax=no',
+                                 '--disable-multilib'])
         self.add_config(arch='nios2',
                         os_name='linux-gnu')
         self.add_config(arch='powerpc',
@@ -1269,6 +1281,7 @@ class Config(object):
                     'm68k': 'm68k',
                     'microblaze': 'microblaze',
                     'mips': 'mips',
+                    'nds32': 'nds32',
                     'nios2': 'nios2',
                     'powerpc': 'powerpc',
                     's390': 's390',
-- 
1.9.5


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: [PATCH v4 01/11] nds32: Build Infastructure
  2019-06-05 11:56 ` [PATCH v4 01/11] nds32: Build Infastructure Vincent Chen
@ 2019-06-05 12:18   ` Andreas Schwab
  2019-06-06  5:31     ` Vincent Chen
  0 siblings, 1 reply; 28+ messages in thread
From: Andreas Schwab @ 2019-06-05 12:18 UTC (permalink / raw
  To: Vincent Chen; +Cc: libc-alpha, joseph, deanbo422, cnoize

On Jun 05 2019, Vincent Chen <vincentc@andestech.com> wrote:

> diff --git a/sysdeps/unix/sysv/linux/nds32/Versions b/sysdeps/unix/sysv/linux/nds32/Versions
> new file mode 100644
> index 0000000..abe47ce
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/nds32/Versions
> @@ -0,0 +1,11 @@
> +ld {
> +  GLIBC_PRIVATE {
> +  # used for loading by static libraries
> +    _dl_var_init;
> +  }
> +}
> +libc {
> +  GLIBC_2.28 {

Since the base version is GLIBC_2.30, it doesn't make sense to reference
an earlier version.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v4 00/11] nds32 glibc port, v4
  2019-06-05 11:56 [PATCH v4 00/11] nds32 glibc port, v4 Vincent Chen
                   ` (10 preceding siblings ...)
  2019-06-05 11:56 ` [PATCH v4 11/11] Add nds32 port to build-many-glibcs.py Vincent Chen
@ 2019-06-05 12:28 ` Florian Weimer
  2019-06-06  2:59   ` Vincent Chen
  2019-06-06 22:34 ` Joseph Myers
  12 siblings, 1 reply; 28+ messages in thread
From: Florian Weimer @ 2019-06-05 12:28 UTC (permalink / raw
  To: Vincent Chen; +Cc: libc-alpha, joseph, deanbo422, cnoize

* Vincent Chen:

>    7. misc/tst-syscall-list
>         This case turns to PASS if I add NR_fp_udfiex_crtl to 
>       linux/syscall-names.list

I think the actual system call name is fp_udfiex_crtl, and this can go
in immediately as a separate patch (it's not necessary to wait for the
upstream kernel release).

Thanks,
Florian

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v4 00/11] nds32 glibc port, v4
  2019-06-05 12:28 ` [PATCH v4 00/11] nds32 glibc port, v4 Florian Weimer
@ 2019-06-06  2:59   ` Vincent Chen
  2019-06-07  7:17     ` Florian Weimer
  0 siblings, 1 reply; 28+ messages in thread
From: Vincent Chen @ 2019-06-06  2:59 UTC (permalink / raw
  To: Florian Weimer
  Cc: libc-alpha@sourceware.org, joseph@codesourcery.com,
	deanbo422@gmail.com, Che-Wei Chuang (??????)

On Wed, Jun 05, 2019 at 08:28:15PM +0800, Florian Weimer wrote:
> * Vincent Chen:
> 
> >    7. misc/tst-syscall-list
> >         This case turns to PASS if I add NR_fp_udfiex_crtl to 
> >       linux/syscall-names.list
> 
> I think the actual system call name is fp_udfiex_crtl, and this can go
> in immediately as a separate patch (it's not necessary to wait for the
> upstream kernel release).
>
Yes, the actual system call name is fp_udfiex_crtl. I will use a
separate patch to complete it in the next version patchset.

Thanks,
Vincent

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v4 01/11] nds32: Build Infastructure
  2019-06-05 12:18   ` Andreas Schwab
@ 2019-06-06  5:31     ` Vincent Chen
  0 siblings, 0 replies; 28+ messages in thread
From: Vincent Chen @ 2019-06-06  5:31 UTC (permalink / raw
  To: Andreas Schwab
  Cc: libc-alpha@sourceware.org, joseph@codesourcery.com,
	deanbo422@gmail.com, Che-Wei Chuang (??????)

On Wed, Jun 05, 2019 at 08:18:10PM +0800, Andreas Schwab wrote:
> On Jun 05 2019, Vincent Chen <vincentc@andestech.com> wrote:
> 
> > diff --git a/sysdeps/unix/sysv/linux/nds32/Versions b/sysdeps/unix/sysv/linux/nds32/Versions
> > new file mode 100644
> > index 0000000..abe47ce
> > --- /dev/null
> > +++ b/sysdeps/unix/sysv/linux/nds32/Versions
> > @@ -0,0 +1,11 @@
> > +ld {
> > +  GLIBC_PRIVATE {
> > +  # used for loading by static libraries
> > +    _dl_var_init;
> > +  }
> > +}
> > +libc {
> > +  GLIBC_2.28 {
> 
> Since the base version is GLIBC_2.30, it doesn't make sense to reference
> an earlier version.
>
I forget to update it. I will modify it in the next version patch.
Thanks for your reminder.

Regards,
Vincent

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v4 00/11] nds32 glibc port, v4
  2019-06-05 11:56 [PATCH v4 00/11] nds32 glibc port, v4 Vincent Chen
                   ` (11 preceding siblings ...)
  2019-06-05 12:28 ` [PATCH v4 00/11] nds32 glibc port, v4 Florian Weimer
@ 2019-06-06 22:34 ` Joseph Myers
  2019-06-10  7:15   ` Vincent Chen
  12 siblings, 1 reply; 28+ messages in thread
From: Joseph Myers @ 2019-06-06 22:34 UTC (permalink / raw
  To: Vincent Chen; +Cc: libc-alpha, deanbo422, cnoize

On Wed, 5 Jun 2019, Vincent Chen wrote:

>   This is the fourth version of the nds32 port. I am sorry that one year has
> passed since the previous submission. The most obvious modification in this
> version patchset is that FPU extension is supported now.In addition,
> the mainline of gcc and binutils has contained the nds32 ports.Hence, the
> nds32 toolchain without FPU extension support can be derived through
> build-many-glibcs.py. The toolchain with FPU extension needs an extra kernel
> patchset to successfully compile. This patchset has been pulled and may be
> released in 5.2 rc-4. The implementations for nds32 FPU extension are like
> other architecture except for the following two parts.

Please see <https://sourceware.org/glibc/wiki/NewPorts> and make sure the 
port submission follows what is described there.  In particular: (a) give 
pointers to the relevant instruction set and ABI manuals 
(<https://gcc.gnu.org/readings.html> points to a page with a great many 
manuals, pointers directly to exactly the ones that are relevant would be 
helpful); (b) fix coding style issues, such as brace positioning, 
indentation and missing spaces before '('.

> B. The analysis of FAIL cases: 
>    1. The following 20 cases have same error behevior, namespace violation:
>       "SIOCGSTAMP_OLD", "SIOCGSTAMPNSD", "fds_bits" and "val". The cause of 
>       the first two cases, "SIOCGSTAMP_OLD" and "SIOCGSTAMPNSD", is the same
>       that Linux kernel recently added the definition of these two macros in
>       asm-generic/sockios.h. For the last two cases, kernel header
>       uapi/asm-generic/socket.h includes linux/posix_types.h instead of
>       asm/bitsperlong.h. This change introduces the two variables "fds_bits"
>       and "val" declared in the linux/posix_types.h and
>       asm-generic/posix_types.h.

fds_bits and val are a generic Linux kernel issue - a patch was sent to 
linux-api in March and acked by David Miller but still didn't get into the 
Linux kernel in 5.1 (and, indeed, still hasn't got into the kernel).  I'm 
not sure what the holdup is there, but for now we should assume that Linux 
kernel header versions later than 5.0 are not suitable for use in glibc 
(and so probably avoid adding any new ports depending on newer kernel 
header versions, because of the possibility of being unable to test them 
effectively for an indefinite period while build-many-glibcs.py is stuck 
on 5.0).

The others also sound like a generic issue.  Please *start a separate 
thread on them, not part of the port submission*.  Is this like the case 
where sysdeps/unix/sysv/linux/bits/socket.h has

/* Ugly workaround for unclean kernel headers.  */

for some existing macros?  If so, you should send a patch for that, 
extending the workaround to the new macros (again, not part of the port 
submission, not marked as part of the port submission, because it's an 
independent issue).

>    2. locale/tst-locale-locpath
>         I found that the failure is caused by missing the environment parameter
>       when this testcase is executed on FPGA through cross-test-ssh.sh. I try
>       to modify the Makefile rule of tst-locale-locpath.out to "$(SHELL) $<
>       '$(common-objpfx)' '$(test-wrapper-env)' '$(run_program_env)' > $ @;"
>       .However, the content of $ (run_program_env) is empty so that the
>       environment parameter is still empty.
>         The testcase passed if I set the environment parameters by manually.

Again, start an independent thread on this issue.  I'm not sure if 
$(run_program_env) should be passed at all (given how this test is 
deliberately overriding the default environment), but in any case, the 
call in the Makefile should be consistent with the test script - and this 
needs to be discussed outside the context of a port submission.

>    3. libio/tst-wfile-sync.test-result
>         The testcases will try to operate the standard input file by lseek
>       function. However, the standard input is pipe instead of file if this
>       testcase run on FPGA through cross-test-ssh.sh. This causes testcase gets
>       an unexpected error ESPIPE from the return of the lseek function.
>         The testcase passed if it was directly executed on FPGA board.

Likewise, start a separate thread, not marked as part of a port 
submission, for any such architecture-independent issue; resolve such 
issues first and ensure the port submission only needs to include 
genuinely architecture-specific patches.

>         I tried to port the latest soft-fp module from glibc to kernel, and the
>       above 21 failed testcases turned into PASS based on the latest soft-fp
>       module. By the way, I found that Joseph tried to update the soft-fp
>       module in Linux kernel in 2015, but the last status of the patchset seems
>       to remain pending due to the lack of ACK from sparc maintainer. Does
>       Joseph have any plans to resend the patchset?

No.  It was accepted by the powerpc maintainers into a branch with a 
statement "I'll ask Stephen to put it in linux-next once 4.3-rc1 is out, 
and I'll ask Linus to pull it for 4.4".  I don't know what the holdup is 
that stopped it going further.  There was an issue with sparc compilers 
that didn't default to -mlong-double-128, but a patch for that was added 
in Nov 2015.  There was a build robot reporting new warnings on sh but I 
didn't think they indicated any actual problems that were new with the 
patch (which was acked for sh).

Since that patch series deals with the hard part of an update (i.e. 
updating the kernel code across several architectures for extensive API 
changes in glibc soft-fp made as part of the optimization project 
described in the GCC Summit 2006 proceedings, and subsequently), I think 
it makes sense to integrate that patch series more or less as I posted it 
(plus, I suppose, a corresponding nds32 patch), and then possibly follow 
up with another update of the code to the latest glibc version (much 
easier because of the lack of API changes needing all-architectures 
fixes).

Note: I have a long list of issues with the powerpc math emulation in the 
Linux kernel (i.e., the architecture-specific code) that could reasonably 
be fixed after that series is in, and shorter lists for alpha and sh (all 
of those are lists as of 2015, I don't know if some of the issues might 
have been fixed in the kernel since then).

>    7. misc/tst-syscall-list
>         This case turns to PASS if I add NR_fp_udfiex_crtl to 
>       linux/syscall-names.list  

Again, send a separate patch outside of this series.

>    8.  The following 6 testcase fail because the testing environment lacks
>        native python: 
>       ./nptl/test-condattr-printers
>       ./nptl/test-cond-printers
>       ./nptl/test-mutexattr-printers
>       ./nptl/test-mutex-printers
>       ./nptl/test-rwlockattr-printers
>       ./nptl/test-rwlock-printers
> 
>    9.  stdio-common/bug22 
>          The required memory size for this testcase is more than 2 GB but
>        the DRAM size on our FPGA is just 2GB. Therefore, the errno is set as
>        ENOMEM instead of EOVERFLOW.
> 
>   10.  bug20790.test-result
>          It fails because the testing environment lacks native cpp

These are on the list of known architecture-independent issues on the 
per-release wiki pages, thus can be ignored for the purposes of the 
expectation of no more than 20 architecture-specific test failures.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v4 02/11] nds32: ABI Implementation
  2019-06-05 11:56 ` [PATCH v4 02/11] nds32: ABI Implementation Vincent Chen
@ 2019-06-06 22:37   ` Joseph Myers
  2019-06-10  2:34     ` Vincent Chen
  0 siblings, 1 reply; 28+ messages in thread
From: Joseph Myers @ 2019-06-06 22:37 UTC (permalink / raw
  To: Vincent Chen; +Cc: libc-alpha, deanbo422, cnoize

On Wed, 5 Jun 2019, Vincent Chen wrote:

> diff --git a/locale/Makefile b/locale/Makefile
> index 0ad99ec..803a3a5 100644
> --- a/locale/Makefile
> +++ b/locale/Makefile
> @@ -113,5 +113,5 @@ lib := locale-programs
>  include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
>  
>  $(objpfx)tst-locale-locpath.out : tst-locale-locpath.sh $(objpfx)locale
> -	$(SHELL) $< '$(common-objpfx)' '$(test-wrapper)' '$(test-wrapper-env)' > $@; \
> +	$(SHELL) $< '$(common-objpfx)' '$(test-wrapper-env)' '$(run_program_env)'> $@; \
>  	$(evaluate-test)

Never mix this sort of architecture-independent patch into an 
architecture-specific one; post separately with its own justification.

> +  } __jmp_buf[1] __attribute__((__aligned__ (8)));

Example of a coding style issue, missing space before '(' (fix everywhere 
in this series).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v4 05/11] nds32: Generic <math.h>, soft-fp and hard-fp Routines
  2019-06-05 11:56 ` [PATCH v4 05/11] nds32: Generic <math.h>, soft-fp and hard-fp Routines Vincent Chen
@ 2019-06-06 22:41   ` Joseph Myers
  2019-06-10  2:43     ` Vincent Chen
  0 siblings, 1 reply; 28+ messages in thread
From: Joseph Myers @ 2019-06-06 22:41 UTC (permalink / raw
  To: Vincent Chen; +Cc: libc-alpha, deanbo422, cnoize

On Wed, 5 Jun 2019, Vincent Chen wrote:

> +double __ieee754_sqrt (double x)

Example of a coding style issue, should have the function name in a 
definition at the start of a new line (separate line from return type).  
This only applies in definitions, not in function declarations that are 
not definitions.  Please fix everywhere in the patch series.

> +  if (__KERNEL_SUPPORT_SUBNOR_OUTPUT) {

Example of a coding style issue, '{' should go on its own line, indented 
two columns from the line above (and then the contents of the block should 
be indented a further two columns).

> diff --git a/sysdeps/nds32/fpu/fenv_private.h b/sysdeps/nds32/fpu/fenv_private.h
> new file mode 100644
> index 0000000..45c13f6
> --- /dev/null
> +++ b/sysdeps/nds32/fpu/fenv_private.h

> +#ifndef NDS32_MATH_PRIVATE_H
> +#define NDS32_MATH_PRIVATE_H 1

That seems an inappropriate macro name for a fenv_private.h header.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v4 08/11] nds32: Linux ABI
  2019-06-05 11:56 ` [PATCH v4 08/11] nds32: Linux ABI Vincent Chen
@ 2019-06-06 22:45   ` Joseph Myers
  2019-06-10  2:53     ` Vincent Chen
  0 siblings, 1 reply; 28+ messages in thread
From: Joseph Myers @ 2019-06-06 22:45 UTC (permalink / raw
  To: Vincent Chen; +Cc: libc-alpha, deanbo422, cnoize

On Wed, 5 Jun 2019, Vincent Chen wrote:

> +int __ioctl (int __fd, unsigned long int __request, ...)
> +{
> +	unsigned long arg1;

Example coding style issue, indentation should be two columns not eight 
(tabs are always eight columns in glibc sources), as well as the 
previously noted issue of function name starting a new line.

> +	return INLINE_SYSCALL(ioctl,3,__fd,__request,arg1);

Example coding style issue, missing spaces after ','.

> +int __prctl (int __option, ...)
> +{
> +	unsigned long arg1,arg2,arg3,arg4;
> +	va_list arg;
> +	va_start (arg, __option);
> +	arg1 = va_arg (arg, unsigned long);
> +	arg2 = va_arg (arg, unsigned long);
> +	arg3 = va_arg (arg, unsigned long);
> +	arg4 = va_arg (arg, unsigned long);

Example coding style issue, should be "unsigned long int".

> +#ifdef __USE_MISC
> +# define __ctx(fld) fld
> +#else
> +# define __ctx(fld) __ ## fld
> +#endif

__ctx is only expected to be used for old ports where there might be 
existing code relying on the old names and we want as much API 
compatibility as possible.  For new ports, just use the __* names in this 
header unconditionally rather than having such a macro at all.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v4 11/11] Add nds32 port to build-many-glibcs.py
  2019-06-05 11:56 ` [PATCH v4 11/11] Add nds32 port to build-many-glibcs.py Vincent Chen
@ 2019-06-06 22:47   ` Joseph Myers
  2019-06-10  3:11     ` Vincent Chen
  0 siblings, 1 reply; 28+ messages in thread
From: Joseph Myers @ 2019-06-06 22:47 UTC (permalink / raw
  To: Vincent Chen; +Cc: libc-alpha, deanbo422, cnoize

On Wed, 5 Jun 2019, Vincent Chen wrote:

> From: CheWei Chunang <cnoize@andestech.com>
> 
> The nds32 toochain cannot be generated successfully by this patch because
> the nds32 port of Binutils and GCC on upstream is too old. This patch is
> used to help reviewer to review the glibc port for Andes nds32 ISA.

For a new port to go into glibc, the upstream mainline versions of 
binutils / GCC / Linux kernel need to have all the features required to 
build the port and run tests with good results (even if release branches 
are too old to work well - though if it's just a matter of bug fixes, 
backporting those to release branches may be a good idea).  Ports 
depending on non-upstream changes to those components can't be accepted 
(we had trouble in the past with MicroBlaze and NaCl depending on things 
that weren't upstream, fixed by getting some MicroBlaze GCC patches 
upstream and removing the NaCl port; we don't want to go there again).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v4 00/11] nds32 glibc port, v4
  2019-06-06  2:59   ` Vincent Chen
@ 2019-06-07  7:17     ` Florian Weimer
  2019-06-10  3:27       ` Vincent Chen
  0 siblings, 1 reply; 28+ messages in thread
From: Florian Weimer @ 2019-06-07  7:17 UTC (permalink / raw
  To: Vincent Chen
  Cc: libc-alpha@sourceware.org, joseph@codesourcery.com,
	deanbo422@gmail.com, Che-Wei Chuang (??????)

* Vincent Chen:

> On Wed, Jun 05, 2019 at 08:28:15PM +0800, Florian Weimer wrote:
>> * Vincent Chen:
>> 
>> >    7. misc/tst-syscall-list
>> >         This case turns to PASS if I add NR_fp_udfiex_crtl to 
>> >       linux/syscall-names.list
>> 
>> I think the actual system call name is fp_udfiex_crtl, and this can go
>> in immediately as a separate patch (it's not necessary to wait for the
>> upstream kernel release).

> Yes, the actual system call name is fp_udfiex_crtl. I will use a
> separate patch to complete it in the next version patchset.

You can submit this change separately any time, it is not tied to the
port.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v4 02/11] nds32: ABI Implementation
  2019-06-06 22:37   ` Joseph Myers
@ 2019-06-10  2:34     ` Vincent Chen
  0 siblings, 0 replies; 28+ messages in thread
From: Vincent Chen @ 2019-06-10  2:34 UTC (permalink / raw
  To: Joseph Myers
  Cc: libc-alpha@sourceware.org, deanbo422@gmail.com,
	Che-Wei Chuang (??????)

On Fri, Jun 07, 2019 at 06:37:28AM +0800, Joseph Myers wrote:
> On Wed, 5 Jun 2019, Vincent Chen wrote:
> 
> > diff --git a/locale/Makefile b/locale/Makefile
> > index 0ad99ec..803a3a5 100644
> > --- a/locale/Makefile
> > +++ b/locale/Makefile
> > @@ -113,5 +113,5 @@ lib := locale-programs
> >  include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
> >  
> >  $(objpfx)tst-locale-locpath.out : tst-locale-locpath.sh $(objpfx)locale
> > -	$(SHELL) $< '$(common-objpfx)' '$(test-wrapper)' '$(test-wrapper-env)' > $@; \
> > +	$(SHELL) $< '$(common-objpfx)' '$(test-wrapper-env)' '$(run_program_env)'> $@; \
> >  	$(evaluate-test)
> 
> Never mix this sort of architecture-independent patch into an 
> architecture-specific one; post separately with its own justification.
> 

This modification is for self-testing, and I accidentally included it
in this patchset. I will remove it in the next submission.

> > +  } __jmp_buf[1] __attribute__((__aligned__ (8)));
> 
> Example of a coding style issue, missing space before '(' (fix everywhere 
> in this series).
> 

OK, I will fix it.


Thanks,
Vincent


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v4 05/11] nds32: Generic <math.h>, soft-fp and hard-fp Routines
  2019-06-06 22:41   ` Joseph Myers
@ 2019-06-10  2:43     ` Vincent Chen
  0 siblings, 0 replies; 28+ messages in thread
From: Vincent Chen @ 2019-06-10  2:43 UTC (permalink / raw
  To: Joseph Myers
  Cc: libc-alpha@sourceware.org, deanbo422@gmail.com,
	Che-Wei Chuang (??????)

On Fri, Jun 07, 2019 at 06:41:45AM +0800, Joseph Myers wrote:
> On Wed, 5 Jun 2019, Vincent Chen wrote:
> 
> > +double __ieee754_sqrt (double x)
> 
> Example of a coding style issue, should have the function name in a 
> definition at the start of a new line (separate line from return type).  
> This only applies in definitions, not in function declarations that are 
> not definitions.  Please fix everywhere in the patch series.
> 
> > +  if (__KERNEL_SUPPORT_SUBNOR_OUTPUT) {
> 
> Example of a coding style issue, '{' should go on its own line, indented 
> two columns from the line above (and then the contents of the block should 
> be indented a further two columns).
> 
I will fix these coding style issues in the next submission.

> > diff --git a/sysdeps/nds32/fpu/fenv_private.h b/sysdeps/nds32/fpu/fenv_private.h
> > new file mode 100644
> > index 0000000..45c13f6
> > --- /dev/null
> > +++ b/sysdeps/nds32/fpu/fenv_private.h
> 
> > +#ifndef NDS32_MATH_PRIVATE_H
> > +#define NDS32_MATH_PRIVATE_H 1
> 
> That seems an inappropriate macro name for a fenv_private.h header.
>
OK, I will fix it in the next submission.

Thanks,
Vincent

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v4 08/11] nds32: Linux ABI
  2019-06-06 22:45   ` Joseph Myers
@ 2019-06-10  2:53     ` Vincent Chen
  0 siblings, 0 replies; 28+ messages in thread
From: Vincent Chen @ 2019-06-10  2:53 UTC (permalink / raw
  To: Joseph Myers
  Cc: libc-alpha@sourceware.org, deanbo422@gmail.com,
	Che-Wei Chuang (??????)

On Fri, Jun 07, 2019 at 06:45:13AM +0800, Joseph Myers wrote:
> On Wed, 5 Jun 2019, Vincent Chen wrote:
> 
> > +int __ioctl (int __fd, unsigned long int __request, ...)
> > +{
> > +	unsigned long arg1;
> 
> Example coding style issue, indentation should be two columns not eight 
> (tabs are always eight columns in glibc sources), as well as the 
> previously noted issue of function name starting a new line.
> 
> > +	return INLINE_SYSCALL(ioctl,3,__fd,__request,arg1);
> 
> Example coding style issue, missing spaces after ','.
> 
> > +int __prctl (int __option, ...)
> > +{
> > +	unsigned long arg1,arg2,arg3,arg4;
> > +	va_list arg;
> > +	va_start (arg, __option);
> > +	arg1 = va_arg (arg, unsigned long);
> > +	arg2 = va_arg (arg, unsigned long);
> > +	arg3 = va_arg (arg, unsigned long);
> > +	arg4 = va_arg (arg, unsigned long);
> 
> Example coding style issue, should be "unsigned long int".
> 
> > +#ifdef __USE_MISC
> > +# define __ctx(fld) fld
> > +#else
> > +# define __ctx(fld) __ ## fld
> > +#endif
> 
> __ctx is only expected to be used for old ports where there might be 
> existing code relying on the old names and we want as much API 
> compatibility as possible.  For new ports, just use the __* names in this 
> header unconditionally rather than having such a macro at all.
>

OK, I got it. I will remove __ctx macro and replace __ctx with prifix __.
Also, I will fix the above codeing style issues in the next submission.

Thanks,
Vincent

> -- 
> Joseph S. Myers
> joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v4 11/11] Add nds32 port to build-many-glibcs.py
  2019-06-06 22:47   ` Joseph Myers
@ 2019-06-10  3:11     ` Vincent Chen
  0 siblings, 0 replies; 28+ messages in thread
From: Vincent Chen @ 2019-06-10  3:11 UTC (permalink / raw
  To: Joseph Myers
  Cc: libc-alpha@sourceware.org, deanbo422@gmail.com,
	Che-Wei Chuang (??????)

On Fri, Jun 07, 2019 at 06:47:49AM +0800, Joseph Myers wrote:
> On Wed, 5 Jun 2019, Vincent Chen wrote:
> 
> > From: CheWei Chunang <cnoize@andestech.com>
> > 
> > The nds32 toochain cannot be generated successfully by this patch because
> > the nds32 port of Binutils and GCC on upstream is too old. This patch is
> > used to help reviewer to review the glibc port for Andes nds32 ISA.
> 
> For a new port to go into glibc, the upstream mainline versions of 
> binutils / GCC / Linux kernel need to have all the features required to 
> build the port and run tests with good results (even if release branches 
> are too old to work well - though if it's just a matter of bug fixes, 
> backporting those to release branches may be a good idea).  Ports 
> depending on non-upstream changes to those components can't be accepted 
> (we had trouble in the past with MicroBlaze and NaCl depending on things 
> that weren't upstream, fixed by getting some MicroBlaze GCC patches 
> upstream and removing the NaCl port; we don't want to go there again).
>

Sorry, I did not find the commit log is out-of-day. Now, build-many-glibcs.py
can use upstream Binutils-2.32, GCC-9.0.1 and this patchset to generate nds32
toolchain and pass the test. I will correct this commit log and append the
test log in the next submission.

Thanks,
Vincent

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v4 00/11] nds32 glibc port, v4
  2019-06-07  7:17     ` Florian Weimer
@ 2019-06-10  3:27       ` Vincent Chen
  0 siblings, 0 replies; 28+ messages in thread
From: Vincent Chen @ 2019-06-10  3:27 UTC (permalink / raw
  To: Florian Weimer
  Cc: libc-alpha@sourceware.org, joseph@codesourcery.com,
	deanbo422@gmail.com, Che-Wei Chuang (??????)

On Fri, Jun 07, 2019 at 03:17:58PM +0800, Florian Weimer wrote:
> * Vincent Chen:
> 
> > On Wed, Jun 05, 2019 at 08:28:15PM +0800, Florian Weimer wrote:
> >> * Vincent Chen:
> >> 
> >> >    7. misc/tst-syscall-list
> >> >         This case turns to PASS if I add NR_fp_udfiex_crtl to 
> >> >       linux/syscall-names.list
> >> 
> >> I think the actual system call name is fp_udfiex_crtl, and this can go
> >> in immediately as a separate patch (it's not necessary to wait for the
> >> upstream kernel release).
> 
> > Yes, the actual system call name is fp_udfiex_crtl. I will use a
> > separate patch to complete it in the next version patchset.
> 
> You can submit this change separately any time, it is not tied to the
> port.
>
Ok, I got it. Thank you.

Regards,
vincent

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v4 00/11] nds32 glibc port, v4
  2019-06-06 22:34 ` Joseph Myers
@ 2019-06-10  7:15   ` Vincent Chen
  0 siblings, 0 replies; 28+ messages in thread
From: Vincent Chen @ 2019-06-10  7:15 UTC (permalink / raw
  To: Joseph Myers
  Cc: libc-alpha@sourceware.org, deanbo422@gmail.com,
	Che-Wei Chuang (??????)

On Fri, Jun 07, 2019 at 06:34:47AM +0800, Joseph Myers wrote:
> On Wed, 5 Jun 2019, Vincent Chen wrote:
> 
> 
> Please see <https://sourceware.org/glibc/wiki/NewPorts> and make sure the 
> port submission follows what is described there.  In particular: (a) give 
> pointers to the relevant instruction set and ABI manuals 
> (<https://gcc.gnu.org/readings.html> points to a page with a great many 
> manuals, pointers directly to exactly the ones that are relevant would be 
> helpful); (b) fix coding style issues, such as brace positioning, 
> indentation and missing spaces before '('.
> 

Ok

> 
> fds_bits and val are a generic Linux kernel issue - a patch was sent to 
> linux-api in March and acked by David Miller but still didn't get into the 
> Linux kernel in 5.1 (and, indeed, still hasn't got into the kernel).  I'm 
> not sure what the holdup is there, but for now we should assume that Linux 
> kernel header versions later than 5.0 are not suitable for use in glibc 
> (and so probably avoid adding any new ports depending on newer kernel 
> header versions, because of the possibility of being unable to test them 
> effectively for an indefinite period while build-many-glibcs.py is stuck 
> on 5.0).
>

Ok, I will develop nds32 ports based on kernel 5.0 before relevant issues
are fixed in kernel.
 
> The others also sound like a generic issue.  Please *start a separate 
> thread on them, not part of the port submission*.  Is this like the case 
> where sysdeps/unix/sysv/linux/bits/socket.h has
> 
> /* Ugly workaround for unclean kernel headers.  */
> 
> for some existing macros?  If so, you should send a patch for that, 
> extending the workaround to the new macros (again, not part of the port 
> submission, not marked as part of the port submission, because it's an 
> independent issue).
> 

Yes, the issue of the macros "SIOCGSTAMPNS_OLD" and "SIOCGSTAMP_OLD" is similar
to the case in sysdeps/unix/sysv/linux/bits/socket.h. I will send a separate
patch to add these two macros to the workaround list.


> >    2. locale/tst-locale-locpath
> 
> Again, start an independent thread on this issue.  I'm not sure if 
> $(run_program_env) should be passed at all (given how this test is 
> deliberately overriding the default environment), but in any case, the 
> call in the Makefile should be consistent with the test script - and this 
> needs to be discussed outside the context of a port submission.
> 

Ok

> >    3. libio/tst-wfile-sync.test-result
> 
> Likewise, start a separate thread, not marked as part of a port 
> submission, for any such architecture-independent issue; resolve such 
> issues first and ensure the port submission only needs to include 
> genuinely architecture-specific patches.
> 

Ok
> >       to remain pending due to the lack of ACK from sparc maintainer. Does
> >       Joseph have any plans to resend the patchset?
> 
> No.  It was accepted by the powerpc maintainers into a branch with a 
> statement "I'll ask Stephen to put it in linux-next once 4.3-rc1 is out, 
> and I'll ask Linus to pull it for 4.4".  I don't know what the holdup is 
> that stopped it going further.  There was an issue with sparc compilers 
> that didn't default to -mlong-double-128, but a patch for that was added 
> in Nov 2015.  There was a build robot reporting new warnings on sh but I 
> didn't think they indicated any actual problems that were new with the 
> patch (which was acked for sh).
> 
> Since that patch series deals with the hard part of an update (i.e. 
> updating the kernel code across several architectures for extensive API 
> changes in glibc soft-fp made as part of the optimization project 
> described in the GCC Summit 2006 proceedings, and subsequently), I think 
> it makes sense to integrate that patch series more or less as I posted it 
> (plus, I suppose, a corresponding nds32 patch), and then possibly follow 
> up with another update of the code to the latest glibc version (much 
> easier because of the lack of API changes needing all-architectures 
> fixes).
> 
> Note: I have a long list of issues with the powerpc math emulation in the 
> Linux kernel (i.e., the architecture-specific code) that could reasonably 
> be fixed after that series is in, and shorter lists for alpha and sh (all 
> of those are lists as of 2015, I don't know if some of the issues might 
> have been fixed in the kernel since then).
> 

I got it. Thank you very much for the detailed descriptions.

> >    7. misc/tst-syscall-list
> >         This case turns to PASS if I add NR_fp_udfiex_crtl to 
> >       linux/syscall-names.list  
> 
> Again, send a separate patch outside of this series.
>

Ok 


Regards,
Vincent


^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2019-06-10  7:15 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-05 11:56 [PATCH v4 00/11] nds32 glibc port, v4 Vincent Chen
2019-06-05 11:56 ` [PATCH v4 01/11] nds32: Build Infastructure Vincent Chen
2019-06-05 12:18   ` Andreas Schwab
2019-06-06  5:31     ` Vincent Chen
2019-06-05 11:56 ` [PATCH v4 02/11] nds32: ABI Implementation Vincent Chen
2019-06-06 22:37   ` Joseph Myers
2019-06-10  2:34     ` Vincent Chen
2019-06-05 11:56 ` [PATCH v4 03/11] nds32: Thread-Local Storage Support Vincent Chen
2019-06-05 11:56 ` [PATCH v4 04/11] nds32: Startup and Dynamic Loader Vincent Chen
2019-06-05 11:56 ` [PATCH v4 05/11] nds32: Generic <math.h>, soft-fp and hard-fp Routines Vincent Chen
2019-06-06 22:41   ` Joseph Myers
2019-06-10  2:43     ` Vincent Chen
2019-06-05 11:56 ` [PATCH v4 06/11] nds32: Atomic and Locking Routines Vincent Chen
2019-06-05 11:56 ` [PATCH v4 07/11] nds32: Linux Syscall Interface Vincent Chen
2019-06-05 11:56 ` [PATCH v4 08/11] nds32: Linux ABI Vincent Chen
2019-06-06 22:45   ` Joseph Myers
2019-06-10  2:53     ` Vincent Chen
2019-06-05 11:56 ` [PATCH v4 09/11] nds32: Add ABI list Vincent Chen
2019-06-05 11:56 ` [PATCH v4 10/11] Add nds32 entries to config.h.in Vincent Chen
2019-06-05 11:56 ` [PATCH v4 11/11] Add nds32 port to build-many-glibcs.py Vincent Chen
2019-06-06 22:47   ` Joseph Myers
2019-06-10  3:11     ` Vincent Chen
2019-06-05 12:28 ` [PATCH v4 00/11] nds32 glibc port, v4 Florian Weimer
2019-06-06  2:59   ` Vincent Chen
2019-06-07  7:17     ` Florian Weimer
2019-06-10  3:27       ` Vincent Chen
2019-06-06 22:34 ` Joseph Myers
2019-06-10  7:15   ` Vincent Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).