head	1.19;
access;
symbols
	netbsd-9-5-RELEASE:1.19
	netbsd-11-0-RELEASE:1.19
	netbsd-11-0-RC7:1.19
	netbsd-11-0-RC6:1.19
	netbsd-11-0-RC5:1.19
	netbsd-11-0-RC4:1.19
	netbsd-11-0-RC3:1.19
	netbsd-11-0-RC2:1.19
	netbsd-11-0-RC1:1.19
	perseant-exfatfs-base-20250801:1.19
	netbsd-11:1.19.0.106
	netbsd-11-base:1.19
	netbsd-10-1-RELEASE:1.19
	perseant-exfatfs-base-20240630:1.19
	perseant-exfatfs:1.19.0.104
	perseant-exfatfs-base:1.19
	netbsd-8-3-RELEASE:1.19
	netbsd-9-4-RELEASE:1.19
	netbsd-10-0-RELEASE:1.19
	netbsd-10-0-RC6:1.19
	netbsd-10-0-RC5:1.19
	netbsd-10-0-RC4:1.19
	netbsd-10-0-RC3:1.19
	netbsd-10-0-RC2:1.19
	thorpej-ifq:1.19.0.102
	thorpej-ifq-base:1.19
	thorpej-altq-separation:1.19.0.100
	thorpej-altq-separation-base:1.19
	netbsd-10-0-RC1:1.19
	netbsd-10:1.19.0.98
	netbsd-10-base:1.19
	bouyer-sunxi-drm:1.19.0.96
	bouyer-sunxi-drm-base:1.19
	netbsd-9-3-RELEASE:1.19
	thorpej-i2c-spi-conf2:1.19.0.94
	thorpej-i2c-spi-conf2-base:1.19
	thorpej-futex2:1.19.0.92
	thorpej-futex2-base:1.19
	thorpej-cfargs2:1.19.0.90
	thorpej-cfargs2-base:1.19
	cjep_sun2x-base1:1.19
	cjep_sun2x:1.19.0.88
	cjep_sun2x-base:1.19
	cjep_staticlib_x-base1:1.19
	netbsd-9-2-RELEASE:1.19
	cjep_staticlib_x:1.19.0.86
	cjep_staticlib_x-base:1.19
	thorpej-i2c-spi-conf:1.19.0.84
	thorpej-i2c-spi-conf-base:1.19
	thorpej-cfargs:1.19.0.82
	thorpej-cfargs-base:1.19
	thorpej-futex:1.19.0.80
	thorpej-futex-base:1.19
	netbsd-9-1-RELEASE:1.19
	bouyer-xenpvh-base2:1.19
	phil-wifi-20200421:1.19
	bouyer-xenpvh-base1:1.19
	phil-wifi-20200411:1.19
	bouyer-xenpvh:1.19.0.78
	bouyer-xenpvh-base:1.19
	is-mlppp:1.19.0.76
	is-mlppp-base:1.19
	phil-wifi-20200406:1.19
	netbsd-8-2-RELEASE:1.19
	ad-namecache-base3:1.19
	netbsd-9-0-RELEASE:1.19
	netbsd-9-0-RC2:1.19
	ad-namecache-base2:1.19
	ad-namecache-base1:1.19
	ad-namecache:1.19.0.74
	ad-namecache-base:1.19
	netbsd-9-0-RC1:1.19
	phil-wifi-20191119:1.19
	netbsd-9:1.19.0.72
	netbsd-9-base:1.19
	phil-wifi-20190609:1.19
	netbsd-8-1-RELEASE:1.19
	netbsd-8-1-RC1:1.19
	isaki-audio2:1.19.0.70
	isaki-audio2-base:1.19
	pgoyette-compat-merge-20190127:1.19
	pgoyette-compat-20190127:1.19
	pgoyette-compat-20190118:1.19
	pgoyette-compat-1226:1.19
	pgoyette-compat-1126:1.19
	pgoyette-compat-1020:1.19
	pgoyette-compat-0930:1.19
	pgoyette-compat-0906:1.19
	netbsd-7-2-RELEASE:1.19
	pgoyette-compat-0728:1.19
	netbsd-8-0-RELEASE:1.19
	phil-wifi:1.19.0.68
	phil-wifi-base:1.19
	pgoyette-compat-0625:1.19
	netbsd-8-0-RC2:1.19
	pgoyette-compat-0521:1.19
	pgoyette-compat-0502:1.19
	pgoyette-compat-0422:1.19
	netbsd-8-0-RC1:1.19
	pgoyette-compat-0415:1.19
	pgoyette-compat-0407:1.19
	pgoyette-compat-0330:1.19
	pgoyette-compat-0322:1.19
	pgoyette-compat-0315:1.19
	netbsd-7-1-2-RELEASE:1.19
	pgoyette-compat:1.19.0.66
	pgoyette-compat-base:1.19
	netbsd-7-1-1-RELEASE:1.19
	tls-maxphys-base-20171202:1.19
	matt-nb8-mediatek:1.19.0.64
	matt-nb8-mediatek-base:1.19
	nick-nhusb-base-20170825:1.19
	perseant-stdc-iso10646:1.19.0.62
	perseant-stdc-iso10646-base:1.19
	netbsd-8:1.19.0.60
	netbsd-8-base:1.19
	prg-localcount2-base3:1.19
	prg-localcount2-base2:1.19
	prg-localcount2-base1:1.19
	prg-localcount2:1.19.0.58
	prg-localcount2-base:1.19
	pgoyette-localcount-20170426:1.19
	bouyer-socketcan-base1:1.19
	jdolecek-ncq:1.19.0.56
	jdolecek-ncq-base:1.19
	pgoyette-localcount-20170320:1.19
	netbsd-7-1:1.19.0.54
	netbsd-7-1-RELEASE:1.19
	netbsd-7-1-RC2:1.19
	nick-nhusb-base-20170204:1.19
	netbsd-7-nhusb-base-20170116:1.19
	bouyer-socketcan:1.19.0.52
	bouyer-socketcan-base:1.19
	pgoyette-localcount-20170107:1.19
	netbsd-7-1-RC1:1.19
	nick-nhusb-base-20161204:1.19
	pgoyette-localcount-20161104:1.19
	netbsd-7-0-2-RELEASE:1.19
	nick-nhusb-base-20161004:1.19
	localcount-20160914:1.19
	netbsd-7-nhusb:1.19.0.50
	netbsd-7-nhusb-base:1.19
	pgoyette-localcount-20160806:1.19
	pgoyette-localcount-20160726:1.19
	pgoyette-localcount:1.19.0.48
	pgoyette-localcount-base:1.19
	nick-nhusb-base-20160907:1.19
	nick-nhusb-base-20160529:1.19
	netbsd-7-0-1-RELEASE:1.19
	nick-nhusb-base-20160422:1.19
	nick-nhusb-base-20160319:1.19
	nick-nhusb-base-20151226:1.19
	netbsd-7-0:1.19.0.46
	netbsd-7-0-RELEASE:1.19
	nick-nhusb-base-20150921:1.19
	netbsd-7-0-RC3:1.19
	netbsd-7-0-RC2:1.19
	netbsd-7-0-RC1:1.19
	nick-nhusb-base-20150606:1.19
	nick-nhusb-base-20150406:1.19
	nick-nhusb:1.19.0.44
	nick-nhusb-base:1.19
	netbsd-5-2-3-RELEASE:1.18
	netbsd-5-1-5-RELEASE:1.18
	netbsd-6-0-6-RELEASE:1.19
	netbsd-6-1-5-RELEASE:1.19
	netbsd-7:1.19.0.42
	netbsd-7-base:1.19
	yamt-pagecache-base9:1.19
	yamt-pagecache-tag8:1.19
	netbsd-6-1-4-RELEASE:1.19
	netbsd-6-0-5-RELEASE:1.19
	tls-earlyentropy:1.19.0.40
	tls-earlyentropy-base:1.19
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.19
	riastradh-drm2-base3:1.19
	netbsd-6-1-3-RELEASE:1.19
	netbsd-6-0-4-RELEASE:1.19
	netbsd-5-2-2-RELEASE:1.18
	netbsd-5-1-4-RELEASE:1.18
	netbsd-6-1-2-RELEASE:1.19
	netbsd-6-0-3-RELEASE:1.19
	netbsd-5-2-1-RELEASE:1.18
	netbsd-5-1-3-RELEASE:1.18
	rmind-smpnet-nbase:1.19
	netbsd-6-1-1-RELEASE:1.19
	riastradh-drm2-base2:1.19
	riastradh-drm2-base1:1.19
	riastradh-drm2:1.19.0.38
	riastradh-drm2-base:1.19
	rmind-smpnet:1.19.0.30
	rmind-smpnet-base:1.19
	netbsd-6-1:1.19.0.36
	netbsd-6-0-2-RELEASE:1.19
	netbsd-6-1-RELEASE:1.19
	khorben-n900:1.19.0.34
	netbsd-6-1-RC4:1.19
	netbsd-6-1-RC3:1.19
	agc-symver:1.19.0.32
	agc-symver-base:1.19
	netbsd-6-1-RC2:1.19
	netbsd-6-1-RC1:1.19
	yamt-pagecache-base8:1.19
	netbsd-5-2:1.18.0.20
	netbsd-6-0-1-RELEASE:1.19
	yamt-pagecache-base7:1.19
	netbsd-5-2-RELEASE:1.18
	netbsd-5-2-RC1:1.18
	matt-nb6-plus-nbase:1.19
	yamt-pagecache-base6:1.19
	netbsd-6-0:1.19.0.28
	netbsd-6-0-RELEASE:1.19
	netbsd-6-0-RC2:1.19
	tls-maxphys:1.19.0.26
	tls-maxphys-base:1.19
	matt-nb6-plus:1.19.0.24
	matt-nb6-plus-base:1.19
	netbsd-6-0-RC1:1.19
	jmcneill-usbmp-base10:1.19
	yamt-pagecache-base5:1.19
	jmcneill-usbmp-base9:1.19
	yamt-pagecache-base4:1.19
	jmcneill-usbmp-base8:1.19
	jmcneill-usbmp-base7:1.19
	jmcneill-usbmp-base6:1.19
	jmcneill-usbmp-base5:1.19
	jmcneill-usbmp-base4:1.19
	jmcneill-usbmp-base3:1.19
	jmcneill-usbmp-pre-base2:1.19
	jmcneill-usbmp-base2:1.19
	netbsd-6:1.19.0.22
	netbsd-6-base:1.19
	netbsd-5-1-2-RELEASE:1.18
	netbsd-5-1-1-RELEASE:1.18
	jmcneill-usbmp:1.19.0.20
	jmcneill-usbmp-base:1.19
	jmcneill-audiomp3:1.19.0.18
	jmcneill-audiomp3-base:1.19
	yamt-pagecache-base3:1.19
	yamt-pagecache-base2:1.19
	yamt-pagecache:1.19.0.16
	yamt-pagecache-base:1.19
	rmind-uvmplock-nbase:1.19
	cherry-xenmp:1.19.0.14
	cherry-xenmp-base:1.19
	jym-xensuspend-nbase:1.19
	uebayasi-xip-base7:1.19
	bouyer-quota2-nbase:1.19
	bouyer-quota2:1.19.0.12
	bouyer-quota2-base:1.19
	jruoho-x86intr:1.19.0.10
	jruoho-x86intr-base:1.19
	matt-mips64-premerge-20101231:1.19
	matt-nb5-mips64-premerge-20101231:1.18
	matt-nb5-pq3:1.18.0.18
	matt-nb5-pq3-base:1.18
	netbsd-5-1:1.18.0.16
	uebayasi-xip-base6:1.19
	uebayasi-xip-base5:1.19
	netbsd-5-1-RELEASE:1.18
	uebayasi-xip-base4:1.19
	uebayasi-xip-base3:1.19
	yamt-nfs-mp-base11:1.19
	netbsd-5-1-RC4:1.18
	matt-nb5-mips64-k15:1.18
	uebayasi-xip-base2:1.19
	yamt-nfs-mp-base10:1.19
	netbsd-5-1-RC3:1.18
	netbsd-5-1-RC2:1.18
	uebayasi-xip-base1:1.19
	netbsd-5-1-RC1:1.18
	rmind-uvmplock:1.19.0.8
	rmind-uvmplock-base:1.19
	yamt-nfs-mp-base9:1.19
	uebayasi-xip:1.19.0.6
	uebayasi-xip-base:1.19
	netbsd-5-0-2-RELEASE:1.18
	matt-nb5-mips64-premerge-20091211:1.18
	matt-premerge-20091211:1.19
	yamt-nfs-mp-base8:1.19
	matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.18
	matt-nb4-mips64-k7-u2a-k9b:1.18
	matt-nb5-mips64-u1-k1-k5:1.18
	yamt-nfs-mp-base7:1.19
	matt-nb5-mips64:1.18.0.14
	netbsd-5-0-1-RELEASE:1.18
	jymxensuspend-base:1.19
	yamt-nfs-mp-base6:1.19
	yamt-nfs-mp-base5:1.19
	yamt-nfs-mp-base4:1.19
	yamt-nfs-mp-base3:1.19
	nick-hppapmap-base4:1.19
	nick-hppapmap-base3:1.19
	netbsd-5-0:1.18.0.12
	netbsd-5-0-RELEASE:1.18
	netbsd-5-0-RC4:1.18
	netbsd-5-0-RC3:1.18
	nick-hppapmap-base2:1.19
	netbsd-5-0-RC2:1.18
	jym-xensuspend:1.19.0.4
	jym-xensuspend-base:1.19
	netbsd-5-0-RC1:1.18
	haad-dm-base2:1.19
	haad-nbase2:1.19
	ad-audiomp2:1.19.0.2
	ad-audiomp2-base:1.19
	netbsd-5:1.18.0.10
	netbsd-5-base:1.18
	nick-hppapmap:1.18.0.8
	nick-hppapmap-base:1.19
	matt-mips64-base2:1.18
	haad-dm-base1:1.18
	wrstuden-revivesa-base-4:1.18
	netbsd-4-0-1-RELEASE:1.17
	wrstuden-revivesa-base-3:1.18
	wrstuden-revivesa-base-2:1.18
	wrstuden-fixsa-newbase:1.17
	nick-csl-alignment-base5:1.17
	haad-dm:1.18.0.6
	haad-dm-base:1.19
	wrstuden-revivesa-base-1:1.18
	simonb-wapbl-nbase:1.18
	yamt-pf42-base4:1.18
	simonb-wapbl:1.18.0.4
	simonb-wapbl-base:1.18
	yamt-pf42-base3:1.18
	hpcarm-cleanup-nbase:1.18
	yamt-pf42-baseX:1.17
	yamt-pf42-base2:1.18
	yamt-nfs-mp-base2:1.18
	wrstuden-revivesa:1.18.0.2
	wrstuden-revivesa-base:1.18
	yamt-nfs-mp:1.17.0.72
	yamt-nfs-mp-base:1.17
	yamt-pf42:1.17.0.70
	yamt-pf42-base:1.17
	ad-socklock-base1:1.17
	yamt-lazymbuf-base15:1.17
	yamt-lazymbuf-base14:1.17
	keiichi-mipv6-nbase:1.17
	mjf-devfs2:1.17.0.68
	mjf-devfs2-base:1.19
	nick-net80211-sync:1.17.0.66
	nick-net80211-sync-base:1.17
	keiichi-mipv6:1.17.0.64
	keiichi-mipv6-base:1.17
	bouyer-xeni386-merge1:1.17
	matt-armv6-prevmlocking:1.17
	wrstuden-fixsa-base-1:1.17
	vmlocking2-base3:1.17
	netbsd-4-0:1.17.0.62
	netbsd-4-0-RELEASE:1.17
	bouyer-xeni386-nbase:1.17
	yamt-kmem-base3:1.17
	cube-autoconf:1.17.0.60
	cube-autoconf-base:1.17
	yamt-kmem-base2:1.17
	bouyer-xeni386:1.17.0.58
	bouyer-xeni386-base:1.17
	yamt-kmem:1.17.0.56
	yamt-kmem-base:1.17
	vmlocking2-base2:1.17
	reinoud-bufcleanup-nbase:1.17
	vmlocking2:1.17.0.54
	vmlocking2-base1:1.17
	netbsd-4-0-RC5:1.17
	matt-nb4-arm:1.17.0.52
	matt-nb4-arm-base:1.17
	matt-armv6-nbase:1.17
	jmcneill-base:1.17
	netbsd-4-0-RC4:1.17
	mjf-devfs:1.17.0.50
	mjf-devfs-base:1.17
	bouyer-xenamd64-base2:1.17
	vmlocking-nbase:1.17
	yamt-x86pmap-base4:1.17
	bouyer-xenamd64:1.17.0.48
	bouyer-xenamd64-base:1.17
	netbsd-4-0-RC3:1.17
	yamt-x86pmap-base3:1.17
	yamt-x86pmap-base2:1.17
	netbsd-4-0-RC2:1.17
	yamt-x86pmap:1.17.0.46
	yamt-x86pmap-base:1.17
	netbsd-4-0-RC1:1.17
	matt-armv6:1.17.0.44
	matt-armv6-base:1.17
	jmcneill-pm:1.17.0.42
	jmcneill-pm-base:1.17
	hpcarm-cleanup:1.17.0.40
	hpcarm-cleanup-base:1.17
	nick-csl-alignment:1.17.0.38
	nick-csl-alignment-base:1.17
	matt-mips64:1.17.0.36
	matt-mips64-base:1.17
	netbsd-3-1-1-RELEASE:1.13
	netbsd-3-0-3-RELEASE:1.13
	yamt-idlelwp-base8:1.17
	wrstuden-fixsa:1.17.0.34
	wrstuden-fixsa-base:1.17
	ppcoea-renovation:1.17.0.32
	ppcoea-renovation-base:1.17
	thorpej-atomic:1.17.0.30
	thorpej-atomic-base:1.17
	reinoud-bufcleanup:1.17.0.28
	reinoud-bufcleanup-base:1.17
	mjf-ufs-trans:1.17.0.26
	mjf-ufs-trans-base:1.17
	vmlocking:1.17.0.24
	vmlocking-base:1.17
	ad-audiomp:1.17.0.22
	ad-audiomp-base:1.17
	yamt-idlelwp:1.17.0.20
	post-newlock2-merge:1.17
	newlock2-nbase:1.17
	yamt-splraiseipl-base5:1.17
	yamt-splraiseipl-base4:1.17
	yamt-splraiseipl-base3:1.17
	abandoned-netbsd-4-base:1.17
	abandoned-netbsd-4:1.17.0.12
	netbsd-3-1:1.13.0.22
	netbsd-3-1-RELEASE:1.13
	netbsd-3-0-2-RELEASE:1.13
	yamt-splraiseipl-base2:1.17
	netbsd-3-1-RC4:1.13
	yamt-splraiseipl:1.17.0.16
	yamt-splraiseipl-base:1.17
	netbsd-3-1-RC3:1.13
	yamt-pdpolicy-base9:1.17
	newlock2:1.17.0.14
	newlock2-base:1.17
	yamt-pdpolicy-base8:1.17
	netbsd-3-1-RC2:1.13
	netbsd-3-1-RC1:1.13
	yamt-pdpolicy-base7:1.17
	netbsd-4:1.17.0.18
	netbsd-4-base:1.17
	yamt-pdpolicy-base6:1.17
	chap-midi-nbase:1.17
	netbsd-3-0-1-RELEASE:1.13
	gdamore-uart:1.17.0.10
	gdamore-uart-base:1.17
	simonb-timcounters-final:1.15.4.1
	yamt-pdpolicy-base5:1.17
	chap-midi:1.17.0.8
	chap-midi-base:1.17
	yamt-pdpolicy-base4:1.17
	yamt-pdpolicy-base3:1.17
	peter-altq-base:1.17
	peter-altq:1.17.0.6
	yamt-pdpolicy-base2:1.17
	elad-kernelauth-base:1.17
	elad-kernelauth:1.17.0.4
	yamt-pdpolicy:1.17.0.2
	yamt-pdpolicy-base:1.17
	yamt-uio_vmspace-base5:1.15
	simonb-timecounters:1.15.0.4
	simonb-timecounters-base:1.17
	rpaulo-netinet-merge-pcb:1.15.0.2
	rpaulo-netinet-merge-pcb-base:1.17
	yamt-uio_vmspace:1.14.0.2
	netbsd-3-0:1.13.0.20
	netbsd-3-0-RELEASE:1.13
	netbsd-3-0-RC6:1.13
	yamt-readahead-base3:1.13
	netbsd-3-0-RC5:1.13
	netbsd-3-0-RC4:1.13
	netbsd-3-0-RC3:1.13
	yamt-readahead-base2:1.13
	netbsd-3-0-RC2:1.13
	yamt-readahead-pervnode:1.13
	yamt-readahead-perfile:1.13
	yamt-readahead:1.13.0.18
	yamt-readahead-base:1.13
	netbsd-3-0-RC1:1.13
	yamt-vop-base3:1.13
	netbsd-2-0-3-RELEASE:1.10
	netbsd-2-1:1.10.0.6
	yamt-vop-base2:1.13
	thorpej-vnode-attr:1.13.0.16
	thorpej-vnode-attr-base:1.13
	netbsd-2-1-RELEASE:1.10
	yamt-vop:1.13.0.14
	yamt-vop-base:1.13
	netbsd-2-1-RC6:1.10
	netbsd-2-1-RC5:1.10
	netbsd-2-1-RC4:1.10
	netbsd-2-1-RC3:1.10
	netbsd-2-1-RC2:1.10
	netbsd-2-1-RC1:1.10
	yamt-lazymbuf:1.13.0.12
	yamt-km-base4:1.13
	netbsd-2-0-2-RELEASE:1.10
	yamt-km-base3:1.13
	netbsd-3:1.13.0.10
	netbsd-3-base:1.13
	yamt-km-base2:1.13
	yamt-km:1.13.0.6
	yamt-km-base:1.13
	kent-audio2:1.13.0.4
	kent-audio2-base:1.13
	netbsd-2-0-1-RELEASE:1.10
	kent-audio1-beforemerge:1.13
	netbsd-2:1.10.0.4
	netbsd-2-base:1.10
	kent-audio1:1.13.0.2
	kent-audio1-base:1.13
	netbsd-2-0-RELEASE:1.10
	netbsd-2-0-RC5:1.10
	netbsd-2-0-RC4:1.10
	netbsd-2-0-RC3:1.10
	netbsd-2-0-RC2:1.10
	netbsd-2-0-RC1:1.10
	netbsd-2-0:1.10.0.2
	netbsd-2-0-base:1.10
	netbsd-1-6-PATCH002-RELEASE:1.7
	netbsd-1-6-PATCH002:1.7
	netbsd-1-6-PATCH002-RC4:1.7
	netbsd-1-6-PATCH002-RC3:1.7
	netbsd-1-6-PATCH002-RC2:1.7
	netbsd-1-6-PATCH002-RC1:1.7
	ktrace-lwp:1.7.0.16
	ktrace-lwp-base:1.13
	netbsd-1-6-PATCH001:1.7
	netbsd-1-6-PATCH001-RELEASE:1.7
	netbsd-1-6-PATCH001-RC3:1.7
	netbsd-1-6-PATCH001-RC2:1.7
	netbsd-1-6-PATCH001-RC1:1.7
	nathanw_sa_end:1.6.6.2
	nathanw_sa_before_merge:1.7
	fvdl_fs64_base:1.7
	gmcgarry_ctxsw:1.7.0.14
	gmcgarry_ctxsw_base:1.7
	gmcgarry_ucred:1.7.0.12
	gmcgarry_ucred_base:1.7
	nathanw_sa_base:1.7
	kqueue-aftermerge:1.7
	kqueue-beforemerge:1.7
	netbsd-1-6-RELEASE:1.7
	netbsd-1-6-RC3:1.7
	netbsd-1-6-RC2:1.7
	netbsd-1-6-RC1:1.7
	netbsd-1-6:1.7.0.10
	netbsd-1-6-base:1.7
	gehenna-devsw:1.7.0.8
	gehenna-devsw-base:1.7
	eeh-devprop:1.7.0.6
	eeh-devprop-base:1.7
	newlock:1.7.0.4
	newlock-base:1.7
	ifpoll-base:1.7
	nathanw_sa:1.6.0.6
	thorpej-mips-cache:1.6.0.4
	thorpej-mips-cache-base:1.6
	thorpej-devvp-base3:1.6
	thorpej-devvp-base2:1.6
	post-chs-ubcperf:1.6
	pre-chs-ubcperf:1.6
	thorpej-devvp:1.6.0.2
	thorpej-devvp-base:1.6
	kqueue:1.5.0.2
	kqueue-base:1.7
	thorpej_scsipi_beforemerge:1.2
	thorpej_scsipi_base:1.2
	thorpej_scsipi:1.1.0.2
	thorpej_scsipi_nbase:1.2;
