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