From b34eea348cb7d6d9c93d17d51a1f322114b8f15d Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Fri, 15 Feb 2008 18:16:06 +0000 Subject: Importing mkelfimage from ftp://ftp.lnxi.com/pub/mkelfImage/mkelfImage-2.7.tar.gz Signed-off-by: Stefan Reinauer Acked-by: Stefan Reinauer git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3103 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/mkelfImage/kunzip_src/arch/i386/lib/Makefile | 1 + .../mkelfImage/kunzip_src/arch/i386/lib/kunzip.lds | 50 ++++++++++++++++++++++ util/mkelfImage/kunzip_src/arch/i386/lib/start.S | 36 ++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 util/mkelfImage/kunzip_src/arch/i386/lib/Makefile create mode 100644 util/mkelfImage/kunzip_src/arch/i386/lib/kunzip.lds create mode 100644 util/mkelfImage/kunzip_src/arch/i386/lib/start.S (limited to 'util/mkelfImage/kunzip_src/arch/i386/lib') diff --git a/util/mkelfImage/kunzip_src/arch/i386/lib/Makefile b/util/mkelfImage/kunzip_src/arch/i386/lib/Makefile new file mode 100644 index 0000000000..df2474d210 --- /dev/null +++ b/util/mkelfImage/kunzip_src/arch/i386/lib/Makefile @@ -0,0 +1 @@ +ARCH_OPTIONS= diff --git a/util/mkelfImage/kunzip_src/arch/i386/lib/kunzip.lds b/util/mkelfImage/kunzip_src/arch/i386/lib/kunzip.lds new file mode 100644 index 0000000000..0e649005cf --- /dev/null +++ b/util/mkelfImage/kunzip_src/arch/i386/lib/kunzip.lds @@ -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/ : { + *(*) + } +} diff --git a/util/mkelfImage/kunzip_src/arch/i386/lib/start.S b/util/mkelfImage/kunzip_src/arch/i386/lib/start.S new file mode 100644 index 0000000000..fec7c9da66 --- /dev/null +++ b/util/mkelfImage/kunzip_src/arch/i386/lib/start.S @@ -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 + \ No newline at end of file -- cgit v1.2.3