locks; strict;
comment	@// @;


1.19
date	2008.11.07.16.28.26;	author rafal;	state Exp;
branches;
next	1.18;

1.18
date	2008.04.28.20.23.20;	author martin;	state Exp;
branches
	1.18.6.1
	1.18.8.1;
next	1.17;

1.17
date	2006.03.05.04.04.13;	author uwe;	state Exp;
branches
	1.17.2.1
	1.17.68.1
	1.17.70.1
	1.17.72.1;
next	1.16;

1.16
date	2006.03.02.23.56.58;	author uwe;	state Exp;
branches;
next	1.15;

1.15
date	2006.01.14.23.23.32;	author uwe;	state Exp;
branches
	1.15.2.1
	1.15.4.1;
next	1.14;

1.14
date	2005.12.11.12.17.28;	author christos;	state Exp;
branches
	1.14.2.1;
next	1.13;

1.13
date	2004.08.06.18.33.09;	author uch;	state Exp;
branches
	1.13.12.1;
next	1.12;

1.12
date	2004.06.12.12.09.38;	author uch;	state Exp;
branches;
next	1.11;

1.11
date	2004.06.10.15.57.18;	author uch;	state Exp;
branches;
next	1.10;

1.10
date	2004.03.16.22.30.36;	author uwe;	state Exp;
branches;
next	1.9;

