opnsense-src/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 Use the correct printf specifier. 2004-10-03 16:34:01 +00:00
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 Fix a comparison that broke ``set console=vidconsole'' and even the 2005-07-29 12:47:42 +00:00
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 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
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 Replace a rarely used "depuration" with "debugging". 2006-10-13 20:48:17 +00:00
interp.c As reported in kern/118222, pxeboot in RELENG7 (and presumably 2008-11-20 14:57:09 +00:00
interp_backslash.c Use __FBSDID(). 2003-08-25 23:30:41 +00:00
interp_forth.c Use __FBSDID(). 2003-08-25 23:30:41 +00:00
interp_parse.c Use __FBSDID(). 2003-08-25 23:30:41 +00:00
isapnp.c Use __FBSDID(). 2003-08-25 23:30:41 +00:00
isapnp.h Remove __P. 2002-03-20 08:00:54 +00:00
load_elf.c Initial support of loader(8) for ARM machines running U-Boot. 2008-10-14 10:11:14 +00:00
load_elf32.c Use __FBSDID(). 2003-08-25 23:30:41 +00:00
load_elf32_obj.c Add the loader side of support for preloading ELF relocatable object 2004-08-29 00:48:42 +00:00
load_elf64.c Use __FBSDID(). 2003-08-25 23:30:41 +00:00
load_elf64_obj.c Add the loader side of support for preloading ELF relocatable object 2004-08-29 00:48:42 +00:00
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
loader.8 Add a helper function for loading geli keys from the loader. 2009-02-16 02:42:17 +00:00
ls.c Use __FBSDID(). 2003-08-25 23:30:41 +00:00
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 Ignore a sub-topic match if it is inside the command description. 2006-09-28 19:06:20 +00:00
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 When building a kernel or the loader, let the hostname be overridden 2004-07-01 06:40:12 +00:00
panic.c Fix WARNS=2 warnings. 2006-09-29 20:57:38 +00:00
pnp.c Garbage collect the code for auto-loading modules based on ISAPNP IDs, 2007-01-07 22:25:45 +00:00
reloc_elf.c Make our ELF64 type definitions match standards. In particular this 2005-12-18 04:52:37 +00:00
reloc_elf32.c Separate out the ELF relocation code from the ELF loader, and add 2004-08-28 23:03:05 +00:00
reloc_elf64.c Separate out the ELF relocation code from the ELF loader, and add 2004-08-28 23:03:05 +00:00
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