diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2014-01-11 12:29:23 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2014-01-11 12:29:23 +0100 |
commit | 407f9b8fde3ad9cc55f39f7a548cde6056dab494 (patch) | |
tree | 0375ea8ddab3502bf6883066f43fc7e328d5c704 /target/linux | |
parent | 2ecefcf609e484d04d1546581191831e07ad71ec (diff) | |
parent | abb858ae43374dc13a5fcef19b9e0ba9442013bb (diff) |
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'target/linux')
32 files changed, 276145 insertions, 30 deletions
diff --git a/target/linux/Config.in b/target/linux/Config.in index 79511489c..e4b81dd2f 100644 --- a/target/linux/Config.in +++ b/target/linux/Config.in @@ -18,7 +18,6 @@ source target/linux/config/Config.in.bluetooth source target/linux/config/Config.in.watchdog source target/linux/config/Config.in.leds source target/linux/config/Config.in.misc -source target/linux/config/Config.in.microblaze source target/linux/config/Config.in.mips source target/linux/config/Config.in.lib source target/linux/config/Config.in.pm diff --git a/target/linux/config/Config.in.flash b/target/linux/config/Config.in.flash index 091cb98a4..773c518e8 100644 --- a/target/linux/config/Config.in.flash +++ b/target/linux/config/Config.in.flash @@ -1,6 +1,10 @@ config ADK_KERNEL_MTD + select ADK_KERNEL_GENERIC_IO boolean +config ADK_KERNEL_GENERIC_IO + boolean + config ADK_KERNEL_MTD_MTDRAM boolean @@ -41,6 +45,9 @@ config ADK_KERNEL_MTD_GEN_PROBE config ADK_KERNEL_MTD_PHYSMAP boolean +config ADK_KERNEL_MTD_PHYSMAP_OF + boolean + config ADK_KERNEL_MTD_CFI_ADV_OPTIONS boolean @@ -57,16 +64,31 @@ config ADK_KERNEL_MTD_AR7_PARTS config ADK_KERNEL_MTD_CFI_INTELEXT boolean default y if ADK_TARGET_SYSTEM_BROADCOM_BCM47XX + default y if ADK_TARGET_SYSTEM_QEMU_MICROBLAZEEL + default y if ADK_TARGET_SYSTEM_QEMU_MICROBLAZE default n config ADK_KERNEL_MTD_CFI_AMDSTD boolean default y if ADK_TARGET_SYSTEM_BROADCOM_BCM47XX + default y if ADK_TARGET_SYSTEM_QEMU_MICROBLAZEEL + default y if ADK_TARGET_SYSTEM_QEMU_MICROBLAZE default n config ADK_KERNEL_MTD_CFI_STAA boolean default y if ADK_TARGET_SYSTEM_BROADCOM_BCM47XX + default y if ADK_TARGET_SYSTEM_QEMU_MICROBLAZEEL + default y if ADK_TARGET_SYSTEM_QEMU_MICROBLAZE + default n + +config ADK_KERNEL_MTD_OF_PARTS + boolean + default n + +config ADK_KERNEL_MTD_M25P80 + boolean + default y if ADK_TARGET_QEMU_MICROBLAZE_MODEL_ML605 default n config ADK_KERNEL_MTD_AR2315 @@ -78,6 +100,7 @@ config ADK_KERNEL_MTD_AR2315 config ADK_TARGET_NAND boolean + select ADK_KERNEL_BLOCK select ADK_KERNEL_MISC_FILESYSTEMS select ADK_KERNEL_YAFFS_FS select ADK_KERNEL_YAFFS_YAFFS2 @@ -88,22 +111,31 @@ config ADK_TARGET_NAND select ADK_KERNEL_MTD_NAND_PLATFORM select ADK_KERNEL_MTD_CHAR select ADK_KERNEL_MTD_BLKDEVS - select ADK_KERNEL_BLOCK select ADK_KERNEL_MTD_BLOCK default y if ADK_TARGET_WITH_NAND default n config ADK_TARGET_MTD boolean + select ADK_KERNEL_BLOCK + select ADK_KERNEL_MISC_FILESYSTEMS + select ADK_KERNEL_JFFS2_FS select ADK_KERNEL_MTD select ADK_KERNEL_MTD_PARTITIONS select ADK_KERNEL_MTD_CHAR select ADK_KERNEL_MTD_BLKDEVS - select ADK_KERNEL_BLOCK select ADK_KERNEL_MTD_BLOCK select ADK_KERNEL_MTD_ROOTFS_ROOT_DEV select ADK_KERNEL_MTD_CFI select ADK_KERNEL_MTD_GEN_PROBE select ADK_KERNEL_MTD_PHYSMAP + select ADK_KERNEL_MTD_PHYSMAP_OF if ADK_LINUX_MICROBLAZE + select ADK_KERNEL_MTD_OF_PARTS if ADK_LINUX_MICROBLAZE default y if ADK_TARGET_WITH_MTD default n + +config ADK_TARGET_MTD_SIZE + int + default "33554432" if ADK_TARGET_SYSTEM_QEMU_MICROBLAZE + default "33554432" if ADK_TARGET_SYSTEM_QEMU_MICROBLAZEEL + default "0" diff --git a/target/linux/config/Config.in.fs b/target/linux/config/Config.in.fs index 10b2d7e1b..a764e7491 100644 --- a/target/linux/config/Config.in.fs +++ b/target/linux/config/Config.in.fs @@ -1,5 +1,8 @@ menu "Filesystems support" +config ADK_KERNEL_MISC_FILESYSTEMS + boolean + config ADK_KERNEL_FSNOTIFY boolean default y @@ -8,6 +11,9 @@ config ADK_KERNEL_EXPORTFS boolean default y +config ADK_KERNEL_JFFS2_FS + boolean + config ADK_KERNEL_YAFFS_FS tristate @@ -27,9 +33,6 @@ config ADK_KERNEL_YAFFS_CHECKPOINT_RESERVED_BLOCKS config ADK_KERNEL_YAFFS_SHORT_NAMES_IN_RAM boolean -config ADK_KERNEL_MISC_FILESYSTEMS - boolean - config ADK_KERNEL_DNOTIFY boolean @@ -44,10 +47,15 @@ config ADK_KERNEL_FAT_DEFAULT_IOCHARSET string default "iso8859-1" +config ADK_KERNEL_SQUASHFS_XZ + boolean + default n + config ADK_KERNEL_SQUASHFS prompt "squashfs.......................... SquashFS filesystem" boolean select ADK_KERNEL_MISC_FILESYSTEMS + select ADK_KERNEL_SQUASHFS_XZ default n config ADK_KERNEL_EXT2_FS diff --git a/target/linux/config/Config.in.graphics b/target/linux/config/Config.in.graphics index 75c05449f..af28b91d7 100644 --- a/target/linux/config/Config.in.graphics +++ b/target/linux/config/Config.in.graphics @@ -1,6 +1,5 @@ config ADK_KERNEL_VT boolean - default y if ADK_HARDWARE_QEMU default y if ADK_HARDWARE_VBOX default y if ADK_TARGET_WITH_VGA default y if ADK_NATIVE_SYSTEM_IBM_X40 @@ -9,7 +8,6 @@ config ADK_KERNEL_VT config ADK_KERNEL_VT_CONSOLE boolean - default y if ADK_HARDWARE_QEMU default y if ADK_HARDWARE_VBOX default y if ADK_TARGET_WITH_VGA default y if ADK_NATIVE_SYSTEM_IBM_X40 diff --git a/target/linux/config/Config.in.input b/target/linux/config/Config.in.input index 51d25c4ac..c2516c27d 100644 --- a/target/linux/config/Config.in.input +++ b/target/linux/config/Config.in.input @@ -107,6 +107,7 @@ config ADK_KERNEL_INPUT_MOUSE default y if ADK_TARGET_SYSTEM_LEMOTE_YEELONG default y if ADK_TARGET_SYSTEM_SHUTTLE_SA76 default y if ADK_TARGET_SYSTEM_SHARP_ZAURUS + default y if ADK_TARGET_SYSTEM_RASPBERRY_PI default n config ADK_KERNEL_INPUT_MOUSEDEV @@ -142,6 +143,7 @@ config ADK_KPACKAGE_KMOD_USB_HID select ADK_KERNEL_HID select ADK_KERNEL_INPUT_KEYBOARD select ADK_KERNEL_INPUT_MOUSEDEV + select ADK_KERNEL_INPUT_MOUSE depends on ADK_PACKAGE_KMOD_USB_CONTROLLER depends on !ADK_TARGET_SYSTEM_FOXBOARD_LX depends on ADK_TARGET_WITH_USB @@ -155,6 +157,7 @@ config ADK_KPACKAGE_KMOD_KEYBOARD_ATKBD select ADK_KERNEL_INPUT select ADK_KERNEL_INPUT_KEYBOARD depends on !ADK_KERNEL_KEYBOARD_ATKBD + depends on !ADK_TARGET_SYSTEM_RASPBERRY_PI default n config ADK_KPACKAGE_KMOD_INPUT_MOUSEDEV @@ -169,6 +172,7 @@ config ADK_KPACKAGE_KMOD_INPUT_EVDEV tristate select ADK_KERNEL_INPUT depends on !ADK_KERNEL_INPUT_EVDEV + default y if ADK_TARGET_SYSTEM_RASPBERRY_PI default n endmenu diff --git a/target/linux/config/Config.in.microblaze b/target/linux/config/Config.in.microblaze deleted file mode 100644 index 5a6764250..000000000 --- a/target/linux/config/Config.in.microblaze +++ /dev/null @@ -1,4 +0,0 @@ -config ADK_KERNEL_OPT_LIB_ASM - default y if ADK_TARGET_SYSTEM_QEMU_MICROBLAZE - default n - boolean diff --git a/target/linux/config/Config.in.netdevice b/target/linux/config/Config.in.netdevice index dcf9f03ec..b2eb73b57 100644 --- a/target/linux/config/Config.in.netdevice +++ b/target/linux/config/Config.in.netdevice @@ -113,16 +113,6 @@ config ADK_KERNEL_AR231X_ETHERNET default n help -config ADK_KERNEL_NE2K_PCI - boolean - select ADK_KERNEL_NETDEVICES - select ADK_KERNEL_NET_ETHERNET - select ADK_KERNEL_NET_PCI - select ADK_KERNEL_MII - default y if ADK_TARGET_SYSTEM_QEMU_PPC - default n - help - config ADK_KERNEL_KORINA boolean select ADK_KERNEL_NETDEVICES @@ -164,10 +154,6 @@ config ADK_KERNEL_E1000 default y if ADK_NATIVE_SYSTEM_IBM_X40 default y if ADK_TARGET_SYSTEM_QEMU_I686 default y if ADK_TARGET_SYSTEM_QEMU_X86_64 - default y if ADK_TARGET_SYSTEM_QEMU_MIPS64 - default y if ADK_TARGET_SYSTEM_QEMU_MIPS64EL - default y if ADK_TARGET_SYSTEM_QEMU_MIPS - default y if ADK_TARGET_SYSTEM_QEMU_MIPSEL default n help @@ -327,12 +313,30 @@ config ADK_KERNEL_WLAN_80211 config ADK_KPACKAGE_KMOD_RT2X00 tristate +config ADK_KPACKAGE_KMOD_RT2X00_LIB_USB + tristate + +config ADK_KPACKAGE_KMOD_RT2X00_LIB_PCI + tristate + config ADK_KERNEL_RT2X00 boolean select ADK_KPACKAGE_KMOD_RT2X00 select ADK_KPACKAGE_KMOD_FW_LOADER select ADK_KPACKAGE_KMOD_EEPROM_93CX6 +config ADK_KERNEL_RT2800USB_RT3573 + boolean + +config ADK_KERNEL_RT2800USB_RT53XX + boolean + +config ADK_KERNEL_RT2800USB_RT55XX + boolean + +config ADK_KERNEL_RT2800USB_UNKNOWN + boolean + config ADK_KERNEL_MOD_CFG80211 tristate @@ -479,10 +483,38 @@ config ADK_KPACKAGE_KMOD_P54_USB help Driver for Prism54 USB adaptors. +config ADK_KPACKAGE_KMOD_RT2800USB + prompt "kmod-rt2800-usb.............. Ralink rt2800 USB" + tristate + select ADK_KERNEL_RT2X00 + select ADK_KERNEL_RT2800USB_RT3573 + select ADK_KERNEL_RT2800USB_RT53XX + select ADK_KERNEL_RT2800USB_RT55XX + select ADK_KERNEL_RT2800USB_UNKNOWN + select ADK_KPACKAGE_KMOD_RT2X00_LIB_USB + select ADK_KPACKAGE_KMOD_MAC80211 + select ADK_KPACKAGE_KMOD_CRC_CCITT + depends on ADK_PACKAGE_KMOD_USB_CONTROLLER + default n + help + Driver for Ralink RT2800 USB. + +config ADK_KPACKAGE_KMOD_RTL8192CU + prompt "kmod-rtl8192cu............... Realtek RTL8192CU USB" + tristate + select ADK_KPACKAGE_KMOD_MAC80211 + select ADK_KERNEL_CFG80211_WEXT + select ADK_KERNEL_WIRELESS_EXT + depends on ADK_PACKAGE_KMOD_USB_CONTROLLER + default n + help + Driver for Realtek RTL8192CU USB + config ADK_KPACKAGE_KMOD_RT2400PCI prompt "kmod-rt2400pci............... Ralink rt2400" tristate select ADK_KERNEL_RT2X00 + select ADK_KPACKAGE_KMOD_RT2X00_LIB_PCI select ADK_KPACKAGE_KMOD_MAC80211 select ADK_KERNEL_MAC80211_LEDS depends on ADK_TARGET_WITH_MINIPCI || ADK_TARGET_WITH_PCI @@ -495,6 +527,7 @@ config ADK_KPACKAGE_KMOD_RT2500PCI prompt "kmod-rt2500pci............... Ralink rt2500" tristate select ADK_KERNEL_RT2X00 + select ADK_KPACKAGE_KMOD_RT2X00_LIB_PCI select ADK_KPACKAGE_KMOD_MAC80211 select ADK_KERNEL_MAC80211_LEDS depends on ADK_TARGET_WITH_MINIPCI || ADK_TARGET_WITH_PCI @@ -507,6 +540,7 @@ config ADK_KPACKAGE_KMOD_RT61PCI prompt "kmod-rt61pci................. Ralink rt2501/rt61" tristate select ADK_KERNEL_RT2X00 + select ADK_KPACKAGE_KMOD_RT2X00_LIB_PCI select ADK_KPACKAGE_KMOD_MAC80211 select ADK_KERNEL_MAC80211_LEDS select ADK_KPACKAGE_KMOD_CRC_ITU_T diff --git a/target/linux/config/Config.in.netfilter.ip4 b/target/linux/config/Config.in.netfilter.ip4 index 2cdd45d85..a9c42769a 100644 --- a/target/linux/config/Config.in.netfilter.ip4 +++ b/target/linux/config/Config.in.netfilter.ip4 @@ -38,6 +38,7 @@ config ADK_KPACKAGE_KMOD_FULL_NAT tristate "Meta package for Full NAT" select ADK_KPACKAGE_KMOD_NF_NAT if ADK_KERNEL_VERSION_3_4_71 select ADK_KPACKAGE_KMOD_NF_NAT_IPV4 if ADK_KERNEL_VERSION_3_11_10 + select ADK_KPACKAGE_KMOD_NF_NAT_IPV4 if ADK_KERNEL_VERSION_3_12_6 config ADK_KPACKAGE_KMOD_NF_NAT tristate 'Full NAT' @@ -51,7 +52,7 @@ config ADK_KPACKAGE_KMOD_NF_NAT config ADK_KPACKAGE_KMOD_NF_NAT_IPV4 tristate 'Full NAT' depends on ADK_KPACKAGE_KMOD_IP_NF_IPTABLES - depends on ADK_KERNEL_VERSION_3_11_10 + depends on ADK_KERNEL_VERSION_3_11_10 || ADK_KERNEL_VERSION_3_12_6 help The Full NAT option allows masquerading, port forwarding and other forms of full Network Address Port Translation. It is controlled by diff --git a/target/linux/config/Config.in.systems b/target/linux/config/Config.in.systems index d41ce49f1..239f3495e 100644 --- a/target/linux/config/Config.in.systems +++ b/target/linux/config/Config.in.systems @@ -9,9 +9,6 @@ config ADK_KERNEL_PAGE_SIZE_16KB config ADK_KERNEL_ATHEROS_AR231X boolean -config ADK_KERNEL_MIPS_MALTA - boolean - config ADK_KERNEL_MIKROTIK_RB532 boolean diff --git a/target/linux/kernel.config b/target/linux/kernel.config new file mode 100644 index 000000000..8bf3aafe6 --- /dev/null +++ b/target/linux/kernel.config @@ -0,0 +1,41 @@ +CONFIG_DEFAULT_HOSTNAME="openadk" +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE="" +CONFIG_MMU=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_XFRM=y +CONFIG_INET=y +CONFIG_PROC_FS=y +CONFIG_PROC_SYSCTL=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="iso8859-1" +CONFIG_EMBEDDED=y +CONFIG_MODULES=y +CONFIG_BINFMT_ELF=y +CONFIG_BINFMT_SCRIPT=y +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_STANDALONE=y +CONFIG_NO_HZ=y +CONFIG_PRINTK=y +CONFIG_BUG=n +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_AIO=y +CONFIG_PCI_QUIRKS=y +CONFIG_TTY=y +CONFIG_UNIX98_PTYS=y +CONFIG_PRINTK_TIME=y +CONFIG_EARLY_PRINTK=y diff --git a/target/linux/patches/3.11.10/defaults.patch b/target/linux/patches/3.11.10/defaults.patch index 58aae610b..6cdca084e 100644 --- a/target/linux/patches/3.11.10/defaults.patch +++ b/target/linux/patches/3.11.10/defaults.patch @@ -20,3 +20,27 @@ diff -Nur linux-3.0.4.orig/fs/notify/Kconfig linux-3.0.4/fs/notify/Kconfig source "fs/notify/dnotify/Kconfig" source "fs/notify/inotify/Kconfig" +diff -Nur linux-3.11.10.orig/drivers/scsi/Kconfig linux-3.11.10/drivers/scsi/Kconfig +--- linux-3.11.10.orig/drivers/scsi/Kconfig 2013-11-29 19:42:37.000000000 +0100 ++++ linux-3.11.10/drivers/scsi/Kconfig 2013-12-27 19:13:21.000000000 +0100 +@@ -2,7 +2,7 @@ + + config SCSI_MOD + tristate +- default y if SCSI=n || SCSI=y ++ default y if SCSI=y + default m if SCSI=m + + config RAID_ATTRS +diff -Nur linux-3.11.10.orig/usr/Kconfig linux-3.11.10/usr/Kconfig +--- linux-3.11.10.orig/usr/Kconfig 2013-11-29 19:42:37.000000000 +0100 ++++ linux-3.11.10/usr/Kconfig 2013-12-27 19:15:16.000000000 +0100 +@@ -47,7 +47,7 @@ + + config RD_GZIP + bool "Support initial ramdisks compressed using gzip" if EXPERT +- default y ++ default n + depends on BLK_DEV_INITRD + select DECOMPRESS_GZIP + help diff --git a/target/linux/patches/3.11.10/microblaze-ethernet.patch b/target/linux/patches/3.11.10/microblaze-ethernet.patch new file mode 100644 index 000000000..742ab477e --- /dev/null +++ b/target/linux/patches/3.11.10/microblaze-ethernet.patch @@ -0,0 +1,11 @@ +diff -Nur linux-3.11.10.orig/drivers/net/ethernet/xilinx/xilinx_emaclite.c linux-3.11.10/drivers/net/ethernet/xilinx/xilinx_emaclite.c +--- linux-3.11.10.orig/drivers/net/ethernet/xilinx/xilinx_emaclite.c 2013-11-29 19:42:37.000000000 +0100 ++++ linux-3.11.10/drivers/net/ethernet/xilinx/xilinx_emaclite.c 2013-12-23 20:01:14.000000000 +0100 +@@ -1282,6 +1282,7 @@ + { .compatible = "xlnx,opb-ethernetlite-1.01.b", }, + { .compatible = "xlnx,xps-ethernetlite-1.00.a", }, + { .compatible = "xlnx,xps-ethernetlite-2.00.a", }, ++ { .compatible = "xlnx,xps-ethernetlite-2.00.b", }, + { .compatible = "xlnx,xps-ethernetlite-2.01.a", }, + { .compatible = "xlnx,xps-ethernetlite-3.00.a", }, + { /* end of list */ }, diff --git a/target/linux/patches/3.12.6/bsd-compatibility.patch b/target/linux/patches/3.12.6/bsd-compatibility.patch new file mode 100644 index 000000000..b954b658f --- /dev/null +++ b/target/linux/patches/3.12.6/bsd-compatibility.patch @@ -0,0 +1,2538 @@ +diff -Nur linux-3.11.5.orig/scripts/Makefile.lib linux-3.11.5/scripts/Makefile.lib +--- linux-3.11.5.orig/scripts/Makefile.lib 2013-10-14 03:14:45.000000000 +0200 ++++ linux-3.11.5/scripts/Makefile.lib 2013-10-16 18:09:31.000000000 +0200 +@@ -281,7 +281,12 @@ + size_append = printf $(shell \ + dec_size=0; \ + for F in $1; do \ +- fsize=$$(stat -c "%s" $$F); \ ++ if stat -qs .>/dev/null 2>&1; then \ ++ statcmd='stat -f %z'; \ ++ else \ ++ statcmd='stat -c %s'; \ ++ fi; \ ++ fsize=$$($$statcmd $$F); \ + dec_size=$$(expr $$dec_size + $$fsize); \ + done; \ + printf "%08x\n" $$dec_size | \ +diff -Nur linux-3.11.5.orig/scripts/mod/mk_elfconfig.c linux-3.11.5/scripts/mod/mk_elfconfig.c +--- linux-3.11.5.orig/scripts/mod/mk_elfconfig.c 2013-10-14 03:14:45.000000000 +0200 ++++ linux-3.11.5/scripts/mod/mk_elfconfig.c 2013-10-16 18:09:31.000000000 +0200 +@@ -1,7 +1,18 @@ + #include <stdio.h> + #include <stdlib.h> + #include <string.h> +-#include <elf.h> ++ ++#define EI_NIDENT (16) ++#define ELFMAG "\177ELF" ++ ++#define SELFMAG 4 ++#define EI_CLASS 4 ++#define ELFCLASS32 1 /* 32-bit objects */ ++#define ELFCLASS64 2 /* 64-bit objects */ ++ ++#define EI_DATA 5 /* Data encoding byte index */ ++#define ELFDATA2LSB 1 /* 2's complement, little endian */ ++#define ELFDATA2MSB 2 /* 2's complement, big endian */ + + int + main(int argc, char **argv) +diff -Nur linux-3.11.5.orig/scripts/mod/modpost.h linux-3.11.5/scripts/mod/modpost.h +--- linux-3.11.5.orig/scripts/mod/modpost.h 2013-10-14 03:14:45.000000000 +0200 ++++ linux-3.11.5/scripts/mod/modpost.h 2013-10-16 18:09:31.000000000 +0200 +@@ -7,7 +7,2453 @@ + #include <sys/mman.h> + #include <fcntl.h> + #include <unistd.h> +-#include <elf.h> ++ ++ ++/* This file defines standard ELF types, structures, and macros. ++ Copyright (C) 1995-1999,2000,2001,2002,2003 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, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#ifndef _ELF_H ++#define _ELF_H 1 ++ ++__BEGIN_DECLS ++ ++/* Standard ELF types. */ ++ ++#include <stdint.h> ++ ++/* Type for a 16-bit quantity. */ ++typedef uint16_t Elf32_Half; ++typedef uint16_t Elf64_Half; ++ ++/* Types for signed and unsigned 32-bit quantities. */ ++typedef uint32_t Elf32_Word; ++typedef int32_t Elf32_Sword; ++typedef uint32_t Elf64_Word; ++typedef int32_t Elf64_Sword; ++ ++/* Types for signed and unsigned 64-bit quantities. */ ++typedef uint64_t Elf32_Xword; ++typedef int64_t Elf32_Sxword; ++typedef uint64_t Elf64_Xword; ++typedef int64_t Elf64_Sxword; ++ ++/* Type of addresses. */ ++typedef uint32_t Elf32_Addr; ++typedef uint64_t Elf64_Addr; ++ ++/* Type of file offsets. */ ++typedef uint32_t Elf32_Off; ++typedef uint64_t Elf64_Off; ++ ++/* Type for section indices, which are 16-bit quantities. */ ++typedef uint16_t Elf32_Section; ++typedef uint16_t Elf64_Section; ++ ++/* Type for version symbol information. */ ++typedef Elf32_Half Elf32_Versym; ++typedef Elf64_Half Elf64_Versym; ++ ++ ++/* The ELF file header. This appears at the start of every ELF file. */ ++ ++#define EI_NIDENT (16) ++ ++typedef struct ++{ ++ unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */ ++ Elf32_Half e_type; /* Object file type */ ++ Elf32_Half e_machine; /* Architecture */ ++ Elf32_Word e_version; /* Object file version */ ++ Elf32_Addr e_entry; /* Entry point virtual address */ ++ Elf32_Off e_phoff; /* Program header table file offset */ ++ Elf32_Off e_shoff; /* Section header table file offset */ ++ Elf32_Word e_flags; /* Processor-specific flags */ ++ Elf32_Half e_ehsize; /* ELF header size in bytes */ ++ Elf32_Half e_phentsize; /* Program header table entry size */ ++ Elf32_Half e_phnum; /* Program header table entry count */ ++ Elf32_Half e_shentsize; /* Section header table entry size */ ++ Elf32_Half e_shnum; /* Section header table entry count */ ++ Elf32_Half e_shstrndx; /* Section header string table index */ ++} Elf32_Ehdr; ++ ++typedef struct ++{ ++ unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */ ++ Elf64_Half e_type; /* Object file type */ ++ Elf64_Half e_machine; /* Architecture */ ++ Elf64_Word e_version; /* Object file version */ ++ Elf64_Addr e_entry; /* Entry point virtual address */ ++ Elf64_Off e_phoff; /* Program header table file offset */ ++ Elf64_Off e_shoff; /* Section header table file offset */ ++ Elf64_Word e_flags; /* Processor-specific flags */ ++ Elf64_Half e_ehsize; /* ELF header size in bytes */ ++ Elf64_Half e_phentsize; /* Program header table entry size */ ++ Elf64_Half e_phnum; /* Program header table entry count */ ++ Elf64_Half e_shentsize; /* Section header table entry size */ ++ Elf64_Half e_shnum; /* Section header table entry count */ ++ Elf64_Half e_shstrndx; /* Section header string table index */ ++} Elf64_Ehdr; ++ ++/* Fields in the e_ident array. The EI_* macros are indices into the ++ array. The macros under each EI_* macro are the values the byte ++ may have. */ ++ ++#define EI_MAG0 0 /* File identification byte 0 index */ ++#define ELFMAG0 0x7f /* Magic number byte 0 */ ++ ++#define EI_MAG1 1 /* File identification byte 1 index */ ++#define ELFMAG1 'E' /* Magic number byte 1 */ ++ ++#define EI_MAG2 2 /* File identification byte 2 index */ ++#define ELFMAG2 'L' /* Magic number byte 2 */ ++ ++#define EI_MAG3 3 /* File identification byte 3 index */ ++#define ELFMAG3 'F' /* Magic number byte 3 */ ++ ++/* Conglomeration of the identification bytes, for easy testing as a word. */ ++#define ELFMAG "\177ELF" ++#define SELFMAG 4 ++ ++#define EI_CLASS 4 /* File class byte index */ ++#define ELFCLASSNONE 0 /* Invalid class */ ++#define ELFCLASS32 1 /* 32-bit objects */ ++#define ELFCLASS64 2 /* 64-bit objects */ ++#define ELFCLASSNUM 3 ++ ++#define EI_DATA 5 /* Data encoding byte index */ ++#define ELFDATANONE 0 /* Invalid data encoding */ ++#define ELFDATA2LSB 1 /* 2's complement, little endian */ ++#define ELFDATA2MSB 2 /* 2's complement, big endian */ ++#define ELFDATANUM 3 ++ ++#define EI_VERSION 6 /* File version byte index */ ++ /* Value must be EV_CURRENT */ ++ ++#define EI_OSABI 7 /* OS ABI identification */ ++#define ELFOSABI_NONE 0 /* UNIX System V ABI */ ++#define ELFOSABI_SYSV 0 /* Alias. */ ++#define ELFOSABI_HPUX 1 /* HP-UX */ ++#define ELFOSABI_NETBSD 2 /* NetBSD. */ ++#define ELFOSABI_LINUX 3 /* Linux. */ ++#define ELFOSABI_SOLARIS 6 /* Sun Solaris. */ ++#define ELFOSABI_AIX 7 /* IBM AIX. */ ++#define ELFOSABI_IRIX 8 /* SGI Irix. */ ++#define ELFOSABI_FREEBSD 9 /* FreeBSD. */ ++#define ELFOSABI_TRU64 10 /* Compaq TRU64 UNIX. */ ++#define ELFOSABI_MODESTO 11 /* Novell Modesto. */ ++#define ELFOSABI_OPENBSD 12 /* OpenBSD. */ ++#define ELFOSABI_ARM 97 /* ARM */ ++#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ ++ ++#define EI_ABIVERSION 8 /* ABI version */ ++ ++#define EI_PAD 9 /* Byte index of padding bytes */ ++ ++/* Legal values for e_type (object file type). */ ++ ++#define ET_NONE 0 /* No file type */ ++#define ET_REL 1 /* Relocatable file */ ++#define ET_EXEC 2 /* Executable file */ ++#define ET_DYN 3 /* Shared object file */ ++#define ET_CORE 4 /* Core file */ ++#define ET_NUM 5 /* Number of defined types */ ++#define ET_LOOS 0xfe00 /* OS-specific range start */ ++#define ET_HIOS 0xfeff /* OS-specific range end */ ++#define ET_LOPROC 0xff00 /* Processor-specific range start */ ++#define ET_HIPROC 0xffff /* Processor-specific range end */ ++ ++/* Legal values for e_machine (architecture). */ ++ ++#define EM_NONE 0 /* No machine */ ++#define EM_M32 1 /* AT&T WE 32100 */ ++#define EM_SPARC 2 /* SUN SPARC */ ++#define EM_386 3 /* Intel 80386 */ ++#define EM_68K 4 /* Motorola m68k family */ ++#define EM_88K 5 /* Motorola m88k family */ ++#define EM_860 7 /* Intel 80860 */ ++#define EM_MIPS 8 /* MIPS R3000 big-endian */ ++#define EM_S370 9 /* IBM System/370 */ ++#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */ ++ ++#define EM_PARISC 15 /* HPPA */ ++#define EM_VPP500 17 /* Fujitsu VPP500 */ ++#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ ++#define EM_960 19 /* Intel 80960 */ ++#define EM_PPC 20 /* PowerPC */ ++#define EM_PPC64 21 /* PowerPC 64-bit */ ++#define EM_S390 22 /* IBM S390 */ ++ ++#define EM_V800 36 /* NEC V800 series */ ++#define EM_FR20 37 /* Fujitsu FR20 */ ++#define EM_RH32 38 /* TRW RH-32 */ ++#define EM_RCE 39 /* Motorola RCE */ ++#define EM_ARM 40 /* ARM */ ++#define EM_FAKE_ALPHA 41 /* Digital Alpha */ ++#define EM_SH 42 /* Hitachi SH */ ++#define EM_SPARCV9 43 /* SPARC v9 64-bit */ ++#define EM_TRICORE 44 /* Siemens Tricore */ ++#define EM_ARC 45 /* Argonaut RISC Core */ ++#define EM_H8_300 46 /* Hitachi H8/300 */ ++#define EM_H8_300H 47 /* Hitachi H8/300H */ ++#define EM_H8S 48 /* Hitachi H8S */ ++#define EM_H8_500 49 /* Hitachi H8/500 */ ++#define EM_IA_64 50 /* Intel Merced */ ++#define EM_MIPS_X 51 /* Stanford MIPS-X */ ++#define EM_COLDFIRE 52 /* Motorola Coldfire */ ++#define EM_68HC12 53 /* Motorola M68HC12 */ ++#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator*/ ++#define EM_PCP 55 /* Siemens PCP */ ++#define EM_NCPU 56 /* Sony nCPU embeeded RISC */ ++#define EM_NDR1 57 /* Denso NDR1 microprocessor */ ++#define EM_STARCORE 58 /* Motorola Start*Core processor */ ++#define EM_ME16 59 /* Toyota ME16 processor */ ++#define EM_ST100 60 /* STMicroelectronic ST100 processor */ ++#define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/ ++#define EM_X86_64 62 /* AMD x86-64 architecture */ ++#define EM_PDSP 63 /* Sony DSP Processor */ ++ ++#define EM_FX66 66 /* Siemens FX66 microcontroller */ ++#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */ ++#define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */ ++#define EM_68HC16 69 /* Motorola MC68HC16 microcontroller */ ++#define EM_68HC11 70 /* Motorola MC68HC11 microcontroller */ ++#define EM_68HC08 71 /* Motorola MC68HC08 microcontroller */ ++#define EM_68HC05 72 /* Motorola MC68HC05 microcontroller */ ++#define EM_SVX 73 /* Silicon Graphics SVx */ ++#define EM_ST19 74 /* STMicroel |