1.9
date	2003.12.23.04.59.44;	author uwe;	state Exp;
branches;
next	1.8;

1.8
date	2003.12.18.12.19.49;	author uwe;	state Exp;
branches;
next	1.7;

1.7
date	2002.02.11.17.08.55;	author uch;	state Exp;
branches
	1.7.16.1;
next	1.6;

1.6
date	2001.07.19.16.13.01;	author wiz;	state Exp;
branches
	1.6.6.1;
next	1.5;

1.5
date	2001.07.08.17.19.02;	author uch;	state Exp;
branches
	1.5.2.1;
next	1.4;

1.4
date	2001.07.03.20.38.03;	author uch;	state Exp;
branches;
next	1.3;

1.3
date	2001.05.08.18.51.23;	author uch;	state Exp;
branches;
next	1.2;

1.2
date	2001.03.21.14.06.25;	author toshii;	state Exp;
branches;
next	1.1;

1.1
date	2001.02.09.18.34.46;	author uch;	state Exp;
branches
	1.1.2.1
	1.1.4.1;
next	;

1.18.6.1
date	2008.12.13.01.13.11;	author haad;	state Exp;
branches;
next	;

1.18.8.1
date	2009.01.19.13.16.13;	author skrll;	state Exp;
branches;
next	;

1.17.2.1
date	2006.03.05.04.04.13;	author uwe;	state dead;
branches;
next	1.17.2.2;

1.17.2.2
date	2006.03.05.04.04.14;	author uwe;	state Exp;
branches;
next	;

1.17.68.1
date	2008.06.02.13.22.08;	author mjf;	state Exp;
branches;
next	1.17.68.2;

1.17.68.2
date	2009.01.17.13.28.01;	author mjf;	state Exp;
branches;
next	;

1.17.70.1
date	2008.05.18.12.31.59;	author yamt;	state Exp;
branches;
next	;

1.17.72.1
date	2008.05.16.02.22.24;	author yamt;	state Exp;
branches;
next	1.17.72.2;

1.17.72.2
date	2009.05.04.08.11.09;	author yamt;	state Exp;
branches;
next	;

1.15.2.1
date	2006.09.09.02.39.27;	author rpaulo;	state Exp;
branches;
next	;

1.15.4.1
date	2006.04.22.11.37.28;	author simonb;	state Exp;
branches;
next	;

1.14.2.1
date	2006.01.15.10.02.37;	author yamt;	state Exp;
branches;
next	;

1.13.12.1
date	2006.06.21.14.51.38;	author yamt;	state Exp;
branches;
next	;

1.7.16.1
date	2004.08.03.10.34.59;	author skrll;	state Exp;
branches;
next	1.7.16.2;

1.7.16.2
date	2004.08.12.11.41.05;	author skrll;	state Exp;
branches;
next	1.7.16.3;

1.7.16.3
date	2004.09.18.14.34.39;	author skrll;	state Exp;
branches;
next	1.7.16.4;

1.7.16.4
date	2004.09.21.13.15.48;	author skrll;	state Exp;
branches;
next	;

1.6.6.1
date	2001.07.19.16.13.01;	author nathanw;	state dead;
branches;
next	1.6.6.2;

1.6.6.2
date	2002.02.28.04.09.45;	author nathanw;	state Exp;
branches;
next	;

1.5.2.1
date	2001.08.03.04.11.30;	author lukem;	state Exp;
branches;
next	1.5.2.2;

1.5.2.2
date	2002.03.16.15.57.51;	author jdolecek;	state Exp;
branches;
next	;

1.1.2.1
date	2001.02.09.18.34.46;	author bouyer;	state dead;
branches;
next	1.1.2.2;

1.1.2.2
date	2001.02.11.19.09.56;	author bouyer;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	2001.03.27.15.30.48;	author bouyer;	state Exp;
branches;
next	;

1.1.4.1
date	2001.04.09.01.52.39;	author nathanw;	state Exp;
branches;
next	1.1.4.2;

1.1.4.2
date	2001.06.21.19.22.46;	author nathanw;	state Exp;
branches;
next	;


desc
@@


1.19
log
@Let hpcboot load kernels linked with PA != VA; use the PA addresses specified
instead of the VA addresses.  Should make no difference for kernels where the
physical and virtual addresses are the same.
@
text
@/*	$NetBSD: load_elf.cpp,v 1.18 2008/04/28 20:23:20 martin Exp $	*/

