summaryrefslogtreecommitdiff
path: root/elf_ops.h
AgeCommit message (Collapse)AuthorFilesLines
2009-06-05Fix elf loader range checkingPaul Brook1-3/+3
The ELF loader tracks the range of addresses used by a binary. However this incorrectly assumes zero is not a valid address. Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-03-13Make the ELF loader aware of backwards compatibilityblueswir11-2/+15
Most 64 bit architectures I'm aware of support running 32 bit code of the same architecture as well. So x86_64 can run i386 code easily and ppc64 can run ppc code. Unfortunately, the current checks are pretty strict. So you can only load e.g. an x86_64 elf binary on qemu-system-x86_64, but no i386 one. This can get really annoying. I first encountered this issue with my multiboot patch, where qemu-system-x86_64 was unable to load an i386 elf binary because the elf loader rejected it. The same thing happened again on PPC64 now. The firmware we're loading is a PPC32 elf binary, as it's shared with PPC32. But the platform is PPC64. Right now there is a hack for this in the ppc cpu.h definition, that simply sets the type to PPC32 in system emulation mode. While that works fine for the firmware, it's no good if you also want to load a PPC64 kernel with -kernel. So in order to solve this mess, I figured the easiest way is to make the elf loader aware of platforms that are backwards compatible. For now I was only sure that x86_64 does i386 and ppc64 does ppc32, but maybe there are other combinations too. This patch is a prerequisite for having a working -kernel option on PPC64. Signed-off-by: Alexander Graf <alex@csgraf.de> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6855 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-22Use load address when loading ELF images.pbrook1-2/+4
Signed-off-by: Paul Brook <paul@codesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5513 c046a42c-6fe2-441c-8c8c-71466251a162
2008-10-22* Use function pointers for symbol lookup (currently for elf32 and elf64,pbrook1-24/+63
could be expanded). This also fixes the bug with mips elf64 symbols in current Qemu trunk. * Use quicksort and binary search for symbol lookup. * Remove unneeded entries from symbol table. This reduced a typical table size (linux mips kernel) from 1764487 to 11656 entries. Signed-off-by: Stefan Weil <weil@mail.berlios.de> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5510 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-18Add statics and missing #includes for prototypes.pbrook1-3/+3
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3683 c046a42c-6fe2-441c-8c8c-71466251a162
2007-10-17Cast ELF datatypes properly to host 64bit types.ths1-3/+3
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3407 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-25 Remove the target dependency introduced by previous patchblueswir11-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3239 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-24 Fix loading above 4Gblueswir11-2/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3230 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-17find -type f | xargs sed -i 's/[\t ]*$//g' # Yes, again. Note the star in ↵ths1-3/+3
the regex. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3177 c046a42c-6fe2-441c-8c8c-71466251a162
2007-09-16find -type f | xargs sed -i 's/[\t ]$//g' # on most filesths1-5/+5
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3173 c046a42c-6fe2-441c-8c8c-71466251a162
2007-04-01Improved initrd support for mips.ths1-1/+11
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2574 c046a42c-6fe2-441c-8c8c-71466251a162
2006-12-23Simplify error handling again.ths1-7/+4
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2275 c046a42c-6fe2-441c-8c8c-71466251a162
2006-12-23Check ELF binaries for machine type and endianness.ths1-4/+9
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2274 c046a42c-6fe2-441c-8c8c-71466251a162
2006-05-02fixed memory leakbellard1-0/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1890 c046a42c-6fe2-441c-8c8c-71466251a162
2006-04-26added entry parameter to ELF loaderbellard1-3/+10
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1859 c046a42c-6fe2-441c-8c8c-71466251a162
2006-04-23generic ELF loaderbellard1-0/+197
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1831 c046a42c-6fe2-441c-8c8c-71466251a162