freebsd-nq/sys/boot/common
Andriy Gapon 676799a00d 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
2010-07-23 17:07:51 +00:00
..
bcache.c
boot.c Introduce a new option (BOOT_PROMPT_123) that lets enter the boot prompt 2009-11-12 01:30:17 +00:00
bootstrap.h Remove file system support based on the simple file system protocol 2010-01-09 22:54:29 +00:00
commands.c Close a file descriptor leak in an error case. 2009-10-28 10:06:27 +00:00
console.c
dev_net.c - Add code allowing a network device to only be open and closed once 2010-01-09 21:23:39 +00:00
dev_net.h
devopen.c Show info about net devices in loader's 'lsdev' command. While there fix style. 2008-09-03 17:41:44 +00:00
help.common
interp_backslash.c
interp_forth.c
interp_parse.c
interp.c As reported in kern/118222, pxeboot in RELENG7 (and presumably 2008-11-20 14:57:09 +00:00
isapnp.c
isapnp.h
load_elf32_obj.c
load_elf32.c
load_elf64_obj.c
load_elf64.c
load_elf_obj.c completely ignore zero-sized elf sections in modules of elf object type (amd64) 2010-07-23 17:07:51 +00:00
load_elf.c Initial support of loader(8) for ARM machines running U-Boot. 2008-10-14 10:11:14 +00:00
loader.8 Add a helper function for loading geli keys from the loader. 2009-02-16 02:42:17 +00:00
ls.c
Makefile.inc Provide support in loader for booting 64-bit PowerPC kernels. Like amd64, 2010-07-12 00:49:22 +00:00
md.c Add support for memory disk (md). The size of the memory disk 2009-12-13 01:20:32 +00:00
merge_help.awk
misc.c Setting a variable to the same value twice doesn't actually make it 2008-08-04 06:39:52 +00:00
module.c Formatting nit 2010-05-10 18:23:00 +00:00
newvers.sh
panic.c
pnp.c
reloc_elf32.c
reloc_elf64.c
reloc_elf.c
ufsread.c Some of the boot loader code only works on a ufs file system, but it 2009-05-28 08:22:36 +00:00