/*-
 * Copyright (c) 2001 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by UCHIYAMA Yasushi.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <hpcmenu.h>
#include <menu/window.h>
#include <menu/rootwindow.h>

#include <load.h>
#include <load_elf.h>
#include <console.h>
#include <memory.h>
#include <file.h>

#define	ROUND4(x)	(((x) + 3) & ~3)

ElfLoader::ElfLoader(Console *&cons, MemoryManager *&mem)
	: Loader(cons, mem)
{

	_sym_blk.enable = FALSE;
	_ph = NULL;
	_sh = NULL;

	DPRINTF((TEXT("Loader: ELF\n")));
}

ElfLoader::~ElfLoader(void)
{

	if (_sym_blk.header != NULL)
		free(_sym_blk.header);
	if (_ph != NULL)
		free(_ph);
	if (_sh != NULL)
		free(_sh);
}

BOOL
ElfLoader::setFile(File *&file)
{
	size_t sz;
	Loader::setFile(file);

	// read ELF header and check it
	if (!read_header())
		return FALSE;

	// read section header
	sz = _eh.e_shnum * _eh.e_shentsize;
	if ((_sh = static_cast<Elf_Shdr *>(malloc(sz))) == NULL) {
		DPRINTF((TEXT("can't allocate section header table.\n")));
		return FALSE;
	}
	if (_file->read(_sh, sz, _eh.e_shoff) != sz) {
		DPRINTF((TEXT("section header read error.\n")));
		return FALSE;
	}

	// read program header
	sz = _eh.e_phnum * _eh.e_phentsize;
	if ((_ph = static_cast<Elf_Phdr *>(malloc(sz))) == NULL) {
		DPRINTF((TEXT("can't allocate program header table.\n")));
		return FALSE;
	}
	if (_file->read(_ph, sz, _eh.e_phoff) != sz) {
		DPRINTF((TEXT("program header read error.\n")));
		return FALSE;
	}

	return TRUE;
}

size_t
ElfLoader::memorySize()
{
	int i;
	Elf_Phdr *ph = _ph;
	size_t sz = 0;
	size_t extra = 0;

	DPRINTF((TEXT("file size: ")));
	for (i = 0; i < _eh.e_phnum; i++, ph++) {
		if (ph->p_type == PT_LOAD) {
			size_t filesz = ph->p_filesz;
			DPRINTF((TEXT("%s0x%x"),
				 sz == 0 ? "" : "+",
				 filesz));
			sz += _mem->roundPage(filesz);
			// compensate for partial last tag
			extra += _mem->getTaggedPageSize();
			if (filesz < ph->p_memsz)
				// compensate for zero clear
				extra += _mem->getTaggedPageSize();

		}
	}

	// reserve for symbols
	size_t symblk_sz = symbol_block_size();
	if (symblk_sz) {
		sz += symblk_sz;
		DPRINTF((TEXT(" = 0x%x]"), symblk_sz));
		// XXX: compensate for partial tags after ELF header and symtab
		extra += 2 * _mem->getTaggedPageSize();
	}

	sz += extra;
	DPRINTF((TEXT("+[extra: 0x%x]"), extra));

	DPRINTF((TEXT(" = 0x%x bytes\n"), sz));
	return sz;
}

kaddr_t
ElfLoader::jumpAddr()
{
	DPRINTF((TEXT("kernel entry address: 0x%08x\n"), _eh.e_entry));
	return _eh.e_entry;
}

BOOL
ElfLoader::load()
{
	Elf_Phdr *ph;
	vaddr_t kv;
	int i;

	_load_segment_start();

	for (i = 0, ph = _ph; i < _eh.e_phnum; i++, ph++) {
		if (ph->p_type == PT_LOAD) {
			size_t filesz = ph->p_filesz;
			size_t memsz = ph->p_memsz;
			kv = ph->p_paddr;
			off_t fileofs = ph->p_offset;
			DPRINTF((TEXT("seg[%d] paddr 0x%08x file size 0x%x mem size 0x%x\n"),
			    i, kv, filesz, memsz));
			_load_segment(kv, memsz, fileofs, filesz);
			kv += ROUND4(memsz);
		}
	}

	load_symbol_block(kv);

	// tag chain still opening

	return _load_success();
}

//
// Prepare ELF headers for symbol table.
//
//   ELF header
//   section header
//   shstrtab
//   symtab
//   strtab
//
size_t
ElfLoader::symbol_block_size()
{
	size_t shstrsize = ROUND4(_sh[_eh.e_shstrndx].sh_size);
	size_t shtab_sz = _eh.e_shentsize * _eh.e_shnum;
	off_t shstrtab_offset = sizeof(Elf_Ehdr) + shtab_sz;
	int i;

	memset(&_sym_blk, 0, sizeof(_sym_blk));
	_sym_blk.enable = FALSE;
	_sym_blk.header_size = sizeof(Elf_Ehdr) + shtab_sz + shstrsize;

	// inquire string and symbol table size
	_sym_blk.header = static_cast<char *>(malloc(_sym_blk.header_size));
	if (_sym_blk.header == NULL) {
		MessageBox(HPC_MENU._root->_window,
		    TEXT("Can't determine symbol block size."),
		    TEXT("WARNING"),
		    MB_ICONWARNING | MB_OK);
		UpdateWindow(HPC_MENU._root->_window);
		return (0);
	}

	// set pointer for symbol block
	Elf_Ehdr *eh = reinterpret_cast<Elf_Ehdr *>(_sym_blk.header);
	Elf_Shdr *sh = reinterpret_cast<Elf_Shdr *>
	    (_sym_blk.header + sizeof(Elf_Ehdr));
	char *shstrtab = _sym_blk.header + shstrtab_offset;

	// initialize headers
	memset(_sym_blk.header, 0, _sym_blk.header_size);
	memcpy(eh, &_eh, sizeof(Elf_Ehdr));
	eh->e_phoff = 0;
	eh->e_phnum = 0;
	eh->e_entry = 0; // XXX NetBSD kernel check this member. see machdep.c
	eh->e_shoff = sizeof(Elf_Ehdr);
	memcpy(sh, _sh, shtab_sz);

	// inquire symbol/string table information
	_file->read(shstrtab, shstrsize, _sh[_eh.e_shstrndx].sh_offset);
	for (i = 0; i < _eh.e_shnum; i++, sh++) {
		if (strcmp(".strtab", shstrtab + sh->sh_name) == 0) {
			_sym_blk.shstr = sh;
			_sym_blk.stroff = sh->sh_offset;
		} else if (strcmp(".symtab", shstrtab + sh->sh_name) == 0) {
			_sym_blk.shsym = sh;
			_sym_blk.symoff = sh->sh_offset;
		}

		sh->sh_offset = (i == _eh.e_shstrndx) ? shstrtab_offset : 0;
	}

	if (_sym_blk.shstr == NULL || _sym_blk.shsym == NULL) {
		if (HPC_PREFERENCE.safety_message) {
			MessageBox(HPC_MENU._root->_window,
			    TEXT("No symbol and/or string table in binary.\n(not fatal)"),
			    TEXT("Information"),
			    MB_ICONINFORMATION | MB_OK);
			UpdateWindow(HPC_MENU._root->_window);
		}
		free(_sym_blk.header);
		_sym_blk.header = NULL;

		return (0);
	}

	// set Section Headers for symbol/string table
	_sym_blk.shsym->sh_offset = shstrtab_offset + shstrsize;
	_sym_blk.shstr->sh_offset = shstrtab_offset + shstrsize +
	    ROUND4(_sym_blk.shsym->sh_size);
	_sym_blk.enable = TRUE;

	DPRINTF((TEXT("+[ksyms: header 0x%x, symtab 0x%x, strtab 0x%x"),
	    _sym_blk.header_size, _sym_blk.shsym->sh_size,
	    _sym_blk.shstr->sh_size));

	// return total amount of symbol block
	return (_sym_blk.header_size + ROUND4(_sym_blk.shsym->sh_size) +
	    _sym_blk.shstr->sh_size);
}

void
ElfLoader::load_symbol_block(vaddr_t kv)
{
	size_t sz;

	if (!_sym_blk.enable)
		return;

	DPRINTF((TEXT("ksyms\n")));

	// load header
	_load_memory(kv, _sym_blk.header_size, _sym_blk.header);
	kv += _sym_blk.header_size;

	// load symbol table
	sz = _sym_blk.shsym->sh_size;
	_load_segment(kv, sz, _sym_blk.symoff, sz);
	kv += ROUND4(sz);

	// load string table
	sz = _sym_blk.shstr->sh_size;
	_load_segment(kv, sz, _sym_blk.stroff, sz);
}

BOOL
ElfLoader::read_header()
{
	// read ELF header
	_file->read(&_eh, sizeof(Elf_Ehdr), 0);

	// check ELF Magic.
	if (!is_elf_file()) {
		DPRINTF((TEXT("not a ELF file.\n")));
		return FALSE;
	}

	// Windows CE is 32bit little-endian only.
	if (_eh.e_ident[EI_DATA] != ELFDATA2LSB ||
	    _eh.e_ident[EI_CLASS] != ELFCLASS32) {
		DPRINTF((TEXT("invalid class/data(%d/%d)\n"),
		    _eh.e_ident[EI_CLASS], _eh.e_ident[EI_DATA]));
		return FALSE;
	}

	// Is native architecture?
	switch(_eh.e_machine) {
		ELF32_MACHDEP_ID_CASES;
	default:
		DPRINTF((TEXT("not a native architecture. machine = %d\n"),
		    _eh.e_machine));
		return FALSE;
	}

	// Check object type
	if (_eh.e_type != ET_EXEC) {
		DPRINTF((TEXT("not a executable file. type = %d\n"),
		    _eh.e_type));
		return FALSE;
	}

	if (_eh.e_phoff == 0 || _eh.e_phnum == 0 || _eh.e_phnum > 16 ||
	    _eh.e_phentsize != sizeof(Elf_Phdr)) {
		DPRINTF((TEXT("invalid program header information.\n")));
		return FALSE;
	}

	return TRUE;
}
@


1.18
log
@Remove clause 3 and 4 from TNF licenses
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.17 2006/03/05 04:04:13 uwe Exp $	*/
d162 1
a162 1
			kv = ph->p_vaddr;
