History log of /freebsd-10-stable/sys/boot/common/load_elf_obj.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 298493 22-Apr-2016 emaste

MFC r277205 (imp):

Reserve and ignore the a new module metadata type MDT_PNP_INFO for
associating an optional PNP hint table with this module. In the
future, when these are added, these changes will silently ignore the
new type they would otherwise warn about. It will always be safe to
ignore this data. Get this into the builds today for some future
proofing.


# 296438 07-Mar-2016 dim

MFC r296419 (by kib):

In the link_elf_obj.c, handle sections of type SHT_AMD64_UNWIND same
as SHT_PROGBITS. This is needed after the clang 3.8 import, which
generates that type for .eh_frame section, which had SHT_PROGBITS type
before.

Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com>
PR: 207729
Tested by: dim (previous version)
Sponsored by: The FreeBSD Foundation

MFC r296428:

Since kernel modules can now contain sections of type SHT_AMD64_UNWIND,
the boot loader should not skip over these anymore while loading images.
Otherwise the kernel can still panic when it doesn't find the .eh_frame
section belonging to the .rela.eh_frame section.

Unfortunately this will require installing boot loaders from sys/boot
before attempting to boot with a new kernel.

Reviewed by: kib


# 294981 28-Jan-2016 smh

MFC r281169, r293724, r293796, r294029, r294041, r294058

MFC r281169 (by andrew):
Make global variabled only used in this file static

MFC r294058:
Make common boot file_loadraw name parameter const

MFC r294041:
Remove unused reg param from fdt_fixup_memory

MFC r293724:
Enable warnings in EFI boot code

MFC r293796:
Fix typo in libefi.c

MFC r294029:
Only build EFI components on supported compilers

Sponsored by: Multiplay


# 294417 20-Jan-2016 royger

MFC r277215, r277291, r277418, r280953 and r280954:

loader: implement multiboot support for Xen Dom0

Note that only the subset of the multiboot specification needed in order to
boot a Xen Dom0 is implemented.

Sponsored by: Citrix Systems R&D


# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 237338 20-Jun-2012 jhb

Don't return an error if a kld does not contain any modules (e.g. a
kld that only contained a sysctl). The kernel linker allows such
modules, so the boot loader should not reject them.

MFC after: 2 weeks


# 223295 19-Jun-2011 kan

Minimize backward seeks when trying to load ELF relocatable modules.

Some of loader filesystems are very ill equipped to handle seeking
backwards within the file. Namely, tftp requires trasfer to be
restarted from the start of the file every time we go backwards.


# 220311 03-Apr-2011 marcel

Add 2 new archsw interfaces:
1. arch_loadaddr - used by platform code to adjust the address at which
the object gets loaded. Implement PC98 using this new interface instead
of using conditional compilation. For ELF objects the ELF header is
passed as the data pointer. For raw files it's the filename. Note that
ELF objects are first considered as raw files.
2. arch_loadseg - used by platform code to keep track of actual segments,
so that (instruction) caches can be flushed or translations can be
created. Both the ELF header as well as the program header are passed
to allow platform code to treat the kernel proper differently from any
additional modules and to have all the relevant details of the loaded
segment (e.g. protection).


# 210423 23-Jul-2010 avg

completely ignore zero-sized elf sections in modules of elf object type (amd64)

Current code doesn't check size of elf sections and may perform needless
actions of zero-sized memory allocation and similar.
The bigger issue is that alignment requirement of a zero-sized section
gets effectively applied to the next section if it has smaller alignment
requirement. But other tools, like gdb and consequently kgdb,
completely ignore zero-sized sections and thus may map symbols to
addresses differently.

Zero-sized sections are not typical in general.
Their typical (only, even) cause in FreeBSD modules is inline assembly that
creates custom sections which is found in pcpu.h and vnet.h. Mere inclusion
of one of those header files produces a custom section in elf output.
If there is no actual use for the section in a given module, then the
section remains empty.

Better solution is to avoid creating zero-sized sections altogether,
which is in plans.

Preloaded modules are handled in boot code (load_elf_obj.c), while
dynamically loaded modules are handled by kernel (link_elf_obj.c).

Based on code by: np
MFC after: 3 weeks


# 153504 18-Dec-2005 marcel

Make our ELF64 type definitions match standards. In particular this
means:
o Remove Elf64_Quarter,
o Redefine Elf64_Half to be 16-bit,
o Redefine Elf64_Word to be 32-bit,
o Add Elf64_Xword and Elf64_Sxword for 64-bit entities,
o Use Elf_Size in MI code to abstract the difference between
Elf32_Word and Elf64_Word.
o Add Elf_Ssize as the signed counterpart of Elf_Size.

MFC after: 2 weeks


# 134459 28-Aug-2004 iedowse

Add the loader side of support for preloading ELF relocatable object
format modules, which are currently only used on the amd64 platform.
This initial implementation just parses enough of the module to
allow it to extract dependencies and load all the bits into the
right place in memory, so the kernel must still do the full relocation
and linking. The details of the loaded sections are passed to the
kernel by supplying a copy of the ELF section header table as module
metadata with the MODINFOMD_SHDR tag.