Importing mkelfimage from
ftp://ftp.lnxi.com/pub/mkelfImage/mkelfImage-2.7.tar.gz Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3103 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
committed by
Stefan Reinauer
parent
46fc14dcc8
commit
b34eea348c
15
util/mkelfImage/kunzip_src/arch/i386/include/stddef.h
Normal file
15
util/mkelfImage/kunzip_src/arch/i386/include/stddef.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef I386_STDDEF_H
|
||||
#define I386_STDDEF_H
|
||||
|
||||
typedef long ptrdiff_t;
|
||||
typedef unsigned long size_t;
|
||||
typedef long ssize_t;
|
||||
|
||||
typedef int wchar_t;
|
||||
typedef unsigned int wint_t;
|
||||
|
||||
#define NULL 0
|
||||
|
||||
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
|
||||
|
||||
#endif I386_STDDEF_H
|
52
util/mkelfImage/kunzip_src/arch/i386/include/stdint.h
Normal file
52
util/mkelfImage/kunzip_src/arch/i386/include/stdint.h
Normal file
@ -0,0 +1,52 @@
|
||||
#ifndef I386_STDINT_H
|
||||
#define I386_STDINT_H
|
||||
|
||||
/* Exact integral types */
|
||||
typedef unsigned char uint8_t;
|
||||
typedef signed char int8_t;
|
||||
|
||||
typedef unsigned short uint16_t;
|
||||
typedef signed short int16_t;
|
||||
|
||||
typedef unsigned int uint32_t;
|
||||
typedef signed int int32_t;
|
||||
|
||||
typedef unsigned long long uint64_t;
|
||||
typedef signed long long int64_t;
|
||||
|
||||
/* Small types */
|
||||
typedef unsigned char uint_least8_t;
|
||||
typedef signed char int_least8_t;
|
||||
|
||||
typedef unsigned short uint_least16_t;
|
||||
typedef signed short int_least16_t;
|
||||
|
||||
typedef unsigned int uint_least32_t;
|
||||
typedef signed int int_least32_t;
|
||||
|
||||
typedef unsigned long long uint_least64_t;
|
||||
typedef signed long long int_least64_t;
|
||||
|
||||
/* Fast Types */
|
||||
typedef unsigned char uint_fast8_t;
|
||||
typedef signed char int_fast8_t;
|
||||
|
||||
typedef unsigned int uint_fast16_t;
|
||||
typedef signed int int_fast16_t;
|
||||
|
||||
typedef unsigned int uint_fast32_t;
|
||||
typedef signed int int_fast32_t;
|
||||
|
||||
typedef unsigned long long uint_fast64_t;
|
||||
typedef signed long long int_fast64_t;
|
||||
|
||||
/* Types for `void *' pointers. */
|
||||
typedef int intptr_t;
|
||||
typedef unsigned int uintptr_t;
|
||||
|
||||
/* Largest integral types */
|
||||
typedef long long int intmax_t;
|
||||
typedef unsigned long long uintmax_t;
|
||||
|
||||
|
||||
#endif /* I386_STDINT_H */
|
1
util/mkelfImage/kunzip_src/arch/i386/lib/Makefile
Normal file
1
util/mkelfImage/kunzip_src/arch/i386/lib/Makefile
Normal file
@ -0,0 +1 @@
|
||||
ARCH_OPTIONS=
|
50
util/mkelfImage/kunzip_src/arch/i386/lib/kunzip.lds
Normal file
50
util/mkelfImage/kunzip_src/arch/i386/lib/kunzip.lds
Normal file
@ -0,0 +1,50 @@
|
||||
PAGE_SIZE = 4096;
|
||||
BASIC_ALIGN = 8;
|
||||
OUTPUT_FORMAT("elf32-i386")
|
||||
ENTRY(__start)
|
||||
SECTIONS
|
||||
{
|
||||
. = PAGE_SIZE;
|
||||
_start = .;
|
||||
/*
|
||||
* First we place the code and read only data (typically const declared).
|
||||
* This get placed in rom.
|
||||
*/
|
||||
.text : {
|
||||
_text = .;
|
||||
*(.text)
|
||||
_etext = .;
|
||||
_rodata = .;
|
||||
*(.rodata);
|
||||
_erodata = .;
|
||||
}
|
||||
/* Global data */
|
||||
.data : {
|
||||
_data = .;
|
||||
*(.data)
|
||||
CONSTRUCTORS
|
||||
*(.got)
|
||||
*(.sdata)
|
||||
_edata = .;
|
||||
}
|
||||
|
||||
/* Important align _bss so bss may be zeroed with quadword access */
|
||||
. = ALIGN(BASIC_ALIGN);
|
||||
.bss : {
|
||||
_bss = .;
|
||||
*(.sbss)
|
||||
*(.scommon)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
*(.heap)
|
||||
*(.stack)
|
||||
/* Important align _ebss so bss may be zeroed with quadword access */
|
||||
. = ALIGN(BASIC_ALIGN);
|
||||
_ebss = .;
|
||||
}
|
||||
_end = .;
|
||||
|
||||
/DISCARD/ : {
|
||||
*(*)
|
||||
}
|
||||
}
|
36
util/mkelfImage/kunzip_src/arch/i386/lib/start.S
Normal file
36
util/mkelfImage/kunzip_src/arch/i386/lib/start.S
Normal file
@ -0,0 +1,36 @@
|
||||
.text
|
||||
|
||||
__original_registers:
|
||||
.long 0, 0, 0, 0, 0, 0 , 0 , 0
|
||||
__entry:
|
||||
.long entry
|
||||
|
||||
.globl __start
|
||||
__start:
|
||||
movl %eax, 0+__original_registers
|
||||
movl %ebx, 4+__original_registers
|
||||
movl %ecx, 8+__original_registers
|
||||
movl %edx, 12+__original_registers
|
||||
movl %esi, 16+__original_registers
|
||||
movl %edi, 20+__original_registers
|
||||
movl %esp, 24+__original_registers
|
||||
movl %ebp, 28+__original_registers
|
||||
|
||||
__normal_start:
|
||||
movl $_estack, %esp
|
||||
call kunzip
|
||||
|
||||
.globl jmp_to_program_entry
|
||||
jmp_to_program_entry:
|
||||
movl 4(%esp), %eax
|
||||
movl %eax, __entry
|
||||
movl 0+__original_registers, %eax
|
||||
movl 4+__original_registers, %ebx
|
||||
movl 8+__original_registers, %ecx
|
||||
movl 12+__original_registers, %edx
|
||||
movl 16+__original_registers, %esi
|
||||
movl 20+__original_registers, %edi
|
||||
movl 24+__original_registers, %esp
|
||||
movl 28+__original_registers, %ebp
|
||||
jmp *__entry
|
||||
|
Reference in New Issue
Block a user