d164 1
a164 1
			DPRINTF((TEXT("seg[%d] vaddr 0x%08x file size 0x%x mem size 0x%x\n"),
@


1.18.8.1
log
@Sync with HEAD.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.19 2008/11/07 16:28:26 rafal Exp $	*/
d162 1
a162 1
			kv = ph->p_paddr;
d164 1
a164 1
			DPRINTF((TEXT("seg[%d] paddr 0x%08x file size 0x%x mem size 0x%x\n"),
@


1.18.6.1
log
@Update haad-dm branch to haad-dm-base2.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.19 2008/11/07 16:28:26 rafal Exp $	*/
d162 1
a162 1
			kv = ph->p_paddr;
d164 1
a164 1
			DPRINTF((TEXT("seg[%d] paddr 0x%08x file size 0x%x mem size 0x%x\n"),
@


1.17
log
@Loader uses ElfLoader::memorySize to determine the number of tagged
pages to allocate, as some of those pages are only partially filled
(e.g. last page of loadable segment) we may allocate too few tagged
pages and boot will fail.  So lie by reporting extra size for each
partial tagged page.

XXX: This is an ugly hack, but I'm not going to shave this yak.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.16 2006/03/02 23:56:58 uwe Exp $	*/
a17 7
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *        This product includes software developed by the NetBSD
 *        Foundation, Inc. and its contributors.
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
@


1.17.2.1
log
@file load_elf.cpp was added on branch yamt-pdpolicy on 2006-03-05 04:04:14 +0000
@
text
@d1 342
@


1.17.2.2
log
@Loader uses ElfLoader::memorySize to determine the number of tagged
pages to allocate, as some of those pages are only partially filled
(e.g. last page of loadable segment) we may allocate too few tagged
pages and boot will fail.  So lie by reporting extra size for each
partial tagged page.

XXX: This is an ugly hack, but I'm not going to shave this yak.
@
text
@a0 342
/*	$NetBSD: load_elf.cpp,v 1.17 2006/03/05 04:04:13 uwe Exp $	*/

/*-
 * Copyright (c) 2001 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by UCHIYAMA Yasushi.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *        This product includes software developed by the NetBSD
 *        Foundation, Inc. and its contributors.
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <hpcmenu.h>
#include <menu/window.h>
#include <menu/rootwindow.h>

#include <load.h>
#include <load_elf.h>
#include <console.h>
#include <memory.h>
#include <file.h>

#define	ROUND4(x)	(((x) + 3) & ~3)

ElfLoader::ElfLoader(Console *&cons, MemoryManager *&mem)
	: Loader(cons, mem)
{

	_sym_blk.enable = FALSE;
	_ph = NULL;
	_sh = NULL;

	DPRINTF((TEXT("Loader: ELF\n")));
}

ElfLoader::~ElfLoader(void)
{

	if (_sym_blk.header != NULL)
		free(_sym_blk.header);
	if (_ph != NULL)
		free(_ph);
	if (_sh != NULL)
		free(_sh);
}

BOOL
ElfLoader::setFile(File *&file)
{
	size_t sz;
	Loader::setFile(file);

	// read ELF header and check it
	if (!read_header())
		return FALSE;

	// read section header
	sz = _eh.e_shnum * _eh.e_shentsize;
	if ((_sh = static_cast<Elf_Shdr *>(malloc(sz))) == NULL) {
		DPRINTF((TEXT("can't allocate section header table.\n")));
		return FALSE;
	}
	if (_file->read(_sh, sz, _eh.e_shoff) != sz) {
		DPRINTF((TEXT("section header read error.\n")));
		return FALSE;
	}

	// read program header
	sz = _eh.e_phnum * _eh.e_phentsize;
	if ((_ph = static_cast<Elf_Phdr *>(malloc(sz))) == NULL) {
		DPRINTF((TEXT("can't allocate program header table.\n")));
		return FALSE;
	}
	if (_file->read(_ph, sz, _eh.e_phoff) != sz) {
		DPRINTF((TEXT("program header read error.\n")));
		return FALSE;
	}

	return TRUE;
}

size_t
ElfLoader::memorySize()
{
	int i;
	Elf_Phdr *ph = _ph;
	size_t sz = 0;
	size_t extra = 0;

	DPRINTF((TEXT("file size: ")));
	for (i = 0; i < _eh.e_phnum; i++, ph++) {
		if (ph->p_type == PT_LOAD) {
			size_t filesz = ph->p_filesz;
			DPRINTF((TEXT("%s0x%x"),
				 sz == 0 ? "" : "+",
				 filesz));
			sz += _mem->roundPage(filesz);
			// compensate for partial last tag
			extra += _mem->getTaggedPageSize();
			if (filesz < ph->p_memsz)
				// compensate for zero clear
				extra += _mem->getTaggedPageSize();

		}
	}

	// reserve for symbols
	size_t symblk_sz = symbol_block_size();
	if (symblk_sz) {
		sz += symblk_sz;
		DPRINTF((TEXT(" = 0x%x]"), symblk_sz));
		// XXX: compensate for partial tags after ELF header and symtab
		extra += 2 * _mem->getTaggedPageSize();
	}

	sz += extra;
	DPRINTF((TEXT("+[extra: 0x%x]"), extra));

	DPRINTF((TEXT(" = 0x%x bytes\n"), sz));
	return sz;
}

kaddr_t
ElfLoader::jumpAddr()
{
	DPRINTF((TEXT("kernel entry address: 0x%08x\n"), _eh.e_entry));
	return _eh.e_entry;
}

BOOL
ElfLoader::load()
{
	Elf_Phdr *ph;
	vaddr_t kv;
	int i;

	_load_segment_start();

	for (i = 0, ph = _ph; i < _eh.e_phnum; i++, ph++) {
		if (ph->p_type == PT_LOAD) {
			size_t filesz = ph->p_filesz;
			size_t memsz = ph->p_memsz;
			kv = ph->p_vaddr;
			off_t fileofs = ph->p_offset;
			DPRINTF((TEXT("seg[%d] vaddr 0x%08x file size 0x%x mem size 0x%x\n"),
			    i, kv, filesz, memsz));
			_load_segment(kv, memsz, fileofs, filesz);
			kv += ROUND4(memsz);
		}
	}

	load_symbol_block(kv);

	// tag chain still opening

	return _load_success();
}

//
// Prepare ELF headers for symbol table.
//
//   ELF header
//   section header
//   shstrtab
//   symtab
//   strtab
//
size_t
ElfLoader::symbol_block_size()
{
	size_t shstrsize = ROUND4(_sh[_eh.e_shstrndx].sh_size);
	size_t shtab_sz = _eh.e_shentsize * _eh.e_shnum;
	off_t shstrtab_offset = sizeof(Elf_Ehdr) + shtab_sz;
	int i;

	memset(&_sym_blk, 0, sizeof(_sym_blk));
	_sym_blk.enable = FALSE;
	_sym_blk.header_size = sizeof(Elf_Ehdr) + shtab_sz + shstrsize;

	// inquire string and symbol table size
	_sym_blk.header = static_cast<char *>(malloc(_sym_blk.header_size));
	if (_sym_blk.header == NULL) {
		MessageBox(HPC_MENU._root->_window,
		    TEXT("Can't determine symbol block size."),
		    TEXT("WARNING"),
		    MB_ICONWARNING | MB_OK);
		UpdateWindow(HPC_MENU._root->_window);
		return (0);
	}

	// set pointer for symbol block
	Elf_Ehdr *eh = reinterpret_cast<Elf_Ehdr *>(_sym_blk.header);
	Elf_Shdr *sh = reinterpret_cast<Elf_Shdr *>
	    (_sym_blk.header + sizeof(Elf_Ehdr));
	char *shstrtab = _sym_blk.header + shstrtab_offset;

	// initialize headers
	memset(_sym_blk.header, 0, _sym_blk.header_size);
	memcpy(eh, &_eh, sizeof(Elf_Ehdr));
	eh->e_phoff = 0;
	eh->e_phnum = 0;
	eh->e_entry = 0; // XXX NetBSD kernel check this member. see machdep.c
	eh->e_shoff = sizeof(Elf_Ehdr);
	memcpy(sh, _sh, shtab_sz);

	// inquire symbol/string table information
	_file->read(shstrtab, shstrsize, _sh[_eh.e_shstrndx].sh_offset);
	for (i = 0; i < _eh.e_shnum; i++, sh++) {
		if (strcmp(".strtab", shstrtab + sh->sh_name) == 0) {
			_sym_blk.shstr = sh;
			_sym_blk.stroff = sh->sh_offset;
		} else if (strcmp(".symtab", shstrtab + sh->sh_name) == 0) {
			_sym_blk.shsym = sh;
			_sym_blk.symoff = sh->sh_offset;
		}

		sh->sh_offset = (i == _eh.e_shstrndx) ? shstrtab_offset : 0;
	}

	if (_sym_blk.shstr == NULL || _sym_blk.shsym == NULL) {
		if (HPC_PREFERENCE.safety_message) {
			MessageBox(HPC_MENU._root->_window,
			    TEXT("No symbol and/or string table in binary.\n(not fatal)"),
			    TEXT("Information"),
			    MB_ICONINFORMATION | MB_OK);
			UpdateWindow(HPC_MENU._root->_window);
		}
		free(_sym_blk.header);
		_sym_blk.header = NULL;

		return (0);
	}

	// set Section Headers for symbol/string table
	_sym_blk.shsym->sh_offset = shstrtab_offset + shstrsize;
	_sym_blk.shstr->sh_offset = shstrtab_offset + shstrsize +
	    ROUND4(_sym_blk.shsym->sh_size);
	_sym_blk.enable = TRUE;

	DPRINTF((TEXT("+[ksyms: header 0x%x, symtab 0x%x, strtab 0x%x"),
	    _sym_blk.header_size, _sym_blk.shsym->sh_size,
	    _sym_blk.shstr->sh_size));

	// return total amount of symbol block
	return (_sym_blk.header_size + ROUND4(_sym_blk.shsym->sh_size) +
	    _sym_blk.shstr->sh_size);
}

void
ElfLoader::load_symbol_block(vaddr_t kv)
{
	size_t sz;

	if (!_sym_blk.enable)
		return;

	DPRINTF((TEXT("ksyms\n")));

	// load header
	_load_memory(kv, _sym_blk.header_size, _sym_blk.header);
	kv += _sym_blk.header_size;

	// load symbol table
	sz = _sym_blk.shsym->sh_size;
	_load_segment(kv, sz, _sym_blk.symoff, sz);
	kv += ROUND4(sz);

	// load string table
	sz = _sym_blk.shstr->sh_size;
	_load_segment(kv, sz, _sym_blk.stroff, sz);
}

BOOL
ElfLoader::read_header()
{
	// read ELF header
	_file->read(&_eh, sizeof(Elf_Ehdr), 0);

	// check ELF Magic.
	if (!is_elf_file()) {
		DPRINTF((TEXT("not a ELF file.\n")));
		return FALSE;
	}

	// Windows CE is 32bit little-endian only.
	if (_eh.e_ident[EI_DATA] != ELFDATA2LSB ||
	    _eh.e_ident[EI_CLASS] != ELFCLASS32) {
		DPRINTF((TEXT("invalid class/data(%d/%d)\n"),
		    _eh.e_ident[EI_CLASS], _eh.e_ident[EI_DATA]));
		return FALSE;
	}

	// Is native architecture?
	switch(_eh.e_machine) {
		ELF32_MACHDEP_ID_CASES;
	default:
		DPRINTF((TEXT("not a native architecture. machine = %d\n"),
		    _eh.e_machine));
		return FALSE;
	}

	// Check object type
	if (_eh.e_type != ET_EXEC) {
		DPRINTF((TEXT("not a executable file. type = %d\n"),
		    _eh.e_type));
		return FALSE;
	}

	if (_eh.e_phoff == 0 || _eh.e_phnum == 0 || _eh.e_phnum > 16 ||
	    _eh.e_phentsize != sizeof(Elf_Phdr)) {
		DPRINTF((TEXT("invalid program header information.\n")));
		return FALSE;
	}

	return TRUE;
}
@


1.17.68.1
log
@Sync with HEAD.
@
text
@d1 1
a1 1
/*	$NetBSD$	*/
d18 7
@


1.17.68.2
log
@Sync with HEAD.
@
text
@d162 1
a162 1
			kv = ph->p_paddr;
d164 1
a164 1
			DPRINTF((TEXT("seg[%d] paddr 0x%08x file size 0x%x mem size 0x%x\n"),
@


1.17.70.1
log
@sync with head.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.17 2006/03/05 04:04:13 uwe Exp $	*/
d18 7
@


1.17.72.1
log
@sync with head.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.17 2006/03/05 04:04:13 uwe Exp $	*/
d18 7
@


1.17.72.2
log
@sync with head.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.17.72.1 2008/05/16 02:22:24 yamt Exp $	*/
d162 1
a162 1
			kv = ph->p_paddr;
d164 1
a164 1
			DPRINTF((TEXT("seg[%d] paddr 0x%08x file size 0x%x mem size 0x%x\n"),
@


1.16
log
@Cosmetic.  In debug pritnf in ElfLoader::memorySize don't prepend '+'
when printing the size of the first loadable segment.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.15 2006/01/14 23:23:32 uwe Exp $	*/
d114 1
d124 6
d138 2
d142 3
@


1.15
log
@Prettify debug messages about ksyms block.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.14 2005/12/11 12:17:28 christos Exp $	*/
d119 3
a121 1
			DPRINTF((TEXT("+0x%x"), filesz));
@


1.15.2.1
log
@sync with head
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.17 2006/03/05 04:04:13 uwe Exp $	*/
a113 1
	size_t extra = 0;
d119 1
a119 3
			DPRINTF((TEXT("%s0x%x"),
				 sz == 0 ? "" : "+",
				 filesz));
a120 6
			// compensate for partial last tag
			extra += _mem->getTaggedPageSize();
			if (filesz < ph->p_memsz)
				// compensate for zero clear
				extra += _mem->getTaggedPageSize();

a128 2
		// XXX: compensate for partial tags after ELF header and symtab
		extra += 2 * _mem->getTaggedPageSize();
a130 3
	sz += extra;
	DPRINTF((TEXT("+[extra: 0x%x]"), extra));

@


1.15.4.1
log
@Sync with head.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.17 2006/03/05 04:04:13 uwe Exp $	*/
a113 1
	size_t extra = 0;
d119 1
a119 3
			DPRINTF((TEXT("%s0x%x"),
				 sz == 0 ? "" : "+",
				 filesz));
a120 6
			// compensate for partial last tag
			extra += _mem->getTaggedPageSize();
			if (filesz < ph->p_memsz)
				// compensate for zero clear
				extra += _mem->getTaggedPageSize();

a128 2
		// XXX: compensate for partial tags after ELF header and symtab
		extra += 2 * _mem->getTaggedPageSize();
a130 3
	sz += extra;
	DPRINTF((TEXT("+[extra: 0x%x]"), extra));

@


1.14
log
@merge ktrace-lwp.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.7.16.4 2004/09/21 13:15:48 skrll Exp $	*/
d131 1
a131 1
	DPRINTF((TEXT(" = 0x%x byte\n"), sz));
d157 1
a157 1
			DPRINTF((TEXT("[%d] vaddr 0x%08x file size 0x%x mem size 0x%x\n"),
d252 2
a253 2
	DPRINTF((TEXT("+[(symbol block: header %d symbol %d string %d byte)"),
	    _sym_blk.header_size,_sym_blk.shsym->sh_size,
d269 2
@


1.14.2.1
log
@sync with head.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.14 2005/12/11 12:17:28 christos Exp $	*/
d131 1
a131 1
	DPRINTF((TEXT(" = 0x%x bytes\n"), sz));
d157 1
a157 1
			DPRINTF((TEXT("seg[%d] vaddr 0x%08x file size 0x%x mem size 0x%x\n"),
d252 2
a253 2
	DPRINTF((TEXT("+[ksyms: header 0x%x, symtab 0x%x, strtab 0x%x"),
	    _sym_blk.header_size, _sym_blk.shsym->sh_size,
a268 2
	DPRINTF((TEXT("ksyms\n")));

@


1.13
log
@clean up whitespace.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.12 2004/06/12 12:09:38 uch Exp $	*/
@


1.13.12.1
log
@sync with head.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.13 2004/08/06 18:33:09 uch Exp $	*/
a113 1
	size_t extra = 0;
d119 1
a119 3
			DPRINTF((TEXT("%s0x%x"),
				 sz == 0 ? "" : "+",
				 filesz));
a120 6
			// compensate for partial last tag
			extra += _mem->getTaggedPageSize();
			if (filesz < ph->p_memsz)
				// compensate for zero clear
				extra += _mem->getTaggedPageSize();

a128 2
		// XXX: compensate for partial tags after ELF header and symtab
		extra += 2 * _mem->getTaggedPageSize();
d131 1
a131 4
	sz += extra;
	DPRINTF((TEXT("+[extra: 0x%x]"), extra));

	DPRINTF((TEXT(" = 0x%x bytes\n"), sz));
d157 1
a157 1
			DPRINTF((TEXT("seg[%d] vaddr 0x%08x file size 0x%x mem size 0x%x\n"),
d252 2
a253 2
	DPRINTF((TEXT("+[ksyms: header 0x%x, symtab 0x%x, strtab 0x%x"),
	    _sym_blk.header_size, _sym_blk.shsym->sh_size,
a268 2
	DPRINTF((TEXT("ksyms\n")));

@


1.12
log
@adjust segment load address to 4byte align.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.11 2004/06/10 15:57:18 uch Exp $	*/
d49 1
a49 1
#define ROUND4(x)	(((x) + 3) & ~3)
d148 1
a148 1
  
d265 1
a265 1
	
d294 1
a294 1
  
d311 1
a311 1
  
d318 1
a318 1
  
@


1.11
log
@allocate section and program header table dynamicaly.
fixed section header table over flow problem.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.10 2004/03/16 22:30:36 uwe Exp $	*/
d160 1
a160 1
			kv += memsz;
d166 1
a166 1
	// tag chain still opening 
@


1.10
log
@Add a few calls to UpdateWindow.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.9 2003/12/23 04:59:44 uwe Exp $	*/
d54 1
d56 2
d64 1
d66 5
a70 1
		free (_sym_blk.header);
d82 1
d85 8
a92 1
	_file->read(_sh, _eh.e_shentsize * _eh.e_shnum, _eh.e_shoff);
d96 8
d105 1
a105 1
	return _file->read(_ph, sz, _eh.e_phoff) == sz;
@


1.9
log
@Load ".symtab" section before ".strtab".  The code to pack the symbol
table (kern_ksyms.c:addsymtab) relies on that order.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.8 2003/12/18 12:19:49 uwe Exp $	*/
d175 1
d209 1
a209 1
		if (HPC_PREFERENCE.safety_message)
d214 2
@


1.8
log
@Add MB_ICON* styles to message boxes.  Use explicit MB_OK.
Capitalize messages.   Minor tweaks.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.7 2002/02/11 17:08:55 uch Exp $	*/
d153 1
a154 1
//   symtab
d220 3
a222 3
	_sym_blk.shstr->sh_offset = shstrtab_offset + shstrsize;
	_sym_blk.shsym->sh_offset = shstrtab_offset + shstrsize +
	    ROUND4(_sym_blk.shstr->sh_size);
d225 3
a227 3
	DPRINTF((TEXT("+[(symbol block: header %d string %d symbol %d byte)"),
	    _sym_blk.header_size,_sym_blk.shstr->sh_size, 
	    _sym_blk.shsym->sh_size));
d230 2
a231 2
	return (_sym_blk.header_size + ROUND4(_sym_blk.shstr->sh_size) +
	    _sym_blk.shsym->sh_size);
d246 5
a253 5
	kv += ROUND4(sz);

	// load symbol table
	sz = _sym_blk.shsym->sh_size;
	_load_segment(kv, sz, _sym_blk.symoff, sz);
@


1.7
log
@totaly clean up SH3/SH4 related code
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.6 2001/07/19 16:13:01 wiz Exp $	*/
d172 3
a174 2
		    TEXT("couldn't determine symbol block size"),
		    TEXT("WARNING"), 0);
d210 3
a212 2
			    TEXT("no symbol and/or string table in binary. (not fatal)"),
			    TEXT("Information"), 0);
@


1.7.16.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.12 2004/06/12 12:09:38 uch Exp $	*/
a53 1

a54 2
	_ph = NULL;
	_sh = NULL;
a60 1

d62 1
a62 5
		free(_sym_blk.header);
	if (_ph != NULL)
		free(_ph);
	if (_sh != NULL)
		free(_sh);
a73 1

d76 1
a76 8
	if ((_sh = static_cast<Elf_Shdr *>(malloc(sz))) == NULL) {
		DPRINTF((TEXT("can't allocate section header table.\n")));
		return FALSE;
	}
	if (_file->read(_sh, sz, _eh.e_shoff) != sz) {
		DPRINTF((TEXT("section header read error.\n")));
		return FALSE;
	}
a79 8
	if ((_ph = static_cast<Elf_Phdr *>(malloc(sz))) == NULL) {
		DPRINTF((TEXT("can't allocate program header table.\n")));
		return FALSE;
	}
	if (_file->read(_ph, sz, _eh.e_phoff) != sz) {
		DPRINTF((TEXT("program header read error.\n")));
		return FALSE;
	}
d81 1
a81 1
	return TRUE;
d136 1
a136 1
			kv += ROUND4(memsz);
d142 1
a142 1
	// tag chain still opening
d153 1
a154 1
//   strtab
d172 2
a173 4
		    TEXT("Can't determine symbol block size."),
		    TEXT("WARNING"),
		    MB_ICONWARNING | MB_OK);
		UpdateWindow(HPC_MENU._root->_window);
d207 1
a207 1
		if (HPC_PREFERENCE.safety_message) {
d209 2
a210 5
			    TEXT("No symbol and/or string table in binary.\n(not fatal)"),
			    TEXT("Information"),
			    MB_ICONINFORMATION | MB_OK);
			UpdateWindow(HPC_MENU._root->_window);
		}
d218 3
a220 3
	_sym_blk.shsym->sh_offset = shstrtab_offset + shstrsize;
	_sym_blk.shstr->sh_offset = shstrtab_offset + shstrsize +
	    ROUND4(_sym_blk.shsym->sh_size);
d223 3
a225 3
	DPRINTF((TEXT("+[(symbol block: header %d symbol %d string %d byte)"),
	    _sym_blk.header_size,_sym_blk.shsym->sh_size,
	    _sym_blk.shstr->sh_size));
d228 2
a229 2
	return (_sym_blk.header_size + ROUND4(_sym_blk.shsym->sh_size) +
	    _sym_blk.shstr->sh_size);
d244 5
a251 5
	kv += ROUND4(sz);

	// load string table
	sz = _sym_blk.shstr->sh_size;
	_load_segment(kv, sz, _sym_blk.stroff, sz);
@


1.7.16.2
log
@Sync with HEAD.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.7.16.1 2004/08/03 10:34:59 skrll Exp $	*/
d49 1
a49 1
#define	ROUND4(x)	(((x) + 3) & ~3)
d148 1
a148 1

d265 1
a265 1

d294 1
a294 1

d311 1
a311 1

d318 1
a318 1

@


1.7.16.3
log
@Sync with HEAD.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.13 2004/08/06 18:33:09 uch Exp $	*/
@


1.7.16.4
log
@Fix the sync with head I botched.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.7.16.2 2004/08/12 11:41:05 skrll Exp $	*/
@


1.6
log
@Fix typo (`information' has an 'r').
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.5 2001/07/08 17:19:02 uch Exp $	*/
d144 1
a144 1
	return TRUE;
@


1.6.6.1
log
@file load_elf.cpp was added on branch nathanw_sa on 2002-02-28 04:09:45 +0000
@
text
@d1 297
@


1.6.6.2
log
@Catch up to -current.
@
text
@a0 297
/*	$NetBSD: load_elf.cpp,v 1.6.6.1 2002/02/28 04:09:45 nathanw Exp $	*/

/*-
 * Copyright (c) 2001 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by UCHIYAMA Yasushi.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *        This product includes software developed by the NetBSD
 *        Foundation, Inc. and its contributors.
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <hpcmenu.h>
#include <menu/window.h>
#include <menu/rootwindow.h>

#include <load.h>
#include <load_elf.h>
#include <console.h>
#include <memory.h>
#include <file.h>

#define ROUND4(x)	(((x) + 3) & ~3)

ElfLoader::ElfLoader(Console *&cons, MemoryManager *&mem)
	: Loader(cons, mem)
{
	_sym_blk.enable = FALSE;

	DPRINTF((TEXT("Loader: ELF\n")));
}

ElfLoader::~ElfLoader(void)
{
	if (_sym_blk.header != NULL)
		free (_sym_blk.header);
}

BOOL
ElfLoader::setFile(File *&file)
{
	size_t sz;
	Loader::setFile(file);

	// read ELF header and check it
	if (!read_header())
		return FALSE;
	// read section header
	sz = _eh.e_shnum * _eh.e_shentsize;
	_file->read(_sh, _eh.e_shentsize * _eh.e_shnum, _eh.e_shoff);

	// read program header
	sz = _eh.e_phnum * _eh.e_phentsize;

	return _file->read(_ph, sz, _eh.e_phoff) == sz;
}

size_t
ElfLoader::memorySize()
{
	int i;
	Elf_Phdr *ph = _ph;
	size_t sz = 0;

	DPRINTF((TEXT("file size: ")));
	for (i = 0; i < _eh.e_phnum; i++, ph++) {
		if (ph->p_type == PT_LOAD) {
			size_t filesz = ph->p_filesz;
			DPRINTF((TEXT("+0x%x"), filesz));
			sz += _mem->roundPage(filesz);
		}
	}

	// reserve for symbols
	size_t symblk_sz = symbol_block_size();
	if (symblk_sz) {
		sz += symblk_sz;
		DPRINTF((TEXT(" = 0x%x]"), symblk_sz));
	}

	DPRINTF((TEXT(" = 0x%x byte\n"), sz));
	return sz;
}

kaddr_t
ElfLoader::jumpAddr()
{
	DPRINTF((TEXT("kernel entry address: 0x%08x\n"), _eh.e_entry));
	return _eh.e_entry;
}

BOOL
ElfLoader::load()
{
	Elf_Phdr *ph;
	vaddr_t kv;
	int i;
  
	_load_segment_start();

	for (i = 0, ph = _ph; i < _eh.e_phnum; i++, ph++) {
		if (ph->p_type == PT_LOAD) {
			size_t filesz = ph->p_filesz;
			size_t memsz = ph->p_memsz;
			kv = ph->p_vaddr;
			off_t fileofs = ph->p_offset;
			DPRINTF((TEXT("[%d] vaddr 0x%08x file size 0x%x mem size 0x%x\n"),
			    i, kv, filesz, memsz));
			_load_segment(kv, memsz, fileofs, filesz);
			kv += memsz;
		}
	}

	load_symbol_block(kv);

	// tag chain still opening 

	return _load_success();
}

//
// Prepare ELF headers for symbol table.
//
//   ELF header
//   section header
//   shstrtab
//   strtab
//   symtab
//
size_t
ElfLoader::symbol_block_size()
{
	size_t shstrsize = ROUND4(_sh[_eh.e_shstrndx].sh_size);
	size_t shtab_sz = _eh.e_shentsize * _eh.e_shnum;
	off_t shstrtab_offset = sizeof(Elf_Ehdr) + shtab_sz;
	int i;

	memset(&_sym_blk, 0, sizeof(_sym_blk));
	_sym_blk.enable = FALSE;
	_sym_blk.header_size = sizeof(Elf_Ehdr) + shtab_sz + shstrsize;

	// inquire string and symbol table size
	_sym_blk.header = static_cast<char *>(malloc(_sym_blk.header_size));
	if (_sym_blk.header == NULL) {
		MessageBox(HPC_MENU._root->_window,
		    TEXT("couldn't determine symbol block size"),
		    TEXT("WARNING"), 0);
		return (0);
	}

	// set pointer for symbol block
	Elf_Ehdr *eh = reinterpret_cast<Elf_Ehdr *>(_sym_blk.header);
	Elf_Shdr *sh = reinterpret_cast<Elf_Shdr *>
	    (_sym_blk.header + sizeof(Elf_Ehdr));
	char *shstrtab = _sym_blk.header + shstrtab_offset;

	// initialize headers
	memset(_sym_blk.header, 0, _sym_blk.header_size);
	memcpy(eh, &_eh, sizeof(Elf_Ehdr));
	eh->e_phoff = 0;
	eh->e_phnum = 0;
	eh->e_entry = 0; // XXX NetBSD kernel check this member. see machdep.c
	eh->e_shoff = sizeof(Elf_Ehdr);
	memcpy(sh, _sh, shtab_sz);

	// inquire symbol/string table information
	_file->read(shstrtab, shstrsize, _sh[_eh.e_shstrndx].sh_offset);
	for (i = 0; i < _eh.e_shnum; i++, sh++) {
		if (strcmp(".strtab", shstrtab + sh->sh_name) == 0) {
			_sym_blk.shstr = sh;
			_sym_blk.stroff = sh->sh_offset;
		} else if (strcmp(".symtab", shstrtab + sh->sh_name) == 0) {
			_sym_blk.shsym = sh;
			_sym_blk.symoff = sh->sh_offset;
		}

		sh->sh_offset = (i == _eh.e_shstrndx) ? shstrtab_offset : 0;
	}

	if (_sym_blk.shstr == NULL || _sym_blk.shsym == NULL) {
		if (HPC_PREFERENCE.safety_message)
			MessageBox(HPC_MENU._root->_window,
			    TEXT("no symbol and/or string table in binary. (not fatal)"),
			    TEXT("Information"), 0);
		free(_sym_blk.header);
		_sym_blk.header = NULL;

		return (0);
	}

	// set Section Headers for symbol/string table
	_sym_blk.shstr->sh_offset = shstrtab_offset + shstrsize;
	_sym_blk.shsym->sh_offset = shstrtab_offset + shstrsize +
	    ROUND4(_sym_blk.shstr->sh_size);
	_sym_blk.enable = TRUE;

	DPRINTF((TEXT("+[(symbol block: header %d string %d symbol %d byte)"),
	    _sym_blk.header_size,_sym_blk.shstr->sh_size, 
	    _sym_blk.shsym->sh_size));

	// return total amount of symbol block
	return (_sym_blk.header_size + ROUND4(_sym_blk.shstr->sh_size) +
	    _sym_blk.shsym->sh_size);
}

void
ElfLoader::load_symbol_block(vaddr_t kv)
{
	size_t sz;
	
	if (!_sym_blk.enable)
		return;

	// load header
	_load_memory(kv, _sym_blk.header_size, _sym_blk.header);
	kv += _sym_blk.header_size;

	// load string table
	sz = _sym_blk.shstr->sh_size;
	_load_segment(kv, sz, _sym_blk.stroff, sz);
	kv += ROUND4(sz);

	// load symbol table
	sz = _sym_blk.shsym->sh_size;
	_load_segment(kv, sz, _sym_blk.symoff, sz);
}

BOOL
ElfLoader::read_header()
{
	// read ELF header
	_file->read(&_eh, sizeof(Elf_Ehdr), 0);

	// check ELF Magic.
	if (!is_elf_file()) {
		DPRINTF((TEXT("not a ELF file.\n")));
		return FALSE;
	}
  
	// Windows CE is 32bit little-endian only.
	if (_eh.e_ident[EI_DATA] != ELFDATA2LSB ||
	    _eh.e_ident[EI_CLASS] != ELFCLASS32) {
		DPRINTF((TEXT("invalid class/data(%d/%d)\n"),
		    _eh.e_ident[EI_CLASS], _eh.e_ident[EI_DATA]));
		return FALSE;
	}

	// Is native architecture?
	switch(_eh.e_machine) {
		ELF32_MACHDEP_ID_CASES;
	default:
		DPRINTF((TEXT("not a native architecture. machine = %d\n"),
		    _eh.e_machine));
		return FALSE;
	}
  
	// Check object type
	if (_eh.e_type != ET_EXEC) {
		DPRINTF((TEXT("not a executable file. type = %d\n"),
		    _eh.e_type));
		return FALSE;
	}
  
	if (_eh.e_phoff == 0 || _eh.e_phnum == 0 || _eh.e_phnum > 16 ||
	    _eh.e_phentsize != sizeof(Elf_Phdr)) {
		DPRINTF((TEXT("invalid program header information.\n")));
		return FALSE;
	}

	return TRUE;
}
@


1.5
log
@when "safety message" check box is not checked, no symbol kernel is
loaded to memory silently. (its MessageBox will bother)
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.4 2001/07/03 20:38:03 uch Exp $	*/
d292 1
a292 1
		DPRINTF((TEXT("invalid program header infomation.\n")));
@


1.5.2.1
log
@update to -current
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.6 2001/07/19 16:13:01 wiz Exp $	*/
d292 1
a292 1
		DPRINTF((TEXT("invalid program header information.\n")));
@


1.5.2.2
log
@Catch up with -current.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.5.2.1 2001/08/03 04:11:30 lukem Exp $	*/
d144 1
a144 1
	return _load_success();
@


1.4
log
@reserve correct size of kernel symbol table.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.3 2001/05/08 18:51:23 uch Exp $	*/
d207 4
a210 3
		MessageBox(HPC_MENU._root->_window,
		    TEXT("no symbol and/or strint table in binary"),
		    TEXT("Information"), 0);
@


1.3
log
@KNF.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.2 2001/03/21 14:06:25 toshii Exp $	*/
d39 4
d49 2
d54 2
d61 2
d71 1
a71 1
	/* read ELF header and check it */
d74 1
a74 1
	/* read section header */
d78 1
a78 1
	/* read program header */
d99 7
a105 2
	/* XXX reserve 192kB for symbols */
	sz += 0x30000;
a121 2
	Elf_Shdr *sh, *shstr, *shsym;
	off_t stroff = 0, symoff = 0, off;
a122 3

	size_t shstrsize;
	char buf[1024];
d140 61
a200 29
	/*
	 * Prepare ELF headers for symbol table.
	 *
	 *   ELF header
	 *   section header
	 *   shstrtab
	 *   strtab
	 *   symtab
	 */
	memcpy(buf, &_eh, sizeof(_eh));
	((Elf_Ehdr *)buf)->e_phoff = 0;
	((Elf_Ehdr *)buf)->e_phnum = 0;
	((Elf_Ehdr *)buf)->e_entry = 0;
	((Elf_Ehdr *)buf)->e_shoff = sizeof(_eh);
	off = ((Elf_Ehdr *)buf)->e_shoff;
	memcpy(buf + off, _sh, _eh.e_shentsize * _eh.e_shnum);
	sh = (Elf_Shdr *)(buf + off);
	off += _eh.e_shentsize * _eh.e_shnum;

	/* load shstrtab and find desired sections */
	shstrsize = (sh[_eh.e_shstrndx].sh_size + 3) & ~0x3;
	_file->read(buf + off, shstrsize, sh[_eh.e_shstrndx].sh_offset);
	for(i = 0; i < _eh.e_shnum; i++, sh++) {
		if (strcmp(".strtab", buf + off + sh->sh_name) == 0) {
			stroff = sh->sh_offset;
			shstr = sh;
		} else if (strcmp(".symtab", buf + off + sh->sh_name) == 0) {
			symoff = sh->sh_offset;
			shsym = sh;
a201 16
		if (i == _eh.e_shstrndx)
			sh->sh_offset = off;
		else
			sh->sh_offset = 0;
	}
	/* silently return if strtab or symtab can't be found */
	if (! stroff || ! symoff)
		return TRUE;

	shstr->sh_offset = off + shstrsize;
	shsym->sh_offset = off + shstrsize + ((shstr->sh_size + 3) & ~0x3);
	_load_memory(kv, off + shstrsize, buf);
	kv += off + shstrsize;
	_load_segment(kv, shstr->sh_size, stroff, shstr->sh_size);
	kv += (shstr->sh_size + 3) & ~0x3;
	_load_segment(kv, shsym->sh_size, symoff, shsym->sh_size);
d203 9
a211 1
	/* tag chain still opening */
d213 38
a250 1
	return TRUE;
d254 1
a254 1
ElfLoader::read_header(void)
d282 1
a282 1
	/* Check object type */
@


1.2
log
@Load ELF symbol table for DDB.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.1 2001/02/09 18:34:46 uch Exp $	*/
d109 2
a110 1
	vaddr_t kv;
d124 1
a124 1
				 i, kv, filesz, memsz));
d198 1
a198 1
			 _eh.e_ident[EI_CLASS], _eh.e_ident[EI_DATA]));
d207 1
a207 1
			 _eh.e_machine));
d214 1
a214 1
			 _eh.e_type));
@


1.1
log
@bootloader for SH3, SA-1100, TX39, VR41 based Windows CE(2.00 or later)
@
text
@d1 1
a1 1
/*	$NetBSD$	*/
d58 1
d64 4
d69 1
a69 1
	size_t sz = _eh.e_phnum * _eh.e_phentsize;
d89 3
d107 5
d120 1
a120 1
			vaddr_t kv = ph->p_vaddr;
d125 33
d159 4
d164 12
@


1.1.2.1
log
@file load_elf.cpp was added on branch thorpej_scsipi on 2001-02-11 19:09:56 +0000
@
text
@d1 162
@


1.1.2.2
log
@Sync with HEAD.
@
text
@a0 162
/*	$NetBSD: load_elf.cpp,v 1.1.2.1 2001/02/11 19:09:56 bouyer Exp $	*/

/*-
 * Copyright (c) 2001 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by UCHIYAMA Yasushi.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *        This product includes software developed by the NetBSD
 *        Foundation, Inc. and its contributors.
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <load.h>
#include <load_elf.h>
#include <console.h>
#include <memory.h>
#include <file.h>

ElfLoader::ElfLoader(Console *&cons, MemoryManager *&mem)
	: Loader(cons, mem)
{
	DPRINTF((TEXT("Loader: ELF\n")));
}

ElfLoader::~ElfLoader(void)
{
}

BOOL
ElfLoader::setFile(File *&file)
{
	Loader::setFile(file);

	/* read ELF header and check it */
	if (!read_header())
		return FALSE;
	/* read program header */
	size_t sz = _eh.e_phnum * _eh.e_phentsize;

	return _file->read(_ph, sz, _eh.e_phoff) == sz;
}

size_t
ElfLoader::memorySize()
{
	int i;
	Elf_Phdr *ph = _ph;
	size_t sz = 0;

	DPRINTF((TEXT("file size: ")));
	for (i = 0; i < _eh.e_phnum; i++, ph++) {
		if (ph->p_type == PT_LOAD) {
			size_t filesz = ph->p_filesz;
			DPRINTF((TEXT("+0x%x"), filesz));
			sz += _mem->roundPage(filesz);
		}
	}
	DPRINTF((TEXT(" = 0x%x byte\n"), sz));
	return sz;
}

kaddr_t
ElfLoader::jumpAddr()
{
	DPRINTF((TEXT("kernel entry address: 0x%08x\n"), _eh.e_entry));
	return _eh.e_entry;
}

BOOL
ElfLoader::load()
{
	Elf_Phdr *ph;
	int i;
  
	_load_segment_start();

	for (i = 0, ph = _ph; i < _eh.e_phnum; i++, ph++) {
		if (ph->p_type == PT_LOAD) {
			size_t filesz = ph->p_filesz;
			size_t memsz = ph->p_memsz;
			vaddr_t kv = ph->p_vaddr;
			off_t fileofs = ph->p_offset;
			DPRINTF((TEXT("[%d] vaddr 0x%08x file size 0x%x mem size 0x%x\n"),
				 i, kv, filesz, memsz));
			_load_segment(kv, memsz, fileofs, filesz);
		}
	}
	/* tag chain still opening */

	return TRUE;
}

BOOL
ElfLoader::read_header(void)
{
	// read ELF header
	_file->read(&_eh, sizeof(Elf_Ehdr), 0);

	// check ELF Magic.
	if (!is_elf_file()) {
		DPRINTF((TEXT("not a ELF file.\n")));
		return FALSE;
	}
  
	// Windows CE is 32bit little-endian only.
	if (_eh.e_ident[EI_DATA] != ELFDATA2LSB ||
	    _eh.e_ident[EI_CLASS] != ELFCLASS32) {
		DPRINTF((TEXT("invalid class/data(%d/%d)\n"),
			 _eh.e_ident[EI_CLASS], _eh.e_ident[EI_DATA]));
		return FALSE;
	}

	// Is native architecture?
	switch(_eh.e_machine) {
		ELF32_MACHDEP_ID_CASES;
	default:
		DPRINTF((TEXT("not a native architecture. machine = %d\n"),
			 _eh.e_machine));
		return FALSE;
	}
  
	/* Check object type */
	if (_eh.e_type != ET_EXEC) {
		DPRINTF((TEXT("not a executable file. type = %d\n"),
			 _eh.e_type));
		return FALSE;
	}
  
	if (_eh.e_phoff == 0 || _eh.e_phnum == 0 || _eh.e_phnum > 16 ||
	    _eh.e_phentsize != sizeof(Elf_Phdr)) {
		DPRINTF((TEXT("invalid program header infomation.\n")));
		return FALSE;
	}

	return TRUE;
}
@


1.1.2.3
log
@Sync with HEAD.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.1.2.2 2001/03/27 15:30:48 bouyer Exp $	*/
a57 1
	size_t sz;
a62 4
	/* read section header */
	sz = _eh.e_shnum * _eh.e_shentsize;
	_file->read(_sh, _eh.e_shentsize * _eh.e_shnum, _eh.e_shoff);

d64 1
a64 1
	sz = _eh.e_phnum * _eh.e_phentsize;
a83 3
	/* XXX reserve 192kB for symbols */
	sz += 0x30000;

a98 5
	Elf_Shdr *sh, *shstr, *shsym;
	off_t stroff = 0, symoff = 0, off;
	vaddr_t kv;
	size_t shstrsize;
	char buf[1024];
d107 1
a107 1
			kv = ph->p_vaddr;
a111 1
			kv += memsz;
a113 48

	/*
	 * Prepare ELF headers for symbol table.
	 *
	 *   ELF header
	 *   section header
	 *   shstrtab
	 *   strtab
	 *   symtab
	 */
	memcpy(buf, &_eh, sizeof(_eh));
	((Elf_Ehdr *)buf)->e_phoff = 0;
	((Elf_Ehdr *)buf)->e_phnum = 0;
	((Elf_Ehdr *)buf)->e_entry = 0;
	((Elf_Ehdr *)buf)->e_shoff = sizeof(_eh);
	off = ((Elf_Ehdr *)buf)->e_shoff;
	memcpy(buf + off, _sh, _eh.e_shentsize * _eh.e_shnum);
	sh = (Elf_Shdr *)(buf + off);
	off += _eh.e_shentsize * _eh.e_shnum;

	/* load shstrtab and find desired sections */
	shstrsize = (sh[_eh.e_shstrndx].sh_size + 3) & ~0x3;
	_file->read(buf + off, shstrsize, sh[_eh.e_shstrndx].sh_offset);
	for(i = 0; i < _eh.e_shnum; i++, sh++) {
		if (strcmp(".strtab", buf + off + sh->sh_name) == 0) {
			stroff = sh->sh_offset;
			shstr = sh;
		} else if (strcmp(".symtab", buf + off + sh->sh_name) == 0) {
			symoff = sh->sh_offset;
			shsym = sh;
		}
		if (i == _eh.e_shstrndx)
			sh->sh_offset = off;
		else
			sh->sh_offset = 0;
	}
	/* silently return if strtab or symtab can't be found */
	if (! stroff || ! symoff)
		return TRUE;

	shstr->sh_offset = off + shstrsize;
	shsym->sh_offset = off + shstrsize + ((shstr->sh_size + 3) & ~0x3);
	_load_memory(kv, off + shstrsize, buf);
	kv += off + shstrsize;
	_load_segment(kv, shstr->sh_size, stroff, shstr->sh_size);
	kv += (shstr->sh_size + 3) & ~0x3;
	_load_segment(kv, shsym->sh_size, symoff, shsym->sh_size);

@


1.1.4.1
log
@Catch up with -current.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.2 2001/03/21 14:06:25 toshii Exp $	*/
a57 1
	size_t sz;
a62 4
	/* read section header */
	sz = _eh.e_shnum * _eh.e_shentsize;
	_file->read(_sh, _eh.e_shentsize * _eh.e_shnum, _eh.e_shoff);

d64 1
a64 1
	sz = _eh.e_phnum * _eh.e_phentsize;
a83 3
	/* XXX reserve 192kB for symbols */
	sz += 0x30000;

a98 5
	Elf_Shdr *sh, *shstr, *shsym;
	off_t stroff = 0, symoff = 0, off;
	vaddr_t kv;
	size_t shstrsize;
	char buf[1024];
d107 1
a107 1
			kv = ph->p_vaddr;
a111 33
			kv += memsz;
		}
	}

	/*
	 * Prepare ELF headers for symbol table.
	 *
	 *   ELF header
	 *   section header
	 *   shstrtab
	 *   strtab
	 *   symtab
	 */
	memcpy(buf, &_eh, sizeof(_eh));
	((Elf_Ehdr *)buf)->e_phoff = 0;
	((Elf_Ehdr *)buf)->e_phnum = 0;
	((Elf_Ehdr *)buf)->e_entry = 0;
	((Elf_Ehdr *)buf)->e_shoff = sizeof(_eh);
	off = ((Elf_Ehdr *)buf)->e_shoff;
	memcpy(buf + off, _sh, _eh.e_shentsize * _eh.e_shnum);
	sh = (Elf_Shdr *)(buf + off);
	off += _eh.e_shentsize * _eh.e_shnum;

	/* load shstrtab and find desired sections */
	shstrsize = (sh[_eh.e_shstrndx].sh_size + 3) & ~0x3;
	_file->read(buf + off, shstrsize, sh[_eh.e_shstrndx].sh_offset);
	for(i = 0; i < _eh.e_shnum; i++, sh++) {
		if (strcmp(".strtab", buf + off + sh->sh_name) == 0) {
			stroff = sh->sh_offset;
			shstr = sh;
		} else if (strcmp(".symtab", buf + off + sh->sh_name) == 0) {
			symoff = sh->sh_offset;
			shsym = sh;
a112 4
		if (i == _eh.e_shstrndx)
			sh->sh_offset = off;
		else
			sh->sh_offset = 0;
a113 12
	/* silently return if strtab or symtab can't be found */
	if (! stroff || ! symoff)
		return TRUE;

	shstr->sh_offset = off + shstrsize;
	shsym->sh_offset = off + shstrsize + ((shstr->sh_size + 3) & ~0x3);
	_load_memory(kv, off + shstrsize, buf);
	kv += off + shstrsize;
	_load_segment(kv, shstr->sh_size, stroff, shstr->sh_size);
	kv += (shstr->sh_size + 3) & ~0x3;
	_load_segment(kv, shsym->sh_size, symoff, shsym->sh_size);

@


1.1.4.2
log
@Catch up to -current.
@
text
@d1 1
a1 1
/*	$NetBSD: load_elf.cpp,v 1.1.4.1 2001/04/09 01:52:39 nathanw Exp $	*/
d109 1
a109 2
	vaddr_t kv;

d123 1
a123 1
			    i, kv, filesz, memsz));
d197 1
a197 1
		    _eh.e_ident[EI_CLASS], _eh.e_ident[EI_DATA]));
d206 1
a206 1
		    _eh.e_machine));
d213 1
a213 1
		    _eh.e_type));
@
