[newlib-cygwin] cygwin: add explicit_bzero, elf.h changes to release

2017-08-02 Thread Yaakov Selkowitz
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=109a3a02a3855bae4be5ab6fe641366c7694b978

commit 109a3a02a3855bae4be5ab6fe641366c7694b978
Author: Yaakov Selkowitz 
Date:   Wed Aug 2 04:38:01 2017 -0500

cygwin: add explicit_bzero, elf.h changes to release

Signed-off-by: Yaakov Selkowitz 

Diff:
---
 winsup/cygwin/release/2.8.3 | 4 
 1 file changed, 4 insertions(+)

diff --git a/winsup/cygwin/release/2.8.3 b/winsup/cygwin/release/2.8.3
index 5cecabb..c76d571 100644
--- a/winsup/cygwin/release/2.8.3
+++ b/winsup/cygwin/release/2.8.3
@@ -1,10 +1,14 @@
 What's new:
 ---
 
+- New API: explicit_bzero.
+
 
 What changed:
 -
 
+- Improved implementation of .
+
 
 Bug Fixes
 -


[newlib-cygwin] Add elf.h to newlib

2017-08-02 Thread Yaakov Selkowitz
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=4aaec3cb88b333731ab844046d6f01145f81e9e1

commit 4aaec3cb88b333731ab844046d6f01145f81e9e1
Author: Yaakov Selkowitz 
Date:   Wed Aug 2 01:15:31 2017 -0500

Add elf.h to newlib

This is copied from musl (MIT license).  This is newer and more thorough
than that of FreeBSD currently shipped only on Cygwin.

Signed-off-by: Yaakov Selkowitz 

Diff:
---
 newlib/libc/include/elf.h   | 3146 +++
 winsup/cygwin/include/elf.h |   41 -
 winsup/cygwin/include/machine/elf.h |  117 --
 winsup/cygwin/include/sys/elf.h |   41 -
 winsup/cygwin/include/sys/elf32.h   |  245 ---
 winsup/cygwin/include/sys/elf64.h   |  248 ---
 winsup/cygwin/include/sys/elf_common.h  | 1110 ---
 winsup/cygwin/include/sys/elf_generic.h |   88 -
 8 files changed, 3146 insertions(+), 1890 deletions(-)

