Commit Graph

20 Commits

Author SHA1 Message Date
thorpej e727e3f180 Split elf32 vs. elf64 handling in loadfile(), including support for
each separately and explicitly.  BOOT_ELF is now BOOT_ELF32 and
BOOT_ELF64, and ELFSIZE should no longer be defined in loadfile_machdep.h.
2001-10-31 17:20:45 +00:00
thorpej 4810d73020 Build the loadfile() a.out, ECOFF, and ELF back-ends as separate
objects.
2001-10-31 01:51:42 +00:00
thorpej 91626c3515 Split the exec formats included by loadfile() into separate files.
Primary goal: explcitly select which ELF format (elf32 or elf64) to
support for a cross tool which uses loadfile().
2001-10-30 23:51:03 +00:00
bjh21 acf574f63e When loading ELF, zero out:
The e_shstrndx field in the ELF header, since we don't load .shstrtab.
The sh_name field in each section header, for the same reason.
The sh_offset field for any section we don't load.

This means the kernel has some chance of knowing what it's being given.  It
also means that the behaviour of old kernels with new loaders should be
deterministic (if not terribly useful: they still can't find the symbol
table).
2001-07-31 22:11:57 +00:00
bjh21 30f144749a G/C "off", since it was just tracking the difference between maxp and elfp. 2001-07-31 21:09:52 +00:00
bjh21 67a82e1d4e Fix a small memory leak when counting the size of the symbol table (shp was
ALLOC'ed if (LOAD_SYM|COUNT_SYM), but FREEd if (LOAD_SYM)).
2001-07-31 20:03:03 +00:00
bjh21 1a35da3617 When loading an ELF kernel, don't load all the STRTAB sections. Instead, just
load those STRTAB sections that are referenced by a SYMTAB that we're loading.

The main advantage of this is that (at least with the binaries output by my
ARM ELF linker) this removes the need to seek backwards through the file, which
is a big win when loading a gzipped kernel.

While we're here, don't allocate space for string tables we don't load.
2001-07-31 19:20:29 +00:00
fvdl 3350f68f80 Avoid warnings about uninitialised usage. 2001-07-19 18:55:38 +00:00
christos 366971a414 Back out previous. The booter will need to find the symbol table itself,
as explained in the code.
2001-07-13 17:43:23 +00:00
christos 6711e49228 From Nigel Pearson: Make SYMS and NSYMS work on ELF.
The MacOS booter needs them.
2001-07-13 17:17:12 +00:00
tsutsui 99d2177add Don't try to load a.out header if there is no space for it before text. 2000-12-03 02:53:04 +00:00
tsutsui 071bf9bca9 Don't print "]" if loading kernel does not have symbol table. 2000-11-11 09:25:12 +00:00
ragge aeb756f1b5 Add define NO_MID_CHECK that avoids checking of the a.out mid field. 2000-11-01 14:23:04 +00:00
hannken 2b8c4ea32e Fix IS_DATA and IS_TEXT. PF_X and PF_W are valid on p_pflags, not p_ptype. 1999-12-29 11:08:02 +00:00
thorpej 36ff5d93e8 Backout my libsa changes. 1999-11-13 21:17:56 +00:00
thorpej 471a3aa8e4 Update for the improvements to libsa, and don't reference libkern.h. 1999-11-11 20:23:16 +00:00
kleink 522cbf0248 Update to match new SVR4-style definition names in <sys/exec_elf.h>. 1999-10-25 13:55:06 +00:00
itohy e72ef17380 - a.out header is not a part of text segment in NMAGIC.
- Fix section alignment code.
Patch supplied by Izumi Tsutsui, PR #8575.
1999-10-08 03:55:06 +00:00
christos 2da63ed66f cosmetic printf change 1999-04-28 09:12:24 +00:00
christos 0fdd24ecdc MI loadfile (used by i386, pmax and sparc shortly) 1999-04-28 09:08:50 +00:00