freebsd-dev/sys
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
..
amd64 When compat32 binary asks for the value of hw.machine_arch, report the 2010-07-22 09:13:49 +00:00
arm Add the s3c24x0 real time clock driver 2010-07-22 23:23:39 +00:00
boot completely ignore zero-sized elf sections in modules of elf object type (amd64) 2010-07-23 17:07:51 +00:00
bsm
cam ATA device reset starts probe sequence from the beginning. If reset caused 2010-07-06 19:05:41 +00:00
cddl Enable fake resolving of SMB RIDs by using nulldomain and UID_NOBODY 2010-07-22 23:30:24 +00:00
compat Remove proc locking, it's not needed after r210132. 2010-07-17 15:52:11 +00:00
conf Crypto(4) driver for AESNI. 2010-07-23 11:00:46 +00:00
contrib Update the port of FreeBSD to Cavium Octeon to use the Cavium Simple Executive 2010-07-20 19:25:11 +00:00
crypto Crypto(4) driver for AESNI. 2010-07-23 11:00:46 +00:00
ddb One more use for _SIG_VALID. 2010-07-12 10:18:10 +00:00
dev Fixes a mistake to calculate CALC_COEFF2() value that tmp[3] is 2010-07-22 20:08:02 +00:00
fs For the experimental NFSv4 server's dumplocks operation, add the 2010-07-19 23:33:42 +00:00
gdb
geom Prevent access after free to table entry in case when 2010-07-23 06:30:01 +00:00
gnu Move checking against RLIMIT_FSIZE into one place, vn_rlimit_fsize(). 2010-05-05 16:44:25 +00:00
i386 MFamd64: 2010-07-21 18:47:52 +00:00
ia64 When compat32 binary asks for the value of hw.machine_arch, report the 2010-07-22 09:13:49 +00:00
isa When we are not switching VTs, just mark all buffer to be updated. 2010-07-15 23:11:51 +00:00
kern completely ignore zero-sized elf sections in modules of elf object type (amd64) 2010-07-23 17:07:51 +00:00
kgssapi
libkern Provide memchr() in the libkern. 2010-06-02 17:27:23 +00:00
mips Add some comments. 2010-07-23 08:20:14 +00:00
modules Crypto(4) driver for AESNI. 2010-07-23 11:00:46 +00:00
net Fix an obvious typo from r1.1. We were acquiring an exclusive writer lock 2010-07-22 18:44:40 +00:00
net80211 - Introduce IEEE80211_KEY_NOREPLAY, a per-key flag to ignore replay 2010-07-01 20:50:12 +00:00
netatalk
netgraph Remove defunct email address from header as well. 2010-07-06 16:55:39 +00:00
netinet - Move common code from the hook functions that fills in a packet node struct to 2010-07-18 05:09:10 +00:00
netinet6 Since r186119 IP6 input counters for octets and packets were not 2010-07-21 13:01:21 +00:00
netipsec MFp4 @178283: 2010-05-24 16:27:47 +00:00
netipx
netnatm
netncp Switch to our preferred 2-clause BSD license. 2010-04-07 16:50:38 +00:00
netsmb Switch to our preferred 2-clause BSD license. 2010-04-07 16:50:38 +00:00
nfs Factor out the code shared between NFS client and server into its own 2010-02-16 20:00:21 +00:00
nfsclient Retire the NFS access cache timestamp structure. It was used in VOP_OPEN() 2010-07-15 19:40:48 +00:00
nfsserver Patch the regular NFS server so that it returns ESTALE to the client 2010-03-26 01:19:29 +00:00
nlm
opencrypto Use the fpu_kern_enter() interface to properly separate usermode FPU 2010-06-05 16:00:53 +00:00
pc98 Store fsbase and gsbase in the right fields of the mcontext. They were 2010-07-20 12:36:36 +00:00
pci Implement WOL. WOL is supported on RTL8139B or newer controllers. 2010-07-19 18:01:06 +00:00
powerpc When compat32 binary asks for the value of hw.machine_arch, report the 2010-07-22 09:13:49 +00:00
rpc When the regular NFS server replied to a UDP client out of the replay 2010-03-23 23:03:30 +00:00
security Add a case to make sure that internal audit records get converted 2010-05-04 15:29:07 +00:00
sparc64 KTR_CTx are long time aliased by existing classes so they can't serve 2010-07-21 10:05:07 +00:00
sun4v KTR_CTx are long time aliased by existing classes so they can't serve 2010-07-21 10:05:07 +00:00
sys - Bump __FreeBSD_version for BSD grep import 2010-07-22 19:15:26 +00:00
teken Just use <stdint.h> instead of <inttypes.h>. We don't need it here. 2010-04-03 17:22:28 +00:00
tools Flattened Device Tree helper scripts. 2010-06-02 17:22:38 +00:00
ufs Revert the previous commit. The race is not applicable to the lockmgr 2010-07-16 19:52:03 +00:00
vm Redo the page table page allocation on MIPS, as suggested by 2010-07-21 09:27:00 +00:00
x86 Fix several un-/signedness bugs of r210290 and r210293. Add one more check. 2010-07-20 15:48:29 +00:00
xdr
xen don't hold spin lock across free 2010-02-21 01:12:18 +00:00
Makefile