aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Bucur <stefanb@zytor.com>2008-06-06 21:01:34 +0300
committerStefan Bucur <stefanb@zytor.com>2008-06-06 21:01:34 +0300
commit0b98e71eac04dbec110d8ef08248ef451738aa9f (patch)
tree44b6c1308748be8f2715f6971fe214a64236e5a7
parent98b8be55d69b18ad6bfc76ee6a432e29314c7b9c (diff)
downloadsyslinux-elf-0b98e71eac04dbec110d8ef08248ef451738aa9f.tar.gz
syslinux-elf-0b98e71eac04dbec110d8ef08248ef451738aa9f.tar.xz
syslinux-elf-0b98e71eac04dbec110d8ef08248ef451738aa9f.zip
Removed the redundant elf.h header.
-rw-r--r--.cproject176
-rw-r--r--.project77
-rw-r--r--elf/elf.h184
-rwxr-xr-xelf/elftestbin8431 -> 0 bytes
-rw-r--r--elf/elftest.c12
5 files changed, 6 insertions, 443 deletions
diff --git a/.cproject b/.cproject
deleted file mode 100644
index 9b0bb333..00000000
--- a/.cproject
+++ /dev/null
@@ -1,176 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?fileVersion 4.0.0?>
-
-<cproject>
-<storageModule moduleId="org.eclipse.cdt.core.settings">
-<cconfiguration id="cdt.managedbuild.toolchain.gnu.base.1373856746">
-<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.base.1373856746" moduleId="org.eclipse.cdt.core.settings" name="Linux GCC">
-<externalSettings/>
-<extensions>
-<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
-<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
-</extensions>
-</storageModule>
-<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-<configuration artifactName="SyslinuxELF" buildProperties="" id="cdt.managedbuild.toolchain.gnu.base.1373856746" name="Linux GCC" parent="org.eclipse.cdt.build.core.emptycfg">
-<folderInfo id="cdt.managedbuild.toolchain.gnu.base.1373856746.1892202794" name="/" resourcePath="">
-<toolChain id="cdt.managedbuild.toolchain.gnu.base.991391865" name="cdt.managedbuild.toolchain.gnu.base" superClass="cdt.managedbuild.toolchain.gnu.base">
-<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.551529690" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
-<builder id="cdt.managedbuild.target.gnu.builder.base.1493849787" managedBuildOn="false" name="Gnu Make Builder.Linux GCC" superClass="cdt.managedbuild.target.gnu.builder.base"/>
-<tool id="cdt.managedbuild.tool.gnu.archiver.base.771541123" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
-<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.934691204" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base"/>
-<tool id="cdt.managedbuild.tool.gnu.c.compiler.base.1193832074" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
-<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.356314568" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
-</tool>
-<tool id="cdt.managedbuild.tool.gnu.c.linker.base.2090485270" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base">
-<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1066697913" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
-<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
-<additionalInput kind="additionalinput" paths="$(LIBS)"/>
-</inputType>
-</tool>
-<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.1016773070" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base"/>
-<tool id="cdt.managedbuild.tool.gnu.assembler.base.1181854962" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
-<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1827973049" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
-</tool>
-</toolChain>
-</folderInfo>
-</configuration>
-</storageModule>
-<storageModule moduleId="scannerConfiguration">
-<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="specsFile">
-<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
-<buildOutputProvider>
-<openAction enabled="true" filePath=""/>
-<parser enabled="true"/>
-</buildOutputProvider>
-<scannerInfoProvider id="makefileGenerator">
-<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
-<parser enabled="true"/>
-</scannerInfoProvider>
-</profile>
-</storageModule>
-<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
-<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
-<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
-<buildTargets>
-<target name="All" path="elf" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
-<buildCommand>make</buildCommand>
-<buildArguments/>
-<buildTarget>all</buildTarget>
-<stopOnError>true</stopOnError>
-<useDefaultCommand>true</useDefaultCommand>
-<runAllBuilders>true</runAllBuilders>
-</target>
-<target name="Clean" path="elf" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
-<buildCommand>make</buildCommand>
-<buildArguments/>
-<buildTarget>clean</buildTarget>
-<stopOnError>true</stopOnError>
-<useDefaultCommand>true</useDefaultCommand>
-<runAllBuilders>true</runAllBuilders>
-</target>
-<target name="Test" path="elf" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
-<buildCommand>make</buildCommand>
-<buildArguments/>
-<buildTarget>test</buildTarget>
-<stopOnError>true</stopOnError>
-<useDefaultCommand>true</useDefaultCommand>
-<runAllBuilders>true</runAllBuilders>
-</target>
-<target name="Clean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
-<buildCommand>make</buildCommand>
-<buildArguments/>
-<buildTarget>clean</buildTarget>
-<stopOnError>true</stopOnError>
-<useDefaultCommand>true</useDefaultCommand>
-<runAllBuilders>true</runAllBuilders>
-</target>
-<target name="Build" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
-<buildCommand>make</buildCommand>
-<buildArguments/>
-<buildTarget/>
-<stopOnError>true</stopOnError>
-<useDefaultCommand>true</useDefaultCommand>
-<runAllBuilders>true</runAllBuilders>
-</target>
-</buildTargets>
-</storageModule>
-</cconfiguration>
-</storageModule>
-<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-<project id="SyslinuxELF.null.1852742557" name="SyslinuxELF"/>
-</storageModule>
-</cproject>
diff --git a/.project b/.project
deleted file mode 100644
index ce7d5bdc..00000000
--- a/.project
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>SyslinuxELF</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
- <triggers>clean,full,incremental,</triggers>
- <arguments>
- <dictionary>
- <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
- <value>clean</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>?name?</key>
- <value></value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.append_environment</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.stopOnError</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.buildCommand</key>
- <value>make</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.contents</key>
- <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
- <value>false</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.enableFullBuild</key>
- <value>true</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.buildArguments</key>
- <value></value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
- <value>all</value>
- </dictionary>
- <dictionary>
- <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
- <value>all</value>
- </dictionary>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
- <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
- <nature>org.eclipse.cdt.core.cnature</nature>
- </natures>
-</projectDescription>
diff --git a/elf/elf.h b/elf/elf.h
deleted file mode 100644
index 36186f74..00000000
--- a/elf/elf.h
+++ /dev/null
@@ -1,184 +0,0 @@
-// License would go here
-
-#ifndef ELF_H_
-#define ELF_H_
-
-
-////////////////////////////////////////////////////////////////////////////////
-// GENERAL ELF FORMAT DECLARATIONS
-
-// ELF data types
-typedef unsigned long Elf32_Addr;
-typedef unsigned short Elf32_Half;
-typedef unsigned long Elf32_Off;
-typedef long Elf32_Sword;
-typedef unsigned long Elf32_Word;
-
-
-////////////////////////////////////////////////////////////////////////////////
-// ELF HEADER DECLARATIONS
-
-// Relevant indices in the identification section
-enum e_ident_indices_enum {
- // Magic indices
- EI_MAG0 = 0,
- EI_MAG1 = 1,
- EI_MAG2 = 2,
- EI_MAG3 = 3,
-
- EI_CLASS = 4,
- EI_DATA = 5,
- EI_VERSION = 6,
- EI_PAD = 7,
- EI_NIDENT = 16 // Total size of the identification information
-};
-
-enum ei_class_enum {
- ELFCLASSNONE = 0,
- ELFCLASS32 = 1,
- ELFCLASS64 = 2
-};
-
-enum ei_data_enum {
- ELFDATANONE = 0,
- ELFDATA2LSB = 1,
- ELFDATA2MSB = 2
-};
-
-
-// Object file types
-enum e_type_enum {
- ET_NONE = 0, // No type
- ET_REL = 1, // Relocatable
- ET_EXEC = 2, // Executable
- ET_DYN = 3, // Shared object
- ET_CORE = 4, // Core
-};
-
-// Machine types
-enum e_machine_enum {
- EM_NONE = 0, // No machine
- EM_M32 = 1, // AT&T WE 32100
- EM_SPARC = 2, // SPARC
- EM_386 = 3, // Intel 80386
- EM_68K = 4, // Motorola 68000
- EM_88K = 5, // Motorola 88000
- EM_860 = 7, // Intel 80860
- EM_MIPS = 8, // MIPS RS3000 Big Endian
- EM_MIPS_RS4_BE = 10 // MIPS RS4000 Big Endian
-};
-
-// Object version
-enum e_version_enum {
- EV_NONE = 0, // Invalid version
- EV_CURRENT = 1 // Current version
-};
-
-// The ELF header
-typedef struct {
- unsigned char e_ident[EI_NIDENT]; // Identification
- Elf32_Half e_type; // Object file type
- Elf32_Half e_machine; // Machine type
- Elf32_Word e_version; // Object file version
- Elf32_Addr e_entry; // Program entry point
- Elf32_Off e_phoff; // Program Header Table (PHT) offset
- Elf32_Off e_shoff; // Section Header Table (SHT) offset
- Elf32_Word e_flags; // Processor specific flags
- Elf32_Half e_ehsize; // ELF header size
- Elf32_Half e_phentsize; // Size of an entry in PHT
- Elf32_Half e_phnum; // Number of entries in PHT
- Elf32_Half e_shentsize; // Size of an header in SHT
- Elf32_Half e_shnum; // Number of entries in SHT
- Elf32_Half e_shstrndx; // Section name string table index
-} Elf32_Ehdr;
-
-
-////////////////////////////////////////////////////////////////////////////////
-// ELF SECTION DECLARATIONS
-
-// Special section indices
-enum sh_special_enum {
- SHN_UNDEF = 0, // Undefined
- SHN_LORESERVE = 0xFF00, // Lower index of reserved range
- SHN_LOPROC = 0xFF00, // Processor specific semantics interval
- SHN_HIPROC = 0xFF1F, // *
- SHN_ABS = 0xFFF1, // Absolute values for the reference
- SHN_COMMON = 0xFFF2, // Common symbols
- SHN_HIRESERVE = 0xFFFF // Upper index of reserved range
-};
-
-// Section type
-enum sh_type_enum {
- SHT_NULL = 0, // Inactive
- SHT_PROGBITS = 1, // Program specific information
- SHT_SYMTAB = 2, // Symbol table
- SHT_STRTAB = 3, // String table
- SHT_RELA = 4, // Relocation entries with explicit addends
- SHT_HASH = 5, // Symbol hash table
- SHT_DYNAMIC = 6, // Dynamic linking information
- SHT_NOTE = 7, // Marking information
- SHT_NOBITS = 8, // No space occupied
- SHT_REL = 9, // Relocation entries w/o explicit addends
- SHT_SHLIB = 10, // Reserved
- SHT_DYNSYM = 11, // Symbol table
- SHT_LOPROC = 0x70000000, // Processor specific semantics
- SHT_HIPROC = 0x7FFFFFFF, // *
- SHT_LOUSER = 0x80000000, // Application programs
- SHT_HIUSER = 0xFFFFFFFF // *
-};
-
-// Section flags
-enum sh_flags_enum {
- SHF_WRITE = 0x1, // Writable data
- SHF_ALLOC = 0x2, // Section occupies memory during execution
- SHF_EXECINSTR = 0x4, // Executable code
- SHF_MASKPROC = 0xF0000000 // Processor specific semantics
-};
-
-// The section header
-typedef struct {
- Elf32_Word sh_name; // Index into section header string table
- Elf32_Word sh_type; // Section type and semantic
- Elf32_Word sh_flags; // Section flags
- Elf32_Addr sh_addr; // Address of the memory mapping (or 0)
- Elf32_Off sh_offset; // Section location in the file
- Elf32_Word sh_size; // Section size in the file
- Elf32_Word sh_link; // Section header table index link
- Elf32_Word sh_info; // Extra information
- Elf32_Word sh_addralign; // Alignment constraint
- Elf32_Word sh_entsize; // Entry size for table-like sections
-} Elf32_Shdr;
-
-
-////////////////////////////////////////////////////////////////////////////////
-// SYMBOL TABLE DECLARATIONS
-
-// Special symbol indices
-enum st_special_enum {
- STN_UNDEF = 0 // Undefined symbol index
-};
-
-// Macros for manipulating a symbol table entry information field
-#define ELF32_ST_BIND(i) ((i) >> 4)
-#define ELF32_ST_TYPE(i) ((i) & 0xF)
-#define ELF32_ST_INFO(b,t) ((b) << 4) + ((t) & 0xF))
-
-enum st_bind_enum {
- STB_LOCAL = 0,
- STB_GLOBAL = 1,
- STB_WEAK = 2,
- STB_LOPROC = 13,
- STB_HIPROC = 15
-};
-
-// Symbol table entry
-typedef struct {
- Elf32_Word st_name; // Index in the name table
- Elf32_Addr st_value; // Value associated with the symbol
- Elf32_Word st_size; // Symbol data size
- unsigned char st_info; // Type and binding attrs.
- unsigned char st_other; // Reserved (zero)
- Elf32_Half st_shndx; // Relevant section header table index
-} Elf32_Sym;
-
-#endif /*ELF_H_*/
diff --git a/elf/elftest b/elf/elftest
deleted file mode 100755
index 7f8fcf18..00000000
--- a/elf/elftest
+++ /dev/null
Binary files differ
diff --git a/elf/elftest.c b/elf/elftest.c
index 047537ed..5436b40e 100644
--- a/elf/elftest.c
+++ b/elf/elftest.c
@@ -7,7 +7,7 @@
#include <fcntl.h>
#include <unistd.h>
-#include "elf.h"
+#include <elf.h>
void print_usage() {
fprintf(stderr, "Usage:\n");
@@ -47,11 +47,11 @@ void print_elf_info(const char *file_name) {
printf("\n");
printf("Type:\t\t%u\n", elf_header->e_type);
printf("Machine:\t%u\n", elf_header->e_machine);
- printf("Version:\t%lu\n", elf_header->e_version);
- printf("Entry:\t\t0x%08lx\n", elf_header->e_entry);
- printf("PHT Offset:\t0x%08lx\n", elf_header->e_phoff);
- printf("SHT Offset:\t0x%08lx\n", elf_header->e_shoff);
- printf("Flags:\t\t%lu\n", elf_header->e_flags);
+ printf("Version:\t%u\n", elf_header->e_version);
+ printf("Entry:\t\t0x%08x\n", elf_header->e_entry);
+ printf("PHT Offset:\t0x%08x\n", elf_header->e_phoff);
+ printf("SHT Offset:\t0x%08x\n", elf_header->e_shoff);
+ printf("Flags:\t\t%u\n", elf_header->e_flags);
printf("Header size:\t%u (Structure size: %u)\n", elf_header->e_ehsize,
sizeof(Elf32_Ehdr));