diff --git a/newlib/libc/include/elf.h b/newlib/libc/include/elf.h
new file mode 100644
index 000..1b62db5
--- /dev/null
+++ b/newlib/libc/include/elf.h
@@ -0,0 +1,3146 @@
+/*
+From musl include/elf.h
+
+Copyright © 2005-2014 Rich Felker, et al.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#ifndef _ELF_H
+#define _ELF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+
+typedef uint16_t Elf32_Half;
+typedef uint16_t Elf64_Half;
+
+typedef uint32_t Elf32_Word;
+typedefint32_t  Elf32_Sword;
+typedef uint32_t Elf64_Word;
+typedefint32_t  Elf64_Sword;
+
+typedef uint64_t Elf32_Xword;
+typedefint64_t  Elf32_Sxword;
+typedef uint64_t Elf64_Xword;
+typedefint64_t  Elf64_Sxword;
+
+typedef uint32_t Elf32_Addr;
+typedef uint64_t Elf64_Addr;
+
+typedef uint32_t Elf32_Off;
+typedef uint64_t Elf64_Off;
+
+typedef uint16_t Elf32_Section;
+typedef uint16_t Elf64_Section;
+
+typedef Elf32_Half Elf32_Versym;
+typedef Elf64_Half Elf64_Versym;
+
+#define EI_NIDENT (16)
+
+typedef struct {
+  unsigned chare_ident[EI_NIDENT];
+  Elf32_Half   e_type;
+  Elf32_Half   e_machine;
+  Elf32_Word   e_version;
+  Elf32_Addr   e_entry;
+  Elf32_Offe_phoff;
+  Elf32_Offe_shoff;
+  Elf32_Word   e_flags;
+  Elf32_Half   e_ehsize;
+  Elf32_Half   e_phentsize;
+  Elf32_Half   e_phnum;
+  Elf32_Half   e_shentsize;
+  Elf32_Half   e_shnum;
+  Elf32_Half   e_shstrndx;
+} Elf32_Ehdr;
+
+typedef struct {
+  unsigned chare_ident[EI_NIDENT];
+  Elf64_Half   e_type;
+  Elf64_Half   e_machine;
+  Elf64_Word   e_version;
+  Elf64_Addr   e_entry;
+  Elf64_Offe_phoff;
+  Elf64_Offe_shoff;
+  Elf64_Word   e_flags;
+  Elf64_Half   e_ehsize;
+  Elf64_Half   e_phentsize;
+  Elf64_Half   e_phnum;
+  Elf64_Half   e_shentsize;
+  Elf64_Half   e_shnum;
+  Elf64_Half   e_shstrndx;
+} Elf64_Ehdr;
+
+#define EI_MAG00
+#define ELFMAG00x7f
+
+#define EI_MAG11
+#define ELFMAG1'E'
+
+#define EI_MAG22
+#define ELFMAG2'L'
+
+#define EI_MAG33
+#define ELFMAG3'F'
+
+
+#defineELFMAG  "\177ELF"
+#defineSELFMAG 4
+
+#define EI_CLASS   4
+#define ELFCLASSNONE   0
+#define ELFCLASS32 1
+#define ELFCLASS64 2
+#define ELFCLASSNUM3
+
+#define EI_DATA5
+#define ELFDATANONE0
+#define ELFDATA2LSB1
+#define ELFDATA2MSB2
+#define ELFDATANUM 3
+
+#define EI_VERSION 6
+
+
+#define EI_OSABI   7
+#define ELFOSABI_NONE  0
+#define ELFOSABI_SYSV  0
+#define ELFOSABI_HPUX  1
+#define ELFOSABI_NETBSD2
+#define ELFOSABI_LINUX 3
+#define ELFOSABI_GNU   3
+#define ELFOSABI_SOLARIS   6
+#define ELFOSABI_AIX   7
+#define ELFOSABI_IRIX  8
+#define ELFOSABI_FREEBSD   9
+#define ELFOSABI_TRU64 10
+#define ELFOSABI_MODESTO   11
+#define ELFOSABI_OPENBSD   12
+#define ELFOSABI_ARM   97
+#define ELFOSABI_STAN

[newlib-cygwin] cygwin: Export explicit_bzero

2017-08-02 Thread Yaakov Selkowitz
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=2c83bc950fec04feb76a018a994598deb3787256

commit 2c83bc950fec04feb76a018a994598deb3787256
Author: Yaakov Selkowitz 
Date:   Wed Aug 2 01:09:49 2017 -0500

cygwin: Export explicit_bzero

This was added to newlib together with timingsafe_*cmp but never exported.

Signed-off-by: Yaakov Selkowitz 

Diff:
---
 winsup/cygwin/common.din   | 1 +
 winsup/cygwin/include/cygwin/version.h | 3 ++-
 winsup/doc/posix.xml   | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din
index 08baa9e..73e6768 100644
--- a/winsup/cygwin/common.din
+++ b/winsup/cygwin/common.din
@@ -433,6 +433,7 @@ exp2f NOSIGFE
 exp2l NOSIGFE
 expf NOSIGFE
 expl NOSIGFE
+explicit_bzero NOSIGFE
 expm1 NOSIGFE
 expm1f NOSIGFE
 expm1l NOSIGFE
diff --git a/winsup/cygwin/include/cygwin/version.h 
b/winsup/cygwin/include/cygwin/version.h
index bbb6326..ce548b1 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -478,12 +478,13 @@ details. */
   311: Export __xpg_sigpause.
   312: Export strverscmp, versionsort.
   313: Export fls, flsl, flsll.
+  314: Export explicit_bzero.
 
   Note that we forgot to bump the api for ualarm, strtoll, strtoull,
   sigaltstack, sethostname. */
 
 #define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 313
+#define CYGWIN_VERSION_API_MINOR 314
 
 /* There is also a compatibity version number associated with the shared memory
regions.  It is incremented when incompatible changes are made to the shared
diff --git a/winsup/doc/posix.xml b/winsup/doc/posix.xml
index bc50643..5ce5988 100644
--- a/winsup/doc/posix.xml
+++ b/winsup/doc/posix.xml
@@ -1139,6 +1139,7 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).
 endusershell
 err
 errx
+explicit_bzero
 feof_unlocked
 ferror_unlocked
 fflush_unlocked