]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/commitdiff
Merge remote-tracking branch 'stevee/xen-iasl'
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 15 Dec 2011 09:25:17 +0000 (10:25 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 15 Dec 2011 09:25:17 +0000 (10:25 +0100)
722 files changed:
ImageMagick/ImageMagick.nm [new file with mode: 0644]
MAKEDEV/MAKEDEV.nm [new file with mode: 0644]
MAKEDEV/makedev.d.5 [new file with mode: 0644]
SDL/SDL.nm [moved from sdl/sdl.nm with 94% similarity]
X11vnc/X11vnc.nm
acl/acl.nm
acpid/acpid.nm
aiccu/aiccu.nm
attr/attr.nm
audit/audit.nm
authconfig/authconfig.nm
autoconf/autoconf.nm
autogen/autogen.nm
automake/automake.nm
avahi/avahi.nm
bash/bash.nm
bc/bc.nm
beecrypt/beecrypt.nm [new file with mode: 0644]
beecrypt/patches/beecrypt-4.1.2-biarch.patch [new file with mode: 0644]
beecrypt/patches/beecrypt-4.2.1-no-c++.patch [new file with mode: 0644]
beep/beep.nm
bind/bind.nm
bind/named.tmpfiles
binutils/binutils.nm
binutils/patches/binutils-2.20.51.0.2-pt-pax-flags-20091010.patch [deleted file]
binutils/patches/binutils-2.22-flexible-tests.patch [new file with mode: 0644]
binutils/patches/binutils-2.22-pt-pax-flags-20111121.patch [new file with mode: 0644]
binutils/patches/binutils-2.22-warn-textrel.patch [moved from binutils/patches/binutils-2.20.1-gentoo-warn-textrel.patch with 57% similarity]
bird/bird.nm
bison/bison.nm
boost/boost.nm
br2684ctl/br2684ctl.nm
bridge-utils/bridge-utils.nm
btrfs-progs/btrfs-progs.nm
bwm-ng/bwm-ng.nm
bzip2/bzip2.nm
bzip2/patches/bzip2-1.0.4-saneso.patch [new file with mode: 0644]
c_icap/c_icap.nm
c_icap_modules/c_icap_modules.nm
cairo/cairo.nm
ccache/ccache.nm
chrony/chrony-helper
chrony/chrony.nm
chrpath/chrpath.nm
clamav/clamav.nm
cloog-ppl/cloog-ppl.nm
cmake/cmake.nm
coreutils/coreutils.nm
cpio/cpio.nm
cpufrequtils/cpufrequtils.nm
cracklib/cracklib.nm
crda/crda.nm
cronie/cronie.nm
cryptsetup-luks/cryptsetup-luks.nm
cups/cups.nm
curl/curl.nm
cyrus-sasl/cyrus-sasl.nm
cyrus-sasl/patches/cyrus-sasl-2.1.23-bad-elif.patch [deleted file]
dansguardian/dansguardian.nm
db4/db4.nm
db4/patches/db-4.7.25-upstream_fixes-1.patch [deleted file]
dbus-glib/dbus-glib.nm
dbus/dbus.nm
dejagnu/dejagnu.nm
dev86/dev86.nm [new file with mode: 0644]
dev86/patches/01-dev86-pic.patch [new file with mode: 0644]
dev86/patches/02-dev86-0.16.17-fortify.patch [new file with mode: 0644]
dhcp/dhcp.nm
dhcping/dhcping.nm
dialog/dialog.nm [new file with mode: 0644]
dialog/patches/dialog-incdir.patch [new file with mode: 0644]
dialog/patches/dialog-libs.patch [new file with mode: 0644]
dialog/patches/dialog-multilib.patch [new file with mode: 0644]
diffutils/diffutils.nm
diffutils/patches/diffutils-2.8.1-hardened_tmp-1.patch [deleted file]
diffutils/patches/diffutils-2.9-i18n-1.patch [deleted file]
diffutils/patches/diffutils-cmp-s-empty.patch [new file with mode: 0644]
directfb/directfb.nm
dmidecode/dmidecode.nm
dmraid/dmraid.nm
docbook-dsssl/docbook-dsssl.nm [new file with mode: 0644]
docbook-dtds/docbook-dtds.nm [new file with mode: 0644]
docbook-dtds/patches/docbook-4.2-euro.patch [new file with mode: 0644]
docbook-dtds/patches/docbook-dtd30-sgml-1.0.catalog.patch [new file with mode: 0644]
docbook-dtds/patches/docbook-dtd31-sgml-1.0.catalog.patch [new file with mode: 0644]
docbook-dtds/patches/docbook-dtd40-sgml-1.0.catalog.patch [new file with mode: 0644]
docbook-dtds/patches/docbook-dtd41-sgml-1.0.catalog.patch [new file with mode: 0644]
docbook-dtds/patches/docbook-dtd412-entities.patch [new file with mode: 0644]
docbook-dtds/patches/docbook-dtd42-sgml-1.0.catalog.patch [new file with mode: 0644]
docbook-dtds/patches/docbook-dtds-ents.patch [new file with mode: 0644]
docbook-dtds/patches/docbook-sgml-systemrewrite.patch [new file with mode: 0644]
docbook-utils/docbook-utils.nm [new file with mode: 0644]
docbook-utils/patches/docbook-utils-2ndspaces.patch [new file with mode: 0644]
docbook-utils/patches/docbook-utils-grepnocolors.patch [new file with mode: 0644]
docbook-utils/patches/docbook-utils-newgrep.patch [new file with mode: 0644]
docbook-utils/patches/docbook-utils-nofinalecho.patch [new file with mode: 0644]
docbook-utils/patches/docbook-utils-papersize.patch [new file with mode: 0644]
docbook-utils/patches/docbook-utils-rtfmanpage.patch [new file with mode: 0644]
docbook-utils/patches/docbook-utils-sgmlinclude.patch [new file with mode: 0644]
docbook-utils/patches/docbook-utils-spaces.patch [new file with mode: 0644]
docbook-utils/patches/docbook-utils-w3mtxtconvert.patch [new file with mode: 0644]
docbook-xsl/Makefile [new file with mode: 0644]
docbook-xsl/docbook-xsl.nm [new file with mode: 0644]
docbook-xsl/patches/docbook-xsl-list-item-body.patch [new file with mode: 0644]
docbook-xsl/patches/docbook-xsl-mandir.patch [new file with mode: 0644]
docbook-xsl/patches/docbook-xsl-marginleft.patch [new file with mode: 0644]
docbook-xsl/patches/docbook-xsl-newmethods.patch [new file with mode: 0644]
docbook-xsl/patches/docbook-xsl-non-constant-expressions.patch [new file with mode: 0644]
docbook-xsl/patches/docbook-xsl-pagesetup.patch [new file with mode: 0644]
dos2unix/dos2unix.nm
dosfstools/dosfstools.nm
dracut/dracut.nm
dvdrtools/dvdrtools.nm
e2fsprogs/e2fsprogs.nm
ebtables/ebtables.nm
ebtables/patches/ebtables-2.0.8-cflags.patch [deleted file]
ebtables/patches/ebtables-2.0.8-norootinst.patch [deleted file]
ebtables/patches/ebtables-2.0.9-lsb.patch [deleted file]
ed/ed.nm
eggdbus/eggdbus.nm
eject/eject.nm
elfutils/elfutils.nm
elinks/elinks.nm
etherwake/etherwake.nm
ethtool/ethtool.nm
expat/expat.nm
expect/expect.nm
ez-ipupdate/ez-ipupdate.nm
fail2ban/fail2ban.nm
file/file.nm
filesystem/filesystem.nm
findutils/findutils.nm
firewall/firewall.nm
flex/flex.nm
fontconfig/fontconfig.nm
freeradius/freeradius.nm
freeradius/freeradius.tmpfiles
freeradius/patches/freeradius-2.1.6-cert-config.patch [deleted file]
freeradius/patches/freeradius-cert-config.patch [new file with mode: 0644]
freeradius/systemd/freeradius.service
freetype/freetype.nm
fuse-sshfs/fuse-sshfs.nm
fuse/fuse.nm
gawk/gawk.nm
gcc/gcc.nm
gcc/patches/gcc46-cloog-dl.patch0
gdb/gdb.nm
gdb/gdbinit [new file with mode: 0644]
gdb/patches/gdb-6.3-attach-see-vdso-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-bz140532-ppc-unwinding-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-bz202689-exec-from-pthread-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-bz231832-obstack-2gb.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-focus-cmd-prev-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-gcore-thread-20050204.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-gstack-20050411.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-ia64-gcore-page0-20050421.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-ia64-gcore-speedup-20050714.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-ia64-info-frame-fix-20050725.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-ia64-sigill-20051115.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-ia64-sigtramp-frame-20050708.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-inferior-notification-20050721.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-inheritancetest-20050726.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-mapping-zero-inode-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-ppc64displaysymbol-20041124.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-ppc64syscall-20040622.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-ppcdotsolib-20041022.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-readnever-20050907.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-rh-dummykfail-20041202.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-rh-testlibunwind-20041202.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-rh-testversion-20041202.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-security-errata-20050610.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-step-thread-exit-20050211-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-test-dtorfix-20050121.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-test-movedir-20050125.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-test-pie-20050107.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-test-self-20050110.patch [new file with mode: 0644]
gdb/patches/gdb-6.3-threaded-watchpoints2-20050225.patch [new file with mode: 0644]
gdb/patches/gdb-6.5-BEA-testsuite.patch [new file with mode: 0644]
gdb/patches/gdb-6.5-bz109921-DW_AT_decl_file-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch [new file with mode: 0644]
gdb/patches/gdb-6.5-bz190810-gdbserver-arch-advice.patch [new file with mode: 0644]
gdb/patches/gdb-6.5-bz203661-emit-relocs.patch [new file with mode: 0644]
gdb/patches/gdb-6.5-bz216711-clone-is-outermost.patch [new file with mode: 0644]
gdb/patches/gdb-6.5-bz218379-ppc-solib-trampoline-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch [new file with mode: 0644]
gdb/patches/gdb-6.5-bz243845-stale-testing-zombie-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.5-gcore-buffer-limit-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.5-ia64-libunwind-leak-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.5-last-address-space-byte-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.5-missed-trap-on-step-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.5-readline-long-line-crash-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.5-section-num-fixup-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.5-sharedlibrary-path.patch [new file with mode: 0644]
gdb/patches/gdb-6.6-buildid-locate-core-as-arg.patch [new file with mode: 0644]
gdb/patches/gdb-6.6-buildid-locate.patch [new file with mode: 0644]
gdb/patches/gdb-6.6-bz229517-gcore-without-terminal.patch [new file with mode: 0644]
gdb/patches/gdb-6.6-bz230000-power6-disassembly-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.6-bz235197-fork-detach-info.patch [new file with mode: 0644]
gdb/patches/gdb-6.6-bz237572-ppc-atomic-sequence-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.6-scheduler_locking-step-is-default.patch [new file with mode: 0644]
gdb/patches/gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch [new file with mode: 0644]
gdb/patches/gdb-6.6-step-thread-exit.patch [new file with mode: 0644]
gdb/patches/gdb-6.6-testsuite-timeouts.patch [new file with mode: 0644]
gdb/patches/gdb-6.6-threads-static-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.7-bz426600-DW_TAG_interface_type-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.7-charsign-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.7-ppc-clobbered-registers-O2-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.7-testsuite-stable-results.patch [new file with mode: 0644]
gdb/patches/gdb-6.8-attach-signalled-detach-stopped.patch [new file with mode: 0644]
gdb/patches/gdb-6.8-bz254229-gcore-prpsinfo.patch [new file with mode: 0644]
gdb/patches/gdb-6.8-bz436037-reg-no-longer-active.patch [new file with mode: 0644]
gdb/patches/gdb-6.8-bz442765-threaded-exec-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.8-bz457187-largefile-test.patch [new file with mode: 0644]
gdb/patches/gdb-6.8-bz466901-backtrace-full-prelinked.patch [new file with mode: 0644]
gdb/patches/gdb-6.8-quit-never-aborts.patch [new file with mode: 0644]
gdb/patches/gdb-6.8-sparc64-silence-memcpy-check.patch [new file with mode: 0644]
gdb/patches/gdb-6.8-tui-singlebinary.patch [new file with mode: 0644]
gdb/patches/gdb-6.8-watchpoint-conditionals-test.patch [new file with mode: 0644]
gdb/patches/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch [new file with mode: 0644]
gdb/patches/gdb-archer-next-over-throw-cxx-exec.patch [new file with mode: 0644]
gdb/patches/gdb-archer-pie-addons-keep-disabled.patch [new file with mode: 0644]
gdb/patches/gdb-archer.patch [new file with mode: 0644]
gdb/patches/gdb-bz533176-fortran-omp-step.patch [new file with mode: 0644]
gdb/patches/gdb-bz541866-rwatch-before-run.patch [new file with mode: 0644]
gdb/patches/gdb-bz562763-pretty-print-2d-vectors.patch [new file with mode: 0644]
gdb/patches/gdb-bz568248-oom-is-error.patch [new file with mode: 0644]
gdb/patches/gdb-bz592031-siginfo-lost-4of5.patch [new file with mode: 0644]
gdb/patches/gdb-bz592031-siginfo-lost-5of5.patch [new file with mode: 0644]
gdb/patches/gdb-bz601887-dwarf4-rh-test.patch [new file with mode: 0644]
gdb/patches/gdb-bz623749-gcore-relro.patch [new file with mode: 0644]
gdb/patches/gdb-bz634108-solib_address.patch [new file with mode: 0644]
gdb/patches/gdb-ccache-workaround.patch [new file with mode: 0644]
gdb/patches/gdb-core-open-vdso-warning.patch [new file with mode: 0644]
gdb/patches/gdb-dlopen-skip_inline_frames-perf.patch [new file with mode: 0644]
gdb/patches/gdb-dlopen-stap-probe-test.patch [new file with mode: 0644]
gdb/patches/gdb-dlopen-stap-probe.patch [new file with mode: 0644]
gdb/patches/gdb-follow-child-stale-parent.patch [new file with mode: 0644]
gdb/patches/gdb-fortran-common-reduce.patch [new file with mode: 0644]
gdb/patches/gdb-fortran-common.patch [new file with mode: 0644]
gdb/patches/gdb-gcc46-stdarg-prologue.patch [new file with mode: 0644]
gdb/patches/gdb-gdb-add-index-script.patch [new file with mode: 0644]
gdb/patches/gdb-glibc-vdso-workaround.patch [new file with mode: 0644]
gdb/patches/gdb-implptr-64bit-1of2.patch [new file with mode: 0644]
gdb/patches/gdb-implptr-64bit-2of2.patch [new file with mode: 0644]
gdb/patches/gdb-lineno-makeup-test.patch [new file with mode: 0644]
gdb/patches/gdb-moribund-utrace-workaround.patch [new file with mode: 0644]
gdb/patches/gdb-optimized-out-internal-error.patch [new file with mode: 0644]
gdb/patches/gdb-ppc-power7-test.patch [new file with mode: 0644]
gdb/patches/gdb-runtest-pie-override.patch [new file with mode: 0644]
gdb/patches/gdb-simultaneous-step-resume-breakpoint-test.patch [new file with mode: 0644]
gdb/patches/gdb-test-bt-cfi-without-die.patch [new file with mode: 0644]
gdb/patches/gdb-test-dw2-aranges.patch [new file with mode: 0644]
gdb/patches/gdb-test-expr-cumulative-archer.patch [new file with mode: 0644]
gdb/patches/gdb-test-pid0-core.patch [new file with mode: 0644]
gdb/patches/gdb-tui-strip-stepi.patch [new file with mode: 0644]
gdb/patches/gdb-unused-revert.patch [new file with mode: 0644]
gdb/patches/gdb-upstream.patch [new file with mode: 0644]
gdb/patches/gdb-vla-frame-set.patch [new file with mode: 0644]
gdb/patches/gdb-x86_64-i386-syscall-restart.patch [new file with mode: 0644]
gdbm/gdbm.nm
gdk-pixbuf2/gdk-pixbuf2.nm [new file with mode: 0644]
gettext/gettext.nm
ghostscript/ghostscript.nm
git/git.nm
glib2/glib2.nm
glibc/glibc.nm
glibc/patches/glibc-2.10.1-sanitize_env.patch.off [deleted file]
glibc/patches/glibc-2.14-arm-hardened.patch0 [new file with mode: 0644]
gmp/gmp.nm
gnupg2/gnupg2.nm
gnutls/gnutls.nm
gobject-introspection/gobject-introspection.nm
gperf/gperf.nm
grep/grep.nm
groff/groff.nm
grub/default/grub [moved from grub/grub.default with 100% similarity]
grub/grub.nm
grubby/grubby.nm [new file with mode: 0644]
gssdp/gssdp.nm
guile/guile.nm
gupnp-av/gupnp-av.nm
gupnp-igd/gupnp-igd.nm
gupnp/gupnp.nm
gzip/gzip.nm
hdparm/hdparm.nm
help2man/help2man.nm
hostapd/hostapd.nm
hplip/hplip.nm
htop/htop.nm
ibod/ibod.nm [new file with mode: 0644]
ibod/patches/ibod-1.4-config.patch [new file with mode: 0644]
ibod/patches/ibod-1.4-configuration-cli.patch [new file with mode: 0644]
ibod/patches/ibod-1.4-license.patch [new file with mode: 0644]
ibod/systemd/ibod@.service [new file with mode: 0644]
icecream/icecream.nm
icecream/systemd/icecc-scheduler.service [new file with mode: 0644]
icecream/systemd/iceccd.service [new file with mode: 0644]
iftop/iftop.nm
igmpproxy/igmpproxy.nm
initscripts/functions [deleted file]
initscripts/initscripts.nm
initscripts/rc.local [new file with mode: 0644]
initscripts/src/Makefile
initscripts/src/console_init.c [deleted file]
initscripts/sysconfig/clock [deleted file]
initscripts/sysconfig/createfiles [deleted file]
initscripts/sysconfig/modules [deleted file]
initscripts/sysconfig/network [deleted file]
initscripts/sysconfig/rc [deleted file]
initscripts/sysconfig/rc.local [deleted file]
initscripts/sysconfig/rc.site [deleted file]
initscripts/sysctl.conf [deleted file]
initscripts/systemd/rc-local.service [new file with mode: 0644]
initscripts/udev/10-console.rules [deleted file]
intltool/intltool.nm
iperf/iperf.nm [new file with mode: 0644]
iproute2/iproute2.nm
iptables/iptables.nm
iputils/iputils.nm
iscsi-initiator-utils/iscsi-initiator-utils.nm
isdn4k-utils/40-isdn.rules [new file with mode: 0644]
isdn4k-utils/capi20.conf [new file with mode: 0644]
isdn4k-utils/isdn4k-utils.nm [new file with mode: 0644]
isdn4k-utils/patches/isdn4k-utils-0202131200-true.patch [new file with mode: 0644]
isdn4k-utils/patches/isdn4k-utils-CVS-2004-11-18-autoconf25x.patch [new file with mode: 0644]
isdn4k-utils/patches/isdn4k-utils-CVS-2006-07-20-capi.patch [new file with mode: 0644]
isdn4k-utils/patches/isdn4k-utils-CVS-2009-10-20-ipfire.patch [new file with mode: 0644]
isdn4k-utils/patches/isdn4k-utils-CVS-2010-05-01-capi-soname.patch [new file with mode: 0644]
isdn4k-utils/patches/isdn4k-utils-CVS-2010-05-01-capi.patch [new file with mode: 0644]
isdn4k-utils/patches/isdn4k-utils-autoconf-2.6.4-quoting.patch [new file with mode: 0644]
isdn4k-utils/patches/isdn4k-utils-capiinit.patch [new file with mode: 0644]
isdn4k-utils/patches/isdn4k-utils-man.patch [new file with mode: 0644]
isdn4k-utils/patches/isdn4k-utils-misc-overflow-in-capi-subsystem.patch [new file with mode: 0644]
isdn4k-utils/patches/isdn4k-utils-sh-linux.patch [new file with mode: 0644]
isdn4k-utils/patches/isdn4k-utils-statfs.patch [new file with mode: 0644]
isdn4k-utils/patches/ppp-userpass.patch [new file with mode: 0644]
isdn4k-utils/systemd/capi.service [new file with mode: 0644]
isdn4k-utils/systemd/isdn.service [new file with mode: 0644]
iw/iw.nm
joe/joe.nm
jwhois/jwhois.nm
kbd/kbd.nm
kbd/patches/kbd-1.15-po.patch [deleted file]
kbd/patches/kbd-1.15-quiet_doc.patch [deleted file]
kbd/patches/kbd-1.15-sparc.patch [deleted file]
kbd/patches/kbd-1.15.3-dumpkeys-man.patch [new file with mode: 0644]
kbd/patches/kbd-1.15.3-fix-es-translation.patch [new file with mode: 0644]
keepalived/keepalived.nm [new file with mode: 0644]
keepalived/patches/keepalived-1.1.14-installmodules.patch [new file with mode: 0644]
keepalived/patches/keepalived-1.1.19-fix-ipvs-loading.patch [new file with mode: 0644]
keepalived/patches/keepalived-1.2.2-ip_vs.h-pathfix.patch [new file with mode: 0644]
keepalived/systemd/keepalived.service [new file with mode: 0644]
kernel/config.armv5tel-versatile [new file with mode: 0644]
kernel/config.i686 [moved from kernel/config with 72% similarity]
kernel/config.i686-PAE [new file with mode: 0644]
kernel/kernel.nm
kernel/patches/grsecurity-2.2.2-3.1.3-201111262001.patch [moved from kernel/patches/grsecurity-2.2.2-3.0.4-201109261052.patch with 78% similarity]
kernel/patches/linux-2.6-defaults-acpi-video.patch [new file with mode: 0644]
kernel/patches/linux-2.6-defaults-aspm.patch [new file with mode: 0644]
kernel/patches/linux-2.6-input-kill-stupid-messages.patch [new file with mode: 0644]
kernel/patches/linux-2.6-silence-acpi-blacklist.patch [new file with mode: 0644]
kernel/patches/linux-2.6-silence-fbcon-logo.patch [new file with mode: 0644]
kernel/patches/linux-2.6.30-no-pcspkr-modalias.patch [new file with mode: 0644]
kernel/systemd/cpupower.service [new file with mode: 0644]
l7-protocols/l7-protocols.nm
ldapvi/ldapvi.nm
less/less.nm
libICE/libICE.nm
libSM/libSM.nm
libVNCServer/libVNCServer.nm
libX11/libX11.nm
libXau/libXau.nm
libXaw/libXaw.nm
libXdamage/libXdamage.nm
libXdmcp/libXdmcp.nm
libXext/libXext.nm
libXfixes/libXfixes.nm
libXfont/libXfont.nm
libXft/libXft.nm
libXi/libXi.nm
libXmu/libXmu.nm
libXpm/libXpm.nm
libXrandr/libXrandr.nm
libXrender/libXrender.nm
libXres/libXres.nm
libXt/libXt.nm
libXtst/libXtst.nm
libXv/libXv.nm
libXvMC/libXvMC.nm
libXxf86vm/libXxf86vm.nm
libaal/libaal.nm
libaio/libaio.nm
libarchive/libarchive.nm
libart/libart.nm
libassuan/libassuan.nm
libatasmart/libatasmart.nm
libcap-ng/libcap-ng.nm
libcap/libcap.nm
libcap/patches/libcap-2.16-build-system-fixes.patch [deleted file]
libcap/patches/libcap-2.16-headerfix.patch [deleted file]
libcgroup/libcgroup.nm
libcroco/libcroco.nm [new file with mode: 0644]
libdaemon/libdaemon.nm
libdnet/libdnet.nm
libdrm/libdrm.nm
libedit/libedit.nm
libevent/libevent.nm
libffi/libffi.nm
libfontenc/libfontenc.nm
libgcrypt/libgcrypt.nm
libgpg-error/libgpg-error.nm
libgssglue/libgssglue.nm
libidn/libidn.nm
libjpeg/libjpeg.nm
libksba/libksba.nm
libmng/libmng.nm
libmpc/libmpc.nm
libnet/libnet.nm
libnetfilter_conntrack/libnetfilter_conntrack.nm
libnetfilter_log/libnetfilter_log.nm
libnetfilter_queue/libnetfilter_queue.nm
libnfnetlink/libnfnetlink.nm
libnfsidmap/libnfsidmap.nm
libnl/libnl.nm
libpcap/libpcap.nm
libpciaccess/libpciaccess.nm
libpipeline/libpipeline.nm
libpng/libpng.nm
librpcsecgss/librpcsecgss.nm
librsvg2/librsvg2.nm [new file with mode: 0644]
libselinux/libselinux.nm
libsemanage/libsemanage.nm
libsepol/libsepol.nm
libsigc++/libsigc++.nm
libsolv/libsolv.nm
libsoup/libsoup.nm
libssh2/libssh2.nm
libtasn1/libtasn1.nm
libtiff/libtiff.nm
libtool/libtool.nm
libtorrent/libtorrent.nm
libusb-compat/libusb-compat.nm
libusb/libusb.nm
libuser/libuser.nm
libvirt/libvirt.nm
libxcb/libxcb.nm
libxkbfile/libxkbfile.nm
libxml2/libxml2.nm
libxslt/libxslt.nm
libyaml/libyaml.nm
lighttpd/lighttpd.nm
lighttpd/lighttpd.tmpfiles
linux-atm/linux-atm.nm
linux-firmware/linux-firmware.nm
lldpd/lldpd.nm
lldpd/lldpd.tmpfiles
lldpd/patches/lldpd-0.52.x-os-release.patch [deleted file]
lldpd/systemd/lldpd.service
lm-sensors/lm-sensors.nm
logrotate/logrotate.nm
lsof/lsof.nm
lua/lua.nm
lvm2/lvm2.nm
lzo/lzo.nm
m4/m4.nm
m4/patches/m4-1.4.16-readlink-einval.patch [new file with mode: 0644]
make/make.nm
man-db/man-db.nm
man-pages/man-pages.nm
mc/mc.nm
mdadm/mdadm.nm
memtest86+/memtest86+.nm
mesa/mesa.nm
minicom/minicom.nm
module-init-tools/modprobe.d/blacklist.conf [deleted file]
module-init-tools/module-init-tools.nm
mpfr/mpfr.nm
mstpd/mstpd.nm [new file with mode: 0644]
mstpd/svn-export.sh [new file with mode: 0755]
mstpd/systemd/mstpd.service [new file with mode: 0644]
multipath-tools/multipath-tools.nm
nano/nano.nm
nasm/nasm.nm
ncurses/ncurses.nm
net-snmp/net-snmp.nm
net-tools/net-tools.nm
netplug/netplug.nm
nettle/nettle.nm
network/network.nm
newt/newt.nm
nfs-utils/nfs-utils.nm
nmap/nmap.nm
noip/noip.nm
nspr/nspr.nm
nss-myhostname/nss-myhostname.nm
nss-softokn/nss-softokn.nm
nss-util/nss-util.nm
nss-util/nss-util.spec [deleted file]
nss/nss.nm
nss_ldap/nss_ldap.nm
oinkmaster/oinkmaster.nm [new file with mode: 0644]
open-vm-tools/open-vm-tools.nm [new file with mode: 0644]
openjade/openjade.nm [new file with mode: 0644]
openjade/patches/openjade-1.3.1-manpage.patch [new file with mode: 0644]
openjade/patches/openjade-1.3.1-nsl.patch [new file with mode: 0644]
openjade/patches/openjade-1.3.2-gcc46.patch [new file with mode: 0644]
openjade/patches/openjade-deplibs.patch [new file with mode: 0644]
openjade/patches/openjade-nola.patch [new file with mode: 0644]
openl2tp/openl2tp.nm
openldap/openldap.nm
opensp/opensp.nm [new file with mode: 0644]
opensp/patches/opensp-multilib.patch [new file with mode: 0644]
opensp/patches/opensp-nodeids.patch [new file with mode: 0644]
opensp/patches/opensp-sigsegv.patch [new file with mode: 0644]
openssh/openssh.nm
openssh/patches/openssh-5.6p1-keygen.patch [deleted file]
openssh/patches/openssh-5.6p1-redhat.patch
openssh/patches/openssh-5.8p1-getaddrinfo.patch [new file with mode: 0644]
openssh/patches/openssh-5.8p1-keyperm.patch [new file with mode: 0644]
openssh/patches/openssh-5.8p1-localdomain.patch [new file with mode: 0644]
openssh/patches/openssh-5.8p1-packet.patch [new file with mode: 0644]
openssh/patches/openssh-5.8p1-randclean.patch [deleted file]
openssh/patches/openssh-5.8p1-selinux.patch [deleted file]
openssh/patches/openssh-5.8p2-askpass-ld.patch [new file with mode: 0644]
openssh/patches/openssh-5.8p2-force_krb.patch [new file with mode: 0644]
openssh/patches/openssh-5.8p2-remove-stale-control-socket.patch [new file with mode: 0644]
openssh/patches/openssh-5.8p2-sigpipe.patch [new file with mode: 0644]
openssh/patches/openssh-5.9p1-2auth.patch [new file with mode: 0644]
openssh/patches/openssh-5.9p1-akc.patch [moved from openssh/patches/openssh-5.8p1-authorized-keys-command.patch with 81% similarity]
openssh/patches/openssh-5.9p1-coverity.patch [new file with mode: 0644]
openssh/patches/openssh-5.9p1-edns.patch [moved from openssh/patches/openssh-5.2p1-edns.patch with 62% similarity]
openssh/patches/openssh-5.9p1-entropy.patch [new file with mode: 0644]
openssh/patches/openssh-5.9p1-ipfire.patch [new file with mode: 0644]
openssh/patches/openssh-5.9p1-ipv6man.patch [new file with mode: 0644]
openssh/patches/openssh-5.9p1-keygen.patch [new file with mode: 0644]
openssh/patches/openssh-5.9p1-kuserok.patch [moved from openssh/patches/openssh-5.8p1-kuserok.patch with 60% similarity]
openssh/patches/openssh-5.9p1-mls.patch [moved from openssh/patches/openssh-5.8p1-mls.patch with 89% similarity]
openssh/patches/openssh-5.9p1-randclean.patch [new file with mode: 0644]
openssh/patches/openssh-5.9p1-role.patch [moved from openssh/patches/openssh-5.8p1-selinux-role.patch with 77% similarity]
openssh/patches/openssh-5.9p1-sftp-chroot.patch [new file with mode: 0644]
openssh/patches/openssh-5.9p1-vendor.patch [new file with mode: 0644]
openssh/sshd_config [deleted file]
openssl/openssl.nm
openvpn/openvpn.nm
os-prober/os-prober.nm
p11-kit/p11-kit.nm
pakfire/pakfire.nm
pam/pam.nm
pam_ldap/pam_ldap.nm
pango/pango.nm
parted/parted.nm
passwd/passwd.nm
patch/patch.nm
pax-utils/pax-utils.nm
paxctl/paxctl.nm
paxtest/paxtest.nm
pcapy/pcapy.nm
pciutils/pciutils.nm
pcre/pcre.nm
pdns-recursor/pdns-recursor.nm
pdns/pdns.nm
perl-HTML-Parser/perl-HTML-Parser.nm
perl-SGMLSpm/perl-SGMLSpm.nm [new file with mode: 0644]
perl-Test-Simple/perl-Test-Simple.nm [deleted file]
perl-XML-Parser/perl-XML-Parser.nm
perl-libwww-perl/perl-libwww-perl.nm
perl/perl.nm
pinentry/pinentry.nm
pixman/pixman.nm
pkg-config/pkg-config.nm
polkit/polkit.nm
popt/popt.nm
powertop/powertop.nm
ppl/ppl.nm
ppp/ppp.nm
pptp/pptp.nm
procps/procps.nm
psmisc/psmisc.nm
pth/pth.nm
pyQt/patches/PyQt-x11-gpl-4.4.4-64bit.patch [deleted file]
pyQt/patches/PyQt-x11-gpl-4.5.2-QT_SHARED.patch [deleted file]
pyQt/patches/PyQt-x11-gpl-4.7.2-fix-implicit-linking.patch [deleted file]
pyQt/patches/PyQt-x11-gpl-4.8.3-pyuic_shbang.patch [new file with mode: 0644]
pyQt/patches/add_gettext_support.patch0 [new file with mode: 0644]
pyQt/pyQt.nm
pyfire/pyfire.nm
pygobject2/pygobject2.nm
pyliblzma/pyliblzma.nm
python-cairo/python-cairo.nm
python-cryptsetup/python-cryptsetup.nm
python-dbus/python-dbus.nm
python-gudev/python-gudev.nm
python-m2crypto/python-m2crypto.nm
python-netfilter_conntrack/python-netfilter_conntrack.nm
python-parted/python-parted.nm
python-piksemel/python-piksemel.nm
python-pyaspects/python-pyaspects.nm
python-pyblock/python-pyblock.nm
python-pycurl/python-pycurl.nm
python-qtermwidget/python-qtermwidget.nm
python-urlgrabber/python-urlgrabber.nm
python/python.nm
pyxattr/pyxattr.nm
qemu/qemu.nm
qt/qt.nm
qtermwidget/qtermwidget.nm
quagga/quagga.nm
radvd/radvd.nm
radvd/radvd.tmpfiles
radvd/systemd/radvd.service
readline/readline.nm
reiser4progs/reiser4progs.nm
reiserfsprogs/reiserfsprogs.nm
rrdtool/rrdtool.nm
rstp/bridge-stp [deleted file]
rstp/patches/rstp-0.21-dump-commands.patch [deleted file]
rstp/patches/rstp-0.21-upstream-fixes.patch [deleted file]
rstp/rstp.nm [deleted file]
rstp/systemd/rstp.service [deleted file]
rsync/rsync.nm
rsyslog/rsyslog.log
rsyslog/rsyslog.nm
rtorrent/rtorrent.nm
samba/samba.nm
sane/sane.nm
screen/screen.nm
sed/sed.nm
setup/setup.nm
sg3-utils/sg3-utils.nm
sgml-common/MLCATALOG [new file with mode: 0644]
sgml-common/html.dcl [new file with mode: 0644]
sgml-common/html.soc [new file with mode: 0644]
sgml-common/patches/sgml-common-quotes.patch [new file with mode: 0644]
sgml-common/patches/sgml-common-umask.patch [new file with mode: 0644]
sgml-common/patches/sgml-common-xmldir.patch [new file with mode: 0644]
sgml-common/sgml-common.nm [new file with mode: 0644]
sgml-common/xml.dcl [new file with mode: 0644]
sgml-common/xml.soc [new file with mode: 0644]
shadow-utils/default/useradd [moved from shadow-utils/useradd.default with 100% similarity]
shadow-utils/shadow-utils.nm
sip/sip.nm
slang/slang.nm
smartmontools/smartmontools.nm
sqlite/sqlite.nm
squashfs-tools/squashfs-tools.nm
squid/cache_swap.sh [new file with mode: 0644]
squid/patches/squid-3.0.STABLE7-from_manpg.patch [deleted file]
squid/squid.nm
squid/squid.sysconfig [new file with mode: 0644]
squid/systemd/squid.service [new file with mode: 0644]
squidGuard/squidGuard.nm
strace/strace.nm
strongswan/strongswan.nm
sudo/sudo.nm
suricata/suricata.conf [new file with mode: 0644]
suricata/suricata.nm
suricata/systemd/suricata.service [new file with mode: 0644]
swig/swig.nm
sysfsutils/sysfsutils.nm
syslinux/syslinux.nm
system-release/system-release.nm
systemd/patches/systemd-33-no_manpages.patch [deleted file]
systemd/systemd.nm
sysvinit/sysvinit.nm
tar/tar.nm
tcl/tcl.nm
tcpdump/tcpdump.nm
telnet/telnet.nm
texinfo/texinfo.nm
tinc/tinc.nm
traceroute/traceroute.nm
transmission/transmission.nm
tunctl/tunctl.nm
tzdata/tzdata.nm [new file with mode: 0644]
u-boot/targets [new file with mode: 0644]
u-boot/u-boot.nm [new file with mode: 0644]
udev/console_init [deleted file]
udev/rules/10-console.rules [deleted file]
udev/udev.nm
udisks/udisks.nm
ulogd2/ulogd2.nm
unzip/unzip.nm
upower/upower.nm
usb-modeswitch-data/usb-modeswitch-data.nm [new file with mode: 0644]
usb-modeswitch/usb-modeswitch.nm
usbutils/usbutils.nm
ustr/ustr.nm
util-linux/util-linux.nm
vala/vala.nm
vim/vim.nm
vlan/vlan.nm
vsftpd/vsftpd.nm
wavemon/wavemon.nm
wget/wget.nm
which/which.nm
wireless-tools/wireless-tools.nm
wpa_supplicant/wpa_supplicant.nm
xcb-util/xcb-util.nm
xen/xen.nm
xfsprogs/xfsprogs.nm
xmlto/xmlto.nm [new file with mode: 0644]
xorg-x11-drv-ati/xorg-x11-drv-ati.nm
xorg-x11-drv-evdev/xorg-x11-drv-evdev.nm
xorg-x11-drv-intel/xorg-x11-drv-intel.nm
xorg-x11-drv-keyboard/xorg-x11-drv-keyboard.nm
xorg-x11-drv-mouse/xorg-x11-drv-mouse.nm
xorg-x11-drv-nv/xorg-x11-drv-nv.nm
xorg-x11-drv-synaptics/xorg-x11-drv-synaptics.nm
xorg-x11-drv-vesa/xorg-x11-drv-vesa.nm
xorg-x11-drv-vmware/xorg-x11-drv-vmware.nm
xorg-x11-font-utils/xorg-x11-font-utils.nm
xorg-x11-font-utils/xorg-x11-fonts-update-dirs [new file with mode: 0644]
xorg-x11-fonts/xorg-x11-fonts.nm
xorg-x11-server/xorg-x11-server.nm
xorg-x11-xinit/xorg-x11-xinit.nm
xorg-x11-xkb-utils/xorg-x11-xkb-utils.nm
xrandr/xrandr.nm
xterm/xterm.nm
xz/xz.nm
zerofree/zerofree.nm
zlib/patches/zlib-1.2.5-gentoo.patch [new file with mode: 0644]
zlib/zlib.nm

diff --git a/ImageMagick/ImageMagick.nm b/ImageMagick/ImageMagick.nm
new file mode 100644 (file)
index 0000000..c5d75ad
--- /dev/null
@@ -0,0 +1,53 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = ImageMagick
+version    = 6.7.3
+release    = 1
+patchlevel = 3
+
+groups     = Application/Multimedia
+url        = http://www.imagemagick.org/
+license    = ImageMagick
+summary    = Command line programm to create and convert several image formats.
+
+description
+       ImageMagick also includes command line programs for creating
+       animated or transparent .gifs, creating composite images, creating
+       thumbnail images, and more.
+end
+
+thisapp    = %{name}-%{version}-%{patchlevel}
+
+source_dl  = ftp://ftp.ImageMagick.org/pub/%{name}/
+sources    = %{thisapp}.tar.xz
+
+build
+       requires
+               libjpeg-devel
+               libpng-devel
+               librsvg2-devel
+               libtiff-devel
+               libxml2-devel
+       end
+
+       configure_options += \
+               --sysconfdir=/etc \
+               --enable-shared \
+               --disable-static \
+               --with-threads
+end
+
+packages
+       package %{name}
+
+       package %{name}-devel
+               template DEVEL
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
diff --git a/MAKEDEV/MAKEDEV.nm b/MAKEDEV/MAKEDEV.nm
new file mode 100644 (file)
index 0000000..4cf5627
--- /dev/null
@@ -0,0 +1,67 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = MAKEDEV
+version    = 3.24
+release    = 1
+
+groups     = System/Base
+url        =
+license    = GPLv2
+summary    = A program used for creating device files in /dev.
+
+description
+       This package contains the MAKEDEV program, which makes it easier to create
+       and maintain the files in the /dev directory.  /dev directory files
+       correspond to a particular device supported by Linux (serial or printer
+       ports, scanners, sound cards, tape drives, CD-ROM drives, hard drives,
+       etc.) and interface with the drivers in the kernel.
+
+       You should install the MAKEDEV package because the MAKEDEV utility makes
+       it easy to manage the /dev directory device files.
+end
+
+sources    = %{thisapp}-1.tar.gz
+
+build
+       requires
+               libselinux-devel
+       end
+
+       make_build_targets += OPTFLAGS="%{CFLAGS}" SELINUX=1
+       make_install_targets += devdir=/dev makedevdir=/sbin
+
+       install_cmds
+               rm -f %{BUILDROOT}/dev/MAKEDEV
+               mkdir -pv %{BUILDROOT}/usr/share/man/man5
+               install -m 644 -p %{DIR_SOURCE}/makedev.d.5 \
+                       %{BUILDROOT}/usr/share/man/man5
+               mkdir -pv %{BUILDROOT}/lib/udev/devices
+               ln -svf ../../../sbin/MAKEDEV \
+                       %{BUILDROOT}/lib/udev/devices/MAKEDEV
+       end
+end
+
+packages
+       package %{name}
+               groups += Base
+
+               prerequires = shadow-utils
+               requires += udev
+
+               script prein
+                       # Add the floopy group and the vcsa user.
+                       getent group floppy >/dev/null || groupadd -g 19 -r -f floppy
+                       getent group vcsa >/dev/null || groupadd -g 69 -r -f vcsa
+                       getent passwd vcsa >/dev/null || \
+                               useradd -r -g vcsa -d /dev -s /sbin/nologin -u 69 \
+                               -c "virtual console memory owner" vcsa 2>/dev/null
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
diff --git a/MAKEDEV/makedev.d.5 b/MAKEDEV/makedev.d.5
new file mode 100644 (file)
index 0000000..290334c
--- /dev/null
@@ -0,0 +1,180 @@
+.\" Copyright (c) 2002 Thierry Vignaud <tvignaud@mandrakesoft.com>
+.\" Copyright (c) 2010 Hans de Goede <hdegoede@redhat.com>
+.\"
+.\" This is free documentation; you can redistribute it and/or
+.\" modify it under the terms of the GNU General Public License as
+.\" published by the Free Software Foundation; either version 2 of
+.\" the License, or (at your option) any later version.
+.\"
+.\" The GNU General Public License's references to "object code"
+.\" and "executables" are to be interpreted as the output of any
+.\" document formatting or typesetting system, including
+.\" intermediate and printed output.
+.\"
+.\" This manual is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+.\" GNU General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU General Public
+.\" License along with this manual; if not, write to the Free
+.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
+.\" USA.
+.\"
+.\"
+.TH makedev.d 5 "1 June 2010" "Red Hat Linux" "Linux System Administrator's Manual"
+.SH NAME
+makedev.d \- configuration files for devices creation through MAKEDEV
+.\".SH SYNOPSIS
+.SH DESCRIPTION
+The behavior of
+.B MAKEDEV
+is instrumented by the configuration files in
+.I /etc/makedev.d/
+directory. They're read and "executed" by
+.BR MAKEDEV(8)
+on post installation of the MAKEDEV package.
+.PP
+These configuration file consists of a set of lines.
+.PP
+All empty lines, and all text on a line after a '#', will be ignored.
+.PP
+The remaining lines should all conform to one of the following formats:
+.SH SYNTAX
+This is a description of the four basic legal directives.
+.TP
+.B =NAME expanded text
+this define a macro. eg: 
+.I =BURNER   660 root cdwriter
+will make 
+.B MAKEDEV
+expand
+.I $BURNER
+when encountered.
+.TP
+.B b mask owner group   major minor  minor_step dev_number root_name base
+this directive define some
+.I block
+(``b'') device(s) creation.  They will be owned by
+.I owner
+and
+.I group
+and will have the
+.I major
+and
+.I minor
+as major and minor numbers.
+.br
+The
+.I dev_number
+arguments define how many devices will be created. If 
+.I dev_number
+is different from 1, then
+.I dev_number
+devices will be created, their minor number being incremented by
+.I minor_step
+at each step.
+.br
+If only one device is created, it will be named \fIroot_name\fP.  Else,
+the devices will be named with regards to the following rules :
+.RS 7
+.IP \(bu
+If 
+.I root_name
+does not contains ``%d'', then ```\fI%d\fP'' is appended to its end.
+.IP \(bu
+If 
+.I base
+is not set, it is initialized to zero.
+.IP \(bu
+Then, at each step, the name of the device we have to created is obtained
+by incrementing
+.I base
+and replacing ``%d'' by \fI base\fP. This is equivament to these statements :
+.NF
+$base++; $file = sprintf($name, $base);
+.FI
+.\" If several devices have to be created and if 
+.RE
+.TP
+.B c mask owner group   major minor  minor_step dev_number root_name base
+is quite the same directive as the previous one, exept its purpose is
+.I character
+devices (``c'') creation.
+.TP
+.B l destination source
+will make
+.B makdev
+symlink
+.I source
+on \fIdestination\fP.
+.\" .TP
+.\" .B s mask owner group root_name
+.\" will make
+.\" .B makdev
+.\" creating a node like the \fBb\fP and the \fBc\fP directives, but as a regular
+.\" file with the sticky bit positionned.
+.SH CUSTOMIZATION
+Since there is currently no standardization in what names are used for
+system users and groups, it is possible that you may need to modify
+\fBMAKEDEV\fR's configuration files to reflect your site's settings.
+.SH EXAMPLES
+.RS
+.sp
+.nf
+.ne 7
+# /etc/makedev.d/test sample
+#
+
+# the following line create (```\fBc\fP'') the famous \fI/dev/null\fP entry
+# with 666 mask (file access permissions), with 1 as major and
+# 3 as minor
+c 666 root root         1   3  1  1 null
+
+
+# the following line define the STORAGE macro that specify a 660
+# mask for file permissions, root as owner and disk as group
+=STORAGE  660 root disk
+
+# the following line create 16 \fI/dev/hdaX\fP entries (/dev/hda0 to
+# /dev/hda15) with the permissions and ownership defined above,
+# and with 22 as major
+b $STORAGE             22   0  1 16 hda%d
+
+# this one link /dev/snd on alsa entry in procfs
+# (usually mounted in /proc)
+l snd ../proc/asound/dev
+.fi
+.sp
+.RE
+.PP
+.SH NOTES
+The name of the file may contain some ``\fI/\fP'' characters :
+.B makdev
+will create the necessary directories if the node to create must be
+in a sub directory.
+.br
+Comments must begin on first line character.
+.br
+Files are parsed one by one, after having been sorted by name in alphabetical order.
+.SH FILES
+The
+.IR /etc/makedev.d/*
+files contains instructions that instrument
+.B makdev
+to create the device files in /dev.  Especially,
+.IR /etc/makedev.d/00macros
+define most frequently used macros.
+.SH "SEE ALSO"
+Linux Allocated Devices
+.br
+It can be found in
+.IR /usr/share/doc/kernel-doc-<VERSION>/Documentation/devices.txt
+if the kernel-doc package is installed. <VERSION> is the version number
+of the installed kernel (eg: 2.6.32).
+.PP
+.BR MAKEDEV (8)
+.SH AUTHOR
+.RI "Thierry Vignaud <" tvignaud@mandrakesoft.com ">, 2002"
+.br
+.RI "Hans de Goede <" hdegoede@redhat.com ">, 2010"
similarity index 94%
rename from sdl/sdl.nm
rename to SDL/SDL.nm
index 200dc564611dd1fd682722b95b42cfeed5882269..5e22e0591e980573f490cbcccd271a4506e81950 100644 (file)
@@ -31,8 +31,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index f4b2b7795cb09e2abb6b87396efbaf8baa8f9322..e38dd26e799d4fcb13fe300306d4760bd01b820e 100644 (file)
@@ -53,4 +53,8 @@ packages
                        xorg-x11-server
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index f75a039ffd48aecddd294a41f4bfdf201f9c30ad..069b9635c9f6a053b762dc114b110212ee4b21d8 100644 (file)
@@ -47,12 +47,18 @@ end
 packages
        package %{name}
        end
-       
+
        package libacl
                template LIBS
        end
-       
+
        package libacl-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+
+               provides += libacl-debuginfo
+       end
 end
index 01f28f74a0891d6f8d30cf4acd01cd3219f88c8f..b0baa161ae076ffbd973e8f6fa8106754139eb50 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = acpid
 version    = 2.0.9
-release    = 4
+release    = 5
 
-groups     = Base System/Daemons
+groups     = System/Daemons
 url        = http://tedfelix.com/linux/acpid-netlink.html
 license    = GPLv2+
 summary    = ACPI Event Daemon.
@@ -36,5 +36,10 @@ end
 
 packages
        package %{name}
+               groups += Base
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 7334bfd3171dc98d393b8f453bfe8ffcb1dcbb4c..a879172aa8170f0e15b15ff2d48648f46502386c 100644 (file)
@@ -40,4 +40,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index cc27de0a5ecd81916905c696a801dbed2f61f434..9a6a8de59e2c0b46210d809c190336cc7bb07a34 100644 (file)
@@ -46,8 +46,14 @@ end
 packages
        package lib%{name}
        end
-       
+
        package lib%{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+
+               provides += libattr-debuginfo
+       end
 end
index 04d258f437166d259bbe406f86ba77b0434f5458..5e36fbb1b5cdd2ee2c263f21af2ad02240f22630 100644 (file)
@@ -63,8 +63,12 @@ packages
        package %{name}-libs
                template LIBS
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index f89d1aba5620f3e0e0111fac4653e6358962ed9a..12b7230cb1fd48e7e4e5f156001c0493a178ee9c 100644 (file)
@@ -68,8 +68,12 @@ packages
        package %{name}
                requires += newt-python
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index e8fd519b12dad268fec09d3efdc9b78c45ac5e27..295d64c2795326af4116657b72b75b3af333ccba 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = autoconf
 version    = 2.68
-release    = 1
+release    = 2
 arch       = noarch
 
 groups     = Development/Tools
@@ -33,5 +33,9 @@ end
 packages
        package %{name}
                requires = m4
+
+               filter_requires
+                       perl>=[0-9]\:.*
+               end
        end
 end
index 6e6ee13ebee9ac0d609d19f35a71def376f37933..3dec57f836e163cf6ea5155c8fefa4664f5cbb1c 100644 (file)
@@ -31,4 +31,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index c25f1e9df6fb8bfe1d5981806077815fbb28adc6..05812d981708fe0c399aca975d88b72cc28d6f11 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = automake
 version    = 1.11.1
-release    = 1
+release    = 2
 arch       = noarch
 
 groups     = Development/Tools
@@ -31,5 +31,9 @@ end
 packages
        package %{name}
                requires = autoconf
+
+               filter_requires
+                       perl>=[0-9]\:.*
+               end
        end
 end
index 2ca00ecff854537d0bb48452c312ff2d7f97cfb3..a0d4e98b850770998e05fce0854fbb939afd45b9 100644 (file)
@@ -59,12 +59,16 @@ packages
        package %{name}
                requires = libdaemon>=0.14
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
-       
+
        package %{name}-libs
                template LIBS
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index bc9662d3e4eaca7fee926f6c8d1b368057e041a9..e6c0ff56b28fd9cf264ef223c929624945e6eead 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = bash
 version    = 4.2
-release    = 2
+release    = 5
 
-groups     = Base Build System/Tools
+groups     = System/Tools
 url        = http://www.gnu.org/software/bash/
 license    = GPLv2+
 summary    = Bash is short for born again shell.
@@ -67,6 +67,53 @@ end
 
 packages
        package %{name}
+               groups += Base Build
+
+               prerequires = coreutils
                requires = /etc/bashrc /etc/profile
+
+               script postin
+                       # Create /etc/shells, if it does not exist.
+                       [ -f "/etc/shells" ] || touch /etc/shells
+
+                       found_sh=0
+                       found_bash=0
+                       while read line; do
+                               if [ "/bin/bash" = "${line}" ]; then
+                                       found_bash=1
+                               elif [ "/bin/sh" = "${line}" ]; then
+                                       found_sh=1
+                               fi
+                       done < /etc/shells
+
+                       if [ "${found_bash}" = "0" ]; then
+                               echo "/bin/bash" >> /etc/shells
+                       fi
+
+                       if [ "${found_sh}" = "0" ]; then
+                               echo "/bin/sh" >> /etc/shells
+                       fi
+               end
+
+               script postun
+                       [ -e "/etc/shells" ] || exit 0
+
+                       # Remove /bin/bash and /bin/sh from /etc/shells.
+                       while read line; do
+                               if [ "/bin/bash" = "${line}" ]; then
+                                       continue
+                               elif [ "/bin/sh" = "${line}" ]; then
+                                       continue
+                               fi
+
+                               echo "${line}"
+                       done < /etc/shells > /etc/shells.$$
+
+                       mv -f /etc/shells{.$$,}
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 71d89a40252ae56f12df4da4b6e0f3fe30f92c99..9b91ebd4caae02d1f67c398d5cdf4e73187a02de 100644 (file)
--- a/bc/bc.nm
+++ b/bc/bc.nm
@@ -40,4 +40,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/beecrypt/beecrypt.nm b/beecrypt/beecrypt.nm
new file mode 100644 (file)
index 0000000..8cfe957
--- /dev/null
@@ -0,0 +1,59 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = beecrypt
+version    = 4.2.1
+release    = 1
+
+groups     = System/Libraries
+url        = http://beecrypt.sourceforge.net/
+license    = LGPLv2+
+summary    = An open source cryptography library.
+
+description
+       BeeCrypt is an ongoing project to provide a strong and fast cryptography
+       toolkit. Includes entropy sources, random generators, block ciphers, hash
+       functions, message authentication codes, multiprecision integer routines
+       and public key primitives.
+end
+
+source_dl  = http://downloads.sourceforge.net/sourceforge/%{name}/
+
+build
+       requires
+               autoconf
+               automake
+               gcc-c++
+               libtool
+
+               perl-Carp
+       end
+
+       prepare_cmds
+               libtoolize
+               autoreconf
+       end
+
+       configure_options += \
+               --with-cplusplus=no \
+               --with-java=no \
+               --with-python=no
+
+       test
+               make check
+       end
+end
+
+packages
+       package %{name}
+
+       package %{name}-devel
+               template DEVEL
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
diff --git a/beecrypt/patches/beecrypt-4.1.2-biarch.patch b/beecrypt/patches/beecrypt-4.1.2-biarch.patch
new file mode 100644 (file)
index 0000000..695eef0
--- /dev/null
@@ -0,0 +1,19 @@
+Patch by Paul Nasrat <pnasrat@redhat.com> for beecrypt >= 4.1.2 to make multilib/multiarch
+of beecrypt-devel working.
+
+--- beecrypt-4.1.2/gnu.h.in                            2006-05-22 15:53:45.000000000 -0400
++++ beecrypt-4.1.2/gnu.h.in.biarch                     2006-05-22 15:53:49.000000000 -0400
+@@ -61,7 +61,12 @@
+  * make assumptions about the size set by the configure script
+  */
+ #if !defined(MP_WBITS)
+-# define MP_WBITS     @MP_WBITS@
++# include <bits/wordsize.h>
++#if __WORDSIZE == 32
++# define MP_WBITS     32U
++#elif __WORDSIZE == 64
++# define MP_WBITS     64U
++#endif
+ #endif
+ #endif
diff --git a/beecrypt/patches/beecrypt-4.2.1-no-c++.patch b/beecrypt/patches/beecrypt-4.2.1-no-c++.patch
new file mode 100644 (file)
index 0000000..bb2d227
--- /dev/null
@@ -0,0 +1,16 @@
+Patch by Robert Scheck <robert@fedoraproject.org> for beecrypt >= 4.2.1 to avoid linking
+against libstdc++. This patch is based on an old by Florian La Roche <laroche@redhat.com>
+and Panu Matilainen <pmatilai@redhat.com>. For further information see Red Hat Bugzilla
+for bug ID #165080.
+
+--- beecrypt-4.2.1/Makefile.am                         2009-07-08 20:56:18.000000000 +0200
++++ beecrypt-4.2.1/Makefile.am.no-c++                  2010-03-28 20:55:51.000000000 +0200
+@@ -62,7 +62,7 @@
+ lib_LTLIBRARIES = libbeecrypt.la
+-libbeecrypt_la_SOURCES = aes.c base64.c beecrypt.c blockmode.c blockpad.c blowfish.c dhies.c dldp.c dlkp.c dlpk.c dlsvdp-dh.c dsa.c elgamal.c endianness.c entropy.c fips186.c hmac.c hmacmd5.c hmacsha1.c hmacsha224.c hmacsha256.c md4.c md5.c hmacsha384.c hmacsha512.c memchunk.c mp.c mpbarrett.c mpnumber.c mpprime.c mtprng.c pkcs1.c pkcs12.c ripemd128.c ripemd160.c ripemd256.c ripemd320.c rsa.c rsakp.c rsapk.c sha1.c sha224.c sha256.c sha384.c sha512.c sha2k32.c sha2k64.c timestamp.c cppglue.cxx
++libbeecrypt_la_SOURCES = aes.c base64.c beecrypt.c blockmode.c blockpad.c blowfish.c dhies.c dldp.c dlkp.c dlpk.c dlsvdp-dh.c dsa.c elgamal.c endianness.c entropy.c fips186.c hmac.c hmacmd5.c hmacsha1.c hmacsha224.c hmacsha256.c md4.c md5.c hmacsha384.c hmacsha512.c memchunk.c mp.c mpbarrett.c mpnumber.c mpprime.c mtprng.c pkcs1.c pkcs12.c ripemd128.c ripemd160.c ripemd256.c ripemd320.c rsa.c rsakp.c rsapk.c sha1.c sha224.c sha256.c sha384.c sha512.c sha2k32.c sha2k64.c timestamp.c # cppglue.cxx
+ libbeecrypt_la_DEPENDENCIES = $(BEECRYPT_OBJECTS)
+ libbeecrypt_la_LIBADD = blowfishopt.lo mpopt.lo sha1opt.lo $(OPENMP_LIBS)
+ libbeecrypt_la_LDFLAGS = -no-undefined -version-info $(LIBBEECRYPT_LT_CURRENT):$(LIBBEECRYPT_LT_REVISION):$(LIBBEECRYPT_LT_AGE)
index 6de82eeff2d7f08f67acf135e663c034cf4a85eb..6cdf5d94ca75400c4cfa414ea7d8fb2c50bf2292 100644 (file)
@@ -40,4 +40,8 @@ end
 
 packages
        package beep
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 92290af603d06d50bb2e05ddde34e3f1c9373baf..8563b7c26e1e834a28f61aa353631164f7edbdac 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = bind
 version    = 9.8.1
-release    = 2
+release    = 3
 
 groups     = Networking/Tools
 url        = http://www.isc.org/products/BIND/
@@ -62,6 +62,7 @@ build
                libidn-devel
                pkg-config
                openssl-devel
+               shadow-utils
        end
 
        configure_options += \
@@ -97,6 +98,9 @@ build
                libtoolize -c -f
                aclocal -I m4 --force
                autoconf -f
+
+               # Create user and group for /run directory.
+               %{create_user}
        end
 
        install
@@ -138,7 +142,7 @@ build
                tar -C %{BUILDROOT} -xaf %{DIR_DL}/bind-config-8.tar.bz2
                touch %{BUILDROOT}/etc/rndc.key
                touch %{BUILDROOT}/etc/rndc.conf
-               
+
                mkdir %{BUILDROOT}/etc/named
                install -m 644 bind.keys %{BUILDROOT}/etc/named.iscdlv.key
                install -m 644 %{DIR_SOURCE}/trusted-key.key %{BUILDROOT}/etc/trusted-key.key
@@ -150,9 +154,19 @@ build
                ln -svf ../../lib/libirs-export.so.80 %{BUILDROOT}/usr/lib/libirs-export.so
                ln -svf ../../lib/libisccfg-export.so.82 %{BUILDROOT}/usr/lib/libisccfg-export.so
                ln -svf ../../lib/libisc-export.so.83 %{BUILDROOT}/usr/lib/libisc-export.so
+
+               # Create /run/named.
+               mkdir -pv %{BUILDROOT}/run/named
+               chown -Rv named.named %{BUILDROOT}/run/named/
        end
 end
 
+create_user
+       getent group named >/dev/null || /usr/sbin/groupadd -r named
+       getent passwd named >/dev/null || /usr/sbin/useradd -r -g named \
+               -d /var/named -c "User for bind DNS server" -s /sbin/nologin named
+end
+
 packages
        package %{name}
                requires
@@ -163,12 +177,7 @@ packages
                prerequires += shadow-utils
 
                script prein
-                       # Create unprivileged user and group.
-                       getent group named > /dev/null || groupadd -r named
-                       getent passwd named > /dev/null || \
-                               useradd -r -g named -d /var/named -s /sbin/nologin \
-                               -c "User for bind DNS server" named
-                       exit 0
+                       %{create_user}
                end
 
                # XXX Add systemd scriptlet if a service file becomes available
@@ -206,4 +215,8 @@ packages
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 8a7fa4950abe17da20a5822a4856f6b7639d906b..640a656170fbb4ede4dd65aa2ff3f864a697f07d 100644 (file)
@@ -1 +1 @@
-d /var/run/named 0755 named named -
+d /run/named 0755 named named -
index f8c808ee417b9f6b0db96748ffc3d67bc9b204e7..8879700fe16463b27bbb01bf178facccf2b813db 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = binutils
-version    = 2.21.51.0.8
+version    = 2.22
 release    = 1
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
@@ -45,19 +45,19 @@ build
        build
                BINUTILS_TARGET_PLATFORM=$(echo "%{DISTRO_MACHINE}" | sed -e "s/-gnu//")
 
-               cd %{DIR_SRC}/binutils-build && \
-                       ../%{thisapp}/configure \
-                               --host=${BINUTILS_TARGET_PLATFORM} \
-                               --build=${BINUTILS_TARGET_PLATFORM} \
-                               --target=${BINUTILS_TARGET_PLATFORM} \
-                               --prefix=/usr \
-                               --mandir=/usr/share/man \
-                               --enable-shared \
-                               --disable-nls \
-                               --disable-werror \
-                               --disable-static
-
-               cd %{DIR_SRC}/binutils-build && make tooldir=/usr %{PARALLELISMFLAGS}
+               cd %{DIR_SRC}/binutils-build
+               ../%{thisapp}/configure \
+                       --host=${BINUTILS_TARGET_PLATFORM} \
+                       --build=${BINUTILS_TARGET_PLATFORM} \
+                       --target=${BINUTILS_TARGET_PLATFORM} \
+                       --prefix=/usr \
+                       --mandir=/usr/share/man \
+                       --enable-shared \
+                       --disable-nls \
+                       --disable-werror \
+                       --disable-static
+
+               make tooldir=/usr %{PARALLELISMFLAGS}
        end
 
        #def test
@@ -70,10 +70,32 @@ build
                cd %{DIR_SRC}/binutils-build && make tooldir=/usr install DESTDIR=%{BUILDROOT}
 
                cp -fv %{DIR_APP}/include/libiberty.h %{BUILDROOT}/usr/include
+
+               # Prevent packages from linking against libbfd and libopcodes,
+               # because they change too often.
+               rm -rfv %{BUILDROOT}/usr/lib/lib{bfd,opcodes}.so
+       end
+
+       # Keep static version of libiberty.
+       keep_libraries
+               /usr/lib/libiberty.a
        end
 end
 
 packages
        package %{name}
+
+       package %{name}-devel
+               template DEVEL
+
+               # Don't package libbfd and libopcodes in the -devel package.
+               files
+                       /usr/include
+                       /usr/lib/*.a
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
diff --git a/binutils/patches/binutils-2.20.51.0.2-pt-pax-flags-20091010.patch b/binutils/patches/binutils-2.20.51.0.2-pt-pax-flags-20091010.patch
deleted file mode 100644 (file)
index 460484b..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
---- binutils-2.20/bfd/elf-bfd.h
-+++ binutils-2.20/bfd/elf-bfd.h
-@@ -1527,6 +1527,9 @@ struct elf_obj_tdata
-   /* Segment flags for the PT_GNU_STACK segment.  */
-   unsigned int stack_flags;
-+  /* Segment flags for the PT_PAX_FLAGS segment.  */
-+  unsigned int pax_flags;
-+
-   /* Symbol version definitions in external objects.  */
-   Elf_Internal_Verdef *verdef;
---- binutils-2.20/bfd/elf.c
-+++ binutils-2.20/bfd/elf.c
-@@ -1081,6 +1081,7 @@ get_segment_type (unsigned int p_type)
-     case PT_GNU_EH_FRAME: pt = "EH_FRAME"; break;
-     case PT_GNU_STACK: pt = "STACK"; break;
-     case PT_GNU_RELRO: pt = "RELRO"; break;
-+    case PT_PAX_FLAGS: pt = "PAX_FLAGS"; break;
-     default: pt = NULL; break;
-     }
-   return pt;
-@@ -2379,6 +2380,9 @@ bfd_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int index)
-     case PT_GNU_RELRO:
-       return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "relro");
-+    case PT_PAX_FLAGS:
-+      return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "pax_flags");
-+
-     default:
-       /* Check for any processor-specific program segment types.  */
-       bed = get_elf_backend_data (abfd);
-@@ -3393,6 +3397,11 @@ get_program_header_size (bfd *abfd, struct bfd_link_info *info)
-       ++segs;
-     }
-+    {
-+      /* We need a PT_PAX_FLAGS segment.  */
-+      ++segs;
-+    }
-+
-   for (s = abfd->sections; s != NULL; s = s->next)
-     {
-       if ((s->flags & SEC_LOAD) != 0
-@@ -3972,6 +3981,20 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info)
-           }
-       }
-+    {
-+      amt = sizeof (struct elf_segment_map);
-+      m = bfd_zalloc (abfd, amt);
-+      if (m == NULL)
-+      goto error_return;
-+      m->next = NULL;
-+      m->p_type = PT_PAX_FLAGS;
-+      m->p_flags = elf_tdata (abfd)->pax_flags;
-+      m->p_flags_valid = 1;
-+
-+      *pm = m;
-+      pm = &m->next;
-+    }
-+
-       free (sections);
-       elf_tdata (abfd)->segment_map = mfirst;
-     }
-@@ -5176,7 +5199,8 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
-        6. PT_TLS segment includes only SHF_TLS sections.
-        7. SHF_TLS sections are only in PT_TLS or PT_LOAD segments.
-        8. PT_DYNAMIC should not contain empty sections at the beginning
--        (with the possible exception of .dynamic).  */
-+        (with the possible exception of .dynamic).
-+       9. PT_PAX_FLAGS segments do not include any sections.  */
- #define IS_SECTION_IN_INPUT_SEGMENT(section, segment, bed)            \
-   ((((segment->p_paddr                                                        \
-       ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr)      \
-@@ -5184,6 +5208,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
-      && (section->flags & SEC_ALLOC) != 0)                            \
-     || IS_NOTE (segment, section))                                    \
-    && segment->p_type != PT_GNU_STACK                                 \
-+   && segment->p_type != PT_PAX_FLAGS                                 \
-    && (segment->p_type != PT_TLS                                      \
-        || (section->flags & SEC_THREAD_LOCAL))                                \
-    && (segment->p_type == PT_LOAD                                     \
---- binutils-2.20/bfd/elflink.c
-+++ binutils-2.20/bfd/elflink.c
-@@ -5465,16 +5465,30 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
-     return TRUE;
-   bed = get_elf_backend_data (output_bfd);
-+
-+  elf_tdata (output_bfd)->pax_flags = PF_NORANDEXEC;
-+  if (info->execheap)
-+    elf_tdata (output_bfd)->pax_flags |= PF_NOMPROTECT;
-+  else if (info->noexecheap)
-+    elf_tdata (output_bfd)->pax_flags |= PF_MPROTECT;
-+
-   if (info->execstack)
--    elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
-+    {
-+      elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
-+      elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
-+    }
-   else if (info->noexecstack)
--    elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
-+    {
-+      elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
-+      elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
-+    }
-   else
-     {
-       bfd *inputobj;
-       asection *notesec = NULL;
-       int exec = 0;
-+      elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
-       for (inputobj = info->input_bfds;
-          inputobj;
-          inputobj = inputobj->link_next)
-@@ -5487,7 +5501,11 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
-         if (s)
-           {
-             if (s->flags & SEC_CODE)
--              exec = PF_X;
-+              {
-+                elf_tdata (output_bfd)->pax_flags &= ~PF_NOEMUTRAMP;
-+                elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
-+                exec = PF_X;
-+              }
-             notesec = s;
-           }
-         else if (bed->default_execstack)
---- binutils-2.20/binutils/readelf.c
-+++ binutils-2.20/binutils/readelf.c
-@@ -2556,6 +2556,7 @@ get_segment_type (unsigned long p_type)
-                       return "GNU_EH_FRAME";
-     case PT_GNU_STACK:        return "GNU_STACK";
-     case PT_GNU_RELRO:  return "GNU_RELRO";
-+    case PT_PAX_FLAGS:  return "PAX_FLAGS";
-     default:
-       if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC))
---- binutils-2.20/include/bfdlink.h
-+++ binutils-2.20/include/bfdlink.h
-@@ -319,6 +319,14 @@ struct bfd_link_info
-   /* TRUE if PT_GNU_RELRO segment should be created.  */
-   unsigned int relro: 1;
-+  /* TRUE if PT_PAX_FLAGS segment should be created with PF_NOMPROTECT
-+     flags.  */
-+  unsigned int execheap: 1;
-+
-+  /* TRUE if PT_PAX_FLAGS segment should be created with PF_MPROTECT
-+     flags.  */
-+  unsigned int noexecheap: 1;
-+
-   /* TRUE if we should warn when adding a DT_TEXTREL to a shared object.  */
-   unsigned int warn_shared_textrel: 1;
---- binutils-2.20/include/elf/common.h
-+++ binutils-2.20/include/elf/common.h
-@@ -422,6 +422,7 @@
- #define PT_GNU_STACK  (PT_LOOS + 0x474e551) /* Stack flags */
- #define PT_GNU_RELRO  (PT_LOOS + 0x474e552) /* Read-only after relocation */
- #define PT_GNU_SHR    (PT_LOOS + 0x474e554) /* Sharable segment */
-+#define PT_PAX_FLAGS  (PT_LOOS + 0x5041580) /* PaX flags */
- /* Program segment permissions, in program header p_flags field.  */
-@@ -432,6 +433,21 @@
- #define PF_MASKOS     0x0FF00000      /* New value, Oct 4, 1999 Draft */
- #define PF_MASKPROC   0xF0000000      /* Processor-specific reserved bits */
-+/* Flags to control PaX behavior.  */
-+
-+#define PF_PAGEEXEC   (1 << 4)        /* Enable  PAGEEXEC */
-+#define PF_NOPAGEEXEC (1 << 5)        /* Disable PAGEEXEC */
-+#define PF_SEGMEXEC   (1 << 6)        /* Enable  SEGMEXEC */
-+#define PF_NOSEGMEXEC (1 << 7)        /* Disable SEGMEXEC */
-+#define PF_MPROTECT   (1 << 8)        /* Enable  MPROTECT */
-+#define PF_NOMPROTECT (1 << 9)        /* Disable MPROTECT */
-+#define PF_RANDEXEC   (1 << 10)       /* Enable  RANDEXEC */
-+#define PF_NORANDEXEC (1 << 11)       /* Disable RANDEXEC */
-+#define PF_EMUTRAMP   (1 << 12)       /* Enable  EMUTRAMP */
-+#define PF_NOEMUTRAMP (1 << 13)       /* Disable EMUTRAMP */
-+#define PF_RANDMMAP   (1 << 14)       /* Enable  RANDMMAP */
-+#define PF_NORANDMMAP (1 << 15)       /* Disable RANDMMAP */
-+
- /* Values for section header, sh_type field.  */
- #define SHT_NULL      0               /* Section header table entry unused */
---- binutils-2.20/ld/emultempl/elf32.em
-+++ binutils-2.20/ld/emultempl/elf32.em
-@@ -2159,6 +2159,16 @@ fragment <<EOF
-         link_info.noexecstack = TRUE;
-         link_info.execstack = FALSE;
-       }
-+      else if (strcmp (optarg, "execheap") == 0)
-+      {
-+        link_info.execheap = TRUE;
-+        link_info.noexecheap = FALSE;
-+      }
-+      else if (strcmp (optarg, "noexecheap") == 0)
-+      {
-+        link_info.noexecheap = TRUE;
-+        link_info.execheap = FALSE;
-+      }
- EOF
-   if test -n "$COMMONPAGESIZE"; then
-@@ -2237,6 +2247,8 @@ fragment <<EOF
-   fprintf (file, _("\
-   -z execstack                Mark executable as requiring executable stack\n"));
-   fprintf (file, _("\
-+  -z execheap                 Mark executable as requiring executable heap\n"));
-+  fprintf (file, _("\
-   -z initfirst                Mark DSO to be initialized first at runtime\n"));
-   fprintf (file, _("\
-   -z interpose                Mark object to interpose all DSOs but executable\n"));
-@@ -2260,6 +2272,8 @@ fragment <<EOF
-   -z nodump                   Mark DSO not available to dldump\n"));
-   fprintf (file, _("\
-   -z noexecstack              Mark executable as not requiring executable stack\n"));
-+  fprintf (file, _("\
-+  -z noexecheap               Mark executable as not requiring executable heap\n"));
- EOF
-   if test -n "$COMMONPAGESIZE"; then
---- binutils-2.20/ld/ldgram.y
-+++ binutils-2.20/ld/ldgram.y
-@@ -1116,6 +1116,8 @@ phdr_type:
-                           $$ = exp_intop (0x6474e550);
-                         else if (strcmp (s, "PT_GNU_STACK") == 0)
-                           $$ = exp_intop (0x6474e551);
-+                        else if (strcmp (s, "PT_PAX_FLAGS") == 0)
-+                          $$ = exp_intop (0x65041580);
-                         else
-                           {
-                             einfo (_("\
diff --git a/binutils/patches/binutils-2.22-flexible-tests.patch b/binutils/patches/binutils-2.22-flexible-tests.patch
new file mode 100644 (file)
index 0000000..681d33f
--- /dev/null
@@ -0,0 +1,45 @@
+making some of the address matches more flexible fixes tests when using
+pax/relro/hash patches
+
+--- binutils/ld/testsuite/ld-i386/hidden2.d
++++ binutils/ld/testsuite/ld-i386/hidden2.d
+@@ -8,6 +8,6 @@
+ Disassembly of section .text:
+ [a-f0-9]+ <bar>:
+-[     ]*[a-f0-9]+:    e8 cf fe ff ff          call   0 .*
++[     ]*[a-f0-9]+:    e8 ([a-f0-9]{2} ){2}ff ff               call   0 .*
+ [     ]*[a-f0-9]+:    c3                      ret    
+ #pass
+--- binutils/ld/testsuite/ld-x86-64/hidden2.d
++++ binutils/ld/testsuite/ld-x86-64/hidden2.d
+@@ -8,6 +8,6 @@
+ Disassembly of section .text:
+ [a-f0-9]+ <bar>:
+-[     ]*[a-f0-9]+:    e8 33 fe ff ff          callq  0 .*
++[     ]*[a-f0-9]+:    e8 ([a-f0-9]{2} ){2}ff ff               callq  0 .*
+ [     ]*[a-f0-9]+:    c3                      retq   
+ #pass
+--- binutils/ld/testsuite/ld-ifunc/ifunc-2-local-x86-64.d
++++ binutils/ld/testsuite/ld-ifunc/ifunc-2-local-x86-64.d
+@@ -4,6 +4,6 @@
+ #target: x86_64-*-*
+ #...
+-[ \t0-9a-f]+:[ \t0-9a-f]+call[ \t0-9a-fq]+<\*ABS\*\+0x220@plt>
+-[ \t0-9a-f]+:[ \t0-9a-f]+lea[ \t]+.*\(%rip\),%rax.*[ \t0-9a-fq]+<\*ABS\*\+0x220@plt>
++[ \t0-9a-f]+:[ \t0-9a-f]+call[ \t0-9a-fq]+<\*ABS\*\+0x[a-f0-9]+@plt>
++[ \t0-9a-f]+:[ \t0-9a-f]+lea[ \t]+.*\(%rip\),%rax.*[ \t0-9a-fq]+<\*ABS\*\+0x[a-f0-9]+@plt>
+ #pass
+--- binutils/ld/testsuite/ld-ifunc/ifunc-2-x86-64.d
++++ binutils/ld/testsuite/ld-ifunc/ifunc-2-x86-64.d
+@@ -4,6 +4,6 @@
+ #target: x86_64-*-*
+ #...
+-[ \t0-9a-f]+:[ \t0-9a-f]+call[ \t0-9a-fq]+<\*ABS\*\+0x220@plt>
+-[ \t0-9a-f]+:[ \t0-9a-f]+lea[ \t]+.*\(%rip\),%rax.*[ \t0-9a-fq]+<\*ABS\*\+0x220@plt>
++[ \t0-9a-f]+:[ \t0-9a-f]+call[ \t0-9a-fq]+<\*ABS\*\+0x[a-f0-9]+@plt>
++[ \t0-9a-f]+:[ \t0-9a-f]+lea[ \t]+.*\(%rip\),%rax.*[ \t0-9a-fq]+<\*ABS\*\+0x[a-f0-9]+@plt>
+ #pass
diff --git a/binutils/patches/binutils-2.22-pt-pax-flags-20111121.patch b/binutils/patches/binutils-2.22-pt-pax-flags-20111121.patch
new file mode 100644 (file)
index 0000000..3ba1a87
--- /dev/null
@@ -0,0 +1,1859 @@
+--- binutils-2.22/bfd/elf-bfd.h
++++ binutils-2.22/bfd/elf-bfd.h
+@@ -1577,6 +1577,9 @@ struct elf_obj_tdata
+   /* Segment flags for the PT_GNU_STACK segment.  */
+   unsigned int stack_flags;
++  /* Segment flags for the PT_PAX_FLAGS segment.  */
++  unsigned int pax_flags;
++
+   /* Symbol version definitions in external objects.  */
+   Elf_Internal_Verdef *verdef;
+--- binutils-2.22/bfd/elf.c
++++ binutils-2.22/bfd/elf.c
+@@ -1158,6 +1158,7 @@ get_segment_type (unsigned int p_type)
+     case PT_GNU_EH_FRAME: pt = "EH_FRAME"; break;
+     case PT_GNU_STACK: pt = "STACK"; break;
+     case PT_GNU_RELRO: pt = "RELRO"; break;
++    case PT_PAX_FLAGS: pt = "PAX_FLAGS"; break;
+     default: pt = NULL; break;
+     }
+   return pt;
+@@ -2477,6 +2478,9 @@ bfd_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int hdr_index)
+     case PT_GNU_RELRO:
+       return _bfd_elf_make_section_from_phdr (abfd, hdr, hdr_index, "relro");
++    case PT_PAX_FLAGS:
++      return _bfd_elf_make_section_from_phdr (abfd, hdr, hdr_index, "pax_flags");
++
+     default:
+       /* Check for any processor-specific program segment types.  */
+       bed = get_elf_backend_data (abfd);
+@@ -3551,6 +3555,11 @@ get_program_header_size (bfd *abfd, struct bfd_link_info *info)
+       ++segs;
+     }
++    {
++      /* We need a PT_PAX_FLAGS segment.  */
++      ++segs;
++    }
++
+   for (s = abfd->sections; s != NULL; s = s->next)
+     {
+       if ((s->flags & SEC_LOAD) != 0
+@@ -4153,6 +4162,20 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info)
+           }
+       }
++    {
++      amt = sizeof (struct elf_segment_map);
++      m = bfd_zalloc (abfd, amt);
++      if (m == NULL)
++      goto error_return;
++      m->next = NULL;
++      m->p_type = PT_PAX_FLAGS;
++      m->p_flags = elf_tdata (abfd)->pax_flags;
++      m->p_flags_valid = 1;
++
++      *pm = m;
++      pm = &m->next;
++    }
++
+       free (sections);
+       elf_tdata (abfd)->segment_map = mfirst;
+     }
+@@ -5417,7 +5440,8 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
+        6. PT_TLS segment includes only SHF_TLS sections.
+        7. SHF_TLS sections are only in PT_TLS or PT_LOAD segments.
+        8. PT_DYNAMIC should not contain empty sections at the beginning
+-        (with the possible exception of .dynamic).  */
++        (with the possible exception of .dynamic).
++       9. PT_PAX_FLAGS segments do not include any sections.  */
+ #define IS_SECTION_IN_INPUT_SEGMENT(section, segment, bed)            \
+   ((((segment->p_paddr                                                        \
+       ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr)      \
+@@ -5425,6 +5449,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
+      && (section->flags & SEC_ALLOC) != 0)                            \
+     || IS_NOTE (segment, section))                                    \
+    && segment->p_type != PT_GNU_STACK                                 \
++   && segment->p_type != PT_PAX_FLAGS                                 \
+    && (segment->p_type != PT_TLS                                      \
+        || (section->flags & SEC_THREAD_LOCAL))                                \
+    && (segment->p_type == PT_LOAD                                     \
+--- binutils-2.22/bfd/elflink.c
++++ binutils-2.22/bfd/elflink.c
+@@ -5545,16 +5545,30 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
+     return TRUE;
+   bed = get_elf_backend_data (output_bfd);
++
++  elf_tdata (output_bfd)->pax_flags = PF_NORANDEXEC;
++  if (info->execheap)
++    elf_tdata (output_bfd)->pax_flags |= PF_NOMPROTECT;
++  else if (info->noexecheap)
++    elf_tdata (output_bfd)->pax_flags |= PF_MPROTECT;
++
+   if (info->execstack)
+-    elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
++    {
++      elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
++      elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
++    }
+   else if (info->noexecstack)
+-    elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
++    {
++      elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
++      elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
++    }
+   else
+     {
+       bfd *inputobj;
+       asection *notesec = NULL;
+       int exec = 0;
++      elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
+       for (inputobj = info->input_bfds;
+          inputobj;
+          inputobj = inputobj->link_next)
+@@ -5567,7 +5581,11 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
+         if (s)
+           {
+             if (s->flags & SEC_CODE)
+-              exec = PF_X;
++              {
++                elf_tdata (output_bfd)->pax_flags &= ~PF_NOEMUTRAMP;
++                elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
++                exec = PF_X;
++              }
+             notesec = s;
+           }
+         else if (bed->default_execstack)
+--- binutils-2.22/binutils/readelf.c
++++ binutils-2.22/binutils/readelf.c
+@@ -2740,6 +2740,7 @@ get_segment_type (unsigned long p_type)
+                       return "GNU_EH_FRAME";
+     case PT_GNU_STACK:        return "GNU_STACK";
+     case PT_GNU_RELRO:  return "GNU_RELRO";
++    case PT_PAX_FLAGS:  return "PAX_FLAGS";
+     default:
+       if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC))
+--- binutils-2.22/include/bfdlink.h
++++ binutils-2.22/include/bfdlink.h
+@@ -322,6 +322,14 @@ struct bfd_link_info
+   /* TRUE if PT_GNU_RELRO segment should be created.  */
+   unsigned int relro: 1;
++  /* TRUE if PT_PAX_FLAGS segment should be created with PF_NOMPROTECT
++     flags.  */
++  unsigned int execheap: 1;
++
++  /* TRUE if PT_PAX_FLAGS segment should be created with PF_MPROTECT
++     flags.  */
++  unsigned int noexecheap: 1;
++
+   /* TRUE if .eh_frame_hdr section and PT_GNU_EH_FRAME ELF segment
+      should be created.  */
+   unsigned int eh_frame_hdr: 1;
+--- binutils-2.22/include/elf/common.h
++++ binutils-2.22/include/elf/common.h
+@@ -429,6 +429,7 @@
+ #define PT_SUNW_EH_FRAME PT_GNU_EH_FRAME      /* Solaris uses the same value */
+ #define PT_GNU_STACK  (PT_LOOS + 0x474e551) /* Stack flags */
+ #define PT_GNU_RELRO  (PT_LOOS + 0x474e552) /* Read-only after relocation */
++#define PT_PAX_FLAGS  (PT_LOOS + 0x5041580) /* PaX flags */
+ /* Program segment permissions, in program header p_flags field.  */
+@@ -439,6 +440,21 @@
+ #define PF_MASKOS     0x0FF00000      /* New value, Oct 4, 1999 Draft */
+ #define PF_MASKPROC   0xF0000000      /* Processor-specific reserved bits */
++/* Flags to control PaX behavior.  */
++
++#define PF_PAGEEXEC   (1 << 4)        /* Enable  PAGEEXEC */
++#define PF_NOPAGEEXEC (1 << 5)        /* Disable PAGEEXEC */
++#define PF_SEGMEXEC   (1 << 6)        /* Enable  SEGMEXEC */
++#define PF_NOSEGMEXEC (1 << 7)        /* Disable SEGMEXEC */
++#define PF_MPROTECT   (1 << 8)        /* Enable  MPROTECT */
++#define PF_NOMPROTECT (1 << 9)        /* Disable MPROTECT */
++#define PF_RANDEXEC   (1 << 10)       /* Enable  RANDEXEC */
++#define PF_NORANDEXEC (1 << 11)       /* Disable RANDEXEC */
++#define PF_EMUTRAMP   (1 << 12)       /* Enable  EMUTRAMP */
++#define PF_NOEMUTRAMP (1 << 13)       /* Disable EMUTRAMP */
++#define PF_RANDMMAP   (1 << 14)       /* Enable  RANDMMAP */
++#define PF_NORANDMMAP (1 << 15)       /* Disable RANDMMAP */
++
+ /* Values for section header, sh_type field.  */
+ #define SHT_NULL      0               /* Section header table entry unused */
+--- binutils-2.22/ld/emultempl/elf32.em
++++ binutils-2.22/ld/emultempl/elf32.em
+@@ -2285,6 +2285,16 @@ fragment <<EOF
+         link_info.noexecstack = TRUE;
+         link_info.execstack = FALSE;
+       }
++      else if (strcmp (optarg, "execheap") == 0)
++      {
++        link_info.execheap = TRUE;
++        link_info.noexecheap = FALSE;
++      }
++      else if (strcmp (optarg, "noexecheap") == 0)
++      {
++        link_info.noexecheap = TRUE;
++        link_info.execheap = FALSE;
++      }
+ EOF
+ if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
+ fragment <<EOF
+@@ -2368,6 +2378,8 @@ fragment <<EOF
+   -z defs                     Report unresolved symbols in object files.\n"));
+   fprintf (file, _("\
+   -z execstack                Mark executable as requiring executable stack\n"));
++  fprintf (file, _("\
++  -z execheap                 Mark executable as requiring executable heap\n"));
+ EOF
+ if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
+@@ -2391,6 +2403,8 @@ fragment <<EOF
+ fragment <<EOF
+   fprintf (file, _("\
+   -z noexecstack              Mark executable as not requiring executable stack\n"));
++  fprintf (file, _("\
++  -z noexecheap               Mark executable as not requiring executable heap\n"));
+ EOF
+ if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
+ fragment <<EOF
+--- binutils-2.22/ld/ldgram.y
++++ binutils-2.22/ld/ldgram.y
+@@ -1119,6 +1119,8 @@ phdr_type:
+                           $$ = exp_intop (0x6474e550);
+                         else if (strcmp (s, "PT_GNU_STACK") == 0)
+                           $$ = exp_intop (0x6474e551);
++                        else if (strcmp (s, "PT_PAX_FLAGS") == 0)
++                          $$ = exp_intop (0x65041580);
+                         else
+                           {
+                             einfo (_("\
+--- binutils-2.22/ld/testsuite/ld-alpha/tlsbin.rd
++++ binutils-2.22/ld/testsuite/ld-alpha/tlsbin.rd
+@@ -35,13 +35,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
+ Program Headers:
+   Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
+-  PHDR +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+150 R E 0x8
++  PHDR +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+188 R E 0x8
+   INTERP +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x1
+ .*Requesting program interpreter.*
+   LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x10000
+   LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x10000
+   DYNAMIC +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RW +0x8
+   TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 3 entries:
+--- binutils-2.22/ld/testsuite/ld-alpha/tlsbinr.rd
++++ binutils-2.22/ld/testsuite/ld-alpha/tlsbinr.rd
+@@ -42,6 +42,7 @@ Program Headers:
+  +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x10000
+  +DYNAMIC +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RW +0x8
+  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 2 entries:
+--- binutils-2.22/ld/testsuite/ld-alpha/tlspic.rd
++++ binutils-2.22/ld/testsuite/ld-alpha/tlspic.rd
+@@ -38,6 +38,7 @@ Program Headers:
+  +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x10000
+  +DYNAMIC +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RW +0x8
+  +TLS +0x0+10e0 0x0+110e0 0x0+110e0 0x0+60 0x0+80 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 7 entries:
+--- binutils-2.22/ld/testsuite/ld-elf/eh1.d
++++ binutils-2.22/ld/testsuite/ld-elf/eh1.d
+@@ -22,11 +22,11 @@ Contents of the .eh_frame section:
+   DW_CFA_nop
+   DW_CFA_nop
+-00000018 0000001c 0000001c FDE cie=00000000 pc=00400078..00400078
+-  DW_CFA_advance_loc: 0 to 00400078
++00000018 0000001c 0000001c FDE cie=00000000 pc=([0-9a-f]+)..\1
++  DW_CFA_advance_loc: 0 to [0-9a-f]+
+   DW_CFA_def_cfa_offset: 16
+   DW_CFA_offset: r6 \(rbp\) at cfa-16
+-  DW_CFA_advance_loc: 0 to 00400078
++  DW_CFA_advance_loc: 0 to [0-9a-f]+
+   DW_CFA_def_cfa_register: r6 \(rbp\)
+ 00000038 ZERO terminator
+--- binutils-2.22/ld/testsuite/ld-elf/eh2.d
++++ binutils-2.22/ld/testsuite/ld-elf/eh2.d
+@@ -22,11 +22,11 @@ Contents of the .eh_frame section:
+   DW_CFA_nop
+   DW_CFA_nop
+-00000018 0000001c 0000001c FDE cie=00000000 pc=00400078..00400078
+-  DW_CFA_advance_loc: 0 to 00400078
++00000018 0000001c 0000001c FDE cie=00000000 pc=([0-9a-f]+)..\1
++  DW_CFA_advance_loc: 0 to [0-9a-f]+
+   DW_CFA_def_cfa_offset: 16
+   DW_CFA_offset: r6 \(rbp\) at cfa-16
+-  DW_CFA_advance_loc: 0 to 00400078
++  DW_CFA_advance_loc: 0 to [0-9a-f]+
+   DW_CFA_def_cfa_register: r6 \(rbp\)
+ 00000038 ZERO terminator
+--- binutils-2.22/ld/testsuite/ld-elf/eh3.d
++++ binutils-2.22/ld/testsuite/ld-elf/eh3.d
+@@ -22,11 +22,11 @@ Contents of the .eh_frame section:
+   DW_CFA_nop
+   DW_CFA_nop
+-00000018 0000001c 0000001c FDE cie=00000000 pc=00400078..00400078
+-  DW_CFA_advance_loc: 0 to 00400078
++00000018 0000001c 0000001c FDE cie=00000000 pc=([0-9a-f]+)..\1
++  DW_CFA_advance_loc: 0 to [0-9a-f]+
+   DW_CFA_def_cfa_offset: 16
+   DW_CFA_offset: r6 \(rbp\) at cfa-16
+-  DW_CFA_advance_loc: 0 to 00400078
++  DW_CFA_advance_loc: 0 to [0-9a-f]+
+   DW_CFA_def_cfa_register: r6 \(rbp\)
+ 00000038 ZERO terminator
+--- binutils-2.22/ld/testsuite/ld-elf/orphan-region.d
++++ binutils-2.22/ld/testsuite/ld-elf/orphan-region.d
+@@ -15,7 +15,9 @@
+ Program Headers:
+   Type.*
+   LOAD[ \t]+0x[0-9a-f]+ 0x0*40000000 0x0*40000000 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x[0-9a-f]+
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+   Segment Sections...
+    00     .text .rodata .moredata *
++   01 +
+--- binutils-2.22/ld/testsuite/ld-i386/tlsbin.rd
++++ binutils-2.22/ld/testsuite/ld-i386/tlsbin.rd
+@@ -44,6 +44,7 @@ Program Headers:
+  +LOAD.*
+  +DYNAMIC.*
+  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+60 0x0+a0 R +0x1000
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -53,6 +54,7 @@ Program Headers:
+  +03 +.tdata .dynamic .got .got.plt *
+  +04 +.dynamic *
+  +05 +.tdata .tbss *
++ +06 +
+ Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 9 entries:
+  Offset +Info +Type +Sym.Value +Sym. Name
+--- binutils-2.22/ld/testsuite/ld-i386/tlsbindesc.rd
++++ binutils-2.22/ld/testsuite/ld-i386/tlsbindesc.rd
+@@ -42,6 +42,7 @@ Program Headers:
+  +LOAD.*
+  +DYNAMIC.*
+  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+60 0x0+a0 R +0x1000
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -51,6 +52,7 @@ Program Headers:
+  +03 +.tdata .dynamic .got .got.plt *
+  +04 +.dynamic *
+  +05 +.tdata .tbss *
++ +06 +
+ Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 9 entries:
+  Offset +Info +Type +Sym.Value +Sym. Name
+--- binutils-2.22/ld/testsuite/ld-i386/tlsdesc.rd
++++ binutils-2.22/ld/testsuite/ld-i386/tlsdesc.rd
+@@ -39,6 +39,7 @@ Program Headers:
+  +LOAD.*
+  +DYNAMIC.*
+  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+60 0x0+80 R +0x1
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -46,6 +47,7 @@ Program Headers:
+  +01 +.tdata .dynamic .got .got.plt *
+  +02 +.dynamic *
+  +03 +.tdata .tbss *
++ +04 +
+ Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 20 entries:
+  Offset +Info +Type +Sym.Value +Sym. Name
+--- binutils-2.22/ld/testsuite/ld-i386/tlsdesc.sd
++++ binutils-2.22/ld/testsuite/ld-i386/tlsdesc.sd
+@@ -14,7 +14,7 @@ Contents of section \.got:
+  [0-9a-f]+ 6c000000 b4ffffff 4c000000 68000000  .*
+  [0-9a-f]+ 50000000 70000000 00000000 bcffffff  .*
+ Contents of section \.got\.plt:
+- [0-9a-f]+ b0150000 00000000 00000000 00000000  .*
++ [0-9a-f]+ [a-f]0150000 00000000 00000000 00000000  .*
+  [0-9a-f]+ 20000000 00000000 60000000 00000000  .*
+  [0-9a-f]+ 00000000 00000000 00000000 00000000  .*
+  [0-9a-f]+ 40000000 +.*
+--- binutils-2.22/ld/testsuite/ld-i386/tlsgdesc.rd
++++ binutils-2.22/ld/testsuite/ld-i386/tlsgdesc.rd
+@@ -36,12 +36,14 @@ Program Headers:
+  +LOAD.*
+  +LOAD.*
+  +DYNAMIC.*
++ +PAX_FLAGS.*
+  Section to Segment mapping:
+  +Segment Sections...
+  +00 +.hash .dynsym .dynstr .rel.dyn .rel.plt .plt .text *
+  +01 +.dynamic .got .got.plt *
+  +02 +.dynamic *
++ +03 +
+ Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 8 entries:
+  Offset +Info +Type +Sym.Value +Sym. Name
+--- binutils-2.22/ld/testsuite/ld-i386/tlsnopic.rd
++++ binutils-2.22/ld/testsuite/ld-i386/tlsnopic.rd
+@@ -37,6 +37,7 @@ Program Headers:
+  +LOAD.*
+  +DYNAMIC.*
+  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+ 0x0+24 R +0x1
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -44,6 +45,7 @@ Program Headers:
+  +01 +.dynamic .got .got.plt *
+  +02 +.dynamic *
+  +03 +.tbss *
++ +04 +
+ Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 20 entries:
+  Offset +Info +Type +Sym.Value +Sym. Name
+--- binutils-2.22/ld/testsuite/ld-i386/tlspic.rd
++++ binutils-2.22/ld/testsuite/ld-i386/tlspic.rd
+@@ -40,6 +40,7 @@ Program Headers:
+  +LOAD.*
+  +DYNAMIC.*
+  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+60 0x0+80 R +0x1
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -47,6 +48,7 @@ Program Headers:
+  +01 +.tdata .dynamic .got .got.plt *
+  +02 +.dynamic *
+  +03 +.tdata .tbss *
++ +04 +
+ Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 26 entries:
+  Offset +Info +Type +Sym.Value +Sym. Name
+--- binutils-2.22/ld/testsuite/ld-ia64/merge1.d
++++ binutils-2.22/ld/testsuite/ld-ia64/merge1.d
+@@ -4,7 +4,7 @@
+ #objdump: -d
+ #...
+-0+1e0 <.text>:
++[a-f0-9]+ <.text>:
+ [     ]*[a-f0-9]+:    0b 60 80 02 00 24       \[MMI\]       addl r12=32,r1;;
+ [     ]*[a-f0-9]+:    c0 c0 04 00 48 00                   addl r12=24,r1
+ [     ]*[a-f0-9]+:    00 00 04 00                         nop.i 0x0;;
+--- binutils-2.22/ld/testsuite/ld-ia64/merge2.d
++++ binutils-2.22/ld/testsuite/ld-ia64/merge2.d
+@@ -4,7 +4,7 @@
+ #objdump: -d
+ #...
+-0+1e0 <.text>:
++[a-f0-9]+ <.text>:
+ [     ]*[a-f0-9]+:    0b 60 80 02 00 24       \[MMI\]       addl r12=32,r1;;
+ [     ]*[a-f0-9]+:    c0 c0 04 00 48 00                   addl r12=24,r1
+ [     ]*[a-f0-9]+:    00 00 04 00                         nop.i 0x0;;
+--- binutils-2.22/ld/testsuite/ld-ia64/merge3.d
++++ binutils-2.22/ld/testsuite/ld-ia64/merge3.d
+@@ -4,7 +4,7 @@
+ #objdump: -d
+ #...
+-0+210 <.text>:
++[a-f0-9]+ <.text>:
+ [     ]*[a-f0-9]+:    0b 60 80 02 00 24       \[MMI\]       addl r12=32,r1;;
+ [     ]*[a-f0-9]+:    c0 40 05 00 48 00                   addl r12=40,r1
+ [     ]*[a-f0-9]+:    00 00 04 00                         nop.i 0x0;;
+--- binutils-2.22/ld/testsuite/ld-ia64/merge4.d
++++ binutils-2.22/ld/testsuite/ld-ia64/merge4.d
+@@ -4,7 +4,7 @@
+ #objdump: -d
+ #...
+-0+240 <.text>:
++[a-f0-9]+ <.text>:
+ [     ]*[a-f0-9]+:    0b 60 80 02 00 24       \[MMI\]       addl r12=32,r1;;
+ [     ]*[a-f0-9]+:    c0 40 05 00 48 00                   addl r12=40,r1
+ [     ]*[a-f0-9]+:    00 00 04 00                         nop.i 0x0;;
+--- binutils-2.22/ld/testsuite/ld-ia64/merge5.d
++++ binutils-2.22/ld/testsuite/ld-ia64/merge5.d
+@@ -4,7 +4,7 @@
+ #objdump: -d
+ #...
+-0+270 <.text>:
++[a-f0-9]+ <.text>:
+ [     ]*[a-f0-9]+:    0b 60 80 02 00 24       \[MMI\]       addl r12=32,r1;;
+ [     ]*[a-f0-9]+:    c0 40 05 00 48 00                   addl r12=40,r1
+ [     ]*[a-f0-9]+:    00 00 04 00                         nop.i 0x0;;
+--- binutils-2.22/ld/testsuite/ld-ia64/tlsbin.rd
++++ binutils-2.22/ld/testsuite/ld-ia64/tlsbin.rd
+@@ -36,13 +36,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
+ Program Headers:
+  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
+- +PHDR +0x0+40 0x40+40 0x40+40 0x0+188 0x0+188 R E 0x8
+- +INTERP +0x0+1c8 0x40+1c8 0x40+1c8 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x1
++ +PHDR +0x0+40 0x40+40 0x40+40 (0x[0-9a-f]+) \1 R E 0x8
++ +INTERP +0x0+([0-9a-f]+) (0x40+\1) \2 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x1
+ .*Requesting program interpreter.*
+  +LOAD +0x0+ 0x40+ 0x40+ 0x0+1[0-9a-f]+ 0x0+1[0-9a-f]+ R E 0x10000
+  +LOAD +0x0+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x0+0[0-9a-f]+ 0x0+0[0-9a-f]+ RW +0x10000
+  +DYNAMIC +0x0+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x0+150 0x0+150 RW +0x8
+  +TLS +0x0+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x0+60 0x0+a0 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  +IA_64_UNWIND .* R +0x8
+ #...
+--- binutils-2.22/ld/testsuite/ld-ia64/tlspic.rd
++++ binutils-2.22/ld/testsuite/ld-ia64/tlspic.rd
+@@ -40,6 +40,7 @@ Program Headers:
+  +LOAD +0x0+1[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+0[0-9a-f]+ 0x0+0[0-9a-f]+ RW +0x10000
+  +DYNAMIC +0x0+1[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+140 0x0+140 RW +0x8
+  +TLS +0x0+1[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+60 0x0+80 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  +IA_64_UNWIND +0x0+1[0-9a-f]+ 0x0+1[0-9a-f]+ 0x0+1[0-9a-f]+ 0x0+18 0x0+18 R +0x8
+ #...
+--- binutils-2.22/ld/testsuite/ld-mips-elf/multi-got-no-shared.d
++++ binutils-2.22/ld/testsuite/ld-mips-elf/multi-got-no-shared.d
+@@ -8,9 +8,9 @@
+ .*: +file format.*
+ Disassembly of section \.text:
+-004000b0 <[^>]*> 3c1c0043     lui     gp,0x43
+-004000b4 <[^>]*> 279c9ff0     addiu   gp,gp,-24592
+-004000b8 <[^>]*> afbc0008     sw      gp,8\(sp\)
++004000d0 <[^>]*> 3c1c0043     lui     gp,0x43
++004000d4 <[^>]*> 279c9ff0     addiu   gp,gp,-24592
++004000d8 <[^>]*> afbc0008     sw      gp,8\(sp\)
+ #...
+ 00408d60 <[^>]*> 3c1c0043     lui     gp,0x43
+ 00408d64 <[^>]*> 279c2c98     addiu   gp,gp,11416
+--- binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.sd
++++ binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.sd
+@@ -1,7 +1,7 @@
+ Elf file type is DYN \(Shared object file\)
+ Entry point .*
+-There are 5 program headers, starting at offset .*
++There are [0-9] program headers, starting at offset .*
+ Program Headers:
+  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
+@@ -9,6 +9,7 @@ Program Headers:
+  * LOAD * [^ ]+ * 0x0+00000 * 0x0+00000 [^ ]+ * [^ ]+ * R E * 0x.*
+  * LOAD * [^ ]+ * 0x0+10000 * 0x0+10000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * DYNAMIC * [^ ]+ * 0x0+00400 * 0x0+00400 .*
++ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  * NULL * .*
+  *Section to Segment mapping:
+@@ -18,3 +19,4 @@ Program Headers:
+  *0*2 * \.data \.got *
+  *0*3 * \.dynamic *
+  *0*4 *
++ *0*5 *
+--- binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-3b.sd
++++ binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-3b.sd
+@@ -1,7 +1,7 @@
+ Elf file type is EXEC \(Executable file\)
+ Entry point 0x44000
+-There are 8 program headers, starting at offset .*
++There are [0-9] program headers, starting at offset .*
+ Program Headers:
+  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
+@@ -13,6 +13,7 @@ Program Headers:
+  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
++ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  * NULL * .*
+  *Section to Segment mapping:
+@@ -25,3 +26,4 @@ Program Headers:
+  *0*5 *\.got \.data *
+  *0*6 *\.dynamic *
+  *0*7 *
++ *0*8 *
+--- binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-4b.sd
++++ binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-4b.sd
+@@ -1,7 +1,7 @@
+ Elf file type is EXEC \(Executable file\)
+ Entry point 0x44000
+-There are 8 program headers, starting at offset .*
++There are [0-9] program headers, starting at offset .*
+ Program Headers:
+  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
+@@ -13,6 +13,7 @@ Program Headers:
+  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
++ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  * NULL * .*
+  *Section to Segment mapping:
+@@ -25,3 +26,4 @@ Program Headers:
+  *0*5 * \.got \.data \.bss *
+  *0*6 * \.dynamic *
+  *0*7 *
++ *0*8 *
+--- binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-5b.sd
++++ binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-5b.sd
+@@ -1,7 +1,7 @@
+ Elf file type is EXEC \(Executable file\)
+ Entry point 0x44000
+-There are 8 program headers, starting at offset .*
++There are [0-9] program headers, starting at offset .*
+ Program Headers:
+  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
+@@ -13,6 +13,7 @@ Program Headers:
+  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
++ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  * NULL * .*
+  *Section to Segment mapping:
+@@ -25,3 +26,4 @@ Program Headers:
+  *0*5 * \.got \.data \.bss *
+  *0*6 * \.dynamic *
+  *0*7 *
++ *0*8 *
+--- binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n32.sd
++++ binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n32.sd
+@@ -1,7 +1,7 @@
+ Elf file type is EXEC \(Executable file\)
+ Entry point 0x44000
+-There are 8 program headers, starting at offset .*
++There are [0-9] program headers, starting at offset .*
+ Program Headers:
+  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
+@@ -13,6 +13,7 @@ Program Headers:
+  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
++ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  * NULL * .*
+  *Section to Segment mapping:
+@@ -25,3 +26,4 @@ Program Headers:
+  *0*5 * \.got \.data \.bss *
+  *0*6 * \.dynamic *
+  *0*7 *
++ *0*8 *
+--- binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n64.sd
++++ binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n64.sd
+@@ -1,7 +1,7 @@
+ Elf file type is EXEC \(Executable file\)
+ Entry point 0x44000
+-There are 7 program headers, starting at offset .*
++There are [0-9] program headers, starting at offset .*
+ Program Headers:
+  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
+@@ -12,6 +12,7 @@ Program Headers:
+  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
++ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  * NULL * .*
+  *Section to Segment mapping:
+@@ -23,3 +24,4 @@ Program Headers:
+  *0*4 * \.got \.data \.bss *
+  *0*5 * \.dynamic *
+  *0*6 *
++ *0*7 *
+--- binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-o32.sd
++++ binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-o32.sd
+@@ -1,7 +1,7 @@
+ Elf file type is EXEC \(Executable file\)
+ Entry point 0x44000
+-There are 8 program headers, starting at offset .*
++There are [0-9] program headers, starting at offset .*
+ Program Headers:
+  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
+@@ -13,6 +13,7 @@ Program Headers:
+  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
++ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  * NULL * .*
+  *Section to Segment mapping:
+@@ -25,3 +26,4 @@ Program Headers:
+  *0*5 * \.got \.data \.bss *
+  *0*6 * \.dynamic *
+  *0*7 *
++ *0*8 *
+--- binutils-2.22/ld/testsuite/ld-mips-elf/rel32-n32.d
++++ binutils-2.22/ld/testsuite/ld-mips-elf/rel32-n32.d
+@@ -10,6 +10,6 @@ Relocation section '.rel.dyn' at offset .* contains 2 entries:
+ [0-9a-f ]+R_MIPS_REL32     
+ Hex dump of section '.text':
+-  0x000002e0 00000000 00000000 00000000 00000000 ................
+-  0x000002f0 000002f0 00000000 00000000 00000000 ................
+   0x00000300 00000000 00000000 00000000 00000000 ................
++  0x00000310 00000310 00000000 00000000 00000000 ................
++  0x00000320 00000000 00000000 00000000 00000000 ................
+--- binutils-2.22/ld/testsuite/ld-mips-elf/rel32-o32.d
++++ binutils-2.22/ld/testsuite/ld-mips-elf/rel32-o32.d
+@@ -10,6 +10,6 @@ Relocation section '.rel.dyn' at offset .* contains 2 entries:
+ [0-9a-f ]+R_MIPS_REL32     
+ Hex dump of section '.text':
+-  0x000002e0 00000000 00000000 00000000 00000000 ................
+-  0x000002f0 000002f0 00000000 00000000 00000000 ................
+   0x00000300 00000000 00000000 00000000 00000000 ................
++  0x00000310 00000310 00000000 00000000 00000000 ................
++  0x00000320 00000000 00000000 00000000 00000000 ................
+--- binutils-2.22/ld/testsuite/ld-mips-elf/rel64.d
++++ binutils-2.22/ld/testsuite/ld-mips-elf/rel64.d
+@@ -14,6 +14,6 @@ Relocation section '.rel.dyn' at offset .* contains 2 entries:
+  +Type3: R_MIPS_NONE      
+ Hex dump of section '.text':
+-  0x00000450 00000000 00000000 00000000 00000000 ................
+-  0x00000460 00000000 00000460 00000000 00000000 ................
+-  0x00000470 00000000 00000000 00000000 00000000 ................
++  0x00000490 00000000 00000000 00000000 00000000 ................
++  0x000004a0 00000000 000004a0 00000000 00000000 ................
++  0x000004b0 00000000 00000000 00000000 00000000 ................
+--- binutils-2.22/ld/testsuite/ld-mips-elf/tlsbin-o32.d
++++ binutils-2.22/ld/testsuite/ld-mips-elf/tlsbin-o32.d
+@@ -2,42 +2,42 @@
+ Disassembly of section .text:
+-004000d0 <__start>:
+-  4000d0:     3c1c0fc0        lui     gp,0xfc0
+-  4000d4:     279c7f30        addiu   gp,gp,32560
+-  4000d8:     0399e021        addu    gp,gp,t9
+-  4000dc:     27bdfff0        addiu   sp,sp,-16
+-  4000e0:     afbe0008        sw      s8,8\(sp\)
+-  4000e4:     03a0f021        move    s8,sp
+-  4000e8:     afbc0000        sw      gp,0\(sp\)
+-  4000ec:     8f998018        lw      t9,-32744\(gp\)
+-  4000f0:     27848028        addiu   a0,gp,-32728
+-  4000f4:     0320f809        jalr    t9
+-  4000f8:     00000000        nop
+-  4000fc:     8fdc0000        lw      gp,0\(s8\)
+-  400100:     00000000        nop
+-  400104:     8f998018        lw      t9,-32744\(gp\)
+-  400108:     27848020        addiu   a0,gp,-32736
+-  40010c:     0320f809        jalr    t9
+-  400110:     00000000        nop
+-  400114:     8fdc0000        lw      gp,0\(s8\)
+-  400118:     00401021        move    v0,v0
+-  40011c:     3c030000        lui     v1,0x0
+-  400120:     24638000        addiu   v1,v1,-32768
+-  400124:     00621821        addu    v1,v1,v0
+-  400128:     7c02283b        rdhwr   v0,\$5
+-  40012c:     8f83801c        lw      v1,-32740\(gp\)
+-  400130:     00000000        nop
+-  400134:     00621821        addu    v1,v1,v0
+-  400138:     7c02283b        rdhwr   v0,\$5
+-  40013c:     3c030000        lui     v1,0x0
+-  400140:     24639004        addiu   v1,v1,-28668
+-  400144:     00621821        addu    v1,v1,v0
+-  400148:     03c0e821        move    sp,s8
+-  40014c:     8fbe0008        lw      s8,8\(sp\)
+-  400150:     03e00008        jr      ra
+-  400154:     27bd0010        addiu   sp,sp,16
++00400[0-9a-f]{3} <__start>:
++  400[0-9a-f]{3}:     3c1c0fc0        lui     gp,0xfc0
++  400[0-9a-f]{3}:     279c7f30        addiu   gp,gp,32560
++  400[0-9a-f]{3}:     0399e021        addu    gp,gp,t9
++  400[0-9a-f]{3}:     27bdfff0        addiu   sp,sp,-16
++  400[0-9a-f]{3}:     afbe0008        sw      s8,8\(sp\)
++  400[0-9a-f]{3}:     03a0f021        move    s8,sp
++  400[0-9a-f]{3}:     afbc0000        sw      gp,0\(sp\)
++  400[0-9a-f]{3}:     8f998018        lw      t9,-32744\(gp\)
++  400[0-9a-f]{3}:     27848028        addiu   a0,gp,-32728
++  400[0-9a-f]{3}:     0320f809        jalr    t9
++  400[0-9a-f]{3}:     00000000        nop
++  400[0-9a-f]{3}:     8fdc0000        lw      gp,0\(s8\)
++  400[0-9a-f]{3}:     00000000        nop
++  400[0-9a-f]{3}:     8f998018        lw      t9,-32744\(gp\)
++  400[0-9a-f]{3}:     27848020        addiu   a0,gp,-32736
++  400[0-9a-f]{3}:     0320f809        jalr    t9
++  400[0-9a-f]{3}:     00000000        nop
++  400[0-9a-f]{3}:     8fdc0000        lw      gp,0\(s8\)
++  400[0-9a-f]{3}:     00401021        move    v0,v0
++  400[0-9a-f]{3}:     3c030000        lui     v1,0x0
++  400[0-9a-f]{3}:     24638000        addiu   v1,v1,-32768
++  400[0-9a-f]{3}:     00621821        addu    v1,v1,v0
++  400[0-9a-f]{3}:     7c02283b        rdhwr   v0,\$5
++  400[0-9a-f]{3}:     8f83801c        lw      v1,-32740\(gp\)
++  400[0-9a-f]{3}:     00000000        nop
++  400[0-9a-f]{3}:     00621821        addu    v1,v1,v0
++  400[0-9a-f]{3}:     7c02283b        rdhwr   v0,\$5
++  400[0-9a-f]{3}:     3c030000        lui     v1,0x0
++  400[0-9a-f]{3}:     24639004        addiu   v1,v1,-28668
++  400[0-9a-f]{3}:     00621821        addu    v1,v1,v0
++  400[0-9a-f]{3}:     03c0e821        move    sp,s8
++  400[0-9a-f]{3}:     8fbe0008        lw      s8,8\(sp\)
++  400[0-9a-f]{3}:     03e00008        jr      ra
++  400[0-9a-f]{3}:     27bd0010        addiu   sp,sp,16
+-00400158 <__tls_get_addr>:
+-  400158:     03e00008        jr      ra
+-  40015c:     00000000        nop
++00400[0-9a-f]{3} <__tls_get_addr>:
++  400[0-9a-f]{3}:     03e00008        jr      ra
++  400[0-9a-f]{3}:     00000000        nop
+--- binutils-2.22/ld/testsuite/ld-powerpc/tls.d
++++ binutils-2.22/ld/testsuite/ld-powerpc/tls.d
+@@ -9,45 +9,45 @@
+ Disassembly of section \.text:
+-0+100000e8 <_start>:
+-    100000e8: 3c 6d 00 00     addis   r3,r13,0
+-    100000ec: 60 00 00 00     nop
+-    100000f0: 38 63 90 78     addi    r3,r3,-28552
+-    100000f4: 3c 6d 00 00     addis   r3,r13,0
+-    100000f8: 60 00 00 00     nop
+-    100000fc: 38 63 10 00     addi    r3,r3,4096
+-    10000100: 3c 6d 00 00     addis   r3,r13,0
+-    10000104: 60 00 00 00     nop
+-    10000108: 38 63 90 40     addi    r3,r3,-28608
+-    1000010c: 3c 6d 00 00     addis   r3,r13,0
+-    10000110: 60 00 00 00     nop
+-    10000114: 38 63 10 00     addi    r3,r3,4096
+-    10000118: 39 23 80 48     addi    r9,r3,-32696
+-    1000011c: 3d 23 00 00     addis   r9,r3,0
+-    10000120: 81 49 80 50     lwz     r10,-32688\(r9\)
+-    10000124: e9 22 80 10     ld      r9,-32752\(r2\)
+-    10000128: 7d 49 18 2a     ldx     r10,r9,r3
+-    1000012c: 3d 2d 00 00     addis   r9,r13,0
+-    10000130: a1 49 90 60     lhz     r10,-28576\(r9\)
+-    10000134: 89 4d 90 68     lbz     r10,-28568\(r13\)
+-    10000138: 3d 2d 00 00     addis   r9,r13,0
+-    1000013c: 99 49 90 70     stb     r10,-28560\(r9\)
+-    10000140: 3c 6d 00 00     addis   r3,r13,0
+-    10000144: 60 00 00 00     nop
+-    10000148: 38 63 90 00     addi    r3,r3,-28672
+-    1000014c: 3c 6d 00 00     addis   r3,r13,0
+-    10000150: 60 00 00 00     nop
+-    10000154: 38 63 10 00     addi    r3,r3,4096
+-    10000158: f9 43 80 08     std     r10,-32760\(r3\)
+-    1000015c: 3d 23 00 00     addis   r9,r3,0
+-    10000160: 91 49 80 10     stw     r10,-32752\(r9\)
+-    10000164: e9 22 80 08     ld      r9,-32760\(r2\)
+-    10000168: 7d 49 19 2a     stdx    r10,r9,r3
+-    1000016c: 3d 2d 00 00     addis   r9,r13,0
+-    10000170: b1 49 90 60     sth     r10,-28576\(r9\)
+-    10000174: e9 4d 90 2a     lwa     r10,-28632\(r13\)
+-    10000178: 3d 2d 00 00     addis   r9,r13,0
+-    1000017c: a9 49 90 30     lha     r10,-28624\(r9\)
++0+10000[0-9a-f]{3} <_start>:
++    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
++    10000[0-9a-f]{3}: 60 00 00 00     nop
++    10000[0-9a-f]{3}: 38 63 90 78     addi    r3,r3,-28552
++    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
++    10000[0-9a-f]{3}: 60 00 00 00     nop
++    10000[0-9a-f]{3}: 38 63 10 00     addi    r3,r3,4096
++    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
++    10000[0-9a-f]{3}: 60 00 00 00     nop
++    10000[0-9a-f]{3}: 38 63 90 40     addi    r3,r3,-28608
++    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
++    10000[0-9a-f]{3}: 60 00 00 00     nop
++    10000[0-9a-f]{3}: 38 63 10 00     addi    r3,r3,4096
++    10000[0-9a-f]{3}: 39 23 80 48     addi    r9,r3,-32696
++    10000[0-9a-f]{3}: 3d 23 00 00     addis   r9,r3,0
++    10000[0-9a-f]{3}: 81 49 80 50     lwz     r10,-32688\(r9\)
++    10000[0-9a-f]{3}: e9 22 80 10     ld      r9,-32752\(r2\)
++    10000[0-9a-f]{3}: 7d 49 18 2a     ldx     r10,r9,r3
++    10000[0-9a-f]{3}: 3d 2d 00 00     addis   r9,r13,0
++    10000[0-9a-f]{3}: a1 49 90 60     lhz     r10,-28576\(r9\)
++    10000[0-9a-f]{3}: 89 4d 90 68     lbz     r10,-28568\(r13\)
++    10000[0-9a-f]{3}: 3d 2d 00 00     addis   r9,r13,0
++    10000[0-9a-f]{3}: 99 49 90 70     stb     r10,-28560\(r9\)
++    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
++    10000[0-9a-f]{3}: 60 00 00 00     nop
++    10000[0-9a-f]{3}: 38 63 90 00     addi    r3,r3,-28672
++    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
++    10000[0-9a-f]{3}: 60 00 00 00     nop
++    10000[0-9a-f]{3}: 38 63 10 00     addi    r3,r3,4096
++    10000[0-9a-f]{3}: f9 43 80 08     std     r10,-32760\(r3\)
++    10000[0-9a-f]{3}: 3d 23 00 00     addis   r9,r3,0
++    10000[0-9a-f]{3}: 91 49 80 10     stw     r10,-32752\(r9\)
++    10000[0-9a-f]{3}: e9 22 80 08     ld      r9,-32760\(r2\)
++    10000[0-9a-f]{3}: 7d 49 19 2a     stdx    r10,r9,r3
++    10000[0-9a-f]{3}: 3d 2d 00 00     addis   r9,r13,0
++    10000[0-9a-f]{3}: b1 49 90 60     sth     r10,-28576\(r9\)
++    10000[0-9a-f]{3}: e9 4d 90 2a     lwa     r10,-28632\(r13\)
++    10000[0-9a-f]{3}: 3d 2d 00 00     addis   r9,r13,0
++    10000[0-9a-f]{3}: a9 49 90 30     lha     r10,-28624\(r9\)
+-0+10000180 <\.__tls_get_addr>:
+-    10000180: 4e 80 00 20     blr
++0+10000[0-9a-f]{3} <\.__tls_get_addr>:
++    10000[0-9a-f]{3}: 4e 80 00 20     blr
+--- binutils-2.22/ld/testsuite/ld-powerpc/tls.g
++++ binutils-2.22/ld/testsuite/ld-powerpc/tls.g
+@@ -8,5 +8,5 @@
+ .*: +file format elf64-powerpc
+ Contents of section \.got:
+- 100101e0 00000000 100181e0 ffffffff ffff8018  .*
+- 100101f0 ffffffff ffff8058                    .*
++ 10010([0-9a-f]{3}) 00000000 10018\1 ffffffff ffff8018  .*
++ 10010[0-9a-f]{3} ffffffff ffff8058                    .*
+--- binutils-2.22/ld/testsuite/ld-powerpc/tls32.d
++++ binutils-2.22/ld/testsuite/ld-powerpc/tls32.d
+@@ -9,42 +9,42 @@
+ Disassembly of section \.text:
+-0+1800094 <_start>:
+- 1800094:     3c 62 00 00     addis   r3,r2,0
+- 1800098:     38 63 90 3c     addi    r3,r3,-28612
+- 180009c:     3c 62 00 00     addis   r3,r2,0
+- 18000a0:     38 63 10 00     addi    r3,r3,4096
+- 18000a4:     3c 62 00 00     addis   r3,r2,0
+- 18000a8:     38 63 90 20     addi    r3,r3,-28640
+- 18000ac:     3c 62 00 00     addis   r3,r2,0
+- 18000b0:     38 63 10 00     addi    r3,r3,4096
+- 18000b4:     39 23 80 24     addi    r9,r3,-32732
+- 18000b8:     3d 23 00 00     addis   r9,r3,0
+- 18000bc:     81 49 80 28     lwz     r10,-32728\(r9\)
+- 18000c0:     3d 22 00 00     addis   r9,r2,0
+- 18000c4:     a1 49 90 30     lhz     r10,-28624\(r9\)
+- 18000c8:     89 42 90 34     lbz     r10,-28620\(r2\)
+- 18000cc:     3d 22 00 00     addis   r9,r2,0
+- 18000d0:     99 49 90 38     stb     r10,-28616\(r9\)
+- 18000d4:     3c 62 00 00     addis   r3,r2,0
+- 18000d8:     38 63 90 00     addi    r3,r3,-28672
+- 18000dc:     3c 62 00 00     addis   r3,r2,0
+- 18000e0:     38 63 10 00     addi    r3,r3,4096
+- 18000e4:     91 43 80 04     stw     r10,-32764\(r3\)
+- 18000e8:     3d 23 00 00     addis   r9,r3,0
+- 18000ec:     91 49 80 08     stw     r10,-32760\(r9\)
+- 18000f0:     3d 22 00 00     addis   r9,r2,0
+- 18000f4:     b1 49 90 30     sth     r10,-28624\(r9\)
+- 18000f8:     a1 42 90 14     lhz     r10,-28652\(r2\)
+- 18000fc:     3d 22 00 00     addis   r9,r2,0
+- 1800100:     a9 49 90 18     lha     r10,-28648\(r9\)
++0+1800[0-9a-f]{3} <_start>:
++ 1800[0-9a-f]{3}:     3c 62 00 00     addis   r3,r2,0
++ 1800[0-9a-f]{3}:     38 63 90 3c     addi    r3,r3,-28612
++ 1800[0-9a-f]{3}:     3c 62 00 00     addis   r3,r2,0
++ 1800[0-9a-f]{3}:     38 63 10 00     addi    r3,r3,4096
++ 1800[0-9a-f]{3}:     3c 62 00 00     addis   r3,r2,0
++ 1800[0-9a-f]{3}:     38 63 90 20     addi    r3,r3,-28640
++ 1800[0-9a-f]{3}:     3c 62 00 00     addis   r3,r2,0
++ 1800[0-9a-f]{3}:     38 63 10 00     addi    r3,r3,4096
++ 1800[0-9a-f]{3}:     39 23 80 24     addi    r9,r3,-32732
++ 1800[0-9a-f]{3}:     3d 23 00 00     addis   r9,r3,0
++ 1800[0-9a-f]{3}:     81 49 80 28     lwz     r10,-32728\(r9\)
++ 1800[0-9a-f]{3}:     3d 22 00 00     addis   r9,r2,0
++ 1800[0-9a-f]{3}:     a1 49 90 30     lhz     r10,-28624\(r9\)
++ 1800[0-9a-f]{3}:     89 42 90 34     lbz     r10,-28620\(r2\)
++ 1800[0-9a-f]{3}:     3d 22 00 00     addis   r9,r2,0
++ 1800[0-9a-f]{3}:     99 49 90 38     stb     r10,-28616\(r9\)
++ 1800[0-9a-f]{3}:     3c 62 00 00     addis   r3,r2,0
++ 1800[0-9a-f]{3}:     38 63 90 00     addi    r3,r3,-28672
++ 1800[0-9a-f]{3}:     3c 62 00 00     addis   r3,r2,0
++ 1800[0-9a-f]{3}:     38 63 10 00     addi    r3,r3,4096
++ 1800[0-9a-f]{3}:     91 43 80 04     stw     r10,-32764\(r3\)
++ 1800[0-9a-f]{3}:     3d 23 00 00     addis   r9,r3,0
++ 1800[0-9a-f]{3}:     91 49 80 08     stw     r10,-32760\(r9\)
++ 1800[0-9a-f]{3}:     3d 22 00 00     addis   r9,r2,0
++ 1800[0-9a-f]{3}:     b1 49 90 30     sth     r10,-28624\(r9\)
++ 1800[0-9a-f]{3}:     a1 42 90 14     lhz     r10,-28652\(r2\)
++ 1800[0-9a-f]{3}:     3d 22 00 00     addis   r9,r2,0
++ 1800[0-9a-f]{3}:     a9 49 90 18     lha     r10,-28648\(r9\)
+-0+1800104 <__tls_get_addr>:
+- 1800104:     4e 80 00 20     blr
++0+1800[0-9a-f]{3} <__tls_get_addr>:
++ 1800[0-9a-f]{3}:     4e 80 00 20     blr
+ Disassembly of section \.got:
+-0+1810128 <_GLOBAL_OFFSET_TABLE_-0x4>:
+- 1810128:     4e 80 00 21     blrl
++0+1810[0-9a-f]{3} <_GLOBAL_OFFSET_TABLE_-0x4>:
++ 1810[0-9a-f]{3}:     4e 80 00 21     blrl
+-0+181012c <_GLOBAL_OFFSET_TABLE_>:
++0+1810[0-9a-f]{3} <_GLOBAL_OFFSET_TABLE_>:
+       \.\.\.
+--- binutils-2.22/ld/testsuite/ld-powerpc/tls32.g
++++ binutils-2.22/ld/testsuite/ld-powerpc/tls32.g
+@@ -8,4 +8,4 @@
+ .*: +file format elf32-powerpc
+ Contents of section \.got:
+- 1810128 4e800021 00000000 00000000 00000000  .*
++ 18101[0-9a-f]{2} 4e800021 00000000 00000000 00000000  .*
+--- binutils-2.22/ld/testsuite/ld-powerpc/tls32.t
++++ binutils-2.22/ld/testsuite/ld-powerpc/tls32.t
+@@ -8,5 +8,5 @@
+ .*: +file format elf32-powerpc
+ Contents of section \.tdata:
+- 1810108 12345678 23456789 3456789a 456789ab  .*
+- 1810118 56789abc 6789abcd 789abcde 00c0ffee  .*
++ 18101[0-9a-f]{2} 12345678 23456789 3456789a 456789ab  .*
++ 18101[0-9a-f]{2} 56789abc 6789abcd 789abcde 00c0ffee  .*
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlsexe32.d
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlsexe32.d
+@@ -44,4 +44,4 @@ Disassembly of section \.got:
+ .*:   4e 80 00 21     blrl
+ .* <_GLOBAL_OFFSET_TABLE_>:
+-.*:   01 81 02 b8 00 00 00 00 00 00 00 00  .*
++.*:   01 81 02 [bd]8 00 00 00 00 00 00 00 00  .*
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlsexe32.g
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlsexe32.g
+@@ -8,4 +8,4 @@
+ Contents of section \.got:
+ .* 00000000 00000000 00000000 4e800021  .*
+-.* 018102b8 00000000 00000000           .*
++.* 018102[bd]8 00000000 00000000           .*
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlsexe32.r
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlsexe32.r
+@@ -33,13 +33,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
+ Program Headers:
+  +Type +Offset +VirtAddr +PhysAddr +FileSiz MemSiz +Flg Align
+- +PHDR +0x000034 0x01800034 0x01800034 0x000c0 0x000c0 R E 0x4
+- +INTERP +0x0000f4 0x018000f4 0x018000f4 0x00011 0x00011 R +0x1
++ +PHDR +0x000034 0x01800034 0x01800034 (0x000[0-9a-f]{2}) \1 R E 0x4
++ +INTERP +0x000([0-9a-f]{3}) 0x01800\1 0x01800\1 0x00011 0x00011 R +0x1
+  +\[Requesting program interpreter: .*\]
+  +LOAD .* R E 0x10000
+  +LOAD .* RWE 0x10000
+  +DYNAMIC .* RW +0x4
+  +TLS .* 0x0001c 0x00038 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections\.\.\.
+@@ -49,6 +50,7 @@ Program Headers:
+  +03 +\.tdata \.dynamic \.got \.plt 
+  +04 +\.dynamic 
+  +05 +\.tdata \.tbss 
++ +06 +
+ Relocation section '\.rela\.dyn' at offset .* contains 2 entries:
+  Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlsmark.d
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlsmark.d
+@@ -9,29 +9,29 @@
+ Disassembly of section \.text:
+-0+100000e8 <_start>:
+-    100000e8: 48 00 00 18     b       10000100 <_start\+0x18>
+-    100000ec: 60 00 00 00     nop
+-    100000f0: 38 63 90 00     addi    r3,r3,-28672
+-    100000f4: e8 83 00 00     ld      r4,0\(r3\)
+-    100000f8: 3c 6d 00 00     addis   r3,r13,0
+-    100000fc: 48 00 00 0c     b       10000108 <_start\+0x20>
+-    10000100: 3c 6d 00 00     addis   r3,r13,0
+-    10000104: 4b ff ff e8     b       100000ec <_start\+0x4>
+-    10000108: 60 00 00 00     nop
+-    1000010c: 38 63 10 00     addi    r3,r3,4096
+-    10000110: e8 83 80 00     ld      r4,-32768\(r3\)
+-    10000114: 3c 6d 00 00     addis   r3,r13,0
+-    10000118: 48 00 00 0c     b       10000124 <_start\+0x3c>
+-    1000011c: 3c 6d 00 00     addis   r3,r13,0
+-    10000120: 48 00 00 14     b       10000134 <_start\+0x4c>
+-    10000124: 60 00 00 00     nop
+-    10000128: 38 63 90 04     addi    r3,r3,-28668
+-    1000012c: e8 a3 00 00     ld      r5,0\(r3\)
+-    10000130: 4b ff ff ec     b       1000011c <_start\+0x34>
+-    10000134: 60 00 00 00     nop
+-    10000138: 38 63 10 00     addi    r3,r3,4096
+-    1000013c: e8 a3 80 04     ld      r5,-32764\(r3\)
++0+10000[0-9a-f]{3} <_start>:
++    10000[0-9a-f]{3}: 48 00 00 18     b       10000[0-9a-f]{3} <_start\+0x18>
++    10000[0-9a-f]{3}: 60 00 00 00     nop
++    10000[0-9a-f]{3}: 38 63 90 00     addi    r3,r3,-28672
++    10000[0-9a-f]{3}: e8 83 00 00     ld      r4,0\(r3\)
++    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
++    10000[0-9a-f]{3}: 48 00 00 0c     b       10000[0-9a-f]{3} <_start\+0x20>
++    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
++    10000[0-9a-f]{3}: 4b ff ff e8     b       10000[0-9a-f]{3} <_start\+0x4>
++    10000[0-9a-f]{3}: 60 00 00 00     nop
++    10000[0-9a-f]{3}: 38 63 10 00     addi    r3,r3,4096
++    10000[0-9a-f]{3}: e8 83 80 00     ld      r4,-32768\(r3\)
++    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
++    10000[0-9a-f]{3}: 48 00 00 0c     b       10000[0-9a-f]{3} <_start\+0x3c>
++    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
++    10000[0-9a-f]{3}: 48 00 00 14     b       10000[0-9a-f]{3} <_start\+0x4c>
++    10000[0-9a-f]{3}: 60 00 00 00     nop
++    10000[0-9a-f]{3}: 38 63 90 04     addi    r3,r3,-28668
++    10000[0-9a-f]{3}: e8 a3 00 00     ld      r5,0\(r3\)
++    10000[0-9a-f]{3}: 4b ff ff ec     b       10000[0-9a-f]{3} <_start\+0x34>
++    10000[0-9a-f]{3}: 60 00 00 00     nop
++    10000[0-9a-f]{3}: 38 63 10 00     addi    r3,r3,4096
++    10000[0-9a-f]{3}: e8 a3 80 04     ld      r5,-32764\(r3\)
+-0+10000140 <\.__tls_get_addr>:
+-    10000140: 4e 80 00 20     blr
++0+10000[0-9a-f]{3} <\.__tls_get_addr>:
++    10000[0-9a-f]{3}: 4e 80 00 20     blr
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlsmark32.d
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlsmark32.d
+@@ -9,17 +9,17 @@
+ Disassembly of section \.text:
+-0+1800094 <_start>:
+- 1800094:     48 00 00 14     b       18000a8 <_start\+0x14>
+- 1800098:     38 63 90 00     addi    r3,r3,-28672
+- 180009c:     80 83 00 00     lwz     r4,0\(r3\)
+- 18000a0:     3c 62 00 00     addis   r3,r2,0
+- 18000a4:     48 00 00 0c     b       18000b0 <_start\+0x1c>
+- 18000a8:     3c 62 00 00     addis   r3,r2,0
+- 18000ac:     4b ff ff ec     b       1800098 <_start\+0x4>
+- 18000b0:     38 63 10 00     addi    r3,r3,4096
+- 18000b4:     80 83 80 00     lwz     r4,-32768\(r3\)
++0+18000[0-9a-f]{2} <_start>:
++ 18000[0-9a-f]{2}:    48 00 00 14     b       18000[0-9a-f]{2} <_start\+0x14>
++ 18000[0-9a-f]{2}:    38 63 90 00     addi    r3,r3,-28672
++ 18000[0-9a-f]{2}:    80 83 00 00     lwz     r4,0\(r3\)
++ 18000[0-9a-f]{2}:    3c 62 00 00     addis   r3,r2,0
++ 18000[0-9a-f]{2}:    48 00 00 0c     b       18000[0-9a-f]{2} <_start\+0x1c>
++ 18000[0-9a-f]{2}:    3c 62 00 00     addis   r3,r2,0
++ 18000[0-9a-f]{2}:    4b ff ff ec     b       18000[0-9a-f]{2} <_start\+0x4>
++ 18000[0-9a-f]{2}:    38 63 10 00     addi    r3,r3,4096
++ 18000[0-9a-f]{2}:    80 83 80 00     lwz     r4,-32768\(r3\)
+-0+18000b8 <__tls_get_addr>:
+- 18000b8:     4e 80 00 20     blr
+-#pass
+\ No newline at end of file
++0+18000[0-9a-f]{2} <__tls_get_addr>:
++ 18000[0-9a-f]{2}:    4e 80 00 20     blr
++#pass
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlsopt1.d
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlsopt1.d
+@@ -9,17 +9,17 @@
+ Disassembly of section \.text:
+-0+100000e8 <\.__tls_get_addr>:
+-    100000e8: 4e 80 00 20     blr
++0+10000[0-9a-f]{3} <\.__tls_get_addr>:
++    10000[0-9a-f]{3}: 4e 80 00 20     blr
+ Disassembly of section \.no_opt1:
+-0+100000ec <\.no_opt1>:
+-    100000ec: 38 62 80 08     addi    r3,r2,-32760
+-    100000f0: 2c 24 00 00     cmpdi   r4,0
+-    100000f4: 41 82 00 10     beq-    .*
+-    100000f8: 4b ff ff f1     bl      100000e8 <\.__tls_get_addr>
+-    100000fc: 60 00 00 00     nop
+-    10000100: 48 00 00 0c     b       .*
+-    10000104: 4b ff ff e5     bl      100000e8 <\.__tls_get_addr>
+-    10000108: 60 00 00 00     nop
++0+10000[0-9a-f]{3} <\.no_opt1>:
++    10000[0-9a-f]{3}: 38 62 80 08     addi    r3,r2,-32760
++    10000[0-9a-f]{3}: 2c 24 00 00     cmpdi   r4,0
++    10000[0-9a-f]{3}: 41 82 00 10     beq-    .*
++    10000[0-9a-f]{3}: 4b ff ff f1     bl      10000[0-9a-f]{3} <\.__tls_get_addr>
++    10000[0-9a-f]{3}: 60 00 00 00     nop
++    10000[0-9a-f]{3}: 48 00 00 0c     b       .*
++    10000[0-9a-f]{3}: 4b ff ff e5     bl      10000[0-9a-f]{3} <\.__tls_get_addr>
++    10000[0-9a-f]{3}: 60 00 00 00     nop
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlsopt1_32.d
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlsopt1_32.d
+@@ -9,16 +9,16 @@
+ Disassembly of section \.text:
+-0+1800094 <__tls_get_addr>:
+- 1800094:     4e 80 00 20     blr
++0+18000[0-9a-f]{2} <__tls_get_addr>:
++ 18000[0-9a-f]{2}:    4e 80 00 20     blr
+ Disassembly of section \.no_opt1:
+-0+1800098 <\.no_opt1>:
+- 1800098:     38 6d ff f4     addi    r3,r13,-12
+- 180009c:     2c 04 00 00     cmpwi   r4,0
+- 18000a0:     41 82 00 0c     beq-    .*
+- 18000a4:     4b ff ff f1     bl      1800094 <__tls_get_addr>
+- 18000a8:     48 00 00 08     b       .*
+- 18000ac:     4b ff ff e9     bl      1800094 <__tls_get_addr>
++0+18000[0-9a-f]{2} <\.no_opt1>:
++ 18000[0-9a-f]{2}:    38 6d ff f4     addi    r3,r13,-12
++ 18000[0-9a-f]{2}:    2c 04 00 00     cmpwi   r4,0
++ 18000[0-9a-f]{2}:    41 82 00 0c     beq-    .*
++ 18000[0-9a-f]{2}:    4b ff ff f1     bl      18000[0-9a-f]{2} <__tls_get_addr>
++ 18000[0-9a-f]{2}:    48 00 00 08     b       .*
++ 18000[0-9a-f]{2}:    4b ff ff e9     bl      18000[0-9a-f]{2} <__tls_get_addr>
+ #pass
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlsopt2.d
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlsopt2.d
+@@ -9,15 +9,15 @@
+ Disassembly of section \.text:
+-0+100000e8 <\.__tls_get_addr>:
+-    100000e8: 4e 80 00 20     blr
++0+10000[0-9a-f]{3} <\.__tls_get_addr>:
++    10000[0-9a-f]{3}: 4e 80 00 20     blr
+ Disassembly of section \.no_opt2:
+-0+100000ec <\.no_opt2>:
+-    100000ec: 38 62 80 08     addi    r3,r2,-32760
+-    100000f0: 2c 24 00 00     cmpdi   r4,0
+-    100000f4: 41 82 00 08     beq-    .*
+-    100000f8: 38 62 80 08     addi    r3,r2,-32760
+-    100000fc: 4b ff ff ed     bl      100000e8 <\.__tls_get_addr>
+-    10000100: 60 00 00 00     nop
++0+10000[0-9a-f]{3} <\.no_opt2>:
++    10000[0-9a-f]{3}: 38 62 80 08     addi    r3,r2,-32760
++    10000[0-9a-f]{3}: 2c 24 00 00     cmpdi   r4,0
++    10000[0-9a-f]{3}: 41 82 00 08     beq-    .*
++    10000[0-9a-f]{3}: 38 62 80 08     addi    r3,r2,-32760
++    10000[0-9a-f]{3}: 4b ff ff ed     bl      10000[0-9a-f]{3} <\.__tls_get_addr>
++    10000[0-9a-f]{3}: 60 00 00 00     nop
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlsopt2_32.d
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlsopt2_32.d
+@@ -9,15 +9,15 @@
+ Disassembly of section \.text:
+-0+1800094 <__tls_get_addr>:
+- 1800094:     4e 80 00 20     blr
++0+18000[0-9a-f]{2} <__tls_get_addr>:
++ 18000[0-9a-f]{2}:    4e 80 00 20     blr
+ Disassembly of section \.no_opt2:
+-0+1800098 <\.no_opt2>:
+- 1800098:     38 6d ff f4     addi    r3,r13,-12
+- 180009c:     2c 04 00 00     cmpwi   r4,0
+- 18000a0:     41 82 00 08     beq-    .*
+- 18000a4:     38 6d ff f4     addi    r3,r13,-12
+- 18000a8:     4b ff ff ed     bl      1800094 <__tls_get_addr>
++0+18000[0-9a-f]{2} <\.no_opt2>:
++ 18000[0-9a-f]{2}:    38 6d ff f4     addi    r3,r13,-12
++ 18000[0-9a-f]{2}:    2c 04 00 00     cmpwi   r4,0
++ 18000[0-9a-f]{2}:    41 82 00 08     beq-    .*
++ 18000[0-9a-f]{2}:    38 6d ff f4     addi    r3,r13,-12
++ 18000[0-9a-f]{2}:    4b ff ff ed     bl      18000[0-9a-f]{2} <__tls_get_addr>
+ #pass
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlsopt3.d
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlsopt3.d
+@@ -9,18 +9,18 @@
+ Disassembly of section \.text:
+-00000000100000e8 <\.__tls_get_addr>:
+-    100000e8: 4e 80 00 20     blr
++0000000010000[0-9a-f]{3} <\.__tls_get_addr>:
++    10000[0-9a-f]{3}: 4e 80 00 20     blr
+ Disassembly of section \.no_opt3:
+-00000000100000ec <\.no_opt3>:
+-    100000ec: 38 62 80 08     addi    r3,r2,-32760
+-    100000f0: 48 00 00 0c     b       .*
+-    100000f4: 38 62 80 18     addi    r3,r2,-32744
+-    100000f8: 48 00 00 10     b       .*
+-    100000fc: 4b ff ff ed     bl      100000e8 <\.__tls_get_addr>
+-    10000100: 60 00 00 00     nop
+-    10000104: 48 00 00 0c     b       .*
+-    10000108: 4b ff ff e1     bl      100000e8 <\.__tls_get_addr>
+-    1000010c: 60 00 00 00     nop
++0000000010000[0-9a-f]{3} <\.no_opt3>:
++    10000[0-9a-f]{3}: 38 62 80 08     addi    r3,r2,-32760
++    10000[0-9a-f]{3}: 48 00 00 0c     b       .*
++    10000[0-9a-f]{3}: 38 62 80 18     addi    r3,r2,-32744
++    10000[0-9a-f]{3}: 48 00 00 10     b       .*
++    10000[0-9a-f]{3}: 4b ff ff ed     bl      10000[0-9a-f]{3} <\.__tls_get_addr>
++    10000[0-9a-f]{3}: 60 00 00 00     nop
++    10000[0-9a-f]{3}: 48 00 00 0c     b       .*
++    10000[0-9a-f]{3}: 4b ff ff e1     bl      10000[0-9a-f]{3} <\.__tls_get_addr>
++    10000[0-9a-f]{3}: 60 00 00 00     nop
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlsopt3_32.d
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlsopt3_32.d
+@@ -9,17 +9,17 @@
+ Disassembly of section \.text:
+-0+1800094 <__tls_get_addr>:
+- 1800094:     4e 80 00 20     blr
++0+18000[0-9a-f]{2} <__tls_get_addr>:
++ 18000[0-9a-f]{2}:    4e 80 00 20     blr
+ Disassembly of section \.no_opt3:
+-0+1800098 <\.no_opt3>:
+- 1800098:     38 6d ff ec     addi    r3,r13,-20
+- 180009c:     48 00 00 0c     b       .*
+- 18000a0:     38 6d ff f4     addi    r3,r13,-12
+- 18000a4:     48 00 00 0c     b       .*
+- 18000a8:     4b ff ff ed     bl      1800094 <__tls_get_addr>
+- 18000ac:     48 00 00 08     b       .*
+- 18000b0:     4b ff ff e5     bl      1800094 <__tls_get_addr>
++0+18000[0-9a-f]{2} <\.no_opt3>:
++ 18000[0-9a-f]{2}:    38 6d ff ec     addi    r3,r13,-20
++ 18000[0-9a-f]{2}:    48 00 00 0c     b       .*
++ 18000[0-9a-f]{2}:    38 6d ff f4     addi    r3,r13,-12
++ 18000[0-9a-f]{2}:    48 00 00 0c     b       .*
++ 18000[0-9a-f]{2}:    4b ff ff ed     bl      18000[0-9a-f]{2} <__tls_get_addr>
++ 18000[0-9a-f]{2}:    48 00 00 08     b       .*
++ 18000[0-9a-f]{2}:    4b ff ff e5     bl      18000[0-9a-f]{2} <__tls_get_addr>
+ #pass
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlsopt4.d
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlsopt4.d
+@@ -9,40 +9,40 @@
+ Disassembly of section \.text:
+-0+100000e8 <\.__tls_get_addr>:
+-    100000e8: 4e 80 00 20     blr
++0+10000[0-9a-f]{3} <\.__tls_get_addr>:
++    10000[0-9a-f]{3}: 4e 80 00 20     blr
+ Disassembly of section \.opt1:
+-0+100000ec <\.opt1>:
+-    100000ec: 3c 6d 00 00     addis   r3,r13,0
+-    100000f0: 2c 24 00 00     cmpdi   r4,0
+-    100000f4: 41 82 00 10     beq-    .*
+-    100000f8: 60 00 00 00     nop
+-    100000fc: 38 63 90 10     addi    r3,r3,-28656
+-    10000100: 48 00 00 0c     b       .*
+-    10000104: 60 00 00 00     nop
+-    10000108: 38 63 90 10     addi    r3,r3,-28656
++0+10000[0-9a-f]{3} <\.opt1>:
++    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
++    10000[0-9a-f]{3}: 2c 24 00 00     cmpdi   r4,0
++    10000[0-9a-f]{3}: 41 82 00 10     beq-    .*
++    10000[0-9a-f]{3}: 60 00 00 00     nop
++    10000[0-9a-f]{3}: 38 63 90 10     addi    r3,r3,-28656
++    10000[0-9a-f]{3}: 48 00 00 0c     b       .*
++    10000[0-9a-f]{3}: 60 00 00 00     nop
++    10000[0-9a-f]{3}: 38 63 90 10     addi    r3,r3,-28656
+ Disassembly of section \.opt2:
+-0+1000010c <\.opt2>:
+-    1000010c: 3c 6d 00 00     addis   r3,r13,0
+-    10000110: 2c 24 00 00     cmpdi   r4,0
+-    10000114: 41 82 00 08     beq-    .*
+-    10000118: 3c 6d 00 00     addis   r3,r13,0
+-    1000011c: 60 00 00 00     nop
+-    10000120: 38 63 90 10     addi    r3,r3,-28656
++0+10000[0-9a-f]{3} <\.opt2>:
++    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
++    10000[0-9a-f]{3}: 2c 24 00 00     cmpdi   r4,0
++    10000[0-9a-f]{3}: 41 82 00 08     beq-    .*
++    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
++    10000[0-9a-f]{3}: 60 00 00 00     nop
++    10000[0-9a-f]{3}: 38 63 90 10     addi    r3,r3,-28656
+ Disassembly of section \.opt3:
+-0+10000124 <\.opt3>:
+-    10000124: 3c 6d 00 00     addis   r3,r13,0
+-    10000128: 48 00 00 0c     b       .*
+-    1000012c: 3c 6d 00 00     addis   r3,r13,0
+-    10000130: 48 00 00 10     b       .*
+-    10000134: 60 00 00 00     nop
+-    10000138: 38 63 90 10     addi    r3,r3,-28656
+-    1000013c: 48 00 00 0c     b       .*
+-    10000140: 60 00 00 00     nop
+-    10000144: 38 63 90 08     addi    r3,r3,-28664
++0+10000[0-9a-f]{3} <\.opt3>:
++    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
++    10000[0-9a-f]{3}: 48 00 00 0c     b       .*
++    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
++    10000[0-9a-f]{3}: 48 00 00 10     b       .*
++    10000[0-9a-f]{3}: 60 00 00 00     nop
++    10000[0-9a-f]{3}: 38 63 90 10     addi    r3,r3,-28656
++    10000[0-9a-f]{3}: 48 00 00 0c     b       .*
++    10000[0-9a-f]{3}: 60 00 00 00     nop
++    10000[0-9a-f]{3}: 38 63 90 08     addi    r3,r3,-28664
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlsopt4_32.d
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlsopt4_32.d
+@@ -9,36 +9,36 @@
+ Disassembly of section \.text:
+-0+1800094 <__tls_get_addr>:
+- 1800094:     4e 80 00 20     blr
++0+18000[0-9a-f]{2} <__tls_get_addr>:
++ 18000[0-9a-f]{2}:    4e 80 00 20     blr
+ Disassembly of section \.opt1:
+-0+1800098 <\.opt1>:
+- 1800098:     3c 62 00 00     addis   r3,r2,0
+- 180009c:     2c 04 00 00     cmpwi   r4,0
+- 18000a0:     41 82 00 0c     beq-    .*
+- 18000a4:     38 63 90 10     addi    r3,r3,-28656
+- 18000a8:     48 00 00 08     b       .*
+- 18000ac:     38 63 90 10     addi    r3,r3,-28656
++0+18000[0-9a-f]{2} <\.opt1>:
++ 18000[0-9a-f]{2}:    3c 62 00 00     addis   r3,r2,0
++ 18000[0-9a-f]{2}:    2c 04 00 00     cmpwi   r4,0
++ 18000[0-9a-f]{2}:    41 82 00 0c     beq-    .*
++ 18000[0-9a-f]{2}:    38 63 90 10     addi    r3,r3,-28656
++ 18000[0-9a-f]{2}:    48 00 00 08     b       .*
++ 18000[0-9a-f]{2}:    38 63 90 10     addi    r3,r3,-28656
+ Disassembly of section \.opt2:
+-0+18000b0 <\.opt2>:
+- 18000b0:     3c 62 00 00     addis   r3,r2,0
+- 18000b4:     2c 04 00 00     cmpwi   r4,0
+- 18000b8:     41 82 00 08     beq-    .*
+- 18000bc:     3c 62 00 00     addis   r3,r2,0
+- 18000c0:     38 63 90 10     addi    r3,r3,-28656
++0+18000[0-9a-f]{2} <\.opt2>:
++ 18000[0-9a-f]{2}:    3c 62 00 00     addis   r3,r2,0
++ 18000[0-9a-f]{2}:    2c 04 00 00     cmpwi   r4,0
++ 18000[0-9a-f]{2}:    41 82 00 08     beq-    .*
++ 18000[0-9a-f]{2}:    3c 62 00 00     addis   r3,r2,0
++ 18000[0-9a-f]{2}:    38 63 90 10     addi    r3,r3,-28656
+ Disassembly of section \.opt3:
+-0+18000c4 <\.opt3>:
+- 18000c4:     3c 62 00 00     addis   r3,r2,0
+- 18000c8:     48 00 00 0c     b       .*
+- 18000cc:     3c 62 00 00     addis   r3,r2,0
+- 18000d0:     48 00 00 0c     b       .*
+- 18000d4:     38 63 90 10     addi    r3,r3,-28656
+- 18000d8:     48 00 00 08     b       .*
+- 18000dc:     38 63 90 08     addi    r3,r3,-28664
++0+18000[0-9a-f]{2} <\.opt3>:
++ 18000[0-9a-f]{2}:    3c 62 00 00     addis   r3,r2,0
++ 18000[0-9a-f]{2}:    48 00 00 0c     b       .*
++ 18000[0-9a-f]{2}:    3c 62 00 00     addis   r3,r2,0
++ 18000[0-9a-f]{2}:    48 00 00 0c     b       .*
++ 18000[0-9a-f]{2}:    38 63 90 10     addi    r3,r3,-28656
++ 18000[0-9a-f]{2}:    48 00 00 08     b       .*
++ 18000[0-9a-f]{2}:    38 63 90 08     addi    r3,r3,-28664
+ #pass
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlsso32.d
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlsso32.d
+@@ -42,5 +42,5 @@ Disassembly of section \.got:
+ .* <\.got>:
+       \.\.\.
+ .*:   4e 80 00 21     blrl
+-.*:   00 01 03 ec     .*
++.*:   00 01 [0-9a-f]{2} [0-9a-f]{2}   .*
+       \.\.\.
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlsso32.g
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlsso32.g
+@@ -9,5 +9,5 @@
+ Contents of section \.got:
+ .* 00000000 00000000 00000000 00000000  .*
+ .* 00000000 00000000 00000000 00000000  .*
+-.* 00000000 4e800021 000103ec 00000000  .*
++.* 00000000 4e800021 00010[0-9a-f]{3} 00000000  .*
+ .* 00000000                             .*
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlsso32.r
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlsso32.r
+@@ -35,6 +35,7 @@ Program Headers:
+  +LOAD .* RWE 0x10000
+  +DYNAMIC .* RW +0x4
+  +TLS .* 0x0+1c 0x0+38 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections\.\.\.
+@@ -42,6 +43,7 @@ Program Headers:
+  +01 +\.tdata \.dynamic \.got \.plt 
+  +02 +\.dynamic 
+  +03 +\.tdata \.tbss 
++ +04 +
+ Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 18 entries:
+  Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend
+@@ -52,9 +54,9 @@ Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 18 entries:
+ [0-9a-f ]+R_PPC_TPREL16 +0+30 +le0 \+ 0
+ [0-9a-f ]+R_PPC_TPREL16_HA +0+34 +le1 \+ 0
+ [0-9a-f ]+R_PPC_TPREL16_LO +0+34 +le1 \+ 0
+-[0-9a-f ]+R_PPC_TPREL16 +0+103d0 +\.tdata \+ 103e4
+-[0-9a-f ]+R_PPC_TPREL16_HA +0+103d0 +\.tdata \+ 103e8
+-[0-9a-f ]+R_PPC_TPREL16_LO +0+103d0 +\.tdata \+ 103e8
++[0-9a-f ]+R_PPC_TPREL16 +0+103[df]0 +\.tdata \+ 10[0-9a-f]{3}
++[0-9a-f ]+R_PPC_TPREL16_HA +0+103[df]0 +\.tdata \+ 10[0-9a-f]{3}
++[0-9a-f ]+R_PPC_TPREL16_LO +0+103[df]0 +\.tdata \+ 10[0-9a-f]{3}
+ [0-9a-f ]+R_PPC_DTPMOD32 +0+
+ [0-9a-f ]+R_PPC_DTPREL32 +0+
+ [0-9a-f ]+R_PPC_DTPMOD32 +0+
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlstoc.g
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlstoc.g
+@@ -8,8 +8,8 @@
+ .*: +file format elf64-powerpc
+ Contents of section \.got:
+- 100101a0 00000000 00000001 00000000 00000000  .*
+- 100101b0 00000000 00000001 00000000 00000000  .*
+- 100101c0 00000000 00000001 00000000 00000000  .*
+- 100101d0 00000000 00000001 00000000 00000000  .*
+- 100101e0 ffffffff ffff8060 00000000 00000000  .*
++ 10010[0-9a-f]{3} 00000000 00000001 00000000 00000000  .*
++ 10010[0-9a-f]{3} 00000000 00000001 00000000 00000000  .*
++ 10010[0-9a-f]{3} 00000000 00000001 00000000 00000000  .*
++ 10010[0-9a-f]{3} 00000000 00000001 00000000 00000000  .*
++ 10010[0-9a-f]{3} ffffffff ffff8060 00000000 00000000  .*
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlstoc.t
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlstoc.t
+@@ -8,7 +8,7 @@
+ .*: +file format elf64-powerpc
+ Contents of section \.tdata:
+- 10010148 00c0ffee 00000000 12345678 9abcdef0  .*
+- 10010158 23456789 abcdef01 3456789a bcdef012  .*
+- 10010168 456789ab cdef0123 56789abc def01234  .*
+- 10010178 6789abcd ef012345 789abcde f0123456  .*
++ 10010180 00c0ffee 00000000 12345678 9abcdef0  .*
++ 10010190 23456789 abcdef01 3456789a bcdef012  .*
++ 100101a0 456789ab cdef0123 56789abc def01234  .*
++ 100101b0 6789abcd ef012345 789abcde f0123456  .*
+--- binutils-2.22/ld/testsuite/ld-powerpc/tlstocso.g
++++ binutils-2.22/ld/testsuite/ld-powerpc/tlstocso.g
+@@ -7,7 +7,7 @@
+ .*: +file format elf64-powerpc
+ Contents of section \.got:
+-.* 00000000 000186c0 00000000 00000000  .*
++.* 00000000 000186f8 00000000 00000000  .*
+ .* 00000000 00000000 00000000 00000000  .*
+ .* 00000000 00000000 00000000 00000000  .*
+ .* 00000000 00000000 00000000 00000000  .*
+--- binutils-2.22/ld/testsuite/ld-s390/tlsbin.rd
++++ binutils-2.22/ld/testsuite/ld-s390/tlsbin.rd
+@@ -36,13 +36,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
+ Program Headers:
+  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
+- +PHDR +0x0+34 0x0+400034 0x0+400034 0x0+c0 0x0+c0 R E 0x4
+- +INTERP +0x0+f4 0x0+4000f4 0x0+4000f4 0x0+11 0x0+11 R +0x1
++ +PHDR +0x0+34 0x0+400034 0x0+400034 0x0+e0 0x0+e0 R E 0x4
++ +INTERP +0x0+114 0x0+400114 0x0+400114 0x0+11 0x0+11 R +0x1
+ .*Requesting program interpreter.*
+  +LOAD .* R E 0x1000
+  +LOAD .* RW +0x1000
+  +DYNAMIC .* RW +0x4
+  +TLS .* 0x0+60 0x0+a0 R +0x20
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -52,6 +53,7 @@ Program Headers:
+  +03 +.tdata .dynamic .got *
+  +04 +.dynamic *
+  +05 +.tdata .tbss *
++ +06 +
+ Relocation section '.rela.dyn' at offset .* contains 4 entries:
+  Offset +Info +Type +Sym.Value +Sym. Name \+ Addend
+--- binutils-2.22/ld/testsuite/ld-s390/tlsbin_64.rd
++++ binutils-2.22/ld/testsuite/ld-s390/tlsbin_64.rd
+@@ -36,13 +36,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
+ Program Headers:
+  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
+- +PHDR +0x0+40 0x0+80000040 0x0+80000040 0x0+150 0x0+150 R E 0x8
+- +INTERP +0x0+190 0x0+80000190 0x0+80000190 0x0+11 0x0+11 R +0x1
++ +PHDR +0x0+40 0x0+80000040 0x0+80000040 0x0+188 0x0+188 R E 0x8
++ +INTERP +0x0+1c8 0x0+800001c8 0x0+800001c8 0x0+11 0x0+11 R +0x1
+ .*Requesting program interpreter.*
+  +LOAD .* R E 0x1000
+  +LOAD .* RW +0x1000
+  +DYNAMIC .* RW +0x8
+  +TLS .* 0x0+60 0x0+a0 R +0x20
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -52,6 +53,7 @@ Program Headers:
+  +03 +.tdata .dynamic .got *
+  +04 +.dynamic *
+  +05 +.tdata .tbss *
++ +06 +
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
+  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
+--- binutils-2.22/ld/testsuite/ld-s390/tlspic.rd
++++ binutils-2.22/ld/testsuite/ld-s390/tlspic.rd
+@@ -39,6 +39,7 @@ Program Headers:
+  +LOAD .* RW +0x1000
+  +DYNAMIC .* RW +0x4
+  +TLS .* 0x0+60 0x0+80 R +0x20
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -46,6 +47,7 @@ Program Headers:
+  +01 +.tdata .dynamic .got 
+  +02 +.dynamic 
+  +03 +.tdata .tbss 
++ +04 +
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
+  Offset +Info +Type +Sym.Value +Sym. Name \+ Addend
+--- binutils-2.22/ld/testsuite/ld-s390/tlspic_64.rd
++++ binutils-2.22/ld/testsuite/ld-s390/tlspic_64.rd
+@@ -39,6 +39,7 @@ Program Headers:
+  +LOAD .* RW +0x1000
+  +DYNAMIC .* RW +0x8
+  +TLS .* 0x0+60 0x0+80 R +0x20
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -46,6 +47,7 @@ Program Headers:
+  +01 +.tdata .dynamic .got *
+  +02 +.dynamic *
+  +03 +.tdata .tbss *
++ +04 +
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
+  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
+--- binutils-2.22/ld/testsuite/ld-scripts/empty-aligned.d
++++ binutils-2.22/ld/testsuite/ld-scripts/empty-aligned.d
+@@ -8,7 +8,9 @@
+ Program Headers:
+  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg +Align
+  +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ [RWE ]+ +0x[0-9a-f]+
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections\.\.\.
+  +00 +.text 
++ +01 +
+--- binutils-2.22/ld/testsuite/ld-sh/tlsbin-2.d
++++ binutils-2.22/ld/testsuite/ld-sh/tlsbin-2.d
+@@ -44,6 +44,7 @@ Program Headers:
+  +LOAD.*
+  +DYNAMIC.*
+  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+18 0x0+28 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections\.\.\.
+@@ -53,6 +54,7 @@ Program Headers:
+  +03 +\.tdata \.dynamic \.got *
+  +04 +\.dynamic *
+  +05 +\.tdata \.tbss *
++ +06 +
+ Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
+  Offset +Info +Type +Sym\.Value +Sym\. Name \+ Addend
+--- binutils-2.22/ld/testsuite/ld-sh/tlspic-2.d
++++ binutils-2.22/ld/testsuite/ld-sh/tlspic-2.d
+@@ -32,7 +32,7 @@ Key to Flags:
+ Elf file type is DYN \(Shared object file\)
+ Entry point 0x[0-9a-f]+
+-There are 4 program headers, starting at offset [0-9]+
++There are [0-9] program headers, starting at offset [0-9]+
+ Program Headers:
+  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
+@@ -40,6 +40,7 @@ Program Headers:
+  +LOAD.*
+  +DYNAMIC.*
+  +TLS .* 0x0+18 0x0+20 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections\.\.\.
+@@ -47,6 +48,7 @@ Program Headers:
+  +01 +\.tdata \.dynamic \.got *
+  +02 +\.dynamic *
+  +03 +\.tdata \.tbss *
++ +04 +
+ Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 10 entries:
+  Offset +Info +Type +Sym\.Value +Sym\. Name \+ Addend
+--- binutils-2.22/ld/testsuite/ld-sparc/gotop32.rd
++++ binutils-2.22/ld/testsuite/ld-sparc/gotop32.rd
+@@ -31,6 +31,7 @@ Program Headers:
+  +LOAD +0x0+ 0x0+ 0x0+ 0x0+2000 0x0+2000 R E 0x10000
+  +LOAD +0x0+2000 0x0+12000 0x0+12000 0x0+2000 0x0+2000 RW +0x10000
+  +DYNAMIC +0x0+2000 0x0+12000 0x0+12000 0x0+70 0x0+70 RW +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 1 entries:
+--- binutils-2.22/ld/testsuite/ld-sparc/gotop64.rd
++++ binutils-2.22/ld/testsuite/ld-sparc/gotop64.rd
+@@ -31,6 +31,7 @@ Program Headers:
+  +LOAD +0x0+ 0x0+ 0x0+ 0x0+2000 0x0+2000 R E 0x100000
+  +LOAD +0x0+2000 0x0+102000 0x0+102000 0x0+2000 0x0+2000 RW +0x100000
+  +DYNAMIC +0x0+2000 0x0+102000 0x0+102000 0x0+e0 0x0+e0 RW +0x8
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 1 entries:
+--- binutils-2.22/ld/testsuite/ld-sparc/tlssunbin32.rd
++++ binutils-2.22/ld/testsuite/ld-sparc/tlssunbin32.rd
+@@ -30,13 +30,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
+ Program Headers:
+  +Type +Offset +VirtAddr +PhysAddr +FileSiz MemSiz +Flg Align
+- +PHDR +0x0+34 0x0+10034 0x0+10034 0x0+c0 0x0+c0 R E 0x4
+- +INTERP +0x0+f4 0x0+100f4 0x0+100f4 0x0+11 0x0+11 R +0x1
++ +PHDR +0x0+34 0x0+10034 0x0+10034 (0x[0-9a-f]+) \1 R E 0x4
++ +INTERP +(0x[0-9a-f]+ ){3}0x0+11 0x0+11 R +0x1
+ .*Requesting program interpreter.*
+  +LOAD .* R E 0x10000
+  +LOAD .* RW +0x10000
+  +DYNAMIC .* RW +0x4
+  +TLS .* 0x0+1060 0x0+10a0 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
+--- binutils-2.22/ld/testsuite/ld-sparc/tlssunbin64.rd
++++ binutils-2.22/ld/testsuite/ld-sparc/tlssunbin64.rd
+@@ -30,13 +30,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
+ Program Headers:
+  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
+- +PHDR +0x0+40 0x0+100040 0x0+100040 0x0+150 0x0+150 R E 0x8
+- +INTERP +0x0+190 0x0+100190 0x0+100190 0x0+19 0x0+19 R +0x1
++ +PHDR +0x0+40 0x0+100040 0x0+100040 (0x[0-9a-f]+) \1 R E 0x8
++ +INTERP +0x0+([0-9a-f]+) (0x0+10+\1) \2 0x0+19 0x0+19 R +0x1
+ .*Requesting program interpreter.*
+  +LOAD .* R E 0x100000
+  +LOAD .* RW +0x100000
+  +DYNAMIC .* RW +0x8
+  +TLS .* 0x0+60 0x0+a0 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
+--- binutils-2.22/ld/testsuite/ld-sparc/tlssunnopic32.rd
++++ binutils-2.22/ld/testsuite/ld-sparc/tlssunnopic32.rd
+@@ -32,6 +32,7 @@ Program Headers:
+  +LOAD .* RW +0x10000
+  +DYNAMIC .* RW +0x4
+  +TLS .* 0x0+ 0x0+24 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 12 entries:
+--- binutils-2.22/ld/testsuite/ld-sparc/tlssunnopic64.rd
++++ binutils-2.22/ld/testsuite/ld-sparc/tlssunnopic64.rd
+@@ -32,6 +32,7 @@ Program Headers:
+  +LOAD .* RW +0x100000
+  +DYNAMIC .* RW +0x8
+  +TLS .* 0x0+ 0x0+24 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
+--- binutils-2.22/ld/testsuite/ld-sparc/tlssunpic32.rd
++++ binutils-2.22/ld/testsuite/ld-sparc/tlssunpic32.rd
+@@ -36,6 +36,7 @@ Program Headers:
+  +LOAD +0x0+2000 0x0+12000 0x0+12000 0x0+184 0x0+184 RWE 0x10000
+  +DYNAMIC +0x0+2060 0x0+12060 0x0+12060 0x0+98 0x0+98 RW +0x4
+  +TLS +0x0+2000 0x0+12000 0x0+12000 0x0+60 0x0+80 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
+--- binutils-2.22/ld/testsuite/ld-sparc/tlssunpic64.rd
++++ binutils-2.22/ld/testsuite/ld-sparc/tlssunpic64.rd
+@@ -36,6 +36,7 @@ Program Headers:
+  +LOAD +0x0+2000 0x0+102000 0x0+102000 0x0+3a0 0x0+3a0 RWE 0x100000
+  +DYNAMIC +0x0+2060 0x0+102060 0x0+102060 0x0+130 0x0+130 RW +0x8
+  +TLS +0x0+2000 0x0+102000 0x0+102000 0x0+60 0x0+80 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
+--- binutils-2.22/ld/testsuite/ld-x86-64/protected3.d
++++ binutils-2.22/ld/testsuite/ld-x86-64/protected3.d
+@@ -8,6 +8,6 @@
+ Disassembly of section .text:
+ 0+[a-f0-9]+ <bar>:
+-[     ]*[a-f0-9]+:    8b 05 [a-f0-9][a-f0-9] 00 [a-f0-9][a-f0-9] 00           mov    0x[a-f0-9]+\(%rip\),%eax        # [a-f0-9]+ <foo>
++[     ]*[a-f0-9]+:    8b 05 [a-f0-9][a-f0-9] [a-f0-9][a-f0-9] [a-f0-9][a-f0-9] 00     mov    0x[a-f0-9]+\(%rip\),%eax        # [a-f0-9]+ <foo>
+ [     ]*[a-f0-9]+:    c3                      retq   
+ #pass
+--- binutils-2.22/ld/testsuite/ld-x86-64/tlsgdesc.rd
++++ binutils-2.22/ld/testsuite/ld-x86-64/tlsgdesc.rd
+@@ -36,12 +36,14 @@ Program Headers:
+  +LOAD.*
+  +LOAD.*
+  +DYNAMIC.*
++ +PAX_FLAGS.*
+  Section to Segment mapping:
+  +Segment Sections...
+  +00 +.hash .dynsym .dynstr .rela.dyn .rela.plt .plt .text *
+  +01 +.dynamic .got .got.plt *
+  +02 +.dynamic *
++ +03 +
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 8 entries:
+  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
+--- binutils-2.22/ld/testsuite/ld-x86-64/tlspic.rd
++++ binutils-2.22/ld/testsuite/ld-x86-64/tlspic.rd
+@@ -40,6 +40,7 @@ Program Headers:
+  +LOAD +0x0+11ac 0x0+2011ac 0x0+2011ac 0x0+244 0x0+244 RW +0x200000
+  +DYNAMIC +0x0+1210 0x0+201210 0x0+201210 0x0+130 0x0+130 RW +0x8
+  +TLS +0x0+11ac 0x0+2011ac 0x0+2011ac 0x0+60 0x0+80 R +0x1
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -47,6 +48,7 @@ Program Headers:
+  +01 +.tdata .dynamic .got .got.plt *
+  +02 +.dynamic *
+  +03 +.tdata .tbss *
++ +04 +
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
+  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
similarity index 57%
rename from binutils/patches/binutils-2.20.1-gentoo-warn-textrel.patch
rename to binutils/patches/binutils-2.22-warn-textrel.patch
index c8783a28758dbddf87a3ade2ffe299a8e9fb2382..ab63ed45626a5cf5871d522f8ef4a5f4816b49a8 100644 (file)
@@ -10,15 +10,16 @@ the very fact that they're needed at all.
        * ld/testsuite/lib/ld-lib.exp (default_ld_simple_link): Scrub TEXTREL
        warnings from ld output.
 
---- binutils/bfd/elflink.c
-+++ binutils/bfd/elflink.c
-@@ -8652,14 +8652,12 @@
+--- a/bfd/elflink.c
++++ b/bfd/elflink.c
+@@ -8652,14 +8652,12 @@ bfd_elf_final_link (bfd *abfd, struct bf
        goto error_return;
  
        /* Check for DT_TEXTREL (late, in case the backend removes it).  */
--      if (info->warn_shared_textrel && info->shared)
+-      if ((info->warn_shared_textrel && info->shared)
 +      o = bfd_get_section_by_name (dynobj, ".dynamic");
-+      if (info->warn_shared_textrel && o != NULL)
++      if ((info->warn_shared_textrel && o != NULL)
+         || info->error_textrel)
        {
          bfd_byte *dyncon, *dynconend;
  
@@ -30,56 +31,30 @@ the very fact that they're needed at all.
          dynconend = o->contents + o->size;
          for (; dyncon < dynconend; dyncon += bed->s->sizeof_dyn)
 @@ -8702,7 +8702,7 @@ bfd_elf_final_link (bfd *abfd, struct bf
-             if (dyn.d_tag == DT_TEXTREL)
-               {
-                info->callbacks->einfo
+                     (_("%P%X: read-only segment has dynamic relocations.\n"));
+                 else
+                   info->callbacks->einfo
 -                  (_("%P: warning: creating a DT_TEXTREL in a shared object.\n"));
 +                  (_("%P: warning: creating a DT_TEXTREL in object.\n"));
                  break;
                }
            }
---- binutils/ld/ldmain.c
-+++ binutils/ld/ldmain.c
-@@ -282,2 +282,3 @@
+--- a/ld/ldmain.c
++++ b/ld/ldmain.c
+@@ -282,2 +282,3 @@ main (int argc, char **argv)
    link_info.spare_dynamic_tags = 5;
 +  link_info.warn_shared_textrel = TRUE;
    link_info.sharable_sections = FALSE;
---- binutils/ld/testsuite/lib/ld-lib.exp
-+++ binutils/ld/testsuite/lib/ld-lib.exp
+--- a/ld/testsuite/lib/ld-lib.exp
++++ b/ld/testsuite/lib/ld-lib.exp
 @@ -181,6 +181,10 @@ proc default_ld_simple_link { ld target 
      # symbol, since the default linker script might use ENTRY.
      regsub -all "(^|\n)(\[^\n\]*: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output
  
 +    # Gentoo tweak:
 +    # We want to ignore TEXTREL warnings since we force enable them by default
-+    regsub -all "^.*ld-new: warning: creating a DT_TEXTREL in object\." $exec_output "\\1" exec_output
++    regsub -all "^lt-ld-new: warning: creating a DT_TEXTREL in object\." $exec_output "\\1" exec_output
 +
      if [string match "" $exec_output] then {
        return 1
      } else {
-@@ -899,6 +903,10 @@
-       remote_file build delete "ld.tmp"
-       set cmdret [lindex $cmdret 0]
-+      # Gentoo tweak:
-+      # We want to ignore TEXTREL warnings since we force enable them by default
-+      regsub -all "^.*ld-new: warning: creating a DT_TEXTREL in object\." $comp_output "\\1" comp_output
-+
-       if { $cmdret == 0 && $run_objcopy } {
-           set infile $objfile
-           set objfile "tmpdir/dump1"
-
-this sucks, but the warn test explicitly checks for textrels, and we
-change/filter that output with the above hunks
-
---- binutils/ld/testsuite/ld-i386/i386.exp
-+++ binutils/ld/testsuite/ld-i386/i386.exp
-@@ -176,7 +176,7 @@
- run_dump_test "pcrel16"
- run_dump_test "pcrel16abs"
- run_dump_test "alloc"
--run_dump_test "warn1"
-+#run_dump_test "warn1"
- run_dump_test "tlsgd2"
- run_dump_test "tlsie2"
- run_dump_test "tlsie3"
index e86eda2599529792fd65a1102b3f97a9cc58889c..72046aa4626bdbb15ad1697f3e07f191c5bf1a97 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = bird
 version    = 1.3.1
-release    = 1
+release    = 2
 
 groups     = Networking/Routing
 url        = http://bird.network.cz/
@@ -57,5 +57,32 @@ end
 
 packages
        package %{name}
+               prerequires = systemd-units
+
+               script postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       /bin/systemctl --no-reload disable bird.service > /dev/null 2>&1 || :
+                       /bin/systemctl stop bird.service > /dev/null 2>&1 || :
+
+                       /bin/systemctl --no-reload disable bird6.service > /dev/null 2>&1 || :
+                       /bin/systemctl stop bird6.service > /dev/null 2>&1 || :
+               end
+
+               script postun
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       /bin/systemctl daemon-reload 2>&1 || :
+                       /bin/systemctl reload-or-try-restart bird.service >/dev/null 2>&1 || :
+                       /bin/systemctl reload-or-try-restart bird6.service >/dev/null 2>&1 || :
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index ab7ad3c7ff870aeca2edc4e128de2929d1592b02..7335957027576abc419d3f57ed9eb502b9c3d2c3 100644 (file)
@@ -47,4 +47,8 @@ packages
        package %{name}
                requires += m4
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 0493c0859f10edd2785668e9a602a04ad0a2f37d..452ef254bffc5291573ed3cef6ad15371c5b14aa 100644 (file)
@@ -69,8 +69,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 556f94ce9395bcfad2555d218f08fe94bbca167f..6cf052cb0e7166af9d01a2dcf52cdd8d6d4e8394 100644 (file)
@@ -44,4 +44,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 4f55a63404dc973d11b27be32b2445dca5d7243d..65f017589fa7df9c2e8660762af60daa8ce4aaea 100644 (file)
@@ -43,4 +43,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index c76feb7be0ab6d60f702f701f34f2f0b22dff06f..ae9961441766a1a48a64833028886d7f4960b705 100644 (file)
@@ -45,4 +45,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 738321dea363333d96228e9cd276c4752b45f29f..d319cc1f00dfc5c198babd31fdfd56178c57ab7d 100644 (file)
@@ -27,4 +27,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index f0165c75c05571365b3b4a3eefd62cb197263ef9..39dcf189686f874fbdc0ca01ebcc9d789f10237a 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = bzip2
 version    = 1.0.6
-release    = 1
+release    = 3
 
-groups     = Applications/Compression Build
+groups     = Applications/Compression
 url        = http://www.bzip.org/
 license    = GPLv2+
 summary    = Bzip2 is a data compressor.
@@ -29,10 +29,12 @@ build
 
        build
                %{DO_FIX_LIBTOOL}
-               make -f Makefile-libbz2_so %{PARALLELISMFLAGS}
+               make -f Makefile-libbz2_so %{PARALLELISMFLAGS} \
+                       CFLAGS="%{CFLAGS}"
 
                make clean
-               make %{PARALLELISMFLAGS}
+               make %{PARALLELISMFLAGS} \
+                       CFLAGS="%{CFLAGS}"
        end
 
        install
@@ -54,9 +56,14 @@ end
 
 packages
        package %{name}
+               groups += Build
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/bzip2/patches/bzip2-1.0.4-saneso.patch b/bzip2/patches/bzip2-1.0.4-saneso.patch
new file mode 100644 (file)
index 0000000..6b3430c
--- /dev/null
@@ -0,0 +1,12 @@
+diff -up bzip2-1.0.6/Makefile-libbz2_so.pom bzip2-1.0.6/Makefile-libbz2_so
+--- bzip2-1.0.6/Makefile-libbz2_so.pom 2010-09-11 01:07:52.000000000 +0200
++++ bzip2-1.0.6/Makefile-libbz2_so     2010-09-22 10:31:46.000000000 +0200
+@@ -35,7 +35,7 @@ OBJS= blocksort.o  \
+       bzlib.o
+ all: $(OBJS)
+-      $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS)
++      $(CC) -shared -Wl,-soname -Wl,libbz2.so.1 -o libbz2.so.1.0.6 $(OBJS)
+       $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6
+       rm -f libbz2.so.1.0
+       ln -s libbz2.so.1.0.6 libbz2.so.1.0
index 3c80c63575c4c4e344cfb063d976557829e91063..bf873ec8219fb19f7d0a3b7b4e902db7b99ca07d 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = c_icap
-version    = 0.1.5
+version    = 0.1.7
 release    = 1
 
 maintainer = Christian Schmidt <christian.schmidt@ipfire.org>
@@ -19,6 +19,8 @@ description
        adaptation and filtering services.
 end
 
+source_dl  = http://downloads.sourceforge.net/project/c-icap/c-icap/0.1.x/
+
 build
        requires
                autoconf
@@ -48,4 +50,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 04fc7d026ed6405de039da8eefdac683fc80a143..5f34d46a64c10256e10f738d68ad6e2805a8bbec 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = c_icap_modules
-version    = 0.1.4
+version    = 0.1.6
 release    = 1
 
 maintainer = Christian Schmidt <christian.schmidt@ipfire.org>
@@ -19,6 +19,8 @@ description
        adaptation and filtering services.
 end
 
+source_dl = http://downloads.sourceforge.net/project/c-icap/c-icap-modules/0.1.x/
+
 build
        requires
                autoconf
@@ -46,4 +48,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index af94c848b6240c74bc484390de7b5f5cd840ed4f..5cafa622c5694a48d9308dce68023e30ef536338 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = cairo
 version    = 1.10.2
-release    = 2
+release    = 3
 
 groups     = System/Graphics
 url        = http://cairographics.org
@@ -21,6 +21,7 @@ source_dl  = http://cairographics.org/releases/
 
 build
        requires
+               binutils>=2.21.51.0.8-2
                fontconfig-devel
                freetype-devel
                libpng-devel
@@ -32,11 +33,10 @@ end
 
 packages
        package %{name}
-       end
-       
+
        package %{name}-devel
                template DEVEL
-       
+
                # The development package needs the other dependencies as well.
                requires
                        fontconfig-devel
@@ -45,4 +45,8 @@ packages
                        pixman-devel
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index c9569a231d9102ae75b7edfa28017321bd429bcd..8c25d7c52a51be582259daeed35e95ca99734d7f 100644 (file)
@@ -64,4 +64,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index a5bbf8479c082e5b0078d604786063d926637f56..34add5f40bded6cfee90ac476a99c274dc30de9e 100644 (file)
@@ -32,7 +32,7 @@ generate_commandkey() {
     commandkey=$(get_key $commandkeyid)
     [ -z "$commandkey" ] || return 0
 
-    commandkey=$(tr -c -d '[\041-\176]' < /dev/urandom | head -c 8)
+    commandkey=$(tr -c -d '[\041-\176]' < /dev/urandom | head -c 16)
     [ -n "$commandkey" ] && echo "$commandkeyid $commandkey" >> $keyfile
 }
 
index fb44fbb7ea8a79fd4ecc2e3857537afd14363076..956eead485945b9c9f70af8fe43b1e80d73c5421 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = chrony
 version    = 1.26
-release    = 6
+release    = 8
 
-groups     = Base System/Daemons
+groups     = System/Daemons
 url        = http://chrony.tuxfamily.org
 license    = GPLv2
 summary    = An NTP client/server.
@@ -73,31 +73,38 @@ end
 
 packages
        package %{name}
-               preprequires = shadow-utils systemd-units
-       
+               groups += Base
+
                configfiles
                        /etc/chrony.conf
                        /etc/chrony.keys
                end
-       
+
+               prerequires = shadow-utils systemd-units
+
                script prein
                        %{create_user}
                end
-       
+
                script postin
-                       /bin/systemctl daemon-reload &>/dev/null
-                       /bin/systemctl enable cronyd.service &>/dev/null
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl --no-reload enable \
+                               chrony-wait.service chronyd.service >/dev/null 2>&1 || :
                end
-       
+
                script preun
                        /bin/systemctl --no-reload disable \
-                               chrony-wait.service chronyd.service &>/dev/null
-                       /bin/systemctl stop chrony-wait.service chronyd.service &>/dev/null
+                               chrony-wait.service chronyd.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop chrony-wait.service chronyd.service >/dev/null 2>&1 || :
                end
-       
+
                script postup
-                       /bin/systemctl daemon-reload &>/dev/null
-                       /bin/systemctl try-restart chronyd.service &>/dev/null
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl try-restart chronyd.service >/dev/null 2>&1 || :
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index c176c9cbecde367e1f2208aa24491fc48dfa14b2..6106930554bcb6628455561b4a2dcc1cf41ce686 100644 (file)
@@ -32,4 +32,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index a3c74738bfc0e5f158b7eca82211116793515a58..ae809ebae2da14ca1cab39ec42c135ca09817104 100644 (file)
@@ -65,12 +65,16 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-libs
                template LIBS
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 82f120f29fdc34888481611e1660e115afb5fa92..e8966beceddfad284850988a01367d73f593df76 100644 (file)
@@ -4,8 +4,8 @@
 ###############################################################################
 
 name       = cloog-ppl
-version    = 0.15.9
-release    = 3
+version    = 0.15.11
+release    = 1
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
 groups     = System/Libraries
@@ -20,6 +20,8 @@ description
        designed to avoid control overhead and to produce a very efficient code.
 end
 
+source_dl += ftp://gcc.gnu.org/pub/gcc/infrastructure/
+
 build
        requires
                autoconf
@@ -44,9 +46,12 @@ end
 
 packages
        package %{name}
-       end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 9cfc81917395f9c9240feb0b0c4408ef780dbbfa..ddbe23aa04b3baa613cc9de8b2faeed2fbc5ad09 100644 (file)
@@ -66,4 +66,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index bb3c5a2fa52ae1525c52d45e77e16d8c531a7876..55ddee9450e79d916e932d71f148d69656de7ec0 100644 (file)
@@ -4,10 +4,10 @@
 ###############################################################################
 
 name       = coreutils
-version    = 8.13
+version    = 8.14
 release    = 2
 
-groups     = Base Build System/Base
+groups     = System/Base
 url        = http://www.gnu.org/software/coreutils/
 license    = GPLv3+
 summary    = A set of basic GNU tools commonly used in shell scripts.
@@ -80,4 +80,10 @@ end
 
 packages
        package %{name}
+               groups += Base Build
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 53c3d42c606d1b6575f333e6cf43565a775dffeb..7b21d84788dc8de512a873f53208f530b92a1a0e 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = cpio
-version    = 2.10
+version    = 2.11
 release    = 1
 
 groups     = System/Packaging
@@ -36,5 +36,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index f8e13862d28ab6e07a6fefc36adfa7f1b30bd468..6465a45b054e34173ede36f6904c9e6bd23776a4 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = cpufrequtils
 version    = 008
-release    = 4
+release    = 5
 
-groups     = Base Applications/System
+groups     = Applications/System
 url        = http://htop.sourceforge.net/
 license    = GPLv2
 summary    = Command line tools to determine current CPUfreq settings and to modify them
@@ -30,9 +30,14 @@ end
 
 packages
        package %{name}
+               groups += Base
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index ac714726e058099e1438fca2bfe33f9571916170..f008a9ba125ab1607af6a54ef2c5fa4f7d9bf56d 100644 (file)
@@ -70,27 +70,31 @@ packages
        package %{name}
                requires = %{name}-dicts
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
-       
+
        # We build an extra package with the dictionaries.
        package %{name}-dicts
                summary = Dictionaries for %{thisapp}.
                description = %{summary}
-       
+
                files
                        /lib/cracklib
                        /usr/share/dict*
                end
        end
-       
+
        # We build an extra python package with the bindings for it.
        package python-cracklib
                summary = Python bindings for ${thisapp}.
                description = %{summary}
-       
+
                files = /usr/lib*/python*
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index d436ca2c35b140c2469278793b0e46b120172625..16af943de31ca68fbec8b2a54b0d03134ef4942a 100644 (file)
@@ -42,4 +42,8 @@ packages
                        wireless-regdb
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 614d1cb306adf556023a5b0ae7a46d87f3adc5a4..ae94fa5be5a222c40c11b745753d46e72e7da86b 100644 (file)
@@ -34,4 +34,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 116aa54b612da3784229dfa76ca54e41710a2b69..8ac4302766a8afe370786d5c6366b82cd31d4230 100644 (file)
@@ -47,8 +47,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 9a78e98460f62e68c92c03c4b90edb39c6329280..39225947d531d30c27a1dc27cd55995967284dc5 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = cups
 version    = 1.4.5
-release    = 5
+release    = 7
 
 groups     = Applications/Printing
 url        = http://cups.org/software.php
@@ -17,7 +17,7 @@ description
        by Apple Inc. for Mac OS(R) X and other UNIX(R)-like operating systems.
 end
 
-source_dl  =
+source_dl  = http://ftp.easysw.com/pub/cups/%{version}/
 sources    = %{thisapp}-source.tar.bz2
 
 build
@@ -74,21 +74,22 @@ build
        end
 end
 
-# XXX what is this?
-# This line has to be added at the installation of cups.
-# File: /lib/udev/rules.d/99-systemd.rules
-# Line: SUBSYSTEM=="usb", ATTR{serial}=="AL01077498", TAG+="systemd", ENV{SYSTEMD_WANTS}="cups.service"
-
 packages
        package %{name}
                requires = ghostscript
        end
-       
+
        package %{name}-devel
                template DEVEL
+
+               requires += %{name}-libs=%{thisver}
        end
-       
+
        package %{name}-libs
                template LIBS
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 3baf575035eabdace22433034dd4f4631b596daf..68a22bfaededffd5bc1ece7237a805afb2791d5a 100644 (file)
@@ -4,8 +4,8 @@
 ###############################################################################
 
 name       = curl
-version    = 7.21.7
-release    = 1
+version    = 7.23.1
+release    = 2
 
 groups     = Application/Internet
 url        = http://www.curl.haxx.se/
@@ -20,7 +20,7 @@ description
        user authentication, FTP upload, HTTP post, and file transfer resume.
 end
 
-source_dl  =
+source_dl  = http://curl.haxx.se/download/
 
 build
        requires
@@ -53,20 +53,25 @@ build
                autoreconf -vfi
        end
 
-       # Doesn't work
-       #test
-       #       make check
-       #end
+       test
+               make check
+       end
 end
 
 packages
        package curl
-       
+
        package libcurl
                template LIBS
        end
-       
+
        package libcurl-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+
+               provides += libcurl-debuginfo
+       end
 end
index beab6159ecc23365da1a7c826206bff6e2b317de..4609f37beee9e2d6e241de834c1dede2a2262db8 100644 (file)
@@ -4,8 +4,8 @@
 ###############################################################################
 
 name       = cyrus-sasl
-version    = 2.1.23
-release    = 0
+version    = 2.1.25
+release    = 1
 
 groups     = System/Libraries
 url        = http://asg.web.cmu.edu/sasl/sasl-library.html
@@ -18,7 +18,7 @@ description
        adding authentication support to connection-based protocols.
 end
 
-source_dl  =
+source_dl  = ftp://ftp.cyrusimap.org/cyrus-sasl/
 
 build
        requires
@@ -50,8 +50,12 @@ packages
        package %{name}-libs
                template LIBS
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/cyrus-sasl/patches/cyrus-sasl-2.1.23-bad-elif.patch b/cyrus-sasl/patches/cyrus-sasl-2.1.23-bad-elif.patch
deleted file mode 100644 (file)
index 33550c4..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -up cyrus-sasl-2.1.22/plugins/digestmd5.c.elif cyrus-sasl-2.1.22/plugins/digestmd5.c
---- cyrus-sasl-2.1.22/plugins/digestmd5.c.elif 2009-01-23 09:40:31.000000000 +0100
-+++ cyrus-sasl-2.1.22/plugins/digestmd5.c      2009-02-06 15:20:15.000000000 +0100
-@@ -2743,7 +2743,7 @@ static sasl_server_plug_t digestmd5_serv
-       "DIGEST-MD5",                   /* mech_name */
- #ifdef WITH_RC4
-       128,                            /* max_ssf */
--#elif WITH_DES
-+#elif defined(WITH_DES)
-       112,
- #else 
-       1,
-@@ -4071,7 +4071,7 @@ static sasl_client_plug_t digestmd5_clie
-       "DIGEST-MD5",
- #ifdef WITH_RC4                               /* mech_name */
-       128,                            /* max ssf */
--#elif WITH_DES
-+#elif defined(WITH_DES)
-       112,
- #else
-       1,
index 4a0833508b139f4723209a389c4151bf63be25ba..4ac512b777614c6ea4be5bbc8663d7291a19f2e2 100644 (file)
@@ -46,4 +46,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 6839448047cd830db137f0b69d45bacadb8050ad..4fe07f95baa8927876cc77a3350cfb797ba6c575 100644 (file)
@@ -4,8 +4,8 @@
 ###############################################################################
 
 name       = db
-version_major = 4.7
-version_minor = 25
+version_major = 4.8
+version_minor = 30
 version    = %{version_major}.%{version_minor}
 release    = 1
 epoch      = 1
@@ -51,14 +51,14 @@ end
 
 packages
        package db4
-       
+
        package db4-devel
                template DEVEL
 
                files += \
                        !/usr/lib*/libdb-%{version_major}.so
        end
-       
+
        package db4-utils
                summary = Command line tools for managing Berkeley DB (version 4) databases.
                description = %{summary}
@@ -67,7 +67,7 @@ packages
                        /usr/bin
                end
        end
-       
+
        package db4-cxx
                summary = The Berkeley DB database library (version 4) for C++.
                description = %{summary}
@@ -76,4 +76,8 @@ packages
                        /usr/lib*/libdb_cxx-%{version_major}.so
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/db4/patches/db-4.7.25-upstream_fixes-1.patch b/db4/patches/db-4.7.25-upstream_fixes-1.patch
deleted file mode 100644 (file)
index a8de431..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-Submitted By: DJ Lucas <dj_AT_linuxfromscratch_DOT_org>
-Date: 2008-09-28
-Initial Package Version: 4.7.25
-Upstream Status: From Upstream
-Origin: http://www.oracle.com/technology/products/berkeley-db/db/update/4.7.25/patch.4.7.25.1
-Description: Update to latest patch for 4.7.25 release (avoid improperly named
-             patches in LFS).
-
-diff -Naur db-4.7.25-orig/sequence/sequence.c db-4.7.25/sequence/sequence.c
---- db-4.7.25-orig/sequence/sequence.c 2008-05-05 15:25:09.000000000 -0500
-+++ db-4.7.25/sequence/sequence.c      2008-09-28 00:03:59.000000000 -0500
-@@ -187,7 +187,11 @@
-       if ((ret = __db_get_flags(dbp, &tflags)) != 0)
-               goto err;
--      if (DB_IS_READONLY(dbp)) {
-+      /*
-+       * We can let replication clients open sequences, but must
-+       * check later that they do not update them.
-+       */
-+      if (F_ISSET(dbp, DB_AM_RDONLY)) {
-               ret = __db_rdonly(dbp->env, "DB_SEQUENCE->open");
-               goto err;
-       }
-@@ -244,6 +248,11 @@
-               if ((ret != DB_NOTFOUND && ret != DB_KEYEMPTY) ||
-                   !LF_ISSET(DB_CREATE))
-                       goto err;
-+              if (IS_REP_CLIENT(env) &&
-+                  !F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
-+                      ret = __db_rdonly(env, "DB_SEQUENCE->open");
-+                      goto err;
-+              }
-               ret = 0;
-               rp = &seq->seq_record;
-@@ -296,7 +305,12 @@
-        */
-       rp = seq->seq_data.data;
-       if (rp->seq_version == DB_SEQUENCE_OLDVER) {
--oldver:               rp->seq_version = DB_SEQUENCE_VERSION;
-+oldver:               if (IS_REP_CLIENT(env) &&
-+                  !F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
-+                      ret = __db_rdonly(env, "DB_SEQUENCE->open");
-+                      goto err;
-+              }
-+              rp->seq_version = DB_SEQUENCE_VERSION;
-               if (!F_ISSET(env, ENV_LITTLEENDIAN)) {
-                       if (IS_DB_AUTO_COMMIT(dbp, txn)) {
-                               if ((ret =
-@@ -707,6 +721,13 @@
-       MUTEX_LOCK(env, seq->mtx_seq);
-+      if (handle_check && IS_REP_CLIENT(env) &&
-+          !F_ISSET(dbp, DB_AM_NOT_DURABLE)) {
-+              ret = __db_rdonly(env, "DB_SEQUENCE->get");
-+              goto err;
-+      }
-+
-+
-       if (rp->seq_min + delta > rp->seq_max) {
-               __db_errx(env, "Sequence overflow");
-               ret = EINVAL;
index c80decc2741b37f346b3690e11204c6512aedf33..8054c6d37ed4467cf20d1d0c964c31b0253d463c 100644 (file)
@@ -49,10 +49,14 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
-       
+
                requires = glib2-devel
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 95921949e8151fc0b3d24a7ec248b5b503b10a7e..7286d068a5a643f9c99c06e2147ad74709a72446 100644 (file)
@@ -4,8 +4,8 @@
 ###############################################################################
 
 name       = dbus
-version    = 1.4.0
-release    = 3
+version    = 1.4.14
+release    = 2
 
 groups     = System/Daemons
 url        = http://www.freedesktop.org/software/dbus/
@@ -13,12 +13,12 @@ license    = GPLv2+ AFL
 summary    = D-BUS message bus.
 
 description
-       D-BUS is a system for sending messages between applications. It is \
-       used both for the system-wide message bus service, and as a \
+       D-BUS is a system for sending messages between applications. It is
+       used both for the system-wide message bus service, and as a
        per-user-login-session messaging facility.
 end
 
-source_dl  =
+source_dl  = http://dbus.freedesktop.org/releases/dbus/
 
 build
        requires
@@ -55,15 +55,53 @@ end
 
 packages
        package %{name}
+               prerequires += shadow-utils
+
+               script prein
+                       getent group dbus >/dev/null || groupadd -r dbus
+                       getent passwd dbus >/dev/null || \
+                               useradd -r -g dbus -d / -s /sbin/nologin \
+                                       -c "User for dbus service" dbus
+                       exit  0
+               end
+
+               # Just search for new unit files that were just installed.
+               script postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+
+                       # The dbus service should be started on default.
+                       /bin/systemctl enable dbus.service > /dev/null 2>&1 || :
+               end
+
+               # Disable the service that is to be removed and stop it if it is still running.
+               script preun
+                       /bin/systemctl --no-reload disable dbus.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop dbus.service >/dev/null 2>&1 || :
+               end
+
+               # Just tell systemd that unitfiles have been removed.
+               script postun
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               # Try to restart the service if it is running.
+               script postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl try-restart dbus.service >/dev/null 2>&1 || :
+               end
        end
-       
+
        package %{name}-libs
                template LIBS
        end
-       
+
        package %{name}-devel
                template DEVEL
-       
+
                files += /usr/lib/dbus-1.0
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 52eb826d2e7d8e189eb8293f7645c6edd05e521f..2c0d195a45b5b2930b5ada473ea1aa85c9ef0ab2 100644 (file)
@@ -41,7 +41,7 @@ packages
        package %{name}
                requires = expect tcl
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
diff --git a/dev86/dev86.nm b/dev86/dev86.nm
new file mode 100644 (file)
index 0000000..c31897e
--- /dev/null
@@ -0,0 +1,60 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = dev86
+version    = 0.16.18
+release    = 1
+
+maintainer = Ben Schweikert <ben.schweikert@ipfire.org>
+groups     = Development/Languages
+url        = http://www.debath.co.uk/dev86/
+license    = GPL+
+summary    = Cross development C compiler.
+
+description
+       This is a cross development C compiler, assembler and linker
+       environment for the production of 8086 executables
+       (Optionally MSDOS COM)
+end
+
+source_dl = http://www.debath.co.uk/dev86/
+sources   = Dev86src-%{version}.tar.gz
+
+build
+       requires
+               ncurses-devel
+       end
+
+       build
+               make bcc86 unproto copt as86 ld86 CFLAGS="%{CFLAGS}"
+               make -C cpp CFLAGS="%{CFLAGS}" %{PARALLELISMFLAGS}
+               make -C ar CFLAGS="%{CFLAGS}" %{PARALLELISMFLAGS}
+               make -C ld CFLAGS="%{CFLAGS}" %{PARALLELISMFLAGS}
+
+               # ncc doesn't support gcc optflags and no parallel build
+               make
+       end
+
+       make_install_targets = \
+               DIST=%{BUILDROOT} \
+               MANDIR=/usr/share/man \
+               LIBDIR=/usr/lib/bcc \
+               INCLDIR=/usr/include/bcc \
+               LOCLAPREFIX=/usr \
+               install install-man
+
+       install_cmds
+               # Remove useless files.
+               rm -rf %{BUILDROOT}/usr/share/{applications,pixmaps}
+       end
+end
+
+packages
+       package %{name}
+
+       package %{name}-devel
+               template DEVEL
+       end
+end
diff --git a/dev86/patches/01-dev86-pic.patch b/dev86/patches/01-dev86-pic.patch
new file mode 100644 (file)
index 0000000..ec5d706
--- /dev/null
@@ -0,0 +1,20 @@
+--- dev86-0.16.18/elksemu/elks.c.orig  2005-11-04 01:35:37.000000000 +0100
++++ dev86-0.16.18/elksemu/elks.c       2005-11-04 01:45:28.000000000 +0100
+@@ -129,8 +129,17 @@
+ static inline int vm86_mine(struct vm86_struct* v86)
+ {
+       int __res;
++#ifndef __PIC__
+       __asm__ __volatile__("int $0x80\n"
+       :"=a" (__res):"a" ((int)OLD_SYS_vm86), "b" ((int)v86));
++#else
++      __asm__ __volatile__(
++              "movl   %%ebx,%%ecx\n\t"
++              "movl   %2,%%ebx\n\t"
++              "int    $0x80\n\t"
++              "movl   %%ecx,%%ebx\n\t"
++              :"=a" (__res):"a" ((int)OLD_SYS_vm86), "r" ((int)v86) : "ecx");
++#endif
+       return __res;
+ } 
+ #endif
diff --git a/dev86/patches/02-dev86-0.16.17-fortify.patch b/dev86/patches/02-dev86-0.16.17-fortify.patch
new file mode 100644 (file)
index 0000000..715d0c4
--- /dev/null
@@ -0,0 +1,43 @@
+--- dev86-0.16.17/bcc/bcc.c
++++ dev86-0.16.17/bcc/bcc.c
+@@ -19,6 +19,7 @@
+ #ifdef __STDC__
+ #include <stdlib.h>
+ #ifndef MSDOS
++#include <limits.h>
+ #include <unistd.h>
+ #endif
+ #else
+@@ -596,12 +597,17 @@
+    }
+ }
+-void
+-command_reset()
+-{
+ #ifndef MAXPATHLEN
++#ifdef PATH_MAX
++#define MAXPATHLEN PATH_MAX
++#else
+ #define MAXPATHLEN 1024
+ #endif
++#endif
++
++void
++command_reset()
++{
+    char buf[MAXPATHLEN];
+    char ** prefix;
+    char * saved_cmd;
+@@ -1308,11 +1314,7 @@
+       for(d=s=ptr; d && *s; s=d)
+       {
+-#ifdef MAXPATHLEN
+          char buf[MAXPATHLEN];
+-#else
+-         char buf[1024];
+-#endif
+        free(temp);
+          d=strchr(s, ':');
index 05dfd2fe228ffed47088093a345438346918ce9a..507891a9e9bb7d7915ef0b221deb2cebfd304f06 100644 (file)
@@ -16,7 +16,7 @@ description
        DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
        individual devices on an IP network to get their own network
        configuration information (IP address, subnetmask, broadcast address,
-       etc.) from a DHCP server. The overall purpose of DHCP is to make it 
+       etc.) from a DHCP server. The overall purpose of DHCP is to make it
        easier to administer a large network.
 end
 
@@ -189,7 +189,7 @@ packages
        package %{name}-common
                summary = Common files used by the dhcp client and server.
                description = %{summary}
-               
+
                files
                        /usr/bin/
                        /usr/share/man/man1/omshell.1*
@@ -205,4 +205,8 @@ packages
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index b43cc70ca54a17aa7924faa39031bf22af7d6d8c..ef2d45c51bf512abb3bb7a0d7048717e84e928ca 100644 (file)
@@ -27,4 +27,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/dialog/dialog.nm b/dialog/dialog.nm
new file mode 100644 (file)
index 0000000..b46ae2b
--- /dev/null
@@ -0,0 +1,64 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = dialog
+version    = 1.1
+svn_ver    = 20111020
+release    = 1.%{svn_ver}
+thisapp    = %{name}-%{version}-%{svn_ver}
+
+groups     = Applications/System
+url        = http://invisible-island.net/dialog/dialog.html
+license    = LGPLv2
+summary    = A utility for creating TTY dialog boxes.
+
+description
+       Dialog is a utility that allows you to show dialog boxes (containing
+       questions or messages) in TTY (text mode) interfaces.  Dialog is called
+       from within a shell script.  The following dialog boxes are implemented:
+       yes/no, menu, input, message, text, info, checklist, radiolist, and
+       gauge.
+end
+
+source_dl  = ftp://invisible-island.net/dialog/
+sources    = %{thisapp}.tgz
+
+build
+       requires
+               findutils
+               gettext
+               libtool
+               ncurses-devel
+       end
+
+       configure_options += \
+               --enable-nls \
+               --with-libtool \
+               --with-ncursesw \
+               --includedir=/usr/include/dialog \
+               --mandir=/usr/share/man
+
+       install_cmds
+               chmod -v 755 %{BUILDROOT}/usr/lib/libdialog.so.*.*.*
+       end
+end
+
+quality-agent
+       whitelist_rpath
+               /usr/lib
+       end
+end
+
+packages
+       package %{name}
+
+       package %{name}-devel
+               template DEVEL
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
diff --git a/dialog/patches/dialog-incdir.patch b/dialog/patches/dialog-incdir.patch
new file mode 100644 (file)
index 0000000..f31f57b
--- /dev/null
@@ -0,0 +1,23 @@
+diff -up dialog-1.1-20110707/dialog-config.in.incdir dialog-1.1-20110707/dialog-config.in
+--- dialog-1.1-20110707/dialog-config.in.incdir        2011-01-06 10:38:03.000000000 +0100
++++ dialog-1.1-20110707/dialog-config.in       2011-07-26 13:00:02.692038027 +0200
+@@ -35,6 +35,7 @@ bindir="@bindir@"
+ libdir="@libdir@"
+ datadir="@datadir@"
+ mandir="@mandir@"
++includedir="@includedir@"
+ THIS="@PACKAGE@"
+@@ -67,10 +68,7 @@ while test $# -gt 0; do
+               ;;
+       # compile/link
+       --cflags)
+-              INCS=
+-              if test "${prefix}/include" != /usr/include ; then
+-                      INCS="-I${prefix}/include"
+-              fi
++              INCS="-I$includedir"
+               sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
+                       $INCS
+ ENDECHO
diff --git a/dialog/patches/dialog-libs.patch b/dialog/patches/dialog-libs.patch
new file mode 100644 (file)
index 0000000..8669336
--- /dev/null
@@ -0,0 +1,17 @@
+diff -up dialog-1.1-20110707/makefile.in.libs dialog-1.1-20110707/makefile.in
+--- dialog-1.1-20110707/makefile.in.libs       2011-06-25 02:27:56.000000000 +0200
++++ dialog-1.1-20110707/makefile.in    2011-07-26 13:04:50.389183890 +0200
+@@ -176,11 +176,11 @@ dialog$o \
+ $(OBJECTS) : $(srcdir)/dialog.h $(srcdir)/dlg_keys.h dlg_config.h VERSION
+ $(LIB) : $(LIB_OBJECT)
+-      $(LIBTOOL_CREATE) $(LIB) $(LIB_OBJECT)
++      $(LIBTOOL_CREATE) $(LIB) $(LIB_OBJECT) $(LIBS)
+       $(RANLIB) $@
+ dialog$x : $(LIB) dialog$o @INTLDIR_MAKE@ @INTLLIBS@
+-      $(LINK) -o $@ dialog$o -L. -l@PACKAGE@ $(LDFLAGS) $(LIBS)
++      $(LINK) -o $@ dialog$o -L. -l@PACKAGE@ $(LDFLAGS)
+ clean \
+ distclean \
diff --git a/dialog/patches/dialog-multilib.patch b/dialog/patches/dialog-multilib.patch
new file mode 100644 (file)
index 0000000..fc35c76
--- /dev/null
@@ -0,0 +1,32 @@
+diff -up dialog-1.1-20110707/dialog-config.in.multilib dialog-1.1-20110707/dialog-config.in
+--- dialog-1.1-20110707/dialog-config.in.multilib      2011-07-26 13:01:29.929082616 +0200
++++ dialog-1.1-20110707/dialog-config.in       2011-07-26 13:01:29.932082618 +0200
+@@ -32,7 +32,7 @@ prefix="@prefix@"
+ exec_prefix="@exec_prefix@"
+ bindir="@bindir@"
+-libdir="@libdir@"
++libdir=
+ datadir="@datadir@"
+ mandir="@mandir@"
+ includedir="@includedir@"
+@@ -75,7 +75,7 @@ ENDECHO
+               ;;
+       --libs)
+               sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
+-                      -L${exec_prefix}/lib -l${THIS} @LIBS@
++                      -l${THIS}
+ ENDECHO
+               ;;
+       # identification
+diff -up dialog-1.1-20110707/headers-sh.in.multilib dialog-1.1-20110707/headers-sh.in
+--- dialog-1.1-20110707/headers-sh.in.multilib 2011-01-06 10:38:25.000000000 +0100
++++ dialog-1.1-20110707/headers-sh.in  2011-07-26 13:02:44.177120225 +0200
+@@ -127,6 +127,7 @@ EOF
+               echo "s,#include <${pkgname}_,#include <${PACKAGE}/${pkgname}_," >>$TMPSED
+       fi
++      echo '/_FILE_OFFSET_BITS/d' >>$TMPSED
+       # reduce the count if possible, since some old sed's limit is 100 lines
+       sort -u $TMPSED >headers.tmp
+       mv headers.tmp $TMPSED
index 1fa2b4fc3eace5facd88a92abfe321e26d369173..9d676c37fee203d0d17502865512106efdb71b34 100644 (file)
@@ -4,10 +4,10 @@
 ###############################################################################
 
 name       = diffutils
-version    = 3.0
-release    = 1
+version    = 3.2
+release    = 2
 
-groups     = Base Build Development/Tools
+groups     = Development/Tools
 url        = http://www.gnu.org/software/diffutils/diffutils.html
 license    = GPLv2+
 summary    = A GNU collection of diff utilities.
@@ -19,7 +19,7 @@ description
        cmp can show the characters that differ between the two files.
 end
 
-source_dl  =
+source_dl  = http://ftp.gnu.org/gnu/diffutils/
 
 build
        configure_options += \
@@ -32,4 +32,10 @@ end
 
 packages
        package %{name}
+               groups += Base Build
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/diffutils/patches/diffutils-2.8.1-hardened_tmp-1.patch b/diffutils/patches/diffutils-2.8.1-hardened_tmp-1.patch
deleted file mode 100644 (file)
index c335090..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
-Date: 2006-10-09
-Initial Package Version: 2.8.7
-Upstream Status: Submitted - Partially accepted
-Thread starts here:
-       http://sources.redhat.com/ml/bug-gnu-utils/2000-12/msg00163.html
-Origin: ALT Linux / Openwall Owl Linux - diffutils-2.8.7-alt-tmp.diff
-Description: This patch removes the more portable and less safe use of
-tmpname(3), in preference of mkstemp(3).
-
---- diffutils-2.8.7/src/sdiff.c.orig   2004-04-12 07:44:35 +0000
-+++ diffutils-2.8.7/src/sdiff.c        2005-05-17 12:58:44 +0000
-@@ -990,13 +990,13 @@ edit (struct line_filter *left, char con
-           int fd;
-           if (tmpname)
--            tmp = fopen (tmpname, "w");
--          else
-             {
--              if ((fd = temporary_file ()) < 0)
--                perror_fatal ("mkstemp");
--              tmp = fdopen (fd, "w");
-+              unlink (tmpname);
-+              free (tmpname);
-             }
-+          if ((fd = temporary_file ()) < 0)
-+            perror_fatal ("mkstemp");
-+          tmp = fdopen (fd, "w");
-           if (! tmp)
-             perror_fatal (tmpname);
diff --git a/diffutils/patches/diffutils-2.9-i18n-1.patch b/diffutils/patches/diffutils-2.9-i18n-1.patch
deleted file mode 100644 (file)
index b6f12ef..0000000
+++ /dev/null
@@ -1,768 +0,0 @@
---- diffutils-2.9/src/diff.c   2010-02-11 10:39:17.000000000 +0100
-+++ diffutils-2.9.mod/src/diff.c       2010-02-13 15:28:22.268208253 +0100
-@@ -284,6 +284,13 @@
-   re_set_syntax (RE_SYNTAX_GREP | RE_NO_POSIX_BACKTRACKING);
-   excluded = new_exclude ();
-+#ifdef HANDLE_MULTIBYTE
-+  if (MB_CUR_MAX > 1)
-+    lines_differ = lines_differ_multibyte;
-+  else
-+#endif
-+    lines_differ = lines_differ_singlebyte;
-+
-   /* Decode the options.  */
-   while ((c = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1)
---- diffutils-2.9/src/diff.h   2010-02-11 10:05:57.000000000 +0100
-+++ diffutils-2.9.mod/src/diff.h       2010-02-13 15:28:22.269208190 +0100
-@@ -23,6 +23,19 @@
- #include <stdio.h>
- #include <unlocked-io.h>
-+/* For platform which support the ISO C amendement 1 functionality we
-+   support user defined character classes.  */
-+#if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H
-+/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.  */
-+# include <wchar.h>
-+# include <wctype.h>
-+# if defined (HAVE_MBRTOWC)
-+#  define HANDLE_MULTIBYTE      1
-+# endif
-+#endif
-+
-+#define TAB_WIDTH 8
-+
- /* What kind of changes a hunk contains.  */
- enum changes
- {
-@@ -350,7 +363,13 @@
- extern char const pr_program[];
- char *concat (char const *, char const *, char const *);
- char *dir_file_pathname (char const *, char const *);
--bool lines_differ (char const *, char const *);
-+
-+bool (*lines_differ) (char const *, char const *);
-+bool lines_differ_singlebyte (char const *, char const *);
-+#ifdef HANDLE_MULTIBYTE
-+bool lines_differ_multibyte (char const *, char const *);
-+#endif
-+
- lin translate_line_number (struct file_data const *, lin);
- struct change *find_change (struct change *);
- struct change *find_reverse_change (struct change *);
---- diffutils-2.9/src/io.c     2010-02-05 09:10:15.000000000 +0100
-+++ diffutils-2.9.mod/src/io.c 2010-02-13 15:39:59.313224273 +0100
-@@ -22,6 +22,7 @@
- #include <cmpbuf.h>
- #include <file-type.h>
- #include <xalloc.h>
-+#include <assert.h>
- /* Rotate an unsigned value to the left.  */
- #define ROL(v, n) ((v) << (n) | (v) >> (sizeof (v) * CHAR_BIT - (n)))
-@@ -194,6 +195,28 @@
\f
- /* Split the file into lines, simultaneously computing the equivalence
-    class for each line.  */
-+#ifdef HANDLE_MULTIBYTE
-+# define MBC2WC(P, END, MBLENGTH, WC, STATE, CONVFAIL)                        \
-+do                                                                    \
-+{                                                                     \
-+    mbstate_t state_bak = STATE;                                      \
-+                                                                      \
-+    CONVFAIL = 0;                                                     \
-+    MBLENGTH = mbrtowc (&WC, P, END - (char const *)P, &STATE);               \
-+                                                                      \
-+    switch (MBLENGTH)                                                 \
-+      {                                                                       \
-+      case (size_t)-2:                                                        \
-+      case (size_t)-1:                                                        \
-+      STATE = state_bak;                                              \
-+      ++CONVFAIL;                                                     \
-+        /* Fall through. */                                           \
-+      case 0:                                                         \
-+      MBLENGTH = 1;                                                   \
-+      }                                                                       \
-+}                                                                     \
-+while (0)
-+#endif
- static void
- find_and_hash_each_line (struct file_data *current)
-@@ -220,12 +243,282 @@
-   bool same_length_diff_contents_compare_anyway =
-     diff_length_compare_anyway | ignore_case;
-+#ifdef HANDLE_MULTIBYTE
-+  wchar_t   wc;
-+  size_t    mblength;
-+  mbstate_t state;
-+  int       convfail;
-+
-+  memset (&state, '\0', sizeof (mbstate_t));
-+#endif
-+
-   while (p < suffix_begin)
-     {
-       char const *ip = p;
-       h = 0;
-+#ifdef HANDLE_MULTIBYTE
-+      if (MB_CUR_MAX > 1)
-+       {
-+         wchar_t   lo_wc;
-+         char      mbc[MB_LEN_MAX];
-+         mbstate_t state_wc;
-+
-+         /* Hash this line until we find a newline.  */
-+         switch (ignore_white_space)
-+           {
-+           case IGNORE_ALL_SPACE:
-+             while (1)
-+               {
-+                 if (*p == '\n')
-+                   {
-+                     ++p;
-+                     break;
-+                   }
-+
-+                 MBC2WC (p, suffix_begin, mblength, wc, state, convfail);
-+
-+                 if (convfail)
-+                   mbc[0] = *p++;
-+                 else if (!iswspace (wc))
-+                   {
-+                     bool flag = 0;
-+
-+                     if (ignore_case)
-+                       {
-+                         lo_wc = towlower (wc);
-+                         if (lo_wc != wc)
-+                           {
-+                             flag = 1;
-+
-+                             p += mblength;
-+                             memset (&state_wc, '\0', sizeof(mbstate_t));
-+                             mblength = wcrtomb (mbc, lo_wc, &state_wc);
-+
-+                             assert (mblength != (size_t)-1 &&
-+                                 mblength != (size_t)-2);
-+
-+                             mblength = (mblength < 1) ? 1 : mblength;
-+                           }
-+                       }
-+
-+                     if (!flag)
-+                       {
-+                         for (i = 0; i < mblength; i++)
-+                           mbc[i] =  *p++;
-+                       }
-+                   }
-+                 else
-+                   {
-+                     p += mblength;
-+                     continue;
-+                   }
-+
-+                 for (i = 0; i < mblength; i++)
-+                   h = HASH (h, mbc[i]);
-+               }
-+             break;
-+
-+           case IGNORE_SPACE_CHANGE:
-+             while (1)
-+               {
-+                 if (*p == '\n')
-+                   {
-+                     ++p;
-+                     break;
-+                   }
-+
-+                 MBC2WC (p, suffix_begin, mblength, wc, state, convfail);
-+
-+                 if (!convfail && iswspace (wc))
-+                   {
-+                     while (1)
-+                       {
-+                         if (*p == '\n')
-+                           {
-+                             ++p;
-+                             goto hashing_done;
-+                           }
-+
-+                         p += mblength;
-+                         MBC2WC (p, suffix_begin, mblength, wc, state, convfail);
-+                         if (convfail || (!convfail && !iswspace (wc)))
-+                           break;
-+                       }
-+                     h = HASH (h, ' ');
-+                   }
-+
-+                 /* WC is now the first non-space.  */
-+                 if (convfail)
-+                   mbc[0] = *p++;
-+                 else
-+                   {
-+                     bool flag = 0;
-+
-+                     if (ignore_case)
-+                       {
-+                         lo_wc = towlower (wc);
-+                         if (lo_wc != wc)
-+                           {
-+                             flag = 1;
-+
-+                             p += mblength;
-+                             memset (&state_wc, '\0', sizeof(mbstate_t));
-+                             mblength = wcrtomb (mbc, lo_wc, &state_wc);
-+
-+                             assert (mblength != (size_t)-1 &&
-+                                 mblength != (size_t)-2);
-+
-+                             mblength = (mblength < 1) ? 1 : mblength;
-+                           }
-+                       }
-+
-+                     if (!flag)
-+                       {
-+                         for (i = 0; i < mblength; i++)
-+                           mbc[i] = *p++;
-+                       }
-+                   }
-+
-+                 for (i = 0; i < mblength; i++)
-+                   h = HASH (h, mbc[i]);
-+               }
-+             break;
-+
-+           case IGNORE_TAB_EXPANSION:
-+               {
-+                 size_t column = 0;
-+
-+                 while (1)
-+                   {
-+                     if (*p == '\n')
-+                       {
-+                         ++p;
-+                         break;
-+                       }
-+
-+                     MBC2WC (p, suffix_begin, mblength, wc, state, convfail);
-+
-+                     if (convfail)
-+                       {
-+                         h = HASH (h, *p++);
-+                         ++column;
-+                       }
-+                     else
-+                       {
-+                         bool flag;
-+
-+                         switch (wc)
-+                           {
-+                           case L'\b':
-+                             column -= 0 < column;
-+                             h = HASH (h, '\b');
-+                             ++p;
-+                             break;
-+
-+                           case L'\t':
-+                               {
-+                                 int repetitions;
-+
-+                                 repetitions = TAB_WIDTH - column % TAB_WIDTH;
-+                                 column += repetitions;
-+                                 do
-+                                   h = HASH (h, ' ');
-+                                 while (--repetitions != 0);
-+                                 ++p;
-+                               }
-+                             break;
-+
-+                           case L'\r':
-+                             column = 0;
-+                             h = HASH (h, '\r');
-+                             ++p;
-+                             break;
-+
-+                           default:
-+                             flag = 0;
-+                             column += wcwidth (wc);
-+                             if (ignore_case)
-+                               {
-+                                 lo_wc = towlower (wc);
-+                                 if (lo_wc != wc)
-+                                   {
-+                                     flag = 1;
-+                                     p += mblength;
-+                                     memset (&state_wc, '\0', sizeof(mbstate_t));
-+                                     mblength = wcrtomb (mbc, lo_wc, &state_wc);
-+
-+                                     assert (mblength != (size_t)-1 &&
-+                                         mblength != (size_t)-2);
-+
-+                                     mblength = (mblength < 1) ? 1 : mblength;
-+                                   }
-+                               }
-+
-+                             if (!flag)
-+                               {
-+                                 for (i = 0; i < mblength; i++)
-+                                   mbc[i] = *p++;
-+                               }
-+
-+                             for (i = 0; i < mblength; i++)
-+                               h = HASH (h, mbc[i]);
-+                           }
-+                       }
-+                   }
-+               }
-+             break;
-+
-+           default:
-+             while (1)
-+               {
-+                 if (*p == '\n')
-+                   {
-+                     ++p;
-+                     break;
-+                   }
-+
-+                 MBC2WC (p, suffix_begin, mblength, wc, state, convfail);
-+
-+                 if (convfail)
-+                   mbc[0] = *p++;
-+                 else
-+                   {
-+                     int flag = 0;
-+
-+                     if (ignore_case)
-+                       {
-+                         lo_wc = towlower (wc);
-+                         if (lo_wc != wc)
-+                           {
-+                             flag = 1;
-+                             p += mblength;
-+                             memset (&state_wc, '\0', sizeof(mbstate_t));
-+                             mblength = wcrtomb (mbc, lo_wc, &state_wc);
-+
-+                             assert (mblength != (size_t)-1 &&
-+                                 mblength != (size_t)-2);
-+
-+                             mblength = (mblength < 1) ? 1 : mblength;
-+                           }
-+                       }
-+
-+                     if (!flag)
-+                       {
-+                         for (i = 0; i < mblength; i++)
-+                           mbc[i] = *p++;
-+                       }
-+                   }
-+
-+                 for (i = 0; i < mblength; i++)
-+                   h = HASH (h, mbc[i]);
-+               }
-+           }
-+       }
-+      else
-+#endif
-+
-       /* Hash this line until we find a newline.  */
-       if (ignore_case)
-       switch (ignore_white_space)
---- diffutils-2.9/src/side.c   2010-02-05 09:10:15.000000000 +0100
-+++ diffutils-2.9.mod/src/side.c       2010-02-13 15:51:32.647221551 +0100
-@@ -77,11 +77,74 @@
-   register char const *text_limit = line[1];
-   mbstate_t mbstate = { 0 };
-+#if defined HAVE_WCHAR_H && defined HAVE_WCTYPE_H
-+  unsigned char mbc[MB_LEN_MAX];
-+  wchar_t wc;
-+  mbstate_t state, state_bak;
-+  size_t mbc_pos, mblength;
-+  int mbc_loading_flag = 0;
-+  int wc_width;
-+
-+  memset (&state, '\0', sizeof (mbstate_t));
-+#endif
-+
-   while (text_pointer < text_limit)
-     {
-       char const *tp0 = text_pointer;
-       register char c = *text_pointer++;
-+#if defined HAVE_WCHAR_H && defined HAVE_WCTYPE_H
-+      if (MB_CUR_MAX > 1 && mbc_loading_flag)
-+       {
-+         mbc_loading_flag = 0;
-+         state_bak = state;
-+         mbc[mbc_pos++] = c;
-+
-+process_mbc:
-+         mblength = mbrtowc (&wc, mbc, mbc_pos, &state);
-+
-+         switch (mblength)
-+           {
-+           case (size_t)-2:    /* Incomplete multibyte character. */
-+             mbc_loading_flag = 1;
-+             state = state_bak;
-+             break;
-+
-+           case (size_t)-1:    /* Invalid as a multibyte character. */
-+             if (in_position++ < out_bound)
-+               {
-+                 out_position = in_position;
-+                 putc (mbc[0], out);
-+               }
-+             memmove (mbc, mbc + 1, --mbc_pos);
-+             if (mbc_pos > 0)
-+               {
-+                 mbc[mbc_pos] = '\0';
-+                 goto process_mbc;
-+               }
-+             break;
-+
-+           default:
-+             wc_width = wcwidth (wc);
-+             if (wc_width < 1) /* Unprintable multibyte character. */
-+               {
-+                 if (in_position <= out_bound)
-+                   fprintf (out, "%lc", (wint_t)wc);
-+               }
-+             else              /* Printable multibyte character. */
-+               {
-+                 in_position += wc_width;
-+                 if (in_position <= out_bound)
-+                   {
-+                     out_position = in_position;
-+                     fprintf (out, "%lc", (wint_t)wc);
-+                   }
-+               }
-+           }
-+         continue;
-+       }
-+#endif
-+
-       switch (c)
-       {
-       case '\t':
---- diffutils-2.9/src/util.c   2010-02-11 10:39:17.000000000 +0100
-+++ diffutils-2.9.mod/src/util.c       2010-02-13 16:08:16.065232588 +0100
-@@ -309,7 +309,7 @@
-   outfile = 0;
- }
--\f
-+
- /* Compare two lines (typically one from each input file)
-    according to the command line options.
-    For efficiency, this is invoked only when the lines do not match exactly
-@@ -317,7 +317,7 @@
-    Return nonzero if the lines differ.  */
- bool
--lines_differ (char const *s1, char const *s2)
-+lines_differ_singlebyte (char const *s1, char const *s2)
- {
-   register char const *t1 = s1;
-   register char const *t2 = s2;
-@@ -446,7 +446,294 @@
-   return true;
- }
--\f
-+
-+#ifdef HANDLE_MULTIBYTE
-+# define MBC2WC(T, END, MBLENGTH, WC, STATE, CONVFAIL)                        \
-+do                                                                    \
-+{                                                                     \
-+    mbstate_t bak = STATE;                                            \
-+                                                                      \
-+    CONVFAIL = 0;                                                     \
-+    MBLENGTH = mbrtowc (&WC, T, END - T, &STATE);                     \
-+                                                                      \
-+    switch (MBLENGTH)                                                 \
-+      {                                                                       \
-+      case (size_t)-2:                                                        \
-+      case (size_t)-1:                                                        \
-+      STATE = bak;                                                    \
-+      ++CONVFAIL;                                                     \
-+        /* Fall through. */                                           \
-+      case 0:                                                         \
-+      MBLENGTH = 1;                                                   \
-+      }                                                                       \
-+}                                                                     \
-+while (0)
-+
-+bool
-+lines_differ_multibyte (char const *s1, char const *s2)
-+{
-+  unsigned char const *end1, *end2;
-+  unsigned char c1, c2;
-+  wchar_t wc1, wc2, wc1_bak, wc2_bak;
-+  size_t mblen1, mblen2;
-+  mbstate_t state1, state2, state1_bak, state2_bak;
-+  int convfail1, convfail2, convfail1_bak, convfail2_bak;
-+  
-+  unsigned char const *t1 = (unsigned char const *) s1;
-+  unsigned char const *t2 = (unsigned char const *) s2;
-+  unsigned char const *t1_bak, *t2_bak;
-+  size_t column = 0;
-+
-+  if (ignore_white_space == IGNORE_NO_WHITE_SPACE  && !ignore_case)
-+    {
-+      while (*t1 != '\n')
-+      if (*t1++ != * t2++)
-+        return 1;
-+      return 0;
-+    }
-+
-+  memset (&state1, '\0', sizeof (mbstate_t));
-+  memset (&state2, '\0', sizeof (mbstate_t));
-+
-+  end1 = s1 + strlen (s1);
-+  end2 = s2 + strlen (s2);
-+
-+  while (1)
-+    {
-+      c1 = *t1;
-+      c2 = *t2;
-+      MBC2WC (t1, end1, mblen1, wc1, state1, convfail1);
-+      MBC2WC (t2, end2, mblen2, wc2, state2, convfail2);
-+
-+      /* Test for exact char equality first, since it's a common case.  */
-+      if (convfail1 ^ convfail2)
-+      break;
-+      else if (convfail1 && convfail2 && c1 != c2)
-+      break;
-+      else if (!convfail1 && !convfail2 && wc1 != wc2)
-+      {
-+        switch (ignore_white_space)
-+          {
-+          case IGNORE_ALL_SPACE:
-+            /* For -w, just skip past any white space.  */
-+            while (1)
-+              {
-+                if (convfail1)
-+                  break;
-+                else if (wc1 == L'\n' || !iswspace (wc1))
-+                  break;
-+
-+                t1 += mblen1;
-+                c1 = *t1;
-+                MBC2WC (t1, end1, mblen1, wc1, state1, convfail1);
-+              }
-+
-+            while (1)
-+              {
-+                if (convfail2)
-+                  break;
-+                else if (wc2 == L'\n' || !iswspace (wc2))
-+                  break;
-+
-+                t2 += mblen2;
-+                c2 = *t2;
-+                MBC2WC (t2, end2, mblen2, wc2, state2, convfail2);
-+              }
-+            t1 += mblen1;
-+            t2 += mblen2;
-+            break;
-+
-+          case IGNORE_SPACE_CHANGE:
-+            /* For -b, advance past any sequence of white space in
-+               line 1 and consider it just one space, or nothing at
-+               all if it is at the end of the line.  */
-+            if (wc1 != L'\n' && iswspace (wc1))
-+              {
-+                size_t mblen_bak;
-+                mbstate_t state_bak;
-+
-+                do
-+                  {
-+                    t1 += mblen1;
-+                    mblen_bak = mblen1;
-+                    state_bak = state1;
-+                    MBC2WC (t1, end1, mblen1, wc1, state1, convfail1);
-+                  }
-+                while (!convfail1 && (wc1 != L'\n' && iswspace (wc1)));
-+
-+                state1 = state_bak;
-+                mblen1 = mblen_bak;
-+                t1 -= mblen1;
-+                convfail1 = 0;
-+                wc1 = L' ';
-+              }
-+
-+            /* Likewise for line 2.  */
-+            if (wc2 != L'\n' && iswspace (wc2))
-+              {
-+                size_t mblen_bak;
-+                mbstate_t state_bak;
-+
-+                do
-+                  {
-+                    t2 += mblen2;
-+                    mblen_bak = mblen2;
-+                    state_bak = state2;
-+                    MBC2WC (t2, end2, mblen2, wc2, state2, convfail2);
-+                  }
-+                while (!convfail2 && (wc2 != L'\n' && iswspace (wc2)));
-+
-+                state2 = state_bak;
-+                mblen2 = mblen_bak;
-+                t2 -= mblen2;
-+                convfail2 = 0;
-+                wc2 = L' ';
-+              }
-+
-+            if (wc1 != wc2)
-+              {
-+                if (wc2 == L' ' && wc1 != L'\n' &&
-+                    t1 > (unsigned char const *)s1 &&
-+                    !convfail1_bak && iswspace (wc1_bak))
-+                  {
-+                    t1 = t1_bak;
-+                    wc1 = wc1_bak;
-+                    state1 = state1_bak;
-+                    convfail1 = convfail1_bak;
-+                    continue;
-+                  }
-+                if (wc1 == L' ' && wc2 != L'\n'
-+                    && t2 > (unsigned char const *)s2
-+                    && !convfail2_bak && iswspace (wc2_bak))
-+                  {
-+                    t2 = t2_bak;
-+                    wc2 = wc2_bak;
-+                    state2 = state2_bak;
-+                    convfail2 = convfail2_bak;
-+                    continue;
-+                  }
-+              }
-+
-+            t1_bak = t1;                t2_bak = t2;
-+            wc1_bak = wc1;              wc2_bak = wc2;
-+            state1_bak = state1;        state2_bak = state2;
-+            convfail1_bak = convfail1;  convfail2_bak = convfail2;
-+
-+            if (wc1 == L'\n')
-+              wc1 = L' ';
-+            else
-+              t1 += mblen1;
-+
-+            if (wc2 == L'\n')
-+              wc2 = L' ';
-+            else
-+              t2 += mblen2;
-+
-+            break;
-+
-+          case IGNORE_TAB_EXPANSION:
-+            if ((wc1 == L' ' && wc2 == L'\t')
-+                || (wc1 == L'\t' && wc2 == L' '))
-+              {
-+                size_t column2 = column;
-+
-+                while (1)
-+                  {
-+                    if (convfail1)
-+                      {
-+                        ++t1;
-+                        break;
-+                      }
-+                    else if (wc1 == L' ')
-+                      column++;
-+                    else if (wc1 == L'\t')
-+                      column += TAB_WIDTH - column % TAB_WIDTH;
-+                    else
-+                      {
-+                        t1 += mblen1;
-+                        break;
-+                      }
-+
-+                    t1 += mblen1;
-+                    c1 = *t1;
-+                    MBC2WC (t1, end1, mblen1, wc1, state1, convfail1);
-+                  }
-+
-+                while (1)
-+                  {
-+                    if (convfail2)
-+                      {
-+                        ++t2;
-+                        break;
-+                      }
-+                    else if (wc2 == L' ')
-+                      column2++;
-+                    else if (wc2 == L'\t')
-+                      column2 += TAB_WIDTH - column2 % TAB_WIDTH;
-+                    else
-+                      {
-+                        t2 += mblen2;
-+                        break;
-+                      }
-+
-+                    t2 += mblen2;
-+                    c2 = *t2;
-+                    MBC2WC (t2, end2, mblen2, wc2, state2, convfail2);
-+                  }
-+
-+                if (column != column2)
-+                  return 1;
-+              }
-+            else
-+              {
-+                t1 += mblen1;
-+                t2 += mblen2;
-+              }
-+            break;
-+
-+          case IGNORE_NO_WHITE_SPACE:
-+            t1 += mblen1;
-+            t2 += mblen2;
-+            break;
-+          }
-+
-+        /* Lowercase all letters if -i is specified.  */
-+        if (ignore_case)
-+          {
-+            if (!convfail1)
-+              wc1 = towlower (wc1);
-+            if (!convfail2)
-+              wc2 = towlower (wc2);
-+          }
-+
-+        if (convfail1 ^ convfail2)
-+          break;
-+        else if (convfail1 && convfail2 && c1 != c2)
-+          break;
-+        else if (!convfail1 && !convfail2 && wc1 != wc2)
-+          break;
-+      }
-+      else
-+      {
-+        t1_bak = t1;                  t2_bak = t2;
-+        wc1_bak = wc1;                wc2_bak = wc2;
-+        state1_bak = state1;          state2_bak = state2;
-+        convfail1_bak = convfail1;    convfail2_bak = convfail2;
-+
-+        t1 += mblen1;                 t2 += mblen2;
-+      }
-+      
-+      if (!convfail1 && wc1 == L'\n')
-+      return 0;
-+
-+      column += convfail1 ? 1 :
-+      (wc1 == L'\t') ? TAB_WIDTH - column % TAB_WIDTH : wcwidth (wc1);
-+    }
-+
-+  return 1;
-+}
-+#endif
-+
- /* Find the consecutive changes at the start of the script START.
-    Return the last link before the first gap.  */
diff --git a/diffutils/patches/diffutils-cmp-s-empty.patch b/diffutils/patches/diffutils-cmp-s-empty.patch
new file mode 100644 (file)
index 0000000..bc1c6b4
--- /dev/null
@@ -0,0 +1,20 @@
+diff -up diffutils-2.8.1/src/cmp.c.cmp-s-empty diffutils-2.8.1/src/cmp.c
+--- diffutils-2.8.1/src/cmp.c.cmp-s-empty      2002-04-05 21:37:31.000000000 +0100
++++ diffutils-2.8.1/src/cmp.c  2010-06-25 14:56:08.464802321 +0100
+@@ -316,12 +316,15 @@ main (int argc, char **argv)
+   /* If only a return code is needed,
+      and if both input descriptors are associated with plain files,
++     and if both files are larger than 0 bytes (procfs files are always 0),
+      conclude that the files differ if they have different sizes
+      and if more bytes will be compared than are in the smaller file.  */
+   if (comparison_type == type_status
+       && S_ISREG (stat_buf[0].st_mode)
+-      && S_ISREG (stat_buf[1].st_mode))
++      && S_ISREG (stat_buf[1].st_mode)
++      && stat_buf[0].st_size > 0
++      && stat_buf[1].st_size > 0)
+     {
+       off_t s0 = stat_buf[0].st_size - file_position (0);
+       off_t s1 = stat_buf[1].st_size - file_position (1);
index 5e777c445bd8fc1249f4bcfb5e56ff9ad6f37a91..e8d24338afd64e7d963646dfaa9ec480d705989c 100644 (file)
@@ -49,4 +49,8 @@ packages
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 43d244a245642a9257fe8e1886942fbfa9f6422b..d42cf91eb96b24f9e326cb3fe77ac449b3a30271 100644 (file)
@@ -33,4 +33,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index e017e197c9b321a9e73c5f47030c5c84a5bd6cc0..9a43c0b513e2855e5de722d0f55198d427a1b116 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = dmraid
 version    = 1.0.0.rc15
-release    = 1
+release    = 2
 
 groups     = System/Filesystems
 url        = http://people.redhat.com/heinzm/sw/dmraid
@@ -13,12 +13,12 @@ license    = GPLv2+
 summary    = Device-mapper RAID tool and library.
 
 description
-       DMRAID supports RAID device discovery, RAID set activation, creation, \
-       removal, rebuild and display of properties for ATARAID/DDF1 metadata on \
+       DMRAID supports RAID device discovery, RAID set activation, creation,
+       removal, rebuild and display of properties for ATARAID/DDF1 metadata on
        Linux >= 2.4 using device-mapper.
 end
 
-source_dl  =
+source_dl  = http://people.redhat.com/heinzm/sw/dmraid/src/old/
 sources    = %{thisapp}.tar.bz2
 
 build
@@ -48,14 +48,21 @@ build
                install -v -m 755 lib/libdmraid.so \
                        %{BUILDROOT}/lib/libdmraid.so.%{version}
                ln -svf ../../lib/libdmraid.so.%{version} %{BUILDROOT}/usr/lib/libdmraid.so
+
+               # Install development headers.
+               install -m 644 include/dmraid/*.h %{BUILDROOT}/usr/include/dmraid/
        end
 end
 
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/docbook-dsssl/docbook-dsssl.nm b/docbook-dsssl/docbook-dsssl.nm
new file mode 100644 (file)
index 0000000..db78d0d
--- /dev/null
@@ -0,0 +1,69 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = docbook-dsssl
+version    = 1.79
+release    = 2
+arch       = noarch
+
+groups     = Applications/Text
+url        = http://docbook.sourceforge.net/
+license    = GPLv2+
+summary    = The DocBook DSSSL Stylesheets package contains DSSSL stylesheets.
+
+description
+       The DocBook DSSSL Stylesheets package contains DSSSL stylesheets. These
+       are used by OpenJade or other tools to transform SGML and XML DocBook files.
+end
+
+source_dl = http://prdownloads.sourceforge.net/docbook/
+
+build
+       requires
+               sgml-common
+       end
+
+       build = # empty
+
+       install
+               mkdir -pv %{BUILDROOT}/usr/bin %{BUILDROOT}/usr/share/man/man1
+               install -v -m755 bin/collateindex.pl %{BUILDROOT}/usr/bin
+               install -v -m644 bin/collateindex.pl.1 %{BUILDROOT}/usr/share/man/man1
+
+               install -v -d -m755 %{BUILDROOT}/usr/share/sgml/docbook/dsssl-stylesheets-%{version}
+               cp -v -R * %{BUILDROOT}/usr/share/sgml/docbook/dsssl-stylesheets-%{version}
+
+               # Remove empty conflicting file.
+               rm -rvf %{BUILDROOT}/etc/sgml/sgml-docbook.cat
+       end
+end
+
+packages
+       package %{name}
+               requires
+                       docbook-dtds
+                       sgml-common
+               end
+
+               prerequires +=\
+                       docbook-dtds \
+                       libxml2 \
+                       sgml-common
+
+               script postin
+                       # Install catalog files.
+                       for centralized in /etc/sgml/*-docbook-*.cat; do
+                               /usr/bin/xmlcatalog --sgml --noout --add ${centralized} /usr/share/sgml/docbook/dsssl-stylesheets-%{version}/catalog > /dev/null 2>/dev/null
+                       done
+               end
+
+               script preun
+                       # Uninstall catalog files.
+                       for centralized in /etc/sgml/*-docbook-*.cat; do
+                               /usr/bin/xmlcatalog --remove ${centralized} /usr/share/sgml/docbook/dsssl-stylesheets-%{version}/catalog > /dev/null 2>/dev/null
+                       done
+               end
+       end
+end
diff --git a/docbook-dtds/docbook-dtds.nm b/docbook-dtds/docbook-dtds.nm
new file mode 100644 (file)
index 0000000..5841054
--- /dev/null
@@ -0,0 +1,260 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = docbook-dtds
+version    = 1.0
+release    = 3
+arch       = noarch
+
+groups     = Applications/Text
+url        = http://www.oasis-open.org/docbook/
+license    = Copyright only
+summary    = SGML and XML document type definitions for DocBook.
+
+description
+       The DocBook Document Type Definition (DTD) describes the syntax of
+       technical documentation texts (articles, books and manual pages).
+       This syntax is XML-compliant and is developed by the OASIS consortium.
+       This package contains SGML and XML versions of the DocBook DTD.
+end
+
+sources = \
+       docbk30.zip \
+       docbk31.zip \
+       docbk40.zip \
+       docbk41.zip \
+       docbkx412.zip \
+       docbook-4.2.zip \
+       docbook-xml-4.2.zip \
+       docbook-4.3.zip \
+       docbook-xml-4.3.zip \
+       docbook-4.4.zip \
+       docbook-xml-4.4.zip \
+       docbook-4.5.zip \
+       docbook-xml-4.5.zip
+
+# Update directories at the scriptlets if there will be any changes.
+directories = \
+       3.0-sgml \
+       3.1-sgml \
+       4.0-sgml \
+       4.1-sgml \
+       4.1.2-xml \
+       4.2-sgml \
+       4.2-xml \
+       4.3-sgml \
+       4.3-xml \
+       4.4-sgml \
+       4.4-xml \
+       4.5-sgml \
+       4.5-xml
+
+build
+       requires
+               dos2unix
+               unzip>=6.0-3
+       end
+
+       prepare
+               # Define a bash function to extract the files
+               function macro_extract()
+               {
+                 mkdir -pv %{DIR_APP}/$2
+                 cd %{DIR_APP}/$2 && unzip %{DIR_DL}/$1
+               }
+
+               # Extract files
+               macro_extract docbk30.zip 3.0-sgml
+               macro_extract docbk31.zip 3.1-sgml
+               macro_extract docbk40.zip 4.0-sgml
+               macro_extract docbk41.zip 4.1-sgml
+               macro_extract docbkx412.zip 4.1.2-xml
+               macro_extract docbook-4.2.zip 4.2-sgml
+               macro_extract docbook-xml-4.2.zip 4.2-xml
+               macro_extract docbook-4.3.zip 4.3-sgml
+               macro_extract docbook-xml-4.3.zip 4.3-xml
+               macro_extract docbook-4.4.zip 4.4-sgml
+               macro_extract docbook-xml-4.4.zip 4.4-xml
+               macro_extract docbook-4.5.zip 4.5-sgml
+               macro_extract docbook-xml-4.5.zip 4.5-xml
+
+               # Convert all catalog files to unix format
+               cd %{DIR_APP} && dos2unix */docbook.cat
+
+               %{MACRO_PATCHES}
+
+               sed -e's,\(NAMELEN\s\+\)44\(\s\*\)\?,\1256,' -i.namelen */docbook.dcl
+               sed -i 's/\r//' */*.txt
+               chown -R root:root .
+               chmod -R a+rX,g-w,o-w .
+       end
+
+       build = # Nothing to do
+
+       install
+               # Create Symlinks.
+               mkdir -pv %{BUILDROOT}/etc/sgml
+               for fmt in sgml xml; do
+                       ln -svf $fmt-docbook-4.5.cat %{BUILDROOT}/etc/sgml/$fmt-docbook.cat
+               done
+
+               for dir in %{directories}; do
+                       fmt=${dir#*-}; ver=${dir%%-*}
+                               cd %{DIR_APP}/$dir
+                               DESTDIR=%{BUILDROOT}/usr/share/sgml/docbook/$fmt-dtd-$ver
+                       mkdir -pv $DESTDIR
+                       case $fmt in
+                               sgml)   mkdir -pv $DESTDIR; install -v *.dcl $DESTDIR ;;
+                               xml)    mkdir -pv $DESTDIR/ent; install -v ent/* $DESTDIR/ent ;;
+                       esac
+                       install -v *.dtd *.mod $DESTDIR
+                       install -v docbook.cat $DESTDIR/catalog
+                       touch %{BUILDROOT}/etc/sgml/${dir#*-}-docbook-$ver.cat
+               done
+       end
+end
+
+packages
+       package %{name}
+
+               prerequires += \
+                       libxml2 \
+                       sgml-common
+
+               script postin
+                       # Install catalog files.
+                       for dir in %{directories}; do
+                               fmt=${dir#*-}
+                               ver=${dir%%-*}
+                                       /usr/bin/xmlcatalog --sgml --noout --add /etc/sgml/${fmt}-docbook-${ver}.cat \
+                                               /usr/share/sgml/docbook/${fmt}-dtd-${ver}/catalog > /dev/null 2>/dev/null
+                                       /usr/bin/xmlcatalog --sgml --noout --add /etc/sgml/${fmt}-docbook-${ver}.cat \
+                                               /usr/share/sgml/sgml-iso-entities-8879.1986/catalog > /dev/null 2>/dev/null
+                       done
+
+                       # Create XML catalog.
+                       for dir in %{directories}; do
+                               fmt=${dir#*-}
+                               ver=${dir%%-*}
+
+                               if [ $fmt = xml -a -w /usr/share/sgml/docbook/xmlcatalog ]; then
+                                       while read f desc; do
+                                       case $ver in 4.[45]) f={$f/-/} ;; esac
+                                               /usr/bin/xmlcatalog --noout --add public "$desc" /usr/share/sgml/docbook/${fmt}-dtd-${ver}/${f} \
+                                                       /etc/sgml/docbook/xmlcatalog /dev/null 2>/dev/null
+                                       done <<ENDENT
+                               ent/iso-pub.ent ISO 8879:1986//ENTITIES Publishing//EN
+                               ent/iso-grk1.ent        ISO 8879:1986//ENTITIES Greek Letters//EN
+                               dbpoolx.mod     -//OASIS//ELEMENTS DocBook XML Information Pool V${ver}//EN
+                               ent/iso-box.ent ISO 8879:1986//ENTITIES Box and Line Drawing//EN
+                               docbookx.dtd    -//OASIS//DTD DocBook XML V${ver}//EN
+                               ent/iso-grk3.ent        ISO 8879:1986//ENTITIES Greek Symbols//EN
+                               ent/iso-amsn.ent        ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN
+                               ent/iso-num.ent ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN
+                               dbcentx.mod     -//OASIS//ENTITIES DocBook XML Character Entities V${ver}//EN
+                               ent/iso-grk4.ent        ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN
+                               dbnotnx.mod     -//OASIS//ENTITIES DocBook XML Notations V${ver}//EN
+                               ent/iso-dia.ent ISO 8879:1986//ENTITIES Diacritical Marks//EN
+                               ent/iso-grk2.ent        ISO 8879:1986//ENTITIES Monotoniko Greek//EN
+                               dbgenent.mod    -//OASIS//ENTITIES DocBook XML Additional General Entities V${ver}//EN
+                               dbhierx.mod     -//OASIS//ELEMENTS DocBook XML Document Hierarchy V${vers}//EN
+                               ent/iso-amsa.ent        ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN
+                               ent/iso-amso.ent        ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN
+                               ent/iso-cyr1.ent        ISO 8879:1986//ENTITIES Russian Cyrillic//EN
+                               ent/iso-tech.ent        ISO 8879:1986//ENTITIES General Technical//EN
+                               ent/iso-amsc.ent        ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN
+                               soextblx.dtd    -//OASIS//DTD XML Exchange Table Model 19990315//EN
+                               calstblx.dtd    -//OASIS//DTD DocBook XML CALS Table Model V${ver}//EN
+                               ent/iso-lat1.ent        ISO 8879:1986//ENTITIES Added Latin 1//EN
+                               ent/iso-amsb.ent        ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN
+                               ent/iso-lat2.ent        ISO 8879:1986//ENTITIES Added Latin 2//EN
+                               ent/iso-amsr.ent        ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN
+                               ent/iso-cyr2.ent        ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN
+                       ENDENT
+
+                                       for f in System URI; do
+                                               /usr/bin/xmlcatalog --noout --add rewrite${f} "http://www.oasis-open.org/docbook/xml/${ver}" \
+                                                       /usr/share/sgml/docbook/${fmt}-dtd-${ver} /etc/sgml/docbook/xmlcatalog > /dev/null 2>/dev/null
+                                       done
+                               fi
+                       done
+
+                       sed -ni '
+                               /xml-docbook/ H
+                               /xml-docbook/ !p
+                                       $ {
+                                               g
+                                               s/^\n//p
+                                       }
+                               ' /etc/sgml/catalog
+
+                       # Finally, make sure everything in /etc/sgml is readable!
+                       chmod a+r /etc/sgml/*
+               end
+
+               script postun
+                       # remove entries only on removal of package
+                       if [ "$1" = 0 ]; then
+
+                               entities="
+                                       ent/iso-pub.ent
+                                       ent/iso-grk1.ent
+                                       dbpoolx.mod
+                                       ent/iso-box.ent
+                                       docbookx.dtd
+                                       ent/iso-grk3.ent
+                                       ent/iso-amsn.ent
+                                       ent/iso-num.ent
+                                       dbcentx.mod
+                                       ent/iso-grk4.ent
+                                       dbnotnx.mod
+                                       ent/iso-dia.ent
+                                       ent/iso-grk2.ent
+                                       dbgenent.mod
+                                       dbhierx.mod
+                                       ent/iso-amsa.ent
+                                       ent/iso-amso.ent
+                                       ent/iso-cyr1.ent
+                                       ent/iso-tech.ent
+                                       ent/iso-amsc.ent
+                                       soextblx.dtd
+                                       calstblx.dtd
+                                       ent/iso-lat1.ent
+                                       ent/iso-amsb.ent
+                                       ent/iso-lat2.ent
+                                       ent/iso-amsr.ent
+                                       ent/iso-cyr2.ent"
+
+                       for dir in %{directories}; do
+                               fmt=${dir#*-} ver=${dir%%-*}
+
+                               ## SGML catalog
+                               # Update the centralized catalog corresponding to this version of the DTD
+                               /usr/bin/xmlcatalog --noout --sgml --del /etc/sgml/catalog /etc/sgml/$fmt-docbook-$ver.cat
+                               rm -f /etc/sgml/$fmt-docbook-$ver.cat
+
+                               ## XML catalog
+                               if [ $fmt = xml -a -w /usr/share/sgml/docbook/xmlcatalog ]; then
+                                       for f in $entities; do
+                                               case $ver in 4.[45]) f=${f/-/} ;; esac
+                                                       /usr/bin/xmlcatalog --noout --del /usr/share/sgml/docbook/$fmt-dtd-$ver/$f /usr/share/sgml/docbook/xmlcatalog
+                                       done
+                                       /usr/bin/xmlcatalog --noout --del /usr/share/sgml/docbook/$fmt-dtd-$ver /usr/share/sgml/docbook/xmlcatalog
+                               fi
+                       done
+
+                       # See the comment attached to this command in the postin scriptlet.
+                       sed -ni '
+                               /xml-docbook/ H
+                               /xml-docbook/ !p
+                                       $ {
+                                               g
+                                               s/^\n//p
+                                       }
+                               ' /etc/sgml/catalog
+                       fi
+               end
+       end
+end
diff --git a/docbook-dtds/patches/docbook-4.2-euro.patch b/docbook-dtds/patches/docbook-4.2-euro.patch
new file mode 100644 (file)
index 0000000..bbace5d
--- /dev/null
@@ -0,0 +1,22 @@
+--- docbook-dtds-1.0/4.2-sgml/docbookx.dtd.euro        2003-07-15 09:07:58.000000000 +0100
++++ docbook-dtds-1.0/4.2-sgml/docbookx.dtd     2003-07-15 09:08:12.000000000 +0100
+@@ -106,7 +106,7 @@
+ <![%dbcent.module;[
+ <![%sgml.features;[
+-<!ENTITY euro "[euro  ]"><!-- euro sign, U+20AC NEW -->
++<!ENTITY euro SDATA "[euro  ]"><!-- euro sign, U+20AC NEW -->
+ ]]>
+ <![%xml.features;[
+ <!ENTITY euro "&#x20AC;"><!-- euro sign, U+20AC NEW -->
+--- docbook-dtds-1.0/4.2-xml/docbookx.dtd.euro 2003-07-15 09:08:02.000000000 +0100
++++ docbook-dtds-1.0/4.2-xml/docbookx.dtd      2003-07-15 09:08:21.000000000 +0100
+@@ -106,7 +106,7 @@
+ <![%dbcent.module;[
+ <![%sgml.features;[
+-<!ENTITY euro "[euro  ]"><!-- euro sign, U+20AC NEW -->
++<!ENTITY euro SDATA "[euro  ]"><!-- euro sign, U+20AC NEW -->
+ ]]>
+ <![%xml.features;[
+ <!ENTITY euro "&#x20AC;"><!-- euro sign, U+20AC NEW -->
diff --git a/docbook-dtds/patches/docbook-dtd30-sgml-1.0.catalog.patch b/docbook-dtds/patches/docbook-dtd30-sgml-1.0.catalog.patch
new file mode 100644 (file)
index 0000000..81bff59
--- /dev/null
@@ -0,0 +1,41 @@
+--- a/3.0-sgml/docbook.cat     Tue Dec 10 16:35:22 1996
++++ b/3.0-sgml/catalog Mon Jun  5 11:08:34 2000
+@@ -27,7 +27,7 @@
+   -- ...................................................................... --
+   -- SGML declaration associated with DocBook ............................. --
+-DTDDECL "-//Davenport//DTD DocBook V3.0//EN" "docbook.dcl"
++SGMLDECL "docbook.dcl"
+   -- ...................................................................... --
+   -- DocBook driver file .................................................. --
+@@ -41,29 +41,6 @@
+ PUBLIC "-//Davenport//ELEMENTS DocBook Information Pool V3.0//EN" "dbpool.mod"
+ PUBLIC "-//Davenport//ELEMENTS DocBook Document Hierarchy V3.0//EN" "dbhier.mod"
+ PUBLIC "-//Davenport//ENTITIES DocBook Additional General Entities V3.0//EN" "dbgenent.mod"
+-
+-  -- ...................................................................... --
+-  -- ISO entity sets ...................................................... --
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Diacritical Marks//EN" "iso-dia.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN" "iso-num.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Publishing//EN" "iso-pub.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES General Technical//EN" "iso-tech.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN" "iso-lat1.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Latin 2//EN" "iso-lat2.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Greek Letters//EN" "iso-grk1.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Monotoniko Greek//EN" "iso-grk2.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Greek Symbols//EN" "iso-grk3.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN" "iso-grk4.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN" "iso-amsa.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN" "iso-amsb.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN" "iso-amsc.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN" "iso-amsn.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN" "iso-amso.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN" "iso-amsr.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Box and Line Drawing//EN" "iso-box.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Russian Cyrillic//EN" "iso-cyr1.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN" "iso-cyr2.gml"
+   -- End of catalog data for DocBook V3.0 ................................. --
+   -- ...................................................................... --
diff --git a/docbook-dtds/patches/docbook-dtd31-sgml-1.0.catalog.patch b/docbook-dtds/patches/docbook-dtd31-sgml-1.0.catalog.patch
new file mode 100644 (file)
index 0000000..d4789b3
--- /dev/null
@@ -0,0 +1,41 @@
+--- a/3.1-sgml/docbook.cat     Tue Feb  2 06:53:32 1999
++++ b/3.1-sgml/catalog Thu May 25 11:45:01 2000
+@@ -19,7 +19,7 @@
+   -- ...................................................................... --
+   -- SGML declaration associated with DocBook ............................. --
+-DTDDECL "-//OASIS//DTD DocBook V3.1//EN" "docbook.dcl"
++SGMLDECL "docbook.dcl"
+   -- ...................................................................... --
+   -- DocBook driver file .................................................. --
+@@ -35,29 +35,6 @@
+ PUBLIC "-//OASIS//ENTITIES DocBook Additional General Entities V3.1//EN" "dbgenent.mod"
+ PUBLIC "-//OASIS//ENTITIES DocBook Notations V3.1//EN" "dbnotn.mod"
+ PUBLIC "-//OASIS//ENTITIES DocBook Character Entities V3.1//EN" "dbcent.mod"
+-
+-  -- ...................................................................... --
+-  -- ISO entity sets ...................................................... --
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Diacritical Marks//EN" "iso-dia.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN" "iso-num.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Publishing//EN" "iso-pub.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES General Technical//EN" "iso-tech.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN" "iso-lat1.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Latin 2//EN" "iso-lat2.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Greek Letters//EN" "iso-grk1.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Monotoniko Greek//EN" "iso-grk2.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Greek Symbols//EN" "iso-grk3.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN" "iso-grk4.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN" "iso-amsa.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN" "iso-amsb.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN" "iso-amsc.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN" "iso-amsn.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN" "iso-amso.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN" "iso-amsr.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Box and Line Drawing//EN" "iso-box.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Russian Cyrillic//EN" "iso-cyr1.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN" "iso-cyr2.gml"
+   -- End of catalog data for DocBook V3.1 ................................. --
+   -- ...................................................................... --
diff --git a/docbook-dtds/patches/docbook-dtd40-sgml-1.0.catalog.patch b/docbook-dtds/patches/docbook-dtd40-sgml-1.0.catalog.patch
new file mode 100644 (file)
index 0000000..367279f
--- /dev/null
@@ -0,0 +1,41 @@
+--- a/4.0-sgml/docbook.cat     Mon May 22 22:38:05 2000
++++ b/4.0-sgml/catalog Mon May 22 22:12:36 2000
+@@ -19,7 +19,7 @@
+   -- ...................................................................... --
+   -- SGML declaration associated with DocBook ............................. --
+-DTDDECL "-//OASIS//DTD DocBook V4.0//EN" "docbook.dcl"
++SGMLDECL "docbook.dcl"
+   -- ...................................................................... --
+   -- DocBook driver file .................................................. --
+@@ -35,29 +35,6 @@
+ PUBLIC "-//OASIS//ENTITIES DocBook Additional General Entities V4.0//EN" "dbgenent.mod"
+ PUBLIC "-//OASIS//ENTITIES DocBook Notations V4.0//EN" "dbnotn.mod"
+ PUBLIC "-//OASIS//ENTITIES DocBook Character Entities V4.0//EN" "dbcent.mod"
+-
+-  -- ...................................................................... --
+-  -- ISO entity sets ...................................................... --
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Diacritical Marks//EN" "iso-dia.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN" "iso-num.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Publishing//EN" "iso-pub.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES General Technical//EN" "iso-tech.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN" "iso-lat1.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Latin 2//EN" "iso-lat2.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Greek Letters//EN" "iso-grk1.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Monotoniko Greek//EN" "iso-grk2.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Greek Symbols//EN" "iso-grk3.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN" "iso-grk4.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN" "iso-amsa.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN" "iso-amsb.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN" "iso-amsc.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN" "iso-amsn.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN" "iso-amso.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN" "iso-amsr.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Box and Line Drawing//EN" "iso-box.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Russian Cyrillic//EN" "iso-cyr1.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN" "iso-cyr2.gml"
+   -- End of catalog data for DocBook V4.0 ................................. --
+   -- ...................................................................... --
diff --git a/docbook-dtds/patches/docbook-dtd41-sgml-1.0.catalog.patch b/docbook-dtds/patches/docbook-dtd41-sgml-1.0.catalog.patch
new file mode 100644 (file)
index 0000000..2a10e7d
--- /dev/null
@@ -0,0 +1,41 @@
+--- a/4.1-sgml/docbook.cat     Mon May 22 22:38:05 2000
++++ b/4.1-sgml/catalog Mon May 22 22:12:36 2000
+@@ -19,7 +19,7 @@
+   -- ...................................................................... --
+   -- SGML declaration associated with DocBook ............................. --
+-DTDDECL "-//OASIS//DTD DocBook V4.1//EN" "docbook.dcl"
++SGMLDECL "docbook.dcl"
+   -- ...................................................................... --
+   -- DocBook driver file .................................................. --
+@@ -35,29 +35,6 @@
+ PUBLIC "-//OASIS//ENTITIES DocBook Additional General Entities V4.1//EN" "dbgenent.mod"
+ PUBLIC "-//OASIS//ENTITIES DocBook Notations V4.1//EN" "dbnotn.mod"
+ PUBLIC "-//OASIS//ENTITIES DocBook Character Entities V4.1//EN" "dbcent.mod"
+-
+-  -- ...................................................................... --
+-  -- ISO entity sets ...................................................... --
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Diacritical Marks//EN" "iso-dia.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN" "iso-num.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Publishing//EN" "iso-pub.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES General Technical//EN" "iso-tech.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN" "iso-lat1.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Latin 2//EN" "iso-lat2.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Greek Letters//EN" "iso-grk1.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Monotoniko Greek//EN" "iso-grk2.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Greek Symbols//EN" "iso-grk3.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN" "iso-grk4.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN" "iso-amsa.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN" "iso-amsb.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN" "iso-amsc.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN" "iso-amsn.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN" "iso-amso.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN" "iso-amsr.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Box and Line Drawing//EN" "iso-box.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Russian Cyrillic//EN" "iso-cyr1.gml"
+-PUBLIC "ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN" "iso-cyr2.gml"
+   -- End of catalog data for DocBook V4.1 ................................. --
+   -- ...................................................................... --
diff --git a/docbook-dtds/patches/docbook-dtd412-entities.patch b/docbook-dtds/patches/docbook-dtd412-entities.patch
new file mode 100644 (file)
index 0000000..39a7bb2
--- /dev/null
@@ -0,0 +1,48 @@
+diff -urNp docbook-dtds-1.0-orig/4.1.2-xml/docbook.cat docbook-dtds-1.0/4.1.2-xml/docbook.cat
+--- docbook-dtds-1.0-orig/4.1.2-xml/docbook.cat        2009-02-19 13:49:08.000000000 +0100
++++ docbook-dtds-1.0/4.1.2-xml/docbook.cat     2009-02-19 13:50:59.000000000 +0100
+@@ -41,25 +41,25 @@ PUBLIC "-//OASIS//ENTITIES DocBook XML C
+   -- ...................................................................... --
+   -- ISO entity sets ...................................................... --
+-PUBLIC "ISO 8879:1986//ENTITIES Diacritical Marks//EN" "ent/iso-dia.ent"
+-PUBLIC "ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN" "ent/iso-num.ent"
+-PUBLIC "ISO 8879:1986//ENTITIES Publishing//EN" "ent/iso-pub.ent"
+-PUBLIC "ISO 8879:1986//ENTITIES General Technical//EN" "ent/iso-tech.ent"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN" "ent/iso-lat1.ent"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Latin 2//EN" "ent/iso-lat2.ent"
+-PUBLIC "ISO 8879:1986//ENTITIES Greek Letters//EN" "ent/iso-grk1.ent"
+-PUBLIC "ISO 8879:1986//ENTITIES Monotoniko Greek//EN" "ent/iso-grk2.ent"
+-PUBLIC "ISO 8879:1986//ENTITIES Greek Symbols//EN" "ent/iso-grk3.ent"
+-PUBLIC "ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN" "ent/iso-grk4.ent"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN" "ent/iso-amsa.ent"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN" "ent/iso-amsb.ent"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN" "ent/iso-amsc.ent"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN" "ent/iso-amsn.ent"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN" "ent/iso-amso.ent"
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN" "ent/iso-amsr.ent"
+-PUBLIC "ISO 8879:1986//ENTITIES Box and Line Drawing//EN" "ent/iso-box.ent"
+-PUBLIC "ISO 8879:1986//ENTITIES Russian Cyrillic//EN" "ent/iso-cyr1.ent"
+-PUBLIC "ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN" "ent/iso-cyr2.ent"
++PUBLIC "ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML" "ent/iso-dia.ent"
++PUBLIC "ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML" "ent/iso-num.ent"
++PUBLIC "ISO 8879:1986//ENTITIES Publishing//EN//XML" "ent/iso-pub.ent"
++PUBLIC "ISO 8879:1986//ENTITIES General Technical//EN//XML" "ent/iso-tech.ent"
++PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN//XML" "ent/iso-lat1.ent"
++PUBLIC "ISO 8879:1986//ENTITIES Added Latin 2//EN//XML" "ent/iso-lat2.ent"
++PUBLIC "ISO 8879:1986//ENTITIES Greek Letters//EN//XML" "ent/iso-grk1.ent"
++PUBLIC "ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML" "ent/iso-grk2.ent"
++PUBLIC "ISO 8879:1986//ENTITIES Greek Symbols//EN//XML" "ent/iso-grk3.ent"
++PUBLIC "ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML" "ent/iso-grk4.ent"
++PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML" "ent/iso-amsa.ent"
++PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML" "ent/iso-amsb.ent"
++PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML" "ent/iso-amsc.ent"
++PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML" "ent/iso-amsn.ent"
++PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML" "ent/iso-amso.ent"
++PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML" "ent/iso-amsr.ent"
++PUBLIC "ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML" "ent/iso-box.ent"
++PUBLIC "ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML" "ent/iso-cyr1.ent"
++PUBLIC "ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML" "ent/iso-cyr2.ent"
+   -- End of catalog data for DocBook XML V4.1.2 ............................. --
+   -- ...................................................................... --
diff --git a/docbook-dtds/patches/docbook-dtd42-sgml-1.0.catalog.patch b/docbook-dtds/patches/docbook-dtd42-sgml-1.0.catalog.patch
new file mode 100644 (file)
index 0000000..d0b2cc3
--- /dev/null
@@ -0,0 +1,68 @@
+--- a/4.2-sgml/docbook.cat.orig        2002-07-17 17:14:28.000000000 +0100
++++ b/4.2-sgml/docbook.cat     2002-07-17 21:58:24.000000000 +0100
+@@ -49,65 +49,5 @@
+ PUBLIC "-//OASIS//ENTITIES DocBook Character Entities V4.2//EN"
+        "dbcentx.mod"
+-  -- ...................................................................... --
+-  -- ISO entity sets ...................................................... --
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Diacritical Marks//EN"
+-       "iso-dia.gml"
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN"
+-       "iso-num.gml"
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Publishing//EN"
+-       "iso-pub.gml"
+-
+-PUBLIC "ISO 8879:1986//ENTITIES General Technical//EN"
+-       "iso-tech.gml"
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN"
+-       "iso-lat1.gml"
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Added Latin 2//EN"
+-       "iso-lat2.gml"
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Greek Letters//EN"
+-       "iso-grk1.gml"
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Monotoniko Greek//EN"
+-       "iso-grk2.gml"
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Greek Symbols//EN"
+-       "iso-grk3.gml"
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN"
+-       "iso-grk4.gml"
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN"
+-       "iso-amsa.gml"
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN"
+-       "iso-amsb.gml"
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN"
+-       "iso-amsc.gml"
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN"
+-       "iso-amsn.gml"
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN"
+-       "iso-amso.gml"
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN"
+-       "iso-amsr.gml"
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Box and Line Drawing//EN"
+-       "iso-box.gml"
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Russian Cyrillic//EN"
+-       "iso-cyr1.gml"
+-
+-PUBLIC "ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN"
+-       "iso-cyr2.gml"
+-
+   -- End of catalog data for DocBook V4.2 ................................. --
+   -- ...................................................................... --
diff --git a/docbook-dtds/patches/docbook-dtds-ents.patch b/docbook-dtds/patches/docbook-dtds-ents.patch
new file mode 100644 (file)
index 0000000..bc45628
--- /dev/null
@@ -0,0 +1,53 @@
+--- docbook-dtds-1.0/4.3-sgml/docbook.cat.ents 2005-12-13 13:14:24.000000000 +0000
++++ docbook-dtds-1.0/4.3-sgml/docbook.cat      2005-12-13 13:14:38.000000000 +0000
+@@ -51,6 +51,7 @@
+   -- ...................................................................... --
+   -- ISO entity sets ...................................................... --
++--
+ PUBLIC "ISO 8879:1986//ENTITIES Diacritical Marks//EN"
+        "iso-dia.gml"
+@@ -109,5 +110,6 @@
+ PUBLIC "ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN"
+        "iso-cyr2.gml"
++--
+   -- End of catalog data for DocBook V4.3 ................................. --
+   -- ...................................................................... --
+--- docbook-dtds-1.0/4.4-sgml/docbook.cat.ents 2005-12-13 13:14:51.000000000 +0000
++++ docbook-dtds-1.0/4.4-sgml/docbook.cat      2005-12-13 13:14:59.000000000 +0000
+@@ -54,6 +54,7 @@
+   -- ...................................................................... --
+   -- ISO entity sets ...................................................... --
++--
+ PUBLIC "ISO 8879:1986//ENTITIES Diacritical Marks//EN"
+        "iso-dia.gml"
+@@ -112,5 +113,6 @@
+ PUBLIC "ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN"
+        "iso-cyr2.gml"
++--
+   -- End of catalog data for DocBook V4.4 ................................. --
+   -- ...................................................................... --
+diff -urNp docbook-dtds-1.0-orig/4.5-sgml/docbook.cat docbook-dtds-1.0/4.5-sgml/docbook.cat
+--- docbook-dtds-1.0-orig/4.5-sgml/docbook.cat 2009-02-19 13:45:22.000000000 +0100
++++ docbook-dtds-1.0/4.5-sgml/docbook.cat      2009-02-19 13:47:31.000000000 +0100
+@@ -60,6 +60,7 @@ PUBLIC "-//OASIS//ENTITIES DocBook Chara
+   -- ...................................................................... --
+   -- ISO entity sets ...................................................... --
++--
+ PUBLIC "ISO 8879:1986//ENTITIES Diacritical Marks//EN"
+        "iso-dia.gml"
+@@ -118,5 +119,7 @@ PUBLIC "ISO 8879:1986//ENTITIES Russian 
+ PUBLIC "ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN"
+        "iso-cyr2.gml"
++--
++
+   -- End of catalog data for DocBook V4.5 ................................. --
+   -- ...................................................................... --
diff --git a/docbook-dtds/patches/docbook-sgml-systemrewrite.patch b/docbook-dtds/patches/docbook-sgml-systemrewrite.patch
new file mode 100644 (file)
index 0000000..4adbc50
--- /dev/null
@@ -0,0 +1,210 @@
+diff -urNp docbook-dtds-1.0-orig/3.0-sgml/docbook.cat docbook-dtds-1.0/3.0-sgml/docbook.cat
+--- docbook-dtds-1.0-orig/3.0-sgml/docbook.cat 2009-02-05 16:44:15.000000000 +0100
++++ docbook-dtds-1.0/3.0-sgml/docbook.cat      2009-02-05 16:48:58.000000000 +0100
+@@ -30,6 +30,12 @@
+ SGMLDECL "docbook.dcl"
+   -- ...................................................................... --
++  -- SYSTEM rewrite of web URL .............. ............................. --
++
++SYSTEM "http://www.oasis-open.org/docbook/sgml/3.0/docbook.dtd"
++       "docbook.dtd"
++
++  -- ...................................................................... --
+   -- DocBook driver file .................................................. --
+ PUBLIC "-//Davenport//DTD DocBook V3.0//EN" "docbook.dtd"
+diff -urNp docbook-dtds-1.0-orig/3.1-sgml/docbook.cat docbook-dtds-1.0/3.1-sgml/docbook.cat
+--- docbook-dtds-1.0-orig/3.1-sgml/docbook.cat 2009-02-05 16:44:15.000000000 +0100
++++ docbook-dtds-1.0/3.1-sgml/docbook.cat      2009-02-05 16:56:51.000000000 +0100
+@@ -22,6 +22,12 @@
+ SGMLDECL "docbook.dcl"
+   -- ...................................................................... --
++  -- SYSTEM rewrite of web URL .............. ............................. --
++
++SYSTEM "http://www.oasis-open.org/docbook/sgml/3.0/docbook.dtd"
++       "docbook.dtd"
++
++  -- ...................................................................... --
+   -- DocBook driver file .................................................. --
+ PUBLIC "-//OASIS//DTD DocBook V3.1//EN" "docbook.dtd"
+diff -urNp docbook-dtds-1.0-orig/4.0-sgml/docbook.cat docbook-dtds-1.0/4.0-sgml/docbook.cat
+--- docbook-dtds-1.0-orig/4.0-sgml/docbook.cat 2009-02-05 16:44:16.000000000 +0100
++++ docbook-dtds-1.0/4.0-sgml/docbook.cat      2009-02-05 16:49:06.000000000 +0100
+@@ -22,6 +22,12 @@
+ SGMLDECL "docbook.dcl"
+   -- ...................................................................... --
++  -- SYSTEM rewrite of web URL .............. ............................. --
++
++SYSTEM "http://www.oasis-open.org/docbook/sgml/4.0/docbook.dtd"
++       "docbook.dtd"
++
++  -- ...................................................................... --
+   -- DocBook driver file .................................................. --
+ PUBLIC "-//OASIS//DTD DocBook V4.0//EN" "docbook.dtd"
+Binární soubory docbook-dtds-1.0-orig/4.0-sgml/.docbook.cat.swp a docbook-dtds-1.0/4.0-sgml/.docbook.cat.swp jsou různé
+diff -urNp docbook-dtds-1.0-orig/4.1-sgml/docbook.cat docbook-dtds-1.0/4.1-sgml/docbook.cat
+--- docbook-dtds-1.0-orig/4.1-sgml/docbook.cat 2009-02-05 16:44:16.000000000 +0100
++++ docbook-dtds-1.0/4.1-sgml/docbook.cat      2009-02-05 16:49:27.000000000 +0100
+@@ -22,6 +22,12 @@
+ SGMLDECL "docbook.dcl"
+   -- ...................................................................... --
++  -- SYSTEM rewrite of web URL .............. ............................. --
++SYSTEM "http://www.oasis-open.org/docbook/sgml/4.1/docbook.dtd"
++       "docbook.dtd"
++
++
++  -- ...................................................................... --
+   -- DocBook driver file .................................................. --
+ PUBLIC "-//OASIS//DTD DocBook V4.1//EN" "docbook.dtd"
+diff -urNp docbook-dtds-1.0-orig/4.1.2-xml/docbook.cat docbook-dtds-1.0/4.1.2-xml/docbook.cat
+--- docbook-dtds-1.0-orig/4.1.2-xml/docbook.cat        2000-08-27 17:19:42.000000000 +0200
++++ docbook-dtds-1.0/4.1.2-xml/docbook.cat     2009-02-05 16:52:16.000000000 +0100
+@@ -17,6 +17,12 @@
+   --
+   -- ...................................................................... --
++  -- SYSTEM rewrite of web URL .............. ............................. --
++
++SYSTEM "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
++       "docbookx.dtd"
++
++  -- ...................................................................... --
+   -- DocBook driver file .................................................. --
+ PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "docbookx.dtd"
+diff -urNp docbook-dtds-1.0-orig/4.2-sgml/docbook.cat docbook-dtds-1.0/4.2-sgml/docbook.cat
+--- docbook-dtds-1.0-orig/4.2-sgml/docbook.cat 2009-02-05 16:44:17.000000000 +0100
++++ docbook-dtds-1.0/4.2-sgml/docbook.cat      2009-02-05 16:50:10.000000000 +0100
+@@ -17,6 +17,12 @@
+   --
+   -- ...................................................................... --
++  -- SYSTEM rewrite of web URL .............. ............................. --
++
++SYSTEM "http://www.oasis-open.org/docbook/sgml/4.2/docbook.dtd"
++       "docbook.dtd"
++
++  -- ...................................................................... --
+   -- DocBook driver file .................................................. --
+ PUBLIC "-//OASIS//DTD DocBook V4.2//EN"
+diff -urNp docbook-dtds-1.0-orig/4.2-xml/docbook.cat docbook-dtds-1.0/4.2-xml/docbook.cat
+--- docbook-dtds-1.0-orig/4.2-xml/docbook.cat  2002-07-17 18:14:41.000000000 +0200
++++ docbook-dtds-1.0/4.2-xml/docbook.cat       2009-02-05 16:52:53.000000000 +0100
+@@ -17,6 +17,12 @@
+   --
+   -- ...................................................................... --
++  -- SYSTEM rewrite of web URL .............. ............................. --
++
++SYSTEM "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
++       "docbookx.dtd"
++
++  -- ...................................................................... --
+   -- DocBook driver file .................................................. --
+ PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+diff -urNp docbook-dtds-1.0-orig/4.3-sgml/docbook.cat docbook-dtds-1.0/4.3-sgml/docbook.cat
+--- docbook-dtds-1.0-orig/4.3-sgml/docbook.cat 2009-02-05 16:44:18.000000000 +0100
++++ docbook-dtds-1.0/4.3-sgml/docbook.cat      2009-02-05 16:50:37.000000000 +0100
+@@ -17,6 +17,13 @@
+   --
+   -- ...................................................................... --
++  -- SYSTEM rewrite of web URL .............. ............................. --
++
++SYSTEM "http://www.oasis-open.org/docbook/sgml/4.3/docbook.dtd"
++       "docbook.dtd"
++
++
++  -- ...................................................................... --
+   -- DocBook driver file .................................................. --
+ PUBLIC "-//OASIS//DTD DocBook V4.3//EN"
+diff -urNp docbook-dtds-1.0-orig/4.3-xml/docbook.cat docbook-dtds-1.0/4.3-xml/docbook.cat
+--- docbook-dtds-1.0-orig/4.3-xml/docbook.cat  2004-03-31 13:22:18.000000000 +0200
++++ docbook-dtds-1.0/4.3-xml/docbook.cat       2009-02-05 16:53:12.000000000 +0100
+@@ -17,6 +17,12 @@
+   --
+   -- ...................................................................... --
++  -- SYSTEM rewrite of web URL .............. ............................. --
++
++SYSTEM "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
++       "docbookx.dtd"
++
++  -- ...................................................................... --
+   -- DocBook driver file .................................................. --
+ PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+diff -urNp docbook-dtds-1.0-orig/4.4-sgml/docbook.cat docbook-dtds-1.0/4.4-sgml/docbook.cat
+--- docbook-dtds-1.0-orig/4.4-sgml/docbook.cat 2009-02-05 16:44:18.000000000 +0100
++++ docbook-dtds-1.0/4.4-sgml/docbook.cat      2009-02-05 16:50:57.000000000 +0100
+@@ -17,6 +17,12 @@
+   --
+   -- ...................................................................... --
++  -- SYSTEM rewrite of web URL .............. ............................. --
++
++SYSTEM "http://www.oasis-open.org/docbook/sgml/4.4/docbook.dtd"
++       "docbook.dtd"
++
++  -- ...................................................................... --
+   -- DocBook driver file .................................................. --
+ PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
+diff -urNp docbook-dtds-1.0-orig/4.4-xml/docbook.cat docbook-dtds-1.0/4.4-xml/docbook.cat
+--- docbook-dtds-1.0-orig/4.4-xml/docbook.cat  2005-01-27 14:57:19.000000000 +0100
++++ docbook-dtds-1.0/4.4-xml/docbook.cat       2009-02-05 16:53:30.000000000 +0100
+@@ -17,6 +17,12 @@
+   --
+   -- ...................................................................... --
++  -- SYSTEM rewrite of web URL .............. ............................. --
++
++SYSTEM "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
++       "docbookx.dtd"
++
++  -- ...................................................................... --
+   -- DocBook driver file .................................................. --
+ PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+diff -urNp docbook-dtds-1.0-orig/4.5-sgml/docbook.cat docbook-dtds-1.0/4.5-sgml/docbook.cat
+--- docbook-dtds-1.0-orig/4.5-sgml/docbook.cat 2006-10-03 15:27:50.000000000 +0200
++++ docbook-dtds-1.0/4.5-sgml/docbook.cat      2009-02-05 16:51:22.000000000 +0100
+@@ -17,6 +17,12 @@
+   --
+   -- ...................................................................... --
++  -- SYSTEM rewrite of web URL .............. ............................. --
++
++SYSTEM "http://www.oasis-open.org/docbook/sgml/4.5/docbook.dtd"
++       "docbook.dtd"
++
++  -- ...................................................................... --
+   -- DocBook driver file .................................................. --
+ PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
+diff -urNp docbook-dtds-1.0-orig/4.5-xml/docbook.cat docbook-dtds-1.0/4.5-xml/docbook.cat
+--- docbook-dtds-1.0-orig/4.5-xml/docbook.cat  2006-10-03 15:26:00.000000000 +0200
++++ docbook-dtds-1.0/4.5-xml/docbook.cat       2009-02-05 16:55:45.000000000 +0100
+@@ -17,6 +17,12 @@
+   --
+   -- ...................................................................... --
++  -- SYSTEM rewrite of web URL .............. ............................. --
++
++SYSTEM "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
++       "docbookx.dtd"
++
++  -- ...................................................................... --
+   -- DocBook driver file .................................................. --
+ PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
diff --git a/docbook-utils/docbook-utils.nm b/docbook-utils/docbook-utils.nm
new file mode 100644 (file)
index 0000000..a0bc3f4
--- /dev/null
@@ -0,0 +1,57 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = docbook-utils
+version    = 0.6.14
+release    = 1
+
+groups     = Applications/Text
+url        = http://sources.redhat.com/docbook-tools/
+license    = GPLv2+
+summary    = Shell scripts for managing DocBook documents.
+
+description
+       This package contains scripts are for easy conversion from DocBook
+       files to other formats, and for comparing SGML files.
+end
+
+# Manual list patches because they need to be applied in specical order
+patches = \
+       %{name}-spaces.patch \
+       %{name}-2ndspaces.patch \
+       %{name}-w3mtxtconvert.patch \
+       %{name}-grepnocolors.patch \
+       %{name}-sgmlinclude.patch \
+       %{name}-rtfmanpage.patch \
+       %{name}-papersize.patch \
+       %{name}-nofinalecho.patch \
+       %{name}-newgrep.patch
+
+build
+       requires
+               docbook-dsssl
+               docbook-dtds
+               openjade
+               sgml-common
+       end
+
+       configure_options += \
+               --libdir=/usr/lib \
+               --mandir=/usr/share/man
+end
+
+packages
+       package %{name}
+               requires
+                       docbook-dtds
+                       docbook-dsssl
+                       openjade
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
diff --git a/docbook-utils/patches/docbook-utils-2ndspaces.patch b/docbook-utils/patches/docbook-utils-2ndspaces.patch
new file mode 100644 (file)
index 0000000..eb4d6c6
--- /dev/null
@@ -0,0 +1,260 @@
+--- Original/backends/dvi      2003-01-13 18:14:10.000000000 +0100
++++ Changes/backends/dvi       2007-05-21 14:10:42.000000000 +0200
+@@ -6,31 +6,31 @@
+ export TEXINPUTS
+ # Convert to TeX
+-$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS
++$SGML_JADE -t tex -o "${SGML_FILE_NAME}.tex" $SGML_ARGUMENTS "$SGML_FILE"
+ if [ $? -ne 0 ]
+ then exit 1
+ fi
+ # Convert from TeX to DVI
+-jadetex ${SGML_FILE_NAME}.tex >${SGML_FILE_NAME}.tmp
++jadetex "${SGML_FILE_NAME}.tex" > "${SGML_FILE_NAME}.tmp"
+ if [ $? -ne 0 ]
+ then
+-  cat ${SGML_FILE_NAME}.tmp
+-  rm ${SGML_FILE_NAME}.tmp
+-  rm ${SGML_FILE_NAME}.tex
++  cat "${SGML_FILE_NAME}.tmp"
++  rm "${SGML_FILE_NAME}.tmp"
++  rm "${SGML_FILE_NAME}.tex"
+   exit 2
+ fi
+-rm ${SGML_FILE_NAME}.tmp
++rm "${SGML_FILE_NAME}.tmp"
+ # If there are unresolved references, re-run jadetex, twice 
+-if egrep '^LaTeX Warning: There were undefined references.$' ${SGML_FILE_NAME}.log >/dev/null 2>&1
++if egrep '^LaTeX Warning: There were undefined references.$' "${SGML_FILE_NAME}.log" >/dev/null 2>&1
+ then
+-    jadetex ${SGML_FILE_NAME}.tex >/dev/null
+-    jadetex ${SGML_FILE_NAME}.tex >/dev/null
++    jadetex "${SGML_FILE_NAME}.tex" >/dev/null
++    jadetex "${SGML_FILE_NAME}.tex" >/dev/null
+ fi
+-rm ${SGML_FILE_NAME}.log
+-rm ${SGML_FILE_NAME}.aux
+-rm ${SGML_FILE_NAME}.tex
+-rm ${SGML_FILE_NAME}.out
++rm "${SGML_FILE_NAME}.log"
++rm "${SGML_FILE_NAME}.aux"
++rm "${SGML_FILE_NAME}.tex"
++rm "${SGML_FILE_NAME}.out"
+ exit 0
+--- Original/backends/html     2000-07-21 20:15:22.000000000 +0200
++++ Changes/backends/html      2007-05-21 14:11:32.000000000 +0200
+@@ -3,7 +3,7 @@
+ # This program is under GPL license. See LICENSE file for details.
+ # Convert to HTML
+-$SGML_JADE -t sgml $SGML_ARGUMENTS
++$SGML_JADE -t sgml $SGML_ARGUMENTS "$SGML_FILE"
+ if [ $? -ne 0 ]
+ then exit 1
+ fi
+--- Original/backends/pdf      2003-03-17 18:47:11.000000000 +0100
++++ Changes/backends/pdf       2007-05-21 14:13:58.000000000 +0200
+@@ -6,26 +6,26 @@
+ export TEXINPUTS
+ # Convert to TeX
+-$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS
++$SGML_JADE -t tex -o "${SGML_FILE_NAME}.tex" $SGML_ARGUMENTS "$SGML_FILE"
+ if [ $? -ne 0 ]
+ then exit 1
+ fi
+ # Convert from TeX to PDF
+-pdfjadetex ${SGML_FILE_NAME}.tex >${SGML_FILE_NAME}.tmp
++pdfjadetex "${SGML_FILE_NAME}.tex" > "${SGML_FILE_NAME}.tmp"
+ if [ $? -ne 0 ]
+ then
+-  cat ${SGML_FILE_NAME}.tmp
+-  rm ${SGML_FILE_NAME}.tmp
+-  rm ${SGML_FILE_NAME}.tex
++  cat "${SGML_FILE_NAME}.tmp"
++  rm "${SGML_FILE_NAME}.tmp"
++  rm "${SGML_FILE_NAME}.tex"
+   exit 2
+ fi
+-rm ${SGML_FILE_NAME}.tmp
++rm "${SGML_FILE_NAME}.tmp"
+ # Unconditionally re-run pdfjadetex, twice 
+-pdfjadetex ${SGML_FILE_NAME}.tex >/dev/null
+-pdfjadetex ${SGML_FILE_NAME}.tex >/dev/null
+-rm -f ${SGML_FILE_NAME}.log ${SGML_FILE_NAME}.aux \
+-      ${SGML_FILE_NAME}.tex ${SGML_FILE_NAME}.out
++pdfjadetex "${SGML_FILE_NAME}.tex" >/dev/null
++pdfjadetex "${SGML_FILE_NAME}.tex" >/dev/null
++rm -f "${SGML_FILE_NAME}.log" "${SGML_FILE_NAME}.aux" \
++      "${SGML_FILE_NAME}.tex" "${SGML_FILE_NAME}.out"
+ exit 0
+--- Original/backends/ps       2003-03-17 18:51:48.000000000 +0100
++++ Changes/backends/ps        2007-05-21 14:16:51.000000000 +0200
+@@ -6,30 +6,30 @@
+ export TEXINPUTS
+ # Convert to TeX
+-$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS
++$SGML_JADE -t tex -o "${SGML_FILE_NAME}.tex" $SGML_ARGUMENTS "$SGML_FILE"
+ if [ $? -ne 0 ]
+ then exit 1
+ fi
+ # Convert from TeX to DVI
+-jadetex ${SGML_FILE_NAME}.tex >${SGML_FILE_NAME}.tmp
++jadetex "${SGML_FILE_NAME}.tex" > "${SGML_FILE_NAME}.tmp"
+ if [ $? -ne 0 ]
+ then
+-  cat ${SGML_FILE_NAME}.tmp
+-  rm ${SGML_FILE_NAME}.tmp
+-  rm ${SGML_FILE_NAME}.tex
++  cat "${SGML_FILE_NAME}.tmp"
++  rm "${SGML_FILE_NAME}.tmp"
++  rm "${SGML_FILE_NAME}.tex"
+   exit 2
+ fi
+-rm ${SGML_FILE_NAME}.tmp
++rm "${SGML_FILE_NAME}.tmp"
+ # If there are unresolved references, re-run jadetex, twice 
+-if egrep '^LaTeX Warning: There were undefined references.$' ${SGML_FILE_NAME}.log >/dev/null 2>&1
++if egrep '^LaTeX Warning: There were undefined references.$' "${SGML_FILE_NAME}.log" >/dev/null 2>&1
+ then
+-    jadetex ${SGML_FILE_NAME}.tex >/dev/null
+-    jadetex ${SGML_FILE_NAME}.tex >/dev/null
++    jadetex "${SGML_FILE_NAME}.tex" >/dev/null
++    jadetex "${SGML_FILE_NAME}.tex" >/dev/null
+ fi
+-rm -f ${SGML_FILE_NAME}.log ${SGML_FILE_NAME}.aux \
+-      ${SGML_FILE_NAME}.tex ${SGML_FILE_NAME}.out
++rm -f "${SGML_FILE_NAME}.log" "${SGML_FILE_NAME}.aux" \
++      "${SGML_FILE_NAME}.tex" "${SGML_FILE_NAME}.out"
+ # Convert from DVI to PostScript
+ PAPERSIZE="-t letter"
+@@ -38,12 +38,12 @@
+   PAPERSIZE="-t a4"
+ fi
+-dvips -R -q $PAPERSIZE ${SGML_FILE_NAME}.dvi -o ${SGML_FILE_NAME}.ps
++dvips -R -q $PAPERSIZE "${SGML_FILE_NAME}.dvi" -o "${SGML_FILE_NAME}.ps"
+ if [ $? -ne 0 ]
+ then
+-  rm ${SGML_FILE_NAME}.dvi
++  rm "${SGML_FILE_NAME}.dvi"
+   exit 3
+ fi
+-rm ${SGML_FILE_NAME}.dvi
++rm "${SGML_FILE_NAME}.dvi"
+ exit 0
+--- Original/backends/rtf      2000-07-21 20:15:22.000000000 +0200
++++ Changes/backends/rtf       2007-05-21 14:18:37.000000000 +0200
+@@ -3,7 +3,7 @@
+ # This program is under GPL license. See LICENSE file for details.
+ # Convert to RTF
+-$SGML_JADE -t rtf -o ${SGML_FILE_NAME}.rtf $SGML_ARGUMENTS
++$SGML_JADE -t rtf -o "${SGML_FILE_NAME}.rtf" $SGML_ARGUMENTS "$SGML_FILE"
+ if [ $? -ne 0 ]
+ then exit 1
+ fi
+--- Original/backends/tex      2000-07-21 20:15:22.000000000 +0200
++++ Changes/backends/tex       2007-05-21 14:21:12.000000000 +0200
+@@ -3,7 +3,7 @@
+ # This program is under GPL license. See LICENSE file for details.
+ # Convert to TeX
+-$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS
++$SGML_JADE -t tex -o "${SGML_FILE_NAME}.tex" $SGML_ARGUMENTS "$SGML_FILE"
+ if [ $? -ne 0 ]
+ then exit 1
+ fi
+--- Original/backends/txt      2004-02-11 14:58:03.000000000 +0100
++++ Changes/backends/txt       2007-05-21 14:22:33.000000000 +0200
+@@ -23,7 +23,7 @@
+ trap 'rm -f "$HTML"; exit' 0 1 2 3 7 13 15
+ # Convert to HTML
+-$SGML_JADE -V nochunks -t sgml ${SGML_ARGUMENTS} >${HTML}
++$SGML_JADE -V nochunks -t sgml ${SGML_ARGUMENTS} "$SGML_FILE" >${HTML}
+ if [ $? -ne 0 ]
+ then exit 1
+ fi
+--- Original/bin/jw.in 2003-04-30 18:21:49.000000000 +0200
++++ Changes/bin/jw.in  2007-05-21 14:28:58.000000000 +0200
+@@ -246,7 +246,7 @@ then
+   echo -e $SGML_HELP_MESSAGE >&2
+   exit 1
+ fi
+-if [ ! -s $SGML_FRONTEND ]
++if [ ! -s "$SGML_FRONTEND" ]
+ then
+   echo "`basename $0`: There is no frontend called \"$SGML_FRONTEND\"." >&2
+   exit 2
+@@ -270,14 +270,14 @@
+   echo -e $SGML_HELP_MESSAGE >&2
+   exit 1
+ fi
+-if [ ! -s $SGML_FILE ]
++if [ ! -s "$SGML_FILE" ]
+ then
+   echo "`basename $0`: Cannot open \"$SGML_FILE\"." >&2
+   exit 3
+ fi
+ # Separate the file name and the extension (if any)
+-SGML_FILE_NAME=`basename $SGML_FILE`
++SGML_FILE_NAME=`basename "$SGML_FILE"`
+ SGML_FILE_NAME=${SGML_FILE_NAME%.*}
+ # Determine if we are in an XML file
+@@ -416,7 +416,7 @@
+ fi
+ # Prepare the parser's arguments
+-SGML_ARGUMENTS="$SGML_INCLUDE -i $SGML_TYPE -d $SGML_STYLESHEET $SGML_OPTIONS $SGML_WARNINGS $SGML_DECL $SGML_FILE"
++SGML_ARGUMENTS="$SGML_INCLUDE -i $SGML_TYPE -d $SGML_STYLESHEET $SGML_OPTIONS $SGML_WARNINGS $SGML_DECL"
+ # Call the backend
+ echo "Using catalogs: `echo $SGML_CATALOG_FILES | sed 's/:/, /g'`"
+@@ -430,7 +430,7 @@
+ then
+       sh $SGML_BACKEND
+ else
+-      sh $SGML_BACKEND >$SGML_FILE_NAME.html
++      sh $SGML_BACKEND >"$SGML_FILE_NAME.html"
+ fi
+ SGML_RETURN=$?
+ cd "$SGML_CURRENT_DIRECTORY"
+diff -urNp docbook-utils-0.6.14-orig/backends/man.in docbook-utils-0.6.14/backends/man.in
+--- docbook-utils-0.6.14-orig/backends/man.in  2003-02-11 13:56:23.000000000 +0100
++++ docbook-utils-0.6.14/backends/man.in       2009-07-24 15:07:04.000000000 +0200
+@@ -7,7 +7,7 @@ HELPER=$SGML_BASE_DIR/docbook/utils-@VER
+ TMPDIR=`mktemp -d /tmp/man.XXXXXX` || \
+  { echo >&2 "man backend: could not create secure temporary directory"; exit 1;}
+ trap 'rm -rf "${TMPDIR}"' EXIT
+-nsgmls $SGML_FILE > "${TMPDIR}/nsgmls.tmp"
++nsgmls "$SGML_FILE" > "${TMPDIR}/nsgmls.tmp"
+ sgmlspl $HELPER <"${TMPDIR}/nsgmls.tmp" 2>"${TMPDIR}/errs"
+ if [ $? -ne 0 ]
+ then
+diff -urNp docbook-utils-0.6.14-orig/backends/texi.in docbook-utils-0.6.14/backends/texi.in
+--- docbook-utils-0.6.14-orig/backends/texi.in 2002-08-05 23:20:56.000000000 +0200
++++ docbook-utils-0.6.14/backends/texi.in      2009-07-24 15:08:02.000000000 +0200
+@@ -3,7 +3,7 @@
+ # This program is under GPL license. See LICENSE file for details.
+ # Convert to texinfo
+-nsgmls $SGML_FILE | sgmlspl $SGML_BASE_DIR/docbook/utils-@VERSION@/helpers/docbook2texi-spec.pl >$SGML_FILE_NAME.texi
++nsgmls "$SGML_FILE" | sgmlspl $SGML_BASE_DIR/docbook/utils-@VERSION@/helpers/docbook2texi-spec.pl >$SGML_FILE_NAME.texi
+ if [ $? -ne 0 ]
+ then exit 1
+ fi
diff --git a/docbook-utils/patches/docbook-utils-grepnocolors.patch b/docbook-utils/patches/docbook-utils-grepnocolors.patch
new file mode 100644 (file)
index 0000000..3cce39e
--- /dev/null
@@ -0,0 +1,15 @@
+diff -urNp docbook-utils-0.6.14-orig/bin/jw.in docbook-utils-0.6.14/bin/jw.in
+--- docbook-utils-0.6.14-orig/bin/jw.in        2008-11-28 10:53:09.000000000 +0100
++++ docbook-utils-0.6.14/bin/jw.in     2008-11-28 11:22:28.000000000 +0100
+@@ -81,9 +81,9 @@ SGML_CATALOGS_DIR="/etc/sgml"
+ if [ -f "$SGML_CONF" ]
+ then
+   RE='^[:space:]*SGML_BASE_DIR[:space:]*=[:space:]*'
+-  SGML_BASE_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"`
++  SGML_BASE_DIR=`grep --color=never $RE $SGML_CONF | sed "s/$RE//"`
+   RE='^[:space:]*SGML_CATALOGS_DIR[:space:]*=[:space:]*'
+-  SGML_CATALOGS_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"`
++  SGML_CATALOGS_DIR=`grep --color=never $RE $SGML_CONF | sed "s/$RE//"`
+ fi
+ # Set frontend to use
diff --git a/docbook-utils/patches/docbook-utils-newgrep.patch b/docbook-utils/patches/docbook-utils-newgrep.patch
new file mode 100644 (file)
index 0000000..a2c3591
--- /dev/null
@@ -0,0 +1,24 @@
+diff -urNp docbook-utils-0.6.14-orig/bin/jw.in docbook-utils-0.6.14/bin/jw.in
+--- docbook-utils-0.6.14-orig/bin/jw.in        2010-09-28 18:18:39.567895321 +0200
++++ docbook-utils-0.6.14/bin/jw.in     2010-09-28 18:23:25.849756994 +0200
+@@ -80,9 +80,9 @@ SGML_BASE_DIR="@prefix@/share/sgml"
+ SGML_CATALOGS_DIR="/etc/sgml"
+ if [ -f "$SGML_CONF" ]
+ then
+-  RE='^[:space:]*SGML_BASE_DIR[:space:]*=[:space:]*'
++  RE='^[[:space:]]*SGML_BASE_DIR[[:space:]]*=[[:space:]]*'
+   SGML_BASE_DIR=`grep --color=never $RE $SGML_CONF | sed "s/$RE//"`
+-  RE='^[:space:]*SGML_CATALOGS_DIR[:space:]*=[:space:]*'
++  RE='^[[:space:]]*SGML_CATALOGS_DIR[[:space:]]*=[[:space:]]*'
+   SGML_CATALOGS_DIR=`grep --color=never $RE $SGML_CONF | sed "s/$RE//"`
+ fi
+@@ -312,7 +312,7 @@ case $SGML_STANDARD_CATALOGS in
+         SGML_CATALOG_FILES=$SGML_CENTRALIZED_CATALOG
+       else
+         SGML_CATALOG_FILES=`find $SGML_BASE_DIR -name catalog`
+-        SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | tr [:space:] :`
++        SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | tr [[:space:]] :`
+       fi
+       ;;
+   no) SGML_CATALOG_FILES=""
diff --git a/docbook-utils/patches/docbook-utils-nofinalecho.patch b/docbook-utils/patches/docbook-utils-nofinalecho.patch
new file mode 100644 (file)
index 0000000..5787b97
--- /dev/null
@@ -0,0 +1,12 @@
+diff -urNp docbook-utils-0.6.14-orig/bin/jw.in docbook-utils-0.6.14/bin/jw.in
+--- docbook-utils-0.6.14-orig/bin/jw.in        2010-05-31 16:21:46.379401250 +0200
++++ docbook-utils-0.6.14/bin/jw.in     2010-05-31 16:23:55.348413466 +0200
+@@ -438,5 +438,7 @@ cd "$SGML_CURRENT_DIRECTORY"
+ if [ $SGML_RETURN -gt 0 ]
+ then exit `expr 7 + $SGML_RETURN`
+ fi
+-echo "Done."
++#Final echo commented out, it causes manpage noise when generating some
++#manpages with new perl(#513271, #587012)
++#echo "Done."
+ exit 0
diff --git a/docbook-utils/patches/docbook-utils-papersize.patch b/docbook-utils/patches/docbook-utils-papersize.patch
new file mode 100644 (file)
index 0000000..74e5007
--- /dev/null
@@ -0,0 +1,12 @@
+diff -urNp docbook-utils-0.6.14-orig/bin/jw.in docbook-utils-0.6.14/bin/jw.in
+--- docbook-utils-0.6.14-orig/bin/jw.in        2009-10-07 14:41:19.000000000 +0200
++++ docbook-utils-0.6.14/bin/jw.in     2009-10-07 14:45:22.000000000 +0200
+@@ -368,7 +368,7 @@ case "$SGML_OPTIONS" in
+       fi
+       if [ -n "$papersize" ]
+       then
+-        SGML_OPTIONS="-V paper-type=$papersize $SGML_OPTIONS"
++        SGML_OPTIONS="-V %paper-type%=$papersize $SGML_OPTIONS"
+       fi
+       ;;
+ esac
diff --git a/docbook-utils/patches/docbook-utils-rtfmanpage.patch b/docbook-utils/patches/docbook-utils-rtfmanpage.patch
new file mode 100644 (file)
index 0000000..f37873b
--- /dev/null
@@ -0,0 +1,15 @@
+diff -urNp docbook-utils-0.6.14-orig/doc/man/jw.1 docbook-utils-0.6.14/doc/man/jw.1
+--- docbook-utils-0.6.14-orig/doc/man/jw.1     2004-02-11 15:16:21.000000000 +0100
++++ docbook-utils-0.6.14/doc/man/jw.1  2009-08-13 10:44:03.000000000 +0200
+@@ -192,6 +192,11 @@ by calling \fBJade\fR or
+ \fBOpenJade\fR\&. The resulting file can
+ then be inported into \fBMS Word\fR
+ or one of its Linux replacement programs.
++
++\fBNote\fR - The original picture must be
++present when RTF document is viewed, because
++the RTF documents created by \fBOpenJade\fR
++includes pictures by reference.
+ .TP
+ \fB\fItex\fB\fR
+ Converts to TeX by calling \fBJade\fR or
diff --git a/docbook-utils/patches/docbook-utils-sgmlinclude.patch b/docbook-utils/patches/docbook-utils-sgmlinclude.patch
new file mode 100644 (file)
index 0000000..a4958e0
--- /dev/null
@@ -0,0 +1,24 @@
+diff -urNp docbook-utils-0.6.14-orig/backends/man.in docbook-utils-0.6.14/backends/man.in
+--- docbook-utils-0.6.14-orig/backends/man.in  2009-07-24 15:17:42.000000000 +0200
++++ docbook-utils-0.6.14/backends/man.in       2009-07-24 15:20:57.000000000 +0200
+@@ -7,7 +7,7 @@ HELPER=$SGML_BASE_DIR/docbook/utils-@VER
+ TMPDIR=`mktemp -d /tmp/man.XXXXXX` || \
+  { echo >&2 "man backend: could not create secure temporary directory"; exit 1;}
+ trap 'rm -rf "${TMPDIR}"' EXIT
+-nsgmls "$SGML_FILE" > "${TMPDIR}/nsgmls.tmp"
++nsgmls "$SGML_INCLUDE" "$SGML_FILE" > "${TMPDIR}/nsgmls.tmp"
+ sgmlspl $HELPER <"${TMPDIR}/nsgmls.tmp" 2>"${TMPDIR}/errs"
+ if [ $? -ne 0 ]
+ then
+diff -urNp docbook-utils-0.6.14-orig/bin/jw.in docbook-utils-0.6.14/bin/jw.in
+--- docbook-utils-0.6.14-orig/bin/jw.in        2009-07-24 15:17:42.000000000 +0200
++++ docbook-utils-0.6.14/bin/jw.in     2009-07-24 15:18:51.000000000 +0200
+@@ -423,7 +423,7 @@ echo "Using catalogs: `echo $SGML_CATALO
+ echo "Using stylesheet: $SGML_STYLESHEET"
+ echo "Working on: $SGML_FILE"
+ cd "$SGML_OUTPUT_DIRECTORY"
+-export SGML_JADE SGML_FILE_NAME SGML_ARGUMENTS
++export SGML_JADE SGML_FILE_NAME SGML_ARGUMENTS SGML_INCLUDE
+ export SGML_CATALOG_FILES SGML_BASE_DIR SGML_FILE SGML_STYLESHEET
+ NOCHUNKS=`echo $SGML_OPTIONS | grep nochunks`
+ if [ -z "$NOCHUNKS" ]
diff --git a/docbook-utils/patches/docbook-utils-spaces.patch b/docbook-utils/patches/docbook-utils-spaces.patch
new file mode 100644 (file)
index 0000000..4c18b1d
--- /dev/null
@@ -0,0 +1,32 @@
+--- docbook-utils-0.6.14/bin/jw.in.spaces      2003-04-30 17:21:49.000000000 +0100
++++ docbook-utils-0.6.14/bin/jw.in     2004-08-19 09:33:34.989426640 +0100
+@@ -405,9 +405,9 @@
+   echo -e $SGML_HELP_MESSAGE >&2
+   exit 1
+ fi
+-if [ ! -d $SGML_OUTPUT_DIRECTORY ]
++if [ ! -d "$SGML_OUTPUT_DIRECTORY" ]
+ then
+-  mkdir $SGML_OUTPUT_DIRECTORY 2>/dev/null
++  mkdir "$SGML_OUTPUT_DIRECTORY" 2>/dev/null
+   if [ $? -ne 0 ]
+   then
+     echo "`basename $0`: Could not create \"$SGML_OUTPUT_DIRECTORY\" output directory" >&2
+@@ -422,7 +422,7 @@
+ echo "Using catalogs: `echo $SGML_CATALOG_FILES | sed 's/:/, /g'`"
+ echo "Using stylesheet: $SGML_STYLESHEET"
+ echo "Working on: $SGML_FILE"
+-cd $SGML_OUTPUT_DIRECTORY
++cd "$SGML_OUTPUT_DIRECTORY"
+ export SGML_JADE SGML_FILE_NAME SGML_ARGUMENTS
+ export SGML_CATALOG_FILES SGML_BASE_DIR SGML_FILE SGML_STYLESHEET
+ NOCHUNKS=`echo $SGML_OPTIONS | grep nochunks`
+@@ -433,7 +433,7 @@
+       sh $SGML_BACKEND >$SGML_FILE_NAME.html
+ fi
+ SGML_RETURN=$?
+-cd $SGML_CURRENT_DIRECTORY
++cd "$SGML_CURRENT_DIRECTORY"
+ if [ $SGML_RETURN -gt 0 ]
+ then exit `expr 7 + $SGML_RETURN`
diff --git a/docbook-utils/patches/docbook-utils-w3mtxtconvert.patch b/docbook-utils/patches/docbook-utils-w3mtxtconvert.patch
new file mode 100644 (file)
index 0000000..249af8e
--- /dev/null
@@ -0,0 +1,12 @@
+diff -urNp original/txt new/txt
+--- original/backends/txt      2007-11-05 18:44:52.000000000 +0100
++++ new/backends/txt   2007-11-22 15:21:36.000000000 +0100
+@@ -13,7 +13,7 @@ then
+ elif [ -x /usr/bin/w3m ]
+ then
+   CONVERT=/usr/bin/w3m
+-  ARGS="-dump"
++  ARGS="-T text/html -dump"
+ else
+   echo >&2 "No way to convert HTML to text found."
+   exit 1
diff --git a/docbook-xsl/Makefile b/docbook-xsl/Makefile
new file mode 100644 (file)
index 0000000..281656d
--- /dev/null
@@ -0,0 +1,52 @@
+BINDIR = /usr/bin
+DESTDIR = ..overridden in spec file..
+
+all: install
+
+install: install-xsl install-img install-extensions install-misc install-epub
+
+install-xsl:
+       mkdir -p $(DESTDIR)/{common,eclipse,fo,html,htmlhelp/doc,javahelp,lib,template,xhtml,xhtml-1_1,manpages,profiling,highlighting,roundtrip,website}
+       cp common/*.dtd $(DESTDIR)/common
+       cp common/*.ent $(DESTDIR)/common
+       cp common/*.xml $(DESTDIR)/common
+       cp common/*.xsl $(DESTDIR)/common
+       cp eclipse/*.xsl $(DESTDIR)/eclipse
+       cp fo/*.xml $(DESTDIR)/fo
+       cp fo/*.xsl $(DESTDIR)/fo
+       cp html/*.xml $(DESTDIR)/html
+       cp html/*.xsl $(DESTDIR)/html
+       cp htmlhelp/*.xsl $(DESTDIR)/htmlhelp
+       cp javahelp/*.xsl $(DESTDIR)/javahelp
+       cp lib/*.xsl $(DESTDIR)/lib
+       cp template/*.xsl $(DESTDIR)/template
+       cp xhtml/*.xsl $(DESTDIR)/xhtml
+       cp xhtml-1_1/*.xsl $(DESTDIR)/xhtml-1_1
+       cp manpages/*.xsl $(DESTDIR)/manpages
+       cp profiling/*.xsl $(DESTDIR)/profiling
+       cp highlighting/*.xml $(DESTDIR)/highlighting
+       cp highlighting/*.xsl $(DESTDIR)/highlighting
+       cp roundtrip/*.xml $(DESTDIR)/roundtrip
+       cp roundtrip/*.xsl $(DESTDIR)/roundtrip
+       cp roundtrip/*.dtd $(DESTDIR)/roundtrip
+       cp website/*.xsl $(DESTDIR)/website
+
+install-img:
+       mkdir -p $(DESTDIR)/images/callouts
+       cp images/*.gif $(DESTDIR)/images
+       cp images/*.png $(DESTDIR)/images
+       cp images/*.svg $(DESTDIR)/images
+       cp images/callouts/*.png $(DESTDIR)/images/callouts
+       cp images/callouts/*.gif $(DESTDIR)/images/callouts
+       cp images/callouts/*.svg $(DESTDIR)/images/callouts
+
+install-extensions:
+       mkdir -p $(DESTDIR)/extensions
+       cp -r extensions/* $(DESTDIR)/extensions
+
+install-epub:
+       mkdir -p $(DESTDIR)/epub
+       cp -r epub/* ${DESTDIR}/epub
+
+install-misc:
+       cp VERSION $(DESTDIR)
diff --git a/docbook-xsl/docbook-xsl.nm b/docbook-xsl/docbook-xsl.nm
new file mode 100644 (file)
index 0000000..797789f
--- /dev/null
@@ -0,0 +1,85 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = docbook-xsl
+version    = 1.76.1
+release    = 2
+arch       = noarch
+
+groups     = Applications/Text
+url        = http://docbook.sourceforge.net/projects/xsl/
+license    = GPLv2+
+summary    = Norman Walsh's XSL stylesheets for DocBook XML.
+
+description
+       hese XSL stylesheets allow you to transform any DocBook XML document to
+       other formats, such as HTML, FO, and XHMTL.  They are highly customizable.
+end
+
+source_dl = http://prdownloads.sourceforge.net/docbook/
+
+sources =\
+       %{thisapp}.tar.bz2 \
+       %{name}-doc-%{version}.tar.bz2
+
+build
+       prepare_cmds
+               cp -av %{DIR_SOURCE}/Makefile %{DIR_APP}/Makefile
+       end
+
+       build = # empty
+
+       make_install_targets +=\
+               BINDIR=%{BUILDROOT}/usr/bin \
+               DESTDIR=%{BUILDROOT}/usr/share/sgml/docbook/xsl-stylesheets-%{version}
+
+       install_cmds
+               # Remove buggy extensions.
+               rm -rfv %{BUILDROOT}/usr/share/sgml/docbook/xsl-stylesheets-%{version}/extensions/*
+
+               # Remove unneeded tool for .epub formats.
+               rm -rvf %{BUILDROOT}/usr/share/sgml/docbook/xsl-stylesheets-%{version}/epub
+       end
+end
+
+packages
+       package %{name}
+               requires
+                       libxslt
+                       docbook-dtds
+                       sgml-common
+               end
+
+               prerequires +=\
+                       docbook-dtds \
+                       libxml2 \
+                       sgml-common
+
+               script postin
+                       # Install catalog files.
+                       /usr/bin/xmlcatalog --noout --add "rewriteSystem" \
+                               "http://docbook.sourceforge.net/release/xsl/%{version}" \
+                               "file:///usr/share/sgml/docbook/xsl-stylesheets-%{version}" /etc/xml/catalog
+
+                       /usr/bin/xmlcatalog --noout --add "rewriteURI" \
+                               "http://docbook.sourceforge.net/release/xsl/%{version}" \
+                               "file:///usr/share/sgml/docbook/xsl-stylesheets-%{version}" /etc/xml/catalog
+
+                       /usr/bin/xmlcatalog --noout --add "rewriteSystem" \
+                               "http://docbook.sourceforge.net/release/xsl/current" \
+                               "file:///usr/share/sgml/docbook/xsl-stylesheets-%{version}" /etc/xml/catalog
+
+                       /usr/bin/xmlcatalog --noout --add "rewriteURI" \
+                               "http://docbook.sourceforge.net/release/xsl/current" \
+                               "file:///usr/share/sgml/docbook/xsl-stylesheets-%{version}" /etc/xml/catalog
+               end
+
+               script preun
+                       # Uninstall catalog files.
+                       /usr/bin/xmlcatalog --noout --del \
+                               "file:///usr/share/sgml/docbook/xsl-stylesheets-%{version}" /etc/xml/catalog
+               end
+       end
+end
diff --git a/docbook-xsl/patches/docbook-xsl-list-item-body.patch b/docbook-xsl/patches/docbook-xsl-list-item-body.patch
new file mode 100644 (file)
index 0000000..a3d3819
--- /dev/null
@@ -0,0 +1,110 @@
+diff -ruNp docbook-xsl-1.74.0.orig/fo/lists.xsl docbook-xsl-1.74.0/fo/lists.xsl
+--- docbook-xsl-1.74.0.orig/fo/lists.xsl       2008-08-06 13:32:46.000000000 +0200
++++ docbook-xsl-1.74.0/fo/lists.xsl    2008-08-06 13:41:27.000000000 +0200
+@@ -248,9 +248,17 @@
+       </fo:block>
+     </fo:list-item-label>
+     <fo:list-item-body start-indent="body-start()">
+-      <fo:block>
+-        <xsl:apply-templates/>
+-      </fo:block>
++      <xsl:choose>
++        <!-- * work around broken passivetex list-item-body rendering -->
++        <xsl:when test="$passivetex.extensions = '1'">
++          <xsl:apply-templates/>
++        </xsl:when>
++        <xsl:otherwise>
++          <fo:block>
++            <xsl:apply-templates/>
++          </fo:block>
++        </xsl:otherwise>
++      </xsl:choose>
+     </fo:list-item-body>
+   </xsl:variable>
+@@ -446,10 +454,18 @@
+       </fo:block>
+     </fo:list-item-label>
+     <fo:list-item-body start-indent="body-start()">
+-      <fo:block>
+-        <xsl:apply-templates select="listitem"/>
+-      </fo:block>
+-    </fo:list-item-body>
++      <xsl:choose>
++        <!-- * work around broken passivetex list-item-body rendering -->
++        <xsl:when test="$passivetex.extensions = '1'">
++          <xsl:apply-templates select="listitem"/>
++        </xsl:when>
++        <xsl:otherwise>
++          <fo:block>
++            <xsl:apply-templates select="listitem"/>
++          </fo:block>
++        </xsl:otherwise>
++      </xsl:choose>
++     </fo:list-item-body>
+   </xsl:variable>
+   <xsl:choose>
+@@ -925,9 +941,17 @@
+       </fo:block>
+     </fo:list-item-label>
+     <fo:list-item-body start-indent="body-start()">
+-      <fo:block>
+-        <xsl:apply-templates/>
+-      </fo:block>
++      <xsl:choose>
++        <!-- * work around broken passivetex list-item-body rendering -->
++        <xsl:when test="$passivetex.extensions = '1'">
++          <xsl:apply-templates/>
++        </xsl:when>
++        <xsl:otherwise>
++          <fo:block>
++            <xsl:apply-templates/>
++          </fo:block>
++        </xsl:otherwise>
++      </xsl:choose>
+     </fo:list-item-body>
+   </fo:list-item>
+ </xsl:template>
+@@ -951,9 +975,17 @@
+       </fo:block>
+     </fo:list-item-label>
+     <fo:list-item-body start-indent="body-start()">
+-      <fo:block>
+-        <xsl:apply-templates/>
+-      </fo:block>
++      <xsl:choose>
++        <!-- * work around broken passivetex list-item-body rendering -->
++        <xsl:when test="$passivetex.extensions = '1'">
++          <xsl:apply-templates/>
++        </xsl:when>
++        <xsl:otherwise>
++          <fo:block>
++            <xsl:apply-templates/>
++          </fo:block>
++        </xsl:otherwise>
++      </xsl:choose>
+     </fo:list-item-body>
+   </fo:list-item>
+ </xsl:template>
+@@ -1141,9 +1173,17 @@
+       </fo:block>
+     </fo:list-item-label>
+     <fo:list-item-body start-indent="body-start()">
+-      <fo:block>
+-        <xsl:apply-templates/>
+-      </fo:block>
++      <xsl:choose>
++        <!-- * work around broken passivetex list-item-body rendering -->
++        <xsl:when test="$passivetex.extensions = '1'">
++          <xsl:apply-templates/>
++        </xsl:when>
++        <xsl:otherwise>
++          <fo:block>
++            <xsl:apply-templates/>
++          </fo:block>
++        </xsl:otherwise>
++      </xsl:choose>
+     </fo:list-item-body>
+   </fo:list-item>
+ </xsl:template>
diff --git a/docbook-xsl/patches/docbook-xsl-mandir.patch b/docbook-xsl/patches/docbook-xsl-mandir.patch
new file mode 100644 (file)
index 0000000..d2c5a7e
--- /dev/null
@@ -0,0 +1,19 @@
+diff -urNp docbook-xsl-1.76.1-orig/manpages/other.xsl docbook-xsl-1.76.1/manpages/other.xsl
+--- docbook-xsl-1.76.1-orig/manpages/other.xsl 2010-08-27 05:14:52.000000000 +0200
++++ docbook-xsl-1.76.1/manpages/other.xsl      2011-09-06 17:17:07.973737258 +0200
+@@ -595,7 +595,14 @@ manvolnum
+           <xsl:with-param name="message-prolog">Note: </xsl:with-param>
+           <xsl:with-param name="message-epilog"> (soelim stub)</xsl:with-param>
+           <xsl:with-param name="content">
+-            <xsl:value-of select="'.so '"/>
++            <xsl:choose>
++              <xsl:when test="$man.output.in.separate.dir = 0">
++              <xsl:value-of select="concat('.so man', $section, '/')"/>
++              </xsl:when>
++              <xsl:otherwise>
++              <xsl:value-of select="'.so '"/> <!-- added case -->
++              </xsl:otherwise>
++              </xsl:choose>
+             <xsl:call-template name="make.adjusted.man.filename">
+               <xsl:with-param name="name" select="$first.refname"/>
+               <xsl:with-param name="section" select="$section"/>
diff --git a/docbook-xsl/patches/docbook-xsl-marginleft.patch b/docbook-xsl/patches/docbook-xsl-marginleft.patch
new file mode 100644 (file)
index 0000000..31c1b84
--- /dev/null
@@ -0,0 +1,100 @@
+diff -ruNp docbook-xsl-1.74.0.orig/fo/lists.xsl docbook-xsl-1.74.0/fo/lists.xsl
+--- docbook-xsl-1.74.0.orig/fo/lists.xsl       2008-06-01 23:36:39.000000000 +0200
++++ docbook-xsl-1.74.0/fo/lists.xsl    2008-08-06 13:32:46.000000000 +0200
+@@ -324,7 +324,7 @@
+       </xsl:when>
+       <xsl:when test="@termlength">
+         <xsl:variable name="termlength.is.number">
+-          <xsl:value-of select="@termlength + 0"/>
++          <xsl:value-of select="@termlength"/>
+         </xsl:variable>
+         <xsl:choose>
+           <xsl:when test="string($termlength.is.number) = 'NaN'">
+@@ -333,15 +333,7 @@
+           </xsl:when>
+           <xsl:otherwise>
+             <xsl:value-of select="@termlength"/>
+-            <xsl:choose>
+-              <!-- workaround for passivetex lack of support for non-constant expressions -->
+-              <xsl:when test="$passivetex.extensions != 0">
+-                <xsl:text>em</xsl:text>
+-              </xsl:when>
+-              <xsl:otherwise>
+-                <xsl:text>em * 0.60</xsl:text>
+-              </xsl:otherwise>
+-            </xsl:choose>
++            <xsl:text>em</xsl:text>
+           </xsl:otherwise>
+         </xsl:choose>
+       </xsl:when>
+@@ -350,15 +342,7 @@
+           <xsl:with-param name="terms" select="varlistentry/term"/>
+           <xsl:with-param name="maxlength" select="$variablelist.max.termlength"/>
+         </xsl:call-template>
+-        <xsl:choose>
+-          <!-- workaround for passivetex lack of support for non-constant expressions -->
+-          <xsl:when test="$passivetex.extensions != 0">
+-            <xsl:text>em</xsl:text>
+-          </xsl:when>
+-          <xsl:otherwise>
+-            <xsl:text>em * 0.60</xsl:text>
+-          </xsl:otherwise>
+-        </xsl:choose>
++        <xsl:text>em</xsl:text>
+       </xsl:otherwise>
+     </xsl:choose>
+   </xsl:variable>
+@@ -372,17 +356,7 @@
+   <xsl:variable name="label-separation">1em</xsl:variable>
+   <xsl:variable name="distance-between-starts">
+-    <xsl:choose>
+-      <!-- workaround for passivetex lack of support for non-constant expressions -->
+-      <xsl:when test="$passivetex.extensions != 0">
+-        <xsl:value-of select="$termlength"/>
+-      </xsl:when>
+-      <xsl:otherwise>
+-        <xsl:value-of select="$termlength"/>
+-        <xsl:text>+</xsl:text>
+-        <xsl:value-of select="$label-separation"/>
+-      </xsl:otherwise>
+-    </xsl:choose>
++    <xsl:value-of select="$termlength"/>
+   </xsl:variable>
+   <xsl:if test="title">
+diff -ruNp docbook-xsl-1.74.0.orig/fo/param.xsl docbook-xsl-1.74.0/fo/param.xsl
+--- docbook-xsl-1.74.0.orig/fo/param.xsl       2008-06-02 01:06:18.000000000 +0200
++++ docbook-xsl-1.74.0/fo/param.xsl    2008-08-06 13:32:46.000000000 +0200
+@@ -133,8 +133,8 @@
+ <xsl:attribute-set name="component.title.properties">
+   <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
+   <xsl:attribute name="space-before.optimum"><xsl:value-of select="concat($body.font.master, 'pt')"/></xsl:attribute>
+-  <xsl:attribute name="space-before.minimum"><xsl:value-of select="concat($body.font.master, 'pt * 0.8')"/></xsl:attribute>
+-  <xsl:attribute name="space-before.maximum"><xsl:value-of select="concat($body.font.master, 'pt * 1.2')"/></xsl:attribute>
++  <xsl:attribute name="space-before.minimum"><xsl:value-of select="concat($body.font.master*0.8, 'pt')"/></xsl:attribute>
++  <xsl:attribute name="space-before.maximum"><xsl:value-of select="concat($body.font.master*1.2, 'pt')"/></xsl:attribute>
+   <xsl:attribute name="hyphenate">false</xsl:attribute>
+   <xsl:attribute name="text-align">
+     <xsl:choose>
+diff -urNp docbook-xsl-1.75.0-orig/fo/pagesetup.xsl docbook-xsl-1.75.0/fo/pagesetup.xsl
+--- docbook-xsl-1.75.0-orig/fo/pagesetup.xsl   2009-05-11 11:40:49.000000000 +0200
++++ docbook-xsl-1.75.0/fo/pagesetup.xsl        2009-05-11 11:42:29.000000000 +0200
+@@ -30,16 +30,7 @@
+ </xsl:param>
+ <xsl:param name="margin.left.inner">
+-  <xsl:choose>
+-    <xsl:when test="$passivetex.extensions != 0">
+-      <xsl:value-of select="$page.margin.inner"/>
+-    </xsl:when>
+-    <xsl:otherwise>
+-      <xsl:value-of select="$page.margin.inner"/>
+-      <xsl:text> - </xsl:text>
+-      <xsl:value-of select="$title.margin.left"/>
+-    </xsl:otherwise>
+-  </xsl:choose>
++  <xsl:value-of select="$page.margin.inner"/>
+ </xsl:param>
+ <xsl:template name="setup.pagemasters">
diff --git a/docbook-xsl/patches/docbook-xsl-newmethods.patch b/docbook-xsl/patches/docbook-xsl-newmethods.patch
new file mode 100644 (file)
index 0000000..debc51b
--- /dev/null
@@ -0,0 +1,394 @@
+diff -ruNp docbook-xsl-1.74.0.orig/html/docbook.xsl docbook-xsl-1.74.0/html/docbook.xsl
+--- docbook-xsl-1.74.0.orig/html/docbook.xsl   2008-06-01 23:36:39.000000000 +0200
++++ docbook-xsl-1.74.0/html/docbook.xsl        2008-08-06 13:37:35.000000000 +0200
+@@ -26,6 +26,7 @@
+ <xsl:include href="../VERSION"/>
+ <xsl:include href="param.xsl"/>
+ <xsl:include href="../lib/lib.xsl"/>
++<xsl:include href="../lib/dumpfragment.xsl"/>
+ <xsl:include href="../common/l10n.xsl"/>
+ <xsl:include href="../common/common.xsl"/>
+ <xsl:include href="../common/utility.xsl"/>
+@@ -44,6 +45,7 @@
+ <xsl:include href="graphics.xsl"/>
+ <xsl:include href="xref.xsl"/>
+ <xsl:include href="formal.xsl"/>
++<xsl:include href="dtbl.xsl"/>
+ <xsl:include href="table.xsl"/>
+ <xsl:include href="htmltbl.xsl"/>
+ <xsl:include href="sections.xsl"/>
+diff -ruNp docbook-xsl-1.74.0.orig/html/dtbl.xsl docbook-xsl-1.74.0/html/dtbl.xsl
+--- docbook-xsl-1.74.0.orig/html/dtbl.xsl      1970-01-01 01:00:00.000000000 +0100
++++ docbook-xsl-1.74.0/html/dtbl.xsl   2008-08-06 13:37:35.000000000 +0200
+@@ -0,0 +1,293 @@
++<?xml version="1.0" encoding="US-ASCII"?>
++<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
++                xmlns:exsl="http://exslt.org/common"
++                xmlns:func="http://exslt.org/functions"
++                xmlns:dtbl="http://docbook.sourceforge.net/dtbl"
++                extension-element-prefixes="func"
++                exclude-result-prefixes="exsl func dtbl"
++                version="1.0">
++
++<func:function name="dtbl:convertLength">
++  <xsl:param name="arbitrary.length"/>
++
++  <xsl:variable name="pixels.per.inch" select="96"/>
++
++  <xsl:variable name="unscaled.length"
++                select="translate($arbitrary.length, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ', '')"/>
++
++  <xsl:variable name="units"
++                select="translate($arbitrary.length,'+-0123456789. ', '')"/>
++
++  <xsl:variable name="scaled.length">
++    <xsl:choose>
++      <xsl:when test="$units='in'">
++        <xsl:value-of select="$unscaled.length * $pixels.per.inch"/>
++      </xsl:when>
++      <xsl:when test="$units='cm'">
++        <xsl:value-of select="$unscaled.length * ($pixels.per.inch div 2.54)"/>
++      </xsl:when>
++      <xsl:when test="$units='mm'">
++        <xsl:value-of select="$unscaled.length * ($pixels.per.inch div 25.4)"/>
++      </xsl:when>
++      <xsl:when test="$units='pc'">
++        <xsl:value-of select="$unscaled.length * (($pixels.per.inch div 72) * 12)"/>
++      </xsl:when>
++      <xsl:when test="$units='pt'">
++        <xsl:value-of select="$unscaled.length * ($pixels.per.inch div 72)"/>
++      </xsl:when>
++      <xsl:when test="$units='px' or $units=''">
++        <xsl:value-of select="$unscaled.length"/>
++      </xsl:when>
++      <xsl:otherwise>
++        <xsl:message terminate="no">
++          <xsl:text>"</xsl:text>
++          <xsl:value-of select="$units"/>
++          <xsl:text>" is not a known unit.  Applying scaling factor of 1 instead.</xsl:text>
++        </xsl:message>
++        <xsl:value-of select="$unscaled.length"/>
++      </xsl:otherwise>
++    </xsl:choose>
++  </xsl:variable>
++
++  <func:result select="round($scaled.length)"/>
++</func:function>
++
++<func:function name="dtbl:adjustColumnWidths">
++  <xsl:param name="colgroup"/>
++
++  <xsl:if test="$adjustColumnWidths.debug">
++    <xsl:message>
++      <xsl:text>entering adjustColumnWidths(</xsl:text>
++      <xsl:call-template name="dump-fragment">
++        <xsl:with-param name="fragment" select="$colgroup"/>
++      </xsl:call-template>
++      <xsl:text>)</xsl:text>
++    </xsl:message>
++  </xsl:if>
++
++  <xsl:variable name="expanded.colgroup">
++    <xsl:apply-templates select="exsl:node-set($colgroup)/*" mode="dtbl-split-widths"/>
++  </xsl:variable>
++
++  <xsl:variable name="absolute.widths.total">
++    <xsl:value-of select="sum(exsl:node-set($expanded.colgroup)//col/@abswidth)"/>
++  </xsl:variable>
++
++  <xsl:variable name="relative.widths.total">
++    <xsl:value-of select="sum(exsl:node-set($expanded.colgroup)//col/@relwidth)"/>
++  </xsl:variable>
++
++  <xsl:if test="$adjustColumnWidths.debug">
++    <xsl:message>
++      <xsl:text>total relative widths = (</xsl:text>
++      <xsl:value-of select="$relative.widths.total"/>
++      <xsl:text>)</xsl:text>
++    </xsl:message>
++    <xsl:message>
++      <xsl:text>total absolute widths = (</xsl:text>
++      <xsl:value-of select="$absolute.widths.total"/>
++      <xsl:text>)</xsl:text>
++    </xsl:message>
++  </xsl:if>
++
++  <xsl:variable name="adjusted.colgroup">
++    <xsl:choose>
++      <xsl:when test="$relative.widths.total = 0">
++        <xsl:if test="$adjustColumnWidths.debug">
++          <xsl:message>all widths are absolute</xsl:message>
++        </xsl:if>
++        <xsl:apply-templates select="exsl:node-set($expanded.colgroup)/*"
++                             mode="dtbl-use-absolute-widths"/>
++      </xsl:when>
++      <xsl:when test="$absolute.widths.total = 0">
++        <xsl:if test="$adjustColumnWidths.debug">
++          <xsl:message>all widths are relative</xsl:message>
++        </xsl:if>
++        <xsl:apply-templates select="exsl:node-set($expanded.colgroup)/*"
++                             mode="dtbl-use-relative-widths">
++          <xsl:with-param name="relative.widths.total"
++                          select="$relative.widths.total"/>
++        </xsl:apply-templates>
++      </xsl:when>
++    </xsl:choose>
++  </xsl:variable>
++
++  <xsl:variable name="corrected.adjusted.colgroup">
++    <xsl:choose>
++      <xsl:when test="$relative.widths.total = 0">
++        <xsl:copy-of select="$adjusted.colgroup"/>
++      </xsl:when>
++      <xsl:otherwise>
++        <xsl:variable name="widths.total"
++                      select="sum(exsl:node-set($adjusted.colgroup)//col/@width)"/>
++        <xsl:variable name="n.columns"
++                      select="count(exsl:node-set($adjusted.colgroup)//col)"/>
++        <xsl:variable name="error"
++                      select="100 - $widths.total"/>
++        <xsl:variable name="first.bad.column"
++                      select="($n.columns - $error) + 1"/>
++        <xsl:apply-templates select="exsl:node-set($adjusted.colgroup)/*"
++                             mode="dtbl-correct-rounding-error">
++          <xsl:with-param name="first.bad.column"
++                          select="$first.bad.column"/>
++        </xsl:apply-templates>
++      </xsl:otherwise>
++    </xsl:choose>
++  </xsl:variable>
++
++  <xsl:if test="$adjustColumnWidths.debug">
++    <xsl:message>
++      <xsl:text>result = (</xsl:text>
++      <xsl:call-template name="dump-fragment">
++        <xsl:with-param name="fragment" select="$corrected.adjusted.colgroup"/>
++      </xsl:call-template>
++      <xsl:text>)</xsl:text>
++    </xsl:message>
++  </xsl:if>
++
++  <func:result select="$corrected.adjusted.colgroup"/>
++</func:function>
++
++<xsl:template match="colgroup" mode="dtbl-correct-rounding-error">
++  <xsl:param name="first.bad.column"/>
++
++  <xsl:if test="$adjustColumnWidths.debug">
++    <xsl:message>
++      <xsl:text>first.bad.column = (</xsl:text>
++      <xsl:value-of select="$first.bad.column"/>
++      <xsl:text>)</xsl:text>
++    </xsl:message>
++  </xsl:if>
++
++  <colgroup>
++    <xsl:for-each select="col[position() &lt; $first.bad.column]">
++      <xsl:element name="col">
++        <xsl:attribute name="width">
++          <xsl:value-of select="concat(@width, '%')"/>
++        </xsl:attribute>
++      </xsl:element>
++    </xsl:for-each>
++    <xsl:for-each select="col[position() >= $first.bad.column]">
++      <xsl:element name="col">
++        <xsl:attribute name="width">
++          <xsl:value-of select="concat(@width + 1, '%')"/>
++        </xsl:attribute>
++      </xsl:element>
++    </xsl:for-each>
++  </colgroup>
++</xsl:template>
++
++<xsl:template match="col" mode="dtbl-correct-rounding-error">
++  <xsl:param name="relative.widths.total"/>
++  <xsl:param name="error"/>
++
++  <xsl:element name="col">
++    <xsl:attribute name="width">
++      <xsl:value-of select="concat('', round((@relwidth div $relative.widths.total) * 100))"/>
++    </xsl:attribute>
++    <xsl:apply-templates mode="dtbl-use-absolute-widths"/>
++  </xsl:element>
++</xsl:template>
++
++<xsl:template match="colgroup" mode="dtbl-use-relative-widths">
++  <xsl:param name="relative.widths.total"/>
++
++  <colgroup>
++    <xsl:apply-templates mode="dtbl-use-relative-widths">
++      <xsl:with-param name="relative.widths.total"
++                      select="$relative.widths.total"/>
++    </xsl:apply-templates>
++  </colgroup>
++</xsl:template>
++
++<xsl:template match="col" mode="dtbl-use-relative-widths">
++  <xsl:param name="relative.widths.total"/>
++
++  <xsl:element name="col">
++    <xsl:attribute name="width">
++      <xsl:value-of select="round((@relwidth div $relative.widths.total) * 100)"/>
++    </xsl:attribute>
++    <xsl:apply-templates mode="dtbl-use-absolute-widths"/>
++  </xsl:element>
++</xsl:template>
++
++<xsl:template match="colgroup" mode="dtbl-use-absolute-widths">
++  <colgroup>
++    <xsl:apply-templates mode="dtbl-use-absolute-widths"/>
++  </colgroup>
++</xsl:template>
++
++<xsl:template match="col" mode="dtbl-use-absolute-widths">
++  <xsl:element name="col">
++    <xsl:attribute name="width">
++      <xsl:value-of select="@abswidth"/>
++    </xsl:attribute>
++    <xsl:apply-templates mode="dtbl-use-absolute-widths"/>
++  </xsl:element>
++</xsl:template>
++
++<xsl:template match="colgroup" mode="dtbl-split-widths">
++  <colgroup>
++    <xsl:apply-templates mode="dtbl-split-widths"/>
++  </colgroup>
++</xsl:template>
++
++<xsl:template match="col" mode="dtbl-split-widths">
++
++  <!-- width = @width ? @width : '1*' -->
++  <xsl:variable name="width">
++    <xsl:choose>
++      <xsl:when test="@width != ''">
++        <xsl:value-of select="@width"/>
++      </xsl:when>
++      <xsl:otherwise>
++        <xsl:text>1*</xsl:text>
++      </xsl:otherwise>
++    </xsl:choose>
++  </xsl:variable>
++
++  <!-- absolute.width = contains($width,'*') ? substring-after($width, '*') : $width -->
++  <xsl:variable name="absolute.width">
++    <xsl:choose>
++      <xsl:when test="contains($width, '*')">
++        <xsl:value-of select="substring-after($width, '*')"/>
++      </xsl:when>
++      <xsl:otherwise>
++        <xsl:value-of select="$width"/>
++      </xsl:otherwise>
++    </xsl:choose>
++  </xsl:variable>
++
++  <xsl:variable name="converted.absolute.width">
++    <xsl:choose>
++      <xsl:when test="$absolute.width != ''">
++        <xsl:value-of select="dtbl:convertLength($absolute.width)"/>
++      </xsl:when>
++     <xsl:otherwise>0</xsl:otherwise>
++    </xsl:choose>
++  </xsl:variable>
++
++  <xsl:variable name="relative.width">
++    <xsl:choose>
++      <xsl:when test="substring-before($width, '*') != ''">
++        <xsl:value-of select="substring-before($width, '*')"/>
++      </xsl:when>
++      <xsl:otherwise>0</xsl:otherwise>
++    </xsl:choose>
++  </xsl:variable>
++
++  <xsl:element name="col">
++    <xsl:attribute name="width">
++      <xsl:value-of select="$width"/>
++    </xsl:attribute>
++    <xsl:attribute name="relwidth">
++      <xsl:value-of select="$relative.width"/>
++    </xsl:attribute>
++    <xsl:attribute name="abswidth">
++      <xsl:value-of select="$converted.absolute.width"/>
++    </xsl:attribute>
++    <xsl:apply-templates mode="dtbl-split-widths"/>
++  </xsl:element>
++</xsl:template>
++
++</xsl:stylesheet>
+diff -ruNp docbook-xsl-1.74.0.orig/html/table.xsl docbook-xsl-1.74.0/html/table.xsl
+--- docbook-xsl-1.74.0.orig/html/table.xsl     2008-06-01 23:36:39.000000000 +0200
++++ docbook-xsl-1.74.0/html/table.xsl  2008-08-06 13:37:35.000000000 +0200
+@@ -5,7 +5,8 @@
+                 xmlns:xtbl="xalan://com.nwalsh.xalan.Table"
+                 xmlns:lxslt="http://xml.apache.org/xslt"
+                 xmlns:ptbl="http://nwalsh.com/xslt/ext/xsltproc/python/Table"
+-                exclude-result-prefixes="doc stbl xtbl lxslt ptbl"
++                xmlns:dtbl="http://docbook.sourceforge.net/dtbl"
++                exclude-result-prefixes="doc stbl xtbl lxslt ptbl dtbl"
+                 version='1.0'>
+ <xsl:include href="../common/table.xsl"/>
+@@ -365,6 +366,9 @@
+           <xsl:when test="$use.extensions != 0
+                           and $tablecolumns.extension != 0">
+             <xsl:choose>
++              <xsl:when test="function-available('dtbl:convertLength')">
++                <xsl:value-of select="dtbl:convertLength($table.width)"/>
++              </xsl:when>
+               <xsl:when test="function-available('stbl:convertLength')">
+                 <xsl:value-of select="stbl:convertLength($table.width)"/>
+               </xsl:when>
+@@ -389,6 +393,9 @@
+       <xsl:when test="$use.extensions != 0
+                       and $tablecolumns.extension != 0">
+         <xsl:choose>
++          <xsl:when test="function-available('dtbl:adjustColumnWidths')">
++            <xsl:copy-of select="dtbl:adjustColumnWidths($colgroup)"/>
++          </xsl:when>
+           <xsl:when test="function-available('stbl:adjustColumnWidths')">
+             <xsl:copy-of select="stbl:adjustColumnWidths($colgroup)"/>
+           </xsl:when>
+diff -ruNp docbook-xsl-1.74.0.orig/lib/dumpfragment.xsl docbook-xsl-1.74.0/lib/dumpfragment.xsl
+--- docbook-xsl-1.74.0.orig/lib/dumpfragment.xsl       1970-01-01 01:00:00.000000000 +0100
++++ docbook-xsl-1.74.0/lib/dumpfragment.xsl    2008-08-06 13:37:35.000000000 +0200
+@@ -0,0 +1,30 @@
++<?xml version="1.0" encoding="US-ASCII"?>
++<xsl:stylesheet version="1.0"
++                xmlns:exsl="http://exslt.org/common"
++                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
++                xmlns="http://www.w3.org/1999/xhtml"
++                exclude-result-prefixes="exsl">
++
++<xsl:template name="dump-fragment">
++  <xsl:param name="fragment"/>
++  <xsl:apply-templates select="exsl:node-set($fragment)/*" mode="dump-fragment"/>
++</xsl:template>
++
++<xsl:template match="@*" mode="dump-fragment">
++  <xsl:text> </xsl:text>
++  <xsl:value-of select="local-name(.)"/>
++  <xsl:text>="</xsl:text>
++  <xsl:value-of select="."/>
++  <xsl:text>"</xsl:text>
++</xsl:template>
++
++<xsl:template match="*" mode="dump-fragment">
++  <xsl:text>&lt;</xsl:text><xsl:value-of select="local-name(.)"/>
++  <xsl:apply-templates select="@*" mode="dump-fragment"/>
++  <xsl:text>></xsl:text>
++  <xsl:apply-templates mode="dump-fragment"/>
++  <xsl:text>&lt;/</xsl:text><xsl:value-of select="local-name(.)"/>
++  <xsl:text>></xsl:text>
++</xsl:template>
++
++</xsl:stylesheet>
+diff -urNp docbook-xsl-1.76.0-orig/html/param.xsl docbook-xsl-1.76.0/html/param.xsl
+--- docbook-xsl-1.76.0-orig/html/param.xsl     2010-08-31 09:27:22.000000000 +0200
++++ docbook-xsl-1.76.0/html/param.xsl  2010-09-06 11:01:07.916914161 +0200
+@@ -68,6 +68,7 @@ div.annotation-close { position: absolut
+ http://docbook.sourceforge.net/release/images/annot-close.png</xsl:param>
+ <xsl:param name="annotation.graphic.open">http://docbook.sourceforge.net/release/images/annot-open.png</xsl:param>
++<xsl:param name="adjustColumnWidths.debug" select="false()"/>
+ <xsl:param name="annotation.js">
+ <xsl:text>http://docbook.sourceforge.net/release/script/AnchorPosition.js http://docbook.sourceforge.net/release/script/PopupWindow.js</xsl:text></xsl:param>
diff --git a/docbook-xsl/patches/docbook-xsl-non-constant-expressions.patch b/docbook-xsl/patches/docbook-xsl-non-constant-expressions.patch
new file mode 100644 (file)
index 0000000..0c3f6be
--- /dev/null
@@ -0,0 +1,25 @@
+diff -ruNp docbook-xsl-1.74.0.orig/fo/param.xsl docbook-xsl-1.74.0/fo/param.xsl
+--- docbook-xsl-1.74.0.orig/fo/param.xsl       2008-08-06 13:32:46.000000000 +0200
++++ docbook-xsl-1.74.0/fo/param.xsl    2008-08-06 13:38:36.000000000 +0200
+@@ -23,8 +23,8 @@
+   <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
+   <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
+   <xsl:attribute name="space-before.optimum"><xsl:value-of select="concat($body.font.master, 'pt')"/></xsl:attribute>
+-  <xsl:attribute name="space-before.minimum"><xsl:value-of select="concat($body.font.master, 'pt * 0.8')"/></xsl:attribute>
+-  <xsl:attribute name="space-before.maximum"><xsl:value-of select="concat($body.font.master, 'pt * 1.2')"/></xsl:attribute>
++  <xsl:attribute name="space-before.minimum"><xsl:value-of select="concat(($body.font.master * 0.8), 'pt')"/></xsl:attribute>
++  <xsl:attribute name="space-before.maximum"><xsl:value-of select="concat(($body.font.master * 1.2), 'pt')"/></xsl:attribute>
+   <xsl:attribute name="hyphenate">false</xsl:attribute>
+   <xsl:attribute name="text-align">center</xsl:attribute>
+ </xsl:attribute-set>
+@@ -334,8 +334,8 @@ set       toc,title
+   <xsl:attribute name="font-weight">bold</xsl:attribute>
+   <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
+   <xsl:attribute name="space-before.optimum"><xsl:value-of select="concat($body.font.master,'pt')"/></xsl:attribute>
+-  <xsl:attribute name="space-before.minimum"><xsl:value-of select="concat($body.font.master,'pt * 0.8')"/></xsl:attribute>
+-  <xsl:attribute name="space-before.maximum"><xsl:value-of select="concat($body.font.master,'pt * 1.2')"/></xsl:attribute>
++  <xsl:attribute name="space-before.minimum"><xsl:value-of select="concat(($body.font.master * 0.8),'pt')"/></xsl:attribute>
++  <xsl:attribute name="space-before.maximum"><xsl:value-of select="concat(($body.font.master * 1.2),'pt')"/></xsl:attribute>
+   <xsl:attribute name="start-indent">0pt</xsl:attribute>
+ </xsl:attribute-set>
+ <xsl:attribute-set name="index.entry.properties">
diff --git a/docbook-xsl/patches/docbook-xsl-pagesetup.patch b/docbook-xsl/patches/docbook-xsl-pagesetup.patch
new file mode 100644 (file)
index 0000000..e4d77ff
--- /dev/null
@@ -0,0 +1,227 @@
+diff -ruNp docbook-xsl-1.74.0.orig/fo/pagesetup.xsl docbook-xsl-1.74.0/fo/pagesetup.xsl
+--- docbook-xsl-1.74.0.orig/fo/pagesetup.xsl   2008-06-01 23:36:39.000000000 +0200
++++ docbook-xsl-1.74.0/fo/pagesetup.xsl        2008-08-06 13:31:11.000000000 +0200
+@@ -1697,36 +1697,81 @@
+         <xsl:with-param name="gentext-key" select="$gentext-key"/>
+       </xsl:call-template>
+-      <fo:table-column column-number="1">
+-        <xsl:attribute name="column-width">
+-          <xsl:text>proportional-column-width(</xsl:text>
+-          <xsl:call-template name="header.footer.width">
+-            <xsl:with-param name="location">header</xsl:with-param>
+-            <xsl:with-param name="position" select="$column1"/>
+-          </xsl:call-template>
+-          <xsl:text>)</xsl:text>
+-        </xsl:attribute>
+-      </fo:table-column>
+-      <fo:table-column column-number="2">
+-        <xsl:attribute name="column-width">
+-          <xsl:text>proportional-column-width(</xsl:text>
+-          <xsl:call-template name="header.footer.width">
+-            <xsl:with-param name="location">header</xsl:with-param>
+-            <xsl:with-param name="position" select="2"/>
+-          </xsl:call-template>
+-          <xsl:text>)</xsl:text>
+-        </xsl:attribute>
+-      </fo:table-column>
+-      <fo:table-column column-number="3">
+-        <xsl:attribute name="column-width">
+-          <xsl:text>proportional-column-width(</xsl:text>
+-          <xsl:call-template name="header.footer.width">
+-            <xsl:with-param name="location">header</xsl:with-param>
+-            <xsl:with-param name="position" select="$column3"/>
+-          </xsl:call-template>
+-          <xsl:text>)</xsl:text>
+-        </xsl:attribute>
+-      </fo:table-column>
++      <xsl:choose>
++        <xsl:when test="$passivetex.extensions != 0">
++          <fo:table-column column-number="1">
++            <xsl:attribute name="column-width">
++              <xsl:call-template name="header.footer.width">
++                <xsl:with-param name="location">header</xsl:with-param>
++                <xsl:with-param name="position" select="$column1"/>
++              </xsl:call-template>
++              <xsl:text>%</xsl:text>
++            </xsl:attribute>
++          </fo:table-column>
++        </xsl:when>
++        <xsl:otherwise>
++          <fo:table-column column-number="1">
++            <xsl:attribute name="column-width">
++              <xsl:text>proportional-column-width(</xsl:text>
++              <xsl:call-template name="header.footer.width">
++                <xsl:with-param name="location">header</xsl:with-param>
++                <xsl:with-param name="position" select="$column1"/>
++              </xsl:call-template>
++              <xsl:text>)</xsl:text>
++            </xsl:attribute>
++          </fo:table-column>
++        </xsl:otherwise>
++                      </xsl:choose>
++      <xsl:choose>
++        <xsl:when test="$passivetex.extensions != 0">
++          <fo:table-column column-number="2">
++            <xsl:attribute name="column-width">
++              <xsl:call-template name="header.footer.width">
++                <xsl:with-param name="location">header</xsl:with-param>
++                <xsl:with-param name="position" select="2"/>
++              </xsl:call-template>
++              <xsl:text>%</xsl:text>
++            </xsl:attribute>
++          </fo:table-column>
++        </xsl:when>
++        <xsl:otherwise>
++          <fo:table-column column-number="2">
++            <xsl:attribute name="column-width">
++              <xsl:text>proportional-column-width(</xsl:text>
++              <xsl:call-template name="header.footer.width">
++                <xsl:with-param name="location">header</xsl:with-param>
++                <xsl:with-param name="position" select="2"/>
++              </xsl:call-template>
++              <xsl:text>)</xsl:text>
++            </xsl:attribute>
++          </fo:table-column>
++        </xsl:otherwise>
++      </xsl:choose>
++      <xsl:choose>
++        <xsl:when test="$passivetex.extensions != 0">
++          <fo:table-column column-number="3">
++            <xsl:attribute name="column-width">
++              <xsl:call-template name="header.footer.width">
++                <xsl:with-param name="location">header</xsl:with-param>
++                <xsl:with-param name="position" select="$column3"/>
++              </xsl:call-template>
++              <xsl:text>%</xsl:text>
++            </xsl:attribute>
++          </fo:table-column>
++        </xsl:when>
++        <xsl:otherwise>
++          <fo:table-column column-number="3">
++            <xsl:attribute name="column-width">
++              <xsl:text>proportional-column-width(</xsl:text>
++              <xsl:call-template name="header.footer.width">
++                <xsl:with-param name="location">header</xsl:with-param>
++                <xsl:with-param name="position" select="$column3"/>
++              </xsl:call-template>
++              <xsl:text>)</xsl:text>
++            </xsl:attribute>
++          </fo:table-column>
++        </xsl:otherwise>
++      </xsl:choose>
+       <fo:table-body>
+         <fo:table-row>
+@@ -2021,36 +2066,81 @@
+         <xsl:with-param name="sequence" select="$sequence"/>
+         <xsl:with-param name="gentext-key" select="$gentext-key"/>
+       </xsl:call-template>
+-      <fo:table-column column-number="1">
+-        <xsl:attribute name="column-width">
+-          <xsl:text>proportional-column-width(</xsl:text>
+-          <xsl:call-template name="header.footer.width">
+-            <xsl:with-param name="location">footer</xsl:with-param>
+-            <xsl:with-param name="position" select="$column1"/>
+-          </xsl:call-template>
+-          <xsl:text>)</xsl:text>
+-        </xsl:attribute>
+-      </fo:table-column>
+-      <fo:table-column column-number="2">
+-        <xsl:attribute name="column-width">
+-          <xsl:text>proportional-column-width(</xsl:text>
+-          <xsl:call-template name="header.footer.width">
+-            <xsl:with-param name="location">footer</xsl:with-param>
+-            <xsl:with-param name="position" select="2"/>
+-          </xsl:call-template>
+-          <xsl:text>)</xsl:text>
+-        </xsl:attribute>
+-      </fo:table-column>
+-      <fo:table-column column-number="3">
+-        <xsl:attribute name="column-width">
+-          <xsl:text>proportional-column-width(</xsl:text>
+-          <xsl:call-template name="header.footer.width">
+-            <xsl:with-param name="location">footer</xsl:with-param>
+-            <xsl:with-param name="position" select="$column3"/>
+-          </xsl:call-template>
+-          <xsl:text>)</xsl:text>
+-        </xsl:attribute>
+-      </fo:table-column>
++      <xsl:choose>
++        <xsl:when test="$passivetex.extensions != 0">
++          <fo:table-column column-number="1">
++            <xsl:attribute name="column-width">
++              <xsl:call-template name="header.footer.width">
++                <xsl:with-param name="location">footer</xsl:with-param>
++                <xsl:with-param name="position" select="$column1"/>
++              </xsl:call-template>
++              <xsl:text>%</xsl:text>
++            </xsl:attribute>
++          </fo:table-column>
++        </xsl:when>
++        <xsl:otherwise>
++          <fo:table-column column-number="1">
++            <xsl:attribute name="column-width">
++              <xsl:text>proportional-column-width(</xsl:text>
++              <xsl:call-template name="header.footer.width">
++                <xsl:with-param name="location">footer</xsl:with-param>
++                <xsl:with-param name="position" select="$column1"/>
++              </xsl:call-template>
++              <xsl:text>)</xsl:text>
++            </xsl:attribute>
++          </fo:table-column>
++        </xsl:otherwise>
++      </xsl:choose>
++      <xsl:choose>
++        <xsl:when test="$passivetex.extensions != 0">
++          <fo:table-column column-number="2">
++            <xsl:attribute name="column-width">
++              <xsl:call-template name="header.footer.width">
++                <xsl:with-param name="location">footer</xsl:with-param>
++                <xsl:with-param name="position" select="2"/>
++              </xsl:call-template>
++              <xsl:text>%</xsl:text>
++            </xsl:attribute>
++          </fo:table-column>
++        </xsl:when>
++        <xsl:otherwise>
++          <fo:table-column column-number="2">
++            <xsl:attribute name="column-width">
++              <xsl:text>proportional-column-width(</xsl:text>
++              <xsl:call-template name="header.footer.width">
++                <xsl:with-param name="location">footer</xsl:with-param>
++                <xsl:with-param name="position" select="2"/>
++              </xsl:call-template>
++              <xsl:text>)</xsl:text>
++            </xsl:attribute>
++          </fo:table-column>
++        </xsl:otherwise>
++      </xsl:choose>
++      <xsl:choose>
++        <xsl:when test="$passivetex.extensions != 0">
++          <fo:table-column column-number="3">
++            <xsl:attribute name="column-width">
++              <xsl:call-template name="header.footer.width">
++                <xsl:with-param name="location">footer</xsl:with-param>
++                <xsl:with-param name="position" select="$column3"/>
++              </xsl:call-template>
++              <xsl:text>%</xsl:text>
++            </xsl:attribute>
++          </fo:table-column>
++        </xsl:when>
++        <xsl:otherwise>
++          <fo:table-column column-number="3">
++            <xsl:attribute name="column-width">
++              <xsl:text>proportional-column-width(</xsl:text>
++              <xsl:call-template name="header.footer.width">
++                <xsl:with-param name="location">footer</xsl:with-param>
++                <xsl:with-param name="position" select="$column3"/>
++              </xsl:call-template>
++              <xsl:text>)</xsl:text>
++            </xsl:attribute>
++          </fo:table-column>
++        </xsl:otherwise>
++      </xsl:choose>
+       <fo:table-body>
+         <fo:table-row>
index 5b0b053ab036723935575137fff76335086530e9..55da32154e7a8f836108aaf26950b4b9e9a07a78 100644 (file)
@@ -37,4 +37,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index c479619f6420557a0f8230a5086f4183023fe2f7..1ab3d5ecad216ddc7fc013eaa02eb8a972514b76 100644 (file)
@@ -31,4 +31,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 2638db4cc49c5bb0fb5f73d1a6e2b1b2e5912760..8b49f4d5711ae78de3f6a06b8f093907a07c20e3 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = dracut
 version    = 010
-release    = 3
+release    = 5
 arch       = noarch
 
 groups     = System/Boot
@@ -21,12 +21,9 @@ source_dl  =
 sources    = %{thisapp}.tar.bz2
 
 build
-       prepare_cmds
-               # Remove all man pages.
-               # XXX requires docbook
-               cd %{DIR_APP} && sed -i Makefile \
-                       -e "s/^all:.*/all: \$%{targets}/" \
-                       -e "/.*man.*/d"
+       requires
+               docbook-utils
+               docbook-xsl
        end
 
        install
@@ -56,27 +53,28 @@ packages
                        libselinux
                        lvm2
                        mdadm
+                       multipath-tools
                        sysvinit
                        udev
                        util-linux
                        which
                end
        end
-       
+
        package %{name}-network
                summary = Network support for the initramdisk.
                description
                        This package requires everything which is needed to build a generic
                        all purpose initramfs with network support with dracut.
                end
-       
+
                requires
                        bridge-utils
                        dhclient
-                       iproute
+                       iproute2
                        nfs-utils
                end
-       
+
                files
                        /usr/share/dracut/modules.d/40network
                        /usr/share/dracut/modules.d/95fcoe
@@ -87,12 +85,12 @@ packages
                        /usr/share/dracut/modules.d/95znet
                end
        end
-       
-       
+
+
        package %{name}-utils
                summary = Command line utils for dracut.
                description = %{summary}
-       
+
                files
                        /sbin/dracut-*
                        /sbin/*initrd
index 5efad8de787e41e6c1ef8f80805cef9676ad51cf..efa34909a21b3988b2c725dc85da21587babfc3e 100644 (file)
@@ -34,4 +34,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 1fce087e9feab631e7f46465b714ba645d6ea341..e55ee5d75828e75f493a09ad4063facc9d30900d 100644 (file)
@@ -31,10 +31,6 @@ build
        prepare_cmds
                mkdir -pv %{DIR_APP}/build
 
-               # Fix DT_TEXTREL in e2fsprogs libraries. --disable-shared and
-               # --with-pic are not options in E2fsprogs:
-               find lib/ -name Makefile.in -exec sed -i "s/\%{ALL_CFLAGS}/& -fPIC/" {} \;
-
                # At run time libblkid looks for the BLKID_DEBUG environment variable to
                # enable debbugging, with getenv(3). Some suid-root programs use libblkid,
                # such as mount(1). e2fsprogs includes a safe_getenv() function, which calls
@@ -42,25 +38,30 @@ build
                # variables if the user is suid or sgid. So, this command replaces getenv()
                # with safe_getenv():
                sed \
-                       -e "s/getenv(\"BLKID_DEBUG\")/safe_getenv(\"BLKID_DEBUG\")/" \
+                       -e 's/getenv("BLKID_DEBUG")/safe_getenv("BLKID_DEBUG")/' \
                        -i lib/blkid/cache.c
        end
 
+       configure_options += \
+               --with-root-prefix="" \
+               --enable-elf-shlibs \
+               --disable-libblkid \
+               --disable-fsck \
+               --disable-uuidd \
+               --disable-libuuid
+
        build
                cd build
                ../configure \
-                       --prefix=/usr \
-                       --with-root-prefix="" \
-                       --enable-elf-shlibs \
-                       --disable-libblkid \
-                       --disable-fsck \
-                       --disable-uuidd \
-                       --disable-libuuid
+                       %{configure_options}
 
                make %{PARALLELISMFLAGS}
        end
 
        test
+               # Create empty mtab file if it does not exist.
+               [ -e /etc/mtab ] || touch /etc/mtab
+
                cd build && make check
        end
 
@@ -79,8 +80,12 @@ packages
        package %{name}
                groups += Base
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 2539b25c1c0bfe17879d52cb1120e07f79fc9a50..5235920dd8f3de21737cbce4d475f037b123315c 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = ebtables
-version    = v2.0.9-2
+version    = v2.0.10-3
 release    = 1
 
 groups     = Networking/Tools
@@ -18,7 +18,7 @@ description
        layer filtering and some basic filtering on higher network layers.
 end
 
-source_dl  =
+source_dl  = http://downloads.sourceforge.net/ebtables/
 
 build
        CFLAGS += -Wall
@@ -35,8 +35,6 @@ build
 
                rm -vfr %{BUILDROOT}/etc/{init.d,sysconfig}
        end
-
-       export PKG_REQUIRES_FILTER = libebt
 end
 
 quality-agent
@@ -47,5 +45,12 @@ end
 
 packages
        package %{name}
+               filter_requires
+                       libebt
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
diff --git a/ebtables/patches/ebtables-2.0.8-cflags.patch b/ebtables/patches/ebtables-2.0.8-cflags.patch
deleted file mode 100644 (file)
index 1e34a9e..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -up ebtables-v2.0.8-1/extensions/Makefile.BAD ebtables-v2.0.8-1/extensions/Makefile
---- ebtables-v2.0.8-1/extensions/Makefile.BAD  2007-08-23 09:52:37.000000000 -0400
-+++ ebtables-v2.0.8-1/extensions/Makefile      2007-08-23 09:52:50.000000000 -0400
-@@ -11,13 +11,13 @@ EXT_LIBSI+=$(foreach T,$(EXT_FUNC), -leb
- EXT_LIBSI+=$(foreach T,$(EXT_TABLES), -lebtable_$(T))
- extensions/ebt_%.so: extensions/ebt_%.o
--      $(CC) -shared -o $@ -lc $< -nostartfiles
-+      $(CC) $(CFLAGS) -shared -o $@ -lc $< -nostartfiles
- extensions/libebt_%.so: extensions/ebt_%.so
-       mv $< $@
- extensions/ebtable_%.so: extensions/ebtable_%.o
--      $(CC) -shared -o $@ -lc $< -nostartfiles
-+      $(CC) $(CFLAGS) -shared -o $@ -lc $< -nostartfiles
- extensions/libebtable_%.so: extensions/ebtable_%.so
-       mv $< $@
diff --git a/ebtables/patches/ebtables-2.0.8-norootinst.patch b/ebtables/patches/ebtables-2.0.8-norootinst.patch
deleted file mode 100644 (file)
index d475928..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-diff -up ebtables-v2.0.8-2/Makefile.orig ebtables-v2.0.8-2/Makefile
---- ebtables-v2.0.8-2/Makefile.orig    2007-09-21 13:27:20.000000000 -0400
-+++ ebtables-v2.0.8-2/Makefile 2007-10-28 15:09:01.000000000 -0400
-@@ -154,28 +154,28 @@ tmp3:=$(shell printf $(PIPE) | sed 's/\/
- .PHONY: scripts
- scripts: ebtables-save ebtables.sysv ebtables-config
-       cat ebtables-save | sed 's/__EXEC_PATH__/$(tmp1)/g' > ebtables-save_
--      install -m 0755 -o root -g root ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save
-+      install -m 0755 ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save
-       cat ebtables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables.sysv_
--      install -m 0755 -o root -g root ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables
-+      install -m 0755 ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables
-       cat ebtables-config | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables-config_
--      install -m 0600 -o root -g root ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config
-+      install -m 0600 ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config
-       rm -f ebtables-save_ ebtables.sysv_ ebtables-config_
- $(MANDIR)/man8/ebtables.8: ebtables.8
-       mkdir -p $(DESTDIR)$(@D)
-       sed 's/$$(VERSION)/$(PROGVERSION)/' ebtables.8 | sed 's/$$(DATE)/$(PROGDATE)/' > ebtables.8_
--      install -m 0644 -o root -g root ebtables.8_ $(DESTDIR)$@
-+      install -m 0644 ebtables.8_ $(DESTDIR)$@
-       rm -f ebtables.8_
- $(ETHERTYPESFILE): ethertypes
-       mkdir -p $(DESTDIR)$(@D)
--      install -m 0644 -o root -g root $< $(DESTDIR)$@
-+      install -m 0644 $< $(DESTDIR)$@
- .PHONY: exec
- exec: ebtables ebtables-restore
-       mkdir -p $(DESTDIR)$(BINDIR)
--      install -m 0755 -o root -g root $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME)
--      install -m 0755 -o root -g root ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore
-+      install -m 0755 $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME)
-+      install -m 0755 ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore
- .PHONY: install
- install: $(MANDIR)/man8/ebtables.8 $(ETHERTYPESFILE) exec scripts
-@@ -199,18 +199,18 @@ release:
-       rm -f extensions/ebt_inat.c
-       rm -rf $(CVSDIRS)
-       mkdir -p include/linux/netfilter_bridge
--      install -m 0644 -o root -g root \
-+      install -m 0644 \
-               $(KERNEL_INCLUDES)/linux/netfilter_bridge.h include/linux/
- # To keep possible compile error complaints about undefined ETH_P_8021Q
- # off my back
--      install -m 0644 -o root -g root \
-+      install -m 0644 \
-               $(KERNEL_INCLUDES)/linux/if_ether.h include/linux/
--      install -m 0644 -o root -g root \
-+      install -m 0644 \
-               $(KERNEL_INCLUDES)/linux/types.h include/linux/
--      install -m 0644 -o root -g root \
-+      install -m 0644 \
-               $(KERNEL_INCLUDES)/linux/netfilter_bridge/*.h \
-               include/linux/netfilter_bridge/
--      install -m 0644 -o root -g root \
-+      install -m 0644 \
-               include/ebtables.h include/linux/netfilter_bridge/
-       make clean
-       touch *
diff --git a/ebtables/patches/ebtables-2.0.9-lsb.patch b/ebtables/patches/ebtables-2.0.9-lsb.patch
deleted file mode 100644 (file)
index 721deea..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-diff -up ebtables-v2.0.9-1/ebtables.sysv.lsb ebtables-v2.0.9-1/ebtables.sysv
---- ebtables-v2.0.9-1/ebtables.sysv.lsb        2010-01-15 11:39:31.000000000 +0100
-+++ ebtables-v2.0.9-1/ebtables.sysv    2010-01-15 12:52:24.000000000 +0100
-@@ -18,9 +18,9 @@ source /etc/sysconfig/network
- # Check that networking is up.
- [ ${NETWORKING} = "no" ] && exit 0
--[ -x __EXEC_PATH__/ebtables ] || exit 1
--[ -x __EXEC_PATH__/ebtables-save ] || exit 1
--[ -x __EXEC_PATH__/ebtables-restore ] || exit 1
-+[ -x __EXEC_PATH__/ebtables ] || exit 5
-+[ -x __EXEC_PATH__/ebtables-save ] || exit 5
-+[ -x __EXEC_PATH__/ebtables-restore ] || exit 5
- RETVAL=0
- prog="ebtables"
-@@ -39,6 +39,7 @@ config=__SYSCONFIG__/$prog-config
- [ -f "$config" ] && . "$config"
- start() {
-+      [ "$EUID" != "0" ] && exit 4
-       echo -n $"Starting $desc ($prog): "
-       if [ "$EBTABLES_BINARY_FORMAT" = "yes" ]; then
-               for table in $(ls __SYSCONFIG__/ebtables.* 2>/dev/null | sed -e 's/.*ebtables\.//' -e '/save/d' ); do
-@@ -50,7 +51,7 @@ start() {
-       if [ $RETVAL -eq 0 ]; then
-               success "$prog startup"
--              rm -f /var/lock/subsys/$prog
-+              touch "/var/lock/subsys/$prog"
-       else
-               failure "$prog startup"
-       fi
-@@ -58,6 +59,7 @@ start() {
- }
- stop() {
-+      [ "$EUID" != "0" ] && exit 4
-       echo -n $"Stopping $desc ($prog): "
-       for table in $(grep '^ebtable_' /proc/modules | sed -e 's/ebtable_\([^ ]*\).*/\1/'); do
-               __EXEC_PATH__/ebtables -t $table --init-table || RETVAL=1
-@@ -71,7 +73,7 @@ stop() {
-       if [ $RETVAL -eq 0 ]; then
-               success "$prog shutdown"
--              rm -f /var/lock/subsys/$prog
-+              rm -f "/var/lock/subsys/$prog"
-       else
-               failure "$prog shutdown"
-       fi
-@@ -79,11 +81,13 @@ stop() {
- }
- restart() {
-+      [ "$EBTABLES_SAVE_ON_RESTART" = "yes" ] && save
-       stop
-       start
- }
- save() {
-+      [ "$EUID" != "0" ] && exit 4
-       echo -n $"Saving $desc ($prog): "
-       if [ "$EBTABLES_TEXT_FORMAT" = "yes" ]; then
-               if [ -e __SYSCONFIG__/ebtables ]; then
-@@ -116,30 +120,34 @@ save() {
- case "$1" in
-   start)
-+      [ -f "/var/lock/subsys/$prog" ] && exit 0
-       start
-       ;;
-   stop)
-       [ "$EBTABLES_SAVE_ON_STOP" = "yes" ] && save
-       stop
-       ;;
--  restart|reload)
--      [ "$EBTABLES_SAVE_ON_RESTART" = "yes" ] && save
-+  restart|force-reload)
-       restart
-       ;;
--  condrestart)
--      [ -e /var/lock/subsys/$prog ] && restart
--      RETVAL=$?
-+  reload)
-+      [ ! -f "/var/lock/subsys/$prog" ] && exit 7
-+      restart
-+      ;;
-+  condrestart|try-restart)
-+      [ ! -e "/var/lock/subsys/$prog" ] && exit 0
-+      restart
-       ;;
-   save)
-       save
-       ;;
-   status)
-+      [ -f "/var/lock/subsys/$prog" ] && RETVAL=0 || RETVAL=3
-       __EXEC_PATH__/ebtables-save
--      RETVAL=$?
-       ;;
-   *)
-       echo $"Usage $0 {start|stop|restart|condrestart|save|status}"
--      RETVAL=1
-+      RETVAL=2
- esac
- exit $RETVAL
index f2ddbc78f608306039651f4f9d1c1fe3a53f70be..fe1f1158304097b8b06178b7bc187f61eb788ab2 100644 (file)
--- a/ed/ed.nm
+++ b/ed/ed.nm
@@ -39,4 +39,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 502736d81db4518bca600e9b75e4ac507976b28a..fe158655beb910d6fab7d538994bffab6b0dca78 100644 (file)
@@ -34,8 +34,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index e2a74888bc2325f80d827d37df6bdb3cff8e86a7..7f1e448bf879e9acb56d7bed73fd01bee64cbe68 100644 (file)
@@ -36,4 +36,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index a82a69b4917f50ec6e1488aa0985c87e17591f43..a56e6bc00dd54926b98e3678e5bedb267d086174 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = elfutils
 version    = 0.152
-release    = 2
+release    = 3
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
 groups     = Development/Libraries
@@ -32,6 +32,8 @@ build
                zlib-devel
        end
 
+       CFLAGS += -Wno-error
+
        configure_options += \
                --program-prefix=eu-
 
@@ -58,7 +60,7 @@ packages
 
        package %{name}-devel
                template DEVEL
-       
+
                requires = %{name}=%{thisver} %{name}-libs=%{thisver}
        end
 
@@ -68,4 +70,8 @@ packages
                files += /usr/lib*/lib*%{version}.so
                files += /usr/lib/elfutils
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index b17764b77083d0104b43de9b26130030f4d00fec..1e7bc512001e7224cedda9cbdc9ffa586b435c41 100644 (file)
@@ -44,4 +44,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 5ceab2aa9c7a9d3cc8cc806966d89acbe908158f..57728b7c2f5354282a4beac2478fff3a6c5c1d82 100644 (file)
@@ -34,4 +34,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index dfbca0e6189f30717cadb4d2666beb56c16e9d89..1f7d906269448458036baa4405cb3cb79eaa8e1b 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = ethtool
 version    = 2.6.34
-release    = 1
+release    = 2
 
-groups     = Base Applications/System
+groups     = Applications/System
 url        = http://sourceforge.net/projects/gkernel/
 license    = GPLv2
 summary    = Ethernet settings tool for PCI ethernet cards.
@@ -27,5 +27,10 @@ end
 
 packages
        package %{name}
+               groups += Base
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index dc13fc7370a81caf941d66e3d8c22dd166cf79eb..d03a8bcf1cf9c788d178a4f9324f865bf754055e 100644 (file)
@@ -38,8 +38,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index eea26324ae8d3e3c1558bbfca8d646435f99e8ad..0648f33ac97543f36fc366b6b5b4ffb43f3227fa 100644 (file)
@@ -53,4 +53,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index a91cdc4b44bf5673ac0b86a082f74c9de4f49b81..4d92b792a352546b5d9d588bd182e7b2885581db 100644 (file)
@@ -28,4 +28,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 0d204e028619c028a4b457b26226cab2b9800cda..38ad03b6791d573bcf344f53ac0aaee83b8680b0 100644 (file)
@@ -40,4 +40,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index c193681d6546c8f5d3c4d5275b874119e0772a7f..fc45b81ae7ec70d60a97a5707255e5d6a7697e56 100644 (file)
@@ -4,10 +4,10 @@
 ###############################################################################
 
 name       = file
-version    = 5.07
-release    = 1
+version    = 5.09
+release    = 2
 
-groups     = Base Build System/Tools
+groups     = System/Tools
 url        = http://www.darwinsys.com/file/
 license    = BSD
 summary    = A utility for determining file types.
@@ -19,7 +19,7 @@ description
        different graphics formats.
 end
 
-source_dl  =
+source_dl  = ftp://ftp.astron.com/pub/file/
 
 build
        requires
@@ -36,8 +36,14 @@ end
 
 packages
        package %{name}
+               groups += Base Build
+       end
 
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index f5668ef54cf3563b2f138951dfaebeedd8f0d3b7..cb010b469ffb7f9b848ec8d172c4c1c31958000b 100644 (file)
@@ -88,8 +88,8 @@ build
                chown root:mail %{BUILDROOT}/var/spool/mail
                chmod 775 %{BUILDROOT}/var/spool/mail
        end
-       
-       # XXX not implemented at the moment     
+
+       # XXX not implemented at the moment
        export QUALITY_AGENT_NO_DIRECTORY_CHECK = yes
        export QUALITY_AGENT_NO_DIRECTORY_PRUNE = yes
 end
@@ -98,4 +98,7 @@ packages
        package %{name}
                prerequires = setup
        end
+
+       # Although this package is not noarch, it does not
+       # contain any binary data and thus has no debuginfo package.
 end
index 335aa68c990877301ccdeb37d33822687cf141c5..652d138eec324fd6187d341205b30c81bfac739f 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = findutils
 version    = 4.5.10
-release    = 1
+release    = 2
 
-groups     = Base Build System/Tools
+groups     = System/Tools
 url        = http://www.gnu.org/software/findutils/
 license    = GPLv3+
 summary    = The GNU versions of find utilities (find and xargs).
@@ -46,5 +46,10 @@ end
 
 packages
        package %{name}
+               groups += Base Build
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 6e3cd35ea6ec440b6f050ceccddcc6d65e9af236..53b3c8fc29325a0c265b46d3371a7ec8f02527c8 100644 (file)
@@ -41,4 +41,8 @@ packages
        package %{name}
                requires = iproute2 iptables
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 8f31c1760cc2a581b42db57fac0ebc6ca7e00643..2993e4fbcc645b58556343e49b5a4f3dd05f1c6b 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = flex
 version    = 2.5.35
-release    = 2
+release    = 3
 
 groups     = Development/Tools
 url        = http://flex.sourceforge.net/
@@ -34,6 +34,8 @@ build
                m4
        end
 
+       keep_libraries = /usr/lib/libfl_pic.a
+
        configure_options += \
                --mandir=/usr/share/man
 
@@ -52,8 +54,12 @@ packages
        package %{name}
                requires = m4
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 666165c436bd975ca2eaf8d9a85561fe29f40f16..5520cbb3ee4f88f6a69e2bdb376de0e3bf7d5f8e 100644 (file)
@@ -37,8 +37,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index e780786ff24789523883ed52f6c42b8e64df7afb..a9ea8befff9dd2dd77feadc5002a80ebeef7fcf9 100644 (file)
@@ -4,8 +4,8 @@
 ###############################################################################
 
 name       = freeradius-server
-version    = 2.1.9
-release    = 2
+version    = 2.1.12
+release    = 3
 
 groups     = System/Daemons
 url        = http://www.freeradius.org
@@ -13,14 +13,14 @@ license    = GPLv2+ and LGPLv2+
 summary    = High-performance and highly configurable free RADIUS server.
 
 description
-       The FreeRADIUS Server Project is a high performance and highly \
-       configurable GPL'd free RADIUS server. \
-       FreeRADIUS is an Internet authentication daemon, which implements \
-       the RADIUS protocol, as defined in RFC 2865. It allows \
+       The FreeRADIUS Server Project is a high performance and highly
+       configurable GPL'd free RADIUS server.
+       FreeRADIUS is an Internet authentication daemon, which implements
+       the RADIUS protocol, as defined in RFC 2865. It allows
        Network Access Servers to perform authentication for dial-up users.
 end
 
-source_dl  =
+source_dl  = ftp://ftp.freeradius.org/pub/freeradius/
 
 build
        requires
@@ -30,50 +30,130 @@ build
                libtool-devel
                openssl-devel
                perl
+               shadow-utils
        end
 
-       build
-               ./configure \
-                       %{CONFIGURE_ARCH} \
-                       --prefix=/usr \
-                       --sysconfdir=/etc \
-                       --libdir=/usr/lib/freeradius \
-                       --localstatedir=/var \
-                       --with-system-libtool \
-                       --with-threads \
-                       --with-thread-pool \
-                       --disable-ltdl-install \
-                       --with-gnu-ld \
-                       --without-rlm_eap_ikev2 \
-                       --without-rlm_sql_iodbc \
-                       --without-rlm_sql_firebird \
-                       --without-rlm_sql_db2 \
-                       --without-rlm_sql_oracle
-
-               make LIBTOOL="libtool --tag=CC" #%{PARALLELISMFLAGS}
+       PARALLELISMFLAGS = # Disabled
+
+       configure_options +=\
+               %{CONFIGURE_ARCH} \
+               --sysconfdir=/etc \
+               --libdir=/usr/lib/freeradius \
+               --localstatedir=/var \
+               --with-system-libtool \
+               --with-threads \
+               --with-thread-pool \
+               --disable-ltdl-install \
+               --with-gnu-ld \
+               --without-rlm_eap_ikev2 \
+               --without-rlm_sql_iodbc \
+               --without-rlm_sql_firebird \
+               --without-rlm_sql_db2 \
+               --without-rlm_sql_oracle
+
+       prepare_cmds
+               %{create_user}
        end
 
+       make_build_targets = LINK_MODE=-pie
+
        install
-               R=%{BUILDROOT} make install
-       end
+               make install R=%{BUILDROOT}
+
+               # Change freeradius user and group.
+               perl -i -pe 's/^#user =.*$/user = radiusd/' %{BUILDROOT}/etc/raddb/radiusd.conf
+               perl -i -pe 's/^#group =.*$/group = radiusd/' %{BUILDROOT}/etc/raddb/radiusd.conf
+
+               # Create emty logfiles.
+               mkdir -pv %{BUILDROOT}/var/log/radius/radacct
+               touch %{BUILDROOT}/var/log/radius/{radutmp,radius.log}
+               chown -Rv radiusd.radiusd %{BUILDROOT}/var/log/radius/
 
-       install_cmds
-               mkdir -pv %{BUILDROOT}/etc/logrotate.d/
-               cp -vf %{DIR_SOURCE}/logrotate/freeradius %{BUILDROOT}/etc/logrotate.d/
+               # Create tmpfiles folder.
+               mkdir -pv %{BUILDROOT}/run/radiusd
+               chown -Rv radiusd.radiusd %{BUILDROOT}/run/radiusd/
+
+               # Remove unneeded stuff.
+               rm -vf %{BUILDROOT}/usr/sbin/rc.radiusd
+               rm -rvf %{BUILDROOT}/etc/raddb/sql/
+               rm -rvf %{BUILDROOT}/var/run/
+
+               # Remove header files, we don't ship a devel package.
+               rm -rvf %{BUILDROOT}/usr/include/
+
+               # remove unsupported config file.
+               rm -vf %{BUILDROOT}/etc/raddb/experimental.conf
+
+               # Fix permissions.
+               chown -Rv root.radiusd %{BUILDROOT}/etc/raddb
        end
 end
 
+create_user
+       getent group radiusd >/dev/null || /usr/sbin/groupadd -r radiusd
+       getent passwd radiusd >/dev/null || /usr/sbin/useradd -r -g radiusd \
+               -d /var/lib/radiusd -s /sbin/nologin radiusd
+end
+
 quality-agent
        whitelist_rpath
                /usr/lib/freeradius
        end
 end
 
-# Generate certificates after installation
-# Command: cd /etc/raddb/certs/ && make Makefile
-
 packages
        package %{name}
-               requires = make
+               configfiles
+                       /etc/raddb/radiusd.conf
+               end
+
+               prerequires = shadow-utils systemd-units
+
+               script prein
+                       %{create_user}
+               end
+
+               script postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       /bin/systemctl --no-reload disable freeradius.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop freeradius.service >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl try-restart freeradius.service >/dev/null 2>&1 || :
+               end
+       end
+
+       package freeradius-utils
+               summary = FreeRADIUS utilities.
+               description
+                       Additional utilities to configure and manage FreeRADUIS
+                       Servers.
+               end
+
+               files
+                       /usr/bin/*
+                       /usr/share/man/man1/radclient.1
+                       /usr/share/man/man1/radeapclient.1
+                       /usr/share/man/man1/radlast.1
+                       /usr/share/man/man1/radtest.1
+                       /usr/share/man/man1/radwho.1
+                       /usr/share/man/man1/radzap.1
+                       /usr/share/man/man1/smbencrypt.1
+                       /usr/share/man/man5/checkrad.5
+                       /usr/share/man/man8/radconf2xml.8
+                       /usr/share/man/man8/radcrypt.8
+                       /usr/share/man/man8/radsniff.8
+                       /usr/share/man/man8/radsqlrelay.8
+                       /usr/share/man/man8/rlm_ippool_tool.8
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index f06f7f3d3dea1cf145782ecdad30a922cc46b90f..613d0089215b6085574db5fefd02c11564e79676 100644 (file)
@@ -1,2 +1,2 @@
-d /var/run/radiusd 0750 root root -
+d /run/radiusd 0750 radiusd radiusd
 
diff --git a/freeradius/patches/freeradius-2.1.6-cert-config.patch b/freeradius/patches/freeradius-2.1.6-cert-config.patch
deleted file mode 100644 (file)
index 8390beb..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-diff -r -u freeradius-server-2.1.8.orig/raddb/certs/ca.cnf freeradius-server-2.1.8/raddb/certs/ca.cnf
---- freeradius-server-2.1.8.orig/raddb/certs/ca.cnf    2009-12-30 10:44:35.000000000 -0500
-+++ freeradius-server-2.1.8/raddb/certs/ca.cnf 2010-01-08 12:35:23.000000000 -0500
-@@ -14,9 +14,9 @@
- RANDFILE              = $dir/.rand
- name_opt              = ca_default
- cert_opt              = ca_default
--default_days          = 365
-+default_days          = 60
- default_crl_days      = 30
--default_md            = md5
-+default_md            = sha1
- preserve              = no
- policy                        = policy_match
-Only in freeradius-server-2.1.8/raddb/certs: ca.cnf~
-diff -r -u freeradius-server-2.1.8.orig/raddb/certs/client.cnf freeradius-server-2.1.8/raddb/certs/client.cnf
---- freeradius-server-2.1.8.orig/raddb/certs/client.cnf        2009-12-30 10:44:35.000000000 -0500
-+++ freeradius-server-2.1.8/raddb/certs/client.cnf     2010-01-08 12:35:37.000000000 -0500
-@@ -14,9 +14,9 @@
- RANDFILE              = $dir/.rand
- name_opt              = ca_default
- cert_opt              = ca_default
--default_days          = 365
-+default_days          = 60
- default_crl_days      = 30
--default_md            = md5
-+default_md            = sha1
- preserve              = no
- policy                        = policy_match
-Only in freeradius-server-2.1.8/raddb/certs: client.cnf~
-diff -r -u freeradius-server-2.1.8.orig/raddb/certs/server.cnf freeradius-server-2.1.8/raddb/certs/server.cnf
---- freeradius-server-2.1.8.orig/raddb/certs/server.cnf        2009-12-30 10:44:35.000000000 -0500
-+++ freeradius-server-2.1.8/raddb/certs/server.cnf     2010-01-08 12:35:05.000000000 -0500
-@@ -14,9 +14,9 @@
- RANDFILE              = $dir/.rand
- name_opt              = ca_default
- cert_opt              = ca_default
--default_days          = 365
-+default_days          = 60
- default_crl_days      = 30
--default_md            = md5
-+default_md            = sha1
- preserve              = no
- policy                        = policy_match
-Only in freeradius-server-2.1.8/raddb/certs: server.cnf~
-diff -r -u freeradius-server-2.1.8.orig/raddb/eap.conf freeradius-server-2.1.8/raddb/eap.conf
---- freeradius-server-2.1.8.orig/raddb/eap.conf        2009-12-30 10:44:35.000000000 -0500
-+++ freeradius-server-2.1.8/raddb/eap.conf     2010-01-08 12:36:04.000000000 -0500
-@@ -251,15 +251,6 @@
-                       cipher_list = "DEFAULT"
-                       #
--
--                      #  This configuration entry should be deleted
--                      #  once the server is running in a normal
--                      #  configuration.  It is here ONLY to make
--                      #  initial deployments easier.
--                      #
--                      make_cert_command = "${certdir}/bootstrap"
--
--                      #
-                       #  Session resumption / fast reauthentication
-                       #  cache.
-                       #
-Only in freeradius-server-2.1.8/raddb: eap.conf~
diff --git a/freeradius/patches/freeradius-cert-config.patch b/freeradius/patches/freeradius-cert-config.patch
new file mode 100644 (file)
index 0000000..9967a15
--- /dev/null
@@ -0,0 +1,62 @@
+diff -r -u freeradius-server-2.1.12.orig/raddb/certs/ca.cnf freeradius-server-2.1.12/raddb/certs/ca.cnf
+--- freeradius-server-2.1.12.orig/raddb/certs/ca.cnf   2011-09-07 06:59:21.000000000 -0400
++++ freeradius-server-2.1.12/raddb/certs/ca.cnf        2011-09-07 10:28:28.000000000 -0400
+@@ -14,9 +14,9 @@
+ RANDFILE              = $dir/.rand
+ name_opt              = ca_default
+ cert_opt              = ca_default
+-default_days          = 365
++default_days          = 60
+ default_crl_days      = 30
+-default_md            = md5
++default_md            = sha1
+ preserve              = no
+ policy                        = policy_match
+diff -r -u freeradius-server-2.1.12.orig/raddb/certs/client.cnf freeradius-server-2.1.12/raddb/certs/client.cnf
+--- freeradius-server-2.1.12.orig/raddb/certs/client.cnf       2011-09-07 06:59:21.000000000 -0400
++++ freeradius-server-2.1.12/raddb/certs/client.cnf    2011-09-07 10:28:28.000000000 -0400
+@@ -14,9 +14,9 @@
+ RANDFILE              = $dir/.rand
+ name_opt              = ca_default
+ cert_opt              = ca_default
+-default_days          = 365
++default_days          = 60
+ default_crl_days      = 30
+-default_md            = md5
++default_md            = sha1
+ preserve              = no
+ policy                        = policy_match
+diff -r -u freeradius-server-2.1.12.orig/raddb/certs/server.cnf freeradius-server-2.1.12/raddb/certs/server.cnf
+--- freeradius-server-2.1.12.orig/raddb/certs/server.cnf       2011-09-07 06:59:21.000000000 -0400
++++ freeradius-server-2.1.12/raddb/certs/server.cnf    2011-09-07 10:28:28.000000000 -0400
+@@ -14,9 +14,9 @@
+ RANDFILE              = $dir/.rand
+ name_opt              = ca_default
+ cert_opt              = ca_default
+-default_days          = 365
++default_days          = 60
+ default_crl_days      = 30
+-default_md            = md5
++default_md            = sha1
+ preserve              = no
+ policy                        = policy_match
+diff -r -u freeradius-server-2.1.12.orig/raddb/eap.conf freeradius-server-2.1.12/raddb/eap.conf
+--- freeradius-server-2.1.12.orig/raddb/eap.conf       2011-09-07 06:59:21.000000000 -0400
++++ freeradius-server-2.1.12/raddb/eap.conf    2011-09-07 10:28:28.000000000 -0400
+@@ -281,7 +281,11 @@
+                       # for the server to print out an error message,
+                       # and refuse to start.
+                       #
+-                      make_cert_command = "${certdir}/bootstrap"
++                      # Redhat RPM's run the bootstrap certificate creation
++                      # as part of the RPM install (not upgrade), therefore
++                      # the make_cert_command is commented out.
++                      #
++                      #make_cert_command = "${certdir}/bootstrap"
+                       #
+                       #  Elliptical cryptography configuration
+Only in freeradius-server-2.1.12/raddb: eap.conf.orig
index 0bdae0dc8cbca389b00ce44cb8673143f135234f..4f86f2140e473632857f906e7070bd123c173b8b 100644 (file)
@@ -1,11 +1,13 @@
 [Unit]
-Description=Freeradius Server
+Description=FreeRADIUS Server
 After=network.target
 
 [Service]
-ExecStart=/usr/sbin/radiusd -f -d /etc/radvd/freeradius.conf
+ExecStartPre=/etc/raddb/certs/bootstrap
+ExecStartPre=/usr/sbin/radiusd -C
+ExecStart=/usr/sbin/radiusd -f -d /etc/raddb
+ExecReload=/usr/sbin/radiusd -C
 ExecReload=/bin/kill -HUP $MAINPID
-ExecPostStop=/bin/rm -vf /var/run/radiusd/radiusd.sock
 
 [Install]
 WantedBy=multi-user.target
index 75ae2823e5838cfc8dd60a68c7fa476cec62ff8c..c0a2c2c0de9c32492ce20b5bc9f083919fba5b9b 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = freetype
-version    = 2.3.9
+version    = 2.4.7
 release    = 1
 
 groups     = System/Graphics
@@ -13,34 +13,32 @@ license    = FTL GPLv2+
 summary    = A free and portable font rendering engine.
 
 description
-       The FreeType engine is a free and portable font rendering \
-       engine, developed to provide advanced font support for a variety of \
-       platforms and environments. FreeType is a library which can open and \
-       manages font files as well as efficiently load, hint and render \
-       individual glyphs. FreeType is not a font server or a complete \
+       The FreeType engine is a free and portable font rendering
+       engine, developed to provide advanced font support for a variety of
+       platforms and environments. FreeType is a library which can open and
+       manages font files as well as efficiently load, hint and render
+       individual glyphs. FreeType is not a font server or a complete
        text-rendering library.
 end
 
-source_dl  =
-sources    = %{thisapp}.tar.bz2
+source_dl  = http://download.savannah.gnu.org/releases/freetype/
 
 build
        requires
+               pkg-config
                zlib-devel
        end
-
-       prepare_cmds
-               sed -i -r -e 's:.*(#.*BYTE.*) .*:\1:' \
-                       -e 's:.*(#.*SUBPIX.*) .*:\1:' \
-                       include/freetype/config/ftoption.h
-       end
 end
 
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index ac137808ea9f60dea438130743203def3958836d..fab5b72ad513c5619b4f87a99e02e4083d74c879 100644 (file)
@@ -37,4 +37,8 @@ packages
                provides = sshfs=%{thisver}
                requires = openssh-clients
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index e8fe47d00c54fa8be6f9a90d34c349f2fc0dc3f7..4974a398c8f22fb7b3bbc1c9f75512e3e8c5b969 100644 (file)
@@ -43,8 +43,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 835aef21d391b1d8b350b5c46218d3108f482121..30bffddcda0973ed9a1465eaf01ff2ade3c6d973 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = gawk
 version    = 4.0.0
-release    = 1
+release    = 2
 
-groups     = Base Build System/Tools
+groups     = System/Tools
 url        = http://www.gnu.org/software/gawk/gawk.html
 license    = GPLv3+
 summary    = The GNU version of the awk text processing utility.
@@ -50,5 +50,10 @@ end
 
 packages
        package %{name}
+               groups += Base Build
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 0be4fc485e1a01a56cfafde549b6a220891a6632..8fd265ac806760e76a123c8d85a68dfe65e431f9 100644 (file)
@@ -4,13 +4,11 @@
 ###############################################################################
 
 # Configure build to compile with cloog and ppl.
-# XXX THIS PACKAGE DOES CURRENTLY NOT BUILD WITH CLOOG AND PPL WHICH
-# NEEDS TO BE FIXED SOON.
-build_cloog_ppl = 0
+build_cloog_ppl = 1
 
 name       = gcc
-version    = 4.6.1
-release    = 4
+version    = 4.6.2
+release    = 3
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
 groups     = Development/Compilers
@@ -26,7 +24,7 @@ end
 # This is the at least required version of binutils.
 required_binutils_version = 2.21.51.0.8-1
 
-source_dl  = http://ftp.gnu.org/gnu/gcc/
+source_dl  = http://ftp.gnu.org/gnu/gcc/%{thisapp}/
 sources    = %{thisapp}.tar.gz
 
 patches
@@ -79,6 +77,10 @@ build
                configure_options = --with-arch=%{DISTRO_ARCH} --with-tune=generic
        end
 
+       if "%{DISTRO_ARCH}" == "armv5tel"
+               configure_options += --with-float=soft
+       end
+
        if "%{build_cloog_ppl}" == "1"
                configure_options += --with-cloog --with-ppl
        end
@@ -194,6 +196,11 @@ build
                # Remove some GNU debugger stuff.
                rm -vf %{BUILDROOT}/usr/lib/lib*.py
        end
+
+       keep_libraries
+               /usr/lib/gcc/%{DISTRO_BUILDTARGET}/%{version}/libgcc.a
+               /usr/lib/gcc/%{DISTRO_BUILDTARGET}/%{version}/libgcc_eh.a
+       end
 end
 
 packages
@@ -287,4 +294,8 @@ packages
                        /usr/lib/libquadmath*.so
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index dd9a5b9859686f2faf1bbf436e6aa9f1b059a0ed..11ce82b98422b455299ae0260ab7d3611964f266 100644 (file)
        $(LINKER) $(LINKERFLAGS) $(LDFLAGS) -o $@ \
 --- gcc/graphite-cloog-compat.h.jj     2011-01-03 12:53:05.000000000 +0100
 +++ gcc/graphite-cloog-compat.h        2011-01-04 17:34:09.857757544 +0100
-@@ -272,4 +272,263 @@ static inline int cloog_matrix_nrows (Cl
+@@ -272,4 +272,277 @@ static inline int cloog_matrix_nrows (Cl
     return m->NbRows;
  }
  #endif /* CLOOG_ORG  */
 +
 +#include <dlfcn.h>
++#if PPL_VERSION_MAJOR == 0 && PPL_VERSION_MINOR < 11
++#define DYNSYMS_PPL11
++#else
++#define DYNSYMS_PPL11 \
++  DYNSYM (ppl_new_PIP_Problem_from_constraints); \
++  DYNSYM (ppl_PIP_Problem_is_satisfiable); \
++  DYNSYM (ppl_delete_PIP_Problem);
++#endif
 +#define DYNSYMS \
 +  DYNSYM (cloog_block_alloc); \
 +  DYNSYM (cloog_block_list_free); \
 +  DYNSYM (ppl_new_Constraint_System_from_Constraint); \
 +  DYNSYM (ppl_new_C_Polyhedron_from_Constraint_System); \
 +  DYNSYM (ppl_Polyhedron_affine_image); \
-+  DYNSYM (ppl_io_fprint_Pointset_Powerset_C_Polyhedron);
++  DYNSYM (ppl_io_fprint_Pointset_Powerset_C_Polyhedron); \
++  DYNSYMS_PPL11
 +extern struct
 +{
 +  bool inited;
 +#define ppl_new_Constraint_System_from_Constraint (*cloog_pointers__.p_ppl_new_Constraint_System_from_Constraint)
 +#define ppl_new_C_Polyhedron_from_Constraint_System (*cloog_pointers__.p_ppl_new_C_Polyhedron_from_Constraint_System)
 +#define ppl_Polyhedron_affine_image (*cloog_pointers__.p_ppl_Polyhedron_affine_image)
-+#define ppl_io_fprint_Pointset_Powerset_C_Polyhedron (cloog_pointers__.p_ppl_io_fprint_Pointset_Powerset_C_Polyhedron)
++#define ppl_io_fprint_Pointset_Powerset_C_Polyhedron (*cloog_pointers__.p_ppl_io_fprint_Pointset_Powerset_C_Polyhedron)
++#if !(PPL_VERSION_MAJOR == 0 && PPL_VERSION_MINOR < 11)
++#define ppl_new_PIP_Problem_from_constraints (*cloog_pointers__.p_ppl_new_PIP_Problem_from_constraints)
++#define ppl_PIP_Problem_is_satisfiable (*cloog_pointers__.p_ppl_PIP_Problem_is_satisfiable)
++#define ppl_delete_PIP_Problem (*cloog_pointers__.p_ppl_delete_PIP_Problem)
++#endif
 +
 +#define cloog_finalize (*cloog_pointers__.p_ppl_finalize)
 +
  #endif /* GRAPHITE_CLOOG_COMPAT_H  */
 --- gcc/graphite.c.jj  2011-01-03 12:53:05.194056513 +0100
 +++ gcc/graphite.c     2011-01-04 16:18:32.385007767 +0100
-@@ -54,6 +54,35 @@ along with GCC; see the file COPYING3.  
- #include "graphite-clast-to-gimple.h"
- #include "graphite-sese-to-poly.h"
+@@ -56,6 +56,35 @@ along with GCC; see the file COPYING3.  
+ CloogState *cloog_state;
  
 +__typeof (cloog_pointers__) cloog_pointers__;
 +
  /* Print global statistics to FILE.  */
  
  static void
-@@ -199,6 +228,12 @@ graphite_initialize (void)
+@@ -201,6 +230,12 @@ graphite_initialize (void)
        return false;
      }
  
index 7c377584ce9fb6b7e221c75a10d4ec44880864f1..8ad9a5a3603387a8381522e3312fd7e6289266e8 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = gdb
-version    = 7.3.1
+version    = 7.3.50.20110722
 release    = 1
 
 groups     = Development/Debuggers
@@ -18,27 +18,68 @@ description
        and printing their data.
 end
 
-source_dl  = ftp://ftp.gnu.org/gnu/gdb/
-sources    = %{thisapp}.tar.gz
+#source_dl  = ftp://ftp.gnu.org/gnu/gdb/
+source_dl  = ftp://sourceware.org/pub/gdb/snapshots/current/
+sources    = %{thisapp}.tar.bz2
 
 build
        requires
+               bison
+               expat-devel
                ncurses-devel
-               readline-devel
+               texinfo
                zlib-devel
        end
 
        configure_options += \
+               --with-system-gdbinit=/etc/gdbinit \
                --mandir=/usr/share/man \
-               --disable-werror
+               --enable-gdb-build-warnings=,-Wno-unused \
+               --with-separate-debug-dir=/usr/lib/debug \
+               --disable-sim \
+               --disable-rpath \
+               --without-system-readline \
+               --disable-werror \
+               --with-expat \
+               --without-libexpat-prefix \
+               --enable-tui \
+               --with-python \
+               --without-rpm \
+               --without-libunwind \
+               --enable-64-bit-bfd \
+               %{DISTRO_MACHINE}
+
+       prepare_cmds
+               echo "%{DISTRO_NAME} (%{thisver})" > gdb/version.in
+       end
+
+       # Testsuite does not succeed. Needs to be fixed eventually.
+       #test
+       #       make check
+       #end
+
+       install_cmds
+               # Install gcore script.
+               cp -v gdb/gdb_gcore.sh %{BUILDROOT}/usr/bin/gcore
+               chmod -v 755 %{BUILDROOT}/usr/bin/gcore
+
+               # Remove gdb/gdbtui binaries duplicity.
+               ln -svf gdb %{BUILDROOT}/usr/bin/gdbtui
+               ln -svf gdb.1 %{BUILDROOT}/usr/share/man/man1/gdbtui.1
+
+               mkdir -pv %{BUILDROOT}/etc/gdbinit.d
+               cp -vf %{DIR_SOURCE}/gdbinit %{BUILDROOT}/etc/gdbinit
+       end
 end
 
 packages
        package %{name}
-               requires = python
-       end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/gdb/gdbinit b/gdb/gdbinit
new file mode 100644 (file)
index 0000000..f1f45b0
--- /dev/null
@@ -0,0 +1,4 @@
+# System-wide GDB initialization file.
+
+# FIXME: provide a wildcard.
+source /etc/gdbinit.d/gdb-heap.py
diff --git a/gdb/patches/gdb-6.3-attach-see-vdso-test.patch b/gdb/patches/gdb-6.3-attach-see-vdso-test.patch
new file mode 100644 (file)
index 0000000..a0923f8
--- /dev/null
@@ -0,0 +1,103 @@
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.base/attach-see-vdso.c 6 Jul 2007 14:14:44 -0000
+@@ -0,0 +1,25 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2007 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
++
++#include <unistd.h>
++
++int main ()
++{
++  pause ();
++  return 1;
++}
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.base/attach-see-vdso.exp       6 Jul 2007 14:14:44 -0000
+@@ -0,0 +1,72 @@
++# Copyright 2007
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++# This file was created by Jan Kratochvil <jan.kratochvil@redhat.com>.
++
++# This test only works on Linux
++if { ![istarget "*-*-linux-gnu*"] } {
++    return 0
++}
++
++set testfile "attach-see-vdso"
++set srcfile  ${testfile}.c
++set binfile  ${objdir}/${subdir}/${testfile}
++set escapedbinfile  [string_to_regexp ${objdir}/${subdir}/${testfile}]
++
++# The kernel VDSO is used for the syscalls returns only on i386 (not x86_64).
++#
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-m32}] != "" } {
++    gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail."
++}
++
++if [get_compiler_info ${binfile}] {
++    return -1
++}
++
++# Start the program running and then wait for a bit, to be sure
++# that it can be attached to.
++
++set testpid [eval exec $binfile &]
++
++# Avoid some race:
++sleep 2
++
++# Start with clean gdb
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++# Never call: gdb_load ${binfile}
++# as the former problem would not reproduce otherwise.
++
++set test "attach"
++gdb_test_multiple "attach $testpid" "$test" {
++    -re "Attaching to process $testpid\r?\n.*$gdb_prompt $" {
++      pass "$test"
++    }
++}
++
++gdb_test "bt" "#0 *0x\[0-9a-f\]* in \[^?\].*" "backtrace decodes VDSO"
++
++# Exit and detach the process.
++   
++gdb_exit
++
++# Make sure we don't leave a process around to confuse
++# the next test run (and prevent the compile by keeping
++# the text file busy), in case the "set should_exit" didn't
++# work.
++   
++remote_exec build "kill -9 ${testpid}"
diff --git a/gdb/patches/gdb-6.3-bz140532-ppc-unwinding-test.patch b/gdb/patches/gdb-6.3-bz140532-ppc-unwinding-test.patch
new file mode 100644 (file)
index 0000000..6494cde
--- /dev/null
@@ -0,0 +1,310 @@
+diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S
+--- gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S      1969-12-31 19:00:00.000000000 -0500
++++ gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S        2007-08-02 13:23:10.000000000 -0400
+@@ -0,0 +1,78 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2007 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
++
++      .section        ".text"
++      .align 2
++      .globl func0
++      .type   func0, @function
++func0:
++      stwu 1,-16(1)
++      mflr 0
++      stw 31,12(1)
++      stw 0,20(1)
++      mr 31,1
++      bl abort
++      .size   func0, .-func0
++      .align 2
++      .globl func1
++      .type   func1, @function
++func1:
++      stwu 1,-16(1)
++      mflr 0
++/* 20 = BO = branch always
++   31 = BI = CR bit (ignored)  */
++      bcl 20,31,.Lpie
++.Lpie:        stw 31,12(1)
++      stw 0,20(1)
++      mr 31,1
++      bl func0
++      mr 0,3
++      lis 9,var@ha
++      lwz 9,var@l(9)
++      add 0,0,9
++      mr 3,0
++      lwz 11,0(1)
++      lwz 0,4(11)
++      mtlr 0
++      lwz 31,-4(11)
++      mr 1,11
++      blr
++      .size   func1, .-func1
++      .section        .note.GNU-stack,"",@progbits
++      .ident  "GCC: (GNU) 3.4.6 20060404 (Red Hat 3.4.6-8)"
++
++/* Original source file:
++
++#include <stdlib.h>
++
++extern volatile int var;
++
++int func0 (void) __attribute__((__noinline__));
++int func0 (void)
++{
++  abort ();
++  return var;
++}
++
++int func1 (void) __attribute__((__noinline__));
++int func1 (void)
++{
++  return func0 () + var;
++}
++
++*/
+diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S
+--- gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S      1969-12-31 19:00:00.000000000 -0500
++++ gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S        2007-08-02 14:28:56.000000000 -0400
+@@ -0,0 +1,98 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2007 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
++
++      .section        ".toc","aw"
++      .section        ".text"
++      .align 2
++      .globl func0
++      .section        ".opd","aw"
++      .align 3
++func0:
++      .quad   .L.func0,.TOC.@tocbase
++      .previous
++      .type   func0, @function
++.L.func0:
++      mflr 0
++      std 31,-8(1)
++      std 0,16(1)
++      stdu 1,-128(1)
++      mr 31,1
++      bl abort
++      nop
++      .long 0
++      .byte 0,0,0,1,128,1,0,1
++      .size   func0,.-.L.func0
++      .section        ".toc","aw"
++.LC1:
++      .tc var[TC],var
++      .section        ".text"
++      .align 2
++      .globl func1
++      .section        ".opd","aw"
++      .align 3
++func1:
++      .quad   .L.func1,.TOC.@tocbase
++      .previous
++      .type   func1, @function
++.L.func1:
++      mflr 0
++/* 20 = BO = branch always
++   31 = BI = CR bit (ignored)  */
++      bcl 20,31,.Lpie
++.Lpie:        std 31,-8(1)
++      std 0,16(1)
++      stdu 1,-128(1)
++      mr 31,1
++      bl func0
++      mr 11,3
++      ld 9,.LC1@toc(2)
++      lwz 0,0(9)
++      add 0,11,0
++      extsw 0,0
++      mr 3,0
++      ld 1,0(1)
++      ld 0,16(1)
++      mtlr 0
++      ld 31,-8(1)
++      blr
++      .long 0
++      .byte 0,0,0,1,128,1,0,1
++      .size   func1,.-.L.func1
++      .section        .note.GNU-stack,"",@progbits
++      .ident  "GCC: (GNU) 3.4.6 20060404 (Red Hat 3.4.6-8)"
++
++/* Original source file:
++
++#include <stdlib.h>
++
++extern volatile int var;
++
++int func0 (void) __attribute__((__noinline__));
++int func0 (void)
++{
++  abort ();
++  return var;
++}
++
++int func1 (void) __attribute__((__noinline__));
++int func1 (void)
++{
++  return func0 () + var;
++}
++
++*/
+diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c
+--- gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c    1969-12-31 19:00:00.000000000 -0500
++++ gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c      2007-08-02 13:25:10.000000000 -0400
+@@ -0,0 +1,29 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2007 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
++
++/* Force `-fpie' double jump bl->blrl.  */
++/* No longer used.  */
++volatile int var;
++
++extern int func1 (void);
++
++int main (void)
++{
++  func1 ();
++  return 0;
++}
+diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp
+--- gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp  1969-12-31 19:00:00.000000000 -0500
++++ gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp    2007-08-02 14:21:29.000000000 -0400
+@@ -0,0 +1,72 @@
++#   Copyright 2006, 2007 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# Test unwinding fixes of the PPC platform, specifically on the coping with BCL
++# jump of the PIE code.
++
++if ![istarget "powerpc*-*-linux*"] then {
++    verbose "Skipping powerpc-linux prologue tests."
++    return
++}
++
++set testfile "powerpc-bcl-prologue"
++set srcfile1 ${testfile}.c
++set flags "debug"
++if [istarget "powerpc-*"] then {
++    set srcfile2 ${testfile}-asm32.S
++    set flags "$flags additional_flags=-m32"
++} elseif [istarget "powerpc64-*"] then {
++    set srcfile2 ${testfile}-asm64.S
++    set flags "$flags additional_flags=-m64"
++} else {
++   fail "powerpc arch test"
++   return
++}
++set objfile2 ${objdir}/${subdir}/${testfile}-asm.o
++set binfile ${objdir}/${subdir}/${testfile}
++
++if { [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${srcdir}/${subdir}/${srcfile2}" ${binfile} executable $flags] != ""} {
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++# We should stop in abort(3).
++
++gdb_run_cmd
++
++gdb_test_multiple {} "continue to abort()" {
++    -re ".*Program received signal SIGABRT,.*$gdb_prompt $" {
++       pass "continue to abort()"
++    }
++}
++
++# Check backtrace:
++# #3  0x0804835f in func0 ()
++# #4  0x0804836a in func1 ()
++# #5  0x0804838c in main ()
++# (gdb)
++# `\\.?' prefixes are needed for ppc64 without `debug' (another bug).
++
++set test "matching unwind"
++gdb_test_multiple "backtrace" $test {
++    -re "\r\n#\[0-9\]\[^\r\n\]* in \\.?func0 \\(\[^\r\n\]*\r\n#\[0-9\]\[^\r\n\]* in \\.?func1 \\(\[^\r\n\]*\r\n#\[0-9\]\[^\r\n\]* in \\.?main \\(\[^\r\n\]*\r\n$gdb_prompt $" {
++      pass $test
++    }
++}
+
+Fixup the testcase for ppc64 biarch GDB.
+
+--- ./gdb/testsuite/gdb.arch/powerpc-prologue.exp      2008-01-13 13:32:19.000000000 +0100
++++ ./gdb/testsuite/gdb.arch/powerpc-prologue.exp      2008-01-02 00:04:10.000000000 +0100
+@@ -17,8 +17,9 @@
+ # Test PowerPC prologue analyzer.
+ # Do not run on AIX (where we won't be able to build the tests without
+-# some surgery) or on PowerPC64 (ditto, dot symbols).
+-if {[istarget *-*-aix*] || ![istarget "powerpc-*-*"]} then {
++# some surgery).  PowerPC64 target would break due to dot symbols but we build
++# there PowerPC32 inferior.
++if {[istarget *-*-aix*] || ![istarget "powerpc*-*-*"]} then {
+     verbose "Skipping PowerPC prologue tests."
+     return
+ }
diff --git a/gdb/patches/gdb-6.3-bz202689-exec-from-pthread-test.patch b/gdb/patches/gdb-6.3-bz202689-exec-from-pthread-test.patch
new file mode 100644 (file)
index 0000000..91dc69a
--- /dev/null
@@ -0,0 +1,98 @@
+2007-01-17  Jan Kratochvil <jan.kratochvil@redhat.com>
+
+       * gdb.threads/threaded-exec.exp, gdb.threads/threaded-exec.c: New files.
+
+
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.threads/threaded-exec.c        17 Jan 2007 23:10:22 -0000
+@@ -0,0 +1,46 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2007 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <stddef.h>
++#include <pthread.h>
++#include <assert.h>
++#include <stdlib.h>
++#include <unistd.h>
++
++
++static void *
++threader (void *arg)
++{
++      return NULL;
++}
++
++int
++main (void)
++{
++      pthread_t t1;
++      int i;
++
++      i = pthread_create (&t1, NULL, threader, (void *) NULL);
++      assert (i == 0);
++      i = pthread_join (t1, NULL);
++      assert (i == 0);
++
++      execl ("/bin/true", "/bin/true", NULL);
++      abort ();
++}
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.threads/threaded-exec.exp      17 Jan 2007 23:10:22 -0000
+@@ -0,0 +1,41 @@
++# threaded-exec.exp -- Check reset of the tracked threads on exec*(2)
++# Copyright (C) 2007 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++
++# Please email any bugs, comments, and/or additions to this file to:
++# bug-gdb@prep.ai.mit.edu
++
++set testfile threaded-exec
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++
++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable []] != "" } {
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++
++gdb_load ${binfile}
++
++gdb_run_cmd
++
++gdb_test_multiple {} "Program exited" {
++   -re "\r\n\\\[Inferior .* exited normally\\\]\r\n$gdb_prompt $" {
++       pass "Program exited"
++   }
++}
diff --git a/gdb/patches/gdb-6.3-bz231832-obstack-2gb.patch b/gdb/patches/gdb-6.3-bz231832-obstack-2gb.patch
new file mode 100644 (file)
index 0000000..38742cd
--- /dev/null
@@ -0,0 +1,201 @@
+https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=231832
+
+
+Index: gdb-7.2.50.20101116/gdb/symmisc.c
+===================================================================
+--- gdb-7.2.50.20101116.orig/gdb/symmisc.c     2010-11-16 07:53:59.000000000 +0100
++++ gdb-7.2.50.20101116/gdb/symmisc.c  2010-11-16 08:03:08.000000000 +0100
+@@ -186,8 +186,8 @@ print_objfile_statistics (void)
+     if (OBJSTAT (objfile, sz_strtab) > 0)
+       printf_filtered (_("  Space used by a.out string tables: %d\n"),
+                      OBJSTAT (objfile, sz_strtab));
+-    printf_filtered (_("  Total memory used for objfile obstack: %d\n"),
+-                   obstack_memory_used (&objfile->objfile_obstack));
++    printf_filtered (_("  Total memory used for objfile obstack: %ld\n"),
++                   (long) obstack_memory_used (&objfile->objfile_obstack));
+     printf_filtered (_("  Total memory used for psymbol cache: %d\n"),
+                    bcache_memory_used (psymbol_bcache_get_bcache
+                                         (objfile->psymbol_cache)));
+Index: gdb-7.2.50.20101116/include/obstack.h
+===================================================================
+--- gdb-7.2.50.20101116.orig/include/obstack.h 2008-10-21 01:03:31.000000000 +0200
++++ gdb-7.2.50.20101116/include/obstack.h      2010-11-16 08:02:37.000000000 +0100
+@@ -188,31 +188,31 @@ struct obstack           /* control current objec
+ /* Declare the external functions we use; they are in obstack.c.  */
+-extern void _obstack_newchunk (struct obstack *, int);
++extern void _obstack_newchunk (struct obstack *, PTR_INT_TYPE);
+ extern void _obstack_free (struct obstack *, void *);
+-extern int _obstack_begin (struct obstack *, int, int,
++extern int _obstack_begin (struct obstack *, PTR_INT_TYPE, int,
+                           void *(*) (long), void (*) (void *));
+-extern int _obstack_begin_1 (struct obstack *, int, int,
++extern int _obstack_begin_1 (struct obstack *, PTR_INT_TYPE, int,
+                            void *(*) (void *, long),
+                            void (*) (void *, void *), void *);
+-extern int _obstack_memory_used (struct obstack *);
++extern PTR_INT_TYPE _obstack_memory_used (struct obstack *);
\f
+ /* Do the function-declarations after the structs
+    but before defining the macros.  */
+ void obstack_init (struct obstack *obstack);
+-void * obstack_alloc (struct obstack *obstack, int size);
++void * obstack_alloc (struct obstack *obstack, PTR_INT_TYPE size);
+-void * obstack_copy (struct obstack *obstack, void *address, int size);
+-void * obstack_copy0 (struct obstack *obstack, void *address, int size);
++void * obstack_copy (struct obstack *obstack, void *address, PTR_INT_TYPE size);
++void * obstack_copy0 (struct obstack *obstack, void *address, PTR_INT_TYPE size);
+ void obstack_free (struct obstack *obstack, void *block);
+-void obstack_blank (struct obstack *obstack, int size);
++void obstack_blank (struct obstack *obstack, PTR_INT_TYPE size);
+-void obstack_grow (struct obstack *obstack, void *data, int size);
+-void obstack_grow0 (struct obstack *obstack, void *data, int size);
++void obstack_grow (struct obstack *obstack, void *data, PTR_INT_TYPE size);
++void obstack_grow0 (struct obstack *obstack, void *data, PTR_INT_TYPE size);
+ void obstack_1grow (struct obstack *obstack, int data_char);
+ void obstack_ptr_grow (struct obstack *obstack, void *data);
+@@ -220,20 +220,20 @@ void obstack_int_grow (struct obstack *o
+ void * obstack_finish (struct obstack *obstack);
+-int obstack_object_size (struct obstack *obstack);
++PTR_INT_TYPE obstack_object_size (struct obstack *obstack);
+-int obstack_room (struct obstack *obstack);
+-void obstack_make_room (struct obstack *obstack, int size);
++PTR_INT_TYPE obstack_room (struct obstack *obstack);
++void obstack_make_room (struct obstack *obstack, PTR_INT_TYPE size);
+ void obstack_1grow_fast (struct obstack *obstack, int data_char);
+ void obstack_ptr_grow_fast (struct obstack *obstack, void *data);
+ void obstack_int_grow_fast (struct obstack *obstack, int data);
+-void obstack_blank_fast (struct obstack *obstack, int size);
++void obstack_blank_fast (struct obstack *obstack, PTR_INT_TYPE size);
+ void * obstack_base (struct obstack *obstack);
+ void * obstack_next_free (struct obstack *obstack);
+ int obstack_alignment_mask (struct obstack *obstack);
+-int obstack_chunk_size (struct obstack *obstack);
+-int obstack_memory_used (struct obstack *obstack);
++size_t obstack_chunk_size (struct obstack *obstack);
++size_t obstack_memory_used (struct obstack *obstack);
+ /* Error handler called when `obstack_chunk_alloc' failed to allocate
+    more memory.  This can be set to a user defined function.  The
+@@ -318,7 +318,7 @@ extern int obstack_exit_failure;
+ # define obstack_make_room(OBSTACK,length)                            \
+ __extension__                                                         \
+ ({ struct obstack *__o = (OBSTACK);                                   \
+-   int __len = (length);                                              \
++   PTR_INT_TYPE __len = (length);                                     \
+    if (__o->chunk_limit - __o->next_free < __len)                     \
+      _obstack_newchunk (__o, __len);                                  \
+    (void) 0; })
+@@ -331,7 +331,7 @@ __extension__                                                              \
+ # define obstack_grow(OBSTACK,where,length)                           \
+ __extension__                                                         \
+ ({ struct obstack *__o = (OBSTACK);                                   \
+-   int __len = (length);                                              \
++   PTR_INT_TYPE __len = (length);                                     \
+    if (__o->next_free + __len > __o->chunk_limit)                     \
+      _obstack_newchunk (__o, __len);                                  \
+    _obstack_memcpy (__o->next_free, (where), __len);                  \
+@@ -341,7 +341,7 @@ __extension__                                                              \
+ # define obstack_grow0(OBSTACK,where,length)                          \
+ __extension__                                                         \
+ ({ struct obstack *__o = (OBSTACK);                                   \
+-   int __len = (length);                                              \
++   PTR_INT_TYPE __len = (length);                                     \
+    if (__o->next_free + __len + 1 > __o->chunk_limit)                 \
+      _obstack_newchunk (__o, __len + 1);                              \
+    _obstack_memcpy (__o->next_free, (where), __len);                  \
+@@ -392,7 +392,7 @@ __extension__                                                              \
+ # define obstack_blank(OBSTACK,length)                                        \
+ __extension__                                                         \
+ ({ struct obstack *__o = (OBSTACK);                                   \
+-   int __len = (length);                                              \
++   PTR_INT_TYPE __len = (length);                                     \
+    if (__o->chunk_limit - __o->next_free < __len)                     \
+      _obstack_newchunk (__o, __len);                                  \
+    obstack_blank_fast (__o, __len);                                   \
+@@ -532,7 +532,7 @@ __extension__                                                              \
+ # define obstack_free(h,obj)                                          \
+ ( (h)->temp = (char *) (obj) - (char *) (h)->chunk,                   \
+   (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
+-   ? (int) ((h)->next_free = (h)->object_base                         \
++   ? (PTR_INT_TYPE) ((h)->next_free = (h)->object_base                        \
+           = (h)->temp + (char *) (h)->chunk)                          \
+    : (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0)))
+Index: gdb-7.2.50.20101116/libiberty/obstack.c
+===================================================================
+--- gdb-7.2.50.20101116.orig/libiberty/obstack.c       2005-05-10 17:33:33.000000000 +0200
++++ gdb-7.2.50.20101116/libiberty/obstack.c    2010-11-16 08:02:37.000000000 +0100
+@@ -44,9 +44,11 @@
+ #if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
+ #include <gnu-versions.h>
+ #if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
++#if 0 /* 64-bit obstack is not compatible with any glibc implementation.  */
+ #define ELIDE_CODE
+ #endif
+ #endif
++#endif
+ #ifndef ELIDE_CODE
+@@ -139,7 +141,7 @@ struct obstack *_obstack;
+    free up some memory, then call this again.  */
+ int
+-_obstack_begin (struct obstack *h, int size, int alignment,
++_obstack_begin (struct obstack *h, PTR_INT_TYPE size, int alignment,
+                 POINTER (*chunkfun) (long), void (*freefun) (void *))
+ {
+   register struct _obstack_chunk *chunk; /* points to new chunk */
+@@ -183,7 +185,7 @@ _obstack_begin (struct obstack *h, int s
+ }
+ int
+-_obstack_begin_1 (struct obstack *h, int size, int alignment,
++_obstack_begin_1 (struct obstack *h, PTR_INT_TYPE size, int alignment,
+                   POINTER (*chunkfun) (POINTER, long),
+                   void (*freefun) (POINTER, POINTER), POINTER arg)
+ {
+@@ -235,7 +237,7 @@ _obstack_begin_1 (struct obstack *h, int
+    to the beginning of the new one.  */
+ void
+-_obstack_newchunk (struct obstack *h, int length)
++_obstack_newchunk (struct obstack *h, PTR_INT_TYPE length)
+ {
+   register struct _obstack_chunk *old_chunk = h->chunk;
+   register struct _obstack_chunk *new_chunk;
+@@ -388,11 +390,11 @@ obstack_free (struct obstack *h, POINTER
+     abort ();
+ }
\f
+-int
++PTR_INT_TYPE
+ _obstack_memory_used (struct obstack *h)
+ {
+   register struct _obstack_chunk* lp;
+-  register int nbytes = 0;
++  register PTR_INT_TYPE nbytes = 0;
+   for (lp = h->chunk; lp != 0; lp = lp->prev)
+     {
+@@ -421,6 +423,7 @@ print_and_abort (void)
+ }
\f
+ #if 0
++/* These functions are now broken for 64-bit obstack!  */
+ /* These are now turned off because the applications do not use it
+    and it uses bcopy via obstack_grow, which causes trouble on sysV.  */
diff --git a/gdb/patches/gdb-6.3-focus-cmd-prev-test.patch b/gdb/patches/gdb-6.3-focus-cmd-prev-test.patch
new file mode 100644 (file)
index 0000000..88f52f1
--- /dev/null
@@ -0,0 +1,28 @@
+--- /dev/null  2008-03-23 13:41:46.072650180 +0100
++++ gdb-6.3/gdb/testsuite/gdb.base/focus-cmd-prev.exp  2008-03-23 23:46:45.000000000 +0100
+@@ -0,0 +1,25 @@
++# Copyright 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++if $tracelevel then {
++    strace $tracelevel
++}
++
++gdb_exit
++gdb_start
++
++gdb_test "focus cmd"
++gdb_test "focus prev"
diff --git a/gdb/patches/gdb-6.3-gcore-thread-20050204.patch b/gdb/patches/gdb-6.3-gcore-thread-20050204.patch
new file mode 100644 (file)
index 0000000..31ecbba
--- /dev/null
@@ -0,0 +1,25 @@
+2005-02-07  Jeff Johnston  <jjohnstn@redhat.com>
+
+        * linux-nat.c (linux_nat_xfer_memory): Don't use
+        linux_proc_xfer_memory for ia64.
+
+Index: gdb-6.8.50.20090803/gdb/linux-nat.c
+===================================================================
+--- gdb-6.8.50.20090803.orig/gdb/linux-nat.c   2009-08-04 06:29:47.000000000 +0200
++++ gdb-6.8.50.20090803/gdb/linux-nat.c        2009-08-04 06:29:55.000000000 +0200
+@@ -4495,10 +4495,15 @@ linux_xfer_partial (struct target_ops *o
+       offset &= ((ULONGEST) 1 << addr_bit) - 1;
+     }
++#ifndef NATIVE_XFER_UNWIND_TABLE
++  /* FIXME: For ia64, we cannot currently use linux_proc_xfer_memory
++          for accessing thread storage.  Revert when Bugzilla 147436
++          is fixed.  */
+   xfer = linux_proc_xfer_partial (ops, object, annex, readbuf, writebuf,
+                                 offset, len);
+   if (xfer != 0)
+     return xfer;
++#endif
+   return super_xfer_partial (ops, object, annex, readbuf, writebuf,
+                            offset, len);
diff --git a/gdb/patches/gdb-6.3-gstack-20050411.patch b/gdb/patches/gdb-6.3-gstack-20050411.patch
new file mode 100644 (file)
index 0000000..98d5bb0
--- /dev/null
@@ -0,0 +1,241 @@
+2004-11-23  Andrew Cagney  <cagney@redhat.com>
+
+       * Makefile.in (uninstall-gstack, install-gstack): New rules, add
+       to install and uninstall.
+       * gstack.sh, gstack.1: New files.
+
+Index: gdb-7.2.50.20101116/gdb/Makefile.in
+===================================================================
+--- gdb-7.2.50.20101116.orig/gdb/Makefile.in   2010-11-05 15:31:25.000000000 +0100
++++ gdb-7.2.50.20101116/gdb/Makefile.in        2010-11-16 07:56:10.000000000 +0100
+@@ -972,7 +972,7 @@ gdb.z:gdb.1
+ install: all
+       @$(MAKE) $(FLAGS_TO_PASS) install-only
+-install-only: $(CONFIG_INSTALL)
++install-only: install-gstack $(CONFIG_INSTALL)
+       transformed_name=`t='$(program_transform_name)'; \
+                         echo gdb | sed -e "$$t"` ; \
+               if test "x$$transformed_name" = x; then \
+@@ -1008,7 +1008,25 @@ install-tui:
+ install-python:
+       $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb
+-uninstall: force $(CONFIG_UNINSTALL)
++GSTACK=gstack
++.PHONY: install-gstack
++install-gstack:
++      transformed_name=`t='$(program_transform_name)'; \
++                        echo $(GSTACK) | sed -e "$$t"` ; \
++              if test "x$$transformed_name" = x; then \
++                transformed_name=$(GSTACK) ; \
++              else \
++                true ; \
++              fi ; \
++              $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir) ; \
++              $(INSTALL_PROGRAM) $(srcdir)/$(GSTACK).sh \
++                      $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
++              : $(SHELL) $(srcdir)/../mkinstalldirs \
++                      $(DESTDIR)$(man1dir) ; \
++              : $(INSTALL_DATA) $(srcdir)/gstack.1 \
++                      $(DESTDIR)$(man1dir)/$$transformed_name.1
++
++uninstall: force uninstall-gstack $(CONFIG_UNINSTALL)
+       transformed_name=`t='$(program_transform_name)'; \
+                         echo gdb | sed -e $$t` ; \
+               if test "x$$transformed_name" = x; then \
+@@ -1030,6 +1048,17 @@ uninstall-tui:
+               fi ; \
+               rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \
+                     $(DESTDIR)$(man1dir)/$$transformed_name.1
++.PHONY: uninstall-gstack
++uninstall-gstack:
++      transformed_name=`t='$(program_transform_name)'; \
++                        echo $(GSTACK) | sed -e $$t` ; \
++              if test "x$$transformed_name" = x; then \
++                transformed_name=$(GSTACK) ; \
++              else \
++                true ; \
++              fi ; \
++              rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \
++                    $(DESTDIR)$(man1dir)/$$transformed_name.1
+ # The C++ name parser can be built standalone for testing.
+ test-cp-name-parser.o: cp-name-parser.c
+Index: gdb-7.2.50.20101116/gdb/gstack.sh
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20101116/gdb/gstack.sh  2010-11-16 07:55:47.000000000 +0100
+@@ -0,0 +1,48 @@
++#!/bin/sh
++
++if test $# -ne 1; then
++    echo "Usage: `basename $0 .sh` <process-id>" 1>&2
++    exit 1
++fi
++
++if test ! -r /proc/$1; then
++    echo "Process $1 not found." 1>&2
++    exit 1
++fi
++
++# GDB doesn't allow "thread apply all bt" when the process isn't
++# threaded; need to peek at the process to determine if that or the
++# simpler "bt" should be used.
++
++backtrace="bt"
++if test -d /proc/$1/task ; then
++    # Newer kernel; has a task/ directory.
++    if test `/bin/ls /proc/$1/task | /usr/bin/wc -l` -gt 1 2>/dev/null ; then
++      backtrace="thread apply all bt"
++    fi
++elif test -f /proc/$1/maps ; then
++    # Older kernel; go by it loading libpthread.
++    if /bin/grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then
++      backtrace="thread apply all bt"
++    fi
++fi
++
++GDB=${GDB:-/usr/bin/gdb}
++
++if $GDB -nx --quiet --batch --readnever > /dev/null 2>&1; then
++    readnever=--readnever
++else
++    readnever=
++fi
++
++# Run GDB, strip out unwanted noise.
++$GDB --quiet $readnever -nx /proc/$1/exe $1 <<EOF 2>&1 | 
++set width 0
++set height 0
++set pagination no
++$backtrace
++EOF
++/bin/sed -n \
++    -e 's/^\((gdb) \)*//' \
++    -e '/^#/p' \
++    -e '/^Thread/p'
+Index: gdb-7.2.50.20101116/gdb/testsuite/gdb.base/gstack.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20101116/gdb/testsuite/gdb.base/gstack.exp      2010-11-16 07:55:47.000000000 +0100
+@@ -0,0 +1,71 @@
++# Copyright (C) 2010 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++set testfile gstack
++set executable ${testfile}
++set binfile ${objdir}/${subdir}/$executable
++if {[build_executable ${testfile} ${executable} "" {debug}] == -1} {
++    return -1
++}
++
++set test "spawn inferior"
++set command "${binfile}"
++set res [remote_spawn host $command];
++if { $res < 0 || $res == "" } {
++    perror "Spawning $command failed."
++    fail $test
++    return
++}
++set pid [exp_pid -i $res]
++gdb_expect {
++    -re "looping\r\n" {
++      pass $test
++    }
++    eof {
++      fail "$test (eof)"
++      return
++    }
++    timeout {
++      fail "$test (timeout)"
++      return
++    }
++}
++gdb_exit
++
++# Testcase uses the most simple notification not to get caught by attach on
++# exiting the function.  Still we could retry the gstack command if we fail.
++
++set test "spawn gstack"
++set command "sh -c GDB=$GDB\\ sh\\ ${srcdir}/../gstack.sh\\ $pid\\;echo\\ GSTACK-END"
++set res [remote_spawn host $command];
++if { $res < 0 || $res == "" } {
++    perror "Spawning $command failed."
++    fail $test
++}
++set pid [exp_pid -i $res]
++gdb_expect {
++    -re {^#0 +0x[0-9a-f]+ in \.?func \(\)\r\n#1 +0x[0-9a-f]+ in \.?main \(\)\r\nGSTACK-END\r\n$} {
++      pass $test
++    }
++    eof {
++      fail "$test (eof)"
++    }
++    timeout {
++      fail "$test (timeout)"
++    }
++}
++gdb_exit
++
++remote_exec host "kill -9 $pid"
+Index: gdb-7.2.50.20101116/gdb/testsuite/gdb.base/gstack.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20101116/gdb/testsuite/gdb.base/gstack.c        2010-11-16 07:55:47.000000000 +0100
+@@ -0,0 +1,43 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#include <stdio.h>
++#include <unistd.h>
++#include <string.h>
++
++void
++func (void)
++{
++  const char msg[] = "looping\n";
++
++  /* Use the most simple notification not to get caught by attach on exiting
++     the function.  */
++  write (1, msg, strlen (msg));
++  
++  for (;;);
++}
++
++int
++main (void)
++{
++  alarm (60);
++  nice (100);
++
++  func ();
++
++  return 0;
++}
diff --git a/gdb/patches/gdb-6.3-ia64-gcore-page0-20050421.patch b/gdb/patches/gdb-6.3-ia64-gcore-page0-20050421.patch
new file mode 100644 (file)
index 0000000..ecdfbae
--- /dev/null
@@ -0,0 +1,20 @@
+Index: gdb-7.2.50.20110107/gdb/gcore.c
+===================================================================
+--- gdb-7.2.50.20110107.orig/gdb/gcore.c       2011-01-05 23:22:49.000000000 +0100
++++ gdb-7.2.50.20110107/gdb/gcore.c    2011-01-07 09:04:28.000000000 +0100
+@@ -534,8 +534,14 @@ gcore_copy_callback (bfd *obfd, asection
+       if (size > total_size)
+       size = total_size;
++      /* Warn if read error occurs except if we were trying to read the
++       first page for ia64.  The first page is marked readable, but it cannot
++       be read.  */
+       if (target_read_memory (bfd_section_vma (obfd, osec) + offset,
+-                            memhunk, size) != 0)
++                            memhunk, size) != 0
++        && (strcmp (gdbarch_bfd_arch_info (target_gdbarch)->arch_name,
++                    "ia64")
++            || bfd_section_vma (obfd, osec) != 0))
+       {
+         warning (_("Memory read failed for corefile "
+                    "section, %s bytes at %s."),
diff --git a/gdb/patches/gdb-6.3-ia64-gcore-speedup-20050714.patch b/gdb/patches/gdb-6.3-ia64-gcore-speedup-20050714.patch
new file mode 100644 (file)
index 0000000..f902e62
--- /dev/null
@@ -0,0 +1,126 @@
+2005-07-14  Jeff Johnsotn  <jjohnstn@redhat.com>
+
+       * linux-nat.c (linux_nat_xfer_memory): Incorporate Fujitsu
+       work-around to use /proc/mem for storage, but to fall-back
+       to PTRACE for ia64 rse register areas.
+       * ia64-linux-nat.c (ia64_rse_slot_num): New static function.
+       (ia64_rse_skip_regs): Ditto.
+       (ia64_linux_check_stack_region): New function.
+       
+Index: gdb-6.8.50.20090803/gdb/linux-nat.c
+===================================================================
+--- gdb-6.8.50.20090803.orig/gdb/linux-nat.c   2009-08-04 06:29:55.000000000 +0200
++++ gdb-6.8.50.20090803/gdb/linux-nat.c        2009-08-04 06:30:53.000000000 +0200
+@@ -4495,15 +4495,38 @@ linux_xfer_partial (struct target_ops *o
+       offset &= ((ULONGEST) 1 << addr_bit) - 1;
+     }
+-#ifndef NATIVE_XFER_UNWIND_TABLE
+-  /* FIXME: For ia64, we cannot currently use linux_proc_xfer_memory
+-          for accessing thread storage.  Revert when Bugzilla 147436
+-          is fixed.  */
+   xfer = linux_proc_xfer_partial (ops, object, annex, readbuf, writebuf,
+                                 offset, len);
+   if (xfer != 0)
+-    return xfer;
++    {
++#ifdef NATIVE_XFER_UNWIND_TABLE
++      struct mem_region range;
++      range.lo = memaddr;
++      range.hi = memaddr + len;
++
++      /* FIXME: For ia64, we cannot currently use
++       linux_proc_xfer_partial for accessing rse register storage.
++       Revert when Bugzilla 147436 is fixed.  */
++#ifdef NATIVE_XFER_UNWIND_TABLE
++      extern int ia64_linux_check_stack_region (struct lwp_info *lwp,
++                                              void *range);
++#endif
++      if (iterate_over_lwps (ia64_linux_check_stack_region, &range) != NULL)
++      { /* This region contains ia64 rse registers, we have to re-read.  */
++        int xxfer;
++
++        /* Re-read register stack area.  */
++        xxfer = super_xfer_partial (ops, object, annex,
++                                    readbuf + (range.lo - memaddr),
++                                    writebuf + (range.lo - memaddr),
++                                    offset + (range.lo - memaddr),
++                                    range.hi - range.lo);
++        if (xxfer == 0)
++          xfer = 0;
++      }
+ #endif
++      return xfer;
++    }
+   return super_xfer_partial (ops, object, annex, readbuf, writebuf,
+                            offset, len);
+Index: gdb-6.8.50.20090803/gdb/ia64-linux-nat.c
+===================================================================
+--- gdb-6.8.50.20090803.orig/gdb/ia64-linux-nat.c      2009-02-23 01:03:49.000000000 +0100
++++ gdb-6.8.50.20090803/gdb/ia64-linux-nat.c   2009-08-04 06:30:53.000000000 +0200
+@@ -809,6 +809,64 @@ ia64_linux_xfer_partial (struct target_o
+ void _initialize_ia64_linux_nat (void);
++/*
++ * Note: taken from ia64_tdep.c
++ *
++ */
++
++static __inline__ unsigned long
++ia64_rse_slot_num (unsigned long addr)
++{
++  return (addr >> 3) & 0x3f;
++}
++
++/* Skip over a designated number of registers in the backing
++   store, remembering every 64th position is for NAT.  */
++static __inline__ unsigned long
++ia64_rse_skip_regs (unsigned long  addr, long num_regs)
++{
++  long delta = ia64_rse_slot_num(addr) + num_regs;
++
++  if (num_regs < 0)
++    delta -= 0x3e;
++  return addr + ((num_regs + delta/0x3f) << 3);
++}
++
++/*
++ * Check mem_region is stack or not. If stack, /proc/<pid>/mem cannot return 
++ * expected value.
++ */
++int ia64_linux_check_stack_region(struct lwp_info *ti, struct mem_region *range)
++{
++      CORE_ADDR addr;
++      int error;
++      unsigned long bsp, cfm, bspstore;
++      long sof;
++      pid_t pid = ptid_get_lwp(ti->ptid);
++      bsp = ptrace(PTRACE_PEEKUSER, pid, PT_AR_BSP ,NULL);
++      if (bsp == (unsigned long)-1) {
++              return 1;
++      }
++      /* stack is allocated by one-segment, not separated into several segments.
++         So, we only have to check whether bsp is in *range* or not. */               
++      if((range->lo <= bsp) && (bsp <= range->hi)) {
++              bspstore = ptrace(PTRACE_PEEKUSER, pid, PT_AR_BSPSTORE, NULL);
++              cfm = ptrace(PTRACE_PEEKUSER, pid, PT_CFM, NULL);
++              sof = cfm & 0x3f;
++              bsp = ia64_rse_skip_regs(bsp, -sof);
++              range->lo = bspstore;
++              range->hi = bsp;
++              /* we have to check the size of dirty register stack area */
++              /*
++              fprintf_unfiltered(gdb_stdlog, "<%d> <%p>  <%lx> <%p> <%p>\n",
++                                 pid, bsp, sof, range->lo, range->hi);
++              */
++              return 1;
++      }
++      
++      return 0;
++}
++
+ void
+ _initialize_ia64_linux_nat (void)
+ {
diff --git a/gdb/patches/gdb-6.3-ia64-info-frame-fix-20050725.patch b/gdb/patches/gdb-6.3-ia64-info-frame-fix-20050725.patch
new file mode 100644 (file)
index 0000000..2ebab9e
--- /dev/null
@@ -0,0 +1,107 @@
+2005-07-25  Jeff Johnstno  <jjohnstn@redhat.com>
+
+       * libunwind-frame.c (libunwind_frame_prev_register): Check valuep
+       is not NULL before copying cursor address into it.
+       
+testsuite:
+2005-07-25  Jeff Johnstno  <jjohnstn@redhat.com>
+
+       * gdb.arch/ia64-sigtramp.exp: New test.
+       * gdb.arch/ia64-sigtramp.c: Ditto.
+
+2008-02-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Port to GDB-6.8pre.  (Only the testcase has remained.)
+
+--- gdb-6.3/gdb/testsuite/gdb.arch/ia64-sigtramp.c.fix 2005-07-25 16:42:46.000000000 -0400
++++ gdb-6.3/gdb/testsuite/gdb.arch/ia64-sigtramp.c     2005-07-25 16:42:08.000000000 -0400
+@@ -0,0 +1,23 @@
++#include <stdio.h>
++#include <signal.h>
++
++int *l;
++
++void x (int sig)
++{
++  printf ("in signal handler for signal %d\n", sig);
++}
++
++int main()
++{
++  int k;
++
++  signal (SIGSEGV, &x);
++
++  k = *l;
++
++  printf ("k is %d\n", k);
++ 
++  return 0;
++}
++
+--- gdb-6.3/gdb/testsuite/gdb.arch/ia64-sigtramp.exp.fix       2005-07-25 16:42:50.000000000 -0400
++++ gdb-6.3/gdb/testsuite/gdb.arch/ia64-sigtramp.exp   2005-07-25 16:42:01.000000000 -0400
+@@ -0,0 +1,63 @@
++#   Copyright 2005 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# Please email any bugs, comments, and/or additions to this file to:
++# bug-gdb@prep.ai.mit.edu
++
++# This file was written by Jeff Johnston (jjohnstn@redhat.com)
++
++if ![istarget "ia64-*-*"] then {
++    return
++}
++
++set testfile "ia64-sigtramp"
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
++    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
++}
++
++if [get_compiler_info ${binfile}] {
++    return -1
++}
++
++gdb_exit
++set match_max_old [match_max]
++match_max -d 1000000
++gdb_start
++match_max -d $match_max_old
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++if ![runto_main] then {
++    fail "Can't run to main"
++    return 0
++}
++
++gdb_test "handle SIGSEGV" "SIGSEGV.*Yes.*Yes.*Yes.*Segmentation fault"
++gdb_test "next" "" "first next"
++gdb_test "next" "Program received signal SIGSEGV.*" "getting SIGSEGV"
++gdb_breakpoint "x"
++gdb_test "continue" "Breakpoint.*x.*" "continue to x"
++
++gdb_test "f 1" ".*signal handler called.*" "frame 1"
++
++# gdb-7.0+ no longer prints the pseudo registers as they are computed.
++# frame_info says: /* For moment, only display registers that were saved on the
++#                     stack.  */
++gdb_test "set debug frame 1"
++gdb_test "info frame" "Stack level 1, .*frame_unwind_register_value \\(frame=1,regnum=750\\(p63\\),\[^\r\n\]*\r\n\[^\r\n\]*-> computed bytes=.*" "info sigtramp frame"
diff --git a/gdb/patches/gdb-6.3-ia64-sigill-20051115.patch b/gdb/patches/gdb-6.3-ia64-sigill-20051115.patch
new file mode 100644 (file)
index 0000000..bf8a1f1
--- /dev/null
@@ -0,0 +1,95 @@
+2005-11-15  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * linux-thread-db.c (thread_db_wait): Don't bother continuing if
+       the wait result indicates the program terminated with a signal.
+       * linux-nat.c (linux_nat_wait): For SIGILL and SIGTRAP, don't
+       throw away the event if the user has specified nostop noprint.
+
+gdb/testsuite:
+
+2005-11-15  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * gdb.arch/ia64-sigill.c: New test.
+       * gdb.arch/ia64-sigill.exp: Ditto.
+
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/ia64-sigill.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/ia64-sigill.exp 2011-07-22 19:16:13.000000000 +0200
+@@ -0,0 +1,49 @@
++#   Copyright 2005 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# Please email any bugs, comments, and/or additions to this file to:
++# bug-gdb@prep.ai.mit.edu
++
++# This file was written by Jeff Johnston (jjohnstn@redhat.com)
++
++if ![istarget "ia64-*-*"] then {
++    return
++}
++
++set testfile "ia64-sigill"
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++
++# Deliberately compile with pthreads, even though test is single-threaded.
++# We want to force gdb thread code to be exercised.
++if  { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
++    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
++}
++
++if [get_compiler_info ${binfile}] {
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++# We set up SIGILL nostop, noprint, pass and then run the program.
++# We expect to just see a normal run.
++gdb_test "handle SIGILL nostop noprint" "SIGILL.*No.*No.*Yes.*" "handle sigill"
++gdb_test "run" "Starting program.*ia64-sigill.*\[New thread.*\].*hello world.*Program exited normally." "run to exit"
++ 
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/ia64-sigill.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/ia64-sigill.c   2011-07-22 19:16:13.000000000 +0200
+@@ -0,0 +1,8 @@
++#include <stdio.h>
++
++int main()
++{
++  printf ("hello world\n");
++  return 0;
++}
++
+Index: gdb-7.3.50.20110722/gdb/linux-nat.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/linux-nat.c   2011-07-22 19:15:05.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/linux-nat.c        2011-07-22 19:16:13.000000000 +0200
+@@ -3733,7 +3733,8 @@ retry:
+      threads can be a bit time-consuming so if we want decent
+      performance with heavily multi-threaded programs, especially when
+      they're using a high frequency timer, we'd better avoid it if we
+-     can.  */
++     can.  For possible trap signals like SIGTRAP and SIGILL, don't
++     avoid reporting.  */
+   if (WIFSTOPPED (status))
+     {
diff --git a/gdb/patches/gdb-6.3-ia64-sigtramp-frame-20050708.patch b/gdb/patches/gdb-6.3-ia64-sigtramp-frame-20050708.patch
new file mode 100644 (file)
index 0000000..c6a7789
--- /dev/null
@@ -0,0 +1,158 @@
+2005-07-08  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * ia64-tdep.c (ia64_sigtramp_frame_prev_register): Build
+       pseudo-registers the same as ia64_pseudo_register_read.
+
+2008-04-16  Yi Zhan  <yi.zhan@intel.com>
+
+       * ia64-tdep.c (ia64_sigtramp_frame_prev_register): Fix an
+       ISO C compliance compilation error.
+
+2008-02-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Port to gdb-6.8.50.20081128, follow the upstream change:
+       http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ia64-tdep.c.diff?cvsroot=src&r1=1.176&r2=1.177
+
+Index: gdb-6.8.50.20081128/gdb/ia64-tdep.c
+===================================================================
+--- gdb-6.8.50.20081128.orig/gdb/ia64-tdep.c   2008-11-26 06:27:48.000000000 +0100
++++ gdb-6.8.50.20081128/gdb/ia64-tdep.c        2008-12-02 19:04:32.000000000 +0100
+@@ -2107,6 +2107,94 @@ ia64_sigtramp_frame_prev_register (struc
+       return frame_unwind_got_constant (this_frame, regnum, pc);
+     }
++  /* Red Hat patch begin.  */
++  else if (IA64_NAT0_REGNUM <= regnum && regnum <= IA64_NAT31_REGNUM)
++    {
++      /* NAT pseudo registers 0-31: get them from UNAT.
++       * "copied" from ia64_pseudo_register_read() */
++      ULONGEST unatN_val;
++      ULONGEST unat;
++      read_memory (cache->saved_regs[IA64_UNAT_REGNUM], (char *) &unat,
++                 register_size (target_gdbarch, IA64_UNAT_REGNUM));
++      unatN_val = (unat & (1LL << (regnum - IA64_NAT0_REGNUM))) != 0;
++      return frame_unwind_got_constant (this_frame, regnum, unatN_val);
++    }
++  else if (IA64_NAT32_REGNUM <= regnum && regnum <= IA64_NAT127_REGNUM)
++    {
++      /* NAT pseudo registers 32-127.
++       * "copied" from ia64_pseudo_register_read()
++       * FIXME: Not currently tested -- cannot get the frame to include
++       *        NAT32-NAT127.  */
++      ULONGEST bsp;
++      ULONGEST cfm;
++      ULONGEST natN_val = 0;
++      CORE_ADDR gr_addr = 0, nat_addr = 0;
++
++      read_memory (cache->saved_regs[IA64_BSP_REGNUM], (char *) &bsp,
++                 register_size (target_gdbarch, IA64_BSP_REGNUM));
++      read_memory (cache->saved_regs[IA64_CFM_REGNUM], (char *) &cfm,
++                 register_size (target_gdbarch, IA64_CFM_REGNUM));
++
++      /* The bsp points at the end of the register frame so we
++       subtract the size of frame from it to get start of register frame.  */
++      bsp = rse_address_add (bsp, -(cfm & 0x7f));
++
++      if ((cfm & 0x7f) > regnum - V32_REGNUM)
++      gr_addr = rse_address_add (bsp, (regnum - V32_REGNUM));
++
++      if (gr_addr != 0)
++      {
++        /* Compute address of nat collection bits */
++        CORE_ADDR nat_collection;
++        int nat_bit;
++        nat_addr = gr_addr | 0x1f8;
++        /* If our nat collection address is bigger than bsp, we have to get
++           the nat collection from rnat.  Otherwise, we fetch the nat
++           collection from the computed address. FIXME: Do not know if
++           RNAT can be not stored in the frame--being extra cautious. */
++        if (nat_addr >= bsp)
++          {
++            nat_addr = cache->saved_regs[IA64_RNAT_REGNUM];
++            if (nat_addr != 0)
++              read_memory (nat_addr, (char *) &nat_collection,
++                           register_size (target_gdbarch, IA64_RNAT_REGNUM));
++          }
++        else
++          nat_collection = read_memory_integer (nat_addr, 8, BFD_ENDIAN_LITTLE);
++        if (nat_addr != 0)
++          {
++            nat_bit = (gr_addr >> 3) & 0x3f;
++            natN_val = (nat_collection >> nat_bit) & 1;
++            return frame_unwind_got_constant (this_frame, regnum, natN_val);
++          }
++      }
++      warning (_("ia64_sigtramp_frame_prev_register: unhandled register %d"),
++             regnum);
++    }
++  else if (regnum == VBOF_REGNUM)
++    {
++      /* BOF pseudo register.
++       * "copied" from ia64_pseudo_register_read()
++       *
++       * A virtual register frame start is provided for user convenience.
++       * It can be calculated as the bsp - sof (sizeof frame). */
++      ULONGEST bsp;
++      ULONGEST cfm;
++      ULONGEST bof;
++
++      read_memory (cache->saved_regs[IA64_BSP_REGNUM], (char *) &bsp,
++                 register_size (target_gdbarch, IA64_BSP_REGNUM));
++      read_memory (cache->saved_regs[IA64_CFM_REGNUM], (char *) &cfm,
++                 register_size (target_gdbarch, IA64_CFM_REGNUM));
++
++      /* The bsp points at the end of the register frame so we
++       subtract the size of frame from it to get beginning of frame.  */
++      bof = rse_address_add (bsp, -(cfm & 0x7f));
++
++      return frame_unwind_got_constant (this_frame, regnum, bof);
++    }
++  /* Red Hat patch end.  */
++
+   else if ((regnum >= IA64_GR32_REGNUM && regnum <= IA64_GR127_REGNUM)
+            || (regnum >= V32_REGNUM && regnum <= V127_REGNUM))
+     {
+@@ -2121,7 +2209,42 @@ ia64_sigtramp_frame_prev_register (struc
+       return frame_unwind_got_constant (this_frame, regnum, 0);
+     }
+-  else  /* All other registers not listed above.  */
++  /* Red Hat patch begin.  */
++  else if (VP0_REGNUM <= regnum && regnum <= VP63_REGNUM)
++    {
++      /* VP 0-63.
++       * "copied" from ia64_pseudo_register_read()
++       *
++       * FIXME: Not currently tested--cannot get the frame to include PR. */
++      CORE_ADDR pr_addr = 0;
++
++      pr_addr = cache->saved_regs[IA64_PR_REGNUM];
++      if (pr_addr != 0)
++      {
++        ULONGEST pr;
++        ULONGEST cfm;
++        ULONGEST prN_val;
++        read_memory (pr_addr, (char *) &pr,
++                     register_size (target_gdbarch, IA64_PR_REGNUM));
++        read_memory (cache->saved_regs[IA64_CFM_REGNUM], (char *) &cfm,
++                     register_size (target_gdbarch, IA64_CFM_REGNUM));
++
++        /* Get the register rename base for this frame and adjust the
++         * register name to take rotation into account. */
++        if (VP16_REGNUM <= regnum && regnum <= VP63_REGNUM)
++          {
++            int rrb_pr = (cfm >> 32) & 0x3f;
++            regnum = VP16_REGNUM + ((regnum - VP16_REGNUM) + rrb_pr) % 48;
++          }
++        prN_val = (pr & (1LL << (regnum - VP0_REGNUM))) != 0;
++        return frame_unwind_got_constant (this_frame, regnum, prN_val);
++      }
++      warning (_("ia64_sigtramp_frame_prev_register: unhandled register %d"),
++             regnum);
++    }
++  /* Red Hat patch end.  */
++
++  /* All other registers not listed above.  */
+     {
+       CORE_ADDR addr = cache->saved_regs[regnum];
diff --git a/gdb/patches/gdb-6.3-inferior-notification-20050721.patch b/gdb/patches/gdb-6.3-inferior-notification-20050721.patch
new file mode 100644 (file)
index 0000000..0eb397c
--- /dev/null
@@ -0,0 +1,315 @@
+2005-07-21  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * gdb.base/attach-32.exp: New test for attaching in 32-bit
+       mode on 64-bit systems.
+       * gdb.base/attach-32.c: Ditto.
+       * gdb.base/attach-32b.c: Ditto.
+
+2007-12-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * gdb.base/attach-32.exp: Fix forgotten $GDBFLAGS as set.
+
+Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32.c     2011-03-20 20:15:57.000000000 +0100
+@@ -0,0 +1,20 @@
++/* This program is intended to be started outside of gdb, and then
++   attached to by gdb.  Thus, it simply spins in a loop.  The loop
++   is exited when & if the variable 'should_exit' is non-zero.  (It
++   is initialized to zero in this program, so the loop will never
++   exit unless/until gdb sets the variable to non-zero.)
++   */
++#include <stdio.h>
++
++int  should_exit = 0;
++
++int main ()
++{
++  int  local_i = 0;
++
++  while (! should_exit)
++    {
++      local_i++;
++    }
++  return 0;
++}
+Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32.exp   2011-03-20 20:20:03.000000000 +0100
+@@ -0,0 +1,245 @@
++# Copyright 2005 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++#
++# This test was based on attach.exp and modified for 32/64 bit Linux systems. */
++
++# On HP-UX 11.0, this test is causing a process running the program
++# "attach" to be left around spinning.  Until we figure out why, I am
++# commenting out the test to avoid polluting tiamat (our 11.0 nightly
++# test machine) with these processes. RT
++#
++# Setting the magic bit in the target app should work.  I added a
++# "kill", and also a test for the R3 register warning.  JB
++if { ![istarget "x86_64*-*linux*"] 
++     && ![istarget "powerpc64*-*linux*"]} {
++    return 0
++}
++
++# are we on a target board
++if [is_remote target] then {
++    return 0
++}
++
++set testfile "attach-32"
++set srcfile  ${testfile}.c
++set srcfile2 ${testfile}b.c
++set binfile  ${objdir}/${subdir}/${testfile}
++set binfile2 ${objdir}/${subdir}/${testfile}b
++set escapedbinfile  [string_to_regexp ${objdir}/${subdir}/${testfile}]
++
++#execute_anywhere "rm -f ${binfile} ${binfile2}"
++remote_exec build "rm -f ${binfile} ${binfile2}"
++# For debugging this test
++#
++#log_user 1
++
++# build the first test case
++#
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "additional_flags=-m32"]] != "" } {
++    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
++}
++
++# Build the in-system-call test
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable [list debug "additional_flags=-m32"]] != "" } {
++    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
++}
++
++if [get_compiler_info ${binfile}] {
++    return -1
++}
++
++proc do_attach_tests {} {
++    global gdb_prompt
++    global binfile
++    global escapedbinfile
++    global srcfile
++    global testfile
++    global objdir
++    global subdir
++    global timeout
++    global testpid
++    
++    # Verify that we can "see" the variable "should_exit" in the
++    # program, and that it is zero.
++   
++    gdb_test "print should_exit" " = 0" "after attach-32, print should_exit"
++
++    # Verify that we can modify the variable "should_exit" in the
++    # program.
++
++    gdb_test "set should_exit=1" "" "after attach-32, set should_exit"
++
++    # Verify that the modification really happened.
++
++    send_gdb "tbreak 19\n"
++    gdb_expect {
++      -re "reakpoint .*at.*$srcfile, line 19.*$gdb_prompt $" {
++          pass "after attach-32, set tbreak postloop"
++      }
++      -re "$gdb_prompt $" {
++          fail "after attach-32, set tbreak postloop"
++      }
++      timeout {
++          fail "(timeout) after attach-32, set tbreak postloop"
++      }
++    }
++    send_gdb "continue\n"
++    gdb_expect {
++      -re "main.*at.*$srcfile:19.*$gdb_prompt $" {
++          pass "after attach-32, reach tbreak postloop"
++      }
++      -re "$gdb_prompt $" {
++          fail "after attach-32, reach tbreak postloop"
++      }
++      timeout {
++          fail "(timeout) after attach-32, reach tbreak postloop"
++      }
++    }
++
++    # Allow the test process to exit, to cleanup after ourselves.
++
++    gdb_test "continue" {\[Inferior .* exited normally\]} "after attach-32, exit"
++
++    # Make sure we don't leave a process around to confuse
++    # the next test run (and prevent the compile by keeping
++    # the text file busy), in case the "set should_exit" didn't
++    # work.
++   
++    remote_exec build "kill -9 ${testpid}"
++
++    # Start the program running and then wait for a bit, to be sure
++    # that it can be attached to.
++   
++    set testpid [eval exec $binfile &]
++    exec sleep 2
++    if { [istarget "*-*-cygwin*"] } {
++      # testpid is the Cygwin PID, GDB uses the Windows PID, which might be
++      # different due to the way fork/exec works.
++      set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ]
++    }
++
++    # Verify that we can attach to the process, and find its a.out
++    # when we're cd'd to some directory that doesn't contain the
++    # a.out.  (We use the source path set by the "dir" command.)
++    
++    gdb_test "dir ${objdir}/${subdir}" "Source directories searched: .*" \
++      "set source path"
++
++    gdb_test "cd /tmp" "Working directory /tmp." \
++      "cd away from process working directory"
++
++    # Explicitly flush out any knowledge of the previous attachment.
++
++    set test "before attach-32-3, flush symbols"
++    gdb_test_multiple "symbol" "$test" {
++      -re "Discard symbol table from.*y or n. $" {
++          gdb_test "y" "No symbol file now." \
++              "$test"
++      }
++      -re "No symbol file now.*$gdb_prompt $" {
++          pass "$test"
++      }
++    }
++
++    gdb_test "exec" "No executable file now." \
++      "before attach-32-3, flush exec"
++
++    gdb_test "attach $testpid" \
++      "Attaching to process $testpid.*Reading symbols from $escapedbinfile.*main.*at .*" \
++      "attach-32 when process' a.out not in cwd"
++
++    set test "after attach-32-3, exit"
++    gdb_test_multiple "kill" "$test" {
++      -re "Kill the program being debugged.*y or n. $" {
++          gdb_test "y" "" "$test"
++      }
++    }
++    
++    # Another "don't leave a process around"
++    remote_exec build "kill -9 ${testpid}"
++}
++
++proc do_call_attach_tests {} {
++    global gdb_prompt
++    global binfile2
++    global testpid
++    
++    # See if other registers are problems
++    
++    set test "info other register"
++    gdb_test_multiple "i r r3" "$test" {
++      -re "warning: reading register.*$gdb_prompt $" {
++          fail "$test"
++      }
++      -re "r3.*$gdb_prompt $" {
++          pass "$test"
++      }
++    }
++
++    # Get rid of the process
++    
++    gdb_test "p should_exit = 1"
++    gdb_test "c" {\[Inferior .* exited normally\]}
++   
++    # Be paranoid
++   
++    remote_exec build "kill -9 ${testpid}"
++}
++
++
++# Start with a fresh gdb
++
++gdb_exit
++set testpid [eval exec $binfile &]
++exec sleep 3
++if { [istarget "*-*-cygwin*"] } {
++    # testpid is the Cygwin PID, GDB uses the Windows PID, which might be
++    # different due to the way fork/exec works.
++    set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ]
++}
++
++set GDBFLAGS_orig $GDBFLAGS
++set GDBFLAGS "--pid=$testpid"
++gdb_start
++set GDBFLAGS $GDBFLAGS_orig
++
++gdb_reinitialize_dir $srcdir/$subdir
++
++# This is a test of gdb's ability to attach to a running process.
++
++do_attach_tests
++
++# Test attaching when the target is inside a system call
++
++gdb_exit
++set testpid [eval exec $binfile2 &]
++exec sleep 3
++if { [istarget "*-*-cygwin*"] } {
++    # testpid is the Cygwin PID, GDB uses the Windows PID, which might be
++    # different due to the way fork/exec works.
++    set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ]
++}
++
++set GDBFLAGS_orig $GDBFLAGS
++set GDBFLAGS "--pid=$testpid"
++gdb_start
++set GDBFLAGS $GDBFLAGS_orig
++
++gdb_reinitialize_dir $srcdir/$subdir
++do_call_attach_tests
++
++return 0
+Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32b.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/attach-32b.c    2011-03-20 20:15:57.000000000 +0100
+@@ -0,0 +1,24 @@
++/* This program is intended to be started outside of gdb, and then
++   attached to by gdb.  Thus, it simply spins in a loop.  The loop
++   is exited when & if the variable 'should_exit' is non-zero.  (It
++   is initialized to zero in this program, so the loop will never
++   exit unless/until gdb sets the variable to non-zero.)
++   */
++#include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
++
++int  should_exit = 0;
++
++int main ()
++{
++  int  local_i = 0;
++
++  sleep( 10 ); /* System call causes register fetch to fail */
++               /* This is a known HPUX "feature"            */
++  while (! should_exit)
++    {
++      local_i++;
++    }
++  return (0);
++}
diff --git a/gdb/patches/gdb-6.3-inheritancetest-20050726.patch b/gdb/patches/gdb-6.3-inheritancetest-20050726.patch
new file mode 100644 (file)
index 0000000..ab81976
--- /dev/null
@@ -0,0 +1,153 @@
+2005-07-26  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * gdb.cp/b146835.exp: New testcase.
+       * gdb.cp/b146835.cc: Ditto.
+       * gdb.cp/b146835b.cc: Ditto.
+       * gdb.cp/b146835.h: Ditto.
+
+Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835b.cc
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835b.cc       2009-08-12 06:07:50.000000000 +0200
+@@ -0,0 +1,11 @@
++#include "b146835.h"
++
++C::C() { d = 0; x = 3; }
++
++int C::z (char *s) { return 0; }
++
++C::~C() {}
++
++void A::funcD (class E *e, class D *d) {}
++void A::funcE (E *e, D *d) {}
++void A::funcF (unsigned long x, D *d) {}
+Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.cc
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.cc        2009-08-12 06:07:50.000000000 +0200
+@@ -0,0 +1,32 @@
++#include "b146835.h"
++#include <iostream>
++
++class F : public C {
++
++protected:
++
++   virtual void funcA (unsigned long a, B *b);
++   virtual void funcB (E *e);
++   virtual void funcC (unsigned long x, bool y);
++
++   char *s1, *s2;
++   bool b1;
++   int k;
++
++public:
++   void foo() {
++       std::cout << "foo" << std::endl;
++   }
++};
++
++
++void F::funcA (unsigned long a, B *b) {}
++void F::funcB (E *e) {}
++void F::funcC (unsigned long x, bool y) {}
++
++int  main()
++{
++   F f;
++   f.foo();
++}
++
+Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.exp       2009-08-12 06:58:28.000000000 +0200
+@@ -0,0 +1,47 @@
++# This testcase is part of GDB, the GNU debugger.
++
++# Copyright 2005 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# Check that GDB can properly print an inherited member variable
++# (Bugzilla 146835)
++
++set testfile "b146835"
++set srcfile ${testfile}.cc
++set srcfile2 ${testfile}b.cc
++set binfile ${objdir}/${subdir}/${testfile}
++if {[gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile2}" "${binfile}" executable {debug c++}] != "" } {
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++#
++# Run to `main' where we begin our tests.
++#
++
++if ![runto_main] then {
++    gdb_suppress_tests
++}
++
++gdb_test "break 'F::foo()'" ""
++gdb_continue_to_breakpoint "First line foo"
++
++# Verify that we can access the inherited member d
++gdb_test "p d" " = \\(D \\*\\) *0x0" "Verify inherited member d accessible"
+Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.h 2009-08-12 06:07:50.000000000 +0200
+@@ -0,0 +1,36 @@
++
++class A {
++
++protected:
++
++   virtual void funcA (unsigned long a, class B *b) = 0;
++   virtual void funcB (class E *e) = 0;
++   virtual void funcC (unsigned long x, bool y) = 0;
++
++   void funcD (class E *e, class D* d);
++   virtual void funcE (E *e, D *d);
++   virtual void funcF (unsigned long x, D *d);
++};
++
++
++class C : public A {
++
++protected:
++
++   int x;
++   class K *k;
++   class H *h;
++
++   D *d;
++
++   class W *w;
++   class N *n;
++   class L *l;
++   unsigned long *r;
++
++public:
++
++   C();
++   int z (char *s);
++   virtual ~C();
++};
diff --git a/gdb/patches/gdb-6.3-mapping-zero-inode-test.patch b/gdb/patches/gdb-6.3-mapping-zero-inode-test.patch
new file mode 100644 (file)
index 0000000..73d2446
--- /dev/null
@@ -0,0 +1,229 @@
+Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.exp        2009-06-29 16:24:36.000000000 +0200
+@@ -0,0 +1,96 @@
++# Copyright 2007, 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# Test GDB's handling of gcore for mapping with a name but zero inode.
++
++if { [prepare_for_testing gcore-shmid0.exp gcore-shmid0] } {
++    return -1
++}
++
++# Does this gdb support gcore?
++set test "help gcore"
++gdb_test_multiple $test $test {
++    -re "Undefined command: .gcore.*$gdb_prompt $" {
++      # gcore command not supported -- nothing to test here.
++      unsupported "gdb does not support gcore on this target"
++      return -1;
++    }
++    -re "Save a core file .*$gdb_prompt $" {
++      pass $test
++    }
++}
++
++if { ! [ runto_main ] } then {
++    untested gcore-shmid0.exp
++    return -1
++}
++
++gdb_breakpoint "initialized"
++gdb_breakpoint "unresolved"
++
++set test "Continue to initialized."
++gdb_test_multiple "continue" $test {
++    -re "Breakpoint .*, initialized .* at .*\r\n$gdb_prompt $" {
++      pass $test
++    }
++    -re "Breakpoint .*, unresolved .* at .*\r\n$gdb_prompt $" {
++      unsupported $test
++      return -1
++    }
++}
++
++set escapedfilename [string_to_regexp ${objdir}/${subdir}/gcore-shmid0.test]
++
++set test "save a corefile"
++gdb_test_multiple "gcore ${objdir}/${subdir}/gcore-shmid0.test" $test {
++    -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
++      pass $test
++    }
++    -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
++      unsupported $test
++    }
++}
++
++# Be sure to remove the handle first.
++# But it would get removed even on a kill by GDB as the handle is already
++# deleted, just it is still attached.
++gdb_continue_to_end "finish"
++
++set test "core-file command"
++gdb_test_multiple "core-file $objdir/$subdir/gcore-shmid0.test" $test {
++    -re ".* program is being debugged already.*y or n. $" {
++      # gdb_load may connect us to a gdbserver.
++      send_gdb "y\n"
++      exp_continue;
++    }
++    -re "Core was generated by .*\r\n\#0  .*\\\(\\\).*\r\n$gdb_prompt $" {
++      # The filename does not fit there anyway so do not check it.
++      pass $test
++    }
++    -re ".*registers from core file: File in wrong format.* $" {
++      fail "core-file command (could not read registers from core file)"
++    }
++}
++
++set test "backtrace"
++gdb_test_multiple "bt" $test {
++    -re "#0 *initialized \\\(\\\) at .*#1 .* main \\\(.*$gdb_prompt $" {
++      pass $test
++    }
++    -re "#0 *initialized \\\(\\\) at .*Cannot access memory at address .*$gdb_prompt $" {
++      fail $test
++    }
++}
+Index: gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20090302/gdb/testsuite/gdb.base/gcore-shmid0.c  2009-06-29 16:22:49.000000000 +0200
+@@ -0,0 +1,123 @@
++/* Copyright 2007, 2009 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or (at
++   your option) any later version.
++
++   This program is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++/*
++ * Test GDB's handling of gcore for mapping with a name but zero inode.
++ */
++
++#include <sys/ipc.h>
++#include <sys/shm.h>
++#include <stdio.h>
++#include <errno.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <assert.h>
++
++/* The same test running in a parallel testsuite may steal us the zero SID,
++   even if we never get any EEXIST.  Just try a while.  */
++
++#define TIMEOUT_SEC 10
++
++static void
++initialized (void)
++{
++}
++
++static void
++unresolved (void)
++{
++}
++
++int
++main (void)
++{
++  int sid;
++  unsigned int *addr = (void *) -1L;
++  int attempt, round = 0;
++  time_t ts_start, ts;
++
++  if (time (&ts_start) == (time_t) -1)
++    {
++      printf ("time (): %m\n");
++      exit (1);
++    }
++
++  /* The generated SID will cycle with an increment of 32768, attempt until it
++   * wraps to 0.  */
++
++  for (attempt = 0; addr == (void *) -1L; attempt++)
++    {
++      /* kernel-2.6.25-8.fc9.x86_64 just never returns the value 0 by
++       shmget(2).  shmget returns SID range 0..1<<31 in steps of 32768,
++       0x1000 should be enough but wrap the range it to be sure.  */
++
++      if (attempt > 0x21000)
++        {
++        if (time (&ts) == (time_t) -1)
++          {
++            printf ("time (): %m\n");
++            exit (1);
++          }
++
++        if (ts >= ts_start && ts < ts_start + TIMEOUT_SEC)
++          {
++            attempt = 0;
++            round++;
++            continue;
++          }
++
++        printf ("Problem is not reproducible on this kernel (attempt %d, "
++                "round %d))\n", attempt, round);
++        unresolved ();
++        exit (1);
++      }
++
++      sid = shmget ((key_t) rand (), 0x1000, IPC_CREAT | IPC_EXCL | 0777);
++      if (sid == -1)
++      {
++        if (errno == EEXIST)
++          continue;
++
++        printf ("shmget (%d, 0x1000, IPC_CREAT): errno %d\n", 0, errno);
++        exit (1);
++      }
++
++      /* Use SID only if it is 0, retry it otherwise.  */
++
++      if (sid == 0)
++      {
++        addr = shmat (sid, NULL, SHM_RND);
++        if (addr == (void *) -1L)
++          {
++            printf ("shmat (%d, NULL, SHM_RND): errno %d\n", sid,
++                    errno);
++            exit (1);
++          }
++      }
++      if (shmctl (sid, IPC_RMID, NULL) != 0)
++      {
++        printf ("shmctl (%d, IPC_RMID, NULL): errno %d\n", sid, errno);
++        exit (1);
++      }
++    }
++
++  initialized ();
++
++  return 0;
++}
diff --git a/gdb/patches/gdb-6.3-ppc64displaysymbol-20041124.patch b/gdb/patches/gdb-6.3-ppc64displaysymbol-20041124.patch
new file mode 100644 (file)
index 0000000..8e94e00
--- /dev/null
@@ -0,0 +1,24 @@
+2004-11-24  Andrew Cagney  <cagney@gnu.org>
+
+       * printcmd.c (build_address_symbolic): Find a section for the
+       address.
+
+Index: gdb-6.8.50.20081128/gdb/printcmd.c
+===================================================================
+--- gdb-6.8.50.20081128.orig/gdb/printcmd.c    2008-12-04 01:36:05.000000000 +0100
++++ gdb-6.8.50.20081128/gdb/printcmd.c 2008-12-04 01:37:18.000000000 +0100
+@@ -616,6 +616,14 @@ build_address_symbolic (CORE_ADDR addr, 
+         addr = overlay_mapped_address (addr, section);
+       }
+     }
++  /* To ensure that the symbol returned belongs to the correct setion
++     (and that the last [random] symbol from the previous section
++     isn't returned) try to find the section containing PC.  First try
++     the overlay code (which by default returns NULL); and second try
++     the normal section code (which almost always succeeds).  */
++  section = find_pc_overlay (addr);
++  if (section == NULL)
++    section = find_pc_section (addr);
+   /* First try to find the address in the symbol table, then
+      in the minsyms.  Take the closest one.  */
diff --git a/gdb/patches/gdb-6.3-ppc64syscall-20040622.patch b/gdb/patches/gdb-6.3-ppc64syscall-20040622.patch
new file mode 100644 (file)
index 0000000..a237cc1
--- /dev/null
@@ -0,0 +1,111 @@
+2004-06-22  Andrew Cagney  <cagney@gnu.org>
+
+       * rs6000-tdep.c (struct rs6000_framedata): Add field "func_start".
+       (skip_prologue): Delete local variable "orig_pc", use
+       "func_start".  Add local variable "num_skip_linux_syscall_insn",
+       use to skip over first half of a GNU/Linux syscall and update
+       "func_start".
+
+Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c
+===================================================================
+--- gdb-7.2.50.20110117.orig/gdb/rs6000-tdep.c 2011-01-11 20:23:02.000000000 +0100
++++ gdb-7.2.50.20110117/gdb/rs6000-tdep.c      2011-01-17 15:48:19.000000000 +0100
+@@ -126,6 +126,7 @@ static const char *powerpc_vector_abi_st
+ struct rs6000_framedata
+   {
++    CORE_ADDR func_start;     /* True function start.  */
+     int offset;                       /* total size of frame --- the distance
+                                  by which we decrement sp to allocate
+                                  the frame */
+@@ -1496,7 +1497,6 @@ static CORE_ADDR
+ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
+              struct rs6000_framedata *fdata)
+ {
+-  CORE_ADDR orig_pc = pc;
+   CORE_ADDR last_prologue_pc = pc;
+   CORE_ADDR li_found_pc = 0;
+   gdb_byte buf[4];
+@@ -1514,12 +1514,14 @@ skip_prologue (struct gdbarch *gdbarch, 
+   int minimal_toc_loaded = 0;
+   int prev_insn_was_prologue_insn = 1;
+   int num_skip_non_prologue_insns = 0;
++  int num_skip_ppc64_gnu_linux_syscall_insn = 0;
+   int r0_contains_arg = 0;
+   const struct bfd_arch_info *arch_info = gdbarch_bfd_arch_info (gdbarch);
+   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+   memset (fdata, 0, sizeof (struct rs6000_framedata));
++  fdata->func_start = pc;
+   fdata->saved_gpr = -1;
+   fdata->saved_fpr = -1;
+   fdata->saved_vr = -1;
+@@ -1553,6 +1555,55 @@ skip_prologue (struct gdbarch *gdbarch, 
+       break;
+       op = extract_unsigned_integer (buf, 4, byte_order);
++      /* A PPC64 GNU/Linux system call function is split into two
++       sub-functions: a non-threaded fast-path (__NAME_nocancel)
++       which does not use a frame; and a threaded slow-path
++       (Lpseudo_cancel) that does create a frame.  Ref:
++       nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
++
++       *INDENT-OFF*
++       NAME:
++              SINGLE_THREAD_P
++              bne- .Lpseudo_cancel
++       __NAME_nocancel:
++              li r0,162
++              sc
++              bnslr+
++              b 0x7fe014ef64 <.__syscall_error>
++       Lpseudo_cancel:
++              stdu r1,-128(r1)
++              ...
++       *INDENT-ON*
++
++       Unfortunatly, because the latter case uses a local label (not
++       in the symbol table) a PC in "Lpseudo_cancel" appears to be
++       in "__NAME_nocancel".  The following code recognizes this,
++       adjusting FUNC_START to point to where "Lpseudo_cancel"
++       should be, and parsing the prologue sequence as if
++       "Lpseudo_cancel" was the entry point.  */
++
++      if (((op & 0xffff0000) == 0x38000000 /* li r0,N */
++         && pc == fdata->func_start + 0
++         && num_skip_ppc64_gnu_linux_syscall_insn == 0)
++        || (op == 0x44000002 /* sc */
++            && pc == fdata->func_start + 4
++            && num_skip_ppc64_gnu_linux_syscall_insn == 1)
++        || (op == 0x4ca30020 /* bnslr+ */
++            && pc == fdata->func_start + 8
++            && num_skip_ppc64_gnu_linux_syscall_insn == 2))
++      {
++        num_skip_ppc64_gnu_linux_syscall_insn++;
++        continue;
++      }
++      else if ((op & 0xfc000003) == 0x48000000 /* b __syscall_error */
++             && pc == fdata->func_start + 12
++             && num_skip_ppc64_gnu_linux_syscall_insn == 3)
++      {
++        num_skip_ppc64_gnu_linux_syscall_insn = -1;
++        fdata->func_start = pc;
++        continue;
++      }
++
+       if ((op & 0xfc1fffff) == 0x7c0802a6)
+       {                       /* mflr Rx */
+         /* Since shared library / PIC code, which needs to get its
+@@ -1734,9 +1785,9 @@ skip_prologue (struct gdbarch *gdbarch, 
+            we have no line table information or the line info tells
+            us that the subroutine call is not part of the line
+            associated with the prologue.  */
+-        if ((pc - orig_pc) > 8)
++        if ((pc - fdata->func_start) > 8)
+           {
+-            struct symtab_and_line prologue_sal = find_pc_line (orig_pc, 0);
++            struct symtab_and_line prologue_sal = find_pc_line (fdata->func_start, 0);
+             struct symtab_and_line this_sal = find_pc_line (pc, 0);
+             if ((prologue_sal.line == 0)
diff --git a/gdb/patches/gdb-6.3-ppcdotsolib-20041022.patch b/gdb/patches/gdb-6.3-ppcdotsolib-20041022.patch
new file mode 100644 (file)
index 0000000..7226c0d
--- /dev/null
@@ -0,0 +1,31 @@
+2004-10-22  Andrew Cagney  <cagney@gnu.org>
+       * solib-svr4.c (enable_break): Convert a symbol descriptor into
+       the corresponding function entry point.
+       (solib_break_names): Delete "._dl_debug_state", no longer needed.
+
+2007-10-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Port to GDB-6.7.
+       
+Index: gdb-6.8.50.20090802/gdb/solib-svr4.c
+===================================================================
+--- gdb-6.8.50.20090802.orig/gdb/solib-svr4.c  2009-08-03 10:03:36.000000000 +0200
++++ gdb-6.8.50.20090802/gdb/solib-svr4.c       2009-08-03 10:51:15.000000000 +0200
+@@ -1431,7 +1431,15 @@ enable_break (struct svr4_info *info)
+       {
+         sym_addr = bfd_lookup_symbol (tmp_bfd, *bkpt_namep);
+         if (sym_addr != 0)
+-          break;
++          {
++            /* The symbol might be a descriptor, convert to into the
++               corresponding code address.  */
++            sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch,
++                                                           sym_addr,
++                                                           tmp_bfd_target);
++            if (sym_addr != 0)
++              break;
++          }
+       }
+       if (sym_addr != 0)
diff --git a/gdb/patches/gdb-6.3-readnever-20050907.patch b/gdb/patches/gdb-6.3-readnever-20050907.patch
new file mode 100644 (file)
index 0000000..f327051
--- /dev/null
@@ -0,0 +1,98 @@
+2004-11-18  Andrew Cagney  <cagney@gnu.org>
+
+        * dwarf2read.c: Include "top.c".
+        (dwarf2_has_info): Check for readnever_symbol_files.
+        * symfile.c (readnever_symbol_files): Define.
+        * top.h (readnever_symbol_files): Declare.
+        * main.c (captured_main): Add --readnever option.
+        (print_gdb_help): Ditto.
+
+2004-11-18  Andrew Cagney  <cagney@gnu.org>
+
+        * gdb.texinfo (File Options): Document --readnever.
+
+Index: gdb-7.3.50.20110722/gdb/doc/gdb.texinfo
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/doc/gdb.texinfo       2011-07-22 19:08:19.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/doc/gdb.texinfo    2011-07-22 19:15:13.000000000 +0200
+@@ -1005,6 +1005,12 @@ Read each symbol file's entire symbol ta
+ the default, which is to read it incrementally as it is needed.
+ This makes startup slower, but makes future operations faster.
++@item --readnever
++@cindex @code{--readnever}
++Do not read each symbol file's symbolic debug information.  This makes
++startup faster but at the expense of not being able to perform
++symbolic debugging.
++
+ @end table
+ @node Mode Options
+Index: gdb-7.3.50.20110722/gdb/main.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/main.c        2011-07-22 19:14:25.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/main.c     2011-07-22 19:15:13.000000000 +0200
+@@ -399,6 +399,7 @@ captured_main (void *data)
+       {"xdb", no_argument, &xdb_commands, 1},
+       {"dbx", no_argument, &dbx_commands, 1},
+       {"readnow", no_argument, &readnow_symbol_files, 1},
++      {"readnever", no_argument, &readnever_symbol_files, 1},
+       {"r", no_argument, &readnow_symbol_files, 1},
+       {"quiet", no_argument, &quiet, 1},
+       {"q", no_argument, &quiet, 1},
+@@ -1065,6 +1066,7 @@ Options:\n\n\
+   fputs_unfiltered (_("\
+   --quiet            Do not print version number on startup.\n\
+   --readnow          Fully read symbol files on first access.\n\
++  --readnever        Do not read symbol files.\n\
+ "), stream);
+   fputs_unfiltered (_("\
+   --se=FILE          Use FILE as symbol file and executable file.\n\
+Index: gdb-7.3.50.20110722/gdb/symfile.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/symfile.c     2011-05-11 06:56:07.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/symfile.c  2011-07-22 19:15:13.000000000 +0200
+@@ -81,6 +81,7 @@ static void clear_symtab_users_cleanup (
+ /* Global variables owned by this file.  */
+ int readnow_symbol_files;     /* Read full symbols immediately.  */
++int readnever_symbol_files;   /* Never read full symbols.  */
+ /* External variables and functions referenced.  */
+Index: gdb-7.3.50.20110722/gdb/dwarf2read.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/dwarf2read.c  2011-07-22 19:08:19.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/dwarf2read.c       2011-07-22 19:15:41.000000000 +0200
+@@ -58,6 +58,7 @@
+ #include "c-lang.h"
+ #include "valprint.h"
+ #include <ctype.h>
++#include "top.h"
+ #include <fcntl.h>
+ #include "gdb_string.h"
+@@ -1388,8 +1389,9 @@ dwarf2_has_info (struct objfile *objfile
+                              (void *) names);
+       dwarf2_per_objfile->objfile = objfile;
+     }
+-  return (dwarf2_per_objfile->info.asection != NULL
+-        && dwarf2_per_objfile->abbrev.asection != NULL);
++  return (! readnever_symbol_files
++        && (dwarf2_per_objfile->info.asection != NULL
++            && dwarf2_per_objfile->abbrev.asection != NULL));
+ }
+ /* When loading sections, we look either for uncompressed section or for
+Index: gdb-7.3.50.20110722/gdb/top.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/top.h 2011-07-21 13:03:45.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/top.h      2011-07-22 19:15:13.000000000 +0200
+@@ -59,6 +59,7 @@ extern void set_prompt (const char *);
+ /* From random places.  */
+ extern int readnow_symbol_files;
++extern int readnever_symbol_files;
+ /* Perform _initialize initialization.  */
+ extern void gdb_init (char *);
diff --git a/gdb/patches/gdb-6.3-rh-dummykfail-20041202.patch b/gdb/patches/gdb-6.3-rh-dummykfail-20041202.patch
new file mode 100644 (file)
index 0000000..1f0bc9d
--- /dev/null
@@ -0,0 +1,22 @@
+2003-07-11  Elena Zannoni  <ezannoni@redhat.com>
+
+        * lib/gdb.exp (setup_kfail, kfail): Redefine procedures.
+                                                                               
+--- ./gdb/testsuite/lib/gdb.exp.1      2004-11-24 15:59:46.131394720 -0500
++++ ./gdb/testsuite/lib/gdb.exp        2004-11-24 16:01:06.304206600 -0500
+@@ -63,6 +63,15 @@
+ ### Only procedures should come after this point.
++if {![llength [info procs kfail]]} {
++    proc setup_kfail { args } {
++      #setup_xfail args
++    }
++    proc kfail { bugid message } {
++      fail $message
++    }
++}
++
+ #
+ # gdb_version -- extract and print the version number of GDB
+ #
diff --git a/gdb/patches/gdb-6.3-rh-testlibunwind-20041202.patch b/gdb/patches/gdb-6.3-rh-testlibunwind-20041202.patch
new file mode 100644 (file)
index 0000000..0a121c3
--- /dev/null
@@ -0,0 +1,103 @@
+2003-11-17  Elena Zannoni  <ezannoni@redhat.com>
+   
+        From Jeff Johnston <jjohnstn@redhat.com>
+        * gdb.arch/ia64-libunwind.exp: New file.
+        * gdb.arch/ia64-libunwind.c: New file.
+
+2004-08-03  Jeff Johnston  <jjohnstn@redhat.com>
+   
+        * gdb.arch/ia64-libunwind.exp: Fix test string to match
+       current code base.
+
+       [ acquire_unwind_info -> ia64_find_proc_info_x ]
+
+2009-04-30  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Remove a race from send_gdb "COMMAND\n".
+       Cleanup.
+       Merge in: Patch4: gdb-6.3-rh-testlibunwind1fix-20041202.patch
+--- /dev/null  2009-04-19 08:52:54.499000000 +0200
++++ gdb-6.8/gdb/testsuite/gdb.arch/ia64-libunwind.c    2009-04-30 19:15:16.000000000 +0200
+@@ -0,0 +1,26 @@
++/* Copyright 2003, 2009 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#include <stdio.h>
++
++int
++main ()
++{
++  printf ("hello world\n");
++ 
++  return 0;
++}
+--- /dev/null  2009-04-19 08:52:54.499000000 +0200
++++ gdb-6.8/gdb/testsuite/gdb.arch/ia64-libunwind.exp  2009-04-30 19:19:22.000000000 +0200
+@@ -0,0 +1,52 @@
++# Copyright 2003, 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# Please email any bugs, comments, and/or additions to this file to:
++# bug-gdb@prep.ai.mit.edu
++
++# This file was written by Jeff Johnston (jjohnstn@redhat.com)
++
++if ![istarget "ia64-*-*"] then {
++    return
++}
++
++set testfile "ia64-libunwind"
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
++    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
++}
++
++if [get_compiler_info ${binfile}] {
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++gdb_test "set debug arch 1"
++gdb_breakpoint "main"
++gdb_run_cmd
++
++set test "libunwind message"
++gdb_test_multiple "" $test {
++    -re "ia64_find_proc_info_x.*$gdb_prompt $" {
++      pass $test
++    }
++}
diff --git a/gdb/patches/gdb-6.3-rh-testversion-20041202.patch b/gdb/patches/gdb-6.3-rh-testversion-20041202.patch
new file mode 100644 (file)
index 0000000..7839200
--- /dev/null
@@ -0,0 +1,19 @@
+2003-02-24  Elena Zannoni  <ezannoni@redhat.com>
+
+        * gdb.gdb/selftest.exp: Add matching on specific Red Hat only version
+        string.
+
+Index: gdb-7.1.90.20100711/gdb/testsuite/gdb.gdb/selftest.exp
+===================================================================
+--- gdb-7.1.90.20100711.orig/gdb/testsuite/gdb.gdb/selftest.exp        2010-06-26 08:44:47.000000000 +0200
++++ gdb-7.1.90.20100711/gdb/testsuite/gdb.gdb/selftest.exp     2010-07-12 09:59:42.000000000 +0200
+@@ -342,6 +342,9 @@ proc test_with_self { executable } {
+       -re ".\[0-9\]+ = +.+ +0x.*\[0-9.\]+.*$gdb_prompt $" {
+           pass "printed version with cast"
+       }
++      -re ".\[0-9\]+ = .(Fedora|Red Hat Enterprise Linux) \[\\(\\)0-9.a-z\\-\]+.*$gdb_prompt $" {
++          pass "printed version Fedora or Red Hat Enterprise Linux only"
++      }
+     }
+     do_steps_and_nexts
diff --git a/gdb/patches/gdb-6.3-security-errata-20050610.patch b/gdb/patches/gdb-6.3-security-errata-20050610.patch
new file mode 100644 (file)
index 0000000..3763332
--- /dev/null
@@ -0,0 +1,243 @@
+http://sourceware.org/ml/gdb-patches/2005-05/threads.html#00637
+Proposed upstream but never committed upstream.
+
+2005-06-09  Jeff Johnston  <jjohnstn@redhat.com>
+
+        * gdb.base/gdbinit.exp: New testcase.
+        * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp.
+
+2005-06-08  Daniel Jacobowitz  <dan@codesourcery.com>
+            Jeff Johnston  <jjohnstn@redhat.com>
+
+        * Makefile.in (cli-cmds.o): Update.
+        * configure.in: Add check for getuid.
+        * configure: Regenerated.
+        * config.in: Ditto.
+        * main.c (captured_main): Pass -1 to source_command when loading
+        gdbinit files.
+        * cli/cli-cmds.c: Include "gdb_stat.h" and <fcntl.h>.
+        (source_command): Update documentation.  Check permissions if
+        FROM_TTY is -1.
+
+Index: gdb-7.3.50.20110722/gdb/cli/cli-cmds.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/cli/cli-cmds.c        2011-06-07 19:26:46.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/cli/cli-cmds.c     2011-07-22 19:14:25.000000000 +0200
+@@ -39,6 +39,7 @@
+ #include "source.h"
+ #include "disasm.h"
+ #include "tracepoint.h"
++#include "gdb_stat.h"
+ #include "ui-out.h"
+@@ -489,7 +490,7 @@ show_script_ext_mode (struct ui_file *fi
+ int
+ find_and_open_script (const char *script_file, int search_path,
+-                    FILE **streamp, char **full_pathp)
++                    FILE **streamp, char **full_pathp, int from_tty)
+ {
+   char *file;
+   int fd;
+@@ -515,6 +516,32 @@ find_and_open_script (const char *script
+       return 0;
+     }
++#ifdef HAVE_GETUID
++  if (from_tty == -1)
++    {
++      struct stat statbuf;
++
++      if (fstat (fd, &statbuf) < 0)
++      {
++        int save_errno = errno;
++
++        close (fd);
++        do_cleanups (old_cleanups);
++        errno = save_errno;
++        return 0;
++      }
++      if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH))
++      {
++        /* FILE gets freed by do_cleanups (old_cleanups).  */
++        warning (_("not using untrusted file \"%s\""), file);
++        close (fd);
++        do_cleanups (old_cleanups);
++        errno = EPERM;
++        return 0;
++      }
++    }
++#endif
++
+   do_cleanups (old_cleanups);
+   *streamp = fdopen (fd, FOPEN_RT);
+@@ -574,13 +601,14 @@ source_script_with_search (const char *f
+   if (file == NULL || *file == 0)
+     error (_("source command requires file name of file to source."));
+-  if (!find_and_open_script (file, search_path, &stream, &full_path))
++  if (!find_and_open_script (file, search_path, &stream, &full_path,
++                           from_tty))
+     {
+       /* The script wasn't found, or was otherwise inaccessible.  
+          If the source command was invoked interactively, throw an
+        error.  Otherwise (e.g. if it was invoked by a script),
+        silently ignore the error.  */
+-      if (from_tty)
++      if (from_tty > 0)
+       perror_with_name (file);
+       else
+       return;
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.base/gdbinit.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.base/gdbinit.exp     2011-07-22 19:14:25.000000000 +0200
+@@ -0,0 +1,91 @@
++#   Copyright 2005
++#   Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++# Please email any bugs, comments, and/or additions to this file to:
++# bug-gdb@prep.ai.mit.edu
++
++# This file was written by Jeff Johnston <jjohnstn@redhat.com>.
++
++# are we on a target board
++if [is_remote target] {
++    return
++}
++
++
++global verbose
++global GDB
++global GDBFLAGS
++global gdb_prompt
++global timeout
++global gdb_spawn_id;
++
++gdb_stop_suppressing_tests;
++
++verbose "Spawning $GDB -nw"
++
++if [info exists gdb_spawn_id] {
++    return 0;
++}
++
++if ![is_remote host] {
++   if { [which $GDB] == 0 } then {
++        perror "$GDB does not exist."
++        exit 1
++    }
++}
++
++set env(HOME) [pwd]
++remote_exec build "rm .gdbinit"
++remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit"
++remote_exec build "chmod 646 .gdbinit"
++
++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
++if { $res < 0 || $res == "" } {
++    perror "Spawning $GDB failed."
++    return 1;
++}
++gdb_expect 360 {
++    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
++        pass "untrusted .gdbinit caught."
++    }
++    -re "$gdb_prompt $"     {
++        fail "untrusted .gdbinit caught."
++    }
++    timeout {
++        fail "(timeout) untrusted .gdbinit caught."
++    }
++}
++
++remote_exec build "chmod 644 .gdbinit"
++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
++if { $res < 0 || $res == "" } {
++    perror "Spawning $GDB failed."
++    return 1;
++}
++gdb_expect 360 {
++    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
++        fail "trusted .gdbinit allowed."
++    }
++    -re "in gdbinit.*$gdb_prompt $"     {
++        pass "trusted .gdbinit allowed."
++    }
++    timeout {
++        fail "(timeout) trusted .gdbinit allowed."
++    }
++}
++
++remote_exec build "rm .gdbinit"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.base/gdbinit.sample
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.base/gdbinit.sample  2011-07-22 19:14:25.000000000 +0200
+@@ -0,0 +1 @@
++echo "\nin gdbinit"
+Index: gdb-7.3.50.20110722/gdb/main.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/main.c        2011-07-22 19:08:19.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/main.c     2011-07-22 19:14:25.000000000 +0200
+@@ -849,7 +849,7 @@ captured_main (void *data)
+      debugging or what directory you are in.  */
+   if (home_gdbinit && !inhibit_gdbinit)
+-    catch_command_errors (source_script, home_gdbinit, 0, RETURN_MASK_ALL);
++    catch_command_errors (source_script, home_gdbinit, -1, RETURN_MASK_ALL);
+   /* Now perform all the actions indicated by the arguments.  */
+   if (cdarg != NULL)
+@@ -928,7 +928,7 @@ captured_main (void *data)
+   /* Read the .gdbinit file in the current directory, *if* it isn't
+      the same as the $HOME/.gdbinit file (it should exist, also).  */
+   if (local_gdbinit && !inhibit_gdbinit)
+-    catch_command_errors (source_script, local_gdbinit, 0, RETURN_MASK_ALL);
++    catch_command_errors (source_script, local_gdbinit, -1, RETURN_MASK_ALL);
+   /* Now that all .gdbinit's have been read and all -d options have been
+      processed, we can read any scripts mentioned in SYMARG.
+Index: gdb-7.3.50.20110722/gdb/python/py-auto-load.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/python/py-auto-load.c 2011-05-16 18:33:57.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/python/py-auto-load.c      2011-07-22 19:14:54.000000000 +0200
+@@ -284,7 +284,7 @@ source_section_scripts (struct objfile *
+       }
+       opened = find_and_open_script (file, 1 /*search_path*/,
+-                                   &stream, &full_path);
++                                   &stream, &full_path, 1 /* from_tty */);
+       /* If one script isn't found it's not uncommon for more to not be
+        found either.  We don't want to print an error message for each
+Index: gdb-7.3.50.20110722/gdb/cli/cli-cmds.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/cli/cli-cmds.h        2011-01-01 16:33:20.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/cli/cli-cmds.h     2011-07-22 19:14:25.000000000 +0200
+@@ -127,7 +127,8 @@ extern void source_script (char *, int);
+ /* Exported to objfiles.c.  */
+ extern int find_and_open_script (const char *file, int search_path,
+-                               FILE **streamp, char **full_path);
++                               FILE **streamp, char **full_path,
++                               int from_tty);
+ /* Command tracing state.  */
diff --git a/gdb/patches/gdb-6.3-step-thread-exit-20050211-test.patch b/gdb/patches/gdb-6.3-step-thread-exit-20050211-test.patch
new file mode 100644 (file)
index 0000000..11c2a44
--- /dev/null
@@ -0,0 +1,188 @@
+2005-02-11  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * testsuite/gdb.threads/step-thread-exit.c: New testcase.
+       * testsuite/gdb.threads/step-thread-exit.exp: Ditto.
+       
+Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/step-thread-exit.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/step-thread-exit.c   2008-12-08 22:21:26.000000000 +0100
+@@ -0,0 +1,50 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2005 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <pthread.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
++
++void *thread_function (void *ptr)
++{
++  int *x = (int *)ptr;
++  printf("In thread_function, *x is %d\n", *x);
++} /* thread_function_end */
++
++volatile int repeat = 0;
++
++main()
++{
++  int ret;
++  pthread_t th;
++  int i = 3;
++
++  ret = pthread_create (&th, NULL, thread_function, &i);
++  do
++    {
++      repeat = 0;
++      sleep (3);  /* sleep */
++    }
++  while (repeat);
++  pthread_join (th, NULL);
++  return 0;
++}
++
++
+Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/step-thread-exit.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/step-thread-exit.exp 2008-12-08 22:22:14.000000000 +0100
+@@ -0,0 +1,123 @@
++# This testcase is part of GDB, the GNU debugger.
++
++# Copyright 2005 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# Check that GDB can step over a thread exit.
++
++set testfile "step-thread-exit"
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++# Reset the debug file directory so we can't debug within the C library
++gdb_test "set debug-file-directory ." "" ""
++
++#
++# Run to `main' where we begin our tests.
++#
++
++if ![runto_main] then {
++    gdb_suppress_tests
++}
++
++# FIXME: Currently the main thread will escape/exit before our thread finishes
++# without this setting.
++gdb_test "set scheduler-locking step"
++gdb_test "show scheduler-locking" "Mode for locking scheduler during execution is \"step\"." "check scheduler-locking first"
++
++set sleep_line [expr [gdb_get_line_number "sleep"]]
++set end_line [expr [gdb_get_line_number "thread_function_end"]]
++
++gdb_breakpoint "$end_line"
++gdb_test "continue" "Break.*thread_function.*" "continue to thread_function 1"
++
++# Keep nexting until we cause the thread to exit.  We expect the main
++# thread to be stopped and a message printed to tell us we have stepped
++# over the thread exit.
++set test "step over thread exit 1"
++gdb_test_multiple "next" "$test" {
++  -re "\}.*$gdb_prompt $" {
++     send_gdb "next\n"
++     exp_continue
++  }
++  -re "\[Thread .* exited\].*Program received signal SIGSTOP.*$gdb_prompt $" {
++     pass "$test"
++  }
++  -re "start_thread.*$gdb_prompt $" {
++     send_gdb "next\n"
++     exp_continue
++  }
++}
++
++# Without this fixup we could end up in:
++# #0  0x00110416 in __kernel_vsyscall ()
++# #1  0x0011de26 in __lll_unlock_wake_private () from /lib/libpthread.so.0
++# #2  0x001179f4 in _L_unlock_3164 () from /lib/libpthread.so.0
++# #3  0x00116f01 in pthread_create@@GLIBC_2.1 () from /lib/libpthread.so.0
++# #4  0x08048531 in main () at ../.././gdb/testsuite/gdb.threads/step-thread-exit.c:39
++gdb_breakpoint "$sleep_line"
++gdb_test "set repeat=1" "" "Get to the sleep function prepare 1"
++gdb_test "continue" "Break.*$sleep_line.*" "Get to the sleep function 1"
++
++gdb_test "bt" "main.*$sleep_line.*" "backtrace after step 1"
++
++runto_main
++gdb_test "show scheduler-locking" "Mode for locking scheduler during execution is \"step\"." "check scheduler-locking second"
++
++gdb_breakpoint "$sleep_line"
++gdb_breakpoint "$end_line"
++set test "continue to thread_function 2"
++gdb_test_multiple "continue" "$test" {
++    -re "Break.*thread_function.*$gdb_prompt $" {
++      pass $test
++    }
++    -re "Break.*$sleep_line.*$gdb_prompt $" {
++      gdb_test "set repeat=1" "" ""
++      send_gdb "continue\n"
++      exp_continue
++    }
++}
++
++# Keep nexting until we cause the thread to exit.  In this case, we
++# expect the breakpoint in the main thread to have already triggered
++# and so we should stop there with a message that we stepped over
++# the thread exit.
++set test "step over thread exit 2"
++gdb_test_multiple "next" "$test" {
++  -re "\}.*$gdb_prompt $" {
++     send_gdb "next\n"
++     exp_continue
++  }
++  -re "\[Thread .* exited\].*Break.*$sleep_line.*$gdb_prompt $" {
++     pass "$test (breakpoint hit)"
++  }
++  -re "\[Thread .* exited\].*$gdb_prompt $" {
++     pass "$test (breakpoint not hit)"
++  }
++  -re "start_thread.*$gdb_prompt $" {
++     send_gdb "next\n"
++     exp_continue
++  }
++}
++
diff --git a/gdb/patches/gdb-6.3-test-dtorfix-20050121.patch b/gdb/patches/gdb-6.3-test-dtorfix-20050121.patch
new file mode 100644 (file)
index 0000000..51308bc
--- /dev/null
@@ -0,0 +1,262 @@
+Index: gdb/testsuite/ChangeLog
+2005-01-21  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * gdb.cp/constructortest.exp: New test.
+       * gdb.cp/constructortest.cc: Ditto.
+       * gdb.cp/templates.exp: Change break of dtor to be fully quoted.
+
+2007-09-22  Jan Kratochvil <jan.kratochvil@redhat.com>
+
+       * gdb.cp/constructortest.exp, gdb.cp/constructortest.cc: Test also the
+       `$delete' destructor variant.
+
+2007-09-25  Jan Kratochvil <jan.kratochvil@redhat.com>
+
+       * gdb.cp/constructortest.exp: Delete the FIXME workaround of restarting
+       the whole GDB.
+
+2007-10-05  Jan Kratochvil <jan.kratochvil@redhat.com>
+
+       * gdb.cp/constructortest.exp: Test BREAKPOINT_RE_SET for multiple PCs
+       by PIE.
+       * gdb.cp/constructortest.exp: Handle the change of settings breakpoints
+       always at all the ctor/dtor variants.
+
+[ Removed the `gdb.cp/templates.exp' patch.  ]
+[ Updated the patch for "(X location") of GDB-6.8+.  ]
+
+--- gdb-6.3/gdb/testsuite/gdb.cp/constructortest.cc.fix        Fri Jan 21 17:06:56 2005
++++ gdb-6.3/gdb/testsuite/gdb.cp/constructortest.cc    Fri Jan 21 17:05:18 2005
+@@ -0,0 +1,99 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2005 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++class A
++{
++  public:
++    A();
++    ~A();
++    int  k;
++  private:
++    int  x;
++};
++
++class B: public A
++{
++  public:
++    B();
++  private:
++    int  y;
++};
++
++/* C and D are for the $delete destructor.  */
++
++class C
++{
++  public:
++    C();
++    virtual ~C();
++  private:
++    int  x;
++};
++
++class D: public C
++{
++  public:
++    D();
++  private:
++    int  y;
++};
++
++int main(int argc, char *argv[])
++{
++  A* a = new A;
++  B* b = new B;
++  D* d = new D;
++  delete a;
++  delete b;
++  delete d;
++  return 0;
++}
++
++A::A() /* Constructor A */
++{
++   x = 1; /* First line A */
++   k = 4; /* Second line A */
++}
++
++A::~A() /* Destructor A */
++{
++   x = 3; /* First line ~A */
++   k = 6; /* Second line ~A */
++}
++
++B::B()
++{
++   y = 2; /* First line B */
++   k = 5;
++}
++
++C::C() /* Constructor C */
++{
++   x = 1; /* First line C */
++}
++
++C::~C() /* Destructor C */
++{
++   x = 3; /* First line ~C */
++}
++
++D::D()
++{
++   y = 2; /* First line D */
++}
+--- gdb-6.3/gdb/testsuite/gdb.cp/constructortest.exp.fix       Fri Jan 21 17:07:02 2005
++++ gdb-6.3/gdb/testsuite/gdb.cp/constructortest.exp   Fri Jan 21 17:05:29 2005
+@@ -0,0 +1,130 @@
++# This testcase is part of GDB, the GNU debugger.
++
++# Copyright 2005, 2007 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# Check that GDB can break at multiple forms of constructors.
++
++set testfile "constructortest"
++set srcfile ${testfile}.cc
++set binfile ${objdir}/${subdir}/${testfile}
++# PIE is required for testing proper BREAKPOINT_RE_SET of the multiple-PC
++# breakpoints.
++if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++ "additional_flags=-fpie -pie"}] != "" } {
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++#
++# Run to `main' where we begin our tests.
++#
++
++if ![runto_main] then {
++    gdb_suppress_tests
++}
++
++# Break on the various forms of the A::A constructor.
++# " (2 locations)" is displayed depending on G++ version.
++gdb_test "break A\:\:A" "Breakpoint 2 at .*" "breaking on A::A"
++        
++# Verify that we break for the A constructor two times
++# Once for new A and once for new B
++gdb_continue_to_breakpoint "First line A"
++gdb_test "bt" "#0.*A.*#1.*main.*" "Verify in in-charge A::A"
++gdb_continue_to_breakpoint "First line A"
++gdb_test "bt" "#0.*A.*#1.*B.*#2.*main.*" "Verify in not-in-charge A::A"
++
++# Now do the same for destructors
++gdb_test "break 'A::~A()'" ""
++
++# Verify that we break for the A destructor two times
++# Once for delete a and once for delete b
++gdb_continue_to_breakpoint "First line ~A"
++gdb_test "bt" "#0.*~A.*#1.*main.*" "Verify in in-charge A::~A"
++gdb_continue_to_breakpoint "First line ~A"
++gdb_test "bt" "#0.*~A.*#1.*~B.*#2.*main.*" "Verify in not-in-charge A::~A"
++
++
++# Verify that we can break by line number in a constructor and find
++# both occurrences
++runto_main
++gdb_test "break 'A::A()'" "" "break in constructor A 2"
++gdb_continue_to_breakpoint "First line A"
++set second_line [gdb_get_line_number "Second line A"]
++# " (2 locations)" is displayed depending on G++ version.
++gdb_test "break $second_line" "Breakpoint .*, line $second_line\\..*" "break by line in constructor"
++gdb_continue_to_breakpoint "Second line A"
++gdb_test "bt" "#0.*A.*#1.*main.*" "Verify in in-charge A::A second line"
++gdb_continue_to_breakpoint "Second line A"
++gdb_test "bt" "#0.*A.*#1.*B.*#2.*main.*" "Verify in not-in-charge A::A second line"
++
++# Verify that we can break by line number in a destructor and find
++# both occurrences
++gdb_test "break 'A::~A()'" "" "break in constructor ~A 2"
++gdb_continue_to_breakpoint "First line ~A"
++set second_line_dtor [gdb_get_line_number "Second line ~A"]
++# " (2 locations)" is displayed depending on G++ version.
++gdb_test "break $second_line_dtor" "Breakpoint .*, line $second_line_dtor\\..*" "break by line in destructor"
++gdb_continue_to_breakpoint "Second line ~A"
++gdb_test "bt" "#0.*A.*#1.*main.*" "Verify in in-charge A::~A second line"
++# FIXME: Analyse this case better.
++gdb_continue_to_breakpoint "Second line ~A"
++gdb_test "bt" "#0.*A.*#1.*main.*" "Verify in A::~A second line #2"
++gdb_continue_to_breakpoint "Second line ~A"
++gdb_test "bt" "#0.*A.*#1.*B.*#2.*main.*" "Verify in not-in-charge A::~A second line"
++
++
++# Test now the $delete destructors.
++
++gdb_load ${binfile}
++runto_main
++
++set first_line_dtor [gdb_get_line_number "First line ~C"]
++set define_line_dtor [gdb_get_line_number "Destructor C"]
++# Break on the various forms of the C::~C destructor
++# " ([23] locations)" is displayed depending on G++ version.
++gdb_test "break C\:\:~C" "Breakpoint .*, line ($define_line_dtor|$define_line_dtor)\\..*" "breaking on C::~C"
++gdb_continue_to_breakpoint "First line ~C"
++
++# Verify that we can break by line number in a destructor and find
++# the $delete occurence
++
++gdb_load ${binfile}
++delete_breakpoints
++
++# " (3 locations)" is displayed depending on G++ version.
++gdb_test "break $first_line_dtor" "Breakpoint .*, line $first_line_dtor\\..*" "break by line in destructor"
++
++# Run to `main' where we begin our tests.
++# Set the breakpoints first to test PIE multiple-PC BREAKPOINT_RE_SET.
++# RUNTO_MAIN or RUNTO MAIN are not usable here as it runs DELETE_BREAKPOINTS.
++
++if ![gdb_breakpoint main] {
++    gdb_suppress_tests
++}
++gdb_run_cmd
++set test "running to main"
++gdb_test_multiple "" $test {
++    -re "Breakpoint \[0-9\]*, main .*$gdb_prompt $" {
++      pass $test
++    }
++}
++
++gdb_continue_to_breakpoint "First line ~C"
diff --git a/gdb/patches/gdb-6.3-test-movedir-20050125.patch b/gdb/patches/gdb-6.3-test-movedir-20050125.patch
new file mode 100644 (file)
index 0000000..4b05c13
--- /dev/null
@@ -0,0 +1,95 @@
+2005-01-25  Elena Zannoni  <ezannoni@redhat.com>
+
+        * gdb.base/move-dir.exp: New test.
+        * gdb.base/move-dir.c: Ditto.
+        * gdb.base/move-dir.h: Ditto.
+
+Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.c      2008-12-07 23:57:41.000000000 +0100
+@@ -0,0 +1,10 @@
++#include <stdio.h>
++#include <stdlib.h>
++#include "move-dir.h"
++
++int main() {
++   const char* hw = "hello world.";
++   printf ("%s\n", hw);;
++   other();
++}
++
+Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.exp    2008-12-07 10:13:01.000000000 +0100
+@@ -0,0 +1,57 @@
++#   Copyright 2005
++#   Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++set testfile "move-dir"
++set srcfile ${testfile}.c
++set incfile ${testfile}.h
++set binfile ${objdir}/${subdir}/${testfile}
++
++set testdir "${objdir}/${subdir}/incdir"
++
++remote_exec build "mkdir $testdir"
++remote_exec build "cp ${srcdir}/${subdir}/${srcfile} ${objdir}/${subdir}"
++remote_exec build "cp ${srcdir}/${subdir}/${incfile} ${testdir}"
++
++set additional_flags "additional_flags=-I${subdir}/incdir"
++
++if  { [gdb_compile "${objdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
++    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
++}
++
++# Create and source the file that provides information about the compiler
++# used to compile the test case.
++
++if [get_compiler_info ${binfile}] {
++    return -1;
++}
++
++
++set oldtimeout $timeout
++set timeout [expr "$timeout + 60"]
++
++# Start with a fresh gdb.
++
++gdb_exit
++gdb_start
++gdb_test "cd ../.." "" ""
++gdb_load ${binfile}
++gdb_test "list main" ".*hw.*other.*" "found main"
++gdb_test "list other" ".*ostring.*" "found include file"
++
++
++set timeout $oldtimeout
++return 0
+Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.h      2008-12-07 10:13:01.000000000 +0100
+@@ -0,0 +1,7 @@
++#include <stdlib.h>
++
++void other() {
++  const char* ostring = "other";
++  printf ("%s\n", ostring);;
++}
++
diff --git a/gdb/patches/gdb-6.3-test-pie-20050107.patch b/gdb/patches/gdb-6.3-test-pie-20050107.patch
new file mode 100644 (file)
index 0000000..0b4a2db
--- /dev/null
@@ -0,0 +1,2089 @@
+Index: gdb-7.2.50.20110320/gdb/testsuite/configure.ac
+===================================================================
+--- gdb-7.2.50.20110320.orig/gdb/testsuite/configure.ac        2011-03-03 17:57:55.000000000 +0100
++++ gdb-7.2.50.20110320/gdb/testsuite/configure.ac     2011-03-20 20:21:43.000000000 +0100
+@@ -97,6 +97,6 @@ AC_OUTPUT([Makefile \
+   gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile \
+   gdb.hp/gdb.defects/Makefile \
+   gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile \
+-  gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile \
++  gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile \
+   gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile \
+   gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile])
+Index: gdb-7.2.50.20110320/gdb/testsuite/configure
+===================================================================
+--- gdb-7.2.50.20110320.orig/gdb/testsuite/configure   2011-03-03 17:57:55.000000000 +0100
++++ gdb-7.2.50.20110320/gdb/testsuite/configure        2011-03-20 20:21:43.000000000 +0100
+@@ -3448,7 +3448,7 @@ done
+-ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cell/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
++ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cell/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
+ cat >confcache <<\_ACEOF
+ # This file is a shell script that caches the results of configure
+@@ -4173,6 +4173,7 @@ do
+     "gdb.opencl/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opencl/Makefile" ;;
+     "gdb.opt/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opt/Makefile" ;;
+     "gdb.pascal/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pascal/Makefile" ;;
++    "gdb.pie/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pie/Makefile" ;;
+     "gdb.python/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.python/Makefile" ;;
+     "gdb.reverse/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.reverse/Makefile" ;;
+     "gdb.stabs/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.stabs/Makefile" ;;
+Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/attach.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/attach.c 2011-03-20 20:21:43.000000000 +0100
+@@ -0,0 +1,20 @@
++/* This program is intended to be started outside of gdb, and then
++   attached to by gdb.  Thus, it simply spins in a loop.  The loop
++   is exited when & if the variable 'should_exit' is non-zero.  (It
++   is initialized to zero in this program, so the loop will never
++   exit unless/until gdb sets the variable to non-zero.)
++   */
++#include <stdio.h>
++
++int  should_exit = 0;
++
++int main ()
++{
++  int  local_i = 0;
++
++  while (! should_exit)
++    {
++      local_i++;
++    }
++  return 0;
++}
+Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/attach2.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/attach2.c        2011-03-20 20:21:43.000000000 +0100
+@@ -0,0 +1,24 @@
++/* This program is intended to be started outside of gdb, and then
++   attached to by gdb.  Thus, it simply spins in a loop.  The loop
++   is exited when & if the variable 'should_exit' is non-zero.  (It
++   is initialized to zero in this program, so the loop will never
++   exit unless/until gdb sets the variable to non-zero.)
++   */
++#include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
++
++int  should_exit = 0;
++
++int main ()
++{
++  int  local_i = 0;
++
++  sleep( 10 ); /* System call causes register fetch to fail */
++               /* This is a known HPUX "feature"            */
++  while (! should_exit)
++    {
++      local_i++;
++    }
++  return (0);
++}
+Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/break.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/break.c  2011-03-20 20:21:43.000000000 +0100
+@@ -0,0 +1,146 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 1992, 1993, 1994, 1995, 1999, 2002, 2003 Free Software
++   Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++   Please email any bugs, comments, and/or additions to this file to:
++   bug-gdb@prep.ai.mit.edu  */
++
++#ifdef vxworks
++
++#  include <stdio.h>
++
++/* VxWorks does not supply atoi.  */
++static int
++atoi (z)
++     char *z;
++{
++  int i = 0;
++
++  while (*z >= '0' && *z <= '9')
++    i = i * 10 + (*z++ - '0');
++  return i;
++}
++
++/* I don't know of any way to pass an array to VxWorks.  This function
++   can be called directly from gdb.  */
++
++vxmain (arg)
++char *arg;
++{
++  char *argv[2];
++
++  argv[0] = "";
++  argv[1] = arg;
++  main (2, argv, (char **) 0);
++}
++
++#else /* ! vxworks */
++#  include <stdio.h>
++#  include <stdlib.h>
++#endif /* ! vxworks */
++
++#ifdef PROTOTYPES
++extern int marker1 (void);
++extern int marker2 (int a);
++extern void marker3 (char *a, char *b);
++extern void marker4 (long d);
++#else
++extern int marker1 ();
++extern int marker2 ();
++extern void marker3 ();
++extern void marker4 ();
++#endif
++
++/*
++ *    This simple classical example of recursion is useful for
++ *    testing stack backtraces and such.
++ */
++
++#ifdef PROTOTYPES
++int factorial(int);
++
++int
++main (int argc, char **argv, char **envp)
++#else
++int
++main (argc, argv, envp)
++int argc;
++char *argv[], **envp;
++#endif
++{
++#ifdef usestubs
++    set_debug_traps();  /* set breakpoint 5 here */
++    breakpoint();
++#endif
++    if (argc == 12345) {  /* an unlikely value < 2^16, in case uninited */ /* set breakpoint 6 here */
++      fprintf (stderr, "usage:  factorial <number>\n");
++      return 1;
++    }
++    printf ("%d\n", factorial (atoi ("6")));  /* set breakpoint 1 here */
++    /* set breakpoint 12 here */
++    marker1 ();  /* set breakpoint 11 here */
++    marker2 (43); /* set breakpoint 20 here */
++    marker3 ("stack", "trace"); /* set breakpoint 21 here */
++    marker4 (177601976L);
++    argc = (argc == 12345); /* This is silly, but we can step off of it */ /* set breakpoint 2 here */
++    return argc;  /* set breakpoint 10 here */
++}
++
++#ifdef PROTOTYPES
++int factorial (int value)
++#else
++int factorial (value)
++int value;
++#endif
++{
++  if (value > 1) {  /* set breakpoint 7 here */
++      value *= factorial (value - 1);
++    }
++    return (value); /* set breakpoint 19 here */
++}
++
++#ifdef PROTOTYPES
++int multi_line_if_conditional (int a, int b, int c)
++#else
++int multi_line_if_conditional (a, b, c)
++  int a, b, c;
++#endif
++{
++  if (a    /* set breakpoint 3 here */
++      && b
++      && c)
++    return 0;
++  else
++    return 1;
++}
++
++#ifdef PROTOTYPES
++int multi_line_while_conditional (int a, int b, int c)
++#else
++int multi_line_while_conditional (a, b, c)
++  int a, b, c;
++#endif
++{
++  while (a /* set breakpoint 4 here */
++      && b
++      && c)
++    {
++      a--, b--, c--;
++    }
++  return 0;
++}
+Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/break1.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/break1.c 2011-03-20 20:21:43.000000000 +0100
+@@ -0,0 +1,44 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 1992, 1993, 1994, 1995, 1999, 2002, 2003 Free Software
++   Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++   Please email any bugs, comments, and/or additions to this file to:
++   bug-gdb@prep.ai.mit.edu  */
++
++/* The code for this file was extracted from the gdb testsuite
++   testcase "break.c". */
++
++/* The following functions do nothing useful.  They are included
++   simply as places to try setting breakpoints at.  They are
++   explicitly "one-line functions" to verify that this case works
++   (some versions of gcc have or have had problems with this).
++  
++   These functions are in a separate source file to prevent an
++   optimizing compiler from inlining them and optimizing them away. */
++
++#ifdef PROTOTYPES
++int marker1 (void) { return (0); }    /* set breakpoint 15 here */
++int marker2 (int a) { return (1); }   /* set breakpoint 8 here */
++void marker3 (char *a, char *b) {}    /* set breakpoint 17 here */
++void marker4 (long d) {}              /* set breakpoint 14 here */
++#else
++int marker1 () { return (0); }                /* set breakpoint 16 here */
++int marker2 (a) int a; { return (1); }        /* set breakpoint 9 here */
++void marker3 (a, b) char *a, *b; {}   /* set breakpoint 18 here */
++void marker4 (d) long d; {}           /* set breakpoint 13 here */
++#endif
+Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/coremaker.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/coremaker.c      2011-03-20 20:21:43.000000000 +0100
+@@ -0,0 +1,142 @@
++/* Copyright 1992, 1993, 1994, 1995, 1996, 1999
++   Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or (at
++   your option) any later version.
++
++   This program is distributed in the hope that it will be useful, but
++   WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++/* Simple little program that just generates a core dump from inside some
++   nested function calls. */
++
++#include <stdio.h>
++#include <sys/types.h>
++#include <fcntl.h>
++#include <sys/mman.h>
++#include <signal.h>
++#include <stdlib.h>
++#include <unistd.h>
++
++#ifndef __STDC__
++#define       const   /**/
++#endif
++
++#define MAPSIZE (8 * 1024)
++
++/* Don't make these automatic vars or we will have to walk back up the
++   stack to access them. */
++
++char *buf1;
++char *buf2;
++
++int coremaker_data = 1;       /* In Data section */
++int coremaker_bss;    /* In BSS section */
++
++const int coremaker_ro = 201; /* In Read-Only Data section */
++
++/* Note that if the mapping fails for any reason, we set buf2
++   to -1 and the testsuite notices this and reports it as
++   a failure due to a mapping error.  This way we don't have
++   to test for specific errors when running the core maker. */
++
++void
++mmapdata ()
++{
++  int j, fd;
++
++  /* Allocate and initialize a buffer that will be used to write
++     the file that is later mapped in. */
++
++  buf1 = (char *) malloc (MAPSIZE);
++  for (j = 0; j < MAPSIZE; ++j)
++    {
++      buf1[j] = j;
++    }
++
++  /* Write the file to map in */
++
++  fd = open ("coremmap.data", O_CREAT | O_RDWR, 0666);
++  if (fd == -1)
++    {
++      perror ("coremmap.data open failed");
++      buf2 = (char *) -1;
++      return;
++    }
++  write (fd, buf1, MAPSIZE);
++
++  /* Now map the file into our address space as buf2 */
++
++  buf2 = (char *) mmap (0, MAPSIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
++  if (buf2 == (char *) -1)
++    {
++      perror ("mmap failed");
++      return;
++    }
++
++  /* Verify that the original data and the mapped data are identical.
++     If not, we'd rather fail now than when trying to access the mapped
++     data from the core file. */
++
++  for (j = 0; j < MAPSIZE; ++j)
++    {
++      if (buf1[j] != buf2[j])
++      {
++        fprintf (stderr, "mapped data is incorrect");
++        buf2 = (char *) -1;
++        return;
++      }
++    }
++}
++
++void
++func2 ()
++{
++  int coremaker_local[5];
++  int i;
++
++#ifdef SA_FULLDUMP
++  /* Force a corefile that includes the data section for AIX.  */
++  {
++    struct sigaction sa;
++
++    sigaction (SIGABRT, (struct sigaction *)0, &sa);
++    sa.sa_flags |= SA_FULLDUMP;
++    sigaction (SIGABRT, &sa, (struct sigaction *)0);
++  }
++#endif
++
++  /* Make sure that coremaker_local doesn't get optimized away. */
++  for (i = 0; i < 5; i++)
++    coremaker_local[i] = i;
++  coremaker_bss = 0;
++  for (i = 0; i < 5; i++)
++    coremaker_bss += coremaker_local[i];
++  coremaker_data = coremaker_ro + 1;
++  abort ();
++}
++
++void
++func1 ()
++{
++  func2 ();
++}
++
++int main ()
++{
++  mmapdata ();
++  func1 ();
++  return 0;
++}
++
+Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/attach.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/attach.exp       2011-03-20 20:25:53.000000000 +0100
+@@ -0,0 +1,417 @@
++#   Copyright 1997, 1999, 2002 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++
++# On HP-UX 11.0, this test is causing a process running the program
++# "attach" to be left around spinning.  Until we figure out why, I am
++# commenting out the test to avoid polluting tiamat (our 11.0 nightly
++# test machine) with these processes. RT
++#
++# Setting the magic bit in the target app should work.  I added a
++# "kill", and also a test for the R3 register warning.  JB
++if { [istarget "hppa*-*-hpux*"] } {
++    return 0
++}
++
++# are we on a target board
++if [is_remote target] then {
++    return 0
++}
++
++set testfile "attach"
++set srcfile  ${testfile}.c
++set srcfile2 ${testfile}2.c
++set binfile  ${objdir}/${subdir}/${testfile}
++set binfile2 ${objdir}/${subdir}/${testfile}2
++set escapedbinfile  [string_to_regexp ${objdir}/${subdir}/${testfile}]
++set cleanupfile ${objdir}/${subdir}/${testfile}.awk
++
++#execute_anywhere "rm -f ${binfile} ${binfile2}"
++remote_exec build "rm -f ${binfile} ${binfile2}"
++# For debugging this test
++#
++#log_user 1
++
++# Clean out any old files from past runs.
++#
++remote_exec build "${cleanupfile}"
++
++# build the first test case
++#
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug "additional_flags= -fpie -pie"}] != "" } {
++     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
++}
++
++# Build the in-system-call test
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug "additional_flags= -fpie -pie"}] != "" } {
++     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
++}
++
++if [get_compiler_info ${binfile}] {
++    return -1
++}
++
++proc do_attach_tests {} {
++   global gdb_prompt
++   global binfile
++   global escapedbinfile
++   global srcfile
++   global testfile
++   global objdir
++   global subdir
++   global timeout
++
++   # Start the program running and then wait for a bit, to be sure
++   # that it can be attached to.
++   #
++   set testpid [eval exec $binfile &]
++   exec sleep 2
++
++   # Verify that we cannot attach to nonsense.
++   #
++   send_gdb "attach abc\n"
++   gdb_expect {
++      -re ".*Illegal process-id: abc.*$gdb_prompt $"\
++                      {pass "attach to nonsense is prohibited"}
++      -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $"\
++                      {
++                        # Response expected from /proc-based systems.
++                        pass "attach to nonsense is prohibited" 
++                      }
++      -re "Attaching to.*$gdb_prompt $"\
++                      {fail "attach to nonsense is prohibited (bogus pid allowed)"}
++      -re "$gdb_prompt $" {fail "attach to nonsense is prohibited"}
++      timeout         {fail "(timeout) attach to nonsense is prohibited"}
++   }
++
++   # Verify that we cannot attach to what appears to be a valid
++   # process ID, but is a process that doesn't exist.  Traditionally,
++   # most systems didn't have a process with ID 0, so we take that as
++   # the default.  However, there are a few exceptions.
++   #
++   set boguspid 0
++   if { [istarget "*-*-*bsd*"] } {
++       # In FreeBSD 5.0, PID 0 is used for "swapper".  Use -1 instead
++       # (which should have the desired effect on any version of
++       # FreeBSD, and probably other *BSD's too).
++       set boguspid -1
++   }
++   send_gdb "attach $boguspid\n"
++   gdb_expect {
++       -re "Attaching to.*, process $boguspid.*No such process.*$gdb_prompt $"\
++             {
++         # Response expected on ptrace-based systems (i.e. HP-UX 10.20).
++         pass "attach to nonexistent process is prohibited"
++       }
++       -re "Attaching to.*, process $boguspid failed.*Hint.*$gdb_prompt $"\
++             {
++         # Response expected on ttrace-based systems (i.e. HP-UX 11.0).
++         pass "attach to nonexistent process is prohibited"
++       }
++       -re "Attaching to.*, process $boguspid.*denied.*$gdb_prompt $"\
++             {pass "attach to nonexistent process is prohibited"}
++       -re "Attaching to.*, process $boguspid.*not permitted.*$gdb_prompt $"\
++             {pass "attach to nonexistent process is prohibited"}
++       -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $"\
++             {
++         # Response expected from /proc-based systems.
++         pass "attach to nonexistent process is prohibited"
++       }
++       -re "$gdb_prompt $" {fail "attach to nonexistent process is prohibited"}
++       timeout {
++         fail "(timeout) attach to nonexistent process is prohibited"
++       }
++   }
++
++   # Verify that we can attach to the process by first giving its
++   # executable name via the file command, and using attach with
++   # the process ID.
++   #
++   # (Actually, the test system appears to do this automatically
++   # for us.  So, we must also be prepared to be asked if we want
++   # to discard an existing set of symbols.)
++   #
++   send_gdb "file $binfile\n"
++   gdb_expect {
++      -re "Load new symbol table from.*y or n.*$" {
++         send_gdb "y\n"
++         gdb_expect {
++            -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $"\
++                            {pass "(re)set file, before attach1"}
++            -re "$gdb_prompt $" {fail "(re)set file, before attach1"}
++            timeout         {fail "(timeout) (re)set file, before attach1"}
++         }
++      }
++      -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $"\
++                      {pass "set file, before attach1"}
++      -re "$gdb_prompt $" {fail "set file, before attach1"}
++      timeout         {fail "(timeout) set file, before attach1"}
++   }
++
++   send_gdb "attach $testpid\n"
++   gdb_expect {
++      -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*main.*at .*$srcfile:.*$gdb_prompt $"\
++                      {pass "attach1, after setting file"}
++      -re "$gdb_prompt $" {fail "attach1, after setting file"}
++      timeout         {fail "(timeout) attach1, after setting file"}
++   }
++
++   # Verify that we can "see" the variable "should_exit" in the
++   # program, and that it is zero.
++   #
++   send_gdb "print should_exit\n"
++   gdb_expect {
++      -re ".* = 0.*$gdb_prompt $"\
++                      {pass "after attach1, print should_exit"}
++      -re "$gdb_prompt $" {fail "after attach1, print should_exit"}
++      timeout         {fail "(timeout) after attach1, print should_exit"}
++   }
++
++   # Detach the process.
++   #
++   send_gdb "detach\n"
++   gdb_expect {
++      -re "Detaching from program: .*$escapedbinfile.*$gdb_prompt $"\
++                      {pass "attach1 detach"}
++      -re "$gdb_prompt $" {fail "attach1 detach"}
++      timeout         {fail "(timeout) attach1 detach"}
++   }
++
++   # Wait a bit for gdb to finish detaching
++   #
++   exec sleep 5
++
++   # Purge the symbols from gdb's brain.  (We want to be certain
++   # the next attach, which won't be preceded by a "file" command,
++   # is really getting the executable file without our help.)
++   #
++   set old_timeout $timeout
++   set timeout 15 
++   send_gdb "file\n"
++   gdb_expect {
++      -re ".*gdb internal error.*$" { 
++          fail "Internal error, prob. Memory corruption" 
++      }
++      -re "No executable file now.*Discard symbol table.*y or n.*$" {
++         send_gdb "y\n"
++         gdb_expect {
++            -re "No symbol file now.*$gdb_prompt $"\
++                            {pass "attach1, purging symbols after detach"}
++            -re "$gdb_prompt $" {fail "attach1, purging symbols after detach"}
++            timeout         {fail "(timeout) attach1, purging symbols after detach"}
++         }
++      }
++      -re "$gdb_prompt $" {fail "attach1, purging file after detach"}
++      timeout         {
++          fail "(timeout) attach1, purging file after detach"
++      }
++   }
++   set timeout $old_timeout
++
++   # Verify that we can attach to the process just by giving the
++   # process ID.
++   #
++   send_gdb "attach $testpid\n"
++   gdb_expect {
++      -re "Attaching to process $testpid.*Reading symbols from $escapedbinfile.*main.*at .*$gdb_prompt $"\
++                      {pass "attach2"}
++      -re "$gdb_prompt $" {fail "attach2"}
++      timeout         {fail "(timeout) attach2"}
++   }
++
++   # Verify that we can modify the variable "should_exit" in the
++   # program.
++   #
++   send_gdb "set should_exit=1\n"
++   gdb_expect {
++      -re "$gdb_prompt $" {pass "after attach2, set should_exit"}
++      timeout         {fail "(timeout) after attach2, set should_exit"}
++   }
++
++   # Verify that the modification really happened.
++   #
++   send_gdb "tbreak 19\n"
++   gdb_expect {
++      -re "reakpoint .*at.*$srcfile, line 19.*$gdb_prompt $"\
++                      {pass "after attach2, set tbreak postloop"}
++      -re "$gdb_prompt $" {fail "after attach2, set tbreak postloop"}
++      timeout         {fail "(timeout) after attach2, set tbreak postloop"}
++   }
++   send_gdb "continue\n"
++   gdb_expect {
++      -re "main.*at.*$srcfile:19.*$gdb_prompt $"\
++                      {pass "after attach2, reach tbreak postloop"}
++      -re "$gdb_prompt $" {fail "after attach2, reach tbreak postloop"}
++      timeout         {fail "(timeout) after attach2, reach tbreak postloop"}
++   }
++
++   # Allow the test process to exit, to cleanup after ourselves.
++   #
++   gdb_test "continue" {\[Inferior .* exited normally\]} "after attach2, exit"
++
++   # Make sure we don't leave a process around to confuse
++   # the next test run (and prevent the compile by keeping
++   # the text file busy), in case the "set should_exit" didn't
++   # work.
++   #
++   remote_exec build "kill -9 ${testpid}"
++   # Start the program running and then wait for a bit, to be sure
++   # that it can be attached to.
++   #
++   set testpid [eval exec $binfile &]
++   exec sleep 2
++
++   # Verify that we can attach to the process, and find its a.out
++   # when we're cd'd to some directory that doesn't contain the
++   # a.out.  (We use the source path set by the "dir" command.)
++   #
++   send_gdb "dir ${objdir}/${subdir}\n"
++   gdb_expect {
++      -re ".*Source directories searched: .*$gdb_prompt $"\
++                      {pass "set source path"}
++      -re "$gdb_prompt $" {fail "set source path"}
++      timeout         {fail "(timeout) set source path"}
++   }
++
++   send_gdb "cd /tmp\n"
++   gdb_expect {
++      -re ".*Working directory /tmp.*$gdb_prompt $"\
++                      {pass "cd away from process' a.out"}
++      -re "$gdb_prompt $" {fail "cd away from process' a.out"}
++      timeout         {fail "(timeout) cd away from process' a.out"}
++   }
++
++   # Explicitly flush out any knowledge of the previous attachment.
++   send_gdb "symbol\n"
++   gdb_expect {
++      -re ".*Discard symbol table from.*y or n. $"\
++                      {send_gdb "y\n"
++                       gdb_expect {
++                          -re ".*No symbol file now.*$gdb_prompt $"\
++                                          {pass "before attach3, flush symbols"}
++                          -re "$gdb_prompt $" {fail "before attach3, flush symbols"}
++                          timeout         {fail "(timeout) before attach3, flush symbols"}
++                       }
++                      }
++      -re ".*No symbol file now.*$gdb_prompt $"\
++                      {pass "before attach3, flush symbols"}
++      -re "$gdb_prompt $" {fail "before attach3, flush symbols"}
++      timeout         {fail "(timeout) before attach3, flush symbols"}
++   }
++   send_gdb "exec\n"
++   gdb_expect {
++      -re ".*No executable file now.*$gdb_prompt $"\
++                      {pass "before attach3, flush exec"}
++      -re "$gdb_prompt $" {fail "before attach3, flush exec"}
++      timeout         {fail "(timeout) before attach3, flush exec"}
++   }
++
++   send_gdb "attach $testpid\n"
++   gdb_expect {
++      -re "Attaching to process $testpid.*Reading symbols from $escapedbinfile.*main.*at .*$gdb_prompt $"\
++                      {pass "attach when process' a.out not in cwd"}
++      -re "$gdb_prompt $" {fail "attach when process' a.out not in cwd"}
++      timeout         {fail "(timeout) attach when process' a.out not in cwd"}
++   }
++
++   send_gdb "kill\n"
++   gdb_expect {
++      -re ".*Kill the program being debugged.*y or n. $"\
++                      {send_gdb "y\n"
++                       gdb_expect {
++                          -re "$gdb_prompt $" {pass "after attach3, exit"}
++                          timeout {fail "(timeout) after attach3, exit"}
++                       }
++                      }
++      -re "$gdb_prompt $" {fail "after attach3, exit"}
++      timeout         {fail "(timeout) after attach3, exit"}
++   }
++
++   # Another "don't leave a process around"
++   remote_exec build "kill -9 ${testpid}"
++}
++
++proc do_call_attach_tests {} {
++   global gdb_prompt
++   global binfile2
++
++   # Start the program running and then wait for a bit, to be sure
++   # that it can be attached to.
++   #
++   set testpid [eval exec $binfile2 &]
++   exec sleep 2
++
++   # Attach
++   #
++   gdb_test "file $binfile2" ".*" "force switch to gdb64, if necessary"
++   send_gdb "attach $testpid\n"
++   gdb_expect {
++      -re ".*warning: reading register.*I.*O error.*$gdb_prompt $" {
++         fail "attach call, read register 3 error"
++     }
++     -re "Attaching to.*process $testpid.*$gdb_prompt $" {
++         # libc is relocated, not relocated, therefore not printed.
++         pass "attach call"
++     }
++      -re "$gdb_prompt $" {fail "attach call"}
++      timeout         {fail "(timeout) attach call"}
++   }
++
++   # See if other registers are problems
++   #
++   send_gdb "i r r3\n"
++   gdb_expect {
++       -re ".*warning: reading register.*$gdb_prompt $" {
++           pass "CHFts23490: known bug"
++       }
++       -re ".*r3.*$gdb_prompt $" {
++           pass "Bug fixed, Yayyy!"
++       }
++       timeout { fail "timeout on info reg" }
++   }
++
++   # Get rid of the process
++   #
++   gdb_test "p should_exit = 1" ".*"
++   gdb_test "c" {\[Inferior .* exited normally\]}
++   
++   # Be paranoid
++   #
++    remote_exec build "kill -9 ${testpid}"
++
++}
++
++
++# Start with a fresh gdb
++#
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++# This is a test of gdb's ability to attach to a running process.
++#
++do_attach_tests
++
++# Test attaching when the target is inside a system call
++#
++gdb_exit
++gdb_start
++
++gdb_reinitialize_dir $srcdir/$subdir
++do_call_attach_tests
++
++return 0
+Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/break.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/break.exp        2011-03-20 20:21:43.000000000 +0100
+@@ -0,0 +1,966 @@
++#   Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
++#   2000, 2002, 2003, 2004
++#   Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# Please email any bugs, comments, and/or additions to this file to:
++# bug-gdb@prep.ai.mit.edu
++
++# This file was written by Rob Savoye. (rob@cygnus.com)
++
++# Test the same stuff but with PIE executables
++
++set testfile "break"
++set srcfile ${testfile}.c
++set srcfile1 ${testfile}1.c
++set binfile ${objdir}/${subdir}/${testfile}
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug "additional_flags=-w -fpie -pie"}] != "" } {
++     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
++}
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug "additional_flags=-w -fpie -pie"}] != "" } {
++     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
++}
++
++if  { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug "additional_flags=-w -fpie -pie"}] != "" } {
++     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
++}
++
++if [get_compiler_info ${binfile}] {
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++if [target_info exists gdb_stub] {
++    gdb_step_for_stub;
++}
++#
++# test simple breakpoint setting commands
++#
++
++# Test deleting all breakpoints when there are none installed,
++# GDB should not prompt for confirmation.
++# Note that gdb-init.exp provides a "delete_breakpoints" proc
++# for general use elsewhere.
++
++send_gdb "delete breakpoints\n"
++gdb_expect {
++     -re "Delete all breakpoints.*$" {
++          send_gdb "y\n"
++          gdb_expect {
++              -re "$gdb_prompt $" {
++                  fail "Delete all breakpoints when none (unexpected prompt)"
++              }
++              timeout { fail "Delete all breakpoints when none (timeout after unexpected prompt)" }
++          }
++      }
++     -re ".*$gdb_prompt $"       { pass "Delete all breakpoints when none" }
++    timeout               { fail "Delete all breakpoints when none (timeout)" }
++}
++
++#
++# test break at function
++#
++gdb_test "break main" \
++    "Breakpoint.*at.* file .*$srcfile, line.*" \
++    "breakpoint function"
++
++#
++# test break at quoted function
++#
++gdb_test "break \"marker2\"" \
++    "Breakpoint.*at.* file .*$srcfile1, line.*" \
++    "breakpoint quoted function"
++
++#
++# test break at function in file
++#
++gdb_test "break $srcfile:factorial" \
++    "Breakpoint.*at.* file .*$srcfile, line.*" \
++    "breakpoint function in file"
++
++set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
++
++#
++# test break at line number
++#
++# Note that the default source file is the last one whose source text
++# was printed.  For native debugging, before we've executed the
++# program, this is the file containing main, but for remote debugging,
++# it's wherever the processor was stopped when we connected to the
++# board.  So, to be sure, we do a list command.
++#
++gdb_test "list main" \
++    ".*main \\(argc, argv, envp\\).*" \
++    "use `list' to establish default source file"
++gdb_test "break $bp_location1" \
++    "Breakpoint.*at.* file .*$srcfile, line $bp_location1\\." \
++    "breakpoint line number"
++
++#
++# test duplicate breakpoint
++#
++gdb_test "break $bp_location1" \
++    "Note: breakpoint \[0-9\]+ also set at pc.*Breakpoint \[0-9\]+ at.* file .*$srcfile, line $bp_location1\\." \
++    "breakpoint duplicate"
++
++set bp_location2 [gdb_get_line_number "set breakpoint 2 here"]
++
++#
++# test break at line number in file
++#
++gdb_test "break $srcfile:$bp_location2" \
++    "Breakpoint.*at.* file .*$srcfile, line $bp_location2\\." \
++    "breakpoint line number in file"
++
++set bp_location3 [gdb_get_line_number "set breakpoint 3 here"]
++set bp_location4 [gdb_get_line_number "set breakpoint 4 here"]
++
++#
++# Test putting a break at the start of a multi-line if conditional.
++# Verify the breakpoint was put at the start of the conditional.
++#
++gdb_test "break multi_line_if_conditional" \
++    "Breakpoint.*at.* file .*$srcfile, line $bp_location3\\." \
++    "breakpoint at start of multi line if conditional"
++
++gdb_test "break multi_line_while_conditional" \
++    "Breakpoint.*at.* file .*$srcfile, line $bp_location4\\." \
++    "breakpoint at start of multi line while conditional"
++
++set bp_location5 [gdb_get_line_number "set breakpoint 5 here"]
++set bp_location6 [gdb_get_line_number "set breakpoint 6 here"]
++
++#
++# check to see what breakpoints are set
++#
++if [target_info exists gdb_stub] {
++    set main_line $bp_location5
++} else {
++    set main_line $bp_location6
++}
++
++if {$hp_aCC_compiler} {
++    set proto "\\(int\\)"
++} else {
++    set proto ""
++}
++
++set bp_location7 [gdb_get_line_number "set breakpoint 7 here"]
++set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile1]
++set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1]
++
++# Test a pending breakpoint in PIE executable does not crash later GDB.
++gdb_breakpoint "non_existent_function" allow-pending
++
++gdb_test "info break" \
++    "Num\[ \]+Type\[ \]+Disp Enb Address\[ \]+What.*
++\[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$main_line.*
++\[0-9\]+\[\t \]+breakpoint     keep y.* in marker2 at .*$srcfile1:($bp_location8|$bp_location9).*
++\[0-9\]+\[\t \]+breakpoint     keep y.* in factorial$proto at .*$srcfile:$bp_location7.*
++\[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$bp_location1.*
++\[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$bp_location1.*
++\[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$bp_location2.*
++\[0-9\]+\[\t \]+breakpoint     keep y.* in multi_line_if_conditional at .*$srcfile:$bp_location3.*
++\[0-9\]+\[\t \]+breakpoint     keep y.* in multi_line_while_conditional at .*$srcfile:$bp_location4.*
++\[0-9\]+\[\t \]+breakpoint     keep y.* <PENDING> *non_existent_function" \
++    "breakpoint info"
++
++# FIXME: The rest of this test doesn't work with anything that can't
++# handle arguments.
++# Huh? There doesn't *appear* to be anything that passes arguments
++# below.
++if [istarget "mips-idt-*"] then {
++    return
++}
++
++#
++# run until the breakpoint at main is hit. For non-stubs-using targets.
++#
++if ![target_info exists use_gdb_stub] {
++  if [istarget "*-*-vxworks*"] then {
++    send_gdb "run vxmain \"2\"\n"
++    set timeout 120
++    verbose "Timeout is now $timeout seconds" 2
++  } else {
++      send_gdb "run\n"
++  }
++  gdb_expect {
++    -re "The program .* has been started already.*y or n. $" {
++      send_gdb "y\n"
++      exp_continue
++    }
++    -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.* \{.*$gdb_prompt $"\
++                          { pass "run until function breakpoint" }
++    -re ".*$gdb_prompt $"       { fail "run until function breakpoint" }
++    timeout               { fail "run until function breakpoint (timeout)" }
++  }
++} else {
++    if ![target_info exists gdb_stub] {
++      gdb_test continue ".*Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.*\{.*" "stub continue"
++    }
++}
++
++#
++# run until the breakpoint at a line number
++#
++gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location1.*$bp_location1\[\t \]+printf.*factorial.*" \
++                      "run until breakpoint set at a line number"
++
++#
++# Run until the breakpoint set in a function in a file
++#
++for {set i 6} {$i >= 1} {incr i -1} {
++      gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, factorial \\(value=$i\\) at .*$srcfile:$bp_location7.*$bp_location7\[\t \]+.*if .value > 1. \{.*" \
++                      "run until file:function($i) breakpoint"
++}
++
++#
++# Run until the breakpoint set at a quoted function
++#
++gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, (0x\[0-9a-f\]+ in )?marker2 \\(a=43\\) at .*$srcfile1:($bp_location8|$bp_location9).*" \
++              "run until quoted breakpoint"
++#
++# run until the file:function breakpoint at a line number in a file
++#
++gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location2.*$bp_location2\[\t \]+argc = \\(argc == 12345\\);.*" \
++              "run until file:linenum breakpoint"
++
++# Test break at offset +1
++set bp_location10 [gdb_get_line_number "set breakpoint 10 here"]
++
++gdb_test "break +1" \
++    "Breakpoint.*at.* file .*$srcfile, line $bp_location10\\." \
++    "breakpoint offset +1"
++
++# Check to see if breakpoint is hit when stepped onto
++
++gdb_test "step" \
++    ".*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location10.*$bp_location10\[\t \]+return argc;.*breakpoint 10 here.*" \
++    "step onto breakpoint"
++
++#
++# delete all breakpoints so we can start over, course this can be a test too
++#
++delete_breakpoints
++
++#
++# test temporary breakpoint at function
++#
++
++gdb_test "tbreak main" "reakpoint.*at.* file .*$srcfile, line.*" "Temporary breakpoint function"
++
++#
++# test break at function in file
++#
++
++gdb_test "tbreak $srcfile:factorial" "reakpoint.*at.* file .*$srcfile, line.*" \
++      "Temporary breakpoint function in file"
++
++#
++# test break at line number
++#
++send_gdb "tbreak $bp_location1\n"
++gdb_expect {
++    -re "reakpoint.*at.* file .*$srcfile, line $bp_location1.*$gdb_prompt $" { pass "Temporary breakpoint line number #1" }
++      -re ".*$gdb_prompt $"   { pass "Temporary breakpoint line number #1" }
++      timeout     { fail "breakpoint line number #1 (timeout)" }
++}
++
++gdb_test "tbreak $bp_location6" "reakpoint.*at.* file .*$srcfile, line $bp_location6.*" "Temporary breakpoint line number #2"
++
++#
++# test break at line number in file
++#
++send_gdb "tbreak $srcfile:$bp_location2\n"
++gdb_expect {
++    -re "reakpoint.*at.* file .*$srcfile, line $bp_location2.*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" }
++      -re ".*$gdb_prompt $"   { pass "Temporary breakpoint line number in file #1" }
++      timeout     { fail "Temporary breakpoint line number in file #1 (timeout)" }
++}
++
++set bp_location11 [gdb_get_line_number "set breakpoint 11 here"]
++gdb_test  "tbreak $srcfile:$bp_location11" "reakpoint.*at.* file .*$srcfile, line $bp_location11.*" "Temporary breakpoint line number in file #2"
++
++#
++# check to see what breakpoints are set (temporary this time)
++#
++gdb_test "info break" "Num.*Type.*Disp Enb Address.*What.*\[\r\n\]
++\[0-9\]+\[\t \]+breakpoint     del.*y.*in main at .*$srcfile:$main_line.*\[\r\n\]
++\[0-9\]+\[\t \]+breakpoint     del.*y.*in factorial$proto at .*$srcfile:$bp_location7.*\[\r\n\]
++\[0-9\]+\[\t \]+breakpoint     del.*y.*in main at .*$srcfile:$bp_location1.*\[\r\n\]
++\[0-9\]+\[\t \]+breakpoint     del.*y.*in main at .*$srcfile:$bp_location6.*\[\r\n\]
++\[0-9\]+\[\t \]+breakpoint     del.*y.*in main at .*$srcfile:$bp_location2.*\[\r\n\]
++\[0-9\]+\[\t \]+breakpoint     del.*y.*in main at .*$srcfile:$bp_location11.*" \
++    "Temporary breakpoint info"
++
++
++#***********
++
++# Verify that catchpoints for fork, vfork and exec don't trigger
++# inappropriately.  (There are no calls to those system functions
++# in this test program.)
++#
++if ![runto_main] then { fail "break tests suppressed" }
++
++send_gdb "catch\n"
++gdb_expect {
++  -re "Catch requires an event name.*$gdb_prompt $"\
++          {pass "catch requires an event name"}
++  -re "$gdb_prompt $"\
++          {fail "catch requires an event name"}
++  timeout {fail "(timeout) catch requires an event name"}
++}
++
++
++set name "set catch fork, never expected to trigger"
++send_gdb "catch fork\n"
++gdb_expect {
++  -re "Catchpoint \[0-9\]* .fork..*$gdb_prompt $"
++          {pass $name}
++  -re "Catch of fork not yet implemented.*$gdb_prompt $"
++        {pass $name}
++  -re "$gdb_prompt $"
++          {fail $name}
++  timeout {fail "(timeout) $name"}
++}
++
++
++set name "set catch vfork, never expected to trigger"
++send_gdb "catch vfork\n"
++
++# If we are on HP-UX 10.20, we expect an error message to be
++# printed if we type "catch vfork" at the gdb gdb_prompt.  This is
++# because on HP-UX 10.20, we cannot catch vfork events.
++
++if [istarget "hppa*-hp-hpux10.20"] then {
++    gdb_expect {
++      -re "Catch of vfork events not supported on HP-UX 10.20..*$gdb_prompt $"
++              {pass $name}
++      -re "$gdb_prompt $"
++              {fail $name}
++      timeout {fail "(timeout) $name"}
++    }
++} else {
++    gdb_expect {
++      -re "Catchpoint \[0-9\]* .vfork..*$gdb_prompt $"
++              {pass $name}
++      -re "Catch of vfork not yet implemented.*$gdb_prompt $"
++              {pass $name}
++      -re "$gdb_prompt $"
++              {fail $name}
++      timeout {fail "(timeout) $name"}
++    }
++}
++
++set name "set catch exec, never expected to trigger"
++send_gdb "catch exec\n"
++gdb_expect {
++  -re "Catchpoint \[0-9\]* .exec..*$gdb_prompt $"
++          {pass $name}
++  -re "Catch of exec not yet implemented.*$gdb_prompt $"
++        {pass $name}
++  -re "$gdb_prompt $" {fail $name}
++  timeout {fail "(timeout) $name"}
++}
++
++# Verify that GDB responds gracefully when asked to set a breakpoint
++# on a nonexistent source line.
++#
++send_gdb "break 999\n"
++gdb_expect {
++  -re "No line 999 in file .*$gdb_prompt $"\
++          {pass "break on non-existent source line"}
++  -re "$gdb_prompt $"\
++          {fail "break on non-existent source line"}
++  timeout {fail "(timeout) break on non-existent source line"}
++}
++
++# Run to the desired default location. If not positioned here, the
++# tests below don't work.
++#
++gdb_test "until $bp_location1" "main .* at .*:$bp_location1.*" "until bp_location1"
++
++
++# Verify that GDB allows one to just say "break", which is treated
++# as the "default" breakpoint.  Note that GDB gets cute when printing
++# the informational message about other breakpoints at the same
++# location.  We'll hit that bird with this stone too.
++#
++send_gdb "break\n"
++gdb_expect {
++  -re "Breakpoint \[0-9\]*.*$gdb_prompt $"\
++          {pass "break on default location, 1st time"}
++  -re "$gdb_prompt $"\
++          {fail "break on default location, 1st time"}
++  timeout {fail "(timeout) break on default location, 1st time"}
++}
++
++send_gdb "break\n"
++gdb_expect {
++  -re "Note: breakpoint \[0-9\]* also set at .*Breakpoint \[0-9\]*.*$gdb_prompt $"\
++          {pass "break on default location, 2nd time"}
++  -re "$gdb_prompt $"\
++          {fail "break on default location, 2nd time"}
++  timeout {fail "(timeout) break on default location, 2nd time"}
++}
++
++send_gdb "break\n"
++gdb_expect {
++  -re "Note: breakpoints \[0-9\]* and \[0-9\]* also set at .*Breakpoint \[0-9\]*.*$gdb_prompt $"\
++          {pass "break on default location, 3rd time"}
++  -re "$gdb_prompt $"\
++          {fail "break on default location, 3rd time"}
++  timeout {fail "(timeout) break on default location, 3rd time"}
++}
++
++send_gdb "break\n"
++gdb_expect {
++  -re "Note: breakpoints \[0-9\]*, \[0-9\]* and \[0-9\]* also set at .*Breakpoint \[0-9\]*.*$gdb_prompt $"\
++          {pass "break on default location, 4th time"}
++  -re "$gdb_prompt $"\
++          {fail "break on default location, 4th time"}
++  timeout {fail "(timeout) break on default location, 4th time"}
++}
++
++# Verify that a "silent" breakpoint can be set, and that GDB is indeed
++# "silent" about its triggering.
++#
++if ![runto_main] then { fail "break tests suppressed" }
++
++send_gdb "break $bp_location1\n"
++gdb_expect {
++  -re "Breakpoint (\[0-9\]*) at .*, line $bp_location1.*$gdb_prompt $"\
++          {pass "set to-be-silent break bp_location1"}
++  -re "$gdb_prompt $"\
++          {fail "set to-be-silent break bp_location1"}
++  timeout {fail "(timeout) set to-be-silent break bp_location1"}
++}
++
++send_gdb "commands $expect_out(1,string)\n"
++send_gdb "silent\n"
++send_gdb "end\n"
++gdb_expect {
++  -re ".*$gdb_prompt $"\
++          {pass "set silent break bp_location1"}
++  timeout {fail "(timeout) set silent break bp_location1"}
++}
++
++send_gdb "info break $expect_out(1,string)\n"
++gdb_expect {
++  -re "\[0-9\]*\[ \t\]*breakpoint.*:$bp_location1\r\n\[ \t\]*silent.*$gdb_prompt $"\
++          {pass "info silent break bp_location1"}
++  -re "$gdb_prompt $"\
++          {fail "info silent break bp_location1"}
++  timeout {fail "(timeout) info silent break bp_location1"}
++}
++send_gdb "continue\n"
++gdb_expect {
++  -re "Continuing.\r\n$gdb_prompt $"\
++          {pass "hit silent break bp_location1"}
++  -re "$gdb_prompt $"\
++          {fail "hit silent break bp_location1"}
++  timeout {fail "(timeout) hit silent break bp_location1"}
++}
++send_gdb "bt\n"
++gdb_expect {
++  -re "#0  main .* at .*:$bp_location1.*$gdb_prompt $"\
++          {pass "stopped for silent break bp_location1"}
++  -re "$gdb_prompt $"\
++          {fail "stopped for silent break bp_location1"}
++  timeout {fail "(timeout) stopped for silent break bp_location1"}
++}
++
++# Verify that GDB can at least parse a breakpoint with the
++# "thread" keyword.  (We won't attempt to test here that a
++# thread-specific breakpoint really triggers appropriately.
++# The gdb.threads subdirectory contains tests for that.)
++#
++set bp_location12 [gdb_get_line_number "set breakpoint 12 here"]
++send_gdb "break $bp_location12 thread 999\n"
++gdb_expect {
++  -re "Unknown thread 999.*$gdb_prompt $"\
++          {pass "thread-specific breakpoint on non-existent thread disallowed"}
++  -re "$gdb_prompt $"\
++          {fail "thread-specific breakpoint on non-existent thread disallowed"}
++  timeout {fail "(timeout) thread-specific breakpoint on non-existent thread disallowed"}
++}
++send_gdb "break $bp_location12 thread foo\n"
++gdb_expect {
++  -re "Junk after thread keyword..*$gdb_prompt $"\
++          {pass "thread-specific breakpoint on bogus thread ID disallowed"}
++  -re "$gdb_prompt $"\
++          {fail "thread-specific breakpoint on bogus thread ID disallowed"}
++  timeout {fail "(timeout) thread-specific breakpoint on bogus thread ID disallowed"}
++}
++
++# Verify that GDB responds gracefully to a breakpoint command with
++# trailing garbage.
++#
++send_gdb "break $bp_location12 foo\n"
++gdb_expect {
++  -re "Junk at end of arguments..*$gdb_prompt $"\
++          {pass "breakpoint with trailing garbage disallowed"}
++  -re "$gdb_prompt $"\
++          {fail "breakpoint with trailing garbage disallowed"}
++  timeout {fail "(timeout) breakpoint with trailing garbage disallowed"}
++}
++
++# Verify that GDB responds gracefully to a "clear" command that has
++# no matching breakpoint.  (First, get us off the current source line,
++# which we know has a breakpoint.)
++#
++send_gdb "next\n"
++gdb_expect {
++  -re ".*$gdb_prompt $"\
++          {pass "step over breakpoint"}
++  timeout {fail "(timeout) step over breakpoint"}
++}
++send_gdb "clear 81\n"
++gdb_expect {
++  -re "No breakpoint at 81..*$gdb_prompt $"\
++          {pass "clear line has no breakpoint disallowed"}
++  -re "$gdb_prompt $"\
++          {fail "clear line has no breakpoint disallowed"}
++  timeout {fail "(timeout) clear line has no breakpoint disallowed"}
++}
++send_gdb "clear\n"
++gdb_expect {
++  -re "No breakpoint at this line..*$gdb_prompt $"\
++          {pass "clear current line has no breakpoint disallowed"}
++  -re "$gdb_prompt $"\
++          {fail "clear current line has no breakpoint disallowed"}
++  timeout {fail "(timeout) clear current line has no breakpoint disallowed"}
++}
++
++# Verify that we can set and clear multiple breakpoints.
++#
++# We don't test that it deletes the correct breakpoints.  We do at
++# least test that it deletes more than one breakpoint.
++#
++gdb_test "break marker3" "Breakpoint.*at.*" "break marker3 #1"
++gdb_test "break marker3" "Breakpoint.*at.*" "break marker3 #2"
++gdb_test "clear marker3" {Deleted breakpoints [0-9]+ [0-9]+.*}
++
++# Verify that a breakpoint can be set via a convenience variable.
++#
++send_gdb "set \$foo=$bp_location11\n"
++gdb_expect {
++  -re "$gdb_prompt $"\
++          {pass "set convenience variable \$foo to bp_location11"}
++  timeout {fail "(timeout) set convenience variable \$foo to bp_location11"}
++}
++send_gdb "break \$foo\n"
++gdb_expect {
++  -re "Breakpoint (\[0-9\]*) at .*, line $bp_location11.*$gdb_prompt $"\
++          {pass "set breakpoint via convenience variable"}
++  -re "$gdb_prompt $"\
++          {fail "set breakpoint via convenience variable"}
++  timeout {fail "(timeout) set breakpoint via convenience variable"}
++}
++
++# Verify that GDB responds gracefully to an attempt to set a
++# breakpoint via a convenience variable whose type is not integer.
++#
++send_gdb "set \$foo=81.5\n"
++gdb_expect {
++  -re "$gdb_prompt $"\
++          {pass "set convenience variable \$foo to 81.5"}
++  timeout {fail "(timeout) set convenience variable \$foo to 81.5"}
++}
++send_gdb "break \$foo\n"
++gdb_expect {
++  -re "Convenience variables used in line specs must have integer values..*$gdb_prompt $"\
++          {pass "set breakpoint via non-integer convenience variable disallowed"}
++  -re "$gdb_prompt $"\
++          {fail "set breakpoint via non-integer convenience variable disallowed"}
++  timeout {fail "(timeout) set breakpoint via non-integer convenience variable disallowed"}
++}
++
++# Verify that we can set and trigger a breakpoint in a user-called function.
++#
++send_gdb "break marker2\n"
++gdb_expect {
++    -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location8|$bp_location9).*$gdb_prompt $"\
++          {pass "set breakpoint on to-be-called function"}
++  -re "$gdb_prompt $"\
++          {fail "set breakpoint on to-be-called function"}
++  timeout {fail "(timeout) set breakpoint on to-be-called function"}
++}
++send_gdb "print marker2(99)\n"
++gdb_expect {
++  -re "The program being debugged stopped while in a function called from GDB.\r\nEvaluation of the expression containing the function\r\n.marker2$proto. will be abandoned.\r\nWhen the function is done executing, GDB will silently stop.\r\n$gdb_prompt $"\
++          {pass "hit breakpoint on called function"}
++  -re "$gdb_prompt $"\
++          {fail "hit breakpoint on called function"}
++  timeout {fail "(timeout) hit breakpoint on called function"}
++}
++
++# As long as we're stopped (breakpointed) in a called function,
++# verify that we can successfully backtrace & such from here.
++#
++# In this and the following test, the _sr4export check apparently is needed
++# for hppa*-*-hpux.
++#
++send_gdb "bt\n"
++gdb_expect {
++    -re "#0\[ \t\]*($hex in )?marker2.*:($bp_location8|$bp_location9)\r\n#1.*_sr4export.*$gdb_prompt $"\
++            {pass "backtrace while in called function"}
++    -re "#0\[ \t\]*($hex in )?marker2.*:($bp_location8|$bp_location9)\r\n#1.*function called from gdb.*$gdb_prompt $"\
++          {pass "backtrace while in called function"}
++    -re "$gdb_prompt $"\
++            {fail "backtrace while in called function"}
++    timeout {fail "(timeout) backtrace while in called function"}
++}
++
++# Return from the called function.  For remote targets, it's important to do
++# this before runto_main, which otherwise may silently stop on the dummy
++# breakpoint inserted by GDB at the program's entry point.
++#
++send_gdb "finish\n"
++gdb_expect {
++    -re "Run till exit from .*marker2.* at .*($bp_location8|$bp_location9)\r\n.* in _sr4export.*$gdb_prompt $"\
++            {pass "finish from called function"}
++    -re "Run till exit from .*marker2.* at .*($bp_location8|$bp_location9)\r\n.*function called from gdb.*$gdb_prompt $"\
++            {pass "finish from called function"}
++    -re "Run till exit from .*marker2.* at .*($bp_location8|$bp_location9)\r\n.*Value returned.*$gdb_prompt $"\
++            {pass "finish from called function"}
++    -re "$gdb_prompt $"\
++            {fail "finish from called function"}
++    timeout {fail "(timeout) finish from called function"}
++}
++
++# Verify that GDB responds gracefully to a "finish" command with
++# arguments.
++#
++if ![runto_main] then { fail "break tests suppressed" }
++
++send_gdb "finish 123\n"
++gdb_expect {
++  -re "The \"finish\" command does not take any arguments.\r\n$gdb_prompt $"\
++          {pass "finish with arguments disallowed"}
++  -re "$gdb_prompt $"\
++          {fail "finish with arguments disallowed"}
++  timeout {fail "(timeout) finish with arguments disallowed"}
++}
++
++# Verify that GDB responds gracefully to a request to "finish" from
++# the outermost frame.  On a stub that never exits, this will just
++# run to the stubs routine, so we don't get this error...  Thus the 
++# second condition.
++#
++
++send_gdb "finish\n"
++gdb_expect {
++  -re "\"finish\" not meaningful in the outermost frame.\r\n$gdb_prompt $"\
++          {pass "finish from outermost frame disallowed"}
++  -re "Run till exit from.*\r\n$gdb_prompt $" {
++     pass "finish from outermost frame disallowed"
++  }
++  -re "$gdb_prompt $"\
++          {fail "finish from outermost frame disallowed"}
++  timeout {fail "(timeout) finish from outermost frame disallowed"}
++}
++
++# Verify that we can explicitly ask GDB to stop on all shared library
++# events, and that it does so.
++#
++if [istarget "hppa*-*-hpux*"] then {
++  if ![runto_main] then { fail "break tests suppressed" }
++
++  send_gdb "set stop-on-solib-events 1\n"
++  gdb_expect {
++    -re "$gdb_prompt $"\
++            {pass "set stop-on-solib-events"}
++    timeout {fail "(timeout) set stop-on-solib-events"}
++  }
++
++  send_gdb "run\n"
++  gdb_expect {
++    -re ".*Start it from the beginning.*y or n. $"\
++            {send_gdb "y\n"
++             gdb_expect {
++               -re ".*Stopped due to shared library event.*$gdb_prompt $"\
++                       {pass "triggered stop-on-solib-events"}
++               -re "$gdb_prompt $"\
++                       {fail "triggered stop-on-solib-events"}
++               timeout {fail "(timeout) triggered stop-on-solib-events"}
++             }
++            }
++    -re "$gdb_prompt $"\
++            {fail "rerun for stop-on-solib-events"}
++    timeout {fail "(timeout) rerun for stop-on-solib-events"}
++  }
++
++  send_gdb "set stop-on-solib-events 0\n"
++  gdb_expect {
++    -re "$gdb_prompt $"\
++            {pass "reset stop-on-solib-events"}
++    timeout {fail "(timeout) reset stop-on-solib-events"}
++  }
++}
++
++# Hardware breakpoints are unsupported on HP-UX.  Verify that GDB
++# gracefully responds to requests to create them.
++#
++if [istarget "hppa*-*-hpux*"] then {
++  if ![runto_main] then { fail "break tests suppressed" }
++
++  send_gdb "hbreak\n"
++  gdb_expect {
++    -re "No hardware breakpoint support in the target.*$gdb_prompt $"\
++            {pass "hw breaks disallowed"}
++    -re "$gdb_prompt $"\
++            {fail "hw breaks disallowed"}
++    timeout {fail "(timeout) hw breaks disallowed"}
++  }
++
++  send_gdb "thbreak\n"
++  gdb_expect {
++    -re "No hardware breakpoint support in the target.*$gdb_prompt $"\
++            {pass "temporary hw breaks disallowed"}
++    -re "$gdb_prompt $"\
++            {fail "temporary hw breaks disallowed"}
++    timeout {fail "(timeout) temporary hw breaks disallowed"}
++  }
++}
++
++#********
++
++
++#
++# Test "next" over recursive function call.
++#
++
++proc test_next_with_recursion {} { 
++    global gdb_prompt
++    global decimal
++    global binfile
++
++    if [target_info exists use_gdb_stub] {
++      # Reload the program.
++      delete_breakpoints
++      gdb_load ${binfile};
++    } else {
++      # FIXME: should be using runto
++      gdb_test "kill" "" "kill program" "Kill the program being debugged.*y or n. $" "y"
++
++      delete_breakpoints
++    }
++
++    gdb_test "break factorial" "Breakpoint $decimal at .*" "break at factorial"
++
++    # Run until we call factorial with 6
++
++    if [istarget "*-*-vxworks*"] then {
++      send_gdb "run vxmain \"6\"\n"
++    } else {
++      gdb_run_cmd
++    }
++    gdb_expect {
++      -re "Break.* factorial .value=6. .*$gdb_prompt $" {}
++      -re ".*$gdb_prompt $" {
++          fail "run to factorial(6)";
++          gdb_suppress_tests;
++      }
++      timeout { fail "run to factorial(6) (timeout)" ; gdb_suppress_tests }
++    }
++
++    # Continue until we call factorial recursively with 5.
++
++    if [gdb_test "continue" \
++      "Continuing.*Break.* factorial .value=5. .*" \
++      "continue to factorial(5)"] then { gdb_suppress_tests }
++
++    # Do a backtrace just to confirm how many levels deep we are.
++
++    if [gdb_test "backtrace" \
++      "#0\[ \t\]+ factorial .value=5..*" \
++      "backtrace from factorial(5)"] then { gdb_suppress_tests }
++
++    # Now a "next" should position us at the recursive call, which
++    # we will be performing with 4.
++
++    if [gdb_test "next" \
++      ".* factorial .value - 1.;.*" \
++      "next to recursive call"] then { gdb_suppress_tests }
++
++    # Disable the breakpoint at the entry to factorial by deleting them all.
++    # The "next" should run until we return to the next line from this
++    # recursive call to factorial with 4.
++    # Buggy versions of gdb will stop instead at the innermost frame on
++    # the line where we are trying to "next" to.
++
++    delete_breakpoints
++
++    if [istarget "mips*tx39-*"] {
++      set timeout 60
++    }
++    # We used to set timeout here for all other targets as well.  This
++    # is almost certainly wrong.  The proper timeout depends on the
++    # target system in use, and how we communicate with it, so there
++    # is no single value appropriate for all targets.  The timeout
++    # should be established by the Dejagnu config file(s) for the
++    # board, and respected by the test suite.
++    #
++    # For example, if I'm running GDB over an SSH tunnel talking to a
++    # portmaster in California talking to an ancient 68k board running
++    # a crummy ROM monitor (a situation I can only wish were
++    # hypothetical), then I need a large timeout.  But that's not the
++    # kind of knowledge that belongs in this file.
++
++    gdb_test next "\[0-9\]*\[\t \]+return \\(value\\);.*" \
++          "next over recursive call"
++
++    # OK, we should be back in the same stack frame we started from.
++    # Do a backtrace just to confirm.
++
++    set result [gdb_test "backtrace" \
++          "#0\[ \t\]+ factorial .value=120.*\r\n#1\[ \t\]+ \[0-9a-fx\]+ in factorial .value=6..*" \
++          "backtrace from factorial(5.1)"]
++    if { $result != 0 } { gdb_suppress_tests }
++
++    if [target_info exists gdb,noresults] { gdb_suppress_tests }
++  gdb_continue_to_end "recursive next test"
++   gdb_stop_suppressing_tests;
++}
++
++test_next_with_recursion
++
++
++#********
++
++# build a new file with optimization enabled so that we can try breakpoints
++# on targets with optimized prologues
++
++set binfileo2 ${objdir}/${subdir}/${testfile}o2
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}O0.o" object {debug "additional_flags=-w -O2 -fpie -pie"}] != "" } {
++     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
++}
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}O1.o" object {debug "additional_flags=-w -O2 -fpie -pie"}] != "" } {
++     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
++}
++
++if  { [gdb_compile "${binfile}O0.o ${binfile}O1.o" "${binfileo2}" executable {debug "additional_flags=-w -fpie -pie"}] != "" } {
++     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
++}
++
++if [get_compiler_info ${binfileo2}] {
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfileo2}
++
++if [target_info exists gdb_stub] {
++    gdb_step_for_stub;
++}
++
++#
++# test break at function
++#
++gdb_test "break main" \
++    "Breakpoint.*at.* file .*$srcfile, line.*" \
++    "breakpoint function, optimized file"
++
++#
++# test break at function
++#
++gdb_test "break marker4" \
++    "Breakpoint.*at.* file .*$srcfile1, line.*" \
++    "breakpoint small function, optimized file"
++
++#
++# run until the breakpoint at main is hit. For non-stubs-using targets.
++#
++if ![target_info exists use_gdb_stub] {
++  if [istarget "*-*-vxworks*"] then {
++    send_gdb "run vxmain \"2\"\n"
++    set timeout 120
++    verbose "Timeout is now $timeout seconds" 2
++  } else {
++      send_gdb "run\n"
++  }
++  gdb_expect {
++    -re "The program .* has been started already.*y or n. $" {
++      send_gdb "y\n"
++      exp_continue
++    }
++    -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.* \{.*$gdb_prompt $"\
++                          { pass "run until function breakpoint, optimized file" }
++    -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$gdb_prompt $"\
++                          { pass "run until function breakpoint, optimized file (code motion)" }
++    -re ".*$gdb_prompt $"       { fail "run until function breakpoint, optimized file" }
++    timeout               { fail "run until function breakpoint, optimized file (timeout)" }
++  }
++} else {
++    if ![target_info exists gdb_stub] {
++      gdb_test continue ".*Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.*\{.*" "stub continue, optimized file"
++    }
++}
++
++#
++# run until the breakpoint at a small function
++#
++
++#
++# Add a second pass pattern.  The behavior differs here between stabs
++# and dwarf for one-line functions.  Stabs preserves two line symbols
++# (one before the prologue and one after) with the same line number, 
++# but dwarf regards these as duplicates and discards one of them.
++# Therefore the address after the prologue (where the breakpoint is)
++# has no exactly matching line symbol, and GDB reports the breakpoint
++# as if it were in the middle of a line rather than at the beginning.
++
++set bp_location13 [gdb_get_line_number "set breakpoint 13 here" $srcfile1]
++set bp_location14 [gdb_get_line_number "set breakpoint 14 here" $srcfile1]
++send_gdb "continue\n"
++gdb_expect {
++    -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile1:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" {
++      pass "run until breakpoint set at small function, optimized file"
++    }
++    -re "Breakpoint $decimal, $hex in marker4 \\(d=177601976\\) at .*$srcfile1:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" {
++      pass "run until breakpoint set at small function, optimized file"
++    }
++    -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile1:$bp_location14\[\r\n\]+$bp_location14\[\t \]+void marker4.*" {
++        # marker4() is defined at line 46 when compiled with -DPROTOTYPES
++      pass "run until breakpoint set at small function, optimized file (line bp_location14)"
++    }
++    -re ".*$gdb_prompt " {
++      fail "run until breakpoint set at small function, optimized file"
++    }
++    timeout {
++      fail "run until breakpoint set at small function, optimized file (timeout)"
++    }
++}
++
++
++# Reset the default arguments for VxWorks
++if [istarget "*-*-vxworks*"] {
++    set timeout 10
++    verbose "Timeout is now $timeout seconds" 2
++    send_gdb "set args main\n"
++    gdb_expect -re ".*$gdb_prompt $" {}
++}
+Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/corefile.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/corefile.exp     2011-03-20 20:21:43.000000000 +0100
+@@ -0,0 +1,233 @@
++# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
++# Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# This file was written by Fred Fish. (fnf@cygnus.com)
++
++# are we on a target board
++if ![isnative] then {
++    return
++}
++
++set testfile "coremaker"
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug "additional_flags=-fpie -pie"}] != "" } {
++     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
++}
++
++# Create and source the file that provides information about the compiler
++# used to compile the test case.
++if [get_compiler_info ${binfile}] {
++    return -1;
++}
++
++# Create a core file named "corefile" rather than just "core", to
++# avoid problems with sys admin types that like to regularly prune all
++# files named "core" from the system.
++#
++# Arbitrarily try setting the core size limit to "unlimited" since
++# this does not hurt on systems where the command does not work and
++# allows us to generate a core on systems where it does.
++#
++# Some systems append "core" to the name of the program; others append
++# the name of the program to "core"; still others (like Linux, as of
++# May 2003) create cores named "core.PID".  In the latter case, we
++# could have many core files lying around, and it may be difficult to
++# tell which one is ours, so let's run the program in a subdirectory.
++set found 0
++set coredir "${objdir}/${subdir}/coredir.[getpid]"
++file mkdir $coredir
++catch "system \"(cd ${coredir}; ulimit -c unlimited; ${binfile}; true) >/dev/null 2>&1\""
++#      remote_exec host "${binfile}"
++foreach i "${coredir}/core ${coredir}/core.coremaker.c ${binfile}.core" {
++    if [remote_file build exists $i] {
++      remote_exec build "mv $i ${objdir}/${subdir}/corefile"
++      set found 1
++    }
++}
++# Check for "core.PID".
++if { $found == 0 } {
++    set names [glob -nocomplain -directory $coredir core.*]
++    if {[llength $names] == 1} {
++        set corefile [file join $coredir [lindex $names 0]]
++        remote_exec build "mv $corefile ${objdir}/${subdir}/corefile"
++        set found 1
++    }
++}
++if { $found == 0 } {
++    # The braindamaged HPUX shell quits after the ulimit -c above
++    # without executing ${binfile}.  So we try again without the
++    # ulimit here if we didn't find a core file above.
++    # Oh, I should mention that any "braindamaged" non-Unix system has
++    # the same problem. I like the cd bit too, it's really neat'n stuff.
++    catch "system \"(cd ${objdir}/${subdir}; ${binfile}; true) >/dev/null 2>&1\""
++    foreach i "${objdir}/${subdir}/core ${objdir}/${subdir}/core.coremaker.c ${binfile}.core" {
++      if [remote_file build exists $i] {
++          remote_exec build "mv $i ${objdir}/${subdir}/corefile"
++          set found 1
++      }
++    }
++}
++
++# Try to clean up after ourselves. 
++remote_file build delete [file join $coredir coremmap.data]
++remote_exec build "rmdir $coredir"
++    
++if { $found == 0  } {
++    warning "can't generate a core file - core tests suppressed - check ulimit -c"
++    return 0
++}
++
++#
++# Test that we can simply startup with a "-core=corefile" command line arg
++# and recognize that the core file is a valid, usable core file.
++# To do this, we must shutdown the currently running gdb and restart
++# with the -core args.  We can't use gdb_start because it looks for
++# the first gdb prompt, and the message we are looking for occurs
++# before the first prompt.  Also, we can't include GDBFLAGS because
++# if it is empty, this confuses gdb with an empty argument that it
++# grumbles about (said grumbling currently being ignored in gdb_start).
++# **FIXME**
++#
++# Another problem is that on some systems (solaris for example), there
++# is apparently a limit on the length of a fully specified path to 
++# the coremaker executable, at about 80 chars.  For this case, consider
++# it a pass, but note that the program name is bad.
++
++gdb_exit
++if $verbose>1 then {
++    send_user "Spawning $GDB -nw $GDBFLAGS -core=$objdir/$subdir/corefile\n"
++}
++
++set oldtimeout $timeout
++set timeout [expr "$timeout + 60"]
++verbose "Timeout is now $timeout seconds" 2
++eval "spawn $GDB -nw $GDBFLAGS -core=$objdir/$subdir/corefile"
++expect {
++    -re "Couldn't find .* registers in core file.*$gdb_prompt $" {
++        fail "args: -core=corefile (couldn't find regs)"
++    }
++    -re "Core was generated by .*coremaker.*\r\n\#0  .*\(\).*\r\n$gdb_prompt $" {
++      pass "args: -core=corefile"
++    }
++    -re "Core was generated by .*\r\n\#0  .*\(\).*\r\n$gdb_prompt $" {
++      pass "args: -core=corefile (with bad program name)"
++    }
++    -re ".*registers from core file: File in wrong format.* $" {
++      fail "args: -core=corefile (could not read registers from core file)"
++    }
++    -re ".*$gdb_prompt $"     { fail "args: -core=corefile" }
++    timeout           { fail "(timeout) starting with -core" }
++}
++
++
++#
++# Test that startup with both an executable file and -core argument.
++# See previous comments above, they are still applicable.
++#
++
++close;
++
++if $verbose>1 then {
++    send_user "Spawning $GDB -nw $GDBFLAGS $binfile -core=$objdir/$subdir/corefile\n"
++}
++
++
++eval "spawn $GDB -nw $GDBFLAGS $binfile -core=$objdir/$subdir/corefile";
++expect {
++    -re "Core was generated by .*coremaker.*\r\n\#0  .*\(\).*\r\n$gdb_prompt $" {
++      pass "args: execfile -core=corefile"
++    }
++    -re "Core was generated by .*\r\n\#0  .*\(\).*\r\n$gdb_prompt $"   {
++      pass "args: execfile -core=corefile (with bad program name)"
++    }
++    -re ".*registers from core file: File in wrong format.* $" {
++      fail "args: execfile -core=corefile (could not read registers from core file)"
++    }
++    -re ".*$gdb_prompt $"     { fail "args: execfile -core=corefile" }
++    timeout           { fail "(timeout) starting with -core" }
++}
++set timeout $oldtimeout
++verbose "Timeout is now $timeout seconds" 2
++
++close;
++
++# Now restart normally.
++
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++# Test basic corefile recognition via core-file command.
++
++send_gdb "core-file $objdir/$subdir/corefile\n"
++gdb_expect {
++    -re ".* program is being debugged already.*y or n. $" {
++      # gdb_load may connect us to a gdbserver.
++      send_gdb "y\n"
++      exp_continue;
++    }
++    -re "Core was generated by .*coremaker.*\r\n\#0  .*\(\).*\r\n$gdb_prompt $" {
++      pass "core-file command"
++    }
++    -re "Core was generated by .*\r\n\#0  .*\(\).*\r\n$gdb_prompt $" {
++      pass "core-file command (with bad program name)"
++    }
++    -re ".*registers from core file: File in wrong format.* $" {
++      fail "core-file command (could not read registers from core file)"
++    }
++    -re ".*$gdb_prompt $"     { fail "core-file command" }
++    timeout           { fail "(timeout) core-file command" }
++}
++
++# Test correct mapping of corefile sections by printing some variables.
++
++gdb_test "print coremaker_data" "\\\$$decimal = 202"
++gdb_test "print coremaker_bss" "\\\$$decimal = 10"
++gdb_test "print coremaker_ro" "\\\$$decimal = 201"
++
++gdb_test "print func2::coremaker_local" "\\\$$decimal = \\{0, 1, 2, 3, 4\\}"
++
++# Somehow we better test the ability to read the registers out of the core
++# file correctly.  I don't think the other tests do this.
++
++gdb_test "bt" "abort.*func2.*func1.*main.*" "backtrace in corefile.exp"
++gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp"
++
++# Test ability to read mmap'd data
++
++gdb_test "x/8bd buf1" ".*:.*0.*1.*2.*3.*4.*5.*6.*7" "accessing original mmap data in core file"
++setup_xfail "*-*-sunos*" "*-*-ultrix*" "*-*-aix*"
++set test "accessing mmapped data in core file"
++gdb_test_multiple "x/8bd buf2" "$test" {
++    -re ".*:.*0.*1.*2.*3.*4.*5.*6.*7.*$gdb_prompt $" {
++      pass "$test"
++    }
++    -re "0x\[f\]*:.*Cannot access memory at address 0x\[f\]*.*$gdb_prompt $" {
++      fail "$test (mapping failed at runtime)"
++    }
++    -re "0x.*:.*Cannot access memory at address 0x.*$gdb_prompt $" {
++      fail "$test (mapping address not found in core file)"
++    }
++}
++
++# test reinit_frame_cache
++
++gdb_load ${binfile}
++gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp (reinit)"
++
++gdb_test "core" "No core file now."
+Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/Makefile.in
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.pie/Makefile.in      2011-03-20 20:21:43.000000000 +0100
+@@ -0,0 +1,19 @@
++VPATH = @srcdir@
++srcdir = @srcdir@
++
++EXECUTABLES =
++MISCELLANEOUS = arch.inc
++
++all info install-info dvi install uninstall installcheck check:
++      @echo "Nothing to be done for $@..."
++
++clean mostlyclean:
++      -rm -f *~ *.o a.out *.x *.ci *.tmp
++      -rm -f core core.coremaker coremaker.core corefile $(EXECUTABLES)
++      -rm -f $(MISCELLANEOUS)
++
++distclean maintainer-clean realclean: clean
++      -rm -f *~ core
++      -rm -f Makefile config.status config.log
++      -rm -f *-init.exp
++      -rm -fr *.log summary detail *.plog *.sum *.psum site.*
diff --git a/gdb/patches/gdb-6.3-test-self-20050110.patch b/gdb/patches/gdb-6.3-test-self-20050110.patch
new file mode 100644 (file)
index 0000000..a3ada08
--- /dev/null
@@ -0,0 +1,101 @@
+2004-02-23  Elena Zannoni  <ezannoni@redhat.com>
+
+        * gdb.gdb/selftest.exp: Make sure that the debug directory is
+        set up properly.
+        * gdb.gdb/complaints.exp: Ditto.
+        * gdb.gdb/xfullpath.exp: Ditto.
+        * gdb.gdb/observer.exp: Ditto.
+
+Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.gdb/complaints.exp
+===================================================================
+--- gdb-6.8.50.20090226.orig/gdb/testsuite/gdb.gdb/complaints.exp      2009-01-03 06:58:04.000000000 +0100
++++ gdb-6.8.50.20090226/gdb/testsuite/gdb.gdb/complaints.exp   2009-02-26 22:10:48.000000000 +0100
+@@ -302,13 +302,13 @@ proc find_gdb { arg } {
+ set GDB_FULLPATH [find_gdb $GDB]
+ # Remove any old copy lying around.
+-remote_file host delete x$tool
++#remote_file host delete x$tool
+ gdb_start
+-set file [remote_download host $GDB_FULLPATH x$tool]
++#set file [remote_download host $GDB_FULLPATH x$tool]
+-set setup_result [setup_test $file ]
++set setup_result [setup_test $GDB_FULLPATH ]
+ if {$setup_result <0} then {
+     return -1
+ }
+@@ -319,4 +319,4 @@ test_short_complaints
+ test_empty_complaints
+ gdb_exit;
+-catch "remote_file host delete $file";
++#catch "remote_file host delete $file";
+Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.gdb/observer.exp
+===================================================================
+--- gdb-6.8.50.20090226.orig/gdb/testsuite/gdb.gdb/observer.exp        2009-02-17 20:52:27.000000000 +0100
++++ gdb-6.8.50.20090226/gdb/testsuite/gdb.gdb/observer.exp     2009-02-26 22:11:40.000000000 +0100
+@@ -258,13 +258,13 @@ proc find_gdb { arg } {
+ set GDB_FULLPATH [find_gdb $GDB]
+ # Remove any old copy lying around.
+-remote_file host delete x$tool
++#remote_file host delete x$tool
+ gdb_start
+-set file [remote_download host $GDB_FULLPATH x$tool]
+-set result [test_observer $file];
++#set file [remote_download host $GDB_FULLPATH x$tool]
++set result [test_observer $GDB_FULLPATH];
+ gdb_exit;
+-catch "remote_file host delete $file";
++#catch "remote_file host delete $file";
+ if {$result <0} then {
+     warning "Couldn't test self"
+Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.gdb/selftest.exp
+===================================================================
+--- gdb-6.8.50.20090226.orig/gdb/testsuite/gdb.gdb/selftest.exp        2009-02-26 22:09:59.000000000 +0100
++++ gdb-6.8.50.20090226/gdb/testsuite/gdb.gdb/selftest.exp     2009-02-26 22:10:48.000000000 +0100
+@@ -551,13 +551,13 @@ proc find_gdb { arg } {
+ set GDB_FULLPATH [find_gdb $GDB]
+ # Remove any old copy lying around.
+-remote_file host delete x$tool
++#remote_file host delete x$tool
+ gdb_start
+-set file [remote_download host $GDB_FULLPATH x$tool]
+-set result [test_with_self $file];
++#set file [remote_download host $GDB_FULLPATH x$tool]
++set result [test_with_self $GDB_FULLPATH];
+ gdb_exit;
+-catch "remote_file host delete $file";
++#catch "remote_file host delete $file";
+ if {$result <0} then {
+     warning "Couldn't test self"
+Index: gdb-6.8.50.20090226/gdb/testsuite/gdb.gdb/xfullpath.exp
+===================================================================
+--- gdb-6.8.50.20090226.orig/gdb/testsuite/gdb.gdb/xfullpath.exp       2009-01-03 06:58:04.000000000 +0100
++++ gdb-6.8.50.20090226/gdb/testsuite/gdb.gdb/xfullpath.exp    2009-02-26 22:10:48.000000000 +0100
+@@ -179,13 +179,13 @@ proc find_gdb { arg } {
+ set GDB_FULLPATH [find_gdb $GDB]
+ # Remove any old copy lying around.
+-remote_file host delete x$tool
++#remote_file host delete x$tool
+ gdb_start
+-set file [remote_download host $GDB_FULLPATH x$tool]
+-set result [test_with_self $file];
++#set file [remote_download host $GDB_FULLPATH x$tool]
++set result [test_with_self $GDB_FULLPATH];
+ gdb_exit;
+-catch "remote_file host delete $file";
++#catch "remote_file host delete $file";
+ if {$result <0} then {
+     warning "Couldn't test self"
diff --git a/gdb/patches/gdb-6.3-threaded-watchpoints2-20050225.patch b/gdb/patches/gdb-6.3-threaded-watchpoints2-20050225.patch
new file mode 100644 (file)
index 0000000..187a33e
--- /dev/null
@@ -0,0 +1,243 @@
+2005-02-28  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * config/i386/nm-linux.h: Change dr register routines to
+       accept a ptid_t first argument.  Change all calling macros
+       to default the inferior_ptid for the first argument.
+       (i386_linux_insert_watchpoint): New prototype.
+       (i386_linux_remove_watchpoint, i386_linux_insert_hw_breakpoint): Ditto.
+       (i386_linux_remove_hw_breakpoint): Ditto.
+       (target_insert_watchpoint, target_remove_watchpoint): Undef and
+       override.
+       (target_insert_hw_breakpoint, target_remove_hw_breakpoint): Ditto.
+       * config/i386/nm-linux64.h: Ditto except add amd64 versions of
+       the watchpoint/hw-breakpoint insert/remove routines.
+       * i386-nat.c: Include "inferior.h" to define inferior_ptid.
+       * i386-linux-nat.c: Change all dr get/set routines to accept
+       ptid_t as first argument and to use this argument to determine
+       the tid for PTRACE.
+       (i386_linux_set_debug_regs_for_thread): New function.
+       (i386_linux_sync_debug_registers_callback): Ditto.
+       (i386_linux_sync_debug_registers_across_threads): Ditto.
+       (i386_linux_insert_watchpoint, i386_linux_remove_watchpoint): Ditto.
+       (i386_linux_hw_breakpoint, i386_linux_remove_hw_breakpoint): Ditto.
+       (i386_linux_new_thread): Ditto.
+       (_initialize_i386_linux_nat): Ditto.
+       * amd64-linux-nat.c: Change all dr get/set routines to accept
+       ptid_t as first argument and to use this argument to determine
+       the tid for PTRACE.
+       (amd64_linux_set_debug_regs_for_thread): New function.
+       (amd64_linux_sync_debug_registers_callback): Ditto.
+       (amd64_linux_sync_debug_registers_across_threads): Ditto.
+       (amd64_linux_insert_watchpoint, amd64_linux_remove_watchpoint): Ditto.
+       (amd64_linux_hw_breakpoint, amd64_linux_remove_hw_breakpoint): Ditto.
+       (amd64_linux_new_thread): Ditto.
+       (_initialize_amd64_linux_nat): Register linux new thread observer.
+       * testsuite/gdb.threads/watchthreads2.c: New test case.
+       * testsuite/gdb.threads/watchthreads2.exp: Ditto.
+
+[ With recent upstream GDB (6.8) reduced only to the testcase.  ]
+
+FIXME: The testcase does not expects multiple watchpoints hits per one stop.
+
+Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.5/gdb/testsuite/gdb.threads/watchthreads-threaded.c  2006-07-12 01:54:29.000000000 -0300
+@@ -0,0 +1,66 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  
++ 
++   This file is copied from schedlock.c.  */
++
++#include <stdio.h>
++#include <unistd.h>
++#include <stdlib.h>
++#include <pthread.h>
++
++void *thread_function(void *arg); /* Pointer to function executed by each thread */
++
++#define NUM 5
++
++unsigned int args[NUM+1];
++
++int main() {
++    int res;
++    pthread_t threads[NUM];
++    void *thread_result;
++    long i;
++
++    for (i = 0; i < NUM; i++)
++      {
++      args[i] = 1; /* Init value.  */
++      res = pthread_create(&threads[i],
++                           NULL,
++                           thread_function,
++                           (void *) i);
++      }
++
++    args[i] = 1;
++    thread_function ((void *) i);
++
++    exit(EXIT_SUCCESS);
++}
++
++void *thread_function(void *arg) {
++    int my_number =  (long) arg;
++    int *myp = (int *) &args[my_number];
++
++    /* Don't run forever.  Run just short of it :)  */
++    while (*myp > 0)
++      {
++      (*myp) ++; usleep (1); /* Loop increment.  */
++      }
++
++    pthread_exit(NULL);
++}
++
+Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.5/gdb/testsuite/gdb.threads/watchthreads-threaded.exp        2006-07-12 01:54:29.000000000 -0300
+@@ -0,0 +1,126 @@
++# This testcase is part of GDB, the GNU debugger.
++
++# Copyright 2005 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# Check that GDB can support multiple watchpoints across threads.
++
++# This test verifies that a watchpoint is detected in the proper thread
++# so the test is only meaningful on a system with hardware watchpoints.
++if [target_info exists gdb,no_hardware_watchpoints] {
++    return 0;
++}
++
++set testfile "watchthreads2"
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++gdb_test "set can-use-hw-watchpoints 1" "" ""
++
++#
++# Run to `main' where we begin our tests.
++#
++
++if ![runto_main] then {
++    gdb_suppress_tests
++}
++
++set args_2 0
++set args_3 0
++
++gdb_breakpoint "thread_function"
++gdb_continue_to_breakpoint "thread_function"
++gdb_test "disable 2" ""
++
++gdb_test_multiple "p args\[2\]" "get initial args2" {
++  -re "\\\$\[0-9\]* = (.*)$gdb_prompt $" {
++    set init_args_2 $expect_out(1,string)
++    pass "get initial args2"
++  }
++}
++
++gdb_test_multiple "p args\[3\]" "get initial args3" {
++  -re "\\\$\[0-9\]* = (.*)$gdb_prompt $" {
++    set init_args_3 $expect_out(1,string)
++    pass "get initial args3"
++  }
++}
++
++set args_2 $init_args_2
++set args_3 $init_args_3
++
++# Watch values that will be modified by distinct threads.
++gdb_test "watch args\[2\]" "Hardware watchpoint 3: args\\\[2\\\]"
++gdb_test "watch args\[3\]" "Hardware watchpoint 4: args\\\[3\\\]"
++
++set init_line [expr [gdb_get_line_number "Init value"]+1]
++set inc_line [gdb_get_line_number "Loop increment"]
++
++# Loop and continue to allow both watchpoints to be triggered.
++for {set i 0} {$i < 30} {incr i} {
++  set test_flag 0
++  gdb_test_multiple "continue" "threaded watch loop" {
++    -re "Hardware watchpoint 3: args\\\[2\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads2.c:$init_line.*$gdb_prompt $"
++       { set args_2 1; set test_flag 1 }
++    -re "Hardware watchpoint 4: args\\\[3\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads2.c:$init_line.*$gdb_prompt $"
++       { set args_3 1; set test_flag 1 }
++    -re "Hardware watchpoint 3: args\\\[2\\\].*Old value = $args_2.*New value = [expr $args_2+1].*in thread_function \\\(arg=0x2\\\) at .*watchthreads2.c:$inc_line.*$gdb_prompt $"
++       { set args_2 [expr $args_2+1]; set test_flag 1 }
++    -re "Hardware watchpoint 4: args\\\[3\\\].*Old value = $args_3.*New value = [expr $args_3+1].*in thread_function \\\(arg=0x3\\\) at .*watchthreads2.c:$inc_line.*$gdb_prompt $"
++       { set args_3 [expr $args_3+1]; set test_flag 1 }
++  }
++  # If we fail above, don't bother continuing loop
++  if { $test_flag == 0 } {
++    set i 30;
++  }
++}
++
++# Print success message if loop succeeded.
++if { $test_flag == 1 } {
++  pass "threaded watch loop"
++}
++
++# Verify that we hit first watchpoint in child thread.
++set message "watchpoint on args\[2\] hit in thread"
++if { $args_2 > 1 } {
++  pass $message 
++} else {
++  fail $message
++}
++
++# Verify that we hit second watchpoint in child thread.
++set message "watchpoint on args\[3\] hit in thread"
++if { $args_3 > 1 } {
++  pass $message 
++} else {
++  fail $message 
++}
++
++# Verify that all watchpoint hits are accounted for.
++set message "combination of threaded watchpoints = 30 + initial values"
++if { [expr $args_2+$args_3] == [expr [expr 30+$init_args_2]+$init_args_3] } {
++  pass $message 
++} else {
++  fail $message 
++}
diff --git a/gdb/patches/gdb-6.5-BEA-testsuite.patch b/gdb/patches/gdb-6.5-BEA-testsuite.patch
new file mode 100644 (file)
index 0000000..76d7566
--- /dev/null
@@ -0,0 +1,938 @@
+Index: ./gdb/testsuite/gdb.threads/threadcrash.c
+===================================================================
+RCS file: gdb/testsuite/gdb.threads/threadcrash.c
+diff -N gdb/testsuite/gdb.threads/threadcrash.c
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.threads/threadcrash.c  31 Oct 2006 17:54:38 -0000
+@@ -0,0 +1,301 @@
++/*
++ * The point of this program is to crash in a multi-threaded app.
++ * There are seven threads, doing the following things:
++ * * Spinning
++ * * Spinning inside a signal handler
++ * * Spinning inside a signal handler executing on the altstack
++ * * In a syscall
++ * * In a syscall inside a signal handler
++ * * In a syscall inside a signal handler executing on the altstack
++ * * Finally, the main thread crashes in main, with no frills.
++ *
++ * These are the things threads in JRockit tend to be doing.  If gdb
++ * can handle those things, both in core files and during live
++ * debugging, that will help (at least) JRockit development.
++ *
++ * Let the program create a core file, then load the core file into
++ * gdb.  Inside gdb, you should be able to do something like this:
++ *
++ * (gdb) t a a bt
++ * 
++ * Thread 7 (process 4352):
++ * #0  0x001ba7dc in __nanosleep_nocancel () from /lib/tls/libc.so.6
++ * #1  0x001ba5ff in sleep () from /lib/tls/libc.so.6
++ * #2  0x080488a2 in makeSyscall (ignored=0x0) at threadcrash.c:118
++ * #3  0x006aadec in start_thread () from /lib/tls/libpthread.so.0
++ * #4  0x001ed19a in clone () from /lib/tls/libc.so.6
++ * 
++ * Thread 6 (process 4353):
++ * #0  0x001ba7dc in __nanosleep_nocancel () from /lib/tls/libc.so.6
++ * #1  0x001ba5ff in sleep () from /lib/tls/libc.so.6
++ * #2  0x0804898f in syscallingSighandler (signo=10, info=0xb6be76f0, context=0xb6be7770)
++ *     at threadcrash.c:168
++ * #3  <signal handler called>
++ * #4  0x006adf5e in pthread_kill () from /lib/tls/libpthread.so.0
++ * #5  0x08048a51 in makeSyscallFromSighandler (ignored=0x0) at threadcrash.c:204
++ * #6  0x006aadec in start_thread () from /lib/tls/libpthread.so.0
++ * #7  0x001ed19a in clone () from /lib/tls/libc.so.6
++ * 
++ * Thread 5 (process 4354):
++ * #0  0x001ba7dc in __nanosleep_nocancel () from /lib/tls/libc.so.6
++ * #1  0x001ba5ff in sleep () from /lib/tls/libc.so.6
++ * #2  0x08048936 in syscallingAltSighandler (signo=3, info=0x959cd70, context=0x959cdf0)
++ *     at threadcrash.c:144
++ * #3  <signal handler called>
++ * #4  0x006adf5e in pthread_kill () from /lib/tls/libpthread.so.0
++ * #5  0x080489e2 in makeSyscallFromAltSighandler (ignored=0x0) at threadcrash.c:190
++ * #6  0x006aadec in start_thread () from /lib/tls/libpthread.so.0
++ * #7  0x001ed19a in clone () from /lib/tls/libc.so.6
++ * 
++ * Thread 4 (process 4355):
++ * #0  spin (ignored=0x0) at threadcrash.c:242
++ * #1  0x006aadec in start_thread () from /lib/tls/libpthread.so.0
++ * #2  0x001ed19a in clone () from /lib/tls/libc.so.6
++ * 
++ * Thread 3 (process 4356):
++ * #0  spinningSighandler (signo=12, info=0xb4de46f0, context=0xb4de4770) at threadcrash.c:180
++ * #1  <signal handler called>
++ * #2  0x006adf5e in pthread_kill () from /lib/tls/libpthread.so.0
++ * #3  0x08048b2f in spinFromSighandler (ignored=0x0) at threadcrash.c:232
++ * #4  0x006aadec in start_thread () from /lib/tls/libpthread.so.0
++ * #5  0x001ed19a in clone () from /lib/tls/libc.so.6
++ * 
++ * Thread 2 (process 4357):
++ * #0  spinningAltSighandler (signo=14, info=0x959ee50, context=0x959eed0) at threadcrash.c:156
++ * #1  <signal handler called>
++ * #2  0x006adf5e in pthread_kill () from /lib/tls/libpthread.so.0
++ * #3  0x08048ac0 in spinFromAltSighandler (ignored=0x0) at threadcrash.c:218
++ * #4  0x006aadec in start_thread () from /lib/tls/libpthread.so.0
++ * #5  0x001ed19a in clone () from /lib/tls/libc.so.6
++ * 
++ * Thread 1 (process 4351):
++ * #0  0x08048cf3 in main (argc=1, argv=0xbfff9d74) at threadcrash.c:273
++ * (gdb)
++ */
++
++#include <pthread.h>
++#include <signal.h>
++#include <assert.h>
++#include <unistd.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++#define SIGSYSCALL_ALT SIGQUIT
++#define SIGSYSCALL SIGUSR1
++#define SIGSPIN_ALT SIGALRM
++#define SIGSPIN SIGUSR2
++
++typedef void (*sigaction_t)(int, siginfo_t *, void *);
++
++static void installHandler(int signo, sigaction_t handler, int onAltstack) {
++   struct sigaction action;
++   sigset_t sigset;
++   int result;
++   stack_t altstack;
++   stack_t oldaltstack;
++   
++   memset(&action, 0, sizeof(action));
++   memset(&altstack, 0, sizeof(altstack));
++   memset(&oldaltstack, 0, sizeof(oldaltstack));
++   
++   if (onAltstack) {
++      altstack.ss_sp = malloc(SIGSTKSZ);
++      assert(altstack.ss_sp != NULL);
++      altstack.ss_size = SIGSTKSZ;
++      altstack.ss_flags = 0;
++      result = sigaltstack(&altstack, &oldaltstack);
++      assert(result == 0);
++      assert(oldaltstack.ss_flags == SS_DISABLE);
++   }
++   
++   sigemptyset(&sigset);
++   
++   action.sa_handler = NULL;
++   action.sa_sigaction = handler;
++   action.sa_mask = sigset;
++   action.sa_flags = SA_SIGINFO;
++   if (onAltstack) {
++      action.sa_flags |= SA_ONSTACK;
++   }
++   
++   result = sigaction(signo, &action, NULL);
++   assert(result == 0);
++}
++
++static void installNormalHandler(int signo, sigaction_t handler) {
++   installHandler(signo, handler, 0);
++}
++
++static void installAlthandler(int signo, sigaction_t handler) {
++   installHandler(signo, handler, 1);
++}
++
++static void *makeSyscall(void *ignored) {
++   (void)ignored;
++
++   sleep(42);
++
++   fprintf(stderr, "%s: returning\n", __FUNCTION__);
++   return NULL;
++}
++
++/* Return true if we're currently executing on the altstack */
++static int onAltstack(void) {
++   stack_t stack;
++   int result;
++   
++   result = sigaltstack(NULL, &stack);
++   assert(result == 0);
++   
++   return stack.ss_flags & SS_ONSTACK;
++}
++
++static void syscallingAltSighandler(int signo, siginfo_t *info, void *context) {
++   (void)signo;
++   (void)info;
++   (void)context;
++   
++   if (!onAltstack()) {
++      printf("%s() not running on altstack!\n", __FUNCTION__);
++   }
++   
++   sleep(42);
++}
++
++static void spinningAltSighandler(int signo, siginfo_t *info, void *context) {
++   (void)signo;
++   (void)info;
++   (void)context;
++   
++   if (!onAltstack()) {
++      printf("%s() not running on altstack!\n", __FUNCTION__);
++   }
++   
++   while (1);
++}
++
++static void syscallingSighandler(int signo, siginfo_t *info, void *context) {
++   (void)signo;
++   (void)info;
++   (void)context;
++   
++   if (onAltstack()) {
++      printf("%s() running on altstack!\n", __FUNCTION__);
++   }
++   
++   sleep(42);
++}
++
++static void spinningSighandler(int signo, siginfo_t *info, void *context) {
++   (void)signo;
++   (void)info;
++   (void)context;
++   
++   if (onAltstack()) {
++      printf("%s() running on altstack!\n", __FUNCTION__);
++   }
++   
++   while (1);
++}
++
++static void *makeSyscallFromAltSighandler(void *ignored) {
++   (void)ignored;
++   
++   int result;
++   
++   installAlthandler(SIGSYSCALL_ALT, syscallingAltSighandler);
++   
++   result = pthread_kill(pthread_self(), SIGSYSCALL_ALT);
++   assert(result == 0);
++   
++   fprintf(stderr, "%s: returning\n", __FUNCTION__);
++   return NULL;
++}
++
++static void *makeSyscallFromSighandler(void *ignored) {
++   (void)ignored;
++   
++   int result;
++   
++   installNormalHandler(SIGSYSCALL, syscallingSighandler);
++   
++   result = pthread_kill(pthread_self(), SIGSYSCALL);
++   assert(result == 0);
++   
++   fprintf(stderr, "%s: returning\n", __FUNCTION__);
++   return NULL;
++}
++
++static void *spinFromAltSighandler(void *ignored) {
++   (void)ignored;
++   
++   int result;
++   
++   installAlthandler(SIGSPIN_ALT, spinningAltSighandler);
++   
++   result = pthread_kill(pthread_self(), SIGSPIN_ALT);
++   assert(result == 0);
++   
++   fprintf(stderr, "%s: returning\n", __FUNCTION__);
++   return NULL;
++}
++
++static void *spinFromSighandler(void *ignored) {
++   (void)ignored;
++   
++   int result;
++   
++   installNormalHandler(SIGSPIN, spinningSighandler);
++   
++   result = pthread_kill(pthread_self(), SIGSPIN);
++   assert(result == 0);
++   
++   fprintf(stderr, "%s: returning\n", __FUNCTION__);
++   return NULL;
++}
++
++static void *spin(void *ignored) {
++   (void)ignored;
++   
++   while (1);
++
++   fprintf(stderr, "%s: returning\n", __FUNCTION__);
++   return NULL;
++}
++
++int main(int argc, char *argv[]) {
++   int result;
++   pthread_t thread;
++   volatile int bad;
++   
++   result = pthread_create(&thread, NULL, makeSyscall, NULL);
++   assert(result == 0);
++   result = pthread_create(&thread, NULL, makeSyscallFromSighandler, NULL);
++   assert(result == 0);
++   result = pthread_create(&thread, NULL, makeSyscallFromAltSighandler, NULL);
++   assert(result == 0);
++   result = pthread_create(&thread, NULL, spin, NULL);
++   assert(result == 0);
++   result = pthread_create(&thread, NULL, spinFromSighandler, NULL);
++   assert(result == 0);
++   result = pthread_create(&thread, NULL, spinFromAltSighandler, NULL);
++   assert(result == 0);
++   
++   // Give threads some time to get going
++   sleep(3);
++   
++   // Crash
++   bad = *(int*)7;
++
++   /* Workaround: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29628
++      Simulate use to ensure `DW_AT_location' for them:
++      readelf -a --debug threadcrash|grep -A5 -w argc
++      --> DW_AT_location    : 2 byte block: 71 0     (DW_OP_breg1: 0)
++      This case verified on: gcc-4.1.1-30.i386
++      Keep it late to ensure persistency in the registers.  */
++   bad = (int) argc;
++   bad = (unsigned long) argv;
++   
++   return 0;
++}
+Index: ./gdb/testsuite/gdb.threads/threadcrash.exp
+===================================================================
+RCS file: gdb/testsuite/gdb.threads/threadcrash.exp
+diff -N gdb/testsuite/gdb.threads/threadcrash.exp
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.threads/threadcrash.exp        31 Oct 2006 17:54:38 -0000
+@@ -0,0 +1,37 @@
++# threadcrash.exp - The point of this program is to crash in a multi-threaded app.
++
++
++set testfile threadcrash
++set srcfile ${testfile}.c
++set shellfile ${srcdir}/${subdir}/${testfile}.sh
++set binfile ${objdir}/${subdir}/${testfile}
++
++set GDB_abs ${GDB}
++if [regexp "^\[^/\]" ${GDB_abs}] {
++    set GDB_abs $env(PWD)/${GDB_abs}
++}
++
++if [istarget "*-*-linux"] then {
++    set target_cflags "-D_MIT_POSIX_THREADS"
++} else {
++    set target_cflags ""
++}
++
++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    return -1
++}
++
++# ${shellfile} argument must not contain any directories.
++set fd [open "|bash ${shellfile} ${binfile} $GDB -nw $GDBFLAGS" r]
++while { [gets $fd line] >= 0 } {
++    if [regexp " PASS: (.*)$" $line trash message] {
++      pass $message
++    } elseif [regexp " FAIL: (.*)$" $line trash message] {
++      fail $message
++    }
++}
++catch {
++    close $fd
++}
++
++return 0
+Index: ./gdb/testsuite/gdb.threads/threadcrash.sh
+===================================================================
+RCS file: gdb/testsuite/gdb.threads/threadcrash.sh
+diff -N gdb/testsuite/gdb.threads/threadcrash.sh
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.threads/threadcrash.sh 31 Oct 2006 17:54:38 -0000
+@@ -0,0 +1,324 @@
++#! /bin/bash
++
++# NOTE: threadcrash.c *must* be built with debugging symbols
++#
++# The point of this shell script is to crash treadcrash.c, load the
++# resulting core file into gdb and verify that gdb can extract enough
++# information from the core file.
++#
++# The return code from this script is the number of failed tests.
++
++LOG=gdbresult.log
++
++if [ $# = 0 ] ; then
++    echo >&2 Syntax: $0 \<name of threadcrash binary\> [\<gdb binary\> \<args...\>]
++    exit 1
++fi
++RUNME="$1"
++shift
++GDB="${*:-gdb}"
++
++
++pf_prefix=""
++function pf_prefix() {
++      pf_prefix="$*"
++}
++
++set_test=""
++function set_test() {
++      if [ -n "$set_test" ] ; then
++              echo >&2 "DEJAGNU-BASH ERROR: set_test already set"
++              exit 1
++      fi
++      set_test="$*"
++      if [ -n "$pf_prefix" ] ; then
++              set_test="$pf_prefix: $set_test"
++      fi
++}
++
++# INTERNAL
++function record_test {
++      if [ -z "$set_test" ] ; then
++              echo >&2 "DEJAGNU-BASH ERROR: set_test not set"
++              exit 1
++      fi
++      # Provide the leading whitespace delimiter:
++      echo " $1: $set_test"
++      set_test=""
++}
++
++function pass() {
++      record_test PASS
++}
++function fail() {
++      record_test FAIL
++}
++
++
++# Verify that the gdb output doesn't contain $1.
++function mustNotHave() {
++    local BADWORD=$1
++    set_test gdb output contains "$BADWORD"
++    if grep -q "$BADWORD" $LOG ; then
++        fail
++        return 1
++    fi
++    pass
++    return 0
++}
++
++# Verify that the gdb output contains exactly $1 $2s.
++function mustHaveCorrectAmount() {
++    local WANTEDNUMBER=$1
++    local GOODWORD=$2
++    local ACTUALNUMBER=$(grep "$GOODWORD" $LOG | wc -l)
++    set_test gdb output contained $ACTUALNUMBER \""$GOODWORD"\", not $WANTEDNUMBER as expected
++    if [ $ACTUALNUMBER != $WANTEDNUMBER ] ; then
++        fail
++        return 1
++    fi
++    pass
++    return 0
++}
++
++# Verify that the gdb output contains seven threads
++function mustHaveSevenThreads() {
++    NTHREADS=$(egrep "^Thread [1-7] \(" $LOG | wc -l)
++    set_test gdb output contains $NTHREADS threads, not 7 as expected
++    if [ $NTHREADS != 7 ] ; then
++        fail
++        return 1
++    fi
++    pass
++    return 0
++}
++
++# Verify that the gdb output has all parameters on consecutive lines
++function mustHaveSequence() {
++    SEQUENCE="$*"
++    NPARTS=$#
++    grep "$1" -A$((NPARTS - 1)) $LOG > matches.log
++
++    while [ $# -gt 1 ] ; do
++        shift
++        ((NPARTS--))
++        grep "$1" -A$((NPARTS - 1)) matches.log > temp.log
++        mv temp.log matches.log
++    done
++    LASTPART=$1
++
++    set_test gdb output does not contain the sequence: $SEQUENCE
++    if ! grep -q "$LASTPART" matches.log ; then
++        fail
++        return 1
++    fi
++    pass
++    return 0
++}
++
++# Verify that $LOG contains all information we want
++function verifyLog() {
++    local FAILURES=0
++    
++    mustNotHave '??' || ((FAILURES++))
++    mustHaveCorrectAmount 12 threadcrash.c: || ((FAILURES++))
++    
++    mustHaveSevenThreads || ((FAILURES++))
++    mustHaveSequence sleep "makeSyscall (ignored=" || ((FAILURES++))
++    
++    mustHaveSequence sleep "syscallingSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
++    mustHaveSequence pthread_kill "makeSyscallFromSighandler (ignored=" || ((FAILURES++))
++    
++    mustHaveSequence sleep "syscallingAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
++    mustHaveSequence pthread_kill "makeSyscallFromAltSighandler (ignored=" || ((FAILURES++))
++    
++    mustHaveSequence Thread "spin (ignored=" || ((FAILURES++))
++    
++    mustHaveSequence "spinningSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
++    mustHaveSequence pthread_kill "spinFromSighandler (ignored=" || ((FAILURES++))
++    
++    mustHaveSequence "spinningAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
++    mustHaveSequence pthread_kill "spinFromAltSighandler (ignored=" || ((FAILURES++))
++    
++    mustHaveSequence Thread "main (argc=1, argv=" || ((FAILURES++))
++
++    return $FAILURES
++}
++
++# Put result of debugging a core file in $LOG
++function getLogFromCore() {
++    # Make sure we get a core file
++    set_test Make sure we get a core file
++    if ! ulimit -c unlimited ; then
++        fail
++        exit 1
++    fi
++    pass
++
++    # Run the crasher
++    ./$(basename "$RUNME")
++    EXITCODE=$?
++
++    # Verify that we actually crashed
++    set_test $RUNME should have been killed by a signal, got non-signal exit code $EXITCODE
++    if [ $EXITCODE -lt 128 ] ; then
++        fail
++        exit 1
++    fi
++    pass
++
++    # Verify that we got a core file
++    set_test $RUNME did not create a core file
++    if [ ! -r core* ] ; then
++        fail
++        exit 1
++    fi
++    pass
++
++    # Run gdb
++    cat > gdbscript.gdb <<EOF
++set width 0
++t a a bt 100
++quit
++EOF
++    cat gdbscript.gdb /dev/zero | $GDB -nx "./$(basename "$RUNME")" core* > $LOG
++    EXITCODE=$?
++
++    set_test gdb exited with error code
++    if [ $EXITCODE != 0 ] ; then
++        ((FAILURES++))
++        echo >&2 gdb exited with error code $EXITCODE
++      fail
++    fi
++    pass
++}
++
++# Put result of debugging a gcore file in $LOG
++function getLogFromGcore() {
++    # Create the core file
++    rm -f core*
++    cat > gdbscript.gdb <<EOF
++handle SIGQUIT pass noprint nostop
++handle SIGUSR1 pass noprint nostop
++handle SIGUSR2 pass noprint nostop
++handle SIGALRM pass noprint nostop
++run
++gcore
++quit
++EOF
++    cat gdbscript.gdb /dev/zero | $GDB -nx "./$(basename "$RUNME")" > /dev/null
++    EXITCODE=$?
++
++    set_test gdb exited with error code when creating gcore file
++    if [ $EXITCODE != 0 ] ; then
++        ((FAILURES++))
++        echo >&2 gdb exited with error code $EXITCODE when creating gcore file
++      fail
++    fi
++    pass
++    
++    # Verify that we got a core file from gcore
++    set_test gdb gcore did not create a core file
++    if [ ! -r core* ] ; then
++        fail
++        exit 1
++    fi
++    pass
++
++    # Run gdb on the gcore file
++    cat > gdbscript.gdb <<EOF
++set width 0
++t a a bt 100
++quit
++EOF
++    cat gdbscript.gdb /dev/zero | $GDB -nx "./$(basename "$RUNME")" core* > $LOG
++    EXITCODE=$?
++
++    set_test gdb exited with error code when examining gcore file
++    if [ $EXITCODE != 0 ] ; then
++        ((FAILURES++))
++        echo >&2 gdb exited with error code $EXITCODE when examining gcore file
++      fail
++    fi
++    pass
++}
++
++# Put result of debugging a core file in $LOG
++function getLogFromLiveProcess() {
++    # Run gdb
++    cat > gdbscript.gdb <<EOF
++handle SIGQUIT pass noprint nostop
++handle SIGUSR1 pass noprint nostop
++handle SIGUSR2 pass noprint nostop
++handle SIGALRM pass noprint nostop
++set width 0
++run
++t a a bt 100
++quit
++EOF
++    cat gdbscript.gdb /dev/zero | $GDB -nx "./$(basename "$RUNME")" > $LOG
++    EXITCODE=$?
++
++    set_test gdb exited with error code
++    if [ $EXITCODE != 0 ] ; then
++        ((FAILURES++))
++        echo >&2 gdb exited with error code $EXITCODE
++      fail
++    fi
++    pass
++}
++
++####### Main program follows #####################
++
++# Make sure we don't clobber anybody else's (core) file(s)
++WORKDIR=/tmp/$PPID
++mkdir -p $WORKDIR
++cp "$RUNME" $WORKDIR
++cd $WORKDIR
++
++# Count problems
++FAILURES=0
++
++echo === Testing gdb vs core file...
++pf_prefix core file
++getLogFromCore
++verifyLog
++((FAILURES+=$?))
++pf_prefix
++echo === Core file tests done.
++
++echo
++
++echo === Testing gdb vs gcore file...
++pf_prefix gcore file
++getLogFromGcore
++verifyLog
++((FAILURES+=$?))
++pf_prefix
++echo === Gcore file tests done.
++
++echo
++
++echo === Testing gdb vs live process...
++pf_prefix live process
++getLogFromLiveProcess
++verifyLog
++((FAILURES+=$?))
++pf_prefix
++echo === Live process tests done.
++
++# Executive summary
++echo
++if [ $FAILURES == 0 ] ; then
++    echo All tests passed!
++else
++    echo $FAILURES tests failed!
++    echo
++    echo Make sure the threadcrash binary contains debugging information \(build with \"gcc -g\"\).
++fi
++
++# Clean up
++cd /
++rm -rf $WORKDIR
++
++exit $FAILURES
+Index: ./gdb/testsuite/gdb.threads/threadcrash.sh-orig
+===================================================================
+RCS file: gdb/testsuite/gdb.threads/threadcrash.sh-orig
+diff -N gdb/testsuite/gdb.threads/threadcrash.sh-orig
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.threads/threadcrash.sh-orig    31 Oct 2006 17:54:38 -0000
+@@ -0,0 +1,248 @@
++#! /bin/bash
++
++# NOTE: threadcrash.c *must* be built with debugging symbols
++#
++# The point of this shell script is to crash treadcrash.c, load the
++# resulting core file into gdb and verify that gdb can extract enough
++# information from the core file.
++#
++# The return code from this script is the number of failed tests.
++
++LOG=gdbresult.log
++
++if [ $# != 1 ] ; then
++    echo > /dev/stderr Syntax: $0 \<name of threadcrash binary\>
++    exit 1
++fi
++RUNME="$1"
++
++# Verify that the gdb output doesn't contain $1.
++function mustNotHave() {
++    local BADWORD=$1
++    if grep -q "$BADWORD" $LOG ; then
++        echo >> /dev/stderr WARNING: gdb output contains "$BADWORD"
++        return 1
++    fi
++    return 0
++}
++
++# Verify that the gdb output contains exactly $1 $2s.
++function mustHaveCorrectAmount() {
++    local WANTEDNUMBER=$1
++    local GOODWORD=$2
++    local ACTUALNUMBER=$(grep "$GOODWORD" $LOG | wc -l)
++    if [ $ACTUALNUMBER != $WANTEDNUMBER ] ; then
++        echo >> /dev/stderr WARNING: gdb output contained $ACTUALNUMBER \""$GOODWORD"\", not $WANTEDNUMBER as expected
++        return 1
++    fi
++    return 0
++}
++
++# Verify that the gdb output contains seven threads
++function mustHaveSevenThreads() {
++    NTHREADS=$(egrep "^Thread [1-7] \(" $LOG | wc -l)
++    if [ $NTHREADS != 7 ] ; then
++        echo >> /dev/stderr WARNING: gdb output contains $NTHREADS threads, not 7 as expected
++        return 1
++    fi
++    return 0
++}
++
++# Verify that the gdb output has all parameters on consecutive lines
++function mustHaveSequence() {
++    SEQUENCE="$*"
++    NPARTS=$#
++    grep "$1" -A$((NPARTS - 1)) $LOG > matches.log
++
++    while [ $# -gt 1 ] ; do
++        shift
++        ((NPARTS--))
++        grep "$1" -A$((NPARTS - 1)) matches.log > temp.log
++        mv temp.log matches.log
++    done
++    LASTPART=$1
++
++    if ! grep -q "$LASTPART" matches.log ; then
++        echo >> /dev/stderr WARNING: gdb output does not contain the sequence: $SEQUENCE
++        return 1
++    fi
++    return 0
++}
++
++# Verify that $LOG contains all information we want
++function verifyLog() {
++    local FAILURES=0
++    
++    mustNotHave '??' || ((FAILURES++))
++    mustHaveCorrectAmount 12 threadcrash.c: || ((FAILURES++))
++    
++    mustHaveSevenThreads || ((FAILURES++))
++    mustHaveSequence sleep "makeSyscall (ignored=" || ((FAILURES++))
++    
++    mustHaveSequence sleep "syscallingSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
++    mustHaveSequence pthread_kill "makeSyscallFromSighandler (ignored=" || ((FAILURES++))
++    
++    mustHaveSequence sleep "syscallingAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
++    mustHaveSequence pthread_kill "makeSyscallFromAltSighandler (ignored=" || ((FAILURES++))
++    
++    mustHaveSequence Thread "spin (ignored=" || ((FAILURES++))
++    
++    mustHaveSequence "spinningSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
++    mustHaveSequence pthread_kill "spinFromSighandler (ignored=" || ((FAILURES++))
++    
++    mustHaveSequence "spinningAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
++    mustHaveSequence pthread_kill "spinFromAltSighandler (ignored=" || ((FAILURES++))
++    
++    mustHaveSequence Thread "main (argc=1, argv=" || ((FAILURES++))
++
++    return $FAILURES
++}
++
++# Put result of debugging a core file in $LOG
++function getLogFromCore() {
++    # Make sure we get a core file
++    ulimit -c unlimited || exit 1
++
++    # Run the crasher
++    ./$(basename "$RUNME")
++    EXITCODE=$?
++
++    # Verify that we actually crashed
++    if [ $EXITCODE -lt 128 ] ; then
++        echo >> /dev/stderr ERROR: $RUNME should have been killed by a signal, got non-signal exit code $EXITCODE
++        exit 1
++    fi
++
++    # Verify that we got a core file
++    if [ ! -r core* ] ; then
++        echo >> /dev/stderr ERROR: $RUNME did not create a core file
++        exit 1
++    fi
++
++    # Run gdb
++    cat > gdbscript.gdb <<EOF
++set width 0
++t a a bt 100
++quit
++EOF
++    cat gdbscript.gdb /dev/zero | gdb -nx "./$(basename "$RUNME")" core* > $LOG
++    EXITCODE=$?
++
++    if [ $EXITCODE != 0 ] ; then
++        ((FAILURES++))
++        echo >> /dev/stderr WARNING: gdb exited with error code $EXITCODE
++    fi
++}
++
++# Put result of debugging a gcore file in $LOG
++function getLogFromGcore() {
++    # Create the core file
++    rm -f core*
++    cat > gdbscript.gdb <<EOF
++handle SIGQUIT pass noprint nostop
++handle SIGUSR1 pass noprint nostop
++handle SIGUSR2 pass noprint nostop
++handle SIGALRM pass noprint nostop
++run
++gcore
++quit
++EOF
++    cat gdbscript.gdb /dev/zero | gdb -nx "./$(basename "$RUNME")" > /dev/null
++    EXITCODE=$?
++
++    if [ $EXITCODE != 0 ] ; then
++        ((FAILURES++))
++        echo >> /dev/stderr WARNING: gdb exited with error code $EXITCODE when creating gcore file
++    fi
++    
++    # Verify that we got a core file from gcore
++    if [ ! -r core* ] ; then
++        echo >> /dev/stderr ERROR: gdb gcore did not create a core file
++        exit 1
++    fi
++
++    # Run gdb on the gcore file
++    cat > gdbscript.gdb <<EOF
++set width 0
++t a a bt 100
++quit
++EOF
++    cat gdbscript.gdb /dev/zero | gdb -nx "./$(basename "$RUNME")" core* > $LOG
++    EXITCODE=$?
++
++    if [ $EXITCODE != 0 ] ; then
++        ((FAILURES++))
++        echo >> /dev/stderr WARNING: gdb exited with error code $EXITCODE when examining gcore file
++    fi
++}
++
++# Put result of debugging a core file in $LOG
++function getLogFromLiveProcess() {
++    # Run gdb
++    cat > gdbscript.gdb <<EOF
++handle SIGQUIT pass noprint nostop
++handle SIGUSR1 pass noprint nostop
++handle SIGUSR2 pass noprint nostop
++handle SIGALRM pass noprint nostop
++set width 0
++run
++t a a bt 100
++quit
++EOF
++    cat gdbscript.gdb /dev/zero | gdb -nx "./$(basename "$RUNME")" > $LOG
++    EXITCODE=$?
++
++    if [ $EXITCODE != 0 ] ; then
++        ((FAILURES++))
++        echo >> /dev/stderr WARNING: gdb exited with error code $EXITCODE
++    fi
++}
++
++####### Main program follows #####################
++
++# Make sure we don't clobber anybody else's (core) file(s)
++WORKDIR=/tmp/$PPID
++mkdir -p $WORKDIR
++cp "$RUNME" $WORKDIR
++cd $WORKDIR
++
++# Count problems
++FAILURES=0
++
++echo === Testing gdb vs core file...
++getLogFromCore
++verifyLog
++((FAILURES+=$?))
++echo === Core file tests done.
++
++echo
++
++echo === Testing gdb vs gcore file...
++getLogFromGcore
++verifyLog
++((FAILURES+=$?))
++echo === Gcore file tests done.
++
++echo
++
++echo === Testing gdb vs live process...
++getLogFromLiveProcess
++verifyLog
++((FAILURES+=$?))
++echo === Live process tests done.
++
++# Executive summary
++echo
++if [ $FAILURES == 0 ] ; then
++    echo All tests passed!
++else
++    echo $FAILURES tests failed!
++    echo
++    echo Make sure the threadcrash binary contains debugging information \(build with \"gcc -g\"\).
++fi
++
++# Clean up
++cd /
++rm -rf $WORKDIR
++
++exit $FAILURES
diff --git a/gdb/patches/gdb-6.5-bz109921-DW_AT_decl_file-test.patch b/gdb/patches/gdb-6.5-bz109921-DW_AT_decl_file-test.patch
new file mode 100644 (file)
index 0000000..70be875
--- /dev/null
@@ -0,0 +1,120 @@
+https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=109921
+
+It is duplicite to its upstream variant:
+http://sourceware.org/ml/gdb-cvs/2007-01/msg00157.html
+http://sourceware.org/ml/gdb-patches/2007-01/msg00434.html
+2007-01-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
+           Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * gdb.base/included.c, gdb.base/included.exp,
+       gdb.base/included.h: New files.
+
+------------------------------------------------------------------------------
+
+2007-01-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * gdb.dwarf2/dw2-included.exp, gdb.dwarf2/dw2-included.c,
+       gdb.dwarf2/dw2-included.h: New files.
+
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.dwarf2/dw2-included.c  2 Jan 2007 00:20:27 -0000
+@@ -0,0 +1,26 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2006 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#include "dw2-included.h"
++
++int
++main()
++{
++  return 0;
++}
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.dwarf2/dw2-included.exp        2 Jan 2007 00:20:27 -0000
+@@ -0,0 +1,47 @@
++# Copyright 2006 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++# Minimal DWARF-2 unit test
++
++# This test can only be run on targets which support DWARF-2.
++# For now pick a sampling of likely targets.
++if {![istarget *-*-linux*]
++    && ![istarget *-*-gnu*]
++    && ![istarget *-*-elf*]
++    && ![istarget *-*-openbsd*]
++    && ![istarget arm-*-eabi*]
++    && ![istarget powerpc-*-eabi*]} {
++    return 0  
++}
++
++set testfile "dw2-included"
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++gdb_test "set listsize 1" ""
++gdb_test "list integer" "int integer;\r"
++gdb_test "ptype integer" "type = int\r"
++# Path varies depending on the build location.
++gdb_test "info variables integer" "\r\nFile \[^\r\n\]*/gdb.dwarf2/dw2-included.h:\r\nint integer;\r"
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.dwarf2/dw2-included.h  2 Jan 2007 00:20:27 -0000
+@@ -0,0 +1,20 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2006 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++int integer;
diff --git a/gdb/patches/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch b/gdb/patches/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
new file mode 100644 (file)
index 0000000..fa2f4ed
--- /dev/null
@@ -0,0 +1,143 @@
+https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=185337
+
+2008-02-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Port to GDB-6.8pre.
+
+currently for trivial nonthreaded helloworld with no debug info up to -ggdb2 you
+will get:
+        (gdb) p errno
+        [some error]
+
+* with -ggdb2 and less "errno" in fact does not exist anywhere as it was
+  compiled to "(*__errno_location ())" and the macro definition is not present.
+  Unfortunately gdb will find the TLS symbol and it will try to access it but
+  as the program has been compiled without -lpthread the TLS base register
+  (%gs on i386) is not setup and it will result in:
+        Cannot access memory at address 0x8
+
+Attached suggestion patch how to deal with the most common "errno" symbol
+for the most common under-ggdb3 compiled programs.
+
+Original patch hooked into target_translate_tls_address.  But its inferior
+call invalidates `struct frame *' in the callers - RH BZ 690908.
+
+
+2007-11-03  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * ./gdb/dwarf2read.c (read_partial_die, dwarf2_linkage_name): Prefer
+       DW_AT_MIPS_linkage_name over DW_AT_name now only for non-C.
+
+glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug:
+  <81a2>     DW_AT_name        : (indirect string, offset: 0x280e): __errno_location
+  <81a8>     DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location
+
+--- a/gdb/printcmd.c
++++ b/gdb/printcmd.c
+@@ -967,6 +967,8 @@ print_command_1 (char *exp, int inspect, int voidprint)
+   if (exp && *exp)
+     {
++      if (strcmp (exp, "errno") == 0)
++      exp = "*((int *(*) (void)) __errno_location) ()";
+       expr = parse_expression (exp);
+       old_chain = make_cleanup (free_current_contents, &expr);
+       cleanup = 1;
+Index: gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.c       2011-03-29 10:55:35.000000000 +0200
+@@ -0,0 +1,28 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2005, 2007 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++   Please email any bugs, comments, and/or additions to this file to:
++   bug-gdb@prep.ai.mit.edu  */
++
++#include <errno.h>
++
++int main()
++{
++  errno = 42;
++
++  return 0;   /* breakpoint */
++}
+Index: gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.exp     2011-03-29 10:55:35.000000000 +0200
+@@ -0,0 +1,60 @@
++# Copyright 2007 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++set testfile dw2-errno
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++
++proc prep {} {
++    global srcdir subdir binfile
++    gdb_exit
++    gdb_start
++    gdb_reinitialize_dir $srcdir/$subdir
++    gdb_load ${binfile}
++
++    runto_main
++
++    gdb_breakpoint [gdb_get_line_number "breakpoint"]
++    gdb_continue_to_breakpoint "breakpoint"
++}
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g2"] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++prep
++gdb_test "print errno" ".* = 42" "errno with macros=N threads=N"
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g3"] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++prep
++gdb_test "print errno" ".* = 42" "errno with macros=Y threads=N"
++
++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g2"] != "" } {
++    return -1
++}
++prep
++gdb_test "print errno" ".* = 42" "errno with macros=N threads=Y"
++
++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "additional_flags=-g3"] != "" } {
++    return -1
++}
++prep
++gdb_test "print errno" ".* = 42" "errno with macros=Y threads=Y"
++
++# TODO: Test the error on resolving ERRNO with only libc loaded.
++# Just how to find the current libc filename?
diff --git a/gdb/patches/gdb-6.5-bz190810-gdbserver-arch-advice.patch b/gdb/patches/gdb-6.5-bz190810-gdbserver-arch-advice.patch
new file mode 100644 (file)
index 0000000..c702327
--- /dev/null
@@ -0,0 +1,28 @@
+https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=190810
+
+
+2006-09-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * remote.c (remote_wait): Suggestion on crash due to nonmatching target.
+       (remote_async_wait): Likewise.
+
+
+Index: gdb-6.8.50.20090818/gdb/remote.c
+===================================================================
+--- gdb-6.8.50.20090818.orig/gdb/remote.c      2009-08-18 21:00:35.000000000 +0200
++++ gdb-6.8.50.20090818/gdb/remote.c   2009-08-18 21:04:46.000000000 +0200
+@@ -4408,8 +4408,13 @@ Packet: '%s'\n"),
+             VEC_safe_push (cached_reg_t, event->regcache, &cached_reg);
+           }
++        /* It may also occur on amd64 which defaults to 32-bit i386
++           target.  gdbserver(1) is not aware of the `set architecture'
++           name itself as it is not using libbfd.  */
+         if (*p != ';')
+-          error (_("Remote register badly formatted: %s\nhere: %s"),
++          error (_("Remote register badly formatted: %s\nhere: %s"
++                   "\nTry to load the executable by `file' first,"
++                   "\nyou may also check `set/show architecture'."),
+                  buf, p);
+         ++p;
+       }
diff --git a/gdb/patches/gdb-6.5-bz203661-emit-relocs.patch b/gdb/patches/gdb-6.5-bz203661-emit-relocs.patch
new file mode 100644 (file)
index 0000000..61e0d56
--- /dev/null
@@ -0,0 +1,17 @@
+Index: gdb-7.0.90.20100306/gdb/symfile.c
+===================================================================
+--- gdb-7.0.90.20100306.orig/gdb/symfile.c     2010-03-06 23:20:35.000000000 +0100
++++ gdb-7.0.90.20100306/gdb/symfile.c  2010-03-06 23:26:25.000000000 +0100
+@@ -3642,6 +3642,12 @@ default_symfile_relocate (struct objfile
+ {
+   bfd *abfd = objfile->obfd;
++  /* Executable files have all the relocations already resolved.
++   * Handle files linked with --emit-relocs.
++   * http://sources.redhat.com/ml/gdb/2006-08/msg00137.html  */
++  if ((abfd->flags & EXEC_P) != 0)
++    return NULL;
++
+   /* We're only interested in sections with relocation
+      information.  */
+   if ((sectp->flags & SEC_RELOC) == 0)
diff --git a/gdb/patches/gdb-6.5-bz216711-clone-is-outermost.patch b/gdb/patches/gdb-6.5-bz216711-clone-is-outermost.patch
new file mode 100644 (file)
index 0000000..bb7038f
--- /dev/null
@@ -0,0 +1,133 @@
+https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216711
+
+FIXME: This workaround should be dropped and
+glibc/sysdeps/unix/sysv/linux/x86_64/clone.S should get CFI for the child
+instead.
+
+2006-12-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * gdb/amd64-linux-tdep.c (linux_clone_code): New variable.
+       (LINUX_CLONE_LEN): New definition.
+       (amd64_linux_clone_running, amd64_linux_outermost_frame): New function.
+       (amd64_linux_init_abi): Initialize `outermost_frame_p'.
+       * gdb/i386-tdep.c (i386_gdbarch_init): Likewise.
+       * gdb/i386-tdep.h (gdbarch_tdep): Add `outermost_frame_p' member.
+       * gdb/amd64-tdep.c (amd64_frame_this_id): Call `outermost_frame_p'.
+
+2006-12-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * gdb.threads/bt-clone-stop.exp, gdb.threads/bt-clone-stop.c:
+       New file.
+
+2007-10-16  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Port to GDB-6.7.
+
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20090802/gdb/testsuite/gdb.threads/bt-clone-stop.c      2009-08-03 15:50:08.000000000 +0200
+@@ -0,0 +1,39 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2006 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
++   MA 02110-1301, USA.  */
++
++
++#include <pthread.h>
++#include <unistd.h>
++#include <assert.h>
++
++
++void *threader (void *arg)
++{
++      assert (0);
++      return NULL;
++}
++
++int main (void)
++{
++      pthread_t t1;
++
++      pthread_create (&t1, NULL, threader, (void *) NULL);
++      for (;;)
++              pause();
++}
+Index: gdb-6.8.50.20090802/gdb/testsuite/gdb.threads/bt-clone-stop.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20090802/gdb/testsuite/gdb.threads/bt-clone-stop.exp    2009-08-03 15:50:08.000000000 +0200
+@@ -0,0 +1,61 @@
++# Copyright 2006 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# Backtraced `clone' must not have `PC == 0' as its previous frame.
++
++if $tracelevel then {
++    strace $tracelevel
++}
++
++set testfile bt-clone-stop
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++if  { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++
++# Get things started.
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++# threader: threader.c:8: threader: Assertion `0' failed.
++# Program received signal SIGABRT, Aborted.
++
++gdb_test "run" \
++     "Program received signal SIGABRT.*" \
++     "run"
++
++# Former gdb unwind (the first function is `clone'):
++# #5  0x0000003421ecd62d in ?? () from /lib64/libc.so.6
++# #6  0x0000000000000000 in ?? ()
++# (gdb)
++# Tested `amd64_linux_outermost_frame' functionality should omit the line `#6'.
++# 
++# Two `-re' cases below must be in this order (1st is a subset of the 2nd one).
++# Unhandled case below should not happen and it is fortunately handled by
++# `amd64_linux_outermost_frame' as FAIL (and result `0x0 entry output invalid').
++gdb_test_multiple "bt" "0x0 entry output invalid" {
++    -re "in threader \\(.*\n#\[0-9\]* *0x0* in .*$gdb_prompt $" {
++      fail "0x0 entry found"
++    }
++    -re "in threader \\(.*$gdb_prompt $" {
++      pass "0x0 entry not found"
++    }
++}
diff --git a/gdb/patches/gdb-6.5-bz218379-ppc-solib-trampoline-test.patch b/gdb/patches/gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
new file mode 100644 (file)
index 0000000..bb6f3f1
--- /dev/null
@@ -0,0 +1,91 @@
+https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
+
+
+--- /dev/null  2006-12-17 14:18:21.881669220 -0500
++++ gdb-6.5/gdb/testsuite/gdb.base/step-over-trampoline.exp    2006-12-17 16:52:51.000000000 -0500
+@@ -0,0 +1,54 @@
++# Copyright 2006 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++if $tracelevel then {
++    strace $tracelevel
++}
++
++set testfile step-over-trampoline
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++
++# Get things started.
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++# For C programs, "start" should stop in main().
++
++gdb_test "start" \
++         "main \\(\\) at .*$srcfile.*" \
++         "start"
++
++# main () at hello2.c:5
++# 5           puts("hello world\n");
++# (gdb) next
++# 0x100007e0 in call___do_global_ctors_aux ()
++
++gdb_test_multiple "next" "invalid `next' output" {
++      -re "\nhello world.*return 0;.*" {
++              pass "stepped over"
++      }
++      -re " in call___do_global_ctors_aux \\(\\).*" {
++              fail "stepped into trampoline"
++      }
++}
+--- /dev/null  2006-12-17 14:18:21.881669220 -0500
++++ gdb-6.5/gdb/testsuite/gdb.base/step-over-trampoline.c      2006-12-17 16:18:12.000000000 -0500
+@@ -0,0 +1,28 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2006 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++   Please email any bugs, comments, and/or additions to this file to:
++   bug-gdb@prep.ai.mit.edu  */
++
++#include <stdio.h>
++
++int main (void)
++{
++      puts ("hello world");
++      return 0;
++}
diff --git a/gdb/patches/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch b/gdb/patches/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
new file mode 100644 (file)
index 0000000..082b9a0
--- /dev/null
@@ -0,0 +1,21 @@
+https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
+
+
+Index: gdb-7.2.50.20110117/gdb/symtab.c
+===================================================================
+--- gdb-7.2.50.20110117.orig/gdb/symtab.c      2011-01-17 15:47:37.000000000 +0100
++++ gdb-7.2.50.20110117/gdb/symtab.c   2011-01-17 15:51:48.000000000 +0100
+@@ -2015,6 +2015,13 @@ find_pc_sect_line (CORE_ADDR pc, struct 
+            SYMBOL_LINKAGE_NAME (msymbol)); */
+         ;
+       /* fall through */
++      /* `msymbol' trampoline may be located before its .text symbol
++         but this text symbol may be the address we were looking for.
++         Avoid `find_pc_sect_line'<->`find_pc_line' infinite loop.
++         Red Hat Bug 218379.  */
++      else if (SYMBOL_VALUE (mfunsym) == pc)
++        warning ("In stub for %s (0x%s); interlocked, please submit the binary to http://bugzilla.redhat.com", SYMBOL_LINKAGE_NAME (msymbol), paddress (target_gdbarch, pc));
++      /* fall through */
+       else
+         return find_pc_line (SYMBOL_VALUE_ADDRESS (mfunsym), 0);
+       }
diff --git a/gdb/patches/gdb-6.5-bz243845-stale-testing-zombie-test.patch b/gdb/patches/gdb-6.5-bz243845-stale-testing-zombie-test.patch
new file mode 100644 (file)
index 0000000..1c9b1f2
--- /dev/null
@@ -0,0 +1,79 @@
+diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.base/tracefork-zombie.exp gdb-6.3/gdb/testsuite/gdb.base/tracefork-zombie.exp
+--- gdb-6.3-unpatched/gdb/testsuite/gdb.base/tracefork-zombie.exp      1969-12-31 19:00:00.000000000 -0500
++++ gdb-6.3/gdb/testsuite/gdb.base/tracefork-zombie.exp        2007-07-31 13:04:12.000000000 -0400
+@@ -0,0 +1,75 @@
++# Copyright 2007 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++
++# are we on a target board
++if [is_remote target] then {
++    return 0
++}
++
++# Start the program running and then wait for a bit, to be sure
++# that it can be attached to.
++
++gdb_exit
++gdb_start
++gdb_load sleep
++
++set gdb_pid [exp_pid -i [board_info host fileid]]
++set test "identified the child GDB"
++if {$gdb_pid != "" && $gdb_pid > 0} {
++    pass $test
++    verbose -log "Child GDB PID $gdb_pid"
++} else {
++    fail $test
++}
++
++set testpid [eval exec sleep 10 &]
++exec sleep 2
++
++set test "attach"
++gdb_test_multiple "attach $testpid" "$test" {
++    -re "Attaching to program.*`?.*'?, process $testpid..*$gdb_prompt $" {
++      pass "$test"
++    }
++    -re "Attaching to program.*`?.*\.exe'?, process $testpid.*\[Switching to thread $testpid\..*\].*$gdb_prompt $" {
++      # Response expected on Cygwin
++      pass "$test"
++    }
++}
++
++# Some time to let GDB spawn its testing child.
++exec sleep 2
++
++set found none
++foreach procpid [glob -directory /proc -type d {[0-9]*}] {
++    if {[catch {open $procpid/status} statusfi]} {
++      continue
++    }
++    set status [read $statusfi]
++    close $statusfi
++    if {1
++         && [regexp -line {^Name:\tgdb$} $status]
++         && [regexp -line {^PPid:\t1$} $status]
++         && [regexp -line "^TracerPid:\t$gdb_pid$" $status]} {
++      set found $procpid
++      verbose -log "Found linux_test_for_tracefork zombie PID $procpid"
++    }
++}
++set test "linux_test_for_tracefork leaves no zombie"
++if {$found eq {none}} {
++    pass $test
++} else {
++    fail $test
++}
diff --git a/gdb/patches/gdb-6.5-gcore-buffer-limit-test.patch b/gdb/patches/gdb-6.5-gcore-buffer-limit-test.patch
new file mode 100644 (file)
index 0000000..dad4833
--- /dev/null
@@ -0,0 +1,139 @@
+diff -u -X /home/jkratoch/.diffi.list -ruNp gdb-6.5/gdb/testsuite/gdb.base/gcore-excessive-memory.c gdb-6.5-unknown/gdb/testsuite/gdb.base/gcore-excessive-memory.c
+--- gdb-6.5/gdb/testsuite/gdb.base/gcore-excessive-memory.c    1970-01-01 01:00:00.000000000 +0100
++++ gdb-6.5-unknown/gdb/testsuite/gdb.base/gcore-excessive-memory.c    2008-01-08 11:25:45.000000000 +0100
+@@ -0,0 +1,37 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2008 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++   Please email any bugs, comments, and/or additions to this file to:
++   bug-gdb@prep.ai.mit.edu  */
++
++#include <unistd.h>
++#include <stdlib.h>
++
++#define MEGS 64
++
++int main()
++{
++  void *mem;
++  
++  mem = malloc (MEGS * 1024ULL * 1024ULL);
++
++  for (;;)
++    sleep (1);
++
++  return 0;
++}
+diff -u -X /home/jkratoch/.diffi.list -ruNp gdb-6.5/gdb/testsuite/gdb.base/gcore-excessive-memory.exp gdb-6.5-unknown/gdb/testsuite/gdb.base/gcore-excessive-memory.exp
+--- gdb-6.5/gdb/testsuite/gdb.base/gcore-excessive-memory.exp  1970-01-01 01:00:00.000000000 +0100
++++ gdb-6.5-unknown/gdb/testsuite/gdb.base/gcore-excessive-memory.exp  2008-01-08 11:47:32.000000000 +0100
+@@ -0,0 +1,94 @@
++# Copyright 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++set testfile gcore-excessive-memory
++set srcfile ${testfile}.c
++set shfile ${objdir}/${subdir}/${testfile}-gdb.sh
++set corefile ${objdir}/${subdir}/${testfile}.core
++set binfile ${objdir}/${subdir}/${testfile}
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++
++set f [open "|getconf PAGESIZE" "r"]
++gets $f pagesize
++close $f
++
++set pid_of_bin [eval exec $binfile &]
++sleep 2
++
++# Get things started.
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++set pid_of_gdb [exp_pid -i [board_info host fileid]]
++
++gdb_test "attach $pid_of_bin" "Attaching to .*" "attach"
++gdb_test "up 99" "in main .*" "verify we can get to main"
++
++proc memory_v_pages_get {} {
++    global pid_of_gdb pagesize
++    set fd [open "/proc/$pid_of_gdb/statm"]
++    gets $fd line
++    close $fd
++    # number of pages of virtual memory
++    scan $line "%d" drs
++    return $drs
++}
++
++set pages_found [memory_v_pages_get]
++
++# It must be definitely less than `MEGS' of `gcore-excessive-memory.c'.
++set mb_gcore_reserve 4
++verbose -log "pages_found = $pages_found, mb_gcore_reserve = $mb_gcore_reserve"
++set kb_found [expr $pages_found * $pagesize / 1024]
++set kb_permit [expr $kb_found + 1 * 1024 + $mb_gcore_reserve * 1024]
++verbose -log "kb_found = $kb_found, kb_permit = $kb_permit"
++
++# Create the ulimit wrapper.
++set f [open $shfile "w"]
++puts $f "#! /bin/sh"
++puts $f "ulimit -v $kb_permit"
++puts $f "exec $GDB \"\$@\""
++close $f
++remote_exec host "chmod +x $shfile"
++
++gdb_exit
++set GDBold $GDB
++set GDB "$shfile"
++gdb_start
++set GDB $GDBold
++
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++set pid_of_gdb [exp_pid -i [board_info host fileid]]
++
++gdb_test "attach $pid_of_bin" "Attaching to .*" "attach"
++gdb_test "up 99" "in main .*" "verify we can get to main"
++
++verbose -log "kb_found before gcore = [expr [memory_v_pages_get] * $pagesize / 1024]"
++
++gdb_test "gcore $corefile" "Saved corefile \[^\n\r\]*" "Save the core file"
++
++verbose -log "kb_found after gcore = [expr [memory_v_pages_get] * $pagesize / 1024]"
++
++# Cleanup.
++exec kill -9 $pid_of_bin
diff --git a/gdb/patches/gdb-6.5-ia64-libunwind-leak-test.patch b/gdb/patches/gdb-6.5-ia64-libunwind-leak-test.patch
new file mode 100644 (file)
index 0000000..c77c677
--- /dev/null
@@ -0,0 +1,120 @@
+diff -u -rup gdb-6.3-orig/gdb/testsuite/gdb.base/unwind-leak.c gdb-6.3/gdb/testsuite/gdb.base/unwind-leak.c
+--- gdb-6.3-orig/gdb/testsuite/gdb.base/unwind-leak.c  2007-12-19 15:12:55.000000000 -0500
++++ gdb-6.3/gdb/testsuite/gdb.base/unwind-leak.c       2007-12-19 13:55:22.000000000 -0500
+@@ -0,0 +1,29 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2007 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++   Please email any bugs, comments, and/or additions to this file to:
++   bug-gdb@prep.ai.mit.edu  */
++
++#include <unistd.h>
++
++int main()
++{
++  for (;;)
++    alarm (0);
++  return 0;
++}
+diff -u -rup gdb-6.3-orig/gdb/testsuite/gdb.base/unwind-leak.exp gdb-6.3/gdb/testsuite/gdb.base/unwind-leak.exp
+--- gdb-6.3-orig/gdb/testsuite/gdb.base/unwind-leak.exp        2007-12-19 15:12:53.000000000 -0500
++++ gdb-6.3/gdb/testsuite/gdb.base/unwind-leak.exp     2007-12-19 15:11:35.000000000 -0500
+@@ -0,0 +1,83 @@
++# Copyright 2007 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++set testfile unwind-leak
++set srcfile ${testfile}.c
++set shfile ${objdir}/${subdir}/${testfile}-gdb.sh
++set binfile ${objdir}/${subdir}/${testfile}
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++
++# Get things started.
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++set pid [exp_pid -i [board_info host fileid]]
++
++# For C programs, "start" should stop in main().
++
++gdb_test "start" \
++         "main \\(\\) at .*$srcfile.*" \
++         "start"
++
++set loc [gdb_get_line_number "alarm"]
++gdb_breakpoint $loc
++
++proc memory_get {} {
++    global pid
++    set fd [open "/proc/$pid/statm"]
++    gets $fd line
++    close $fd
++    # number of pages of data/stack
++    scan $line "%*d%*d%*d%*d%*d%d" drs
++    return $drs
++}
++
++set cycles 100
++# For 100 cycles it was 1308: from = 363 KB, to = 1671 KB
++set permit_kb 100
++verbose -log "cycles = $cycles, permit_kb = $permit_kb"
++
++set fail 0
++set test "breakpoint stop/continue cycles" 
++for {set i $cycles} {$i > 0} {set i [expr {$i - 1}]} {
++    gdb_test_multiple "continue" $test {
++      -re "Breakpoint 2, main .*alarm .*.*${gdb_prompt} $" {
++      }
++      -re "Segmentation fault" {
++          fail $test
++          set i 0
++          set fail 1
++      }
++    }
++    if ![info exists from] {
++      set from [memory_get]
++    }
++}
++set to [memory_get]
++if {!$fail} {
++    verbose -log "from = $from KB, to = $to KB"
++    if {$from > 0 && $to > 10 && $to < $from + $permit_kb} {
++      pass $test
++    } else {
++      fail $test
++    }
++}
diff --git a/gdb/patches/gdb-6.5-last-address-space-byte-test.patch b/gdb/patches/gdb-6.5-last-address-space-byte-test.patch
new file mode 100644 (file)
index 0000000..8bdbb2b
--- /dev/null
@@ -0,0 +1,56 @@
+Index: ./gdb/testsuite/gdb.base/largecore-last-address-lock.exp
+===================================================================
+RCS file: ./gdb/testsuite/gdb.base/largecore-last-address-lock.exp
+diff -N ./gdb/testsuite/gdb.base/largecore-last-address-lock.exp
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.base/largecore-last-address-lock.exp   15 Nov 2006 21:43:24 -0000
+@@ -0,0 +1,49 @@
++# Copyright 2006 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++if $tracelevel then {
++    strace $tracelevel
++}
++
++# Get things started.
++
++gdb_exit
++gdb_start
++
++# i386 (32-bit) only: gdb with Red Hat largecore patch did lock up:
++# https://enterprise.redhat.com/issue-tracker/?module=issues&action=view&tid=103263
++# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=210614
++
++# i386: Bug exists when the `target_xfer_memory' condition
++# `(memaddr + len < region->hi)' operates on 64-bit operands on
++# largecore-patched with 32-bit addresses and so it can get `false' with
++# arbitrary `len'.
++
++# x86_64: The bug is not present as the operands and calculations have the same
++# bit size.  Would would still need to pass there the highest address
++# (`memaddr == 0xffffffffffffffff') but we would need to pass `len == 0'
++# to make the condition `(memaddr + len < region->hi)' false.
++# `len == 0' would get caught eariler.
++
++# Error in the success case is immediate.
++set timeoutold ${timeout}
++set timeout 10
++
++gdb_test "x/xb 0xffffffff" \
++         "Cannot access memory at address 0xffffffff" \
++         "Read the last address space byte"
++
++set timeout ${timeoutold}
diff --git a/gdb/patches/gdb-6.5-missed-trap-on-step-test.patch b/gdb/patches/gdb-6.5-missed-trap-on-step-test.patch
new file mode 100644 (file)
index 0000000..2f4436d
--- /dev/null
@@ -0,0 +1,83 @@
+Fix has been committed to:
+       gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch
+
+--- /dev/null  2007-12-14 20:45:09.113039517 +0100
++++ gdb-6.5/gdb/testsuite/gdb.base/watchpoint-during-step.exp  2007-12-24 19:42:00.000000000 +0100
+@@ -0,0 +1,44 @@
++# Copyright 2007 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++set testfile watchpoint-during-step
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++
++# Get things started.
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++runto_main
++
++gdb_breakpoint [gdb_get_line_number "var = 2"]
++gdb_continue_to_breakpoint "Find the first var set"
++
++gdb_test "step" ".*var = 3;" "Step to the next var set"
++
++gdb_test "watch var" "atchpoint .*: var" "Set the watchpoint"
++
++# Here is the target point.  Be careful to not have breakpoint set on the line
++# we step from as in this case it is a valid upstream KFAIL gdb/38
++
++gdb_test "step" ".*Old value = 2.*New value = 3.*" "Catch the watchpoint"
+--- /dev/null  2007-12-14 20:45:09.113039517 +0100
++++ gdb-6.5/gdb/testsuite/gdb.base/watchpoint-during-step.c    2007-12-24 19:38:10.000000000 +0100
+@@ -0,0 +1,30 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2007 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++   Please email any bugs, comments, and/or additions to this file to:
++   bug-gdb@prep.ai.mit.edu  */
++
++static int var;
++
++int main()
++{
++  var = 1;
++  var = 2;
++  var = 3;
++  return 0;
++}
diff --git a/gdb/patches/gdb-6.5-readline-long-line-crash-test.patch b/gdb/patches/gdb-6.5-readline-long-line-crash-test.patch
new file mode 100644 (file)
index 0000000..86a82a4
--- /dev/null
@@ -0,0 +1,136 @@
+https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214196
+
+
+Index: ./gdb/testsuite/gdb.base/readline-overflow.exp
+===================================================================
+RCS file: ./gdb/testsuite/gdb.base/readline-overflow.exp
+diff -N ./gdb/testsuite/gdb.base/readline-overflow.exp
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.base/readline-overflow.exp     13 Nov 2006 23:42:50 -0000
+@@ -0,0 +1,125 @@
++# Copyright 2006 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# Please email any bugs, comments, and/or additions to this file to:
++# bug-gdb@prep.ai.mit.edu
++
++# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>
++
++# This file is part of the gdb testsuite.
++
++#
++# Tests for readline buffer overflow.
++#
++
++if $tracelevel {
++  strace $tracelevel
++}
++
++# Don't let a .inputrc file or an existing setting of INPUTRC mess up
++# the test results.  Even if /dev/null doesn't exist on the particular
++# platform, the readline library will use the default setting just by
++# failing to open the file.  OTOH, opening /dev/null successfully will
++# also result in the default settings being used since nothing will be
++# read from this file.
++global env
++if [info exists env(INPUTRC)] {
++    set old_inputrc $env(INPUTRC)
++}
++set env(INPUTRC) "/dev/null"
++
++set oldtimeout1 $timeout
++set timeout 600
++
++if [info exists env(GDBHISTFILE)] {
++    set old_gdbhistfile $env(GDBHISTFILE)
++}
++if [info exists env(HISTSIZE)] {
++    set old_histsize $env(HISTSIZE)
++}
++set env(GDBHISTFILE) "${srcdir}/${subdir}/gdb_history"
++set env(HISTSIZE) "10"
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++
++
++set width 11
++gdb_test "set width $width" \
++         "" \
++         "Setting width to $width."
++#gdb_test "set height 1" \
++#         "" \
++#         "Setting height to 1."
++send_gdb "run X"
++set i 0
++# It crashes using `set width 7' on `set total 3560'.
++# Sometimes it corrupts screen on `set width 7'.
++# Bugreport used `set total 130001':
++#     https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214196
++# Check also `timeout' above.
++set total 4200
++gdb_expect {
++      -re X {
++              incr i
++              if {$i <= $total} {
++                      send_gdb "X"
++                      exp_continue
++              }
++      }
++      -re "\[ \b\r\n\]" {
++              exp_continue
++      }
++      eof {
++              fail "gdb sending total $total characters"
++              note "Failed after sending $i characters, reason: EOF"
++              gdb_clear_suppressed
++      }
++      timeout {
++              fail "gdb sending total $total characters"
++              note "Failed after sending $i characters (timeout $timeout), reason: TIMEOUT"
++              gdb_clear_suppressed
++      }
++      default {
++              fail "gdb sending total $total characters"
++              note "Failed after sending $i characters, reason: 0=\[$expect_out(0,string)\] buffer=\[$expect_out(buffer)\]"
++              gdb_clear_suppressed
++      }
++}
++gdb_test "\r" \
++         "No executable file specified..*" \
++         "All the characters transferred"
++
++
++# Restore globals modified in this test...
++if [info exists old_inputrc] {
++    set env(INPUTRC) $old_inputrc
++} else {
++    unset env(INPUTRC)
++}
++if [info exists old_gdbhistfile] {
++    set env(GDBHISTFILE) $old_gdbhistfile
++} else {
++    unset env(GDBHISTFILE)
++}
++if [info exists old_histsize] {
++    set env(HISTSIZE) $old_histsize
++} else {
++    unset env(HISTSIZE)
++}
++set timeout $oldtimeout1
++
++return 0
diff --git a/gdb/patches/gdb-6.5-section-num-fixup-test.patch b/gdb/patches/gdb-6.5-section-num-fixup-test.patch
new file mode 100644 (file)
index 0000000..53f7fec
--- /dev/null
@@ -0,0 +1,111 @@
+diff -up -ruNp gdb-6.5-orig/gdb/testsuite/gdb.base/datalib-lib.c gdb-6.5/gdb/testsuite/gdb.base/datalib-lib.c
+--- gdb-6.5-orig/gdb/testsuite/gdb.base/datalib-lib.c  1969-12-31 19:00:00.000000000 -0500
++++ gdb-6.5/gdb/testsuite/gdb.base/datalib-lib.c       2008-05-29 13:51:50.000000000 -0400
+@@ -0,0 +1,22 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2008 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++   Please email any bugs, comments, and/or additions to this file to:
++   bug-gdb@prep.ai.mit.edu  */
++
++int var;
+diff -up -ruNp gdb-6.5-orig/gdb/testsuite/gdb.base/datalib-main.c gdb-6.5/gdb/testsuite/gdb.base/datalib-main.c
+--- gdb-6.5-orig/gdb/testsuite/gdb.base/datalib-main.c 1969-12-31 19:00:00.000000000 -0500
++++ gdb-6.5/gdb/testsuite/gdb.base/datalib-main.c      2008-05-29 13:51:39.000000000 -0400
+@@ -0,0 +1,26 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2008 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++   Please email any bugs, comments, and/or additions to this file to:
++   bug-gdb@prep.ai.mit.edu  */
++
++int
++main (void)
++{
++  return 0;
++}
+diff -up -ruNp gdb-6.5-orig/gdb/testsuite/gdb.base/datalib.exp gdb-6.5/gdb/testsuite/gdb.base/datalib.exp
+--- gdb-6.5-orig/gdb/testsuite/gdb.base/datalib.exp    1969-12-31 19:00:00.000000000 -0500
++++ gdb-6.5/gdb/testsuite/gdb.base/datalib.exp 2008-05-29 14:58:33.000000000 -0400
+@@ -0,0 +1,51 @@
++# Copyright 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++set testfile datalib
++set srcfilemain ${testfile}-main.c
++set srcfilelib ${testfile}-lib.c
++set libfile ${objdir}/${subdir}/${testfile}-lib.so
++set binfile ${objdir}/${subdir}/${testfile}-main
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfilelib}" "${libfile}" executable [list debug {additional_flags=-shared -nostdlib}]] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfilemain}" "${binfile} ${libfile}" executable {debug}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++
++# Get things started.
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++# We must use a separate library as the main executable is compiled to the
++# address 0 by default and it would get fixed up already at the end of
++# INIT_OBJFILE_SECT_INDICES.  We also cannot PRELINK it as PRELINK is missing
++# on ia64.  The library must be NOSTDLIB as otherwise some stub code would
++# create the `.text' section there.  Also DEBUG option is useful as some of
++# the crashes occur in dwarf2read.c.
++
++# FAIL case:
++# ../../gdb/ia64-tdep.c:2838: internal-error: sect_index_text not initialized
++# A problem internal to GDB has been detected,
++
++gdb_test "start" \
++         "main \\(\\) at .*${srcfilemain}.*" \
++         "start"
diff --git a/gdb/patches/gdb-6.5-sharedlibrary-path.patch b/gdb/patches/gdb-6.5-sharedlibrary-path.patch
new file mode 100644 (file)
index 0000000..3e0c101
--- /dev/null
@@ -0,0 +1,171 @@
+If you provided some relative path to the shared library, such as with
+       export LD_LIBRARY_PATH=.
+then gdb would fail to match the shared library name during the TLS lookup.
+
+
+Dropped the workaround/fix for gdb-6.8.50.20081128 - is it still needed?
+
+
+The testsuite needs `gdb-6.3-bz146810-solib_absolute_prefix_is_empty.patch'.
+The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'.
+
+
+2006-09-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * solib-svr4.c (svr4_fetch_objfile_link_map): Match even absolute
+       requested pathnames to the internal loaded relative pathnames.
+
+2007-10-16  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Port to GDB-6.7.
+
+2008-02-27  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Port to gdb-6.7.50.20080227.
+
+Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-main.c  2008-02-27 09:00:15.000000000 +0100
+@@ -0,0 +1,25 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2006 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++   Please email any bugs, comments, and/or additions to this file to:
++   bug-gdb@prep.ai.mit.edu  */
++
++int main()
++{
++  return 0;
++}
+Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c        2008-02-27 09:00:15.000000000 +0100
+@@ -0,0 +1,22 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2006 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++   Please email any bugs, comments, and/or additions to this file to:
++   bug-gdb@prep.ai.mit.edu  */
++
++__thread int var = 42;
+--- /dev/null  2009-02-10 00:19:00.494289687 +0100
++++ gdb-6.8.50.20090209-x/gdb/testsuite/gdb.threads/tls-sepdebug.exp   2009-02-10 00:49:38.000000000 +0100
+@@ -0,0 +1,86 @@
++# Copyright 2006 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++if $tracelevel then {
++    strace $tracelevel
++}
++
++set testfile tls-sepdebug
++set srcmainfile   ${testfile}-main.c
++set srcsharedfile ${testfile}-shared.c
++
++set binmainfile        ${objdir}/${subdir}/${testfile}-main
++set binsharedbase      ${testfile}-shared.so
++set binsharedfile      ${objdir}/${subdir}/${binsharedbase}
++set binshareddebugfile ${objdir}/${subdir}/${binsharedbase}.debug
++
++# Use explicit -soname as otherwise the full path to the library would get
++# encoded into ${binmainfile} making LD_LIBRARY_PATH tests useless.
++
++# FIXME: gcc dependency (-Wl,-soname).
++
++if  { [gdb_compile_shlib "${srcdir}/${subdir}/${srcsharedfile}" "${binsharedfile}" [list debug additional_flags=-Wl,-soname=${binsharedbase}]] != "" } {
++    untested "Couldn't compile test library"
++    return -1
++}
++
++# eu-strip(1) works fine but it is a part of `elfutils', not `binutils'.
++if 0 then {
++    remote_exec build "eu-strip -f ${binshareddebugfile} ${binsharedfile}"
++} else {
++    remote_exec build "objcopy --only-keep-debug ${binsharedfile} ${binshareddebugfile}"
++    remote_exec build "objcopy --strip-debug ${binsharedfile}"
++    remote_exec build "objcopy --add-gnu-debuglink=${binshareddebugfile} ${binsharedfile}"
++}
++
++# Do not use `shlib=' as it will automatically add also -rpath for gcc.
++
++if  { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcmainfile} ${binsharedfile}" "${binmainfile}" executable {debug}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++
++# Get things started.
++
++# Test also the proper resolving of relative library names to absolute ones.
++# \$PWD is easy - it is the absolute way
++# ${subdir} would fail on "print var"
++
++foreach ld_library_path [list [pwd]/${subdir} ./${subdir}] name { absolute relative }  {
++
++    gdb_exit
++    gdb_start
++    ###gdb_reinitialize_dir $srcdir/$subdir
++    
++    gdb_test "set env LD_LIBRARY_PATH=$ld_library_path" \
++             "" \
++             "set env LD_LIBRARY_PATH is $name"
++    
++    gdb_load ${binmainfile}
++    
++    # For C programs, "start" should stop in main().
++    
++    gdb_test "start" \
++             "main \\(\\) at .*${srcmainfile}.*" \
++             "start"
++    
++    # Check for: Cannot find shared library `/usr/lib/debug/lib/libc-2.4.90.so.debug' in dynamic linker's load module list
++    # as happens with TLS variables and `separate_debug_objfile_backlink'.
++    
++    gdb_test "print var" \
++             "\\\$1 = \[0-9\].*" \
++             "print TLS variable from a shared library with $name-directory separate debug info file"
++}
diff --git a/gdb/patches/gdb-6.6-buildid-locate-core-as-arg.patch b/gdb/patches/gdb-6.6-buildid-locate-core-as-arg.patch
new file mode 100644 (file)
index 0000000..b9d1134
--- /dev/null
@@ -0,0 +1,196 @@
+http://sourceware.org/ml/gdb-patches/2010-01/msg00558.html
+Subject: Re: [patch] print a more useful error message for "gdb core"
+
+[ Fixed up since the mail.  ]
+
+On Thu, 21 Jan 2010 18:17:15 +0100, Doug Evans wrote:
+> Not an exhaustive list, but if we go down the path of converting "gdb
+> corefile" to "gdb -c corefile", then we also need to think about "file
+> corefile" being converted to "core corefile" [or "target core
+> corefile", "core" is apparently deprecated in favor of "target core"]
+> and "target exec corefile" -> "target core corefile".  Presumably
+> "file corefile" (and "target exec corefile") would discard the
+> currently selected executable.  But maybe not.  Will that be confusing
+> for users?  I don't know.
+
+While thinking about it overriding some GDB _commands_ was not my intention.
+
+There is a general assumption if I have a shell COMMAND and some FILE I can do
+$ COMMAND FILE
+and COMMAND will appropriately load the FILE.
+
+FSF GDB currently needs to specify also the executable file for core files
+which already inhibits this intuitive expectation.  OTOH with the build-id
+locating patch which could allow such intuitive start  notneeding the
+executable file.  Still it currently did not work due to the required "-c":
+$ COMMAND -c COREFILE
+
+Entering "file", "core-file" or "attach" commands is already explicit enough
+so that it IMO should do what the command name says without any
+autodetections.  The second command line argument
+(captured_main->pid_or_core_arg) is also autodetected (for PID or CORE) but
+neither "attach" accepts a core file nor "core-file" accepts a PID.
+
+
+The patch makes sense only with the build-id patchset so this is not submit
+for FSF GDB inclusion yet.  I am fine with your patch (+/- Hui Zhu's pending
+bfd_check_format_matches) as the patch below is its natural extension.
+
+
+Sorry for the delay,
+Jan
+
+
+2010-01-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * exceptions.h (enum errors <IS_CORE_ERROR>): New.
+       * exec.c: Include exceptions.h.
+       (exec_file_attach <bfd_core>): Call throw_error (IS_CORE_ERROR, ...).
+       * main.c (exec_or_core_file_attach): New.
+       (captured_main <optind < argc>): Set also corearg.
+       (captured_main <strcmp (execarg, symarg) == 0>): New variable func.
+       Call exec_or_core_file_attach if COREARG matches EXECARG.  Call
+       symbol_file_add_main only if CORE_BFD remained NULL.
+
+Http://sourceware.org/ml/gdb-patches/2010-01/msg00517.html
+2010-01-20  Doug Evans  <dje@google.com>
+
+       * exec.c (exec_file_attach): Print a more useful error message if the
+       user did "gdb core".
+
+Index: gdb-7.2.50.20110218/gdb/exceptions.h
+===================================================================
+--- gdb-7.2.50.20110218.orig/gdb/exceptions.h  2011-02-14 12:35:44.000000000 +0100
++++ gdb-7.2.50.20110218/gdb/exceptions.h       2011-02-18 10:45:31.000000000 +0100
+@@ -85,6 +85,9 @@ enum errors {
+      traceframe.  */
+   NOT_AVAILABLE_ERROR,
++  /* Attempt to load a core file as executable.  */
++  IS_CORE_ERROR,
++
+   /* Add more errors here.  */
+   NR_ERRORS
+ };
+Index: gdb-7.2.50.20110218/gdb/exec.c
+===================================================================
+--- gdb-7.2.50.20110218.orig/gdb/exec.c        2011-02-14 23:08:48.000000000 +0100
++++ gdb-7.2.50.20110218/gdb/exec.c     2011-02-18 10:45:16.000000000 +0100
+@@ -34,6 +34,7 @@
+ #include "arch-utils.h"
+ #include "gdbthread.h"
+ #include "progspace.h"
++#include "exceptions.h"
+ #include <fcntl.h>
+ #include "readline/readline.h"
+@@ -253,12 +254,27 @@ exec_file_attach (char *filename, int fr
+       if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
+       {
++        int is_core;
++
++        /* If the user accidentally did "gdb core", print a useful
++           error message.  Check it only after bfd_object has been checked as
++           a valid executable may get recognized for example also as
++           "trad-core".  */
++        is_core = bfd_check_format (exec_bfd, bfd_core);
++
+         /* Make sure to close exec_bfd, or else "run" might try to use
+            it.  */
+         exec_close ();
+-        error (_("\"%s\": not in executable format: %s"),
+-               scratch_pathname,
+-               gdb_bfd_errmsg (bfd_get_error (), matching));
++
++        if (is_core != 0)
++          throw_error (IS_CORE_ERROR,
++                 _("\"%s\" is a core file.\n"
++                   "Please specify an executable to debug."),
++                 scratch_pathname);
++        else
++          error (_("\"%s\": not in executable format: %s"),
++                 scratch_pathname,
++                 gdb_bfd_errmsg (bfd_get_error (), matching));
+       }
+       /* FIXME - This should only be run for RS6000, but the ifdef is a poor
+Index: gdb-7.2.50.20110218/gdb/main.c
+===================================================================
+--- gdb-7.2.50.20110218.orig/gdb/main.c        2011-02-18 10:44:17.000000000 +0100
++++ gdb-7.2.50.20110218/gdb/main.c     2011-02-18 10:45:16.000000000 +0100
+@@ -243,6 +243,36 @@ captured_command_loop (void *data)
+   return 1;
+ }
++/* Call exec_file_attach.  If it detected FILENAME is a core file call
++   core_file_command.  Print the original exec_file_attach error only if
++   core_file_command failed to find a matching executable.  */
++
++static void
++exec_or_core_file_attach (char *filename, int from_tty)
++{
++  volatile struct gdb_exception e;
++
++  gdb_assert (exec_bfd == NULL);
++
++  TRY_CATCH (e, RETURN_MASK_ALL)
++    {
++      exec_file_attach (filename, from_tty);
++    }
++  if (e.reason < 0)
++    {
++      if (e.error == IS_CORE_ERROR)
++      {
++        core_file_command (filename, from_tty);
++
++        /* Iff the core file found its executable suppress the error message
++           from exec_file_attach.  */
++        if (exec_bfd != NULL)
++          return;
++      }
++      throw_exception (e);
++    }
++}
++
+ static int
+ captured_main (void *data)
+ {
+@@ -727,6 +757,8 @@ captured_main (void *data)
+       {
+         symarg = argv[optind];
+         execarg = argv[optind];
++        if (optind + 1 == argc && corearg == NULL)
++          corearg = argv[optind];
+         optind++;
+       }
+@@ -868,11 +900,25 @@ captured_main (void *data)
+       && symarg != NULL
+       && strcmp (execarg, symarg) == 0)
+     {
++      catch_command_errors_ftype *func;
++
++      /* Call exec_or_core_file_attach only if the file was specified as
++       a command line argument (and not an a command line option).  */
++      if (corearg != NULL && strcmp (corearg, execarg) == 0)
++      {
++        func = exec_or_core_file_attach;
++        corearg = NULL;
++      }
++      else
++      func = exec_file_attach;
++
+       /* The exec file and the symbol-file are the same.  If we can't
+          open it, better only print one error message.
+-         catch_command_errors returns non-zero on success!  */
+-      if (catch_command_errors (exec_file_attach, execarg,
+-                              !batch_flag, RETURN_MASK_ALL))
++         catch_command_errors returns non-zero on success!
++       Do not load EXECARG as a symbol file if it has been already processed
++       as a core file.  */
++      if (catch_command_errors (func, execarg, !batch_flag, RETURN_MASK_ALL)
++        && core_bfd == NULL)
+       catch_command_errors (symbol_file_add_main, symarg,
+                             !batch_flag, RETURN_MASK_ALL);
+     }
diff --git a/gdb/patches/gdb-6.6-buildid-locate.patch b/gdb/patches/gdb-6.6-buildid-locate.patch
new file mode 100644 (file)
index 0000000..022d0ca
--- /dev/null
@@ -0,0 +1,1034 @@
+Index: gdb-7.3.50.20110722/gdb/corelow.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/corelow.c     2011-07-22 20:12:40.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/corelow.c  2011-07-22 20:13:00.000000000 +0200
+@@ -48,6 +48,9 @@
+ #include "progspace.h"
+ #include "objfiles.h"
+ #include "wrapper.h"
++#include "auxv.h"
++#include "elf/common.h"
++#include "gdbcmd.h"
+ #ifndef O_LARGEFILE
+@@ -279,6 +282,52 @@ add_to_thread_list (bfd *abfd, asection 
+     inferior_ptid = ptid;                     /* Yes, make it current.  */
+ }
++static int build_id_core_loads = 1;
++
++static void
++build_id_locate_exec (int from_tty)
++{
++  CORE_ADDR at_entry;
++  struct build_id *build_id;
++  char *exec_filename, *debug_filename;
++  char *build_id_filename;
++  struct cleanup *back_to;
++
++  if (exec_bfd != NULL || symfile_objfile != NULL)
++    return;
++
++  if (target_auxv_search (&current_target, AT_ENTRY, &at_entry) <= 0)
++    return;
++
++  build_id = build_id_addr_get (at_entry);
++  if (build_id == NULL)
++    return;
++
++  /* SYMFILE_OBJFILE should refer to the main executable (not only to its
++     separate debug info file).  gcc44+ keeps .eh_frame only in the main
++     executable without its duplicate .debug_frame in the separate debug info
++     file - such .eh_frame would not be found if SYMFILE_OBJFILE would refer
++     directly to the separate debug info file.  */
++
++  exec_filename = build_id_to_filename (build_id, &build_id_filename, 0);
++  back_to = make_cleanup (xfree, build_id_filename);
++
++  if (exec_filename != NULL)
++    {
++      make_cleanup (xfree, exec_filename);
++      exec_file_attach (exec_filename, from_tty);
++      symbol_file_add_main (exec_filename, from_tty);
++      if (symfile_objfile != NULL)
++        symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED;
++    }
++  else
++    debug_print_missing (_("the main executable file"), build_id_filename);
++
++  do_cleanups (back_to);
++
++  /* No automatic SOLIB_ADD as the libraries would get read twice.  */
++}
++
+ /* This routine opens and sets up the core file bfd.  */
+ static void
+@@ -380,6 +429,12 @@ core_open (char *filename, int from_tty)
+   push_target (&core_ops);
+   discard_cleanups (old_chain);
++  /* Find the build_id identifiers.  If it gets executed after
++     POST_CREATE_INFERIOR we would clash with asking to discard the already
++     loaded VDSO symbols.  */
++  if (build_id_core_loads != 0)
++    build_id_locate_exec (from_tty);
++
+   /* Do this before acknowledging the inferior, so if
+      post_create_inferior throws (can happen easilly if you're loading
+      a core file with the wrong exec), we aren't left with threads
+@@ -933,4 +988,11 @@ _initialize_corelow (void)
+   init_core_ops ();
+   add_target (&core_ops);
++
++  add_setshow_boolean_cmd ("build-id-core-loads", class_files,
++                         &build_id_core_loads, _("\
++Set whether CORE-FILE loads the build-id associated files automatically."), _("\
++Show whether CORE-FILE loads the build-id associated files automatically.."),
++                         NULL, NULL, NULL,
++                         &setlist, &showlist);
+ }
+Index: gdb-7.3.50.20110722/gdb/doc/gdb.texinfo
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/doc/gdb.texinfo       2011-07-22 20:12:40.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/doc/gdb.texinfo    2011-07-22 20:13:00.000000000 +0200
+@@ -15402,6 +15402,27 @@ information files.
+ @end table
++You can also adjust the current verbosity of the @dfn{build id} locating.
++
++@table @code
++
++@kindex set build-id-verbose
++@item set build-id-verbose 0
++No additional messages are printed.
++
++@item set build-id-verbose 1
++Missing separate debug filenames are printed.
++
++@item set build-id-verbose 2
++Missing separate debug filenames are printed and also all the parsing of the
++binaries to find their @dfn{build id} content is printed.
++
++@kindex show build-id-verbose
++@item show build-id-verbose
++Show the current verbosity value for the @dfn{build id} content locating.
++
++@end table
++
+ @cindex @code{.gnu_debuglink} sections
+ @cindex debug link sections
+ A debug link is a special section of the executable file named
+Index: gdb-7.3.50.20110722/gdb/solib-svr4.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/solib-svr4.c  2011-07-22 20:12:40.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/solib-svr4.c       2011-07-22 20:16:10.000000000 +0200
+@@ -1201,9 +1201,49 @@ svr4_current_sos (void)
+                    safe_strerror (errcode));
+         else
+           {
+-            strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+-            new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+-            strcpy (new->so_original_name, new->so_name);
++            struct build_id *build_id;
++
++            strncpy (new->so_original_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
++            new->so_original_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
++            /* May get overwritten below.  */
++            strcpy (new->so_name, new->so_original_name);
++
++            build_id = build_id_addr_get (lm_dynamic_from_link_map (new));
++            if (build_id != NULL)
++              {
++                char *name, *build_id_filename;
++
++                /* Missing the build-id matching separate debug info file
++                   would be handled while SO_NAME gets loaded.  */
++                name = build_id_to_filename (build_id, &build_id_filename, 0);
++                if (name != NULL)
++                  {
++                    strncpy (new->so_name, name, SO_NAME_MAX_PATH_SIZE - 1);
++                    new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
++                    xfree (name);
++                  }
++                else
++                  {
++                    debug_print_missing (new->so_name, build_id_filename);
++
++                    /* In the case the main executable was found according to
++                       its build-id (from a core file) prevent loading
++                       a different build of a library with accidentally the
++                       same SO_NAME.
++
++                       It suppresses bogus backtraces (and prints "??" there
++                       instead) if the on-disk files no longer match the
++                       running program version.  */
++
++                    if (symfile_objfile != NULL
++                        && (symfile_objfile->flags
++                            & OBJF_BUILD_ID_CORE_LOADED) != 0)
++                      new->so_name[0] = 0;
++                  }
++
++                xfree (build_id_filename);
++                xfree (build_id);
++              }
+           }
+         xfree (buffer);
+Index: gdb-7.3.50.20110722/gdb/elfread.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/elfread.c     2011-07-22 20:12:40.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/elfread.c  2011-07-22 20:13:00.000000000 +0200
+@@ -45,6 +45,11 @@
+ #include "infcall.h"
+ #include "gdbthread.h"
+ #include "regcache.h"
++#include "libbfd.h"
++#include "gdbcore.h"
++#include "gdbcmd.h"
++#include "observer.h"
++#include <sys/stat.h>
+ extern void _initialize_elfread (void);
+@@ -1074,16 +1079,65 @@ elf_gnu_ifunc_resolver_return_stop (stru
+   update_breakpoint_locations (b, sals, sals_end);
+ }
++#define BUILD_ID_VERBOSE_NONE 0
++#define BUILD_ID_VERBOSE_FILENAMES 1
++#define BUILD_ID_VERBOSE_BINARY_PARSE 2
++static int build_id_verbose = BUILD_ID_VERBOSE_FILENAMES;
++static void
++show_build_id_verbose (struct ui_file *file, int from_tty,
++                     struct cmd_list_element *c, const char *value)
++{
++  fprintf_filtered (file, _("Verbosity level of the build-id locator is %s.\n"),
++                  value);
++}
++
+ struct build_id
+   {
+     size_t size;
+     gdb_byte data[1];
+   };
+-/* Locate NT_GNU_BUILD_ID from ABFD and return its content.  */
++/* Locate NT_GNU_BUILD_ID and return its matching debug filename.
++   FIXME: NOTE decoding should be unified with the BFD core notes decoding.  */
++
++struct build_id *
++build_id_buf_get (bfd *templ, gdb_byte *buf, bfd_size_type size)
++{
++  bfd_byte *p;
++
++  p = buf;
++  while (p < buf + size)
++    {
++      /* FIXME: bad alignment assumption.  */
++      Elf_External_Note *xnp = (Elf_External_Note *) p;
++      size_t namesz = H_GET_32 (templ, xnp->namesz);
++      size_t descsz = H_GET_32 (templ, xnp->descsz);
++      bfd_byte *descdata = xnp->name + BFD_ALIGN (namesz, 4);
++
++      if (H_GET_32 (templ, xnp->type) == NT_GNU_BUILD_ID
++        && namesz == sizeof "GNU"
++        && memcmp (xnp->name, "GNU", sizeof "GNU") == 0)
++      {
++        size_t size = descsz;
++        gdb_byte *data = (void *) descdata;
++        struct build_id *retval;
++
++        retval = xmalloc (sizeof *retval - 1 + size);
++        retval->size = size;
++        memcpy (retval->data, data, size);
++
++        return retval;
++      }
++      p = descdata + BFD_ALIGN (descsz, 4);
++    }
++  return NULL;
++}
++
++/* Separate debuginfo files have corrupted PHDR but SHDR is correct there.
++   Locate NT_GNU_BUILD_ID from ABFD and return its content.  */
+ static struct build_id *
+-build_id_bfd_get (bfd *abfd)
++build_id_bfd_shdr_get (bfd *abfd)
+ {
+   struct build_id *retval;
+@@ -1099,6 +1153,348 @@ build_id_bfd_get (bfd *abfd)
+   return retval;
+ }
++/* Core files may have missing (corrupt) SHDR but PDHR is correct there.
++   bfd_elf_bfd_from_remote_memory () has too much overhead by
++   allocating/reading all the available ELF PT_LOADs.  */
++
++static struct build_id *
++build_id_phdr_get (bfd *templ, bfd_vma loadbase, unsigned e_phnum,
++                 Elf_Internal_Phdr *i_phdr)
++{
++  int i;
++  struct build_id *retval = NULL;
++
++  for (i = 0; i < e_phnum; i++)
++    if (i_phdr[i].p_type == PT_NOTE && i_phdr[i].p_filesz > 0)
++      {
++      Elf_Internal_Phdr *hdr = &i_phdr[i];
++      gdb_byte *buf;
++      int err;
++
++      buf = xmalloc (hdr->p_filesz);
++      err = target_read_memory (loadbase + i_phdr[i].p_vaddr, buf,
++                                hdr->p_filesz);
++      if (err == 0)
++        retval = build_id_buf_get (templ, buf, hdr->p_filesz);
++      else
++        retval = NULL;
++      xfree (buf);
++      if (retval != NULL)
++        break;
++      }
++  return retval;
++}
++
++/* First we validate the file by reading in the ELF header and checking
++   the magic number.  */
++
++static inline bfd_boolean
++elf_file_p (Elf64_External_Ehdr *x_ehdrp64)
++{
++  gdb_assert (sizeof (Elf64_External_Ehdr) >= sizeof (Elf32_External_Ehdr));
++  gdb_assert (offsetof (Elf64_External_Ehdr, e_ident)
++            == offsetof (Elf32_External_Ehdr, e_ident));
++  gdb_assert (sizeof (((Elf64_External_Ehdr *) 0)->e_ident)
++            == sizeof (((Elf32_External_Ehdr *) 0)->e_ident));
++
++  return ((x_ehdrp64->e_ident[EI_MAG0] == ELFMAG0)
++        && (x_ehdrp64->e_ident[EI_MAG1] == ELFMAG1)
++        && (x_ehdrp64->e_ident[EI_MAG2] == ELFMAG2)
++        && (x_ehdrp64->e_ident[EI_MAG3] == ELFMAG3));
++}
++
++/* Translate an ELF file header in external format into an ELF file header in
++   internal format.  */
++
++#define H_GET_WORD(bfd, ptr) (is64 ? H_GET_64 (bfd, (ptr))            \
++                                 : H_GET_32 (bfd, (ptr)))
++#define H_GET_SIGNED_WORD(bfd, ptr) (is64 ? H_GET_S64 (bfd, (ptr))    \
++                                        : H_GET_S32 (bfd, (ptr)))
++
++static void
++elf_swap_ehdr_in (bfd *abfd,
++                const Elf64_External_Ehdr *src64,
++                Elf_Internal_Ehdr *dst)
++{
++  int is64 = bfd_get_arch_size (abfd) == 64;
++#define SRC(field) (is64 ? src64->field \
++                       : ((const Elf32_External_Ehdr *) src64)->field)
++
++  int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
++  memcpy (dst->e_ident, SRC (e_ident), EI_NIDENT);
++  dst->e_type = H_GET_16 (abfd, SRC (e_type));
++  dst->e_machine = H_GET_16 (abfd, SRC (e_machine));
++  dst->e_version = H_GET_32 (abfd, SRC (e_version));
++  if (signed_vma)
++    dst->e_entry = H_GET_SIGNED_WORD (abfd, SRC (e_entry));
++  else
++    dst->e_entry = H_GET_WORD (abfd, SRC (e_entry));
++  dst->e_phoff = H_GET_WORD (abfd, SRC (e_phoff));
++  dst->e_shoff = H_GET_WORD (abfd, SRC (e_shoff));
++  dst->e_flags = H_GET_32 (abfd, SRC (e_flags));
++  dst->e_ehsize = H_GET_16 (abfd, SRC (e_ehsize));
++  dst->e_phentsize = H_GET_16 (abfd, SRC (e_phentsize));
++  dst->e_phnum = H_GET_16 (abfd, SRC (e_phnum));
++  dst->e_shentsize = H_GET_16 (abfd, SRC (e_shentsize));
++  dst->e_shnum = H_GET_16 (abfd, SRC (e_shnum));
++  dst->e_shstrndx = H_GET_16 (abfd, SRC (e_shstrndx));
++
++#undef SRC
++}
++
++/* Translate an ELF program header table entry in external format into an
++   ELF program header table entry in internal format.  */
++
++void
++elf_swap_phdr_in (bfd *abfd,
++                const Elf64_External_Phdr *src64,
++                Elf_Internal_Phdr *dst)
++{
++  int is64 = bfd_get_arch_size (abfd) == 64;
++#define SRC(field) (is64 ? src64->field                                       \
++                       : ((const Elf32_External_Phdr *) src64)->field)
++
++  int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
++
++  dst->p_type = H_GET_32 (abfd, SRC (p_type));
++  dst->p_flags = H_GET_32 (abfd, SRC (p_flags));
++  dst->p_offset = H_GET_WORD (abfd, SRC (p_offset));
++  if (signed_vma)
++    {
++      dst->p_vaddr = H_GET_SIGNED_WORD (abfd, SRC (p_vaddr));
++      dst->p_paddr = H_GET_SIGNED_WORD (abfd, SRC (p_paddr));
++    }
++  else
++    {
++      dst->p_vaddr = H_GET_WORD (abfd, SRC (p_vaddr));
++      dst->p_paddr = H_GET_WORD (abfd, SRC (p_paddr));
++    }
++  dst->p_filesz = H_GET_WORD (abfd, SRC (p_filesz));
++  dst->p_memsz = H_GET_WORD (abfd, SRC (p_memsz));
++  dst->p_align = H_GET_WORD (abfd, SRC (p_align));
++
++#undef SRC
++}
++
++#undef H_GET_SIGNED_WORD
++#undef H_GET_WORD
++
++static Elf_Internal_Phdr *
++elf_get_phdr (bfd *templ, bfd_vma ehdr_vma, unsigned *e_phnum_pointer,
++              bfd_vma *loadbase_pointer)
++{
++  /* sizeof (Elf64_External_Ehdr) >= sizeof (Elf32_External_Ehdr)  */
++  Elf64_External_Ehdr x_ehdr64;       /* Elf file header, external form */
++  Elf_Internal_Ehdr i_ehdr;   /* Elf file header, internal form */
++  bfd_size_type x_phdrs_size;
++  gdb_byte *x_phdrs_ptr;
++  Elf_Internal_Phdr *i_phdrs;
++  int err;
++  unsigned int i;
++  bfd_vma loadbase;
++  int loadbase_set;
++
++  gdb_assert (templ != NULL);
++  gdb_assert (sizeof (Elf64_External_Ehdr) >= sizeof (Elf32_External_Ehdr));
++
++  /* Read in the ELF header in external format.  */
++  err = target_read_memory (ehdr_vma, (bfd_byte *) &x_ehdr64, sizeof x_ehdr64);
++  if (err)
++    {
++      if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++        warning (_("build-id: Error reading ELF header at address 0x%lx"),
++               (unsigned long) ehdr_vma);
++      return NULL;
++    }
++
++  /* Now check to see if we have a valid ELF file, and one that BFD can
++     make use of.  The magic number must match, the address size ('class')
++     and byte-swapping must match our XVEC entry.  */
++
++  if (! elf_file_p (&x_ehdr64)
++      || x_ehdr64.e_ident[EI_VERSION] != EV_CURRENT
++      || !((bfd_get_arch_size (templ) == 64
++            && x_ehdr64.e_ident[EI_CLASS] == ELFCLASS64)
++           || (bfd_get_arch_size (templ) == 32
++             && x_ehdr64.e_ident[EI_CLASS] == ELFCLASS32)))
++    {
++      if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++        warning (_("build-id: Unrecognized ELF header at address 0x%lx"),
++               (unsigned long) ehdr_vma);
++      return NULL;
++    }
++
++  /* Check that file's byte order matches xvec's */
++  switch (x_ehdr64.e_ident[EI_DATA])
++    {
++    case ELFDATA2MSB:         /* Big-endian */
++      if (! bfd_header_big_endian (templ))
++      {
++        if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++          warning (_("build-id: Unrecognized "
++                     "big-endian ELF header at address 0x%lx"),
++                   (unsigned long) ehdr_vma);
++        return NULL;
++      }
++      break;
++    case ELFDATA2LSB:         /* Little-endian */
++      if (! bfd_header_little_endian (templ))
++      {
++        if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++          warning (_("build-id: Unrecognized "
++                     "little-endian ELF header at address 0x%lx"),
++                   (unsigned long) ehdr_vma);
++        return NULL;
++      }
++      break;
++    case ELFDATANONE:         /* No data encoding specified */
++    default:                  /* Unknown data encoding specified */
++      if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++      warning (_("build-id: Unrecognized "
++                 "ELF header endianity at address 0x%lx"),
++               (unsigned long) ehdr_vma);
++      return NULL;
++    }
++
++  elf_swap_ehdr_in (templ, &x_ehdr64, &i_ehdr);
++
++  /* The file header tells where to find the program headers.
++     These are what we use to actually choose what to read.  */
++
++  if (i_ehdr.e_phentsize != (bfd_get_arch_size (templ) == 64
++                             ? sizeof (Elf64_External_Phdr)
++                           : sizeof (Elf32_External_Phdr))
++      || i_ehdr.e_phnum == 0)
++    {
++      if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++      warning (_("build-id: Invalid ELF program headers from the ELF header "
++                 "at address 0x%lx"), (unsigned long) ehdr_vma);
++      return NULL;
++    }
++
++  x_phdrs_size = (bfd_get_arch_size (templ) == 64 ? sizeof (Elf64_External_Phdr)
++                                              : sizeof (Elf32_External_Phdr));
++
++  i_phdrs = xmalloc (i_ehdr.e_phnum * (sizeof *i_phdrs + x_phdrs_size));
++  x_phdrs_ptr = (void *) &i_phdrs[i_ehdr.e_phnum];
++  err = target_read_memory (ehdr_vma + i_ehdr.e_phoff, (bfd_byte *) x_phdrs_ptr,
++                          i_ehdr.e_phnum * x_phdrs_size);
++  if (err)
++    {
++      free (i_phdrs);
++      if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++        warning (_("build-id: Error reading "
++                 "ELF program headers at address 0x%lx"),
++               (unsigned long) (ehdr_vma + i_ehdr.e_phoff));
++      return NULL;
++    }
++
++  loadbase = ehdr_vma;
++  loadbase_set = 0;
++  for (i = 0; i < i_ehdr.e_phnum; ++i)
++    {
++      elf_swap_phdr_in (templ, (Elf64_External_Phdr *)
++                             (x_phdrs_ptr + i * x_phdrs_size), &i_phdrs[i]);
++      /* IA-64 vDSO may have two mappings for one segment, where one mapping
++       is executable only, and one is read only.  We must not use the
++       executable one (PF_R is the first one, PF_X the second one).  */
++      if (i_phdrs[i].p_type == PT_LOAD && (i_phdrs[i].p_flags & PF_R))
++      {
++        /* Only the first PT_LOAD segment indicates the file bias.
++           Next segments may have P_VADDR arbitrarily higher.
++           If the first segment has P_VADDR zero any next segment must not
++           confuse us, the first one sets LOADBASE certainly enough.  */
++        if (!loadbase_set && i_phdrs[i].p_offset == 0)
++          {
++            loadbase = ehdr_vma - i_phdrs[i].p_vaddr;
++            loadbase_set = 1;
++          }
++      }
++    }
++
++  if (build_id_verbose >= BUILD_ID_VERBOSE_BINARY_PARSE)
++    warning (_("build-id: Found ELF header at address 0x%lx, loadbase 0x%lx"),
++           (unsigned long) ehdr_vma, (unsigned long) loadbase);
++
++  *e_phnum_pointer = i_ehdr.e_phnum;
++  *loadbase_pointer = loadbase;
++  return i_phdrs;
++}
++
++/* BUILD_ID_ADDR_GET gets ADDR located somewhere in the object.
++   Find the first section before ADDR containing an ELF header.
++   We rely on the fact the sections from multiple files do not mix.
++   FIXME: We should check ADDR is contained _inside_ the section with possibly
++   missing content (P_FILESZ < P_MEMSZ).  These omitted sections are currently
++   hidden by _BFD_ELF_MAKE_SECTION_FROM_PHDR.  */
++
++static CORE_ADDR build_id_addr;
++struct build_id_addr_sect
++  {
++    struct build_id_addr_sect *next;
++    asection *sect;
++  };
++static struct build_id_addr_sect *build_id_addr_sect;
++
++static void build_id_addr_candidate (bfd *abfd, asection *sect, void *obj)
++{
++  if (build_id_addr >= bfd_section_vma (abfd, sect))
++    {
++      struct build_id_addr_sect *candidate;
++
++      candidate = xmalloc (sizeof *candidate);
++      candidate->next = build_id_addr_sect;
++      build_id_addr_sect = candidate;
++      candidate->sect = sect;
++    }
++}
++
++struct build_id *
++build_id_addr_get (CORE_ADDR addr)
++{
++  struct build_id_addr_sect *candidate;
++  struct build_id *retval = NULL;
++  Elf_Internal_Phdr *i_phdr = NULL;
++  bfd_vma loadbase = 0;
++  unsigned e_phnum = 0;
++
++  if (core_bfd == NULL)
++    return NULL;
++
++  build_id_addr = addr;
++  gdb_assert (build_id_addr_sect == NULL);
++  bfd_map_over_sections (core_bfd, build_id_addr_candidate, NULL);
++
++  /* Sections are sorted in the high-to-low VMAs order.
++     Stop the search on the first ELF header we find.
++     Do not continue the search even if it does not contain NT_GNU_BUILD_ID.  */
++
++  for (candidate = build_id_addr_sect; candidate != NULL;
++       candidate = candidate->next)
++    {
++      i_phdr = elf_get_phdr (core_bfd,
++                           bfd_section_vma (core_bfd, candidate->sect),
++                           &e_phnum, &loadbase);
++      if (i_phdr != NULL)
++      break;
++    }
++
++  if (i_phdr != NULL)
++    {
++      retval = build_id_phdr_get (core_bfd, loadbase, e_phnum, i_phdr);
++      xfree (i_phdr);
++    }
++
++  while (build_id_addr_sect != NULL)
++    {
++      candidate = build_id_addr_sect;
++      build_id_addr_sect = candidate->next;
++      xfree (candidate);
++    }
++
++  return retval;
++}
++
+ /* Return if FILENAME has NT_GNU_BUILD_ID matching the CHECK value.  */
+ static int
+@@ -1113,7 +1509,7 @@ build_id_verify (const char *filename, s
+   if (abfd == NULL)
+     return 0;
+-  found = build_id_bfd_get (abfd);
++  found = build_id_bfd_shdr_get (abfd);
+   if (found == NULL)
+     warning (_("File \"%s\" has no build-id, file skipped"), filename);
+@@ -1131,14 +1527,15 @@ build_id_verify (const char *filename, s
+   return retval;
+ }
+-static char *
+-build_id_to_debug_filename (struct build_id *build_id)
++char *
++build_id_to_filename (struct build_id *build_id, char **link_return,
++                    int add_debug_suffix)
+ {
+   char *link, *debugdir, *retval = NULL;
++  char *link_all = NULL;
+   /* DEBUG_FILE_DIRECTORY/.build-id/ab/cdef */
+-  link = alloca (strlen (debug_file_directory) + (sizeof "/.build-id/" - 1) + 1
+-               + 2 * build_id->size + (sizeof ".debug" - 1) + 1);
++  link = xmalloc (strlen (debug_file_directory) + 2 * build_id->size + 50);
+   /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
+      cause "/.build-id/..." lookups.  */
+@@ -1149,6 +1546,8 @@ build_id_to_debug_filename (struct build
+       char *s, *debugdir_end;
+       gdb_byte *data = build_id->data;
+       size_t size = build_id->size;
++      unsigned seqno;
++      struct stat statbuf_trash;
+       while (*debugdir == DIRNAME_SEPARATOR)
+       debugdir++;
+@@ -1169,39 +1568,242 @@ build_id_to_debug_filename (struct build
+       *s++ = '/';
+       while (size-- > 0)
+       s += sprintf (s, "%02x", (unsigned) *data++);
+-      strcpy (s, ".debug");
+-
+-      /* lrealpath() is expensive even for the usually non-existent files.  */
+-      if (access (link, F_OK) == 0)
+-      retval = lrealpath (link);
+-      if (retval != NULL && !build_id_verify (retval, build_id))
++      for (seqno = 0;; seqno++)
+       {
+-        xfree (retval);
+-        retval = NULL;
++        char *s2;
++
++        if (seqno)
++          {
++            /* There can be multiple build-id symlinks pointing to real files
++               with the same build-id (such as hard links).  Some of the real
++               files may not be installed.  */
++
++            s2 = s + sprintf (s, ".%u", seqno);
++          }
++        else
++          s2 = s;
++
++        if (add_debug_suffix)
++          strcpy (s2, ".debug");
++        else
++          *s2 = 0;
++
++        /* `access' automatically dereferences LINK.  */
++        if (lstat (link, &statbuf_trash) != 0)
++          {
++            /* Stop increasing SEQNO.  */
++            break;
++          }
++
++        retval = lrealpath (link);
++
++        if (retval != NULL && !build_id_verify (retval, build_id))
++          {
++            xfree (retval);
++            retval = NULL;
++          }
++
++        if (retval)
++          break;
+       }
+       if (retval != NULL)
+-      break;
++      {
++        /* LINK_ALL is not used below in this non-NULL RETVAL case.  */
++        break;
++      }
++
++      if (link_all == NULL)
++        link_all = xstrdup (link);
++      else
++        {
++          size_t len_orig = strlen (link_all);
++
++          link_all = xrealloc (link_all, len_orig + 1 + strlen (link) + 1);
++
++          /* Use whitespace instead of DIRNAME_SEPARATOR to be compatible with
++             its possible use as an argument for installation command.  */
++          link_all[len_orig] = ' ';
++
++          strcpy (&link_all[len_orig + 1], link);
++        }
+       debugdir = debugdir_end;
+     }
+   while (*debugdir != 0);
++  if (link_return != NULL)
++    {
++      if (retval != NULL)
++       {
++         *link_return = link;
++         link = NULL;
++       }
++      else
++       {
++         *link_return = link_all;
++         link_all = NULL;
++       }
++    }
++  xfree (link);
++  xfree (link_all);
++
++  return retval;
++}
++
++/* This MISSING_FILEPAIR_HASH tracker is used only for the duplicite messages
++     Try to install the hash file ...
++   avoidance.  */
++
++struct missing_filepair
++  {
++    char *binary;
++    char *debug;
++    char data[1];
++  };
++
++static struct htab *missing_filepair_hash;
++static struct obstack missing_filepair_obstack;
++
++static void *
++missing_filepair_xcalloc (size_t nmemb, size_t nmemb_size)
++{
++  void *retval;
++  size_t size = nmemb * nmemb_size;
++
++  retval = obstack_alloc (&missing_filepair_obstack, size);
++  memset (retval, 0, size);
+   return retval;
+ }
++static hashval_t
++missing_filepair_hash_func (const struct missing_filepair *elem)
++{
++  hashval_t retval = 0;
++
++  retval ^= htab_hash_string (elem->binary);
++  if (elem->debug != NULL)
++    retval ^= htab_hash_string (elem->debug);
++
++  return retval;
++}
++
++static int
++missing_filepair_eq (const struct missing_filepair *elem1,
++                     const struct missing_filepair *elem2)
++{
++  return strcmp (elem1->binary, elem2->binary) == 0
++         && ((elem1->debug == NULL) == (elem2->debug == NULL))
++         && (elem1->debug == NULL || strcmp (elem1->debug, elem2->debug) == 0);
++}
++
++static void
++missing_filepair_change (void)
++{
++  if (missing_filepair_hash != NULL)
++    {
++      obstack_free (&missing_filepair_obstack, NULL);
++      /* All their memory came just from missing_filepair_OBSTACK.  */
++      missing_filepair_hash = NULL;
++    }
++}
++
++static void
++debug_print_executable_changed (void)
++{
++  missing_filepair_change ();
++}
++
++/* Notify user the file BINARY with (possibly NULL) associated separate debug
++   information file DEBUG is missing.  DEBUG may or may not be the build-id
++   file such as would be:
++     /usr/lib/debug/.build-id/dd/b1d2ce632721c47bb9e8679f369e2295ce71be.debug
++   */
++
++void
++debug_print_missing (const char *binary, const char *debug)
++{
++  size_t binary_len0 = strlen (binary) + 1;
++  size_t debug_len0 = debug ? strlen (debug) + 1 : 0;
++  struct missing_filepair missing_filepair_find;
++  struct missing_filepair *missing_filepair;
++  struct missing_filepair **slot;
++
++  if (build_id_verbose < BUILD_ID_VERBOSE_FILENAMES)
++    return;
++
++  if (missing_filepair_hash == NULL)
++    {
++      obstack_init (&missing_filepair_obstack);
++      missing_filepair_hash = htab_create_alloc (64,
++      (hashval_t (*) (const void *)) missing_filepair_hash_func,
++      (int (*) (const void *, const void *)) missing_filepair_eq, NULL,
++      missing_filepair_xcalloc, NULL);
++    }
++
++  /* Use MISSING_FILEPAIR_FIND first instead of calling obstack_alloc with
++     obstack_free in the case of a (rare) match.  The problem is ALLOC_F for
++     MISSING_FILEPAIR_HASH allocates from MISSING_FILEPAIR_OBSTACK maintenance
++     structures for MISSING_FILEPAIR_HASH.  Calling obstack_free would possibly
++     not to free only MISSING_FILEPAIR but also some such structures (allocated
++     during the htab_find_slot call).  */
++
++  missing_filepair_find.binary = (char *) binary;
++  missing_filepair_find.debug = (char *) debug;
++  slot = (struct missing_filepair **) htab_find_slot (missing_filepair_hash,
++                                                    &missing_filepair_find,
++                                                    INSERT);
++
++  /* While it may be still printed duplicitely with the missing debuginfo file
++   * it is due to once printing about the binary file build-id link and once
++   * about the .debug file build-id link as both the build-id symlinks are
++   * located in the debuginfo package.  */
++
++  if (*slot != NULL)
++    return;
++
++  missing_filepair = obstack_alloc (&missing_filepair_obstack,
++                                    sizeof (*missing_filepair) - 1
++                                    + binary_len0 + debug_len0);
++  missing_filepair->binary = missing_filepair->data;
++  memcpy (missing_filepair->binary, binary, binary_len0);
++  if (debug != NULL)
++    {
++      missing_filepair->debug = missing_filepair->binary + binary_len0;
++      memcpy (missing_filepair->debug, debug, debug_len0);
++    }
++  else
++    missing_filepair->debug = NULL;
++
++  *slot = missing_filepair;
++
++  /* We do not collect and flush these messages as each such message
++     already requires its own separate lines.  */
++
++  fprintf_unfiltered (gdb_stdlog,
++                    _("Missing separate debuginfo for %s\n"), binary);
++  if (debug != NULL)
++    fprintf_unfiltered (gdb_stdlog, _("Try to install the hash file %s\n"),
++                      debug);
++}
++
+ static char *
+-find_separate_debug_file_by_buildid (struct objfile *objfile)
++find_separate_debug_file_by_buildid (struct objfile *objfile,
++                                   char **build_id_filename_return)
+ {
+   struct build_id *build_id;
+-  build_id = build_id_bfd_get (objfile->obfd);
++  if (build_id_filename_return)
++    *build_id_filename_return = NULL;
++
++  build_id = build_id_bfd_shdr_get (objfile->obfd);
+   if (build_id != NULL)
+     {
+       char *build_id_name;
+-      build_id_name = build_id_to_debug_filename (build_id);
++      build_id_name = build_id_to_filename (build_id, build_id_filename_return,
++                                          1);
+       xfree (build_id);
+       /* Prevent looping on a stripped .debug file.  */
+       if (build_id_name != NULL
+@@ -1212,7 +1814,7 @@ find_separate_debug_file_by_buildid (str
+         xfree (build_id_name);
+       }
+       else if (build_id_name != NULL)
+-        return build_id_name;
++      return build_id_name;
+     }
+   return NULL;
+ }
+@@ -1432,9 +2034,10 @@ elf_symfile_read (struct objfile *objfil
+      `.note.gnu.build-id'.  */
+   else if (!objfile_has_partial_symbols (objfile))
+     {
+-      char *debugfile;
++      char *debugfile, *build_id_filename;
+-      debugfile = find_separate_debug_file_by_buildid (objfile);
++      debugfile = find_separate_debug_file_by_buildid (objfile,
++                                                     &build_id_filename);
+       if (debugfile == NULL)
+       debugfile = find_separate_debug_file_by_debuglink (objfile);
+@@ -1446,6 +2049,12 @@ elf_symfile_read (struct objfile *objfil
+         symbol_file_add_separate (abfd, symfile_flags, objfile);
+         xfree (debugfile);
+       }
++      /* Check if any separate debug info has been extracted out.  */
++      else if (bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink")
++             != NULL)
++      debug_print_missing (objfile->name, build_id_filename);
++
++      xfree (build_id_filename);
+     }
+ }
+@@ -1925,4 +2534,16 @@ _initialize_elfread (void)
+   elf_objfile_gnu_ifunc_cache_data = register_objfile_data ();
+   gnu_ifunc_fns_p = &elf_gnu_ifunc_fns;
++
++  add_setshow_zinteger_cmd ("build-id-verbose", no_class, &build_id_verbose,
++                          _("\
++Set debugging level of the build-id locator."), _("\
++Show debugging level of the build-id locator."), _("\
++Level 1 (default) enables printing the missing debug filenames,\n\
++level 2 also prints the parsing of binaries to find the identificators."),
++                          NULL,
++                          show_build_id_verbose,
++                          &setlist, &showlist);
++
++  observer_attach_executable_changed (debug_print_executable_changed);
+ }
+Index: gdb-7.3.50.20110722/gdb/symfile.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/symfile.h     2011-07-22 20:12:40.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/symfile.h  2011-07-22 20:13:00.000000000 +0200
+@@ -609,6 +609,13 @@ void free_symfile_segment_data (struct s
+ extern struct cleanup *increment_reading_symtab (void);
++/* build-id support.  */
++struct build_id;
++extern struct build_id *build_id_addr_get (CORE_ADDR addr);
++extern char *build_id_to_filename (struct build_id *build_id,
++                                 char **link_return, int add_debug_suffix);
++extern void debug_print_missing (const char *binary, const char *debug);
++
+ /* From dwarf2read.c */
+ /* Names for a dwarf2 debugging section.  The field NORMAL is the normal
+Index: gdb-7.3.50.20110722/gdb/testsuite/lib/gdb.exp
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/testsuite/lib/gdb.exp 2011-07-22 20:12:40.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/testsuite/lib/gdb.exp      2011-07-22 20:13:00.000000000 +0200
+@@ -1390,6 +1390,16 @@ proc default_gdb_start { } {
+           warning "Couldn't set the width to 0."
+       }
+     }
++    # Turn off the missing warnings as the testsuite does not expect it.
++    send_gdb "set build-id-verbose 0\n"
++    gdb_expect 10 {
++      -re "$gdb_prompt $" {
++          verbose "Disabled the missing debug infos warnings." 2
++      }
++      timeout {
++          warning "Could not disable the missing debug infos warnings.."
++      }
++    }
+     return 0;
+ }
+Index: gdb-7.3.50.20110722/gdb/testsuite/lib/mi-support.exp
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/testsuite/lib/mi-support.exp  2011-07-22 20:12:40.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/testsuite/lib/mi-support.exp       2011-07-22 20:13:00.000000000 +0200
+@@ -222,6 +222,16 @@ proc default_mi_gdb_start { args } {
+           }
+       }
+     }
++    # Turn off the missing warnings as the testsuite does not expect it.
++    send_gdb "190-gdb-set build-id-verbose 0\n"
++    gdb_expect 10 {
++      -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" {
++          verbose "Disabled the missing debug infos warnings." 2
++      }
++      timeout {
++          warning "Could not disable the missing debug infos warnings.."
++      }
++    }
+     detect_async
+Index: gdb-7.3.50.20110722/gdb/objfiles.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/objfiles.h    2011-07-22 20:12:40.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/objfiles.h 2011-07-22 20:13:00.000000000 +0200
+@@ -434,6 +434,10 @@ struct objfile
+ #define OBJF_PSYMTABS_READ (1 << 4)
++/* This file was loaded according to the BUILD_ID_CORE_LOADS rules.  */
++
++#define OBJF_BUILD_ID_CORE_LOADED (1 << 12)
++
+ /* The object file that contains the runtime common minimal symbols
+    for SunOS4.  Note that this objfile has no associated BFD.  */
diff --git a/gdb/patches/gdb-6.6-bz229517-gcore-without-terminal.patch b/gdb/patches/gdb-6.6-bz229517-gcore-without-terminal.patch
new file mode 100644 (file)
index 0000000..c2d0180
--- /dev/null
@@ -0,0 +1,171 @@
+2007-04-22  Jan Kratochvil <jan.kratochvil@redhat.com>
+
+       * gdb_gcore.sh: Redirect GDB from `</dev/null'.
+
+2007-04-22  Jan Kratochvil <jan.kratochvil@redhat.com>
+
+       * gdb.base/gcorebg.exp, gdb.base/gcorebg.c: New files.
+
+
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.base/gcorebg.c 25 Feb 2007 12:21:20 -0000
+@@ -0,0 +1,43 @@
++#include <stdio.h>
++#include <sys/types.h>
++#include <unistd.h>
++#include <stdlib.h>
++#include <signal.h>
++
++int main (int argc, char **argv)
++{
++  pid_t pid = 0;
++  pid_t ppid;
++  char buf[256];
++
++  if (argc != 4)
++    {
++      fprintf (stderr, "Syntax: %s {standard|detached} <gcore command> <core output file>\n",
++             argv[0]);
++      exit (1);
++    }
++
++  pid = fork ();
++
++  switch (pid)
++    {
++      case 0:
++        if (strcmp (argv[1], "detached") == 0)
++        setpgrp ();
++      ppid = getppid ();
++      sprintf (buf, "sh %s -o %s %d", argv[2], argv[3], (int) ppid);
++      system (buf);
++      kill (ppid, SIGTERM);
++      break;
++
++      case -1:
++      perror ("fork err\n");
++      exit (1);
++      break;
++
++      default:
++      sleep (60);
++    }
++
++  return 0;
++}
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.base/gcorebg.exp       25 Feb 2007 12:21:20 -0000
+@@ -0,0 +1,113 @@
++# Copyright 2007 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# Please email any bugs, comments, and/or additions to this file to:
++# bug-gdb@prep.ai.mit.edu
++
++# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
++# This is a test for `gdb_gcore.sh' functionality.
++# It also tests a regression with `gdb_gcore.sh' being run without its
++# accessible terminal.
++
++if ![info exists GCORE] {
++    set GCORE "${srcdir}/../gdb_gcore.sh"
++}
++verbose "using GCORE = $GCORE" 2
++
++set testfile "gcorebg"
++set srcfile  ${testfile}.c
++set binfile  ${objdir}/${subdir}/${testfile}
++set corefile ${objdir}/${subdir}/${testfile}.test
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++     untested gcorebg.exp
++     return -1
++}
++
++# Cleanup.
++
++proc core_clean {} {
++    global corefile
++
++    foreach file [glob -nocomplain [join [list $corefile *] ""]] {
++      verbose "Delete file $file" 1
++      remote_file target delete $file
++    }
++}
++core_clean
++remote_file target delete "./gdb"
++
++# Generate the core file.
++
++# Provide `./gdb' for `gdb_gcore.sh' running it as a bare `gdb' command.
++# Setup also `$PATH' appropriately.
++# If GDB was not found let `gdb_gcore.sh' to find the system GDB by `$PATH'.
++if {$GDB != "gdb"} {
++    file link ./gdb $GDB
++}
++global env
++set oldpath $env(PATH)
++set env(PATH) [join [list . $env(PATH)] ":"]
++verbose "PATH = $env(PATH)" 2
++
++# Test file body.
++# $detached == "standard" || $detached == "detached"
++
++proc test_body { detached } {
++    global binfile
++    global GCORE
++    global corefile
++
++    set res [remote_spawn target "$binfile $detached $GCORE $corefile"]
++    if { $res < 0 || $res == "" } {
++      fail "Spawning $detached gcore"
++      return 1
++    }
++    pass "Spawning $detached gcore"
++    remote_expect target 20 {
++      timeout {
++          fail "Spawned $detached gcore finished"
++          remote_exec target "kill -9 -[exp_pid -i $res]"
++          return 1
++      }
++      eof {
++          pass "Spawned $detached gcore finished"
++          remote_wait target 20
++      }
++    }
++
++    if {1 == [llength [glob -nocomplain [join [list $corefile *] ""]]]} {
++      pass "Core file generated by $detached gcore"
++    } else {
++      fail "Core file generated by $detached gcore"
++    }
++    core_clean
++}
++
++# First a general `gdb_gcore.sh' spawn with its controlling terminal available.
++
++test_body standard
++
++# And now `gdb_gcore.sh' spawn without its controlling terminal available.
++# It is spawned through `gcorebg.c' using setpgrp ().
++
++test_body detached
++
++
++# Cleanup.
++
++set env(PATH) $oldpath
++remote_file target delete "./gdb"
diff --git a/gdb/patches/gdb-6.6-bz230000-power6-disassembly-test.patch b/gdb/patches/gdb-6.6-bz230000-power6-disassembly-test.patch
new file mode 100644 (file)
index 0000000..1ebf31b
--- /dev/null
@@ -0,0 +1,83 @@
+https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230000
+
+The original testcase
+       https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230000#c1
+requires too recent GCC.
+
+
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.arch/powerpc-power6.exp        25 Feb 2007 18:27:39 -0000
+@@ -0,0 +1,54 @@
++# Copyright 2007 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# Test PowerPC Power6 instructions disassembly.
++
++if {![istarget "powerpc*-*-*"]} then {
++    verbose "Skipping PowerPC Power6 instructions disassembly."
++    return
++}
++
++set testfile "powerpc-power6"
++set srcfile ${testfile}.s
++set objfile ${objdir}/${subdir}/${testfile}.o
++
++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } {
++    untested "PowerPC prologue tests"
++    return -1
++}
++
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${objfile}
++
++# Disassemble the function.
++
++gdb_test "disass func" ":\tblr\r\n.*" "Basic disassembly"
++
++gdb_test "disass func" ":\tdcbzl  *r8,r9\r\n.*" "Power5 disassembly dcbzl"
++gdb_test "disass func" ":\tfrsqrtes  *f10,f11\r\n.*" "Power5 disassembly frsqrtes"
++gdb_test "disass func" ":\tdadd  *f1,f2,f1\r\n.*" "Power6 disassembly dadd"
++gdb_test "disass func" ":\tdaddq  *f1,f2,f1\r\n.*" "Power6 disassembly daddq"
++gdb_test "disass func" ":\tdsub  *f1,f2,f1\r\n.*" "Power6 disassembly dsub"
++gdb_test "disass func" ":\tdsubq  *f1,f2,f1\r\n.*" "Power6 disassembly dsubq"
++gdb_test "disass func" ":\tdmul  *f1,f2,f1\r\n.*" "Power6 disassembly dmul"
++gdb_test "disass func" ":\tdmulq  *f1,f2,f1\r\n.*" "Power6 disassembly dmulq"
++gdb_test "disass func" ":\tddiv  *f1,f2,f1\r\n.*" "Power6 disassembly ddiv"
++gdb_test "disass func" ":\tddivq  *f1,f2,f1\r\n.*" "Power6 disassembly ddivq"
++gdb_test "disass func" ":\tdcmpu  *cr1,f2,f1\r\n.*" "Power6 disassembly dcmpu"
++gdb_test "disass func" ":\tdcmpuq  *cr1,f2,f1\r\n.*" "Power6 disassembly dcmpuq"
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.arch/powerpc-power6.s  25 Feb 2007 18:27:39 -0000
+@@ -0,0 +1,16 @@
++      .text
++      .globl  func
++func:
++      blr
++      .long   0x7c284fec      /* dcbzl        r8,r9           */
++      .long   0xed405834      /* frsqrtes     f10,f11         */
++      .long   0xec220804      /* dadd         f1,f2,f1        */
++      .long   0xfc220804      /* daddq        f1,f2,f1        */
++      .long   0xec220c04      /* dsub         f1,f2,f1        */
++      .long   0xfc220c04      /* dsubq        f1,f2,f1        */
++      .long   0xec220844      /* dmul         f1,f2,f1        */
++      .long   0xfc220844      /* dmulq        f1,f2,f1        */
++      .long   0xec220c44      /* ddiv         f1,f2,f1        */
++      .long   0xfc220c44      /* ddivq        f1,f2,f1        */
++      .long   0xec820d04      /* dcmpu        cr1,f2,f1       */
++      .long   0xfc820d04      /* dcmpuq       cr1,f2,f1       */
diff --git a/gdb/patches/gdb-6.6-bz235197-fork-detach-info.patch b/gdb/patches/gdb-6.6-bz235197-fork-detach-info.patch
new file mode 100644 (file)
index 0000000..d7263ff
--- /dev/null
@@ -0,0 +1,121 @@
+2008-03-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Port to GDB-6.8pre.
+       Remove the `[' character from the GDB-6.8 default message.
+
+Index: gdb-7.2.50.20110320/gdb/linux-nat.c
+===================================================================
+--- gdb-7.2.50.20110320.orig/gdb/linux-nat.c   2011-03-20 16:59:51.000000000 +0100
++++ gdb-7.2.50.20110320/gdb/linux-nat.c        2011-03-20 16:59:51.000000000 +0100
+@@ -716,7 +716,7 @@ holding the child stopped.  Try \"set de
+             remove_breakpoints_pid (GET_PID (inferior_ptid));
+           }
+-        if (info_verbose || debug_linux_nat)
++        if (1 /* Fedora Bug 235197 */ || info_verbose || debug_linux_nat)
+           {
+             target_terminal_ours ();
+             fprintf_filtered (gdb_stdlog,
+Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.c   2011-03-20 16:59:51.000000000 +0100
+@@ -0,0 +1,57 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2007 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++   Please email any bugs, comments, and/or additions to this file to:
++   bug-gdb@prep.ai.mit.edu  */
++
++#include <sys/types.h>
++#include <sys/wait.h>
++#include <unistd.h>
++#include <assert.h>
++#include <stdlib.h>
++
++static void func (void)
++{
++}
++
++int main (void)
++{
++  pid_t child;
++
++  child = fork ();
++  switch (child)
++    {
++      case -1:
++      abort ();
++      case 0:
++      func ();
++      break;
++      default:
++        {
++/* We do not test the switching to the other fork by GDB `fork 1'.  */
++#if 0
++        pid_t got;
++
++        got = waitpid (child, NULL, 0);
++        assert (got == child);
++#endif
++        break;
++      }
++    }
++  return 0;
++}
+Index: gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110320/gdb/testsuite/gdb.base/fork-detach.exp 2011-03-20 17:12:22.000000000 +0100
+@@ -0,0 +1,36 @@
++# Copyright 2007 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++set testfile fork-detach
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++
++# Get things started.
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++gdb_run_cmd
++# `Starting program: .*' prefix is available since gdb-6.7.
++gdb_test "" \
++         "Detaching after fork from child process.*\\\[Inferior .* exited normally\\\]" \
++         "Info message caught"
diff --git a/gdb/patches/gdb-6.6-bz237572-ppc-atomic-sequence-test.patch b/gdb/patches/gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
new file mode 100644 (file)
index 0000000..928c7fb
--- /dev/null
@@ -0,0 +1,270 @@
+2007-06-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * gdb.threads/atomic-seq-threaded.c,
+       gdb.threads/atomic-seq-threaded.exp: New files.
+
+Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.c        2008-12-08 22:27:01.000000000 +0100
+@@ -0,0 +1,171 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2007 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
++   MA 02110-1301, USA.  */
++
++/* Test stepping over RISC atomic sequences.
++   This variant testcases the code for stepping another thread while skipping
++   over the atomic sequence in the former thread
++   (STEPPING_PAST_SINGLESTEP_BREAKPOINT).
++   Code comes from gcc/testsuite/gcc.dg/sync-2.c  */
++
++/* { dg-options "-march=i486" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
++/* { dg-options "-mcpu=v9" { target sparc*-*-* } } */
++
++/* Test functionality of the intrinsics for 'short' and 'char'.  */
++
++#include <stdlib.h>
++#include <string.h>
++#include <pthread.h>
++#include <assert.h>
++#include <unistd.h>
++
++#define LOOPS 2
++
++static int unused;
++
++static char AI[18];
++static char init_qi[18] = { 3,5,7,9,0,0,0,0,-1,0,0,0,0,0,-1,0,0,0 };
++static char test_qi[18] = { 3,5,7,9,1,4,22,-12,7,8,9,7,1,-12,7,8,9,7 };
++
++static void
++do_qi (void)
++{
++  if (__sync_fetch_and_add(AI+4, 1) != 0)
++    abort ();
++  if (__sync_fetch_and_add(AI+5, 4) != 0)
++    abort ();
++  if (__sync_fetch_and_add(AI+6, 22) != 0)
++    abort ();
++  if (__sync_fetch_and_sub(AI+7, 12) != 0)
++    abort ();
++  if (__sync_fetch_and_and(AI+8, 7) != (char)-1)
++    abort ();
++  if (__sync_fetch_and_or(AI+9, 8) != 0)
++    abort ();
++  if (__sync_fetch_and_xor(AI+10, 9) != 0)
++    abort ();
++  if (__sync_fetch_and_nand(AI+11, 7) != 0)
++    abort ();
++
++  if (__sync_add_and_fetch(AI+12, 1) != 1)
++    abort ();
++  if (__sync_sub_and_fetch(AI+13, 12) != (char)-12)
++    abort ();
++  if (__sync_and_and_fetch(AI+14, 7) != 7)
++    abort ();
++  if (__sync_or_and_fetch(AI+15, 8) != 8)
++    abort ();
++  if (__sync_xor_and_fetch(AI+16, 9) != 9)
++    abort ();
++  if (__sync_nand_and_fetch(AI+17, 7) != 7)
++    abort ();
++}
++
++static short AL[18];
++static short init_hi[18] = { 3,5,7,9,0,0,0,0,-1,0,0,0,0,0,-1,0,0,0 };
++static short test_hi[18] = { 3,5,7,9,1,4,22,-12,7,8,9,7,1,-12,7,8,9,7 };
++
++static void
++do_hi (void)
++{
++  if (__sync_fetch_and_add(AL+4, 1) != 0)
++    abort ();
++  if (__sync_fetch_and_add(AL+5, 4) != 0)
++    abort ();
++  if (__sync_fetch_and_add(AL+6, 22) != 0)
++    abort ();
++  if (__sync_fetch_and_sub(AL+7, 12) != 0)
++    abort ();
++  if (__sync_fetch_and_and(AL+8, 7) != -1)
++    abort ();
++  if (__sync_fetch_and_or(AL+9, 8) != 0)
++    abort ();
++  if (__sync_fetch_and_xor(AL+10, 9) != 0)
++    abort ();
++  if (__sync_fetch_and_nand(AL+11, 7) != 0)
++    abort ();
++
++  if (__sync_add_and_fetch(AL+12, 1) != 1)
++    abort ();
++  if (__sync_sub_and_fetch(AL+13, 12) != -12)
++    abort ();
++  if (__sync_and_and_fetch(AL+14, 7) != 7)
++    abort ();
++  if (__sync_or_and_fetch(AL+15, 8) != 8)
++    abort ();
++  if (__sync_xor_and_fetch(AL+16, 9) != 9)
++    abort ();
++  if (__sync_nand_and_fetch(AL+17, 7) != 7)
++    abort ();
++}
++
++static void *
++start1 (void *arg)
++{
++  unsigned loop;
++  sleep(1);
++
++  for (loop = 0; loop < LOOPS; loop++)
++    {
++      memcpy(AI, init_qi, sizeof(init_qi));
++
++      do_qi ();
++
++      if (memcmp (AI, test_qi, sizeof(test_qi)))
++      abort ();
++    }
++
++  return arg;                                         /* _delete1_ */
++}
++
++static void *
++start2 (void *arg)
++{
++  unsigned loop;
++
++  for (loop = 0; loop < LOOPS; loop++)
++    {
++      memcpy(AL, init_hi, sizeof(init_hi));
++
++      do_hi ();
++
++      if (memcmp (AL, test_hi, sizeof(test_hi)))
++      abort ();
++    }
++
++  return arg;                                         /* _delete2_ */
++}
++
++int
++main (int argc, char **argv)
++{
++  pthread_t thread;
++  int i;
++
++  i = pthread_create (&thread, NULL, start1, NULL);   /* _create_ */
++  assert (i == 0);                                    /* _create_after_ */
++
++  sleep (1);
++
++  start2 (NULL);
++
++  i = pthread_join (thread, NULL);                    /* _delete_ */
++  assert (i == 0);
++
++  return 0;                                           /* _exit_ */
++}
+Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp      2008-12-08 22:31:01.000000000 +0100
+@@ -0,0 +1,84 @@
++# atomic-seq-threaded.exp -- Test case for stepping over RISC atomic code seqs.
++# This variant testcases the code for stepping another thread while skipping
++# over the atomic sequence in the former thread
++# (STEPPING_PAST_SINGLESTEP_BREAKPOINT).
++# Copyright (C) 2007 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++
++# Please email any bugs, comments, and/or additions to this file to:
++# bug-gdb@prep.ai.mit.edu
++
++set testfile atomic-seq-threaded
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++
++foreach opts {{} {compiler=gcc4} {FAIL}} {
++    if {$opts eq "FAIL"} {
++      return -1
++    }
++    if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $opts]] eq "" } {
++      break
++    }
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++
++gdb_load ${binfile}
++if ![runto_main] then {
++   fail "Can't run to main"
++   return 0
++}
++
++# pthread_create () will not pass even on x86_64 with software watchpoint.
++# Pass after pthread_create () without any watchpoint active.
++set line [gdb_get_line_number "_create_after_"]
++gdb_test "tbreak $line" \
++       "reakpoint (\[0-9\]+) at .*$srcfile, line $line\..*" \
++       "set breakpoint after pthread_create ()"
++gdb_test "c" \
++       ".*/\\* _create_after_ \\*/.*" \
++       "run till after pthread_create ()"
++
++# Without a watchpoint being software no single-stepping would be used.
++set test "Start (software) watchpoint"
++gdb_test_multiple "watch unused" $test {
++    -re "Watchpoint \[0-9\]+: unused.*$gdb_prompt $" {
++      pass $test
++    }
++    -re "Hardware watchpoint \[0-9\]+: unused.*$gdb_prompt $" {
++      # We do not test the goal but still the whole testcase should pass.
++      unsupported $test
++    }
++}
++
++# More thorough testing of the scheduling logic.
++gdb_test "set scheduler-locking step" ""
++
++# Critical code path is stepped through at this point.
++set line [gdb_get_line_number "_exit_"]
++gdb_test "tbreak $line" \
++       "reakpoint \[0-9\]+ at .*$srcfile, line $line\..*" \
++       "set breakpoint at _exit_"
++gdb_test "c" \
++       ".*/\\* _exit_ \\*/.*" \
++       "run till _exit_"
++
++# Just a nonproblematic program exit.
++gdb_test "c" \
++       ".*Program exited normally\\..*" \
++       "run till program exit"
diff --git a/gdb/patches/gdb-6.6-scheduler_locking-step-is-default.patch b/gdb/patches/gdb-6.6-scheduler_locking-step-is-default.patch
new file mode 100644 (file)
index 0000000..50af796
--- /dev/null
@@ -0,0 +1,54 @@
+Index: gdb-7.3.50.20110722/gdb/infrun.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/infrun.c      2011-07-22 19:12:56.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/infrun.c   2011-07-22 19:17:06.000000000 +0200
+@@ -1549,7 +1549,7 @@ static const char *scheduler_enums[] = {
+   schedlock_step,
+   NULL
+ };
+-static const char *scheduler_mode = schedlock_off;
++static const char *scheduler_mode = schedlock_step;
+ static void
+ show_scheduler_mode (struct ui_file *file, int from_tty,
+                    struct cmd_list_element *c, const char *value)
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi-console.exp
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/testsuite/gdb.mi/mi-console.exp       2011-01-01 16:33:47.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi-console.exp    2011-07-22 19:17:06.000000000 +0200
+@@ -47,6 +47,9 @@ if  { [gdb_compile "${srcdir}/${subdir}/
+ mi_run_to_main
++# thread-id=\"all\" vs. thread-id=\"1\" below:
++mi_gdb_test "210-gdb-set scheduler-locking off" "210\\^done" "set scheduler-locking off"
++
+ # Next over the hello() call which will produce lots of output
+ mi_gdb_test "220-exec-next" \
+           "220\\^running(\r\n\\*running,thread-id=\"all\")?" \
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi2-console.exp
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/testsuite/gdb.mi/mi2-console.exp      2011-06-23 11:40:50.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi2-console.exp   2011-07-22 19:17:27.000000000 +0200
+@@ -47,6 +47,9 @@ if  { [gdb_compile "${srcdir}/${subdir}/
+ mi_run_to_main
++# thread-id=\"all\" vs. thread-id=\"1\" below:
++mi_gdb_test "210-gdb-set scheduler-locking off" "210\\^done" "set scheduler-locking off"
++
+ # Next over the hello() call which will produce lots of output
+ mi_gdb_test "220-exec-next" "220\\^running(\r\n)?(\\*running,thread-id=\"all\")?" \
+       "Started step over hello"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi-cli.exp
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/testsuite/gdb.mi/mi-cli.exp   2011-04-27 12:17:38.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi-cli.exp        2011-07-22 19:17:06.000000000 +0200
+@@ -176,7 +176,7 @@ mi_execute_to "exec-continue" "breakpoin
+ # Test that the token is output even for CLI commands
+ # Also test that *stopped includes frame information.
+ mi_gdb_test "34 next" \
+-    ".*34\\\^running.*\\*running,thread-id=\"all\"" \
++    ".*34\\\^running.*\\*running,thread-id=\"1\"" \
+     "34 next: run"
+ if {!$async} {
diff --git a/gdb/patches/gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch b/gdb/patches/gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch
new file mode 100644 (file)
index 0000000..671b457
--- /dev/null
@@ -0,0 +1,205 @@
+2007-06-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * inferior.h (enum resume_step): New definition.
+       (resume): Change STEP parameter type to ENUM RESUME_STEP.
+       * infrun.c (resume): Likewise.  Extend debug printing of the STEP
+       parameter.  Lock the scheduler only for intentional stepping.
+       (proceed): Replace the variable ONESTEP with tristate RESUME_STEP.
+       Set the third RESUME_STEP state according to BPSTAT_SHOULD_STEP.
+       (currently_stepping): Change the return type to ENUM RESUME_STEP.
+       Return RESUME_STEP_NEEDED if it is just due to BPSTAT_SHOULD_STEP.
+       * linux-nat.c (select_singlestep_lwp_callback): Do not focus on
+       the software watchpoint events.
+       * linux-nat.h (struct lwp_info): Redeclare STEP as ENUM RESUME_STEP.
+
+2007-10-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * infrun.c (proceed): RESUME_STEP initialized for non-stepping.
+       RESUME_STEP set according to STEP only at the end of the function.
+
+2008-02-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Port to GDB-6.8pre.
+
+Index: gdb-7.3.50.20110722/gdb/inferior.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/inferior.h    2011-07-22 01:46:08.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/inferior.h 2011-07-22 19:13:30.000000000 +0200
+@@ -158,7 +158,15 @@ extern void reopen_exec_file (void);
+ /* The `resume' routine should only be called in special circumstances.
+    Normally, use `proceed', which handles a lot of bookkeeping.  */
+-extern void resume (int, enum target_signal);
++enum resume_step
++  {
++    /* currently_stepping () should return non-zero for non-continue.  */
++    RESUME_STEP_CONTINUE = 0,
++    RESUME_STEP_USER,         /* Stepping is intentional by the user.  */
++    RESUME_STEP_NEEDED                /* Stepping only for software watchpoints.  */
++  };
++
++extern void resume (enum resume_step, enum target_signal);
+ extern ptid_t user_visible_resume_ptid (int step);
+Index: gdb-7.3.50.20110722/gdb/infrun.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/infrun.c      2011-07-22 19:08:19.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/infrun.c   2011-07-22 19:12:56.000000000 +0200
+@@ -79,7 +79,7 @@ static int follow_fork (void);
+ static void set_schedlock_func (char *args, int from_tty,
+                               struct cmd_list_element *c);
+-static int currently_stepping (struct thread_info *tp);
++static enum resume_step currently_stepping (struct thread_info *tp);
+ static int currently_stepping_or_nexting_callback (struct thread_info *tp,
+                                                  void *data);
+@@ -1630,7 +1630,8 @@ user_visible_resume_ptid (int step)
+     }
+   else if ((scheduler_mode == schedlock_on)
+          || (scheduler_mode == schedlock_step
+-             && (step || singlestep_breakpoints_inserted_p)))
++             && (step == RESUME_STEP_USER
++                 || singlestep_breakpoints_inserted_p)))
+     {
+       /* User-settable 'scheduler' mode requires solo thread resume.  */
+       resume_ptid = inferior_ptid;
+@@ -1648,7 +1649,7 @@ user_visible_resume_ptid (int step)
+    STEP nonzero if we should step (zero to continue instead).
+    SIG is the signal to give the inferior (zero for none).  */
+ void
+-resume (int step, enum target_signal sig)
++resume (enum resume_step step, enum target_signal sig)
+ {
+   int should_resume = 1;
+   struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0);
+@@ -1681,9 +1682,13 @@ resume (int step, enum target_signal sig
+   if (debug_infrun)
+     fprintf_unfiltered (gdb_stdlog,
+-                        "infrun: resume (step=%d, signal=%d), "
++                        "infrun: resume (step=%s, signal=%d), "
+                       "trap_expected=%d, current thread [%s] at %s\n",
+-                      step, sig, tp->control.trap_expected,
++                      (step == RESUME_STEP_CONTINUE
++                       ? "RESUME_STEP_CONTINUE"
++                       : (step == RESUME_STEP_USER ? "RESUME_STEP_USER"
++                                                   : "RESUME_STEP_NEEDED")),
++                      sig, tp->control.trap_expected,
+                       target_pid_to_str (inferior_ptid),
+                       paddress (gdbarch, pc));
+@@ -2056,7 +2061,7 @@ proceed (CORE_ADDR addr, enum target_sig
+   struct thread_info *tp;
+   CORE_ADDR pc;
+   struct address_space *aspace;
+-  int oneproc = 0;
++  enum resume_step resume_step = RESUME_STEP_CONTINUE;
+   /* If we're stopped at a fork/vfork, follow the branch set by the
+      "set follow-fork-mode" command; otherwise, we'll just proceed
+@@ -2096,13 +2101,13 @@ proceed (CORE_ADDR addr, enum target_sig
+          actually be executing the breakpoint insn anyway.
+          We'll be (un-)executing the previous instruction.  */
+-      oneproc = 1;
++      resume_step = RESUME_STEP_USER;
+       else if (gdbarch_single_step_through_delay_p (gdbarch)
+              && gdbarch_single_step_through_delay (gdbarch,
+                                                    get_current_frame ()))
+       /* We stepped onto an instruction that needs to be stepped
+          again before re-inserting the breakpoint, do so.  */
+-      oneproc = 1;
++      resume_step = RESUME_STEP_USER;
+     }
+   else
+     {
+@@ -2133,13 +2138,13 @@ proceed (CORE_ADDR addr, enum target_sig
+        is required it returns TRUE and sets the current thread to
+        the old thread.  */
+       if (prepare_to_proceed (step))
+-      oneproc = 1;
++      resume_step = RESUME_STEP_USER;
+     }
+   /* prepare_to_proceed may change the current thread.  */
+   tp = inferior_thread ();
+-  if (oneproc)
++  if (resume_step == RESUME_STEP_USER)
+     {
+       tp->control.trap_expected = 1;
+       /* If displaced stepping is enabled, we can step over the
+@@ -2226,8 +2231,13 @@ proceed (CORE_ADDR addr, enum target_sig
+   /* Reset to normal state.  */
+   init_infwait_state ();
++  if (step)
++    resume_step = RESUME_STEP_USER;
++  if (resume_step == RESUME_STEP_CONTINUE && bpstat_should_step ())
++    resume_step = RESUME_STEP_NEEDED;
++
+   /* Resume inferior.  */
+-  resume (oneproc || step || bpstat_should_step (), tp->suspend.stop_signal);
++  resume (resume_step, tp->suspend.stop_signal);
+   /* Wait for it to stop (if not standalone)
+      and in any case decode why it stopped, and act accordingly.  */
+@@ -5123,14 +5133,19 @@ process_event_stop_test:
+ /* Is thread TP in the middle of single-stepping?  */
+-static int
++static enum resume_step
+ currently_stepping (struct thread_info *tp)
+ {
+-  return ((tp->control.step_range_end
+-         && tp->control.step_resume_breakpoint == NULL)
+-        || tp->control.trap_expected
+-        || tp->stepping_through_solib_after_catch
+-        || bpstat_should_step ());
++  if ((tp->control.step_range_end
++       && tp->control.step_resume_breakpoint == NULL)
++      || tp->control.trap_expected
++      || tp->stepping_through_solib_after_catch)
++    return RESUME_STEP_USER;
++
++  if (bpstat_should_step ())
++    return RESUME_STEP_NEEDED;
++
++  return RESUME_STEP_CONTINUE;
+ }
+ /* Returns true if any thread *but* the one passed in "data" is in the
+Index: gdb-7.3.50.20110722/gdb/linux-nat.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/linux-nat.c   2011-07-22 19:08:19.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/linux-nat.c        2011-07-22 19:10:24.000000000 +0200
+@@ -2986,7 +2986,10 @@ count_events_callback (struct lwp_info *
+ static int
+ select_singlestep_lwp_callback (struct lwp_info *lp, void *data)
+ {
+-  if (lp->step && lp->status != 0)
++  /* We do not focus on software watchpoints as we would not catch
++     STEPPING_PAST_SINGLESTEP_BREAKPOINT breakpoints in some other thread
++     as they would remain pending due to `Push back breakpoint for %s'.  */
++  if (lp->step == RESUME_STEP_USER && lp->status != 0)
+     return 1;
+   else
+     return 0;
+Index: gdb-7.3.50.20110722/gdb/linux-nat.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/linux-nat.h   2011-07-22 19:08:19.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/linux-nat.h        2011-07-22 19:10:24.000000000 +0200
+@@ -55,8 +55,8 @@ struct lwp_info
+   /* If non-zero, a pending wait status.  */
+   int status;
+-  /* Non-zero if we were stepping this LWP.  */
+-  int step;
++  /* The kind of stepping of this LWP.  */
++  enum resume_step step;
+   /* Non-zero si_signo if this LWP stopped with a trap.  si_addr may
+      be the address of a hardware watchpoint.  */
diff --git a/gdb/patches/gdb-6.6-step-thread-exit.patch b/gdb/patches/gdb-6.6-step-thread-exit.patch
new file mode 100644 (file)
index 0000000..22afbea
--- /dev/null
@@ -0,0 +1,60 @@
+Index: gdb-7.2.50.20101116/gdb/linux-nat.c
+===================================================================
+--- gdb-7.2.50.20101116.orig/gdb/linux-nat.c   2010-11-16 07:58:15.000000000 +0100
++++ gdb-7.2.50.20101116/gdb/linux-nat.c        2010-11-16 07:59:06.000000000 +0100
+@@ -1863,16 +1863,18 @@ resume_set_callback (struct lwp_info *lp
+ static void
+ linux_nat_resume (struct target_ops *ops,
+-                ptid_t ptid, int step, enum target_signal signo)
++                ptid_t ptid, int step_int, enum target_signal signo)
+ {
+   sigset_t prev_mask;
+   struct lwp_info *lp;
+   int resume_many;
++  enum resume_step step = step_int;
+   if (debug_linux_nat)
+     fprintf_unfiltered (gdb_stdlog,
+                       "LLR: Preparing to %s %s, %s, inferior_ptid %s\n",
+-                      step ? "step" : "resume",
++                      (step == RESUME_STEP_NEEDED
++                       ? "needed" : (step ? "step" : "resume")),
+                       target_pid_to_str (ptid),
+                       (signo != TARGET_SIGNAL_0
+                        ? strsignal (target_signal_to_host (signo)) : "0"),
+@@ -3171,10 +3173,34 @@ linux_nat_filter_event (int lwpid, int s
+       if (num_lwps (GET_PID (lp->ptid)) > 1)
+        {
++      enum resume_step step = lp->step;
++      pid_t pid = GET_PID (lp->ptid);
++
+        /* If there is at least one more LWP, then the exit signal
+           was not the end of the debugged application and should be
+           ignored.  */
+        exit_lwp (lp);
++
++      if (step == RESUME_STEP_USER)
++        {
++          /* Now stop the closest LWP's ...  */
++          lp = find_lwp_pid (pid_to_ptid (pid));
++          if (!lp)
++            lp = lwp_list;
++          gdb_assert (lp != NULL);
++          errno = 0;
++          ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0,
++                  (void *) (unsigned long) SIGSTOP);
++          if (debug_linux_nat)
++            fprintf_unfiltered (gdb_stdlog,
++                                "PTRACE_CONT %s, 0, 0 (%s)\n",
++                                target_pid_to_str (lp->ptid),
++                                errno ? safe_strerror (errno)
++                                      : "OK");
++          /* Avoid the silent `delayed SIGSTOP' handling.  */
++          lp->signalled = 0;
++        }
++
+        return NULL;
+        }
+     }
diff --git a/gdb/patches/gdb-6.6-testsuite-timeouts.patch b/gdb/patches/gdb-6.6-testsuite-timeouts.patch
new file mode 100644 (file)
index 0000000..1166ef0
--- /dev/null
@@ -0,0 +1,42 @@
+--- ./gdb/testsuite/gdb.base/annota1.exp       10 Jan 2007 03:23:04 -0000      1.23
++++ ./gdb/testsuite/gdb.base/annota1.exp       10 May 2007 12:54:11 -0000
+@@ -57,6 +57,8 @@ if [target_info exists gdb_stub] {
+     gdb_step_for_stub;
+ }
++gdb_test "set breakpoint pending off" "" "Avoid lockup on nonexisting functions"
++
+ #
+ # the line at which break main will put the breakpoint
+ #
+--- ./gdb/testsuite/gdb.base/annota3.exp       9 Jan 2007 17:59:09 -0000       1.12
++++ ./gdb/testsuite/gdb.base/annota3.exp       10 May 2007 12:54:11 -0000
+@@ -56,6 +56,8 @@ if [target_info exists gdb_stub] {
+     gdb_step_for_stub;
+ }
++gdb_test "set breakpoint pending off" "" "Avoid lockup on nonexisting functions"
++
+ #
+ # the line at which break main will put the breakpoint
+ #
+--- gdb-6.6/gdb/testsuite/gdb.threads/step-thread-exit.exp-orig        2007-05-10 15:03:15.000000000 +0200
++++ gdb-6.6/gdb/testsuite/gdb.threads/step-thread-exit.exp     2007-05-10 15:04:24.000000000 +0200
+@@ -58,6 +58,9 @@ gdb_test "continue" "Break.*thread_funct
+ # thread to be stopped and a message printed to tell us we have stepped
+ # over the thread exit.
+ set test "step over thread exit 1"
++# ppc64 is currently failing:
++set timeout_old $timeout
++set timeout 60
+ gdb_test_multiple "next" "$test" {
+   -re "\}.*$gdb_prompt $" {
+      send_gdb "next\n"
+@@ -71,6 +74,7 @@ gdb_test_multiple "next" "$test" {
+      exp_continue
+   }
+ }
++set timeout $timeout_old
+ # Without this fixup we could end up in:
+ # #0  0x00110416 in __kernel_vsyscall ()
diff --git a/gdb/patches/gdb-6.6-threads-static-test.patch b/gdb/patches/gdb-6.6-threads-static-test.patch
new file mode 100644 (file)
index 0000000..2bac722
--- /dev/null
@@ -0,0 +1,23 @@
+Index: gdb-7.1.90.20100711/gdb/testsuite/gdb.threads/staticthreads.exp
+===================================================================
+--- gdb-7.1.90.20100711.orig/gdb/testsuite/gdb.threads/staticthreads.exp       2010-06-02 23:53:28.000000000 +0200
++++ gdb-7.1.90.20100711/gdb/testsuite/gdb.threads/staticthreads.exp    2010-07-12 11:43:26.000000000 +0200
+@@ -44,6 +44,18 @@ gdb_test_no_output "set print sevenbit-s
+ # See if the static multi-threaded program runs.
+ runto_main
++
++# See if we get excessive LWP there (patched glibc with unpatched GDB):
++# * 2 Thread 135661664 (LWP 3856)  main () at threadloop.c:41
++#   1 process 3856  main () at threadloop.c:41
++
++set test "info threads on start"
++gdb_test_multiple "info threads" "$test" {
++    -re "^info threads\r?\n\[^\r\n\]* Thread \[^\r\n\]*\r?\n$gdb_prompt" {
++      pass "$test"
++    }
++}
++
+ gdb_test "break sem_post"
+ set test "Continue to main's call of sem_post"
+ gdb_test_multiple "continue" "$test" {
diff --git a/gdb/patches/gdb-6.7-bz426600-DW_TAG_interface_type-test.patch b/gdb/patches/gdb-6.7-bz426600-DW_TAG_interface_type-test.patch
new file mode 100644 (file)
index 0000000..9dc8a7b
--- /dev/null
@@ -0,0 +1,703 @@
+http://sourceware.org/ml/gdb-patches/2007-12/msg00397.html
+
+2007-12-22  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * gdb.arch/i386-interface.S, gdb.arch/i386-interface.exp: New files.
+
+2008-03-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * gdb.arch/i386-interface.exp: Fix a testcase race.
+
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.arch/i386-interface.S  22 Dec 2007 19:07:28 -0000
+@@ -0,0 +1,628 @@
++/* Copyright 2007 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++   Please email any bugs, comments, and/or additions to this file to:
++   bug-gdb@gnu.org
++
++   This file is part of the gdb testsuite.
++
++   This file was produced by:
++   $ gcj -S interface.java -ggdb2 -Wall -m32
++   from the .java file:
++     interface Interface
++     {
++     }
++     class Class implements Interface
++     {  
++     }
++*/
++
++      .file   "cc28Pp2B.jar"
++      .section        .debug_abbrev,"",@progbits
++.Ldebug_abbrev0:
++      .section        .debug_info,"",@progbits
++.Ldebug_info0:
++      .section        .debug_line,"",@progbits
++.Ldebug_line0:
++      .text
++.Ltext0:
++      .local  _MT_Interface
++      .comm   _MT_Interface,0,4
++      .data
++      .align 4
++      .type   _catch_classes_Interface, @object
++      .size   _catch_classes_Interface, 24
++_catch_classes_Interface:
++      .zero   24
++      .section        .rodata
++      .align 2
++      .type   _Utf1, @object
++      .size   _Utf1, 4
++_Utf1:
++      .value  36121
++      .value  9
++      .ascii  "Interface"
++      .zero   1
++.globl _ZN9Interface6class$E
++      .data
++      .align 32
++      .type   _ZN9Interface6class$E, @object
++      .size   _ZN9Interface6class$E, 144
++_ZN9Interface6class$E:
++      .long   _ZTVN4java4lang5ClassE+8
++      .long   403000
++      .long   _Utf1
++      .value  1536
++      .zero   2
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   _MT_Interface
++      .value  0
++      .value  6
++      .long   0
++      .long   4
++      .value  0
++      .value  0
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   _catch_classes_Interface
++      .long   0
++      .long   0
++      .value  0
++      .byte   1
++      .zero   1
++      .long   0
++      .value  0
++      .zero   2
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .hidden _ZN9Interface7class$$E
++.globl _ZN9Interface7class$$E
++      .section        .rodata
++      .align 4
++      .type   _ZN9Interface7class$$E, @object
++      .size   _ZN9Interface7class$$E, 4
++_ZN9Interface7class$$E:
++      .long   _ZN9Interface6class$E
++      .text
++      .align 2
++.globl _ZN5ClassC1Ev
++      .type   _ZN5ClassC1Ev, @function
++_ZN5ClassC1Ev:
++.LFB2:
++      pushl   %ebp
++.LCFI0:
++      movl    %esp, %ebp
++.LCFI1:
++      subl    $24, %esp
++.LCFI2:
++.LBB2:
++#if 0
++      .file 1 "interface.java"
++#else
++      .file "interface.java"
++#endif
++      .loc 1 4 0
++      movl    8(%ebp), %eax
++      movl    %eax, -4(%ebp)
++      movl    -4(%ebp), %eax
++      movl    %eax, (%esp)
++      call    _ZN4java4lang6ObjectC1Ev
++.LBE2:
++      leave
++      ret
++.LFE2:
++      .size   _ZN5ClassC1Ev, .-_ZN5ClassC1Ev
++      .hidden _ZTVN5ClassE
++.globl _ZTVN5ClassE
++      .data
++      .align 32
++      .type   _ZTVN5ClassE, @object
++      .size   _ZTVN5ClassE, 40
++_ZTVN5ClassE:
++      .long   0
++      .long   0
++      .long   _ZN5Class6class$E
++      .long   4
++      .long   _ZN4java4lang6Object8finalizeEJvv
++      .long   _ZN4java4lang6Object8hashCodeEJiv
++      .long   _ZN4java4lang6Object6equalsEJbPS1_
++      .long   _ZN4java4lang6Object8toStringEJPNS0_6StringEv
++      .long   _ZN4java4lang6Object5cloneEJPS1_v
++      .long   _ZN4java4lang6Object22throwNoSuchMethodErrorEJvv
++      .set    .L_ZN5ClassC1Ev0,_ZN5ClassC1Ev
++      .section        .rodata
++      .align 2
++      .type   _Utf2, @object
++      .size   _Utf2, 4
++_Utf2:
++      .value  626
++      .value  6
++      .ascii  "<init>"
++      .zero   1
++      .align 2
++      .type   _Utf3, @object
++      .size   _Utf3, 4
++_Utf3:
++      .value  39797
++      .value  3
++      .ascii  "()V"
++      .zero   1
++      .data
++      .align 4
++      .type   _MT_Class, @object
++      .size   _MT_Class, 20
++_MT_Class:
++      .long   _Utf2
++      .long   _Utf3
++      .value  16384
++      .value  -1
++      .long   .L_ZN5ClassC1Ev0
++      .long   0
++      .align 4
++      .type   _IF_Class, @object
++      .size   _IF_Class, 4
++_IF_Class:
++      .long   _ZN9Interface6class$E
++      .align 4
++      .type   _catch_classes_Class, @object
++      .size   _catch_classes_Class, 24
++_catch_classes_Class:
++      .zero   24
++      .section        .rodata
++      .align 2
++      .type   _Utf4, @object
++      .size   _Utf4, 4
++_Utf4:
++      .value  47448
++      .value  5
++      .ascii  "Class"
++      .zero   1
++.globl _ZN5Class6class$E
++      .data
++      .align 32
++      .type   _ZN5Class6class$E, @object
++      .size   _ZN5Class6class$E, 144
++_ZN5Class6class$E:
++      .long   _ZTVN4java4lang5ClassE+8
++      .long   403000
++      .long   _Utf4
++      .value  32
++      .zero   2
++      .long   _ZN4java4lang6Object6class$E
++      .long   0
++      .long   0
++      .long   0
++      .long   _MT_Class
++      .value  1
++      .value  6
++      .long   0
++      .long   4
++      .value  0
++      .value  0
++      .long   _ZTVN5ClassE+8
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   _catch_classes_Class
++      .long   _IF_Class
++      .long   0
++      .value  1
++      .byte   1
++      .zero   1
++      .long   0
++      .value  0
++      .zero   2
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .long   0
++      .hidden _ZN5Class7class$$E
++.globl _ZN5Class7class$$E
++      .section        .rodata
++      .align 4
++      .type   _ZN5Class7class$$E, @object
++      .size   _ZN5Class7class$$E, 4
++_ZN5Class7class$$E:
++      .long   _ZN5Class6class$E
++      .section        .jcr,"aw",@progbits
++      .align 4
++      .long   _ZN9Interface6class$E
++      .long   _ZN5Class6class$E
++      .section        .debug_frame,"",@progbits
++.Lframe0:
++      .long   .LECIE0-.LSCIE0
++.LSCIE0:
++      .long   0xffffffff
++      .byte   0x1
++      .string ""
++      .uleb128 0x1
++      .sleb128 -4
++      .byte   0x8
++      .byte   0xc
++      .uleb128 0x4
++      .uleb128 0x4
++      .byte   0x88
++      .uleb128 0x1
++      .align 4
++.LECIE0:
++.LSFDE0:
++      .long   .LEFDE0-.LASFDE0
++.LASFDE0:
++      .long   .Lframe0
++      .long   .LFB2
++      .long   .LFE2-.LFB2
++      .byte   0x4
++      .long   .LCFI0-.LFB2
++      .byte   0xe
++      .uleb128 0x8
++      .byte   0x85
++      .uleb128 0x2
++      .byte   0x4
++      .long   .LCFI1-.LCFI0
++      .byte   0xd
++      .uleb128 0x5
++      .align 4
++.LEFDE0:
++      .section        .eh_frame,"a",@progbits
++.Lframe1:
++      .long   .LECIE1-.LSCIE1
++.LSCIE1:
++      .long   0x0
++      .byte   0x1
++.globl __gcj_personality_v0
++      .string "zP"
++      .uleb128 0x1
++      .sleb128 -4
++      .byte   0x8
++      .uleb128 0x5
++      .byte   0x0
++      .long   __gcj_personality_v0
++      .byte   0xc
++      .uleb128 0x4
++      .uleb128 0x4
++      .byte   0x88
++      .uleb128 0x1
++      .align 4
++.LECIE1:
++.LSFDE1:
++      .long   .LEFDE1-.LASFDE1
++.LASFDE1:
++      .long   .LASFDE1-.Lframe1
++      .long   .LFB2
++      .long   .LFE2-.LFB2
++      .uleb128 0x0
++      .byte   0x4
++      .long   .LCFI0-.LFB2
++      .byte   0xe
++      .uleb128 0x8
++      .byte   0x85
++      .uleb128 0x2
++      .byte   0x4
++      .long   .LCFI1-.LCFI0
++      .byte   0xd
++      .uleb128 0x5
++      .align 4
++.LEFDE1:
++      .text
++.Letext0:
++      .section        .debug_loc,"",@progbits
++.Ldebug_loc0:
++.LLST0:
++      .long   .LFB2-.Ltext0
++      .long   .LCFI0-.Ltext0
++      .value  0x2
++      .byte   0x74
++      .sleb128 4
++      .long   .LCFI0-.Ltext0
++      .long   .LCFI1-.Ltext0
++      .value  0x2
++      .byte   0x74
++      .sleb128 8
++      .long   .LCFI1-.Ltext0
++      .long   .LFE2-.Ltext0
++      .value  0x2
++      .byte   0x75
++      .sleb128 8
++      .long   0x0
++      .long   0x0
++      .section        .debug_info
++      .long   0x117
++      .value  0x2
++      .long   .Ldebug_abbrev0
++      .byte   0x4
++      .uleb128 0x1
++      .string "GNU Java 4.3.0 20071221 (experimental)"
++      .byte   0xb
++      .string "interface.java"
++      .string "/home/jkratoch/redhat/bz371831"
++      .long   .Ltext0
++      .long   .Letext0
++      .long   .Ldebug_line0
++      .uleb128 0x2
++      .string "Interface"
++      .byte   0x4
++      .byte   0x1
++      .byte   0x0
++      .long   0x8e
++      .long   0x8e
++      .uleb128 0x3
++      .long   0x8e
++      .byte   0x2
++      .byte   0x23
++      .uleb128 0x0
++      .byte   0x1
++      .byte   0x0
++      .uleb128 0x4
++      .string "java.lang.Object"
++      .byte   0x1
++      .uleb128 0x5
++      .string "Class"
++      .byte   0x4
++      .byte   0x1
++      .byte   0x0
++      .long   0x8e
++      .long   0xe8
++      .uleb128 0x3
++      .long   0x8e
++      .byte   0x2
++      .byte   0x23
++      .uleb128 0x0
++      .byte   0x1
++      .uleb128 0x6
++      .long   0x6e
++      .byte   0x2
++      .byte   0x23
++      .uleb128 0x0
++      .byte   0x1
++      .byte   0x1
++      .uleb128 0x7
++      .byte   0x1
++      .string "<init>"
++      .byte   0x1
++      .byte   0x0
++      .string "_ZN5ClassC1Ev"
++      .byte   0x1
++      .uleb128 0x8
++      .long   0xe8
++      .byte   0x1
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x9
++      .byte   0x4
++      .long   0xa1
++      .uleb128 0xa
++      .long   0xc6
++      .long   .LFB2
++      .long   .LFE2
++      .long   .LLST0
++      .long   0x114
++      .uleb128 0xb
++      .long   0xe8
++      .byte   0x2
++      .byte   0x91
++      .sleb128 0
++      .uleb128 0xc
++      .long   0x114
++      .byte   0x2
++      .byte   0x91
++      .sleb128 -12
++      .byte   0x0
++      .uleb128 0x9
++      .byte   0x4
++      .long   0x8e
++      .byte   0x0
++      .section        .debug_abbrev
++      .uleb128 0x1
++      .uleb128 0x11
++      .byte   0x1
++      .uleb128 0x25
++      .uleb128 0x8
++      .uleb128 0x13
++      .uleb128 0xb
++      .uleb128 0x3
++      .uleb128 0x8
++      .uleb128 0x1b
++      .uleb128 0x8
++      .uleb128 0x11
++      .uleb128 0x1
++      .uleb128 0x12
++      .uleb128 0x1
++      .uleb128 0x10
++      .uleb128 0x6
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x2
++      .uleb128 0x38
++      .byte   0x1
++      .uleb128 0x3
++      .uleb128 0x8
++      .uleb128 0xb
++      .uleb128 0xb
++      .uleb128 0x3a
++      .uleb128 0xb
++      .uleb128 0x3b
++      .uleb128 0xb
++      .uleb128 0x1d
++      .uleb128 0x13
++      .uleb128 0x1
++      .uleb128 0x13
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x3
++      .uleb128 0x1c
++      .byte   0x0
++      .uleb128 0x49
++      .uleb128 0x13
++      .uleb128 0x38
++      .uleb128 0xa
++      .uleb128 0x32
++      .uleb128 0xb
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x4
++      .uleb128 0x2
++      .byte   0x0
++      .uleb128 0x3
++      .uleb128 0x8
++      .uleb128 0x3c
++      .uleb128 0xc
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x5
++      .uleb128 0x2
++      .byte   0x1
++      .uleb128 0x3
++      .uleb128 0x8
++      .uleb128 0xb
++      .uleb128 0xb
++      .uleb128 0x3a
++      .uleb128 0xb
++      .uleb128 0x3b
++      .uleb128 0xb
++      .uleb128 0x1d
++      .uleb128 0x13
++      .uleb128 0x1
++      .uleb128 0x13
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x6
++      .uleb128 0x1c
++      .byte   0x0
++      .uleb128 0x49
++      .uleb128 0x13
++      .uleb128 0x38
++      .uleb128 0xa
++      .uleb128 0x4c
++      .uleb128 0xb
++      .uleb128 0x32
++      .uleb128 0xb
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x7
++      .uleb128 0x2e
++      .byte   0x1
++      .uleb128 0x3f
++      .uleb128 0xc
++      .uleb128 0x3
++      .uleb128 0x8
++      .uleb128 0x3a
++      .uleb128 0xb
++      .uleb128 0x3b
++      .uleb128 0xb
++      .uleb128 0x2007
++      .uleb128 0x8
++      .uleb128 0x3c
++      .uleb128 0xc
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x8
++      .uleb128 0x5
++      .byte   0x0
++      .uleb128 0x49
++      .uleb128 0x13
++      .uleb128 0x34
++      .uleb128 0xc
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x9
++      .uleb128 0xf
++      .byte   0x0
++      .uleb128 0xb
++      .uleb128 0xb
++      .uleb128 0x49
++      .uleb128 0x13
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0xa
++      .uleb128 0x2e
++      .byte   0x1
++      .uleb128 0x47
++      .uleb128 0x13
++      .uleb128 0x11
++      .uleb128 0x1
++      .uleb128 0x12
++      .uleb128 0x1
++      .uleb128 0x40
++      .uleb128 0x6
++      .uleb128 0x1
++      .uleb128 0x13
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0xb
++      .uleb128 0x5
++      .byte   0x0
++      .uleb128 0x49
++      .uleb128 0x13
++      .uleb128 0x2
++      .uleb128 0xa
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0xc
++      .uleb128 0x34
++      .byte   0x0
++      .uleb128 0x49
++      .uleb128 0x13
++      .uleb128 0x2
++      .uleb128 0xa
++      .byte   0x0
++      .byte   0x0
++      .byte   0x0
++      .section        .debug_pubnames,"",@progbits
++      .long   0x15
++      .value  0x2
++      .long   .Ldebug_info0
++      .long   0x11b
++      .long   0xee
++      .string "()"
++      .long   0x0
++      .section        .debug_aranges,"",@progbits
++      .long   0x1c
++      .value  0x2
++      .long   .Ldebug_info0
++      .byte   0x4
++      .byte   0x0
++      .value  0x0
++      .value  0x0
++      .long   .Ltext0
++      .long   .Letext0-.Ltext0
++      .long   0x0
++      .long   0x0
++      .ident  "GCC: (GNU) 4.3.0 20071221 (experimental)"
++      .section        .note.GNU-stack,"",@progbits
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.arch/i386-interface.exp        22 Dec 2007 19:07:28 -0000
+@@ -0,0 +1,59 @@
++# Copyright 2007 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++# Please email any bugs, comments, and/or additions to this file to:
++# bug-gdb@gnu.org
++
++# This file is part of the gdb testsuite.
++
++# Test basis recognization of DW_TAG_interface_type.
++# GCC java_classify_record() produces it if returns RECORD_IS_INTERFACE.
++
++if {![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]} then {
++    verbose "Skipping i386 Java DW_TAG_interface_type test."
++    return
++}
++
++set testfile "i386-interface"
++set srcfile ${testfile}.S
++set binfile ${objdir}/${subdir}/${testfile}.o
++
++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug additional_flags=-m32}] != "" } {
++    untested i386-gnu-cfi.exp
++    return -1
++}
++
++# Get things started.
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++gdb_test "set language java"
++
++set test "ptype Interface"
++gdb_test_multiple $test $test {
++    -re "type = class Interface  *extends java.lang.Object \{.*$gdb_prompt $" {
++      pass $test
++    }
++}
++
++set test "ptype Class"
++gdb_test_multiple $test $test {
++    -re "type = class Class  *extends java.lang.Object implements Interface \{.*$gdb_prompt $" {
++      pass $test
++    }
++}
diff --git a/gdb/patches/gdb-6.7-charsign-test.patch b/gdb/patches/gdb-6.7-charsign-test.patch
new file mode 100644 (file)
index 0000000..793ff8a
--- /dev/null
@@ -0,0 +1,118 @@
+https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224128
+
+2007-01-25  Jan Kratochvil <jan.kratochvil@redhat.com>
+
+       * gdb.base/charsign.exp, gdb.base/charsign.c: New files.
+       [ stripped ]
+
+2007-10-19  Jan Kratochvil <jan.kratochvil@redhat.com>
+
+       Port to GDB-6.7 - only the testcase left, patch has been reverted,
+       char-vectors restricted.
+
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.base/charsign.c        26 Jan 2007 10:32:00 -0000
+@@ -0,0 +1,37 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2007 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++   Please email any bugs, comments, and/or additions to this file to:
++   bug-gdb@prep.ai.mit.edu  */
++
++int main()
++{
++  return 0;
++}
++
++char n[]="A";
++signed char s[]="A";
++unsigned char u[]="A";
++
++typedef char char_n;
++typedef signed char char_s;
++typedef unsigned char char_u;
++
++char_n n_typed[]="A";
++char_s s_typed[]="A";
++char_u u_typed[]="A";
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.base/charsign.exp      26 Jan 2007 10:32:00 -0000
+@@ -0,0 +1,63 @@
++# Copyright 2007 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++set testfile charsign
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++
++proc do_test { cflags } {
++    global srcdir
++    global binfile
++    global subdir
++    global srcfile
++    global gdb_prompt
++
++    if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug additional_flags=$cflags]] != "" } {
++      untested "Couldn't compile test program"
++      return -1
++    }
++
++    # Get things started.
++
++    gdb_exit
++    gdb_start
++    gdb_reinitialize_dir $srcdir/$subdir
++    gdb_load ${binfile}
++
++    # For C programs, "start" should stop in main().
++
++    gdb_test "p n" \
++           "= \"A\""
++    gdb_test "p s" \
++           "= \\{65 'A', 0 '\\\\0'\\}"
++    gdb_test "p u" \
++           "= \\{65 'A', 0 '\\\\0'\\}"
++    gdb_test "p n_typed" \
++           "= \"A\""
++    gdb_test "p s_typed" \
++           "= \\{65 'A', 0 '\\\\0'\\}"
++    gdb_test "p u_typed" \
++           "= \\{65 'A', 0 '\\\\0'\\}"
++}
++
++# The string identification works despite the compiler flags below due to
++# gdbtypes.c:
++#   if (name && strcmp (name, "char") == 0)
++#     TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN;
++
++do_test {}
++do_test {-fsigned-char}
++do_test {-funsigned-char}
diff --git a/gdb/patches/gdb-6.7-ppc-clobbered-registers-O2-test.patch b/gdb/patches/gdb-6.7-ppc-clobbered-registers-O2-test.patch
new file mode 100644 (file)
index 0000000..761d10f
--- /dev/null
@@ -0,0 +1,96 @@
+2007-11-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * gdb.arch/ppc-clobbered-registers-O2.exp: `powerpc64' changed to
+       `powerpc*'.
+
+Testcase for:
+
+http://sourceware.org/ml/gdb-patches/2007-09/msg00228.html
+
+2007-10-21  Luis Machado  <luisgpm@br.ibm.com>
+
+       * rs6000-tdep.c (ppc_dwarf2_frame_init_reg): New function.
+       * (rs6000_gdbarch_init): Install ppc_dwarf2_frame_init_reg as
+       default dwarf2_frame_set_init_reg function.
+
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c      3 Nov 2007 22:22:28 -0000
+@@ -0,0 +1,21 @@
++
++unsigned * __attribute__((noinline))
++start_sequence (unsigned * x, unsigned * y)
++{
++      return (unsigned *)0xdeadbeef;
++};
++
++unsigned __attribute__((noinline))
++gen_movsd (unsigned * operand0, unsigned * operand1)
++{
++      return *start_sequence(operand0, operand1);
++}
++
++int main(void)
++{
++  unsigned x, y;
++
++  x = 13;
++  y = 14;
++  return (int)gen_movsd (&x, &y);
++}
+--- /dev/null  1 Jan 1970 00:00:00 -0000
++++ ./gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp    3 Nov 2007 22:22:28 -0000
+@@ -0,0 +1,54 @@
++# Copyright 2006 Free Software Foundation, Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++#
++# This file is part of the gdb testsuite.
++
++# Test displaying call clobbered registers in optimized binaries for ppc.
++# GDB should not show incorrect values.
++
++if ![istarget "powerpc*-*"] then {
++    verbose "Skipping powerpc* call clobbered registers testing."
++    return
++}
++
++set testfile "ppc-clobbered-registers-O2"
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++set compile_flags "debug additional_flags=-O2"
++
++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ${compile_flags}] != "" } {
++    unsupported "Testcase compile failed."
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++if ![runto_main] then {
++    perror "Couldn't run to breakpoint"
++    continue
++}
++
++gdb_test "b start_sequence" ".*Breakpoint 2 at.*line 6.*" \
++  "Insert breakpoint at problematic function"
++
++gdb_test continue ".*Breakpoint 2.*in start_sequence.*" \
++  "Run until problematic function"
++
++gdb_test backtrace ".*operand0=<value optimized out>.*operand1=<value optimized out>.*" \
++  "Check value of call clobbered registers"
diff --git a/gdb/patches/gdb-6.7-testsuite-stable-results.patch b/gdb/patches/gdb-6.7-testsuite-stable-results.patch
new file mode 100644 (file)
index 0000000..a4c195c
--- /dev/null
@@ -0,0 +1,108 @@
+gdb/testsuite/gdb.base/fileio.c:
+gdb/testsuite/gdb.base/fileio.exp:
+2007-12-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * gdb.base/fileio.c (ROOTSUBDIR): New macro.
+       (main): CHDIR into ROOTSUBDIR.  CHOWN ROOTSUBDIR and CHDIR into
+       ROOTSUBDIR if we are being run as root.
+       * gdb.base/fileio.exp: Change the startup and finish cleanup.
+       Change the test file reference to be into the `fileio.dir' directory.
+
+
+sources/gdb/testsuite/gdb.base/dump.exp:
+Found on RHEL-5.s390x.
+
+
+gdb-6.8.50.20090209/gdb/testsuite/gdb.base/auxv.exp:
+random FAIL: gdb.base/auxv.exp: matching auxv data from live and gcore
+
+
+gdb-6.8.50.20090209/gdb/testsuite/gdb.base/annota1.exp:
+frames-invalid can happen asynchronously.
+
+Index: gdb-7.1.90.20100711/gdb/testsuite/gdb.base/fileio.c
+===================================================================
+--- gdb-7.1.90.20100711.orig/gdb/testsuite/gdb.base/fileio.c   2009-10-01 17:39:13.000000000 +0200
++++ gdb-7.1.90.20100711/gdb/testsuite/gdb.base/fileio.c        2010-07-12 11:41:43.000000000 +0200
+@@ -58,6 +58,8 @@ system (const char * string);
+ 1) Invalid string/command. -  returns 127.  */
+ static const char *strerrno (int err);
++#define ROOTSUBDIR "fileio.dir"
++
+ #define FILENAME    "foo.fileio.test"
+ #define RENAMED     "bar.fileio.test"
+ #define NONEXISTANT "nofoo.fileio.test"
+@@ -542,6 +544,37 @@ strerrno (int err)
+ int
+ main ()
+ {
++  /* ROOTSUBDIR is already prepared by fileio.exp.  We use it for easy cleanup
++     (by fileio.exp) if we are run by multiple users in the same directory.  */
++
++  if (chdir (ROOTSUBDIR) != 0)
++    {
++      printf ("chdir " ROOTSUBDIR ": %s\n", strerror (errno));
++      exit (1);
++    }
++
++  /* These tests
++       Open for write but no write permission returns EACCES
++       Unlinking a file in a directory w/o write access returns EACCES
++     fail if we are being run as root - drop the privileges here.  */
++
++  if (geteuid () == 0)
++    {
++      uid_t uid = 99;
++
++      if (chown (".", uid, uid) != 0)
++      {
++        printf ("chown %d.%d " ROOTSUBDIR ": %s\n", (int) uid, (int) uid,
++                strerror (errno));
++        exit (1);
++      }
++      if (setuid (uid) || geteuid () == 0)
++      {
++        printf ("setuid %d: %s\n", (int) uid, strerror (errno));
++        exit (1);
++      }
++    }
++
+   /* Don't change the order of the calls.  They partly depend on each other */
+   test_open ();
+   test_write ();
+Index: gdb-7.1.90.20100711/gdb/testsuite/gdb.base/fileio.exp
+===================================================================
+--- gdb-7.1.90.20100711.orig/gdb/testsuite/gdb.base/fileio.exp 2010-06-09 00:58:03.000000000 +0200
++++ gdb-7.1.90.20100711/gdb/testsuite/gdb.base/fileio.exp      2010-07-12 11:42:07.000000000 +0200
+@@ -42,8 +42,8 @@ if [get_compiler_info ${binfile}] {
+     return -1;
+ }
+-remote_exec build {sh -xc test\ -r\ dir2.fileio.test\ &&\ chmod\ -f\ +w\ dir2.fileio.test}
+-remote_exec build {sh -xc rm\ -rf\ *.fileio.test}
++remote_exec build {sh -xc rm\ -rf\ fileio.dir}
++remote_exec build {sh -xc mkdir\ -m777\ fileio.dir}
+ set oldtimeout $timeout
+ set timeout [expr "$timeout + 60"]
+@@ -85,7 +85,7 @@ gdb_test continue \
+ gdb_test "continue" ".*" ""
+-catch "system \"chmod -f -w nowrt.fileio.test\""
++catch "system \"chmod -f -w fileio.dir/nowrt.fileio.test\""
+ gdb_test continue \
+ "Continuing\\..*open 5:.*EACCES$stop_msg" \
+@@ -250,8 +250,8 @@ gdb_test continue \
+ send_gdb "quit\n"
+ send_gdb "y\n"
+-remote_exec build {sh -xc test\ -r\ dir2.fileio.test\ &&\ chmod\ -f\ +w\ dir2.fileio.test}
+-remote_exec build {sh -xc rm\ -rf\ *.fileio.test}
++remote_exec build {sh -xc test\ -r\ fileio.dir/dir2.fileio.test\ &&\ chmod\ -f\ +w\ fileio.dir/dir2.fileio.test}
++remote_exec build {sh -xc rm\ -rf\ fileio.dir}
+ set timeout $oldtimeout
+ return 0
diff --git a/gdb/patches/gdb-6.8-attach-signalled-detach-stopped.patch b/gdb/patches/gdb-6.8-attach-signalled-detach-stopped.patch
new file mode 100644 (file)
index 0000000..a518122
--- /dev/null
@@ -0,0 +1,183 @@
+Index: gdb-7.0.50.20100115/gdb/linux-nat.c
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/linux-nat.c   2010-01-15 11:53:34.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/linux-nat.c        2010-01-15 12:13:53.000000000 +0100
+@@ -208,6 +208,9 @@ blocked.  */
+ static struct target_ops *linux_ops;
+ static struct target_ops linux_ops_saved;
++/* PID of the inferior stopped by SIGSTOP before attaching (or zero).  */
++static pid_t pid_was_stopped;
++
+ /* The method to call, if any, when a new thread is attached.  */
+ static void (*linux_nat_new_thread) (ptid_t);
+@@ -933,7 +936,14 @@ Attaching after process %d fork to child
+         parent_inf->waiting_for_vfork_done = 0;
+       }
+       else if (detach_fork)
+-      target_detach (NULL, 0);
++      {
++        /* We should check PID_WAS_STOPPED and detach it stopped accordingly.
++           In this point of code it cannot be 1 as we would not get FORK
++           executed without CONTINUE first which resets PID_WAS_STOPPED.
++           We would have to first TARGET_STOP and WAITPID it as with running
++           inferior PTRACE_DETACH, SIGSTOP will ignore the signal.  */
++        target_detach (NULL, 0);
++      }
+       /* Note that the detach above makes PARENT_INF dangling.  */
+@@ -1427,6 +1437,7 @@ linux_nat_post_attach_wait (ptid_t ptid,
+       if (debug_linux_nat)
+       fprintf_unfiltered (gdb_stdlog,
+                           "LNPAW: Attaching to a stopped process\n");
++      pid_was_stopped = GET_PID (ptid);
+       /* The process is definitely stopped.  It is in a job control
+        stop, unless the kernel predates the TASK_STOPPED /
+@@ -1757,6 +1768,9 @@ GPT: lwp %s had signal %s, but it is in 
+                           target_signal_to_string (signo));
+     }
++  if (*status == 0 && GET_PID (lp->ptid) == pid_was_stopped)
++    *status = W_STOPCODE (SIGSTOP);
++
+   return 0;
+ }
+@@ -1866,6 +1880,8 @@ linux_nat_detach (struct target_ops *ops
+     }
+   else
+     linux_ops->to_detach (ops, args, from_tty);
++
++  pid_was_stopped = 0;
+ }
+ /* Resume LP.  */
+@@ -2031,6 +2047,14 @@ linux_nat_resume (struct target_ops *ops
+      resume_callback.  */
+   lp->stopped = 0;
++  /* At this point, we are going to resume the inferior and if we
++     have attached to a stopped process, we no longer should leave
++     it as stopped if the user detaches.  PTID variable has PID set to LWP
++     while we need to check the real PID here.  */
++
++  if (!step && lp && pid_was_stopped == GET_PID (lp->ptid))
++    pid_was_stopped = 0;
++
+   if (resume_many)
+     iterate_over_lwps (ptid, resume_callback, NULL);
+@@ -3923,6 +3947,8 @@ linux_nat_mourn_inferior (struct target_
+        there are other viable forks to debug.  Delete the exiting
+        one and context-switch to the first available.  */
+     linux_fork_mourn_inferior ();
++
++  pid_was_stopped = 0;
+ }
+ /* Convert a native/host siginfo object, into/from the siginfo in the
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.threads/attach-stopped.exp
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.threads/attach-stopped.exp      2010-01-01 08:32:06.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.threads/attach-stopped.exp   2010-01-15 11:54:57.000000000 +0100
+@@ -62,7 +62,65 @@ proc corefunc { threadtype } {
+     gdb_reinitialize_dir $srcdir/$subdir
+     gdb_load ${binfile}
+-    # Verify that we can attach to the stopped process.
++    # Verify that we can attach to the process by first giving its
++    # executable name via the file command, and using attach with the
++    # process ID.
++
++    set test "$threadtype: set file, before attach1 to stopped process"
++    gdb_test_multiple "file $binfile" "$test" {
++       -re "Load new symbol table from.*y or n. $" {
++          gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." \
++                  "$test (re-read)"
++      }
++      -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" {
++          pass "$test"
++      }
++    }
++
++    set test "$threadtype: attach1 to stopped, after setting file"
++    gdb_test_multiple "attach $testpid" "$test" {
++      -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" {
++          pass "$test"
++      }
++    }
++
++    # ".*sleep.*clone.*" would fail on s390x as bt stops at START_THREAD there.
++    if {[string equal $threadtype threaded]} {
++      gdb_test "thread apply all bt" ".*sleep.*start_thread.*" "$threadtype: attach1 to stopped bt"
++    } else {
++      gdb_test "bt" ".*sleep.*main.*" "$threadtype: attach1 to stopped bt"
++    }
++
++    # Exit and detach the process.
++       
++    gdb_exit
++
++    # Avoid some race:
++    sleep 2
++
++    if [catch {open /proc/${testpid}/status r} fileid] {
++      set line2 "NOTFOUND"
++    } else {
++      gets $fileid line1;
++      gets $fileid line2;
++      close $fileid;
++    }
++
++    set test "$threadtype: attach1, exit leaves process stopped"
++    if {[string match "*(stopped)*" $line2]} {
++      pass $test
++    } else {
++      fail $test
++    }
++
++    # At this point, the process should still be stopped
++
++    gdb_start
++    gdb_reinitialize_dir $srcdir/$subdir
++    gdb_load ${binfile}
++
++    # Verify that we can attach to the process just by giving the
++    # process ID.
+        
+     set test "$threadtype: attach2 to stopped, after setting file"
+     gdb_test_multiple "attach $testpid" "$test" {
+Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.threads/attachstop-mt.exp
+===================================================================
+--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.threads/attachstop-mt.exp       2010-01-01 08:32:06.000000000 +0100
++++ gdb-7.0.50.20100115/gdb/testsuite/gdb.threads/attachstop-mt.exp    2010-01-15 11:54:57.000000000 +0100
+@@ -176,12 +176,23 @@ gdb_test "bt" ".*sleep.*(func|main).*" "
+ # Exit and detach the process.
+ gdb_exit
+-# Stop the program 
+-remote_exec build "kill -s STOP ${testpid}"
+-
+ # No race
+ sleep 2
++set fileid3 [open $status2 r];
++gets $fileid3 line1;
++gets $fileid3 line2;
++close $fileid3;
++
++set test "attach3, exit leaves process stopped"
++if {[string match "*(stopped)*" $line2]} {
++  pass $test
++} else {
++  fail $test
++}
++
++# At this point, the process should still be stopped
++
+ # Continue the test as we would hit another expected bug regarding
+ #     Program received signal SIGSTOP, Stopped (signal).
+ # across NPTL threads.
diff --git a/gdb/patches/gdb-6.8-bz254229-gcore-prpsinfo.patch b/gdb/patches/gdb-6.8-bz254229-gcore-prpsinfo.patch
new file mode 100644 (file)
index 0000000..b5eb514
--- /dev/null
@@ -0,0 +1,289 @@
+Index: gdb-7.2.50.20110320/bfd/elf-bfd.h
+===================================================================
+--- gdb-7.2.50.20110320.orig/bfd/elf-bfd.h     2011-03-20 15:17:42.000000000 +0100
++++ gdb-7.2.50.20110320/bfd/elf-bfd.h  2011-03-20 15:24:02.000000000 +0100
+@@ -2193,8 +2193,10 @@ extern Elf_Internal_Phdr * _bfd_elf_find
+ /* Exported interface for writing elf corefile notes. */
+ extern char *elfcore_write_note
+   (bfd *, char *, int *, const char *, int, const void *, int);
++struct elf_prpsinfo;
++typedef struct elf_prpsinfo prpsinfo_t;
+ extern char *elfcore_write_prpsinfo
+-  (bfd *, char *, int *, const char *, const char *);
++  (bfd *, char *, int *, const prpsinfo_t *);
+ extern char *elfcore_write_prstatus
+   (bfd *, char *, int *, long, int, const void *);
+ extern char * elfcore_write_pstatus
+Index: gdb-7.2.50.20110320/bfd/elf.c
+===================================================================
+--- gdb-7.2.50.20110320.orig/bfd/elf.c 2011-03-20 15:17:42.000000000 +0100
++++ gdb-7.2.50.20110320/bfd/elf.c      2011-03-20 15:24:02.000000000 +0100
+@@ -8814,13 +8814,12 @@ elfcore_write_note (bfd *abfd,
+   return buf;
+ }
+-#if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T)
++#if defined (HAVE_PRPSINFO_T)
+ char *
+ elfcore_write_prpsinfo (bfd  *abfd,
+                       char *buf,
+                       int  *bufsiz,
+-                      const char *fname,
+-                      const char *psargs)
++                      const prpsinfo_t *input)
+ {
+   const char *note_name = "CORE";
+   const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+@@ -8828,48 +8827,55 @@ elfcore_write_prpsinfo (bfd  *abfd,
+   if (bed->elf_backend_write_core_note != NULL)
+     {
+       char *ret;
++      char fname[sizeof (input->pr_fname) + 1];
++      char psargs[sizeof (input->pr_psargs) + 1];
++
++      strncpy (fname, input->pr_fname, sizeof (input->pr_fname));
++      fname[sizeof (input->pr_fname)] = 0;
++      strncpy (psargs, input->pr_psargs, sizeof (input->pr_psargs));
++      psargs[sizeof (input->pr_psargs)] = 0;
++
+       ret = (*bed->elf_backend_write_core_note) (abfd, buf, bufsiz,
+                                                NT_PRPSINFO, fname, psargs);
+       if (ret != NULL)
+       return ret;
+     }
+-#if defined (HAVE_PRPSINFO32_T) || defined (HAVE_PSINFO32_T)
++#if defined (HAVE_PRPSINFO32_T)
+   if (bed->s->elfclass == ELFCLASS32)
+     {
+-#if defined (HAVE_PSINFO32_T)
+-      psinfo32_t data;
+-      int note_type = NT_PSINFO;
+-#else
+       prpsinfo32_t data;
+       int note_type = NT_PRPSINFO;
+-#endif
+       memset (&data, 0, sizeof (data));
+-      strncpy (data.pr_fname, fname, sizeof (data.pr_fname));
+-      strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs));
++      data.pr_state = input->pr_state;
++      data.pr_sname = input->pr_sname;
++      data.pr_zomb = input->pr_zomb;
++      data.pr_nice = input->pr_nice;
++      data.pr_flag = input->pr_flag;
++      data.pr_uid = input->pr_uid;
++      data.pr_gid = input->pr_gid;
++      data.pr_pid = input->pr_pid;
++      data.pr_ppid = input->pr_ppid;
++      data.pr_pgrp = input->pr_pgrp;
++      data.pr_sid = input->pr_sid;
++      BFD_ASSERT (sizeof (data.pr_fname) == sizeof (input->pr_fname));
++      memcpy (data.pr_fname, input->pr_fname, sizeof (data.pr_fname));
++      BFD_ASSERT (sizeof (data.pr_psargs) == sizeof (input->pr_psargs));
++      memcpy (data.pr_psargs, input->pr_psargs, sizeof (data.pr_psargs));
+       return elfcore_write_note (abfd, buf, bufsiz,
+                                note_name, note_type, &data, sizeof (data));
+     }
+   else
+ #endif
+     {
+-#if defined (HAVE_PSINFO_T)
+-      psinfo_t data;
+-      int note_type = NT_PSINFO;
+-#else
+-      prpsinfo_t data;
+       int note_type = NT_PRPSINFO;
+-#endif
+-      memset (&data, 0, sizeof (data));
+-      strncpy (data.pr_fname, fname, sizeof (data.pr_fname));
+-      strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs));
+       return elfcore_write_note (abfd, buf, bufsiz,
+-                               note_name, note_type, &data, sizeof (data));
++                               note_name, note_type, input, sizeof (*input));
+     }
+ }
+-#endif        /* PSINFO_T or PRPSINFO_T */
++#endif        /* PRPSINFO_T */
+ #if defined (HAVE_PRSTATUS_T)
+ char *
+Index: gdb-7.2.50.20110320/gdb/linux-nat.c
+===================================================================
+--- gdb-7.2.50.20110320.orig/gdb/linux-nat.c   2011-03-20 15:17:46.000000000 +0100
++++ gdb-7.2.50.20110320/gdb/linux-nat.c        2011-03-20 15:25:36.000000000 +0100
+@@ -4603,6 +4603,131 @@ linux_spu_make_corefile_notes (bfd *obfd
+   return args.note_data;
+ }
++/* Should be always true for Linux */
++#define HAVE_PRPSINFO_T 1
++
++#if defined (HAVE_PRPSINFO_T)
++
++/* Fills struct elf_prpsinfo{32,64} as much as possible, imitate Linux kernel
++   binfmt_elf.c.  Unknown values are filled with zeroes.  The structure is
++   malloced.  */
++
++static const prpsinfo_t *
++fill_prpsinfo (void)
++{
++  struct stat sb;
++  char filename[sizeof ("/proc//cmdline") + sizeof (int) * 3 + 2];
++  char buf[1024];
++  char proc_state[5];
++  char proc_cmdline[sizeof (((struct elf_prpsinfo*)0)->pr_psargs) + 1];
++  unsigned flags;
++  long proc_nice;
++  unsigned proc_ppid;
++  unsigned proc_pgid;
++  unsigned proc_sid;
++  pid_t pid;
++  int fd, n;
++  char *cp, *proc_comm, *state_s;
++  /* String comes from Linux kernel binfmt_elf.c FILL_PSINFO but it is already
++     obsolete there to <linux/sched.h> TASK_* constants.  */
++  const char state_string[] = "RSDTZW";
++  int state_num;
++  static prpsinfo_t retval;
++
++  /* Get /proc/$PID/stat.  */
++  pid = ptid_get_pid (inferior_ptid);
++  sprintf (filename, "/proc/%u/stat", (unsigned)pid);
++  fd = open (filename, O_RDONLY);
++  if (fd < 0)
++    return NULL;
++  fstat (fd, &sb); /* No error checking (can it ever happen?).  */
++  n = read (fd, buf, sizeof (buf) - 1);
++  close (fd);
++  if (n < 0)
++    return NULL;
++  buf[n] = 0;
++
++  cp = strrchr (buf, ')'); /* Split into "PID (COMM" and "<rest>".  */
++  if (!cp)
++    return NULL;
++  *cp = 0;
++
++  /* Grab COMM.  */
++  proc_comm = strchr (buf, '(');
++  if (!proc_comm)
++    return NULL;
++  proc_comm++;
++
++  /* Read /proc/$PID/cmdline.  */
++  proc_cmdline[0] = 0;
++  strcpy (strrchr (filename, '/'), "/cmdline");
++  fd = open (filename, O_RDONLY);
++  if (fd >= 0)
++    {
++      int n;
++
++      n = read (fd, proc_cmdline, sizeof (proc_cmdline) - 1);
++      if (n < 0)
++      n = 0;
++      proc_cmdline[n] = 0;
++      while (n--) /* Replace NULs with spaces.  */
++      if (proc_cmdline[n] == 0)
++        proc_cmdline[n] = ' ';
++      close (fd);
++    }
++
++  /* Parse /proc/$PID/stat.  */
++  n = sscanf (cp + 2, /* skip ") " */
++            "%4s %u "          /* state, ppid */
++            "%u %u %*s %*s "   /* pgid, sid, tty, tpgid */
++            "%u %*s %*s %*s "  /* flags, min_flt, cmin_flt, maj_flt */
++            "%*s "             /* cmaj_flt */
++            "%*s %*s "         /* utime, stime */
++            "%*s %*s %*s "     /* cutime, cstime, priority */
++            "%ld "             /* nice */
++            /*"%*s %*s "          timeout, it_real_value */
++            /*"%lu "              start_time */
++            /*"%lu "              vsize */
++            /*"%lu "              rss */
++            /*"%lu %lu %lu "      rss_rlim, start_code, end_code */
++            /*"%lu %lu %lu "      start_stack, kstk_esp, kstk_eip */
++            /*"%u %u %u %u "      signal, blocked, sigignore, sigcatch */
++            /*"%lu %lu %lu"       wchan, nswap, cnswap */
++            , proc_state, &proc_ppid,
++            &proc_pgid, &proc_sid,
++            &flags,
++            &proc_nice);
++  if (n != 6)
++    return NULL;
++
++  state_s = strchr (state_string, proc_state[0]);
++  if (state_s != NULL)
++    state_num = state_s - state_string;
++  else
++    {
++      /* 0 means Running, some more unusal state would be better.  */
++      state_num = 0;
++    }
++
++  memset (&retval, 0, sizeof (retval));
++  retval.pr_state = state_num;
++  retval.pr_sname = proc_state[0];
++  retval.pr_zomb = (proc_state[0] == 'Z');
++  retval.pr_nice = proc_nice;
++  retval.pr_flag = flags;
++  retval.pr_uid = sb.st_uid;
++  retval.pr_gid = sb.st_gid;
++  retval.pr_pid = pid;
++  retval.pr_ppid = proc_ppid;
++  retval.pr_pgrp = proc_pgid;
++  retval.pr_sid = proc_sid;
++  strncpy (retval.pr_fname, proc_comm, sizeof (retval.pr_fname));
++  strncpy (retval.pr_psargs, proc_cmdline, sizeof (retval.pr_psargs));
++
++  return &retval;
++}
++#endif
++
+ /* Fills the "to_make_corefile_note" target vector.  Builds the note
+    section for a corefile, and returns it in a malloc buffer.  */
+@@ -4621,26 +4746,11 @@ linux_nat_make_corefile_notes (bfd *obfd
+   if (get_exec_file (0))
+     {
+-      strncpy (fname, lbasename (get_exec_file (0)), sizeof (fname));
+-      strncpy (psargs, get_exec_file (0), sizeof (psargs));
+-      if (get_inferior_args ())
+-      {
+-        char *string_end;
+-        char *psargs_end = psargs + sizeof (psargs);
+-
+-        /* linux_elfcore_write_prpsinfo () handles zero unterminated
+-           strings fine.  */
+-        string_end = memchr (psargs, 0, sizeof (psargs));
+-        if (string_end != NULL)
+-          {
+-            *string_end++ = ' ';
+-            strncpy (string_end, get_inferior_args (),
+-                     psargs_end - string_end);
+-          }
+-      }
++      const prpsinfo_t *data = fill_prpsinfo ();
++
+       note_data = (char *) elfcore_write_prpsinfo (obfd,
+                                                  note_data,
+-                                                 note_size, fname, psargs);
++                                                 note_size, data);
+     }
+   /* Dump information for threads.  */
+Index: gdb-7.2.50.20110320/gdb/procfs.c
+===================================================================
+--- gdb-7.2.50.20110320.orig/gdb/procfs.c      2011-03-09 13:48:55.000000000 +0100
++++ gdb-7.2.50.20110320/gdb/procfs.c   2011-03-20 15:24:02.000000000 +0100
+@@ -5752,6 +5752,7 @@ procfs_make_note_section (bfd *obfd, int
+   note_data = (char *) elfcore_write_prpsinfo (obfd,
+                                              note_data,
+                                              note_size,
++                                             NULL,
+                                              fname,
+                                              psargs);
diff --git a/gdb/patches/gdb-6.8-bz436037-reg-no-longer-active.patch b/gdb/patches/gdb-6.8-bz436037-reg-no-longer-active.patch
new file mode 100644 (file)
index 0000000..4987714
--- /dev/null
@@ -0,0 +1,25 @@
+Index: gdb-6.8.50.20090803/gdb/valops.c
+===================================================================
+--- gdb-6.8.50.20090803.orig/gdb/valops.c      2009-08-04 06:30:45.000000000 +0200
++++ gdb-6.8.50.20090803/gdb/valops.c   2009-08-04 06:33:05.000000000 +0200
+@@ -926,10 +926,18 @@ value_assign (struct value *toval, struc
+       struct gdbarch *gdbarch;
+       int value_reg;
+-      /* Figure out which frame this is in currently.  */
+-      frame = frame_find_by_id (VALUE_FRAME_ID (toval));
+       value_reg = VALUE_REGNUM (toval);
++      /* Figure out which frame this is in currently.  */
++      frame = frame_find_by_id (VALUE_FRAME_ID (toval));
++      /* "set $reg+=1" should work on programs with no debug info,
++         but frame_find_by_id returns NULL here (RH bug 436037).
++         Use current frame, it represents CPU state in this case.
++         If frame_find_by_id is changed to do it internally
++         (it is contemplated there), remove this.  */
++      if (!frame)
++        frame = get_current_frame ();
++      /* Probably never happens.  */
+       if (!frame)
+         error (_("Value being assigned to is no longer active."));
diff --git a/gdb/patches/gdb-6.8-bz442765-threaded-exec-test.patch b/gdb/patches/gdb-6.8-bz442765-threaded-exec-test.patch
new file mode 100644 (file)
index 0000000..1006588
--- /dev/null
@@ -0,0 +1,173 @@
+Test various forms of threads tracking across exec(2).
+
+diff -up -u -X /root/jkratoch/.diffi.list -rup gdb-6.8/gdb/testsuite/gdb.threads/threaded-exec.c gdb-6.8-patched/gdb/testsuite/gdb.threads/threaded-exec.c
+--- gdb-6.8/gdb/testsuite/gdb.threads/threaded-exec.c  2008-04-16 17:05:19.000000000 -0400
++++ gdb-6.8-patched/gdb/testsuite/gdb.threads/threaded-exec.c  2008-04-16 14:43:50.000000000 -0400
+@@ -18,21 +18,95 @@
+    Boston, MA 02111-1307, USA.  */
+ #include <stddef.h>
+-#include <pthread.h>
+ #include <assert.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <stdio.h>
++#ifdef THREADS
++
++# include <pthread.h>
+ static void *
+ threader (void *arg)
+ {
+-      return NULL;
++  return NULL;
+ }
++#endif
++
+ int
+-main (void)
++main (int argc, char **argv)
+ {
++  char *exec_nothreads, *exec_threads, *cmd;
++  int phase;
++  char phase_s[8];
++
++  setbuf (stdout, NULL);
++
++  if (argc != 4)
++    {
++      fprintf (stderr, "%s <non-threaded> <threaded> <phase>\n", argv[0]);
++      return 1;
++    }
++
++#ifdef THREADS
++  puts ("THREADS: Y");
++#else
++  puts ("THREADS: N");
++#endif
++  exec_nothreads = argv[1];
++  printf ("exec_nothreads: %s\n", exec_nothreads);
++  exec_threads = argv[2];
++  printf ("exec_threads: %s\n", exec_threads);
++  phase = atoi (argv[3]);
++  printf ("phase: %d\n", phase);
++
++  /* Phases: threading
++     0: N -> N
++     1: N -> Y
++     2: Y -> Y
++     3: Y -> N
++     4: N -> exit  */
++
++  cmd = NULL;
++
++#ifndef THREADS
++  switch (phase)
++    {
++    case 0:
++      cmd = exec_nothreads;
++      break;
++    case 1:
++      cmd = exec_threads;
++      break;
++    case 2:
++      fprintf (stderr, "%s: We should have threads for phase %d!\n", argv[0],
++             phase);
++      return 1;
++    case 3:
++      fprintf (stderr, "%s: We should have threads for phase %d!\n", argv[0],
++             phase);
++      return 1;
++    case 4:
++      return 0;
++    default:
++      assert (0);
++    }
++#else /* THREADS */
++  switch (phase)
++    {
++    case 0:
++      fprintf (stderr, "%s: We should not have threads for phase %d!\n",
++             argv[0], phase);
++      return 1;
++    case 1:
++      fprintf (stderr, "%s: We should not have threads for phase %d!\n",
++             argv[0], phase);
++      return 1;
++    case 2:
++      cmd = exec_threads;
++      {
+       pthread_t t1;
+       int i;
+@@ -40,7 +114,34 @@ main (void)
+       assert (i == 0);
+       i = pthread_join (t1, NULL);
+       assert (i == 0);
++      }
++      break;
++    case 3:
++      cmd = exec_nothreads;
++      {
++      pthread_t t1;
++      int i;
++
++      i = pthread_create (&t1, NULL, threader, (void *) NULL);
++      assert (i == 0);
++      i = pthread_join (t1, NULL);
++      assert (i == 0);
++      }
++      break;
++    case 4:
++      fprintf (stderr, "%s: We should not have threads for phase %d!\n",
++             argv[0], phase);
++      return 1;
++    default:
++      assert (0);
++    }
++#endif        /* THREADS */
++
++  assert (cmd != NULL);
++
++  phase++;
++  snprintf (phase_s, sizeof phase_s, "%d", phase);
+-      execl ("/bin/true", "/bin/true", NULL);
+-      abort ();
++  execl (cmd, cmd, exec_nothreads, exec_threads, phase_s, NULL);
++  assert (0);
+ }
+diff -up -u -X /root/jkratoch/.diffi.list -rup gdb-6.8/gdb/testsuite/gdb.threads/threaded-exec.exp gdb-6.8-patched/gdb/testsuite/gdb.threads/threaded-exec.exp
+--- gdb-6.8/gdb/testsuite/gdb.threads/threaded-exec.exp        2008-04-16 17:05:19.000000000 -0400
++++ gdb-6.8-patched/gdb/testsuite/gdb.threads/threaded-exec.exp        2008-04-16 14:42:49.000000000 -0400
+@@ -20,9 +20,14 @@
+ set testfile threaded-exec
+ set srcfile ${testfile}.c
+-set binfile ${objdir}/${subdir}/${testfile}
++set binfile_nothreads ${objdir}/${subdir}/${testfile}N
++set binfile_threads ${objdir}/${subdir}/${testfile}Y
+-if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable []] != "" } {
++if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile_nothreads}" executable {additional_flags=-UTHREADS}] != "" } {
++    return -1
++}
++
++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile_threads}" executable {additional_flags=-DTHREADS}] != "" } {
+     return -1
+ }
+@@ -30,9 +35,9 @@ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+-gdb_load ${binfile}
++gdb_load ${binfile_nothreads}
+-gdb_run_cmd
++gdb_run_cmd ${binfile_nothreads} ${binfile_threads} 0
+ gdb_test_multiple {} "Program exited" {
+    -re "\r\n\\\[Inferior .* exited normally\\\]\r\n$gdb_prompt $" {
diff --git a/gdb/patches/gdb-6.8-bz457187-largefile-test.patch b/gdb/patches/gdb-6.8-bz457187-largefile-test.patch
new file mode 100644 (file)
index 0000000..d2d6cf8
--- /dev/null
@@ -0,0 +1,105 @@
+--- /dev/null  2009-04-19 14:49:00.974648389 +0200
++++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.exp        2009-04-19 16:30:12.000000000 +0200
+@@ -0,0 +1,61 @@
++# This testcase is part of GDB, the GNU debugger.
++
++# Copyright 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# Test ability to load an elf64-i386 core file.  The provided core file was
++# elf64-x8664 one but it got binary patched to i386:
++# Elf32_Ehdr.e_machine @0x12..0x13
++# Elf64_Ehdr.e_machine @0x12..0x13
++# #define EM_386           3              /* Intel 80386 */
++# #define EM_X86_64       62              /* AMD x86-64 architecture */
++# patch @0x12: 0x3E -> 0x03
++
++if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then {
++    verbose "Skipping i386-biarch-core test."
++    return
++}
++
++set testfile "i386-biarch-core"
++set corebz2uufile ${srcdir}/${subdir}/${testfile}.core.bz2.uu
++set corefile ${objdir}/${subdir}/${testfile}.core
++# Entry point of the original executable.
++set address 0x400078
++
++if {[catch "system \"uudecode -o - ${corebz2uufile} | bzip2 -dc >${corefile}\""] != 0} {
++    untested "failed uudecode or bzip2"
++    return -1
++}
++file stat ${corefile} corestat
++if {$corestat(size) != 102400} {
++    untested "uudecode or bzip2 produce invalid result"
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++
++# Wrongly built GDB complains by:
++# "..." is not a core dump: File format not recognized
++# As the provided test core has 64bit PRSTATUS i386 built GDB cannot parse it.
++# This is just a problem of the test care, real-world elf64-i386 file will have
++# 32bit PRSTATUS.  One cannot prepare elf64-i386 core file from elf32-i386 by
++# objcopy as it corrupts the core file beyond all recognition.
++# "\r\nCore was generated by `\[^\r\n\]*'\\.\r\nProgram terminated with signal 11, Segmentation fault\\.\r\n.*"
++gdb_test "core-file ${corefile}"
++
++gdb_test "x/i $address" "\r\n\[ \t\]*$address:\[ \t\]*hlt\[ \t\]*" ".text is readable"
+--- /dev/null  2009-04-19 14:49:00.974648389 +0200
++++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.S  2009-04-19 14:52:28.000000000 +0200
+@@ -0,0 +1,22 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2009 Free Software Foundation, Inc.
++  
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++  
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++  
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ */
++
++      .globl _start
++_start:
++      hlt
+--- /dev/null  2009-04-19 14:49:00.974648389 +0200
++++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.core.bz2.uu        2009-04-19 15:02:12.000000000 +0200
+@@ -0,0 +1,13 @@
++begin 600 i386-biarch-core.core.bz2
++M0EIH.3%!629361`P1\P`!)?_____\9'@"8Q)6P380'9@'&#`0D@``"``%(``
++M@`#`"!<(L`%F"(:$GH13::F-)M&D&U,AD:`--#)M0&FT0XR9--,)D9`P(Q-&
++M",(-&F``02)%38HT]0T`&AH```'H@``T^>9T*(,("&)SE`>`9@+GP=[,N)KB
++M'I8BL(L]N5TCY\%V]/?DB.BN*UZ'U@]TN7-]UJ5\_%0QTT<*086#%MHT7XVJ
++M9D"+C!"2*L:8D1XPD!`--M@*XT1H5RFYN&)(!0P0#:`I:;2;$5M&\*9"0@%:
++MK@X[T()M)9N7`D$VA!^63)%,;@8LT`(7\K&[7G;U:"B6'!GG+46ALOZF.2F-
++M!@>C*%86X$-]C2`KE;HG)UL(913VR2G]0BD:J=Z_`G@S,`W%.8RMS-#5P:J0
++MAJ2\8&X?@DE;UF68QHM<,D`('::J65/S:PAG*R-09["8DBI)'V]Y.[(/AM*L
++M"X_O^V;%FY.S6Q]FM=D37>5F,%4-F1ZF#,CFJVU;H*^IT<(%<V`.32$`JU["
++/G`68?\7<D4X4)`0,$?,`
++`
++end
diff --git a/gdb/patches/gdb-6.8-bz466901-backtrace-full-prelinked.patch b/gdb/patches/gdb-6.8-bz466901-backtrace-full-prelinked.patch
new file mode 100644 (file)
index 0000000..2211fa3
--- /dev/null
@@ -0,0 +1,473 @@
+Fix resolving of variables at locations lists in prelinked libs (BZ 466901).
+
+Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp     2009-09-09 20:10:35.000000000 +0200
+@@ -0,0 +1,102 @@
++# Copyright 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++# Minimal DWARF-2 unit test
++
++# This test can only be run on i386/x86_64 targets which support DWARF-2.
++# For now pick a sampling of likely targets.
++if {(![istarget *-*-linux*]
++     && ![istarget *-*-gnu*]
++     && ![istarget *-*-elf*]
++     && ![istarget *-*-openbsd*])
++    || (![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"])} {
++    return 0  
++}
++
++set testfile "dw2-loclist-prelinked"
++set srcfuncfile ${testfile}-func.S
++set binsharedfuncfile ${objdir}/${subdir}/${testfile}.so
++set srcmainfile ${testfile}-main.c
++set binfile ${objdir}/${subdir}/${testfile}
++
++remote_exec build "rm -f ${binfile}"
++
++# get the value of gcc_compiled
++if [get_compiler_info ${binfile}] {
++    return -1
++}
++
++# This test can only be run on gcc as we use additional_flags=FIXME
++if {$gcc_compiled == 0} {
++    return 0
++}
++
++if  { [gdb_compile_shlib "${srcdir}/${subdir}/${srcfuncfile}" "${binsharedfuncfile}" {debug additional_flags=-m32}] != "" } {
++    untested "Couldn't compile test library"
++    return -1
++}
++
++# The new separate debug info file will be stored in the .debug subdirectory.
++
++if [gdb_gnu_strip_debug ${binsharedfuncfile}] {
++    # check that you have a recent version of strip and objcopy installed
++    unsupported "cannot produce separate debug info files"
++    return -1
++}
++
++if {[catch "system \"/usr/sbin/prelink -qNR --no-exec-shield ${binsharedfuncfile}\""] != 0} {
++    # Maybe we don't have prelink.
++    return -1
++}
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" \
++                 "${binfile}" executable [list debug additional_flags=-m32 shlib=${binsharedfuncfile}]] != "" } {
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++gdb_run_cmd
++
++gdb_test "" "Program received signal SIGABRT, Aborted..*" "Enter abort()"
++
++# Incorrect:
++# #0  0x00110430 in __kernel_vsyscall ()
++# No symbol table info available.
++# #1  0x003d44c0 in raise () from /lib/libc.so.6
++# No symbol table info available.
++# #2  0x003d5e88 in abort () from /lib/libc.so.6
++# No symbol table info available.
++# #3  0x44f10437 in func () at dw2-loclist-prelinked.c:8
++#     i = Could not find the frame base for "func".
++
++# Correct:
++# #0  0x00110430 in __kernel_vsyscall ()
++# No symbol table info available.
++# #1  0x003d44c0 in raise () from /lib/libc.so.6
++# No symbol table info available.
++# #2  0x003d5e88 in abort () from /lib/libc.so.6
++# No symbol table info available.
++# #3  0x4ae36437 in func () at dw2-loclist-prelinked.c:8
++#     i = 3827288
++# #4  0x0804851a in main () at ../../../gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c:24
++# No locals.
++
++# `abort' can get expressed as `*__GI_abort'.
++gdb_test "bt full" "in \[^ \]*abort \\(.*in func \\(.*\r\n\[\t \]+i = -?\[0-9\].*in main \\(.*" "Backtrace after abort()"
+Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c  2009-09-09 20:10:35.000000000 +0200
+@@ -0,0 +1,26 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2008 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++/* dw2-loclist-prelinked-func.S */
++extern void func (void);
++
++int
++main (void)
++{
++  func ();
++  return 0;
++}
+Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-6.8.50.20090909/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S  2009-09-09 20:10:35.000000000 +0200
+@@ -0,0 +1,328 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2008 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++/*
++#include <stdlib.h>
++
++void
++func (void)
++{
++  int i;
++
++  abort ();
++}
++*/
++      .file   "dw2-loclist-prelinked.c"
++      .section        .debug_abbrev,"",@progbits
++.Ldebug_abbrev0:
++      .section        .debug_info,"",@progbits
++.Ldebug_info0:
++      .section        .debug_line,"",@progbits
++.Ldebug_line0:
++      .text
++.Ltext0:
++.globl func
++      .type   func, @function
++func:
++.LFB2:
++      .file 1 "dw2-loclist-prelinked.c"
++      .loc 1 5 0
++      pushl   %ebp
++.LCFI0:
++      movl    %esp, %ebp
++.LCFI1:
++      subl    $24, %esp
++.LCFI2:
++      .loc 1 8 0
++      call    abort
++.LFE2:
++      .size   func, .-func
++      .section        .debug_frame,"",@progbits
++.Lframe0:
++      .long   .LECIE0-.LSCIE0
++.LSCIE0:
++      .long   0xffffffff
++      .byte   0x1
++      .string ""
++      .uleb128 0x1
++      .sleb128 -4
++      .byte   0x8
++      .byte   0xc
++      .uleb128 0x4
++      .uleb128 0x4
++      .byte   0x88
++      .uleb128 0x1
++      .align 4
++.LECIE0:
++.LSFDE0:
++      .long   .LEFDE0-.LASFDE0
++.LASFDE0:
++      .long   .Lframe0
++      .long   .LFB2
++      .long   .LFE2-.LFB2
++      .byte   0x4
++      .long   .LCFI0-.LFB2
++      .byte   0xe
++      .uleb128 0x8
++      .byte   0x85
++      .uleb128 0x2
++      .byte   0x4
++      .long   .LCFI1-.LCFI0
++      .byte   0xd
++      .uleb128 0x5
++      .align 4
++.LEFDE0:
++      .text
++.Letext0:
++      .section        .debug_loc,"",@progbits
++.Ldebug_loc0:
++.LLST0:
++      .long   .LFB2-.Ltext0
++      .long   .LCFI0-.Ltext0
++      .value  0x2
++      .byte   0x74
++      .sleb128 4
++      .long   .LCFI0-.Ltext0
++      .long   .LCFI1-.Ltext0
++      .value  0x2
++      .byte   0x74
++      .sleb128 8
++      .long   .LCFI1-.Ltext0
++      .long   .LFE2-.Ltext0
++      .value  0x2
++      .byte   0x75
++      .sleb128 8
++      .long   0x0
++      .long   0x0
++      .section        .debug_info
++      .long   0x94
++      .value  0x2
++      .long   .Ldebug_abbrev0
++      .byte   0x4
++      .uleb128 0x1
++      .long   .LASF10
++      .byte   0x1
++      .long   .LASF11
++      .long   .LASF12
++      .long   .Ltext0
++      .long   .Letext0
++      .long   .Ldebug_line0
++      .uleb128 0x2
++      .byte   0x4
++      .byte   0x7
++      .long   .LASF0
++      .uleb128 0x3
++      .byte   0x4
++      .byte   0x5
++      .string "int"
++      .uleb128 0x2
++      .byte   0x4
++      .byte   0x5
++      .long   .LASF1
++      .uleb128 0x2
++      .byte   0x1
++      .byte   0x8
++      .long   .LASF2
++      .uleb128 0x2
++      .byte   0x2
++      .byte   0x7
++      .long   .LASF3
++      .uleb128 0x2
++      .byte   0x4
++      .byte   0x7
++      .long   .LASF4
++      .uleb128 0x2
++      .byte   0x1
++      .byte   0x6
++      .long   .LASF5
++      .uleb128 0x2
++      .byte   0x2
++      .byte   0x5
++      .long   .LASF6
++      .uleb128 0x2
++      .byte   0x8
++      .byte   0x5
++      .long   .LASF7
++      .uleb128 0x2
++      .byte   0x8
++      .byte   0x7
++      .long   .LASF8
++      .uleb128 0x4
++      .byte   0x4
++      .byte   0x7
++      .uleb128 0x2
++      .byte   0x1
++      .byte   0x6
++      .long   .LASF9
++      .uleb128 0x5
++      .byte   0x1
++      .long   .LASF13
++      .byte   0x1
++      .byte   0x5
++      .byte   0x1
++      .long   .LFB2
++      .long   .LFE2
++      .long   .LLST0
++      .uleb128 0x6
++      .string "i"
++      .byte   0x1
++      .byte   0x6
++      .long   0x2c
++      .byte   0x2
++      .byte   0x91
++      .sleb128 -12
++      .byte   0x0
++      .byte   0x0
++      .section        .debug_abbrev
++      .uleb128 0x1
++      .uleb128 0x11
++      .byte   0x1
++      .uleb128 0x25
++      .uleb128 0xe
++      .uleb128 0x13
++      .uleb128 0xb
++      .uleb128 0x3
++      .uleb128 0xe
++      .uleb128 0x1b
++      .uleb128 0xe
++      .uleb128 0x11
++      .uleb128 0x1
++      .uleb128 0x12
++      .uleb128 0x1
++      .uleb128 0x10
++      .uleb128 0x6
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x2
++      .uleb128 0x24
++      .byte   0x0
++      .uleb128 0xb
++      .uleb128 0xb
++      .uleb128 0x3e
++      .uleb128 0xb
++      .uleb128 0x3
++      .uleb128 0xe
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x3
++      .uleb128 0x24
++      .byte   0x0
++      .uleb128 0xb
++      .uleb128 0xb
++      .uleb128 0x3e
++      .uleb128 0xb
++      .uleb128 0x3
++      .uleb128 0x8
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x4
++      .uleb128 0x24
++      .byte   0x0
++      .uleb128 0xb
++      .uleb128 0xb
++      .uleb128 0x3e
++      .uleb128 0xb
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x5
++      .uleb128 0x2e
++      .byte   0x1
++      .uleb128 0x3f
++      .uleb128 0xc
++      .uleb128 0x3
++      .uleb128 0xe
++      .uleb128 0x3a
++      .uleb128 0xb
++      .uleb128 0x3b
++      .uleb128 0xb
++      .uleb128 0x27
++      .uleb128 0xc
++      .uleb128 0x11
++      .uleb128 0x1
++      .uleb128 0x12
++      .uleb128 0x1
++      .uleb128 0x40
++      .uleb128 0x6
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x6
++      .uleb128 0x34
++      .byte   0x0
++      .uleb128 0x3
++      .uleb128 0x8
++      .uleb128 0x3a
++      .uleb128 0xb
++      .uleb128 0x3b
++      .uleb128 0xb
++      .uleb128 0x49
++      .uleb128 0x13
++      .uleb128 0x2
++      .uleb128 0xa
++      .byte   0x0
++      .byte   0x0
++      .byte   0x0
++      .section        .debug_pubnames,"",@progbits
++      .long   0x17
++      .value  0x2
++      .long   .Ldebug_info0
++      .long   0x98
++      .long   0x75
++      .string "func"
++      .long   0x0
++      .section        .debug_aranges,"",@progbits
++      .long   0x1c
++      .value  0x2
++      .long   .Ldebug_info0
++      .byte   0x4
++      .byte   0x0
++      .value  0x0
++      .value  0x0
++      .long   .Ltext0
++      .long   .Letext0-.Ltext0
++      .long   0x0
++      .long   0x0
++      .section        .debug_str,"MS",@progbits,1
++.LASF7:
++      .string "long long int"
++.LASF0:
++      .string "unsigned int"
++.LASF11:
++      .string "dw2-loclist-prelinked.c"
++.LASF12:
++      .string "gdb-6.8/gdb/testsuite/gdb.dwarf2"
++.LASF4:
++      .string "long unsigned int"
++.LASF8:
++      .string "long long unsigned int"
++.LASF2:
++      .string "unsigned char"
++.LASF9:
++      .string "char"
++.LASF1:
++      .string "long int"
++.LASF3:
++      .string "short unsigned int"
++.LASF5:
++      .string "signed char"
++.LASF10:
++      .string "GNU C 4.3.2 20081007 (Red Hat 4.3.2-6)"
++.LASF13:
++      .string "func"
++.LASF6:
++      .string "short int"
++      .ident  "GCC: (GNU) 4.3.2 20081007 (Red Hat 4.3.2-6)"
++      .section        .note.GNU-stack,"",@progbits
diff --git a/gdb/patches/gdb-6.8-quit-never-aborts.patch b/gdb/patches/gdb-6.8-quit-never-aborts.patch
new file mode 100644 (file)
index 0000000..d71557f
--- /dev/null
@@ -0,0 +1,72 @@
+We may abort the process of detaching threads with multiple SIGINTs - which are
+being sent during a testcase terminating its child GDB.
+
+Some of the threads may not be properly PTRACE_DETACHed which hurts if they
+should have been detached with SIGSTOP (as they are accidentally left running
+on the debugger termination).
+
+Index: gdb-7.2.50.20110117/gdb/defs.h
+===================================================================
+--- gdb-7.2.50.20110117.orig/gdb/defs.h        2011-01-17 15:47:37.000000000 +0100
++++ gdb-7.2.50.20110117/gdb/defs.h     2011-01-17 15:53:05.000000000 +0100
+@@ -165,6 +165,7 @@ extern char *python_libdir;
+ extern char *debug_file_directory;
+ extern int quit_flag;
++extern int quit_flag_cleanup;
+ extern int immediate_quit;
+ extern int sevenbit_strings;
+@@ -178,7 +179,7 @@ extern void quit (void);
+    needed.  */
+ #define QUIT { \
+-  if (quit_flag) quit (); \
++  if (quit_flag && !quit_flag_cleanup) quit (); \
+   if (deprecated_interactive_hook) deprecated_interactive_hook (); \
+ }
+Index: gdb-7.2.50.20110117/gdb/event-top.c
+===================================================================
+--- gdb-7.2.50.20110117.orig/gdb/event-top.c   2011-01-17 15:52:39.000000000 +0100
++++ gdb-7.2.50.20110117/gdb/event-top.c        2011-01-17 15:52:49.000000000 +0100
+@@ -904,7 +904,7 @@ async_request_quit (gdb_client_data arg)
+      is no reason to call quit again here, unless immediate_quit is
+      set.  */
+-  if (quit_flag || immediate_quit)
++  if ((quit_flag || immediate_quit) && !quit_flag_cleanup)
+     quit ();
+ }
+Index: gdb-7.2.50.20110117/gdb/top.c
+===================================================================
+--- gdb-7.2.50.20110117.orig/gdb/top.c 2011-01-17 15:47:37.000000000 +0100
++++ gdb-7.2.50.20110117/gdb/top.c      2011-01-17 15:52:49.000000000 +0100
+@@ -1257,7 +1257,9 @@ quit_force (char *args, int from_tty)
+   qt.args = args;
+   qt.from_tty = from_tty;
+-  /* We want to handle any quit errors and exit regardless.  */
++  /* We want to handle any quit errors and exit regardless but we should never
++     get user-interrupted to properly detach the inferior.  */
++  quit_flag_cleanup = 1;
+   catch_errors (quit_target, &qt,
+               "Quitting: ", RETURN_MASK_ALL);
+Index: gdb-7.2.50.20110117/gdb/utils.c
+===================================================================
+--- gdb-7.2.50.20110117.orig/gdb/utils.c       2011-01-17 15:47:37.000000000 +0100
++++ gdb-7.2.50.20110117/gdb/utils.c    2011-01-17 15:52:49.000000000 +0100
+@@ -121,6 +121,11 @@ int job_control;
+ int quit_flag;
++/* Nonzero means we are already processing the quitting cleanups and we should
++   no longer get aborted.  */
++
++int quit_flag_cleanup;
++
+ /* Nonzero means quit immediately if Control-C is typed now, rather
+    than waiting until QUIT is executed.  Be careful in setting this;
+    code which executes with immediate_quit set has to be very careful
diff --git a/gdb/patches/gdb-6.8-sparc64-silence-memcpy-check.patch b/gdb/patches/gdb-6.8-sparc64-silence-memcpy-check.patch
new file mode 100644 (file)
index 0000000..a9d30ce
--- /dev/null
@@ -0,0 +1,11 @@
+diff -up gdb-6.8/gdb/sparc-tdep.c.BAD gdb-6.8/gdb/sparc-tdep.c
+--- gdb-6.8/gdb/sparc-tdep.c.BAD       2008-05-15 16:12:58.000000000 -0500
++++ gdb-6.8/gdb/sparc-tdep.c   2008-05-15 16:13:41.000000000 -0500
+@@ -1122,6 +1122,7 @@ sparc32_store_return_value (struct type 
+   if (sparc_floating_p (type))
+     {
+       /* Floating return values.  */
++      len = (len <= 8) ? len : 8;
+       memcpy (buf, valbuf, len);
+       regcache_cooked_write (regcache, SPARC_F0_REGNUM, buf);
+       if (len > 4)
diff --git a/gdb/patches/gdb-6.8-tui-singlebinary.patch b/gdb/patches/gdb-6.8-tui-singlebinary.patch
new file mode 100644 (file)
index 0000000..cb0be45
--- /dev/null
@@ -0,0 +1,24 @@
+Provide `gdb --tui' functionality for the hardlink `gdbtui'.
+
+--- ./gdb/gdb.c        1 Jan 2008 22:53:09 -0000       1.6
++++ ./gdb/gdb.c        20 Jun 2008 08:02:57 -0000
+@@ -30,5 +30,19 @@ main (int argc, char **argv)
+   args.argv = argv;
+   args.use_windows = 0;
+   args.interpreter_p = INTERP_CONSOLE;
++
++  if (argv[0])
++    {
++      char *s;
++
++      s = strrchr (argv[0], '/');
++      if (s)
++      s++;
++      else
++      s = argv[0];
++      if (strcmp (s, "gdbtui") == 0)
++      args.interpreter_p = INTERP_TUI;
++    }
++
+   return gdb_main (&args);
+ }
diff --git a/gdb/patches/gdb-6.8-watchpoint-conditionals-test.patch b/gdb/patches/gdb-6.8-watchpoint-conditionals-test.patch
new file mode 100644 (file)
index 0000000..b014074
--- /dev/null
@@ -0,0 +1,78 @@
+For:
+http://sourceware.org/ml/gdb-patches/2008-04/msg00379.html
+http://sourceware.org/ml/gdb-cvs/2008-04/msg00104.html
+
+--- /dev/null  2008-11-04 06:31:10.599601840 +0100
++++ gdb-6.8/gdb/testsuite/gdb.base/watchpoint-cond.exp 2008-11-04 06:43:29.000000000 +0100
+@@ -0,0 +1,37 @@
++# Copyright 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++set testfile watchpoint-cond
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++
++# Get things started.
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++if { [runto_main] < 0 } {
++    untested watchpoint-cond
++    return -1
++}
++
++gdb_test "watch i if i < 20" "atchpoint \[0-9\]+: i"
++gdb_test "cont" "atchpoint \[0-9\]+: i.*Old value = 20.*New value = 19.*"
+--- /dev/null  2008-11-04 06:31:10.599601840 +0100
++++ gdb-6.8/gdb/testsuite/gdb.base/watchpoint-cond.c   2008-11-04 06:42:48.000000000 +0100
+@@ -0,0 +1,31 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2008 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++   Please email any bugs, comments, and/or additions to this file to:
++   bug-gdb@prep.ai.mit.edu  */
++
++int
++main (int argc, char **argv)
++{
++  static int i = 0; /* `static' to start initialized.  */
++  int j = 2;
++
++  for (j = 0; j < 30; j++)
++    i = 30 - j;
++
++  return 0;
++}
diff --git a/gdb/patches/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch b/gdb/patches/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch
new file mode 100644 (file)
index 0000000..b011658
--- /dev/null
@@ -0,0 +1,51 @@
+Index: gdb-7.3.50.20110722/gdb/dwarf2read.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/dwarf2read.c  2011-07-22 19:37:15.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/dwarf2read.c       2011-07-22 19:44:42.000000000 +0200
+@@ -67,12 +67,14 @@
+ #ifdef HAVE_ZLIB_H
+ #include <zlib.h>
+ #endif
++#ifndef __sparc__
+ #ifdef HAVE_MMAP
+ #include <sys/mman.h>
+ #ifndef MAP_FAILED
+ #define MAP_FAILED ((void *) -1)
+ #endif
+ #endif
++#endif
+ typedef struct symbol *symbolp;
+ DEF_VEC_P (symbolp);
+@@ -1618,6 +1620,7 @@ dwarf2_read_section (struct objfile *obj
+         }
+     }
++#ifndef __sparc__
+ #ifdef HAVE_MMAP
+   if (pagesize == 0)
+     pagesize = getpagesize ();
+@@ -1641,6 +1644,7 @@ dwarf2_read_section (struct objfile *obj
+       }
+     }
+ #endif
++#endif
+   /* If we get here, we are a normal, not-compressed section.  */
+   info->buffer = buf
+@@ -15983,6 +15987,7 @@ munmap_section_buffer (struct dwarf2_sec
+ {
+   if (info->map_addr != NULL)
+     {
++#ifndef __sparc__
+ #ifdef HAVE_MMAP
+       int res;
+@@ -15992,6 +15997,7 @@ munmap_section_buffer (struct dwarf2_sec
+       /* Without HAVE_MMAP, we should never be here to begin with.  */
+       gdb_assert_not_reached ("no mmap support");
+ #endif
++#endif
+     }
+ }
diff --git a/gdb/patches/gdb-archer-next-over-throw-cxx-exec.patch b/gdb/patches/gdb-archer-next-over-throw-cxx-exec.patch
new file mode 100644 (file)
index 0000000..cbd9a36
--- /dev/null
@@ -0,0 +1,85 @@
+Archer-upstreamed:
+http://sourceware.org/ml/archer/2010-q2/msg00031.html
+
+--- ./gdb/testsuite/gdb.cp/cxxexec.cc  1970-01-01 01:00:00.000000000 +0100
++++ ./gdb/testsuite/gdb.cp/cxxexec.cc  2010-05-29 01:18:56.000000000 +0200
+@@ -0,0 +1,25 @@
++/* This test script is part of GDB, the GNU debugger.
++
++   Copyright 2010 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#include <unistd.h>
++
++int
++main()
++{
++  execlp ("true", "true", NULL);
++  return 1;
++}
+--- ./gdb/testsuite/gdb.cp/cxxexec.exp 1970-01-01 01:00:00.000000000 +0100
++++ ./gdb/testsuite/gdb.cp/cxxexec.exp 2010-05-29 01:29:25.000000000 +0200
+@@ -0,0 +1,51 @@
++# Copyright 2010 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++if { [skip_cplus_tests] } { continue }
++
++set testfile cxxexec
++if { [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.cc {c++ debug}] } {
++    return -1
++}
++
++runto_main
++
++# We could stop after `continue' again at `main'.
++delete_breakpoints
++
++set test "p _Unwind_DebugHook"
++gdb_test_multiple $test $test {
++    -re " = .* 0x\[0-9a-f\].*\r\n$gdb_prompt $" {
++      pass $test
++    }
++    -re "\r\nNo symbol .*\r\n$gdb_prompt $" {
++      xfail $test
++      untested ${testfile}.exp
++      return -1
++    }
++}
++
++set test continue
++gdb_test_multiple $test $test {
++    -re "Cannot access memory at address 0x\[0-9a-f\]+\r\n$gdb_prompt $" {
++      fail $test
++    }
++    -re "\r\n$gdb_prompt $" {
++      pass $test
++    }
++}
++
++# `info inferiors' can show <null> on older GDBs.
++gdb_test "info threads" "info threads" "program finished"
diff --git a/gdb/patches/gdb-archer-pie-addons-keep-disabled.patch b/gdb/patches/gdb-archer-pie-addons-keep-disabled.patch
new file mode 100644 (file)
index 0000000..d2b6c71
--- /dev/null
@@ -0,0 +1,83 @@
+Index: gdb-7.3.50.20110722/gdb/breakpoint.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/breakpoint.c  2011-07-22 19:08:19.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/breakpoint.c       2011-07-22 19:32:04.000000000 +0200
+@@ -13195,6 +13195,50 @@ iterate_over_breakpoints (int (*callback
+   return NULL;
+ }
++ 
++void
++breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta)
++{
++  struct bp_location *bl, **blp_tmp;
++  int changed = 0;
++
++  gdb_assert (objfile->separate_debug_objfile_backlink == NULL);
++
++  ALL_BP_LOCATIONS (bl, blp_tmp)
++    {
++      struct obj_section *osect;
++
++      /* BL->SECTION can be correctly NULL for breakpoints with multiple
++         locations expanded through symtab.  */
++
++      ALL_OBJFILE_OSECTIONS (objfile, osect)
++      {
++        CORE_ADDR relocated_address;
++        CORE_ADDR delta_offset;
++
++        delta_offset = ANOFFSET (delta, osect->the_bfd_section->index);
++        if (delta_offset == 0)
++          continue;
++        relocated_address = bl->address + delta_offset;
++
++        if (obj_section_addr (osect) <= relocated_address
++            && relocated_address < obj_section_endaddr (osect))
++          {
++            if (bl->inserted)
++              remove_breakpoint (bl, mark_uninserted);
++
++            bl->address += delta_offset;
++            bl->requested_address += delta_offset;
++
++            changed = 1;
++          }
++      }
++    }
++
++  if (changed)
++    qsort (bp_location, bp_location_count, sizeof (*bp_location),
++         bp_location_compare);
++}
+ void
+ _initialize_breakpoint (void)
+Index: gdb-7.3.50.20110722/gdb/breakpoint.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/breakpoint.h  2011-07-22 19:08:19.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/breakpoint.h       2011-07-22 19:31:22.000000000 +0200
+@@ -1328,4 +1328,7 @@ extern int user_breakpoint_p (struct bre
+ extern void modify_semaphore (struct bp_location *location, int set);
++extern void breakpoints_relocate (struct objfile *objfile,
++                                struct section_offsets *delta);
++
+ #endif /* !defined (BREAKPOINT_H) */
+Index: gdb-7.3.50.20110722/gdb/objfiles.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/objfiles.c    2011-07-22 19:08:19.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/objfiles.c 2011-07-22 19:31:22.000000000 +0200
+@@ -847,6 +847,11 @@ objfile_relocate1 (struct objfile *objfi
+     objfile->sf->sym_probe_fns->sym_relocate_probe (objfile,
+                                                   new_offsets, delta);
++  /* Final call of breakpoint_re_set can keep breakpoint locations disabled if
++     their addresses match.  */
++  if (objfile->separate_debug_objfile_backlink == NULL)
++    breakpoints_relocate (objfile, delta);
++
+   /* Data changed.  */
+   return 1;
+ }
diff --git a/gdb/patches/gdb-archer.patch b/gdb/patches/gdb-archer.patch
new file mode 100644 (file)
index 0000000..5d346d5
--- /dev/null
@@ -0,0 +1,15142 @@
+http://sourceware.org/gdb/wiki/ProjectArcher
+http://sourceware.org/gdb/wiki/ArcherBranchManagement
+
+GIT snapshot:
+commit 069aac3325764793a2d57f8b2f0933a326c6b7a3
+
+branch `archer' - the merge of branches:
+archer-jankratochvil-vla
+archer-jankratochvil-watchpoint3
+archer-tromey-python
+archer-sergiodj-stap-patch-split
+
+
+Index: gdb-7.3.50.20110722/gdb/Makefile.in
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/Makefile.in   2011-07-22 01:46:08.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/Makefile.in        2011-07-29 22:52:02.000000000 +0200
+@@ -720,8 +720,8 @@ SFILES = ada-exp.y ada-lang.c ada-typepr
+       sentinel-frame.c \
+       serial.c ser-base.c ser-unix.c \
+       solib.c solib-target.c source.c \
+-      stabsread.c stack.c std-regs.c symfile.c symfile-mem.c symmisc.c \
+-      symtab.c \
++      stabsread.c stack.c stap-probe.c std-regs.c \
++      symfile.c symfile-mem.c symmisc.c symtab.c \
+       target.c target-descriptions.c target-memory.c \
+       thread.c top.c tracepoint.c \
+       trad-frame.c \
+@@ -818,7 +818,7 @@ osdata.h procfs.h python/py-event.h pyth
+ python/python-internal.h python/python.h ravenscar-thread.h record.h \
+ solib-darwin.h solib-ia64-hpux.h solib-spu.h windows-nat.h xcoffread.h \
+ gnulib/extra/arg-nonnull.h gnulib/extra/c++defs.h gnulib/extra/warn-on-use.h \
+-gnulib/stddef.in.h inline-frame.h \
++gnulib/stddef.in.h inline-frame.h stap-probe.h \
+ common/common-utils.h common/xml-utils.h common/buffer.h common/ptid.h \
+ common/linux-osdata.h
+@@ -906,7 +906,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $
+       xml-support.o xml-syscall.o xml-utils.o \
+       target-descriptions.o target-memory.o xml-tdesc.o xml-builtin.o \
+       inferior.o osdata.o gdb_usleep.o record.o gcore.o \
+-      jit.o progspace.o \
++      jit.o progspace.o stap-probe.o \
+       common-utils.o buffer.o ptid.o
+ TSOBS = inflow.o
+@@ -1328,6 +1328,12 @@ stamp-h: $(srcdir)/config.in config.stat
+         CONFIG_LINKS= \
+         $(SHELL) config.status
++.gdbinit: $(srcdir)/gdbinit.in config.status
++      CONFIG_FILES=".gdbinit:gdbinit.in" \
++        CONFIG_COMMANDS= \
++        CONFIG_HEADERS= \
++        $(SHELL) config.status
++
+ config.status: $(srcdir)/configure configure.tgt configure.host
+       $(SHELL) config.status --recheck
+Index: gdb-7.3.50.20110722/gdb/NEWS
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/NEWS  2011-07-21 19:23:55.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/NEWS       2011-07-29 22:52:02.000000000 +0200
+@@ -109,6 +109,10 @@ QTDisable
+   Initial support for the OpenCL C language (http://www.khronos.org/opencl)
+   has been integrated into GDB.
++* GDB now has support for SystemTap <sys/sdt.h> probes.  You can set a
++  breakpoint using the new "probe:" linespec and inspect the probe
++  arguments using the new $_probe_arg family of convenience variables.
++
+ * Python scripting
+   ** The function gdb.Write now accepts an optional keyword 'stream'.
+Index: gdb-7.3.50.20110722/gdb/ada-lang.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/ada-lang.c    2011-07-05 06:34:55.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/ada-lang.c 2011-07-29 22:52:02.000000000 +0200
+@@ -11862,6 +11862,7 @@ ada_operator_length (const struct expres
+ static int
+ ada_operator_check (struct expression *exp, int pos,
++                  int (*type_func) (struct type *type, void *data),
+                   int (*objfile_func) (struct objfile *objfile, void *data),
+                   void *data)
+ {
+@@ -11876,12 +11877,15 @@ ada_operator_check (struct expression *e
+       break;
+       default:
+-      return operator_check_standard (exp, pos, objfile_func, data);
++      return operator_check_standard (exp, pos, type_func, objfile_func,
++                                      data);
+     }
+   /* Invoke callbacks for TYPE and OBJFILE if they were set as non-NULL.  */
+-  if (type && TYPE_OBJFILE (type)
++  if (type && type_func && (*type_func) (type, data))
++    return 1;
++  if (type && TYPE_OBJFILE (type) && objfile_func
+       && (*objfile_func) (TYPE_OBJFILE (type), data))
+     return 1;
+Index: gdb-7.3.50.20110722/gdb/amd64-linux-nat.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/amd64-linux-nat.c     2011-01-07 20:36:15.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/amd64-linux-nat.c  2011-07-29 22:52:02.000000000 +0200
+@@ -265,18 +265,11 @@ amd64_linux_store_inferior_registers (st
\f
+ /* Support for debug registers.  */
+-static unsigned long amd64_linux_dr[DR_CONTROL + 1];
+-
+ static unsigned long
+-amd64_linux_dr_get (ptid_t ptid, int regnum)
++amd64_linux_dr_get (int tid, int regnum)
+ {
+-  int tid;
+   unsigned long value;
+-  tid = TIDGET (ptid);
+-  if (tid == 0)
+-    tid = PIDGET (ptid);
+-
+   /* FIXME: kettenis/2001-03-27: Calling perror_with_name if the
+      ptrace call fails breaks debugging remote targets.  The correct
+      way to fix this is to add the hardware breakpoint and watchpoint
+@@ -298,14 +291,8 @@ amd64_linux_dr_get (ptid_t ptid, int reg
+ /* Set debug register REGNUM to VALUE in only the one LWP of PTID.  */
+ static void
+-amd64_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
++amd64_linux_dr_set (int tid, int regnum, unsigned long value)
+ {
+-  int tid;
+-
+-  tid = TIDGET (ptid);
+-  if (tid == 0)
+-    tid = PIDGET (ptid);
+-
+   errno = 0;
+   ptrace (PTRACE_POKEUSER, tid,
+         offsetof (struct user, u_debugreg[regnum]), value);
+@@ -313,35 +300,96 @@ amd64_linux_dr_set (ptid_t ptid, int reg
+     perror_with_name (_("Couldn't write debug register"));
+ }
+-/* Set DR_CONTROL to ADDR in all LWPs of LWP_LIST.  */
++/* Helper for amd64_linux_dr_set_control.  */
++
++static void
++amd64_linux_dr_set_control_callback (int tid, void *control_voidp)
++{
++  unsigned long control = *(unsigned long *) control_voidp;
++
++  amd64_linux_dr_set (tid, DR_CONTROL, control);
++}
++
++static void amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr);
++
++/* Set DR_CONTROL to ADDR in all LWPs of CURRENT_INFERIOR.  */
+ static void
+ amd64_linux_dr_set_control (unsigned long control)
+ {
+-  struct lwp_info *lp;
+-  ptid_t ptid;
++  int inferior_pid = ptid_get_pid (inferior_ptid);
++  struct inferior *inf = current_inferior ();
++
++  /* Are we detaching breakpoints from a fork-ed child?
++     See linux_nat_iterate_watchpoint_lwps for the fork-ed child description.
++     The i386 counterpart is i386_linux_dr_set_control.  */
++  if (inf->pid != inferior_pid)
++    {
++      struct i386_dr_mirror *dr_mirror = i386_dr_mirror_get ();
++      int i;
++
++      /* There were two changes in Linux kernel 2.6.33 by the commit:
++         72f674d203cd230426437cdcf7dd6f681dad8b0d
++
++         (1) After fork/vfork/clone the new task no longer inherits the debug
++       registers.  It has them zeroed instead.  Either case is OK for GDB as
++       GDB already registers a fix up by linux_nat_set_new_thread.
++
++       (2) If you enable a breakpoint by the CONTROL bits you have already
++       written its ADDRESS.  Otherwise Linux kernel will report EINVAL.
++       For this case the workaround here ensures that during resetting
++       (detaching) watchpoints for a fork-ed child we can set CONTROL
++       arbitrarily as the addresses get pre-set here just to be sure.
++
++       The second issue is hopefully going to be fixed in Linux kernel:
++       https://bugzilla.redhat.com/show_bug.cgi?id=660204  */
++
++      if (!dr_mirror->addr_preset)
++      {
++        dr_mirror->addr_preset = 1;
++
++        for (i = 0; i < DR_LASTADDR - DR_FIRSTADDR; i++)
++          amd64_linux_dr_set_addr (i, dr_mirror->addr[i]);
++      }
++    }
++
++  linux_nat_iterate_watchpoint_lwps (amd64_linux_dr_set_control_callback,
++                                   &control);
++}
++
++/* Helper for amd64_linux_dr_set_addr.  */
++
++struct amd64_linux_dr_set_addr_data
++  {
++    int regnum;
++    CORE_ADDR addr;
++  };
++
++static void
++amd64_linux_dr_set_addr_callback (int tid, void *datap_voidp)
++{
++  const struct amd64_linux_dr_set_addr_data *datap = datap_voidp;
+-  amd64_linux_dr[DR_CONTROL] = control;
+-  ALL_LWPS (lp, ptid)
+-    amd64_linux_dr_set (ptid, DR_CONTROL, control);
++  amd64_linux_dr_set (tid, DR_FIRSTADDR + datap->regnum, datap->addr);
+ }
+-/* Set address REGNUM (zero based) to ADDR in all LWPs of LWP_LIST.  */
++/* Set address REGNUM (zero based) to ADDR in all LWPs of CURRENT_INFERIOR.
++   */
+ static void
+ amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr)
+ {
+-  struct lwp_info *lp;
+-  ptid_t ptid;
++  struct amd64_linux_dr_set_addr_data data;
+   gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
+-  amd64_linux_dr[DR_FIRSTADDR + regnum] = addr;
+-  ALL_LWPS (lp, ptid)
+-    amd64_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr);
++  data.regnum = regnum;
++  data.addr = addr;
++  linux_nat_iterate_watchpoint_lwps (amd64_linux_dr_set_addr_callback, &data);
+ }
+-/* Set address REGNUM (zero based) to zero in all LWPs of LWP_LIST.  */
++/* Set address REGNUM (zero based) to zero in all LWPs of CURRENT_INFERIOR.
++   */
+ static void
+ amd64_linux_dr_reset_addr (int regnum)
+@@ -354,37 +402,54 @@ amd64_linux_dr_reset_addr (int regnum)
+ static unsigned long
+ amd64_linux_dr_get_status (void)
+ {
+-  return amd64_linux_dr_get (inferior_ptid, DR_STATUS);
++  int tid;
++
++  tid = TIDGET (inferior_ptid);
++  if (tid == 0)
++    tid = PIDGET (inferior_ptid);
++
++  return amd64_linux_dr_get (tid, DR_STATUS);
+ }
+-/* Unset MASK bits in DR_STATUS in all LWPs of LWP_LIST.  */
++/* Helper for amd64_linux_dr_unset_status.  */
+ static void
+-amd64_linux_dr_unset_status (unsigned long mask)
++amd64_linux_dr_unset_status_callback (int tid, void *mask_voidp)
+ {
+-  struct lwp_info *lp;
+-  ptid_t ptid;
+-
+-  ALL_LWPS (lp, ptid)
+-    {
+-      unsigned long value;
++  unsigned long mask = *(unsigned long *) mask_voidp;
++  unsigned long value;
+       
+-      value = amd64_linux_dr_get (ptid, DR_STATUS);
+-      value &= ~mask;
+-      amd64_linux_dr_set (ptid, DR_STATUS, value);
+-    }
++  value = amd64_linux_dr_get (tid, DR_STATUS);
++  value &= ~mask;
++  amd64_linux_dr_set (tid, DR_STATUS, value);
+ }
++/* Unset MASK bits in DR_STATUS in all LWPs of CURRENT_INFERIOR.  */
++
++static void
++amd64_linux_dr_unset_status (unsigned long mask)
++{
++  linux_nat_iterate_watchpoint_lwps (amd64_linux_dr_unset_status_callback,
++                                   &mask);
++}
+ static void
+ amd64_linux_new_thread (ptid_t ptid)
+ {
+-  int i;
++  struct i386_dr_mirror *dr_mirror = i386_dr_mirror_get ();
++  int i, tid;
++
++  /* Verify DR_MIRROR is valid.  */
++  gdb_assert (PIDGET (ptid) == PIDGET (inferior_ptid));
++
++  tid = TIDGET (ptid);
++  if (tid == 0)
++    tid = PIDGET (ptid);
+-  for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++)
+-    amd64_linux_dr_set (ptid, i, amd64_linux_dr[i]);
++  for (i = 0; i < DR_LASTADDR - DR_FIRSTADDR; i++)
++    amd64_linux_dr_set (tid, DR_FIRSTADDR + i, dr_mirror->addr[i]);
+-  amd64_linux_dr_set (ptid, DR_CONTROL, amd64_linux_dr[DR_CONTROL]);
++  amd64_linux_dr_set (tid, DR_CONTROL, dr_mirror->control);
+ }
\f
+Index: gdb-7.3.50.20110722/gdb/ax-gdb.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/ax-gdb.c      2011-06-17 22:46:47.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/ax-gdb.c   2011-07-29 22:52:02.000000000 +0200
+@@ -2001,7 +2001,8 @@ gen_expr (struct expression *exp, union
+     case OP_INTERNALVAR:
+       {
+-      const char *name = internalvar_name ((*pc)[1].internalvar);
++      struct internalvar *var = (*pc)[1].internalvar;
++      const char *name = internalvar_name (var);
+       struct trace_state_variable *tsv;
+       (*pc) += 3;
+@@ -2015,7 +2016,7 @@ gen_expr (struct expression *exp, union
+           value->kind = axs_rvalue;
+           value->type = builtin_type (exp->gdbarch)->builtin_long_long;
+         }
+-      else
++      else if (! compile_internalvar_to_ax (var, ax, value))
+         error (_("$%s is not a trace state variable; GDB agent "
+                  "expressions cannot use convenience variables."), name);
+       }
+Index: gdb-7.3.50.20110722/gdb/block.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/block.c       2011-01-01 16:32:57.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/block.c    2011-07-29 22:52:02.000000000 +0200
+@@ -322,3 +322,21 @@ allocate_block (struct obstack *obstack)
+   return bl;
+ }
++
++/* Return OBJFILE in which BLOCK is located or NULL if we cannot find it for
++   whatever reason.  */
++
++struct objfile *
++block_objfile (const struct block *block)
++{
++  struct symbol *func;
++
++  if (block == NULL)
++    return NULL;
++
++  func = block_linkage_function (block);
++  if (func == NULL)
++    return NULL;
++
++  return SYMBOL_SYMTAB (func)->objfile;
++}
+Index: gdb-7.3.50.20110722/gdb/block.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/block.h       2011-04-04 16:10:12.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/block.h    2011-07-29 22:52:02.000000000 +0200
+@@ -163,4 +163,6 @@ extern const struct block *block_global_
+ extern struct block *allocate_block (struct obstack *obstack);
++extern struct objfile *block_objfile (const struct block *block);
++
+ #endif /* BLOCK_H */
+Index: gdb-7.3.50.20110722/gdb/breakpoint.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/breakpoint.c  2011-07-05 06:34:55.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/breakpoint.c       2011-07-29 22:52:02.000000000 +0200
+@@ -63,6 +63,8 @@
+ #include "jit.h"
+ #include "xml-syscall.h"
+ #include "parser-defs.h"
++#include "gdb_regex.h"
++#include "stap-probe.h"
+ #include "cli/cli-utils.h"
+ #include "continuations.h"
+@@ -1248,6 +1250,9 @@ update_watchpoint (struct breakpoint *b,
+   if (!watchpoint_in_thread_scope (b))
+     return;
++  if (b->pspace != current_program_space)
++    return;
++
+   if (b->disposition == disp_del_at_next_stop)
+     return;
+  
+@@ -1532,6 +1537,40 @@ should_be_inserted (struct bp_location *
+   return 1;
+ }
++/* See the comment in breakpoint.h.  */
++
++void
++modify_semaphore (struct bp_location *loc, int set)
++{
++  struct gdbarch *arch = loc->gdbarch;
++  gdb_byte bytes[sizeof (LONGEST)];
++  /* The ABI specifies "unsigned short".  */
++  struct type *type = builtin_type (arch)->builtin_unsigned_short;
++  CORE_ADDR address = loc->semaphore;
++  ULONGEST value;
++
++  if (address == 0)
++    return;
++
++  /* Swallow errors.  */
++  if (target_read_memory (address, bytes, TYPE_LENGTH (type)) != 0)
++    return;
++
++  value = extract_unsigned_integer (bytes, TYPE_LENGTH (type),
++                                  gdbarch_byte_order (arch));
++  /* Note that we explicitly don't worry about overflow or
++     underflow.  */
++  if (set)
++    ++value;
++  else
++    --value;
++
++  store_unsigned_integer (bytes, TYPE_LENGTH (type),
++                        gdbarch_byte_order (arch), value);
++
++  target_write_memory (address, bytes, TYPE_LENGTH (type));
++}
++
+ /* Insert a low-level "breakpoint" of some type.  BL is the breakpoint
+    location.  Any error messages are printed to TMP_ERROR_STREAM; and
+    DISABLED_BREAKS, and HW_BREAKPOINT_ERROR are used to report problems.
+@@ -1628,6 +1667,8 @@ insert_bp_location (struct bp_location *
+         else
+           val = target_insert_breakpoint (bl->gdbarch,
+                                           &bl->target_info);
++
++        modify_semaphore (bl, 1);
+       }
+       else
+       {
+@@ -1883,6 +1924,7 @@ insert_breakpoint_locations (void)
+   int val = 0;
+   int disabled_breaks = 0;
+   int hw_breakpoint_error = 0;
++  struct program_space *saved_current_program_space = current_program_space;
+   struct ui_file *tmp_error_stream = mem_fileopen ();
+   struct cleanup *cleanups = make_cleanup_ui_file_delete (tmp_error_stream);
+@@ -1910,9 +1952,13 @@ insert_breakpoint_locations (void)
+       /* For targets that support global breakpoints, there's no need
+        to select an inferior to insert breakpoint to.  In fact, even
+        if we aren't attached to any process yet, we should still
+-       insert breakpoints.  */
++       insert breakpoints.
++
++       Also inserting breakpoints into inappropriate inferior must be
++       prevented.  */
+       if (!gdbarch_has_global_breakpoints (target_gdbarch)
+-        && ptid_equal (inferior_ptid, null_ptid))
++        && (ptid_equal (inferior_ptid, null_ptid)
++            || bl->pspace != saved_current_program_space))
+       continue;
+       val = insert_bp_location (bl, tmp_error_stream, &disabled_breaks,
+@@ -1936,13 +1982,19 @@ insert_breakpoint_locations (void)
+       if (bpt->disposition == disp_del_at_next_stop)
+       continue;
+-      
++
+       for (loc = bpt->loc; loc; loc = loc->next)
+-      if (!loc->inserted && should_be_inserted (loc))
+-        {
+-          some_failed = 1;
+-          break;
+-        }
++      {
++        /* Verify the first loop above really tried to insert this LOC.  */
++        if (!loc->inserted && should_be_inserted (loc)
++            && (gdbarch_has_global_breakpoints (target_gdbarch)
++                || (!ptid_equal (inferior_ptid, null_ptid)
++                    && loc->pspace == saved_current_program_space)))
++          {
++            some_failed = 1;
++            break;
++          }
++      }
+       if (some_failed)
+       {
+         for (loc = bpt->loc; loc; loc = loc->next)
+@@ -2110,11 +2162,23 @@ struct breakpoint_objfile_data
+   /* Minimal symbol(s) for "longjmp", "siglongjmp", etc. (if any).  */
+   struct minimal_symbol *longjmp_msym[NUM_LONGJMP_NAMES];
++  /* True if we have looked for longjmp probes.  */
++  int longjmp_searched;
++
++  /* SystemTap probe points for longjmp (if any).  */
++  VEC (stap_probe_p) *longjmp_probes;
++
+   /* Minimal symbol for "std::terminate()" (if any).  */
+   struct minimal_symbol *terminate_msym;
+   /* Minimal symbol for "_Unwind_DebugHook" (if any).  */
+   struct minimal_symbol *exception_msym;
++
++  /* True if we have looked for exception probes.  */
++  int exception_searched;
++
++  /* SystemTap probe points for unwinding (if any).  */
++  VEC (stap_probe_p) *exception_probes;
+ };
+ static const struct objfile_data *breakpoint_objfile_key;
+@@ -2151,6 +2215,15 @@ get_breakpoint_objfile_data (struct objf
+ }
+ static void
++free_breakpoint_probes (struct objfile *obj, void *data)
++{
++  struct breakpoint_objfile_data *bp_objfile_data = data;
++
++  VEC_free (stap_probe_p, bp_objfile_data->longjmp_probes);
++  VEC_free (stap_probe_p, bp_objfile_data->exception_probes);
++}
++
++static void
+ create_overlay_event_breakpoint (void)
+ {
+   struct objfile *objfile;
+@@ -2226,6 +2299,36 @@ create_longjmp_master_breakpoint (void)
+       bp_objfile_data = get_breakpoint_objfile_data (objfile);
++      if (!bp_objfile_data->longjmp_searched)
++      {
++        bp_objfile_data->longjmp_probes
++          = find_probes_in_objfile (objfile, "libc", "longjmp");
++        bp_objfile_data->longjmp_searched = 1;
++      }
++
++      if (bp_objfile_data->longjmp_probes != NULL)
++      {
++        int i;
++        const struct stap_probe *probe;
++        struct gdbarch *gdbarch = get_objfile_arch (objfile);
++
++        for (i = 0;
++             VEC_iterate (stap_probe_p,
++                          bp_objfile_data->longjmp_probes,
++                          i, probe);
++             ++i)
++          {
++            struct breakpoint *b;
++             
++            b = create_internal_breakpoint (gdbarch, probe->address,
++                                            bp_longjmp_master);
++            b->addr_string = xstrdup ("probe:libc:longjmp");
++            b->enable_state = bp_disabled;
++          }
++
++        continue;
++      }
++
+       for (i = 0; i < NUM_LONGJMP_NAMES; i++)
+       {
+         struct breakpoint *b;
+@@ -2334,6 +2437,39 @@ create_exception_master_breakpoint (void
+       bp_objfile_data = get_breakpoint_objfile_data (objfile);
++      /* We prefer the SystemTap probe point if it exists.  */
++      if (!bp_objfile_data->exception_searched)
++      {
++        bp_objfile_data->exception_probes
++          = find_probes_in_objfile (objfile, "libgcc", "unwind");
++        bp_objfile_data->exception_searched = 1;
++      }
++
++      if (bp_objfile_data->exception_probes != NULL)
++      {
++        struct gdbarch *gdbarch = get_objfile_arch (objfile);
++        int i;
++        const struct stap_probe *probe;
++
++        for (i = 0;
++             VEC_iterate (stap_probe_p,
++                          bp_objfile_data->exception_probes,
++                          i, probe);
++             ++i)
++          {
++            struct breakpoint *b;
++
++            b = create_internal_breakpoint (gdbarch, probe->address,
++                                            bp_exception_master);
++            b->addr_string = xstrdup ("probe:libgcc:unwind");
++            b->enable_state = bp_disabled;
++          }
++
++        continue;
++      }
++
++      /* Otherwise, try the hook function.  */
++
+       if (msym_not_found_p (bp_objfile_data->exception_msym))
+       continue;
+@@ -2552,6 +2688,8 @@ remove_breakpoint_1 (struct bp_location
+           val = target_remove_hw_breakpoint (bl->gdbarch, &bl->target_info);
+         else
+           val = target_remove_breakpoint (bl->gdbarch, &bl->target_info);
++
++        modify_semaphore (bl, 0);
+       }
+       else
+       {
+@@ -5957,6 +6095,7 @@ init_raw_breakpoint (struct breakpoint *
+   b->loc->requested_address = sal.pc;
+   b->loc->address = adjusted_address;
+   b->loc->pspace = sal.pspace;
++  b->loc->semaphore = sal.semaphore;
+   /* Store the program space that was used to set the breakpoint, for
+      breakpoint resetting.  */
+@@ -7226,6 +7365,7 @@ clone_momentary_breakpoint (struct break
+   copy->loc->address = orig->loc->address;
+   copy->loc->section = orig->loc->section;
+   copy->loc->pspace = orig->loc->pspace;
++  copy->loc->semaphore = orig->loc->semaphore;
+   if (orig->source_file == NULL)
+     copy->source_file = NULL;
+@@ -7444,6 +7584,7 @@ add_location_to_breakpoint (struct break
+   loc->address = adjust_breakpoint_address (loc->gdbarch,
+                                           loc->requested_address, b->type);
+   loc->pspace = sal->pspace;
++  loc->semaphore = sal->semaphore;
+   gdb_assert (loc->pspace != NULL);
+   loc->section = sal->section;
+@@ -7792,6 +7933,16 @@ create_breakpoints_sal (struct gdbarch *
+ {
+   int i;
++  if (canonical->pre_expanded)
++    {
++      create_breakpoint_sal (gdbarch, sals, canonical->canonical[0],
++                           cond_string, type, disposition,
++                           thread, task, ignore_count, ops,
++                           from_tty, enabled, internal,
++                           canonical->special_display);
++      return;
++    }
++
+   for (i = 0; i < sals.nelts; ++i)
+     {
+       struct symtabs_and_lines expanded = 
+@@ -8300,7 +8451,7 @@ create_breakpoint (struct gdbarch *gdbar
+       observer_notify_breakpoint_created (b);
+     }
+   
+-  if (sals.nelts > 1)
++  if (sals.nelts > 1 && !canonical.pre_expanded)
+     {
+       warning (_("Multiple breakpoints were set.\nUse the "
+                "\"delete\" command to delete unwanted breakpoints."));
+@@ -9394,6 +9545,7 @@ watch_command_1 (char *arg, int accessfl
+   /* Now set up the breakpoint.  */
+   b = set_raw_breakpoint_without_location (NULL, bp_type);
+   b->thread = thread;
++  b->pspace = current_program_space;
+   b->disposition = disp_donttouch;
+   b->exp = exp;
+   b->exp_valid_block = exp_valid_block;
+@@ -10512,6 +10664,9 @@ update_global_location_list (int should_
+       int keep_in_target = 0;
+       int removed = 0;
++      if (old_loc->pspace != current_program_space)
++      continue;
++
+       /* Skip LOCP entries which will definitely never be needed.
+        Stop either at or being the one matching OLD_LOC.  */
+       while (locp < bp_location + bp_location_count
+@@ -11333,12 +11488,14 @@ update_breakpoint_locations (struct brea
+    On return, FOUND will be 1 if any SaL was found, zero otherwise.  */
+ static struct symtabs_and_lines
+-addr_string_to_sals (struct breakpoint *b, char *addr_string, int *found)
++addr_string_to_sals (struct breakpoint *b, char *addr_string, int *found,
++                   int *pre_expanded)
+ {
+   char *s;
+   int marker_spec;
+   struct symtabs_and_lines sals = {0};
+   struct gdb_exception e;
++  int my_pre_expanded = 0;
+   s = addr_string;
+   marker_spec = b->type == bp_static_tracepoint && is_marker_spec (s);
+@@ -11357,7 +11514,27 @@ addr_string_to_sals (struct breakpoint *
+           error (_("marker %s not found"), b->static_trace_marker_id);
+       }
+       else
+-      sals = decode_line_1 (&s, 1, (struct symtab *) NULL, 0, NULL);
++      {
++        struct linespec_result canonical;
++
++        init_linespec_result (&canonical);
++        sals = decode_line_1 (&s, 1, (struct symtab *) NULL, 0,
++                              &canonical);
++
++        /* We don't need the contents.  */
++        if (canonical.canonical)
++          {
++            int i;
++
++            for (i = 0; i < sals.nelts; ++i)
++              xfree (canonical.canonical[i]);
++            xfree (canonical.canonical);
++          }
++
++        my_pre_expanded = canonical.pre_expanded;
++        if (pre_expanded)
++          *pre_expanded = my_pre_expanded;
++      }
+     }
+   if (e.reason < 0)
+     {
+@@ -11390,7 +11567,7 @@ addr_string_to_sals (struct breakpoint *
+   if (e.reason == 0 || e.error != NOT_FOUND_ERROR)
+     {
+-      gdb_assert (sals.nelts == 1);
++      gdb_assert (my_pre_expanded || sals.nelts == 1);
+       resolve_sal_pc (&sals.sals[0]);
+       if (b->condition_not_parsed && s && s[0])
+@@ -11426,17 +11603,22 @@ breakpoint_re_set_default (struct breakp
+   struct symtabs_and_lines sals, sals_end;
+   struct symtabs_and_lines expanded = {0};
+   struct symtabs_and_lines expanded_end = {0};
++  int pre_expanded = 0;
+-  sals = addr_string_to_sals (b, b->addr_string, &found);
++  sals = addr_string_to_sals (b, b->addr_string, &found, &pre_expanded);
+   if (found)
+     {
+       make_cleanup (xfree, sals.sals);
+-      expanded = expand_line_sal_maybe (sals.sals[0]);
++      if (pre_expanded)
++      expanded = sals;
++      else
++      expanded = expand_line_sal_maybe (sals.sals[0]);
+     }
+   if (b->addr_string_range_end)
+     {
+-      sals_end = addr_string_to_sals (b, b->addr_string_range_end, &found);
++      sals_end = addr_string_to_sals (b, b->addr_string_range_end, &found,
++                                    NULL);
+       if (found)
+       {
+         make_cleanup (xfree, sals_end.sals);
+@@ -12913,6 +13095,24 @@ all_tracepoints (void)
+   return tp_vec;
+ }
++#if 0
++/* Call type_mark_used for any TYPEs referenced from this GDB source file.  */
++
++static void
++breakpoint_types_mark_used (void)
++{
++  struct breakpoint *b;
++
++  ALL_BREAKPOINTS (b)
++    {
++      if (b->exp)
++      exp_types_mark_used (b->exp);
++      if (b->val)
++      type_mark_used (value_type (b->val));
++    }
++}
++#endif
++
\f
+ /* This help string is used for the break, hbreak, tbreak and thbreak
+    commands.  It is defined as a macro to prevent duplication.
+@@ -13005,7 +13205,8 @@ _initialize_breakpoint (void)
+   observer_attach_inferior_exit (clear_syscall_counts);
+   observer_attach_memory_changed (invalidate_bp_value_on_memory_change);
+-  breakpoint_objfile_key = register_objfile_data ();
++  breakpoint_objfile_key
++    = register_objfile_data_with_cleanup (NULL, free_breakpoint_probes);
+   breakpoint_chain = 0;
+   /* Don't bother to call set_breakpoint_count.  $bpnum isn't useful
+@@ -13532,4 +13733,7 @@ range (including START-LOCATION and END-
+   automatic_hardware_breakpoints = 1;
+   observer_attach_about_to_proceed (breakpoint_about_to_proceed);
++#if 0
++  observer_attach_mark_used (breakpoint_types_mark_used);
++#endif
+ }
+Index: gdb-7.3.50.20110722/gdb/breakpoint.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/breakpoint.h  2011-06-22 19:53:44.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/breakpoint.h       2011-07-29 22:52:02.000000000 +0200
+@@ -383,6 +383,11 @@ struct bp_location
+      processor's architectual constraints.  */
+   CORE_ADDR requested_address;
++  /* If the location comes from a SystemTap probe point, and the probe
++     has an associated semaphore variable, then this is the address of
++     the semaphore.  Otherwise, this is zero.  */
++  CORE_ADDR semaphore;
++
+   char *function_name;
+   /* Details of the placed breakpoint, when inserted.  */
+@@ -1316,4 +1321,11 @@ extern struct breakpoint *iterate_over_b
+ extern int user_breakpoint_p (struct breakpoint *);
++/* Set or clear a SystemTap semaphore.  LOC is the location which may
++   hold a semaphore.  SET is non-zero if the semaphore should be set,
++   or zero if the semaphore should be cleared.  Semaphores act as
++   reference counters, so calls to this function must be paired.  */
++
++extern void modify_semaphore (struct bp_location *location, int set);
++
+ #endif /* !defined (BREAKPOINT_H) */
+Index: gdb-7.3.50.20110722/gdb/c-typeprint.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/c-typeprint.c 2011-05-18 18:30:34.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/c-typeprint.c      2011-07-29 22:52:02.000000000 +0200
+@@ -625,9 +625,14 @@ c_type_print_varspec_suffix (struct type
+         fprintf_filtered (stream, ")");
+       fprintf_filtered (stream, "[");
+-      if (get_array_bounds (type, &low_bound, &high_bound))
+-        fprintf_filtered (stream, "%d", 
+-                          (int) (high_bound - low_bound + 1));
++      if (TYPE_RANGE_DATA (TYPE_INDEX_TYPE (type))->high.kind
++          != RANGE_BOUND_KIND_CONSTANT)
++        {
++          /* No _() - printed sources should not be locale dependent.  */
++          fprintf_filtered (stream, "variable");
++        }
++      else if (get_array_bounds (type, &low_bound, &high_bound))
++        fprintf_filtered (stream, "%d", (int) (high_bound - low_bound + 1));
+       fprintf_filtered (stream, "]");
+       c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream,
+Index: gdb-7.3.50.20110722/gdb/cli/cli-utils.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/cli/cli-utils.c       2011-03-16 22:12:12.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/cli/cli-utils.c    2011-07-29 22:52:02.000000000 +0200
+@@ -245,3 +245,32 @@ remove_trailing_whitespace (const char *
+   return s;
+ }
++
++/* See documentation in cli-utils.h.  */
++
++char *
++extract_arg (char **arg)
++{
++  char *result, *copy;
++
++  if (!*arg)
++    return NULL;
++
++  /* Find the start of the argument.  */
++  *arg = skip_spaces (*arg);
++  if (! **arg)
++    return NULL;
++  result = *arg;
++
++  /* Find the end of the argument.  */
++  *arg = skip_to_space (*arg + 1);
++
++  if (result == *arg)
++    return NULL;
++
++  copy = xmalloc (*arg - result + 1);
++  memcpy (copy, result, *arg - result);
++  copy[*arg - result] = '\0';
++
++  return copy;
++}
+Index: gdb-7.3.50.20110722/gdb/cli/cli-utils.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/cli/cli-utils.h       2011-03-16 22:12:12.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/cli/cli-utils.h    2011-07-29 22:52:02.000000000 +0200
+@@ -103,4 +103,11 @@ extern char *skip_to_space (char *inp);
+    START.  */
+ extern char *remove_trailing_whitespace (const char *start, char *s);
++
++/* A helper function to extract an argument from *ARG.  An argument is
++   delimited by whitespace.  The return value is either NULL if no
++   argument was found, or an xmalloc'd string.  */
++
++extern char *extract_arg (char **arg);
++
+ #endif /* CLI_UTILS_H */
+Index: gdb-7.3.50.20110722/gdb/coffread.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/coffread.c    2011-06-14 20:53:13.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/coffread.c 2011-07-29 22:52:02.000000000 +0200
+@@ -2197,6 +2197,7 @@ static const struct sym_fns coff_sym_fns
+   default_symfile_relocate,   /* sym_relocate: Relocate a debug
+                                  section.  */
++  NULL,                               /* sym_probe_fns */
+   &psym_functions
+ };
+Index: gdb-7.3.50.20110722/gdb/data-directory/Makefile.in
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/data-directory/Makefile.in    2011-02-04 19:34:41.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/data-directory/Makefile.in 2011-07-29 22:52:02.000000000 +0200
+@@ -52,11 +52,23 @@ SYSCALLS_FILES = \
+ PYTHON_DIR = python
+ PYTHON_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(PYTHON_DIR)
+ PYTHON_FILES = \
++      gdb/FrameIterator.py \
++      gdb/FrameWrapper.py \
+       gdb/__init__.py \
+-      gdb/types.py \
+-      gdb/printing.py \
++      gdb/backtrace.py \
+       gdb/command/__init__.py \
+-      gdb/command/pretty_printers.py
++      gdb/command/alias.py \
++      gdb/command/backtrace.py \
++      gdb/command/ignore_errors.py \
++      gdb/command/pahole.py \
++      gdb/command/pretty_printers.py \
++      gdb/command/require.py \
++      gdb/command/upto.py \
++      gdb/function/__init__.py \
++      gdb/function/caller_is.py \
++      gdb/function/in_scope.py \
++      gdb/printing.py \
++      gdb/types.py
+ FLAGS_TO_PASS = \
+       "prefix=$(prefix)" \
+Index: gdb-7.3.50.20110722/gdb/dbxread.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/dbxread.c     2011-06-27 21:21:50.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/dbxread.c  2011-07-29 22:52:02.000000000 +0200
+@@ -3590,6 +3590,7 @@ static const struct sym_fns aout_sym_fns
+   default_symfile_segments,   /* Get segment information from a file.  */
+   NULL,
+   default_symfile_relocate,   /* Relocate a debug section.  */
++  NULL,                               /* sym_probe_fns */
+   &psym_functions
+ };
+Index: gdb-7.3.50.20110722/gdb/defs.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/defs.h        2011-07-22 01:46:08.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/defs.h     2011-07-29 22:52:02.000000000 +0200
+@@ -406,6 +406,8 @@ extern struct cleanup *make_cleanup_rest
+ extern struct cleanup *
+   set_batch_flag_and_make_cleanup_restore_page_info (void);
++extern struct cleanup *make_cleanup_restore_selected_frame (void);
++
+ extern char *gdb_realpath (const char *);
+ extern char *xfullpath (const char *);
+Index: gdb-7.3.50.20110722/gdb/doc/gdb.texinfo
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/doc/gdb.texinfo       2011-07-21 17:13:29.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/doc/gdb.texinfo    2011-07-29 22:52:02.000000000 +0200
+@@ -1175,6 +1175,16 @@ for remote debugging.
+ Run using @var{device} for your program's standard input and output.
+ @c FIXME: kingdon thinks there is more to -tty.  Investigate.
++@item -P
++@cindex @code{-P}
++@itemx --python
++@cindex @code{--python}
++Change interpretation of command line so that the argument immediately
++following this switch is taken to be the name of a Python script file.
++This option stops option processing; subsequent options are passed to
++Python as @code{sys.argv}.  This option is only available if Python
++scripting support was enabled when @value{GDBN} was configured.
++
+ @c resolve the situation of these eventually
+ @item -tui
+ @cindex @code{--tui}
+@@ -3295,6 +3305,7 @@ all breakpoints in that range are operat
+ * Conditions::                  Break conditions
+ * Break Commands::              Breakpoint command lists
+ * Save Breakpoints::            How to save breakpoints in a file
++* Static Probe Points::         Listing static probe points
+ * Error in Breakpoints::        ``Cannot insert breakpoints''
+ * Breakpoint-related Warnings:: ``Breakpoint address adjusted...''
+ @end menu
+@@ -4525,6 +4536,50 @@ and remove the breakpoint definitions yo
+ that can no longer be recreated.
+ @end table
++@node Static Probe Points
++@subsection Static Probe Points
++
++@cindex SystemTap static probe point
++@cindex sdt-probe
++The @sc{gnu}/Linux tool @code{SystemTap} provides a way for
++applications to embed static probes, using @file{sys/sdt.h}.  @value{GDBN}
++can list the available probes, and you can put breakpoints at the
++probe points (@pxref{Specify Location}).
++
++You can examine the available @code{SystemTap} static probes using
++@code{info probes}:
++
++@table @code
++@kindex info probes
++@item info probes [@var{provider} [@var{name} [@var{objfile}]]]
++List the available @code{SystemTap} static probes.
++
++If given, @var{provider} is a regular expression used to select which
++providers to list.  If omitted, all providers are listed.
++
++If given, @var{name} is a regular expression used to select which
++probes to list.  If omitted, all probes are listed.
++
++If given, @var{objfile} is a regular expression used to select which
++object files (executable or shared libraries) to examine.  If not
++given, all object files are considered.
++@end table
++
++@vindex $_probe_arg@r{, convenience variable}
++A probe may specify up to ten arguments.  These are available at the
++point at which the probe is defined---that is, when the current PC is
++at the probe's location.  The arguments are available using the
++convenience variables (@pxref{Convenience Vars})
++@code{$_probe_arg0}@dots{}@code{$_probe_arg9}.  Each probe argument is
++an integer of the appropriate size; types are not preserved.  The
++convenience variable @code{$_probe_argc} holds the number of arguments
++at the current probe point.
++
++These variables are always available, but attempts to access them at
++any location other than a probe point will cause @value{GDBN} to give
++an error.
++
++
+ @c  @ifclear BARETARGET
+ @node Error in Breakpoints
+ @subsection ``Cannot insert breakpoints''
+@@ -6440,6 +6495,29 @@ specify the function unambiguously, e.g.
+ functions with identical names in different source files.
+ @end table
++@cindex SystemTap static probe point
++@item probe:@r{[}@var{objfile}:@r{]}@r{[}@var{provider}:@r{]}@var{name}
++The @sc{gnu}/Linux tool @code{SystemTap} provides a way for
++applications to embed static probes.  This form of linespec specifies
++the location of such a static probe.  See
++@uref{http://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps}
++for more information on static probes.
++
++If @var{objfile} is given, only probes coming from that shared library
++or executable are considered.  If @var{provider} is given, then only
++probes from that provider are considered.
++
++@xref{Static Probe Points}, for more information on finding and using
++static probes.
++
++Some probes have an associated semaphore variable; for instance, this
++happens automatically if you defined your probe using a DTrace-style
++@file{.d} file.  If your probe has a semaphore, @value{GDBN} will
++automatically enable it when you specify a breakpoint using the
++@samp{probe:} notation.  But, if you put a breakpoint at a probe's
++location by some other method (e.g., @code{break file:line}), then
++@value{GDBN} will not automatically set the semaphore.
++
+ @end table
+@@ -8526,6 +8604,10 @@ to match the format in which the data wa
+ The variable @code{$_exitcode} is automatically set to the exit code when
+ the program being debugged terminates.
++@item $_probe_argc
++@itemx $_probe_arg0@dots{}$_probe_arg9
++Arguments to a SystemTap static probe.  @xref{Static Probe Points}.
++
+ @item $_sdata
+ @vindex $_sdata@r{, inspect, convenience variable}
+ The variable @code{$_sdata} contains extra collected static tracepoint
+@@ -10264,6 +10346,16 @@ Collect all function arguments.
+ @item $locals
+ Collect all local variables.
++@item $_probe_argc
++Collects the number of arguments from the @code{SystemTap} probe at
++which the tracepoint is located.
++@xref{Static Probe Points,,Static Probe Points}
++
++@item $_probe_arg@var{N}
++Where @var{N} varies from 0 to 9.  Collects the @var{N}th argument
++from the @code{SystemTap} probe at which the tracepoint is located.
++@xref{Static Probe Points,,Static Probe Points}
++
+ @item $_sdata
+ @vindex $_sdata@r{, collect}
+ Collect static tracepoint marker specific data.  Only available for
+@@ -20805,8 +20897,6 @@ containing @code{end}.  For example:
+ @smallexample
+ (@value{GDBP}) python
+-Type python script
+-End with a line saying just "end".
+ >print 23
+ >end
+ 23
+@@ -20824,6 +20914,14 @@ occurs in a Python script.  This can be
+ python print-stack}: if @code{on}, then Python stack printing is
+ enabled; if @code{off}, the default, then Python stack printing is
+ disabled.
++
++@kindex maint set python auto-load
++@item maint set python auto-load
++By default, @value{GDBN} will attempt to automatically load Python
++code when an object file is opened.  This can be controlled using
++@code{maint set python auto-load}: if @code{on}, the default, then
++Python auto-loading is enabled; if @code{off}, then Python
++auto-loading is disabled.
+ @end table
+ It is also possible to execute a Python script from the @value{GDBN}
+@@ -20845,6 +20943,14 @@ and thus is always available.
+ @cindex python api
+ @cindex programming in python
++You can get quick online help for @value{GDBN}'s Python API by issuing
++the command @w{@kbd{python help (gdb)}}.
++
++Functions and methods which have two or more optional arguments allow
++them to be specified using keyword syntax.  This allows passing some
++optional arguments while skipping others.  Example:
++@w{@code{gdb.some_function ('foo', bar = 1, baz = 2)}}.
++
+ @cindex python stdout
+ @cindex python pagination
+ At startup, @value{GDBN} overrides Python's @code{sys.stdout} and
+Index: gdb-7.3.50.20110722/gdb/doc/gdbint.texinfo
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/doc/gdbint.texinfo    2011-04-19 20:04:08.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/doc/gdbint.texinfo 2011-07-29 22:52:02.000000000 +0200
+@@ -2104,6 +2104,18 @@ time, and so we attempt to handle symbol
+ we create @dfn{partial symbol tables} consisting of only selected
+ symbols, and only expand them to full symbol tables when necessary.
++@menu
++* Symbol Reading::
++* Partial Symbol Tables::
++* Types::
++* Object File Formats::
++* Debugging File Formats::
++* Adding a New Symbol Reader to GDB::
++* Memory Management for Symbol Files::
++* Memory Management for Types::
++@end menu
++
++@node Symbol Reading
+ @section Symbol Reading
+ @cindex symbol reading
+@@ -2196,6 +2208,7 @@ symtab.  Upon return, @code{pst->readin}
+ zero if there were no symbols in that part of the symbol file.
+ @end table
++@node Partial Symbol Tables
+ @section Partial Symbol Tables
+ @value{GDBN} has three types of symbol tables:
+@@ -2297,6 +2310,7 @@ and partial symbol tables behind a set o
+ the @dfn{quick symbol functions}.  These are documented in
+ @file{symfile.h}.
++@node Types
+ @section Types
+ @unnumberedsubsec Fundamental Types (e.g., @code{FT_VOID}, @code{FT_BOOLEAN}).
+@@ -2319,6 +2333,7 @@ types map to one @code{TYPE_CODE_*} type
+ other members of the type struct, such as whether the type is signed
+ or unsigned, and how many bits it uses.
++@anchor{Builtin Types}
+ @unnumberedsubsec Builtin Types (e.g., @code{builtin_type_void}, @code{builtin_type_char}).
+ These are instances of type structs that roughly correspond to
+@@ -2333,6 +2348,7 @@ only one instance exists, while @file{c-
+ @code{TYPE_CODE_INT} types as needed, with each one associated with
+ some particular objfile.
++@node Object File Formats
+ @section Object File Formats
+ @cindex object file formats
+@@ -2418,6 +2434,7 @@ SOM, which is a cross-language ABI).
+ The SOM reader is in @file{somread.c}.
++@node Debugging File Formats
+ @section Debugging File Formats
+ This section describes characteristics of debugging information that
+@@ -2489,6 +2506,7 @@ DWARF 3 is an improved version of DWARF
+ @cindex SOM debugging info
+ Like COFF, the SOM definition includes debugging information.
++@node Adding a New Symbol Reader to GDB
+ @section Adding a New Symbol Reader to @value{GDBN}
+ @cindex adding debugging info reader
+@@ -2511,6 +2529,7 @@ will only ever be implemented by one obj
+ directly.  This interface should be described in a file
+ @file{bfd/lib@var{xyz}.h}, which is included by @value{GDBN}.
++@node Memory Management for Symbol Files
+ @section Memory Management for Symbol Files
+ Most memory associated with a loaded symbol file is stored on
+@@ -2522,10 +2541,45 @@ released when the objfile is unloaded or
+ objfile must not reference symbol or type data from another objfile;
+ they could be unloaded at different times.
+-User convenience variables, et cetera, have associated types.  Normally
+-these types live in the associated objfile.  However, when the objfile
+-is unloaded, those types are deep copied to global memory, so that
+-the values of the user variables and history items are not lost.
++@node Memory Management for Types
++@section Memory Management for Types
++@cindex memory management for types
++
++@findex TYPE_OBJFILE
++@code{TYPE_OBJFILE} macro indicates the current memory owner of the type.
++Non-@code{NULL} value indicates it is owned by an objfile (specifically by its
++obstack) and in such case the type remains valid till the objfile is unloaded
++or reloaded.  For such types with an associated objfile no reference counting
++is being made.
++
++User convenience variables, et cetera, have associated types.  Normally these
++types live in the associated objfile.  However, when the objfile is unloaded,
++those types are deep copied to global memory, so that the values of the user
++variables and history items are not lost.  During the copy they will get their
++@code{TYPE_OBJFILE} set to @code{NULL} and become so-called @dfn{reclaimable}
++types.
++
++Types with null @code{TYPE_OBJFILE} can be either permanent types
++(@pxref{Builtin Types}) or reclaimable types which will be deallocated at the
++first idle @value{GDBN} moment if the last object referencing them is removed.
++Permanent types are allocated by the function @code{alloc_type} (and its
++derivations like @code{init_type}) specifying objfile as @code{NULL}.  The
++reclaimable types are created the same way but moreover they need to have
++@code{type_init_group} called to start their tracking as being possibly
++deallocatable.
++
++@findex free_all_types
++When @value{GDBN} gets idle it always calls the @code{free_all_types} function
++which deallocates any unused types.  All types currently not owned by an
++objfile must be marked as used on each @code{free_all_types} call as they would
++get deallocated as unused otherwise.
++
++@code{free_all_types} automatically checks for any cross-type references such
++as through @code{TYPE_TARGET_TYPE}, @code{TYPE_POINTER_TYPE} etc.@: and
++prevents early deallocation for any such existing references.  Reclaimable
++types may reference any other reclaimable types or even permanent types.  But
++permanent types must not reference reclaimable types (nor an objfile associated
++type).
+ @node Language Support
+Index: gdb-7.3.50.20110722/gdb/doc/observer.texi
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/doc/observer.texi     2011-07-21 13:03:47.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/doc/observer.texi  2011-07-29 22:52:02.000000000 +0200
+@@ -227,6 +227,11 @@ Called before a top-level prompt is disp
+ the current top-level prompt.
+ @end deftypefun
++@c @deftypefun void mark_used (void)
++@c Mark any possibly reclaimable objects as used during a mark-and-sweep garbage
++@c collector pass.  Currently only @code{type_mark_used} marker is supported.
++@c @end deftypefun
++
+ @deftypefun void test_notification (int @var{somearg})
+ This observer is used for internal testing.  Do not use.  
+ See testsuite/gdb.gdb/observer.exp.
+Index: gdb-7.3.50.20110722/gdb/dwarf2expr.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/dwarf2expr.c  2011-07-15 22:54:32.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/dwarf2expr.c       2011-07-29 22:52:02.000000000 +0200
+@@ -1258,6 +1258,14 @@ execute_stack_op (struct dwarf_expr_cont
+         }
+         break;
++      case DW_OP_push_object_address:
++        if (ctx->funcs->get_object_address == NULL)
++          error (_("DWARF-2 expression error: DW_OP_push_object_address must "
++                 "have a value to push."));
++        result = (ctx->funcs->get_object_address) (ctx->baton);
++        result_val = value_from_ulongest (address_type, result);
++        break;
++
+       default:
+         error (_("Unhandled dwarf expression opcode 0x%x"), op);
+       }
+Index: gdb-7.3.50.20110722/gdb/dwarf2expr.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/dwarf2expr.h  2011-07-15 22:54:32.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/dwarf2expr.h       2011-07-29 22:52:02.000000000 +0200
+@@ -62,12 +62,10 @@ struct dwarf_expr_context_funcs
+      meaningful to substitute a stub type of the correct size.  */
+   struct type *(*get_base_type) (struct dwarf_expr_context *ctx, size_t die);
+-#if 0
+   /* Not yet implemented.  */
+   /* Return the `object address' for DW_OP_push_object_address.  */
+   CORE_ADDR (*get_object_address) (void *baton);
+-#endif
+ };
+ /* The location of a value.  */
+Index: gdb-7.3.50.20110722/gdb/dwarf2loc.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/dwarf2loc.c   2011-07-19 22:28:52.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/dwarf2loc.c        2011-07-29 22:52:02.000000000 +0200
+@@ -134,6 +134,9 @@ struct dwarf_expr_baton
+ {
+   struct frame_info *frame;
+   struct dwarf2_per_cu_data *per_cu;
++  /* From DW_TAG_variable's DW_AT_location (not DW_TAG_type's
++     DW_AT_data_location) for DW_OP_push_object_address.  */
++  CORE_ADDR object_address;
+ };
+ /* Helper functions for dwarf2_evaluate_loc_desc.  */
+@@ -202,23 +205,33 @@ dwarf_expr_frame_base_1 (struct symbol *
+       symbaton = SYMBOL_LOCATION_BATON (framefunc);
+       *start = dwarf2_find_location_expression (symbaton, length, pc);
+     }
+-  else
++  else if (SYMBOL_COMPUTED_OPS (framefunc) == &dwarf2_locexpr_funcs)
+     {
+       struct dwarf2_locexpr_baton *symbaton;
+       symbaton = SYMBOL_LOCATION_BATON (framefunc);
+-      if (symbaton != NULL)
+-      {
+-        *length = symbaton->size;
+-        *start = symbaton->data;
+-      }
+-      else
+-      *start = NULL;
++      gdb_assert (symbaton != NULL);
++      *start = symbaton->data;
++      *length = symbaton->size;
+     }
++  else if (SYMBOL_COMPUTED_OPS (framefunc) == &dwarf2_missing_funcs)
++    {
++      struct dwarf2_locexpr_baton *symbaton;
++
++      symbaton = SYMBOL_LOCATION_BATON (framefunc);
++      gdb_assert (symbaton == NULL);
++      *start = NULL;
++      *length = 0;    /* unused */
++    }
++  else
++    internal_error (__FILE__, __LINE__,
++                  _("Unsupported SYMBOL_COMPUTED_OPS %p for \"%s\""),
++                  SYMBOL_COMPUTED_OPS (framefunc),
++                  SYMBOL_PRINT_NAME (framefunc));
+   if (*start == NULL)
+     error (_("Could not find the frame base for \"%s\"."),
+-         SYMBOL_NATURAL_NAME (framefunc));
++         SYMBOL_PRINT_NAME (framefunc));
+ }
+ /* Helper function for dwarf2_evaluate_loc_desc.  Computes the CFA for
+@@ -291,6 +304,85 @@ dwarf_expr_dwarf_call (struct dwarf_expr
+                    ctx->funcs->get_frame_pc, ctx->baton);
+ }
++static CORE_ADDR
++dwarf_expr_object_address (void *baton)
++{
++  struct dwarf_expr_baton *debaton = baton;
++
++  /* The message is suppressed in DWARF_BLOCK_EXEC.  */
++  if (debaton->object_address == 0)
++    error (_("Cannot resolve DW_OP_push_object_address for a missing object"));
++
++  return debaton->object_address;
++}
++
++/* Address of the variable we are currently referring to.  It is set from
++   DW_TAG_variable's DW_AT_location (not DW_TAG_type's DW_AT_data_location) for
++   DW_OP_push_object_address.  */
++
++static CORE_ADDR object_address;
++
++/* Callers use object_address_set while their callers use the result set so we
++   cannot run the cleanup at the local block of our direct caller.  Still we
++   should reset OBJECT_ADDRESS at least for the next GDB command.  */
++
++static void
++object_address_cleanup (void *prev_save_voidp)
++{
++  CORE_ADDR *prev_save = prev_save_voidp;
++
++  object_address = *prev_save;
++  xfree (prev_save);
++}
++
++/* Set the base address - DW_AT_location - of a variable.  It is being later
++   used to derive other object addresses by DW_OP_push_object_address.
++
++   It would be useful to sanity check ADDRESS - such as for some objects with
++   unset value_raw_address - but some valid addresses may be zero (such as first
++   objects in relocatable .o files).  */
++
++void
++object_address_set (CORE_ADDR address)
++{
++  CORE_ADDR *prev_save;
++
++  prev_save = xmalloc (sizeof *prev_save);
++  *prev_save = object_address;
++  make_cleanup (object_address_cleanup, prev_save);
++
++  object_address = address;
++}
++
++/* Evaluate DWARF location list at DLLBATON expecting it produces exactly one
++   CORE_ADDR result stored to *ADDRP on the DWARF stack stack.  If the result
++   could not be found return zero and keep *ADDRP unchanged.  */
++
++int
++dwarf_loclist_baton_eval (struct dwarf2_loclist_baton *dllbaton,
++                        struct type *type, CORE_ADDR *addrp)
++{
++  struct frame_info *frame = get_selected_frame (NULL);
++  const gdb_byte *data;
++  size_t size;
++  struct value *val;
++
++  if (!dllbaton)
++    return 0;
++
++  data = dwarf2_find_location_expression (dllbaton, &size,
++                                        get_frame_address_in_block (frame));
++  if (data == NULL)
++    return 0;
++
++  val = dwarf2_evaluate_loc_desc (type, frame, data, size, dllbaton->per_cu);
++  if (value_optimized_out (val))
++    return 0;
++
++  *addrp = value_as_address (val);
++  return 1;
++}
++
+ /* Callback function for dwarf2_evaluate_loc_desc.  */
+ static struct type *
+@@ -301,6 +393,85 @@ dwarf_expr_get_base_type (struct dwarf_e
+   return dwarf2_get_die_type (die_offset, debaton->per_cu);
+ }
++/* Virtual method table for dwarf2_evaluate_loc_desc_full below.  */
++
++static const struct dwarf_expr_context_funcs dwarf_expr_ctx_funcs =
++{
++  dwarf_expr_read_reg,
++  dwarf_expr_read_mem,
++  dwarf_expr_frame_base,
++  dwarf_expr_frame_cfa,
++  dwarf_expr_frame_pc,
++  dwarf_expr_tls_address,
++  dwarf_expr_dwarf_call,
++  dwarf_expr_get_base_type,
++  dwarf_expr_object_address
++};
++
++/* Evaluate DWARF expression at DATA ... DATA + SIZE with its result readable
++   by dwarf_expr_fetch (RETVAL, 0).  FRAME parameter can be NULL to call
++   get_selected_frame to find it.  Returned dwarf_expr_context freeing is
++   pushed on the cleanup chain.  */
++
++static void
++dwarf_expr_prep_ctx (struct dwarf_expr_context *ctx, struct frame_info *frame,
++                   const gdb_byte *data, size_t size,
++                   struct dwarf2_per_cu_data *per_cu)
++{
++  struct dwarf_expr_baton baton;
++  struct objfile *objfile = dwarf2_per_cu_objfile (per_cu);
++  volatile struct gdb_exception ex;
++
++  baton.frame = frame;
++  baton.per_cu = per_cu;
++  baton.object_address = object_address;
++
++  ctx->gdbarch = get_objfile_arch (objfile);
++  ctx->addr_size = dwarf2_per_cu_addr_size (per_cu);
++  ctx->offset = dwarf2_per_cu_text_offset (per_cu);
++  ctx->baton = &baton;
++  ctx->funcs = &dwarf_expr_ctx_funcs;
++
++  dwarf_expr_eval (ctx, data, size);
++}
++
++/* Evaluate DWARF expression at DLBATON expecting it produces exactly one
++   CORE_ADDR result on the DWARF stack stack.  */
++
++CORE_ADDR
++dwarf_locexpr_baton_eval (struct dwarf2_locexpr_baton *dlbaton)
++{
++  struct dwarf_expr_context *ctx;
++  CORE_ADDR retval;
++  struct cleanup *back_to;
++
++  ctx = new_dwarf_expr_context ();
++  back_to = make_cleanup_free_dwarf_expr_context (ctx);
++
++  dwarf_expr_prep_ctx (ctx, get_selected_frame (NULL), dlbaton->data,
++                     dlbaton->size, dlbaton->per_cu);
++
++  if (ctx->num_pieces > 0)
++    error (_("DW_OP_*piece is unsupported for DW_FORM_block"));
++
++  retval = dwarf_expr_fetch_address (ctx, 0);
++
++  if (ctx->location == DWARF_VALUE_REGISTER)
++    {
++      /* Inlined dwarf_expr_read_reg as we no longer have the baton. */
++
++      int gdb_regnum = gdbarch_dwarf2_reg_to_regnum (ctx->gdbarch, retval);
++      struct type *type = builtin_type (ctx->gdbarch)->builtin_data_ptr;
++      struct frame_info *frame = get_selected_frame (NULL);
++
++      retval = address_from_register (type, gdb_regnum, frame);
++    }
++
++  do_cleanups (back_to);
++
++  return retval;
++}
++
+ struct piece_closure
+ {
+   /* Reference count.  */
+@@ -1082,20 +1253,6 @@ invalid_synthetic_pointer (void)
+          "referenced via synthetic pointer"));
+ }
+-/* Virtual method table for dwarf2_evaluate_loc_desc_full below.  */
+-
+-static const struct dwarf_expr_context_funcs dwarf_expr_ctx_funcs =
+-{
+-  dwarf_expr_read_reg,
+-  dwarf_expr_read_mem,
+-  dwarf_expr_frame_base,
+-  dwarf_expr_frame_cfa,
+-  dwarf_expr_frame_pc,
+-  dwarf_expr_tls_address,
+-  dwarf_expr_dwarf_call,
+-  dwarf_expr_get_base_type
+-};
+-
+ /* Evaluate a location description, starting at DATA and with length
+    SIZE, to find the current location of variable of TYPE in the
+    context of FRAME.  BYTE_OFFSET is applied after the contents are
+@@ -1108,10 +1265,8 @@ dwarf2_evaluate_loc_desc_full (struct ty
+                              LONGEST byte_offset)
+ {
+   struct value *retval;
+-  struct dwarf_expr_baton baton;
+   struct dwarf_expr_context *ctx;
+   struct cleanup *old_chain, *value_chain;
+-  struct objfile *objfile = dwarf2_per_cu_objfile (per_cu);
+   volatile struct gdb_exception ex;
+   if (byte_offset < 0)
+@@ -1120,28 +1275,18 @@ dwarf2_evaluate_loc_desc_full (struct ty
+   if (size == 0)
+     return allocate_optimized_out_value (type);
+-  baton.frame = frame;
+-  baton.per_cu = per_cu;
+-
+   ctx = new_dwarf_expr_context ();
+   old_chain = make_cleanup_free_dwarf_expr_context (ctx);
+   value_chain = make_cleanup_value_free_to_mark (value_mark ());
+-  ctx->gdbarch = get_objfile_arch (objfile);
+-  ctx->addr_size = dwarf2_per_cu_addr_size (per_cu);
+-  ctx->offset = dwarf2_per_cu_text_offset (per_cu);
+-  ctx->baton = &baton;
+-  ctx->funcs = &dwarf_expr_ctx_funcs;
+-
+   TRY_CATCH (ex, RETURN_MASK_ERROR)
+     {
+-      dwarf_expr_eval (ctx, data, size);
++      dwarf_expr_prep_ctx (ctx, frame, data, size, per_cu);
+     }
+   if (ex.reason < 0)
+     {
+       if (ex.error == NOT_AVAILABLE_ERROR)
+       {
+-        do_cleanups (old_chain);
+         retval = allocate_value (type);
+         mark_value_bytes_unavailable (retval, 0, TYPE_LENGTH (type));
+         return retval;
+@@ -1198,6 +1343,16 @@ dwarf2_evaluate_loc_desc_full (struct ty
+           int in_stack_memory = dwarf_expr_fetch_in_stack_memory (ctx, 0);
+           do_cleanups (value_chain);
++
++          /* Frame may be needed for check_typedef of TYPE_DYNAMIC.  */
++          make_cleanup_restore_selected_frame ();
++          select_frame (frame);
++
++          /* object_address_set called here is required in ALLOCATE_VALUE's
++             CHECK_TYPEDEF for the object's possible
++             DW_OP_push_object_address.  */
++          object_address_set (address);
++
+           retval = allocate_value_lazy (type);
+           VALUE_LVAL (retval) = lval_memory;
+           if (in_stack_memory)
+@@ -2974,11 +3129,51 @@ loclist_tracepoint_var_ref (struct symbo
+                              dlbaton->per_cu);
+ }
+-/* The set of location functions used with the DWARF-2 expression
+-   evaluator and location lists.  */
++/* The set of location functions used with the DWARF-2 location lists.  */
+ const struct symbol_computed_ops dwarf2_loclist_funcs = {
+   loclist_read_variable,
+   loclist_read_needs_frame,
+   loclist_describe_location,
+   loclist_tracepoint_var_ref
+ };
++
++static struct value *
++missing_read_variable (struct symbol *symbol, struct frame_info *frame)
++{
++  struct dwarf2_loclist_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol);
++
++  gdb_assert (dlbaton == NULL);
++  error (_("Unable to resolve variable \"%s\""), SYMBOL_PRINT_NAME (symbol));
++}
++
++static int
++missing_read_needs_frame (struct symbol *symbol)
++{
++  return 0;
++}
++
++static void
++missing_describe_location (struct symbol *symbol, CORE_ADDR addr,
++                         struct ui_file *stream)
++{
++  fprintf_filtered (stream, _("a variable we are unable to resolve"));
++}
++
++static void
++missing_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch,
++                          struct agent_expr *ax, struct axs_value *value)
++{
++  struct dwarf2_loclist_baton *dlbaton = SYMBOL_LOCATION_BATON (symbol);
++
++  gdb_assert (dlbaton == NULL);
++  error (_("Unable to resolve variable \"%s\""), SYMBOL_PRINT_NAME (symbol));
++}
++
++/* The set of location functions used with the DWARF-2 evaluator when we are
++   unable to resolve the symbols.  */
++const struct symbol_computed_ops dwarf2_missing_funcs = {
++  missing_read_variable,
++  missing_read_needs_frame,
++  missing_describe_location,
++  missing_tracepoint_var_ref
++};
+Index: gdb-7.3.50.20110722/gdb/dwarf2loc.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/dwarf2loc.h   2011-05-12 19:40:54.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/dwarf2loc.h        2011-07-29 22:52:02.000000000 +0200
+@@ -110,6 +110,15 @@ struct dwarf2_loclist_baton
+ extern const struct symbol_computed_ops dwarf2_locexpr_funcs;
+ extern const struct symbol_computed_ops dwarf2_loclist_funcs;
++extern const struct symbol_computed_ops dwarf2_missing_funcs;
++
++extern void object_address_set (CORE_ADDR address);
++
++extern CORE_ADDR dwarf_locexpr_baton_eval
++  (struct dwarf2_locexpr_baton *dlbaton);
++
++extern int dwarf_loclist_baton_eval (struct dwarf2_loclist_baton *dllbaton,
++                                   struct type *type, CORE_ADDR *addrp);
+ /* Compile a DWARF location expression to an agent expression.
+    
+Index: gdb-7.3.50.20110722/gdb/dwarf2read.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/dwarf2read.c  2011-07-29 22:52:00.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/dwarf2read.c       2011-07-29 22:52:02.000000000 +0200
+@@ -1251,6 +1251,9 @@ static void fill_in_loclist_baton (struc
+                                  struct dwarf2_loclist_baton *baton,
+                                  struct attribute *attr);
++static struct dwarf2_loclist_baton *dwarf2_attr_to_loclist_baton
++  (struct attribute *attr, struct dwarf2_cu *cu);
++
+ static void dwarf2_symbol_mark_computed (struct attribute *attr,
+                                        struct symbol *sym,
+                                        struct dwarf2_cu *cu);
+@@ -1285,6 +1288,9 @@ static void age_cached_comp_units (void)
+ static void free_one_cached_comp_unit (void *);
++static void fetch_die_type_attrs (struct die_info *die, struct type *type,
++                                struct dwarf2_cu *cu);
++
+ static struct type *set_die_type (struct die_info *, struct type *,
+                                 struct dwarf2_cu *);
+@@ -1309,6 +1315,9 @@ static struct type *get_die_type_at_offs
+ static struct type *get_die_type (struct die_info *die, struct dwarf2_cu *cu);
++static struct dwarf2_locexpr_baton *dwarf2_attr_to_locexpr_baton
++  (struct attribute *attr, struct dwarf2_cu *cu);
++
+ static void dwarf2_release_queue (void *dummy);
+ static void queue_comp_unit (struct dwarf2_per_cu_data *per_cu,
+@@ -7785,6 +7794,29 @@ process_enumeration_scope (struct die_in
+   new_symbol (die, this_type, cu);
+ }
++/* Create a new array dimension referencing its target type TYPE.
++
++   Multidimensional arrays are internally represented as a stack of
++   singledimensional arrays being referenced by their TYPE_TARGET_TYPE.  */
++
++static struct type *
++create_single_array_dimension (struct type *type, struct type *range_type,
++                             struct die_info *die, struct dwarf2_cu *cu)
++{
++  type = create_array_type (NULL, type, range_type);
++
++  /* These generic type attributes need to be fetched by
++     evaluate_subexp_standard <multi_f77_subscript>'s call of
++     value_subscripted_rvalue only for the innermost array type.  */
++  fetch_die_type_attrs (die, type, cu);
++
++  /* These generic type attributes are checked for allocated/associated
++     validity while accessing FIELD_LOC_KIND_DWARF_BLOCK.  */
++  fetch_die_type_attrs (die, range_type, cu);
++
++  return type;
++}
++
+ /* Extract all information from a DW_TAG_array_type DIE and put it in
+    the DIE's type field.  For now, this only handles one dimensional
+    arrays.  */
+@@ -7798,7 +7830,7 @@ read_array_type (struct die_info *die, s
+   struct type *element_type, *range_type, *index_type;
+   struct type **range_types = NULL;
+   struct attribute *attr;
+-  int ndim = 0;
++  int ndim = 0, i;
+   struct cleanup *back_to;
+   char *name;
+@@ -7851,17 +7883,19 @@ read_array_type (struct die_info *die, s
+   type = element_type;
+   if (read_array_order (die, cu) == DW_ORD_col_major)
+-    {
+-      int i = 0;
+-
+-      while (i < ndim)
+-      type = create_array_type (NULL, type, range_types[i++]);
+-    }
+-  else
+-    {
+-      while (ndim-- > 0)
+-      type = create_array_type (NULL, type, range_types[ndim]);
+-    }
++    for (i = 0; i < ndim; i++)
++      type = create_single_array_dimension (type, range_types[i], die, cu);
++  else /* (read_array_order (die, cu) == DW_ORD_row_major) */
++    for (i = ndim - 1; i >= 0; i--)
++      type = create_single_array_dimension (type, range_types[i], die, cu);
++
++  /* Data locations should be set only for the outermost dimension as they
++     would be confusing for the dereferenced offset on the inner ones.  */
++  attr = dwarf2_attr (die, DW_AT_data_location, cu);
++  if (attr_form_is_block (attr))
++    TYPE_DATA_LOCATION_DWARF_BLOCK (type)
++      = dwarf2_attr_to_locexpr_baton (attr, cu);
++  gdb_assert (!TYPE_DATA_LOCATION_IS_ADDR (type));
+   /* Understand Dwarf2 support for vector types (like they occur on
+      the PowerPC w/ AltiVec).  Gcc just adds another attribute to the
+@@ -8345,29 +8379,114 @@ read_tag_string_type (struct die_info *d
+   struct gdbarch *gdbarch = get_objfile_arch (objfile);
+   struct type *type, *range_type, *index_type, *char_type;
+   struct attribute *attr;
+-  unsigned int length;
++  int length;
++
++  index_type = objfile_type (objfile)->builtin_int;
++  /* RANGE_TYPE is allocated from OBJFILE, not as a permanent type.  */
++  range_type = alloc_type (objfile);
++  /* LOW_BOUND and HIGH_BOUND are set for real below.  */
++  range_type = create_range_type (range_type, index_type, 0, -1);
++
++  /* C/C++ should probably have the low bound 0 but C/C++ does not use
++     DW_TAG_string_type.  */
++  TYPE_LOW_BOUND (range_type) = 1;
+   attr = dwarf2_attr (die, DW_AT_string_length, cu);
+-  if (attr)
++  if (attr && attr_form_is_block (attr))
+     {
+-      length = DW_UNSND (attr);
++      /* Security check for a size overflow.  */
++      if (DW_BLOCK (attr)->size + 2 < DW_BLOCK (attr)->size)
++      TYPE_HIGH_BOUND (range_type) = 1;
++      /* Extend the DWARF block by a new DW_OP_deref/DW_OP_deref_size
++       instruction as DW_AT_string_length specifies the length location, not
++       its value.  */
++      else
++      {
++        struct dwarf2_locexpr_baton *length_baton = NULL;
++        struct dwarf_block *blk = DW_BLOCK (attr);
++
++        /* Turn any single DW_OP_reg* into DW_OP_breg*(0) but clearing
++           DW_OP_deref* in such case.  */
++
++        if (blk->size == 1 && blk->data[0] >= DW_OP_reg0
++            && blk->data[0] <= DW_OP_reg31)
++          length_baton = dwarf2_attr_to_locexpr_baton (attr, cu);
++        else if (blk->size > 1 && blk->data[0] == DW_OP_regx)
++          {
++            ULONGEST ulongest;
++            const gdb_byte *end;
++
++            end = read_uleb128 (&blk->data[1], &blk->data[blk->size],
++                                &ulongest);
++            if (end == &blk->data[blk->size])
++              length_baton = dwarf2_attr_to_locexpr_baton (attr, cu);
++          }
++
++        if (length_baton == NULL)
++          {
++            struct attribute *size_attr;
++            gdb_byte *data;
++
++            length_baton = obstack_alloc (&cu->comp_unit_obstack,
++                                          sizeof (*length_baton));
++            length_baton->per_cu = cu->per_cu;
++            length_baton->size = DW_BLOCK (attr)->size + 2;
++            data = obstack_alloc (&cu->comp_unit_obstack,
++                                  length_baton->size);
++            length_baton->data = data;
++            memcpy (data, DW_BLOCK (attr)->data, DW_BLOCK (attr)->size);
++
++            /* DW_AT_BYTE_SIZE existing together with DW_AT_STRING_LENGTH
++               specifies the size of an integer to fetch.  */
++            size_attr = dwarf2_attr (die, DW_AT_byte_size, cu);
++            if (size_attr)
++              {
++                data[DW_BLOCK (attr)->size] = DW_OP_deref_size;
++                data[DW_BLOCK (attr)->size + 1] = DW_UNSND (size_attr);
++                if (data[DW_BLOCK (attr)->size + 1] != DW_UNSND (size_attr))
++                  complaint (&symfile_complaints,
++                             _("DW_AT_string_length's DW_AT_byte_size "
++                               "integer exceeds the byte size storage"));
++              }
++            else
++              {
++                data[DW_BLOCK (attr)->size] = DW_OP_deref;
++                data[DW_BLOCK (attr)->size + 1] = DW_OP_nop;
++              }
++          }
++
++        TYPE_RANGE_DATA (range_type)->high.kind
++          = RANGE_BOUND_KIND_DWARF_BLOCK;
++        TYPE_RANGE_DATA (range_type)->high.u.dwarf_block = length_baton;
++        TYPE_DYNAMIC (range_type) = 1;
++      }
+     }
+   else
+     {
+-      /* Check for the DW_AT_byte_size attribute.  */
++      if (attr && attr_form_is_constant (attr))
++      {
++        /* We currently do not support a constant address where the location
++           should be read from - attr_form_is_block is expected instead.  See
++           DWARF for the DW_AT_STRING_LENGTH vs. DW_AT_BYTE_SIZE difference.
++           */
++        /* PASSTHRU */
++      }
++
+       attr = dwarf2_attr (die, DW_AT_byte_size, cu);
+-      if (attr)
+-        {
+-          length = DW_UNSND (attr);
+-        }
++      if (attr && attr_form_is_block (attr))
++      {
++        TYPE_RANGE_DATA (range_type)->high.kind
++          = RANGE_BOUND_KIND_DWARF_BLOCK;
++        TYPE_RANGE_DATA (range_type)->high.u.dwarf_block =
++                                      dwarf2_attr_to_locexpr_baton (attr, cu);
++        TYPE_DYNAMIC (range_type) = 1;
++      }
++      else if (attr && attr_form_is_constant (attr))
++      TYPE_HIGH_BOUND (range_type) = dwarf2_get_attr_constant_value (attr, 0);
+       else
+-        {
+-          length = 1;
+-        }
++      TYPE_HIGH_BOUND (range_type) = 1;
+     }
+-  index_type = objfile_type (objfile)->builtin_int;
+-  range_type = create_range_type (NULL, index_type, 1, length);
+   char_type = language_string_char_type (cu->language_defn, gdbarch);
+   type = create_string_type (NULL, char_type, range_type);
+@@ -8658,8 +8777,7 @@ read_subrange_type (struct die_info *die
+   struct type *base_type;
+   struct type *range_type;
+   struct attribute *attr;
+-  LONGEST low = 0;
+-  LONGEST high = -1;
++  LONGEST low;
+   char *name;
+   LONGEST negative_mask;
+@@ -8672,53 +8790,126 @@ read_subrange_type (struct die_info *die
+   if (range_type)
+     return range_type;
+-  if (cu->language == language_fortran)
+-    {
+-      /* FORTRAN implies a lower bound of 1, if not given.  */
+-      low = 1;
+-    }
++  /* LOW_BOUND and HIGH_BOUND are set for real below.  */
++  range_type = create_range_type (NULL, base_type, 0, -1);
++  TYPE_UNSIGNED (range_type) = 0;
+-  /* FIXME: For variable sized arrays either of these could be
+-     a variable rather than a constant value.  We'll allow it,
+-     but we don't know how to handle it.  */
+-  attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
+-  if (attr)
+-    low = dwarf2_get_attr_constant_value (attr, 0);
++  negative_mask = 
++    (LONGEST) -1 << (TYPE_LENGTH (base_type) * TARGET_CHAR_BIT - 1);
+-  attr = dwarf2_attr (die, DW_AT_upper_bound, cu);
+-  if (attr)
++  /* Exclude language_ada from any TYPE_DYNAMIC constructs below.  GDB Ada
++     supports implements the dynamic bounds in a non-DWARF way and the
++     existing DWARF dynamic bounds are invalid, leading to memory access
++     errors.  */
++
++  attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
++  if (attr && attr_form_is_block (attr) && cu->language != language_ada)
+     {
+-      if (attr_form_is_block (attr) || is_ref_attr (attr))
+-        {
+-          /* GCC encodes arrays with unspecified or dynamic length
+-             with a DW_FORM_block1 attribute or a reference attribute.
+-             FIXME: GDB does not yet know how to handle dynamic
+-             arrays properly, treat them as arrays with unspecified
+-             length for now.
+-
+-             FIXME: jimb/2003-09-22: GDB does not really know
+-             how to handle arrays of unspecified length
+-             either; we just represent them as zero-length
+-             arrays.  Choose an appropriate upper bound given
+-             the lower bound we've computed above.  */
+-          high = low - 1;
+-        }
+-      else
+-        high = dwarf2_get_attr_constant_value (attr, 1);
++      TYPE_RANGE_DATA (range_type)->low.kind = RANGE_BOUND_KIND_DWARF_BLOCK;
++      TYPE_RANGE_DATA (range_type)->low.u.dwarf_block =
++                                      dwarf2_attr_to_locexpr_baton (attr, cu);
++      TYPE_DYNAMIC (range_type) = 1;
++      /* For setting a default if DW_AT_UPPER_BOUND would be missing.  */
++      low = 0;
++    }
++  else if (attr && is_ref_attr (attr) && cu->language != language_ada)
++    {
++      struct die_info *target_die;
++      struct dwarf2_cu *target_cu = cu;
++      struct attribute *target_loc_attr;
++
++      target_die = follow_die_ref_or_sig (die, attr, &target_cu);
++      gdb_assert (target_cu->objfile == cu->objfile);
++      target_loc_attr = dwarf2_attr (target_die, DW_AT_location, target_cu);
++
++      TYPE_RANGE_DATA (range_type)->low.kind = RANGE_BOUND_KIND_DWARF_LOCLIST;
++      TYPE_RANGE_DATA (range_type)->low.u.dwarf_loclist.loclist
++        = dwarf2_attr_to_loclist_baton (target_loc_attr, target_cu);
++      TYPE_RANGE_DATA (range_type)->low.u.dwarf_loclist.type
++        = die_type (target_die, target_cu);
++      TYPE_DYNAMIC (range_type) = 1;
++      /* For setting a default if DW_AT_UPPER_BOUND would be missing.  */
++      low = 0;
+     }
+   else
+     {
+-      attr = dwarf2_attr (die, DW_AT_count, cu);
+-      if (attr)
++      if (attr && attr_form_is_constant (attr))
++      low = dwarf2_get_attr_constant_value (attr, 0);
++      else
+       {
+-        int count = dwarf2_get_attr_constant_value (attr, 1);
+-        high = low + count - 1;
++        if (cu->language == language_fortran)
++          {
++            /* FORTRAN implies a lower bound of 1, if not given.  */
++            low = 1;
++          }
++        else
++          {
++            /* According to DWARF we should assume the value 0 only for
++               LANGUAGE_C and LANGUAGE_CPLUS.  */
++            low = 0;
++          }
+       }
++      if (!TYPE_UNSIGNED (base_type) && (low & negative_mask))
++      low |= negative_mask;
++      TYPE_LOW_BOUND (range_type) = low;
++      if (low >= 0)
++      TYPE_UNSIGNED (range_type) = 1;
++    }
++
++  attr = dwarf2_attr (die, DW_AT_upper_bound, cu);
++  if (!attr || (!attr_form_is_block (attr) && !attr_form_is_constant (attr)
++              && !is_ref_attr (attr)))
++    {
++      attr = dwarf2_attr (die, DW_AT_count, cu);
++      /* It does not hurt but it is needlessly ineffective in check_typedef.  */
++      if (attr && (attr_form_is_block (attr) || attr_form_is_constant (attr)))
++              {
++        TYPE_RANGE_HIGH_BOUND_IS_COUNT (range_type) = 1;
++        TYPE_DYNAMIC (range_type) = 1;
++      }
++      /* Pass it now as the regular DW_AT_upper_bound.  */
++    }
++
++  if (attr && attr_form_is_block (attr) && cu->language != language_ada)
++    {
++      TYPE_RANGE_DATA (range_type)->high.kind = RANGE_BOUND_KIND_DWARF_BLOCK;
++      TYPE_RANGE_DATA (range_type)->high.u.dwarf_block =
++                                      dwarf2_attr_to_locexpr_baton (attr, cu);
++      TYPE_DYNAMIC (range_type) = 1;
++    }
++  else if (attr && is_ref_attr (attr) && cu->language != language_ada)
++    {
++      struct die_info *target_die;
++      struct dwarf2_cu *target_cu = cu;
++      struct attribute *target_loc_attr;
++
++      target_die = follow_die_ref_or_sig (die, attr, &target_cu);
++      gdb_assert (target_cu->objfile == cu->objfile);
++      target_loc_attr = dwarf2_attr (target_die, DW_AT_location, target_cu);
++
++      TYPE_RANGE_DATA (range_type)->high.kind = RANGE_BOUND_KIND_DWARF_LOCLIST;
++      TYPE_RANGE_DATA (range_type)->high.u.dwarf_loclist.loclist
++        = dwarf2_attr_to_loclist_baton (target_loc_attr, target_cu);
++      TYPE_RANGE_DATA (range_type)->high.u.dwarf_loclist.type
++        = die_type (target_die, target_cu);
++      TYPE_DYNAMIC (range_type) = 1;
++    }
++  else
++    {
++      LONGEST high;
++
++      if (attr && attr_form_is_constant (attr))
++      high = dwarf2_get_attr_constant_value (attr, 0);
+       else
+       {
+-        /* Unspecified array length.  */
++        /* Ada expects an empty array on no boundary attributes.  */
++        if (cu->language != language_ada)
++          TYPE_HIGH_BOUND_UNDEFINED (range_type) = 1;
+         high = low - 1;
+       }
++      if (!TYPE_UNSIGNED (base_type) && (high & negative_mask))
++      high |= negative_mask;
++      TYPE_HIGH_BOUND (range_type) = high;
+     }
+   /* Dwarf-2 specifications explicitly allows to create subrange types
+@@ -8759,24 +8950,41 @@ read_subrange_type (struct die_info *die
+       }
+     }
+-  negative_mask =
+-    (LONGEST) -1 << (TYPE_LENGTH (base_type) * TARGET_CHAR_BIT - 1);
+-  if (!TYPE_UNSIGNED (base_type) && (low & negative_mask))
+-    low |= negative_mask;
+-  if (!TYPE_UNSIGNED (base_type) && (high & negative_mask))
+-    high |= negative_mask;
+-
+-  range_type = create_range_type (NULL, base_type, low, high);
+-
+-  /* Mark arrays with dynamic length at least as an array of unspecified
+-     length.  GDB could check the boundary but before it gets implemented at
+-     least allow accessing the array elements.  */
+-  if (attr && attr_form_is_block (attr))
+-    TYPE_HIGH_BOUND_UNDEFINED (range_type) = 1;
+-
+-  /* Ada expects an empty array on no boundary attributes.  */
+-  if (attr == NULL && cu->language != language_ada)
+-    TYPE_HIGH_BOUND_UNDEFINED (range_type) = 1;
++  /* DW_AT_bit_stride is currently unsupported as we count in bytes.  */
++  attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
++  if (attr && attr_form_is_block (attr) && cu->language != language_ada)
++    {
++      TYPE_RANGE_DATA (range_type)->byte_stride.kind
++        = RANGE_BOUND_KIND_DWARF_BLOCK;
++      TYPE_RANGE_DATA (range_type)->byte_stride.u.dwarf_block =
++                                      dwarf2_attr_to_locexpr_baton (attr, cu);
++      TYPE_DYNAMIC (range_type) = 1;
++    }
++  else if (attr && is_ref_attr (attr) && cu->language != language_ada)
++    {
++      struct die_info *target_die;
++      struct dwarf2_cu *target_cu = cu;
++      struct attribute *target_loc_attr;
++
++      target_die = follow_die_ref_or_sig (die, attr, &target_cu);
++      gdb_assert (target_cu->objfile == cu->objfile);
++      target_loc_attr = dwarf2_attr (target_die, DW_AT_location, target_cu);
++
++      TYPE_RANGE_DATA (range_type)->byte_stride.kind
++        = RANGE_BOUND_KIND_DWARF_LOCLIST;
++      TYPE_RANGE_DATA (range_type)->byte_stride.u.dwarf_loclist.loclist
++        = dwarf2_attr_to_loclist_baton (target_loc_attr, target_cu);
++      TYPE_RANGE_DATA (range_type)->byte_stride.u.dwarf_loclist.type
++        = die_type (target_die, target_cu);
++      TYPE_DYNAMIC (range_type) = 1;
++    }
++  else if (attr && attr_form_is_constant (attr))
++    {
++      TYPE_BYTE_STRIDE (range_type) = dwarf2_get_attr_constant_value (attr, 0);
++      if (TYPE_BYTE_STRIDE (range_type) == 0)
++      complaint (&symfile_complaints,
++                 _("Found DW_AT_byte_stride with unsupported value 0"));
++    }
+   name = dwarf2_name (die, cu);
+   if (name)
+@@ -11333,10 +11541,12 @@ var_decode_location (struct attribute *a
+      (i.e. when the value of a register or memory location is
+      referenced, or a thread-local block, etc.).  Then again, it might
+      not be worthwhile.  I'm assuming that it isn't unless performance
+-     or memory numbers show me otherwise.  */
++     or memory numbers show me otherwise.
++     
++     SYMBOL_CLASS may get overriden by dwarf2_symbol_mark_computed.  */
+-  dwarf2_symbol_mark_computed (attr, sym, cu);
+   SYMBOL_CLASS (sym) = LOC_COMPUTED;
++  dwarf2_symbol_mark_computed (attr, sym, cu);
+   if (SYMBOL_COMPUTED_OPS (sym) == &dwarf2_loclist_funcs)
+     cu->has_loclist = 1;
+@@ -11377,6 +11587,8 @@ new_symbol_full (struct die_info *die, s
+       else
+       sym = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct symbol);
+       OBJSTAT (objfile, n_syms++);
++      /* Some methods are called w/o checking SYMBOL_COMPUTED_OPS validity.  */
++      SYMBOL_COMPUTED_OPS (sym) = &dwarf2_missing_funcs;
+       /* Cache this symbol's name and the name's demangled form (if any).  */
+       SYMBOL_SET_LANGUAGE (sym, cu->language);
+@@ -12149,6 +12361,9 @@ read_type_die_1 (struct die_info *die, s
+       break;
+     }
++  if (this_type)
++    finalize_type (this_type);
++
+   return this_type;
+ }
+@@ -15324,61 +15539,99 @@ fill_in_loclist_baton (struct dwarf2_cu
+   baton->base_address = cu->base_address;
+ }
+-static void
+-dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym,
+-                           struct dwarf2_cu *cu)
++/* Convert DW_BLOCK into struct dwarf2_locexpr_baton.  ATTR must be a DW_BLOCK
++   attribute type.  */
++
++static struct dwarf2_locexpr_baton *
++dwarf2_attr_to_locexpr_baton (struct attribute *attr, struct dwarf2_cu *cu)
+ {
+-  if (attr_form_is_section_offset (attr)
+-      /* ".debug_loc" may not exist at all, or the offset may be outside
+-       the section.  If so, fall through to the complaint in the
+-       other branch.  */
+-      && DW_UNSND (attr) < dwarf2_section_size (dwarf2_per_objfile->objfile,
+-                                              &dwarf2_per_objfile->loc))
+-    {
+-      struct dwarf2_loclist_baton *baton;
++  struct dwarf2_locexpr_baton *baton;
+-      baton = obstack_alloc (&cu->objfile->objfile_obstack,
+-                           sizeof (struct dwarf2_loclist_baton));
++  gdb_assert (attr_form_is_block (attr));
+-      fill_in_loclist_baton (cu, baton, attr);
++  baton = obstack_alloc (&cu->objfile->objfile_obstack, sizeof (*baton));
++  baton->per_cu = cu->per_cu;
++  gdb_assert (baton->per_cu);
+-      if (cu->base_known == 0)
+-      complaint (&symfile_complaints,
+-                 _("Location list used without "
+-                   "specifying the CU base address."));
++  /* Note that we're just copying the block's data pointer
++     here, not the actual data.  We're still pointing into the
++     info_buffer for SYM's objfile; right now we never release
++     that buffer, but when we do clean up properly this may
++     need to change.  */
++  baton->size = DW_BLOCK (attr)->size;
++  baton->data = DW_BLOCK (attr)->data;
++  gdb_assert (baton->size == 0 || baton->data != NULL);
++  return baton;
++}
++
++static struct dwarf2_loclist_baton *
++dwarf2_attr_to_loclist_baton (struct attribute *attr, struct dwarf2_cu *cu)
++{
++  struct dwarf2_loclist_baton *baton;
++
++  /* DW_AT_location of the referenced DIE may be missing if the referenced
++     variable has been optimized out.  */
++  if (!attr)
++    return NULL;
++
++  dwarf2_read_section (dwarf2_per_objfile->objfile,
++                     &dwarf2_per_objfile->loc);
++
++  if (!(attr_form_is_section_offset (attr)
++      /* ".debug_loc" may not exist at all, or the offset may be outside
++         the section.  If so, fall through to the complaint in the
++         other branch.  */
++      && DW_UNSND (attr) < dwarf2_section_size (dwarf2_per_objfile->objfile,
++                                                &dwarf2_per_objfile->loc)))
++    return NULL;
++
++  baton = obstack_alloc (&cu->objfile->objfile_obstack,
++                       sizeof (struct dwarf2_loclist_baton));
++
++  fill_in_loclist_baton (cu, baton, attr);
++
++  if (cu->base_known == 0)
++    complaint (&symfile_complaints,
++             _("Location list used without "
++               "specifying the CU base address."));
++
++  return baton;
++}
++
++/* SYM may get its SYMBOL_CLASS overriden on invalid ATTR content.  */
++
++static void
++dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym,
++                           struct dwarf2_cu *cu)
++{
++  struct dwarf2_loclist_baton *loclist_baton;
++
++  loclist_baton = dwarf2_attr_to_loclist_baton (attr, cu);
++  if (loclist_baton)
++    {
+       SYMBOL_COMPUTED_OPS (sym) = &dwarf2_loclist_funcs;
+-      SYMBOL_LOCATION_BATON (sym) = baton;
++      SYMBOL_LOCATION_BATON (sym) = loclist_baton;
++    }
++  else if (attr_form_is_block (attr))
++    {
++      SYMBOL_COMPUTED_OPS (sym) = &dwarf2_locexpr_funcs;
++      SYMBOL_LOCATION_BATON (sym) = dwarf2_attr_to_locexpr_baton (attr, cu);
+     }
+   else
+     {
+-      struct dwarf2_locexpr_baton *baton;
++      dwarf2_invalid_attrib_class_complaint ("location description",
++                                           SYMBOL_NATURAL_NAME (sym));
+-      baton = obstack_alloc (&cu->objfile->objfile_obstack,
+-                           sizeof (struct dwarf2_locexpr_baton));
+-      baton->per_cu = cu->per_cu;
+-      gdb_assert (baton->per_cu);
++      /* Some methods are called w/o checking SYMBOL_COMPUTED_OPS validity.  */
+-      if (attr_form_is_block (attr))
+-      {
+-        /* Note that we're just copying the block's data pointer
+-           here, not the actual data.  We're still pointing into the
+-           info_buffer for SYM's objfile; right now we never release
+-           that buffer, but when we do clean up properly this may
+-           need to change.  */
+-        baton->size = DW_BLOCK (attr)->size;
+-        baton->data = DW_BLOCK (attr)->data;
+-      }
+-      else
+-      {
+-        dwarf2_invalid_attrib_class_complaint ("location description",
+-                                               SYMBOL_NATURAL_NAME (sym));
+-        baton->size = 0;
+-        baton->data = NULL;
+-      }
++      SYMBOL_COMPUTED_OPS (sym) = &dwarf2_missing_funcs;
++      SYMBOL_LOCATION_BATON (sym) = NULL;
+-      SYMBOL_COMPUTED_OPS (sym) = &dwarf2_locexpr_funcs;
+-      SYMBOL_LOCATION_BATON (sym) = baton;
++      /* For functions a missing DW_AT_frame_base does not optimize out the
++       whole function definition, only its frame base resolving.  */
++      if (attr->name == DW_AT_location)
++      SYMBOL_CLASS (sym) = LOC_OPTIMIZED_OUT;
+     }
+ }
+@@ -15727,6 +15980,25 @@ offset_and_type_eq (const void *item_lhs
+   return ofs_lhs->offset == ofs_rhs->offset;
+ }
++/* Fill in generic attributes applicable for type DIEs.  */
++
++static void
++fetch_die_type_attrs (struct die_info *die, struct type *type,
++                    struct dwarf2_cu *cu)
++{
++  struct attribute *attr;
++
++  attr = dwarf2_attr (die, DW_AT_allocated, cu);
++  if (attr_form_is_block (attr))
++    TYPE_ALLOCATED (type) = dwarf2_attr_to_locexpr_baton (attr, cu);
++  gdb_assert (!TYPE_NOT_ALLOCATED (type));
++
++  attr = dwarf2_attr (die, DW_AT_associated, cu);
++  if (attr_form_is_block (attr))
++    TYPE_ASSOCIATED (type) = dwarf2_attr_to_locexpr_baton (attr, cu);
++  gdb_assert (!TYPE_NOT_ASSOCIATED (type));
++}
++
+ /* Set the type associated with DIE to TYPE.  Save it in CU's hash
+    table if necessary.  For convenience, return TYPE.
+@@ -15752,6 +16024,8 @@ set_die_type (struct die_info *die, stru
+   struct objfile *objfile = cu->objfile;
+   htab_t *type_hash_ptr;
++  fetch_die_type_attrs (die, type, cu);
++
+   /* For Ada types, make sure that the gnat-specific data is always
+      initialized (if not already set).  There are a few types where
+      we should not be doing so, because the type-specific area is
+Index: gdb-7.3.50.20110722/gdb/elfread.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/elfread.c     2011-05-26 09:47:10.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/elfread.c  2011-07-29 22:52:02.000000000 +0200
+@@ -38,6 +38,8 @@
+ #include "demangle.h"
+ #include "psympriv.h"
+ #include "filenames.h"
++#include "stap-probe.h"
++#include "arch-utils.h"
+ #include "gdbtypes.h"
+ #include "value.h"
+ #include "infcall.h"
+@@ -61,6 +63,21 @@ struct elfinfo
+     asection *mdebugsect;     /* Section pointer for .mdebug section */
+   };
++/* Per-objfile data for SystemTap probe info.  */
++
++static const struct objfile_data *stap_probe_key = NULL;
++
++/* Per-objfile data about SystemTap probes.  */
++
++struct stap_probe_per_objfile
++  {
++    /* The number of probes in this objfile.  */
++    int stap_num_probes;
++
++    /* The probes themselves.  */
++    struct stap_probe *probes;
++  };
++
+ static void free_elfinfo (void *);
+ /* Minimal symbols located at the GOT entries for .plt - that is the real
+@@ -1574,7 +1591,266 @@ elfstab_offset_sections (struct objfile
+     complaint (&symfile_complaints,
+              _("elf/stab section information missing for %s"), filename);
+ }
++
++/* Helper function that parses the information contained in a
++   SystemTap's probe.  Basically, the information consists in:
++
++   - Probe's PC address;
++   - Link-time section address of `.stapsdt.base' section;
++   - Link-time address of the semaphore variable, or ZERO if the
++     probe doesn't have an associated semaphore;
++   - Probe's provider name;
++   - Probe's name;
++   - Probe's argument format.  */
++
++static void
++handle_probe (struct objfile *objfile, struct sdt_note *el,
++            struct stap_probe *ret, CORE_ADDR base)
++{
++  bfd *abfd = objfile->obfd;
++  int size = bfd_get_arch_size (abfd) / 8;
++  struct gdbarch *gdbarch = get_objfile_arch (objfile);
++  struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
++  CORE_ADDR base_ref;
++
++  /* Provider and the name of the probe.  */
++  ret->provider = (const char *) &el->data[3 * size];
++  ret->name = memchr (ret->provider, '\0',
++                    (unsigned long *) el->data
++                    + el->size - (unsigned long *) ret->provider);
++  /* Making sure there is a name.  */
++  if (!ret->name)
++    complaint (&symfile_complaints, _("corrupt probe when reading `%s'"),
++             objfile->name);
++  else
++    ++ret->name;
++
++  /* Retrieving the probe's address.  */
++  ret->address = extract_typed_address ((const gdb_byte *) &el->data[0],
++                                      ptr_type);
++  /* Link-time sh_addr of `.stapsdt.base' section.  */
++  base_ref = extract_typed_address ((const gdb_byte *) &el->data[size],
++                                  ptr_type);
++  /* Semaphore address.  */
++  ret->sem_addr = extract_typed_address ((const gdb_byte *) &el->data[2 * size],
++                                       ptr_type);
++
++  ret->address += (ANOFFSET (objfile->section_offsets,
++                           SECT_OFF_TEXT (objfile))
++                 + base - base_ref);
++  if (ret->sem_addr)
++    ret->sem_addr += (ANOFFSET (objfile->section_offsets,
++                              SECT_OFF_DATA (objfile))
++                    + base - base_ref);
++
++  /* Arguments.  We can only extract the argument format if there is a valid
++     name for this probe.  */
++  if (ret->name)
++    {
++      ret->args = memchr (ret->name, '\0',
++                        (unsigned long *) el->data
++                        + el->size - (unsigned long *) ret->name);
++
++      if (ret->args++ != NULL
++        || memchr (ret->args, '\0', (unsigned long *) el->data
++                   + el->size - (unsigned long *) ret->name)
++        != el->data + el->size - 1)
++      complaint (&symfile_complaints, _("corrupt probe when reading `%s'"),
++                 objfile->name);
++    }
++  else
++    ret->args = NULL;
++}
++
++/* The name of the SystemTap section where we will find information about
++   the probes.  */
++
++#define STAP_BASE_SECTION_NAME ".stapsdt.base"
++
++/* Helper function which tries to find the base address of the SystemTap
++   base section named STAP_BASE_SECTION_NAME.  */
++
++static void
++get_base_address_1 (bfd *abfd, asection *sect, void *obj)
++{
++  bfd_vma *base = (bfd_vma *) obj;
++
++  if (*base == (bfd_vma) -1
++      && (sect->flags & (SEC_DATA | SEC_ALLOC | SEC_HAS_CONTENTS))
++      && sect->name && !strcmp (sect->name, STAP_BASE_SECTION_NAME))
++    *base = sect->vma;
++}
++
++/* Helper function which iterates over every section in the BFD file,
++   trying to find the base address of the SystemTap base section.
++   Returns the section address if found, or -1 otherwise.  */
++
++static bfd_vma
++get_base_address (bfd *obfd)
++{
++  bfd_vma base = (bfd_vma) -1;
++
++  bfd_map_over_sections (obfd, get_base_address_1, (void *) &base);
++
++  return base;
++}
++
++/* Implementation of `sym_get_probes', as documented in symfile.h.  */
++
++static const struct stap_probe *
++elf_get_probes (struct objfile *objfile, int *num_probes)
++{
++  struct stap_probe *ret = NULL;
++  struct stap_probe_per_objfile *probes_per_objfile;
++
++  /* Initially, no probes.  */
++  *num_probes = 0;
++
++  /* Have we parsed this objfile's probes already?  */
++  probes_per_objfile
++    = (struct stap_probe_per_objfile *) objfile_data (objfile,
++                                                    stap_probe_key);
++
++  if (!probes_per_objfile)
++    {
++      /* If we are here, then this is the first time we are parsing the
++       probe's information.  We basically have to count how many probes
++       the objfile has, and then fill in the necessary information
++       for each one.  */
++
++      bfd *obfd = objfile->obfd;
++      bfd_vma base = get_base_address (obfd);
++      struct sdt_note *iter;
++      int i;
++      int n = 0;
++
++      if (! elf_tdata (obfd)->sdt_note_head)
++      /* There isn't any probe here.  */
++      return NULL;
++
++      /* Allocating space for probe info.  */
++      for (iter = elf_tdata (obfd)->sdt_note_head;
++         iter;
++         iter = iter->next, ++n);
++
++      ret = xcalloc (n, sizeof (struct stap_probe));
++
++      /* Parsing each probe's information.  */
++      for (iter = elf_tdata (obfd)->sdt_note_head, i = 0;
++         iter;
++         iter = iter->next, i++)
++      /* We first have to handle all the information about the
++         probe which is present in the section.  */
++      handle_probe (objfile, iter, &ret[i], base);
++
++      /* Creating a cache for these probes in the objfile's registry.  */
++      probes_per_objfile = xmalloc (sizeof (struct stap_probe_per_objfile));
++
++      probes_per_objfile->stap_num_probes = n;
++      probes_per_objfile->probes = ret;
++
++      set_objfile_data (objfile, stap_probe_key, probes_per_objfile);
++    }
++  else
++    ret = probes_per_objfile->probes;
++
++  *num_probes = probes_per_objfile->stap_num_probes;
++
++  return ret;
++}
++
++/* Implementation of `sym_get_probe_argument_count', as documented in
++   symfile.h.  */
++
++static int
++elf_get_probe_argument_count (struct objfile *objfile,
++                            const struct stap_probe *probe)
++{
++  const char *pargs = probe->args;
++
++  if (!pargs || !*pargs || *pargs == ':')
++    /* No arguments.  */
++    return 0;
++
++  return stap_get_probe_argument_count (probe);
++}
++
++/* Implementation of `sym_evaluate_probe_argument', as documented in
++   symfile.h.  */
++
++static struct value *
++elf_evaluate_probe_argument (struct objfile *objfile,
++                           const struct stap_probe *probe,
++                           struct frame_info *frame,
++                           int n)
++{
++  return stap_evaluate_probe_argument (objfile, probe, frame, n);
++}
++
++/* Implementation of `sym_compile_to_ax', as documented in symfile.h.  */
++
++static void
++elf_compile_to_ax (struct objfile *objfile,
++                 const struct stap_probe *probe,
++                 struct agent_expr *expr,
++                 struct axs_value *value,
++                 int n)
++{
++  stap_compile_to_ax (objfile, probe, expr, value, n);
++}
++
++/* Implementation of `sym_relocate_probe', as documented in symfile.h.  */
++
++static void
++elf_symfile_relocate_probe (struct objfile *objfile,
++                          struct section_offsets *new_offsets,
++                          struct section_offsets *delta)
++{
++  int i;
++  struct stap_probe_per_objfile *p
++    = (struct stap_probe_per_objfile *) objfile_data (objfile,
++                                                    stap_probe_key);
++
++  if (!p)
++    /* No probe to relocate.  */
++    return;
++
++  for (i = 0; i < p->stap_num_probes; i++)
++    {
++      p->probes[i].address += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
++      if (p->probes[i].sem_addr)
++      p->probes[i].sem_addr += ANOFFSET (delta, SECT_OFF_DATA (objfile));
++    }
++}
++
++/* Helper function used to free the space allocated for storing SystemTap
++   probe information.  */
++
++static void
++stap_probe_key_free (struct objfile *objfile, void *d)
++{
++  int i;
++  struct stap_probe_per_objfile *data = (struct stap_probe_per_objfile *) d;
++
++  for (i = 0; i < data->stap_num_probes; i++)
++    stap_free_parsed_args (data->probes[i].parsed_args);
++  xfree (data->probes);
++  xfree (data);
++}
++
\f
++
++/* Implementation `sym_probe_fns', as documented in symfile.h.  */
++
++static const struct sym_probe_fns elf_probe_fns =
++{
++  elf_get_probes,             /* sym_get_probes */
++  elf_get_probe_argument_count,       /* sym_get_probe_argument_count */
++  elf_evaluate_probe_argument,        /* sym_evaluate_probe_argument */
++  elf_compile_to_ax,          /* sym_compile_to_ax */
++  elf_symfile_relocate_probe, /* sym_relocate_probe */
++};
++
+ /* Register that we are able to handle ELF object file formats.  */
+ static const struct sym_fns elf_sym_fns =
+@@ -1589,6 +1865,7 @@ static const struct sym_fns elf_sym_fns
+   elf_symfile_segments,               /* Get segment information from a file.  */
+   NULL,
+   default_symfile_relocate,   /* Relocate a debug section.  */
++  &elf_probe_fns,             /* sym_probe_fns */
+   &psym_functions
+ };
+@@ -1607,6 +1884,7 @@ static const struct sym_fns elf_sym_fns_
+   elf_symfile_segments,               /* Get segment information from a file.  */
+   NULL,
+   default_symfile_relocate,   /* Relocate a debug section.  */
++  &elf_probe_fns,             /* sym_probe_fns */
+   &psym_functions
+ };
+@@ -1624,6 +1902,7 @@ static const struct sym_fns elf_sym_fns_
+   elf_symfile_segments,               /* Get segment information from a file.  */
+   NULL,
+   default_symfile_relocate,   /* Relocate a debug section.  */
++  &elf_probe_fns,             /* sym_probe_fns */
+   &dwarf2_gdb_index_functions
+ };
+@@ -1640,6 +1919,8 @@ static const struct gnu_ifunc_fns elf_gn
+ void
+ _initialize_elfread (void)
+ {
++  stap_probe_key
++    = register_objfile_data_with_cleanup (NULL, stap_probe_key_free);
+   add_symtab_fns (&elf_sym_fns);
+   elf_objfile_gnu_ifunc_cache_data = register_objfile_data ();
+Index: gdb-7.3.50.20110722/gdb/eval.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/eval.c        2011-06-17 22:35:09.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/eval.c     2011-07-29 22:52:02.000000000 +0200
+@@ -44,6 +44,7 @@
+ #include "objfiles.h"
+ #include "python/python.h"
+ #include "wrapper.h"
++#include "dwarf2loc.h"
+ #include "gdb_assert.h"
+@@ -489,27 +490,217 @@ init_array_element (struct value *array,
+ }
+ static struct value *
+-value_f90_subarray (struct value *array,
+-                  struct expression *exp, int *pos, enum noside noside)
++value_f90_subarray (struct value *array, struct expression *exp, int *pos,
++                  int nargs, enum noside noside)
+ {
+-  int pc = (*pos) + 1;
+-  LONGEST low_bound, high_bound;
+-  struct type *range = check_typedef (TYPE_INDEX_TYPE (value_type (array)));
+-  enum f90_range_type range_type = longest_to_int (exp->elts[pc].longconst);
+- 
+-  *pos += 3;
++  /* Type to use for the newly allocated value ARRAY.  */
++  struct type *new_array_type;
+-  if (range_type == LOW_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT)
+-    low_bound = TYPE_LOW_BOUND (range);
++  /* Type being iterated for each dimension.  */
++  struct type *type, *type_last_target;
++
++  /* Pointer in the last holder to the type of current dimension.  */
++  struct type **typep = &new_array_type;
++
++  struct subscript_index
++    {
++      enum { SUBSCRIPT_RANGE, SUBSCRIPT_NUMBER } kind;
++      union
++      {
++        struct subscript_range
++          {
++            enum f90_range_type f90_range_type;
++            LONGEST low_bound, high_bound;
++          }
++        range;
++        LONGEST number;
++      };
++    }
++  *subscript_array;
++  struct type **type_array;
++  int i;
++  struct cleanup *old_chain;
++  CORE_ADDR value_byte_address, value_byte_offset = 0;
++  htab_t copied_types;
++  struct value *saved_array;
++
++  old_chain = make_cleanup (null_cleanup, 0);
++  object_address_set (value_raw_address (array));
++
++  if (value_optimized_out (array)
++      || (VALUE_LVAL (array) != not_lval
++          && VALUE_LVAL (array) != lval_memory
++        && VALUE_LVAL (array) != lval_internalvar_component
++        && VALUE_LVAL (array) != lval_internalvar))
++    error (_("value being subranged must be in memory"));
++  type = check_typedef (value_type (array));
++  f_object_address_data_valid_or_error (type);
++
++  copied_types = create_copied_types_hash (NULL);
++  type = copy_type_recursive (type, copied_types);
++  htab_delete (copied_types);
++
++  if (nargs != calc_f77_array_dims (type))
++    error (_("Wrong number of subscripts"));
++
++  if (TYPE_DATA_LOCATION_IS_ADDR (type))
++    {
++      value_byte_address = (TYPE_DATA_LOCATION_ADDR (type)
++                          + value_offset (array));
++      TYPE_DATA_LOCATION_IS_ADDR (type) = 0;
++      TYPE_DATA_LOCATION_DWARF_BLOCK (type) = NULL;
++    }
+   else
+-    low_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
++    {
++      gdb_assert (TYPE_DATA_LOCATION_DWARF_BLOCK (type) == NULL);
++      value_byte_address = value_address (array);
++    }
++
++  new_array_type = type;
++
++  subscript_array = alloca (sizeof (*subscript_array) * nargs);
++
++  gdb_assert (nargs > 0);
++
++  /* Now that we know we have a legal array subscript expression 
++     let us actually find out where this element exists in the array.  */
++
++  /* Take array indices left to right.  */
++  for (i = 0; i < nargs; i++)
++    {
++      struct subscript_index *index = &subscript_array[i];
++
++      if (exp->elts[*pos].opcode == OP_F90_RANGE)
++      {
++        int pc = (*pos) + 1;
++        struct subscript_range *range;
++
++        index->kind = SUBSCRIPT_RANGE;
++        range = &index->range;
++
++        *pos += 3;
++        range->f90_range_type = longest_to_int (exp->elts[pc].longconst);
++
++        if (range->f90_range_type == HIGH_BOUND_DEFAULT
++            || range->f90_range_type == NONE_BOUND_DEFAULT)
++          range->low_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp,
++                                                             pos, noside));
++
++        if (range->f90_range_type == LOW_BOUND_DEFAULT
++            || range->f90_range_type == NONE_BOUND_DEFAULT)
++          range->high_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp,
++                                                              pos, noside));
++      }
++      else
++      {
++        struct value *val;
++
++        index->kind = SUBSCRIPT_NUMBER;
+-  if (range_type == HIGH_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT)
+-    high_bound = TYPE_HIGH_BOUND (range);
++        /* Evaluate each subscript; it must be a legal integer in F77.  */
++        val = evaluate_subexp_with_coercion (exp, pos, noside);
++        index->number = value_as_long (val);
++      }
++    }
++
++  /* Internal type of array is arranged right to left.  */
++  for (i = nargs - 1; i >= 0; i--)
++    {
++      struct subscript_index *index = &subscript_array[i];
++      struct type *range_type = TYPE_INDEX_TYPE (type);
++
++      switch (index->kind)
++      {
++      case SUBSCRIPT_RANGE:
++        {
++          struct subscript_range *range = &index->range;
++          CORE_ADDR byte_offset;
++
++          if (range->f90_range_type == LOW_BOUND_DEFAULT
++              || range->f90_range_type == BOTH_BOUND_DEFAULT)
++            range->low_bound = TYPE_LOW_BOUND (range_type);
++
++          if (range->f90_range_type == HIGH_BOUND_DEFAULT
++              || range->f90_range_type == BOTH_BOUND_DEFAULT)
++            range->high_bound = TYPE_HIGH_BOUND (range_type);
++
++          if (range->low_bound < TYPE_LOW_BOUND (range_type)
++              || (!TYPE_HIGH_BOUND_UNDEFINED (range_type)
++                  && range->high_bound > TYPE_HIGH_BOUND (range_type)))
++            error (_("slice out of range"));
++
++          byte_offset = ((range->low_bound - TYPE_LOW_BOUND (range_type))
++                         * TYPE_ARRAY_BYTE_STRIDE_VALUE (type));
++          TYPE_LOW_BOUND (range_type) = range->low_bound;
++          TYPE_HIGH_BOUND (range_type) = range->high_bound;
++          if (range->f90_range_type == LOW_BOUND_DEFAULT
++              || range->f90_range_type == NONE_BOUND_DEFAULT)
++            TYPE_HIGH_BOUND_UNDEFINED (range_type) = 0;
++
++          typep = &TYPE_TARGET_TYPE (type);
++          value_byte_offset += byte_offset;
++          type = TYPE_TARGET_TYPE (type);
++        }
++        break;
++
++      case SUBSCRIPT_NUMBER:
++        {
++          CORE_ADDR byte_offset;
++
++          if (index->number < TYPE_LOW_BOUND (range_type)
++              || (!TYPE_HIGH_BOUND_UNDEFINED (range_type)
++                  && index->number > TYPE_HIGH_BOUND (range_type)))
++            error (_("no such vector element"));
++
++          byte_offset = ((index->number - TYPE_LOW_BOUND (range_type))
++                         * TYPE_ARRAY_BYTE_STRIDE_VALUE (type));
++
++          type = TYPE_TARGET_TYPE (type);
++          *typep = type;
++          value_byte_offset += byte_offset;
++        }
++        break;
++      }
++    }
++
++  type_last_target = type;
++  type_array = alloca (sizeof (*type_array) * nargs);
++  i = 0;
++  for (type = new_array_type; type != type_last_target;
++       type = TYPE_TARGET_TYPE (type))
++    type_array[i++] = type;
++  while (i > 0)
++    {
++      struct type *type = type_array[--i];
++
++      /* Force TYPE_LENGTH (type) recalculation.  */
++      TYPE_TARGET_STUB (type) = 1;
++      check_typedef (type);
++    }
++
++  saved_array = array;
++  array = allocate_value_lazy (new_array_type);
++  VALUE_LVAL (array) = VALUE_LVAL (saved_array);
++  if (VALUE_LVAL (saved_array) == lval_internalvar_component)
++    VALUE_LVAL (array) = lval_internalvar;
+   else
+-    high_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
++    VALUE_LVAL (array) = VALUE_LVAL (saved_array);
++  VALUE_FRAME_ID (array) = VALUE_FRAME_ID (saved_array);
++  if (VALUE_LVAL (array) != lval_internalvar)
++    set_value_address (array, value_byte_address + value_byte_offset);
+-  return value_slice (array, low_bound, high_bound - low_bound + 1);
++  if (!value_lazy (saved_array))
++    {
++      allocate_value_contents (array);
++      set_value_lazy (array, 0);
++
++      memcpy (value_contents_writeable (array),
++            value_contents (saved_array) + value_byte_offset,
++            TYPE_LENGTH (new_array_type));
++    }
++
++  do_cleanups (old_chain);
++  return array;
+ }
+@@ -790,6 +981,7 @@ evaluate_subexp_standard (struct type *e
+   int save_pos1;
+   struct symbol *function = NULL;
+   char *function_name = NULL;
++  struct cleanup *old_chain;
+   pc = (*pos)++;
+   op = exp->elts[pc].opcode;
+@@ -1862,6 +2054,8 @@ evaluate_subexp_standard (struct type *e
+       /* First determine the type code we are dealing with.  */
+       arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
++      old_chain = make_cleanup (null_cleanup, 0);
++      object_address_set (value_raw_address (arg1));
+       type = check_typedef (value_type (arg1));
+       code = TYPE_CODE (type);
+@@ -1882,23 +2076,13 @@ evaluate_subexp_standard (struct type *e
+             code = TYPE_CODE (type);
+           }
+       } 
++      do_cleanups (old_chain);
+       switch (code)
+       {
+       case TYPE_CODE_ARRAY:
+-        if (exp->elts[*pos].opcode == OP_F90_RANGE)
+-          return value_f90_subarray (arg1, exp, pos, noside);
+-        else
+-          goto multi_f77_subscript;
+-
+       case TYPE_CODE_STRING:
+-        if (exp->elts[*pos].opcode == OP_F90_RANGE)
+-          return value_f90_subarray (arg1, exp, pos, noside);
+-        else
+-          {
+-            arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
+-            return value_subscript (arg1, value_as_long (arg2));
+-          }
++        return value_f90_subarray (arg1, exp, pos, nargs, noside);
+       case TYPE_CODE_PTR:
+       case TYPE_CODE_FUNC:
+@@ -2337,49 +2521,6 @@ evaluate_subexp_standard (struct type *e
+       }
+       return (arg1);
+-    multi_f77_subscript:
+-      {
+-      LONGEST subscript_array[MAX_FORTRAN_DIMS];
+-      int ndimensions = 1, i;
+-      struct value *array = arg1;
+-
+-      if (nargs > MAX_FORTRAN_DIMS)
+-        error (_("Too many subscripts for F77 (%d Max)"), MAX_FORTRAN_DIMS);
+-
+-      ndimensions = calc_f77_array_dims (type);
+-
+-      if (nargs != ndimensions)
+-        error (_("Wrong number of subscripts"));
+-
+-      gdb_assert (nargs > 0);
+-
+-      /* Now that we know we have a legal array subscript expression 
+-         let us actually find out where this element exists in the array.  */
+-
+-      /* Take array indices left to right.  */
+-      for (i = 0; i < nargs; i++)
+-        {
+-          /* Evaluate each subscript; it must be a legal integer in F77.  */
+-          arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
+-
+-          /* Fill in the subscript array.  */
+-
+-          subscript_array[i] = value_as_long (arg2);
+-        }
+-
+-      /* Internal type of array is arranged right to left.  */
+-      for (i = nargs; i > 0; i--)
+-        {
+-          struct type *array_type = check_typedef (value_type (array));
+-          LONGEST index = subscript_array[i - 1];
+-
+-          lower = f77_get_lowerbound (array_type);
+-          array = value_subscripted_rvalue (array, index, lower);
+-        }
+-
+-      return array;
+-      }
+-
+     case BINOP_LOGICAL_AND:
+       arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+       if (noside == EVAL_SKIP)
+@@ -2611,15 +2752,23 @@ evaluate_subexp_standard (struct type *e
+       if (expect_type && TYPE_CODE (expect_type) == TYPE_CODE_PTR)
+       expect_type = TYPE_TARGET_TYPE (check_typedef (expect_type));
+       arg1 = evaluate_subexp (expect_type, exp, pos, noside);
++      old_chain = make_cleanup (null_cleanup, 0);
++      object_address_set (value_raw_address (arg1));
+       type = check_typedef (value_type (arg1));
+       if (TYPE_CODE (type) == TYPE_CODE_METHODPTR
+         || TYPE_CODE (type) == TYPE_CODE_MEMBERPTR)
+       error (_("Attempt to dereference pointer "
+                "to member without an object"));
+       if (noside == EVAL_SKIP)
+-      goto nosideret;
++      {
++        do_cleanups (old_chain);
++        goto nosideret;
++      }
+       if (unop_user_defined_p (op, arg1))
+-      return value_x_unop (arg1, op, noside);
++      {
++        do_cleanups (old_chain);
++        return value_x_unop (arg1, op, noside);
++      }
+       else if (noside == EVAL_AVOID_SIDE_EFFECTS)
+       {
+         type = check_typedef (value_type (arg1));
+@@ -2628,12 +2777,18 @@ evaluate_subexp_standard (struct type *e
+         /* In C you can dereference an array to get the 1st elt.  */
+             || TYPE_CODE (type) == TYPE_CODE_ARRAY
+           )
+-          return value_zero (TYPE_TARGET_TYPE (type),
+-                             lval_memory);
++          {
++            do_cleanups (old_chain);
++            return value_zero (TYPE_TARGET_TYPE (type),
++                               lval_memory);
++          }
+         else if (TYPE_CODE (type) == TYPE_CODE_INT)
+-          /* GDB allows dereferencing an int.  */
+-          return value_zero (builtin_type (exp->gdbarch)->builtin_int,
+-                             lval_memory);
++          {
++            do_cleanups (old_chain);
++            /* GDB allows dereferencing an int.  */
++            return value_zero (builtin_type (exp->gdbarch)->builtin_int,
++                               lval_memory);
++          }
+         else
+           error (_("Attempt to take contents of a non-pointer value."));
+       }
+@@ -2643,9 +2798,14 @@ evaluate_subexp_standard (struct type *e
+        do.  "long long" variables are rare enough that
+        BUILTIN_TYPE_LONGEST would seem to be a mistake.  */
+       if (TYPE_CODE (type) == TYPE_CODE_INT)
+-      return value_at_lazy (builtin_type (exp->gdbarch)->builtin_int,
+-                            (CORE_ADDR) value_as_address (arg1));
+-      return value_ind (arg1);
++      {
++        do_cleanups (old_chain);
++        return value_at_lazy (builtin_type (exp->gdbarch)->builtin_int,
++                              (CORE_ADDR) value_as_address (arg1));
++      }
++      arg1 = value_ind (arg1);
++      do_cleanups (old_chain);
++      return arg1;
+     case UNOP_ADDR:
+       /* C++: check for and handle pointer to members.  */
+@@ -2987,7 +3147,7 @@ evaluate_subexp_with_coercion (struct ex
+ {
+   enum exp_opcode op;
+   int pc;
+-  struct value *val;
++  struct value *val = NULL;
+   struct symbol *var;
+   struct type *type;
+@@ -2998,13 +3158,18 @@ evaluate_subexp_with_coercion (struct ex
+     {
+     case OP_VAR_VALUE:
+       var = exp->elts[pc + 2].symbol;
++      /* address_of_variable will call object_address_set for check_typedef.
++       Call it only if required as it can error-out on VAR in register.  */
++      if (TYPE_DYNAMIC (SYMBOL_TYPE (var)))
++      val = address_of_variable (var, exp->elts[pc + 1].block);
+       type = check_typedef (SYMBOL_TYPE (var));
+       if (TYPE_CODE (type) == TYPE_CODE_ARRAY
+         && !TYPE_VECTOR (type)
+         && CAST_IS_CONVERSION (exp->language_defn))
+       {
+         (*pos) += 4;
+-        val = address_of_variable (var, exp->elts[pc + 1].block);
++        if (!val)
++          val = address_of_variable (var, exp->elts[pc + 1].block);
+         return value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
+                            val);
+       }
+@@ -3056,9 +3221,13 @@ evaluate_subexp_for_sizeof (struct expre
+     case OP_VAR_VALUE:
+       (*pos) += 4;
+-      type = check_typedef (SYMBOL_TYPE (exp->elts[pc + 2].symbol));
+-      return
+-      value_from_longest (size_type, (LONGEST) TYPE_LENGTH (type));
++      /* We do not need to call read_var_value but the object evaluation may
++       need to have executed object_address_set which needs valid
++       SYMBOL_VALUE_ADDRESS of the symbol.  Still VALUE returned by
++       read_var_value we left as lazy.  */
++      type = value_type (read_var_value (exp->elts[pc + 2].symbol,
++                                      deprecated_safe_get_selected_frame ()));
++      return value_from_longest (size_type, (LONGEST) TYPE_LENGTH (type));
+     default:
+       val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
+@@ -3089,18 +3258,25 @@ parse_and_eval_type (char *p, int length
+ int
+ calc_f77_array_dims (struct type *array_type)
+ {
+-  int ndimen = 1;
+-  struct type *tmp_type;
++  switch (TYPE_CODE (array_type))
++    {
++    case TYPE_CODE_STRING:
++      return 1;
+-  if ((TYPE_CODE (array_type) != TYPE_CODE_ARRAY))
+-    error (_("Can't get dimensions for a non-array type"));
++    case TYPE_CODE_ARRAY:
++      {
++      int ndimen = 1;
+-  tmp_type = array_type;
++      while ((array_type = TYPE_TARGET_TYPE (array_type)))
++        {
++          if (TYPE_CODE (array_type) == TYPE_CODE_ARRAY)
++            ++ndimen;
++        }
++      return ndimen;
++      }
+-  while ((tmp_type = TYPE_TARGET_TYPE (tmp_type)))
+-    {
+-      if (TYPE_CODE (tmp_type) == TYPE_CODE_ARRAY)
+-      ++ndimen;
++    default:
++      error (_("Can't get dimensions for a non-array/non-string type"));
+     }
+-  return ndimen;
++
+ }
+Index: gdb-7.3.50.20110722/gdb/f-exp.y
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/f-exp.y       2011-04-19 20:04:07.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/f-exp.y    2011-07-29 22:52:02.000000000 +0200
+@@ -293,7 +293,9 @@ arglist :  subrange
+                       { arglist_len = 1; }
+       ;
+    
+-arglist       :       arglist ',' exp   %prec ABOVE_COMMA
++arglist       :       arglist ',' exp       %prec ABOVE_COMMA
++                      { arglist_len++; }
++      |       arglist ',' subrange  %prec ABOVE_COMMA
+                       { arglist_len++; }
+       ;
+Index: gdb-7.3.50.20110722/gdb/f-lang.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/f-lang.h      2011-01-07 20:36:16.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/f-lang.h   2011-07-29 22:52:02.000000000 +0200
+@@ -28,6 +28,10 @@ extern void f_error (char *);       /* Defined
+ extern void f_print_type (struct type *, const char *, struct ui_file *, int,
+                         int);
++extern const char *f_object_address_data_valid_print_to_stream
++  (struct type *type, struct ui_file *stream);
++extern void f_object_address_data_valid_or_error (struct type *type);
++
+ extern int f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
+                       struct ui_file *, int,
+                       const struct value *,
+Index: gdb-7.3.50.20110722/gdb/f-typeprint.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/f-typeprint.c 2011-06-29 17:32:39.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/f-typeprint.c      2011-07-29 22:52:02.000000000 +0200
+@@ -32,7 +32,7 @@
+ #include "gdbcore.h"
+ #include "target.h"
+ #include "f-lang.h"
+-
++#include "dwarf2loc.h"
+ #include "gdb_string.h"
+ #include <errno.h>
+@@ -49,6 +49,34 @@ void f_type_print_varspec_prefix (struct
+ void f_type_print_base (struct type *, struct ui_file *, int, int);
\f
++const char *
++f_object_address_data_valid_print_to_stream (struct type *type,
++                                           struct ui_file *stream)
++{
++  const char *msg;
++
++  msg = object_address_data_not_valid (type);
++  if (msg != NULL)
++    {
++      /* Assuming the content printed to STREAM should not be localized.  */
++      fprintf_filtered (stream, "<%s>", msg);
++    }
++
++  return msg;
++}
++
++void
++f_object_address_data_valid_or_error (struct type *type)
++{
++  const char *msg;
++
++  msg = object_address_data_not_valid (type);
++  if (msg != NULL)
++    {
++      error (_("Cannot access it because the %s."), _(msg));
++    }
++}
++
+ /* LEVEL is the depth to indent lines by.  */
+ void
+@@ -58,6 +86,9 @@ f_print_type (struct type *type, const c
+   enum type_code code;
+   int demangled_args;
++  if (f_object_address_data_valid_print_to_stream (type, stream) != NULL)
++    return;
++
+   f_type_print_base (type, stream, show, level);
+   code = TYPE_CODE (type);
+   if ((varstring != NULL && *varstring != '\0')
+@@ -165,6 +196,9 @@ f_type_print_varspec_suffix (struct type
+   QUIT;
++  if (TYPE_CODE (type) != TYPE_CODE_TYPEDEF)
++    CHECK_TYPEDEF (type);
++
+   switch (TYPE_CODE (type))
+     {
+     case TYPE_CODE_ARRAY:
+Index: gdb-7.3.50.20110722/gdb/f-valprint.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/f-valprint.c  2011-06-29 17:32:39.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/f-valprint.c       2011-07-29 22:52:02.000000000 +0200
+@@ -54,15 +54,17 @@ int f77_array_offset_tbl[MAX_FORTRAN_DIM
+ /* The following macro gives us the size of the nth dimension, Where 
+    n is 1 based.  */
+-#define F77_DIM_SIZE(n) (f77_array_offset_tbl[n][1])
++#define F77_DIM_COUNT(n) (f77_array_offset_tbl[n][1])
+-/* The following gives us the offset for row n where n is 1-based.  */
++/* The following gives us the element size for row n where n is 1-based.  */
+-#define F77_DIM_OFFSET(n) (f77_array_offset_tbl[n][0])
++#define F77_DIM_BYTE_STRIDE(n) (f77_array_offset_tbl[n][0])
+ int
+ f77_get_lowerbound (struct type *type)
+ {
++  f_object_address_data_valid_or_error (type);
++
+   if (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED (type))
+     error (_("Lower bound may not be '*' in F77"));
+@@ -72,14 +74,17 @@ f77_get_lowerbound (struct type *type)
+ int
+ f77_get_upperbound (struct type *type)
+ {
++  f_object_address_data_valid_or_error (type);
++
+   if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
+     {
+-      /* We have an assumed size array on our hands.  Assume that
+-       upper_bound == lower_bound so that we show at least 1 element.
+-       If the user wants to see more elements, let him manually ask for 'em
+-       and we'll subscript the array and show him.  */
++      /* We have an assumed size array on our hands.  As type_length_get
++       already assumes a length zero of arrays with underfined bounds VALADDR
++       passed to the Fortran functions does not contained the real inferior
++       memory content.  User should request printing of specific array
++       elements instead.  */
+-      return f77_get_lowerbound (type);
++      return f77_get_lowerbound (type) - 1;
+     }
+   return TYPE_ARRAY_UPPER_BOUND_VALUE (type);
+@@ -135,24 +140,29 @@ f77_create_arrayprint_offset_tbl (struct
+       upper = f77_get_upperbound (tmp_type);
+       lower = f77_get_lowerbound (tmp_type);
+-      F77_DIM_SIZE (ndimen) = upper - lower + 1;
++      F77_DIM_COUNT (ndimen) = upper - lower + 1;
++
++      F77_DIM_BYTE_STRIDE (ndimen) =
++        TYPE_ARRAY_BYTE_STRIDE_VALUE (tmp_type);
+       tmp_type = TYPE_TARGET_TYPE (tmp_type);
+       ndimen++;
+     }
+-  /* Now we multiply eltlen by all the offsets, so that later we 
++  /* Now we multiply eltlen by all the BYTE_STRIDEs, so that later we
+      can print out array elements correctly.  Up till now we 
+-     know an offset to apply to get the item but we also 
++     know an eltlen to apply to get the item but we also 
+      have to know how much to add to get to the next item.  */
+   ndimen--;
+   eltlen = TYPE_LENGTH (tmp_type);
+-  F77_DIM_OFFSET (ndimen) = eltlen;
++  if (F77_DIM_BYTE_STRIDE (ndimen) == 0)
++    F77_DIM_BYTE_STRIDE (ndimen) = eltlen;
+   while (--ndimen > 0)
+     {
+-      eltlen *= F77_DIM_SIZE (ndimen + 1);
+-      F77_DIM_OFFSET (ndimen) = eltlen;
++      eltlen *= F77_DIM_COUNT (ndimen + 1);
++      if (F77_DIM_BYTE_STRIDE (ndimen) == 0)
++      F77_DIM_BYTE_STRIDE (ndimen) = eltlen;
+     }
+ }
+@@ -174,37 +184,35 @@ f77_print_array_1 (int nss, int ndimensi
+   if (nss != ndimensions)
+     {
+-      for (i = 0;
+-         (i < F77_DIM_SIZE (nss) && (*elts) < options->print_max);
+-         i++)
++      for (i = 0; (i < F77_DIM_COUNT (nss) && (*elts) < options->print_max); i++)
+       {
+         fprintf_filtered (stream, "( ");
+         f77_print_array_1 (nss + 1, ndimensions, TYPE_TARGET_TYPE (type),
+                            valaddr,
+-                           embedded_offset + i * F77_DIM_OFFSET (nss),
++                           embedded_offset + i * F77_DIM_BYTE_STRIDE (nss),
+                            address,
+                            stream, recurse, val, options, elts);
+         fprintf_filtered (stream, ") ");
+       }
+-      if (*elts >= options->print_max && i < F77_DIM_SIZE (nss)) 
++      if (*elts >= options->print_max && i < F77_DIM_COUNT (nss))
+       fprintf_filtered (stream, "...");
+     }
+   else
+     {
+-      for (i = 0; i < F77_DIM_SIZE (nss) && (*elts) < options->print_max;
++      for (i = 0; i < F77_DIM_COUNT (nss) && (*elts) < options->print_max;
+          i++, (*elts)++)
+       {
+         val_print (TYPE_TARGET_TYPE (type),
+                    valaddr,
+-                   embedded_offset + i * F77_DIM_OFFSET (ndimensions),
++                   embedded_offset + i * F77_DIM_BYTE_STRIDE (ndimensions),
+                    address, stream, recurse,
+                    val, options, current_language);
+-        if (i != (F77_DIM_SIZE (nss) - 1))
++        if (i != (F77_DIM_COUNT (nss) - 1))
+           fprintf_filtered (stream, ", ");
+         if ((*elts == options->print_max - 1)
+-            && (i != (F77_DIM_SIZE (nss) - 1)))
++            && (i != (F77_DIM_COUNT (nss) - 1)))
+           fprintf_filtered (stream, "...");
+       }
+     }
+@@ -260,6 +268,9 @@ f_val_print (struct type *type, const gd
+   CORE_ADDR addr;
+   int index;
++  if (f_object_address_data_valid_print_to_stream (type, stream) != NULL)
++    return 0;
++
+   CHECK_TYPEDEF (type);
+   switch (TYPE_CODE (type))
+     {
+Index: gdb-7.3.50.20110722/gdb/findvar.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/findvar.c     2011-07-12 23:16:48.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/findvar.c  2011-07-29 22:52:44.000000000 +0200
+@@ -35,6 +35,7 @@
+ #include "user-regs.h"
+ #include "block.h"
+ #include "objfiles.h"
++#include "dwarf2loc.h"
+ /* Basic byte-swapping routines.  All 'extract' functions return a
+    host-format integer from a target-format integer at ADDR which is
+@@ -408,8 +409,11 @@ symbol_read_needs_frame (struct symbol *
+ /* Given a struct symbol for a variable,
+    and a stack frame id, read the value of the variable
+-   and return a (pointer to a) struct value containing the value.
+-   If the variable cannot be found, return a zero pointer.  */
++   and return a (pointer to a) struct value containing the value. 
++   If the variable cannot be found, return a zero pointer.
++   We have to first find the address of the variable before allocating struct
++   value to return as its size may depend on DW_OP_PUSH_OBJECT_ADDRESS possibly
++   used by its type.  */
+ struct value *
+ read_var_value (struct symbol *var, struct frame_info *frame)
+@@ -417,16 +421,6 @@ read_var_value (struct symbol *var, stru
+   struct value *v;
+   struct type *type = SYMBOL_TYPE (var);
+   CORE_ADDR addr;
+-  int len;
+-
+-  /* Call check_typedef on our type to make sure that, if TYPE is
+-     a TYPE_CODE_TYPEDEF, its length is set to the length of the target type
+-     instead of zero.  However, we do not replace the typedef type by the
+-     target type, because we want to keep the typedef in order to be able to
+-     set the returned value type description correctly.  */
+-  check_typedef (type);
+-
+-  len = TYPE_LENGTH (type);
+   if (symbol_read_needs_frame (var))
+     gdb_assert (frame);
+@@ -436,7 +430,7 @@ read_var_value (struct symbol *var, stru
+     case LOC_CONST:
+       /* Put the constant back in target format.  */
+       v = allocate_value (type);
+-      store_signed_integer (value_contents_raw (v), len,
++      store_signed_integer (value_contents_raw (v), TYPE_LENGTH (type),
+                           gdbarch_byte_order (get_type_arch (type)),
+                           (LONGEST) SYMBOL_VALUE (var));
+       VALUE_LVAL (v) = not_lval;
+@@ -461,12 +455,12 @@ read_var_value (struct symbol *var, stru
+     case LOC_CONST_BYTES:
+       v = allocate_value (type);
+-      memcpy (value_contents_raw (v), SYMBOL_VALUE_BYTES (var), len);
++      memcpy (value_contents_raw (v), SYMBOL_VALUE_BYTES (var),
++            TYPE_LENGTH (type));
+       VALUE_LVAL (v) = not_lval;
+       return v;
+     case LOC_STATIC:
+-      v = allocate_value_lazy (type);
+       if (overlay_debugging)
+       addr = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
+                                        SYMBOL_OBJ_SECTION (var));
+@@ -479,7 +473,6 @@ read_var_value (struct symbol *var, stru
+       if (!addr)
+       return 0;
+       addr += SYMBOL_VALUE (var);
+-      v = allocate_value_lazy (type);
+       break;
+     case LOC_REF_ARG:
+@@ -493,14 +486,12 @@ read_var_value (struct symbol *var, stru
+       argref += SYMBOL_VALUE (var);
+       ref = value_at (lookup_pointer_type (type), argref);
+       addr = value_as_address (ref);
+-      v = allocate_value_lazy (type);
+       break;
+       }
+     case LOC_LOCAL:
+       addr = get_frame_locals_address (frame);
+       addr += SYMBOL_VALUE (var);
+-      v = allocate_value_lazy (type);
+       break;
+     case LOC_TYPEDEF:
+@@ -508,7 +499,6 @@ read_var_value (struct symbol *var, stru
+       break;
+     case LOC_BLOCK:
+-      v = allocate_value_lazy (type);
+       if (overlay_debugging)
+       addr = symbol_overlayed_address
+         (BLOCK_START (SYMBOL_BLOCK_VALUE (var)), SYMBOL_OBJ_SECTION (var));
+@@ -533,7 +523,6 @@ read_var_value (struct symbol *var, stru
+             error (_("Value of register variable not available."));
+           addr = value_as_address (regval);
+-          v = allocate_value_lazy (type);
+         }
+       else
+         {
+@@ -572,7 +561,6 @@ read_var_value (struct symbol *var, stru
+       if (obj_section
+           && (obj_section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0)
+         addr = target_translate_tls_address (obj_section->objfile, addr);
+-      v = allocate_value_lazy (type);
+       }
+       break;
+@@ -584,6 +572,10 @@ read_var_value (struct symbol *var, stru
+       break;
+     }
++  /* ADDR is set here for ALLOCATE_VALUE's CHECK_TYPEDEF for
++     DW_OP_PUSH_OBJECT_ADDRESS.  */
++  object_address_set (addr);
++  v = allocate_value_lazy (type);
+   VALUE_LVAL (v) = lval_memory;
+   set_value_address (v, addr);
+   return v;
+@@ -623,11 +615,12 @@ struct value *
+ value_from_register (struct type *type, int regnum, struct frame_info *frame)
+ {
+   struct gdbarch *gdbarch = get_frame_arch (frame);
+-  struct type *type1 = check_typedef (type);
+   struct value *v;
+   int optim, unavail, ok;
+-  if (gdbarch_convert_register_p (gdbarch, regnum, type1))
++  type = check_typedef (type);
++
++  if (gdbarch_convert_register_p (gdbarch, regnum, type))
+     {
+       /* The ISA/ABI need to something weird when obtaining the
+          specified value from this register.  It might need to
+@@ -640,7 +633,7 @@ value_from_register (struct type *type,
+       VALUE_LVAL (v) = lval_register;
+       VALUE_FRAME_ID (v) = get_frame_id (frame);
+       VALUE_REGNUM (v) = regnum;
+-      ok = gdbarch_register_to_value (gdbarch, frame, regnum, type1,
++      ok = gdbarch_register_to_value (gdbarch, frame, regnum, type,
+                                     value_contents_raw (v), &optim,
+                                     &unavail);
+     }
+Index: gdb-7.3.50.20110722/gdb/gdbinit.in
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/gdbinit.in    2009-10-05 15:46:52.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/gdbinit.in 2011-07-29 22:52:02.000000000 +0200
+@@ -1,5 +1,15 @@
+ echo Setting up the environment for debugging gdb.\n
++# Set up the Python library and "require" command.
++python
++from os.path import abspath
++gdb.datadir = abspath ('@srcdir@/python/lib')
++gdb.pythonlibdir = gdb.datadir
++gdb.__path__ = [gdb.datadir + '/gdb']
++sys.path.insert(0, gdb.datadir)
++end
++source @srcdir@/python/lib/gdb/__init__.py
++
+ set complaints 1
+ b internal_error
+Index: gdb-7.3.50.20110722/gdb/gdbtypes.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/gdbtypes.c    2011-06-24 21:47:37.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/gdbtypes.c 2011-07-29 22:52:02.000000000 +0200
+@@ -39,6 +39,9 @@
+ #include "cp-abi.h"
+ #include "gdb_assert.h"
+ #include "hashtab.h"
++#include "observer.h"
++#include "dwarf2expr.h"
++#include "dwarf2loc.h"
+ /* Initialize BADNESS constants.  */
+@@ -144,7 +147,16 @@ static void print_bit_vector (B_TYPE *,
+ static void print_arg_types (struct field *, int, int);
+ static void dump_fn_fieldlists (struct type *, int);
+ static void print_cplus_stuff (struct type *, int);
++static LONGEST type_length_get (struct type *type, struct type *target_type,
++                              int full_span);
++#if 0
++/* The hash table holding all discardable `struct type *' references.  */
++static htab_t type_discardable_table;
++
++/* Current type_discardable_check pass used for TYPE_DISCARDABLE_AGE.  */
++static int type_discardable_age_current;
++#endif
+ /* Allocate a new OBJFILE-associated type structure and fill it
+    with some defaults.  Space for the type structure is allocated
+@@ -175,6 +187,43 @@ alloc_type (struct objfile *objfile)
+   return type;
+ }
++#if 0
++/* Declare TYPE as discardable on next garbage collection by free_all_types.
++   You must call type_mark_used during each free_all_types to protect TYPE from
++   being deallocated.  */
++
++static void
++set_type_as_discardable (struct type *type)
++{
++  void **slot;
++
++  gdb_assert (!TYPE_DISCARDABLE (type));
++
++  TYPE_DISCARDABLE (type) = 1;
++  TYPE_DISCARDABLE_AGE (type) = type_discardable_age_current;
++
++  slot = htab_find_slot (type_discardable_table, type, INSERT);
++  gdb_assert (!*slot);
++  *slot = type;
++}
++#endif
++
++/* Allocate a new type like alloc_type but preserve for it the discardability
++   state of PARENT_TYPE.  */
++
++static struct type *
++alloc_type_as_parent (struct type *parent_type)
++{
++  struct type *new_type = alloc_type_copy (parent_type);
++
++#if 0
++  if (TYPE_DISCARDABLE (parent_type))
++    set_type_as_discardable (new_type);
++#endif
++
++  return new_type;
++}
++
+ /* Allocate a new GDBARCH-associated type structure and fill it
+    with some defaults.  Space for the type structure is allocated
+    on the heap.  */
+@@ -300,7 +349,7 @@ make_pointer_type (struct type *type, st
+   if (typeptr == 0 || *typeptr == 0)  /* We'll need to allocate one.  */
+     {
+-      ntype = alloc_type_copy (type);
++      ntype = alloc_type_as_parent (type);
+       if (typeptr)
+       *typeptr = ntype;
+     }
+@@ -377,7 +426,7 @@ make_reference_type (struct type *type,
+   if (typeptr == 0 || *typeptr == 0)  /* We'll need to allocate one.  */
+     {
+-      ntype = alloc_type_copy (type);
++      ntype = alloc_type_as_parent (type);
+       if (typeptr)
+       *typeptr = ntype;
+     }
+@@ -748,6 +797,7 @@ create_range_type (struct type *result_t
+     TYPE_ZALLOC (result_type, sizeof (struct range_bounds));
+   TYPE_LOW_BOUND (result_type) = low_bound;
+   TYPE_HIGH_BOUND (result_type) = high_bound;
++  TYPE_BYTE_STRIDE (result_type) = 0;
+   if (low_bound >= 0)
+     TYPE_UNSIGNED (result_type) = 1;
+@@ -891,26 +941,31 @@ create_array_type (struct type *result_t
+   TYPE_CODE (result_type) = TYPE_CODE_ARRAY;
+   TYPE_TARGET_TYPE (result_type) = element_type;
+-  if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
+-    low_bound = high_bound = 0;
+-  CHECK_TYPEDEF (element_type);
+-  /* Be careful when setting the array length.  Ada arrays can be
+-     empty arrays with the high_bound being smaller than the low_bound.
+-     In such cases, the array length should be zero.  */
+-  if (high_bound < low_bound)
+-    TYPE_LENGTH (result_type) = 0;
+-  else
+-    TYPE_LENGTH (result_type) =
+-      TYPE_LENGTH (element_type) * (high_bound - low_bound + 1);
+   TYPE_NFIELDS (result_type) = 1;
+   TYPE_FIELDS (result_type) =
+     (struct field *) TYPE_ZALLOC (result_type, sizeof (struct field));
+   TYPE_INDEX_TYPE (result_type) = range_type;
+   TYPE_VPTR_FIELDNO (result_type) = -1;
+-  /* TYPE_FLAG_TARGET_STUB will take care of zero length arrays.  */
++  /* DWARF blocks may depend on runtime information like
++     DW_OP_PUSH_OBJECT_ADDRESS not being available during the
++     CREATE_ARRAY_TYPE time.  */
++  if (TYPE_RANGE_DATA (range_type)->low.kind != RANGE_BOUND_KIND_CONSTANT
++      || TYPE_RANGE_DATA (range_type)->high.kind != RANGE_BOUND_KIND_CONSTANT
++      || TYPE_DYNAMIC (element_type))
++    TYPE_LENGTH (result_type) = 0;
++  else
++    {
++      CHECK_TYPEDEF (element_type);
++      TYPE_LENGTH (result_type) = type_length_get (result_type, element_type,
++                                                 0);
++    }
+   if (TYPE_LENGTH (result_type) == 0)
+-    TYPE_TARGET_STUB (result_type) = 1;
++    {
++      /* The real size will be computed for specific instances by
++       CHECK_TYPEDEF.  */
++      TYPE_TARGET_STUB (result_type) = 1;
++    }
+   return result_type;
+ }
+@@ -1439,6 +1494,105 @@ stub_noname_complaint (void)
+   complaint (&symfile_complaints, _("stub type has NULL name"));
+ }
++/* Calculate the memory length of array TYPE.
++
++   TARGET_TYPE should be set to `check_typedef (TYPE_TARGET_TYPE (type))' as
++   a performance hint.  Feel free to pass NULL.  Set FULL_SPAN to return the
++   size incl. the possible padding of the last element - it may differ from the
++   cleared FULL_SPAN return value (the expected SIZEOF) for non-zero
++   TYPE_BYTE_STRIDE values.  */
++
++static LONGEST
++type_length_get (struct type *type, struct type *target_type, int full_span)
++{
++  struct type *range_type;
++  LONGEST byte_stride = 0;    /* `= 0' for a false GCC warning.  */
++  LONGEST count, element_size, retval;
++
++  if (TYPE_CODE (type) != TYPE_CODE_ARRAY
++      && TYPE_CODE (type) != TYPE_CODE_STRING)
++    return TYPE_LENGTH (type);
++
++  /* Avoid executing TYPE_HIGH_BOUND for invalid (unallocated/unassociated)
++     Fortran arrays.  The allocated data will never be used so they can be
++     zero-length.  */
++  if (object_address_data_not_valid (type))
++    return 0;
++
++  range_type = TYPE_INDEX_TYPE (type);
++  if (TYPE_LOW_BOUND_UNDEFINED (range_type)
++      || TYPE_HIGH_BOUND_UNDEFINED (range_type))
++    return 0;
++  count = TYPE_HIGH_BOUND (range_type) - TYPE_LOW_BOUND (range_type) + 1;
++  /* It may happen for wrong DWARF annotations returning garbage data.  */
++  if (count < 0)
++    warning (_("Range for type %s has invalid bounds %s..%s"),
++           TYPE_NAME (type), plongest (TYPE_LOW_BOUND (range_type)),
++           plongest (TYPE_HIGH_BOUND (range_type)));
++  /* The code below does not handle count == 0 right.  */
++  if (count <= 0)
++    return 0;
++  if (full_span || count > 1)
++    {
++      /* We do not use TYPE_ARRAY_BYTE_STRIDE_VALUE (type) here as we want to
++         force FULL_SPAN to 1.  */
++      byte_stride = TYPE_BYTE_STRIDE (range_type);
++      if (byte_stride == 0)
++        {
++        if (target_type == NULL)
++          target_type = check_typedef (TYPE_TARGET_TYPE (type));
++        byte_stride = type_length_get (target_type, NULL, 1);
++      }
++    }
++
++  /* For now, we conservatively take the array length to be 0 if its length
++     exceeds UINT_MAX.  The code below assumes that for x < 0,
++     (ULONGEST) x == -x + ULONGEST_MAX + 1, which is technically not guaranteed
++     by C, but is usually true (because it would be true if x were unsigned
++     with its high-order bit on). It uses the fact that high_bound-low_bound is
++     always representable in ULONGEST and that if high_bound-low_bound+1
++     overflows, it overflows to 0.  We must change these tests if we decide to
++     increase the representation of TYPE_LENGTH from unsigned int to ULONGEST.
++     */
++
++  if (full_span)
++    {
++      retval = count * byte_stride;
++      if (count == 0 || retval / count != byte_stride || retval > UINT_MAX)
++      retval = 0;
++      return retval;
++    }
++  if (target_type == NULL)
++    target_type = check_typedef (TYPE_TARGET_TYPE (type));
++  element_size = type_length_get (target_type, NULL, 1);
++  retval = (count - 1) * byte_stride + element_size;
++  if (retval < element_size
++      || (byte_stride != 0
++          && (retval - element_size) / byte_stride != count - 1)
++      || retval > UINT_MAX)
++    retval = 0;
++  return retval;
++}
++
++/* Prepare TYPE after being read in by the backend.  Currently this function
++   only propagates the TYPE_DYNAMIC flag.  */
++
++void
++finalize_type (struct type *type)
++{
++  int i;
++
++  for (i = 0; i < TYPE_NFIELDS (type); ++i)
++    if (TYPE_FIELD_TYPE (type, i) && TYPE_DYNAMIC (TYPE_FIELD_TYPE (type, i)))
++      break;
++
++  /* FIXME: cplus_stuff is ignored here.  */
++  if (i < TYPE_NFIELDS (type)
++      || (TYPE_VPTR_BASETYPE (type) && TYPE_DYNAMIC (TYPE_VPTR_BASETYPE (type)))
++      || (TYPE_TARGET_TYPE (type) && TYPE_DYNAMIC (TYPE_TARGET_TYPE (type))))
++    TYPE_DYNAMIC (type) = 1;
++}
++
+ /* Find the real type of TYPE.  This function returns the real type,
+    after removing all layers of typedefs, and completing opaque or stub
+    types.  Completion changes the TYPE argument, but stripping of
+@@ -1601,52 +1755,37 @@ check_typedef (struct type *type)
+         }
+     }
+-  if (TYPE_TARGET_STUB (type))
++  /* copy_type_recursive automatically makes the resulting type containing only
++     constant values expected by the callers of this function.  */
++  if (TYPE_DYNAMIC (type))
++    {
++      htab_t copied_types;
++
++      copied_types = create_copied_types_hash (NULL);
++      type = copy_type_recursive (type, copied_types);
++      htab_delete (copied_types);
++
++      gdb_assert (TYPE_DYNAMIC (type) == 0);
++      /* Force TYPE_LENGTH (type) recalculation.  */
++      TYPE_DYNAMIC (type) = 1;
++    }
++
++  if (TYPE_TARGET_STUB (type) || TYPE_DYNAMIC (type))
+     {
+-      struct type *range_type;
+       struct type *target_type = check_typedef (TYPE_TARGET_TYPE (type));
++      if (TYPE_DYNAMIC (type))
++      TYPE_TARGET_TYPE (type) = target_type;
+       if (TYPE_STUB (target_type) || TYPE_TARGET_STUB (target_type))
+       {
+         /* Nothing we can do.  */
+       }
+       else if (TYPE_CODE (type) == TYPE_CODE_ARRAY
+-             && TYPE_NFIELDS (type) == 1
+-             && (TYPE_CODE (range_type = TYPE_INDEX_TYPE (type))
+-                 == TYPE_CODE_RANGE))
++             || TYPE_CODE (type) == TYPE_CODE_STRING)
+       {
+         /* Now recompute the length of the array type, based on its
+-           number of elements and the target type's length.
+-           Watch out for Ada null Ada arrays where the high bound
+-           is smaller than the low bound.  */
+-        const LONGEST low_bound = TYPE_LOW_BOUND (range_type);
+-        const LONGEST high_bound = TYPE_HIGH_BOUND (range_type);
+-        ULONGEST len;
+-
+-        if (high_bound < low_bound)
+-          len = 0;
+-        else
+-          {
+-            /* For now, we conservatively take the array length to be 0
+-               if its length exceeds UINT_MAX.  The code below assumes
+-               that for x < 0, (ULONGEST) x == -x + ULONGEST_MAX + 1,
+-               which is technically not guaranteed by C, but is usually true
+-               (because it would be true if x were unsigned with its
+-               high-order bit on).  It uses the fact that
+-               high_bound-low_bound is always representable in
+-               ULONGEST and that if high_bound-low_bound+1 overflows,
+-               it overflows to 0.  We must change these tests if we 
+-               decide to increase the representation of TYPE_LENGTH
+-               from unsigned int to ULONGEST.  */
+-            ULONGEST ulow = low_bound, uhigh = high_bound;
+-            ULONGEST tlen = TYPE_LENGTH (target_type);
+-
+-            len = tlen * (uhigh - ulow + 1);
+-            if (tlen == 0 || (len / tlen - 1 + ulow) != uhigh 
+-                || len > UINT_MAX)
+-              len = 0;
+-          }
+-        TYPE_LENGTH (type) = len;
++           number of elements and the target type's length.  */
++        TYPE_LENGTH (type) = type_length_get (type, target_type, 0);
+         TYPE_TARGET_STUB (type) = 0;
+       }
+       else if (TYPE_CODE (type) == TYPE_CODE_RANGE)
+@@ -1654,6 +1793,7 @@ check_typedef (struct type *type)
+         TYPE_LENGTH (type) = TYPE_LENGTH (target_type);
+         TYPE_TARGET_STUB (type) = 0;
+       }
++      TYPE_DYNAMIC (type) = 0;
+     }
+   type = make_qualified_type (type, instance_flags, NULL);
+@@ -3292,33 +3432,42 @@ type_pair_eq (const void *item_lhs, cons
+ }
+ /* Allocate the hash table used by copy_type_recursive to walk
+-   types without duplicates.  We use OBJFILE's obstack, because
+-   OBJFILE is about to be deleted.  */
++   types without duplicates.   */
+ htab_t
+ create_copied_types_hash (struct objfile *objfile)
+ {
+-  return htab_create_alloc_ex (1, type_pair_hash, type_pair_eq,
+-                             NULL, &objfile->objfile_obstack,
+-                             hashtab_obstack_allocate,
+-                             dummy_obstack_deallocate);
++  if (objfile == NULL)
++    {
++      /* NULL OBJFILE is for TYPE_DYNAMIC types already contained in
++       OBJFILE_MALLOC memory, such as those from VALUE_HISTORY_CHAIN.  Table
++       element entries get allocated by xmalloc - so use xfree.  */
++      return htab_create (1, type_pair_hash, type_pair_eq, xfree);
++    }
++  else
++    {
++      /* Use OBJFILE's obstack, because OBJFILE is about to be deleted.  Table
++       element entries get allocated by xmalloc - so use xfree.  */
++      return htab_create_alloc_ex (1, type_pair_hash, type_pair_eq,
++                                 xfree, &objfile->objfile_obstack,
++                                 hashtab_obstack_allocate,
++                                 dummy_obstack_deallocate);
++    }
+ }
+-/* Recursively copy (deep copy) TYPE, if it is associated with
+-   OBJFILE.  Return a new type allocated using malloc, a saved type if
+-   we have already visited TYPE (using COPIED_TYPES), or TYPE if it is
+-   not associated with OBJFILE.  */
++/* A helper for copy_type_recursive.  This does all the work.  OBJFILE is used
++   only for an assertion checking.  */
+-struct type *
+-copy_type_recursive (struct objfile *objfile, 
+-                   struct type *type,
+-                   htab_t copied_types)
++static struct type *
++copy_type_recursive_1 (struct objfile *objfile, 
++                     struct type *type,
++                     htab_t copied_types)
+ {
+   struct type_pair *stored, pair;
+   void **slot;
+   struct type *new_type;
+-  if (! TYPE_OBJFILE_OWNED (type))
++  if (! TYPE_OBJFILE_OWNED (type) && !TYPE_DYNAMIC (type))
+     return type;
+   /* This type shouldn't be pointing to any types in other objfiles;
+@@ -3333,9 +3482,10 @@ copy_type_recursive (struct objfile *obj
+   new_type = alloc_type_arch (get_type_arch (type));
+   /* We must add the new type to the hash table immediately, in case
+-     we encounter this type again during a recursive call below.  */
+-  stored
+-    = obstack_alloc (&objfile->objfile_obstack, sizeof (struct type_pair));
++     we encounter this type again during a recursive call below.  Memory could
++     be allocated from OBJFILE in the case we will be removing OBJFILE, this
++     optimization is missed and xfree is called for it from COPIED_TYPES.  */
++  stored = xmalloc (sizeof (*stored));
+   stored->old = type;
+   stored->new = new_type;
+   *slot = stored;
+@@ -3346,6 +3496,21 @@ copy_type_recursive (struct objfile *obj
+   TYPE_OBJFILE_OWNED (new_type) = 0;
+   TYPE_OWNER (new_type).gdbarch = get_type_arch (type);
++#if 0
++  /* TYPE_MAIN_TYPE memory copy above rewrote the TYPE_DISCARDABLE flag so we
++     need to initialize it again.  And even if TYPE was already discardable
++     NEW_TYPE so far is not registered in TYPE_DISCARDABLE_TABLE.  */
++  TYPE_DISCARDABLE (new_type) = 0;
++  set_type_as_discardable (new_type);
++#endif
++
++  /* Pre-clear the fields processed by delete_main_type.  If DWARF block
++     evaluations below call error we would leave an unfreeable TYPE.  */
++  TYPE_TARGET_TYPE (new_type) = NULL;
++  TYPE_VPTR_BASETYPE (new_type) = NULL;
++  TYPE_NFIELDS (new_type) = 0;
++  TYPE_FIELDS (new_type) = NULL;
++
+   if (TYPE_NAME (type))
+     TYPE_NAME (new_type) = xstrdup (TYPE_NAME (type));
+   if (TYPE_TAG_NAME (type))
+@@ -3354,12 +3519,48 @@ copy_type_recursive (struct objfile *obj
+   TYPE_INSTANCE_FLAGS (new_type) = TYPE_INSTANCE_FLAGS (type);
+   TYPE_LENGTH (new_type) = TYPE_LENGTH (type);
++  if (TYPE_ALLOCATED (new_type))
++    {
++      gdb_assert (!TYPE_NOT_ALLOCATED (new_type));
++
++      if (!dwarf_locexpr_baton_eval (TYPE_ALLOCATED (new_type)))
++        TYPE_NOT_ALLOCATED (new_type) = 1;
++      TYPE_ALLOCATED (new_type) = NULL;
++    }
++
++  if (TYPE_ASSOCIATED (new_type))
++    {
++      gdb_assert (!TYPE_NOT_ASSOCIATED (new_type));
++
++      if (!dwarf_locexpr_baton_eval (TYPE_ASSOCIATED (new_type)))
++        TYPE_NOT_ASSOCIATED (new_type) = 1;
++      TYPE_ASSOCIATED (new_type) = NULL;
++    }
++
++  if (!TYPE_DATA_LOCATION_IS_ADDR (new_type)
++      && TYPE_DATA_LOCATION_DWARF_BLOCK (new_type))
++    {
++      if (TYPE_NOT_ALLOCATED (new_type)
++          || TYPE_NOT_ASSOCIATED (new_type))
++      TYPE_DATA_LOCATION_DWARF_BLOCK (new_type) = NULL;
++      else
++      {
++        TYPE_DATA_LOCATION_IS_ADDR (new_type) = 1;
++        TYPE_DATA_LOCATION_ADDR (new_type) = dwarf_locexpr_baton_eval
++                                  (TYPE_DATA_LOCATION_DWARF_BLOCK (new_type));
++      }
++    }
++
+   /* Copy the fields.  */
+   if (TYPE_NFIELDS (type))
+     {
+       int i, nfields;
++      /* TYPE_CODE_RANGE uses TYPE_RANGE_DATA of the union with TYPE_FIELDS.  */
++      gdb_assert (TYPE_CODE (type) != TYPE_CODE_RANGE);
++
+       nfields = TYPE_NFIELDS (type);
++      TYPE_NFIELDS (new_type) = nfields;
+       TYPE_FIELDS (new_type) = XCALLOC (nfields, struct field);
+       for (i = 0; i < nfields; i++)
+       {
+@@ -3368,8 +3569,8 @@ copy_type_recursive (struct objfile *obj
+         TYPE_FIELD_BITSIZE (new_type, i) = TYPE_FIELD_BITSIZE (type, i);
+         if (TYPE_FIELD_TYPE (type, i))
+           TYPE_FIELD_TYPE (new_type, i)
+-            = copy_type_recursive (objfile, TYPE_FIELD_TYPE (type, i),
+-                                   copied_types);
++            = copy_type_recursive_1 (objfile, TYPE_FIELD_TYPE (type, i),
++                                     copied_types);
+         if (TYPE_FIELD_NAME (type, i))
+           TYPE_FIELD_NAME (new_type, i) = 
+             xstrdup (TYPE_FIELD_NAME (type, i));
+@@ -3396,24 +3597,184 @@ copy_type_recursive (struct objfile *obj
+       }
+     }
++  /* Both FIELD_LOC_KIND_DWARF_BLOCK and TYPE_RANGE_HIGH_BOUND_IS_COUNT were
++     possibly converted.  */
++  TYPE_DYNAMIC (new_type) = 0;
++
+   /* For range types, copy the bounds information.  */
+-  if (TYPE_CODE (type) == TYPE_CODE_RANGE)
++  if (TYPE_CODE (new_type) == TYPE_CODE_RANGE)
+     {
+       TYPE_RANGE_DATA (new_type) = xmalloc (sizeof (struct range_bounds));
+       *TYPE_RANGE_DATA (new_type) = *TYPE_RANGE_DATA (type);
++
++      switch (TYPE_RANGE_DATA (new_type)->low.kind)
++      {
++      case RANGE_BOUND_KIND_CONSTANT:
++        break;
++      case RANGE_BOUND_KIND_DWARF_BLOCK:
++        /* `struct dwarf2_locexpr_baton' is too bound to its objfile so
++           it is expected to be made constant by CHECK_TYPEDEF.
++           TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
++           */
++        if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type)
++            || ! has_stack_frames ())
++          {
++            /* We should set 1 for Fortran but how to find the language?  */
++            TYPE_LOW_BOUND (new_type) = 0;
++            TYPE_LOW_BOUND_UNDEFINED (new_type) = 1;
++          }
++        else
++          {
++            TYPE_LOW_BOUND (new_type) = dwarf_locexpr_baton_eval
++                              (TYPE_RANGE_DATA (new_type)->low.u.dwarf_block);
++            if (TYPE_LOW_BOUND (new_type) >= 0)
++              TYPE_UNSIGNED (new_type) = 1;
++          }
++        TYPE_RANGE_DATA (new_type)->low.kind = RANGE_BOUND_KIND_CONSTANT;
++        break;
++      case RANGE_BOUND_KIND_DWARF_LOCLIST:
++        {
++          CORE_ADDR addr;
++
++          /* `struct dwarf2_loclist_baton' is too bound to its objfile so
++             it is expected to be made constant by CHECK_TYPEDEF.
++             TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
++             */
++          if (! TYPE_NOT_ALLOCATED (new_type)
++              && ! TYPE_NOT_ASSOCIATED (new_type) && has_stack_frames ()
++              && dwarf_loclist_baton_eval
++                (TYPE_RANGE_DATA (new_type)->low.u.dwarf_loclist.loclist,
++                 TYPE_RANGE_DATA (new_type)->low.u.dwarf_loclist.type, &addr))
++            {
++              TYPE_LOW_BOUND (new_type) = addr;
++              if (TYPE_LOW_BOUND (new_type) >= 0)
++                TYPE_UNSIGNED (new_type) = 1;
++            }
++          else
++            {
++              /* We should set 1 for Fortran but how to find the language?  */
++              TYPE_LOW_BOUND (new_type) = 0;
++              TYPE_LOW_BOUND_UNDEFINED (new_type) = 1;
++            }
++          TYPE_RANGE_DATA (new_type)->low.kind = RANGE_BOUND_KIND_CONSTANT;
++        }
++        break;
++      }
++
++      switch (TYPE_RANGE_DATA (new_type)->high.kind)
++      {
++      case RANGE_BOUND_KIND_CONSTANT:
++        break;
++      case RANGE_BOUND_KIND_DWARF_BLOCK:
++        /* `struct dwarf2_locexpr_baton' is too bound to its objfile so
++           it is expected to be made constant by CHECK_TYPEDEF.
++           TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
++           */
++        if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type)
++            || ! has_stack_frames ())
++          {
++            TYPE_HIGH_BOUND (new_type) = TYPE_LOW_BOUND (new_type) - 1;
++            TYPE_HIGH_BOUND_UNDEFINED (new_type) = 1;
++          }
++        else
++          TYPE_HIGH_BOUND (new_type) = dwarf_locexpr_baton_eval
++                             (TYPE_RANGE_DATA (new_type)->high.u.dwarf_block);
++        TYPE_RANGE_DATA (new_type)->high.kind = RANGE_BOUND_KIND_CONSTANT;
++        break;
++      case RANGE_BOUND_KIND_DWARF_LOCLIST:
++        {
++          CORE_ADDR addr;
++
++          /* `struct dwarf2_loclist_baton' is too bound to its objfile so
++             it is expected to be made constant by CHECK_TYPEDEF.
++             TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
++             */
++          if (! TYPE_NOT_ALLOCATED (new_type)
++              && ! TYPE_NOT_ASSOCIATED (new_type) && has_stack_frames ()
++              && dwarf_loclist_baton_eval
++                    (TYPE_RANGE_DATA (new_type)->high.u.dwarf_loclist.loclist,
++                     TYPE_RANGE_DATA (new_type)->high.u.dwarf_loclist.type,
++                     &addr))
++            TYPE_HIGH_BOUND (new_type) = addr;
++          else
++            {
++              TYPE_HIGH_BOUND (new_type) = TYPE_LOW_BOUND (new_type) - 1;
++              TYPE_HIGH_BOUND_UNDEFINED (new_type) = 1;
++            }
++          TYPE_RANGE_DATA (new_type)->high.kind = RANGE_BOUND_KIND_CONSTANT;
++        }
++        break;
++      }
++
++      switch (TYPE_RANGE_DATA (new_type)->byte_stride.kind)
++      {
++      case RANGE_BOUND_KIND_CONSTANT:
++        break;
++      case RANGE_BOUND_KIND_DWARF_BLOCK:
++        /* `struct dwarf2_locexpr_baton' is too bound to its objfile so
++           it is expected to be made constant by CHECK_TYPEDEF.
++           TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
++           */
++        if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type)
++            || ! has_stack_frames ())
++          TYPE_BYTE_STRIDE (new_type) = 0;
++        else
++          TYPE_BYTE_STRIDE (new_type) = dwarf_locexpr_baton_eval
++                      (TYPE_RANGE_DATA (new_type)->byte_stride.u.dwarf_block);
++        TYPE_RANGE_DATA (new_type)->byte_stride.kind
++          = RANGE_BOUND_KIND_CONSTANT;
++        break;
++      case RANGE_BOUND_KIND_DWARF_LOCLIST:
++        {
++          CORE_ADDR addr = 0;
++
++          /* `struct dwarf2_loclist_baton' is too bound to its objfile so
++             it is expected to be made constant by CHECK_TYPEDEF.
++             TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE.
++             */
++          if (! TYPE_NOT_ALLOCATED (new_type)
++              && ! TYPE_NOT_ASSOCIATED (new_type) && has_stack_frames ())
++            dwarf_loclist_baton_eval
++             (TYPE_RANGE_DATA (new_type)->byte_stride.u.dwarf_loclist.loclist,
++              TYPE_RANGE_DATA (new_type)->byte_stride.u.dwarf_loclist.type,
++              &addr);
++          TYPE_BYTE_STRIDE (new_type) = addr;
++          TYPE_RANGE_DATA (new_type)->byte_stride.kind
++            = RANGE_BOUND_KIND_CONSTANT;
++        }
++        break;
++      }
++
++      /* Convert TYPE_RANGE_HIGH_BOUND_IS_COUNT into a regular bound.  */
++      if (TYPE_RANGE_HIGH_BOUND_IS_COUNT (new_type))
++      {
++        TYPE_HIGH_BOUND (new_type) = TYPE_LOW_BOUND (new_type)
++                                     + TYPE_HIGH_BOUND (new_type) - 1;
++        TYPE_RANGE_HIGH_BOUND_IS_COUNT (new_type) = 0;
++      }
+     }
+   /* Copy pointers to other types.  */
+   if (TYPE_TARGET_TYPE (type))
+     TYPE_TARGET_TYPE (new_type) = 
+-      copy_type_recursive (objfile, 
+-                         TYPE_TARGET_TYPE (type),
+-                         copied_types);
++      copy_type_recursive_1 (objfile, 
++                           TYPE_TARGET_TYPE (type),
++                           copied_types);
+   if (TYPE_VPTR_BASETYPE (type))
+     TYPE_VPTR_BASETYPE (new_type) = 
+-      copy_type_recursive (objfile,
+-                         TYPE_VPTR_BASETYPE (type),
+-                         copied_types);
++      copy_type_recursive_1 (objfile,
++                           TYPE_VPTR_BASETYPE (type),
++                           copied_types);
++
++  if (TYPE_CODE (new_type) == TYPE_CODE_ARRAY)
++    {
++      struct type *new_index_type = TYPE_INDEX_TYPE (new_type);
++
++      if (TYPE_BYTE_STRIDE (new_index_type) == 0)
++      TYPE_BYTE_STRIDE (new_index_type)
++        = TYPE_LENGTH (TYPE_TARGET_TYPE (new_type));
++    }
++
+   /* Maybe copy the type_specific bits.
+      NOTE drow/2005-12-09: We do not copy the C++-specific bits like
+@@ -3430,6 +3791,17 @@ copy_type_recursive (struct objfile *obj
+   return new_type;
+ }
++/* Recursively copy (deep copy) TYPE.  Return a new type allocated using
++   malloc, a saved type if we have already visited TYPE (using COPIED_TYPES),
++   or TYPE if it is not associated with OBJFILE.  */
++
++struct type *
++copy_type_recursive (struct type *type,
++                   htab_t copied_types)
++{
++  return copy_type_recursive_1 (TYPE_OBJFILE (type), type, copied_types);
++}
++
+ /* Make a copy of the given TYPE, except that the pointer & reference
+    types are not preserved.
+    
+@@ -3452,6 +3824,201 @@ copy_type (const struct type *type)
+   return new_type;
+ }
++#if 0
++/* Callback type for main_type_crawl.  */
++typedef int (*main_type_crawl_iter) (struct type *type, void *data);
++
++/* Iterate all main_type structures reachable through any `struct type *' from
++   TYPE.  ITER will be called only for one type of each main_type, use
++   TYPE_CHAIN traversal to find all the type instances.  ITER is being called
++   for each main_type found.  ITER returns non-zero if main_type_crawl should
++   depth-first enter the specific type.  ITER must provide some detection for
++   reentering the same main_type as this function would otherwise endlessly
++   loop.  */
++
++static void
++main_type_crawl (struct type *type, main_type_crawl_iter iter, void *data)
++{
++  struct type *type_iter;
++  int i;
++
++  if (!type)
++    return;
++
++  gdb_assert (TYPE_OBJFILE (type) == NULL);
++
++  /* `struct cplus_struct_type' handling is unsupported by this function.  */
++  gdb_assert ((TYPE_CODE (type) != TYPE_CODE_STRUCT
++             && TYPE_CODE (type) != TYPE_CODE_UNION)
++            || !HAVE_CPLUS_STRUCT (type));
++
++  if (!(*iter) (type, data))
++    return;
++
++  /* Iterate all the type instances of this main_type.  */
++  type_iter = type;
++  do
++    {
++      gdb_assert (TYPE_MAIN_TYPE (type_iter) == TYPE_MAIN_TYPE (type));
++
++      main_type_crawl (TYPE_POINTER_TYPE (type), iter, data);
++      main_type_crawl (TYPE_REFERENCE_TYPE (type), iter, data);
++
++      type_iter = TYPE_CHAIN (type_iter);
++    }
++  while (type_iter != type);
++
++  for (i = 0; i < TYPE_NFIELDS (type); i++)
++    main_type_crawl (TYPE_FIELD_TYPE (type, i), iter, data);
++
++  main_type_crawl (TYPE_TARGET_TYPE (type), iter, data);
++  main_type_crawl (TYPE_VPTR_BASETYPE (type), iter, data);
++}
++
++/* A helper for delete_type which deletes a main_type and the things to which
++   it refers.  TYPE is a type whose main_type we wish to destroy.  */
++
++static void
++delete_main_type (struct type *type)
++{
++  int i;
++
++  gdb_assert (TYPE_DISCARDABLE (type));
++  gdb_assert (TYPE_OBJFILE (type) == NULL);
++
++  xfree (TYPE_NAME (type));
++  xfree (TYPE_TAG_NAME (type));
++
++  for (i = 0; i < TYPE_NFIELDS (type); ++i)
++    {
++      xfree (TYPE_FIELD_NAME (type, i));
++
++      if (TYPE_FIELD_LOC_KIND (type, i) == FIELD_LOC_KIND_PHYSNAME)
++      xfree (TYPE_FIELD_STATIC_PHYSNAME (type, i));
++    }
++  xfree (TYPE_FIELDS (type));
++
++  gdb_assert (!HAVE_CPLUS_STRUCT (type));
++
++  xfree (TYPE_MAIN_TYPE (type));
++}
++
++/* Delete all the instances on TYPE_CHAIN of TYPE, including their referenced
++   main_type.  TYPE must be a reclaimable type - neither permanent nor objfile
++   associated.  */
++
++static void
++delete_type_chain (struct type *type)
++{
++  struct type *type_iter, *type_iter_to_free;
++
++  gdb_assert (TYPE_DISCARDABLE (type));
++  gdb_assert (TYPE_OBJFILE (type) == NULL);
++
++  delete_main_type (type);
++
++  type_iter = type;
++  do
++    {
++      type_iter_to_free = type_iter;
++      type_iter = TYPE_CHAIN (type_iter);
++      xfree (type_iter_to_free);
++    }
++  while (type_iter != type);
++}
++
++/* Hash function for type_discardable_table.  */
++
++static hashval_t
++type_discardable_hash (const void *p)
++{
++  const struct type *type = p;
++
++  return htab_hash_pointer (TYPE_MAIN_TYPE (type));
++}
++
++/* Equality function for type_discardable_table.  */
++
++static int
++type_discardable_equal (const void *a, const void *b)
++{
++  const struct type *left = a;
++  const struct type *right = b;
++
++  return TYPE_MAIN_TYPE (left) == TYPE_MAIN_TYPE (right);
++}
++
++/* A helper for type_mark_used.  */
++
++static int
++type_mark_used_crawl (struct type *type, void *unused)
++{
++  if (!TYPE_DISCARDABLE (type))
++    return 0;
++
++  if (TYPE_DISCARDABLE_AGE (type) == type_discardable_age_current)
++    return 0;
++
++  TYPE_DISCARDABLE_AGE (type) = type_discardable_age_current;
++
++  /* Continue the traversal.  */
++  return 1;
++}
++
++/* Mark TYPE and its connected types as used in this free_all_types pass.  */
++
++void
++type_mark_used (struct type *type)
++{
++  if (type == NULL)
++    return;
++
++  if (!TYPE_DISCARDABLE (type))
++    return;
++
++  main_type_crawl (type, type_mark_used_crawl, NULL);
++}
++
++/* A traverse callback for type_discardable_table which removes any
++   type_discardable whose reference count is now zero (unused link).  */
++
++static int
++type_discardable_remove (void **slot, void *unused)
++{
++  struct type *type = *slot;
++
++  gdb_assert (TYPE_DISCARDABLE (type));
++
++  if (TYPE_DISCARDABLE_AGE (type) != type_discardable_age_current)
++    {
++      delete_type_chain (type);
++
++      htab_clear_slot (type_discardable_table, slot);
++    }
++
++  return 1;
++}
++
++/* Free all the reclaimable types that have been allocated and that have
++   currently zero reference counter.
++
++   This function is called after each command, successful or not.  Use this
++   cleanup only in the GDB idle state as GDB only marks those types used by
++   globally tracked objects (with no autovariable references tracking).  */
++
++void
++free_all_types (void)
++{
++  /* Mark a new pass.  As GDB checks all the entries were visited after each
++     pass there cannot be any stale entries already containing the changed
++     value.  */
++  type_discardable_age_current ^= 1;
++
++  observer_notify_mark_used ();
++
++  htab_traverse (type_discardable_table, type_discardable_remove, NULL);
++}
++#endif
+ /* Helper functions to initialize architecture-specific types.  */
+@@ -3984,6 +4551,13 @@ void
+ _initialize_gdbtypes (void)
+ {
+   gdbtypes_data = gdbarch_data_register_post_init (gdbtypes_post_init);
++
++#if 0
++  type_discardable_table = htab_create_alloc (20, type_discardable_hash,
++                                           type_discardable_equal, NULL,
++                                           xcalloc, xfree);
++#endif
++
+   objfile_type_data = register_objfile_data ();
+   add_setshow_zinteger_cmd ("overload", no_class, &overload_debug,
+Index: gdb-7.3.50.20110722/gdb/gdbtypes.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/gdbtypes.h    2011-07-05 15:36:41.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/gdbtypes.h 2011-07-29 22:52:02.000000000 +0200
+@@ -215,6 +215,11 @@ enum type_instance_flag_value
+ #define TYPE_TARGET_STUB(t)   (TYPE_MAIN_TYPE (t)->flag_target_stub)
++/* Type needs to be evaluated on each CHECK_TYPEDEF and its results must not be
++   sticky.  */
++
++#define TYPE_DYNAMIC(t)               (TYPE_MAIN_TYPE (t)->flag_dynamic)
++
+ /* Static type.  If this is set, the corresponding type had 
+    a static modifier.
+    Note: This may be unnecessary, since static data members
+@@ -292,6 +297,50 @@ enum type_instance_flag_value
+ #define TYPE_DECLARED_CLASS(t) (TYPE_MAIN_TYPE (t)->flag_declared_class)
++#if 0
++/* Define this type as being reclaimable during free_all_types.  Type is
++   required to be have TYPE_OBJFILE set to NULL.  Setting this flag requires
++   initializing TYPE_DISCARDABLE_AGE, see alloc_type_discardable.  */
++
++#define TYPE_DISCARDABLE(t)   (TYPE_MAIN_TYPE (t)->flag_discardable)
++
++/* Marker this type has been visited by the type_mark_used by this
++   mark-and-sweep types garbage collecting pass.  Current pass is represented
++   by TYPE_DISCARDABLE_AGE_CURRENT.  */
++
++#define TYPE_DISCARDABLE_AGE(t)       (TYPE_MAIN_TYPE (t)->flag_discardable_age)
++#endif
++
++/* Is HIGH_BOUND a low-bound relative count (1) or the high bound itself (0)?  */
++
++#define TYPE_RANGE_HIGH_BOUND_IS_COUNT(range_type) \
++  (TYPE_MAIN_TYPE (range_type)->flag_range_high_bound_is_count)
++
++/* Not allocated.  TYPE_ALLOCATED(t) must be NULL in such case.  If this flag
++   is unset and TYPE_ALLOCATED(t) is NULL then the type is allocated.  If this
++   flag is unset and TYPE_ALLOCATED(t) is not NULL then its DWARF block
++   determines the actual allocation state.  */
++
++#define TYPE_NOT_ALLOCATED(t) (TYPE_MAIN_TYPE (t)->flag_not_allocated)
++
++/* Not associated.  TYPE_ASSOCIATED(t) must be NULL in such case.  If this flag
++   is unset and TYPE_ASSOCIATED(t) is NULL then the type is associated.  If
++   this flag is unset and TYPE_ASSOCIATED(t) is not NULL then its DWARF block
++   determines the actual association state.  */
++
++#define TYPE_NOT_ASSOCIATED(t)        (TYPE_MAIN_TYPE (t)->flag_not_associated)
++
++/* Address of the actual data as for DW_AT_data_location.  Its dwarf block must
++   not be evaluated unless both TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are
++   false.  If TYPE_DATA_LOCATION_IS_ADDR set then TYPE_DATA_LOCATION_ADDR value
++   is the actual data address value.  If unset and
++   TYPE_DATA_LOCATION_DWARF_BLOCK is NULL then the value is the normal
++   value_raw_address.  If unset and TYPE_DATA_LOCATION_DWARF_BLOCK is not NULL
++   then its DWARF block determines the actual data address.  */
++
++#define TYPE_DATA_LOCATION_IS_ADDR(t) \
++  (TYPE_MAIN_TYPE (t)->flag_data_location_is_addr)
++
+ /* Constant type.  If this is set, the corresponding type has a
+    const modifier.  */
+@@ -400,6 +449,15 @@ struct main_type
+   /* True if this type was declared with "class" rather than
+      "struct".  */
+   unsigned int flag_declared_class : 1;
++#if 0
++  unsigned int flag_discardable : 1;
++  unsigned int flag_discardable_age : 1;
++#endif
++  unsigned int flag_dynamic : 1;
++  unsigned int flag_range_high_bound_is_count : 1;
++  unsigned int flag_not_allocated : 1;
++  unsigned int flag_not_associated : 1;
++  unsigned int flag_data_location_is_addr : 1;
+   /* A discriminant telling us which field of the type_specific union
+      is being used for this type, if any.  */
+@@ -473,6 +531,20 @@ struct main_type
+   struct type *target_type;
++  /* For DW_AT_data_location.  */
++  union
++    {
++      struct dwarf2_locexpr_baton *dwarf_block;
++      CORE_ADDR addr;
++    }
++  data_location;
++
++  /* For DW_AT_allocated.  */
++  struct dwarf2_locexpr_baton *allocated;
++
++  /* For DW_AT_associated.  */
++  struct dwarf2_locexpr_baton *associated;
++
+   /* For structure and union types, a description of each field.
+      For set and pascal array types, there is one "field",
+      whose type is the domain type of the set or array.
+@@ -547,13 +619,34 @@ struct main_type
+     struct range_bounds
+     {
++      struct
++      {
++        union
++          {
++            LONGEST constant;
++            struct dwarf2_locexpr_baton *dwarf_block;
++            struct
++              {
++                struct dwarf2_loclist_baton *loclist;
++                struct type *type;
++              }
++            dwarf_loclist;
++          }
++        u;
++        enum range_bound_kind
++          {
++            RANGE_BOUND_KIND_CONSTANT,
++            RANGE_BOUND_KIND_DWARF_BLOCK,
++            RANGE_BOUND_KIND_DWARF_LOCLIST
++          }
++        kind;
++      }
+       /* Low bound of range.  */
+-
+-      LONGEST low;
+-
++      low,
+       /* High bound of range.  */
+-
+-      LONGEST high;
++      high,
++      /* Byte stride of range.  */
++      byte_stride;
+       /* Flags indicating whether the values of low and high are
+          valid.  When true, the respective range value is
+@@ -929,9 +1022,9 @@ extern void allocate_gnat_aux_type (stru
+ #define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type
+ #define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type
+ #define TYPE_CHAIN(thistype) (thistype)->chain
+-/* Note that if thistype is a TYPEDEF type, you have to call check_typedef.
+-   But check_typedef does set the TYPE_LENGTH of the TYPEDEF type,
+-   so you only have to call check_typedef once.  Since allocate_value
++/* Note that if thistype is a TYPEDEF, ARRAY or STRING type, you have to call
++   check_typedef.  But check_typedef does set the TYPE_LENGTH of the TYPEDEF
++   type, so you only have to call check_typedef once.  Since allocate_value
+    calls check_typedef, TYPE_LENGTH (VALUE_TYPE (X)) is safe.  */
+ #define TYPE_LENGTH(thistype) (thistype)->length
+ /* Note that TYPE_CODE can be TYPE_CODE_TYPEDEF, so if you want the real
+@@ -939,11 +1032,16 @@ extern void allocate_gnat_aux_type (stru
+ #define TYPE_CODE(thistype) TYPE_MAIN_TYPE(thistype)->code
+ #define TYPE_NFIELDS(thistype) TYPE_MAIN_TYPE(thistype)->nfields
+ #define TYPE_FIELDS(thistype) TYPE_MAIN_TYPE(thistype)->flds_bnds.fields
++#define TYPE_DATA_LOCATION_DWARF_BLOCK(thistype) TYPE_MAIN_TYPE (thistype)->data_location.dwarf_block
++#define TYPE_DATA_LOCATION_ADDR(thistype) TYPE_MAIN_TYPE (thistype)->data_location.addr
++#define TYPE_ALLOCATED(thistype) TYPE_MAIN_TYPE (thistype)->allocated
++#define TYPE_ASSOCIATED(thistype) TYPE_MAIN_TYPE (thistype)->associated
+ #define TYPE_INDEX_TYPE(type) TYPE_FIELD_TYPE (type, 0)
+ #define TYPE_RANGE_DATA(thistype) TYPE_MAIN_TYPE(thistype)->flds_bnds.bounds
+-#define TYPE_LOW_BOUND(range_type) TYPE_RANGE_DATA(range_type)->low
+-#define TYPE_HIGH_BOUND(range_type) TYPE_RANGE_DATA(range_type)->high
++#define TYPE_LOW_BOUND(range_type) TYPE_RANGE_DATA(range_type)->low.u.constant
++#define TYPE_HIGH_BOUND(range_type) TYPE_RANGE_DATA(range_type)->high.u.constant
++#define TYPE_BYTE_STRIDE(range_type) TYPE_RANGE_DATA(range_type)->byte_stride.u.constant
+ #define TYPE_LOW_BOUND_UNDEFINED(range_type) \
+    TYPE_RANGE_DATA(range_type)->low_undefined
+ #define TYPE_HIGH_BOUND_UNDEFINED(range_type) \
+@@ -960,7 +1058,14 @@ extern void allocate_gnat_aux_type (stru
+    (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype))))
+ #define TYPE_ARRAY_LOWER_BOUND_VALUE(arraytype) \
+-   (TYPE_LOW_BOUND(TYPE_INDEX_TYPE((arraytype))))
++  TYPE_LOW_BOUND (TYPE_INDEX_TYPE (arraytype))
++
++/* TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (arraytype)) with a fallback to the
++   element size if no specific stride value is known.  */
++#define TYPE_ARRAY_BYTE_STRIDE_VALUE(arraytype)               \
++  (TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (arraytype)) == 0        \
++   ? TYPE_LENGTH (TYPE_TARGET_TYPE (arraytype))               \
++   : TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (arraytype)))
+ /* C++ */
+@@ -1385,6 +1490,18 @@ extern struct type *create_array_type (s
+                                      struct type *);
+ extern struct type *lookup_array_range_type (struct type *, int, int);
++extern CORE_ADDR type_range_any_field_internal (struct type *range_type,
++                                              int fieldno);
++
++extern int type_range_high_bound_internal (struct type *range_type);
++
++extern int type_range_count_bound_internal (struct type *range_type);
++
++extern CORE_ADDR type_range_byte_stride_internal (struct type *range_type,
++                                                struct type *element_type);
++
++extern void finalize_type (struct type *type);
++
+ extern struct type *create_string_type (struct type *, struct type *,
+                                       struct type *);
+ extern struct type *lookup_string_range_type (struct type *, int, int);
+@@ -1430,6 +1547,10 @@ extern int is_public_ancestor (struct ty
+ extern int is_unique_ancestor (struct type *, struct value *);
++#if 0
++extern void type_mark_used (struct type *type);
++#endif
++
+ /* Overload resolution */
+ #define LENGTH_MATCH(bv) ((bv)->rank[0])
+@@ -1502,10 +1623,13 @@ extern void maintenance_print_type (char
+ extern htab_t create_copied_types_hash (struct objfile *objfile);
+-extern struct type *copy_type_recursive (struct objfile *objfile,
+-                                       struct type *type,
++extern struct type *copy_type_recursive (struct type *type,
+                                        htab_t copied_types);
+ extern struct type *copy_type (const struct type *type);
++#if 0
++extern void free_all_types (void);
++#endif
++
+ #endif /* GDBTYPES_H */
+Index: gdb-7.3.50.20110722/gdb/i386-linux-nat.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/i386-linux-nat.c      2011-02-27 17:25:37.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/i386-linux-nat.c   2011-07-29 22:52:02.000000000 +0200
+@@ -649,22 +649,13 @@ i386_linux_store_inferior_registers (str
+ }
\f
+-/* Support for debug registers.  */
+-
+-static unsigned long i386_linux_dr[DR_CONTROL + 1];
+-
+ /* Get debug register REGNUM value from only the one LWP of PTID.  */
+ static unsigned long
+-i386_linux_dr_get (ptid_t ptid, int regnum)
++i386_linux_dr_get (int tid, int regnum)
+ {
+-  int tid;
+   unsigned long value;
+-  tid = TIDGET (ptid);
+-  if (tid == 0)
+-    tid = PIDGET (ptid);
+-
+   /* FIXME: kettenis/2001-03-27: Calling perror_with_name if the
+      ptrace call fails breaks debugging remote targets.  The correct
+      way to fix this is to add the hardware breakpoint and watchpoint
+@@ -686,14 +677,8 @@ i386_linux_dr_get (ptid_t ptid, int regn
+ /* Set debug register REGNUM to VALUE in only the one LWP of PTID.  */
+ static void
+-i386_linux_dr_set (ptid_t ptid, int regnum, unsigned long value)
++i386_linux_dr_set (int tid, int regnum, unsigned long value)
+ {
+-  int tid;
+-
+-  tid = TIDGET (ptid);
+-  if (tid == 0)
+-    tid = PIDGET (ptid);
+-
+   errno = 0;
+   ptrace (PTRACE_POKEUSER, tid,
+         offsetof (struct user, u_debugreg[regnum]), value);
+@@ -701,35 +686,78 @@ i386_linux_dr_set (ptid_t ptid, int regn
+     perror_with_name (_("Couldn't write debug register"));
+ }
+-/* Set DR_CONTROL to ADDR in all LWPs of LWP_LIST.  */
++/* Helper for i386_linux_dr_set_control.  */
++
++static void
++i386_linux_dr_set_control_callback (int tid, void *control_voidp)
++{
++  unsigned long control = *(unsigned long *) control_voidp;
++
++  i386_linux_dr_set (tid, DR_CONTROL, control);
++}
++
++static void i386_linux_dr_set_addr (int regnum, CORE_ADDR addr);
++
++/* Set DR_CONTROL to ADDR in all LWPs of CURRENT_INFERIOR.  */
+ static void
+ i386_linux_dr_set_control (unsigned long control)
+ {
+-  struct lwp_info *lp;
+-  ptid_t ptid;
++  int inferior_pid = ptid_get_pid (inferior_ptid);
++  struct inferior *inf = current_inferior ();
+-  i386_linux_dr[DR_CONTROL] = control;
+-  ALL_LWPS (lp, ptid)
+-    i386_linux_dr_set (ptid, DR_CONTROL, control);
++  /* The amd64 counterpart and description is amd64_linux_dr_set_control.  */
++  if (inf->pid != inferior_pid)
++    {
++      struct i386_dr_mirror *dr_mirror = i386_dr_mirror_get ();
++      int i;
++
++      if (!dr_mirror->addr_preset)
++      {
++        dr_mirror->addr_preset = 1;
++
++        for (i = 0; i < DR_LASTADDR - DR_FIRSTADDR; i++)
++          i386_linux_dr_set_addr (i, dr_mirror->addr[i]);
++      }
++    }
++
++  linux_nat_iterate_watchpoint_lwps (i386_linux_dr_set_control_callback,
++                                   &control);
+ }
+-/* Set address REGNUM (zero based) to ADDR in all LWPs of LWP_LIST.  */
++/* Helper for i386_linux_dr_set_addr.  */
++
++struct i386_linux_dr_set_addr_data
++  {
++    int regnum;
++    CORE_ADDR addr;
++  };
++
++static void
++i386_linux_dr_set_addr_callback (int tid, void *datap_voidp)
++{
++  const struct i386_linux_dr_set_addr_data *datap = datap_voidp;
++
++  i386_linux_dr_set (tid, DR_FIRSTADDR + datap->regnum, datap->addr);
++}
++
++/* Set address REGNUM (zero based) to ADDR in all LWPs of CURRENT_INFERIOR.
++   */
+ static void
+ i386_linux_dr_set_addr (int regnum, CORE_ADDR addr)
+ {
+-  struct lwp_info *lp;
+-  ptid_t ptid;
++  struct i386_linux_dr_set_addr_data data;
+   gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR);
+-  i386_linux_dr[DR_FIRSTADDR + regnum] = addr;
+-  ALL_LWPS (lp, ptid)
+-    i386_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr);
++  data.regnum = regnum;
++  data.addr = addr;
++  linux_nat_iterate_watchpoint_lwps (i386_linux_dr_set_addr_callback, &data);
+ }
+-/* Set address REGNUM (zero based) to zero in all LWPs of LWP_LIST.  */
++/* Set address REGNUM (zero based) to zero in all LWPs of CURRENT_INFERIOR.
++   */
+ static void
+ i386_linux_dr_reset_addr (int regnum)
+@@ -742,36 +770,54 @@ i386_linux_dr_reset_addr (int regnum)
+ static unsigned long
+ i386_linux_dr_get_status (void)
+ {
+-  return i386_linux_dr_get (inferior_ptid, DR_STATUS);
++  int tid;
++
++  tid = TIDGET (inferior_ptid);
++  if (tid == 0)
++    tid = PIDGET (inferior_ptid);
++
++  return i386_linux_dr_get (tid, DR_STATUS);
+ }
+-/* Unset MASK bits in DR_STATUS in all LWPs of LWP_LIST.  */
++/* Helper for i386_linux_dr_unset_status.  */
+ static void
+-i386_linux_dr_unset_status (unsigned long mask)
++i386_linux_dr_unset_status_callback (int tid, void *mask_voidp)
+ {
+-  struct lwp_info *lp;
+-  ptid_t ptid;
+-
+-  ALL_LWPS (lp, ptid)
+-    {
+-      unsigned long value;
++  unsigned long mask = *(unsigned long *) mask_voidp;
++  unsigned long value;
+       
+-      value = i386_linux_dr_get (ptid, DR_STATUS);
+-      value &= ~mask;
+-      i386_linux_dr_set (ptid, DR_STATUS, value);
+-    }
++  value = i386_linux_dr_get (tid, DR_STATUS);
++  value &= ~mask;
++  i386_linux_dr_set (tid, DR_STATUS, value);
++}
++
++/* Unset MASK bits in DR_STATUS in all LWPs of CURRENT_INFERIOR.  */
++
++static void
++i386_linux_dr_unset_status (unsigned long mask)
++{
++  linux_nat_iterate_watchpoint_lwps (i386_linux_dr_unset_status_callback,
++                                   &mask);
+ }
+ static void
+ i386_linux_new_thread (ptid_t ptid)
+ {
+-  int i;
++  struct i386_dr_mirror *dr_mirror = i386_dr_mirror_get ();
++  int i, tid;
++
++  /* Verify DR_MIRROR is valid.  */
++  gdb_assert (PIDGET (ptid) == PIDGET (inferior_ptid));
++
++  tid = TIDGET (ptid);
++  if (tid == 0)
++    tid = PIDGET (ptid);
+-  for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++)
+-    i386_linux_dr_set (ptid, i, i386_linux_dr[i]);
++  for (i = 0; i < DR_LASTADDR - DR_FIRSTADDR; i++)
++    i386_linux_dr_set (tid, DR_FIRSTADDR + i, dr_mirror->addr[i]);
+-  i386_linux_dr_set (ptid, DR_CONTROL, i386_linux_dr[DR_CONTROL]);
++  i386_linux_dr_set (tid, DR_CONTROL, dr_mirror->control);
+ }
\f
+Index: gdb-7.3.50.20110722/gdb/i386-nat.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/i386-nat.c    2011-02-26 23:04:51.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/i386-nat.c 2011-07-29 22:52:02.000000000 +0200
+@@ -25,6 +25,7 @@
+ #include "gdbcmd.h"
+ #include "target.h"
+ #include "gdb_assert.h"
++#include "inferior.h"
+ /* Support for hardware watchpoints and breakpoints using the i386
+    debug registers.
+@@ -44,7 +45,6 @@ struct i386_dr_low_type i386_dr_low;
+ #define TARGET_HAS_DR_LEN_8 (i386_dr_low.debug_register_length == 8)
+ /* Debug registers' indices.  */
+-#define DR_NADDR      4       /* The number of debug address registers.  */
+ #define DR_STATUS     6       /* Index of debug status register (DR6).  */
+ #define DR_CONTROL    7       /* Index of debug control register (DR7).  */
+@@ -111,49 +111,60 @@ struct i386_dr_low_type i386_dr_low;
+ /* The I'th debug register is vacant if its Local and Global Enable
+    bits are reset in the Debug Control register.  */
+-#define I386_DR_VACANT(i) \
+-  ((dr_control_mirror & (3 << (DR_ENABLE_SIZE * (i)))) == 0)
++
++static inline int
++i386_dr_vacant (struct i386_dr_mirror *dr_mirror, int i)
++{
++  return (dr_mirror->control & (3 << (DR_ENABLE_SIZE * i))) == 0;
++}
+ /* Locally enable the break/watchpoint in the I'th debug register.  */
+-#define I386_DR_LOCAL_ENABLE(i) \
+-  dr_control_mirror |= (1 << (DR_LOCAL_ENABLE_SHIFT + DR_ENABLE_SIZE * (i)))
+-/* Globally enable the break/watchpoint in the I'th debug register.  */
+-#define I386_DR_GLOBAL_ENABLE(i) \
+-  dr_control_mirror |= (1 << (DR_GLOBAL_ENABLE_SHIFT + DR_ENABLE_SIZE * (i)))
++static inline void
++i386_dr_local_enable (struct i386_dr_mirror *dr_mirror, int i)
++{
++  dr_mirror->control |= 1 << (DR_LOCAL_ENABLE_SHIFT + DR_ENABLE_SIZE * i);
++}
+ /* Disable the break/watchpoint in the I'th debug register.  */
+-#define I386_DR_DISABLE(i) \
+-  dr_control_mirror &= ~(3 << (DR_ENABLE_SIZE * (i)))
++
++static inline void
++i386_dr_disable (struct i386_dr_mirror *dr_mirror, int i)
++{
++  dr_mirror->control &= ~(3 << (DR_ENABLE_SIZE * i));
++}
+ /* Set in DR7 the RW and LEN fields for the I'th debug register.  */
+-#define I386_DR_SET_RW_LEN(i,rwlen) \
+-  do { \
+-    dr_control_mirror &= ~(0x0f << (DR_CONTROL_SHIFT+DR_CONTROL_SIZE*(i)));   \
+-    dr_control_mirror |= ((rwlen) << (DR_CONTROL_SHIFT+DR_CONTROL_SIZE*(i))); \
+-  } while (0)
++
++static inline void
++i386_dr_set_rw_len (struct i386_dr_mirror *dr_mirror, int i, unsigned rwlen)
++{
++  dr_mirror->control &= ~(0x0f << (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * i));
++  dr_mirror->control |= rwlen << (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * i);
++}
+ /* Get from DR7 the RW and LEN fields for the I'th debug register.  */
+-#define I386_DR_GET_RW_LEN(i) \
+-  ((dr_control_mirror >> (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * (i))) & 0x0f)
++
++static inline unsigned
++i386_dr_get_rw_len (struct i386_dr_mirror *dr_mirror, int i)
++{
++  return ((dr_mirror->control >> (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * i))
++        & 0x0f);
++}
+ /* Mask that this I'th watchpoint has triggered.  */
+ #define I386_DR_WATCH_MASK(i) (1 << (i))
+ /* Did the watchpoint whose address is in the I'th register break?  */
+-#define I386_DR_WATCH_HIT(i)  (dr_status_mirror & I386_DR_WATCH_MASK (i))
++static inline int
++i386_dr_watch_hit (struct i386_dr_mirror *dr_mirror, int i)
++{
++  return (dr_mirror->status & I386_DR_WATCH_MASK (i)) != 0;
++}
+ /* A macro to loop over all debug registers.  */
+ #define ALL_DEBUG_REGISTERS(i)        for (i = 0; i < DR_NADDR; i++)
+-/* Mirror the inferior's DRi registers.  We keep the status and
+-   control registers separated because they don't hold addresses.  */
+-static CORE_ADDR dr_mirror[DR_NADDR];
+-static unsigned long dr_status_mirror, dr_control_mirror;
+-
+-/* Reference counts for each debug register.  */
+-static int dr_ref_count[DR_NADDR];
+-
+ /* Whether or not to print the mirrored debug registers.  */
+ static int maint_show_dr;
+@@ -195,21 +206,80 @@ static int i386_handle_nonaligned_watchp
+ /* Implementation.  */
++/* Per-inferior data key.  */
++static const struct inferior_data *i386_inferior_data;
++
++struct i386_inferior_data
++  {
++    /* Copy of i386 hardware debug registers for performance reasons.  */
++    struct i386_dr_mirror dr_mirror;
++  };
++
++static void
++i386_inferior_data_cleanup (struct inferior *inf, void *arg)
++{
++  struct i386_inferior_data *inf_data = arg;
++
++  xfree (inf_data);
++}
++
++static struct i386_inferior_data *
++i386_inferior_data_get (void)
++{
++  struct inferior *inf = current_inferior ();
++  struct i386_inferior_data *inf_data;
++
++  inf_data = inferior_data (inf, i386_inferior_data);
++  if (inf_data == NULL)
++    {
++      inf_data = xzalloc (sizeof (*inf_data));
++      set_inferior_data (current_inferior (), i386_inferior_data, inf_data);
++    }
++
++  if (inf->pid != ptid_get_pid (inferior_ptid))
++    {
++      static struct i386_inferior_data detached_inf_data_local;
++      static int detached_inf_pid = -1;
++
++      if (detached_inf_pid != ptid_get_pid (inferior_ptid))
++      {
++        detached_inf_pid = ptid_get_pid (inferior_ptid);
++
++        /* Forked processes get a copy of the debug registers.  */
++        memcpy (&detached_inf_data_local, inf_data,
++                sizeof (detached_inf_data_local));
++        detached_inf_data_local.dr_mirror.addr_preset = 0;
++      }
++
++      return &detached_inf_data_local;
++    }
++
++  return inf_data;
++}
++
+ /* Clear the reference counts and forget everything we knew about the
+    debug registers.  */
++struct i386_dr_mirror *
++i386_dr_mirror_get (void)
++{
++  return &i386_inferior_data_get ()->dr_mirror;
++}
++
+ void
+ i386_cleanup_dregs (void)
+ {
++  struct i386_dr_mirror *dr_mirror = i386_dr_mirror_get ();
+   int i;
+   ALL_DEBUG_REGISTERS(i)
+     {
+-      dr_mirror[i] = 0;
+-      dr_ref_count[i] = 0;
++      dr_mirror->addr[i] = 0;
++      dr_mirror->ref_count[i] = 0;
+     }
+-  dr_control_mirror = 0;
+-  dr_status_mirror  = 0;
++  dr_mirror->addr_preset = 0;
++  dr_mirror->control = 0;
++  dr_mirror->status = 0;
+ }
+ /* Print the values of the mirrored debug registers.  This is called
+@@ -220,6 +290,7 @@ static void
+ i386_show_dr (const char *func, CORE_ADDR addr,
+             int len, enum target_hw_bp_type type)
+ {
++  struct i386_dr_mirror *dr_mirror = i386_dr_mirror_get ();
+   int addr_size = gdbarch_addr_bit (target_gdbarch) / 8;
+   int i;
+@@ -239,13 +310,16 @@ i386_show_dr (const char *func, CORE_ADD
+                               : "??unknown??"))));
+   puts_unfiltered (":\n");
+   printf_unfiltered ("\tCONTROL (DR7): %s          STATUS (DR6): %s\n",
+-                   phex (dr_control_mirror, 8), phex (dr_status_mirror, 8));
++                   phex (dr_mirror->control, 8),
++                   phex (dr_mirror->status, 8));
+   ALL_DEBUG_REGISTERS(i)
+     {
+       printf_unfiltered ("\
+ \tDR%d: addr=0x%s, ref.count=%d  DR%d: addr=0x%s, ref.count=%d\n",
+-               i, phex (dr_mirror[i], addr_size), dr_ref_count[i],
+-               i+1, phex (dr_mirror[i+1], addr_size), dr_ref_count[i+1]);
++                       i, phex (dr_mirror->addr[i], addr_size),
++                       dr_mirror->ref_count[i], i + 1,
++                       phex (dr_mirror->addr[i + 1], addr_size),
++                       dr_mirror->ref_count[i + 1]);
+       i++;
+     }
+ }
+@@ -313,6 +387,7 @@ Invalid hardware breakpoint length %d in
+ static int
+ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
+ {
++  struct i386_dr_mirror *dr_mirror = i386_dr_mirror_get ();
+   int i;
+   if (!i386_dr_low.set_addr || !i386_dr_low.set_control)
+@@ -323,11 +398,10 @@ i386_insert_aligned_watchpoint (CORE_ADD
+      reuse it for this watchpoint as well (and save a register).  */
+   ALL_DEBUG_REGISTERS(i)
+     {
+-      if (!I386_DR_VACANT (i)
+-        && dr_mirror[i] == addr
+-        && I386_DR_GET_RW_LEN (i) == len_rw_bits)
++      if (!i386_dr_vacant (dr_mirror, i) && dr_mirror->addr[i] == addr
++        && i386_dr_get_rw_len (dr_mirror, i) == len_rw_bits)
+       {
+-        dr_ref_count[i]++;
++        dr_mirror->ref_count[i]++;
+         return 0;
+       }
+     }
+@@ -335,7 +409,7 @@ i386_insert_aligned_watchpoint (CORE_ADD
+   /* Next, look for a vacant debug register.  */
+   ALL_DEBUG_REGISTERS(i)
+     {
+-      if (I386_DR_VACANT (i))
++      if (i386_dr_vacant (dr_mirror, i))
+       break;
+     }
+@@ -346,9 +420,9 @@ i386_insert_aligned_watchpoint (CORE_ADD
+   /* Now set up the register I to watch our region.  */
+   /* Record the info in our local mirrored array.  */
+-  dr_mirror[i] = addr;
+-  dr_ref_count[i] = 1;
+-  I386_DR_SET_RW_LEN (i, len_rw_bits);
++  dr_mirror->addr[i] = addr;
++  dr_mirror->ref_count[i] = 1;
++  i386_dr_set_rw_len (dr_mirror, i, len_rw_bits);
+   /* Note: we only enable the watchpoint locally, i.e. in the current
+      task.  Currently, no i386 target allows or supports global
+      watchpoints; however, if any target would want that in the
+@@ -356,13 +430,13 @@ i386_insert_aligned_watchpoint (CORE_ADD
+      to enable watchpoints globally or locally, and the code below
+      should use global or local enable and slow-down flags as
+      appropriate.  */
+-  I386_DR_LOCAL_ENABLE (i);
+-  dr_control_mirror |= DR_LOCAL_SLOWDOWN;
+-  dr_control_mirror &= I386_DR_CONTROL_MASK;
++  i386_dr_local_enable (dr_mirror, i);
++  dr_mirror->control |= DR_LOCAL_SLOWDOWN;
++  dr_mirror->control &= I386_DR_CONTROL_MASK;
+   /* Finally, actually pass the info to the inferior.  */
+   i386_dr_low.set_addr (i, addr);
+-  i386_dr_low.set_control (dr_control_mirror);
++  i386_dr_low.set_control (dr_mirror->control);
+   /* Only a sanity check for leftover bits (set possibly only by inferior).  */
+   if (i386_dr_low.unset_status)
+@@ -380,21 +454,21 @@ i386_insert_aligned_watchpoint (CORE_ADD
+ static int
+ i386_remove_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits)
+ {
++  struct i386_dr_mirror *dr_mirror = i386_dr_mirror_get ();
+   int i, retval = -1;
+   ALL_DEBUG_REGISTERS(i)
+     {
+-      if (!I386_DR_VACANT (i)
+-        && dr_mirror[i] == addr
+-        && I386_DR_GET_RW_LEN (i) == len_rw_bits)
++      if (!i386_dr_vacant (dr_mirror, i) && dr_mirror->addr[i] == addr
++        && i386_dr_get_rw_len (dr_mirror, i) == len_rw_bits)
+       {
+-        if (--dr_ref_count[i] == 0) /* no longer in use?  */
++        if (--dr_mirror->ref_count[i] == 0) /* no longer in use?  */
+           {
+             /* Reset our mirror.  */
+-            dr_mirror[i] = 0;
+-            I386_DR_DISABLE (i);
++            dr_mirror->addr[i] = 0;
++            i386_dr_disable (dr_mirror, i);
+             /* Reset it in the inferior.  */
+-            i386_dr_low.set_control (dr_control_mirror);
++            i386_dr_low.set_control (dr_mirror->control);
+             if (i386_dr_low.reset_addr)
+               i386_dr_low.reset_addr (i);
+           }
+@@ -556,26 +630,27 @@ i386_region_ok_for_watchpoint (CORE_ADDR
+ static int
+ i386_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p)
+ {
++  struct i386_dr_mirror *dr_mirror = i386_dr_mirror_get ();
+   CORE_ADDR addr = 0;
+   int i;
+   int rc = 0;
+-  dr_status_mirror = i386_dr_low.get_status ();
++  dr_mirror->status = i386_dr_low.get_status ();
+   ALL_DEBUG_REGISTERS(i)
+     {
+-      if (I386_DR_WATCH_HIT (i)
++      if (i386_dr_watch_hit (dr_mirror, i)
+         /* This second condition makes sure DRi is set up for a data
+            watchpoint, not a hardware breakpoint.  The reason is
+            that GDB doesn't call the target_stopped_data_address
+            method except for data watchpoints.  In other words, I'm
+            being paranoiac.  */
+-        && I386_DR_GET_RW_LEN (i) != 0
++        && i386_dr_get_rw_len (dr_mirror, i) != 0
+         /* This third condition makes sure DRi is not vacant, this
+            avoids false positives in windows-nat.c.  */
+-        && !I386_DR_VACANT (i))
++        && !i386_dr_vacant (dr_mirror, i))
+       {
+-        addr = dr_mirror[i];
++        addr = dr_mirror->addr[i];
+         rc = 1;
+         if (maint_show_dr)
+           i386_show_dr ("watchpoint_hit", addr, -1, hw_write);
+@@ -689,6 +764,10 @@ i386_use_watchpoints (struct target_ops
+   t->to_remove_watchpoint = i386_remove_watchpoint;
+   t->to_insert_hw_breakpoint = i386_insert_hw_breakpoint;
+   t->to_remove_hw_breakpoint = i386_remove_hw_breakpoint;
++
++  if (i386_inferior_data == NULL)
++    i386_inferior_data
++      = register_inferior_data_with_cleanup (i386_inferior_data_cleanup);
+ }
+ void
+Index: gdb-7.3.50.20110722/gdb/i386-nat.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/i386-nat.h    2011-01-09 04:08:56.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/i386-nat.h 2011-07-29 22:52:02.000000000 +0200
+@@ -78,6 +78,28 @@ struct i386_dr_low_type
+ extern struct i386_dr_low_type i386_dr_low;
++/* The number of debug address registers.  */
++#define DR_NADDR      4
++
++/* Copy of hardware debug registers for performance reasons.  */
++
++struct i386_dr_mirror
++  {
++    /* Mirror the inferior's DRi registers.  We keep the status and
++       control registers separated because they don't hold addresses.  */
++    CORE_ADDR addr[DR_NADDR];
++
++    /* All the ADDR hardware registers have been written at least once.  */
++    unsigned addr_preset : 1;
++
++    /* Reference counts for each debug register.  */
++    int ref_count[DR_NADDR];
++
++    unsigned long status, control;
++  };
++
++extern struct i386_dr_mirror *i386_dr_mirror_get (void);
++
+ /* Use this function to set i386_dr_low debug_register_length field
+    rather than setting it directly to check that the length is only
+    set once.  It also enables the 'maint set/show show-debug-regs' 
+Index: gdb-7.3.50.20110722/gdb/infrun.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/infrun.c      2011-07-22 01:46:09.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/infrun.c   2011-07-29 22:52:02.000000000 +0200
+@@ -55,6 +55,8 @@
+ #include "jit.h"
+ #include "tracepoint.h"
+ #include "continuations.h"
++#include "stap-probe.h"
++#include "objfiles.h"
+ /* Prototypes for local functions */
+@@ -2341,7 +2343,7 @@ static void handle_step_into_function (s
+ static void handle_step_into_function_backward (struct gdbarch *gdbarch,
+                                               struct execution_control_state *ecs);
+ static void check_exception_resume (struct execution_control_state *,
+-                                  struct frame_info *, struct symbol *);
++                                  struct frame_info *);
+ static void stop_stepping (struct execution_control_state *ecs);
+ static void prepare_to_wait (struct execution_control_state *ecs);
+@@ -4285,9 +4287,17 @@ process_event_stop_test:
+       if (what.is_longjmp)
+         {
+-          if (!gdbarch_get_longjmp_target_p (gdbarch)
+-              || !gdbarch_get_longjmp_target (gdbarch,
+-                                              frame, &jmp_buf_pc))
++          struct value *arg_value;
++
++          /* If we set the longjmp breakpoint via a SystemTap probe,
++             then use it to extract the arguments.  The destination
++             PC is the third argument to the probe.  */
++          arg_value = stap_safe_evaluate_at_pc (frame, 2);
++          if (arg_value)
++            jmp_buf_pc = value_as_address (arg_value);
++          else if (!gdbarch_get_longjmp_target_p (gdbarch)
++                   || !gdbarch_get_longjmp_target (gdbarch,
++                                                   frame, &jmp_buf_pc))
+             {
+               if (debug_infrun)
+                 fprintf_unfiltered (gdb_stdlog,
+@@ -4305,12 +4315,7 @@ process_event_stop_test:
+           insert_longjmp_resume_breakpoint (gdbarch, jmp_buf_pc);
+         }
+       else
+-        {
+-          struct symbol *func = get_frame_function (frame);
+-
+-          if (func)
+-            check_exception_resume (ecs, frame, func);
+-        }
++        check_exception_resume (ecs, frame);
+       keep_going (ecs);
+       return;
+@@ -5423,15 +5428,65 @@ insert_exception_resume_breakpoint (stru
+     }
+ }
++/* A helper for check_exception_resume that sets an
++   exception-breakpoint based on a SystemTap probe.  */
++
++static void
++insert_exception_resume_from_probe (struct thread_info *tp,
++                                  const struct stap_probe *probe,
++                                  struct objfile *objfile,
++                                  struct frame_info *frame)
++{
++  struct value *arg_value;
++  CORE_ADDR handler;
++  struct breakpoint *bp;
++
++  arg_value = stap_safe_evaluate_at_pc (frame, 1);
++  if (!arg_value)
++    return;
++
++  handler = value_as_address (arg_value);
++
++  if (debug_infrun)
++    fprintf_unfiltered (gdb_stdlog,
++                      "infrun: exception resume at %s\n",
++                      paddress (get_objfile_arch (objfile),
++                                handler));
++
++  bp = set_momentary_breakpoint_at_pc (get_frame_arch (frame),
++                                     handler, bp_exception_resume);
++  bp->thread = tp->num;
++  inferior_thread ()->control.exception_resume_breakpoint = bp;
++}
++
+ /* This is called when an exception has been intercepted.  Check to
+    see whether the exception's destination is of interest, and if so,
+    set an exception resume breakpoint there.  */
+ static void
+ check_exception_resume (struct execution_control_state *ecs,
+-                      struct frame_info *frame, struct symbol *func)
++                      struct frame_info *frame)
+ {
+   struct gdb_exception e;
++  struct objfile *objfile;
++  const struct stap_probe *probe;
++  struct symbol *func;
++
++  /* First see if this exception unwinding breakpoint was set via a
++     SystemTap probe point.  If so, the probe has two arguments: the
++     CFA and the HANDLER.  We ignore the CFA, extract the handler, and
++     set a breakpoint there.  */
++  probe = find_probe_by_pc (get_frame_pc (frame), &objfile);
++  if (probe)
++    {
++      insert_exception_resume_from_probe (ecs->event_thread, probe,
++                                        objfile, frame);
++      return;
++    }
++
++  func = get_frame_function (frame);
++  if (!func)
++    return;
+   TRY_CATCH (e, RETURN_MASK_ERROR)
+     {
+@@ -6434,7 +6489,8 @@ static const struct lval_funcs siginfo_v
+    if there's no object available.  */
+ static struct value *
+-siginfo_make_value (struct gdbarch *gdbarch, struct internalvar *var)
++siginfo_make_value (struct gdbarch *gdbarch, struct internalvar *var,
++                  void *ignore)
+ {
+   if (target_has_stack
+       && !ptid_equal (inferior_ptid, null_ptid)
+@@ -6929,6 +6985,15 @@ show_schedule_multiple (struct ui_file *
+                           "of all processes is %s.\n"), value);
+ }
++/* Implementation of `siginfo' variable.  */
++
++static const struct internalvar_funcs siginfo_funcs =
++{
++  siginfo_make_value,
++  NULL,
++  NULL
++};
++
+ void
+ _initialize_infrun (void)
+ {
+@@ -7204,7 +7269,7 @@ Tells gdb whether to detach the child of
+      value with a void typed value, and when we get here, gdbarch
+      isn't initialized yet.  At this point, we're quite sure there
+      isn't another convenience variable of the same name.  */
+-  create_internalvar_type_lazy ("_siginfo", siginfo_make_value);
++  create_internalvar_type_lazy ("_siginfo", &siginfo_funcs, NULL);
+   add_setshow_boolean_cmd ("observer", no_class,
+                          &observer_mode_1, _("\
+Index: gdb-7.3.50.20110722/gdb/linespec.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/linespec.c    2011-07-05 22:30:19.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/linespec.c 2011-07-29 22:52:02.000000000 +0200
+@@ -43,6 +43,7 @@
+ #include "arch-utils.h"
+ #include <ctype.h>
+ #include "cli/cli-utils.h"
++#include "stap-probe.h"
+ /* Prototypes for local functions.  */
+@@ -783,6 +784,7 @@ keep_name_info (char *p, int on_boundary
+    PC returned is 0.
+    FILE:FUNCTION -- likewise, but prefer functions in that file.
+    *EXPR -- line in which address EXPR appears.
++   probe:[OBJFILE:][PROVIDER:]NAME -- a systemtap static probe
+    This may all be followed by an "if EXPR", which we ignore.
+@@ -851,6 +853,9 @@ decode_line_1 (char **argptr, int funfir
+   if (**argptr == '*')
+     return decode_indirect (argptr);
++  if (strncmp (*argptr, "probe:", 6) == 0)
++    return parse_stap_probe (argptr, canonical);
++
+   is_quoted = (strchr (get_gdb_completer_quote_characters (),
+                      **argptr) != NULL);
+Index: gdb-7.3.50.20110722/gdb/linespec.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/linespec.h    2011-04-04 19:41:07.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/linespec.h 2011-07-29 22:52:02.000000000 +0200
+@@ -30,6 +30,10 @@ struct linespec_result
+      display mechanism would do the wrong thing.  */
+   int special_display;
++  /* If non-zero, the linespec result should be considered to be a
++     "pre-expanded" multi-location linespec.  */
++  int pre_expanded;
++
+   /* If non-NULL, an array of canonical names for returned
+      symtab_and_line objects.  The array has as many elements as the
+      `nelts' field in the symtabs_and_line returned by decode_line_1.
+Index: gdb-7.3.50.20110722/gdb/linux-nat.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/linux-nat.c   2011-07-22 01:46:09.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/linux-nat.c        2011-07-29 22:52:02.000000000 +0200
+@@ -1241,6 +1241,64 @@ iterate_over_lwps (ptid_t filter,
+   return NULL;
+ }
++/* Helper for linux_nat_iterate_watchpoint_lwps.  */
++
++struct iterate_watchpoint_lwps_data
++  {
++    linux_nat_iterate_watchpoint_lwps_ftype callback;
++    void *callback_data;
++  };
++
++static int
++iterate_watchpoint_lwps_callback (struct lwp_info *lp, void *datap_voidp)
++{
++  struct iterate_watchpoint_lwps_data *datap = datap_voidp;
++  int tid;
++
++  tid = TIDGET (lp->ptid);
++  if (tid == 0)
++    tid = PIDGET (lp->ptid);
++
++  datap->callback (tid, datap->callback_data);
++
++  /* Continue the traversal.  */
++  return 0;
++}
++
++/* Iterate like iterate_over_lwps does except when forking-off a child call
++   CALLBACK with CALLBACK_DATA specifically only for that new child PID.
++
++   During `set follow-fork-mode child' the call is also made for the new child
++   PID; parent watchpoints get detached elsewhere (during target_detach).  */
++
++void
++linux_nat_iterate_watchpoint_lwps
++  (linux_nat_iterate_watchpoint_lwps_ftype callback, void *callback_data)
++{
++  struct iterate_watchpoint_lwps_data data;
++  int inferior_pid = ptid_get_pid (inferior_ptid);
++  struct inferior *inf = current_inferior ();
++
++  data.callback = callback;
++  data.callback_data = callback_data;
++
++  if (inf->pid == inferior_pid)
++    {
++      /* Standard mode.  Iterate all the threads of the current inferior.
++       Without specifying INFERIOR_PID it would iterate all the threads of
++       all the inferiors, which is inappropriate for watchpoints.  */
++
++      iterate_over_lwps (pid_to_ptid (inferior_pid),
++                       iterate_watchpoint_lwps_callback, &data);
++    }
++  else
++    {
++      /* Detaching a new child PID temporarily present in INFERIOR_PID.  */
++
++      callback (inferior_pid, callback_data);
++    }
++}
++
+ /* Update our internal state when changing from one checkpoint to
+    another indicated by NEW_PTID.  We can only switch single-threaded
+    applications, so we only create one new LWP, and the previous list
+Index: gdb-7.3.50.20110722/gdb/linux-nat.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/linux-nat.h   2011-01-05 23:22:49.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/linux-nat.h        2011-07-29 22:52:02.000000000 +0200
+@@ -140,6 +140,11 @@ struct lwp_info *iterate_over_lwps (ptid
+                                                    void *), 
+                                   void *data);
++typedef void (*linux_nat_iterate_watchpoint_lwps_ftype) (int tid, void *data);
++
++extern void linux_nat_iterate_watchpoint_lwps
++  (linux_nat_iterate_watchpoint_lwps_ftype callback, void *callback_data);
++
+ /* Create a prototype generic GNU/Linux target.  The client can
+    override it with local methods.  */
+ struct target_ops * linux_target (void);
+Index: gdb-7.3.50.20110722/gdb/machoread.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/machoread.c   2011-07-01 20:36:45.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/machoread.c        2011-07-29 22:52:02.000000000 +0200
+@@ -842,6 +842,7 @@ static const struct sym_fns macho_sym_fn
+   default_symfile_segments,   /* Get segment information from a file.  */
+   NULL,
+   macho_symfile_relocate,     /* Relocate a debug section.  */
++  NULL,                               /* sym_get_probes */
+   &psym_functions
+ };
+Index: gdb-7.3.50.20110722/gdb/main.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/main.c        2011-06-13 12:55:26.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/main.c     2011-07-29 22:52:02.000000000 +0200
+@@ -39,6 +39,7 @@
+ #include "interps.h"
+ #include "main.h"
++#include "python/python.h"
+ #include "source.h"
+ #include "cli/cli-cmds.h"
+ #include "python/python.h"
+@@ -262,6 +263,8 @@ captured_main (void *data)
+   char *cdarg = NULL;
+   char *ttyarg = NULL;
++  int python_script = 0;
++
+   /* These are static so that we can take their address in an
+      initializer.  */
+   static int print_help;
+@@ -452,10 +455,14 @@ captured_main (void *data)
+       {"args", no_argument, &set_args, 1},
+       {"l", required_argument, 0, 'l'},
+       {"return-child-result", no_argument, &return_child_result, 1},
++#if HAVE_PYTHON
++      {"python", no_argument, 0, 'P'},
++      {"P", no_argument, 0, 'P'},
++#endif
+       {0, no_argument, 0, 0}
+     };
+-    while (1)
++    while (!python_script)
+       {
+       int option_index;
+@@ -473,6 +480,9 @@ captured_main (void *data)
+         case 0:
+           /* Long option that just sets a flag.  */
+           break;
++        case 'P':
++          python_script = 1;
++          break;
+         case OPT_SE:
+           symarg = optarg;
+           execarg = optarg;
+@@ -668,7 +678,31 @@ captured_main (void *data)
+   /* Now that gdb_init has created the initial inferior, we're in
+      position to set args for that inferior.  */
+-  if (set_args)
++  if (python_script)
++    {
++      /* The first argument is a python script to evaluate, and
++       subsequent arguments are passed to the script for
++       processing there.  */
++      if (optind >= argc)
++      {
++        fprintf_unfiltered (gdb_stderr,
++                            _("%s: Python script file name required\n"),
++                            argv[0]);
++        exit (1);
++      }
++
++      /* FIXME: should handle inferior I/O intelligently here.
++       E.g., should be possible to run gdb in pipeline and have
++       Python (and gdb) output go to stderr or file; and if a
++       prompt is needed, open the tty.  */
++      quiet = 1;
++      /* FIXME: should read .gdbinit if, and only if, a prompt is
++       requested by the script.  Though... maybe this is not
++       ideal?  */
++      /* FIXME: likewise, reading in history.  */
++      inhibit_gdbinit = 1;
++    }
++  else if (set_args)
+     {
+       /* The remaining options are the command-line options for the
+        inferior.  The first one is the sym/exec file, and the rest
+@@ -917,7 +951,8 @@ captured_main (void *data)
+   /* Read in the old history after all the command files have been
+      read.  */
+-  init_history ();
++  if (!python_script)
++    init_history ();
+   if (batch_flag)
+     {
+@@ -928,13 +963,25 @@ captured_main (void *data)
+   /* Show time and/or space usage.  */
+   do_cleanups (pre_stat_chain);
+-  /* NOTE: cagney/1999-11-07: There is probably no reason for not
+-     moving this loop and the code found in captured_command_loop()
+-     into the command_loop() proper.  The main thing holding back that
+-     change - SET_TOP_LEVEL() - has been eliminated.  */
+-  while (1)
++#if HAVE_PYTHON
++  if (python_script)
++    {
++      extern int pagination_enabled;
++      pagination_enabled = 0;
++      run_python_script (argc - optind, &argv[optind]);
++      return 1;
++    }
++  else
++#endif
+     {
+-      catch_errors (captured_command_loop, 0, "", RETURN_MASK_ALL);
++      /* NOTE: cagney/1999-11-07: There is probably no reason for not
++       moving this loop and the code found in captured_command_loop()
++       into the command_loop() proper.  The main thing holding back that
++       change - SET_TOP_LEVEL() - has been eliminated. */
++      while (1)
++      {
++        catch_errors (captured_command_loop, 0, "", RETURN_MASK_ALL);
++      }
+     }
+   /* No exit -- exit is through quit_command.  */
+ }
+@@ -966,7 +1013,12 @@ print_gdb_help (struct ui_file *stream)
+   fputs_unfiltered (_("\
+ This is the GNU debugger.  Usage:\n\n\
+     gdb [options] [executable-file [core-file or process-id]]\n\
+-    gdb [options] --args executable-file [inferior-arguments ...]\n\n\
++    gdb [options] --args executable-file [inferior-arguments ...]\n"), stream);
++#if HAVE_PYTHON
++  fputs_unfiltered (_("\
++    gdb [options] [--python|-P] script-file [script-arguments ...]\n"), stream);
++#endif
++  fputs_unfiltered (_("\n\
+ Options:\n\n\
+ "), stream);
+   fputs_unfiltered (_("\
+@@ -1004,7 +1056,13 @@ Options:\n\n\
+   --nw                     Do not use a window interface.\n\
+   --nx               Do not read "), stream);
+   fputs_unfiltered (gdbinit, stream);
+-  fputs_unfiltered (_(" file.\n\
++  fputs_unfiltered (_(" file.\n"), stream);
++#if HAVE_PYTHON
++  fputs_unfiltered (_("\
++  --python, -P       Following argument is Python script file; remaining\n\
++                     arguments are passed to script.\n"), stream);
++#endif
++  fputs_unfiltered (_("\
+   --quiet            Do not print version number on startup.\n\
+   --readnow          Fully read symbol files on first access.\n\
+ "), stream);
+Index: gdb-7.3.50.20110722/gdb/mi/mi-cmd-var.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/mi/mi-cmd-var.c       2011-06-27 21:21:51.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/mi/mi-cmd-var.c    2011-07-29 22:52:02.000000000 +0200
+@@ -707,7 +707,6 @@ mi_cmd_var_update (char *command, char *
+     }
+   else
+     {
+-      /* Get varobj handle, if a valid var obj name was specified */
+       struct varobj *var = varobj_get_handle (name);
+       varobj_update_one (var, print_values, 1 /* explicit */);
+Index: gdb-7.3.50.20110722/gdb/mipsread.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/mipsread.c    2011-04-19 20:04:07.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/mipsread.c 2011-07-29 22:52:02.000000000 +0200
+@@ -402,6 +402,7 @@ static const struct sym_fns ecoff_sym_fn
+   default_symfile_segments,   /* Get segment information from a file.  */
+   NULL,
+   default_symfile_relocate,   /* Relocate a debug section.  */
++  NULL,                               /* sym_probe_fns */
+   &psym_functions
+ };
+Index: gdb-7.3.50.20110722/gdb/objfiles.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/objfiles.c    2011-06-14 18:49:41.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/objfiles.c 2011-07-29 22:52:02.000000000 +0200
+@@ -842,6 +842,11 @@ objfile_relocate1 (struct objfile *objfi
+                               obj_section_addr (s));
+     }
++  /* Relocating SystemTap probes.  */
++  if (objfile->sf && objfile->sf->sym_probe_fns)
++    objfile->sf->sym_probe_fns->sym_relocate_probe (objfile,
++                                                  new_offsets, delta);
++
+   /* Data changed.  */
+   return 1;
+ }
+Index: gdb-7.3.50.20110722/gdb/p-valprint.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/p-valprint.c  2011-03-15 17:00:56.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/p-valprint.c       2011-07-29 22:52:02.000000000 +0200
+@@ -39,6 +39,7 @@
+ #include "cp-abi.h"
+ #include "cp-support.h"
+ #include "exceptions.h"
++#include "dwarf2loc.h"
\f
+ /* See val_print for a description of the various parameters of this
+@@ -63,8 +64,31 @@ pascal_val_print (struct type *type, con
+   struct type *char_type;
+   LONGEST val;
+   CORE_ADDR addr;
++  struct cleanup *back_to;
++  struct type *saved_type = type;
++  CORE_ADDR saved_address = address;
++  
++  back_to = make_cleanup (null_cleanup, 0);
++  address += embedded_offset;
++  type = object_address_get_data (type, &address);
++  if (type == NULL)
++    {
++      fputs_filtered (object_address_data_not_valid (saved_type), stream);
++      gdb_flush (stream);
++      do_cleanups (back_to);
++      return 0;
++    }
++  if (address != saved_address + embedded_offset)
++    {
++      size_t length = TYPE_LENGTH (type);
+-  CHECK_TYPEDEF (type);
++      valaddr = xmalloc (length);
++      make_cleanup (xfree, (gdb_byte *) valaddr);
++      read_memory (address, (gdb_byte *) valaddr, length);
++      embedded_offset = 0;
++    }
++  else
++    address -= embedded_offset;
+   switch (TYPE_CODE (type))
+     {
+     case TYPE_CODE_ARRAY:
+@@ -120,8 +144,8 @@ pascal_val_print (struct type *type, con
+               {
+                 i = 0;
+               }
+-            val_print_array_elements (type, valaddr, embedded_offset,
+-                                      address, stream, recurse,
++            val_print_array_elements (saved_type, valaddr, embedded_offset,
++                                      saved_address, stream, recurse,
+                                       original_value, options, i);
+             fprintf_filtered (stream, "}");
+           }
+@@ -160,6 +184,7 @@ pascal_val_print (struct type *type, con
+         /* Try to print what function it points to.  */
+         print_address_demangle (gdbarch, addr, stream, demangle);
+         /* Return value is irrelevant except for string pointers.  */
++        do_cleanups (back_to);
+         return (0);
+       }
+@@ -251,6 +276,7 @@ pascal_val_print (struct type *type, con
+       /* Return number of characters printed, including the terminating
+        '\0' if we reached the end.  val_print_string takes care including
+        the terminating '\0' if necessary.  */
++      do_cleanups (back_to);
+       return i;
+       break;
+@@ -567,6 +593,7 @@ pascal_val_print (struct type *type, con
+            TYPE_CODE (type));
+     }
+   gdb_flush (stream);
++  do_cleanups (back_to);
+   return (0);
+ }
\f
+Index: gdb-7.3.50.20110722/gdb/parse.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/parse.c       2011-06-17 22:24:22.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/parse.c    2011-07-29 22:52:02.000000000 +0200
+@@ -1501,6 +1501,7 @@ parser_fprintf (FILE *x, const char *y,
+ int
+ operator_check_standard (struct expression *exp, int pos,
++                       int (*type_func) (struct type *type, void *data),
+                        int (*objfile_func) (struct objfile *objfile,
+                                             void *data),
+                        void *data)
+@@ -1542,7 +1543,7 @@ operator_check_standard (struct expressi
+           struct type *type = elts[pos + 2 + arg].type;
+           struct objfile *objfile = TYPE_OBJFILE (type);
+-          if (objfile && (*objfile_func) (objfile, data))
++          if (objfile && objfile_func && (*objfile_func) (objfile, data))
+             return 1;
+         }
+       }
+@@ -1560,7 +1561,8 @@ operator_check_standard (struct expressi
+       /* Check objfile where the variable itself is placed.
+          SYMBOL_OBJ_SECTION (symbol) may be NULL.  */
+-      if ((*objfile_func) (SYMBOL_SYMTAB (symbol)->objfile, data))
++      if (objfile_func
++          && (*objfile_func) (SYMBOL_SYMTAB (symbol)->objfile, data))
+         return 1;
+       /* Check objfile where is placed the code touching the variable.  */
+@@ -1573,24 +1575,27 @@ operator_check_standard (struct expressi
+   /* Invoke callbacks for TYPE and OBJFILE if they were set as non-NULL.  */
+-  if (type && TYPE_OBJFILE (type)
++  if (type && type_func && (*type_func) (type, data))
++    return 1;
++  if (type && TYPE_OBJFILE (type) && objfile_func
+       && (*objfile_func) (TYPE_OBJFILE (type), data))
+     return 1;
+-  if (objfile && (*objfile_func) (objfile, data))
++  if (objfile && objfile_func && (*objfile_func) (objfile, data))
+     return 1;
+   return 0;
+ }
+-/* Call OBJFILE_FUNC for any TYPE and OBJFILE found being referenced by EXP.
+-   The functions are never called with NULL OBJFILE.  Functions get passed an
+-   arbitrary caller supplied DATA pointer.  If any of the functions returns
+-   non-zero value then (any other) non-zero value is immediately returned to
+-   the caller.  Otherwise zero is returned after iterating through whole EXP.
+-   */
++/* Call TYPE_FUNC and OBJFILE_FUNC for any TYPE and OBJFILE found being
++   referenced by EXP.  The functions are never called with NULL TYPE or NULL
++   OBJFILE.  Functions get passed an arbitrary caller supplied DATA pointer.
++   If any of the functions returns non-zero value then (any other) non-zero
++   value is immediately returned to the caller.  Otherwise zero is returned
++   after iterating through whole EXP.  */
+ static int
+ exp_iterate (struct expression *exp,
++           int (*type_func) (struct type *type, void *data),
+            int (*objfile_func) (struct objfile *objfile, void *data),
+            void *data)
+ {
+@@ -1605,7 +1610,9 @@ exp_iterate (struct expression *exp,
+       pos = endpos - oplen;
+       if (exp->language_defn->la_exp_desc->operator_check (exp, pos,
+-                                                         objfile_func, data))
++                                                         type_func,
++                                                         objfile_func,
++                                                         data))
+       return 1;
+       endpos = pos;
+@@ -1636,8 +1643,29 @@ exp_uses_objfile (struct expression *exp
+ {
+   gdb_assert (objfile->separate_debug_objfile_backlink == NULL);
+-  return exp_iterate (exp, exp_uses_objfile_iter, objfile);
++  return exp_iterate (exp, NULL, exp_uses_objfile_iter, objfile);
++}
++
++/* Helper for exp_types_mark_used.  */
++
++#if 0
++static int
++exp_types_mark_used_iter (struct type *type, void *unused)
++{
++  type_mark_used (type);
++
++  /* Continue the traversal.  */
++  return 0;
++}
++
++/* Call type_mark_used for any type contained in EXP.  */
++
++void
++exp_types_mark_used (struct expression *exp)
++{
++  exp_iterate (exp, exp_types_mark_used_iter, NULL, NULL);
+ }
++#endif
+ void
+ _initialize_parse (void)
+Index: gdb-7.3.50.20110722/gdb/parser-defs.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/parser-defs.h 2011-01-10 21:38:49.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/parser-defs.h      2011-07-29 22:52:02.000000000 +0200
+@@ -194,6 +194,8 @@ extern void operator_length_standard (co
+                                     int *);
+ extern int operator_check_standard (struct expression *exp, int pos,
++                                  int (*type_func) (struct type *type,
++                                                    void *data),
+                                   int (*objfile_func)
+                                     (struct objfile *objfile, void *data),
+                                   void *data);
+@@ -291,6 +293,7 @@ struct exp_descriptor
+        value should be immediately returned to the caller.  Otherwise zero
+        should be returned.  */
+     int (*operator_check) (struct expression *exp, int pos,
++                         int (*type_func) (struct type *type, void *data),
+                          int (*objfile_func) (struct objfile *objfile,
+                                               void *data),
+                          void *data);
+@@ -329,4 +332,10 @@ extern void parser_fprintf (FILE *, cons
+ extern int exp_uses_objfile (struct expression *exp, struct objfile *objfile);
++extern int exp_uses_objfile (struct expression *exp, struct objfile *objfile);
++
++#if 0
++extern void exp_types_mark_used (struct expression *exp);
++#endif
++
+ #endif /* PARSER_DEFS_H */
+Index: gdb-7.3.50.20110722/gdb/ppc-linux-nat.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/ppc-linux-nat.c       2011-05-06 20:46:31.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/ppc-linux-nat.c    2011-07-29 22:52:02.000000000 +0200
+@@ -1647,6 +1647,14 @@ ppc_linux_ranged_break_num_registers (st
+         2 : -1);
+ }
++static void
++booke_insert_point_callback (int tid, void *pp_voidp)
++{
++  struct ppc_hw_breakpoint *pp = pp_voidp;
++
++  booke_insert_point (pp, tid);
++}
++
+ /* Insert the hardware breakpoint described by BP_TGT.  Returns 0 for
+    success, 1 if hardware breakpoints are not supported or -1 for failure.  */
+@@ -1654,8 +1662,6 @@ static int
+ ppc_linux_insert_hw_breakpoint (struct gdbarch *gdbarch,
+                                 struct bp_target_info *bp_tgt)
+ {
+-  ptid_t ptid;
+-  struct lwp_info *lp;
+   struct ppc_hw_breakpoint p;
+   if (!have_ptrace_booke_interface ())
+@@ -1681,18 +1687,23 @@ ppc_linux_insert_hw_breakpoint (struct g
+       p.addr2 = 0;
+     }
+-  ALL_LWPS (lp, ptid)
+-    booke_insert_point (&p, TIDGET (ptid));
++  linux_nat_iterate_watchpoint_lwps (booke_insert_point_callback, &p);
+   return 0;
+ }
++static void
++booke_remove_point_callback (int tid, void *pp_voidp)
++{
++  struct ppc_hw_breakpoint *pp = pp_voidp;
++
++  booke_remove_point (pp, tid);
++}
++
+ static int
+ ppc_linux_remove_hw_breakpoint (struct gdbarch *gdbarch,
+                                 struct bp_target_info *bp_tgt)
+ {
+-  ptid_t ptid;
+-  struct lwp_info *lp;
+   struct ppc_hw_breakpoint p;
+   if (!have_ptrace_booke_interface ())
+@@ -1718,8 +1729,7 @@ ppc_linux_remove_hw_breakpoint (struct g
+       p.addr2 = 0;
+     }
+-  ALL_LWPS (lp, ptid)
+-    booke_remove_point (&p, TIDGET (ptid));
++  linux_nat_iterate_watchpoint_lwps (booke_remove_point_callback, &p);
+   return 0;
+ }
+@@ -2004,6 +2014,15 @@ ppc_linux_can_accel_watchpoint_condition
+         && check_condition (addr, cond, &data_value, &len));
+ }
++static void
++set_saved_dabr_value_callback (int tid, void *retp_voidp)
++{
++  int *retp = retp_voidp;
++
++  if (ptrace (PTRACE_SET_DEBUGREG, tid, 0, saved_dabr_value) < 0)
++    *retp = -1;
++}
++
+ /* Set up P with the parameters necessary to request a watchpoint covering
+    LEN bytes starting at ADDR and if possible with condition expression COND
+    evaluated by hardware.  INSERT tells if we are creating a request for
+@@ -2058,8 +2077,6 @@ static int
+ ppc_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw,
+                            struct expression *cond)
+ {
+-  struct lwp_info *lp;
+-  ptid_t ptid;
+   int ret = -1;
+   if (have_ptrace_booke_interface ())
+@@ -2068,8 +2085,7 @@ ppc_linux_insert_watchpoint (CORE_ADDR a
+       create_watchpoint_request (&p, addr, len, rw, cond, 1);
+-      ALL_LWPS (lp, ptid)
+-      booke_insert_point (&p, TIDGET (ptid));
++      linux_nat_iterate_watchpoint_lwps (booke_insert_point_callback, &p);
+       ret = 0;
+     }
+@@ -2112,12 +2128,8 @@ ppc_linux_insert_watchpoint (CORE_ADDR a
+       saved_dabr_value = dabr_value;
+-      ALL_LWPS (lp, ptid)
+-      if (ptrace (PTRACE_SET_DEBUGREG, TIDGET (ptid), 0,
+-                  saved_dabr_value) < 0)
+-        return -1;
+-
+       ret = 0;
++      linux_nat_iterate_watchpoint_lwps (set_saved_dabr_value_callback, &ret);
+     }
+   return ret;
+@@ -2127,8 +2139,6 @@ static int
+ ppc_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw,
+                            struct expression *cond)
+ {
+-  struct lwp_info *lp;
+-  ptid_t ptid;
+   int ret = -1;
+   if (have_ptrace_booke_interface ())
+@@ -2137,20 +2147,16 @@ ppc_linux_remove_watchpoint (CORE_ADDR a
+       create_watchpoint_request (&p, addr, len, rw, cond, 0);
+-      ALL_LWPS (lp, ptid)
+-      booke_remove_point (&p, TIDGET (ptid));
++      linux_nat_iterate_watchpoint_lwps (booke_remove_point_callback, &p);
+       ret = 0;
+     }
+   else
+     {
+       saved_dabr_value = 0;
+-      ALL_LWPS (lp, ptid)
+-      if (ptrace (PTRACE_SET_DEBUGREG, TIDGET (ptid), 0,
+-                  saved_dabr_value) < 0)
+-        return -1;
+       ret = 0;
++      linux_nat_iterate_watchpoint_lwps (set_saved_dabr_value_callback, &ret);
+     }
+   return ret;
+Index: gdb-7.3.50.20110722/gdb/printcmd.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/printcmd.c    2011-03-22 15:39:40.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/printcmd.c 2011-07-29 22:52:02.000000000 +0200
+@@ -975,6 +975,11 @@ print_command_1 (char *exp, int inspect,
+   else
+     val = access_value_history (0);
++  /* Do not try to OBJECT_ADDRESS_SET here anything.  We are interested in the
++     source variable base addresses as found by READ_VAR_VALUE.  The value here
++     can be already a calculated expression address inappropriate for
++     DW_OP_push_object_address.  */
++
+   if (voidprint || (val && value_type (val) &&
+                   TYPE_CODE (value_type (val)) != TYPE_CODE_VOID))
+     {
+@@ -1476,6 +1481,24 @@ x_command (char *exp, int from_tty)
+       set_internalvar (lookup_internalvar ("__"), last_examine_value);
+     }
+ }
++
++#if 0
++/* Call type_mark_used for any TYPEs referenced from this GDB source file.  */
++
++static void
++print_types_mark_used (void)
++{
++  struct display *d;
++
++  if (last_examine_value)
++    type_mark_used (value_type (last_examine_value));
++
++  for (d = display_chain; d; d = d->next)
++    if (d->exp)
++      exp_types_mark_used (d->exp);
++}
++#endif
++
\f
+ /* Add an expression to the auto-display chain.
+@@ -2870,4 +2893,8 @@ Show printing of source filename and lin
+   add_com ("eval", no_class, eval_command, _("\
+ Convert \"printf format string\", arg1, arg2, arg3, ..., argn to\n\
+ a command line, and call it."));
++
++#if 0
++  observer_attach_mark_used (print_types_mark_used);
++#endif
+ }
+Index: gdb-7.3.50.20110722/gdb/python/lib/gdb/FrameIterator.py
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/python/lib/gdb/FrameIterator.py    2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,33 @@
++# Iterator over frames.
++
++# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++class FrameIterator:
++    """An iterator that iterates over frames."""
++
++    def __init__ (self, frame):
++        "Initialize a FrameIterator.  FRAME is the starting frame."
++        self.frame = frame
++
++    def __iter__ (self):
++        return self
++
++    def next (self):
++        result = self.frame
++        if result is None:
++            raise StopIteration
++        self.frame = result.older ()
++        return result
+Index: gdb-7.3.50.20110722/gdb/python/lib/gdb/FrameWrapper.py
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/python/lib/gdb/FrameWrapper.py     2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,112 @@
++# Wrapper API for frames.
++
++# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++import gdb
++
++# FIXME: arguably all this should be on Frame somehow.
++class FrameWrapper:
++    def __init__ (self, frame):
++        self.frame = frame;
++
++    def write_symbol (self, stream, sym, block):
++        if len (sym.linkage_name):
++            nsym, is_field_of_this = gdb.lookup_symbol (sym.linkage_name, block)
++            if nsym.addr_class != gdb.SYMBOL_LOC_REGISTER:
++                sym = nsym
++
++        stream.write (sym.print_name + "=")
++        try:
++            val = self.read_var (sym)
++            if val != None:
++                val = str (val)
++        # FIXME: would be nice to have a more precise exception here.
++        except RuntimeError, text:
++            val = text
++        if val == None:
++            stream.write ("???")
++        else:
++            stream.write (str (val))
++
++    def print_frame_locals (self, stream, func):
++        if not func:
++            return
++
++        first = True
++        block = func.value
++
++        for sym in block:
++            if sym.is_argument:
++                continue;
++
++            self.write_symbol (stream, sym, block)
++            stream.write ('\n')
++
++    def print_frame_args (self, stream, func):
++        if not func:
++            return
++
++        first = True
++        block = func.value
++
++        for sym in block:
++            if not sym.is_argument:
++                continue;
++
++            if not first:
++                stream.write (", ")
++
++            self.write_symbol (stream, sym, block)
++            first = False
++
++    # FIXME: this should probably just be a method on gdb.Frame.
++    # But then we need stream wrappers.
++    def describe (self, stream, full):
++        if self.type () == gdb.DUMMY_FRAME:
++            stream.write (" <function called from gdb>\n")
++        elif self.type () == gdb.SIGTRAMP_FRAME:
++            stream.write (" <signal handler called>\n")
++        else:
++            sal = self.find_sal ()
++            pc = self.pc ()
++            name = self.name ()
++            if not name:
++                name = "??"
++            if pc != sal.pc or not sal.symtab:
++                stream.write (" 0x%08x in" % pc)
++            stream.write (" " + name + " (")
++
++            func = self.function ()
++            self.print_frame_args (stream, func)
++
++            stream.write (")")
++
++            if sal.symtab and sal.symtab.filename:
++                stream.write (" at " + sal.symtab.filename)
++                stream.write (":" + str (sal.line))
++
++            if not self.name () or (not sal.symtab or not sal.symtab.filename):
++                lib = gdb.solib_address (pc)
++                if lib:
++                    stream.write (" from " + lib)
++
++            stream.write ("\n")
++
++            if full:
++                self.print_frame_locals (stream, func)
++
++    def __getattr__ (self, name):
++        return getattr (self.frame, name)
+Index: gdb-7.3.50.20110722/gdb/python/lib/gdb/backtrace.py
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/python/lib/gdb/backtrace.py        2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,42 @@
++# Filtering backtrace.
++
++# Copyright (C) 2008, 2011 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++import gdb
++import itertools
++
++# Our only exports.
++__all__ = ['push_frame_filter', 'create_frame_filter']
++
++frame_filter = None
++
++def push_frame_filter (constructor):
++    """Register a new backtrace filter class with the 'backtrace' command.
++The filter will be passed an iterator as an argument.  The iterator
++will return gdb.Frame-like objects.  The filter should in turn act as
++an iterator returning such objects."""
++    global frame_filter
++    if frame_filter == None:
++        frame_filter = constructor
++    else:
++        frame_filter = lambda iterator, filter = frame_filter: constructor (filter (iterator))
++
++def create_frame_filter (iter):
++    global frame_filter
++    if frame_filter is None:
++        return iter
++    return frame_filter (iter)
++
+Index: gdb-7.3.50.20110722/gdb/python/lib/gdb/command/alias.py
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/python/lib/gdb/command/alias.py    2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,59 @@
++# Alias command.
++
++# Copyright (C) 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++import gdb
++
++class AliasImplementation (gdb.Command):
++    def __init__ (self, name, real, doc):
++        # Have to set __doc__ before the super init call.
++        # It would be nice if gdb's help looked up __doc__ dynamically.
++        self.__doc__ = doc
++        # Note: no good way to complete :(
++        super (AliasImplementation, self).__init__ (name, gdb.COMMAND_NONE)
++        self.real = real
++
++    def invoke(self, arg, from_tty):
++        gdb.execute (self.real + ' ' + arg, from_tty)
++
++class AliasCommand (gdb.Command):
++    """Alias one command to another.
++In the simplest form, the first word is the name of the alias, and
++the remaining words are the the expansion.
++An '=' by itself can be used to define a multi-word alias; words
++before the '=' are the name of the new command."""
++
++    def __init__ (self):
++        # Completion is not quite right here.
++        super (AliasCommand, self).__init__ ("alias", gdb.COMMAND_NONE,
++                                             gdb.COMPLETE_COMMAND)
++
++    def invoke (self, arg, from_tty):
++        self.dont_repeat ()
++        # Without some form of quoting we can't alias a multi-word
++        # command to another command.
++        args = arg.split()
++        try:
++            start = args.index ('=')
++            end = start + 1
++        except ValueError:
++            start = 1
++            end = 1
++        target = " ".join(args[end:])
++        AliasImplementation (" ".join (args[0:start]), target,
++                             "This command is an alias for '%s'." % target)
++
++AliasCommand()
+Index: gdb-7.3.50.20110722/gdb/python/lib/gdb/command/backtrace.py
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/python/lib/gdb/command/backtrace.py        2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,106 @@
++# New backtrace command.
++
++# Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++import gdb
++import gdb.backtrace
++import itertools
++from gdb.FrameIterator import FrameIterator
++from gdb.FrameWrapper import FrameWrapper
++import sys
++
++class ReverseBacktraceParameter (gdb.Parameter):
++    """The new-backtrace command can show backtraces in 'reverse' order.
++This means that the innermost frame will be printed last.
++Note that reverse backtraces are more expensive to compute."""
++
++    set_doc = "Enable or disable reverse backtraces."
++    show_doc = "Show whether backtraces will be printed in reverse order."
++
++    def __init__(self):
++        gdb.Parameter.__init__ (self, "reverse-backtrace",
++                                gdb.COMMAND_STACK, gdb.PARAM_BOOLEAN)
++        # Default to compatibility with gdb.
++        self.value = False
++
++class FilteringBacktrace (gdb.Command):
++    """Print backtrace of all stack frames, or innermost COUNT frames.
++With a negative argument, print outermost -COUNT frames.
++Use of the 'full' qualifier also prints the values of the local variables.
++Use of the 'raw' qualifier avoids any filtering by loadable modules.
++"""
++
++    def __init__ (self):
++        # FIXME: this is not working quite well enough to replace
++        # "backtrace" yet.
++        gdb.Command.__init__ (self, "new-backtrace", gdb.COMMAND_STACK)
++        self.reverse = ReverseBacktraceParameter()
++
++    def reverse_iter (self, iter):
++        result = []
++        for item in iter:
++            result.append (item)
++        result.reverse()
++        return result
++
++    def final_n (self, iter, x):
++        result = []
++        for item in iter:
++            result.append (item)
++        return result[x:]
++
++    def invoke (self, arg, from_tty):
++        i = 0
++        count = 0
++        filter = True
++        full = False
++
++        for word in arg.split (" "):
++            if word == '':
++                continue
++            elif word == 'raw':
++                filter = False
++            elif word == 'full':
++                full = True
++            else:
++                count = int (word)
++
++        # FIXME: provide option to start at selected frame
++        # However, should still number as if starting from newest
++        newest_frame = gdb.newest_frame()
++        iter = itertools.imap (FrameWrapper,
++                               FrameIterator (newest_frame))
++        if filter:
++            iter = gdb.backtrace.create_frame_filter (iter)
++
++        # Now wrap in an iterator that numbers the frames.
++        iter = itertools.izip (itertools.count (0), iter)
++
++        # Reverse if the user wanted that.
++        if self.reverse.value:
++            iter = self.reverse_iter (iter)
++
++        # Extract sub-range user wants.
++        if count < 0:
++            iter = self.final_n (iter, count)
++        elif count > 0:
++            iter = itertools.islice (iter, 0, count)
++
++        for pair in iter:
++            sys.stdout.write ("#%-2d" % pair[0])
++            pair[1].describe (sys.stdout, full)
++
++FilteringBacktrace()
+Index: gdb-7.3.50.20110722/gdb/python/lib/gdb/command/ignore_errors.py
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/python/lib/gdb/command/ignore_errors.py    2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,37 @@
++# Ignore errors in user commands.
++
++# Copyright (C) 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++import gdb
++
++class IgnoreErrorsCommand (gdb.Command):
++    """Execute a single command, ignoring all errors.
++Only one-line commands are supported.
++This is primarily useful in scripts."""
++
++    def __init__ (self):
++        super (IgnoreErrorsCommand, self).__init__ ("ignore-errors",
++                                                    gdb.COMMAND_OBSCURE,
++                                                    # FIXME...
++                                                    gdb.COMPLETE_COMMAND)
++
++    def invoke (self, arg, from_tty):
++        try:
++            gdb.execute (arg, from_tty)
++        except:
++            pass
++
++IgnoreErrorsCommand ()
+Index: gdb-7.3.50.20110722/gdb/python/lib/gdb/command/pahole.py
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/python/lib/gdb/command/pahole.py   2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,75 @@
++# pahole command for gdb
++
++# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++import gdb
++
++class Pahole (gdb.Command):
++    """Show the holes in a structure.
++This command takes a single argument, a type name.
++It prints the type and displays comments showing where holes are."""
++
++    def __init__ (self):
++        super (Pahole, self).__init__ ("pahole", gdb.COMMAND_NONE,
++                                       gdb.COMPLETE_SYMBOL)
++
++    def pahole (self, type, level, name):
++        if name is None:
++            name = ''
++        tag = type.tag
++        if tag is None:
++            tag = ''
++        print '%sstruct %s {' % (' ' * (2 * level), tag)
++        bitpos = 0
++        for field in type.fields ():
++            # Skip static fields.
++            if not hasattr (field, ('bitpos')):
++                continue
++
++            ftype = field.type.strip_typedefs()
++
++            if bitpos != field.bitpos:
++                hole = field.bitpos - bitpos
++                print '  /* XXX %d bit hole, try to pack */' % hole
++                bitpos = field.bitpos
++            if field.bitsize > 0:
++                fieldsize = field.bitsize
++            else:
++                # TARGET_CHAR_BIT here...
++                fieldsize = 8 * ftype.sizeof
++
++            # TARGET_CHAR_BIT
++            print ' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8)),
++            bitpos = bitpos + fieldsize
++
++            if ftype.code == gdb.TYPE_CODE_STRUCT:
++                self.pahole (ftype, level + 1, field.name)
++            else:
++                print ' ' * (2 + 2 * level),
++                print '%s %s' % (str (ftype), field.name)
++
++        print ' ' * (14 + 2 * level),
++        print '} %s' % name
++
++    def invoke (self, arg, from_tty):
++        type = gdb.lookup_type (arg)
++        type = type.strip_typedefs ()
++        if type.code != gdb.TYPE_CODE_STRUCT:
++            raise TypeError, '%s is not a struct type' % arg
++        print ' ' * 14,
++        self.pahole (type, 0, '')
++
++Pahole()
+Index: gdb-7.3.50.20110722/gdb/python/lib/gdb/command/require.py
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/python/lib/gdb/command/require.py  2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,57 @@
++# Demand-loading commands.
++
++# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++import gdb
++import os
++
++class RequireCommand (gdb.Command):
++    """Prefix command for requiring features."""
++
++    def __init__ (self):
++        super (RequireCommand, self).__init__ ("require",
++                                               gdb.COMMAND_SUPPORT,
++                                               gdb.COMPLETE_NONE,
++                                               True)
++
++class RequireSubcommand (gdb.Command):
++    """Demand-load a command by name."""
++
++    def __init__ (self, name):
++        self.__doc__ = "Demand-load a %s by name." % name
++        super (RequireSubcommand, self).__init__ ("require %s" % name,
++                                                  gdb.COMMAND_SUPPORT)
++        self.name = name
++
++    def invoke (self, arg, from_tty):
++        for cmd in arg.split():
++            exec ('import gdb.' + self.name + '.' + cmd, globals ())
++
++    def complete (self, text, word):
++        dir = gdb.pythondir + '/gdb/' + self.name
++        result = []
++        for file in os.listdir(dir):
++            if not file.startswith (word) or not file.endswith ('.py'):
++                continue
++            feature = file[0:-3]
++            if feature == 'require' or feature == '__init__':
++                continue
++            result.append (feature)
++        return result
++
++RequireCommand()
++RequireSubcommand("command")
++RequireSubcommand("function")
+Index: gdb-7.3.50.20110722/gdb/python/lib/gdb/command/upto.py
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/python/lib/gdb/command/upto.py     2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,129 @@
++# upto command.
++
++# Copyright (C) 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++import gdb
++import re
++from gdb.FrameIterator import FrameIterator
++from gdb.FrameWrapper import FrameWrapper
++
++class UptoPrefix (gdb.Command):
++    def __init__ (self):
++        super (UptoPrefix, self).__init__ ("upto", gdb.COMMAND_STACK,
++                                           prefix = True)
++
++class UptoImplementation (gdb.Command):
++    def __init__ (self, subcommand):
++        super (UptoImplementation, self).__init__ ("upto " + subcommand,
++                                                   gdb.COMMAND_STACK)
++
++    def search (self):
++        saved = gdb.selected_frame ()
++        iter = FrameIterator (saved)
++        found = False
++        try:
++            for frame in iter:
++                frame.select ()
++                try:
++                    if self.filter (frame):
++                        wrapper = FrameWrapper (frame)
++                        wrapper.describe (sys.stdout, False)
++                        return
++                except:
++                    pass
++        except:
++            pass
++        saved.select ()
++        raise RuntimeError, 'Could not find a matching frame'
++
++    def invoke (self, arg, from_tty):
++        self.rx = re.compile (arg)
++        self.search ()
++
++class UptoSymbolCommand (UptoImplementation):
++    """Select and print some calling stack frame, based on symbol.
++The argument is a regular expression.  This command moves up the
++stack, stopping at the first frame whose symbol matches the regular
++expression."""
++
++    def __init__ (self):
++        super (UptoSymbolCommand, self).__init__ ("symbol")
++
++    def filter (self, frame):
++        name = frame.name ()
++        if name is not None:
++            if self.rx.search (name) is not None:
++                return True
++        return False
++
++class UptoSourceCommand (UptoImplementation):
++    """Select and print some calling stack frame, based on source file.
++The argument is a regular expression.  This command moves up the
++stack, stopping at the first frame whose source file name matches the
++regular expression."""
++
++    def __init__ (self):
++        super (UptoSourceCommand, self).__init__ ("source")
++
++    def filter (self, frame):
++        name = frame.find_sal ().symtab.filename
++        if name is not None:
++            if self.rx.search (name) is not None:
++                return True
++        return False
++
++class UptoObjectCommand (UptoImplementation):
++    """Select and print some calling stack frame, based on object file.
++The argument is a regular expression.  This command moves up the
++stack, stopping at the first frame whose object file name matches the
++regular expression."""
++
++    def __init__ (self):
++        super (UptoObjectCommand, self).__init__ ("object")
++
++    def filter (self, frame):
++        name = frame.find_sal ().symtab.objfile.filename
++        if name is not None:
++            if self.rx.search (name) is not None:
++                return True
++        return False
++
++class UptoWhereCommand (UptoImplementation):
++    """Select and print some calling stack frame, based on expression.
++The argument is an expression.  This command moves up the stack,
++parsing and evaluating the expression in each frame.  This stops when
++the expression evaluates to a non-zero (true) value."""
++
++    def __init__ (self):
++        super (UptoWhereCommand, self).__init__ ("where")
++
++    def filter (self, frame):
++        try:
++            if gdb.parse_and_eval (self.expression):
++                return True
++        except:
++            pass
++        return False
++
++    def invoke (self, arg, from_tty):
++        self.expression = arg
++        self.search ()
++
++UptoPrefix ()
++UptoSymbolCommand ()
++UptoSourceCommand ()
++UptoObjectCommand ()
++UptoWhereCommand ()
+Index: gdb-7.3.50.20110722/gdb/python/lib/gdb/function/__init__.py
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/python/lib/gdb/function/__init__.py        2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1 @@
++
+Index: gdb-7.3.50.20110722/gdb/python/lib/gdb/function/caller_is.py
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/python/lib/gdb/function/caller_is.py       2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,58 @@
++# Caller-is functions.
++
++# Copyright (C) 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++import gdb
++import re
++
++class CallerIs (gdb.Function):
++    """Return True if the calling function's name is equal to a string.
++This function takes one or two arguments.
++The first argument is the name of a function; if the calling function's
++name is equal to this argument, this function returns True.
++The optional second argument tells this function how many stack frames
++to traverse to find the calling function.  The default is 1."""
++
++    def __init__ (self):
++        super (CallerIs, self).__init__ ("caller_is")
++
++    def invoke (self, name, nframes = 1):
++        frame = gdb.selected_frame ()
++        while nframes > 0:
++            frame = frame.older ()
++            nframes = nframes - 1
++        return frame.name () == name.string ()
++
++class CallerMatches (gdb.Function):
++    """Return True if the calling function's name matches a string.
++This function takes one or two arguments.
++The first argument is a regular expression; if the calling function's
++name is matched by this argument, this function returns True.
++The optional second argument tells this function how many stack frames
++to traverse to find the calling function.  The default is 1."""
++
++    def __init__ (self):
++        super (CallerMatches, self).__init__ ("caller_matches")
++
++    def invoke (self, name, nframes = 1):
++        frame = gdb.selected_frame ()
++        while nframes > 0:
++            frame = frame.older ()
++            nframes = nframes - 1
++        return re.match (name.string (), frame.name ()) is not None
++
++CallerIs()
++CallerMatches()
+Index: gdb-7.3.50.20110722/gdb/python/lib/gdb/function/in_scope.py
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/python/lib/gdb/function/in_scope.py        2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,47 @@
++# In-scope function.
++
++# Copyright (C) 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++import gdb
++
++class InScope (gdb.Function):
++    """Return True if all the given variables or macros are in scope.
++Takes one argument for each variable name to be checked."""
++
++    def __init__ (self):
++      super (InScope, self).__init__ ("in_scope")
++
++    def invoke (self, *vars):
++        if len (vars) == 0:
++          raise TypeError, "in_scope takes at least one argument"
++
++        # gdb.Value isn't hashable so it can't be put in a map.
++      # Convert to string first.
++      wanted = set (map (lambda x: x.string (), vars))
++      found = set ()
++      block = gdb.selected_frame ().block ()
++      while block:
++          for sym in block:
++              if (sym.is_argument or sym.is_constant
++                    or sym.is_function or sym.is_variable):
++                  if sym.name in wanted:
++                      found.add (sym.name)
++
++          block = block.superblock
++
++      return wanted == found
++
++InScope ()
+Index: gdb-7.3.50.20110722/gdb/python/py-type.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/python/py-type.c      2011-06-24 21:47:37.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/python/py-type.c   2011-07-29 22:52:02.000000000 +0200
+@@ -29,6 +29,8 @@
+ #include "language.h"
+ #include "vec.h"
+ #include "bcache.h"
++#include "observer.h"
++#include "gdb_assert.h"
+ typedef struct pyty_type_object
+ {
+@@ -37,11 +39,19 @@ typedef struct pyty_type_object
+   /* If a Type object is associated with an objfile, it is kept on a
+      doubly-linked list, rooted in the objfile.  This lets us copy the
+-     underlying struct type when the objfile is deleted.  */
++     underlying struct type when the objfile is deleted.
++
++     With NULL objfile Type still can be doubly-linked in the list
++     PYTY_OBJECTS_DISCARDABLE.  */
+   struct pyty_type_object *prev;
+   struct pyty_type_object *next;
+ } type_object;
++#if 0
++/* First element of a doubly-linked list of TYPE_DISCARDABLE Types.  */
++static type_object *pyty_objects_discardable;
++#endif
++
+ static PyTypeObject type_object_type;
+ /* A Field object.  */
+@@ -919,8 +929,63 @@ typy_richcompare (PyObject *self, PyObje
\f
++/* Key associated with each objfile pointing to the first element of
++   a doubly-linked list of Types associated with this objfile.  */
+ static const struct objfile_data *typy_objfile_data_key;
++/* Link TYPE_OBJ to its appropriate list.  Either to its objfile associated one
++   or at least to the global list for TYPE_DISCARDABLE Types.  Permanent types
++   do not get linked anywhere.  */
++static void
++typy_link (type_object *type_obj)
++{
++  type_obj->prev = NULL;
++
++  if (type_obj->type && TYPE_OBJFILE (type_obj->type))
++    {
++      struct objfile *objfile = TYPE_OBJFILE (type_obj->type);
++
++      type_obj->next = objfile_data (objfile, typy_objfile_data_key);
++      if (type_obj->next)
++      type_obj->next->prev = type_obj;
++      set_objfile_data (objfile, typy_objfile_data_key, type_obj);
++    }
++#if 0
++  else if (type_obj->type && TYPE_DISCARDABLE (type_obj->type))
++    {
++      type_obj->next = pyty_objects_discardable;
++      if (type_obj->next)
++      type_obj->next->prev = type_obj;
++      pyty_objects_discardable = type_obj;
++    }
++#endif
++  else
++    type_obj->next = NULL;
++}
++
++/* Unlink TYPE_OBJ from its current list.  Permanent types are not linked
++   anywhere and this function has no effect on them.  */
++static void
++typy_unlink (type_object *type_obj)
++{
++  if (type_obj->prev)
++    type_obj->prev->next = type_obj->next;
++  else if (type_obj->type && TYPE_OBJFILE (type_obj->type))
++    {
++      /* Must reset head of list.  */
++      struct objfile *objfile = TYPE_OBJFILE (type_obj->type);
++
++      set_objfile_data (objfile, typy_objfile_data_key, type_obj->next);
++    }
++#if 0
++  else if (pyty_objects_discardable == type_obj)
++    pyty_objects_discardable = type_obj->next;
++#endif
++
++  if (type_obj->next)
++    type_obj->next->prev = type_obj->prev;
++}
++
+ static void
+ save_objfile_types (struct objfile *objfile, void *datum)
+ {
+@@ -938,12 +1003,13 @@ save_objfile_types (struct objfile *objf
+     {
+       type_object *next = obj->next;
+-      htab_empty (copied_types);
++      gdb_assert (TYPE_OBJFILE (obj->type) == objfile);
++      typy_unlink (obj);
+-      obj->type = copy_type_recursive (objfile, obj->type, copied_types);
++      obj->type = copy_type_recursive (obj->type, copied_types);
+-      obj->next = NULL;
+-      obj->prev = NULL;
++      gdb_assert (TYPE_OBJFILE (obj->type) == NULL);
++      typy_link (obj);
+       obj = next;
+     }
+@@ -954,43 +1020,28 @@ save_objfile_types (struct objfile *objf
+ }
+ static void
+-set_type (type_object *obj, struct type *type)
++typy_dealloc (PyObject *obj)
+ {
+-  obj->type = type;
+-  obj->prev = NULL;
+-  if (type && TYPE_OBJFILE (type))
+-    {
+-      struct objfile *objfile = TYPE_OBJFILE (type);
+-
+-      obj->next = objfile_data (objfile, typy_objfile_data_key);
+-      if (obj->next)
+-      obj->next->prev = obj;
+-      set_objfile_data (objfile, typy_objfile_data_key, obj);
+-    }
+-  else
+-    obj->next = NULL;
++  type_object *type_obj = (type_object *) obj;
++
++  typy_unlink (type_obj);
++
++  type_obj->ob_type->tp_free (obj);
+ }
++#if 0
++/* Call type_mark_used for any TYPEs referenced from this GDB source file.  */
+ static void
+-typy_dealloc (PyObject *obj)
++typy_types_mark_used (void)
+ {
+-  type_object *type = (type_object *) obj;
+-
+-  if (type->prev)
+-    type->prev->next = type->next;
+-  else if (type->type && TYPE_OBJFILE (type->type))
+-    {
+-      /* Must reset head of list.  */
+-      struct objfile *objfile = TYPE_OBJFILE (type->type);
+-
+-      if (objfile)
+-      set_objfile_data (objfile, typy_objfile_data_key, type->next);
+-    }
+-  if (type->next)
+-    type->next->prev = type->prev;
++  type_object *type_obj;
+-  type->ob_type->tp_free (type);
++  for (type_obj = pyty_objects_discardable;
++       type_obj != NULL;
++       type_obj = type_obj->next)
++    type_mark_used (type_obj->type);
+ }
++#endif
+ /* Create a new Type referring to TYPE.  */
+ PyObject *
+@@ -1000,7 +1051,10 @@ type_to_type_object (struct type *type)
+   type_obj = PyObject_New (type_object, &type_object_type);
+   if (type_obj)
+-    set_type (type_obj, type);
++    {
++      type_obj->type = type;
++      typy_link (type_obj);
++    }
+   return (PyObject *) type_obj;
+ }
+@@ -1074,6 +1128,10 @@ gdbpy_initialize_types (void)
+   Py_INCREF (&field_object_type);
+   PyModule_AddObject (gdb_module, "Field", (PyObject *) &field_object_type);
++
++#if 0
++  observer_attach_mark_used (typy_types_mark_used);
++#endif
+ }
\f
+Index: gdb-7.3.50.20110722/gdb/python/py-value.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/python/py-value.c     2011-06-27 21:21:51.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/python/py-value.c  2011-07-29 22:52:02.000000000 +0200
+@@ -28,6 +28,7 @@
+ #include "infcall.h"
+ #include "expression.h"
+ #include "cp-abi.h"
++#include "observer.h"
+ #ifdef HAVE_PYTHON
+@@ -1208,6 +1209,19 @@ gdbpy_is_value_object (PyObject *obj)
+   return PyObject_TypeCheck (obj, &value_object_type);
+ }
++#if 0
++/* Call type_mark_used for any TYPEs referenced from this GDB source file.  */
++
++static void
++python_types_mark_used (void)
++{
++  value_object *iter;
++
++  for (iter = values_in_python; iter; iter = iter->next)
++    type_mark_used (value_type (iter->value));
++}
++#endif
++
+ void
+ gdbpy_initialize_values (void)
+ {
+@@ -1218,6 +1232,10 @@ gdbpy_initialize_values (void)
+   PyModule_AddObject (gdb_module, "Value", (PyObject *) &value_object_type);
+   values_in_python = NULL;
++
++#if 0
++  observer_attach_mark_used (python_types_mark_used);
++#endif
+ }
\f
+Index: gdb-7.3.50.20110722/gdb/python/python.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/python/python.c       2011-07-21 13:03:47.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/python/python.c    2011-07-29 22:52:02.000000000 +0200
+@@ -49,9 +49,12 @@ static int gdbpy_should_print_stack = 0;
+ #include "linespec.h"
+ #include "source.h"
+ #include "version.h"
++#include "inferior.h"
++#include "gdbthread.h"
+ #include "target.h"
+ #include "gdbthread.h"
+ #include "observer.h"
++#include "event-top.h"
+ static PyMethodDef GdbMethods[];
+@@ -849,6 +852,53 @@ gdbpy_print_stack (void)
+ /* Return the current Progspace.
+    There always is one.  */
++/* True if 'gdb -P' was used, false otherwise.  */
++static int running_python_script;
++
++/* True if we are currently in a call to 'gdb.cli', false otherwise.  */
++static int in_cli;
++
++/* Enter the command loop.  */
++
++static PyObject *
++gdbpy_cli (PyObject *unused1, PyObject *unused2)
++{
++  if (! running_python_script || in_cli)
++    return PyErr_Format (PyExc_RuntimeError, "cannot invoke CLI recursively");
++
++  in_cli = 1;
++  cli_command_loop ();
++  in_cli = 0;
++
++  Py_RETURN_NONE;
++}
++
++/* Set up the Python argument vector and evaluate a script.  This is
++   used to implement 'gdb -P'.  */
++
++void
++run_python_script (int argc, char **argv)
++{
++  FILE *input;
++
++  /* We never free this, since we plan to exit at the end.  */
++  ensure_python_env (get_current_arch (), current_language);
++
++  running_python_script = 1;
++  PySys_SetArgv (argc - 1, argv + 1);
++  input = fopen (argv[0], "r");
++  if (! input)
++    {
++      fprintf (stderr, "could not open %s: %s\n", argv[0], strerror (errno));
++      exit (1);
++    }
++  PyRun_SimpleFile (input, argv[0]);
++  fclose (input);
++  exit (0);
++}
++
++\f
++
+ static PyObject *
+ gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2)
+@@ -1333,6 +1383,8 @@ static PyMethodDef GdbMethods[] =
+     "Get a value from history" },
+   { "execute", (PyCFunction) execute_gdb_command, METH_VARARGS | METH_KEYWORDS,
+     "Execute a gdb command" },
++  { "cli", gdbpy_cli, METH_NOARGS,
++    "Enter the gdb CLI" },
+   { "parameter", gdbpy_parameter, METH_VARARGS,
+     "Return a gdb parameter's value" },
+Index: gdb-7.3.50.20110722/gdb/python/python.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/python/python.h       2011-03-14 17:09:54.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/python/python.h    2011-07-29 22:52:02.000000000 +0200
+@@ -32,6 +32,8 @@ void eval_python_from_control_command (s
+ void source_python_script (FILE *stream, const char *file);
++void run_python_script (int argc, char **argv);
++
+ int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr,
+                             int embedded_offset, CORE_ADDR address,
+                             struct ui_file *stream, int recurse,
+Index: gdb-7.3.50.20110722/gdb/somread.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/somread.c     2011-03-07 17:17:29.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/somread.c  2011-07-29 22:52:02.000000000 +0200
+@@ -439,6 +439,7 @@ static const struct sym_fns som_sym_fns
+   default_symfile_segments,   /* Get segment information from a file.  */
+   NULL,
+   default_symfile_relocate,   /* Relocate a debug section.  */
++  NULL,                               /* sym_get_probes */
+   &psym_functions
+ };
+Index: gdb-7.3.50.20110722/gdb/stack.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/stack.c       2011-06-27 21:21:50.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/stack.c    2011-07-29 22:52:02.000000000 +0200
+@@ -366,6 +366,7 @@ print_frame_args (struct symbol *func, s
+               {
+                   const struct language_defn *language;
+                 struct value_print_options opts;
++                struct cleanup *old_chain;
+                   /* Use the appropriate language to display our symbol,
+                      unless the user forced the language to a specific
+@@ -378,7 +379,13 @@ print_frame_args (struct symbol *func, s
+                 get_raw_print_options (&opts);
+                 opts.deref_ref = 0;
+                 opts.summary = summary;
++
++                /* Frame may be needed for check_typedef of TYPE_DYNAMIC.  */
++                old_chain = make_cleanup_restore_selected_frame ();
++                select_frame (frame);
+                 common_val_print (val, stb->stream, 2, &opts, language);
++                do_cleanups (old_chain);
++
+                 ui_out_field_stream (uiout, "value", stb);
+               }
+             else
+Index: gdb-7.3.50.20110722/gdb/stap-probe.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/stap-probe.c       2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,2042 @@
++/* SystemTap probe support for GDB.
++
++   Copyright (C) 2011 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#include "defs.h"
++#include "stap-probe.h"
++#include "vec.h"
++#include "ui-out.h"
++#include "gdb_regex.h"
++#include "objfiles.h"
++#include "arch-utils.h"
++#include "command.h"
++#include "filenames.h"
++#include "value.h"
++#include "exceptions.h"
++#include "ax.h"
++#include "ax-gdb.h"
++#include "user-regs.h"
++#include "complaints.h"
++#include "cli/cli-utils.h"
++#include "linespec.h"
++
++#include <ctype.h>
++
++/* This define is used to inform whether we are compiling an agent
++   expression or not.  */
++
++#define STAP_COMPILING_AGENT_EXPR_P(eval_info) \
++  (eval_info->aexpr != NULL)
++
++/* The various possibilities of bitness defined for a probe's argument.
++
++   The relationship is:
++
++   - STAP_ARG_BITNESS_UNDEFINED:  The user hasn't specified the bitness.
++   - STAP_ARG_BITNESS_32BIT_UNSIGNED:  argument string starts with `4@'.
++   - STAP_ARG_BITNESS_32BIT_SIGNED:  argument string starts with `-4@'.
++   - STAP_ARG_BITNESS_64BIT_UNSIGNED:  argument string starts with `8@'.
++   - STAP_ARG_BITNESS_64BIT_SIGNED:  argument string starts with `-8@'.  */
++
++enum stap_arg_bitness
++{
++  STAP_ARG_BITNESS_UNDEFINED,
++  STAP_ARG_BITNESS_32BIT_UNSIGNED,
++  STAP_ARG_BITNESS_32BIT_SIGNED,
++  STAP_ARG_BITNESS_64BIT_UNSIGNED,
++  STAP_ARG_BITNESS_64BIT_SIGNED,
++};
++
++/* The following structure represents a single argument for the probe.  */
++
++struct stap_probe_arg
++{
++  /* The bitness of this argument.  */
++  enum stap_arg_bitness bitness;
++
++  /* The string representing this argument.  */
++  char *arg_str;
++};
++
++/* The maximum number of arguments that a probe can have,
++   as defined in <sys/sdt.h>.  */
++
++#define STAP_MAX_ARGS 10
++
++/* Structure that holds information about all arguments of a probe.  */
++
++struct stap_args_info
++{
++  /* The number of valid parsed arguments.  */
++  int n_args;
++
++  /* The probe to which these arguments belong.  */
++  struct stap_probe *probe;
++
++  /* Information about each argument.  */
++  struct stap_probe_arg *arg;
++};
++
++/* Structure that contains all the necessary information to evaluate
++   an expression.  */
++
++struct stap_evaluation_info
++{
++  /* The constant pointer which holds the expression. This is primarily
++     used for printing error messages.  Evaluation functions should
++     not modify this pointer directly; instead, they should use the
++     EXP_BUFFER pointer below.  */
++  const char *saved_expr;
++
++  /* Modifiable version of the above pointer.  */
++  char *exp_buf;
++
++  /* The pointer to the current gdbarch.  */
++  struct gdbarch *gdbarch;
++
++  /* The pointer to the current frame, used when accessing registers'
++     contents.  */
++  struct frame_info *frame;
++
++  /* The bitness specified for this argument.  */
++  enum stap_arg_bitness bitness;
++
++  /* If the above flag is true (one), this field will contain the
++     pointer to the agent expression.  */
++  struct agent_expr *aexpr;
++
++  /* The value we are modifying (for agent expression).  */
++  struct axs_value *avalue;
++};
++
++/* This dummy variable is used when parsing a probe's argument fails.
++   In this case, the number of arguments for this probe is zero, so that's
++   why this variable is useful.  */
++
++static struct stap_args_info dummy_stap_args_info =
++  { 0, NULL, NULL };
++
++static struct value *stap_evaluate_probe_argument_2
++  (struct stap_evaluation_info *eval_info,
++   struct value *lhs, int prec);
++
++static struct value *stap_evaluate_conditionally
++  (struct stap_evaluation_info *eval_info);
++
++/* Helper function which decides to skip whitespaces or not in a probe's
++   argument string.  Basically, if we are inside a parenthesis expression
++   (i.e., inside a subexpression), we can skip whitespaces; otherwise we
++   cannot.  */
++
++static void
++stap_skip_whitespace_cond (char **s, int inside_paren)
++{
++  if (inside_paren)
++    *s = skip_spaces (*s);
++}
++
++/* Helper function which parses a single argument in a probe's argument
++   string, based on various rules (which can be learned from the `gas'
++   manual).  It returns 1 on success, or 0 otherwise.  */
++
++static int
++stap_parse_arg (const char **p)
++{
++  char *cur = (char *) *p;
++  int done = 0;
++  int paren_open = 0;
++
++  while (!done)
++    {
++      switch (*cur)
++      {
++      case ' ': case 0:
++        /* If we're here, then we have already parsed everything
++           from this argument.  */
++        if (paren_open)
++          return 0;
++        done = 1;
++        break;
++
++      case '(':
++        ++paren_open;
++        ++cur;
++        stap_skip_whitespace_cond (&cur, paren_open);
++        break;
++
++      case ')':
++        if (!paren_open)
++          return 0;
++
++        --paren_open;
++        ++cur;
++        if (paren_open)
++          cur = skip_spaces (cur);
++        break;
++
++      case '+': case '-':
++      case '*': case '/':
++      case '>': case '<': case '|': case '&':
++      case '^': case '!':
++          {
++            char c = *cur;
++
++            ++cur;
++            switch (*cur)
++              {
++              case '>':
++                if (c != '<' && c != '>')
++                  return 0;
++
++                ++cur;
++                break;
++
++              case '<':
++                if (c != '<')
++                  return 0;
++
++                ++cur;
++                break;
++
++              case '=':
++                if (c != '=' && c != '<' && c != '>' && c != '!')
++                  return 0;
++
++                ++cur;
++                break;
++
++              case '|':
++                if (c != '|')
++                  return 0;
++
++                ++cur;
++                break;
++
++              case '&':
++                if (c != '&')
++                  return 0;
++
++                ++cur;
++                break;
++
++              default:
++                break;
++              }
++            /* Infix operators take two arguments, one on either
++               side.  Skipping the whitespaces that may happen on the
++               right side.  */
++            stap_skip_whitespace_cond (&cur, paren_open);
++          }
++        break;
++
++      case '%':
++          {
++            ++cur;
++            stap_skip_whitespace_cond (&cur, paren_open);
++            if (*cur >= 'a' && *cur <= 'z')
++              {
++                /* We're dealing with a register name.  */
++                while (isalnum (*cur))
++                  ++cur;
++
++                stap_skip_whitespace_cond (&cur, paren_open);
++
++                /* Some registers (e.g. floating-point register stack
++                   registers on Intel i386) have the following syntax:
++
++                   `%st(0)', `%st(1)', and so on.
++
++                   So it's ok to expect parenthesis here.  */
++                if (*cur == '(')
++                  {
++                    ++cur;
++                    stap_skip_whitespace_cond (&cur, paren_open);
++                    if (!isdigit (*cur))
++                      /* This is an error, since we only expect numbers
++                         inside this parenthesis.  */
++                      return 0;
++                    ++cur;
++                    stap_skip_whitespace_cond (&cur, paren_open);
++                    if (*cur != ')')
++                      /* We only expect one number.  */
++                      return 0;
++                    ++cur;
++                    stap_skip_whitespace_cond (&cur, paren_open);
++                  }
++              }
++          }
++        break;
++
++      case '$':
++          {
++            /* This is an integer constant.  */
++            ++cur;
++            stap_skip_whitespace_cond (&cur, paren_open);
++
++            while (isdigit (*cur))
++              ++cur;
++
++            stap_skip_whitespace_cond (&cur, paren_open);
++          }
++        break;
++
++      case '0': case '1': case '2': case '3': case '4':
++      case '5': case '6': case '7': case '8': case '9':
++          {
++            char *old = cur;
++
++            /* Number.  */
++            while (isdigit (*cur))
++              ++cur;
++
++            /* We have to do a lookahead here, because the user may
++               input `2 + 2' (with spaces), and this is not an error.  */
++            cur = skip_spaces (cur);
++
++            switch (*cur)
++              {
++              case '+': case '-':
++                /* We may find the `@' sign, and it means that the
++                   argument has finished, so we shouldn't advance the
++                   pointer.  */
++                if (cur[1] && (cur[1] == '4' || cur[1] == '8')
++                    && cur[2] && cur[2] == '@')
++                  {
++                    cur = old;
++                    goto fin;
++                  }
++                break;
++
++              case '*': case '/': case '>': case '<':
++              case '|': case '&': case '^': case '!':
++                /* This is a binary operation, which means we'll
++                   have to find another number after the operator.  */
++                break;
++
++              case '(':
++                /* We may also have sentences in the form:
++
++                   `4 (%rax)'  */
++                break;
++              }
++          }
++fin:
++        break;
++      }
++    }
++
++  *p = cur;
++
++  return 1;
++}
++
++/* Helper function which is responsible for freeing the space allocated to
++   hold information about a probe's arguments.  */
++
++static void
++stap_free_args_info (void *args_info_ptr)
++{
++  struct stap_args_info *a = (struct stap_args_info *) args_info_ptr;
++  int i;
++
++  for (i = 0; i < a->n_args; i++)
++    xfree (a->arg[i].arg_str);
++
++  xfree (a->arg);
++  xfree (a);
++}
++
++/* Function which parses an argument string from PROBE, correctly splitting
++   the arguments and storing their information in properly ways.  This function
++   only separates the arguments, but does not evaluate them.
++
++   Consider the following argument string:
++
++   `4@%eax 4@$10'
++
++   We have two arguments, `%eax' and `$10', both with 32-bit unsigned bitness.
++   This function basically handles them, properly filling some structures with
++   this information.  */
++
++static void
++stap_parse_probe_arguments (struct stap_probe *probe)
++{
++  struct stap_args_info *args_info;
++  struct cleanup *back_to;
++  const char *cur = probe->args;
++  int current_arg = -1;
++  /* This is a state-machine parser, which means we will always be
++     in a known state when parsing an argument.  The state could be
++     either `NEW_ARG' if we are parsing a new argument, `BITNESS' if
++     we are parsing the bitness-definition part (i.e., `4@'), or
++     `PARSE_ARG' if we are actually parsing the argument part.  */
++  enum
++    {
++      NEW_ARG,
++      BITNESS,
++      PARSE_ARG,
++    } current_state;
++
++  /* For now, we assume everything is not going to work.  */
++  probe->parsed_args = &dummy_stap_args_info;
++
++  if (!cur || !*cur || *cur == ':')
++    return;
++
++  args_info = xmalloc (sizeof (struct stap_args_info));
++  args_info->n_args = 0;
++  back_to = make_cleanup (stap_free_args_info, args_info);
++  args_info->arg = xcalloc (STAP_MAX_ARGS, sizeof (struct stap_probe_arg));
++
++  /* Ok, let's start.  */
++  current_state = NEW_ARG;
++
++  while (*cur)
++    {
++      switch (current_state)
++      {
++      case NEW_ARG:
++        ++current_arg;
++
++        if (current_arg >= STAP_MAX_ARGS)
++          {
++            complaint (&symfile_complaints,
++                       _("probe `%s' has more arguments than the maximum "
++                         "allowed"), probe->name);
++            do_cleanups (back_to);
++            return;
++          }
++
++        current_state = BITNESS;
++        break;
++
++      case BITNESS:
++          {
++            enum stap_arg_bitness b;
++            int got_minus = 0;
++
++            /* We expect to find something like:
++
++               N@OP
++
++               Where `N' can be [+,-][4,8].  This is not mandatory, so
++               we check it here.  If we don't find it, go to the next
++               state.  */
++            if ((*cur == '-' && cur[1] && cur[2] != '@')
++                && cur[1] != '@')
++              {
++                current_state = PARSE_ARG;
++                args_info->arg[current_arg].bitness
++                  = STAP_ARG_BITNESS_UNDEFINED;
++                break;
++              }
++
++            if (*cur == '-')
++              {
++                /* Discard the `-'.  */
++                ++cur;
++                got_minus = 1;
++              }
++
++            if (*cur == '4')
++              b = got_minus ? STAP_ARG_BITNESS_32BIT_SIGNED
++                : STAP_ARG_BITNESS_32BIT_UNSIGNED;
++            else if (*cur == '8')
++              b = got_minus ? STAP_ARG_BITNESS_64BIT_SIGNED
++                : STAP_ARG_BITNESS_64BIT_UNSIGNED;
++            else
++              {
++                /* We have an error, because we don't expect anything
++                   except 4 and 8.  */
++                complaint (&symfile_complaints,
++                           _("unrecognized bitness `%c' for probe `%s'"),
++                           *cur, probe->name);
++                do_cleanups (back_to);
++                return;
++              }
++
++            args_info->arg[current_arg].bitness = b;
++            /* Discard the number and the `@' sign.  */
++            cur += 2;
++            /* Move on.  */
++            current_state = PARSE_ARG;
++          }
++        break;
++
++      case PARSE_ARG:
++          {
++            const char *start = cur;
++
++            if (!stap_parse_arg (&cur))
++              {
++                /* We have tried to parse this argument, but it's
++                   malformed.  This is an error.  */
++                do_cleanups (back_to);
++                return;
++              }
++
++            args_info->arg[current_arg].arg_str
++              = savestring (start, cur - start);
++            ++args_info->n_args;
++            /* Start it over again.  */
++            cur = skip_spaces ((char *) cur);
++            current_state = NEW_ARG;
++          }
++        break;
++      }
++
++      if (!*cur && current_state != NEW_ARG)
++      {
++        /* We reached the end of the argument string, but we're
++           still in the middle of the process of parsing an argument.
++           It means the argument string is malformed.  */
++        complaint (&symfile_complaints,
++                   _("malformed argument for probe `%s'"),
++                   probe->name);
++        do_cleanups (back_to);
++        return;
++      }
++    }
++
++  args_info->arg = xrealloc (args_info->arg,
++                            args_info->n_args
++                            * sizeof (struct stap_probe_arg));
++  args_info->probe = probe;
++
++  probe->parsed_args = args_info;
++
++  discard_cleanups (back_to);
++}
++
++/* See definition in stap-probe.h.  */
++
++int
++stap_get_probe_argument_count (const struct stap_probe *probe)
++{
++  if (!probe->parsed_args)
++    stap_parse_probe_arguments ((struct stap_probe *) probe);
++
++  return probe->parsed_args->n_args;
++}
++
++/* Returns the operator precedence level of OP, or zero if the operator
++   code was not recognized.
++   The levels were taken from the gas manual.  */
++
++static int
++stap_get_operator_prec (enum exp_opcode op)
++{
++  switch (op)
++    {
++    case BINOP_LOGICAL_OR:
++      return 1;
++
++    case BINOP_LOGICAL_AND:
++      return 2;
++
++    case BINOP_ADD: case BINOP_SUB:
++    case BINOP_EQUAL: case BINOP_NOTEQUAL:
++    case BINOP_LESS: case BINOP_LEQ:
++    case BINOP_GTR: case BINOP_GEQ:
++      return 3;
++
++    case BINOP_BITWISE_IOR: case BINOP_BITWISE_AND:
++    case BINOP_BITWISE_XOR: case UNOP_LOGICAL_NOT:
++      return 4;
++
++    case BINOP_MUL: case BINOP_DIV: case BINOP_REM:
++    case BINOP_LSH: case BINOP_RSH:
++      return 5;
++
++    default:
++      return 0;
++    }
++}
++
++/* Given S, this function reads the operator in it and fills the OP
++   pointer with its code.  Returns 1 on success, zero if the operator
++   was not recognized.  */
++
++static int
++stap_get_opcode (char **s, enum exp_opcode *op)
++{
++  char c = **s;
++  int ret = 1;
++
++  *s += 1;
++
++  switch (c)
++    {
++    case '*':
++      *op = BINOP_MUL;
++      break;
++
++    case '/':
++      *op = BINOP_DIV;
++      break;
++
++    case '%':
++      {
++      if (isalpha (**s))
++        {
++          /* Dealing with a register name.  */
++          ret = 0;
++          break;
++        }
++
++      *op = BINOP_REM;
++      }
++    break;
++
++    case '<':
++      *op = BINOP_LESS;
++      if (**s == '<')
++      {
++        *s += 1;
++        *op = BINOP_LSH;
++      }
++      else if (**s == '=')
++      {
++        *s += 1;
++        *op = BINOP_LEQ;
++      }
++      else if (**s == '>')
++      {
++        *s += 1;
++        *op = BINOP_NOTEQUAL;
++      }
++    break;
++
++    case '>':
++      *op = BINOP_GTR;
++      if (**s == '>')
++      {
++        *s += 1;
++        *op = BINOP_RSH;
++      }
++      else if (**s == '=')
++      {
++        *s += 1;
++        *op = BINOP_GEQ;
++      }
++    break;
++
++    case '|':
++      *op = BINOP_BITWISE_IOR;
++      if (**s == '|')
++      {
++        *s += 1;
++        *op = BINOP_LOGICAL_OR;
++      }
++    break;
++
++    case '&':
++      *op = BINOP_BITWISE_AND;
++      if (**s == '&')
++      {
++        *s += 1;
++        *op = BINOP_LOGICAL_AND;
++      }
++    break;
++
++    case '^':
++      *op = BINOP_BITWISE_XOR;
++      break;
++
++    case '!':
++      *op = UNOP_LOGICAL_NOT;
++      break;
++
++    case '+':
++      *op = BINOP_ADD;
++      break;
++
++    case '-':
++      *op = BINOP_SUB;
++      break;
++
++    case '=':
++      if (**s != '=')
++      {
++        ret = 0;
++        break;
++      }
++      *op = BINOP_EQUAL;
++      break;
++
++    default:
++      /* We didn't find any operator.  */
++      *s -= 1;
++      return 0;
++    }
++
++  return ret;
++}
++
++/* Given the operator OPCODE, this function generates agent bytecode
++   for it.  */
++
++static void
++stap_opcode_to_ax (struct stap_evaluation_info *eval_info,
++                 enum exp_opcode opcode)
++{
++  struct agent_expr *expr = eval_info->aexpr;
++
++  switch (opcode)
++    {
++    case BINOP_MUL:
++      ax_simple (expr, aop_mul);
++      break;
++
++    case BINOP_DIV:
++      ax_simple (expr, aop_div_signed);
++      break;
++
++    case BINOP_REM:
++      ax_simple (expr, aop_rem_unsigned);
++      break;
++
++    case BINOP_LESS:
++      ax_simple (expr, aop_less_signed);
++      break;
++
++    case BINOP_LEQ:
++      /* A <= B is !(B < A) */
++      ax_simple (expr, aop_swap);
++      ax_simple (expr, aop_less_signed);
++      ax_simple (expr, aop_log_not);
++      break;
++
++    case BINOP_GTR:
++      /* A > B is B < A */
++      ax_simple (expr, aop_swap);
++      ax_simple (expr, aop_less_signed);
++      break;
++
++    case BINOP_GEQ:
++      /* A >= B is !(A < B) */
++      ax_simple (expr, aop_less_signed);
++      ax_simple (expr, aop_log_not);
++      break;
++
++    case BINOP_NOTEQUAL:
++      ax_simple (expr, aop_equal);
++      ax_simple (expr, aop_log_not);
++      break;
++
++    case BINOP_LSH:
++      ax_simple (expr, aop_lsh);
++      break;
++
++    case BINOP_RSH:
++      ax_simple (expr, aop_rsh_unsigned);
++      break;
++
++    case BINOP_BITWISE_IOR:
++      ax_simple (expr, aop_bit_or);
++      break;
++     
++    case BINOP_LOGICAL_OR:
++      error (_("Operator logical-or (`||') not supported yet."));
++      break;
++
++    case BINOP_BITWISE_AND:
++      ax_simple (expr, aop_bit_and);
++      break;
++
++    case BINOP_LOGICAL_AND:
++      error (_("Operator logical-and (`&&') not supported yet."));
++      break;
++
++    case BINOP_BITWISE_XOR:
++      ax_simple (expr, aop_bit_xor);
++      break;
++
++    case UNOP_LOGICAL_NOT:
++      ax_simple (expr, aop_log_not);
++      break;
++
++    case BINOP_ADD:
++      ax_simple (expr, aop_add);
++      break;
++
++    case BINOP_SUB:
++      ax_simple (expr, aop_sub);
++      break;
++
++    case BINOP_EQUAL:
++      ax_simple (expr, aop_equal);
++      break;
++
++    default:
++      error (_("Invalid operator."));
++    }
++}
++
++/* Returns 1 if *S is an operator, zero otherwise.  */
++
++static int
++stap_is_operator (char *s)
++{
++  char op;
++
++  if (!s || !*s)
++    return 0;
++
++  op = *s;
++
++  if (*s == '%' && isalpha (s[1]))
++    /* Register name.  */
++    return 0;
++
++  return (op == '+' || op == '-' || op == '*' || op == '/'
++        || op == '>' || op == '<' || op == '!' || op == '^'
++        || op == '|' || op == '&' || op == '%' || op == '=');
++}
++
++/* This function fetches the value of the register whose
++   name starts in the expression buffer.  It also applies any register
++   displacements (e.g., `-4(%eax)'), and indirects the contents of the
++   register (e.g., `(%eax)').  It returns RET if the operation has succeeded,
++   or calls `error' otherwise.  */
++
++static struct value *
++stap_fetch_reg_value (struct stap_evaluation_info *eval_info,
++                    struct value *displacement)
++{
++  const char *start;
++  char *s = eval_info->exp_buf;
++  struct gdbarch *gdbarch = eval_info->gdbarch;
++  struct frame_info *frame = eval_info->frame;
++  enum stap_arg_bitness bitness = eval_info->bitness;
++  char *regname;
++  int len, regnum, indirect_p = 0;
++  struct value *ret = NULL;
++  
++  /* The function which called us did not check if the expression
++     buffer was empty.  */
++  gdb_assert (s && *s);
++
++  if (STAP_COMPILING_AGENT_EXPR_P (eval_info))
++    /* If we are compiling, we cannot return NULL because that would
++       lead to errors in future evaluations.  That's why we just make
++       this dummy value, representing that the return value of this
++       function is not NULL.  */
++    ret = value_from_longest (builtin_type (gdbarch)->builtin_int, 0);
++
++  /* Valid register name on x86 platforms are:
++
++     [paren]%{a-z0-9}[paren]
++
++     Let's check for that here.  */
++  if (*s == '(')
++    {
++      ++s;
++      if (!*s || *s != '%'
++        || (*s == '%' && !isalpha (s[1])))
++      error (_("Invalid register name on expression `%s'."),
++             eval_info->saved_expr);
++      ++s;
++      /* The presence of parenthesis means that we want to indirect
++       the register.  */
++      indirect_p = 1;
++    }
++  else if (*s == '%')
++    {
++      ++s;
++      if (!*s || !isalpha (*s))
++      error (_("Invalid register name on expression `%s'."),
++             eval_info->saved_expr);
++    }
++  else
++    error (_("Invalid register name on expression `%s'."),
++         eval_info->saved_expr);
++
++  if (displacement && !indirect_p)
++    /* We cannot apply displacement to non-indirect register access.  */
++    error (_("Trying to apply displacement without indirecting register "
++           "on expression `%s'."), eval_info->saved_expr);
++
++  /* Ok, let's calculate the size of the register name.  */
++  start = s;
++  while (isalnum (*s))
++    ++s;
++
++  len = s - start;
++
++  if (indirect_p && *s == ')')
++    ++s;
++
++  regname = alloca (len + 1);
++  strncpy (regname, start, len);
++  regname[len] = '\0';
++
++  /* Translating the register name into the corresponding number.  */
++  regnum = user_reg_map_name_to_regnum (gdbarch, regname, len);
++
++  if (regnum == -1)
++    error (_("Invalid register name `%s' on expression `%s'."),
++         regname, eval_info->saved_expr);
++
++  if (STAP_COMPILING_AGENT_EXPR_P (eval_info))
++    ax_reg (eval_info->aexpr, regnum);
++  else
++    ret = value_of_register (regnum, frame);
++
++  if (indirect_p)
++    {
++      struct type *t = NULL;
++      enum agent_op aop = aop_ref32;
++
++      /* If the user has specified that the register must be indirected,
++       we should know what's the correct type to cast it before making
++       the indirection.  This type corresponds to the bitness specified
++       before the `@' sign on the argument string, or it defaults to
++       `unsigned long' if the `@' were not present.  */
++
++      switch (bitness)
++      {
++      case STAP_ARG_BITNESS_UNDEFINED:
++        if (STAP_COMPILING_AGENT_EXPR_P (eval_info))
++          {
++            if (gdbarch_addr_bit (gdbarch) == 32)
++              aop = aop_ref32;
++            else
++              aop = aop_ref64;
++          }
++        else
++          {
++            if (gdbarch_addr_bit (gdbarch) == 32)
++              t = lookup_pointer_type
++                (builtin_type (gdbarch)->builtin_uint32);
++            else
++              t = lookup_pointer_type
++                (builtin_type (gdbarch)->builtin_uint64);
++          }
++        break;
++
++      case STAP_ARG_BITNESS_32BIT_SIGNED:
++        if (STAP_COMPILING_AGENT_EXPR_P (eval_info))
++          aop = aop_ref32;
++        else
++          t = lookup_pointer_type
++            (builtin_type (gdbarch)->builtin_int32);
++        break;
++
++      case STAP_ARG_BITNESS_32BIT_UNSIGNED:
++        if (STAP_COMPILING_AGENT_EXPR_P (eval_info))
++          aop = aop_ref32;
++        else
++          t = lookup_pointer_type
++            (builtin_type (gdbarch)->builtin_uint32);
++        break;
++
++      case STAP_ARG_BITNESS_64BIT_SIGNED:
++        if (STAP_COMPILING_AGENT_EXPR_P (eval_info))
++          aop = aop_ref64;
++        else
++          t = lookup_pointer_type
++            (builtin_type (gdbarch)->builtin_int64);
++        break;
++
++      case STAP_ARG_BITNESS_64BIT_UNSIGNED:
++        if (STAP_COMPILING_AGENT_EXPR_P (eval_info))
++          aop = aop_ref64;
++        else
++          t = lookup_pointer_type
++            (builtin_type (gdbarch)->builtin_uint64);
++        break;
++
++      default:
++        internal_error (__FILE__, __LINE__,
++                        _("Undefined bitness for probe."));
++        break;
++      }
++
++      if (displacement)
++      {
++        if (STAP_COMPILING_AGENT_EXPR_P (eval_info))
++          {
++            ax_const_l (eval_info->aexpr, value_as_long (displacement));
++            ax_simple (eval_info->aexpr, aop_add);
++          }
++        else
++          ret = value_ptradd (ret, value_as_long (displacement));
++      }
++
++      if (STAP_COMPILING_AGENT_EXPR_P (eval_info))
++      {
++        if (trace_kludge)
++          {
++            gdb_assert (aop == aop_ref32 || aop == aop_ref64);
++            ax_trace_quick (eval_info->aexpr, aop == aop_ref32 ? 4 : 8);
++          }
++        ax_simple (eval_info->aexpr, aop);
++      }
++      else
++      {
++        ret = value_cast (t, ret);
++        ret = value_ind (ret);
++      }
++    }
++
++  /* Updating the expression buffer pointer, because we have made
++     some modifications to it before.  */
++  eval_info->exp_buf = s;
++
++  return ret;
++}
++
++/* This function tries to evaluate a single operand of the expression.
++
++   Single operands can be:
++
++   - unary operators `-' and `~';
++   - integer constants (beginning with `$');
++   - register access, with/out displacement and indirection.  */
++
++static struct value *
++stap_evaluate_single_operand (struct stap_evaluation_info *eval_info)
++{
++  struct gdbarch *gdbarch = eval_info->gdbarch;
++  struct frame_info *frame = eval_info->frame;
++  enum stap_arg_bitness bitness = eval_info->bitness;
++  struct value *res = NULL;
++
++  if (STAP_COMPILING_AGENT_EXPR_P (eval_info))
++    /* If we are compiling, we cannot return NULL because that would
++       lead to errors in future evaluations.  That's why we just make
++       this dummy value, representing that the return value of this
++       function is not NULL.  */
++    res = value_from_longest (builtin_type (gdbarch)->builtin_int, 0);
++
++  switch (*eval_info->exp_buf)
++    {
++    case '-': case '~':
++      {
++        char c = *eval_info->exp_buf;
++
++        /* This is an unary operator (either `-' or `~').
++
++           If it is followed by a parenthesis, and this parenthesis
++           is NOT followed by a `%', then we are dealing with an expression
++           like `-(2 + 3)' or `~(2 + 3)'.  We just have to treat separately
++           and return the result after applying the operation (`-' or `~').
++
++           If it is followed by a digit, then we have only one choice:  it
++           is a displacement argument for a register access, like
++           `-4(%eax)'.  It also means that the operator can *only* be `-',
++           and the characters immediately after the number *must* be `(%'.
++
++           If it is followed by a `$', then it is an integer constant, and
++           we should apply the correct operation to it.  */
++
++        ++eval_info->exp_buf;
++        eval_info->exp_buf = skip_spaces (eval_info->exp_buf);
++        if (*eval_info->exp_buf
++            && *eval_info->exp_buf == '('
++            && eval_info->exp_buf[1] != '%')
++          {
++            struct value *tmp_res;
++
++            /* We're not dealing with a register name, but with an
++               expression like `-(2 + 3)' or `~(2 + 3)'.  We first have
++               to evaluate the right side of the expression (i.e., the
++               parenthesis), and then apply the specified operation
++               (either `-' or `~') to it.  */
++            tmp_res = stap_evaluate_conditionally (eval_info);
++
++            if (c == '-')
++              {
++                if (STAP_COMPILING_AGENT_EXPR_P (eval_info))
++                  {
++                    /* We have to add `-1' to the stack, and multiply
++                       the two values.  */
++                    ax_const_l (eval_info->aexpr, -1);
++                    ax_simple (eval_info->aexpr, aop_mul);
++                  }
++                else
++                  res = value_neg (tmp_res);
++              }
++            else
++              {
++                if (STAP_COMPILING_AGENT_EXPR_P (eval_info))
++                  ax_simple (eval_info->aexpr, aop_bit_not);
++                else
++                  res = value_complement (tmp_res);
++              }
++          }
++        else if (isdigit (*eval_info->exp_buf))
++          {
++            int number;
++
++            /* This is a number, so it MUST be a register displacement.
++               The only operator allowed here is `-', it MUST be
++               followed by a number, and the number MUST be followed by
++               `(%'.  */
++            if (c != '-')
++              error (_("Invalid operator `%c' for register displacement "
++                       "on expression `%s'."), c, eval_info->saved_expr);
++
++            number = strtol (eval_info->exp_buf,
++                             &eval_info->exp_buf, 0) * -1;
++
++            if (!*eval_info->exp_buf
++                || *eval_info->exp_buf != '('
++                || (*eval_info->exp_buf == '('
++                    && eval_info->exp_buf[1] != '%'))
++              error (_("Invalid method of indirecting a register on "
++                       "expression `%s'."), eval_info->saved_expr);
++
++            res
++              = value_from_longest (builtin_type (gdbarch)->builtin_int,
++                                    number);
++
++            res = stap_fetch_reg_value (eval_info, res);
++          }
++        else if (*eval_info->exp_buf == '$')
++          {
++            int number;
++
++            /* Last case.  We are dealing with an integer constant, so
++               we must read it and then apply the necessary operation,
++               either `-' or `~'.  */
++            ++eval_info->exp_buf;
++            number = strtol (eval_info->exp_buf,
++                             &eval_info->exp_buf, 0);
++
++            if (!STAP_COMPILING_AGENT_EXPR_P (eval_info))
++              res
++                = value_from_longest (builtin_type (gdbarch)->builtin_int,
++                                      number);
++            else
++              ax_const_l (eval_info->aexpr, number);
++
++            eval_info->exp_buf = skip_spaces (eval_info->exp_buf);
++
++            if (c == '-')
++              {
++                if (STAP_COMPILING_AGENT_EXPR_P (eval_info))
++                  ax_simple (eval_info->aexpr, aop_log_not);
++                else
++                  res = value_neg (res);
++              }
++            else
++              {
++                if (STAP_COMPILING_AGENT_EXPR_P (eval_info))
++                  ax_simple (eval_info->aexpr, aop_bit_not);
++                else
++                  res = value_complement (res);
++              }
++          }
++        else
++          error (_("Invalid operand to unary operator `%c' on "
++                   "expression `%s'."), c, eval_info->saved_expr);
++      }
++      break;
++
++    case '0': case '1': case '2': case '3': case '4':
++    case '5': case '6': case '7': case '8': case '9':
++      {
++      int number = strtol (eval_info->exp_buf, &eval_info->exp_buf, 0);
++
++      /* This is a register displacement with a positive value.  We read
++         the number, and then check for the mandatory `(%' part.  */
++      if (!*eval_info->exp_buf
++          || !(*eval_info->exp_buf == '('
++               && eval_info->exp_buf[1] == '%'))
++        error (_("Invalid register access on expression `%s'."),
++               eval_info->saved_expr);
++
++      res = value_from_longest (builtin_type (gdbarch)->builtin_int,
++                                number);
++
++      res = stap_fetch_reg_value (eval_info, res);
++      }
++    break;
++
++    case '$':
++      {
++      int number;
++
++      /* This is an integer constant.  We just have to read the number
++         and return it.  */
++      ++eval_info->exp_buf;
++      eval_info->exp_buf = skip_spaces (eval_info->exp_buf);
++
++      number = strtol (eval_info->exp_buf, &eval_info->exp_buf, 0);
++
++      if (STAP_COMPILING_AGENT_EXPR_P (eval_info))
++        ax_const_l (eval_info->aexpr, number);
++      else
++        res = value_from_longest (builtin_type (gdbarch)->builtin_int,
++                                  number);
++
++      eval_info->exp_buf = skip_spaces (eval_info->exp_buf);
++      }
++    break;
++
++    case '(': case '%':
++      {
++      /* Register access, with or without indirection.  */
++      res = stap_fetch_reg_value (eval_info, /*displacement=*/NULL);
++      eval_info->exp_buf = skip_spaces (eval_info->exp_buf);
++      }
++    break;
++
++    default:
++      {
++      error (_("Operator `%c' not recognized on expression `%s'."),
++             *eval_info->exp_buf, eval_info->saved_expr);
++      }
++    }
++
++  return res;
++}
++
++/* This function is responsible for checking the necessary type of evaluation
++   depending on what is the next "thing" in the buffer.  Valid values are:
++
++   - Unary operators;
++   - Integer constants;
++   - Register displacement, indirection, and direct access;
++   - Parenthesized operand.  */
++
++static struct value *
++stap_evaluate_conditionally (struct stap_evaluation_info *eval_info)
++{
++  char *s = eval_info->exp_buf;
++  struct value *ret = NULL;
++
++  if (*s == '-' || *s == '~' /* Unary operators.  */
++      || *s == '$' /* Number (integer constant).  */
++      || (isdigit (*s) && s[1] == '(' && s[2] == '%') /* Displacement.  */
++      || (*s == '(' && s[1] == '%') /* Register indirection.  */
++      || (*s == '%' && isalpha (s[1]))) /* Register value.  */
++    /* This is a single operand, so just evaluate it and return.  */
++    ret = stap_evaluate_single_operand (eval_info);
++  else if (*s == '(')
++    {
++      /* We are dealing with a parenthesized operand.  It means we
++       have to evaluate it as it was a separate expression, without
++       left-side or precedence.  */
++      ++eval_info->exp_buf;
++      eval_info->exp_buf = skip_spaces (eval_info->exp_buf);
++
++      ret = stap_evaluate_probe_argument_2 (eval_info,
++                                          /*lhs=*/NULL, /*prec=*/0);
++
++      if (*eval_info->exp_buf != ')')
++      error (_("Missign close-paren on expression `%s'."),
++             eval_info->saved_expr);
++
++      ++eval_info->exp_buf;
++      eval_info->exp_buf = skip_spaces (eval_info->exp_buf);
++    }
++  else
++    error (_("Cannot evaluate expression `%s'."),
++         eval_info->saved_expr);
++
++  return ret;
++}
++
++/* Evaluation function for probe's argument expressions.  LHS represents
++   the left side of the expression, and PREC is the precedence of the
++   last operator identified before calling the function.  */
++
++static struct value *
++stap_evaluate_probe_argument_2 (struct stap_evaluation_info *eval_info,
++                              struct value *lhs, int prec)
++{
++  struct value *rhs = NULL;
++  int compiling_p = STAP_COMPILING_AGENT_EXPR_P (eval_info);
++
++  /* This is an operator-precedence parser and evaluator.
++
++     We work with left- and right-sides of expressions, and
++     evaluate them depending on the precedence of the operators
++     we find.  */
++
++  eval_info->exp_buf = skip_spaces (eval_info->exp_buf);
++
++  if (!lhs)
++    /* We were called without a left-side, either because this is the
++       first call, or because we were called to evaluate a parenthesized
++       expression.  It doesn't really matter; we have to evaluate the
++       left-side in order to continue the process.  */
++    lhs = stap_evaluate_conditionally (eval_info);
++
++  /* Start to evaluate the right-side, and to "join" left and right sides
++     depending on the operation specified.
++
++     This loop shall continue until we run out of characters in the input,
++     or until we find a close-parenthesis, which means that we've reached
++     the end of a sub-expression.  */
++  while (eval_info->exp_buf
++       && *eval_info->exp_buf
++       && *eval_info->exp_buf != ')')
++    {
++      char *tmp_exp_buf;
++      enum exp_opcode opcode;
++      int cur_prec;
++
++      if (!stap_is_operator (eval_info->exp_buf))
++      error (_("Invalid operator `%c' on expression `%s'."),
++             *eval_info->exp_buf, eval_info->saved_expr);
++
++      /* We have to save the current value of the expression buffer because
++       the `stap_get_opcode' modifies it in order to get the current
++       operator.  If this operator's precedence is lower than PREC, we
++       should return and not advance the expression buffer pointer.  */
++      tmp_exp_buf = eval_info->exp_buf;
++      stap_get_opcode (&tmp_exp_buf, &opcode);
++
++      cur_prec = stap_get_operator_prec (opcode);
++      if (cur_prec < prec)
++      /* If the precedence of the operator that we are seeing now is
++         lower than the precedence of the first operator seen before
++         this evaluation process began, it means we should stop evaluating
++         and return.  */
++      break;
++
++      eval_info->exp_buf = tmp_exp_buf;
++      eval_info->exp_buf = skip_spaces (eval_info->exp_buf);
++
++      /* Evaluate the right-side of the expression.  */
++      rhs = stap_evaluate_conditionally (eval_info);
++
++      /* While we still have operators, try to evaluate another
++       right-side, but using the current right-side as a left-side.  */
++      while (*eval_info->exp_buf
++           && stap_is_operator (eval_info->exp_buf))
++      {
++        enum exp_opcode lookahead_opcode;
++        int lookahead_prec;
++
++        /* Saving the current expression buffer position.  The explanation
++           is the same as above.  */
++        tmp_exp_buf = eval_info->exp_buf;
++        stap_get_opcode (&tmp_exp_buf, &lookahead_opcode);
++        lookahead_prec = stap_get_operator_prec (lookahead_opcode);
++
++        if (lookahead_prec <= prec)
++          /* If we are dealing with an operator whose precedence is lower
++             than the first one, just abandon the attempt.  */
++          break;
++
++        rhs = stap_evaluate_probe_argument_2 (eval_info,
++                                              rhs, lookahead_prec);
++      }
++
++      /* Now, "join" both left and right sides into one left-side, using
++       the specified operator.  */
++      if (compiling_p)
++      stap_opcode_to_ax (eval_info, opcode);
++      else
++      lhs = value_binop (lhs, rhs, opcode);
++    }
++
++  return lhs;
++}
++
++/* This function fills the necessary arguments for the evaluation function
++   to work.  */
++
++static struct value *
++stap_evaluate_probe_argument_1 (struct objfile *objfile,
++                              const struct stap_probe *probe,
++                              struct frame_info *frame,
++                              int n)
++{
++  struct stap_evaluation_info eval_info;
++  char *s = (char *) probe->parsed_args->arg[n].arg_str;
++  struct value *res, *vs[4];
++
++  /* Filling necessary information for evaluation function.  */
++  eval_info.saved_expr = s;
++  eval_info.exp_buf = s;
++  eval_info.gdbarch = get_objfile_arch (objfile);
++  eval_info.frame = frame;
++  eval_info.bitness = probe->parsed_args->arg[n].bitness;
++  /* We are not compiling to an agent expression.  */
++  eval_info.aexpr = NULL;
++  eval_info.avalue = NULL;
++
++  res = stap_evaluate_probe_argument_2 (&eval_info,
++                                      /*lhs=*/NULL, /*prec=*/0);
++
++  if (!res)
++    error (_("Could not evaluate expression `%s'."),
++         eval_info.saved_expr);
++
++  return res;
++}
++
++/* See definition in stap-probe.h.  */
++
++struct value *
++stap_evaluate_probe_argument (struct objfile *objfile,
++                            const struct stap_probe *probe,
++                            struct frame_info *frame,
++                            int n)
++{
++  if (!probe->parsed_args)
++    stap_parse_probe_arguments ((struct stap_probe *) probe);
++
++  if (!probe->parsed_args->arg
++      || n >= probe->parsed_args->n_args)
++    return NULL;
++
++  return stap_evaluate_probe_argument_1 (objfile, probe, frame, n);
++}
++
++/* Helper function which compiles the probe's argument N into an
++   agent expression, suitable for using with tracepoints.  */
++
++static void
++stap_compile_to_ax_1 (struct objfile *objfile,
++                    const struct stap_probe *probe,
++                    struct agent_expr *expr,
++                    struct axs_value *value,
++                    int n)
++{
++  struct stap_evaluation_info eval_info;
++  struct gdbarch *gdbarch = expr->gdbarch;
++  char *s = (char *) probe->parsed_args->arg[n].arg_str;
++
++  /* Filling necessary information for evaluation function.  */
++  eval_info.saved_expr = s;
++  eval_info.exp_buf = s;
++  eval_info.gdbarch = expr->gdbarch;
++  eval_info.frame = NULL;
++  eval_info.bitness = probe->parsed_args->arg[n].bitness;
++  /* We are compiling to an agent expression.  */
++  eval_info.aexpr = expr;
++  eval_info.avalue = value;
++
++  /* We can always use this kind.  */
++  value->kind = axs_rvalue;
++
++  /* Figuring out the correct type for this axs_value.  */
++  switch (eval_info.bitness)
++    {
++    case STAP_ARG_BITNESS_UNDEFINED:
++      if (gdbarch_addr_bit (gdbarch) == 32)
++      value->type = builtin_type (gdbarch)->builtin_uint32;
++      else
++      value->type = builtin_type (gdbarch)->builtin_uint64;
++      break;
++
++    case STAP_ARG_BITNESS_32BIT_SIGNED:
++      value->type = builtin_type (gdbarch)->builtin_int32;
++      break;
++
++    case STAP_ARG_BITNESS_32BIT_UNSIGNED:
++      value->type = builtin_type (gdbarch)->builtin_uint32;
++      break;
++
++    case STAP_ARG_BITNESS_64BIT_SIGNED:
++      value->type = builtin_type (gdbarch)->builtin_int64;
++      break;
++
++    case STAP_ARG_BITNESS_64BIT_UNSIGNED:
++      value->type = builtin_type (gdbarch)->builtin_uint64;
++      break;
++
++    default:
++      internal_error (__FILE__, __LINE__,
++                    _("Undefined bitness for probe."));
++      break;
++    }
++
++  stap_evaluate_probe_argument_2 (&eval_info,
++                                /*lhs=*/NULL, /*prec=*/0);
++}
++
++/* See definition in stap-probe.h.  */
++
++void
++stap_compile_to_ax (struct objfile *objfile,
++                  const struct stap_probe *probe,
++                  struct agent_expr *expr,
++                  struct axs_value *value,
++                  int n)
++{
++  if (!probe->parsed_args)
++    stap_parse_probe_arguments ((struct stap_probe *) probe);
++
++  if (!probe->parsed_args->arg
++      || n >= probe->parsed_args->n_args)
++    return;
++
++  stap_compile_to_ax_1 (objfile, probe, expr, value, n);
++}
++
++struct value *
++stap_safe_evaluate_at_pc (struct frame_info *frame, int n)
++{
++  const struct stap_probe *probe;
++  struct objfile *objfile;
++  int n_probes;
++
++  probe = find_probe_by_pc (get_frame_pc (frame), &objfile);
++  if (!probe)
++    return NULL;
++  gdb_assert (objfile->sf && objfile->sf->sym_probe_fns);
++
++  n_probes
++    = objfile->sf->sym_probe_fns->sym_get_probe_argument_count (objfile,
++                                                              probe);
++  if (n >= n_probes)
++    return NULL;
++
++  return objfile->sf->sym_probe_fns->sym_evaluate_probe_argument (objfile,
++                                                                probe,
++                                                                frame,
++                                                                n);
++}
++
++/* This function frees the space allocated to hold information about
++   the probe's parsed arguments.  */
++
++void
++stap_free_parsed_args (struct stap_args_info *parsed_args)
++{
++  int i;
++
++  if (!parsed_args
++      || parsed_args == &dummy_stap_args_info
++      || parsed_args->n_args == 0)
++    return;
++
++  for (i = 0; i < parsed_args->n_args; i++)
++    xfree (parsed_args->arg[i].arg_str);
++
++  xfree (parsed_args->arg);
++  xfree (parsed_args);
++}
++
++/* A utility structure.  A VEC of these is built when handling "info
++   probes".  */
++
++struct stap_probe_and_objfile
++{
++  /* The probe.  */
++  const struct stap_probe *probe;
++  /* The probe's objfile.  */
++  struct objfile *objfile;
++};
++
++typedef struct stap_probe_and_objfile stap_entry;
++DEF_VEC_O (stap_entry);
++
++/* A helper function for collect_probes that compiles a regexp and
++   throws an exception on error.  This installs a cleanup to free the
++   resulting pattern on success.  If RX is NULL, this does nothing.  */
++
++static void
++compile_rx_or_error (regex_t *pattern, const char *rx, const char *message)
++{
++  int code;
++
++  if (!rx)
++    return;
++
++  code = regcomp (pattern, rx, REG_NOSUB);
++  if (code == 0)
++    make_regfree_cleanup (pattern);
++  else
++    {
++      char *err = get_regcomp_error (code, pattern);
++
++      make_cleanup (xfree, err);
++      error (_("%s: %s"), message, err);
++    }
++}
++
++/* Make a vector of probes matching OBJNAME, PROVIDER, and PROBE.
++   Each argument is a regexp, or NULL, which matches anything.  */
++
++static VEC (stap_entry) *
++collect_probes (char *objname, char *provider, char *probe)
++{
++  struct objfile *objfile;
++  VEC (stap_entry) *result = NULL;
++  struct cleanup *cleanup;
++  regex_t obj_pat, prov_pat, probe_pat;
++
++  cleanup = make_cleanup (VEC_cleanup (stap_entry), &result);
++
++  compile_rx_or_error (&prov_pat, provider, _("Invalid provider regexp"));
++  compile_rx_or_error (&probe_pat, probe, _("Invalid probe regexp"));
++  compile_rx_or_error (&obj_pat, objname, _("Invalid object file regexp"));
++
++  ALL_OBJFILES (objfile)
++  {
++    const struct stap_probe *probes;
++    int i, num_probes;
++
++    if (! objfile->sf || ! objfile->sf->sym_probe_fns)
++      continue;
++
++    if (objname)
++      {
++      if (regexec (&obj_pat, objfile->name, 0, NULL, 0) != 0)
++        continue;
++      }
++
++    probes = objfile->sf->sym_probe_fns->sym_get_probes (objfile, &num_probes);
++    for (i = 0; i < num_probes; ++i)
++      {
++      stap_entry entry;
++
++      if (provider)
++        {
++          if (regexec (&prov_pat, probes[i].provider, 0, NULL, 0) != 0)
++            continue;
++        }
++
++      if (probe)
++        {
++          if (regexec (&probe_pat, probes[i].name, 0, NULL, 0) != 0)
++            continue;
++        }
++
++      entry.probe = &probes[i];
++      entry.objfile = objfile;
++      VEC_safe_push (stap_entry, result, &entry);
++      }
++  }
++
++  discard_cleanups (cleanup);
++  return result;
++}
++
++/* A qsort comparison function for stap_entry objects.  */
++
++static int
++compare_entries (const void *a, const void *b)
++{
++  const stap_entry *ea = a;
++  const stap_entry *eb = b;
++  int v;
++
++  v = strcmp (ea->probe->provider, eb->probe->provider);
++  if (v)
++    return v;
++
++  v = strcmp (ea->probe->name, eb->probe->name);
++  if (v)
++    return v;
++
++  if (ea->probe->address < eb->probe->address)
++    return -1;
++  if (ea->probe->address > eb->probe->address)
++    return 1;
++
++  return strcmp (ea->objfile->name, eb->objfile->name);
++}
++
++/* Implementation of the "info probes" command.  */
++
++static void
++info_probes_command (char *arg, int from_tty)
++{
++  char *provider, *probe = NULL, *objname = NULL;
++  struct cleanup *cleanup = make_cleanup (null_cleanup, NULL);
++  VEC (stap_entry) *items;
++  int i, addr_width, any_found;
++  stap_entry *entry;
++
++  provider = extract_arg (&arg);
++  if (provider)
++    {
++      make_cleanup (xfree, provider);
++
++      probe = extract_arg (&arg);
++      if (probe)
++      {
++        make_cleanup (xfree, probe);
++
++        objname = extract_arg (&arg);
++        if (objname)
++          make_cleanup (xfree, objname);
++      }
++    }
++
++  items = collect_probes (objname, provider, probe);
++  make_cleanup (VEC_cleanup (stap_entry), &items);
++  make_cleanup_ui_out_table_begin_end (uiout, 5,
++                                     VEC_length (stap_entry, items),
++                                     "SystemTapProbes");
++
++  if (! VEC_empty (stap_entry, items))
++    qsort (VEC_address (stap_entry, items),
++         VEC_length (stap_entry, items),
++         sizeof (stap_entry),
++         compare_entries);
++
++  addr_width = 4 + (gdbarch_ptr_bit (get_current_arch ()) / 4);
++
++  ui_out_table_header (uiout, 10, ui_left, "provider", _("Provider"));
++  ui_out_table_header (uiout, 10, ui_left, "name", _("Name"));
++  ui_out_table_header (uiout, addr_width - 1, ui_left, "addr", _("Where"));
++  ui_out_table_header (uiout, addr_width - 1, ui_left, "semaphore",
++                     _("Semaphore"));
++  ui_out_table_header (uiout, 30, ui_left, "object", _("Object"));
++  ui_out_table_body (uiout);
++
++  for (i = 0; VEC_iterate (stap_entry, items, i, entry); ++i)
++    {
++      struct cleanup *inner;
++
++      inner = make_cleanup_ui_out_tuple_begin_end (uiout, "probe");
++
++      ui_out_field_string (uiout, "provider", entry->probe->provider);
++      ui_out_field_string (uiout, "name", entry->probe->name);
++      ui_out_field_core_addr (uiout, "addr", get_current_arch (),
++                            entry->probe->address);
++      if (entry->probe->sem_addr == 0)
++      ui_out_field_skip (uiout, "semaphore");
++      else
++      ui_out_field_core_addr (uiout, "semaphore", get_current_arch (),
++                            entry->probe->sem_addr);
++      ui_out_field_string (uiout, "object", entry->objfile->name);
++      ui_out_text (uiout, "\n");
++
++      do_cleanups (inner);
++    }
++
++  any_found = ! VEC_empty (stap_entry, items);
++  do_cleanups (cleanup);
++
++  if (! any_found)
++    ui_out_message (uiout, 0, _("No probes matched.\n"));
++}
++
++\f
++
++/* See definition in stap-probe.h.  */
++
++VEC (stap_probe_p) *
++find_probes_in_objfile (struct objfile *objfile,
++                      const char *provider,
++                      const char *name)
++{
++  const struct stap_probe *probes;
++  int i, num_probes;
++  VEC (stap_probe_p) *result = NULL;
++
++  if (! objfile->sf || ! objfile->sf->sym_probe_fns)
++    return NULL;
++
++  probes = objfile->sf->sym_probe_fns->sym_get_probes (objfile, &num_probes);
++  for (i = 0; i < num_probes; ++i)
++    {
++      if (strcmp (probes[i].provider, provider) != 0)
++      continue;
++
++      if (strcmp (probes[i].name, name) != 0)
++      continue;
++
++      VEC_safe_push (stap_probe_p, result, &probes[i]);
++    }
++
++  return result;
++}
++
++/* See definition in stap-probe.h.  */
++
++struct symtabs_and_lines
++parse_stap_probe (char **argptr, struct linespec_result *canonical)
++{
++  char *full_arg = extract_arg (argptr);
++  char *arg = xstrdup (full_arg);
++  char *objfile_name = NULL, *provider = NULL, *name, *p;
++  struct cleanup *cleanup;
++  struct symtabs_and_lines result;
++  struct objfile *objfile;
++
++  result.sals = NULL;
++  result.nelts = 0;
++
++  /* The caller ensured that this starts with 'probe:'.  */
++  gdb_assert (arg && strncmp (arg, "probe:", 6) == 0);
++  cleanup = make_cleanup (xfree, arg);
++  make_cleanup (xfree, full_arg);
++  arg += 6;
++
++  /* Extract each word from the argument, separated by ":"s.  */
++  p = strchr (arg, ':');
++  if (p == NULL)
++    {
++      /* This is `probe:name'.  */
++      name = arg;
++    }
++  else
++    {
++      char *hold = p + 1;
++
++      *p = '\0';
++      p = strchr (hold, ':');
++      if (p == NULL)
++      {
++        /* This is `probe:provider:name'.  */
++        provider = arg;
++        name = hold;
++      }
++      else
++      {
++        /* This is `probe:objfile:provider:name'.  */
++        *p = '\0';
++        objfile_name = arg;
++        provider = hold;
++        name = p + 1;
++      }
++    }
++
++  if (*name == '\0')
++    error (_("no probe name specified"));
++  if (provider && *provider == '\0')
++    error (_("invalid provider name"));
++  if (objfile_name && *objfile_name == '\0')
++    error (_("invalid objfile name"));
++
++  if (canonical)
++    canonical->canonical = NULL;
++
++  ALL_OBJFILES (objfile)
++  {
++    const struct stap_probe *probes;
++    int i, num_probes;
++
++    if (! objfile->sf || ! objfile->sf->sym_probe_fns)
++      continue;
++
++    if (objfile_name
++      && FILENAME_CMP (objfile->name, objfile_name) != 0
++      && FILENAME_CMP (lbasename (objfile->name), objfile_name) != 0)
++      continue;
++
++    probes = objfile->sf->sym_probe_fns->sym_get_probes (objfile, &num_probes);
++    for (i = 0; i < num_probes; ++i)
++      {
++      struct symtab_and_line *sal;
++
++      if (provider && strcmp (probes[i].provider, provider) != 0)
++        continue;
++
++      if (strcmp (probes[i].name, name) != 0)
++        continue;
++
++      ++result.nelts;
++      result.sals = xrealloc (result.sals,
++                              result.nelts * sizeof (struct symtab_and_line));
++      sal = &result.sals[result.nelts - 1];
++
++      init_sal (sal);
++
++      sal->pc = probes[i].address;
++      sal->explicit_pc = 1;
++      sal->section = find_pc_overlay (sal->pc);
++      sal->pspace = current_program_space;
++      sal->semaphore = probes[i].sem_addr;
++
++      if (canonical)
++        {
++          canonical->canonical = xrealloc (canonical->canonical,
++                                           result.nelts * sizeof (char *));
++          canonical->canonical[result.nelts - 1] = xstrdup (full_arg);
++        }
++      }
++  }
++
++  if (result.nelts == 0)
++    {
++      throw_error (NOT_FOUND_ERROR,
++                 _("No probe matching objfile=`%s', provider=`%s', name=`%s'"),
++                 objfile_name ? objfile_name : _("<any>"),
++                 provider ? provider : _("<any>"),
++                 name);
++    }
++
++  if (canonical)
++    {
++      canonical->special_display = 1;
++      canonical->pre_expanded = 1;
++    }
++
++  do_cleanups (cleanup);
++
++  return result;
++}
++
++\f
++
++/* See definition in stap-probe.h.  */
++
++const struct stap_probe *
++find_probe_by_pc (CORE_ADDR pc, struct objfile **objfile_out)
++{
++  struct objfile *objfile;
++
++  ALL_OBJFILES (objfile)
++  {
++    const struct stap_probe *probes;
++    int i, num_probes;
++    stap_entry entry;
++
++    if (! objfile->sf || ! objfile->sf->sym_probe_fns)
++      continue;
++
++    /* If this proves too inefficient, we can replace with a hash.  */
++    probes = objfile->sf->sym_probe_fns->sym_get_probes (objfile, &num_probes);
++    for (i = 0; i < num_probes; ++i)
++      {
++      if (probes[i].address == pc)
++        {
++          *objfile_out = objfile;
++          return &probes[i];
++        }
++      }
++  }
++
++  return NULL;
++}
++
++/* This is called to compute the value of one of the $_probe_arg*
++   convenience variables.  */
++
++static struct value *
++compute_probe_arg (struct gdbarch *arch, struct internalvar *ivar,
++                 void *data)
++{
++  struct frame_info *frame = get_selected_frame (_("No frame selected"));
++  CORE_ADDR pc = get_frame_pc (frame);
++  int sel = (int) (uintptr_t) data;
++  struct objfile *objfile;
++  const struct stap_probe *pc_probe;
++  int n_probes;
++
++  /* SEL==10 means "_probe_argc".  */
++  gdb_assert (sel >= 0 && sel <= STAP_MAX_ARGS);
++
++  pc_probe = find_probe_by_pc (pc, &objfile);
++  if (pc_probe == NULL)
++    error (_("No SystemTap probe at PC %s"), core_addr_to_string (pc));
++
++  n_probes
++    = objfile->sf->sym_probe_fns->sym_get_probe_argument_count (objfile,
++                                                              pc_probe);
++  if (sel == 10)
++    return value_from_longest (builtin_type (arch)->builtin_int, n_probes);
++
++  if (sel >= n_probes)
++    error (_("Invalid probe argument %d -- probe has %d arguments available"),
++         sel, n_probes);
++
++  return objfile->sf->sym_probe_fns->sym_evaluate_probe_argument (objfile,
++                                                                pc_probe,
++                                                                frame, sel);
++}
++
++/* This is called to compile one of the $_probe_arg* convenience
++   variables into an agent expression.  */
++
++static void
++compile_probe_arg (struct internalvar *ivar, struct agent_expr *expr,
++                 struct axs_value *value, void *data)
++{
++  CORE_ADDR pc = expr->scope;
++  int sel = (int) (uintptr_t) data;
++  struct objfile *objfile;
++  const struct stap_probe *pc_probe;
++  int n_probes;
++
++  /* SEL==10 means "_probe_argc".  */
++  gdb_assert (sel >= 0 && sel <= 10);
++
++  pc_probe = find_probe_by_pc (pc, &objfile);
++  if (pc_probe == NULL)
++    error (_("No SystemTap probe at PC %s"), core_addr_to_string (pc));
++
++  n_probes
++    = objfile->sf->sym_probe_fns->sym_get_probe_argument_count (objfile,
++                                                              pc_probe);
++  if (sel == 10)
++    {
++      value->kind = axs_rvalue;
++      value->type = builtin_type (expr->gdbarch)->builtin_int;
++      ax_const_l (expr, n_probes);
++      return;
++    }
++
++  gdb_assert (sel >= 0);
++  if (sel >= n_probes)
++    error (_("Invalid probe argument %d -- probe has %d arguments available"),
++         sel, n_probes);
++
++  objfile->sf->sym_probe_fns->sym_compile_to_ax (objfile, pc_probe,
++                                               expr, value, sel);
++}
++
++\f
++
++/* Implementation of `$_probe_arg*' set of variables.  */
++
++static const struct internalvar_funcs probe_funcs =
++{
++  compute_probe_arg,
++  compile_probe_arg,
++  NULL
++};
++
++void
++_initialize_stap_probe (void)
++{
++  add_info ("probes", info_probes_command, _("\
++Show available static probes.\n\
++Usage: info probes [PROVIDER [NAME [OBJECT]]]\n\
++Each argument is a regular expression, used to select probes.\n\
++PROVIDER matches probe provider names.\n\
++NAME matches the probe names.\n\
++OBJECT match the executable or shared library name."));
++
++  create_internalvar_type_lazy ("_probe_argc", &probe_funcs,
++                              (void *) (uintptr_t) 10);
++  create_internalvar_type_lazy ("_probe_arg0", &probe_funcs,
++                              (void *) (uintptr_t) 0);
++  create_internalvar_type_lazy ("_probe_arg1", &probe_funcs,
++                              (void *) (uintptr_t) 1);
++  create_internalvar_type_lazy ("_probe_arg2", &probe_funcs,
++                              (void *) (uintptr_t) 2);
++  create_internalvar_type_lazy ("_probe_arg3", &probe_funcs,
++                              (void *) (uintptr_t) 3);
++  create_internalvar_type_lazy ("_probe_arg4", &probe_funcs,
++                              (void *) (uintptr_t) 4);
++  create_internalvar_type_lazy ("_probe_arg5", &probe_funcs,
++                              (void *) (uintptr_t) 5);
++  create_internalvar_type_lazy ("_probe_arg6", &probe_funcs,
++                              (void *) (uintptr_t) 6);
++  create_internalvar_type_lazy ("_probe_arg7", &probe_funcs,
++                              (void *) (uintptr_t) 7);
++  create_internalvar_type_lazy ("_probe_arg8", &probe_funcs,
++                              (void *) (uintptr_t) 8);
++  create_internalvar_type_lazy ("_probe_arg9", &probe_funcs,
++                              (void *) (uintptr_t) 9);
++}
+Index: gdb-7.3.50.20110722/gdb/stap-probe.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/stap-probe.h       2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,114 @@
++/* SystemTap probe support for GDB.
++
++   Copyright (C) 2011 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#if !defined (STAP_PROBE_H)
++#define STAP_PROBE_H 1
++
++#include "vec.h"
++
++struct stap_args_info;
++struct axs_value;
++struct linespec_result;
++
++/* Main structure which holds information about a SystemTap probe.  */
++
++struct stap_probe
++{
++  /* The provider of this probe.  */
++  const char *provider;
++
++  /* The name of the probe.  */
++  const char *name;
++
++  /* The address where the probe is inserted.  */
++  CORE_ADDR address;
++
++  /* The address of the probe's semaphore, or 0 if this probe does not
++     have an associated semaphore.  */
++  CORE_ADDR sem_addr;
++
++  /* Probe's arguments.  Users should generally not examine this, but
++     should instead extract information about the arguments using the
++     methods provided in sym_probe_fns.  */
++  const char *args;
++
++  /* Probe's arguments after parsing.  This is an opaque structure that
++     will hold information about the arguments pointed by ARGS.  */
++  struct stap_args_info *parsed_args;
++};
++
++typedef const struct stap_probe *stap_probe_p;
++DEF_VEC_P (stap_probe_p);
++
++/* A helper for linespec that decodes a stap probe specification.  It
++   returns a symtabs_and_lines object and updates *ARGPTR or throws an
++   error.  */
++
++extern struct symtabs_and_lines parse_stap_probe (char **argptr,
++                                                struct linespec_result *canon);
++
++/* Search OBJFILE for a probe with the given PROVIDER and NAME.
++   Return a VEC of all probes that were found.  If no matching probe
++   is found, return NULL.  The caller must free the VEC.  */
++
++extern VEC (stap_probe_p) *find_probes_in_objfile (struct objfile *objfile,
++                                                 const char *provider,
++                                                 const char *name);
++
++/* Given a PC, find an associated SystemTap probe.  If a probe is
++   found, set *OBJFILE_OUT to the probe's objfile, and return the
++   probe.  If no probe is found, return NULL.  */
++
++extern const struct stap_probe *find_probe_by_pc (CORE_ADDR pc,
++                                                struct objfile **objfile_out);
++
++/* Given PROBE, returns the number of arguments present in that probe's
++   argument string.  */
++
++extern int stap_get_probe_argument_count (const struct stap_probe *probe);
++
++/* Given PARSED_ARGS, frees the space allocated to hold information about
++   the probe's parsed arguments.  */
++
++extern void stap_free_parsed_args (struct stap_args_info *parsed_args);
++
++/* Evaluates the probe's argument N, returning a value corresponding
++   to it.  */
++
++extern struct value *stap_evaluate_probe_argument (struct objfile *objfile,
++                                                 const struct stap_probe *probe,
++                                                 struct frame_info *frame,
++                                                 int n);
++
++/* Compile the probe's argument N to agent expression.  */
++
++extern void stap_compile_to_ax (struct objfile *objfile,
++                              const struct stap_probe *probe,
++                              struct agent_expr *expr,
++                              struct axs_value *value,
++                              int n);
++
++/* A convenience function that finds a probe at the PC in FRAME and
++   evaluates argument N.  If there is no probe at that location, or if
++   the probe does not have enough arguments, this returns NULL.  */
++
++extern struct value *stap_safe_evaluate_at_pc (struct frame_info *frame,
++                                             int n);
++
++#endif /* !defined (STAP_PROBE_H) */
+Index: gdb-7.3.50.20110722/gdb/symfile.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/symfile.h     2011-07-29 22:52:00.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/symfile.h  2011-07-29 22:52:02.000000000 +0200
+@@ -31,6 +31,11 @@ struct objfile;
+ struct obj_section;
+ struct obstack;
+ struct block;
++struct stap_probe;
++struct value;
++struct frame_info;
++struct agent_expr;
++struct axs_value;
+ /* Comparison function for symbol look ups.  */
+@@ -294,6 +299,52 @@ struct quick_symbol_functions
+                               symbol_filename_ftype *fun, void *data);
+ };
++/* Structure of functions used for SystemTap probe support.  If one of
++   these functions is provided, all must be.  */
++
++struct sym_probe_fns
++{
++  /* If non-NULL, return an array of SystemTap probe objects.  The
++     number of objects is returned in *NUM_PROBES.  */
++  const struct stap_probe *(*sym_get_probes) (struct objfile *,
++                                            int *num_probes);
++
++  /* Return the number of arguments available to PROBE.  PROBE will
++     have come from a call to this objfile's sym_get_probes method.
++     If you provide an implementation of sym_get_probes, you must
++     implement this method as well.  */
++  int (*sym_get_probe_argument_count) (struct objfile *objfile,
++                                     const struct stap_probe *probe);
++
++  /* Evaluate the Nth argument available to PROBE.  PROBE will have
++     come from a call to this objfile's sym_get_probes method.  N will
++     be between 0 and the number of arguments available to this probe.
++     FRAME is the frame in which the evaluation is done; the frame's
++     PC will match the address of the probe.  If you provide an
++     implementation of sym_get_probes, you must implement this method
++     as well.  */
++  struct value *(*sym_evaluate_probe_argument) (struct objfile *objfile,
++                                              const struct stap_probe *probe,
++                                              struct frame_info *frame,
++                                              int n);
++
++  /* Compile the Nth probe argument to an agent expression.  PROBE
++     will have come from a call to this objfile's sym_get_probes
++     method.  N will be between 0 and the number of arguments
++     available to this probe.  EXPR and VALUE are the agent expression
++     that is being updated.  */
++  void (*sym_compile_to_ax) (struct objfile *objfile,
++                           const struct stap_probe *probe,
++                           struct agent_expr *expr,
++                           struct axs_value *value,
++                           int n);
++
++  /* Relocate the probe section of OBJFILE.  */
++  void (*sym_relocate_probe) (struct objfile *objfile,
++                            struct section_offsets *new_offsets,
++                            struct section_offsets *delta);
++};
++
+ /* Structure to keep track of symbol reading functions for various
+    object file types.  */
+@@ -364,6 +415,10 @@ struct sym_fns
+   bfd_byte *(*sym_relocate) (struct objfile *, asection *sectp, bfd_byte *buf);
++  /* If non-NULL, this objfile has probe support, and all the probe
++     functions referred to here will be non-NULL.  */
++  const struct sym_probe_fns *sym_probe_fns;
++
+   /* The "quick" (aka partial) symbol functions for this symbol
+      reader.  */
+   const struct quick_symbol_functions *qf;
+Index: gdb-7.3.50.20110722/gdb/symtab.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/symtab.c      2011-07-21 17:13:29.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/symtab.c   2011-07-29 22:52:02.000000000 +0200
+@@ -776,6 +776,7 @@ init_sal (struct symtab_and_line *sal)
+   sal->end = 0;
+   sal->explicit_pc = 0;
+   sal->explicit_line = 0;
++  sal->semaphore = 0;
+ }
\f
+Index: gdb-7.3.50.20110722/gdb/symtab.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/symtab.h      2011-06-30 00:19:24.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/symtab.h   2011-07-29 22:52:02.000000000 +0200
+@@ -1115,6 +1115,10 @@ struct symtab_and_line
+   CORE_ADDR end;
+   int explicit_pc;
+   int explicit_line;
++
++  /* If non-zero, the semaphore location associated with a SystemTap
++     probe.  */
++  CORE_ADDR semaphore;
+ };
+ extern void init_sal (struct symtab_and_line *sal);
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S        2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,457 @@
++      .file   "x86_64-vla-pointer.c"
++      .section        .debug_abbrev,"",@progbits
++.Ldebug_abbrev0:
++      .section        .debug_info,"",@progbits
++.Ldebug_info0:
++      .section        .debug_line,"",@progbits
++.Ldebug_line0:
++      .text
++.Ltext0:
++.globl foo
++      .type   foo, @function
++foo:
++.LFB2:
++      .file 1 "x86_64-vla-pointer.c"
++      .loc 1 22 0
++      pushq   %rbp
++.LCFI0:
++      movq    %rsp, %rbp
++.LCFI1:
++      subq    $64, %rsp
++.LCFI2:
++      movl    %edi, -36(%rbp)
++      .loc 1 22 0
++      movq    %rsp, %rax
++      movq    %rax, -48(%rbp)
++      .loc 1 23 0
++      movl    -36(%rbp), %edx
++      movslq  %edx,%rax
++      subq    $1, %rax
++      movq    %rax, -24(%rbp)
++      .loc 1 24 0
++      movslq  %edx,%rax
++      addq    $15, %rax
++      addq    $15, %rax
++      shrq    $4, %rax
++      salq    $4, %rax
++      subq    %rax, %rsp
++      movq    %rsp, -56(%rbp)
++      movq    -56(%rbp), %rax
++      addq    $15, %rax
++      shrq    $4, %rax
++      salq    $4, %rax
++      movq    %rax, -56(%rbp)
++      movq    -56(%rbp), %rax
++      movq    %rax, -16(%rbp)
++      .loc 1 27 0
++      movl    $0, -4(%rbp)
++      jmp     .L2
++.L3:
++      .loc 1 28 0
++      movl    -4(%rbp), %esi
++      movl    -4(%rbp), %eax
++      movl    %eax, %ecx
++      movq    -16(%rbp), %rdx
++      movslq  %esi,%rax
++      movb    %cl, (%rdx,%rax)
++      .loc 1 27 0
++      addl    $1, -4(%rbp)
++.L2:
++      movl    -4(%rbp), %eax
++      cmpl    -36(%rbp), %eax
++      jl      .L3
++      .loc 1 30 0
++      .globl  break_here
++break_here:
++      movq    -16(%rbp), %rax
++      movb    $0, (%rax)
++      movq    -48(%rbp), %rsp
++      .loc 1 31 0
++      leave
++      ret
++.LFE2:
++      .size   foo, .-foo
++      .section        .debug_frame,"",@progbits
++.Lframe0:
++      .long   .LECIE0-.LSCIE0
++.LSCIE0:
++      .long   0xffffffff
++      .byte   0x1
++      .string ""
++      .uleb128 0x1
++      .sleb128 -8
++      .byte   0x10
++      .byte   0xc
++      .uleb128 0x7
++      .uleb128 0x8
++      .byte   0x90
++      .uleb128 0x1
++      .align 8
++.LECIE0:
++.LSFDE0:
++      .long   .LEFDE0-.LASFDE0
++.LASFDE0:
++      .long   .Lframe0
++      .quad   .LFB2
++      .quad   .LFE2-.LFB2
++      .byte   0x4
++      .long   .LCFI0-.LFB2
++      .byte   0xe
++      .uleb128 0x10
++      .byte   0x86
++      .uleb128 0x2
++      .byte   0x4
++      .long   .LCFI1-.LCFI0
++      .byte   0xd
++      .uleb128 0x6
++      .align 8
++.LEFDE0:
++      .section        .eh_frame,"a",@progbits
++.Lframe1:
++      .long   .LECIE1-.LSCIE1
++.LSCIE1:
++      .long   0x0
++      .byte   0x1
++      .string "zR"
++      .uleb128 0x1
++      .sleb128 -8
++      .byte   0x10
++      .uleb128 0x1
++      .byte   0x3
++      .byte   0xc
++      .uleb128 0x7
++      .uleb128 0x8
++      .byte   0x90
++      .uleb128 0x1
++      .align 8
++.LECIE1:
++.LSFDE1:
++      .long   .LEFDE1-.LASFDE1
++.LASFDE1:
++      .long   .LASFDE1-.Lframe1
++      .long   .LFB2
++      .long   .LFE2-.LFB2
++      .uleb128 0x0
++      .byte   0x4
++      .long   .LCFI0-.LFB2
++      .byte   0xe
++      .uleb128 0x10
++      .byte   0x86
++      .uleb128 0x2
++      .byte   0x4
++      .long   .LCFI1-.LCFI0
++      .byte   0xd
++      .uleb128 0x6
++      .align 8
++.LEFDE1:
++      .text
++.Letext0:
++      .section        .debug_loc,"",@progbits
++.Ldebug_loc0:
++.LLST0:
++      .quad   .LFB2-.Ltext0
++      .quad   .LCFI0-.Ltext0
++      .value  0x2
++      .byte   0x77
++      .sleb128 8
++      .quad   .LCFI0-.Ltext0
++      .quad   .LCFI1-.Ltext0
++      .value  0x2
++      .byte   0x77
++      .sleb128 16
++      .quad   .LCFI1-.Ltext0
++      .quad   .LFE2-.Ltext0
++      .value  0x2
++      .byte   0x76
++      .sleb128 16
++      .quad   0x0
++      .quad   0x0
++      .section        .debug_info
++.Ldebug_relative:
++      .long   .Ldebug_end - .Ldebug_start
++.Ldebug_start:
++      .value  0x2
++      .long   .Ldebug_abbrev0
++      .byte   0x8
++      .uleb128 0x1
++      .long   .LASF2
++      .byte   0x1
++      .long   .LASF3
++      .long   .LASF4
++      .quad   .Ltext0
++      .quad   .Letext0
++      .long   .Ldebug_line0
++      .uleb128 0x2
++      .byte   0x1
++      .string "foo"
++      .byte   0x1
++      .byte   0x16
++      .byte   0x1
++      .quad   .LFB2
++      .quad   .LFE2
++      .long   .LLST0
++      .long   .Ltype_int - .Ldebug_relative
++      .uleb128 0x3
++      .long   .LASF5
++      .byte   0x1
++      .byte   0x15
++      .long   .Ltype_int - .Ldebug_relative
++      .byte   0x2
++      .byte   0x91
++      .sleb128 -52
++.Ltag_pointer:
++      .uleb128 0x4
++      .byte   0x8     /* DW_AT_byte_size */
++      .long   .Ltag_array_type - .debug_info  /* DW_AT_type */
++      .uleb128 0x5    /* Abbrev Number: 5 (DW_TAG_variable) */
++      .long   .LASF0
++      .byte   0x1
++      .byte   0x18
++#if 1
++      .long   .Ltag_pointer - .debug_info
++#else
++      /* Debugging only: Skip the typedef indirection.  */
++      .long   .Ltag_array_type - .debug_info
++#endif
++      /* DW_AT_location: DW_FORM_block1: start */
++      .byte   0x3
++      .byte   0x91
++      .sleb128 -32
++#if 0
++      .byte   0x6     /* DW_OP_deref */
++#else
++      .byte   0x96    /* DW_OP_nop */
++#endif
++      /* DW_AT_location: DW_FORM_block1: end */
++      .uleb128 0x6
++      .string "i"
++      .byte   0x1
++      .byte   0x19
++      .long   .Ltype_int - .Ldebug_relative
++      .byte   0x2
++      .byte   0x91
++      .sleb128 -20
++      .byte   0x0
++.Ltype_int:
++      .uleb128 0x7
++      .byte   0x4
++      .byte   0x5
++      .string "int"
++.Ltag_array_type:
++      .uleb128 0x8    /* Abbrev Number: 8 (DW_TAG_array_type) */
++      .long   .Ltype_char - .Ldebug_relative
++      .long   .Ltype_ulong - .Ldebug_relative /* DW_AT_sibling: DW_FORM_ref4 */
++1:    /* DW_AT_data_location: DW_FORM_block1: start */
++      .byte   2f - 3f /* length */
++3:
++      .byte   0x97    /* DW_OP_push_object_address */
++#if 1
++      .byte   0x6     /* DW_OP_deref */
++#else
++      .byte   0x96    /* DW_OP_nop */
++#endif
++2:    /* DW_AT_data_location: DW_FORM_block1: end */
++      .uleb128 0x9
++      .long   .Ltype_char - .Ldebug_relative  /* DW_AT_type: DW_FORM_ref4 */
++      .byte   0x3
++      .byte   0x91
++      .sleb128 -40
++      .byte   0x6
++      .byte   0x0
++.Ltype_ulong:
++      .uleb128 0xa
++      .byte   0x8
++      .byte   0x7
++.Ltype_char:
++      .uleb128 0xb
++      .byte   0x1
++      .byte   0x6
++      .long   .LASF1
++      .byte   0x0
++.Ldebug_end:
++      .section        .debug_abbrev
++      .uleb128 0x1
++      .uleb128 0x11
++      .byte   0x1
++      .uleb128 0x25
++      .uleb128 0xe
++      .uleb128 0x13
++      .uleb128 0xb
++      .uleb128 0x3
++      .uleb128 0xe
++      .uleb128 0x1b
++      .uleb128 0xe
++      .uleb128 0x11
++      .uleb128 0x1
++      .uleb128 0x12
++      .uleb128 0x1
++      .uleb128 0x10
++      .uleb128 0x6
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x2
++      .uleb128 0x2e
++      .byte   0x1
++      .uleb128 0x3f
++      .uleb128 0xc
++      .uleb128 0x3
++      .uleb128 0x8
++      .uleb128 0x3a
++      .uleb128 0xb
++      .uleb128 0x3b
++      .uleb128 0xb
++      .uleb128 0x27
++      .uleb128 0xc
++      .uleb128 0x11
++      .uleb128 0x1
++      .uleb128 0x12
++      .uleb128 0x1
++      .uleb128 0x40
++      .uleb128 0x6
++      .uleb128 0x1
++      .uleb128 0x13
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x3
++      .uleb128 0x5
++      .byte   0x0
++      .uleb128 0x3
++      .uleb128 0xe
++      .uleb128 0x3a
++      .uleb128 0xb
++      .uleb128 0x3b
++      .uleb128 0xb
++      .uleb128 0x49
++      .uleb128 0x13
++      .uleb128 0x2
++      .uleb128 0xa
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x4    /* .Ltag_pointer abbrev */
++      .uleb128 0x0f   /* DW_TAG_pointer_type */
++      .byte   0x0
++      .uleb128 0x0b
++      .uleb128 0xb
++      .uleb128 0x49
++      .uleb128 0x13
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x5
++      .uleb128 0x34
++      .byte   0x0
++      .uleb128 0x3
++      .uleb128 0xe
++      .uleb128 0x3a
++      .uleb128 0xb
++      .uleb128 0x3b
++      .uleb128 0xb
++      .uleb128 0x49
++      .uleb128 0x13
++      .uleb128 0x2
++      .uleb128 0xa
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x6
++      .uleb128 0x34
++      .byte   0x0
++      .uleb128 0x3
++      .uleb128 0x8
++      .uleb128 0x3a
++      .uleb128 0xb
++      .uleb128 0x3b
++      .uleb128 0xb
++      .uleb128 0x49
++      .uleb128 0x13
++      .uleb128 0x2
++      .uleb128 0xa
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x7
++      .uleb128 0x24
++      .byte   0x0
++      .uleb128 0xb
++      .uleb128 0xb
++      .uleb128 0x3e
++      .uleb128 0xb
++      .uleb128 0x3
++      .uleb128 0x8
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x8    /* Abbrev Number: 8 (DW_TAG_array_type) */
++      .uleb128 0x1
++      .byte   0x1
++      .uleb128 0x49   /* DW_AT_type */
++      .uleb128 0x13   /* DW_FORM_ref4 */
++      .uleb128 0x1    /* DW_AT_sibling */
++      .uleb128 0x13   /* DW_FORM_ref4 */
++      .uleb128 0x50   /* DW_AT_data_location */
++      .uleb128 0xa    /* DW_FORM_block1 */
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x9
++      .uleb128 0x21
++      .byte   0x0
++      .uleb128 0x49   /* DW_AT_type */
++      .uleb128 0x13   /* DW_FORM_ref4 */
++      .uleb128 0x2f
++      .uleb128 0xa
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0xa
++      .uleb128 0x24
++      .byte   0x0
++      .uleb128 0xb
++      .uleb128 0xb
++      .uleb128 0x3e
++      .uleb128 0xb
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0xb
++      .uleb128 0x24
++      .byte   0x0
++      .uleb128 0xb
++      .uleb128 0xb
++      .uleb128 0x3e
++      .uleb128 0xb
++      .uleb128 0x3
++      .uleb128 0xe
++      .byte   0x0
++      .byte   0x0
++      .byte   0x0
++      .section        .debug_pubnames,"",@progbits
++      .long   0x16
++      .value  0x2
++      .long   .Ldebug_info0
++      .long   0xa8
++      .long   0x2d
++      .string "foo"
++      .long   0x0
++      .section        .debug_aranges,"",@progbits
++      .long   0x2c
++      .value  0x2
++      .long   .Ldebug_info0
++      .byte   0x8
++      .byte   0x0
++      .value  0x0
++      .value  0x0
++      .quad   .Ltext0
++      .quad   .Letext0-.Ltext0
++      .quad   0x0
++      .quad   0x0
++      .section        .debug_str,"MS",@progbits,1
++.LASF0:
++      .string "array"
++.LASF5:
++      .string "size"
++.LASF3:
++      .string "x86_64-vla-pointer.c"
++.LASF6:
++      .string "array_t"
++.LASF1:
++      .string "char"
++.LASF4:
++      .string "gdb.arch"
++.LASF2:
++      .string "GNU C 4.3.2 20081105 (Red Hat 4.3.2-7)"
++      .ident  "GCC: (GNU) 4.3.2 20081105 (Red Hat 4.3.2-7)"
++      .section        .note.GNU-stack,"",@progbits
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c    2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,43 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2009 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#if 0
++
++void
++foo (int size)
++{
++  typedef char array_t[size];
++  array_t array;
++  int i;
++
++  for (i = 0; i < size; i++)
++    array[i] = i;
++
++  array[0] = 0;       /* break-here */
++}
++
++#else
++
++int
++main (void)
++{
++  foo (26);
++  foo (78);
++  return 0;
++}
++
++#endif
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp  2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,66 @@
++# Copyright 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++if ![istarget "x86_64-*-*"] then {
++    verbose "Skipping over gdb.arch/x86_64-vla-pointer.exp test made only for x86_64."
++    return
++}
++
++set testfile x86_64-vla-pointer
++set srcasmfile ${testfile}-foo.S
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++set binobjfile ${objdir}/${subdir}/${testfile}-foo.o
++if  { [gdb_compile "${srcdir}/${subdir}/${srcasmfile}" "${binobjfile}" object {}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${binobjfile}" "${binfile}" executable {debug}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++if ![runto_main] {
++    untested x86_64-vla-pointer
++    return -1
++}
++
++gdb_breakpoint "break_here"
++
++gdb_continue_to_breakpoint "break_here"
++
++gdb_test "whatis array" "type = char \\(\\*\\)\\\[variable\\\]" "first: whatis array"
++gdb_test "ptype array" "type = char \\(\\*\\)\\\[26\\\]" "first: ptype array"
++
++gdb_test "whatis *array" "type = char \\\[26\\\]" "first: whatis *array"
++gdb_test "ptype *array" "type = char \\\[26\\\]" "first: ptype *array"
++
++gdb_test "p (*array)\[1\]" "\\$\[0-9\] = 1 '\\\\001'"
++gdb_test "p (*array)\[2\]" "\\$\[0-9\] = 2 '\\\\002'"
++gdb_test "p (*array)\[3\]" "\\$\[0-9\] = 3 '\\\\003'"
++gdb_test "p (*array)\[4\]" "\\$\[0-9\] = 4 '\\\\004'"
++
++gdb_continue_to_breakpoint "break_here"
++
++gdb_test "whatis array" "type = char \\(\\*\\)\\\[variable\\\]" "second: whatis array"
++gdb_test "ptype array" "type = char \\(\\*\\)\\\[78\\\]" "second: ptype array"
++
++gdb_test "whatis *array" "type = char \\\[78\\\]" "second: whatis *array"
++gdb_test "ptype *array" "type = char \\\[78\\\]" "second: ptype *array"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S        2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,455 @@
++      .file   "x86_64-vla-typedef.c"
++      .section        .debug_abbrev,"",@progbits
++.Ldebug_abbrev0:
++      .section        .debug_info,"",@progbits
++.Ldebug_info0:
++      .section        .debug_line,"",@progbits
++.Ldebug_line0:
++      .text
++.Ltext0:
++.globl foo
++      .type   foo, @function
++foo:
++.LFB2:
++      .file 1 "x86_64-vla-typedef.c"
++      .loc 1 22 0
++      pushq   %rbp
++.LCFI0:
++      movq    %rsp, %rbp
++.LCFI1:
++      subq    $64, %rsp
++.LCFI2:
++      movl    %edi, -36(%rbp)
++      .loc 1 22 0
++      movq    %rsp, %rax
++      movq    %rax, -48(%rbp)
++      .loc 1 23 0
++      movl    -36(%rbp), %edx
++      movslq  %edx,%rax
++      subq    $1, %rax
++      movq    %rax, -24(%rbp)
++      .loc 1 24 0
++      movslq  %edx,%rax
++      addq    $15, %rax
++      addq    $15, %rax
++      shrq    $4, %rax
++      salq    $4, %rax
++      subq    %rax, %rsp
++      movq    %rsp, -56(%rbp)
++      movq    -56(%rbp), %rax
++      addq    $15, %rax
++      shrq    $4, %rax
++      salq    $4, %rax
++      movq    %rax, -56(%rbp)
++      movq    -56(%rbp), %rax
++      movq    %rax, -16(%rbp)
++      .loc 1 27 0
++      movl    $0, -4(%rbp)
++      jmp     .L2
++.L3:
++      .loc 1 28 0
++      movl    -4(%rbp), %esi
++      movl    -4(%rbp), %eax
++      movl    %eax, %ecx
++      movq    -16(%rbp), %rdx
++      movslq  %esi,%rax
++      movb    %cl, (%rdx,%rax)
++      .loc 1 27 0
++      addl    $1, -4(%rbp)
++.L2:
++      movl    -4(%rbp), %eax
++      cmpl    -36(%rbp), %eax
++      jl      .L3
++      .loc 1 30 0
++      .globl  break_here
++break_here:
++      movq    -16(%rbp), %rax
++      movb    $0, (%rax)
++      movq    -48(%rbp), %rsp
++      .loc 1 31 0
++      leave
++      ret
++.LFE2:
++      .size   foo, .-foo
++      .section        .debug_frame,"",@progbits
++.Lframe0:
++      .long   .LECIE0-.LSCIE0
++.LSCIE0:
++      .long   0xffffffff
++      .byte   0x1
++      .string ""
++      .uleb128 0x1
++      .sleb128 -8
++      .byte   0x10
++      .byte   0xc
++      .uleb128 0x7
++      .uleb128 0x8
++      .byte   0x90
++      .uleb128 0x1
++      .align 8
++.LECIE0:
++.LSFDE0:
++      .long   .LEFDE0-.LASFDE0
++.LASFDE0:
++      .long   .Lframe0
++      .quad   .LFB2
++      .quad   .LFE2-.LFB2
++      .byte   0x4
++      .long   .LCFI0-.LFB2
++      .byte   0xe
++      .uleb128 0x10
++      .byte   0x86
++      .uleb128 0x2
++      .byte   0x4
++      .long   .LCFI1-.LCFI0
++      .byte   0xd
++      .uleb128 0x6
++      .align 8
++.LEFDE0:
++      .section        .eh_frame,"a",@progbits
++.Lframe1:
++      .long   .LECIE1-.LSCIE1
++.LSCIE1:
++      .long   0x0
++      .byte   0x1
++      .string "zR"
++      .uleb128 0x1
++      .sleb128 -8
++      .byte   0x10
++      .uleb128 0x1
++      .byte   0x3
++      .byte   0xc
++      .uleb128 0x7
++      .uleb128 0x8
++      .byte   0x90
++      .uleb128 0x1
++      .align 8
++.LECIE1:
++.LSFDE1:
++      .long   .LEFDE1-.LASFDE1
++.LASFDE1:
++      .long   .LASFDE1-.Lframe1
++      .long   .LFB2
++      .long   .LFE2-.LFB2
++      .uleb128 0x0
++      .byte   0x4
++      .long   .LCFI0-.LFB2
++      .byte   0xe
++      .uleb128 0x10
++      .byte   0x86
++      .uleb128 0x2
++      .byte   0x4
++      .long   .LCFI1-.LCFI0
++      .byte   0xd
++      .uleb128 0x6
++      .align 8
++.LEFDE1:
++      .text
++.Letext0:
++      .section        .debug_loc,"",@progbits
++.Ldebug_loc0:
++.LLST0:
++      .quad   .LFB2-.Ltext0
++      .quad   .LCFI0-.Ltext0
++      .value  0x2
++      .byte   0x77
++      .sleb128 8
++      .quad   .LCFI0-.Ltext0
++      .quad   .LCFI1-.Ltext0
++      .value  0x2
++      .byte   0x77
++      .sleb128 16
++      .quad   .LCFI1-.Ltext0
++      .quad   .LFE2-.Ltext0
++      .value  0x2
++      .byte   0x76
++      .sleb128 16
++      .quad   0x0
++      .quad   0x0
++      .section        .debug_info
++      .long   .Ldebug_end - .Ldebug_start
++.Ldebug_start:
++      .value  0x2
++      .long   .Ldebug_abbrev0
++      .byte   0x8
++      .uleb128 0x1
++      .long   .LASF2
++      .byte   0x1
++      .long   .LASF3
++      .long   .LASF4
++      .quad   .Ltext0
++      .quad   .Letext0
++      .long   .Ldebug_line0
++      .uleb128 0x2
++      .byte   0x1
++      .string "foo"
++      .byte   0x1
++      .byte   0x16
++      .byte   0x1
++      .quad   .LFB2
++      .quad   .LFE2
++      .long   .LLST0
++      .long   0x83
++      .uleb128 0x3
++      .long   .LASF5
++      .byte   0x1
++      .byte   0x15
++      .long   0x83
++      .byte   0x2
++      .byte   0x91
++      .sleb128 -52
++.Ltag_typedef:
++      .uleb128 0x4
++      .long   .LASF6
++      .byte   0x1
++      .byte   0x17
++      .long   .Ltag_array_type - .debug_info
++      .uleb128 0x5    /* Abbrev Number: 5 (DW_TAG_variable) */
++      .long   .LASF0
++      .byte   0x1
++      .byte   0x18
++#if 1
++      .long   .Ltag_typedef - .debug_info
++#else
++      /* Debugging only: Skip the typedef indirection.  */
++      .long   .Ltag_array_type - .debug_info
++#endif
++      /* DW_AT_location: DW_FORM_block1: start */
++      .byte   0x3
++      .byte   0x91
++      .sleb128 -32
++#if 0
++      .byte   0x6     /* DW_OP_deref */
++#else
++      .byte   0x96    /* DW_OP_nop */
++#endif
++      /* DW_AT_location: DW_FORM_block1: end */
++      .uleb128 0x6
++      .string "i"
++      .byte   0x1
++      .byte   0x19
++      .long   0x83
++      .byte   0x2
++      .byte   0x91
++      .sleb128 -20
++      .byte   0x0
++      .uleb128 0x7
++      .byte   0x4
++      .byte   0x5
++      .string "int"
++.Ltag_array_type:
++      .uleb128 0x8    /* Abbrev Number: 8 (DW_TAG_array_type) */
++      .long   0xa0 + (2f - 1f)        /* DW_AT_type: DW_FORM_ref4 */
++      .long   0x9d + (2f - 1f)        /* DW_AT_sibling: DW_FORM_ref4 */
++1:    /* DW_AT_data_location: DW_FORM_block1: start */
++      .byte   2f - 3f /* length */
++3:
++      .byte   0x97    /* DW_OP_push_object_address */
++      .byte   0x6     /* DW_OP_deref */
++2:    /* DW_AT_data_location: DW_FORM_block1: end */
++      .uleb128 0x9
++      .long   0x9d + (2b - 1b)        /* DW_AT_type: DW_FORM_ref4 */
++      .byte   0x3
++      .byte   0x91
++      .sleb128 -40
++      .byte   0x6
++      .byte   0x0
++      .uleb128 0xa
++      .byte   0x8
++      .byte   0x7
++      .uleb128 0xb
++      .byte   0x1
++      .byte   0x6
++      .long   .LASF1
++      .byte   0x0
++.Ldebug_end:
++      .section        .debug_abbrev
++      .uleb128 0x1
++      .uleb128 0x11
++      .byte   0x1
++      .uleb128 0x25
++      .uleb128 0xe
++      .uleb128 0x13
++      .uleb128 0xb
++      .uleb128 0x3
++      .uleb128 0xe
++      .uleb128 0x1b
++      .uleb128 0xe
++      .uleb128 0x11
++      .uleb128 0x1
++      .uleb128 0x12
++      .uleb128 0x1
++      .uleb128 0x10
++      .uleb128 0x6
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x2
++      .uleb128 0x2e
++      .byte   0x1
++      .uleb128 0x3f
++      .uleb128 0xc
++      .uleb128 0x3
++      .uleb128 0x8
++      .uleb128 0x3a
++      .uleb128 0xb
++      .uleb128 0x3b
++      .uleb128 0xb
++      .uleb128 0x27
++      .uleb128 0xc
++      .uleb128 0x11
++      .uleb128 0x1
++      .uleb128 0x12
++      .uleb128 0x1
++      .uleb128 0x40
++      .uleb128 0x6
++      .uleb128 0x1
++      .uleb128 0x13
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x3
++      .uleb128 0x5
++      .byte   0x0
++      .uleb128 0x3
++      .uleb128 0xe
++      .uleb128 0x3a
++      .uleb128 0xb
++      .uleb128 0x3b
++      .uleb128 0xb
++      .uleb128 0x49
++      .uleb128 0x13
++      .uleb128 0x2
++      .uleb128 0xa
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x4
++      .uleb128 0x16
++      .byte   0x0
++      .uleb128 0x3
++      .uleb128 0xe
++      .uleb128 0x3a
++      .uleb128 0xb
++      .uleb128 0x3b
++      .uleb128 0xb
++      .uleb128 0x49
++      .uleb128 0x13
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x5
++      .uleb128 0x34
++      .byte   0x0
++      .uleb128 0x3
++      .uleb128 0xe
++      .uleb128 0x3a
++      .uleb128 0xb
++      .uleb128 0x3b
++      .uleb128 0xb
++      .uleb128 0x49
++      .uleb128 0x13
++      .uleb128 0x2
++      .uleb128 0xa
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x6
++      .uleb128 0x34
++      .byte   0x0
++      .uleb128 0x3
++      .uleb128 0x8
++      .uleb128 0x3a
++      .uleb128 0xb
++      .uleb128 0x3b
++      .uleb128 0xb
++      .uleb128 0x49
++      .uleb128 0x13
++      .uleb128 0x2
++      .uleb128 0xa
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x7
++      .uleb128 0x24
++      .byte   0x0
++      .uleb128 0xb
++      .uleb128 0xb
++      .uleb128 0x3e
++      .uleb128 0xb
++      .uleb128 0x3
++      .uleb128 0x8
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x8    /* Abbrev Number: 8 (DW_TAG_array_type) */
++      .uleb128 0x1
++      .byte   0x1
++      .uleb128 0x49   /* DW_AT_type */
++      .uleb128 0x13   /* DW_FORM_ref4 */
++      .uleb128 0x1    /* DW_AT_sibling */
++      .uleb128 0x13   /* DW_FORM_ref4 */
++      .uleb128 0x50   /* DW_AT_data_location */
++      .uleb128 0xa    /* DW_FORM_block1 */
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x9
++      .uleb128 0x21
++      .byte   0x0
++      .uleb128 0x49   /* DW_AT_type */
++      .uleb128 0x13   /* DW_FORM_ref4 */
++      .uleb128 0x2f
++      .uleb128 0xa
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0xa
++      .uleb128 0x24
++      .byte   0x0
++      .uleb128 0xb
++      .uleb128 0xb
++      .uleb128 0x3e
++      .uleb128 0xb
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0xb
++      .uleb128 0x24
++      .byte   0x0
++      .uleb128 0xb
++      .uleb128 0xb
++      .uleb128 0x3e
++      .uleb128 0xb
++      .uleb128 0x3
++      .uleb128 0xe
++      .byte   0x0
++      .byte   0x0
++      .byte   0x0
++      .section        .debug_pubnames,"",@progbits
++      .long   0x16
++      .value  0x2
++      .long   .Ldebug_info0
++      .long   0xa8
++      .long   0x2d
++      .string "foo"
++      .long   0x0
++      .section        .debug_aranges,"",@progbits
++      .long   0x2c
++      .value  0x2
++      .long   .Ldebug_info0
++      .byte   0x8
++      .byte   0x0
++      .value  0x0
++      .value  0x0
++      .quad   .Ltext0
++      .quad   .Letext0-.Ltext0
++      .quad   0x0
++      .quad   0x0
++      .section        .debug_str,"MS",@progbits,1
++.LASF0:
++      .string "array"
++.LASF5:
++      .string "size"
++.LASF3:
++      .string "x86_64-vla-typedef.c"
++.LASF6:
++      .string "array_t"
++.LASF1:
++      .string "char"
++.LASF4:
++      .string "gdb.arch"
++.LASF2:
++      .string "GNU C 4.3.2 20081105 (Red Hat 4.3.2-7)"
++      .ident  "GCC: (GNU) 4.3.2 20081105 (Red Hat 4.3.2-7)"
++      .section        .note.GNU-stack,"",@progbits
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c    2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,43 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2008 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#if 0
++
++void
++foo (int size)
++{
++  typedef char array_t[size];
++  array_t array;
++  int i;
++
++  for (i = 0; i < size; i++)
++    array[i] = i;
++
++  array[0] = 0;       /* break-here */
++}
++
++#else
++
++int
++main (void)
++{
++  foo (26);
++  foo (78);
++  return 0;
++}
++
++#endif
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp  2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,64 @@
++# Copyright 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++# Test DW_AT_data_location accessed through DW_TAG_typedef intermediate.
++
++if ![istarget "x86_64-*-*"] then {
++    verbose "Skipping over gdb.arch/x86_64-vla-typedef.exp test made only for x86_64."
++    return
++}
++
++set testfile x86_64-vla-typedef
++set srcasmfile ${testfile}-foo.S
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++set binobjfile ${objdir}/${subdir}/${testfile}-foo.o
++if  { [gdb_compile "${srcdir}/${subdir}/${srcasmfile}" "${binobjfile}" object {}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${binobjfile}" "${binfile}" executable {debug}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++if ![runto_main] {
++    untested x86_64-vla-typedef
++    return -1
++}
++
++gdb_breakpoint "break_here"
++
++gdb_continue_to_breakpoint "break_here"
++
++gdb_test "whatis array" "type = array_t" "first: whatis array"
++
++gdb_test "ptype array" "type = char \\\[26\\\]" "first: ptype array"
++
++gdb_test "p array\[1\]" "\\$\[0-9\] = 1 '\\\\001'"
++gdb_test "p array\[2\]" "\\$\[0-9\] = 2 '\\\\002'"
++gdb_test "p array\[3\]" "\\$\[0-9\] = 3 '\\\\003'"
++gdb_test "p array\[4\]" "\\$\[0-9\] = 4 '\\\\004'"
++
++gdb_continue_to_breakpoint "break_here"
++
++gdb_test "whatis array" "type = array_t" "second: whatis array"
++
++gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.base/arrayidx.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/testsuite/gdb.base/arrayidx.c 2011-01-01 16:33:40.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.base/arrayidx.c      2011-07-29 22:52:02.000000000 +0200
+@@ -17,6 +17,13 @@
+ int array[] = {1, 2, 3, 4};
++#ifdef __GNUC__
++struct
++  {
++    int a[0];
++  } unbound;
++#endif
++
+ int
+ main (void)
+ {
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.base/arrayidx.exp
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/testsuite/gdb.base/arrayidx.exp       2011-01-01 16:33:40.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.base/arrayidx.exp    2011-07-29 22:52:02.000000000 +0200
+@@ -57,4 +57,12 @@ gdb_test "print array" \
+          "\\{\\\[0\\\] = 1, \\\[1\\\] = 2, \\\[2\\\] = 3, \\\[3\\\] = 4\\}" \
+          "Print array with array-indexes on"
+-
++set test "p unbound.a == &unbound.a\[0\]"
++gdb_test_multiple $test $test {
++    -re " = 1\r\n$gdb_prompt $" {
++      pass $test
++    }
++    -re "No symbol \"unbound\" in current context.\r\n$gdb_prompt $" {
++      unsupported "$test (no GCC)"
++    }
++}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.base/default.exp
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/testsuite/gdb.base/default.exp        2011-05-20 16:37:20.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.base/default.exp     2011-07-29 22:52:02.000000000 +0200
+@@ -607,6 +607,17 @@ gdb_test_list_exact "show convenience" "
+       {$_sdata = void} \
+       {$_siginfo = void} \
+       {$_thread = 0} \
++      {$_probe_argc = <error: No frame selected>} \
++      {$_probe_arg0 = <error: No frame selected>} \
++      {$_probe_arg1 = <error: No frame selected>} \
++      {$_probe_arg2 = <error: No frame selected>} \
++      {$_probe_arg3 = <error: No frame selected>} \
++      {$_probe_arg4 = <error: No frame selected>} \
++      {$_probe_arg5 = <error: No frame selected>} \
++      {$_probe_arg6 = <error: No frame selected>} \
++      {$_probe_arg7 = <error: No frame selected>} \
++      {$_probe_arg8 = <error: No frame selected>} \
++      {$_probe_arg9 = <error: No frame selected>} \
+     }
+ #test show directories
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.base/internal-var-field-address.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.base/internal-var-field-address.c    2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,20 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2009 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++struct {
++  int field;
++} staticstruct = { 1 };
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.base/internal-var-field-address.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.base/internal-var-field-address.exp  2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,26 @@
++# Copyright 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++set test internal-var-field-address
++set binfile ${test}.x
++if  { [gdb_compile "${srcdir}/${subdir}/${test}.c" "${objdir}/${subdir}/${binfile}" object {debug}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++
++clean_restart $binfile
++
++gdb_test {set $varstruct = staticstruct}
++gdb_test {p $varstruct.field} " = 1"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.base/stap-probe.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.base/stap-probe.c    2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,69 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2011 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#if USE_PROBES
++
++#define _SDT_HAS_SEMAPHORES
++__extension__ unsigned short teste_user_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
++#define TEST teste_user_semaphore
++
++__extension__ unsigned short teste_two_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
++#define TEST2 teste_two_semaphore
++
++#else
++
++#define TEST 1
++#define TEST2 1
++
++#endif
++
++#include <sys/sdt.h>
++
++/* We only support SystemTap and only the v3 form.  */
++#if _SDT_NOTE_TYPE != 3
++#error "not using SystemTap v3 probes"
++#endif
++
++void
++m1 (void)
++{
++  if (TEST2)
++    STAP_PROBE (teste, two);
++}
++
++void
++m2 (void)
++{
++  if (TEST2)
++    STAP_PROBE (teste, two);
++}
++
++int
++f (int x)
++{
++  if (TEST)
++    STAP_PROBE1(teste, user, x);
++  return x+5;
++}
++
++int
++main()
++{
++  f(f(23));
++  m1();
++  m2();
++}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.base/stap-probe.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.base/stap-probe.exp  2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,72 @@
++# Copyright (C) 2011 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++set testfile stap-probe
++
++# Run the tests.  We run the tests two different ways: once with a
++# plain probe, and once with a probe that has an associated semaphore.
++# This returns -1 on failure to compile or start, 0 otherwise.
++proc stap_test {{arg ""}} {
++    global testfile hex
++
++    if {$arg != ""} {
++      set arg "additional_flags=$arg"
++      set addendum ", with semaphore"
++    } else {
++      set addendum ", no semaphore"
++    }
++
++    if {[prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.c \
++         [concat $arg debug]]} {
++      return -1
++    }
++
++    if ![runto_main] {
++      return -1
++    }
++
++    gdb_test "print \$_probe_argc" "No SystemTap probe at PC $hex" \
++      "check argument not at probe point$addendum"
++
++    gdb_test "info probes" \
++      "teste *user *$hex .*" \
++      "info probes$addendum"
++    
++    if {[runto "probe:teste:user"]} {
++      pass "run to probe:teste:user$addendum"
++    } else {
++      fail "run to probe:teste:user$addendum"
++    }
++
++    # Test probe arguments.
++    gdb_test "print \$_probe_argc" " = 1" "print \$_probe_argc$addendum"
++    gdb_test "print \$_probe_arg0 == x" " = 1" "check \$_probe_arg0$addendum"
++    gdb_test "print \$_probe_arg1" \
++      "Invalid probe argument 1 -- probe has 1 arguments available" \
++      "check \$_probe_arg1$addendum"
++
++    # Set a breakpoint with multiple probe locations.
++    gdb_test "break probe:teste:two" \
++      "Breakpoint .* at $hex.*2 locations.*" \
++      "set multi-location probe breakpoint$addendum"
++
++    return 0
++}
++
++if {[stap_test] == -1} {
++    untested stap-probe.exp
++    return -1
++}
++stap_test "-DUSE_PROBES"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.base/vla-overflow.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.base/vla-overflow.c  2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,30 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2008 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#include <stdlib.h>
++
++int
++main (int argc, char **argv)
++{
++  int array[argc];
++
++  array[0] = array[0];
++
++  abort ();
++
++  return 0;
++}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.base/vla-overflow.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.base/vla-overflow.exp        2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,109 @@
++# Copyright 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++# We could crash in:
++# #0  block_linkage_function (bl=0x0) at ../../gdb/block.c:69
++# #1  in dwarf_block_get_frame_base (...) at ../../gdb/dwarf2block.c:97
++#   97          framefunc = block_linkage_function (get_frame_block (frame, NULL));
++# #2  in execute_stack_op (...) at ../../gdb/dwarf2expr.c:496
++# #3  in dwarf_block_exec_core () at ../../gdb/dwarf2block.c:156
++# #4  dwarf_block_exec (...) at ../../gdb/dwarf2block.c:206
++# #5  in range_type_count_bound_internal (...) at ../../gdb/gdbtypes.c:1430
++# #6  in create_array_type (...) at ../../gdb/gdbtypes.c:840
++# ...
++# #21 in psymtab_to_symtab (...) at ../../gdb/symfile.c:292
++# ...
++# #29 in backtrace_command_1 () at ../../gdb/stack.c:1273
++
++set testfile vla-overflow
++set shfile ${objdir}/${subdir}/${testfile}-gdb.sh
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++
++set f [open "|getconf PAGESIZE" "r"]
++gets $f pagesize
++close $f
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++set pid_of_gdb [exp_pid -i [board_info host fileid]]
++
++if { [runto_main] < 0 } {
++    untested vla-overflow
++    return -1
++}
++
++# Get the GDB memory size when we stay at main.
++
++proc memory_v_pages_get {} {
++    global pid_of_gdb pagesize
++    set fd [open "/proc/$pid_of_gdb/statm"]
++    gets $fd line
++    close $fd
++    # number of pages of virtual memory
++    scan $line "%d" drs
++    return $drs
++}
++
++set pages_found [memory_v_pages_get]
++
++# s390x with glibc-debuginfo.s390x installed used approx. 16MB.
++set mb_reserve 40
++verbose -log "pages_found = $pages_found, mb_reserve = $mb_reserve"
++set kb_found [expr $pages_found * $pagesize / 1024]
++set kb_permit [expr $kb_found + 1 * 1024 + $mb_reserve * 1024]
++verbose -log "kb_found = $kb_found, kb_permit = $kb_permit"
++
++# Create the ulimit wrapper.
++set f [open $shfile "w"]
++puts $f "#! /bin/sh"
++puts $f "ulimit -v $kb_permit"
++puts $f "exec $GDB \"\$@\""
++close $f
++remote_exec host "chmod +x $shfile"
++
++gdb_exit
++set GDBold $GDB
++set GDB "$shfile"
++gdb_start
++set GDB $GDBold
++
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++set pid_of_gdb [exp_pid -i [board_info host fileid]]
++
++# Check the size again after the second run.
++# We must not stop in main as it would cache `array' and never crash later.
++
++gdb_run_cmd
++
++verbose -log "kb_found before abort() = [expr [memory_v_pages_get] * $pagesize / 1024]"
++
++gdb_test "" "Program received signal SIGABRT, Aborted..*" "Enter abort()"
++
++verbose -log "kb_found in abort() = [expr [memory_v_pages_get] * $pagesize / 1024]"
++
++# `abort' can get expressed as `*__GI_abort'.
++gdb_test "bt" "in \[^ \]*abort \\(.* in main \\(.*" "Backtrace after abort()"
++
++verbose -log "kb_found in bt after abort() = [expr [memory_v_pages_get] * $pagesize / 1024]"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.base/vla.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.base/vla.c   2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,55 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2008 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#include <string.h>
++
++void
++marker (void)
++{
++}
++
++void
++bar (char *a, char *b, char *c, int size)
++{
++  memset (a, '1', size);
++  memset (b, '2', size);
++  memset (c, '3', 48);
++}
++
++void
++foo (int size)
++{
++  char temp1[size];
++  char temp3[48];
++
++  temp1[size - 1] = '\0';
++  {
++    char temp2[size];
++
++    bar (temp1, temp2, temp3, size);
++
++    marker ();        /* break-here */
++  }
++}
++
++int
++main (void)
++{
++  foo (26);
++  foo (78);
++  return 0;
++}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.base/vla.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.base/vla.exp 2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,62 @@
++# Copyright 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++set testfile vla
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++if ![runto_main] {
++    untested vla
++    return -1
++}
++
++gdb_breakpoint [gdb_get_line_number "break-here"]
++
++gdb_continue_to_breakpoint "break-here"
++
++gdb_test "whatis temp1" "type = char \\\[variable\\\]" "first: whatis temp1"
++gdb_test "whatis temp2" "type = char \\\[variable\\\]" "first: whatis temp2"
++gdb_test "whatis temp3" "type = char \\\[48\\\]" "first: whatis temp3"
++
++gdb_test "ptype temp1" "type = char \\\[26\\\]" "first: ptype temp1"
++gdb_test "ptype temp2" "type = char \\\[26\\\]" "first: ptype temp2"
++gdb_test "ptype temp3" "type = char \\\[48\\\]" "first: ptype temp3"
++
++gdb_test "p temp1" " = '1' <repeats 26 times>" "first: print temp1"
++gdb_test "p temp2" " = '2' <repeats 26 times>" "first: print temp2"
++gdb_test "p temp3" " = '3' <repeats 48 times>" "first: print temp3"
++
++gdb_continue_to_breakpoint "break-here"
++
++gdb_test "whatis temp1" "type = char \\\[variable\\\]" "second: whatis temp1"
++gdb_test "whatis temp2" "type = char \\\[variable\\\]" "second: whatis temp2"
++gdb_test "whatis temp3" "type = char \\\[48\\\]" "second: whatis temp3"
++
++gdb_test "ptype temp1" "type = char \\\[78\\\]" "second: ptype temp1"
++gdb_test "ptype temp2" "type = char \\\[78\\\]" "second: ptype temp2"
++gdb_test "ptype temp3" "type = char \\\[48\\\]" "second: ptype temp3"
++
++gdb_test "p temp1" " = '1' <repeats 78 times>" "second: print temp1"
++gdb_test "p temp2" " = '2' <repeats 78 times>" "second: print temp2"
++gdb_test "p temp3" " = '3' <repeats 48 times>" "second: print temp3"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.cp/nextoverthrow.exp
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/testsuite/gdb.cp/nextoverthrow.exp    2011-01-01 16:33:44.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.cp/nextoverthrow.exp 2011-07-29 22:52:02.000000000 +0200
+@@ -53,6 +53,17 @@ gdb_test_multiple "print _Unwind_DebugHo
+     }
+ }
+ if {!$ok} {
++    gdb_test_multiple "info probe" "check for stap probe in unwinder" {
++      -re ".*libgcc.*unwind.*\r\n$gdb_prompt $" {
++          pass "check for stap probe in unwinder"
++          set ok 1
++      }
++      -re "\r\n$gdb_prompt $" {
++      }
++    }
++}
++
++if {!$ok} {
+     unsupported "nextoverthrow.exp could not find _Unwind_DebugHook"
+     return -1
+ }
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S   2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,246 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2010 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++/* Debug information */
++
++/* We will `break *main' at the very first instruction.  */
++#define main_length 1
++
++      .section        .data
++vardata:
++      /* See DW_OP_lit3 + 1 (0-based).  */
++      .string         "seennotseen"
++
++      .section        .debug_info
++.Lcu1_begin:
++      .4byte          .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
++.Lcu1_start:
++      .2byte          2                       /* DWARF version number */
++      .4byte          .Ldebug_abbrev0         /* Offset Into Abbrev. Section */
++      .byte           4                       /* Pointer Size (in bytes) */
++
++      /* CU die */
++      .uleb128        1                       /* Abbrev: DW_TAG_compile_unit */
++      .4byte          .Lproducer              /* DW_AT_producer */
++      /* Use C++ to exploit a bug in parsing DW_AT_name "".  */
++      .byte           4                       /* DW_AT_language (C++) -  */
++      .4byte          main                    /* DW_AT_low_pc */
++      .byte           main_length             /* DW_AT_high_pc */
++
++.Larray_type:
++      .uleb128        2                       /* Abbrev: DW_TAG_array_type */
++      .4byte          .Lchar_type-.Lcu1_begin /* DW_AT_type */
++
++      .uleb128        3                       /* Abbrev: DW_TAG_subrange_type */
++      .4byte          .Luint_type-.Lcu1_begin /* DW_AT_type */
++      .byte           0                       /* DW_AT_lower_bound */
++      .4byte          .Llen_var-.Lcu1_begin   /* DW_AT_upper_bound */
++      .byte           0                       /* End of children of die */
++
++      /* DW_AT_upper_bound is referencing an optimized-out variable.  */
++.Larrayb_type:
++      .uleb128        2                       /* Abbrev: DW_TAG_array_type */
++      .4byte          .Lchar_type-.Lcu1_begin /* DW_AT_type */
++
++      .uleb128        3                       /* Abbrev: DW_TAG_subrange_type */
++      .4byte          .Luint_type-.Lcu1_begin /* DW_AT_type */
++      .byte           0                       /* DW_AT_lower_bound */
++      .4byte          .Llenb_var-.Lcu1_begin  /* DW_AT_upper_bound */
++      .byte           0                       /* End of children of die */
++
++      /* DW_AT_upper_bound is referencing register.  */
++.Larrayreg_type:
++      .uleb128        2                       /* Abbrev: DW_TAG_array_type */
++      .4byte          .Lchar_type-.Lcu1_begin /* DW_AT_type */
++
++      .uleb128        8                       /* Abbrev: DW_TAG_subrange_type with block */
++      .4byte          .Luint_type-.Lcu1_begin /* DW_AT_type */
++      .byte           0                       /* DW_AT_lower_bound */
++      .byte           2f - 1f                 /* DW_AT_upper_bound */
++1:    .byte           0x50                    /* DW_OP_reg0 */
++2:
++      .byte           0                       /* End of children of die */
++
++.Luint_type:
++      .uleb128        4                       /* Abbrev: DW_TAG_base_type */
++      .4byte          .Luint_str              /* DW_AT_name */
++      .byte           4                       /* DW_AT_byte_size */
++      .byte           7                       /* DW_AT_encoding */
++
++.Lchar_type:
++      .uleb128        4                       /* Abbrev: DW_TAG_base_type */
++      .4byte          .Lchar_str              /* DW_AT_name */
++      .byte           1                       /* DW_AT_byte_size */
++      .byte           6                       /* DW_AT_encoding */
++
++.Llen_var:
++      .uleb128        5                       /* Abbrev: DW_TAG_variable artificial */
++      .byte           1                       /* DW_AT_artificial */
++      .4byte          .Luint_type-.Lcu1_begin /* DW_AT_type */
++      .4byte          .Llen_loclist-.Lloclist /* DW_AT_location */
++
++      /* optimized-out variable for b_string.  */
++.Llenb_var:
++      .uleb128        7                       /* Abbrev: DW_TAG_variable artificial no DW_AT_location */
++      .byte           1                       /* DW_AT_artificial */
++      .4byte          .Luint_type-.Lcu1_begin /* DW_AT_type */
++
++      .uleb128        6                       /* Abbrev: DW_TAG_variable DW_FORM_string */
++      .string         "a_string"              /* DW_AT_name */
++      .4byte          .Larray_type-.Lcu1_begin /* DW_AT_type */
++      .byte           2f - 1f                 /* DW_AT_location */
++1:    .byte           3                       /*   DW_OP_addr */
++      .4byte          vardata                 /*   <addr> */
++2:
++
++      /* DW_AT_upper_bound is referencing an optimized-out variable.  */
++      .uleb128        6                       /* Abbrev: DW_TAG_variable DW_FORM_string */
++      .string         "b_string"              /* DW_AT_name */
++      .4byte          .Larrayb_type-.Lcu1_begin /* DW_AT_type */
++      .byte           2f - 1f                 /* DW_AT_location */
++1:    .byte           3                       /*   DW_OP_addr */
++      .4byte          vardata                 /*   <addr> */
++2:
++
++      /* DW_AT_upper_bound is referencing register.  */
++      .uleb128        6                       /* Abbrev: DW_TAG_variable DW_FORM_string */
++      .string         "reg_string"            /* DW_AT_name */
++      .4byte          .Larrayreg_type-.Lcu1_begin /* DW_AT_type */
++      .byte           2f - 1f                 /* DW_AT_location */
++1:    .byte           3                       /*   DW_OP_addr */
++      .4byte          vardata                 /*   <addr> */
++2:
++
++      .byte           0                       /* End of children of CU */
++.Lcu1_end:
++
++      .section        .debug_loc
++.Lloclist:
++.Llen_loclist:
++      .4byte  0                       # Location list begin address
++      .4byte  main_length             # Location list end address
++      .value  2f-1f   # Location expression size
++1:    .byte   0x33    # DW_OP_lit3
++      .byte   0x9f    # DW_OP_stack_value
++2:
++      .quad   0x0     # Location list terminator begin (*.LLST2)
++      .quad   0x0     # Location list terminator end (*.LLST2)
++
++      .section .debug_abbrev
++.Ldebug_abbrev0:
++      .uleb128        1                       /* Abbrev code */
++      .uleb128        0x11                    /* DW_TAG_compile_unit */
++      .byte           0x1                     /* has_children */
++      .uleb128        0x25                    /* DW_AT_producer */
++      .uleb128        0xe                     /* DW_FORM_strp */
++      .uleb128        0x13                    /* DW_AT_language */
++      .uleb128        0xb                     /* DW_FORM_data1 */
++      .uleb128        0x11                    /* DW_AT_low_pc */
++      .uleb128        0x1                     /* DW_FORM_addr */
++      .uleb128        0x12                    /* DW_AT_high_pc */
++      .uleb128        0xb                     /* DW_FORM_data1 */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .uleb128        2                       /* Abbrev code */
++      .uleb128        0x1                     /* TAG: DW_TAG_array_type */
++      .byte           0x1                     /* DW_children_yes */
++      .uleb128        0x49                    /* DW_AT_type */
++      .uleb128        0x13                    /* DW_FORM_ref4 */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .uleb128        3                       /* Abbrev code */
++      .uleb128        0x21                    /* DW_TAG_subrange_type */
++      .byte           0x0                     /* no children */
++      .uleb128        0x49                    /* DW_AT_type */
++      .uleb128        0x13                    /* DW_FORM_ref4 */
++      .uleb128        0x22                    /* DW_AT_lower_bound */
++      .uleb128        0xb                     /* DW_FORM_data1 */
++      .uleb128        0x2f                    /* DW_AT_upper_bound */
++      .uleb128        0x13                    /* DW_FORM_ref4 */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .uleb128        4                       /* Abbrev code */
++      .uleb128        0x24                    /* DW_TAG_base_type */
++      .byte           0x0                     /* no_children */
++      .uleb128        0x3                     /* DW_AT_name */
++      .uleb128        0xe                     /* DW_FORM_strp */
++      .uleb128        0xb                     /* DW_AT_byte_size */
++      .uleb128        0xb                     /* DW_FORM_data1 */
++      .uleb128        0x3e                    /* DW_AT_encoding */
++      .uleb128        0xb                     /* DW_FORM_data1 */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .uleb128        5                       /* Abbrev code */
++      .uleb128        0x34                    /* DW_TAG_variable */
++      .byte           0x0                     /* no_children */
++      .uleb128        0x34                    /* DW_AT_artificial */
++      .uleb128        0x0c                    /* DW_FORM_flag */
++      .uleb128        0x49                    /* DW_AT_type */
++      .uleb128        0x13                    /* DW_FORM_ref4 */
++      .uleb128        0x02                    /* DW_AT_location */
++      .uleb128        0x06                    /* DW_FORM_data4 */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .uleb128        6                       /* Abbrev code */
++      .uleb128        0x34                    /* DW_TAG_variable */
++      .byte           0x0                     /* no_children */
++      .uleb128        0x3                     /* DW_AT_name */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .uleb128        0x49                    /* DW_AT_type */
++      .uleb128        0x13                    /* DW_FORM_ref4 */
++      .uleb128        0x2                     /* DW_AT_location */
++      .uleb128        0xa                     /* DW_FORM_block1 */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .uleb128        7                       /* Abbrev code */
++      .uleb128        0x34                    /* DW_TAG_variable */
++      .byte           0x0                     /* no_children */
++      .uleb128        0x34                    /* DW_AT_artificial */
++      .uleb128        0x0c                    /* DW_FORM_flag */
++      .uleb128        0x49                    /* DW_AT_type */
++      .uleb128        0x13                    /* DW_FORM_ref4 */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .uleb128        8                       /* Abbrev code */
++      .uleb128        0x21                    /* DW_TAG_subrange_type with block */
++      .byte           0x0                     /* no children */
++      .uleb128        0x49                    /* DW_AT_type */
++      .uleb128        0x13                    /* DW_FORM_ref4 */
++      .uleb128        0x22                    /* DW_AT_lower_bound */
++      .uleb128        0xb                     /* DW_FORM_data1 */
++      .uleb128        0x2f                    /* DW_AT_upper_bound */
++      .uleb128        0xa                     /* DW_FORM_block1 */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .byte           0x0                     /* Terminator */
++
++/* String table */
++      .section .debug_str
++.Lproducer:
++      .string         "GNU C 3.3.3"
++.Lchar_str:
++      .string         "char"
++.Luint_str:
++      .string         "unsigned int"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp 2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,54 @@
++# Copyright 2010 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++# Test printing variable with dynamic bounds which reference a different
++# (artificial in the GCC case) variable containing loclist as its location.
++# This testcase uses value (not address) of the referenced variable:
++# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43762
++
++# This test can only be run on targets which support DWARF-2 and use gas.
++# For now pick a sampling of likely targets.
++if {![istarget *-*-linux*]
++    && ![istarget *-*-gnu*]
++    && ![istarget *-*-elf*]
++    && ![istarget *-*-openbsd*]
++    && ![istarget arm-*-eabi*]
++    && ![istarget powerpc-*-eabi*]} {
++    return 0
++}
++
++set testfile dw2-bound-loclist
++if { [prepare_for_testing ${testfile}.exp ${testfile} [list ${testfile}.S main.c] {}] } {
++    return -1
++}
++
++# Verify it behaves at least as an unbound array without inferior.
++
++gdb_test "p a_string" { = 0x[0-9a-f]+ "seennotseen"}
++gdb_test "ptype a_string" {type = char \[\]}
++
++# Not runto_main as dw2-bound-loclist.S handles only the first byte of main.
++if ![runto "*main"] {
++    return -1
++}
++
++gdb_test "p a_string" { = "seen"}
++gdb_test "ptype a_string" {type = char \[4\]}
++
++gdb_test "p b_string" { = (0x[0-9a-f]+ )?"seennotseen"}
++gdb_test "ptype b_string" {type = char \[\]}
++
++# The register contains unpredictable value - the array size.
++gdb_test "ptype reg_string" {type = char \[-?[0-9]+\]}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.dwarf2/dw2-stripped.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.dwarf2/dw2-stripped.c        2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,42 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2004 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++ 
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++
++/* The function `func1' traced into must have debug info on offset > 0;
++   (DW_UNSND (attr)).  This is the reason of `func0' existence.  */
++
++void
++func0(int a, int b)
++{
++}
++
++/* `func1' being traced into must have some arguments to dump.  */
++
++void
++func1(int a, int b)
++{
++  func0 (a,b);
++}
++
++int
++main(void)
++{
++  func1 (1, 2);
++  return 0;
++}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp      2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,79 @@
++# Copyright 2006 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++# Minimal DWARF-2 unit test
++
++# This test can only be run on targets which support DWARF-2.
++# For now pick a sampling of likely targets.
++if {![istarget *-*-linux*]
++    && ![istarget *-*-gnu*]
++    && ![istarget *-*-elf*]
++    && ![istarget *-*-openbsd*]
++    && ![istarget arm-*-eabi*]
++    && ![istarget powerpc-*-eabi*]} {
++    return 0  
++}
++
++set testfile "dw2-stripped"
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}.x
++
++remote_exec build "rm -f ${binfile}"
++
++# get the value of gcc_compiled
++if [get_compiler_info ${binfile}] {
++    return -1
++}
++
++# This test can only be run on gcc as we use additional_flags=FIXME
++if {$gcc_compiled == 0} {
++    return 0
++}
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-ggdb3}] != "" } {
++    return -1
++}
++
++remote_exec build "objcopy -R .debug_loc ${binfile}"
++set strip_output [remote_exec build "objdump -h ${binfile}"]
++
++set test "stripping test file preservation"
++if [ regexp ".debug_info " $strip_output]  {
++    pass "$test (.debug_info preserved)"
++} else {
++    fail "$test (.debug_info got also stripped)"
++}
++
++set test "stripping test file functionality"
++if [ regexp ".debug_loc " $strip_output]  {
++    fail "$test (.debug_loc still present)"
++} else {
++    pass "$test (.debug_loc stripped)"
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++# For C programs, "start" should stop in main().
++
++gdb_test "start" \
++         ".*main \\(\\) at .*" \
++         "start"
++gdb_test "step" \
++         "func.* \\(.*\\) at .*" \
++         "step"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S     2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,83 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2009 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++/* Debug information */
++
++      .section .debug_info
++.Lcu1_begin:
++      /* CU header */
++      .4byte  .Lcu1_end - .Lcu1_start         /* Length of Compilation Unit */
++.Lcu1_start:
++      .2byte  2                               /* DWARF Version */
++      .4byte  .Labbrev1_begin                 /* Offset into abbrev section */
++      .byte   4                               /* Pointer size */
++
++      /* CU die */
++      .uleb128 1                              /* Abbrev: DW_TAG_compile_unit */
++      .ascii  "dw2-struct-member-data-location.c\0"   /* DW_AT_name */
++      .ascii  "GNU C 4.3.2\0"                 /* DW_AT_producer */
++      .byte   1                               /* DW_AT_language (C) */
++
++.Ltype_uchar:
++      .uleb128        2                       /* Abbrev: DW_TAG_structure_type */
++      .ascii          "some_struct\0"         /* DW_AT_name */
++
++      .uleb128        3                       /* Abbrev: DW_TAG_member */
++      .ascii          "field\0"               /* DW_AT_name */
++      .byte           0                       /* DW_AT_data_member_location */
++
++      .byte           0                       /* End of children of some_struct */
++
++      .byte           0                       /* End of children of CU */
++
++.Lcu1_end:
++
++/* Abbrev table */
++      .section .debug_abbrev
++.Labbrev1_begin:
++      .uleb128        1                       /* Abbrev code */
++      .uleb128        0x11                    /* DW_TAG_compile_unit */
++      .byte           1                       /* has_children */
++      .uleb128        0x3                     /* DW_AT_name */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .uleb128        0x25                    /* DW_AT_producer */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .uleb128        0x13                    /* DW_AT_language */
++      .uleb128        0xb                     /* DW_FORM_data1 */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .uleb128        2                       /* Abbrev code */
++      .uleb128        0x13                    /* DW_TAG_structure_type */
++      .byte           1                       /* has_children */
++      .uleb128        0x3                     /* DW_AT_name */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .uleb128        3                       /* Abbrev code */
++      .uleb128        0x0d                    /* DW_TAG_member */
++      .byte           0                       /* has_children */
++      .uleb128        0x3                     /* DW_AT_name */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .uleb128        0x38                    /* DW_AT_data_member_location */
++      .uleb128        0x0b                    /* DW_FORM_data1 */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp   2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,37 @@
++# Copyright 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++# This test can only be run on targets which support DWARF-2 and use gas.
++# For now pick a sampling of likely targets.
++if {![istarget *-*-linux*]
++    && ![istarget *-*-gnu*]
++    && ![istarget *-*-elf*]
++    && ![istarget *-*-openbsd*]
++    && ![istarget arm-*-eabi*]
++    && ![istarget powerpc-*-eabi*]} {
++    return 0  
++}
++
++set testfile "dw2-struct-member-data-location"
++set srcfile ${testfile}.S
++set binfile ${testfile}.x
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objdir}/${subdir}/${binfile}" object {nodebug}] != "" } {
++    return -1
++}
++
++clean_restart $binfile
++
++gdb_test "ptype struct some_struct" "type = struct some_struct {\[\r\n \t\]*void field;\[\r\n \t\]*}"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/dwarf-stride.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/dwarf-stride.exp     2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,42 @@
++# Copyright 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
++
++# This file is part of the gdb testsuite.  Array element stride must not be
++# specified in the number of elements but in a number of bytes instead.
++# Original problem:
++# (gdb) p c40pt(1)
++# $1 = '0-hello', ' ' <repeats 33 times>
++# (gdb) p c40pt(2)
++# warning: Fortran array stride not divisible by the element size
++
++set testfile dwarf-stride
++set srcfile ${testfile}.f90
++
++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } {
++    return -1
++}
++
++if ![runto MAIN__] then {
++    perror "couldn't run to breakpoint MAIN__"
++    continue
++}
++
++gdb_breakpoint [gdb_get_line_number "break-here"]
++gdb_continue_to_breakpoint "break-here" ".*break-here.*"
++gdb_test "p c40pt(1)" " = '0-hello.*"
++gdb_test "p c40pt(2)" " = '1-hello.*"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/dwarf-stride.f90
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/dwarf-stride.f90     2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,40 @@
++! Copyright 2009 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 2 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program; if not, write to the Free Software
++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++!
++! File written by Alan Matsuoka.
++
++program repro
++
++  type small_stride
++     character*40 long_string
++     integer      small_pad
++  end type small_stride
++
++  type(small_stride), dimension (20), target :: unpleasant
++  character*40, pointer, dimension(:):: c40pt
++
++  integer i
++
++  do i = 0,19
++     unpleasant(i+1)%small_pad = i+1
++     unpleasant(i+1)%long_string = char (ichar('0') + i) // '-hello'
++  end do
++
++  c40pt => unpleasant%long_string
++
++  print *, c40pt  ! break-here
++
++end program repro
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,24 @@
++! Copyright 2010 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 2 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program; if not, write to the Free Software
++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++!
++! Ihis file is the Fortran source file for dynamic.exp.
++! Original file written by Jakub Jelinek <jakub@redhat.com>.
++! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
++
++subroutine bar
++  real :: dummy
++  dummy = 1
++end subroutine bar
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp      2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,37 @@
++# Copyright 2010 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++set testfile "dynamic-other-frame"
++set srcfile1 ${testfile}.f90
++set srcfile2 ${testfile}-stub.f90
++set objfile2 ${objdir}/${subdir}/${testfile}-stub.o
++set executable ${testfile}
++set binfile ${objdir}/${subdir}/${executable}
++
++if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${objfile2}" object {f90}] != ""
++     || [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${objfile2}" "${binfile}" executable {debug f90}] != "" } {
++    untested "Couldn't compile ${srcfile1} or ${srcfile2}"
++    return -1
++}
++
++clean_restart ${executable}
++
++if ![runto bar_] then {
++    perror "couldn't run to bar_"
++    continue
++}
++
++gdb_test "bt" {foo \(string='hello'.*}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90      2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,36 @@
++! Copyright 2010 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 2 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program; if not, write to the Free Software
++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++!
++! Ihis file is the Fortran source file for dynamic.exp.
++! Original file written by Jakub Jelinek <jakub@redhat.com>.
++! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
++
++subroutine foo (string)
++  interface
++    subroutine bar
++    end subroutine
++  end interface
++  character string*(*)
++  call bar                                ! stop-here
++end subroutine foo
++program test
++  interface
++    subroutine foo (string)
++    character string*(*)
++    end subroutine
++  end interface
++  call foo ('hello')
++end
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/dynamic.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/dynamic.exp  2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,145 @@
++# Copyright 2007 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
++
++# This file is part of the gdb testsuite.  It contains tests for dynamically
++# allocated Fortran arrays.
++# It depends on the GCC dynamic Fortran arrays DWARF support:
++#     http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22244
++
++set testfile "dynamic"
++set srcfile ${testfile}.f90
++set binfile ${objdir}/${subdir}/${testfile}
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] != "" } {
++    untested "Couldn't compile ${srcfile}"
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++if ![runto MAIN__] then {
++    perror "couldn't run to breakpoint MAIN__"
++    continue
++}
++
++gdb_breakpoint [gdb_get_line_number "varx-init"]
++gdb_continue_to_breakpoint "varx-init"
++gdb_test "p varx" "\\$\[0-9\]* = <(object|the array) is not allocated>" "p varx unallocated"
++gdb_test "ptype varx" "type = <(object|the array) is not allocated>" "ptype varx unallocated"
++gdb_test "p varx(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "p varx(1,5,17) unallocated"
++gdb_test "p varx(1,5,17)=1" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "p varx(1,5,17)=1 unallocated"
++gdb_test "ptype varx(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "ptype varx(1,5,17) unallocated"
++
++gdb_breakpoint [gdb_get_line_number "varx-allocated"]
++gdb_continue_to_breakpoint "varx-allocated"
++# $1 = (( ( 0, 0, 0, 0, 0, 0) ( 0, 0, 0, 0, 0, 0) --- , 0) ) ( ( 0, 0, ...) ...) ...)
++gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" "ptype varx allocated"
++# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1.
++gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" "p l if varx allocated"
++
++gdb_breakpoint [gdb_get_line_number "varx-filled"]
++gdb_continue_to_breakpoint "varx-filled"
++gdb_test "p varx(2, 5, 17)" "\\$\[0-9\]* = 6"
++gdb_test "p varx(1, 5, 17)" "\\$\[0-9\]* = 7"
++gdb_test "p varx(2, 6, 18)" "\\$\[0-9\]* = 8"
++gdb_test "p varx(6, 15, 28)" "\\$\[0-9\]* = 9"
++# The latter one is for the Intel Fortran Compiler 10.1.008 pointer type.
++gdb_test "p varv" "\\$\[0-9\]* = (<(object|the array) is not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "p varv unassociated"
++gdb_test "ptype varv" "type = (<(object|the array) is not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "ptype varv unassociated"
++
++gdb_breakpoint [gdb_get_line_number "varv-associated"]
++gdb_continue_to_breakpoint "varv-associated"
++gdb_test "p varx(3, 7, 19)" "\\$\[0-9\]* = 6" "p varx(3, 7, 19) with varv associated"
++gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 6" "p varv(3, 7, 19) associated"
++# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1.
++gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" "p l if varv associated"
++gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" "ptype varx with varv associated"
++# Intel Fortran Compiler 10.1.008 uses the pointer type.
++gdb_test "ptype varv" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)\\)?" "ptype varv associated"
++
++gdb_breakpoint [gdb_get_line_number "varv-filled"]
++gdb_continue_to_breakpoint "varv-filled"
++gdb_test "p varx(3, 7, 19)" "\\$\[0-9\]* = 10" "p varx(3, 7, 19) with varv filled"
++gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 10" "p varv(3, 7, 19) filled"
++
++gdb_breakpoint [gdb_get_line_number "varv-deassociated"]
++gdb_continue_to_breakpoint "varv-deassociated"
++# The latter one is for the Intel Fortran Compiler 10.1.008 pointer type.
++gdb_test "p varv" "\\$\[0-9\]* = (<(object|the array) is not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "p varv deassociated"
++gdb_test "ptype varv" "type = (<(object|the array) is not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "ptype varv deassociated"
++gdb_test "p l" "\\$\[0-9\]* = \\.FALSE\\." "p l if varv deassociated"
++gdb_test "p varv(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not associated\\."
++gdb_test "ptype varv(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not associated\\."
++
++gdb_breakpoint [gdb_get_line_number "varx-deallocated"]
++gdb_continue_to_breakpoint "varx-deallocated"
++gdb_test "p varx" "\\$\[0-9\]* = <(object|the array) is not allocated>" "p varx deallocated"
++gdb_test "ptype varx" "type = <(object|the array) is not allocated>" "ptype varx deallocated"
++gdb_test "p l" "\\$\[0-9\]* = \\.FALSE\\." "p l if varx deallocated"
++gdb_test "p varx(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "p varx(1,5,17) deallocated"
++gdb_test "ptype varx(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "ptype varx(1,5,17) deallocated"
++
++gdb_breakpoint [gdb_get_line_number "vary-passed"]
++gdb_continue_to_breakpoint "vary-passed"
++# $1 = (( ( 1, 1, 1, 1, 1, 1) ( 1, 1, 1, 1, 1, 1) --- , 1) ) ( ( 1, 1, ...) ...) ...)
++gdb_test "p vary" "\\$\[0-9\]* = \\(\[()1, .\]*\\)"
++
++gdb_breakpoint [gdb_get_line_number "vary-filled"]
++gdb_continue_to_breakpoint "vary-filled"
++gdb_test "ptype vary" "type = real(\\(kind=4\\)|\\*4) \\(10,10\\)"
++gdb_test "p vary(1, 1)" "\\$\[0-9\]* = 8"
++gdb_test "p vary(2, 2)" "\\$\[0-9\]* = 9"
++gdb_test "p vary(1, 3)" "\\$\[0-9\]* = 10"
++# $1 = (( ( 3, 3, 3, 3, 3, 3) ( 3, 3, 3, 3, 3, 3) --- , 3) ) ( ( 3, 3, ...) ...) ...)
++gdb_test "p varw" "\\$\[0-9\]* = \\(\[()3, .\]*\\)"
++
++gdb_breakpoint [gdb_get_line_number "varw-almostfilled"]
++gdb_continue_to_breakpoint "varw-almostfilled"
++gdb_test "ptype varw" "type = real(\\(kind=4\\)|\\*4) \\(5,4,3\\)"
++gdb_test "p varw(3,1,1)=1" "\\$\[0-9\]* = 1"
++# $1 = (( ( 6, 5, 1, 5, 5, 5) ( 5, 5, 5, 5, 5, 5) --- , 5) ) ( ( 5, 5, ...) ...) ...)
++gdb_test "p varw" "\\$\[0-9\]* = \\( *\\( *\\( *6, *5, *1,\[()5, .\]*\\)" "p varw filled"
++# "up" works with GCC but other Fortran compilers may copy the values into the
++# outer function only on the exit of the inner function.
++# We need both variants as depending on the arch we optionally may still be
++# executing the caller line or not after `finish'.
++gdb_test "finish" ".*(call bar \\(y, x\\)|call foo \\(x, z\\(2:6, 4:7, 6:8\\)\\))"
++gdb_test "p z(2,4,5)" "\\$\[0-9\]* = 3"
++gdb_test "p z(2,4,6)" "\\$\[0-9\]* = 6"
++gdb_test "p z(2,4,7)" "\\$\[0-9\]* = 5"
++gdb_test "p z(4,4,6)" "\\$\[0-9\]* = 1"
++
++gdb_breakpoint [gdb_get_line_number "varz-almostfilled"]
++gdb_continue_to_breakpoint "varz-almostfilled"
++# GCC uses the pointer type here, Intel Fortran Compiler 10.1.008 does not.
++gdb_test "ptype varz" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(\\*\\)\\)?"
++# Intel Fortran Compiler 10.1.008 has a bug here - (2:11,7:7)
++# as it produces DW_AT_lower_bound == DW_AT_upper_bound == 7.
++gdb_test "ptype vart" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(2:11,7:\\*\\)\\)?"
++gdb_test "p varz" "\\$\[0-9\]* = \\(\\)"
++gdb_test "p vart" "\\$\[0-9\]* = \\(\\)"
++gdb_test "p varz(3)" "\\$\[0-9\]* = 4"
++# maps to foo::vary(1,1)
++gdb_test "p vart(2,7)" "\\$\[0-9\]* = 8"
++# maps to foo::vary(2,2)
++gdb_test "p vart(3,8)" "\\$\[0-9\]* = 9"
++# maps to foo::vary(1,3)
++gdb_test "p vart(2,9)" "\\$\[0-9\]* = 10"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/dynamic.f90
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/dynamic.f90  2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,98 @@
++! Copyright 2007 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 2 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program; if not, write to the Free Software
++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++!
++! Ihis file is the Fortran source file for dynamic.exp.
++! Original file written by Jakub Jelinek <jakub@redhat.com>.
++! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
++
++subroutine baz
++  real, target, allocatable :: varx (:, :, :)
++  real, pointer :: varv (:, :, :)
++  real, target :: varu (1, 2, 3)
++  logical :: l
++  allocate (varx (1:6, 5:15, 17:28))            ! varx-init
++  l = allocated (varx)
++  varx(:, :, :) = 6                             ! varx-allocated
++  varx(1, 5, 17) = 7
++  varx(2, 6, 18) = 8
++  varx(6, 15, 28) = 9
++  varv => varx                                  ! varx-filled
++  l = associated (varv)
++  varv(3, 7, 19) = 10                           ! varv-associated
++  varv => null ()                               ! varv-filled
++  l = associated (varv)
++  deallocate (varx)                             ! varv-deassociated
++  l = allocated (varx)
++  varu(:, :, :) = 10                            ! varx-deallocated
++  allocate (varv (1:6, 5:15, 17:28))
++  l = associated (varv)
++  varv(:, :, :) = 6
++  varv(1, 5, 17) = 7
++  varv(2, 6, 18) = 8
++  varv(6, 15, 28) = 9
++  deallocate (varv)
++  l = associated (varv)
++  varv => varu
++  varv(1, 1, 1) = 6
++  varv(1, 2, 3) = 7
++  l = associated (varv)
++end subroutine baz
++subroutine foo (vary, varw)
++  real :: vary (:, :)
++  real :: varw (:, :, :)
++  vary(:, :) = 4                                ! vary-passed
++  vary(1, 1) = 8
++  vary(2, 2) = 9
++  vary(1, 3) = 10
++  varw(:, :, :) = 5                             ! vary-filled
++  varw(1, 1, 1) = 6
++  varw(2, 2, 2) = 7                             ! varw-almostfilled
++end subroutine foo
++subroutine bar (varz, vart)
++  real :: varz (*)
++  real :: vart (2:11, 7:*)
++  varz(1:3) = 4
++  varz(2) = 5                                   ! varz-almostfilled
++  vart(2,7) = vart(2,7)
++end subroutine bar
++program test
++  interface
++    subroutine foo (vary, varw)
++    real :: vary (:, :)
++    real :: varw (:, :, :)
++    end subroutine
++  end interface
++  interface
++    subroutine bar (varz, vart)
++    real :: varz (*)
++    real :: vart (2:11, 7:*)
++    end subroutine
++  end interface
++  real :: x (10, 10), y (5), z(8, 8, 8)
++  x(:,:) = 1
++  y(:) = 2
++  z(:,:,:) = 3
++  call baz
++  call foo (x, z(2:6, 4:7, 6:8))
++  call bar (y, x)
++  if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort
++  if (x (1, 3) .ne. 10) call abort
++  if (z (2, 4, 6) .ne. 6 .or. z (3, 5, 7) .ne. 7 .or. z (2, 4, 7) .ne. 5) call abort
++  if (any (y .ne. (/4, 5, 4, 2, 2/))) call abort
++  call foo (transpose (x), z)
++  if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort
++  if (x (3, 1) .ne. 10) call abort
++end
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/string.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/string.exp   2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,59 @@
++# Copyright 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
++
++# This file is part of the gdb testsuite.  It contains tests for Fortran
++# strings with dynamic length.
++
++set testfile "string"
++set srcfile ${testfile}.f90
++set binfile ${objdir}/${subdir}/${testfile}
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] != "" } {
++    untested "Couldn't compile ${srcfile}"
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++if ![runto MAIN__] then {
++    perror "couldn't run to breakpoint MAIN__"
++    continue
++}
++
++gdb_breakpoint [gdb_get_line_number "var-init"]
++gdb_continue_to_breakpoint "var-init"
++gdb_test "ptype c" "type = character(\\(kind=1\\)|\\*1)"
++gdb_test "ptype d" "type = character(\\(kind=8\\)|\\*8)"
++gdb_test "ptype e" "type = character(\\(kind=4\\)|\\*4)"
++gdb_test "ptype f" "type = character(\\(kind=4\\)|\\*4) \\(7,8:10\\)"
++gdb_test "ptype *e" "Attempt to take contents of a non-pointer value."
++gdb_test "ptype *f" "type = character(\\(kind=4\\)|\\*4) \\(7\\)"
++gdb_test "p c" "\\$\[0-9\]* = 'c'"
++gdb_test "p d" "\\$\[0-9\]* = 'd       '"
++gdb_test "p e" "\\$\[0-9\]* = 'g   '"
++gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'h   ', 'h   ', 'h   ', 'h   ', 'h   ', 'h   ', 'h   '\\) \\( 'h   ', 'h   ', 'h   ', 'h   ', 'h   ', 'h   ', 'h   '\\) \\( 'h   ', 'h   ', 'h   ', 'h   ', 'h   ', 'h   ', 'h   '\\) \\)"
++gdb_test "p *e" "Attempt to take contents of a non-pointer value."
++gdb_test "p *f" "Attempt to take contents of a non-pointer value."
++
++gdb_breakpoint [gdb_get_line_number "var-finish"]
++gdb_continue_to_breakpoint "var-finish"
++gdb_test "p e" "\\$\[0-9\]* = 'e   '" "p e re-set"
++gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'f   ', 'f   ', 'f   ', 'f   ', 'f   ', 'f   ', 'f   '\\) \\( 'f2  ', 'f   ', 'f   ', 'f   ', 'f   ', 'f   ', 'f   '\\) \\( 'f   ', 'f   ', 'f   ', 'f   ', 'f   ', 'f   ', 'f   '\\) \\)" "p *f re-set"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/string.f90
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/string.f90   2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,37 @@
++! Copyright 2008 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 2 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program; if not, write to the Free Software
++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++!
++! Ihis file is the Fortran source file for dynamic.exp.
++! Original file written by Jakub Jelinek <jakub@redhat.com>.
++! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
++
++subroutine foo (e, f)
++  character (len=1) :: c
++  character (len=8) :: d
++  character (len=*) :: e
++  character (len=*) :: f (1:7, 8:10)
++  c = 'c'
++  d = 'd'
++  e = 'e'                                       ! var-init
++  f = 'f'
++  f(1,9) = 'f2'
++  c = 'c'                                       ! var-finish
++end subroutine foo
++  character (len=4) :: g, h (1:7, 8:10)
++  g = 'g'
++  h = 'h'
++  call foo (g, h)
++end
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/subrange.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/subrange.exp 2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,60 @@
++# Copyright 2011 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++if { [skip_fortran_tests] } { return -1 }
++
++set testfile "subrange"
++set srcfile ${testfile}.f90
++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } {
++    return -1
++}
++
++if ![runto MAIN__] {
++    perror "Couldn't run to MAIN__"
++    continue
++}
++
++# Depending on the compiler version being used, the name of the 4-byte integer
++# and real types can be printed differently.  For instance, gfortran-4.1 uses
++# "int4" whereas gfortran-4.3 uses "int(kind=4)".
++set int4 "(int4|integer\\(kind=4\\))"
++
++gdb_breakpoint [gdb_get_line_number "break-static"]
++gdb_continue_to_breakpoint "break-static" ".*break-static.*"
++
++foreach var {a alloc ptr} {
++    global pf_prefix
++    set old_prefix $pf_prefix
++    lappend pf_prefix "$var:"
++
++    gdb_test "p $var (2, 2:3)" { = \(22, 32\)}
++    gdb_test "p $var (2:3, 3)" { = \(32, 33\)}
++    gdb_test "p $var (1, 2:)" { = \(21, 31\)}
++    gdb_test "p $var (2, :2)" { = \(12, 22\)}
++    gdb_test "p $var (3, 2:2)" { = \(23\)}
++    gdb_test "ptype $var (3, 2:2)" " = $int4 \\(2:2\\)"
++    gdb_test "p $var (4, :)" { = \(14, 24, 34\)}
++    gdb_test "p $var (:, :)" { = \(\( *11, 12, 13, 14\) \( *21, 22, 23, 24\) \( *31, 32, 33, 34\) *\)}
++    gdb_test "ptype $var (:, :)" " = $int4 \\(4,3\\)"
++    gdb_test "p $var (:)" "Wrong number of subscripts"
++    gdb_test "p $var (:, :, :)" "Wrong number of subscripts"
++
++    set pf_prefix $old_prefix
++}
++
++gdb_test_no_output {set $a=a}
++delete_breakpoints
++gdb_unload
++gdb_test {p $a (3, 2:2)} { = \(23\)}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/subrange.f90
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/subrange.f90 2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,28 @@
++! Copyright 2011 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 3 of the License, or
++! (at your option) any later version.
++! 
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++! GNU General Public License for more details.
++! 
++! You should have received a copy of the GNU General Public License
++! along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++program test
++  integer, target :: a (4, 3)
++  integer, allocatable :: alloc (:, :)
++  integer, pointer :: ptr (:, :)
++  do 1 i = 1, 4
++  do 1 j = 1, 3
++    a (i, j) = j * 10 + i
++1 continue
++  allocate (alloc (4, 3))
++  alloc = a
++  ptr => a
++  write (*,*) a                 ! break-static
++end
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.gdb/selftest.exp
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/testsuite/gdb.gdb/selftest.exp        2011-07-29 22:52:00.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.gdb/selftest.exp     2011-07-29 22:52:02.000000000 +0200
+@@ -92,6 +92,10 @@ proc do_steps_and_nexts {} {
+               set description "step over ttyarg initialization"
+               set command "step"
+           }
++          -re ".*python_script = 0.*$gdb_prompt $" {
++              set description "step over python_script initialization"
++              set command "step"
++          }
+           -re ".*pre_stat_chain = make_command_stats_cleanup.*$gdb_prompt $" {
+               set description "next over make_command_stats_cleanup and everything it calls"
+               set command "next"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi2-var-stale-type.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi2-var-stale-type.c      2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,26 @@
++/* Copyright 2011 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++int
++main (int argc, char **argv)
++{
++  char vla[argc];
++
++  vla[0] = 0; /* break-here */
++
++  return 0;
++}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp    2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,57 @@
++# Copyright 2011 Free Software Foundation, Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++load_lib mi-support.exp
++set MIFLAGS "-i=mi2"
++
++gdb_exit
++if [mi_gdb_start] {
++    continue
++}
++
++set testfile "mi2-var-stale-type"
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++if {[build_executable ${testfile}.exp $testfile $srcfile] == -1} {
++    return -1
++}
++
++mi_delete_breakpoints
++mi_gdb_reinitialize_dir $srcdir/$subdir
++mi_gdb_load ${binfile}
++
++mi_gdb_test {-interpreter-exec console "maintenance set internal-error quit yes"} \
++  {\^done} \
++  "maintenance set internal-error quit yes"
++
++mi_gdb_test {-interpreter-exec console "maintenance set internal-error corefile yes"} \
++  {\^done} \
++  "maintenance set internal-error corefile yes"
++
++set line [gdb_get_line_number "break-here"]
++set func "main"
++
++mi_gdb_test "-break-insert -t $srcfile:$line" \
++  "\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",line=\"$line\",times=\"0\",original-location=\".*\"\}" \
++  "breakpoint at $func"
++
++if { [mi_run_cmd] < 0 } {
++    return -1
++}
++mi_expect_stop "breakpoint-hit" $func ".*" ".*" "\[0-9\]+" { "" "disp=\"del\"" } "stop after initializing vla"
++
++mi_create_varobj "vla" "vla" "create local variable vla"
++
++mi_gdb_test "-var-update *" "\\^done,changelist=.*" "-var-update *"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.multi/watchpoint-multi.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.multi/watchpoint-multi.c     2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,59 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2010 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#include <pthread.h>
++#include <assert.h>
++
++static volatile int a, b, c;
++
++static void
++marker_exit1 (void)
++{
++  a = 1;
++}
++
++/* Workaround PR breakpoints/12272 by two different breakpoint locations.  */
++static void
++marker_exit2 (void)
++{
++  a = 1;
++}
++
++static void *
++start (void *arg)
++{
++  b = 2;
++  c = 3;
++
++  return NULL;
++}
++
++int
++main (void)
++{
++  pthread_t thread;
++  int i;
++
++  i = pthread_create (&thread, NULL, start, NULL);
++  assert (i == 0);
++  i = pthread_join (thread, NULL);
++  assert (i == 0);
++
++  marker_exit1 ();
++  marker_exit2 ();
++  return 0;
++}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.multi/watchpoint-multi.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.multi/watchpoint-multi.exp   2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,113 @@
++# Copyright 2010 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++if { [is_remote target] || ![isnative] } then {
++    continue
++}
++
++set testfile "watchpoint-multi"
++
++set executable ${testfile}
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${executable}
++
++if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    untested ${testfile}.exp
++    return -1
++}
++
++clean_restart $executable
++
++if ![runto_main] {
++    return
++}
++# Never keep/use any non-hw breakpoints to workaround a multi-inferior bug.
++delete_breakpoints
++
++gdb_test "add-inferior" "Added inferior 2"
++gdb_test "inferior 2" "witching to inferior 2 .*"
++gdb_load $binfile
++
++if ![runto_main] {
++    return
++}
++delete_breakpoints
++
++# Simulate non-stop+target-async which also uses breakpoint always-inserted.
++gdb_test_no_output "set breakpoint always-inserted on"
++# displaced-stepping is also needed as other GDB sometimes still removes the
++# breakpoints, even with always-inserted on.
++gdb_test_no_output "set displaced-stepping on"
++
++# Debugging of this testcase:
++#gdb_test_no_output "maintenance set show-debug-regs on"
++#gdb_test_no_output "set debug infrun 1"
++
++# Do not use simple hardware watchpoint ("watch") as its false hit may be
++# unnoticed by GDB if it reads it still has the same value.
++gdb_test "awatch c" "Hardware access \\(read/write\\) watchpoint \[0-9\]+: c"
++# Never keep/use any non-hw breakpoints to workaround a multi-inferior bug.
++# Use `*' to workaround a multi-inferior bug.
++set test "hbreak *marker_exit2"
++gdb_test_multiple $test $test {
++    -re "Hardware assisted breakpoint \[0-9\]+ at .*\r\n$gdb_prompt $" {
++      pass $test
++    }
++    -re "(No hardware breakpoint support in the target\\.|Hardware breakpoints used exceeds limit\\.)\r\n$gdb_prompt $" {
++      pass $test
++      untested ${testfile}.exp
++      return
++    }
++}
++
++gdb_test "inferior 1" "witching to inferior 1 .*"
++
++gdb_test "awatch b" "Hardware access \\(read/write\\) watchpoint \[0-9\]+: b"
++gdb_test "hbreak *marker_exit1" {Hardware assisted breakpoint [0-9]+ at .*}
++
++gdb_test "inferior 2" "witching to inferior 2 .*"
++
++# FAIL would be a hit on watchpoint for `b' - that one is for the other
++# inferior.
++gdb_test "continue" "Hardware access \\(read/write\\) watchpoint \[0-9\]+: c\r\n\r\nOld value = 0\r\nNew value = 3\r\n.*" "catch c"
++
++set test "catch marker_exit2"
++gdb_test_multiple "continue" $test {
++    -re "Breakpoint \[0-9\]+, marker_exit2 .*\r\n$gdb_prompt $" {
++      setup_kfail breakpoints/12312 *-*-*
++      pass $test
++    }
++    -re "Hardware access \\(read/write\\) watchpoint \[0-9\]+: c\r\n\r\nValue = 3\r\n(.* in )?\\*?(__GI_)?__nptl_death_event .*\r\n$gdb_prompt $" {
++      setup_kfail breakpoints/12312 *-*-*
++      fail $test
++    }
++}
++
++gdb_test "inferior 1" "witching to inferior 1 .*"
++
++gdb_test "continue" "Hardware access \\(read/write\\) watchpoint \[0-9\]+: b\r\n\r\nOld value = 0\r\nNew value = 2\r\n.*" "catch b"
++
++set test "catch marker_exit1"
++gdb_test_multiple "continue" $test {
++    -re "Breakpoint \[0-9\]+, marker_exit1 .*\r\n$gdb_prompt $" {
++      setup_kfail breakpoints/12312 *-*-*
++      pass $test
++    }
++    -re "Hardware access \\(read/write\\) watchpoint \[0-9\]+: b\r\n\r\nValue = 2\r\n(.* in )?\\*?(__GI_)?__nptl_death_event .*\r\n$gdb_prompt $" {
++      setup_kfail breakpoints/12312 *-*-*
++      fail $test
++    }
++}
++
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.opt/array-from-register-func.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.opt/array-from-register-func.c       2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,22 @@
++/* This file is part of GDB, the GNU debugger.
++
++   Copyright 2009 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++int
++func (int *arr)
++{
++  return arr[0];
++}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.opt/array-from-register.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.opt/array-from-register.c    2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,28 @@
++/* This file is part of GDB, the GNU debugger.
++
++   Copyright 2009 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++extern int func (int *arr);
++
++int
++main (void)
++{
++  int arr[] = { 42 };
++
++  func (arr);
++
++  return 0;
++}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.opt/array-from-register.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.opt/array-from-register.exp  2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,33 @@
++# Copyright 2009 Free Software Foundation, Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++#
++# This file is part of the gdb testsuite.
++
++if { [prepare_for_testing array-from-register.exp "array-from-register"      \
++                        {array-from-register.c array-from-register-func.c} \
++                        {debug optimize=-O2}] } {
++    return -1
++}
++
++if ![runto func] then {
++    return -1
++}
++
++gdb_test "p arr" "\\$\[0-9\]+ = \\(int \\*\\) *0x\[0-9a-f\]+"
++
++# Seen regression:
++# Address requested for identifier "arr" which is in register $rdi
++gdb_test "p arr\[0\]" "\\$\[0-9\]+ = 42"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.pascal/arrays.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.pascal/arrays.exp    2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,104 @@
++# Copyright 2008, 2009 Free Software Foundation, Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++if $tracelevel then {
++    strace $tracelevel
++}
++
++load_lib "pascal.exp"
++
++set testfile "arrays"
++set srcfile ${testfile}.pas
++set binfile ${objdir}/${subdir}/${testfile}$EXEEXT
++
++# These tests only work with fpc, using the -gw3 compile-option
++pascal_init
++if { $pascal_compiler_is_fpc != 1 } {
++  return -1
++}
++
++# Detect if the fpc version is below 2.3.0
++set fpc_generates_dwarf_for_dynamic_arrays 1
++if { ($fpcversion_major < 2) || ( ($fpcversion_major == 2) && ($fpcversion_minor < 3))}  {
++  set fpc_generates_dwarf_for_dynamic_arrays 0
++}
++
++
++if {[gdb_compile_pascal "-gw3 ${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ]] != "" } {
++  return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
++set bp_location2 [gdb_get_line_number "set breakpoint 2 here"]
++
++
++if { [gdb_breakpoint ${srcfile}:${bp_location1}] } {
++    pass "setting breakpoint 1"
++}
++if { [gdb_breakpoint ${srcfile}:${bp_location2}] } {
++    pass "setting breakpoint 2"
++}
++
++# Verify that "start" lands inside the right procedure.
++if { [gdb_start_cmd] < 0 } {
++    untested start
++    return -1
++}
++
++gdb_test "" ".* at .*${srcfile}.*" "start"
++
++gdb_test "cont" "Breakpoint .*:${bp_location1}.*" "Going to first breakpoint"
++
++gdb_test "print StatArrInt" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61\\}" "Print static array of integer type"
++gdb_test "print StatArrInt_" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61\\}" "Print static array of integer"
++
++gdb_test "cont" "Breakpoint .*:${bp_location2}.*" "Going to second breakpoint"
++
++gdb_test "print StatArrChar" ".* = 'abcdefghijkl'" "Print static array of char"
++gdb_test "print Stat2dArrInt" ".* = \\{\\{0, 1, 2, 3, 4\\}, \\{1, 2, 3, 4, 5\\}, \\{2, 3, 4, 5, 6\\}, \\{3, 4, 5, 6, 7\\}, \\{4, 5, 6, 7, 8\\}, \\{5, 6, 7, 8, 9\\}, \\{6, 7, 8, 9, 10\\}, \\{7, 8, 9, 10, 11\\}, \\{8, 9, 10, 11, 12\\}, \\{9, 10, 11, 12, 13\\}, \\{10, 11, 12, 13, 14\\}, \\{11, 12, 13, 14, 15\\}\\}" "Print static 2-dimensional array of integer"
++
++if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
++  setup_xfail "*-*-*"
++}
++gdb_test "print DynArrInt" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62\\}" "Print dynamic array of integer type"
++if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
++  setup_xfail "*-*-*"
++}
++gdb_test "print DynArrInt_" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62\\}" "Print dynamic array of integer"
++
++if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
++  setup_xfail "*-*-*"
++}
++gdb_test "print s" ".* = 'test'#0'string'" "Print string containing null-char"
++
++if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
++  setup_xfail "*-*-*"
++}
++gdb_test "print DynArrStr" ".* = \\{'dstr0', 'dstr1', 'dstr2', 'dstr3', 'dstr4', 'dstr5', 'dstr6', 'dstr7', 'dstr8', 'dstr9', 'dstr10', 'dstr11', 'dstr12'\\}" "Print dynamic array of string"
++
++if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
++  setup_xfail "*-*-*"
++}
++gdb_test "print StatArrStr" ".* = \\{'str0', 'str1', 'str2', 'str3', 'str4', 'str5', 'str6', 'str7', 'str8', 'str9', 'str10', 'str11', 'str12'\\}" "Print static array of string"
++
++if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
++  setup_xfail "*-*-*"
++}
++gdb_test "print DynArrChar" ".* = 'abcdefghijklm'" "Print dynamic array of char"
++
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.pascal/arrays.pas
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.pascal/arrays.pas    2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,82 @@
++{
++ Copyright 2008, 2009 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program.  If not, see <http://www.gnu.org/licenses/>.
++}
++
++program arrays;
++
++{$mode objfpc}{$h+}
++
++uses sysutils;
++
++type TStatArrInt= array[0..11] of integer;
++     TDynArrInt= array of integer;
++     TStatArrStr= array[0..12] of string;
++     TDynArrStr= array of string;
++     TDynArrChar = array of char;
++     TStatArrChar = array [0..11] of char;
++
++     TStat2dArrInt = array[0..11,0..4] of integer;
++
++var StatArrInt: TStatArrInt;
++    StatArrInt_: Array[0..11] of integer;
++    DynArrInt:  TDynArrInt;
++    DynArrInt_: Array of integer;
++    StatArrStr: TStatArrStr;
++    DynArrStr: TDynArrStr;
++    StatArrChar: TStatArrChar;
++    DynArrChar: TDynArrChar;
++
++    Stat2dArrInt: TStat2dArrInt;
++
++    s: string;
++      
++    i,j : integer;
++
++begin
++  for i := 0 to 11 do
++    begin
++    StatArrInt[i]:= i+50;
++    StatArrInt_[i]:= i+50;
++    StatArrChar[i]:= chr(ord('a')+i);
++    for j := 0 to 4 do
++      Stat2dArrInt[i,j]:=i+j;
++    end;
++  writeln(StatArrInt_[0]);
++  writeln(StatArrInt[0]); { set breakpoint 1 here }
++  writeln(StatArrChar[0]);
++  writeln(Stat2dArrInt[0,0]);
++
++  setlength(DynArrInt,13);
++  setlength(DynArrInt_,13);
++  setlength(DynArrStr,13);
++  setlength(DynArrChar,13);
++  for i := 0 to 12 do
++    begin
++    DynArrInt[i]:= i+50;
++    DynArrInt_[i]:= i+50;
++    DynArrChar[i]:= chr(ord('a')+i);
++    StatArrStr[i]:='str'+inttostr(i);
++    DynArrStr[i]:='dstr'+inttostr(i);
++    end;
++  writeln(DynArrInt_[1]);
++  writeln(DynArrInt[1]); 
++  writeln(DynArrStr[1]); 
++  writeln(StatArrStr[1]);
++  writeln(DynArrChar[1]);
++
++  s := 'test'#0'string';
++  writeln(s); { set breakpoint 2 here }
++end.
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.python/py-frame.exp
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/testsuite/gdb.python/py-frame.exp     2011-02-26 15:06:28.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.python/py-frame.exp  2011-07-29 22:52:02.000000000 +0200
+@@ -78,8 +78,6 @@ gdb_test "python print bframe == gdb.new
+ gdb_test "python print 'result =', f0 == f1" " = False" "test equality comparison (false)"
+ gdb_test "python print 'result =', f0 == f0" " = True" "test equality comparison (true)"
+-gdb_test "python print 'result =', f0 != f1" " = True" "test inequality comparison (true)"
+-gdb_test "python print 'result =', f0 != f0" " = False" "test inequality comparison (false)"
+ gdb_test "python print 'result =', f0.is_valid ()" " = True" "test Frame.is_valid"
+ gdb_test "python print 'result =', f0.name ()" " = f2" "test Frame.name"
+ gdb_test "python print 'result =', f0.type () == gdb.NORMAL_FRAME" " = True" "test Frame.type"
+@@ -94,3 +92,5 @@ gdb_test "python print 'result =', f0.re
+ gdb_test "python print 'result =', f0.read_var ('a')" " = 1" "test Frame.read_var - success"
+ gdb_test "python print 'result =', gdb.selected_frame () == f1" " = True" "test gdb.selected_frame"
++
++gdb_test "python print 'result =', f0.block ()" "<gdb.Block object at 0x\[\[:xdigit:\]\]+>" "test Frame.block"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.python/py-value.exp
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/testsuite/gdb.python/py-value.exp     2011-04-24 11:04:38.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.python/py-value.exp  2011-07-29 22:52:02.000000000 +0200
+@@ -319,6 +319,15 @@ proc test_value_after_death {} {
+     "print value's type"
+ }
++# Regression test for a cast failure.  The bug was that if we cast a
++# value to its own type, gdb could crash.  This happened because we
++# could end up double-freeing a struct value.
++proc test_cast_regression {} {
++  gdb_test "python v = gdb.Value(5)" "" "create value for cast test"
++  gdb_test "python v = v.cast(v.type)" "" "cast value for cast test"
++  gdb_test "python print v" "5" "print value for cast test"
++}
++
+ # Regression test for invalid subscript operations.  The bug was that
+ # the type of the value was not being checked before allowing a
+ # subscript operation to proceed.
+@@ -456,6 +465,7 @@ test_value_in_inferior
+ test_inferior_function_call
+ test_lazy_strings
+ test_value_after_death
++test_cast_regression
+ # The following test recompiles the binary to test either C or C++
+ # values. 
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.threads/watchpoint-fork-child.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.threads/watchpoint-fork-child.c      2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,127 @@
++/* Test case for forgotten hw-watchpoints after fork()-off of a process.
++
++   Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <string.h>
++#include <errno.h>
++#include <unistd.h>
++#include <assert.h>
++#include <signal.h>
++#include <stdio.h>
++
++#include "watchpoint-fork.h"
++
++static volatile int usr1_got;
++
++static void
++handler_usr1 (int signo)
++{
++  usr1_got++;
++}
++
++void
++forkoff (int nr)
++{
++  pid_t child, save_parent = getpid ();
++  int i;
++  struct sigaction act, oldact;
++#ifdef THREAD
++  void *thread_result;
++#endif
++
++  memset (&act, 0, sizeof act);
++  act.sa_flags = SA_RESTART;
++  act.sa_handler = handler_usr1;
++  sigemptyset (&act.sa_mask);
++  i = sigaction (SIGUSR1, &act, &oldact);
++  assert (i == 0);
++
++  child = fork ();
++  switch (child)
++    {
++    case -1:
++      assert (0);
++    default:
++      printf ("parent%d: %d\n", nr, (int) child);
++
++      /* Sleep for a while to possibly get incorrectly ATTACH_THREADed by GDB
++       tracing the child fork with no longer valid thread/lwp entries of the
++       parent.  */
++
++      i = sleep (2);
++      assert (i == 0);
++
++      /* We must not get caught here (against a forgotten breakpoint).  */
++
++      var++;
++      marker ();
++
++#ifdef THREAD
++      /* And neither got caught our thread.  */
++
++      step = 99;
++      i = pthread_join (thread, &thread_result);
++      assert (i == 0);
++      assert (thread_result == (void *) 99UL);
++#endif
++
++      /* Be sure our child knows we did not get caught above.  */
++
++      i = kill (child, SIGUSR1);
++      assert (i == 0);
++
++      /* Sleep for a while to check GDB's `info threads' no longer tracks us in
++       the child fork.  */
++
++      i = sleep (2);
++      assert (i == 0);
++
++      _exit (0);
++    case 0:
++      printf ("child%d: %d\n", nr, (int) getpid ());
++
++      /* Let the parent signal us about its success.  Be careful of races.  */
++
++      for (;;)
++      {
++        /* Parent either died (and USR1_GOT is zero) or it succeeded.  */
++        if (getppid () != save_parent)
++          break;
++        if (kill (getppid (), 0) != 0)
++          break;
++        /* Parent succeeded?  */
++        if (usr1_got)
++          break;
++
++#ifdef THREAD
++        i = pthread_yield ();
++        assert (i == 0);
++#endif
++      }
++      assert (usr1_got);
++
++      /* We must get caught here (against a false watchpoint removal).  */
++
++      marker ();
++    }
++
++  i = sigaction (SIGUSR1, &oldact, NULL);
++  assert (i == 0);
++}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c 2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,174 @@
++/* Test case for forgotten hw-watchpoints after fork()-off of a process.
++
++   Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <assert.h>
++#include <unistd.h>
++#include <sys/wait.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <pthread.h>
++
++#include <asm/unistd.h>
++#include <unistd.h>
++#define gettid() syscall (__NR_gettid)
++
++#include "watchpoint-fork.h"
++
++/* Non-atomic `var++' should not hurt as we synchronize the threads by the STEP
++   variable.  Hit-comments need to be duplicite there to catch both at-stops
++   and behind-stops, depending on the target.  */
++
++volatile int var;
++
++void
++marker (void)
++{
++}
++
++static void
++empty (void)
++{
++}
++
++static void
++mark_exit (void)
++{
++}
++
++pthread_t thread;
++volatile int step;
++
++static void *
++start (void *arg)
++{
++  int i;
++
++  if (step >= 3)
++    goto step_3;
++
++  while (step != 1)
++    {
++      i = pthread_yield ();
++      assert (i == 0);
++    }
++
++  var++;      /* validity-thread-B */
++  empty ();   /* validity-thread-B */
++  step = 2;
++  while (step != 3)
++    {
++      if (step == 99)
++      goto step_99;
++
++      i = pthread_yield ();
++      assert (i == 0);
++    }
++
++step_3:
++  if (step >= 5)
++    goto step_5;
++
++  var++;      /* after-fork1-B */
++  empty ();   /* after-fork1-B */
++  step = 4;
++  while (step != 5)
++    {
++      if (step == 99)
++      goto step_99;
++
++      i = pthread_yield ();
++      assert (i == 0);
++    }
++
++step_5:
++  var++;      /* after-fork2-B */
++  empty ();   /* after-fork2-B */
++  return (void *) 5UL;
++
++step_99:
++  /* We must not get caught here (against a forgotten breakpoint).  */
++  var++;
++  marker ();
++  return (void *) 99UL;
++}
++
++int
++main (void)
++{
++  int i;
++  void *thread_result;
++
++  setbuf (stdout, NULL);
++  printf ("main: %d\n", (int) gettid ());
++
++  /* General hardware breakpoints and watchpoints validity.  */
++  marker ();
++  var++;      /* validity-first */
++  empty ();   /* validity-first */
++
++  i = pthread_create (&thread, NULL, start, NULL);
++  assert (i == 0);
++
++  var++;      /* validity-thread-A */
++  empty ();   /* validity-thread-A */
++  step = 1;
++  while (step != 2)
++    {
++      i = pthread_yield ();
++      assert (i == 0);
++    }
++
++  /* Hardware watchpoints got disarmed here.  */
++  forkoff (1);
++
++  var++;      /* after-fork1-A */
++  empty ();   /* after-fork1-A */
++  step = 3;
++#ifdef FOLLOW_CHILD
++  /* Spawn new thread as it was deleted in the child of FORK.  */
++  i = pthread_create (&thread, NULL, start, NULL);
++  assert (i == 0);
++#endif
++  while (step != 4)
++    {
++      i = pthread_yield ();
++      assert (i == 0);
++    }
++
++  /* A sanity check for double hardware watchpoints removal.  */
++  forkoff (2);
++
++  var++;      /* after-fork2-A */
++  empty ();   /* after-fork2-A */
++  step = 5;
++#ifdef FOLLOW_CHILD
++  /* Spawn new thread as it was deleted in the child of FORK.  */
++  i = pthread_create (&thread, NULL, start, NULL);
++  assert (i == 0);
++#endif
++
++  i = pthread_join (thread, &thread_result);
++  assert (i == 0);
++  assert (thread_result == (void *) 5UL);
++
++  mark_exit ();
++  return 0;
++}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.threads/watchpoint-fork-parent.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.threads/watchpoint-fork-parent.c     2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,74 @@
++/* Test case for forgotten hw-watchpoints after fork()-off of a process.
++
++   Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <string.h>
++#include <errno.h>
++#include <sys/types.h>
++#include <unistd.h>
++#include <assert.h>
++#include <stdio.h>
++#include <sys/wait.h>
++
++#include "watchpoint-fork.h"
++
++void
++forkoff (int nr)
++{
++  pid_t child, pid_got;
++  int exit_code = 42 + nr;
++  int status, i;
++
++  child = fork ();
++  switch (child)
++    {
++    case -1:
++      assert (0);
++    case 0:
++      printf ("child%d: %d\n", nr, (int) getpid ());
++      /* Delay to get both the "child%d" and "parent%d" message printed without
++       a race breaking expect by its endless wait on `$gdb_prompt$':
++       Breakpoint 3, marker () at ../../../gdb/testsuite/gdb.threads/watchpoint-fork.c:33
++       33      }
++       (gdb) parent2: 14223  */
++      i = sleep (1);
++      assert (i == 0);
++
++      /* We must not get caught here (against a forgotten breakpoint).  */
++      var++;
++      marker ();
++
++      _exit (exit_code);
++    default:
++      printf ("parent%d: %d\n", nr, (int) child);
++      /* Delay to get both the "child%d" and "parent%d" message printed, see
++       above.  */
++      i = sleep (1);
++      assert (i == 0);
++
++      pid_got = wait (&status);
++      assert (pid_got == child);
++      assert (WIFEXITED (status));
++      assert (WEXITSTATUS (status) == exit_code);
++
++      /* We must get caught here (against a false watchpoint removal).  */
++      marker ();
++    }
++}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.threads/watchpoint-fork-st.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.threads/watchpoint-fork-st.c 2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,61 @@
++/* Test case for forgotten hw-watchpoints after fork()-off of a process.
++
++   Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <assert.h>
++#include <unistd.h>
++#include <sys/wait.h>
++#include <stdio.h>
++#include <stdlib.h>
++
++#include "watchpoint-fork.h"
++
++volatile int var;
++
++void
++marker (void)
++{
++}
++
++static void
++mark_exit (void)
++{
++}
++
++int
++main (void)
++{
++  setbuf (stdout, NULL);
++  printf ("main: %d\n", (int) getpid ());
++
++  /* General hardware breakpoints and watchpoints validity.  */
++  marker ();
++  var++;
++  /* Hardware watchpoints got disarmed here.  */
++  forkoff (1);
++  /* This watchpoint got lost before.  */
++  var++;
++  /* A sanity check for double hardware watchpoints removal.  */
++  forkoff (2);
++  var++;
++
++  mark_exit ();
++  return 0;
++}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.threads/watchpoint-fork.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.threads/watchpoint-fork.exp  2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,149 @@
++# Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++# Test case for forgotten hw-watchpoints after fork()-off of a process.
++
++proc test {type symbol} {
++    global objdir subdir srcdir gdb_prompt
++
++    set testfile watchpoint-fork
++
++    global pf_prefix
++    set prefix_test $pf_prefix
++    lappend pf_prefix "$type:"
++    set prefix_mt $pf_prefix
++
++    set srcfile_type ${srcdir}/${subdir}/${testfile}-${type}.c
++
++
++    # no threads
++
++    set pf_prefix $prefix_mt
++    lappend pf_prefix "singlethreaded:"
++
++    set executable ${testfile}-${type}-st
++    set srcfile_main ${srcdir}/${subdir}/${testfile}-st.c
++    if { [gdb_compile "${srcfile_main} ${srcfile_type}" ${objdir}/${subdir}/${executable} executable [list debug additional_flags=-D$symbol]] != "" } {
++      untested ${testfile}.exp
++      return
++    }
++    clean_restart $executable
++
++    gdb_test "show detach-on-fork" "Whether gdb will detach the child of a fork is on\\."
++    gdb_test_no_output "set follow-fork-mode $type"
++    gdb_test "show follow-fork-mode" "Debugger response to a program call of fork or vfork is \"$type\"\\."
++    # Testcase uses it for the `follow-fork-mode child' type.
++    gdb_test "handle SIGUSR1 nostop noprint pass" "No\[ \t\]+No\[ \t\]+Yes.*"
++
++    if ![runto_main] {
++      return
++    }
++
++    gdb_test "watch var" "atchpoint \[0-9\]+: var" "Set the watchpoint"
++
++    # It is never hit but it should not be left over in the fork()ed-off child.
++    set hbreak "hbreak"
++    set test "hbreak marker"
++    gdb_test_multiple $test $test {
++      -re "Hardware assisted breakpoint \[0-9\]+ at .*\r\n$gdb_prompt $" {
++          pass $test
++      }
++      -re "(No hardware breakpoint support in the target\\.|Hardware breakpoints used exceeds limit\\.)\r\n$gdb_prompt $" {
++          pass $test
++          set hbreak "break"
++          gdb_test "break marker"
++      }
++    }
++
++    gdb_breakpoint "mark_exit"
++
++    gdb_test "continue" \
++           "reakpoint \[0-9\]+, marker.*" "hardware breakpoints work"
++    gdb_test "continue" \
++           "atchpoint \[0-9\]+: var.*Old value = 0.*New value = 1.*forkoff *\\(1\\).*" "watchpoints work"
++    gdb_test "continue" \
++           "reakpoint \[0-9\]+, marker.*" "breakpoint after the first fork"
++    gdb_test "continue" \
++           "atchpoint \[0-9\]+: var.*Old value = 1.*New value = 2.*forkoff *\\(2\\).*" "watchpoint after the first fork"
++    gdb_test "continue" \
++           "reakpoint \[0-9\]+, marker.*" "breakpoint after the second fork"
++    gdb_test "continue" \
++           "atchpoint \[0-9\]+: var.*Old value = 2.*New value = 3.*mark_exit \\(\\);" "watchpoint after the second fork"
++    gdb_test "continue" "Continuing\\..*\r\nBreakpoint \[0-9\]+, mark_exit .*" "finish"
++
++
++    # threads
++
++    set pf_prefix $prefix_mt
++    lappend pf_prefix "multithreaded:"
++
++    set executable ${testfile}-${type}-mt
++    set srcfile_main ${srcdir}/${subdir}/${testfile}-mt.c
++    if { [gdb_compile_pthreads "${srcfile_main} ${srcfile_type}" ${objdir}/${subdir}/${executable} executable [list debug "additional_flags=-D$symbol -DTHREAD"]] != "" } {
++      untested ${testfile}.exp
++      return
++    }
++    clean_restart $executable
++
++    gdb_test_no_output "set follow-fork-mode $type"
++    # Testcase uses it for the `follow-fork-mode child' type.
++    gdb_test "handle SIGUSR1 nostop noprint pass" "No\[ \t\]+No\[ \t\]+Yes.*"
++
++    if ![runto_main] {
++      return
++    }
++
++    gdb_test "watch var" "atchpoint \[0-9\]+: var" "Set the watchpoint"
++
++    # It should not be left over in the fork()ed-off child.
++    gdb_test "$hbreak marker" {reakpoint [0-9]+.*}
++
++    gdb_breakpoint "mark_exit"
++
++    gdb_test "continue" \
++           "reakpoint \[0-9\]+, marker.*" "hardware breakpoints work"
++    gdb_test "continue" \
++           "atchpoint \[0-9\]+: var.*Old value = 0.*New value = 1.*validity-first.*" "singlethread watchpoints work"
++    gdb_test "continue" \
++           "atchpoint \[0-9\]+: var.*Old value = 1.*New value = 2.*validity-thread-A.*" "multithreaded watchpoints work at A"
++    gdb_test "continue" \
++           "atchpoint \[0-9\]+: var.*Old value = 2.*New value = 3.*validity-thread-B.*" "multithreaded watchpoints work at B"
++    gdb_test "continue" \
++           "reakpoint \[0-9\]+, marker.*" "breakpoint (A) after the first fork"
++    gdb_test "continue" \
++           "atchpoint \[0-9\]+: var.*Old value = 3.*New value = 4.*after-fork1-A.*" "watchpoint A after the first fork"
++    gdb_test "continue" \
++           "atchpoint \[0-9\]+: var.*Old value = 4.*New value = 5.*after-fork1-B.*" "watchpoint B after the first fork"
++    gdb_test "continue" \
++           "reakpoint \[0-9\]+, marker.*" "breakpoint (A) after the second fork"
++    gdb_test "continue" \
++           "atchpoint \[0-9\]+: var.*Old value = 5.*New value = 6.*after-fork2-A.*" "watchpoint A after the second fork"
++    gdb_test "continue" \
++           "atchpoint \[0-9\]+: var.*Old value = 6.*New value = 7.*after-fork2-B.*" "watchpoint B after the second fork"
++    gdb_test "continue" "Continuing\\..*\r\nBreakpoint \[0-9\]+, mark_exit .*" "finish"
++
++
++    # cleanup
++    set pf_prefix $prefix_test
++}
++
++test parent FOLLOW_PARENT
++
++# Only GNU/Linux is known to support `set follow-fork-mode child'.
++if {[istarget "*-*-linux*"] && ![is_remote target]} {
++    test child FOLLOW_CHILD
++} else {
++    untested "child"
++}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.threads/watchpoint-fork.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.threads/watchpoint-fork.h    2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,32 @@
++/* Test case for forgotten hw-watchpoints after fork()-off of a process.
++
++   Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#ifdef THREAD
++#include <pthread.h>
++
++extern volatile int step;
++extern pthread_t thread;
++#endif /* THREAD */
++
++extern volatile int var;
++
++extern void marker (void);
++extern void forkoff (int nr);
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.trace/stap-trace.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.trace/stap-trace.c   2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,71 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2011 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#if USE_PROBES
++
++#define _SDT_HAS_SEMAPHORES
++__extension__ unsigned short teste_user_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
++#define TEST teste_user_semaphore
++
++__extension__ unsigned short teste_two_semaphore __attribute__ ((unused)) __attribute__ ((section (".probes")));
++#define TEST2 teste_two_semaphore
++
++#else
++
++#define TEST 1
++#define TEST2 1
++
++#endif /* USE_PROBES */
++
++#include <sys/sdt.h>
++
++/* We only support SystemTap and only the v3 form.  */
++#if _SDT_NOTE_TYPE != 3
++#error "not using SystemTap v3 probes"
++#endif
++
++void
++m1 (int x)
++{
++  if (TEST2)
++    STAP_PROBE1 (teste, two, x);
++}
++
++int
++f (int x)
++{
++  if (TEST)
++    STAP_PROBE1(teste, user, x);
++  return x+5;
++}
++
++void
++nothing (void)
++{
++  int a = 1 + 1;
++  return;
++}
++
++int
++main()
++{
++  f (f (23));
++  m1 (46);
++  nothing (); /* end-here */
++
++  return 0;
++}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.trace/stap-trace.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.trace/stap-trace.exp 2011-07-29 22:52:02.000000000 +0200
+@@ -0,0 +1,129 @@
++# Copyright 2011
++# Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++load_lib "trace-support.exp"
++
++if $tracelevel then {
++      strace $tracelevel
++}
++
++set testfile "stap-trace"
++set srcfile ${testfile}.c
++set executable $testfile
++set binfile $objdir/$subdir/$executable
++
++set ws "\[\r\n\t \]+"
++set cr "\[\r\n\]+"
++
++# Only x86 and x86_64 targets are supported for now.
++
++if { ![istarget "x86_64-*"] && ![istarget "i?86-*"] } {
++    continue
++}
++
++proc compile_stap_bin {{ arg "" }} {
++    global srcfile
++    global binfile
++    global srcdir
++    global subdir
++
++    if { $arg != "" } {
++      set arg "additional_flags=$arg"
++    }
++
++    if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
++          executable [concat $arg debug nowarnings]] != "" } {
++      untested "Could not compile ${srcfile}"
++      return -1
++    }
++}
++
++proc prepare_for_trace_test {} {
++    global executable
++
++    clean_restart $executable
++
++    if { ![runto_main] } {
++      perror "Could not run to `main'."
++      continue
++    }
++
++    gdb_breakpoint [gdb_get_line_number "end-here"]
++}
++
++proc run_trace_experiment { test_probe msg } {
++    global gdb_prompt
++
++    set test "collect $msg: start trace experiment"
++    gdb_test_multiple "tstart" "$test" {
++      -re "^tstart\r\n$gdb_prompt $" {
++          pass "$test"
++      }
++    }
++
++    gdb_test "continue" \
++          "Continuing.*Breakpoint \[0-9\]+.*" \
++          "collect $msg: run trace experiment"
++    gdb_test "tstop" \
++          "\[\r\n\]+" \
++          "collect $msg: stop trace experiment"
++    gdb_test "tfind start" \
++          "#0 .*" \
++          "collect $msg: tfind test frame"
++}
++
++proc gdb_collect_probe_arg { msg probe val_arg0 } {
++    global gdb_prompt
++    global cr
++
++    prepare_for_trace_test
++
++    gdb_test "trace $probe" \
++          "Tracepoint \[0-9\]+ at .*" \
++          "collect $msg: set tracepoint"
++    gdb_trace_setactions "collect $msg: define actions" \
++          "" \
++          "collect \$_probe_arg0" "^$"
++
++    # Begin the test.
++    run_trace_experiment $msg $probe
++
++    gdb_test "print \$_probe_arg0" \
++          "\\$\[0-9\]+ = $val_arg0$cr" \
++          "collect $msg: collected probe arg0"
++}
++
++compile_stap_bin ""
++
++clean_restart $executable
++if { ![runto_main] } {
++    perror "Could not run to `main'."
++    continue
++}
++
++if { ![gdb_target_supports_trace] } {
++    # Test cannot run on this target.
++    return 1;
++}
++
++gdb_collect_probe_arg "probe args without semaphore" "probe:user" "23"
++gdb_exit
++
++compile_stap_bin "-DUSE_PROBES"
++gdb_collect_probe_arg "probe args with semaphore" "probe:two" "46"
++
++# Finished!
++gdb_test "tfind none" ".*" ""
+Index: gdb-7.3.50.20110722/gdb/testsuite/lib/gdb.exp
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/testsuite/lib/gdb.exp 2011-07-15 16:11:22.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/testsuite/lib/gdb.exp      2011-07-29 22:52:02.000000000 +0200
+@@ -141,6 +141,11 @@ proc gdb_unload {} {
+           send_gdb "y\n"
+           exp_continue
+       }
++      -re "A program is being debugged already..*Are you sure you want to change the file.*y or n. $"\
++          { send_gdb "y\n"
++              verbose "\t\tUnloading symbols for program being debugged"
++          exp_continue
++      }
+       -re "Discard symbol table from .*y or n.*$" {
+           send_gdb "y\n"
+           exp_continue
+Index: gdb-7.3.50.20110722/gdb/testsuite/lib/pascal.exp
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/testsuite/lib/pascal.exp      2011-01-01 16:33:52.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/testsuite/lib/pascal.exp   2011-07-29 22:52:02.000000000 +0200
+@@ -37,6 +37,9 @@ proc pascal_init {} {
+     global pascal_compiler_is_fpc
+     global gpc_compiler
+     global fpc_compiler
++    global fpcversion_major
++    global fpcversion_minor
++    global fpcversion_release
+     global env
+  
+     if { $pascal_init_done == 1 } {
+@@ -64,6 +67,20 @@ proc pascal_init {} {
+           set pascal_compiler_is_fpc 1
+           verbose -log "Free Pascal compiler found"
+       }
++
++      # Detect the fpc-version
++      if { $pascal_compiler_is_fpc == 1 } {
++          set fpcversion_major 1
++          set fpcversion_minor 0
++          set fpcversion_release 0
++          set fpcversion [ remote_exec host $fpc_compiler "-iV" ] 
++          if [regexp {.*([0-9]+)\.([0-9]+)\.([0-9]+).?} $fpcversion] {
++              regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\1} fpcversion_major
++              regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\2} fpcversion_minor
++              regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\3} fpcversion_release
++          }
++            verbose -log "Freepascal version: $fpcversion_major.$fpcversion_minor.$fpcversion_release"
++      }
+     }
+     set pascal_init_done 1
+ }   
+Index: gdb-7.3.50.20110722/gdb/thread.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/thread.c      2011-05-30 20:04:32.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/thread.c   2011-07-29 22:52:02.000000000 +0200
+@@ -1441,7 +1441,8 @@ update_thread_list (void)
+    no thread is selected, or no threads exist.  */
+ static struct value *
+-thread_id_make_value (struct gdbarch *gdbarch, struct internalvar *var)
++thread_id_make_value (struct gdbarch *gdbarch, struct internalvar *var,
++                    void *ignore)
+ {
+   struct thread_info *tp = find_thread_ptid (inferior_ptid);
+@@ -1452,6 +1453,15 @@ thread_id_make_value (struct gdbarch *gd
+ /* Commands with a prefix of `thread'.  */
+ struct cmd_list_element *thread_cmd_list = NULL;
++/* Implementation of `thread' variable.  */
++
++static struct internalvar_funcs thread_funcs =
++{
++  thread_id_make_value,
++  NULL,
++  NULL
++};
++
+ void
+ _initialize_thread (void)
+ {
+@@ -1497,5 +1507,5 @@ Show printing of thread events (such as
+          show_print_thread_events,
+          &setprintlist, &showprintlist);
+-  create_internalvar_type_lazy ("_thread", thread_id_make_value);
++  create_internalvar_type_lazy ("_thread", &thread_funcs, NULL);
+ }
+Index: gdb-7.3.50.20110722/gdb/top.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/top.c 2011-07-21 13:03:45.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/top.c      2011-07-29 22:52:02.000000000 +0200
+@@ -347,6 +347,9 @@ prepare_execute_command (void)
+   mark = value_mark ();
+   cleanup = make_cleanup_value_free_to_mark (mark);
++#if 0
++  free_all_types ();
++#endif
+   /* With multiple threads running while the one we're examining is
+      stopped, the dcache can get stale without us being able to detect
+Index: gdb-7.3.50.20110722/gdb/tracepoint.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/tracepoint.c  2011-07-07 15:32:55.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/tracepoint.c       2011-07-29 22:52:02.000000000 +0200
+@@ -1609,6 +1609,8 @@ start_tracing (void)
+   for (ix = 0; VEC_iterate (breakpoint_p, tp_vec, ix, t); ix++)
+     {
++      struct bp_location *loc;
++
+       if ((t->type == bp_fast_tracepoint
+          ? !may_insert_fast_tracepoints
+          : !may_insert_tracepoints))
+@@ -1617,6 +1619,9 @@ start_tracing (void)
+       t->number_on_target = 0;
+       target_download_tracepoint (t);
+       t->number_on_target = t->number;
++
++      for (loc = t->loc; loc; loc = loc->next)
++      modify_semaphore (loc, 1);
+     }
+   VEC_free (breakpoint_p, tp_vec);
+@@ -1678,7 +1683,28 @@ trace_stop_command (char *args, int from
+ void
+ stop_tracing (void)
+ {
++  VEC(breakpoint_p) *tp_vec = NULL;
++  int ix;
++  struct breakpoint *t;
++
+   target_trace_stop ();
++
++  tp_vec = all_tracepoints ();
++  for (ix = 0; VEC_iterate (breakpoint_p, tp_vec, ix, t); ix++)
++    {
++      struct bp_location *loc;
++
++      if ((t->type == bp_fast_tracepoint
++         ? !may_insert_fast_tracepoints
++         : !may_insert_tracepoints))
++      continue;
++
++      for (loc = t->loc; loc; loc = loc->next)
++      modify_semaphore (loc, 0);
++    }
++
++  VEC_free (breakpoint_p, tp_vec);
++
+   /* Should change in response to reply?  */
+   current_trace_status ()->running = 0;
+ }
+@@ -4521,7 +4547,8 @@ info_static_tracepoint_markers_command (
+    available.  */
+ static struct value *
+-sdata_make_value (struct gdbarch *gdbarch, struct internalvar *var)
++sdata_make_value (struct gdbarch *gdbarch, struct internalvar *var,
++                void *ignore)
+ {
+   LONGEST size;
+   gdb_byte *buf;
+@@ -4700,6 +4727,15 @@ traceframe_available_memory (VEC(mem_ran
+   return 0;
+ }
++/* Implementation of `sdata' variable.  */
++
++static const struct internalvar_funcs sdata_funcs =
++{
++  sdata_make_value,
++  NULL,
++  NULL
++};
++
+ /* module initialization */
+ void
+ _initialize_tracepoint (void)
+@@ -4710,7 +4746,7 @@ _initialize_tracepoint (void)
+      value with a void typed value, and when we get here, gdbarch
+      isn't initialized yet.  At this point, we're quite sure there
+      isn't another convenience variable of the same name.  */
+-  create_internalvar_type_lazy ("_sdata", sdata_make_value);
++  create_internalvar_type_lazy ("_sdata", &sdata_funcs, NULL);
+   traceframe_number = -1;
+   tracepoint_number = -1;
+Index: gdb-7.3.50.20110722/gdb/typeprint.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/typeprint.c   2011-01-11 22:53:25.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/typeprint.c        2011-07-29 22:52:02.000000000 +0200
+@@ -36,6 +36,7 @@
+ #include "gdb_string.h"
+ #include "exceptions.h"
+ #include "valprint.h"
++#include "dwarf2loc.h"
+ #include <errno.h>
+ extern void _initialize_typeprint (void);
+@@ -77,6 +78,9 @@ void
+ type_print (struct type *type, char *varstring, struct ui_file *stream,
+           int show)
+ {
++  if (show >= 0)
++    type = check_typedef (type);
++
+   LA_PRINT_TYPE (type, varstring, stream, show, 0);
+ }
+@@ -115,7 +119,8 @@ whatis_exp (char *exp, int show)
+ {
+   struct expression *expr;
+   struct value *val;
+-  struct cleanup *old_chain = NULL;
++  /* Required at least for the object_address_set call.  */
++  struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
+   struct type *real_type = NULL;
+   struct type *type;
+   int full = 0;
+@@ -126,12 +131,13 @@ whatis_exp (char *exp, int show)
+   if (exp)
+     {
+       expr = parse_expression (exp);
+-      old_chain = make_cleanup (free_current_contents, &expr);
++      make_cleanup (free_current_contents, &expr);
+       val = evaluate_type (expr);
+     }
+   else
+     val = access_value_history (0);
++  object_address_set (value_raw_address (val));
+   type = value_type (val);
+   get_user_print_options (&opts);
+@@ -168,8 +174,7 @@ whatis_exp (char *exp, int show)
+   type_print (type, "", gdb_stdout, show);
+   printf_filtered ("\n");
+-  if (exp)
+-    do_cleanups (old_chain);
++  do_cleanups (old_chain);
+ }
+ static void
+Index: gdb-7.3.50.20110722/gdb/utils.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/utils.c       2011-07-22 01:46:09.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/utils.c    2011-07-29 22:52:02.000000000 +0200
+@@ -1874,6 +1874,36 @@ set_batch_flag_and_make_cleanup_restore_
+   return back_to;
+ }
++/* Helper for make_cleanup_restore_page_info.  */
++
++static void
++do_restore_selected_frame_cleanup (void *arg)
++{
++  struct frame_id *frame_idp = arg;
++
++  select_frame (frame_find_by_id (*frame_idp));
++
++  xfree (frame_idp);
++}
++
++/* Provide cleanup for restoring currently selected frame.  Use frame_id for
++   the case the current frame becomes stale in the meantime.  */
++
++struct cleanup *
++make_cleanup_restore_selected_frame (void)
++{
++  struct frame_id *frame_idp;
++
++  /* get_selected_frame->get_current_frame would error otherwise.  */
++  if (!has_stack_frames ())
++    return make_cleanup (null_cleanup, NULL);
++
++  frame_idp = xmalloc (sizeof (*frame_idp));
++  *frame_idp = get_frame_id (get_selected_frame (NULL));
++
++  return make_cleanup (do_restore_selected_frame_cleanup, frame_idp);
++}
++
+ /* Set the screen size based on LINES_PER_PAGE and CHARS_PER_LINE.  */
+ static void
+Index: gdb-7.3.50.20110722/gdb/valarith.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/valarith.c    2011-02-18 20:10:46.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/valarith.c 2011-07-29 22:52:02.000000000 +0200
+@@ -198,7 +198,10 @@ value_subscripted_rvalue (struct value *
+   struct type *array_type = check_typedef (value_type (array));
+   struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
+   unsigned int elt_size = TYPE_LENGTH (elt_type);
+-  unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound);
++  unsigned int elt_stride
++    = (TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (array_type)) == 0
++       ? elt_size : TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (array_type)));
++  unsigned int elt_offs = elt_stride * longest_to_int (index - lowerbound);
+   struct value *v;
+   if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type)
+@@ -298,6 +301,10 @@ int
+ binop_user_defined_p (enum exp_opcode op,
+                     struct value *arg1, struct value *arg2)
+ {
++  /* FIXME: We should support user defined ops for dynamic types.  */
++  if (TYPE_DYNAMIC (value_type (arg1)) || TYPE_DYNAMIC (value_type (arg2)))
++    return 0;
++
+   return binop_types_user_defined_p (op, value_type (arg1), value_type (arg2));
+ }
+Index: gdb-7.3.50.20110722/gdb/valops.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/valops.c      2011-07-14 17:00:20.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/valops.c   2011-07-29 22:52:02.000000000 +0200
+@@ -47,6 +47,7 @@
+ #include "objfiles.h"
+ #include "symtab.h"
+ #include "exceptions.h"
++#include "dwarf2loc.h"
+ extern int overload_debug;
+ /* Local functions.  */
+@@ -915,6 +916,65 @@ value_one (struct type *type, enum lval_
+   return val;
+ }
++/* object_address_set must be already called before this function.  */
++
++const char *
++object_address_data_not_valid (struct type *type)
++{
++  /* Attributes are present only at the target type of a typedef.  Make the
++     call conditional as it would otherwise loop through type_length_get.  */
++  if (TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
++    CHECK_TYPEDEF (type);
++
++  /* DW_AT_associated has a preference over DW_AT_allocated.  */
++  if (TYPE_NOT_ASSOCIATED (type)
++      || (TYPE_ASSOCIATED (type) != NULL
++        && 0 == dwarf_locexpr_baton_eval (TYPE_ASSOCIATED (type))))
++    return N_("object is not associated");
++
++  if (TYPE_NOT_ALLOCATED (type)
++      || (TYPE_ALLOCATED (type) != NULL
++        && 0 == dwarf_locexpr_baton_eval (TYPE_ALLOCATED (type))))
++    return N_("object is not allocated");
++
++  return NULL;
++}
++
++/* Return non-NULL check_typedef result on TYPE if the variable is valid.  If
++   it is valid the function may store the data address (DW_AT_DATA_LOCATION) of
++   TYPE at *ADDRESS_RETURN.  You must set *ADDRESS_RETURN from
++   value_raw_address (VAL) before calling this function.  If no
++   DW_AT_DATA_LOCATION is present for TYPE the address at *ADDRESS_RETURN is
++   left unchanged.  ADDRESS_RETURN must not be NULL, use
++   object_address_data_not_valid () for just the data validity check.  */
++
++struct type *
++object_address_get_data (struct type *type, CORE_ADDR *address_return)
++{
++  gdb_assert (address_return != NULL);
++
++  object_address_set (*address_return);
++
++  /* TYPE_DATA_LOCATION_DWARF_BLOCK / TYPE_DATA_LOCATION_ADDR are present only
++     at the target type of a typedef.  */
++  CHECK_TYPEDEF (type);
++
++  if (object_address_data_not_valid (type) != NULL)
++    {
++      /* Do not try to evaluate DW_AT_data_location as it may even crash
++       (it would just return the value zero in the gfortran case).  */
++      return NULL;
++    }
++
++  if (TYPE_DATA_LOCATION_IS_ADDR (type))
++    *address_return = TYPE_DATA_LOCATION_ADDR (type);
++  else if (TYPE_DATA_LOCATION_DWARF_BLOCK (type) != NULL)
++    *address_return
++      = dwarf_locexpr_baton_eval (TYPE_DATA_LOCATION_DWARF_BLOCK (type));
++
++  return type;
++}
++
+ /* Helper function for value_at, value_at_lazy, and value_at_lazy_stack.  */
+ static struct value *
+@@ -1011,12 +1071,20 @@ value_fetch_lazy (struct value *val)
+     }
+   else if (VALUE_LVAL (val) == lval_memory)
+     {
+-      CORE_ADDR addr = value_address (val);
+-      int length = TYPE_LENGTH (check_typedef (value_enclosing_type (val)));
++      CORE_ADDR addr = value_raw_address (val);
+-      if (length)
+-      read_value_memory (val, 0, value_stack (val),
+-                         addr, value_contents_all_raw (val), length);
++      if (object_address_get_data (value_type (val), &addr))
++      {
++        struct type *type = value_enclosing_type (val);
++        int length = TYPE_LENGTH (check_typedef (type));
++
++        if (length)
++          {
++            addr += value_offset (val);
++            read_value_memory (val, 0, value_stack (val),
++                               addr, value_contents_all_raw (val), length);
++          }
++      }
+     }
+   else if (VALUE_LVAL (val) == lval_register)
+     {
+@@ -1528,7 +1596,18 @@ address_of_variable (struct symbol *var,
+   if ((VALUE_LVAL (val) == lval_memory && value_lazy (val))
+       || TYPE_CODE (type) == TYPE_CODE_FUNC)
+     {
+-      CORE_ADDR addr = value_address (val);
++      CORE_ADDR addr;
++
++      if (VALUE_LVAL (val) == lval_memory)
++      {
++        addr = value_raw_address (val);
++        if (!object_address_get_data (type, &addr))
++          error (_("Can't take address of memory lvalue \"%s\"."),
++                 SYMBOL_PRINT_NAME (var));
++        set_value_address (val, addr);
++      }
++
++      addr = value_address (val);
+       return value_from_pointer (lookup_pointer_type (type), addr);
+     }
+@@ -1635,6 +1714,7 @@ struct value *
+ value_coerce_array (struct value *arg1)
+ {
+   struct type *type = check_typedef (value_type (arg1));
++  CORE_ADDR address;
+   /* If the user tries to do something requiring a pointer with an
+      array that has not yet been pushed to the target, then this would
+@@ -1644,8 +1724,12 @@ value_coerce_array (struct value *arg1)
+   if (VALUE_LVAL (arg1) != lval_memory)
+     error (_("Attempt to take address of value not located in memory."));
++  address = value_raw_address (arg1);
++  if (!object_address_get_data (type, &address))
++    error (_("Attempt to take address of non-valid value."));
++
+   return value_from_pointer (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
+-                           value_address (arg1));
++                           address + value_offset (arg1));
+ }
+ /* Given a value which is a function, return a value which is a pointer
+@@ -3676,6 +3760,8 @@ value_slice (struct value *array, int lo
+                                       TYPE_TARGET_TYPE (range_type),
+                                       lowbound, 
+                                       lowbound + length - 1);
++  TYPE_BYTE_STRIDE (slice_range_type) = TYPE_BYTE_STRIDE (range_type);
++
+   if (TYPE_CODE (array_type) == TYPE_CODE_BITSTRING)
+     {
+       int i;
+Index: gdb-7.3.50.20110722/gdb/valprint.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/valprint.c    2011-06-29 17:32:39.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/valprint.c 2011-07-29 22:52:02.000000000 +0200
+@@ -39,6 +39,7 @@
+ #include "gdb_obstack.h"
+ #include "charset.h"
+ #include <ctype.h>
++#include "dwarf2loc.h"
+ #include <errno.h>
+@@ -242,7 +243,6 @@ scalar_type_p (struct type *type)
+     case TYPE_CODE_STRUCT:
+     case TYPE_CODE_UNION:
+     case TYPE_CODE_SET:
+-    case TYPE_CODE_STRING:
+     case TYPE_CODE_BITSTRING:
+       return 0;
+     default:
+@@ -1196,6 +1196,7 @@ val_print_array_elements (struct type *t
+ {
+   unsigned int things_printed = 0;
+   unsigned len;
++  struct type *saved_type = type;
+   struct type *elttype, *index_type;
+   unsigned eltlen;
+   /* Position of the array element we are examining to see
+@@ -1204,9 +1205,33 @@ val_print_array_elements (struct type *t
+   /* Number of repetitions we have detected so far.  */
+   unsigned int reps;
+   LONGEST low_bound, high_bound;
++  struct cleanup *back_to;
++  CORE_ADDR saved_address = address;
++  
++  back_to = make_cleanup (null_cleanup, 0);
++  type = object_address_get_data (type, &address);
++  if (!type)
++    {
++      fputs_filtered (object_address_data_not_valid (type), stream);
++      do_cleanups (back_to);
++      return;
++    }
++  if (address != saved_address)
++    {
++      size_t length = TYPE_LENGTH (type);
+-  elttype = TYPE_TARGET_TYPE (type);
+-  eltlen = TYPE_LENGTH (check_typedef (elttype));
++      valaddr = xmalloc (length);
++      make_cleanup (xfree, (gdb_byte *) valaddr);
++      read_memory (address, (gdb_byte *) valaddr, length);
++    }
++
++  /* Skip typedefs but do not resolve TYPE_DYNAMIC.  */
++  elttype = saved_type;
++  while (TYPE_CODE (elttype) == TYPE_CODE_TYPEDEF)
++    elttype = TYPE_TARGET_TYPE (elttype);
++  elttype = TYPE_TARGET_TYPE (elttype);
++
++  eltlen = TYPE_ARRAY_BYTE_STRIDE_VALUE (type);
+   index_type = TYPE_INDEX_TYPE (type);
+   if (get_array_bounds (type, &low_bound, &high_bound))
+@@ -1293,6 +1318,8 @@ val_print_array_elements (struct type *t
+     {
+       fprintf_filtered (stream, "...");
+     }
++
++  do_cleanups (back_to);
+ }
+ /* Read LEN bytes of target memory at address MEMADDR, placing the
+Index: gdb-7.3.50.20110722/gdb/value.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/value.c       2011-07-14 17:00:20.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/value.c    2011-07-29 22:52:02.000000000 +0200
+@@ -43,6 +43,7 @@
+ #include "python/python.h"
+ #include <ctype.h>
+ #include "tracepoint.h"
++#include "observer.h"
+ /* Prototypes for exported functions.  */
+@@ -1354,12 +1355,15 @@ void
+ set_value_component_location (struct value *component,
+                             const struct value *whole)
+ {
++  CORE_ADDR addr;
++
+   if (whole->lval == lval_internalvar)
+     VALUE_LVAL (component) = lval_internalvar_component;
+   else
+     VALUE_LVAL (component) = whole->lval;
+   component->location = whole->location;
++
+   if (whole->lval == lval_computed)
+     {
+       const struct lval_funcs *funcs = whole->location.computed.funcs;
+@@ -1367,6 +1371,12 @@ set_value_component_location (struct val
+       if (funcs->copy_closure)
+         component->location.computed.closure = funcs->copy_closure (whole);
+     }
++
++  addr = value_raw_address (component);
++  object_address_get_data (value_type (whole), &addr);
++  if (component->lval != lval_internalvar
++      && component->lval != lval_internalvar_component)
++    set_value_address (component, addr);
+ }
\f
+@@ -1500,6 +1510,31 @@ show_values (char *num_exp, int from_tty
+       num_exp[1] = '\0';
+     }
+ }
++
++/* Sanity check for memory leaks and proper types reference counting.  */
++
++static void
++value_history_cleanup (void *unused)
++{
++  while (value_history_chain)
++    {
++      struct value_history_chunk *chunk = value_history_chain;
++      int i;
++
++      for (i = 0; i < ARRAY_SIZE (chunk->values); i++)
++              value_free (chunk->values[i]);
++
++      value_history_chain = chunk->next;
++      xfree (chunk);
++    }
++  value_history_count = 0;
++
++  /* Free the unreferenced types above.  */
++  free_all_values ();
++#if 0
++  free_all_types ();
++#endif
++}
\f
+ /* Internal variables.  These are variables within the debugger
+    that hold values assigned by debugger commands.
+@@ -1545,7 +1580,14 @@ struct internalvar
+       struct value *value;
+       /* The call-back routine used with INTERNALVAR_MAKE_VALUE.  */
+-      internalvar_make_value make_value;
++      struct
++        {
++        /* The functions to call.  */
++        const struct internalvar_funcs *functions;
++
++        /* The function's user-data.  */
++        void *data;
++        } make_value;
+       /* The internal function used with INTERNALVAR_FUNCTION.  */
+       struct
+@@ -1644,18 +1686,39 @@ create_internalvar (const char *name)
+ /* Create an internal variable with name NAME and register FUN as the
+    function that value_of_internalvar uses to create a value whenever
+    this variable is referenced.  NAME should not normally include a
+-   dollar sign.  */
++   dollar sign.  DATA is passed uninterpreted to FUN when it is
++   called.  CLEANUP, if not NULL, is called when the internal variable
++   is destroyed.  It is passed DATA as its only argument.  */
+ struct internalvar *
+-create_internalvar_type_lazy (char *name, internalvar_make_value fun)
++create_internalvar_type_lazy (const char *name,
++                            const struct internalvar_funcs *funcs,
++                            void *data)
+ {
+   struct internalvar *var = create_internalvar (name);
+   var->kind = INTERNALVAR_MAKE_VALUE;
+-  var->u.make_value = fun;
++  var->u.make_value.functions = funcs;
++  var->u.make_value.data = data;
+   return var;
+ }
++/* See documentation in value.h.  */
++
++int
++compile_internalvar_to_ax (struct internalvar *var,
++                         struct agent_expr *expr,
++                         struct axs_value *value)
++{
++  if (var->kind != INTERNALVAR_MAKE_VALUE
++      || var->u.make_value.functions->compile_to_ax == NULL)
++    return 0;
++
++  var->u.make_value.functions->compile_to_ax (var, expr, value,
++                                            var->u.make_value.data);
++  return 1;
++}
++
+ /* Look up an internal variable with name NAME.  NAME should not
+    normally include a dollar sign.
+@@ -1728,7 +1791,8 @@ value_of_internalvar (struct gdbarch *gd
+       break;
+     case INTERNALVAR_MAKE_VALUE:
+-      val = (*var->u.make_value) (gdbarch, var);
++      val = (*var->u.make_value.functions->make_value) (gdbarch, var,
++                                                      var->u.make_value.data);
+       break;
+     default:
+@@ -1924,6 +1988,11 @@ clear_internalvar (struct internalvar *v
+       xfree (var->u.string);
+       break;
++    case INTERNALVAR_MAKE_VALUE:
++      if (var->u.make_value.functions->destroy != NULL)
++      var->u.make_value.functions->destroy (var->u.make_value.data);
++      break;
++
+     default:
+       break;
+     }
+@@ -1978,6 +2047,38 @@ call_internal_function (struct gdbarch *
+   return (*ifn->handler) (gdbarch, language, ifn->cookie, argc, argv);
+ }
++#if 0
++/* Call type_mark_used for any TYPEs referenced from this GDB source file.  */
++
++static void
++value_types_mark_used (void)
++{
++  struct internalvar *var;
++  struct value_history_chunk *chunk;
++
++  for (var = internalvars; var != NULL; var = var->next)
++    switch (var->kind)
++      {
++      case INTERNALVAR_VALUE:
++      type_mark_used (value_type (var->u.value));
++      break;
++
++      case INTERNALVAR_INTEGER:
++      type_mark_used (var->u.integer.type);
++      break;
++      }
++
++  for (chunk = value_history_chain; chunk != NULL; chunk = chunk->next)
++    {
++      int i;
++
++      for (i = 0; i < ARRAY_SIZE (chunk->values); i++)
++      if (chunk->values[i])
++        type_mark_used (value_type (chunk->values[i]));
++    }
++}
++#endif
++
+ /* The 'function' command.  This does nothing -- it is just a
+    placeholder to let "help function NAME" work.  This is also used as
+    the implementation of the sub-command that is created when
+@@ -2025,11 +2126,10 @@ preserve_one_value (struct value *value,
+                   htab_t copied_types)
+ {
+   if (TYPE_OBJFILE (value->type) == objfile)
+-    value->type = copy_type_recursive (objfile, value->type, copied_types);
++    value->type = copy_type_recursive (value->type, copied_types);
+   if (TYPE_OBJFILE (value->enclosing_type) == objfile)
+-    value->enclosing_type = copy_type_recursive (objfile,
+-                                               value->enclosing_type,
++    value->enclosing_type = copy_type_recursive (value->enclosing_type,
+                                                copied_types);
+ }
+@@ -2044,7 +2144,7 @@ preserve_one_internalvar (struct interna
+     case INTERNALVAR_INTEGER:
+       if (var->u.integer.type && TYPE_OBJFILE (var->u.integer.type) == objfile)
+       var->u.integer.type
+-        = copy_type_recursive (objfile, var->u.integer.type, copied_types);
++        = copy_type_recursive (var->u.integer.type, copied_types);
+       break;
+     case INTERNALVAR_VALUE:
+@@ -2095,14 +2195,22 @@ show_convenience (char *ignore, int from
+   get_user_print_options (&opts);
+   for (var = internalvars; var; var = var->next)
+     {
++      volatile struct gdb_exception e;
++
+       if (!varseen)
+       {
+         varseen = 1;
+       }
+       printf_filtered (("$%s = "), var->name);
+-      value_print (value_of_internalvar (gdbarch, var), gdb_stdout,
+-                 &opts);
+-      printf_filtered (("\n"));
++
++      TRY_CATCH (e, RETURN_MASK_ERROR)
++      {
++        value_print (value_of_internalvar (gdbarch, var), gdb_stdout,
++                     &opts);
++        printf_filtered (("\n"));
++      }
++      if (e.reason < 0)
++      printf_filtered (_("<error: %s>\n"), e.message);
+     }
+   if (!varseen)
+     printf_unfiltered (_("No debugger convenience variables now defined.\n"
+@@ -3075,7 +3183,24 @@ value_from_history_ref (char *h, char **
+ struct value *
+ coerce_ref (struct value *arg)
+ {
+-  struct type *value_type_arg_tmp = check_typedef (value_type (arg));
++  struct type *value_type_arg_tmp;
++
++  if (TYPE_DYNAMIC (value_type (arg)))
++    {
++      struct cleanup *cleanups = make_cleanup (null_cleanup, NULL);
++      CORE_ADDR address;
++
++      value_type_arg_tmp = value_type (arg);
++      address = value_raw_address (arg);
++      value_type_arg_tmp = object_address_get_data (value_type_arg_tmp,
++                                                  &address);
++      if (! value_type_arg_tmp)
++      error (_("Attempt to coerce non-valid value."));
++      arg = value_at_lazy (value_type_arg_tmp, address);
++      do_cleanups (cleanups);
++    }
++  else
++    value_type_arg_tmp = check_typedef (value_type (arg));
+   if (TYPE_CODE (value_type_arg_tmp) == TYPE_CODE_REF)
+     arg = value_at_lazy (TYPE_TARGET_TYPE (value_type_arg_tmp),
+@@ -3173,4 +3298,10 @@ VARIABLE is already initialized."));
+   add_prefix_cmd ("function", no_class, function_command, _("\
+ Placeholder command for showing help on convenience functions."),
+                 &functionlist, "function ", 0, &cmdlist);
++
++  make_final_cleanup (value_history_cleanup, NULL);
++
++#if 0
++  observer_attach_mark_used (value_types_mark_used);
++#endif
+ }
+Index: gdb-7.3.50.20110722/gdb/value.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/value.h       2011-07-14 17:00:20.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/value.h    2011-07-29 22:52:02.000000000 +0200
+@@ -475,6 +475,10 @@ extern struct value *value_from_decfloat
+                                         const gdb_byte *decbytes);
+ extern struct value *value_from_history_ref (char *, char **);
++extern const char *object_address_data_not_valid (struct type *type);
++extern struct type *object_address_get_data (struct type *type,
++                                           CORE_ADDR *address_return);
++
+ extern struct value *value_at (struct type *type, CORE_ADDR addr);
+ extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr);
+@@ -700,10 +704,52 @@ extern struct internalvar *lookup_only_i
+ extern struct internalvar *create_internalvar (const char *name);
+-typedef struct value * (*internalvar_make_value) (struct gdbarch *,
+-                                                struct internalvar *);
++/* An internalvar can be dynamically computed by supplying a vector of
++   function pointers to perform various operations.  */
++
++struct internalvar_funcs
++{
++  /* Compute the value of the variable.  The DATA argument passed to
++     the function is the same argument that was passed to
++     `create_internalvar_type_lazy'.  */
++
++  struct value *(*make_value) (struct gdbarch *arch,
++                             struct internalvar *var,
++                             void *data);
++
++  /* Update the agent expression EXPR with bytecode to compute the
++     value.  VALUE is the agent value we are updating.  The DATA
++     argument passed to this function is the same argument that was
++     passed to `create_internalvar_type_lazy'.  If this pointer is
++     NULL, then the internalvar cannot be compiled to an agent
++     expression.  */
++
++  void (*compile_to_ax) (struct internalvar *var,
++                       struct agent_expr *expr,
++                       struct axs_value *value,
++                       void *data);
++
++  /* If non-NULL, this is called to destroy DATA.  The DATA argument
++     passed to this function is the same argument that was passed to
++     `create_internalvar_type_lazy'.  */
++
++  void (*destroy) (void *data);
++};
++
+ extern struct internalvar *
+-  create_internalvar_type_lazy (char *name, internalvar_make_value fun);
++create_internalvar_type_lazy (const char *name,
++                            const struct internalvar_funcs *funcs,
++                            void *data);
++
++/* Compile an internal variable to an agent expression.  VAR is the
++   variable to compile; EXPR and VALUE are the agent expression we are
++   updating.  This will return 0 if there is no known way to compile
++   VAR, and 1 if VAR was successfully compiled.  It may also throw an
++   exception on error.  */
++
++extern int compile_internalvar_to_ax (struct internalvar *var,
++                                    struct agent_expr *expr,
++                                    struct axs_value *value);
+ extern struct internalvar *lookup_internalvar (const char *name);
+Index: gdb-7.3.50.20110722/gdb/windows-tdep.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/windows-tdep.c        2011-07-14 17:00:20.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/windows-tdep.c     2011-07-29 22:52:02.000000000 +0200
+@@ -268,7 +268,7 @@ static const struct lval_funcs tlb_value
+    if there's no object available.  */
+ static struct value *
+-tlb_make_value (struct gdbarch *gdbarch, struct internalvar *var)
++tlb_make_value (struct gdbarch *gdbarch, struct internalvar *var, void *ignore)
+ {
+   if (target_has_stack && !ptid_equal (inferior_ptid, null_ptid))
+     {
+@@ -425,6 +425,15 @@ init_w32_command_list (void)
+     }
+ }
++/* Implementation of `tlb' variable.  */
++
++static const struct internalvar_funcs tlb_funcs =
++{
++  tlb_make_value,
++  NULL,
++  NULL
++};
++
+ void
+ _initialize_windows_tdep (void)
+ {
+@@ -451,5 +460,5 @@ even if their meaning is unknown."),
+      value with a void typed value, and when we get here, gdbarch
+      isn't initialized yet.  At this point, we're quite sure there
+      isn't another convenience variable of the same name.  */
+-  create_internalvar_type_lazy ("_tlb", tlb_make_value);
++  create_internalvar_type_lazy ("_tlb", &tlb_funcs, NULL);
+ }
+Index: gdb-7.3.50.20110722/gdb/xcoffread.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/xcoffread.c   2011-07-29 22:52:00.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/xcoffread.c        2011-07-29 22:52:02.000000000 +0200
+@@ -3125,6 +3125,7 @@ static const struct sym_fns xcoff_sym_fn
+   default_symfile_segments,   /* Get segment information from a file.  */
+   aix_process_linenos,
+   default_symfile_relocate,   /* Relocate a debug section.  */
++  NULL,                               /* sym_probe_fns */
+   &psym_functions
+ };
diff --git a/gdb/patches/gdb-bz533176-fortran-omp-step.patch b/gdb/patches/gdb-bz533176-fortran-omp-step.patch
new file mode 100644 (file)
index 0000000..2cddac3
--- /dev/null
@@ -0,0 +1,121 @@
+https://bugzilla.redhat.com/show_bug.cgi?id=533176#c4
+
+I find it a bug in DWARF and gdb behaves correctly according to it.  From the
+current DWARF's point of view the is a function call which you skip by "next".
+
+If you hide any /usr/lib/debug such as using:
+gdb -nx -ex 'set debug-file-directory /qwe' -ex 'file ./tpcommon_gfortran44'
+and use "step" command instead of "next" there it will work.
+(You need to hide debuginfo from libgomp as you would step into libgomp sources
+to maintain the threads for execution.)
+
+There should be some DWARF extension for it, currently tried to detect
+substring ".omp_fn." as this function is called "MAIN__.omp_fn.0" and do not
+consider such sub-function as a skippable by "next".
+
+Another problem is that with "set scheduler-locking" being "off" (default
+upstream) or "step" (default in F/RHEL) the simultaneous execution of the
+threads is inconvenient.  Setting it to "on" will lockup the debugging as the
+threads need to get synchronized at some point.  This is a more general
+debugging problem of GOMP outside of the scope of this Bug.
+
+
+
+Index: gdb-7.2.50.20101231/gdb/infrun.c
+===================================================================
+--- gdb-7.2.50.20101231.orig/gdb/infrun.c      2011-01-01 01:02:45.000000000 +0100
++++ gdb-7.2.50.20101231/gdb/infrun.c   2011-01-01 01:10:22.000000000 +0100
+@@ -4585,6 +4585,12 @@ infrun: not switching back to stepped th
+       if (ecs->event_thread->control.step_over_calls == STEP_OVER_ALL)
+       {
++        struct symbol *stop_fn = find_pc_function (stop_pc);
++
++        if (stop_fn == NULL
++            || strstr (SYMBOL_LINKAGE_NAME (stop_fn), ".omp_fn.") == NULL)
++{     /* ".omp_fn." */
++
+         /* We're doing a "next".
+            Normal (forward) execution: set a breakpoint at the
+@@ -4612,6 +4618,7 @@ infrun: not switching back to stepped th
+         keep_going (ecs);
+         return;
++}     /* ".omp_fn." */
+       }
+       /* If we are in a function call trampoline (a stub between the
+Index: gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.exp 2011-01-01 01:09:58.000000000 +0100
+@@ -0,0 +1,31 @@
++# Copyright 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++set testfile "omp-step"
++set srcfile ${testfile}.f90
++if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f90 additional_flags=-fopenmp}] } {
++    return -1
++}
++
++if ![runto [gdb_get_line_number "start-here"]] {
++    perror "Couldn't run to start-here"
++    return 0
++}
++
++gdb_test "next" {!\$omp parallel} "step closer"
++gdb_test "next" {a\(omp_get_thread_num\(\) \+ 1\) = 1} "step into omp"
++
++gdb_breakpoint [gdb_get_line_number "success"]
++gdb_continue_to_breakpoint "success" ".*success.*"
+Index: gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.f90
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.f90 2011-01-01 01:09:58.000000000 +0100
+@@ -0,0 +1,32 @@
++! Copyright 2009 Free Software Foundation, Inc.
++
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 3 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++      use omp_lib
++      integer nthreads, i, a(1000)
++      nthreads = omp_get_num_threads()
++      if (nthreads .gt. 1000) call abort
++
++      do i = 1, nthreads
++          a(i) = 0
++      end do
++      print *, "start-here"
++!$omp parallel
++      a(omp_get_thread_num() + 1) = 1
++!$omp end parallel
++      do i = 1, nthreads
++          if (a(i) .ne. 1) call abort
++      end do
++      print *, "success"
++      end
diff --git a/gdb/patches/gdb-bz541866-rwatch-before-run.patch b/gdb/patches/gdb-bz541866-rwatch-before-run.patch
new file mode 100644 (file)
index 0000000..a81d627
--- /dev/null
@@ -0,0 +1,151 @@
+Index: gdb-7.3.50.20110722/gdb/config/i386/linux64.mh
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/config/i386/linux64.mh        2011-07-22 01:46:10.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/config/i386/linux64.mh     2011-07-22 19:32:41.000000000 +0200
+@@ -3,7 +3,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \
+       i386-nat.o amd64-nat.o amd64-linux-nat.o \
+       linux-nat.o linux-osdata.o \
+       proc-service.o linux-thread-db.o linux-fork.o
+-NAT_FILE= config/nm-linux.h
++NAT_FILE= nm-linux64.h
+ NAT_CDEPS = $(srcdir)/proc-service.list
+ # The dynamically loaded libthread_db needs access to symbols in the
+Index: gdb-7.3.50.20110722/gdb/config/i386/linux.mh
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/config/i386/linux.mh  2011-07-22 01:46:10.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/config/i386/linux.mh       2011-07-22 19:32:21.000000000 +0200
+@@ -1,6 +1,6 @@
+ # Host: Intel 386 running GNU/Linux.
+-NAT_FILE= config/nm-linux.h
++NAT_FILE= nm-linux.h
+ NATDEPFILES= inf-ptrace.o fork-child.o \
+       i386-nat.o i386-linux-nat.o \
+       proc-service.o linux-thread-db.o \
+Index: gdb-7.3.50.20110722/gdb/config/i386/nm-linux.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/config/i386/nm-linux.h     2011-07-22 19:32:21.000000000 +0200
+@@ -0,0 +1,28 @@
++/* Native support for GNU/Linux i386.
++
++   Copyright 2010 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#ifndef NM_LINUX_H
++#define NM_LINUX_H
++
++#include "config/nm-linux.h"
++
++/* Red Hat backward compatibility with gdb-6.8.  */
++#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
++
++#endif /* NM_LINUX64_H */
+Index: gdb-7.3.50.20110722/gdb/config/i386/nm-linux64.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/config/i386/nm-linux64.h   2011-07-22 19:32:21.000000000 +0200
+@@ -0,0 +1,28 @@
++/* Native support for GNU/Linux amd64.
++
++   Copyright 2010 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#ifndef NM_LINUX64_H
++#define NM_LINUX64_H
++
++#include "config/nm-linux.h"
++
++/* Red Hat backward compatibility with gdb-6.8.  */
++#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
++
++#endif /* NM_LINUX64_H */
+Index: gdb-7.3.50.20110722/gdb/target.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/target.h      2011-06-06 14:47:07.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/target.h   2011-07-22 19:32:21.000000000 +0200
+@@ -1349,8 +1349,10 @@ extern char *target_thread_name (struct 
+    bp_hardware_breakpoint.  CNT is the number of such watchpoints used so far
+    (including this one?).  OTHERTYPE is who knows what...  */
++#ifndef target_can_use_hardware_watchpoint
+ #define target_can_use_hardware_watchpoint(TYPE,CNT,OTHERTYPE) \
+  (*current_target.to_can_use_hw_breakpoint) (TYPE, CNT, OTHERTYPE);
++#endif
+ /* Returns the number of debug registers needed to watch the given
+    memory region, or zero if not supported.  */
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp    2011-07-22 19:32:21.000000000 +0200
+@@ -0,0 +1,40 @@
++# Copyright 2009, 2010 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++# Arch not supporting hw watchpoints does not imply no_hardware_watchpoints set.
++if {(![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"]
++     && ![istarget "ia64-*-*"])
++    || [target_info exists gdb,no_hardware_watchpoints]} then {
++    verbose "Skipping watchpoint-hw-before-run test."
++    return
++}
++
++set test watchpoint-hw-before-run
++set srcfile watchpoint-hw-hit-once.c
++if { [prepare_for_testing ${test}.exp ${test} ${srcfile}] } {
++    return -1
++}
++
++gdb_test "rwatch watchee" "ardware read watchpoint 1: watchee"
++
++# `runto_main' or `runto main' would delete the watchpoint created above.
++
++if { [gdb_start_cmd] < 0 } {
++    untested start
++    return -1
++}
++gdb_test "" "main .* at .*" "start"
++
++gdb_test "continue" "Continuing.\r\nHardware read watchpoint \[0-9\]+: watchee\r\n\r\nValue = 0\r\n.*"
diff --git a/gdb/patches/gdb-bz562763-pretty-print-2d-vectors.patch b/gdb/patches/gdb-bz562763-pretty-print-2d-vectors.patch
new file mode 100644 (file)
index 0000000..0e3d216
--- /dev/null
@@ -0,0 +1,398 @@
+2010-05-31  Chris Moller  <cmoller@redhat.com>
+
+       * python/py-prettyprint.c (print_children): Add formatting for
+       matrices. (apply_val_pretty_printer): Detect and deal with matrix
+       hints. 
+
+
+2010-05-31  Chris Moller  <cmoller@redhat.com>
+
+       * gdb.python/Makefile.in (EXECUTABLES):  Added pr10659.
+       * gdb.python/pr10659.cc:  New file.
+       * gdb.python/pr10659.exp.  New file.
+       * gdb.python/pr10659.py: New file.
+
+Index: gdb-7.2.50.20110218/gdb/valprint.h
+===================================================================
+--- gdb-7.2.50.20110218.orig/gdb/valprint.h    2011-02-14 12:35:45.000000000 +0100
++++ gdb-7.2.50.20110218/gdb/valprint.h 2011-02-18 10:44:32.000000000 +0100
+@@ -90,6 +90,9 @@ struct value_print_options
+   /* If nonzero, print the value in "summary" form.  */
+   int summary;
++
++  /* Affects pretty printing of matrices.  */
++  int prettyprint_matrix;
+ };
+ /* The global print options set by the user.  In general this should
+Index: gdb-7.2.50.20110218/gdb/python/py-prettyprint.c
+===================================================================
+--- gdb-7.2.50.20110218.orig/gdb/python/py-prettyprint.c       2011-02-14 12:10:53.000000000 +0100
++++ gdb-7.2.50.20110218/gdb/python/py-prettyprint.c    2011-02-18 10:45:02.000000000 +0100
+@@ -501,7 +501,7 @@ print_children (PyObject *printer, const
+   /* Use the prettyprint_arrays option if we are printing an array,
+      and the pretty option otherwise.  */
+-  if (is_array)
++  if (is_array || options->prettyprint_matrix)
+     pretty = options->prettyprint_arrays;
+   else
+     {
+@@ -521,6 +521,9 @@ print_children (PyObject *printer, const
+       goto done;
+     }
+   make_cleanup_py_decref (frame);
++  
++  if (options->prettyprint_matrix && recurse == 0)
++    fputs_filtered ("\n", stream);
+   done_flag = 0;
+   for (i = 0; i < options->print_max; ++i)
+@@ -555,12 +558,23 @@ print_children (PyObject *printer, const
+        3. Other.  Always print a ",".  */
+       if (i == 0)
+       {
+-         if (is_py_none)
+-           fputs_filtered ("{", stream);
+-         else
+-           fputs_filtered (" = {", stream);
++        if (options->prettyprint_matrix && recurse == 0)
++          print_spaces_filtered (2 + 2 * recurse, stream);
++        if (is_py_none)
++          {
++            if (options->prettyprint_matrix && strcmp (hint, "array"))
++              {
++                fputs_filtered ("{\n", stream);
++                print_spaces_filtered (4 + 2 * recurse, stream);
++              }
++            else
++              fputs_filtered ("{", stream);
++          }
++        else
++          fputs_filtered (" = {", stream);
+        }
+-
++      else if (options->prettyprint_matrix)
++      print_spaces_filtered (4 + 2 * recurse, stream);
+       else if (! is_map || i % 2 == 0)
+       fputs_filtered (pretty ? "," : ", ", stream);
+@@ -589,6 +603,10 @@ print_children (PyObject *printer, const
+       if (is_map && i % 2 == 0)
+       fputs_filtered ("[", stream);
++      else if (options->prettyprint_matrix)
++      {
++        /* Force a do-nothing.  */
++      }
+       else if (is_array)
+       {
+         /* We print the index, not whatever the child method
+@@ -667,7 +685,12 @@ print_children (PyObject *printer, const
+         fputs_filtered ("\n", stream);
+         print_spaces_filtered (2 * recurse, stream);
+       }
+-      fputs_filtered ("}", stream);
++      if (options->prettyprint_matrix)
++      {
++      print_spaces_filtered (4 * recurse, stream);
++      fputs_filtered ("}\n", stream);
++      }
++      else fputs_filtered ("}", stream);
+     }
+  done:
+@@ -689,6 +712,7 @@ apply_val_pretty_printer (struct type *t
+   char *hint = NULL;
+   struct cleanup *cleanups;
+   int result = 0;
++  struct value_print_options *options_copy;
+   enum string_repr_result print_result;
+   /* No pretty-printer support for unavailable values.  */
+@@ -726,9 +750,21 @@ apply_val_pretty_printer (struct type *t
+   /* If we are printing a map, we want some special formatting.  */
+   hint = gdbpy_get_display_hint (printer);
++  
++  if (recurse == 0)
++    {
++      options_copy = alloca (sizeof (struct value_print_options));
++      memcpy (options_copy, options, sizeof (struct value_print_options));
++      options_copy->prettyprint_matrix = hint && !strcmp (hint, "matrix");
++    }
++  else options_copy = (struct value_print_options *)options;
++
+   make_cleanup (free_current_contents, &hint);
+   /* Print the section */
++  if (options_copy->prettyprint_matrix)
++    print_result = string_repr_none;
++else /* Red Hat 2D matrix patch */
+   print_result = print_string_repr (printer, hint, stream, recurse,
+                                   options, language, gdbarch);
+   if (print_result != string_repr_error)
+Index: gdb-7.2.50.20110218/gdb/testsuite/gdb.python/pr10659.cc
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110218/gdb/testsuite/gdb.python/pr10659.cc    2011-02-18 10:44:32.000000000 +0100
+@@ -0,0 +1,43 @@
++#include <list>
++#include <vector>  // /usr/include/c++/4.4.1/bits/vector.tcc
++#include <iostream>
++
++using namespace std;
++
++int use_windows = 9999;
++
++int
++main(){
++  vector<int> test1(2,0);
++  test1[0]=8;
++  test1[1]=9;
++  
++  vector< vector<int> > test2(3, vector<int>(2,0));
++  test2[0][0]=0;
++  test2[0][1]=1;
++  test2[1][0]=2;
++  test2[1][1]=3;
++  test2[2][0]=4;
++  test2[2][1]=5;
++
++#define NR_ROWS    2
++#define NR_COLS    3
++#define NR_PLANES  4
++  vector<int> rows(NR_ROWS, 0);
++  vector< vector<int> > columns(NR_COLS, rows);
++  vector< vector < vector<int> > > test3(NR_PLANES, columns);
++
++  cout << "rows.size() = " << rows.size()
++       << ", columns.size() = " << columns.size()
++       << ", test3.size() = " << test3.size() << "\n";
++
++  for (int i = 0; i < rows.size(); i++) {
++    for (int j = 0; j < columns.size(); j++) {
++      for (int k = 0; k < test3.size(); k++) {
++      test3[k][j][i] = k * 100 + j * 10 + i;
++      }
++    }
++  }
++  
++  return 0;  // break
++}
+Index: gdb-7.2.50.20110218/gdb/testsuite/gdb.python/pr10659.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110218/gdb/testsuite/gdb.python/pr10659.exp   2011-02-18 10:44:32.000000000 +0100
+@@ -0,0 +1,82 @@
++#Copyright 2010 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++set nl             "\[\r\n\]+"
++
++set testfile pr10659
++set srcfile ${testfile}.cc
++if [prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}] {
++    return -1
++}
++
++#if { [skip_python_tests] } { continue }
++
++gdb_test "python execfile(\"$srcdir/$subdir/pr10659.py\")" ""
++gdb_test "python gdb.pretty_printers = \[lookup_function\]" ""
++
++if ![runto_main] then {
++    fail "Can't run to main"
++    return
++}
++
++gdb_breakpoint [gdb_get_line_number "break"]
++gdb_continue_to_breakpoint "break"
++
++gdb_test "p test1" "vector of length 2, capacity 2 =.*"
++
++gdb_test "p test2" "= $nl  {$nl    {.*"
++
++# Complete result is:
++#
++# (gdb) p test2
++# $2 =
++#   {
++#     {0      1    }
++#     {2      3    }
++#     {4      5    }
++#  }
++
++
++gdb_test "p test3" "= $nl  {$nl    {$nl      {.*"
++
++# Complete result is:
++#
++# (gdb) p test3
++# $3 =
++#   {
++#     {
++#       {0        1        }
++#       {10        11        }
++#       {20        21        }
++#     }
++#     {
++#       {100        101        }
++#       {110        111        }
++#       {120        121        }
++#     }
++#     {
++#       {200        201        }
++#       {210        211        }
++#       {220        221        }
++#     }
++#     {
++#       {300        301        }
++#       {310        311        }
++#       {320        321        }
++#     }
++#  }
++# 
++
++
+Index: gdb-7.2.50.20110218/gdb/testsuite/gdb.python/pr10659.py
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110218/gdb/testsuite/gdb.python/pr10659.py    2011-02-18 10:44:32.000000000 +0100
+@@ -0,0 +1,109 @@
++# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++import gdb
++import itertools
++import re
++
++vector_sig = 'std::vector'
++vector_regex = re.compile('^' + vector_sig + '<.*>$')
++
++class FakeVectorPrinter:
++    "Print a std::vector"
++
++    class _iterator:
++        def __init__ (self, start, finish):
++            self.item = start
++            self.finish = finish
++            self.count = 0
++
++        def __iter__(self):
++            return self
++
++        def next(self):
++            if self.item == self.finish:
++                raise StopIteration
++            count = self.count
++            self.count = self.count + 1
++            elt = self.item.dereference()
++            self.item = self.item + 1
++            return ('[%d]' % count, elt)
++
++    def __init__(self, typename, val):
++        self.typename = typename
++        self.val = val
++
++    def children(self):
++        return self._iterator(self.val['_M_impl']['_M_start'],
++                              self.val['_M_impl']['_M_finish'])
++
++    def to_string(self):
++        start = self.val['_M_impl']['_M_start']
++        finish = self.val['_M_impl']['_M_finish']
++        end = self.val['_M_impl']['_M_end_of_storage']
++        return ('std::vector of length %d, capacity %d'
++                % (int (finish - start), int (end - start)))
++
++    def display_hint(self):
++        itype0  = self.val.type.template_argument(0)
++        itag = itype0.tag
++        if itag and re.match(vector_regex, itag):
++            rc = 'matrix'
++        else:
++            rc = 'array'
++        return rc
++
++def register_libstdcxx_printers (obj):
++    "Register libstdc++ pretty-printers with objfile Obj."
++
++    if obj == None:
++        obj = gdb
++
++    obj.pretty_printers.append (lookup_function)
++
++def lookup_function (val):
++    "Look-up and return a pretty-printer that can print val."
++
++    # Get the type.
++    type = val.type;
++
++    # If it points to a reference, get the reference.
++    if type.code == gdb.TYPE_CODE_REF:
++        type = type.target ()
++
++    # Get the unqualified type, stripped of typedefs.
++    type = type.unqualified ().strip_typedefs ()
++
++    # Get the type name.    
++    typename = type.tag
++    if typename == None:
++        return None
++
++    # Iterate over local dictionary of types to determine
++    # if a printer is registered for that type.  Return an
++    # instantiation of the printer if found.
++    for function in fake_pretty_printers_dict:
++        if function.search (typename):
++            return fake_pretty_printers_dict[function] (val)
++        
++    # Cannot find a pretty printer.  Return None.
++    return None
++
++def build_libfakecxx_dictionary ():
++    fake_pretty_printers_dict[vector_regex] = lambda val: FakeVectorPrinter(vector_sig, val)
++
++fake_pretty_printers_dict = {}
++
++build_libfakecxx_dictionary ()
+Index: gdb-7.2.50.20110218/gdb/valprint.c
+===================================================================
+--- gdb-7.2.50.20110218.orig/gdb/valprint.c    2011-02-18 10:44:16.000000000 +0100
++++ gdb-7.2.50.20110218/gdb/valprint.c 2011-02-18 10:44:32.000000000 +0100
+@@ -85,7 +85,8 @@ struct value_print_options user_print_op
+   1,                          /* static_field_print */
+   1,                          /* pascal_static_field_print */
+   0,                          /* raw */
+-  0                           /* summary */
++  0,                          /* summary */
++  0                           /* prettyprint_matrix */
+ };
+ /* Initialize *OPTS to be a copy of the user print options.  */
diff --git a/gdb/patches/gdb-bz568248-oom-is-error.patch b/gdb/patches/gdb-bz568248-oom-is-error.patch
new file mode 100644 (file)
index 0000000..045d34e
--- /dev/null
@@ -0,0 +1,68 @@
+http://sourceware.org/ml/gdb-patches/2010-06/msg00005.html
+Subject: [rfc patch] nomem: internal_error -> error
+
+Hi,
+
+unfortunately I see this problem reproducible only with the
+archer-jankratochvil-vla branch (VLA = Variable Length Arrays - char[var]).
+OTOH this branch I hopefully submit in some form for FSF GDB later.
+
+In this case (a general problem but tested for example on Fedora 13 i686):
+
+int
+main (int argc, char **argv)
+{
+  char a[argc];
+  return a[0];
+}
+
+(gdb) start
+(gdb) print a
+../../gdb/utils.c:1251: internal-error: virtual memory exhausted: can't allocate 4294951689 bytes.
+
+It is apparently because boundary for the variable `a' is not initialized
+there.  Users notice it due to Eclipse-CDT trying to automatically display all
+the local variables on each step.
+
+
+Apparentl no regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.
+But is anone aware of the reasons to use internal_error there?
+I find simple error as a perfectly reasonable there.
+(history only tracks it since the initial import)
+
+IIRC this idea has been discussed with Tom Tromey, not sure of its origin.
+
+I understand it may be offtopic for FSF GDB but from some GDB crashes I am not
+sure if it can happen only due to the VLA variables.
+
+
+Thanks,
+Jan
+
+
+gdb/
+2010-06-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
+           Tom Tromey  <tromey@redhat.com>
+
+       * utils.c (nomem): Change internal_error to error.
+
+Index: gdb-7.3.50.20110722/gdb/utils.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/utils.c       2011-07-22 19:28:58.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/utils.c    2011-07-22 19:34:25.000000000 +0200
+@@ -1219,13 +1219,11 @@ malloc_failure (long size)
+ {
+   if (size > 0)
+     {
+-      internal_error (__FILE__, __LINE__,
+-                    _("virtual memory exhausted: can't allocate %ld bytes."),
+-                    size);
++      error (_("virtual memory exhausted: can't allocate %ld bytes."), size);
+     }
+   else
+     {
+-      internal_error (__FILE__, __LINE__, _("virtual memory exhausted."));
++      error (_("virtual memory exhausted."));
+     }
+ }
diff --git a/gdb/patches/gdb-bz592031-siginfo-lost-4of5.patch b/gdb/patches/gdb-bz592031-siginfo-lost-4of5.patch
new file mode 100644 (file)
index 0000000..639b37d
--- /dev/null
@@ -0,0 +1,992 @@
+http://sourceware.org/ml/gdb-patches/2010-09/msg00360.html
+Subject: [patch 3/4]#3 linux-nat: Do not respawn signals
+
+Hi,
+
+linux-nat.c is fixed to never respawn signals; possibly keeping SIGSTOP
+pending, as is done in current in FSF gdbserver and as suggested by Pedro:
+       http://sourceware.org/ml/gdb-patches/2010-08/msg00544.html
+
+The last linux-nat.c removed patch chunk comes from the initial implementation
+by Mark Kettenis:
+       [PATCH] New Linux threads support
+       http://sourceware.org/ml/gdb-patches/2000-09/msg00020.html
+       92280a75e017683bf8e4f339f4f85640b0700509
+It gets in part reimplemented into the new stop_wait_callback <if (lp->step)>
+part and partially just not needed as currently GDB never drops the signals as
+it does not PTRACE_CONT the thread; signal is kept for processing:
+       "RC: Not resuming sibling %s (has pending)\n"
+
+In stop_wait_callback I believe breakpoints cancellation is not needed here,
+it would be done later.
+
+
+The testcase sigstep-threads.exp was written to catch a regression-like
+appearance then the new <if (lp->step)> part of stop_wait_callback gets
+removed.  Still the tecase fails even with FSF HEAD:
+
+32        var++;                /* step-1 */
+(gdb) step
+Program received signal SIGUSR1, User defined signal 1.
+Program received signal SIGUSR1, User defined signal 1.
+31      {                       /* step-0 */
+
+There is no reason why it shouldn't stop on line 33, between line 32 and line
+33 no signal would occur.  Stepping of the current thread should not be
+affected by whatever happens in the other threads as select_event_lwp has:
+  /* Give preference to any LWP that is being single-stepped.  */
+
+There is a problem that with FSF HEAD GDB does PTRACE_SINGLESTEP for thread A,
+PTRACE_CONT for thread B (because of set scheduler-locking off), thread B hits
+SIGUSR1, so GDB tkills thread A with SIGSTOP and it can receive SIGSTOP for
+thread A before the SIGTRAP for completed PTRACE_SINGLESTEP.  At that moment
+select_event_lwp. forgets it was stepping thread A because there is no pending
+SIGTRAP event.  currently_stepping still remembers thread A was stepping so it
+will later stop but as thread A was PTRACE_CONT-ed in the meantime it is too
+late.
+
+There is the new <if (lp->step)> part of stop_wait_callback to always track
+thread A is stepping.  Due to different scheduling without this part the
+changed GDB would very rarely stop in this testcase otherwise, making it look
+as a regression.
+
+I have some another patch I may post separately as if multiple signals happen
+besides SIGTRAP GDB still may switch from thread A away (as not considering it
+stepping) to thread B for SIGUSR and accidentally PTRACE_CONT thread A.
+But I do not find this as a prerequisite for this patchset.
+
+
+
+Thanks,
+Jan
+
+
+gdb/
+2010-09-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * linux-nat.c (stop_wait_callback): New gdb_assert.  Remove signals
+       respawning; keep TP with SIGNALLED.  New debugging message "SWC:
+       Delayed SIGSTOP caught for %s.".  Catch next signal if SIGSTOP has
+       been caught and LP->STEP is set.
+       (linux_nat_wait_1) <lp && lp->signalled>: Remove.
+
+gdb/testsuite/
+2010-09-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * gdb.threads/siginfo-threads.exp: New file.
+       * gdb.threads/siginfo-threads.c: New file.
+       * gdb.threads/sigstep-threads.exp: New file.
+       * gdb.threads/sigstep-threads.c: New file.
+
+Index: gdb-7.2.50.20110117/gdb/linux-nat.c
+===================================================================
+--- gdb-7.2.50.20110117.orig/gdb/linux-nat.c   2011-01-17 15:53:14.000000000 +0100
++++ gdb-7.2.50.20110117/gdb/linux-nat.c        2011-01-17 16:05:57.000000000 +0100
+@@ -2803,6 +2803,8 @@ stop_wait_callback (struct lwp_info *lp,
+     {
+       int status;
++      gdb_assert (lp->resumed);
++
+       status = wait_lwp (lp);
+       if (status == 0)
+       return 0;
+@@ -2828,110 +2830,61 @@ stop_wait_callback (struct lwp_info *lp,
+       if (WSTOPSIG (status) != SIGSTOP)
+       {
+-        if (linux_nat_status_is_event (status))
+-          {
+-            /* If a LWP other than the LWP that we're reporting an
+-               event for has hit a GDB breakpoint (as opposed to
+-               some random trap signal), then just arrange for it to
+-               hit it again later.  We don't keep the SIGTRAP status
+-               and don't forward the SIGTRAP signal to the LWP.  We
+-               will handle the current event, eventually we will
+-               resume all LWPs, and this one will get its breakpoint
+-               trap again.
+-
+-               If we do not do this, then we run the risk that the
+-               user will delete or disable the breakpoint, but the
+-               thread will have already tripped on it.  */
+-
+-            /* Save the trap's siginfo in case we need it later.  */
+-            save_siginfo (lp);
+-
+-            save_sigtrap (lp);
+-
+-            /* Now resume this LWP and get the SIGSTOP event.  */
+-            errno = 0;
+-            ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
+-            if (debug_linux_nat)
+-              {
+-                fprintf_unfiltered (gdb_stdlog,
+-                                    "PTRACE_CONT %s, 0, 0 (%s)\n",
+-                                    target_pid_to_str (lp->ptid),
+-                                    errno ? safe_strerror (errno) : "OK");
+-
+-                fprintf_unfiltered (gdb_stdlog,
+-                                    "SWC: Candidate SIGTRAP event in %s\n",
+-                                    target_pid_to_str (lp->ptid));
+-              }
+-            /* Hold this event/waitstatus while we check to see if
+-               there are any more (we still want to get that SIGSTOP).  */
+-            stop_wait_callback (lp, NULL);
++        /* The thread was stopped with a signal other than SIGSTOP.  */
+-            /* Hold the SIGTRAP for handling by linux_nat_wait.  If
+-               there's another event, throw it back into the
+-               queue.  */
+-            if (lp->status)
+-              {
+-                if (debug_linux_nat)
+-                  fprintf_unfiltered (gdb_stdlog,
+-                                      "SWC: kill %s, %s\n",
+-                                      target_pid_to_str (lp->ptid),
+-                                      status_to_str ((int) status));
+-                kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (lp->status));
+-              }
++        /* Save the trap's siginfo in case we need it later.  */
++        save_siginfo (lp);
+-            /* Save the sigtrap event.  */
+-            lp->status = status;
+-            return 0;
+-          }
+-        else
+-          {
+-            /* The thread was stopped with a signal other than
+-               SIGSTOP, and didn't accidentally trip a breakpoint.  */
++        save_sigtrap (lp);
+-            if (debug_linux_nat)
+-              {
+-                fprintf_unfiltered (gdb_stdlog,
+-                                    "SWC: Pending event %s in %s\n",
+-                                    status_to_str ((int) status),
+-                                    target_pid_to_str (lp->ptid));
+-              }
+-            /* Now resume this LWP and get the SIGSTOP event.  */
+-            errno = 0;
+-            ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
+-            if (debug_linux_nat)
+-              fprintf_unfiltered (gdb_stdlog,
+-                                  "SWC: PTRACE_CONT %s, 0, 0 (%s)\n",
+-                                  target_pid_to_str (lp->ptid),
+-                                  errno ? safe_strerror (errno) : "OK");
+-
+-            /* Hold this event/waitstatus while we check to see if
+-               there are any more (we still want to get that SIGSTOP).  */
+-            stop_wait_callback (lp, NULL);
++        if (debug_linux_nat)
++          fprintf_unfiltered (gdb_stdlog,
++                              "SWC: Pending event %s in %s\n",
++                              status_to_str ((int) status),
++                              target_pid_to_str (lp->ptid));
+-            /* If the lp->status field is still empty, use it to
+-               hold this event.  If not, then this event must be
+-               returned to the event queue of the LWP.  */
+-            if (lp->status)
+-              {
+-                if (debug_linux_nat)
+-                  {
+-                    fprintf_unfiltered (gdb_stdlog,
+-                                        "SWC: kill %s, %s\n",
+-                                        target_pid_to_str (lp->ptid),
+-                                        status_to_str ((int) status));
+-                  }
+-                kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (status));
+-              }
+-            else
+-              lp->status = status;
+-            return 0;
+-          }
++        /* Save the sigtrap event.  */
++        lp->status = status;
++        gdb_assert (! lp->stopped);
++        gdb_assert (lp->signalled);
++        lp->stopped = 1;
+       }
+       else
+       {
+         /* We caught the SIGSTOP that we intended to catch, so
+            there's no SIGSTOP pending.  */
+-        lp->stopped = 1;
++
++        if (debug_linux_nat)
++          fprintf_unfiltered (gdb_stdlog,
++                              "SWC: Delayed SIGSTOP caught for %s.\n",
++                              target_pid_to_str (lp->ptid));
++
++        if (lp->step)
++          {
++            /* LP->STATUS is 0 here.  That means SIGTRAP from
++               PTRACE_SINGLESTEP still has to be delivered for this inferior
++               stop.  Catching the SIGTRAP event is important to prevent
++               starvation in select_event_lwp.  */
++
++            registers_changed ();
++            linux_ops->to_resume (linux_ops, pid_to_ptid (GET_LWP (lp->ptid)),
++                                  1, TARGET_SIGNAL_0);
++            if (debug_linux_nat)
++              fprintf_unfiltered (gdb_stdlog,
++                                  "SWC: %s %s, 0, 0 (discard SIGSTOP)\n",
++                                  "PTRACE_SINGLESTEP",
++                                  target_pid_to_str (lp->ptid));
++
++            lp->stopped = 0;
++            gdb_assert (lp->resumed);
++            stop_wait_callback (lp, NULL);
++            gdb_assert (lp->stopped);
++          }
++        else
++          lp->stopped = 1;
++
++        /* Reset SIGNALLED only after the stop_wait_callback call above as
++           it does gdb_assert on SIGNALLED.  */
+         lp->signalled = 0;
+       }
+     }
+@@ -3514,52 +3467,6 @@ retry:
+       lp = NULL;
+     }
+-  if (lp && lp->signalled)
+-    {
+-      /* A pending SIGSTOP may interfere with the normal stream of
+-         events.  In a typical case where interference is a problem,
+-         we have a SIGSTOP signal pending for LWP A while
+-         single-stepping it, encounter an event in LWP B, and take the
+-         pending SIGSTOP while trying to stop LWP A.  After processing
+-         the event in LWP B, LWP A is continued, and we'll never see
+-         the SIGTRAP associated with the last time we were
+-         single-stepping LWP A.  */
+-
+-      /* Resume the thread.  It should halt immediately returning the
+-         pending SIGSTOP.  */
+-      registers_changed ();
+-      linux_ops->to_resume (linux_ops, pid_to_ptid (GET_LWP (lp->ptid)),
+-                          lp->step, TARGET_SIGNAL_0);
+-      if (debug_linux_nat)
+-      fprintf_unfiltered (gdb_stdlog,
+-                          "LLW: %s %s, 0, 0 (expect SIGSTOP)\n",
+-                          lp->step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT",
+-                          target_pid_to_str (lp->ptid));
+-      lp->stopped = 0;
+-      gdb_assert (lp->resumed);
+-
+-      /* Catch the pending SIGSTOP.  */
+-      status = lp->status;
+-      lp->status = 0;
+-
+-      stop_wait_callback (lp, NULL);
+-
+-      /* If the lp->status field isn't empty, we caught another signal
+-       while flushing the SIGSTOP.  Return it back to the event
+-       queue of the LWP, as we already have an event to handle.  */
+-      if (lp->status)
+-      {
+-        if (debug_linux_nat)
+-          fprintf_unfiltered (gdb_stdlog,
+-                              "LLW: kill %s, %s\n",
+-                              target_pid_to_str (lp->ptid),
+-                              status_to_str (lp->status));
+-        kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (lp->status));
+-      }
+-
+-      lp->status = status;
+-    }
+-
+   if (!target_can_async_p ())
+     {
+       /* Causes SIGINT to be passed on to the attached process.  */
+Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/siginfo-threads.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/siginfo-threads.c    2011-01-17 16:02:40.000000000 +0100
+@@ -0,0 +1,447 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2010 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#define _GNU_SOURCE
++#include <pthread.h>
++#include <stdio.h>
++#include <limits.h>
++#include <errno.h>
++#include <stdlib.h>
++#include <string.h>
++#include <assert.h>
++#include <sys/types.h>
++#include <signal.h>
++#include <unistd.h>
++#include <asm/unistd.h>
++
++#define gettid() syscall (__NR_gettid)
++#define tgkill(tgid, tid, sig) syscall (__NR_tgkill, tgid, tid, sig)
++
++/* Terminate always in the main task, it can lock up with SIGSTOPped GDB
++   otherwise.  */
++#define TIMEOUT (gettid () == getpid() ? 10 : 15)
++
++static pid_t thread1_tid;
++static pthread_cond_t thread1_tid_cond = PTHREAD_COND_INITIALIZER;
++static pthread_mutex_t thread1_tid_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
++static int thread1_sigusr1_hit;
++static int thread1_sigusr2_hit;
++
++static pid_t thread2_tid;
++static pthread_cond_t thread2_tid_cond = PTHREAD_COND_INITIALIZER;
++static pthread_mutex_t thread2_tid_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
++static int thread2_sigusr1_hit;
++static int thread2_sigusr2_hit;
++
++static pthread_mutex_t terminate_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
++
++/* Do not use alarm as it would create a ptrace event which would hang up us if
++   we are being traced by GDB which we stopped ourselves.  */
++
++static void timed_mutex_lock (pthread_mutex_t *mutex)
++{
++  int i;
++  struct timespec start, now;
++
++  i = clock_gettime (CLOCK_MONOTONIC, &start);
++  assert (i == 0);
++
++  do
++    {
++      i = pthread_mutex_trylock (mutex);
++      if (i == 0)
++      return;
++      assert (i == EBUSY);
++
++      i = clock_gettime (CLOCK_MONOTONIC, &now);
++      assert (i == 0);
++      assert (now.tv_sec >= start.tv_sec);
++    }
++  while (now.tv_sec - start.tv_sec < TIMEOUT);
++
++  fprintf (stderr, "Timed out waiting for internal lock!\n");
++  exit (EXIT_FAILURE);
++}
++
++static void
++handler (int signo, siginfo_t *siginfo, void *exception)
++{
++  int *varp;
++
++  assert (siginfo->si_signo == signo);
++  assert (siginfo->si_code == SI_TKILL);
++  assert (siginfo->si_pid == getpid ());
++
++  if (gettid () == thread1_tid)
++    {
++      if (signo == SIGUSR1)
++      varp = &thread1_sigusr1_hit;
++      else if (signo == SIGUSR2)
++      varp = &thread1_sigusr2_hit;
++      else
++      assert (0);
++    }
++  else if (gettid () == thread2_tid)
++    {
++      if (signo == SIGUSR1)
++      varp = &thread2_sigusr1_hit;
++      else if (signo == SIGUSR2)
++      varp = &thread2_sigusr2_hit;
++      else
++      assert (0);
++    }
++  else
++    assert (0);
++
++  if (*varp)
++    {
++      fprintf (stderr, "Signal %d for TID %lu has been already hit!\n", signo,
++             (unsigned long) gettid ());
++      exit (EXIT_FAILURE);
++    }
++  *varp = 1;
++}
++
++static void *
++thread1_func (void *unused)
++{
++  int i;
++
++  timed_mutex_lock (&thread1_tid_mutex);
++
++  /* THREAD1_TID_MUTEX must be already locked to avoid race.  */
++  thread1_tid = gettid ();
++
++  i = pthread_cond_signal (&thread1_tid_cond);
++  assert (i == 0);
++  i = pthread_mutex_unlock (&thread1_tid_mutex);
++  assert (i == 0);
++
++  /* Be sure the "t (tracing stop)" test can proceed for both threads.  */
++  timed_mutex_lock (&terminate_mutex);
++  i = pthread_mutex_unlock (&terminate_mutex);
++  assert (i == 0);
++
++  if (! thread1_sigusr1_hit)
++    {
++      fprintf (stderr, "Thread 1 signal SIGUSR1 not hit!\n");
++      exit (EXIT_FAILURE);
++    }
++  if (! thread1_sigusr2_hit)
++    {
++      fprintf (stderr, "Thread 1 signal SIGUSR2 not hit!\n");
++      exit (EXIT_FAILURE);
++    }
++
++  return NULL;
++}
++
++static void *
++thread2_func (void *unused)
++{
++  int i;
++
++  timed_mutex_lock (&thread2_tid_mutex);
++
++  /* THREAD2_TID_MUTEX must be already locked to avoid race.  */
++  thread2_tid = gettid ();
++
++  i = pthread_cond_signal (&thread2_tid_cond);
++  assert (i == 0);
++  i = pthread_mutex_unlock (&thread2_tid_mutex);
++  assert (i == 0);
++
++  /* Be sure the "t (tracing stop)" test can proceed for both threads.  */
++  timed_mutex_lock (&terminate_mutex);
++  i = pthread_mutex_unlock (&terminate_mutex);
++  assert (i == 0);
++
++  if (! thread2_sigusr1_hit)
++    {
++      fprintf (stderr, "Thread 2 signal SIGUSR1 not hit!\n");
++      exit (EXIT_FAILURE);
++    }
++  if (! thread2_sigusr2_hit)
++    {
++      fprintf (stderr, "Thread 2 signal SIGUSR2 not hit!\n");
++      exit (EXIT_FAILURE);
++    }
++
++  return NULL;
++}
++
++static const char *
++proc_string (const char *filename, const char *line)
++{
++  FILE *f;
++  static char buf[LINE_MAX];
++  size_t line_len = strlen (line);
++
++  f = fopen (filename, "r");
++  if (f == NULL)
++    {
++      fprintf (stderr, "fopen (\"%s\") for \"%s\": %s\n", filename, line,
++             strerror (errno));
++      exit (EXIT_FAILURE);
++    }
++  while (errno = 0, fgets (buf, sizeof (buf), f))
++    {
++      char *s;
++
++      s = strchr (buf, '\n');
++      assert (s != NULL);
++      *s = 0;
++
++      if (strncmp (buf, line, line_len) != 0)
++      continue;
++
++      if (fclose (f))
++      {
++        fprintf (stderr, "fclose (\"%s\") for \"%s\": %s\n", filename, line,
++                 strerror (errno));
++        exit (EXIT_FAILURE);
++      }
++
++      return &buf[line_len];
++    }
++  if (errno != 0)
++    {
++      fprintf (stderr, "fgets (\"%s\": %s\n", filename, strerror (errno));
++      exit (EXIT_FAILURE);
++    }
++  fprintf (stderr, "\"%s\": No line \"%s\" found.\n", filename, line);
++  exit (EXIT_FAILURE);
++}
++
++static unsigned long
++proc_ulong (const char *filename, const char *line)
++{
++  const char *s = proc_string (filename, line);
++  long retval;
++  char *end;
++
++  errno = 0;
++  retval = strtol (s, &end, 10);
++  if (retval < 0 || retval >= LONG_MAX || (end && *end))
++    {
++      fprintf (stderr, "\"%s\":\"%s\": %ld, %s\n", filename, line, retval,
++             strerror (errno));
++      exit (EXIT_FAILURE);
++    }
++  return retval;
++}
++
++static void
++state_wait (pid_t process, const char *wanted)
++{
++  char *filename;
++  int i;
++  struct timespec start, now;
++  const char *state;
++
++  i = asprintf (&filename, "/proc/%lu/status", (unsigned long) process);
++  assert (i > 0);
++
++  i = clock_gettime (CLOCK_MONOTONIC, &start);
++  assert (i == 0);
++
++  do
++    {
++      state = proc_string (filename, "State:\t");
++
++      /* torvalds/linux-2.6.git 464763cf1c6df632dccc8f2f4c7e50163154a2c0
++       has changed "T (tracing stop)" to "t (tracing stop)".  Make the GDB
++       testcase backward compatible with older Linux kernels.  */
++      if (strcmp (state, "T (tracing stop)") == 0)
++      state = "t (tracing stop)";
++
++      if (strcmp (state, wanted) == 0)
++      {
++        free (filename);
++        return;
++      }
++
++      if (sched_yield ())
++      {
++        perror ("sched_yield()");
++        exit (EXIT_FAILURE);
++      }
++
++      i = clock_gettime (CLOCK_MONOTONIC, &now);
++      assert (i == 0);
++      assert (now.tv_sec >= start.tv_sec);
++    }
++  while (now.tv_sec - start.tv_sec < TIMEOUT);
++
++  fprintf (stderr, "Timed out waiting for PID %lu \"%s\" (now it is \"%s\")!\n",
++         (unsigned long) process, wanted, state);
++  exit (EXIT_FAILURE);
++}
++
++static volatile pid_t tracer = 0;
++static pthread_t thread1, thread2;
++
++static void
++cleanup (void)
++{
++  printf ("Resuming GDB PID %lu.\n", (unsigned long) tracer);
++
++  if (tracer)
++    {
++      int i;
++      int tracer_save = tracer;
++
++      tracer = 0;
++
++      i = kill (tracer_save, SIGCONT);
++      assert (i == 0);
++    }
++}
++
++int
++main (int argc, char **argv)
++{
++  int i;
++  int standalone = 0;
++  struct sigaction act;
++
++  if (argc == 2 && strcmp (argv[1], "-s") == 0)
++    standalone = 1;
++  else
++    assert (argc == 1);
++
++  setbuf (stdout, NULL);
++
++  timed_mutex_lock (&thread1_tid_mutex);
++  timed_mutex_lock (&thread2_tid_mutex);
++
++  timed_mutex_lock (&terminate_mutex);
++
++  errno = 0;
++  memset (&act, 0, sizeof (act));
++  act.sa_sigaction = handler;
++  act.sa_flags = SA_RESTART | SA_SIGINFO;
++  i = sigemptyset (&act.sa_mask);
++  assert_perror (errno);
++  assert (i == 0);
++  i = sigaction (SIGUSR1, &act, NULL);
++  assert_perror (errno);
++  assert (i == 0);
++  i = sigaction (SIGUSR2, &act, NULL);
++  assert_perror (errno);
++  assert (i == 0);
++
++  i = pthread_create (&thread1, NULL, thread1_func, NULL);
++  assert (i == 0);
++
++  i = pthread_create (&thread2, NULL, thread2_func, NULL);
++  assert (i == 0);
++
++  if (!standalone)
++    {
++      tracer = proc_ulong ("/proc/self/status", "TracerPid:\t");
++      if (tracer == 0)
++      {
++        fprintf (stderr, "The testcase must be run by GDB!\n");
++        exit (EXIT_FAILURE);
++      }
++      if (tracer != getppid ())
++      {
++        fprintf (stderr, "The testcase parent must be our GDB tracer!\n");
++        exit (EXIT_FAILURE);
++      }
++    }
++
++  /* SIGCONT our debugger in the case of our crash as we would deadlock
++     otherwise.  */
++
++  atexit (cleanup);
++
++  printf ("Stopping GDB PID %lu.\n", (unsigned long) tracer);
++
++  if (tracer)
++    {
++      i = kill (tracer, SIGSTOP);
++      assert (i == 0);
++      state_wait (tracer, "T (stopped)");
++    }
++
++  /* Threads are now waiting at timed_mutex_lock (thread1_tid_mutex) and so
++     they could not trigger the signals before GDB gets unstopped later.
++     Threads get resumed at pthread_cond_wait below.  Use `while' loops for
++     protection against spurious pthread_cond_wait wakeups.  */
++
++  printf ("Waiting till the threads initialize their TIDs.\n");
++
++  while (thread1_tid == 0)
++    {
++      i = pthread_cond_wait (&thread1_tid_cond, &thread1_tid_mutex);
++      assert (i == 0);
++    }
++
++  while (thread2_tid == 0)
++    {
++      i = pthread_cond_wait (&thread2_tid_cond, &thread2_tid_mutex);
++      assert (i == 0);
++    }
++
++  printf ("Thread 1 TID = %lu, thread 2 TID = %lu, PID = %lu.\n",
++        (unsigned long) thread1_tid, (unsigned long) thread2_tid,
++        (unsigned long) getpid ());
++
++  errno = 0;
++  i = tgkill (getpid (), thread1_tid, SIGUSR1);
++  assert_perror (errno);
++  assert (i == 0);
++  i = tgkill (getpid (), thread1_tid, SIGUSR2);
++  assert_perror (errno);
++  assert (i == 0);
++  i = tgkill (getpid (), thread2_tid, SIGUSR1);
++  assert_perror (errno);
++  assert (i == 0);
++  i = tgkill (getpid (), thread2_tid, SIGUSR2);
++  assert_perror (errno);
++  assert (i == 0);
++
++  printf ("Waiting till the threads get trapped by the signals.\n");
++
++  if (tracer)
++    {
++      /* s390x-unknown-linux-gnu will fail with "R (running)".  */
++
++      state_wait (thread1_tid, "t (tracing stop)");
++
++      state_wait (thread2_tid, "t (tracing stop)");
++    }
++
++  cleanup ();
++
++  printf ("Joining the threads.\n");
++
++  i = pthread_mutex_unlock (&terminate_mutex);
++  assert (i == 0);
++
++  i = pthread_join (thread1, NULL);
++  assert (i == 0);
++
++  i = pthread_join (thread2, NULL);
++  assert (i == 0);
++
++  printf ("Exiting.\n");      /* break-at-exit */
++
++  return EXIT_SUCCESS;
++}
+Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/siginfo-threads.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/siginfo-threads.exp  2011-01-17 16:02:40.000000000 +0100
+@@ -0,0 +1,94 @@
++# Copyright 2010 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++set testfile "siginfo-threads"
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" ${binfile} executable [list debug additional_flags=-lrt]] != "" } {
++    return -1
++}
++
++clean_restart $testfile
++
++if ![runto_main] {
++    return -1
++}
++
++# `nostop noprint pass' could in some cases report false PASS due to the
++# (preempt 'handle') code path.
++
++gdb_test "handle SIGUSR1 stop print pass" "Signal\[ \t\]+Stop\[ \t\]+Print\[ \t\]+Pass to program\[ \t\]+Description\r\nSIGUSR1\[ \t\]+Yes\[ \t\]+Yes\[ \t\]+Yes\[ \t\].*"
++gdb_test "handle SIGUSR2 stop print pass" "Signal\[ \t\]+Stop\[ \t\]+Print\[ \t\]+Pass to program\[ \t\]+Description\r\nSIGUSR2\[ \t\]+Yes\[ \t\]+Yes\[ \t\]+Yes\[ \t\].*"
++
++gdb_breakpoint [gdb_get_line_number "break-at-exit"]
++
++set test "get pid"
++gdb_test_multiple "p getpid ()" $test {
++    -re " = (\[0-9\]+)\r\n$gdb_prompt $" {
++      set pid $expect_out(1,string)
++      pass $test
++    }
++}
++
++for {set sigcount 0} {$sigcount < 4} {incr sigcount} {
++    set test "catch signal $sigcount"
++    set sigusr ""
++    gdb_test_multiple "continue" $test {
++      -re "Program received signal SIGUSR(\[12\]), User defined signal \[12\]\\.\r\n.*\r\n$gdb_prompt $" {
++          set sigusr $expect_out(1,string)
++          pass $test
++      }
++    }
++    if {$sigusr == ""} {
++      return -1
++    }
++
++    set test "signal $sigcount si_signo"
++    if {$sigusr == 1} {
++      set signo 10
++    } else {
++      set signo 12
++    }
++    gdb_test_multiple {p $_siginfo.si_signo} $test {
++      -re " = $signo\r\n$gdb_prompt $" {
++          pass $test
++      }
++      -re "Attempt to extract a component of a value that is not a structure\\.\r\n$gdb_prompt $" {
++          unsupported $test
++      }
++    }
++
++    set test "signal $sigcount si_code is SI_TKILL"
++    gdb_test_multiple {p $_siginfo.si_code} $test {
++      -re " = -6\r\n$gdb_prompt $" {
++          pass $test
++      }
++      -re "Attempt to extract a component of a value that is not a structure\\.\r\n$gdb_prompt $" {
++          unsupported $test
++      }
++    }
++
++    set test "signal $sigcount si_pid"
++    gdb_test_multiple {p $_siginfo._sifields._kill.si_pid} $test {
++      -re " = $pid\r\n$gdb_prompt $" {
++          pass $test
++      }
++      -re "Attempt to extract a component of a value that is not a structure\\.\r\n$gdb_prompt $" {
++          unsupported $test
++      }
++    }
++}
++
++gdb_continue_to_breakpoint break-at-exit ".*break-at-exit.*"
+Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/sigstep-threads.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/sigstep-threads.c    2011-01-17 16:02:40.000000000 +0100
+@@ -0,0 +1,54 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2010 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#include <pthread.h>
++#include <assert.h>
++#include <signal.h>
++
++#include <asm/unistd.h>
++#include <unistd.h>
++#define tgkill(tgid, tid, sig) syscall (__NR_tgkill, (tgid), (tid), (sig))
++#define gettid() syscall (__NR_gettid)
++
++static volatile int var;
++
++static void
++handler (int signo)   /* step-0 */
++{                     /* step-0 */
++  var++;              /* step-1 */
++  tgkill (getpid (), gettid (), SIGUSR1);     /* step-2 */
++}
++
++static void *
++start (void *arg)
++{
++  signal (SIGUSR1, handler);
++  tgkill (getpid (), gettid (), SIGUSR1);
++  assert (0);
++
++  return NULL;
++}
++
++int
++main (void)
++{
++  pthread_t thread;
++
++  pthread_create (&thread, NULL, start, NULL);
++  start (NULL);       /* main-start */
++  return 0;
++}
+Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/sigstep-threads.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/sigstep-threads.exp  2011-01-17 16:02:40.000000000 +0100
+@@ -0,0 +1,74 @@
++# Copyright 2010 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++set testfile sigstep-threads
++set srcfile ${testfile}.c
++set executable ${testfile}
++set binfile ${objdir}/${subdir}/${executable}
++
++if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    untested ${testfile}.exp
++    return -1
++}
++
++clean_restart $executable
++
++if ![runto_main] {
++    return -1;
++}
++
++# `noprint' would not test the full logic of GDB.
++gdb_test "handle SIGUSR1 nostop print pass" "\r\nSIGUSR1\[ \t\]+No\[ \t\]+Yes\[ \t\]+Yes\[ \t\].*"
++
++gdb_test_no_output "set scheduler-locking off"
++
++gdb_breakpoint [gdb_get_line_number "step-1"]
++gdb_test_no_output {set $step1=$bpnum}
++gdb_continue_to_breakpoint "step-1" ".* step-1 .*"
++gdb_test_no_output {disable $step1}
++
++# 1 as we are now stopped at the `step-1' label.
++set step_at 1
++for {set i 0} {$i < 100} {incr i} {
++    set test "step $i"
++    # Presume this step failed - as in the case of a timeout.
++    set failed 1
++    gdb_test_multiple "step" $test {
++      -re "\r\nProgram received signal SIGUSR1, User defined signal 1.\r\n" {
++          exp_continue -continue_timer
++      }
++      -re "step-(\[012\]).*\r\n$gdb_prompt $" {
++          set now $expect_out(1,string)
++          if {$step_at == 2 && $now == 1} {
++              set failed 0
++          } elseif {$step_at == 1 && $now == 2} {
++              set failed 0
++              # Continue over the re-signalling back to the handle entry.
++              gdb_test_no_output {enable $step1} ""
++              gdb_test "continue" " step-1 .*" ""
++              set now 1
++              gdb_test_no_output {disable $step1} ""
++          } else  {
++              fail $test
++          }
++          set step_at $now
++      }
++    }
++    if $failed {
++      return
++    }
++}
++# We can never reliably say the racy problematic case has been tested.
++pass "step"
diff --git a/gdb/patches/gdb-bz592031-siginfo-lost-5of5.patch b/gdb/patches/gdb-bz592031-siginfo-lost-5of5.patch
new file mode 100644 (file)
index 0000000..b8212bb
--- /dev/null
@@ -0,0 +1,141 @@
+http://sourceware.org/ml/gdb-patches/2010-09/msg00361.html
+Subject: [patch 4/4]#3 Remove redundant lp->siginfo
+
+Hi,
+
+this is a simplification which should not affect GDB behavior.  As linux-nat
+now stops on each received signal without any reordering of them then
+PTRACE_GETSIGINFO is enough to access siginfo, without any need to copy it in
+advance.
+
+
+Thanks,
+Jan
+
+
+gdb/
+2010-09-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * linux-nat.c (resume_callback) <lp->stopped && lp->status == 0>
+       (linux_nat_resume): Remove LP->SIGINFO clearing.
+       (save_siginfo): Remove.
+       (stop_wait_callback) <WSTOPSIG (status) != SIGSTOP>
+       (linux_nat_filter_event) <linux_nat_status_is_event (status)>: Remove
+       the save_siginfo call.
+       (resume_stopped_resumed_lwps): Remove LP->SIGINFO clearing.
+       (linux_nat_set_siginfo_fixup): Use PTRACE_GETSIGINFO.
+       * linux-nat.h (struct lwp_info) <siginfo>: Remove.
+
+Index: gdb-7.2.50.20101116/gdb/linux-nat.c
+===================================================================
+--- gdb-7.2.50.20101116.orig/gdb/linux-nat.c   2010-11-16 09:12:26.000000000 +0100
++++ gdb-7.2.50.20101116/gdb/linux-nat.c        2010-11-16 09:13:21.000000000 +0100
+@@ -1850,7 +1850,6 @@ resume_callback (struct lwp_info *lp, vo
+                           target_pid_to_str (lp->ptid));
+       lp->stopped = 0;
+       lp->step = 0;
+-      memset (&lp->siginfo, 0, sizeof (lp->siginfo));
+       lp->stopped_by_watchpoint = 0;
+     }
+   else if (lp->stopped && debug_linux_nat)
+@@ -1993,7 +1992,6 @@ linux_nat_resume (struct target_ops *ops
+   ptid = pid_to_ptid (GET_LWP (lp->ptid));
+   linux_ops->to_resume (linux_ops, ptid, step, signo);
+-  memset (&lp->siginfo, 0, sizeof (lp->siginfo));
+   lp->stopped_by_watchpoint = 0;
+   if (debug_linux_nat)
+@@ -2503,22 +2501,6 @@ wait_lwp (struct lwp_info *lp)
+   return status;
+ }
+-/* Save the most recent siginfo for LP.  This is currently only called
+-   for SIGTRAP; some ports use the si_addr field for
+-   target_stopped_data_address.  In the future, it may also be used to
+-   restore the siginfo of requeued signals.  */
+-
+-static void
+-save_siginfo (struct lwp_info *lp)
+-{
+-  errno = 0;
+-  ptrace (PTRACE_GETSIGINFO, GET_LWP (lp->ptid),
+-        (PTRACE_TYPE_ARG3) 0, &lp->siginfo);
+-
+-  if (errno != 0)
+-    memset (&lp->siginfo, 0, sizeof (lp->siginfo));
+-}
+-
+ /* Send a SIGSTOP to LP.  */
+ static int
+@@ -2787,9 +2769,6 @@ stop_wait_callback (struct lwp_info *lp,
+       {
+         /* The thread was stopped with a signal other than SIGSTOP.  */
+-        /* Save the trap's siginfo in case we need it later.  */
+-        save_siginfo (lp);
+-
+         save_sigtrap (lp);
+         if (debug_linux_nat)
+@@ -3155,12 +3134,7 @@ linux_nat_filter_event (int lwpid, int s
+     }
+   if (linux_nat_status_is_event (status))
+-    {
+-      /* Save the trap's siginfo in case we need it later.  */
+-      save_siginfo (lp);
+-
+-      save_sigtrap (lp);
+-    }
++    save_sigtrap (lp);
+   /* Check if the thread has exited.  */
+   if ((WIFEXITED (status) || WIFSIGNALED (status))
+@@ -3763,7 +3737,6 @@ resume_stopped_resumed_lwps (struct lwp_
+       linux_ops->to_resume (linux_ops, pid_to_ptid (GET_LWP (lp->ptid)),
+                           lp->step, TARGET_SIGNAL_0);
+       lp->stopped = 0;
+-      memset (&lp->siginfo, 0, sizeof (lp->siginfo));
+       lp->stopped_by_watchpoint = 0;
+     }
+@@ -5932,11 +5905,19 @@ linux_nat_set_siginfo_fixup (struct targ
+ struct siginfo *
+ linux_nat_get_siginfo (ptid_t ptid)
+ {
+-  struct lwp_info *lp = find_lwp_pid (ptid);
++  static struct siginfo siginfo;
++  int pid;
+-  gdb_assert (lp != NULL);
++  pid = GET_LWP (ptid);
++  if (pid == 0)
++    pid = GET_PID (ptid);
++
++  errno = 0;
++  ptrace (PTRACE_GETSIGINFO, pid, (PTRACE_TYPE_ARG3) 0, &siginfo);
++  if (errno != 0)
++    memset (&siginfo, 0, sizeof (siginfo));
+-  return &lp->siginfo;
++  return &siginfo;
+ }
+ /* Provide a prototype to silence -Wmissing-prototypes.  */
+Index: gdb-7.2.50.20101116/gdb/linux-nat.h
+===================================================================
+--- gdb-7.2.50.20101116.orig/gdb/linux-nat.h   2010-11-16 07:54:36.000000000 +0100
++++ gdb-7.2.50.20101116/gdb/linux-nat.h        2010-11-16 09:12:44.000000000 +0100
+@@ -58,10 +58,6 @@ struct lwp_info
+   /* The kind of stepping of this LWP.  */
+   enum resume_step step;
+-  /* Non-zero si_signo if this LWP stopped with a trap.  si_addr may
+-     be the address of a hardware watchpoint.  */
+-  struct siginfo siginfo;
+-
+   /* STOPPED_BY_WATCHPOINT is non-zero if this LWP stopped with a data
+      watchpoint trap.  */
+   int stopped_by_watchpoint;
diff --git a/gdb/patches/gdb-bz601887-dwarf4-rh-test.patch b/gdb/patches/gdb-bz601887-dwarf4-rh-test.patch
new file mode 100644 (file)
index 0000000..4774bda
--- /dev/null
@@ -0,0 +1,240 @@
+--- /dev/null  2010-06-08 20:35:46.800278452 +0200
++++ gdb-7.1/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S        2010-06-09 15:22:57.000000000 +0200
+@@ -0,0 +1,167 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2010 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++      .file   "rh-dwarf4-x86_64.c"
++      .section        .debug_abbrev,"",@progbits
++.Ldebug_abbrev0:
++      .section        .debug_info,"",@progbits
++.Ldebug_info0:
++      .section        .debug_line,"",@progbits
++.Ldebug_line0:
++      .text
++.Ltext0:
++.globl main
++      .type   main, @function
++main:
++.LFB0:
++      .file 1 "gdb.dwarf2/rh-dwarf4-x86_64.c"
++      # gdb.dwarf2/rh-dwarf4-x86_64.c:20
++      .loc 1 20 0
++      .cfi_startproc
++      # basic block 2
++      pushq   %rbp
++      .cfi_def_cfa_offset 16
++      movq    %rsp, %rbp
++      .cfi_offset 6, -16
++      .cfi_def_cfa_register 6
++      # gdb.dwarf2/rh-dwarf4-x86_64.c:21
++      .loc 1 21 0
++      movl    $0, %eax
++      # gdb.dwarf2/rh-dwarf4-x86_64.c:22
++      .loc 1 22 0
++      leave
++      .cfi_def_cfa 7, 8
++      ret
++      .cfi_endproc
++.LFE0:
++      .size   main, .-main
++.Letext0:
++      .section        .debug_info
++      .long   0x4e    # Length of Compilation Unit Info
++      .value  0x4     # DWARF version number
++      .long   .Ldebug_abbrev0 # Offset Into Abbrev. Section
++      .byte   0x8     # Pointer Size (in bytes)
++      .uleb128 0x1    # (DIE (0xb) DW_TAG_compile_unit)
++      .long   .LASF0  # DW_AT_producer: "GNU C 4.4.4 20100503 (Red Hat 4.4.4-2)"
++      .byte   0x1     # DW_AT_language
++      .long   .LASF1  # DW_AT_name: "gdb.dwarf2/rh-dwarf4-x86_64.c"
++      .long   .LASF2  # DW_AT_comp_dir
++      .quad   .Ltext0 # DW_AT_low_pc
++      .quad   .Letext0        # DW_AT_high_pc
++      .long   .Ldebug_line0   # DW_AT_stmt_list
++      .uleb128 0x2    # (DIE (0x2d) DW_TAG_subprogram)
++                      # DW_AT_external
++      .long   .LASF3  # DW_AT_name: "main"
++      .byte   0x1     # DW_AT_decl_file (gdb.dwarf2/rh-dwarf4-x86_64.c)
++      .byte   0x13    # DW_AT_decl_line
++                      # DW_AT_prototyped
++      .long   0x4a    # DW_AT_type
++      .quad   .LFB0   # DW_AT_low_pc
++      .quad   .LFE0   # DW_AT_high_pc
++      .uleb128 0x1    # DW_AT_frame_base
++      .byte   0x9c    # DW_OP_call_frame_cfa
++      .uleb128 0x3    # (DIE (0x4a) DW_TAG_base_type)
++      .byte   0x4     # DW_AT_byte_size
++      .byte   0x5     # DW_AT_encoding
++      .ascii "int\0"  # DW_AT_name
++      .byte   0x0     # end of children of DIE 0xb
++      .section        .debug_abbrev
++      .uleb128 0x1    # (abbrev code)
++      .uleb128 0x11   # (TAG: DW_TAG_compile_unit)
++      .byte   0x1     # DW_children_yes
++      .uleb128 0x25   # (DW_AT_producer)
++      .uleb128 0xe    # (DW_FORM_strp)
++      .uleb128 0x13   # (DW_AT_language)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x3    # (DW_AT_name)
++      .uleb128 0xe    # (DW_FORM_strp)
++      .uleb128 0x1b   # (DW_AT_comp_dir)
++      .uleb128 0xe    # (DW_FORM_strp)
++      .uleb128 0x11   # (DW_AT_low_pc)
++      .uleb128 0x1    # (DW_FORM_addr)
++      .uleb128 0x12   # (DW_AT_high_pc)
++      .uleb128 0x1    # (DW_FORM_addr)
++      .uleb128 0x10   # (DW_AT_stmt_list)
++      .uleb128 0x17   # (DW_FORM_sec_offset)
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x2    # (abbrev code)
++      .uleb128 0x2e   # (TAG: DW_TAG_subprogram)
++      .byte   0x0     # DW_children_no
++      .uleb128 0x3f   # (DW_AT_external)
++      .uleb128 0x19   # (DW_FORM_flag_present)
++      .uleb128 0x3    # (DW_AT_name)
++      .uleb128 0xe    # (DW_FORM_strp)
++      .uleb128 0x3a   # (DW_AT_decl_file)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x3b   # (DW_AT_decl_line)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x27   # (DW_AT_prototyped)
++      .uleb128 0x19   # (DW_FORM_flag_present)
++      .uleb128 0x49   # (DW_AT_type)
++      .uleb128 0x13   # (DW_FORM_ref4)
++      .uleb128 0x11   # (DW_AT_low_pc)
++      .uleb128 0x1    # (DW_FORM_addr)
++      .uleb128 0x12   # (DW_AT_high_pc)
++      .uleb128 0x1    # (DW_FORM_addr)
++      .uleb128 0x40   # (DW_AT_frame_base)
++      .uleb128 0x18   # (DW_FORM_exprloc)
++      .byte   0x0
++      .byte   0x0
++      .uleb128 0x3    # (abbrev code)
++      .uleb128 0x24   # (TAG: DW_TAG_base_type)
++      .byte   0x0     # DW_children_no
++      .uleb128 0xb    # (DW_AT_byte_size)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x3e   # (DW_AT_encoding)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x3    # (DW_AT_name)
++      .uleb128 0x8    # (DW_FORM_string)
++      .byte   0x0
++      .byte   0x0
++      .byte   0x0
++      .section        .debug_pubnames,"",@progbits
++      .long   0x17    # Length of Public Names Info
++      .value  0x2     # DWARF Version
++      .long   .Ldebug_info0   # Offset of Compilation Unit Info
++      .long   0x52    # Compilation Unit Length
++      .long   0x2d    # DIE offset
++      .ascii "main\0" # external name
++      .long   0x0
++      .section        .debug_aranges,"",@progbits
++      .long   0x2c    # Length of Address Ranges Info
++      .value  0x2     # DWARF Version
++      .long   .Ldebug_info0   # Offset of Compilation Unit Info
++      .byte   0x8     # Size of Address
++      .byte   0x0     # Size of Segment Descriptor
++      .value  0x0     # Pad to 16 byte boundary
++      .value  0x0
++      .quad   .Ltext0 # Address
++      .quad   .Letext0-.Ltext0        # Length
++      .quad   0x0
++      .quad   0x0
++      .section        .debug_str,"MS",@progbits,1
++.LASF2:
++      .string "."
++.LASF0:
++      .string "GNU C 4.4.4 20100503 (Red Hat 4.4.4-2)"
++.LASF1:
++      .string "gdb.dwarf2/rh-dwarf4-x86_64.c"
++.LASF3:
++      .string "main"
++      .ident  "GCC: (GNU) 4.4.4 20100503 (Red Hat 4.4.4-2)"
++      .section        .note.GNU-stack,"",@progbits
+--- /dev/null  2010-06-08 20:35:46.800278452 +0200
++++ gdb-7.1/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c        2010-06-09 15:21:35.000000000 +0200
+@@ -0,0 +1,22 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2010 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++int
++main (void)
++{
++  return 0;
++}
+--- /dev/null  2010-06-08 20:35:46.800278452 +0200
++++ gdb-7.1/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp      2010-06-09 15:26:21.000000000 +0200
+@@ -0,0 +1,42 @@
++# Copyright 2010 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++# This test can only be run on targets which support DWARF-2 and use gas.
++# For now pick a sampling of likely targets.
++if {![istarget *-*-linux*]
++    && ![istarget *-*-gnu*]
++    && ![istarget *-*-elf*]
++    && ![istarget *-*-openbsd*]
++    && ![istarget arm-*-eabi*]
++    && ![istarget powerpc-*-eabi*]} {
++    return 0  
++}
++
++if {![istarget x86_64-*]} {
++    return 0  
++}
++
++set testfile "rh-dwarf4-x86_64"
++set srcfile ${testfile}.S
++set executable ${testfile}.x
++set binfile ${objdir}/${subdir}/${executable}
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } {
++    return -1
++}
++
++clean_restart $executable
++
++gdb_test "ptype main" {type = int \(void\)}
diff --git a/gdb/patches/gdb-bz623749-gcore-relro.patch b/gdb/patches/gdb-bz623749-gcore-relro.patch
new file mode 100644 (file)
index 0000000..4015a7a
--- /dev/null
@@ -0,0 +1,169 @@
+gdb:
+https://bugzilla.redhat.com/show_bug.cgi?id=623749
+kernel:
+https://bugzilla.redhat.com/show_bug.cgi?id=636937
+
+http://sourceware.org/ml/gdb-patches/2010-09/msg00395.html
+Subject: Re: [patch] Fix gcore writer for -Wl,-z,relro (PR corefiles/11804)
+
+gdb/testsuite/
+2010-09-22  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Fix gcore writer for -Wl,-z,relro.
+       * gdb.base/gcore-relro.exp: New file.
+       * gdb.base/gcore-relro-main.c: New file.
+       * gdb.base/gcore-relro-lib.c: New file.
+
+--- ./gdb/gcore.c      2010-09-23 20:14:56.000000000 +0200
++++ ./gdb/gcore.c      2010-09-23 20:37:56.000000000 +0200
+@@ -401,6 +401,7 @@ gcore_create_callback (CORE_ADDR vaddr, 
+   if (write == 0 && !solib_keep_data_in_core (vaddr, size))
+     {
++#if 0 /* https://bugzilla.redhat.com/show_bug.cgi?id=636937  */
+       /* See if this region of memory lies inside a known file on disk.
+        If so, we can avoid copying its contents by clearing SEC_LOAD.  */
+       struct objfile *objfile;
+@@ -433,6 +434,7 @@ gcore_create_callback (CORE_ADDR vaddr, 
+       }
+     keep:
++#endif
+       flags |= SEC_READONLY;
+     }
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/gcore-relro-lib.c
+@@ -0,0 +1,21 @@
++/* Copyright 2010 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++void
++lib (void)
++{
++}
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/gcore-relro-main.c
+@@ -0,0 +1,25 @@
++/* Copyright 2010 Free Software Foundation, Inc.
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++extern void lib (void);
++
++int
++main (void)
++{
++  lib ();
++  return 0;
++}
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/gcore-relro.exp
+@@ -0,0 +1,80 @@
++# Copyright 2010 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++if {[skip_shlib_tests]} {
++    return 0
++}
++
++set testfile "gcore-relro"
++set srcmainfile ${testfile}-main.c
++set srclibfile ${testfile}-lib.c
++set libfile ${objdir}/${subdir}/${testfile}-lib.so
++set objfile ${objdir}/${subdir}/${testfile}-main.o
++set executable ${testfile}-main
++set binfile ${objdir}/${subdir}/${executable}
++set gcorefile ${objdir}/${subdir}/${executable}.gcore
++
++if { [gdb_compile_shlib ${srcdir}/${subdir}/${srclibfile} ${libfile} {debug}] != ""
++     || [gdb_compile ${srcdir}/${subdir}/${srcmainfile} ${objfile} object {debug}] != "" } {
++     untested ${testfile}.exp
++     return -1
++}
++set opts [list debug shlib=${libfile} additional_flags=-Wl,-z,relro]
++if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } {
++     unsupported "-Wl,-z,relro compilation failed"
++     return -1
++}
++
++clean_restart $executable
++gdb_load_shlibs $libfile
++
++# Does this gdb support gcore?
++set test "help gcore"
++gdb_test_multiple $test $test {
++    -re "Undefined command: .gcore.*\r\n$gdb_prompt $" {
++      # gcore command not supported -- nothing to test here.
++      unsupported "gdb does not support gcore on this target"
++      return -1;
++    }
++    -re "Save a core file .*\r\n$gdb_prompt $" {
++      pass $test
++    }
++}
++
++if { ![runto lib] } then {
++    return -1
++}
++
++set escapedfilename [string_to_regexp ${gcorefile}]
++
++set test "save a corefile"
++gdb_test_multiple "gcore ${gcorefile}" $test {
++    -re "Saved corefile ${escapedfilename}\r\n$gdb_prompt $" {
++      pass $test
++    }
++    -re "Can't create a corefile\r\n$gdb_prompt $" {
++      unsupported $test
++      return -1
++    }
++}
++
++# Now restart gdb and load the corefile.
++
++clean_restart $executable
++gdb_load_shlibs $libfile
++
++gdb_test "core ${gcorefile}" "Core was generated by .*" "re-load generated corefile"
++
++gdb_test "frame" "#0 \[^\r\n\]* lib .*" "library got loaded"
diff --git a/gdb/patches/gdb-bz634108-solib_address.patch b/gdb/patches/gdb-bz634108-solib_address.patch
new file mode 100644 (file)
index 0000000..a442648
--- /dev/null
@@ -0,0 +1,29 @@
+Fix gdb.solib_address (fix by Phil Muldoon).
+
+--- /dev/null
++++ b/gdb/testsuite/gdb.python/rh634108-solib_address.exp
+@@ -0,0 +1,24 @@
++# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++# https://bugzilla.redhat.com/show_bug.cgi?id=634108
++
++gdb_exit
++gdb_start
++
++# Skip all tests if Python scripting is not enabled.
++if { [skip_python_tests] } { continue }
++
++gdb_test "python print gdb.solib_address(-1)" "None" "gdb.solib_address exists"
diff --git a/gdb/patches/gdb-ccache-workaround.patch b/gdb/patches/gdb-ccache-workaround.patch
new file mode 100644 (file)
index 0000000..86147bf
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/gdb/testsuite/gdb.base/macscp.exp
++++ b/gdb/testsuite/gdb.base/macscp.exp
+@@ -33,6 +33,14 @@ if [test_compiler_info gcc*] {
+     lappend options additional_flags=-g3
+ }
++# Workaround ccache making lineno non-zero for command-line definitions.
++if {[find_gcc] == "gcc" && [file executable "/usr/bin/gcc"]} {
++    set result [catch "exec which gcc" output]
++    if {$result == 0 && [string first "/ccache/" $output] >= -1} {
++       lappend options "compiler=/usr/bin/gcc"
++    }
++}
++
+ # Generate the intermediate object file.  This is required by Darwin to
+ # have access to the .debug_macinfo section.
+ if  {[gdb_compile "${srcdir}/${subdir}/macscp1.c" "${objfile}" \
diff --git a/gdb/patches/gdb-core-open-vdso-warning.patch b/gdb/patches/gdb-core-open-vdso-warning.patch
new file mode 100644 (file)
index 0000000..87ccc0b
--- /dev/null
@@ -0,0 +1,85 @@
+http://sourceware.org/ml/gdb-patches/2009-10/msg00142.html
+Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map:  Input/output error.
+
+Hi,
+
+GDB currently always prints on loading a core file:
+       warning: Can't read pathname for load map: Input/output error.
+
+The patch is not nice but it was WONTFIXed on the glibc side in:
+       http://sourceware.org/ml/libc-alpha/2009-10/msg00001.html
+
+The same message in GDB PR 8882 and glibc PR 387 was for ld-linux.so.2 l_name
+but that one is now ignored thanks to IGNORE_FIRST_LINK_MAP_ENTRY.
+
+This fix is intended for Linux system vDSO l_name which is a second entry in
+the DSO list.
+
+Regression tested on {x86_86,x86_64-m32,i686}-fedora11-linux-gnu.
+
+
+Thanks,
+Jan
+
+
+gdb/
+2009-10-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Do not print false warning on reading core file with vDSO on GNU/Linux.
+       * solib-svr4.c (svr4_current_sos): Suppress the warning if
+       MASTER_SO_LIST is still NULL.
+       * solib.c (update_solib_list): New variable saved_so_list_head.
+       Conditionally restart the function.
+
+[ Context backport.  ]
+
+Index: gdb-7.3.50.20110722/gdb/solib-svr4.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/solib-svr4.c  2011-07-22 19:26:46.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/solib-svr4.c       2011-07-22 19:29:36.000000000 +0200
+@@ -1197,8 +1197,18 @@ svr4_current_sos (void)
+         target_read_string (lm_name (new), &buffer,
+                             SO_NAME_MAX_PATH_SIZE - 1, &errcode);
+         if (errcode != 0)
+-          warning (_("Can't read pathname for load map: %s."),
+-                   safe_strerror (errcode));
++          {
++            /* During the first ever DSO list reading some strings may be
++               unreadable as residing in the ld.so readonly memory not being
++               present in a dumped core file.  Delay the error check after
++               the first pass of DSO list scanning when ld.so should be
++               already mapped in and all the DSO list l_name memory gets
++               readable.  */
++
++            if (master_so_list () != NULL)
++              warning (_("Can't read pathname for load map: %s."),
++                       safe_strerror (errcode));
++          }
+         else
+           {
+             struct build_id *build_id;
+Index: gdb-7.3.50.20110722/gdb/solib.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/solib.c       2011-06-30 21:29:54.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/solib.c    2011-07-22 19:29:10.000000000 +0200
+@@ -706,6 +706,7 @@ update_solib_list (int from_tty, struct 
+   struct target_so_ops *ops = solib_ops (target_gdbarch);
+   struct so_list *inferior = ops->current_sos();
+   struct so_list *gdb, **gdb_link;
++  struct so_list *saved_so_list_head = so_list_head;
+   /* We can reach here due to changing solib-search-path or the
+      sysroot, before having any inferior.  */
+@@ -846,6 +847,12 @@ update_solib_list (int from_tty, struct 
+         observer_notify_solib_loaded (i);
+       }
++      /* If this was the very first DSO list scan and we possibly read in ld.so
++       recheck all the formerly unreadable DSO names strings.  */
++
++      if (saved_so_list_head == NULL && so_list_head != NULL)
++      return update_solib_list (from_tty, target);
++
+       /* If a library was not found, issue an appropriate warning
+        message.  We have to use a single call to warning in case the
+        front end does something special with warnings, e.g., pop up
diff --git a/gdb/patches/gdb-dlopen-skip_inline_frames-perf.patch b/gdb/patches/gdb-dlopen-skip_inline_frames-perf.patch
new file mode 100644 (file)
index 0000000..1141dd2
--- /dev/null
@@ -0,0 +1,90 @@
+diff --git a/gdb/infrun.c b/gdb/infrun.c
+index 91e0fc2..1d7c808 100644
+--- a/gdb/infrun.c
++++ b/gdb/infrun.c
+@@ -3111,6 +3111,56 @@ fill_in_stop_func (struct gdbarch *gdbarch,
+     }
+ }
++/* Argument for at_solib_event_breakpoint_helper.  */
++
++struct solib_event_breakpoint_helper_arg
++{
++  CORE_ADDR prev_pc;
++  int shlib_bp_count;
++  int other_bp_count;
++};
++
++/* Helper for at_solib_event_breakpoint.  */
++
++static int
++at_solib_event_breakpoint_helper (struct breakpoint *b, void *argp)
++{
++  struct solib_event_breakpoint_helper_arg *arg
++    = (struct solib_event_breakpoint_helper_arg *) argp; 
++  struct bp_location *loc;
++
++  for (loc = b->loc; loc; loc = loc->next)
++    {
++      if (loc->pspace == current_program_space
++        && (loc->address == stop_pc || loc->address == arg->prev_pc))
++      {
++        if (b->type == bp_shlib_event)
++          arg->shlib_bp_count++;
++        else
++          {
++            arg->other_bp_count++;
++            return 1; /* quick exit */
++          }
++      }
++    }
++
++  return 0; /* carry on looking */
++}
++
++/* Nonzero if the location stopoed at is the shlib event breakpoint.  */
++
++static int
++at_solib_event_breakpoint (struct execution_control_state *ecs)
++{
++  struct solib_event_breakpoint_helper_arg arg;
++  arg.prev_pc = ecs->event_thread->prev_pc;
++  arg.shlib_bp_count = arg.other_bp_count = 0;
++
++  iterate_over_breakpoints (at_solib_event_breakpoint_helper, &arg);
++
++  return arg.shlib_bp_count && !arg.other_bp_count;
++}
++
+ /* Given an execution control state that has been freshly filled in
+    by an event from the inferior, figure out what it means and take
+    appropriate action.  */
+@@ -3964,11 +4014,23 @@ handle_inferior_event (struct execution_control_state *ecs)
+   ecs->random_signal = 0;
+   stopped_by_random_signal = 0;
+-  /* Hide inlined functions starting here, unless we just performed stepi or
+-     nexti.  After stepi and nexti, always show the innermost frame (not any
+-     inline function call sites).  */
+-  if (ecs->event_thread->control.step_range_end != 1)
+-    skip_inline_frames (ecs->ptid);
++  /* If we have stopped at the solib event breakpoint and
++     stop_on_solib_events is not set then we can avoid calling
++     anything that calls find_pc_section.  This saves a lot
++     of time when the inferior loads a lot of shared libraries,
++     because otherwise the section map gets regenerated every
++     time we stop.  */
++  if (stop_on_solib_events
++      || ecs->event_thread->suspend.stop_signal != TARGET_SIGNAL_TRAP
++      || stop_after_trap
++      || !at_solib_event_breakpoint (ecs))
++    {
++      /* Hide inlined functions starting here, unless we just
++       performed stepi or nexti.  After stepi and nexti, always show
++       the innermost frame (not any inline function call sites).  */
++      if (ecs->event_thread->control.step_range_end != 1)
++      skip_inline_frames (ecs->ptid);
++    }
+   if (ecs->event_thread->suspend.stop_signal == TARGET_SIGNAL_TRAP
+       && ecs->event_thread->control.trap_expected
diff --git a/gdb/patches/gdb-dlopen-stap-probe-test.patch b/gdb/patches/gdb-dlopen-stap-probe-test.patch
new file mode 100644 (file)
index 0000000..55a6a92
--- /dev/null
@@ -0,0 +1,408 @@
+commit 5bfdc32cd3bf373c3b02e1fd864ed8ceab0292b2
+Author: Jan Kratochvil <jan.kratochvil@redhat.com>
+Date:   Mon Aug 8 12:08:53 2011 +0200
+
+    +testcase
+
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.threads/dlopen-libpthread-lib.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.threads/dlopen-libpthread-lib.c      2011-08-10 18:30:56.000000000 +0200
+@@ -0,0 +1,40 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2011 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#include <pthread.h>
++#include <assert.h>
++
++static void *
++tfunc (void *arg)
++{
++  void (*notifyp) (void) = arg;
++
++  notifyp ();
++}
++
++void
++f (void (*notifyp) (void))
++{
++  pthread_t t;
++  int i;
++
++  i = pthread_create (&t, NULL, tfunc, notifyp);
++  assert (i == 0);
++
++  i = pthread_join (t, NULL);
++  assert (i == 0);
++}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.threads/dlopen-libpthread.c
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.threads/dlopen-libpthread.c  2011-08-10 18:30:56.000000000 +0200
+@@ -0,0 +1,46 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2011 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#include <dlfcn.h>
++#include <stddef.h>
++#include <assert.h>
++
++static const char *volatile filename;
++
++static void
++notify (void)
++{
++  filename = NULL; /* notify-here */
++}
++
++int
++main (void)
++{
++  void *h;
++  void (*fp) (void (*) (void));
++
++  assert (filename != NULL);
++  h = dlopen (filename, RTLD_LAZY);
++  assert (h != NULL);
++
++  fp = dlsym (h, "f");
++  assert (fp != NULL);
++
++  fp (notify);
++
++  return 0;
++}
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.threads/dlopen-libpthread.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.threads/dlopen-libpthread.exp        2011-08-10 18:30:56.000000000 +0200
+@@ -0,0 +1,74 @@
++# Copyright 2011 Free Software Foundation, Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++if {![istarget *-linux*] || [skip_shlib_tests]} {
++    return 0
++}
++
++load_lib prelink-support.exp
++
++set testfile "dlopen-libpthread"
++set srcmainfile ${testfile}.c
++set srclibfile ${testfile}-lib.c
++set executable ${testfile}
++set binfile_lib ${objdir}/${subdir}/${executable}.so
++set binfile ${objdir}/${subdir}/${executable}
++set lib_dlopen [shlib_target_file ${executable}.so]
++
++# Use build_executable_own_libs as prelinked libpthread.so can produce false
++# PASS - it is OK if GDB processes it still before relocation.
++
++set relink_args [build_executable_own_libs ${testfile}.exp ${executable}.so $srclibfile {debug shlib_pthreads} no]
++if {$relink_args == "" || ![prelink_no $relink_args]
++    || [prepare_for_testing ${testfile}.exp ${executable} ${srcmainfile} {debug shlib_load}] } {
++    return -1
++}
++gdb_load_shlibs $binfile_lib
++
++if { ![runto_main] } {
++    return -1
++}
++
++set test "print _dl_debug_notify"
++gdb_test_multiple $test $test {
++    -re " 0x\[0-9a-f\]+ <_dl_debug_notify>\r\n$gdb_prompt $" {
++      pass $test
++    }
++    -re "No symbol \"_dl_debug_notify\" in current context\\.\r\n$gdb_prompt $" {
++      xfail $test
++      untested ${testfile}.exp
++      return
++    }
++}
++
++set test "libpthread.so not found"
++gdb_test_multiple "info sharedlibrary" $test {
++    -re "/libpthread\\.so.*\r\n$gdb_prompt $" {
++      fail $test
++    }
++    -re "/libc\\.so.*\r\n$gdb_prompt $" {
++      pass $test
++    }
++}
++
++gdb_test "set variable filename=\"$lib_dlopen\""
++
++gdb_breakpoint "notify"
++
++# The error was:
++# Cannot find new threads: generic error
++gdb_continue_to_breakpoint "notify" ".* notify-here .*"
++
++gdb_test "info sharedlibrary" {/libpthread\.so.*} "libpthread.so found"
+Index: gdb-7.3.50.20110722/gdb/testsuite/lib/gdb.exp
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/testsuite/lib/gdb.exp 2011-08-10 18:30:55.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/testsuite/lib/gdb.exp      2011-08-10 18:30:56.000000000 +0200
+@@ -3563,30 +3563,49 @@ proc build_executable { testname executa
+         set sources ${executable}.c
+     }
+-    set binfile ${objdir}/${subdir}/${executable}
+-
+-    set objects {}
+-    for {set i 0} "\$i<[llength $sources]" {incr i} {
+-        set s [lindex $sources $i]
+-        if  { [gdb_compile "${srcdir}/${subdir}/${s}" "${binfile}${i}.o" object $options] != "" } {
+-            untested $testname
+-            return -1
+-        }
+-        lappend objects "${binfile}${i}.o"
++    # get_compiler_info by gdb_compile_shlib and gdb_compile_shlib_pthreads.
++    set info_options ""
++    if { [lsearch -exact $options "c++"] >= 0 } {
++      set info_options "c++"
+     }
+-    
+-    if  { [gdb_compile $objects "${binfile}" executable $options] != "" } {
+-        untested $testname
++    if [get_compiler_info binfile_unused ${info_options}] {
+         return -1
+     }
+-    set info_options ""
+-    if { [lsearch -exact $options "c++"] >= 0 } {
+-      set info_options "c++"
++    set binfile ${objdir}/${subdir}/${executable}
++
++    set func gdb_compile
++    set func_index [lsearch -regexp $options {^(pthreads|shlib|shlib_pthreads)$}]
++    if {$func_index != -1} {
++      set func "${func}_[lindex $options $func_index]"
+     }
+-    if [get_compiler_info ${binfile} ${info_options}] {
++
++    # gdb_compile_shlib and gdb_compile_shlib_pthreads do not use the 3rd
++    # parameter.  They also requires $sources while gdb_compile and
++    # gdb_compile_pthreads require $objects.
++    if [string match gdb_compile_shlib* $func] {
++      set sources_path {}
++      foreach s $sources {
++          lappend sources_path "${srcdir}/${subdir}/${s}"
++      }
++      set ret [$func $sources_path "${binfile}" $options]
++    } else {
++      set objects {}
++      for {set i 0} "\$i<[llength $sources]" {incr i} {
++          set s [lindex $sources $i]
++          if  { [gdb_compile "${srcdir}/${subdir}/${s}" "${binfile}${i}.o" object $options] != "" } {
++              untested $testname
++              return -1
++          }
++          lappend objects "${binfile}${i}.o"
++      }
++      set ret [$func $objects "${binfile}" executable $options]
++    }
++    if  { $ret != "" } {
++        untested $testname
+         return -1
+     }
++
+     return 0
+ }
+Index: gdb-7.3.50.20110722/gdb/testsuite/lib/prelink-support.exp
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/testsuite/lib/prelink-support.exp     2011-01-01 16:33:52.000000000 +0100
++++ gdb-7.3.50.20110722/gdb/testsuite/lib/prelink-support.exp  2011-08-10 19:25:41.000000000 +0200
+@@ -95,8 +95,9 @@ proc file_copy {src dest} {
+ # Wrap function build_executable so that the resulting executable is fully
+ # self-sufficient (without dependencies on system libraries).  Parameter
+ # INTERP may be used to specify a loader (ld.so) to be used that is
+-# different from the default system one.  Libraries on which the executable
+-# depends are copied into directory DIR.  Default DIR value to
++# different from the default system one.  INTERP can be set to "no" if no ld.so
++# copy should be made.  Libraries on which the executable depends are copied
++# into directory DIR.  Default DIR value to
+ # `${objdir}/${subdir}/${EXECUTABLE}.d'.
+ #
+ # In case of success, return a string containing the arguments to be used
+@@ -151,8 +152,15 @@ proc build_executable_own_libs {testname
+     if {$interp == ""} {
+       set interp_system [section_get $binfile .interp]
+-      set interp ${dir}/[file tail $interp_system]
+-      file_copy $interp_system $interp
++      if {$interp_system == ""} {
++          fail "$test could not find .interp"
++      } else {
++          set interp ${dir}/[file tail $interp_system]
++          file_copy $interp_system $interp
++      }
++    }
++    if {$interp == "no"} {
++      set interp ""
+     }
+     set dests {}
+@@ -164,13 +172,19 @@ proc build_executable_own_libs {testname
+     # Do not lappend it so that "-rpath $dir" overrides any possible "-rpath"s
+     # specified by the caller to be able to link it for ldd" above.
+-    set options [linsert $options 0 "ldflags=-Wl,--dynamic-linker,$interp,-rpath,$dir"]
++    set options [linsert $options 0 "ldflags=-Wl,-rpath,$dir"]
++    if {$interp != ""} {
++      set options [linsert $options 0 "ldflags=-Wl,--dynamic-linker,$interp"]
++    }
+     if {[build_executable $testname $executable $sources $options] == -1} {
+       return ""
+     }
+-    set prelink_args "--dynamic-linker=$interp --ld-library-path=$dir $binfile $interp [concat $dests]"
++    set prelink_args "--ld-library-path=$dir $binfile [concat $dests]"
++    if {$interp != ""} {
++      set prelink_args "--dynamic-linker=$interp $prelink_args $interp"
++    }
+     return $prelink_args
+ }
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.base/break-interp.exp
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/testsuite/gdb.base/break-interp.exp   2011-07-01 21:12:12.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.base/break-interp.exp        2011-08-10 18:32:21.000000000 +0200
+@@ -108,14 +108,20 @@ proc strip_debug {dest} {
+     }
+ }
++# Former symbol for solib changes notifications was _dl_debug_state, newer one
++# is _dl_debug_notify, the right one one traps by `set stop-on-solib-events 1'.
++
++set solib_bp {(_dl_debug_state|_dl_debug_notify)}
++
+ # Implementation of reach.
+ proc reach_1 {func command displacement} {
+-    global gdb_prompt expect_out
++    global gdb_prompt expect_out solib_bp
+-    if {$func == "_dl_debug_state"} {
++    if {$func == $solib_bp} {
+       # Breakpoint on _dl_debug_state can have problems due to its overlap
+       # with the existing internal breakpoint from GDB.
++      # With also _dl_debug_notify we would need even two breakpoints.
+       gdb_test_no_output "set stop-on-solib-events 1"
+     } elseif {! [gdb_breakpoint $func allow-pending]} {
+       return
+@@ -141,21 +147,21 @@ proc reach_1 {func command displacement}
+           exp_continue
+       }
+       -re "Breakpoint \[0-9\]+, \\.?(__GI_)?$func \\(.*\\) at .*:\[0-9\]+\r\n.*$gdb_prompt $" {
+-          if {$func == "_dl_debug_state"} {
++          if {$func == $solib_bp} {
+               fail $test
+           } else {
+               pass $test
+           }
+       }
+       -re "Breakpoint \[0-9\]+, \[0-9xa-f\]+ in \\.?(__GI_)?$func \\(\\).*\r\n$gdb_prompt $" {
+-          if {$func == "_dl_debug_state"} {
++          if {$func == $solib_bp} {
+               fail $test
+           } else {
+               pass $test
+           }
+       }
+       -re "Stopped due to shared library event\r\n$gdb_prompt $" {
+-          if {$func == "_dl_debug_state"} {
++          if {$func == $solib_bp} {
+               if {$debug_state_count == 0} {
+                   # First stop does not yet relocate the _start function
+                   # descriptor on ppc64.
+@@ -174,7 +180,7 @@ proc reach_1 {func command displacement}
+       fail $test_displacement
+     }
+-    if {$func == "_dl_debug_state"} {
++    if {$func == $solib_bp} {
+       gdb_test_no_output "set stop-on-solib-events 0"
+     }
+ }
+@@ -373,7 +379,7 @@ proc test_attach {file displacement {rel
+ }
+ proc test_ld {file ifmain trynosym displacement} {
+-    global srcdir subdir gdb_prompt expect_out inferior_exited_re
++    global srcdir subdir gdb_prompt expect_out inferior_exited_re solib_bp
+     # First test normal `file'-command loaded $FILE with symbols.
+@@ -401,9 +407,9 @@ proc test_ld {file ifmain trynosym displ
+       gdb_test_no_output "set args ${objdir}/${subdir}/$binfile_test" "set args OBJDIR/${subdir}/$binfile_test"
+     }
+-    reach "_dl_debug_state" "run" $displacement
++    reach $solib_bp "run" $displacement
+-    gdb_test "bt" "#0 +\[^\r\n\]*\\m(__GI_)?_dl_debug_state\\M.*" "dl bt"
++    gdb_test "bt" "#0 +\[^\r\n\]*\\m(__GI_)?$solib_bp\\M.*" "dl bt"
+     if $ifmain {
+       reach "main" continue "NONE"
+@@ -415,7 +421,7 @@ proc test_ld {file ifmain trynosym displ
+     # Try re-run if the new PIE displacement takes effect.
+     gdb_test "kill" "" "kill" {Kill the program being debugged\? \(y or n\) } "y"
+-    reach "_dl_debug_state" "run" $displacement
++    reach $solib_bp "run" $displacement
+     if $ifmain {
+       test_core $file $displacement
+@@ -448,7 +454,7 @@ proc test_ld {file ifmain trynosym displ
+     gdb_test "exec-file $file" "exec-file $escapedfile" "load"
+     if $ifmain {
+-      reach "_dl_debug_state" run $displacement
++      reach $solib_bp run $displacement
+       # Use two separate gdb_test_multiple statements to avoid timeouts due
+       # to slow processing of wildcard capturing long output
diff --git a/gdb/patches/gdb-dlopen-stap-probe.patch b/gdb/patches/gdb-dlopen-stap-probe.patch
new file mode 100644 (file)
index 0000000..5352299
--- /dev/null
@@ -0,0 +1,358 @@
+From: Gary Benson <gbenson@redhat.com>
+To: Jan Kratochvil <jan.kratochvil@redhat.com>
+Message-ID: <20110810133605.GB7294@redhat.com>
+
+diff --git a/gdb/infrun.c b/gdb/infrun.c
+index 4296d3a..fd5e9c3 100644
+--- a/gdb/infrun.c
++++ b/gdb/infrun.c
+@@ -321,6 +323,13 @@ static struct symbol *step_start_function;
+ /* Nonzero if we want to give control to the user when we're notified
+    of shared library events by the dynamic linker.  */
+ int stop_on_solib_events;
++
++static void
++set_stop_on_solib_events (char *args, int from_tty, struct cmd_list_element *c)
++{
++  update_solib_breakpoints ();
++} 
++
+ static void
+ show_stop_on_solib_events (struct ui_file *file, int from_tty,
+                          struct cmd_list_element *c, const char *value)
+@@ -7153,7 +7162,7 @@ Show stopping for shared library events."), _("\
+ If nonzero, gdb will give control to the user when the dynamic linker\n\
+ notifies gdb of shared library events.  The most common event of interest\n\
+ to the user would be loading/unloading of a new library."),
+-                          NULL,
++                          set_stop_on_solib_events,
+                           show_stop_on_solib_events,
+                           &setlist, &showlist);
+diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
+index dffc621..73cbe1c 100644
+--- a/gdb/solib-svr4.c
++++ b/gdb/solib-svr4.c
+@@ -48,6 +48,8 @@
+ #include "auxv.h"
+ #include "exceptions.h"
++#include "stap-probe.h"
++
+ static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
+ static int svr4_have_link_map_offsets (void);
+ static void svr4_relocate_main_executable (void);
+@@ -92,6 +94,32 @@ static const char * const solib_break_names[] =
+   NULL
+ };
++/* A list of SystemTap probes which, if present in the dynamic linker,
++   allow more fine-grained breakpoints to be placed on shared library
++   events.  */
++
++struct probe_info
++  {
++    /* The name of the probe.  */
++    const char *name;
++
++    /* Nonzero if this probe must be stopped at even when
++       stop-on-solib-events is off.  */
++    int mandatory;
++  };
++
++static const struct probe_info probe_info[] =
++{
++  {"rtld_init_start", 0},
++  {"rtld_init_complete", 1},
++  {"rtld_map_start", 0},
++  {"rtld_reloc_complete", 1},
++  {"rtld_unmap_start", 0},
++  {"rtld_unmap_complete", 1},
++};
++
++#define NUM_PROBES (sizeof(probe_info) / sizeof(probe_info[0]))
++
+ static const char * const bkpt_names[] =
+ {
+   "_start",
+@@ -335,6 +363,12 @@ struct svr4_info
+   CORE_ADDR interp_text_sect_high;
+   CORE_ADDR interp_plt_sect_low;
+   CORE_ADDR interp_plt_sect_high;
++
++  /* SystemTap probes.  */
++  VEC (stap_probe_p) *probes[NUM_PROBES];
++
++  /* Nonzero if we are using the SystemTap interface.  */
++  int using_probes;
+ };
+ /* Per-program-space data key.  */
+@@ -344,8 +378,15 @@ static void
+ svr4_pspace_data_cleanup (struct program_space *pspace, void *arg)
+ {
+   struct svr4_info *info;
++  int i;
+   info = program_space_data (pspace, solib_svr4_pspace_data);
++  if (info == NULL)
++    return;
++
++  for (i = 0; i < NUM_PROBES; i++)
++    VEC_free (stap_probe_p, info->probes[i]);
++
+   xfree (info);
+ }
+@@ -1321,6 +1362,126 @@ exec_entry_point (struct bfd *abfd, struct target_ops *targ)
+                                            targ);
+ }
++/* Helper function for svr4_update_solib_event_breakpoints.  */
++
++static int
++svr4_update_solib_event_breakpoint (struct breakpoint *b, void *arg)
++{
++  struct svr4_info *info = get_svr4_info ();
++  struct bp_location *loc;
++
++  if (b->type != bp_shlib_event)
++    return 0;
++
++  for (loc = b->loc; loc; loc = loc->next)
++    {
++      int i;
++
++      for (i = 0; i < NUM_PROBES; i++)
++      {
++        if (!probe_info[i].mandatory)
++          {
++            const struct stap_probe *probe;
++            int ix;
++
++            for (ix = 0;
++                 VEC_iterate (stap_probe_p, info->probes[i], ix, probe);
++                 ++ix)
++              {
++                if (loc->pspace == current_program_space
++                    && loc->address == probe->address)
++                  {
++                    b->enable_state =
++                      stop_on_solib_events ? bp_enabled : bp_disabled;
++                    return 0;
++                  }
++              }
++          }
++      }
++    }
++
++  return 0;
++}
++
++/* Enable or disable optional solib event breakpoints as appropriate.
++   Called whenever stop_on_solib_events is changed.  */
++
++static void
++svr4_update_solib_event_breakpoints (void)
++{
++  struct svr4_info *info = get_svr4_info ();
++
++  if (info->using_probes)
++    iterate_over_breakpoints (svr4_update_solib_event_breakpoint, NULL);
++}
++
++/* Both the SunOS and the SVR4 dynamic linkers call a marker function
++   before and after mapping and unmapping shared libraries.  The sole
++   purpose of this method is to allow debuggers to set a breakpoint so
++   they can track these changes.
++
++   Some versions of the glibc dynamic linker contain SystemTap probes
++   to allow more fine grained stopping.  Given the address of the
++   original marker function, this function attempts to find these
++   probes, and if found, sets breakpoints on those instead.  If the
++   probes aren't found, a single breakpoint is set on the original
++   SVR4 marker function.  */
++
++static void
++svr4_create_solib_event_breakpoints (struct gdbarch *gdbarch, CORE_ADDR address)
++{
++  struct svr4_info *info = get_svr4_info ();
++  struct obj_section *os;
++
++  os = find_pc_section (address);
++  if (os != NULL)
++    {
++      int all_probes_found = 1;
++      int i;
++
++      for (i = 0; i < NUM_PROBES; i++)
++      {
++        info->probes[i] = find_probes_in_objfile (os->objfile, "rtld",
++                                                  probe_info[i].name);
++
++        if (!VEC_length(stap_probe_p, info->probes[i]))
++          {
++            int j;
++
++            for (j = i - 1; j >= 0; j--)
++              {
++                VEC_free (stap_probe_p, info->probes[j]);
++                info->probes[j] = NULL;
++              }
++
++            all_probes_found = 0;
++            break;
++          }
++      }
++
++      if (all_probes_found)
++      {
++        info->using_probes = 1;
++
++        for (i = 0; i < NUM_PROBES; i++)
++          {
++            const struct stap_probe *probe;
++            int ix;
++
++            for (ix = 0;
++                 VEC_iterate (stap_probe_p, info->probes[i], ix, probe);
++                 ++ix)
++              create_solib_event_breakpoint (gdbarch, probe->address);
++          }
++
++        svr4_update_solib_event_breakpoints ();
++        return;
++      }
++    }
++
++  create_solib_event_breakpoint (gdbarch, address);
++}
++
+ /*
+    LOCAL FUNCTION
+@@ -1372,10 +1533,18 @@ enable_break (struct svr4_info *info, int from_tty)
+   asection *interp_sect;
+   gdb_byte *interp_name;
+   CORE_ADDR sym_addr;
++  int i;
+   info->interp_text_sect_low = info->interp_text_sect_high = 0;
+   info->interp_plt_sect_low = info->interp_plt_sect_high = 0;
++  for (i = 0; i < NUM_PROBES; i++)
++    {
++      VEC_free (stap_probe_p, info->probes[i]);
++      info->probes[i] = NULL;
++    }
++  info->using_probes = 0;
++
+   /* If we already have a shared library list in the target, and
+      r_debug contains r_brk, set the breakpoint there - this should
+      mean r_brk has already been relocated.  Assume the dynamic linker
+@@ -1407,7 +1576,7 @@ enable_break (struct svr4_info *info, int from_tty)
+        That knowledge is encoded in the address, if it's Thumb the low bit
+        is 1.  However, we've stripped that info above and it's not clear
+        what all the consequences are of passing a non-addr_bits_remove'd
+-       address to create_solib_event_breakpoint.  The call to
++       address to svr4_create_solib_event_breakpoints.  The call to
+        find_pc_section verifies we know about the address and have some
+        hope of computing the right kind of breakpoint to use (via
+        symbol info).  It does mean that GDB needs to be pointed at a
+@@ -1445,7 +1614,7 @@ enable_break (struct svr4_info *info, int from_tty)
+               + bfd_section_size (tmp_bfd, interp_sect);
+           }
+-        create_solib_event_breakpoint (target_gdbarch, sym_addr);
++        svr4_create_solib_event_breakpoints (target_gdbarch, sym_addr);
+         return 1;
+       }
+     }
+@@ -1599,7 +1768,8 @@ enable_break (struct svr4_info *info, int from_tty)
+       if (sym_addr != 0)
+       {
+-        create_solib_event_breakpoint (target_gdbarch, load_addr + sym_addr);
++        svr4_create_solib_event_breakpoints (target_gdbarch,
++                                             load_addr + sym_addr);
+         xfree (interp_name);
+         return 1;
+       }
+@@ -1625,7 +1795,7 @@ enable_break (struct svr4_info *info, int from_tty)
+         sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch,
+                                                        sym_addr,
+                                                        &current_target);
+-        create_solib_event_breakpoint (target_gdbarch, sym_addr);
++        svr4_create_solib_event_breakpoints (target_gdbarch, sym_addr);
+         return 1;
+       }
+     }
+@@ -1641,7 +1811,7 @@ enable_break (struct svr4_info *info, int from_tty)
+             sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch,
+                                                            sym_addr,
+                                                            &current_target);
+-            create_solib_event_breakpoint (target_gdbarch, sym_addr);
++            svr4_create_solib_event_breakpoints (target_gdbarch, sym_addr);
+             return 1;
+           }
+       }
+@@ -2470,4 +2640,5 @@ _initialize_svr4_solib (void)
+   svr4_so_ops.lookup_lib_global_symbol = elf_lookup_lib_symbol;
+   svr4_so_ops.same = svr4_same;
+   svr4_so_ops.keep_data_in_core = svr4_keep_data_in_core;
++  svr4_so_ops.update_breakpoints = svr4_update_solib_event_breakpoints;
+ }
+diff --git a/gdb/solib.c b/gdb/solib.c
+index 3296ed4..7ba70ce 100644
+--- a/gdb/solib.c
++++ b/gdb/solib.c
+@@ -1313,6 +1313,18 @@ no_shared_libraries (char *ignored, int from_tty)
+   objfile_purge_solibs ();
+ }
++/* Enable or disable optional solib event breakpoints as appropriate.  */
++
++void
++update_solib_breakpoints (void)
++{
++  struct target_so_ops *ops = solib_ops (target_gdbarch);
++
++  if (ops->update_breakpoints != NULL)
++    ops->update_breakpoints ();
++}
++  
++
+ /* Reload shared libraries, but avoid reloading the same symbol file
+    we already have loaded.  */
+diff --git a/gdb/solib.h b/gdb/solib.h
+index c473d85..7b3881c 100644
+--- a/gdb/solib.h
++++ b/gdb/solib.h
+@@ -78,4 +78,8 @@ extern void set_solib_ops (struct gdbarch *gdbarch,
+ extern int libpthread_name_p (const char *name);
++/* Enable or disable optional solib event breakpoints as appropriate.  */
++
++extern void update_solib_breakpoints (void);
++
+ #endif /* SOLIB_H */
+diff --git a/gdb/solist.h b/gdb/solist.h
+index dad11be..14ede10 100644
+--- a/gdb/solist.h
++++ b/gdb/solist.h
+@@ -137,6 +137,13 @@ struct target_so_ops
+        core file (in particular, for readonly sections).  */
+     int (*keep_data_in_core) (CORE_ADDR vaddr,
+                             unsigned long size);
++
++    /* Enable or disable optional solib event breakpoints as
++       appropriate.  This should be called whenever
++       stop_on_solib_events is changed.  This pointer can be
++       NULL, in which case no enabling or disabling is necessary
++       for this target.  */
++    void (*update_breakpoints) (void);
+   };
+ /* Free the memory associated with a (so_list *).  */
diff --git a/gdb/patches/gdb-follow-child-stale-parent.patch b/gdb/patches/gdb-follow-child-stale-parent.patch
new file mode 100644 (file)
index 0000000..336790c
--- /dev/null
@@ -0,0 +1,27 @@
+Problem occurs with python and its get_current_arch () as it selects
+selected_frame and current_frame while still inferior_ptid is valid for the
+original parent.  But since this place it is already attached and later
+unwinders try to access it, breaking:
+  -PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the first fork
+  -PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the first fork
+  -PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the second fork
+  -PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the second fork
+  -PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: finish
+  +FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the first fork
+  +FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the first fork
+  +FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the second fork
+  +FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the second fork
+  +FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: finish
+
+--- ./gdb/infrun.c     2009-12-21 20:26:30.000000000 +0100
++++ ./gdb/infrun.c     2009-12-21 20:26:11.000000000 +0100
+@@ -375,6 +375,9 @@ follow_fork (void)
+         }
+       else
+         {
++          /* Possibly referenced PARENT is no longer valid.  */
++          reinit_frame_cache ();
++
+           /* This pending follow fork event is now handled, one way
+              or another.  The previous selected thread may be gone
+              from the lists by now, but if it is still around, need
diff --git a/gdb/patches/gdb-fortran-common-reduce.patch b/gdb/patches/gdb-fortran-common-reduce.patch
new file mode 100644 (file)
index 0000000..fe1199f
--- /dev/null
@@ -0,0 +1,507 @@
+Index: gdb-7.2.50.20110117/gdb/f-lang.c
+===================================================================
+--- gdb-7.2.50.20110117.orig/gdb/f-lang.c      2011-01-07 20:36:16.000000000 +0100
++++ gdb-7.2.50.20110117/gdb/f-lang.c   2011-01-17 15:56:07.000000000 +0100
+@@ -57,20 +57,6 @@ typedef struct saved_bf_symnum SAVED_BF,
+ /* Local functions */
+ extern void _initialize_f_language (void);
+-#if 0
+-static void clear_function_list (void);
+-static long get_bf_for_fcn (long);
+-static void clear_bf_list (void);
+-static void patch_all_commons_by_name (char *, CORE_ADDR, int);
+-static SAVED_F77_COMMON_PTR find_first_common_named (char *);
+-static void add_common_entry (struct symbol *);
+-static void add_common_block (char *, CORE_ADDR, int, char *);
+-static SAVED_FUNCTION *allocate_saved_function_node (void);
+-static SAVED_BF_PTR allocate_saved_bf_node (void);
+-static COMMON_ENTRY_PTR allocate_common_entry_node (void);
+-static SAVED_F77_COMMON_PTR allocate_saved_f77_common_node (void);
+-static void patch_common_entries (SAVED_F77_COMMON_PTR, CORE_ADDR, int);
+-#endif
+ static void f_printchar (int c, struct type *type, struct ui_file * stream);
+ static void f_emit_char (int c, struct type *type,
+@@ -461,185 +447,7 @@ _initialize_f_language (void)
+   add_language (&f_language_defn);
+ }
+-#if 0
+-static SAVED_BF_PTR
+-allocate_saved_bf_node (void)
+-{
+-  SAVED_BF_PTR new;
+-
+-  new = (SAVED_BF_PTR) xmalloc (sizeof (SAVED_BF));
+-  return (new);
+-}
+-
+-static SAVED_FUNCTION *
+-allocate_saved_function_node (void)
+-{
+-  SAVED_FUNCTION *new;
+-
+-  new = (SAVED_FUNCTION *) xmalloc (sizeof (SAVED_FUNCTION));
+-  return (new);
+-}
+-
+-static SAVED_F77_COMMON_PTR
+-allocate_saved_f77_common_node (void)
+-{
+-  SAVED_F77_COMMON_PTR new;
+-
+-  new = (SAVED_F77_COMMON_PTR) xmalloc (sizeof (SAVED_F77_COMMON));
+-  return (new);
+-}
+-
+-static COMMON_ENTRY_PTR
+-allocate_common_entry_node (void)
+-{
+-  COMMON_ENTRY_PTR new;
+-
+-  new = (COMMON_ENTRY_PTR) xmalloc (sizeof (COMMON_ENTRY));
+-  return (new);
+-}
+-#endif
+-
+ SAVED_F77_COMMON_PTR head_common_list = NULL; /* Ptr to 1st saved COMMON  */
+-SAVED_F77_COMMON_PTR tail_common_list = NULL; /* Ptr to last saved COMMON  */
+-SAVED_F77_COMMON_PTR current_common = NULL;   /* Ptr to current COMMON */
+-
+-#if 0
+-static SAVED_BF_PTR saved_bf_list = NULL;     /* Ptr to (.bf,function) 
+-                                                 list */
+-static SAVED_BF_PTR saved_bf_list_end = NULL; /* Ptr to above list's end */
+-static SAVED_BF_PTR current_head_bf_list = NULL;    /* Current head of
+-                                                     above list.  */
+-
+-static SAVED_BF_PTR tmp_bf_ptr;       /* Generic temporary for use 
+-                                 in macros.  */
+-
+-/* The following function simply enters a given common block onto 
+-   the global common block chain.  */
+-
+-static void
+-add_common_block (char *name, CORE_ADDR offset, int secnum, char *func_stab)
+-{
+-  SAVED_F77_COMMON_PTR tmp;
+-  char *c, *local_copy_func_stab;
+-
+-  /* If the COMMON block we are trying to add has a blank 
+-     name (i.e. "#BLNK_COM") then we set it to __BLANK
+-     because the darn "#" character makes GDB's input 
+-     parser have fits.  */
+-
+-
+-  if (strcmp (name, BLANK_COMMON_NAME_ORIGINAL) == 0
+-      || strcmp (name, BLANK_COMMON_NAME_MF77) == 0)
+-    {
+-
+-      xfree (name);
+-      name = alloca (strlen (BLANK_COMMON_NAME_LOCAL) + 1);
+-      strcpy (name, BLANK_COMMON_NAME_LOCAL);
+-    }
+-
+-  tmp = allocate_saved_f77_common_node ();
+-
+-  local_copy_func_stab = xmalloc (strlen (func_stab) + 1);
+-  strcpy (local_copy_func_stab, func_stab);
+-
+-  tmp->name = xmalloc (strlen (name) + 1);
+-
+-  /* local_copy_func_stab is a stabstring, let us first extract the 
+-     function name from the stab by NULLing out the ':' character.  */
+-
+-
+-  c = NULL;
+-  c = strchr (local_copy_func_stab, ':');
+-
+-  if (c)
+-    *c = '\0';
+-  else
+-    error (_("Malformed function STAB found in add_common_block()"));
+-
+-
+-  tmp->owning_function = xmalloc (strlen (local_copy_func_stab) + 1);
+-
+-  strcpy (tmp->owning_function, local_copy_func_stab);
+-
+-  strcpy (tmp->name, name);
+-  tmp->offset = offset;
+-  tmp->next = NULL;
+-  tmp->entries = NULL;
+-  tmp->secnum = secnum;
+-
+-  current_common = tmp;
+-
+-  if (head_common_list == NULL)
+-    {
+-      head_common_list = tail_common_list = tmp;
+-    }
+-  else
+-    {
+-      tail_common_list->next = tmp;
+-      tail_common_list = tmp;
+-    }
+-}
+-#endif
+-
+-/* The following function simply enters a given common entry onto 
+-   the "current_common" block that has been saved away.  */
+-
+-#if 0
+-static void
+-add_common_entry (struct symbol *entry_sym_ptr)
+-{
+-  COMMON_ENTRY_PTR tmp;
+-
+-
+-
+-  /* The order of this list is important, since 
+-     we expect the entries to appear in decl.
+-     order when we later issue "info common" calls.  */
+-
+-  tmp = allocate_common_entry_node ();
+-
+-  tmp->next = NULL;
+-  tmp->symbol = entry_sym_ptr;
+-
+-  if (current_common == NULL)
+-    error (_("Attempt to add COMMON entry with no block open!"));
+-  else
+-    {
+-      if (current_common->entries == NULL)
+-      {
+-        current_common->entries = tmp;
+-        current_common->end_of_entries = tmp;
+-      }
+-      else
+-      {
+-        current_common->end_of_entries->next = tmp;
+-        current_common->end_of_entries = tmp;
+-      }
+-    }
+-}
+-#endif
+-
+-/* This routine finds the first encountred COMMON block named "name".  */
+-
+-#if 0
+-static SAVED_F77_COMMON_PTR
+-find_first_common_named (char *name)
+-{
+-
+-  SAVED_F77_COMMON_PTR tmp;
+-
+-  tmp = head_common_list;
+-
+-  while (tmp != NULL)
+-    {
+-      if (strcmp (tmp->name, name) == 0)
+-      return (tmp);
+-      else
+-      tmp = tmp->next;
+-    }
+-  return (NULL);
+-}
+-#endif
+ /* This routine finds the first encountred COMMON block named "name" 
+    that belongs to function funcname.  */
+@@ -662,193 +470,3 @@ find_common_for_function (char *name, ch
+     }
+   return (NULL);
+ }
+-
+-
+-#if 0
+-
+-/* The following function is called to patch up the offsets 
+-   for the statics contained in the COMMON block named
+-   "name."  */
+-
+-static void
+-patch_common_entries (SAVED_F77_COMMON_PTR blk, CORE_ADDR offset, int secnum)
+-{
+-  COMMON_ENTRY_PTR entry;
+-
+-  blk->offset = offset;               /* Keep this around for future use.  */
+-
+-  entry = blk->entries;
+-
+-  while (entry != NULL)
+-    {
+-      SYMBOL_VALUE (entry->symbol) += offset;
+-      SYMBOL_SECTION (entry->symbol) = secnum;
+-
+-      entry = entry->next;
+-    }
+-  blk->secnum = secnum;
+-}
+-
+-/* Patch all commons named "name" that need patching.Since COMMON
+-   blocks occur with relative infrequency, we simply do a linear scan on
+-   the name.  Eventually, the best way to do this will be a
+-   hashed-lookup.  Secnum is the section number for the .bss section
+-   (which is where common data lives).  */
+-
+-static void
+-patch_all_commons_by_name (char *name, CORE_ADDR offset, int secnum)
+-{
+-
+-  SAVED_F77_COMMON_PTR tmp;
+-
+-  /* For blank common blocks, change the canonical reprsentation 
+-     of a blank name */
+-
+-  if (strcmp (name, BLANK_COMMON_NAME_ORIGINAL) == 0
+-      || strcmp (name, BLANK_COMMON_NAME_MF77) == 0)
+-    {
+-      xfree (name);
+-      name = alloca (strlen (BLANK_COMMON_NAME_LOCAL) + 1);
+-      strcpy (name, BLANK_COMMON_NAME_LOCAL);
+-    }
+-
+-  tmp = head_common_list;
+-
+-  while (tmp != NULL)
+-    {
+-      if (COMMON_NEEDS_PATCHING (tmp))
+-      if (strcmp (tmp->name, name) == 0)
+-        patch_common_entries (tmp, offset, secnum);
+-
+-      tmp = tmp->next;
+-    }
+-}
+-#endif
+-
+-/* This macro adds the symbol-number for the start of the function 
+-   (the symbol number of the .bf) referenced by symnum_fcn to a 
+-   list.  This list, in reality should be a FIFO queue but since 
+-   #line pragmas sometimes cause line ranges to get messed up 
+-   we simply create a linear list.  This list can then be searched 
+-   first by a queueing algorithm and upon failure fall back to 
+-   a linear scan.  */
+-
+-#if 0
+-#define ADD_BF_SYMNUM(bf_sym,fcn_sym) \
+-  \
+-  if (saved_bf_list == NULL) \
+-{ \
+-    tmp_bf_ptr = allocate_saved_bf_node(); \
+-      \
+-      tmp_bf_ptr->symnum_bf = (bf_sym); \
+-        tmp_bf_ptr->symnum_fcn = (fcn_sym);  \
+-          tmp_bf_ptr->next = NULL; \
+-            \
+-              current_head_bf_list = saved_bf_list = tmp_bf_ptr; \
+-                saved_bf_list_end = tmp_bf_ptr; \
+-                } \
+-else \
+-{  \
+-     tmp_bf_ptr = allocate_saved_bf_node(); \
+-       \
+-         tmp_bf_ptr->symnum_bf = (bf_sym);  \
+-         tmp_bf_ptr->symnum_fcn = (fcn_sym);  \
+-           tmp_bf_ptr->next = NULL;  \
+-             \
+-               saved_bf_list_end->next = tmp_bf_ptr;  \
+-                 saved_bf_list_end = tmp_bf_ptr; \
+-                 }
+-#endif
+-
+-/* This function frees the entire (.bf,function) list.  */
+-
+-#if 0
+-static void
+-clear_bf_list (void)
+-{
+-
+-  SAVED_BF_PTR tmp = saved_bf_list;
+-  SAVED_BF_PTR next = NULL;
+-
+-  while (tmp != NULL)
+-    {
+-      next = tmp->next;
+-      xfree (tmp);
+-      tmp = next;
+-    }
+-  saved_bf_list = NULL;
+-}
+-#endif
+-
+-int global_remote_debug;
+-
+-#if 0
+-
+-static long
+-get_bf_for_fcn (long the_function)
+-{
+-  SAVED_BF_PTR tmp;
+-  int nprobes = 0;
+-
+-  /* First use a simple queuing algorithm (i.e. look and see if the 
+-     item at the head of the queue is the one you want).  */
+-
+-  if (saved_bf_list == NULL)
+-    internal_error (__FILE__, __LINE__,
+-                  _("cannot get .bf node off empty list"));
+-
+-  if (current_head_bf_list != NULL)
+-    if (current_head_bf_list->symnum_fcn == the_function)
+-      {
+-      if (global_remote_debug)
+-        fprintf_unfiltered (gdb_stderr, "*");
+-
+-      tmp = current_head_bf_list;
+-      current_head_bf_list = current_head_bf_list->next;
+-      return (tmp->symnum_bf);
+-      }
+-
+-  /* If the above did not work (probably because #line directives were 
+-     used in the sourcefile and they messed up our internal tables) we now do
+-     the ugly linear scan.  */
+-
+-  if (global_remote_debug)
+-    fprintf_unfiltered (gdb_stderr, "\ndefaulting to linear scan\n");
+-
+-  nprobes = 0;
+-  tmp = saved_bf_list;
+-  while (tmp != NULL)
+-    {
+-      nprobes++;
+-      if (tmp->symnum_fcn == the_function)
+-      {
+-        if (global_remote_debug)
+-          fprintf_unfiltered (gdb_stderr, "Found in %d probes\n", nprobes);
+-        current_head_bf_list = tmp->next;
+-        return (tmp->symnum_bf);
+-      }
+-      tmp = tmp->next;
+-    }
+-
+-  return (-1);
+-}
+-
+-static SAVED_FUNCTION_PTR saved_function_list = NULL;
+-static SAVED_FUNCTION_PTR saved_function_list_end = NULL;
+-
+-static void
+-clear_function_list (void)
+-{
+-  SAVED_FUNCTION_PTR tmp = saved_function_list;
+-  SAVED_FUNCTION_PTR next = NULL;
+-
+-  while (tmp != NULL)
+-    {
+-      next = tmp->next;
+-      xfree (tmp);
+-      tmp = next;
+-    }
+-
+-  saved_function_list = NULL;
+-}
+-#endif
+Index: gdb-7.2.50.20110117/gdb/f-lang.h
+===================================================================
+--- gdb-7.2.50.20110117.orig/gdb/f-lang.h      2011-01-17 15:47:37.000000000 +0100
++++ gdb-7.2.50.20110117/gdb/f-lang.h   2011-01-17 15:54:14.000000000 +0100
+@@ -76,14 +76,9 @@ typedef struct saved_f77_common SAVED_F7
+ typedef struct common_entry COMMON_ENTRY, *COMMON_ENTRY_PTR;
+ extern SAVED_F77_COMMON_PTR head_common_list; /* Ptr to 1st saved COMMON  */
+-extern SAVED_F77_COMMON_PTR tail_common_list; /* Ptr to last saved COMMON  */
+-extern SAVED_F77_COMMON_PTR current_common;   /* Ptr to current COMMON */
+ extern SAVED_F77_COMMON_PTR find_common_for_function (char *, char *);
+-#define UNINITIALIZED_SECNUM -1
+-#define COMMON_NEEDS_PATCHING(blk) ((blk)->secnum == UNINITIALIZED_SECNUM)
+-
+ #define BLANK_COMMON_NAME_ORIGINAL "#BLNK_COM"        /* XLF assigned  */
+ #define BLANK_COMMON_NAME_MF77     "__BLNK__" /* MF77 assigned  */
+ #define BLANK_COMMON_NAME_LOCAL    "__BLANK"  /* Local GDB */
+Index: gdb-7.2.50.20110117/gdb/f-valprint.c
+===================================================================
+--- gdb-7.2.50.20110117.orig/gdb/f-valprint.c  2011-01-17 15:47:37.000000000 +0100
++++ gdb-7.2.50.20110117/gdb/f-valprint.c       2011-01-17 15:54:36.000000000 +0100
+@@ -35,10 +35,6 @@
+ #include "command.h"
+ #include "block.h"
+-#if 0
+-static int there_is_a_visible_common_named (char *);
+-#endif
+-
+ extern void _initialize_f_valprint (void);
+ static void info_common_command (char *, int);
+ static void list_all_visible_commons (char *);
+@@ -604,67 +600,6 @@ info_common_command (char *comname, int 
+                    comname, funname);
+ }
+-/* This function is used to determine whether there is a
+-   F77 common block visible at the current scope called 'comname'.  */
+-
+-#if 0
+-static int
+-there_is_a_visible_common_named (char *comname)
+-{
+-  SAVED_F77_COMMON_PTR the_common;
+-  struct frame_info *fi;
+-  char *funname = 0;
+-  struct symbol *func;
+-
+-  if (comname == NULL)
+-    error (_("Cannot deal with NULL common name!"));
+-
+-  fi = get_selected_frame (_("No frame selected"));
+-
+-  /* The following is generally ripped off from stack.c's routine 
+-     print_frame_info().  */
+-
+-  func = find_pc_function (fi->pc);
+-  if (func)
+-    {
+-      /* In certain pathological cases, the symtabs give the wrong
+-         function (when we are in the first function in a file which
+-         is compiled without debugging symbols, the previous function
+-         is compiled with debugging symbols, and the "foo.o" symbol
+-         that is supposed to tell us where the file with debugging symbols
+-         ends has been truncated by ar because it is longer than 15
+-         characters).
+-
+-         So look in the minimal symbol tables as well, and if it comes
+-         up with a larger address for the function use that instead.
+-         I don't think this can ever cause any problems; there shouldn't
+-         be any minimal symbols in the middle of a function.
+-         FIXME:  (Not necessarily true.  What about text labels?)  */
+-
+-      struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (fi->pc);
+-
+-      if (msymbol != NULL
+-        && (SYMBOL_VALUE_ADDRESS (msymbol)
+-            > BLOCK_START (SYMBOL_BLOCK_VALUE (func))))
+-      funname = SYMBOL_LINKAGE_NAME (msymbol);
+-      else
+-      funname = SYMBOL_LINKAGE_NAME (func);
+-    }
+-  else
+-    {
+-      struct minimal_symbol *msymbol =
+-      lookup_minimal_symbol_by_pc (fi->pc);
+-
+-      if (msymbol != NULL)
+-      funname = SYMBOL_LINKAGE_NAME (msymbol);
+-    }
+-
+-  the_common = find_common_for_function (comname, funname);
+-
+-  return (the_common ? 1 : 0);
+-}
+-#endif
+-
+ void
+ _initialize_f_valprint (void)
+ {
diff --git a/gdb/patches/gdb-fortran-common.patch b/gdb/patches/gdb-fortran-common.patch
new file mode 100644 (file)
index 0000000..66d46b9
--- /dev/null
@@ -0,0 +1,585 @@
+Index: gdb-7.3.50.20110722/gdb/dwarf2read.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/dwarf2read.c  2011-07-22 20:12:05.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/dwarf2read.c       2011-07-22 20:17:22.000000000 +0200
+@@ -7969,12 +7969,14 @@ read_set_type (struct die_info *die, str
+   return set_die_type (die, set_type, cu);
+ }
+-/* First cut: install each common block member as a global variable.  */
++/* Create appropriate locally-scoped variables for all the DW_TAG_common_block
++   entries.  Create also TYPE_CODE_STRUCT listing all such variables to be
++   available for `info common'.  COMMON_BLOCK_DOMAIN is used to sepate the
++   common blocks name namespace from regular variable names.  */
+ static void
+ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
+ {
+-  struct die_info *child_die;
+   struct attribute *attr;
+   struct symbol *sym;
+   CORE_ADDR base = (CORE_ADDR) 0;
+@@ -7999,20 +8001,67 @@ read_common_block (struct die_info *die,
+     }
+   if (die->child != NULL)
+     {
++      struct objfile *objfile = cu->objfile;
++      struct die_info *child_die;
++      struct type *type;
++      struct field *field;
++      char *name;
++      struct symbol *sym;
++
++      type = alloc_type (objfile);
++      TYPE_CODE (type) = TYPE_CODE_STRUCT;
++      /* Artificial type to be used only by `info common'.  */
++      TYPE_NAME (type) = "<common>";
++
++      child_die = die->child;
++      while (child_die && child_die->tag)
++      {
++        TYPE_NFIELDS (type)++;
++        child_die = sibling_die (child_die);
++      }
++
++      TYPE_FIELDS (type) = obstack_alloc (&objfile->objfile_obstack,
++                                        sizeof (*TYPE_FIELDS (type))
++                                        * TYPE_NFIELDS (type));
++      memset (TYPE_FIELDS (type), 0, sizeof (*TYPE_FIELDS (type))
++                                   * TYPE_NFIELDS (type));
++      
++      field = TYPE_FIELDS (type);
+       child_die = die->child;
+       while (child_die && child_die->tag)
+       {
+         LONGEST offset;
++        /* Create the symbol in the DW_TAG_common_block block in the current
++           symbol scope.  */
+         sym = new_symbol (child_die, NULL, cu);
++
++        /* Undocumented in DWARF3, when it can be present?  */
+         if (sym != NULL
+             && handle_data_member_location (child_die, cu, &offset))
+           {
+             SYMBOL_VALUE_ADDRESS (sym) = base + offset;
+             add_symbol_to_list (sym, &global_symbols);
+           }
++
++        if (SYMBOL_CLASS (sym) == LOC_STATIC)
++          SET_FIELD_PHYSADDR (*field, SYMBOL_VALUE_ADDRESS (sym));
++        else
++          SET_FIELD_PHYSNAME (*field, SYMBOL_LINKAGE_NAME (sym));
++        FIELD_TYPE (*field) = SYMBOL_TYPE (sym);
++        FIELD_NAME (*field) = SYMBOL_NATURAL_NAME (sym);
++        field++;
+         child_die = sibling_die (child_die);
+       }
++
++      /* TYPE_LENGTH (type) is left 0 - it is only a virtual structure even
++       with no consecutive address space.  */
++
++      sym = new_symbol (die, type, cu);
++      /* SYMBOL_VALUE_ADDRESS never gets used as all its fields are static.  */
++      SYMBOL_VALUE_ADDRESS (sym) = base;
++
++      set_die_type (die, type, cu);
+     }
+ }
+@@ -11695,6 +11744,13 @@ new_symbol_full (struct die_info *die, s
+           {
+             var_decode_location (attr, sym, cu);
+             attr2 = dwarf2_attr (die, DW_AT_external, cu);
++
++            /* Fortran explicitly imports any global symbols to the local
++               scope by DW_TAG_common_block.  */
++            if (cu->language == language_fortran && die->parent
++                && die->parent->tag == DW_TAG_common_block)
++              attr2 = NULL;
++
+             if (SYMBOL_CLASS (sym) == LOC_STATIC
+                 && SYMBOL_VALUE_ADDRESS (sym) == 0
+                 && !dwarf2_per_objfile->has_section_at_zero)
+@@ -11867,6 +11923,11 @@ new_symbol_full (struct die_info *die, s
+         SYMBOL_CLASS (sym) = LOC_TYPEDEF;
+         list_to_add = &global_symbols;
+         break;
++      case DW_TAG_common_block:
++        SYMBOL_CLASS (sym) = LOC_STATIC;
++        SYMBOL_DOMAIN (sym) = COMMON_BLOCK_DOMAIN;
++        add_symbol_to_list (sym, cu->list_in_scope);
++        break;
+       default:
+         /* Not a tag we recognize.  Hopefully we aren't processing
+            trash data, but since we must specifically ignore things
+Index: gdb-7.3.50.20110722/gdb/f-lang.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/f-lang.c      2011-07-22 20:17:16.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/f-lang.c   2011-07-22 20:17:22.000000000 +0200
+@@ -371,27 +371,3 @@ _initialize_f_language (void)
+   add_language (&f_language_defn);
+ }
+-
+-SAVED_F77_COMMON_PTR head_common_list = NULL; /* Ptr to 1st saved COMMON  */
+-
+-/* This routine finds the first encountred COMMON block named "name" 
+-   that belongs to function funcname.  */
+-
+-SAVED_F77_COMMON_PTR
+-find_common_for_function (char *name, char *funcname)
+-{
+-
+-  SAVED_F77_COMMON_PTR tmp;
+-
+-  tmp = head_common_list;
+-
+-  while (tmp != NULL)
+-    {
+-      if (strcmp (tmp->name, name) == 0
+-        && strcmp (tmp->owning_function, funcname) == 0)
+-      return (tmp);
+-      else
+-      tmp = tmp->next;
+-    }
+-  return (NULL);
+-}
+Index: gdb-7.3.50.20110722/gdb/f-lang.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/f-lang.h      2011-07-22 20:17:16.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/f-lang.h   2011-07-22 20:17:22.000000000 +0200
+@@ -52,36 +52,8 @@ enum f90_range_type
+     NONE_BOUND_DEFAULT                /* "(low:high)"  */
+   };
+-struct common_entry
+-  {
+-    struct symbol *symbol;    /* The symbol node corresponding
+-                                 to this component */
+-    struct common_entry *next;        /* The next component */
+-  };
+-
+-struct saved_f77_common
+-  {
+-    char *name;                       /* Name of COMMON */
+-    char *owning_function;    /* Name of parent function */
+-    int secnum;                       /* Section # of .bss */
+-    CORE_ADDR offset;         /* Offset from .bss for 
+-                                 this block */
+-    struct common_entry *entries;     /* List of block's components */
+-    struct common_entry *end_of_entries;      /* ptr. to end of components */
+-    struct saved_f77_common *next;    /* Next saved COMMON block */
+-  };
+-
+-typedef struct saved_f77_common SAVED_F77_COMMON, *SAVED_F77_COMMON_PTR;
+-
+-typedef struct common_entry COMMON_ENTRY, *COMMON_ENTRY_PTR;
+-
+-extern SAVED_F77_COMMON_PTR head_common_list; /* Ptr to 1st saved COMMON  */
+-
+-extern SAVED_F77_COMMON_PTR find_common_for_function (char *, char *);
+-
+ #define BLANK_COMMON_NAME_ORIGINAL "#BLNK_COM"        /* XLF assigned  */
+ #define BLANK_COMMON_NAME_MF77     "__BLNK__" /* MF77 assigned  */
+-#define BLANK_COMMON_NAME_LOCAL    "__BLANK"  /* Local GDB */
+ /* When reasonable array bounds cannot be fetched, such as when 
+    you ask to 'mt print symbols' and there is no stack frame and 
+Index: gdb-7.3.50.20110722/gdb/f-valprint.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/f-valprint.c  2011-07-22 20:17:16.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/f-valprint.c       2011-07-22 20:18:26.000000000 +0200
+@@ -34,10 +34,11 @@
+ #include "gdbcore.h"
+ #include "command.h"
+ #include "block.h"
++#include "dictionary.h"
++#include "gdb_assert.h"
+ extern void _initialize_f_valprint (void);
+ static void info_common_command (char *, int);
+-static void list_all_visible_commons (char *);
+ static void f77_create_arrayprint_offset_tbl (struct type *,
+                                             struct ui_file *);
+ static void f77_get_dynamic_length_of_aggregate (struct type *);
+@@ -515,22 +516,54 @@ f_val_print (struct type *type, const gd
+   return 0;
+ }
+-static void
+-list_all_visible_commons (char *funname)
++static int
++info_common_command_for_block (struct block *block, struct frame_info *frame,
++                             const char *comname)
+ {
+-  SAVED_F77_COMMON_PTR tmp;
+-
+-  tmp = head_common_list;
++  struct dict_iterator iter;
++  struct symbol *sym;
++  int values_printed = 0;
++  const char *name;
++  struct value_print_options opts;
++
++  get_user_print_options (&opts);
++
++  ALL_BLOCK_SYMBOLS (block, iter, sym)
++    if (SYMBOL_DOMAIN (sym) == COMMON_BLOCK_DOMAIN)
++      {
++              struct type *type = SYMBOL_TYPE (sym);
++      int index;
++
++      gdb_assert (SYMBOL_CLASS (sym) == LOC_STATIC);
++      gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT);
++
++      if (comname && (!SYMBOL_LINKAGE_NAME (sym)
++                      || strcmp (comname, SYMBOL_LINKAGE_NAME (sym)) != 0))
++        continue;
++
++      values_printed = 1;
++      if (SYMBOL_PRINT_NAME (sym))
++        printf_filtered (_("Contents of F77 COMMON block '%s':\n"),
++                         SYMBOL_PRINT_NAME (sym));
++      else
++        printf_filtered (_("Contents of blank COMMON block:\n"));
++      
++      for (index = 0; index < TYPE_NFIELDS (type); index++)
++        {
++          struct value *val;
++
++          gdb_assert (field_is_static (&TYPE_FIELD (type, index)));
++          val = value_static_field (type, index);
++
++          printf_filtered ("%s = ", TYPE_FIELD_NAME (type, index));
++          value_print (val, gdb_stdout, &opts);
++          putchar_filtered ('\n');
++        }
+-  printf_filtered (_("All COMMON blocks visible at this level:\n\n"));
++      putchar_filtered ('\n');
++      }
+-  while (tmp != NULL)
+-    {
+-      if (strcmp (tmp->owning_function, funname) == 0)
+-      printf_filtered ("%s\n", tmp->name);
+-
+-      tmp = tmp->next;
+-    }
++  return values_printed;
+ }
+ /* This function is used to print out the values in a given COMMON 
+@@ -540,11 +573,9 @@ list_all_visible_commons (char *funname)
+ static void
+ info_common_command (char *comname, int from_tty)
+ {
+-  SAVED_F77_COMMON_PTR the_common;
+-  COMMON_ENTRY_PTR entry;
+   struct frame_info *fi;
+-  char *funname = 0;
+-  struct symbol *func;
++  struct block *block;
++  int values_printed = 0;
+   /* We have been told to display the contents of F77 COMMON 
+      block supposedly visible in this function.  Let us 
+@@ -556,74 +587,31 @@ info_common_command (char *comname, int 
+   /* The following is generally ripped off from stack.c's routine 
+      print_frame_info().  */
+-  func = find_pc_function (get_frame_pc (fi));
+-  if (func)
++  block = get_frame_block (fi, 0);
++  if (block == NULL)
+     {
+-      /* In certain pathological cases, the symtabs give the wrong
+-         function (when we are in the first function in a file which
+-         is compiled without debugging symbols, the previous function
+-         is compiled with debugging symbols, and the "foo.o" symbol
+-         that is supposed to tell us where the file with debugging symbols
+-         ends has been truncated by ar because it is longer than 15
+-         characters).
+-
+-         So look in the minimal symbol tables as well, and if it comes
+-         up with a larger address for the function use that instead.
+-         I don't think this can ever cause any problems; there shouldn't
+-         be any minimal symbols in the middle of a function.
+-         FIXME:  (Not necessarily true.  What about text labels?)  */
+-
+-      struct minimal_symbol *msymbol = 
+-      lookup_minimal_symbol_by_pc (get_frame_pc (fi));
+-
+-      if (msymbol != NULL
+-        && (SYMBOL_VALUE_ADDRESS (msymbol)
+-            > BLOCK_START (SYMBOL_BLOCK_VALUE (func))))
+-      funname = SYMBOL_LINKAGE_NAME (msymbol);
+-      else
+-      funname = SYMBOL_LINKAGE_NAME (func);
+-    }
+-  else
+-    {
+-      struct minimal_symbol *msymbol =
+-      lookup_minimal_symbol_by_pc (get_frame_pc (fi));
+-
+-      if (msymbol != NULL)
+-      funname = SYMBOL_LINKAGE_NAME (msymbol);
+-      else /* Got no 'funname', code below will fail.  */
+-      error (_("No function found for frame."));
++      printf_filtered (_("No symbol table info available.\n"));
++      return;
+     }
+-  /* If comname is NULL, we assume the user wishes to see the 
+-     which COMMON blocks are visible here and then return.  */
+-
+-  if (comname == 0)
++  while (block)
+     {
+-      list_all_visible_commons (funname);
+-      return;
++      if (info_common_command_for_block (block, fi, comname))
++      values_printed = 1;
++      /* After handling the function's top-level block, stop.  Don't
++         continue to its superblock, the block of per-file symbols.  */
++      if (BLOCK_FUNCTION (block))
++      break;
++      block = BLOCK_SUPERBLOCK (block);
+     }
+-  the_common = find_common_for_function (comname, funname);
+-
+-  if (the_common)
++  if (!values_printed)
+     {
+-      if (strcmp (comname, BLANK_COMMON_NAME_LOCAL) == 0)
+-      printf_filtered (_("Contents of blank COMMON block:\n"));
++      if (comname)
++      printf_filtered (_("No common block '%s'.\n"), comname);
+       else
+-      printf_filtered (_("Contents of F77 COMMON block '%s':\n"), comname);
+-
+-      printf_filtered ("\n");
+-      entry = the_common->entries;
+-
+-      while (entry != NULL)
+-      {
+-        print_variable_and_value (NULL, entry->symbol, fi, gdb_stdout, 0);
+-        entry = entry->next;
+-      }
++      printf_filtered (_("No common blocks.\n"));
+     }
+-  else
+-    printf_filtered (_("Cannot locate the common block %s in function '%s'\n"),
+-                   comname, funname);
+ }
+ void
+Index: gdb-7.3.50.20110722/gdb/stack.c
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/stack.c       2011-07-22 20:12:05.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/stack.c    2011-07-22 20:17:22.000000000 +0200
+@@ -1524,6 +1524,8 @@ iterate_over_block_locals (struct block 
+       case LOC_COMPUTED:
+         if (SYMBOL_IS_ARGUMENT (sym))
+           break;
++        if (SYMBOL_DOMAIN (sym) == COMMON_BLOCK_DOMAIN)
++          break;
+         (*cb) (SYMBOL_PRINT_NAME (sym), sym, cb_data);
+         break;
+Index: gdb-7.3.50.20110722/gdb/symtab.h
+===================================================================
+--- gdb-7.3.50.20110722.orig/gdb/symtab.h      2011-07-22 20:12:05.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/symtab.h   2011-07-22 20:18:58.000000000 +0200
+@@ -396,7 +396,10 @@ typedef enum domain_enum_tag
+   /* LABEL_DOMAIN may be used for names of labels (for gotos).  */
+-  LABEL_DOMAIN
++  LABEL_DOMAIN,
++
++  /* Fortran common blocks.  Their naming must be separate from VAR_DOMAIN.  */
++  COMMON_BLOCK_DOMAIN
+ } domain_enum;
+ /* Searching domains, used for `search_symbols'.  Element numbers are
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/common-block.exp
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/common-block.exp     2011-07-22 20:17:22.000000000 +0200
+@@ -0,0 +1,101 @@
++# Copyright 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
++
++set testfile "common-block"
++set srcfile ${testfile}.f90
++set binfile ${objdir}/${subdir}/${testfile}
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] != "" } {
++    untested "Couldn't compile ${srcfile}"
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++if ![runto MAIN__] then {
++    perror "couldn't run to breakpoint MAIN__"
++    continue
++}
++
++gdb_breakpoint [gdb_get_line_number "stop-here-out"]
++gdb_continue_to_breakpoint "stop-here-out"
++
++# Common block naming with source name /foo/:
++#                .symtab  DW_TAG_common_block's DW_AT_name
++# Intel Fortran  foo_     foo_
++# GNU Fortran    foo_     foo
++#set suffix "_"
++set suffix ""
++
++set int4 {(integer\(kind=4\)|INTEGER\(4\))}
++set real4 {(real\(kind=4\)|REAL\(4\))}
++set real8 {(real\(kind=8\)|REAL\(8\))}
++
++gdb_test "whatis foo$suffix" "No symbol \"foo$suffix\" in current context."
++gdb_test "ptype foo$suffix" "No symbol \"foo$suffix\" in current context."
++gdb_test "p foo$suffix" "No symbol \"foo$suffix\" in current context."
++gdb_test "whatis fo_o$suffix" "No symbol \"fo_o$suffix\" in current context."
++gdb_test "ptype fo_o$suffix" "No symbol \"fo_o$suffix\" in current context."
++gdb_test "p fo_o$suffix" "No symbol \"fo_o$suffix\" in current context."
++
++gdb_test "info locals" "ix_x = 11\r\niy_y = 22\r\niz_z = 33\r\nix = 1\r\niy = 2\r\niz = 3" "info locals out"
++gdb_test "info common" "Contents of F77 COMMON block 'fo_o':\r\nix_x = 11\r\niy_y = 22\r\niz_z = 33\r\n\r\nContents of F77 COMMON block 'foo':\r\nix = 1\r\niy = 2\r\niz = 3" "info common out"
++
++gdb_test "ptype ix" "type = $int4" "ptype ix out"
++gdb_test "ptype iy" "type = $real4" "ptype iy out"
++gdb_test "ptype iz" "type = $real8" "ptype iz out"
++gdb_test "ptype ix_x" "type = $int4" "ptype ix_x out"
++gdb_test "ptype iy_y" "type = $real4" "ptype iy_y out"
++gdb_test "ptype iz_z" "type = $real8" "ptype iz_z out"
++
++gdb_test "p ix" " = 1 *" "p ix out"
++gdb_test "p iy" " = 2 *" "p iy out"
++gdb_test "p iz" " = 3 *" "p iz out"
++gdb_test "p ix_x" " = 11 *" "p ix_x out"
++gdb_test "p iy_y" " = 22 *" "p iy_y out"
++gdb_test "p iz_z" " = 33 *" "p iz_z out"
++
++gdb_breakpoint [gdb_get_line_number "stop-here-in"]
++gdb_continue_to_breakpoint "stop-here-in"
++
++gdb_test "whatis foo$suffix" "No symbol \"foo$suffix\" in current context." "whatis foo$suffix in"
++gdb_test "ptype foo$suffix" "No symbol \"foo$suffix\" in current context." "ptype foo$suffix in"
++gdb_test "p foo$suffix" "No symbol \"foo$suffix\" in current context." "p foo$suffix in"
++gdb_test "whatis fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." "whatis fo_o$suffix in"
++gdb_test "ptype fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." "ptype fo_o$suffix in"
++gdb_test "p fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." "p fo_o$suffix in"
++
++gdb_test "info locals" "ix = 11\r\niy2 = 22\r\niz = 33\r\nix_x = 1\r\niy_y = 2\r\niz_z2 = 3\r\niy = 5\r\niz_z = 55" "info locals in"
++gdb_test "info common" "Contents of F77 COMMON block 'fo_o':\r\nix = 11\r\niy2 = 22\r\niz = 33\r\n\r\nContents of F77 COMMON block 'foo':\r\nix_x = 1\r\niy_y = 2\r\niz_z2 = 3" "info common in"
++
++gdb_test "ptype ix" "type = $int4" "ptype ix in"
++gdb_test "ptype iy2" "type = $real4" "ptype iy2 in"
++gdb_test "ptype iz" "type = $real8" "ptype iz in"
++gdb_test "ptype ix_x" "type = $int4" "ptype ix_x in"
++gdb_test "ptype iy_y" "type = $real4" "ptype iy_y in"
++gdb_test "ptype iz_z2" "type = $real8" "ptype iz_z2 in"
++
++gdb_test "p ix" " = 11 *" "p ix in"
++gdb_test "p iy2" " = 22 *" "p iy2 in"
++gdb_test "p iz" " = 33 *" "p iz in"
++gdb_test "p ix_x" " = 1 *" "p ix_x in"
++gdb_test "p iy_y" " = 2 *" "p iy_y in"
++gdb_test "p iz_z2" " = 3 *" "p iz_z2 in"
+Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/common-block.f90
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.3.50.20110722/gdb/testsuite/gdb.fortran/common-block.f90     2011-07-22 20:17:22.000000000 +0200
+@@ -0,0 +1,67 @@
++! Copyright 2008 Free Software Foundation, Inc.
++!
++! This program is free software; you can redistribute it and/or modify
++! it under the terms of the GNU General Public License as published by
++! the Free Software Foundation; either version 2 of the License, or
++! (at your option) any later version.
++!
++! This program is distributed in the hope that it will be useful,
++! but WITHOUT ANY WARRANTY; without even the implied warranty of
++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++! GNU General Public License for more details.
++!
++! You should have received a copy of the GNU General Public License
++! along with this program; if not, write to the Free Software
++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++!
++! Ihis file is the Fortran source file for dynamic.exp.
++! Original file written by Jakub Jelinek <jakub@redhat.com>.
++! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
++
++subroutine in
++
++   INTEGER*4            ix
++   REAL*4               iy2
++   REAL*8               iz
++
++   INTEGER*4            ix_x
++   REAL*4               iy_y
++   REAL*8               iz_z2
++
++   common /fo_o/ix,iy2,iz
++   common /foo/ix_x,iy_y,iz_z2
++
++   iy = 5
++   iz_z = 55
++
++   if (ix .ne. 11 .or. iy2 .ne. 22.0 .or. iz .ne. 33.0) call abort
++   if (ix_x .ne. 1 .or. iy_y .ne. 2.0 .or. iz_z2 .ne. 3.0) call abort
++
++   ix = 0                                     ! stop-here-in
++
++end subroutine in
++
++program common_test
++
++   INTEGER*4            ix
++   REAL*4               iy
++   REAL*8               iz
++
++   INTEGER*4            ix_x
++   REAL*4               iy_y
++   REAL*8               iz_z
++
++   common /foo/ix,iy,iz
++   common /fo_o/ix_x,iy_y,iz_z
++
++   ix = 1
++   iy = 2.0
++   iz = 3.0
++
++   ix_x = 11
++   iy_y = 22.0
++   iz_z = 33.0
++
++   call in                                    ! stop-here-out
++
++end program common_test
diff --git a/gdb/patches/gdb-gcc46-stdarg-prologue.patch b/gdb/patches/gdb-gcc46-stdarg-prologue.patch
new file mode 100644 (file)
index 0000000..d0f318e
--- /dev/null
@@ -0,0 +1,655 @@
+http://sourceware.org/ml/gdb-patches/2011-07/msg00645.html
+Subject: [patch] workaround gcc46: prologue skip skips too far (PR 12435) #2
+
+Hi,
+
+this is an improved patch of a former:
+       [patch] workaround gcc46: prologue skip skips too far (PR 12435)
+       http://sourceware.org/ml/gdb-patches/2011-03/msg01108.html
+       cancel/FYI: Re: [patch] workaround gcc46: prologue skip skips too far (PR 12435)
+       http://sourceware.org/ml/gdb-patches/2011-03/msg01123.html
+
+For example `break error' does not work for debugging GDB with gcc-4.6.x.
+
+As gcc-4.6.0 and now even 4.6.1 still has this bug and I have seen a user(s?)
+on non-Fedora platform asking about this bug and as there may be enough
+binaries out there (although it affects only -O0 -g compilation) coded it
+properly I have coded the workaround properly this time.
+
+It does not solve overlays well, but the code just does not work for overlays,
+it has no other negative effect.
+
+I will update the code after FSF gcc gets fixed to minimize the workaround.
+
+No regressions on {x86_64,x86_64-m32,i686}-fedora16pre-linux-gnu.
+
+I would welcome a comment whether it is suitable for FSF GDB.
+
+
+Thanks,
+Jan
+
+
+gdb/
+2011-07-22  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       PR breakpoints/12435
+       * amd64-tdep.c (amd64_skip_prologue): New variables start_pc_sal,
+       next_sal, buf, offset and xmmreg.  Advance PC if it sees the PR.
+       * dwarf2read.c (process_full_comp_unit): Initialize
+       amd64_prologue_line_bug.
+       * symtab.h (struct symtab): New field amd64_prologue_line_bug.
+
+gdb/testsuite/
+2011-07-22  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       PR breakpoints/12435
+       * gdb.arch/amd64-prologue-xmm.c: New file.
+       * gdb.arch/amd64-prologue-xmm.exp: New file.
+       * gdb.arch/amd64-prologue-xmm.s: New file.
+
+--- a/gdb/amd64-tdep.c
++++ b/gdb/amd64-tdep.c
+@@ -1902,6 +1902,9 @@ amd64_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
+ {
+   struct amd64_frame_cache cache;
+   CORE_ADDR pc;
++  struct symtab_and_line start_pc_sal, next_sal;
++  gdb_byte buf[4 + 8 * 7];
++  int offset, xmmreg;
+   amd64_init_frame_cache (&cache);
+   pc = amd64_analyze_prologue (gdbarch, start_pc, 0xffffffffffffffffLL,
+@@ -1909,7 +1912,71 @@ amd64_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
+   if (cache.frameless_p)
+     return start_pc;
+-  return pc;
++  /* GCC PR debug/48827 produced false prologue end:
++     84 c0                test   %al,%al
++     74 23                je     after
++     <-- here is 0 lines advance - the false prologue end marker.
++     0f 29 85 70 ff ff ff movaps %xmm0,-0x90(%rbp)
++     0f 29 4d 80          movaps %xmm1,-0x80(%rbp)
++     0f 29 55 90          movaps %xmm2,-0x70(%rbp)
++     0f 29 5d a0          movaps %xmm3,-0x60(%rbp)
++     0f 29 65 b0          movaps %xmm4,-0x50(%rbp)
++     0f 29 6d c0          movaps %xmm5,-0x40(%rbp)
++     0f 29 75 d0          movaps %xmm6,-0x30(%rbp)
++     0f 29 7d e0          movaps %xmm7,-0x20(%rbp)
++     after:  */
++
++  if (pc == start_pc)
++    return pc;
++
++  start_pc_sal = find_pc_sect_line (start_pc, NULL, 0);
++  if (start_pc_sal.symtab == NULL
++      || !start_pc_sal.symtab->amd64_prologue_line_bug
++      || start_pc_sal.pc != start_pc || pc >= start_pc_sal.end)
++    return pc;
++
++  next_sal = find_pc_sect_line (start_pc_sal.end, NULL, 0);
++  if (next_sal.line != start_pc_sal.line)
++    return pc;
++
++  /* START_PC can be from overlayed memory, ignored here.  */
++  if (target_read_memory (next_sal.pc - 4, buf, sizeof (buf)) != 0)
++    return pc;
++
++  /* test %al,%al */
++  if (buf[0] != 0x84 || buf[1] != 0xc0)
++    return pc;
++  /* je AFTER */
++  if (buf[2] != 0x74)
++    return pc;
++
++  offset = 4;
++  for (xmmreg = 0; xmmreg < 8; xmmreg++)
++    {
++      /* movaps %xmmreg?,-0x??(%rbp) */
++      if (buf[offset] != 0x0f || buf[offset + 1] != 0x29
++          || (buf[offset + 2] & 0b00111111) != (xmmreg << 3 | 0b101))
++      return pc;
++
++      if ((buf[offset + 2] & 0b11000000) == 0b01000000)
++      {
++        /* 8-bit displacement.  */
++        offset += 4;
++      }
++      else if ((buf[offset + 2] & 0b11000000) == 0b10000000)
++      {
++        /* 32-bit displacement.  */
++        offset += 7;
++      }
++      else
++      return pc;
++    }
++
++  /* je AFTER */
++  if (offset - 4 != buf[3])
++    return pc;
++
++  return next_sal.end;
+ }
\f
+--- a/gdb/dwarf2read.c
++++ b/gdb/dwarf2read.c
+@@ -4818,6 +4818,9 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu)
+       if (gcc_4_minor >= 5)
+       symtab->epilogue_unwind_valid = 1;
++
++      if (gcc_4_minor >= 6)
++      symtab->amd64_prologue_line_bug = 1;
+     }
+   if (dwarf2_per_objfile->using_index)
+--- a/gdb/symtab.h
++++ b/gdb/symtab.h
+@@ -784,6 +784,11 @@ struct symtab
+   unsigned int epilogue_unwind_valid : 1;
++  /* At least GCC 4.6.0 and 4.6.1 can produce invalid false prologue and marker
++     on amd64.  This flag is set independently of the symtab arch.  */
++
++  unsigned amd64_prologue_line_bug : 1;
++
+   /* The macro table for this symtab.  Like the blockvector, this
+      may be shared between different symtabs --- and normally is for
+      all the symtabs in a given compilation unit.  */
+--- /dev/null
++++ b/gdb/testsuite/gdb.arch/amd64-prologue-xmm.c
+@@ -0,0 +1,38 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2011 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++static volatile int v, fail;
++
++static void
++func (int i, ...)
++{
++  v = i;
++}
++
++static void
++marker (void)
++{
++}
++
++int
++main (void)
++{
++  func (1);
++  fail = 1;
++  marker ();
++  return 0;
++}
+--- /dev/null
++++ b/gdb/testsuite/gdb.arch/amd64-prologue-xmm.exp
+@@ -0,0 +1,46 @@
++# Copyright 2011 Free Software Foundation, Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++# Test GCC PR debug/48827 workaround in GDB.
++
++set testfile "amd64-prologue-xmm"
++set srcfile ${testfile}.s
++set csrcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}.x
++set opts {}
++
++if [info exists COMPILE] {
++    # make check RUNTESTFLAGS='gdb.arch/amd64-prologue-xmm.exp COMPILE=1'
++    set srcfile ${csrcfile}
++    lappend opts debug optimize=-O0
++} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
++    verbose "Skipping amd64-prologue-xmm test."
++    return 0
++}
++
++if {[prepare_for_testing ${testfile}.exp ${testfile} $srcfile $opts]} {
++    return -1
++}
++
++if ![runto_main] {
++    return -1
++}
++
++gdb_breakpoint "func"
++gdb_breakpoint "marker"
++
++gdb_continue_to_breakpoint "func"
++
++gdb_test "p fail" " = 0" "stopped at func"
+--- /dev/null
++++ b/gdb/testsuite/gdb.arch/amd64-prologue-xmm.s
+@@ -0,0 +1,400 @@
++/* This testcase is part of GDB, the GNU debugger.
++              
++   Copyright 2011 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++              
++/* This file is compiled from gdb.arch/amd64-prologue-xmm.c
++   using -g -dA -S.  */
++
++      .file   "amd64-prologue-xmm.c"
++      .text
++.Ltext0:
++      .local  v
++      .comm   v,4,4
++      .local  fail
++      .comm   fail,4,4
++      .type   func, @function
++func:
++.LFB0:
++      .file 1 "gdb.arch/amd64-prologue-xmm.c"
++      # gdb.arch/amd64-prologue-xmm.c:22
++      .loc 1 22 0
++      .cfi_startproc
++      # basic block 2
++      pushq   %rbp
++      .cfi_def_cfa_offset 16
++      .cfi_offset 6, -16
++      movq    %rsp, %rbp
++      .cfi_def_cfa_register 6
++      subq    $72, %rsp
++      movq    %rsi, -168(%rbp)
++      movq    %rdx, -160(%rbp)
++      movq    %rcx, -152(%rbp)
++      movq    %r8, -144(%rbp)
++      movq    %r9, -136(%rbp)
++      testb   %al, %al
++      je      .L2
++      # basic block 3
++      # gdb.arch/amd64-prologue-xmm.c:22
++      .loc 1 22 0
++      movaps  %xmm0, -128(%rbp)
++      movaps  %xmm1, -112(%rbp)
++      movaps  %xmm2, -96(%rbp)
++      movaps  %xmm3, -80(%rbp)
++      movaps  %xmm4, -64(%rbp)
++      movaps  %xmm5, -48(%rbp)
++      movaps  %xmm6, -32(%rbp)
++      movaps  %xmm7, -16(%rbp)
++.L2:
++      # basic block 4
++      movl    %edi, -180(%rbp)
++      # gdb.arch/amd64-prologue-xmm.c:23
++      .loc 1 23 0
++      movl    -180(%rbp), %eax
++      movl    %eax, v(%rip)
++      # gdb.arch/amd64-prologue-xmm.c:24
++      .loc 1 24 0
++      leave
++      .cfi_def_cfa 7, 8
++      ret
++      .cfi_endproc
++.LFE0:
++      .size   func, .-func
++      .type   marker, @function
++marker:
++.LFB1:
++      # gdb.arch/amd64-prologue-xmm.c:28
++      .loc 1 28 0
++      .cfi_startproc
++      # basic block 2
++      pushq   %rbp
++      .cfi_def_cfa_offset 16
++      .cfi_offset 6, -16
++      movq    %rsp, %rbp
++      .cfi_def_cfa_register 6
++      # gdb.arch/amd64-prologue-xmm.c:29
++      .loc 1 29 0
++      popq    %rbp
++      .cfi_def_cfa 7, 8
++      ret
++      .cfi_endproc
++.LFE1:
++      .size   marker, .-marker
++      .globl  main
++      .type   main, @function
++main:
++.LFB2:
++      # gdb.arch/amd64-prologue-xmm.c:33
++      .loc 1 33 0
++      .cfi_startproc
++      # basic block 2
++      pushq   %rbp
++      .cfi_def_cfa_offset 16
++      .cfi_offset 6, -16
++      movq    %rsp, %rbp
++      .cfi_def_cfa_register 6
++      # gdb.arch/amd64-prologue-xmm.c:34
++      .loc 1 34 0
++      movl    $1, %edi
++      movl    $0, %eax
++      call    func
++      # gdb.arch/amd64-prologue-xmm.c:35
++      .loc 1 35 0
++      movl    $1, fail(%rip)
++      # gdb.arch/amd64-prologue-xmm.c:36
++      .loc 1 36 0
++      call    marker
++      # gdb.arch/amd64-prologue-xmm.c:37
++      .loc 1 37 0
++      movl    $0, %eax
++      # gdb.arch/amd64-prologue-xmm.c:38
++      .loc 1 38 0
++      popq    %rbp
++      .cfi_def_cfa 7, 8
++      ret
++      .cfi_endproc
++.LFE2:
++      .size   main, .-main
++.Letext0:
++      .section        .debug_info,"",@progbits
++.Ldebug_info0:
++      .long   0xc0    # Length of Compilation Unit Info
++      .value  0x4     # DWARF version number
++      .long   .Ldebug_abbrev0 # Offset Into Abbrev. Section
++      .byte   0x8     # Pointer Size (in bytes)
++      .uleb128 0x1    # (DIE (0xb) DW_TAG_compile_unit)
++      .long   .LASF1  # DW_AT_producer: "GNU C 4.6.1 20110715 (Red Hat 4.6.1-3)"
++      .byte   0x1     # DW_AT_language
++      .long   .LASF2  # DW_AT_name: "gdb.arch/amd64-prologue-xmm.c"
++      .long   .LASF3  # DW_AT_comp_dir: ""
++      .quad   .Ltext0 # DW_AT_low_pc
++      .quad   .Letext0        # DW_AT_high_pc
++      .long   .Ldebug_line0   # DW_AT_stmt_list
++      .uleb128 0x2    # (DIE (0x2d) DW_TAG_subprogram)
++      .long   .LASF4  # DW_AT_name: "func"
++      .byte   0x1     # DW_AT_decl_file (gdb.arch/amd64-prologue-xmm.c)
++      .byte   0x15    # DW_AT_decl_line
++                      # DW_AT_prototyped
++      .quad   .LFB0   # DW_AT_low_pc
++      .quad   .LFE0   # DW_AT_high_pc
++      .uleb128 0x1    # DW_AT_frame_base
++      .byte   0x9c    # DW_OP_call_frame_cfa
++                      # DW_AT_GNU_all_call_sites
++      .long   0x59    # DW_AT_sibling
++      .uleb128 0x3    # (DIE (0x4a) DW_TAG_formal_parameter)
++      .ascii "i\0"    # DW_AT_name
++      .byte   0x1     # DW_AT_decl_file (gdb.arch/amd64-prologue-xmm.c)
++      .byte   0x15    # DW_AT_decl_line
++      .long   0x59    # DW_AT_type
++      .uleb128 0x3    # DW_AT_location
++      .byte   0x91    # DW_OP_fbreg
++      .sleb128 -196
++      .uleb128 0x4    # (DIE (0x57) DW_TAG_unspecified_parameters)
++      .byte   0       # end of children of DIE 0x2d
++      .uleb128 0x5    # (DIE (0x59) DW_TAG_base_type)
++      .byte   0x4     # DW_AT_byte_size
++      .byte   0x5     # DW_AT_encoding
++      .ascii "int\0"  # DW_AT_name
++      .uleb128 0x6    # (DIE (0x60) DW_TAG_subprogram)
++      .long   .LASF5  # DW_AT_name: "marker"
++      .byte   0x1     # DW_AT_decl_file (gdb.arch/amd64-prologue-xmm.c)
++      .byte   0x1b    # DW_AT_decl_line
++                      # DW_AT_prototyped
++      .quad   .LFB1   # DW_AT_low_pc
++      .quad   .LFE1   # DW_AT_high_pc
++      .uleb128 0x1    # DW_AT_frame_base
++      .byte   0x9c    # DW_OP_call_frame_cfa
++                      # DW_AT_GNU_all_call_sites
++      .uleb128 0x7    # (DIE (0x79) DW_TAG_subprogram)
++                      # DW_AT_external
++      .long   .LASF6  # DW_AT_name: "main"
++      .byte   0x1     # DW_AT_decl_file (gdb.arch/amd64-prologue-xmm.c)
++      .byte   0x20    # DW_AT_decl_line
++                      # DW_AT_prototyped
++      .long   0x59    # DW_AT_type
++      .quad   .LFB2   # DW_AT_low_pc
++      .quad   .LFE2   # DW_AT_high_pc
++      .uleb128 0x1    # DW_AT_frame_base
++      .byte   0x9c    # DW_OP_call_frame_cfa
++                      # DW_AT_GNU_all_tail_call_sites
++      .uleb128 0x8    # (DIE (0x96) DW_TAG_variable)
++      .ascii "v\0"    # DW_AT_name
++      .byte   0x1     # DW_AT_decl_file (gdb.arch/amd64-prologue-xmm.c)
++      .byte   0x12    # DW_AT_decl_line
++      .long   0xa9    # DW_AT_type
++      .uleb128 0x9    # DW_AT_location
++      .byte   0x3     # DW_OP_addr
++      .quad   v
++      .uleb128 0x9    # (DIE (0xa9) DW_TAG_volatile_type)
++      .long   0x59    # DW_AT_type
++      .uleb128 0xa    # (DIE (0xae) DW_TAG_variable)
++      .long   .LASF0  # DW_AT_name: "fail"
++      .byte   0x1     # DW_AT_decl_file (gdb.arch/amd64-prologue-xmm.c)
++      .byte   0x12    # DW_AT_decl_line
++      .long   0xa9    # DW_AT_type
++      .uleb128 0x9    # DW_AT_location
++      .byte   0x3     # DW_OP_addr
++      .quad   fail
++      .byte   0       # end of children of DIE 0xb
++      .section        .debug_abbrev,"",@progbits
++.Ldebug_abbrev0:
++      .uleb128 0x1    # (abbrev code)
++      .uleb128 0x11   # (TAG: DW_TAG_compile_unit)
++      .byte   0x1     # DW_children_yes
++      .uleb128 0x25   # (DW_AT_producer)
++      .uleb128 0xe    # (DW_FORM_strp)
++      .uleb128 0x13   # (DW_AT_language)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x3    # (DW_AT_name)
++      .uleb128 0xe    # (DW_FORM_strp)
++      .uleb128 0x1b   # (DW_AT_comp_dir)
++      .uleb128 0xe    # (DW_FORM_strp)
++      .uleb128 0x11   # (DW_AT_low_pc)
++      .uleb128 0x1    # (DW_FORM_addr)
++      .uleb128 0x12   # (DW_AT_high_pc)
++      .uleb128 0x1    # (DW_FORM_addr)
++      .uleb128 0x10   # (DW_AT_stmt_list)
++      .uleb128 0x17   # (DW_FORM_sec_offset)
++      .byte   0
++      .byte   0
++      .uleb128 0x2    # (abbrev code)
++      .uleb128 0x2e   # (TAG: DW_TAG_subprogram)
++      .byte   0x1     # DW_children_yes
++      .uleb128 0x3    # (DW_AT_name)
++      .uleb128 0xe    # (DW_FORM_strp)
++      .uleb128 0x3a   # (DW_AT_decl_file)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x3b   # (DW_AT_decl_line)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x27   # (DW_AT_prototyped)
++      .uleb128 0x19   # (DW_FORM_flag_present)
++      .uleb128 0x11   # (DW_AT_low_pc)
++      .uleb128 0x1    # (DW_FORM_addr)
++      .uleb128 0x12   # (DW_AT_high_pc)
++      .uleb128 0x1    # (DW_FORM_addr)
++      .uleb128 0x40   # (DW_AT_frame_base)
++      .uleb128 0x18   # (DW_FORM_exprloc)
++      .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
++      .uleb128 0x19   # (DW_FORM_flag_present)
++      .uleb128 0x1    # (DW_AT_sibling)
++      .uleb128 0x13   # (DW_FORM_ref4)
++      .byte   0
++      .byte   0
++      .uleb128 0x3    # (abbrev code)
++      .uleb128 0x5    # (TAG: DW_TAG_formal_parameter)
++      .byte   0       # DW_children_no
++      .uleb128 0x3    # (DW_AT_name)
++      .uleb128 0x8    # (DW_FORM_string)
++      .uleb128 0x3a   # (DW_AT_decl_file)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x3b   # (DW_AT_decl_line)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x49   # (DW_AT_type)
++      .uleb128 0x13   # (DW_FORM_ref4)
++      .uleb128 0x2    # (DW_AT_location)
++      .uleb128 0x18   # (DW_FORM_exprloc)
++      .byte   0
++      .byte   0
++      .uleb128 0x4    # (abbrev code)
++      .uleb128 0x18   # (TAG: DW_TAG_unspecified_parameters)
++      .byte   0       # DW_children_no
++      .byte   0
++      .byte   0
++      .uleb128 0x5    # (abbrev code)
++      .uleb128 0x24   # (TAG: DW_TAG_base_type)
++      .byte   0       # DW_children_no
++      .uleb128 0xb    # (DW_AT_byte_size)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x3e   # (DW_AT_encoding)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x3    # (DW_AT_name)
++      .uleb128 0x8    # (DW_FORM_string)
++      .byte   0
++      .byte   0
++      .uleb128 0x6    # (abbrev code)
++      .uleb128 0x2e   # (TAG: DW_TAG_subprogram)
++      .byte   0       # DW_children_no
++      .uleb128 0x3    # (DW_AT_name)
++      .uleb128 0xe    # (DW_FORM_strp)
++      .uleb128 0x3a   # (DW_AT_decl_file)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x3b   # (DW_AT_decl_line)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x27   # (DW_AT_prototyped)
++      .uleb128 0x19   # (DW_FORM_flag_present)
++      .uleb128 0x11   # (DW_AT_low_pc)
++      .uleb128 0x1    # (DW_FORM_addr)
++      .uleb128 0x12   # (DW_AT_high_pc)
++      .uleb128 0x1    # (DW_FORM_addr)
++      .uleb128 0x40   # (DW_AT_frame_base)
++      .uleb128 0x18   # (DW_FORM_exprloc)
++      .uleb128 0x2117 # (DW_AT_GNU_all_call_sites)
++      .uleb128 0x19   # (DW_FORM_flag_present)
++      .byte   0
++      .byte   0
++      .uleb128 0x7    # (abbrev code)
++      .uleb128 0x2e   # (TAG: DW_TAG_subprogram)
++      .byte   0       # DW_children_no
++      .uleb128 0x3f   # (DW_AT_external)
++      .uleb128 0x19   # (DW_FORM_flag_present)
++      .uleb128 0x3    # (DW_AT_name)
++      .uleb128 0xe    # (DW_FORM_strp)
++      .uleb128 0x3a   # (DW_AT_decl_file)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x3b   # (DW_AT_decl_line)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x27   # (DW_AT_prototyped)
++      .uleb128 0x19   # (DW_FORM_flag_present)
++      .uleb128 0x49   # (DW_AT_type)
++      .uleb128 0x13   # (DW_FORM_ref4)
++      .uleb128 0x11   # (DW_AT_low_pc)
++      .uleb128 0x1    # (DW_FORM_addr)
++      .uleb128 0x12   # (DW_AT_high_pc)
++      .uleb128 0x1    # (DW_FORM_addr)
++      .uleb128 0x40   # (DW_AT_frame_base)
++      .uleb128 0x18   # (DW_FORM_exprloc)
++      .uleb128 0x2116 # (DW_AT_GNU_all_tail_call_sites)
++      .uleb128 0x19   # (DW_FORM_flag_present)
++      .byte   0
++      .byte   0
++      .uleb128 0x8    # (abbrev code)
++      .uleb128 0x34   # (TAG: DW_TAG_variable)
++      .byte   0       # DW_children_no
++      .uleb128 0x3    # (DW_AT_name)
++      .uleb128 0x8    # (DW_FORM_string)
++      .uleb128 0x3a   # (DW_AT_decl_file)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x3b   # (DW_AT_decl_line)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x49   # (DW_AT_type)
++      .uleb128 0x13   # (DW_FORM_ref4)
++      .uleb128 0x2    # (DW_AT_location)
++      .uleb128 0x18   # (DW_FORM_exprloc)
++      .byte   0
++      .byte   0
++      .uleb128 0x9    # (abbrev code)
++      .uleb128 0x35   # (TAG: DW_TAG_volatile_type)
++      .byte   0       # DW_children_no
++      .uleb128 0x49   # (DW_AT_type)
++      .uleb128 0x13   # (DW_FORM_ref4)
++      .byte   0
++      .byte   0
++      .uleb128 0xa    # (abbrev code)
++      .uleb128 0x34   # (TAG: DW_TAG_variable)
++      .byte   0       # DW_children_no
++      .uleb128 0x3    # (DW_AT_name)
++      .uleb128 0xe    # (DW_FORM_strp)
++      .uleb128 0x3a   # (DW_AT_decl_file)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x3b   # (DW_AT_decl_line)
++      .uleb128 0xb    # (DW_FORM_data1)
++      .uleb128 0x49   # (DW_AT_type)
++      .uleb128 0x13   # (DW_FORM_ref4)
++      .uleb128 0x2    # (DW_AT_location)
++      .uleb128 0x18   # (DW_FORM_exprloc)
++      .byte   0
++      .byte   0
++      .byte   0
++      .section        .debug_aranges,"",@progbits
++      .long   0x2c    # Length of Address Ranges Info
++      .value  0x2     # DWARF Version
++      .long   .Ldebug_info0   # Offset of Compilation Unit Info
++      .byte   0x8     # Size of Address
++      .byte   0       # Size of Segment Descriptor
++      .value  0       # Pad to 16 byte boundary
++      .value  0
++      .quad   .Ltext0 # Address
++      .quad   .Letext0-.Ltext0        # Length
++      .quad   0
++      .quad   0
++      .section        .debug_line,"",@progbits
++.Ldebug_line0:
++      .section        .debug_str,"MS",@progbits,1
++.LASF3:
++      .string ""
++.LASF0:
++      .string "fail"
++.LASF4:
++      .string "func"
++.LASF1:
++      .string "GNU C 4.6.1 20110715 (Red Hat 4.6.1-3)"
++.LASF2:
++      .string "gdb.arch/amd64-prologue-xmm.c"
++.LASF5:
++      .string "marker"
++.LASF6:
++      .string "main"
++      .ident  "GCC: (GNU) 4.6.1 20110715 (Red Hat 4.6.1-3)"
++      .section        .note.GNU-stack,"",@progbits
+
diff --git a/gdb/patches/gdb-gdb-add-index-script.patch b/gdb/patches/gdb-gdb-add-index-script.patch
new file mode 100644 (file)
index 0000000..1c145ac
--- /dev/null
@@ -0,0 +1,118 @@
+http://sourceware.org/ml/gdb-patches/2010-07/msg00184.html
+Subject: Re: [0/4] RFC: add DWARF index support
+
+Jan Kratochvil: Fixed $d -> $dir.
+Jan Kratochvil: Remove /dev/null redirection.
+
+>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
+
+Tom> This patch series adds support for a DWARF index to gdb.
+
+Roland suggested we wrap up the index-creation code into a helper
+script.
+
+I'm not sure if this is something people would want in gdb proper, but I
+figured I would send it here just in case.
+
+Tom
+
+2010-07-09  Tom Tromey  <tromey@redhat.com>
+
+       * Makefile.in (install-only): Install gdb-add-index.
+       * gdb-add-index: New file.
+
+2010-07-09  Tom Tromey  <tromey@redhat.com>
+
+       * gdb.texinfo (Index Files): Mention gdb-add-index.
+
+>From 30714fe719e61baea03d0dc5793eb0d564faebb7 Mon Sep 17 00:00:00 2001
+From: Tom Tromey <tromey@redhat.com>
+Date: Fri, 9 Jul 2010 11:17:54 -0600
+Subject: [PATCH 4/4] add gdb-add-index
+Subject: [PATCH 4/4] add gdb-add-index
+
+---
+ gdb/ChangeLog       |    5 +++++
+ gdb/Makefile.in     |   11 ++++++++++-
+ gdb/doc/ChangeLog   |    4 ++++
+ gdb/doc/gdb.texinfo |    8 ++++++++
+ gdb/gdb-add-index   |   30 ++++++++++++++++++++++++++++++
+ 5 files changed, 57 insertions(+), 1 deletions(-)
+ create mode 100755 gdb/gdb-add-index
+
+Index: gdb-7.2.50.20101116/gdb/Makefile.in
+===================================================================
+--- gdb-7.2.50.20101116.orig/gdb/Makefile.in   2010-11-16 08:03:17.000000000 +0100
++++ gdb-7.2.50.20101116/gdb/Makefile.in        2010-11-16 08:47:45.000000000 +0100
+@@ -986,7 +986,16 @@ install-only: install-gstack $(CONFIG_IN
+               $(SHELL) $(srcdir)/../mkinstalldirs \
+                       $(DESTDIR)$(man1dir) ; \
+               $(INSTALL_DATA) $(srcdir)/gdb.1 \
+-                      $(DESTDIR)$(man1dir)/$$transformed_name.1
++                      $(DESTDIR)$(man1dir)/$$transformed_name.1; \
++      transformed_name=`t='$(program_transform_name)'; \
++                        echo gdb-add-index | sed -e "$$t"` ; \
++              if test "x$$transformed_name" = x; then \
++                transformed_name=gdb-add-index ; \
++              else \
++                true ; \
++              fi ; \
++              $(INSTALL_PROGRAM) $(srcdir)/gdb-add-index \
++                      $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT)
+       @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
+ .PHONY: install-tui
+ install-tui:
+Index: gdb-7.2.50.20101116/gdb/doc/gdb.texinfo
+===================================================================
+--- gdb-7.2.50.20101116.orig/gdb/doc/gdb.texinfo       2010-11-16 08:04:18.000000000 +0100
++++ gdb-7.2.50.20101116/gdb/doc/gdb.texinfo    2010-11-16 08:56:30.000000000 +0100
+@@ -15500,6 +15500,14 @@ There are currently some limitation on i
+ for DWARF debugging information, not stabs.  And, they do not
+ currently work for programs using Ada.
++@value{GDBN} comes with a program, @command{gdb-add-index}, which can
++be used to add the index to a symbol file.  It takes the symbol file
++as its only argument:
++
++@smallexample
++$ gdb-add-index symfile
++@end smallexample
++
+ @node Symbol Errors
+ @section Errors Reading Symbol Files
+Index: gdb-7.2.50.20101116/gdb/gdb-add-index
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ gdb-7.2.50.20101116/gdb/gdb-add-index      2010-11-16 08:47:45.000000000 +0100
+@@ -0,0 +1,30 @@
++#! /bin/sh
++
++# Add a .gdb_index section to a file.
++
++# Copyright (C) 2010 Free Software Foundation, Inc.
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++file="$1"
++dir="${file%/*}"
++
++# We don't care if gdb gives an error.
++gdb -nx --batch-silent -ex "file $file" -ex "save gdb-index $dir"
++
++if test -f "${file}.gdb-index"; then
++   objcopy --add-section .gdb_index="${file}.gdb-index" --set-section-flags .gdb_index=readonly "$file" "$file"
++   rm -f "${file}.gdb-index"
++fi
++
++exit 0
diff --git a/gdb/patches/gdb-glibc-vdso-workaround.patch b/gdb/patches/gdb-glibc-vdso-workaround.patch
new file mode 100644 (file)
index 0000000..48646d7
--- /dev/null
@@ -0,0 +1,30 @@
+http://sourceware.org/ml/gdb-patches/2011-08/msg00331.html
+Subject: [RFC] Work around PR libc/13097 "linux-vdso.so.1" #2
+
+Hi,
+
+missed the x86_64-m32 case:
+
+gdb/
+2011-08-16  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Work around PR libc/13097.
+       * solib.c (update_solib_list): Ignore "linux-vdso.so.1".
+
+--- a/gdb/solib.c
++++ b/gdb/solib.c
+@@ -783,8 +783,11 @@ update_solib_list (int from_tty, struct target_ops *target)
+         TRY_CATCH (e, RETURN_MASK_ERROR)
+           {
+-            /* Fill in the rest of the `struct so_list' node.  */
+-            if (!solib_map_sections (i))
++            /* Fill in the rest of the `struct so_list' node.
++               Work around PR libc/13097.  */
++            if (!solib_map_sections (i)
++                && strcmp (i->so_original_name, "linux-vdso.so.1") != 0
++                && strcmp (i->so_original_name, "linux-gate.so.1") != 0)
+               {
+                 not_found++;
+                 if (not_found_filename == NULL)
+
diff --git a/gdb/patches/gdb-implptr-64bit-1of2.patch b/gdb/patches/gdb-implptr-64bit-1of2.patch
new file mode 100644 (file)
index 0000000..e24595d
--- /dev/null
@@ -0,0 +1,110 @@
+http://sourceware.org/ml/gdb-patches/2011-09/msg00450.html
+Subject: [patch 1/2] Code cleanup: Unify dwarf2_per_cu_addr_size, dwarf2_per_cu_offset_size
+
+Hi,
+
+this is more rather for patch 2/2, it has positive LoC change but still
+I would find it applicable even on its own.
+
+No functionality change intended.
+
+
+Thanks,
+Jan
+
+
+gdb/
+2011-09-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Code cleanup.
+       * dwarf2read.c (per_cu_header_read_in): New function.
+       (dwarf2_per_cu_addr_size, dwarf2_per_cu_offset_size): Use it, with new
+       variables cu_header_local and cu_headerp.
+
+--- a/gdb/dwarf2read.c
++++ b/gdb/dwarf2read.c
+@@ -15187,26 +15187,42 @@ dwarf2_per_cu_objfile (struct dwarf2_per_cu_data *per_cu)
+   return objfile;
+ }
++/* Return comp_unit_head for PER_CU, either already available in PER_CU->CU
++   (CU_HEADERP is unused in such case) or prepare a temporary copy at
++   CU_HEADERP first.  */
++
++static const struct comp_unit_head *
++per_cu_header_read_in (struct comp_unit_head *cu_headerp,
++                     struct dwarf2_per_cu_data *per_cu)
++{
++  struct objfile *objfile;
++  struct dwarf2_per_objfile *per_objfile;
++  gdb_byte *info_ptr;
++
++  if (per_cu->cu)
++    return &per_cu->cu->header;
++
++  objfile = per_cu->objfile;
++  per_objfile = objfile_data (objfile, dwarf2_objfile_data_key);
++  info_ptr = per_objfile->info.buffer + per_cu->offset;
++
++  memset (cu_headerp, 0, sizeof (*cu_headerp));
++  read_comp_unit_head (cu_headerp, info_ptr, objfile->obfd);
++
++  return cu_headerp;
++}
++
+ /* Return the address size given in the compilation unit header for CU.  */
+ CORE_ADDR
+ dwarf2_per_cu_addr_size (struct dwarf2_per_cu_data *per_cu)
+ {
+-  if (per_cu->cu)
+-    return per_cu->cu->header.addr_size;
+-  else
+-    {
+-      /* If the CU is not currently read in, we re-read its header.  */
+-      struct objfile *objfile = per_cu->objfile;
+-      struct dwarf2_per_objfile *per_objfile
+-      = objfile_data (objfile, dwarf2_objfile_data_key);
+-      gdb_byte *info_ptr = per_objfile->info.buffer + per_cu->offset;
+-      struct comp_unit_head cu_header;
++  struct comp_unit_head cu_header_local;
++  const struct comp_unit_head *cu_headerp;
+-      memset (&cu_header, 0, sizeof cu_header);
+-      read_comp_unit_head (&cu_header, info_ptr, objfile->obfd);
+-      return cu_header.addr_size;
+-    }
++  cu_headerp = per_cu_header_read_in (&cu_header_local, per_cu);
++
++  return cu_headerp->addr_size;
+ }
+ /* Return the offset size given in the compilation unit header for CU.  */
+@@ -15214,21 +15230,12 @@ dwarf2_per_cu_addr_size (struct dwarf2_per_cu_data *per_cu)
+ int
+ dwarf2_per_cu_offset_size (struct dwarf2_per_cu_data *per_cu)
+ {
+-  if (per_cu->cu)
+-    return per_cu->cu->header.offset_size;
+-  else
+-    {
+-      /* If the CU is not currently read in, we re-read its header.  */
+-      struct objfile *objfile = per_cu->objfile;
+-      struct dwarf2_per_objfile *per_objfile
+-      = objfile_data (objfile, dwarf2_objfile_data_key);
+-      gdb_byte *info_ptr = per_objfile->info.buffer + per_cu->offset;
+-      struct comp_unit_head cu_header;
++  struct comp_unit_head cu_header_local;
++  const struct comp_unit_head *cu_headerp;
+-      memset (&cu_header, 0, sizeof cu_header);
+-      read_comp_unit_head (&cu_header, info_ptr, objfile->obfd);
+-      return cu_header.offset_size;
+-    }
++  cu_headerp = per_cu_header_read_in (&cu_header_local, per_cu);
++
++  return cu_headerp->offset_size;
+ }
+ /* Return the text offset of the CU.  The returned offset comes from
+
diff --git a/gdb/patches/gdb-implptr-64bit-2of2.patch b/gdb/patches/gdb-implptr-64bit-2of2.patch
new file mode 100644 (file)
index 0000000..d180674
--- /dev/null
@@ -0,0 +1,411 @@
+http://sourceware.org/ml/gdb-patches/2011-09/msg00451.html
+Subject: [patch 2/2] Fix DW_OP_GNU_implicit_pointer for DWARF32 v3+ on 64-bit arches
+
+Hi,
+
+on 64-bit targets DWARF-3+ is used DW_OP_GNU_implicit_pointer does not work.
+
+DWARF-2 says:
+       This type of reference (DW_FORM_ref_addr) is the size of an address on
+       the target architecture; 
+DWARF-3 says:
+       1.5.1 Upward Compatibility
+       References that use the attribute form DW_FORM_ref_addr are specified
+       to be four bytes in the DWARF 32-bit format and eight bytes in the
+       DWARF 64-bit format, while DWARF Version 2 specifies that such
+       references have the same size as an address on the target system (see
+       Sections 7.4 and 7.5.4).
+
+       (DW_FORM_ref_addr)
+       In the 32-bit DWARF format, this offset is a 4-byte unsigned value; in
+       the 64-bit DWARF format, it is an 8-byte unsigned value (see Section
+       7.4).
+
+GDB currently parsed DW_OP_GNU_implicit_pointer the DWARF-2 way, being
+incompatible with DWARF-3+.
+
+I think DW_OP_GNU_implicit_pointer does not make sense to be used from
+.debug_frame (DWARF-5 is not yet released to say more) so for .debug_frame its
+use is just not permitted (the code would be more complicated otherwise).
+
+No regressions on {x86_64,x86_64-m32,i686}-fedora16pre-linux-gnu.
+
+
+Thanks,
+Jan
+
+
+gdb/
+2011-09-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Fix DW_OP_GNU_implicit_pointer for DWARF32 v3+ on 64-bit arches.
+       * dwarf2-frame.c (execute_stack_op): Initialize ctx->ref_addr_size.
+       * dwarf2expr.c (execute_stack_op) <DW_OP_GNU_implicit_pointer>: Use
+       ctx->ref_addr_size.  Handle its invalid value.
+       * dwarf2expr.h (struct dwarf_expr_context): New field ref_addr_size.
+       * dwarf2loc.c (dwarf2_evaluate_loc_desc_full)
+       (dwarf2_loc_desc_needs_frame): Initialize ctx->ref_addr_size.
+       * dwarf2loc.h (dwarf2_per_cu_ref_addr_size): New declaration.
+       * dwarf2read.c (decode_locdesc): Initialize ctx->ref_addr_size.
+       (dwarf2_per_cu_ref_addr_size): New function.
+
+gdb/testsuite/
+2011-09-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Fix DW_OP_GNU_implicit_pointer for DWARF32 v3+ on 64-bit arches.
+       * gdb.dwarf2/implptr-64bit.S: New file.
+       * gdb.dwarf2/implptr-64bit.exp: New file.
+
+--- a/gdb/dwarf2-frame.c
++++ b/gdb/dwarf2-frame.c
+@@ -371,6 +371,7 @@ execute_stack_op (const gdb_byte *exp, ULONGEST len, int addr_size,
+   ctx->gdbarch = get_frame_arch (this_frame);
+   ctx->addr_size = addr_size;
++  ctx->ref_addr_size = -1;
+   ctx->offset = offset;
+   ctx->baton = this_frame;
+   ctx->funcs = &dwarf2_frame_ctx_funcs;
+--- a/gdb/dwarf2expr.c
++++ b/gdb/dwarf2expr.c
+@@ -709,10 +709,14 @@ execute_stack_op (struct dwarf_expr_context *ctx,
+           ULONGEST die;
+           LONGEST len;
++          if (ctx->ref_addr_size == -1)
++            error (_("DWARF-2 expression error: DW_OP_GNU_implicit_pointer "
++                     "is not allowed in frame context"));
++
+           /* The referred-to DIE.  */
+-          ctx->len = extract_unsigned_integer (op_ptr, ctx->addr_size,
++          ctx->len = extract_unsigned_integer (op_ptr, ctx->ref_addr_size,
+                                                byte_order);
+-          op_ptr += ctx->addr_size;
++          op_ptr += ctx->ref_addr_size;
+           /* The byte offset into the data.  */
+           op_ptr = read_sleb128 (op_ptr, op_end, &len);
+--- a/gdb/dwarf2expr.h
++++ b/gdb/dwarf2expr.h
+@@ -125,6 +125,10 @@ struct dwarf_expr_context
+   /* Target address size in bytes.  */
+   int addr_size;
++  /* DW_FORM_ref_addr size in bytes.  If -1 DWARF is executed from a frame
++     context and operations depending on DW_FORM_ref_addr are not allowed.  */
++  int ref_addr_size;
++
+   /* Offset used to relocate DW_OP_addr argument.  */
+   CORE_ADDR offset;
+--- a/gdb/dwarf2loc.c
++++ b/gdb/dwarf2loc.c
+@@ -1118,6 +1118,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
+   ctx->gdbarch = get_objfile_arch (objfile);
+   ctx->addr_size = dwarf2_per_cu_addr_size (per_cu);
++  ctx->ref_addr_size = dwarf2_per_cu_ref_addr_size (per_cu);
+   ctx->offset = dwarf2_per_cu_text_offset (per_cu);
+   ctx->baton = &baton;
+   ctx->funcs = &dwarf_expr_ctx_funcs;
+@@ -1398,6 +1399,7 @@ dwarf2_loc_desc_needs_frame (const gdb_byte *data, unsigned short size,
+   ctx->gdbarch = get_objfile_arch (objfile);
+   ctx->addr_size = dwarf2_per_cu_addr_size (per_cu);
++  ctx->ref_addr_size = dwarf2_per_cu_ref_addr_size (per_cu);
+   ctx->offset = dwarf2_per_cu_text_offset (per_cu);
+   ctx->baton = &baton;
+   ctx->funcs = &needs_frame_ctx_funcs;
+--- a/gdb/dwarf2loc.h
++++ b/gdb/dwarf2loc.h
+@@ -39,6 +39,10 @@ struct objfile *dwarf2_per_cu_objfile (struct dwarf2_per_cu_data *cu);
+ /* Return the address size given in the compilation unit header for CU.  */
+ CORE_ADDR dwarf2_per_cu_addr_size (struct dwarf2_per_cu_data *cu);
++/* Return the DW_FORM_ref_addr size given in the compilation unit header for
++   CU.  */
++int dwarf2_per_cu_ref_addr_size (struct dwarf2_per_cu_data *cu);
++
+ /* Return the offset size given in the compilation unit header for CU.  */
+ int dwarf2_per_cu_offset_size (struct dwarf2_per_cu_data *cu);
+--- a/gdb/dwarf2read.c
++++ b/gdb/dwarf2read.c
+@@ -15238,6 +15239,22 @@ dwarf2_per_cu_offset_size (struct dwarf2_per_cu_data *per_cu)
+   return cu_headerp->offset_size;
+ }
++/* See its dwarf2loc.h declaration.  */
++
++int
++dwarf2_per_cu_ref_addr_size (struct dwarf2_per_cu_data *per_cu)
++{
++  struct comp_unit_head cu_header_local;
++  const struct comp_unit_head *cu_headerp;
++
++  cu_headerp = per_cu_header_read_in (&cu_header_local, per_cu);
++
++  if (cu_headerp->version == 2)
++    return cu_headerp->addr_size;
++  else
++    return cu_headerp->offset_size;
++}
++
+ /* Return the text offset of the CU.  The returned offset comes from
+    this CU's objfile.  If this objfile came from a separate debuginfo
+    file, then the offset may be different from the corresponding
+--- /dev/null
++++ b/gdb/testsuite/gdb.dwarf2/implptr-64bit.S
+@@ -0,0 +1,197 @@
++/* Copyright 2010, 2011 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++      .section        .debug_info
++d:
++      /* Length of Compilation Unit Info */
++#if OFFSET_SIZE == 4
++# define OFFSET .4byte
++      .4byte  debug_end - 1f
++#elif OFFSET_SIZE == 8
++# define OFFSET .8byte
++      .4byte  0xffffffff
++      .8byte  debug_end - 1f
++#else
++# error
++#endif
++#if ADDR_SIZE == 4
++# define ADDR .4byte
++#elif ADDR_SIZE == 8
++# define ADDR .8byte
++#else
++# error
++#endif
++#if REF_ADDR_SIZE == 4
++# define REF_ADDR .4byte
++#elif REF_ADDR_SIZE == 8
++# define REF_ADDR .8byte
++#else
++# error
++#endif
++1:
++      .2byte  DWARF_VERSION   /* DWARF version number */
++      OFFSET  .Ldebug_abbrev0 /* Offset Into Abbrev. Section */
++      .byte   ADDR_SIZE       /* Pointer Size (in bytes) */
++
++      .uleb128 0x1    /* (DIE (0xb) DW_TAG_compile_unit) */
++      .ascii "GNU C 4.4.3\0"  /* DW_AT_producer */
++      .byte   0x1     /* DW_AT_language */
++      .ascii "1.c\0"  /* DW_AT_name */
++
++.Ltype_int:
++      .uleb128 0x7    /* DW_TAG_base_type */
++      .byte   0x4     /* DW_AT_byte_size */
++      .byte   0x5     /* DW_AT_encoding */
++      .ascii "int\0"  /* DW_AT_name */
++
++.Ltype_struct:
++      .uleb128 0x2    /* DW_TAG_structure_type */
++      .ascii "s\0"    /* DW_AT_name */
++      .byte   4       /* DW_AT_byte_size */
++
++      .uleb128 0x3    /* DW_TAG_member */
++      .ascii "f\0"    /* DW_AT_name */
++      .4byte  .Ltype_int - d  /* DW_AT_type */
++      .byte   0       /* DW_AT_data_member_location */
++
++      .byte   0x0     /* end of children of DW_TAG_structure_type */
++
++      .uleb128        6                       /* Abbrev: DW_TAG_subprogram */
++      .ascii          "main\0"                /* DW_AT_name */
++      ADDR            main                    /* DW_AT_low_pc */
++      ADDR            main + 0x100            /* DW_AT_high_pc */
++      .4byte          .Ltype_int - d          /* DW_AT_type */
++      .byte           1                       /* DW_AT_external */
++
++.Ltype_structptr:
++      .uleb128 0x5    /* DW_TAG_pointer_type */
++      .byte   ADDR_SIZE       /* DW_AT_byte_size */
++      .4byte  .Ltype_struct - d       /* DW_AT_type */
++
++.Lvar_out:
++      .uleb128 0x4    /* (DW_TAG_variable) */
++      .ascii "v\0"    /* DW_AT_name */
++      .byte   2f - 1f /* DW_AT_location: DW_FORM_block1 */
++1:
++      .byte   0x9e    /* DW_OP_implicit_value */
++      .uleb128  2f - 3f
++3:
++      .byte   1, 1, 1, 1
++2:
++      .4byte  .Ltype_struct - d       /* DW_AT_type */
++
++      .uleb128 0x4    /* (DW_TAG_variable) */
++      .ascii "p\0"    /* DW_AT_name */
++      .byte   2f - 1f /* DW_AT_location: DW_FORM_block1 */
++1:
++      .byte   0xf2    /* DW_OP_GNU_implicit_pointer */
++      REF_ADDR        .Lvar_out - d   /* referenced DIE */
++      .sleb128        0       /* offset */
++2:
++      .4byte  .Ltype_structptr - d    /* DW_AT_type */
++
++      .byte   0x0     /* end of children of main */
++
++      .byte   0x0     /* end of children of CU */
++debug_end:
++
++      .section        .debug_abbrev
++.Ldebug_abbrev0:
++
++      .uleb128 0x1    /* (abbrev code) */
++      .uleb128 0x11   /* (TAG: DW_TAG_compile_unit) */
++      .byte   0x1     /* DW_children_yes */
++      .uleb128 0x25   /* (DW_AT_producer) */
++      .uleb128 0x8    /* (DW_FORM_string) */
++      .uleb128 0x13   /* (DW_AT_language) */
++      .uleb128 0xb    /* (DW_FORM_data1) */
++      .uleb128 0x3    /* (DW_AT_name) */
++      .uleb128 0x8    /* (DW_FORM_string) */
++      .byte   0x0
++      .byte   0x0
++
++      .uleb128 0x2    /* (abbrev code) */
++      .uleb128 0x13   /* (TAG: DW_TAG_structure_type) */
++      .byte   0x1     /* DW_children_yes */
++      .uleb128 0x3    /* (DW_AT_name) */
++      .uleb128 0x8    /* (DW_FORM_string) */
++      .uleb128 0xb    /* (DW_AT_byte_size) */
++      .uleb128 0xb    /* (DW_FORM_data1) */
++      .byte   0
++      .byte   0
++
++      .uleb128 0x3    /* (abbrev code) */
++      .uleb128 0xd    /* (TAG: DW_TAG_member) */
++      .byte   0       /* DW_children_no */
++      .uleb128 0x3    /* (DW_AT_name) */
++      .uleb128 0x8    /* (DW_FORM_string) */
++      .uleb128 0x49   /* (DW_AT_type) */
++      .uleb128 0x13   /* (DW_FORM_ref4) */
++      .uleb128 0x38   /* (DW_AT_data_member_location) */
++      .uleb128 0xb    /* (DW_FORM_data1) */
++      .byte   0
++      .byte   0
++
++      .uleb128 0x4    /* (abbrev code) */
++      .uleb128 0x34   /* (TAG: DW_TAG_variable) */
++      .byte   0x0     /* DW_children_yes */
++      .uleb128 0x3    /* (DW_AT_name) */
++      .uleb128 0x8    /* (DW_FORM_string) */
++      .uleb128 0x02   /* (DW_AT_location) */
++      .uleb128 0xa    /* (DW_FORM_block1) */
++      .uleb128 0x49   /* (DW_AT_type) */
++      .uleb128 0x13   /* (DW_FORM_ref4) */
++      .byte   0x0
++      .byte   0x0
++
++      .uleb128 0x5    /* (abbrev code) */
++      .uleb128 0xf    /* (TAG: DW_TAG_pointer_type) */
++      .byte   0x0     /* DW_children_no */
++      .uleb128 0xb    /* (DW_AT_byte_size) */
++      .uleb128 0xb    /* (DW_FORM_data1) */
++      .uleb128 0x49   /* (DW_AT_type) */
++      .uleb128 0x13   /* (DW_FORM_ref4) */
++      .byte   0x0
++      .byte   0x0
++
++      .uleb128        6                       /* Abbrev code */
++      .uleb128        0x2e                    /* DW_TAG_subprogram */
++      .byte           1                       /* has_children */
++      .uleb128        0x3                     /* DW_AT_name */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .uleb128        0x11                    /* DW_AT_low_pc */
++      .uleb128        0x1                     /* DW_FORM_addr */
++      .uleb128        0x12                    /* DW_AT_high_pc */
++      .uleb128        0x1                     /* DW_FORM_addr */
++      .uleb128        0x49                    /* DW_AT_type */
++      .uleb128        0x13                    /* DW_FORM_ref4 */
++      .uleb128        0x3f                    /* DW_AT_external */
++      .uleb128        0xc                     /* DW_FORM_flag */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .uleb128 0x7    /* (abbrev code) */
++      .uleb128 0x24   /* (TAG: DW_TAG_base_type) */
++      .byte   0       /* DW_children_no */
++      .uleb128 0xb    /* (DW_AT_byte_size) */
++      .uleb128 0xb    /* (DW_FORM_data1) */
++      .uleb128 0x3e   /* (DW_AT_encoding) */
++      .uleb128 0xb    /* (DW_FORM_data1) */
++      .uleb128 0x3    /* (DW_AT_name) */
++      .uleb128 0x8    /* (DW_FORM_string) */
++      .byte   0
++      .byte   0
++
++      .byte   0x0
+--- /dev/null
++++ b/gdb/testsuite/gdb.dwarf2/implptr-64bit.exp
+@@ -0,0 +1,51 @@
++# Copyright 2011 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++load_lib dwarf.exp
++
++# This test can only be run on targets which support DWARF-2 and use gas.
++if {![dwarf2_support]} {
++    return 0  
++}
++
++set testfile "implptr-64bit"
++set srcfile ${testfile}.S
++set mainfile main.c
++
++proc test { dwarf_version offset_size addr_size ref_addr_size } {
++    global testfile srcfile mainfile
++
++    set opts {}
++    foreach n { dwarf_version offset_size addr_size ref_addr_size } {
++      lappend opts "additional_flags=-D[string toupper $n]=[expr "\$$n"]"
++    }
++
++    set name "d${dwarf_version}o${offset_size}a${addr_size}r${ref_addr_size}"
++    set executable ${testfile}-${name}
++    if [prepare_for_testing ${testfile}.exp $executable "${srcfile} ${mainfile}" $opts] {
++      return -1
++    }
++
++    if ![runto_main] {
++      return -1
++    }
++
++    gdb_test "p/x p->f" " = 0x1010101" $name
++}
++
++#    DWARF_VERSION OFFSET_SIZE ADDR_SIZE REF_ADDR_SIZE
++test 2 8 4 4
++test 2 4 8 8
++test 3 8 4 8
++test 3 4 8 4
+
diff --git a/gdb/patches/gdb-lineno-makeup-test.patch b/gdb/patches/gdb-lineno-makeup-test.patch
new file mode 100644 (file)
index 0000000..073662a
--- /dev/null
@@ -0,0 +1,151 @@
+New testcase for:
+https://bugzilla.redhat.com/show_bug.cgi?id=466222
+       (for the first / customer recommended fix)
+and the upstream fix:
+http://sourceware.org/ml/gdb-patches/2006-11/msg00253.html
+       [rfc] Do not make up line information
+http://sourceware.org/ml/gdb-cvs/2006-11/msg00127.html
+
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/lineno-makeup-func.c
+@@ -0,0 +1,21 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2009 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++void
++func (void)
++{
++}
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/lineno-makeup.c
+@@ -0,0 +1,35 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2009 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++/* DW_AT_low_pc-DW_AT_high_pc should cover the function without line number
++   information (.debug_line) so we cannot use an external object file.
++   
++   It must not be just a label as it would alias on the next function even for
++   correct GDB.  Therefore some stub data must be placed there.
++   
++   We need to provide a real stub function body as at least s390
++   (s390_analyze_prologue) would skip the whole body till reaching `main'.  */
++
++extern void func (void);
++asm ("func: .incbin \"gdb.base/lineno-makeup-func.bin\"");
++
++int
++main (void)
++{
++  func ();
++  return 0;
++}
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/lineno-makeup.exp
+@@ -0,0 +1,78 @@
++# Copyright 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++set testfile "lineno-makeup"
++set srcfuncfile ${testfile}-func.c
++set srcfile ${testfile}.c
++set objfuncfile ${objdir}/${subdir}/${testfile}-func.o
++set binfuncfile ${objdir}/${subdir}/${testfile}-func.bin
++set binfile ${objdir}/${subdir}/${testfile}
++
++if { [gdb_compile "${srcdir}/${subdir}/${srcfuncfile}" "${objfuncfile}" object {}] != "" } {
++    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
++}
++
++set objcopy [catch "exec objcopy -O binary --only-section .text ${objfuncfile} ${binfuncfile}" output]
++verbose -log "objcopy=$objcopy: $output"
++if { $objcopy != 0 } {
++    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
++}
++set binfuncfilesize [file size $binfuncfile]
++verbose -log "file size $binfuncfile = $binfuncfilesize"
++
++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++set b_addr ""
++set test "break func"
++gdb_test_multiple $test $test {
++    -re "Breakpoint \[0-9\]+ at (0x\[0-9a-f\]+)\r\n$gdb_prompt $" {
++      set b_addr $expect_out(1,string)
++      pass $test
++    }
++    -re "Breakpoint \[0-9\]+ at (0x\[0-9a-f\]+): .*\r\n$gdb_prompt $" {
++      set b_addr $expect_out(1,string)
++      fail $test
++    }
++}
++verbose -log "b_addr=<$b_addr>"
++
++set p_addr ""
++set test "print func"
++gdb_test_multiple $test $test {
++    -re "\\$\[0-9\]+ = {<text variable, no debug info>} (0x\[0-9a-f\]+) <func>\r\n$gdb_prompt $" {
++      set p_addr $expect_out(1,string)
++      pass $test
++    }
++}
++verbose -log "p_addr=<$p_addr>"
++
++set test "break address belongs to func"
++if {$b_addr == $p_addr} {
++    pass "$test (exact match)"
++} else {
++    set skip [expr $b_addr - $p_addr]
++    if {$skip > 0 && $skip < $binfuncfilesize} {
++      pass "$test (prologue skip by $skip bytes)"
++    } else {
++      fail $test
++    }
++}
diff --git a/gdb/patches/gdb-moribund-utrace-workaround.patch b/gdb/patches/gdb-moribund-utrace-workaround.patch
new file mode 100644 (file)
index 0000000..6b50a8e
--- /dev/null
@@ -0,0 +1,16 @@
+https://bugzilla.redhat.com/show_bug.cgi?id=590623
+http://sources.redhat.com/bugzilla/show_bug.cgi?id=11593
+
+Bug in FSF GDB exploited by the ptrace-on-utrace interaction.
+
+--- a/gdb/breakpoint.c
++++ b/gdb/breakpoint.c
+@@ -9084,6 +9084,8 @@ update_global_location_list (int should_insert)
+                traps we can no longer explain.  */
+             old_loc->events_till_retirement = 3 * (thread_count () + 1);
++            /* Red Hat Bug 590623.  */
++            old_loc->events_till_retirement *= 10;
+             old_loc->owner = NULL;
+             VEC_safe_push (bp_location_p, moribund_locations, old_loc);
diff --git a/gdb/patches/gdb-optimized-out-internal-error.patch b/gdb/patches/gdb-optimized-out-internal-error.patch
new file mode 100644 (file)
index 0000000..1588ce6
--- /dev/null
@@ -0,0 +1,302 @@
+http://sourceware.org/ml/gdb-patches/2011-09/msg00449.html
+Subject: [patch] Fix internal error on optimized-out values (regression by me)
+
+Hi,
+
+since:
+       Re: [patch] Code cleanup: Introduce allocate_optimized_out_value
+       http://sourceware.org/ml/gdb-patches/2011-07/msg00327.html
+       acfe85f56075910a3ba5e8b76189e0770079b8d1
+can occur:
+       (gdb) p p->f
+       valops.c:1118: internal-error: Unexpected lazy value type.
+       A problem internal to GDB has been detected,
+
+in that mail referenced above:
+# It is true it would be definitely a bug in a code incompatible with such
+# change so one may rather fix that possible regression there.
+
+so this testcase exploits such case.  The problem is formerly the code
+allocated (in some cases) optimized out values as non-lazy ones.  Now they are
+allocated all as lazy (*) which breaks some code not expecting lazy values.
+
+(*) Such lazy optimized out value still gets silently allocate_value_contents
+    by value_fetch_lazy, allocate_value_contents should be suppressed in such
+    case; such more radical change has never been made.
+
+Formerly (incl. gdb-7.3) did:
+       (gdb) p p->f
+       $1 = 0
+which was also wrong, ((struct *) <optimized out>)->field should be IMO still
+<optimized out>; just it became internal-error now.
+
+GDB usually does require_not_optimized_out throwing error() when it meets any
+first <optimized out> value.  I have just produced new optimized value
+instead; require_not_optimized_out is not exported and I find it better this
+way.
+
+Following the rule that it is better if GDB does something wrong rather then
+it throws internal-error to make the patch from July above fully safe one
+would have to change allocate_optimized_out_value to allocate everything as
+non-lazy.  I find that as a too ugly workaround of the codebase.
+
+No regressions on {x86_64,x86_64-m32,i686}-fedora16pre-linux-gnu.
+
+
+Andre, do you still see the bug even with this patch?
+
+
+Thanks,
+Jan
+
+
+gdb/
+2011-09-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Fix internal error regression.
+       * value.c (value_primitive_field): Handle value_optimized_out.  Move
+       packed bitfields comment.
+
+gdb/testsuite/
+2011-09-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Fix internal error regression.
+       * gdb.dwarf2/implptr-optimized-out.S: New file.
+       * gdb.dwarf2/implptr-optimized-out.exp: New file.
+
+--- a/gdb/value.c
++++ b/gdb/value.c
+@@ -2482,16 +2482,19 @@ value_primitive_field (struct value *arg1, int offset,
+      description correctly.  */
+   check_typedef (type);
+-  /* Handle packed fields */
+-
+-  if (TYPE_FIELD_BITSIZE (arg_type, fieldno))
++  if (value_optimized_out (arg1))
++    v = allocate_optimized_out_value (type);
++  else if (TYPE_FIELD_BITSIZE (arg_type, fieldno))
+     {
+-      /* Create a new value for the bitfield, with bitpos and bitsize
++      /* Handle packed fields.
++
++       Create a new value for the bitfield, with bitpos and bitsize
+        set.  If possible, arrange offset and bitpos so that we can
+        do a single aligned read of the size of the containing type.
+        Otherwise, adjust offset to the byte containing the first
+        bit.  Assume that the address, offset, and embedded offset
+        are sufficiently aligned.  */
++
+       int bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno);
+       int container_bitsize = TYPE_LENGTH (type) * 8;
+--- /dev/null
++++ b/gdb/testsuite/gdb.dwarf2/implptr-optimized-out.S
+@@ -0,0 +1,166 @@
++/* Copyright 2010, 2011 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++      .section        .debug_info
++d:
++      .long   debug_end - 1f  /* Length of Compilation Unit Info */
++1:
++      .2byte  0x3     /* DWARF version number */
++      .long   .Ldebug_abbrev0 /* Offset Into Abbrev. Section */
++      .byte   0x4     /* Pointer Size (in bytes) */
++      .uleb128 0x1    /* (DIE (0xb) DW_TAG_compile_unit) */
++      .ascii "GNU C 4.4.3\0"  /* DW_AT_producer */
++      .byte   0x1     /* DW_AT_language */
++      .ascii "1.c\0"  /* DW_AT_name */
++
++.Ltype_int:
++      .uleb128 0x7    /* DW_TAG_base_type */
++      .byte   0x4     /* DW_AT_byte_size */
++      .byte   0x5     /* DW_AT_encoding */
++      .ascii "int\0"  /* DW_AT_name */
++
++.Ltype_struct:
++      .uleb128 0x2    /* DW_TAG_structure_type */
++      .ascii "s\0"    /* DW_AT_name */
++      .byte   4       /* DW_AT_byte_size */
++
++      .uleb128 0x3    /* DW_TAG_member */
++      .ascii "f\0"    /* DW_AT_name */
++      .4byte  .Ltype_int - d  /* DW_AT_type */
++      .byte   0       /* DW_AT_data_member_location */
++
++      .byte   0x0     /* end of children of DW_TAG_structure_type */
++
++      .uleb128        6                       /* Abbrev: DW_TAG_subprogram */
++      .ascii          "main\0"                /* DW_AT_name */
++      .4byte          main                    /* DW_AT_low_pc */
++      .4byte          main + 0x100            /* DW_AT_high_pc */
++      .4byte          .Ltype_int - d          /* DW_AT_type */
++      .byte           1                       /* DW_AT_external */
++
++.Ltype_structptr:
++      .uleb128 0x5    /* DW_TAG_pointer_type */
++      .byte   0x4     /* DW_AT_byte_size */
++      .long   .Ltype_struct - d       /* DW_AT_type */
++
++.Lvar_out:
++      .uleb128 0x4    /* (DW_TAG_variable) */
++      .ascii "v\0"    /* DW_AT_name */
++      .byte   0       /* DW_AT_location: DW_FORM_block1 */
++      .4byte  .Ltype_struct - d       /* DW_AT_type */
++
++      .uleb128 0x4    /* (DW_TAG_variable) */
++      .ascii "p\0"    /* DW_AT_name */
++      .byte   2f - 1f /* DW_AT_location: DW_FORM_block1 */
++1:
++      .byte   0xf2    /* DW_OP_GNU_implicit_pointer */
++      .4byte  .Lvar_out - d   /* referenced DIE */
++      .sleb128        0       /* offset */
++2:
++      .4byte  .Ltype_structptr - d    /* DW_AT_type */
++
++      .byte   0x0     /* end of children of main */
++
++      .byte   0x0     /* end of children of CU */
++debug_end:
++
++      .section        .debug_abbrev
++.Ldebug_abbrev0:
++
++      .uleb128 0x1    /* (abbrev code) */
++      .uleb128 0x11   /* (TAG: DW_TAG_compile_unit) */
++      .byte   0x1     /* DW_children_yes */
++      .uleb128 0x25   /* (DW_AT_producer) */
++      .uleb128 0x8    /* (DW_FORM_string) */
++      .uleb128 0x13   /* (DW_AT_language) */
++      .uleb128 0xb    /* (DW_FORM_data1) */
++      .uleb128 0x3    /* (DW_AT_name) */
++      .uleb128 0x8    /* (DW_FORM_string) */
++      .byte   0x0
++      .byte   0x0
++
++      .uleb128 0x2    /* (abbrev code) */
++      .uleb128 0x13   /* (TAG: DW_TAG_structure_type) */
++      .byte   0x1     /* DW_children_yes */
++      .uleb128 0x3    /* (DW_AT_name) */
++      .uleb128 0x8    /* (DW_FORM_string) */
++      .uleb128 0xb    /* (DW_AT_byte_size) */
++      .uleb128 0xb    /* (DW_FORM_data1) */
++      .byte   0
++      .byte   0
++
++      .uleb128 0x3    /* (abbrev code) */
++      .uleb128 0xd    /* (TAG: DW_TAG_member) */
++      .byte   0       /* DW_children_no */
++      .uleb128 0x3    /* (DW_AT_name) */
++      .uleb128 0x8    /* (DW_FORM_string) */
++      .uleb128 0x49   /* (DW_AT_type) */
++      .uleb128 0x13   /* (DW_FORM_ref4) */
++      .uleb128 0x38   /* (DW_AT_data_member_location) */
++      .uleb128 0xb    /* (DW_FORM_data1) */
++      .byte   0
++      .byte   0
++
++      .uleb128 0x4    /* (abbrev code) */
++      .uleb128 0x34   /* (TAG: DW_TAG_variable) */
++      .byte   0x0     /* DW_children_yes */
++      .uleb128 0x3    /* (DW_AT_name) */
++      .uleb128 0x8    /* (DW_FORM_string) */
++      .uleb128 0x02   /* (DW_AT_location) */
++      .uleb128 0xa    /* (DW_FORM_block1) */
++      .uleb128 0x49   /* (DW_AT_type) */
++      .uleb128 0x13   /* (DW_FORM_ref4) */
++      .byte   0x0
++      .byte   0x0
++
++      .uleb128 0x5    /* (abbrev code) */
++      .uleb128 0xf    /* (TAG: DW_TAG_pointer_type) */
++      .byte   0x0     /* DW_children_no */
++      .uleb128 0xb    /* (DW_AT_byte_size) */
++      .uleb128 0xb    /* (DW_FORM_data1) */
++      .uleb128 0x49   /* (DW_AT_type) */
++      .uleb128 0x13   /* (DW_FORM_ref4) */
++      .byte   0x0
++      .byte   0x0
++
++      .uleb128        6                       /* Abbrev code */
++      .uleb128        0x2e                    /* DW_TAG_subprogram */
++      .byte           1                       /* has_children */
++      .uleb128        0x3                     /* DW_AT_name */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .uleb128        0x11                    /* DW_AT_low_pc */
++      .uleb128        0x1                     /* DW_FORM_addr */
++      .uleb128        0x12                    /* DW_AT_high_pc */
++      .uleb128        0x1                     /* DW_FORM_addr */
++      .uleb128        0x49                    /* DW_AT_type */
++      .uleb128        0x13                    /* DW_FORM_ref4 */
++      .uleb128        0x3f                    /* DW_AT_external */
++      .uleb128        0xc                     /* DW_FORM_flag */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .uleb128 0x7    /* (abbrev code) */
++      .uleb128 0x24   /* (TAG: DW_TAG_base_type) */
++      .byte   0       /* DW_children_no */
++      .uleb128 0xb    /* (DW_AT_byte_size) */
++      .uleb128 0xb    /* (DW_FORM_data1) */
++      .uleb128 0x3e   /* (DW_AT_encoding) */
++      .uleb128 0xb    /* (DW_FORM_data1) */
++      .uleb128 0x3    /* (DW_AT_name) */
++      .uleb128 0x8    /* (DW_FORM_string) */
++      .byte   0
++      .byte   0
++
++      .byte   0x0
+--- /dev/null
++++ b/gdb/testsuite/gdb.dwarf2/implptr-optimized-out.exp
+@@ -0,0 +1,37 @@
++# Copyright 2011 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++load_lib dwarf.exp
++
++# This test can only be run on targets which support DWARF-2 and use gas.
++if {![dwarf2_support]} {
++    return 0  
++}
++
++set testfile "implptr-optimized-out"
++set srcfile ${testfile}.S
++set mainfile main.c
++set executable ${testfile}
++set binfile ${objdir}/${subdir}/${executable}
++
++if [prepare_for_testing ${testfile}.exp $executable "${srcfile} ${mainfile}" {}] {
++    return -1
++}
++
++# DW_OP_GNU_implicit_pointer implementation requires a valid frame.
++if ![runto_main] {
++    return -1
++}
++
++gdb_test "p p->f" " = <optimized out>"
+
diff --git a/gdb/patches/gdb-ppc-power7-test.patch b/gdb/patches/gdb-ppc-power7-test.patch
new file mode 100644 (file)
index 0000000..4d4772a
--- /dev/null
@@ -0,0 +1,295 @@
+--- /dev/null
++++ b/gdb/testsuite/gdb.arch/powerpc-power7.exp
+@@ -0,0 +1,182 @@
++# Copyright 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# Test PowerPC Power7 instructions disassembly.
++
++if {![istarget "powerpc*-*-*"]} then {
++    verbose "Skipping PowerPC Power7 instructions disassembly."
++    return
++}
++
++set testfile "powerpc-power7"
++set srcfile ${testfile}.s
++set objfile ${objdir}/${subdir}/${testfile}.o
++
++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } {
++    untested "PowerPC Power7 instructions disassembly"
++    return -1
++}
++
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${objfile}
++ 
++
++# Disassemble the function.
++
++set test "disass func"
++gdb_test_multiple $test $test {
++    -re "\r\nDump of assembler code for function func:(\r\n.*\r\n)End of assembler dump.\r\n$gdb_prompt $" {
++      set func $expect_out(1,string)
++      pass $test
++    }
++}
++
++proc instr_to_patt {offset instr} {
++    # 0x0000000000000018 <func+24>:   stxvd2x vs43,r4,r5
++    return ".*\r\n\[ \t\]*[string map {0x 0x0*} $offset] <(func)?\\+?\[0-9\]*>:\[ \t\]*[string map [list { } "\[ \t\]+" . {\.}] $instr]\[ \t\]*\r\n.*"
++}
++
++# KFAIL strings would not exist if -Many would print the same as -Mpower7.
++# That means the power7 form should be the preferred one.
++# http://sourceware.org/ml/gdb-patches/2009-03/threads.html#00020
++
++proc func_check {offset instr {kfail ""}} {
++    global func
++
++    set test "Found $offset: $instr"
++    if [regexp -nocase -line [instr_to_patt $offset $instr] $func] {
++      pass $test
++    } elseif {$kfail != "" && [regexp -nocase -line [instr_to_patt $offset $kfail] $func]} {
++      kfail gdb/NNNN $test
++    } else {
++      fail $test
++    }
++}
++
++func_check   0x0 "lxvd2x  vs3,r4,r5"
++# [PATCH] Remove support for POWER7 VSX load/store with update instructions
++# http://sourceware.org/ml/binutils/2009-09/msg00680.html
++# http://sourceware.org/ml/binutils-cvs/2009-09/msg00331.html
++# lxvd2ux vs3,r4,r5
++func_check   0x4 ".long 0x7c642ed8"
++func_check   0x8 "lxvd2x  vs43,r4,r5"
++# lxvd2ux vs43,r4,r5
++func_check   0xc ".long 0x7d642ed9"
++func_check  0x10 "stxvd2x vs3,r4,r5"
++# stxvd2ux vs3,r4,r5
++func_check  0x14 ".long 0x7c642fd8"
++func_check  0x18 "stxvd2x vs43,r4,r5"
++# stxvd2ux vs43,r4,r5
++func_check  0x1c ".long 0x7d642fd9"
++func_check  0x20 "xxmrghd vs3,vs4,vs5"
++func_check  0x24 "xxmrghd vs43,vs44,vs45"
++func_check  0x28 "xxmrgld vs3,vs4,vs5"
++func_check  0x2c "xxmrgld vs43,vs44,vs45"
++func_check  0x30 "xxmrghd vs3,vs4,vs5"
++func_check  0x34 "xxmrghd vs43,vs44,vs45"
++func_check  0x38 "xxmrgld vs3,vs4,vs5"
++func_check  0x3c "xxmrgld vs43,vs44,vs45"
++func_check  0x40 "xxpermdi vs3,vs4,vs5,1"
++func_check  0x44 "xxpermdi vs43,vs44,vs45,1"
++func_check  0x48 "xxpermdi vs3,vs4,vs5,2"
++func_check  0x4c "xxpermdi vs43,vs44,vs45,2"
++func_check  0x50 "xvmovdp vs3,vs4"
++func_check  0x54 "xvmovdp vs43,vs44"
++func_check  0x58 "xvmovdp vs3,vs4"
++func_check  0x5c "xvmovdp vs43,vs44"
++func_check  0x60 "xvcpsgndp vs3,vs4,vs5"
++func_check  0x64 "xvcpsgndp vs43,vs44,vs45"
++func_check  0x68 "wait"
++func_check  0x6c "wait"
++func_check  0x70 "waitrsv"
++func_check  0x74 "waitrsv"
++func_check  0x78 "waitimpl"
++func_check  0x7c "waitimpl"
++func_check  0x80 "doze"
++func_check  0x84 "nap"
++func_check  0x88 "sleep"
++func_check  0x8c "rvwinkle"
++func_check  0x90 "prtyw   r3,r4"
++func_check  0x94 "prtyd   r13,r14"
++func_check  0x98 "mfcfar  r10"           "mfspr   r10,28"
++func_check  0x9c "mtcfar  r11"           "mtspr   28,r11"
++func_check  0xa0 "cmpb    r3,r4,r5"
++func_check  0xa4 "lwzcix  r10,r11,r12"
++func_check  0xa8 "dadd    f16,f17,f18"
++func_check  0xac "daddq   f20,f22,f24"
++func_check  0xb0 "dss     3"
++func_check  0xb4 "dssall"
++func_check  0xb8 "dst     r5,r4,1"
++func_check  0xbc "dstt    r8,r7,0"
++func_check  0xc0 "dstst   r5,r6,3"
++func_check  0xc4 "dststt  r4,r5,2"
++func_check  0xc8 "divwe   r10,r11,r12"
++func_check  0xcc "divwe.  r11,r12,r13"
++func_check  0xd0 "divweo  r12,r13,r14"
++func_check  0xd4 "divweo. r13,r14,r15"
++func_check  0xd8 "divweu  r10,r11,r12"
++func_check  0xdc "divweu. r11,r12,r13"
++func_check  0xe0 "divweuo r12,r13,r14"
++func_check  0xe4 "divweuo. r13,r14,r15"
++func_check  0xe8 "bpermd  r7,r17,r27"
++func_check  0xec "popcntw r10,r20"
++func_check  0xf0 "popcntd r10,r20"
++func_check  0xf4 "ldbrx   r20,r21,r22"
++func_check  0xf8 "stdbrx  r20,r21,r22"
++func_check  0xfc "lfiwzx  f10,0,r10"
++func_check 0x100 "lfiwzx  f10,r9,r10"
++func_check 0x104 "fcfids  f4,f5"
++func_check 0x108 "fcfids. f4,f5"
++func_check 0x10c "fcfidus f4,f5"
++func_check 0x110 "fcfidus. f4,f5"
++func_check 0x114 "fctiwu  f4,f5"
++func_check 0x118 "fctiwu. f4,f5"
++func_check 0x11c "fctiwuz f4,f5"
++func_check 0x120 "fctiwuz. f4,f5"
++func_check 0x124 "fctidu  f4,f5"
++func_check 0x128 "fctidu. f4,f5"
++func_check 0x12c "fctiduz f4,f5"
++func_check 0x130 "fctiduz. f4,f5"
++func_check 0x134 "fcfidu  f4,f5"
++func_check 0x138 "fcfidu. f4,f5"
++func_check 0x13c "ftdiv   cr0,f10,f11"
++func_check 0x140 "ftdiv   cr7,f10,f11"
++func_check 0x144 "ftsqrt  cr0,f10"
++func_check 0x148 "ftsqrt  cr7,f10"
++func_check 0x14c "dcbtt   r8,r9"         "dcbt    16,r8,r9"
++func_check 0x150 "dcbtstt r8,r9"         "dcbtst  16,r8,r9"
++func_check 0x154 "dcffix  f10,f12"
++func_check 0x158 "dcffix. f20,f22"
++func_check 0x15c "lbarx   r10,r11,r12"
++func_check 0x160 "lbarx   r10,r11,r12"
++func_check 0x164 "lbarx   r10,r11,r12,1"
++func_check 0x168 "lharx   r20,r21,r22"
++func_check 0x16c "lharx   r20,r21,r22"
++func_check 0x170 "lharx   r20,r21,r22,1"
++func_check 0x174 "stbcx.  r10,r11,r12"
++func_check 0x178 "sthcx.  r10,r11,r12"
++func_check 0x17c "fre     f14,f15"
++func_check 0x180 "fre.    f14,f15"
++func_check 0x184 "fres    f14,f15"
++func_check 0x188 "fres.   f14,f15"
++func_check 0x18c "frsqrte f14,f15"
++func_check 0x190 "frsqrte. f14,f15"
++func_check 0x194 "frsqrtes f14,f15"
++func_check 0x198 "frsqrtes. f14,f15"
++func_check 0x19c "isel    r2,r3,r4,28"
+--- /dev/null
++++ b/gdb/testsuite/gdb.arch/powerpc-power7.s
+@@ -0,0 +1,107 @@
++      .text
++      .globl  func
++func:
++      .long   0x7c642e98      /*   0: lxvd2x  vs3,r4,r5         */
++      .long   0x7c642ed8      /*   4: lxvd2ux vs3,r4,r5         */
++      .long   0x7d642e99      /*   8: lxvd2x  vs43,r4,r5        */
++      .long   0x7d642ed9      /*   c: lxvd2ux vs43,r4,r5        */
++      .long   0x7c642f98      /*  10: stxvd2x vs3,r4,r5         */
++      .long   0x7c642fd8      /*  14: stxvd2ux vs3,r4,r5        */
++      .long   0x7d642f99      /*  18: stxvd2x vs43,r4,r5        */
++      .long   0x7d642fd9      /*  1c: stxvd2ux vs43,r4,r5       */
++      .long   0xf0642850      /*  20: xxmrghd vs3,vs4,vs5       */
++      .long   0xf16c6857      /*  24: xxmrghd vs43,vs44,vs45    */
++      .long   0xf0642b50      /*  28: xxmrgld vs3,vs4,vs5       */
++      .long   0xf16c6b57      /*  2c: xxmrgld vs43,vs44,vs45    */
++      .long   0xf0642850      /*  30: xxmrghd vs3,vs4,vs5       */
++      .long   0xf16c6857      /*  34: xxmrghd vs43,vs44,vs45    */
++      .long   0xf0642b50      /*  38: xxmrgld vs3,vs4,vs5       */
++      .long   0xf16c6b57      /*  3c: xxmrgld vs43,vs44,vs45    */
++      .long   0xf0642950      /*  40: xxpermdi vs3,vs4,vs5,1    */
++      .long   0xf16c6957      /*  44: xxpermdi vs43,vs44,vs45,1 */
++      .long   0xf0642a50      /*  48: xxpermdi vs3,vs4,vs5,2    */
++      .long   0xf16c6a57      /*  4c: xxpermdi vs43,vs44,vs45,2 */
++      .long   0xf0642780      /*  50: xvmovdp vs3,vs4           */
++      .long   0xf16c6787      /*  54: xvmovdp vs43,vs44         */
++      .long   0xf0642780      /*  58: xvmovdp vs3,vs4           */
++      .long   0xf16c6787      /*  5c: xvmovdp vs43,vs44         */
++      .long   0xf0642f80      /*  60: xvcpsgndp vs3,vs4,vs5     */
++      .long   0xf16c6f87      /*  64: xvcpsgndp vs43,vs44,vs45  */
++      .long   0x7c00007c      /*  68: wait                      */
++      .long   0x7c00007c      /*  6c: wait                      */
++      .long   0x7c20007c      /*  70: waitrsv                   */
++      .long   0x7c20007c      /*  74: waitrsv                   */
++      .long   0x7c40007c      /*  78: waitimpl                  */
++      .long   0x7c40007c      /*  7c: waitimpl                  */
++      .long   0x4c000324      /*  80: doze                      */
++      .long   0x4c000364      /*  84: nap                       */
++      .long   0x4c0003a4      /*  88: sleep                     */
++      .long   0x4c0003e4      /*  8c: rvwinkle                  */
++      .long   0x7c830134      /*  90: prtyw   r3,r4             */
++      .long   0x7dcd0174      /*  94: prtyd   r13,r14           */
++      .long   0x7d5c02a6      /*  98: mfcfar  r10               */
++      .long   0x7d7c03a6      /*  9c: mtcfar  r11               */
++      .long   0x7c832bf8      /*  a0: cmpb    r3,r4,r5          */
++      .long   0x7d4b662a      /*  a4: lwzcix  r10,r11,r12       */
++      .long   0xee119004      /*  a8: dadd    f16,f17,f18       */
++      .long   0xfe96c004      /*  ac: daddq   f20,f22,f24       */
++      .long   0x7c60066c      /*  b0: dss     3                 */
++      .long   0x7e00066c      /*  b4: dssall                    */
++      .long   0x7c2522ac      /*  b8: dst     r5,r4,1           */
++      .long   0x7e083aac      /*  bc: dstt    r8,r7,0           */
++      .long   0x7c6532ec      /*  c0: dstst   r5,r6,3           */
++      .long   0x7e442aec      /*  c4: dststt  r4,r5,2           */
++      .long   0x7d4b6356      /*  c8: divwe   r10,r11,r12       */
++      .long   0x7d6c6b57      /*  cc: divwe.  r11,r12,r13       */
++      .long   0x7d8d7756      /*  d0: divweo  r12,r13,r14       */
++      .long   0x7dae7f57      /*  d4: divweo. r13,r14,r15       */
++      .long   0x7d4b6316      /*  d8: divweu  r10,r11,r12       */
++      .long   0x7d6c6b17      /*  dc: divweu. r11,r12,r13       */
++      .long   0x7d8d7716      /*  e0: divweuo r12,r13,r14       */
++      .long   0x7dae7f17      /*  e4: divweuo. r13,r14,r15      */
++      .long   0x7e27d9f8      /*  e8: bpermd  r7,r17,r27        */
++      .long   0x7e8a02f4      /*  ec: popcntw r10,r20           */
++      .long   0x7e8a03f4      /*  f0: popcntd r10,r20           */
++      .long   0x7e95b428      /*  f4: ldbrx   r20,r21,r22       */
++      .long   0x7e95b528      /*  f8: stdbrx  r20,r21,r22       */
++      .long   0x7d4056ee      /*  fc: lfiwzx  f10,0,r10         */
++      .long   0x7d4956ee      /* 100: lfiwzx  f10,r9,r10        */
++      .long   0xec802e9c      /* 104: fcfids  f4,f5             */
++      .long   0xec802e9d      /* 108: fcfids. f4,f5             */
++      .long   0xec802f9c      /* 10c: fcfidus f4,f5             */
++      .long   0xec802f9d      /* 110: fcfidus. f4,f5            */
++      .long   0xfc80291c      /* 114: fctiwu  f4,f5             */
++      .long   0xfc80291d      /* 118: fctiwu. f4,f5             */
++      .long   0xfc80291e      /* 11c: fctiwuz f4,f5             */
++      .long   0xfc80291f      /* 120: fctiwuz. f4,f5            */
++      .long   0xfc802f5c      /* 124: fctidu  f4,f5             */
++      .long   0xfc802f5d      /* 128: fctidu. f4,f5             */
++      .long   0xfc802f5e      /* 12c: fctiduz f4,f5             */
++      .long   0xfc802f5f      /* 130: fctiduz. f4,f5            */
++      .long   0xfc802f9c      /* 134: fcfidu  f4,f5             */
++      .long   0xfc802f9d      /* 138: fcfidu. f4,f5             */
++      .long   0xfc0a5900      /* 13c: ftdiv   cr0,f10,f11       */
++      .long   0xff8a5900      /* 140: ftdiv   cr7,f10,f11       */
++      .long   0xfc005140      /* 144: ftsqrt  cr0,f10           */
++      .long   0xff805140      /* 148: ftsqrt  cr7,f10           */
++      .long   0x7e084a2c      /* 14c: dcbtt   r8,r9             */
++      .long   0x7e0849ec      /* 150: dcbtstt r8,r9             */
++      .long   0xed406644      /* 154: dcffix  f10,f12           */
++      .long   0xee80b645      /* 158: dcffix. f20,f22           */
++      .long   0x7d4b6068      /* 15c: lbarx   r10,r11,r12       */
++      .long   0x7d4b6068      /* 160: lbarx   r10,r11,r12       */
++      .long   0x7d4b6069      /* 164: lbarx   r10,r11,r12,1     */
++      .long   0x7e95b0e8      /* 168: lharx   r20,r21,r22       */
++      .long   0x7e95b0e8      /* 16c: lharx   r20,r21,r22       */
++      .long   0x7e95b0e9      /* 170: lharx   r20,r21,r22,1     */
++      .long   0x7d4b656d      /* 174: stbcx.  r10,r11,r12       */
++      .long   0x7d4b65ad      /* 178: sthcx.  r10,r11,r12       */
++      .long   0xfdc07830      /* 17c: fre     f14,f15           */
++      .long   0xfdc07831      /* 180: fre.    f14,f15           */
++      .long   0xedc07830      /* 184: fres    f14,f15           */
++      .long   0xedc07831      /* 188: fres.   f14,f15           */
++      .long   0xfdc07834      /* 18c: frsqrte f14,f15           */
++      .long   0xfdc07835      /* 190: frsqrte. f14,f15          */
++      .long   0xedc07834      /* 194: frsqrtes f14,f15          */
++      .long   0xedc07835      /* 198: frsqrtes. f14,f15         */
++      .long   0x7c43271e      /* 19c: isel    r2,r3,r4,28       */
diff --git a/gdb/patches/gdb-runtest-pie-override.patch b/gdb/patches/gdb-runtest-pie-override.patch
new file mode 100644 (file)
index 0000000..dc54494
--- /dev/null
@@ -0,0 +1,40 @@
+make check//unix/-fPIE/-pie RUNTESTFLAGS=solib-display.exp
+
+gcc -fpic -c  -fPIE -pie -o x.o x.c
+/usr/lib/gcc/x86_64-redhat-linux/4.6.1/../../../../lib64/Scrt1.o: In function `_start':
+(.text+0x20): undefined reference to `main'
+
+=> Change the order for overrides.
+
+One has to also use -fPIC rather than -fPIE, -fPIC is stronger.
+
+The correct way would be:
+make check//unix RUNTESTFLAGS='CC_FOR_TARGET=gcc\ -fPIC\ -pie CXX_FOR_TARGET=g++\ -fPIC\ -pie solib-display.exp'
+
+But there is a problem with testsuite.unix non-unique subdir name and also
+a problem with make -j parallelization of the testsuite.
+
+--- gdb-7.3.50.20110722/gdb/testsuite/lib/future.exp   2011-10-11 16:44:05.000000000 +0200
++++ gdb-7.3.50.20110722/gdb/testsuite/lib/future.exp2  2011-10-11 16:44:10.000000000 +0200
+@@ -77,6 +77,10 @@ proc gdb_default_target_compile {source
+     set ldflags ""
+     set dest [target_info name]
++    if {[board_info $dest exists multilib_flags]} {
++      append add_flags " [board_info $dest multilib_flags]"
++    }
++
+     if {[info exists CFLAGS_FOR_TARGET]} {
+       append add_flags " $CFLAGS_FOR_TARGET"
+     }
+@@ -333,10 +337,6 @@ proc gdb_default_target_compile {source
+       }
+     }
+-    if {[board_info $dest exists multilib_flags]} {
+-      append add_flags " [board_info $dest multilib_flags]"
+-    }
+-
+     verbose "doing compile"
+     set sources ""
diff --git a/gdb/patches/gdb-simultaneous-step-resume-breakpoint-test.patch b/gdb/patches/gdb-simultaneous-step-resume-breakpoint-test.patch
new file mode 100644 (file)
index 0000000..e6e53bb
--- /dev/null
@@ -0,0 +1,150 @@
+--- /dev/null  2009-09-25 12:44:54.497650251 +0200
++++ ./gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp        2009-09-25 17:27:12.000000000 +0200
+@@ -0,0 +1,65 @@
++# Copyright (C) 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++# Test multiple threads stepping into a .debug_line-less function with
++# a breakpoint placed on its return-to-caller point.
++
++set testfile simultaneous-step-resume-breakpoint
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++
++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++
++# Ensure we have no debuginfo for the `sleep' call itself (=for libc).
++gdb_test "set debug-file-directory /DoesNotExist"
++
++gdb_load ${binfile}
++if ![runto_main] {
++   return -1
++}
++
++# Red Hat vendor patch does set it to "step" by default.
++gdb_test "set scheduler-locking off"
++
++gdb_breakpoint [gdb_get_line_number "final-exit"]
++
++gdb_breakpoint [gdb_get_line_number "sleep-call"]
++gdb_continue_to_breakpoint "sleep-call"
++
++gdb_test "step" "sleep-call.*" "step thread 1"
++gdb_test "step" "sleep-call.*" "step thread 2"
++gdb_test "step" "sleep-after.*" "step thread 3"
++
++set test "first continue"
++gdb_test_multiple "continue" $test {
++    -re "final-exit.*$gdb_prompt $" {
++      # gdb-7.0.
++      pass $test
++      return
++    }
++    -re "sleep-after.*$gdb_prompt $" {
++      # Fedora/RHEL branch.
++      pass $test
++    }
++}
++
++gdb_test "continue" "sleep-after.*" "second continue"
++gdb_test "continue" "final-exit.*" "third continue"
+--- /dev/null  2009-09-25 12:44:54.497650251 +0200
++++ ./gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c  2009-09-25 17:29:42.000000000 +0200
+@@ -0,0 +1,79 @@
++/* Copyright 2009 Free Software Foundation, Inc.
++
++   Written by Fred Fish of Cygnus Support
++   Contributed by Cygnus Support
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++/* Test multiple threads stepping into a .debug_line-less function with
++   a breakpoint placed on its return-to-caller point.  */
++
++#include <pthread.h>
++#include <assert.h>
++#include <unistd.h>
++#include <errno.h>
++#include <stdio.h>
++
++#define THREADS 3
++
++static void *
++func (void *unused)
++{
++  int i;
++
++  errno = 0;
++  i = 0xdeadf00d;
++  i = sleep (THREADS);        /* sleep-call */
++  if (errno != 0)     /* sleep-after */
++    perror ("sleep");
++
++  /* The GDB bug with forgotten step-resume breakpoint could leave stale
++     breakpoint on the I assignment making it a nop.  */
++  if (i == 0xdeadf00d)
++    assert (0);
++
++  assert (i == 0);
++
++  pthread_exit (NULL);
++}
++
++int
++main (void)
++{
++  pthread_t threads[THREADS];
++  int threadi;
++
++  for (threadi = 0; threadi < THREADS; threadi++)
++    {
++      int i;
++
++      i = pthread_create (&threads[threadi], NULL, func, NULL);
++      assert (i == 0);
++
++      i = sleep (1);
++      assert (i == 0);
++    }
++
++  for (threadi = 0; threadi < THREADS; threadi++)
++    {
++      int i;
++
++      i = pthread_join (threads[threadi], NULL);
++      assert (i == 0);
++    }
++
++  return 0;   /* final-exit */
++}
diff --git a/gdb/patches/gdb-test-bt-cfi-without-die.patch b/gdb/patches/gdb-test-bt-cfi-without-die.patch
new file mode 100644 (file)
index 0000000..5f1f967
--- /dev/null
@@ -0,0 +1,220 @@
+http://sourceware.org/ml/archer/2010-q3/msg00028.html
+Subject: [delayed-symfile] [commit] Fix a regression on CFI without DIE  [Re:
+
+On Wed, 25 Feb 2009 00:14:29 +0100, Jan Kratochvil wrote:
+> commit 6a37c2b9962258ecf9299cc34a650e64a06acaa5
+> 
+> There was a regression on gdb.base/savedregs.exp.
+> 
+> quick_addrmap/require_partial_symbols should be used even for the unwind debug
+> info checking as its load has been also delayed by this branch.
+[...]
+> --- a/gdb/dwarf2-frame.c
+> +++ b/gdb/dwarf2-frame.c
+[...]
+> @@ -1499,6 +1500,14 @@ dwarf2_frame_find_fde (CORE_ADDR *pc)
+>        struct dwarf2_fde *fde;
+>        CORE_ADDR offset;
+>  
+> +      if (objfile->quick_addrmap)
+> +    {
+> +      if (!addrmap_find (objfile->quick_addrmap, *pc))
+> +        continue;
+> +    }
+> +      /* FIXME: Read-in only .debug_frame/.eh_frame without .debug_info?  */
+> +      require_partial_symbols (objfile);
+> +
+
+but this has caused a different regression (as discussed in the confcall).
+
+QUICK_ADDRMAP is built only from .debug_aranges.  But we can have existing
+built .debug_aranges for CUs in OBJFILE but still some CUs do not need to have
+DWARF at all while they can feature CFIs (.eh_frame or .debug_frame).
+It has been described by Daniel Jacobowitz at:
+       Re: [2/4] RFC: check psymtabs_addrmap before reading FDEs
+       http://sourceware.org/ml/gdb-patches/2010-07/msg00012.html
+
+Sorry for this regression by me (in that fix of a different regression).
+
+Fixed it the "slow way" as this branch is now obsoleted by .gdb-index.
+
+No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.
+
+Checked-in.
+
+
+Thanks,
+Jan
+
+
+eb8df8566acc1ed963e3e9b77c13b9c2c3db03fb
+
+Test CFI is parsed even for range (function) not described by any DIE.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=614028
+
+gdb/
+       * dwarf2-frame.c (dwarf2_frame_find_fde): Remove the
+       OBJFILE->QUICK_ADDRMAP check.  New comment why.
+
+gdb/testsuite/
+       * gdb.base/cfi-without-die.exp, gdb.base/cfi-without-die-main.c,
+       gdb.base/cfi-without-die-caller.c: New files.
+---
+ gdb/dwarf2-frame.c                              |    8 +--
+ gdb/testsuite/gdb.base/cfi-without-die-caller.c |   28 ++++++++++
+ gdb/testsuite/gdb.base/cfi-without-die-main.c   |   32 +++++++++++
+ gdb/testsuite/gdb.base/cfi-without-die.exp      |   67 +++++++++++++++++++++++
+ 4 files changed, 130 insertions(+), 5 deletions(-)
+ create mode 100644 gdb/testsuite/gdb.base/cfi-without-die-caller.c
+ create mode 100644 gdb/testsuite/gdb.base/cfi-without-die-main.c
+ create mode 100644 gdb/testsuite/gdb.base/cfi-without-die.exp
+
+diff --git a/gdb/testsuite/gdb.base/cfi-without-die-caller.c b/gdb/testsuite/gdb.base/cfi-without-die-caller.c
+new file mode 100644
+index 0000000..afdfd53
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/cfi-without-die-caller.c
+@@ -0,0 +1,28 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++typedef int (*callback_t) (void);
++
++int
++caller (callback_t callback)
++{
++  /* Ensure some frame content to push away the return address.  */
++  volatile const long one = 1;
++
++  /* Modify the return value to prevent any tail-call optimization.  */
++  return (*callback) () - one;
++}
+diff --git a/gdb/testsuite/gdb.base/cfi-without-die-main.c b/gdb/testsuite/gdb.base/cfi-without-die-main.c
+new file mode 100644
+index 0000000..8451c4b
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/cfi-without-die-main.c
+@@ -0,0 +1,32 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++typedef int (*callback_t) (void);
++
++extern int caller (callback_t callback);
++
++int
++callback (void)
++{
++  return 1;
++}
++
++int
++main (void)
++{
++  return caller (callback);
++}
+diff --git a/gdb/testsuite/gdb.base/cfi-without-die.exp b/gdb/testsuite/gdb.base/cfi-without-die.exp
+new file mode 100644
+index 0000000..db6d248
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/cfi-without-die.exp
+@@ -0,0 +1,67 @@
++# Copyright 2010 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++# Test CFI is parsed even for range (function) not described by any DIE.
++
++set testfile cfi-without-die
++set srcmainfile ${testfile}-main.c
++set srccallerfile ${testfile}-caller.c
++set executable ${testfile}
++set objmainfile ${objdir}/${subdir}/${testfile}-main.o
++set objcallerfile ${objdir}/${subdir}/${testfile}-caller.o
++set binfile ${objdir}/${subdir}/${executable}
++
++if { [gdb_compile "${srcdir}/${subdir}/${srccallerfile}" ${objcallerfile} \
++      object [list {additional_flags=-fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables}]] != ""
++     || [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" ${objmainfile} object {debug}] != ""
++     || [gdb_compile "${objmainfile} ${objcallerfile}" ${binfile} executable {}] != "" } {
++     untested ${testfile}.exp
++     return -1
++}
++
++clean_restart $executable
++
++if ![runto callback] then {
++   fail "verify unwinding: Can't run to callback"
++   return 0
++}
++set test "verify unwinding breaks without CFI"
++gdb_test_multiple "bt" $test {
++    -re " in main .*\r\n$gdb_prompt $" {
++      fail $test
++    }
++    -re "\r\n$gdb_prompt $" {
++      pass $test
++    }
++}
++
++if { [gdb_compile "${srcdir}/${subdir}/${srccallerfile}" ${objcallerfile} \
++      object [list {additional_flags=-fomit-frame-pointer -funwind-tables -fasynchronous-unwind-tables}]] != ""
++     || [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" ${objmainfile} object {debug}] != ""
++     || [gdb_compile "${objmainfile} ${objcallerfile}" ${binfile} executable {}] != "" } {
++     untested ${testfile}.exp
++     return -1
++}
++
++clean_restart $executable
++
++if ![runto callback] then {
++   fail "test CFI without DIEs: Can't run to callback"
++   return 0
++}
++# #0  callback () at ...
++# #1  0x00000000004004e9 in caller ()
++# #2  0x00000000004004cd in main () at ...
++gdb_test "bt" "#0 +callback \[^\r\n\]+\r\n#1 \[^\r\n\]+ in caller \[^\r\n\]+\r\n#2 \[^\r\n\]+ in main \[^\r\n\]+" "verify unwindin works for CFI without DIEs"
+-- 
+1.7.1.1
+
diff --git a/gdb/patches/gdb-test-dw2-aranges.patch b/gdb/patches/gdb-test-dw2-aranges.patch
new file mode 100644 (file)
index 0000000..5ddcf9d
--- /dev/null
@@ -0,0 +1,214 @@
+[archer-tromey-delayed-symfile]
+
+commit 77fa7778a37b0d28a7e4e5235f074a10ecf1815d
+Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
+Date:   Sat Aug 15 15:05:54 2009 +0200
+
+    Test for "handle incorrect aranges".
+    
+    readelf:
+    Contents of the .debug_aranges section:
+    
+      Length:                   8
+      Version:                  2
+      Offset into .debug_info:  0x0
+      Pointer Size:             0
+      Segment Size:             0
+    
+        Address    Length
+    Floating point exception
+    
+       * gdb.dwarf2/dw2-aranges.exp, gdb.dwarf2/dw2-aranges.S: New files.
+
+diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.S b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S
+new file mode 100644
+index 0000000..d5b9ca5a
+--- /dev/null
++++ b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S
+@@ -0,0 +1,140 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++/* Test .debug_aranges containing zero address_size.  */
++
++/* Dummy function to provide debug information for.  */
++
++      .text
++.Lbegin_text1:
++      .globl main
++      .type main, %function
++main:
++.Lbegin_main:
++      .int 0
++.Lend_main:
++      .size main, .-main
++.Lend_text1:
++
++/* Debug information */
++
++      .section .debug_info
++.Lcu1_begin:
++      /* CU header */
++      .4byte  .Lcu1_end - .Lcu1_start         /* Length of Compilation Unit */
++.Lcu1_start:
++      .2byte  2                               /* DWARF Version */
++      .4byte  .Labbrev1_begin                 /* Offset into abbrev section */
++      .byte   4                               /* Pointer size */
++
++      /* CU die */
++      .uleb128 1                              /* Abbrev: DW_TAG_compile_unit */
++      .4byte  .Lend_text1                     /* DW_AT_high_pc */
++      .4byte  .Lbegin_text1                   /* DW_AT_low_pc */
++      .ascii  "file1.txt\0"                   /* DW_AT_name */
++      .ascii  "GNU C 3.3.3\0"                 /* DW_AT_producer */
++      .byte   1                               /* DW_AT_language (C) */
++
++      /* main */
++      .uleb128        2                       /* Abbrev: DW_TAG_subprogram */
++      .byte           1                       /* DW_AT_external */
++      .byte           1                       /* DW_AT_decl_file */
++      .byte           2                       /* DW_AT_decl_line */
++      .ascii          "main\0"                /* DW_AT_name */
++      .4byte          .Ltype_int-.Lcu1_begin  /* DW_AT_type */
++      .4byte          .Lbegin_main    /* DW_AT_low_pc */
++      .4byte          .Lend_main              /* DW_AT_high_pc */
++      .byte           1                       /* DW_AT_frame_base: length */
++      .byte           0x55                    /* DW_AT_frame_base: DW_OP_reg5 */
++
++.Ltype_int:
++      .uleb128        3                       /* Abbrev: DW_TAG_base_type */
++      .ascii          "int\0"                 /* DW_AT_name */
++      .byte           4                       /* DW_AT_byte_size */
++      .byte           5                       /* DW_AT_encoding */
++
++      .byte           0                       /* End of children of CU */
++
++.Lcu1_end:
++
++/* Abbrev table */
++      .section .debug_abbrev
++.Labbrev1_begin:
++      .uleb128        1                       /* Abbrev code */
++      .uleb128        0x11                    /* DW_TAG_compile_unit */
++      .byte           1                       /* has_children */
++      .uleb128        0x12                    /* DW_AT_high_pc */
++      .uleb128        0x1                     /* DW_FORM_addr */
++      .uleb128        0x11                    /* DW_AT_low_pc */
++      .uleb128        0x1                     /* DW_FORM_addr */
++      .uleb128        0x3                     /* DW_AT_name */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .uleb128        0x25                    /* DW_AT_producer */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .uleb128        0x13                    /* DW_AT_language */
++      .uleb128        0xb                     /* DW_FORM_data1 */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .uleb128        2                       /* Abbrev code */
++      .uleb128        0x2e                    /* DW_TAG_subprogram */
++      .byte           0                       /* has_children */
++      .uleb128        0x3f                    /* DW_AT_external */
++      .uleb128        0xc                     /* DW_FORM_flag */
++      .uleb128        0x3a                    /* DW_AT_decl_file */
++      .uleb128        0xb                     /* DW_FORM_data1 */
++      .uleb128        0x3b                    /* DW_AT_decl_line */
++      .uleb128        0xb                     /* DW_FORM_data1 */
++      .uleb128        0x3                     /* DW_AT_name */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .uleb128        0x49                    /* DW_AT_type */
++      .uleb128        0x13                    /* DW_FORM_ref4 */
++      .uleb128        0x11                    /* DW_AT_low_pc */
++      .uleb128        0x1                     /* DW_FORM_addr */
++      .uleb128        0x12                    /* DW_AT_high_pc */
++      .uleb128        0x1                     /* DW_FORM_addr */
++      .uleb128        0x40                    /* DW_AT_frame_base */
++      .uleb128        0xa                     /* DW_FORM_block1 */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .uleb128        3                       /* Abbrev code */
++      .uleb128        0x24                    /* DW_TAG_base_type */
++      .byte           0                       /* has_children */
++      .uleb128        0x3                     /* DW_AT_name */
++      .uleb128        0x8                     /* DW_FORM_string */
++      .uleb128        0xb                     /* DW_AT_byte_size */
++      .uleb128        0xb                     /* DW_FORM_data1 */
++      .uleb128        0x3e                    /* DW_AT_encoding */
++      .uleb128        0xb                     /* DW_FORM_data1 */
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++      .byte           0x0                     /* Terminator */
++      .byte           0x0                     /* Terminator */
++
++/* aranges table */
++      .section .debug_aranges
++      .long   .Laranges_end - 1f
++1:
++      .2byte  2                               /* aranges Version */
++      .4byte  .Lcu1_begin - .debug_info       /* Offset into .debug_info section */
++      /* The GDB crasher is this zero value.  */
++      .byte           0                       /* aranges address_size */
++      .byte           0                       /* aranges segment_size */
++
++.Laranges_end:
+diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp b/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp
+new file mode 100644
+index 0000000..39632d5
+--- /dev/null
++++ b/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp
+@@ -0,0 +1,40 @@
++# Copyright 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++# Test .debug_aranges containing zero address_size.
++
++# This test can only be run on targets which support DWARF-2 and use gas.
++# For now pick a sampling of likely targets.
++if {![istarget *-*-linux*]
++    && ![istarget *-*-gnu*]
++    && ![istarget *-*-elf*]
++    && ![istarget *-*-openbsd*]
++    && ![istarget arm-*-eabi*]
++    && ![istarget powerpc-*-eabi*]} {
++    return 0  
++}
++
++set testfile "dw2-aranges"
++set srcfile ${testfile}.S
++set binfile ${objdir}/${subdir}/${testfile}
++
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {nodebug}] != "" } {
++    return -1
++}
++
++clean_restart $testfile
++
++# Failed gdb_load would abort the testcase execution earlier.
++pass "file loaded"
diff --git a/gdb/patches/gdb-test-expr-cumulative-archer.patch b/gdb/patches/gdb-test-expr-cumulative-archer.patch
new file mode 100644 (file)
index 0000000..232a527
--- /dev/null
@@ -0,0 +1,207 @@
+archer archer-keiths-expr-cumulative
+b5a7497340b24199f0c7ba7fdf0d54d4df44d6bc
+
+--- /dev/null  2011-01-12 06:28:36.282000001 +0100
++++ ./gdb/testsuite/gdb.cp/namespace-nested-imports.cc 2009-09-25 06:50:38.000000000 +0200
+@@ -0,0 +1,36 @@
++namespace A
++{
++  namespace B
++  {
++    int ab = 11;
++  }
++}
++
++namespace C
++{
++  namespace D
++  {
++    using namespace A::B;
++
++    int
++    second()
++    {
++      ab;
++      return 0;
++    }
++  }
++
++  int
++  first()
++  {
++    //ab;
++    return D::second();
++  }
++}
++
++int
++main()
++{
++  //ab;
++  return C::first();
++}
+--- /dev/null  2011-01-12 06:28:36.282000001 +0100
++++ ./gdb/testsuite/gdb.cp/namespace-nested-imports.exp        2009-09-25 06:50:38.000000000 +0200
+@@ -0,0 +1,50 @@
++# Copyright 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++set testfile namespace-nested-imports
++set srcfile ${testfile}.cc
++set binfile ${objdir}/${subdir}/${testfile}
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++
++# Get things started.
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++############################################
++if ![runto_main] then {
++    perror "couldn't run to breakpoint main"
++    continue
++}
++
++gdb_test "print ab" "No symbol .* in current context."
++
++############################################
++gdb_breakpoint C::first
++gdb_continue_to_breakpoint "C::first"
++
++gdb_test "print ab" "No symbol .* in current context."
++gdb_test "print C::D::ab" "= 11"
++
++############################################
++gdb_breakpoint C::D::second
++gdb_continue_to_breakpoint "C::D::second"
++
++gdb_test "print ab" "= 11"
+--- /dev/null  2011-01-12 06:28:36.282000001 +0100
++++ ./gdb/testsuite/gdb.cp/namespace-no-imports.cc     2009-09-25 06:50:38.000000000 +0200
+@@ -0,0 +1,37 @@
++
++namespace A
++{
++  int _a = 11;
++
++  namespace B{
++
++    int ab = 22;
++
++    namespace C{
++
++      int abc = 33;
++
++      int second(){
++        return 0;
++      }
++
++    }
++
++    int first(){
++      _a;
++      ab;
++      C::abc;
++      return C::second();
++    }
++  }
++}
++
++
++int
++main()
++{
++  A::_a;
++  A::B::ab;
++  A::B::C::abc;
++  return A::B::first();
++}
+--- /dev/null  2011-01-12 06:28:36.282000001 +0100
++++ ./gdb/testsuite/gdb.cp/namespace-no-imports.exp    2009-09-25 06:50:38.000000000 +0200
+@@ -0,0 +1,69 @@
++# Copyright 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++set testfile namespace-no-imports
++set srcfile ${testfile}.cc
++set binfile ${objdir}/${subdir}/${testfile}
++if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
++    untested "Couldn't compile test program"
++    return -1
++}
++
++# Get things started.
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++############################################
++if ![runto_main] then {
++    perror "couldn't run to breakpoint main"
++    continue
++}
++
++gdb_test "print A::_a" "= 11"
++gdb_test "print A::B::ab" "= 22"
++gdb_test "print A::B::C::abc" "= 33"
++
++gdb_test "print _a" "No symbol .* in current context."
++gdb_test "print ab" "No symbol .* in current context."
++gdb_test "print abc" "No symbol .* in current context."
++
++############################################
++gdb_breakpoint A::B::first
++gdb_continue_to_breakpoint "A::B::first"
++
++gdb_test "print A::_a" "= 11"
++gdb_test "print A::B::ab" "= 22"
++gdb_test "print A::B::C::abc" "= 33"
++
++gdb_test "print _a" "= 11"
++gdb_test "print ab" "= 22"
++gdb_test "print C::abc" "= 33"
++
++gdb_test "print abc" "No symbol .* in current context."
++
++############################################
++gdb_breakpoint A::B::C::second
++gdb_continue_to_breakpoint "A::B::C::second"
++
++gdb_test "print A::_a" "= 11"
++gdb_test "print A::B::ab" "= 22"
++gdb_test "print A::B::C::abc" "= 33"
++
++gdb_test "print _a" "= 11"
++gdb_test "print ab" "= 22"
++gdb_test "print abc" "= 33"
diff --git a/gdb/patches/gdb-test-pid0-core.patch b/gdb/patches/gdb-test-pid0-core.patch
new file mode 100644 (file)
index 0000000..1bc221b
--- /dev/null
@@ -0,0 +1,80 @@
+https://bugzilla.redhat.com/show_bug.cgi?id=611435
+
+Fix:
+Re: [RFA]corelow.c: Add tid to add_to_thread_list
+http://sourceware.org/ml/gdb-patches/2010-08/msg00085.html
+http://sourceware.org/ml/gdb-cvs/2010-08/msg00026.html
+2e5bcfdef1ec3883d48c3f87a4be5c0dff25e17e
+
+--- /dev/null
++++ b/gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu
+@@ -0,0 +1,20 @@
++begin 600 x86_64-pid0-core.core.bz2
++M0EIH.3%!629362,CA>P!$/'_____^*#EZ-A!SP36P&_:G0#=14``04A&8,'U
++M2*9`>$$)P`*RN"#*;#4R()IJ8C$TT&FC3$&@`T`#:C1H8C0T,@,FC,D"4T2!
++M"/2CU'B90]31ZAD#U`&AZF@/4:``!HT&F@!H<`#0-`-#0``#3$-&F@```#0R
++M``#")2FD]2>4]0TTT-!HTT--,0,"#$`R!I@AD`#1H,3&GZT.4TO$#H40/`0C
++M2$IRXS,<55!8T,&&,R.Z441"?J9I%G6GUA2!.[]Z"C5S[&19,%VS7E6[3"60
++M@`-*2G)QEQ(;?0Y<=MK]/U?Q)LB%+F37TJ9BI*46)H'*Z@V"`"$"P7]&<Q<?
++M>XZ:JE0E<*:#1M$P3G]>VCI)(A!O$64`5$4`E$$-.``7&(09`8HO`B6K!Q^&
++M562%N)2+0@*HB@%D@5$%!*0!L1&0D4D6\:-$A`)`+<6D82PP*H(J(H!?F;0$
++M%PXB7N!2D4!44`W7"ADEQM6<B]J<B(%1GF'5*0;_00KO55=43LPR0,Q?N72`
++M8"W*_;DV<AN#,XRU]Q-J2FDAFKAQ(9A+ZK$MCY#EI8:W-(15>O9TBO5,_]1)
++M($Q2))#),UE,QQK)E$,3D\W.>!4)QO8A_@^Z_SXS<OEHM*+"M8I1)-C(=DIJ
++MW+@WN)O)YO;3:I9YW-A$)N'2<A`F3),R3"3-'"S3E1;6VE*_95KD<!0050(G
++M,JV"N(Z:@0E#)50BSF)$T6_IN)#"Z8PLQ4UQ9]@Z'+;T]990-:Y:2`P26#!D
++MV+0L6"X@C9`GHAGSY7)%LWOY+E[2/>4;Q8=HV6[:&$@2$@$R29IBW)K%3"O`
++M9^Y0YJ&BXY1U2HTZ5)2H-V\_(.DZHWE+C#WS($(!I"3CUH2#(+(OWUV"*<<9
++MJ%A!J[%O.P&V%GI.`L7<1@0>,^1F\MY=V5UT,&NOG%7TTZ[03!@BHB@&)<A^
++4B.Z!/,0-IZ^W_Q=R13A0D",CA>P`
++`
++end
+--- /dev/null
++++ b/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp
+@@ -0,0 +1,46 @@
++# This testcase is part of GDB, the GNU debugger.
++# 
++# Copyright 2010 Free Software Foundation, Inc.
++# 
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++# 
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++# 
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
++
++# Some kernel core files have PID 0 - for the idle task.
++
++if ![istarget "x86_64-*-*"] {
++    verbose "Skipping x86_64-pid0-core test."
++    return
++}
++
++set testfile "x86_64-pid0-core"
++set corebz2uufile ${srcdir}/${subdir}/${testfile}.core.bz2.uu
++set corefile ${objdir}/${subdir}/${testfile}.core
++
++if {[catch "system \"uudecode -o - ${corebz2uufile} | bzip2 -dc >${corefile}\""] != 0} {
++    untested "failed uudecode or bzip2"
++    return -1
++}
++file stat ${corefile} corestat
++if {$corestat(size) != 8798208} {
++    untested "uudecode or bzip2 produce invalid result"
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++
++# Former crash was:
++# thread.c:884: internal-error: switch_to_thread: Assertion `inf != NULL' failed.
++gdb_test "core-file ${corefile}" "Program terminated with signal 11, Segmentation fault\\.\r\n.*"
diff --git a/gdb/patches/gdb-tui-strip-stepi.patch b/gdb/patches/gdb-tui-strip-stepi.patch
new file mode 100644 (file)
index 0000000..c4bdcb0
--- /dev/null
@@ -0,0 +1,73 @@
+http://sourceware.org/ml/gdb-patches/2011-08/msg00283.html
+Subject: [patch] TUI: Permit stepi on stripped code
+
+Hi,
+
+nick <cinolt> on #gdb@freenode complained one cannot stepi on stripped binary.
+
+echo -e '#include<unistd.h>\nint main(void){return alarm(0);}'|gcc -Wall -s -x c -;./gdbtui ./a.out -nx -ex 'layout asm' -ex 'b alarm' -ex r -ex fini
+will:
+       0x7ffff7ae25c0 <alarm>          mov    $0x25,%eax
+       -------------------------------------------------
+       (gdb) p/x $pc
+       $1 = 0x4004d2
+       (gdb) stepi
+       No function contains program counter for selected frame.
+       (gdb) p/x $pc
+       $2 = 0x4004d2
+
+That is the window still displays stale content, stepi does not work at all.
+
+#0  throw_verror (error=GENERIC_ERROR, fmt=0xe73d20 "No function contains program counter for selected frame.", ap=0x7fffdbd3b0a8) at exceptions.c:400
+#1  in error (string=0xe73d20 "No function contains program counter for selected frame.") at utils.c:780
+#2  in tui_show_frame_info (fi=0x3eca1e0) at ./tui/tui-stack.c:383
+#3  in tui_selected_frame_level_changed_hook (level=0) at ./tui/tui-hooks.c:218
+#4  in select_frame (fi=0x3eca1e0) at frame.c:1396
+#5  in restore_selected_frame (a_frame_id=..., frame_level=0) at thread.c:1049
+#6  in do_restore_current_thread_cleanup (arg=0x456dca0) at thread.c:1116
+#7  in do_my_cleanups (pmy_chain=0x1c865f0, old_chain=0x456de90) at utils.c:515
+#8  in do_cleanups (old_chain=0x456de90) at utils.c:497
+#9  in insert_breakpoint_locations () at breakpoint.c:2021
+#10 in insert_breakpoints () at breakpoint.c:1919
+#11 in proceed (addr=18446744073709551615, siggnal=TARGET_SIGNAL_DEFAULT, step=1) at infrun.c:2156
+#12 in step_once (skip_subroutines=0, single_inst=1, count=1, thread=-1) at infcmd.c:1068
+#13 in step_1 (skip_subroutines=0, single_inst=1, count_string=0x0) at infcmd.c:903
+#14 in stepi_command (count_string=0x0, from_tty=1) at infcmd.c:839
+
+With the fix stepi works and the window correctly displays:
+       0x4004d2        pop    %rbp                
+       -------------------------------------------------
+
+I haven't found any TUI testsuite.
+
+I will check it in (after regression testing(?)) in some time.
+
+
+Thanks,
+Jan
+
+
+gdb/
+2011-08-14  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Fix TUI stepi on code without symbols.
+       * tui/tui-stack.c (tui_show_frame_info): Remove error, set LOW for
+       current PC instead.
+
+--- a/gdb/tui/tui-stack.c
++++ b/gdb/tui/tui-stack.c
+@@ -380,8 +380,11 @@ tui_show_frame_info (struct frame_info *fi)
+           {
+             if (find_pc_partial_function (get_frame_pc (fi), (char **) NULL,
+                                           &low, (CORE_ADDR) 0) == 0)
+-              error (_("No function contains program "
+-                       "counter for selected frame."));
++              {
++                /* There is no symbol available for current PC.  There is no
++                   safe way how to "disassemble backwards".  */
++                low = get_frame_pc (fi);
++              }
+             else
+               low = tui_get_low_disassembly_address (get_frame_arch (fi),
+                                                      low, get_frame_pc (fi));
+
diff --git a/gdb/patches/gdb-unused-revert.patch b/gdb/patches/gdb-unused-revert.patch
new file mode 100644 (file)
index 0000000..2abe3cf
--- /dev/null
@@ -0,0 +1,44 @@
+[RFA/commit 5/5] Add -Wunused-function to compile flags.
+http://sourceware.org/ml/gdb-patches/2010-01/msg00371.html
+http://sourceware.org/ml/gdb-cvs/2010-01/msg00163.html
+
+REVERTED
+
+--- src/gdb/configure.ac       2010/01/15 00:34:37     1.112
++++ src/gdb/configure.ac       2010/01/19 09:52:31     1.113
+@@ -1544,8 +1544,7 @@
+ # gdb/doc/gdbint.texinfo.
+ build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
+ -Wformat-nonliteral -Wno-pointer-sign \
+--Wno-unused -Wunused-value -Wunused-function \
+--Wno-switch -Wno-char-subscripts"
++-Wno-unused -Wunused-value -Wno-switch -Wno-char-subscripts"
+ # Enable -Wno-format by default when using gcc on mingw since many
+ # GCC versions complain about %I64.
+--- src/gdb/configure  2010/01/15 00:34:37     1.297
++++ src/gdb/configure  2010/01/19 09:52:32     1.298
+@@ -13435,8 +13435,7 @@
+ # gdb/doc/gdbint.texinfo.
+ build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
+ -Wformat-nonliteral -Wno-pointer-sign \
+--Wno-unused -Wunused-value -Wunused-function \
+--Wno-switch -Wno-char-subscripts"
++-Wno-unused -Wunused-value -Wno-switch -Wno-char-subscripts"
+ # Enable -Wno-format by default when using gcc on mingw since many
+ # GCC versions complain about %I64.
+### src/gdb/ChangeLog  2010/01/19 09:50:48     1.11271
+### src/gdb/ChangeLog  2010/01/19 09:52:33     1.11272
+## -1,11 +1,5 @@
+ 2010-01-19  Joel Brobecker  <brobecker@adacore.com>
+-      Add -Wunused-function to compile flags.
+-      * configure.ac: Add -Wunused-function to build_warnings.
+-      * configure: Regenerate.
+-
+-2010-01-19  Joel Brobecker  <brobecker@adacore.com>
+-
+       "delete" ada-lex.c:input function, not used.
+       * ada-lex.l: #define YY_NO_INPUT.
diff --git a/gdb/patches/gdb-upstream.patch b/gdb/patches/gdb-upstream.patch
new file mode 100644 (file)
index 0000000..c81f72a
--- /dev/null
@@ -0,0 +1,1485 @@
+http://sourceware.org/ml/binutils-cvs/2011-07/msg00116.html
+
+### src/include/ChangeLog      2011/07/22 14:37:50     1.546
+### src/include/ChangeLog      2011/07/22 20:37:50     1.547
+## -1,5 +1,8 @@
+ 2011-07-22  Jakub Jelinek  <jakub@redhat.com>
++      * dwarf2.h (DW_AT_GNU_macros): New.
++      (enum dwarf_macro_record_type): New enum.  Add DW_MACRO_GNU_*.
++
+       PR c++/49756
+       * libiberty.h (stack_limit_increase): New prototype.
+--- src/include/dwarf2.h       2011/06/22 15:03:19     1.26
++++ src/include/dwarf2.h       2011/07/22 20:37:50     1.27
+@@ -366,6 +366,8 @@
+     DW_AT_GNU_all_tail_call_sites = 0x2116,
+     DW_AT_GNU_all_call_sites = 0x2117,
+     DW_AT_GNU_all_source_call_sites = 0x2118,
++    /* Section offset into .debug_macro section.  */
++    DW_AT_GNU_macros = 0x2119,
+     /* VMS extensions.  */
+     DW_AT_VMS_rtnbeg_pd_address = 0x2201,
+     /* GNAT extensions.  */
+@@ -879,6 +881,20 @@
+     DW_MACINFO_end_file = 4,
+     DW_MACINFO_vendor_ext = 255
+   };
++
++/* Names and codes for new style macro information.  */
++enum dwarf_macro_record_type
++  {
++    DW_MACRO_GNU_define = 1,
++    DW_MACRO_GNU_undef = 2,
++    DW_MACRO_GNU_start_file = 3,
++    DW_MACRO_GNU_end_file = 4,
++    DW_MACRO_GNU_define_indirect = 5,
++    DW_MACRO_GNU_undef_indirect = 6,
++    DW_MACRO_GNU_transparent_include = 7,
++    DW_MACRO_GNU_lo_user = 0xe0,
++    DW_MACRO_GNU_hi_user = 0xff
++  };
\f
+ /* @@@ For use with GNU frame unwind information.  */
+
+
+
+FYI: implement new DWARF macro proposal
+http://sourceware.org/ml/gdb-patches/2011-07/msg00732.html
+http://sourceware.org/ml/gdb-cvs/2011-07/msg00212.html
+
+### src/gdb/ChangeLog  2011/07/26 15:24:01     1.13224
+### src/gdb/ChangeLog  2011/07/26 17:04:21     1.13225
+## -1,3 +1,20 @@
++2011-07-26  Tom Tromey  <tromey@redhat.com>
++
++      * symfile.h (struct dwarf2_debug_sections) <macro>: New field.
++      * dwarf2read.c (read_indirect_string_at_offset): New function.
++      (read_indirect_string): Use it.
++      (dwarf_decode_macro_bytes): New function, taken from
++      dwarf_decode_macros.  Handle DW_MACRO_GNU_*.
++      (dwarf_decode_macros): Use it.  handle DW_MACRO_GNU_*.
++      (dwarf_parse_macro_header, skip_form_bytes, skip_unknown_opcode):
++      New functions.
++      (struct dwarf2_per_objfile) <macro>: New field.
++      (dwarf2_elf_names): Add .debug_macro.
++      (dwarf2_macros_too_long_complaint): Add 'section' argument.
++      (dwarf2_locate_sections): Handle new section.
++      (read_file_scope): Handle DW_AT_GNU_macros.
++      (dwarf2_per_objfile_free): Unmap the .debug_macro section.
++
+ 2011-07-26  Paul Pluzhnikov  <ppluzhnikov@google.com>
+       * NEWS: Mention dcache configuration.
+--- src/gdb/dwarf2read.c       2011/07/20 15:13:49     1.554
++++ src/gdb/dwarf2read.c       2011/07/26 17:04:23     1.555
+@@ -187,6 +187,7 @@
+   struct dwarf2_section_info line;
+   struct dwarf2_section_info loc;
+   struct dwarf2_section_info macinfo;
++  struct dwarf2_section_info macro;
+   struct dwarf2_section_info str;
+   struct dwarf2_section_info ranges;
+   struct dwarf2_section_info frame;
+@@ -264,6 +265,7 @@
+   { ".debug_line", ".zdebug_line" },
+   { ".debug_loc", ".zdebug_loc" },
+   { ".debug_macinfo", ".zdebug_macinfo" },
++  { ".debug_macro", ".zdebug_macro" },
+   { ".debug_str", ".zdebug_str" },
+   { ".debug_ranges", ".zdebug_ranges" },
+   { ".debug_types", ".zdebug_types" },
+@@ -858,10 +860,11 @@
+ }
+ static void
+-dwarf2_macros_too_long_complaint (void)
++dwarf2_macros_too_long_complaint (struct dwarf2_section_info *section)
+ {
+   complaint (&symfile_complaints,
+-           _("macro info runs off end of `.debug_macinfo' section"));
++           _("macro info runs off end of `%s' section"),
++           section->asection->name);
+ }
+ static void
+@@ -1233,7 +1236,9 @@
+                                struct dwarf2_cu *);
+ static void dwarf_decode_macros (struct line_header *, unsigned int,
+-                                 char *, bfd *, struct dwarf2_cu *);
++                                 char *, bfd *, struct dwarf2_cu *,
++                               struct dwarf2_section_info *,
++                               int);
+ static int attr_form_is_block (struct attribute *);
+@@ -1438,6 +1443,11 @@
+       dwarf2_per_objfile->macinfo.asection = sectp;
+       dwarf2_per_objfile->macinfo.size = bfd_get_section_size (sectp);
+     }
++  else if (section_is_p (sectp->name, &names->macro))
++    {
++      dwarf2_per_objfile->macro.asection = sectp;
++      dwarf2_per_objfile->macro.size = bfd_get_section_size (sectp);
++    }
+   else if (section_is_p (sectp->name, &names->str))
+     {
+       dwarf2_per_objfile->str.asection = sectp;
+@@ -5641,13 +5651,28 @@
+      refers to information in the line number info statement program
+      header, so we can only read it if we've read the header
+      successfully.  */
+-  attr = dwarf2_attr (die, DW_AT_macro_info, cu);
++  attr = dwarf2_attr (die, DW_AT_GNU_macros, cu);
+   if (attr && cu->line_header)
+     {
+-      unsigned int macro_offset = DW_UNSND (attr);
++      if (dwarf2_attr (die, DW_AT_macro_info, cu))
++      complaint (&symfile_complaints,
++                 _("CU refers to both DW_AT_GNU_macros and DW_AT_macro_info"));
++
++      dwarf_decode_macros (cu->line_header, DW_UNSND (attr),
++                         comp_dir, abfd, cu,
++                         &dwarf2_per_objfile->macro, 1);
++    }
++  else
++    {
++      attr = dwarf2_attr (die, DW_AT_macro_info, cu);
++      if (attr && cu->line_header)
++      {
++        unsigned int macro_offset = DW_UNSND (attr);
+-      dwarf_decode_macros (cu->line_header, macro_offset,
+-                           comp_dir, abfd, cu);
++        dwarf_decode_macros (cu->line_header, macro_offset,
++                             comp_dir, abfd, cu,
++                             &dwarf2_per_objfile->macinfo, 0);
++      }
+     }
+   do_cleanups (back_to);
+ }
+@@ -10262,32 +10287,32 @@
+ }
+ static char *
+-read_indirect_string (bfd *abfd, gdb_byte *buf,
+-                    const struct comp_unit_head *cu_header,
+-                    unsigned int *bytes_read_ptr)
++read_indirect_string_at_offset (bfd *abfd, LONGEST str_offset)
+ {
+-  LONGEST str_offset = read_offset (abfd, buf, cu_header, bytes_read_ptr);
+-
+   dwarf2_read_section (dwarf2_per_objfile->objfile, &dwarf2_per_objfile->str);
+   if (dwarf2_per_objfile->str.buffer == NULL)
+-    {
+-      error (_("DW_FORM_strp used without .debug_str section [in module %s]"),
+-                    bfd_get_filename (abfd));
+-      return NULL;
+-    }
++    error (_("DW_FORM_strp used without .debug_str section [in module %s]"),
++         bfd_get_filename (abfd));
+   if (str_offset >= dwarf2_per_objfile->str.size)
+-    {
+-      error (_("DW_FORM_strp pointing outside of "
+-             ".debug_str section [in module %s]"),
+-           bfd_get_filename (abfd));
+-      return NULL;
+-    }
++    error (_("DW_FORM_strp pointing outside of "
++           ".debug_str section [in module %s]"),
++         bfd_get_filename (abfd));
+   gdb_assert (HOST_CHAR_BIT == 8);
+   if (dwarf2_per_objfile->str.buffer[str_offset] == '\0')
+     return NULL;
+   return (char *) (dwarf2_per_objfile->str.buffer + str_offset);
+ }
++static char *
++read_indirect_string (bfd *abfd, gdb_byte *buf,
++                    const struct comp_unit_head *cu_header,
++                    unsigned int *bytes_read_ptr)
++{
++  LONGEST str_offset = read_offset (abfd, buf, cu_header, bytes_read_ptr);
++
++  return read_indirect_string_at_offset (abfd, str_offset);
++}
++
+ static unsigned long
+ read_unsigned_leb128 (bfd *abfd, gdb_byte *buf, unsigned int *bytes_read_ptr)
+ {
+@@ -14669,117 +14694,205 @@
+     dwarf2_macro_malformed_definition_complaint (body);
+ }
++/* Skip some bytes from BYTES according to the form given in FORM.
++   Returns the new pointer.  */
+-static void
+-dwarf_decode_macros (struct line_header *lh, unsigned int offset,
+-                     char *comp_dir, bfd *abfd,
+-                     struct dwarf2_cu *cu)
++static gdb_byte *
++skip_form_bytes (bfd *abfd, gdb_byte *bytes,
++               enum dwarf_form form,
++               unsigned int offset_size,
++               struct dwarf2_section_info *section)
+ {
+-  gdb_byte *mac_ptr, *mac_end;
+-  struct macro_source_file *current_file = 0;
+-  enum dwarf_macinfo_record_type macinfo_type;
+-  int at_commandline;
++  unsigned int bytes_read;
+-  dwarf2_read_section (dwarf2_per_objfile->objfile,
+-                     &dwarf2_per_objfile->macinfo);
+-  if (dwarf2_per_objfile->macinfo.buffer == NULL)
++  switch (form)
+     {
+-      complaint (&symfile_complaints, _("missing .debug_macinfo section"));
+-      return;
++    case DW_FORM_data1:
++    case DW_FORM_flag:
++      ++bytes;
++      break;
++
++    case DW_FORM_data2:
++      bytes += 2;
++      break;
++
++    case DW_FORM_data4:
++      bytes += 4;
++      break;
++
++    case DW_FORM_data8:
++      bytes += 8;
++      break;
++
++    case DW_FORM_string:
++      read_direct_string (abfd, bytes, &bytes_read);
++      bytes += bytes_read;
++      break;
++
++    case DW_FORM_sec_offset:
++    case DW_FORM_strp:
++      bytes += offset_size;
++      break;
++
++    case DW_FORM_block:
++      bytes += read_unsigned_leb128 (abfd, bytes, &bytes_read);
++      bytes += bytes_read;
++      break;
++
++    case DW_FORM_block1:
++      bytes += 1 + read_1_byte (abfd, bytes);
++      break;
++    case DW_FORM_block2:
++      bytes += 2 + read_2_bytes (abfd, bytes);
++      break;
++    case DW_FORM_block4:
++      bytes += 4 + read_4_bytes (abfd, bytes);
++      break;
++
++    case DW_FORM_sdata:
++    case DW_FORM_udata:
++      bytes = skip_leb128 (abfd, bytes);
++      break;
++
++    default:
++      {
++      complain:
++      complaint (&symfile_complaints,
++                 _("invalid form 0x%x in `%s'"),
++                 form,
++                 section->asection->name);
++      return NULL;
++      }
+     }
+-  /* First pass: Find the name of the base filename.
+-     This filename is needed in order to process all macros whose definition
+-     (or undefinition) comes from the command line.  These macros are defined
+-     before the first DW_MACINFO_start_file entry, and yet still need to be
+-     associated to the base file.
++  return bytes;
++}
+-     To determine the base file name, we scan the macro definitions until we
+-     reach the first DW_MACINFO_start_file entry.  We then initialize
+-     CURRENT_FILE accordingly so that any macro definition found before the
+-     first DW_MACINFO_start_file can still be associated to the base file.  */
++/* A helper for dwarf_decode_macros that handles skipping an unknown
++   opcode.  Returns an updated pointer to the macro data buffer; or,
++   on error, issues a complaint and returns NULL.  */
+-  mac_ptr = dwarf2_per_objfile->macinfo.buffer + offset;
+-  mac_end = dwarf2_per_objfile->macinfo.buffer
+-    + dwarf2_per_objfile->macinfo.size;
++static gdb_byte *
++skip_unknown_opcode (unsigned int opcode,
++                   gdb_byte **opcode_definitions,
++                   gdb_byte *mac_ptr,
++                   bfd *abfd,
++                   unsigned int offset_size,
++                   struct dwarf2_section_info *section)
++{
++  unsigned int bytes_read, i;
++  unsigned long arg;
++  gdb_byte *defn;
+-  do
++  if (opcode_definitions[opcode] == NULL)
+     {
+-      /* Do we at least have room for a macinfo type byte?  */
+-      if (mac_ptr >= mac_end)
+-        {
+-        /* Complaint is printed during the second pass as GDB will probably
+-           stop the first pass earlier upon finding
+-           DW_MACINFO_start_file.  */
+-        break;
+-        }
++      complaint (&symfile_complaints,
++               _("unrecognized DW_MACFINO opcode 0x%x"),
++               opcode);
++      return NULL;
++    }
+-      macinfo_type = read_1_byte (abfd, mac_ptr);
+-      mac_ptr++;
++  defn = opcode_definitions[opcode];
++  arg = read_unsigned_leb128 (abfd, defn, &bytes_read);
++  defn += bytes_read;
+-      switch (macinfo_type)
+-        {
+-          /* A zero macinfo type indicates the end of the macro
+-             information.  */
+-        case 0:
+-        break;
++  for (i = 0; i < arg; ++i)
++    {
++      mac_ptr = skip_form_bytes (abfd, mac_ptr, defn[i], offset_size, section);
++      if (mac_ptr == NULL)
++      {
++        /* skip_form_bytes already issued the complaint.  */
++        return NULL;
++      }
++    }
+-      case DW_MACINFO_define:
+-      case DW_MACINFO_undef:
+-        /* Only skip the data by MAC_PTR.  */
+-        {
+-          unsigned int bytes_read;
++  return mac_ptr;
++}
+-          read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
+-          mac_ptr += bytes_read;
+-          read_direct_string (abfd, mac_ptr, &bytes_read);
+-          mac_ptr += bytes_read;
+-        }
+-        break;
++/* A helper function which parses the header of a macro section.
++   If the macro section is the extended (for now called "GNU") type,
++   then this updates *OFFSET_SIZE.  Returns a pointer to just after
++   the header, or issues a complaint and returns NULL on error.  */
+-      case DW_MACINFO_start_file:
+-        {
+-          unsigned int bytes_read;
+-          int line, file;
++static gdb_byte *
++dwarf_parse_macro_header (gdb_byte **opcode_definitions,
++                        bfd *abfd,
++                        gdb_byte *mac_ptr,
++                        unsigned int *offset_size,
++                        int section_is_gnu)
++{
++  memset (opcode_definitions, 0, 256 * sizeof (gdb_byte *));
+-          line = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
+-          mac_ptr += bytes_read;
+-          file = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
+-          mac_ptr += bytes_read;
++  if (section_is_gnu)
++    {
++      unsigned int version, flags;
+-          current_file = macro_start_file (file, line, current_file,
+-                                           comp_dir, lh, cu->objfile);
+-        }
+-        break;
++      version = read_2_bytes (abfd, mac_ptr);
++      if (version != 4)
++      {
++        complaint (&symfile_complaints,
++                   _("unrecognized version `%d' in .debug_macro section"),
++                   version);
++        return NULL;
++      }
++      mac_ptr += 2;
+-      case DW_MACINFO_end_file:
+-        /* No data to skip by MAC_PTR.  */
+-        break;
++      flags = read_1_byte (abfd, mac_ptr);
++      ++mac_ptr;
++      *offset_size = (flags & 1) ? 8 : 4;
+-      case DW_MACINFO_vendor_ext:
+-        /* Only skip the data by MAC_PTR.  */
+-        {
+-          unsigned int bytes_read;
++      if ((flags & 2) != 0)
++      /* We don't need the line table offset.  */
++      mac_ptr += *offset_size;
+-          read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
+-          mac_ptr += bytes_read;
+-          read_direct_string (abfd, mac_ptr, &bytes_read);
+-          mac_ptr += bytes_read;
+-        }
+-        break;
++      /* Vendor opcode descriptions.  */
++      if ((flags & 4) != 0)
++      {
++        unsigned int i, count;
+-      default:
+-        break;
++        count = read_1_byte (abfd, mac_ptr);
++        ++mac_ptr;
++        for (i = 0; i < count; ++i)
++          {
++            unsigned int opcode, bytes_read;
++            unsigned long arg;
++
++            opcode = read_1_byte (abfd, mac_ptr);
++            ++mac_ptr;
++            opcode_definitions[opcode] = mac_ptr;
++            arg = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
++            mac_ptr += bytes_read;
++            mac_ptr += arg;
++          }
+       }
+-    } while (macinfo_type != 0 && current_file == NULL);
++    }
+-  /* Second pass: Process all entries.
++  return mac_ptr;
++}
+-     Use the AT_COMMAND_LINE flag to determine whether we are still processing
+-     command-line macro definitions/undefinitions.  This flag is unset when we
+-     reach the first DW_MACINFO_start_file entry.  */
++/* A helper for dwarf_decode_macros that handles the GNU extensions,
++   including DW_GNU_MACINFO_transparent_include.  */
++
++static void
++dwarf_decode_macro_bytes (bfd *abfd, gdb_byte *mac_ptr, gdb_byte *mac_end,
++                        struct macro_source_file *current_file,
++                        struct line_header *lh, char *comp_dir,
++                        struct dwarf2_section_info *section,
++                        int section_is_gnu,
++                        unsigned int offset_size,
++                        struct objfile *objfile)
++{
++  enum dwarf_macro_record_type macinfo_type;
++  int at_commandline;
++  gdb_byte *opcode_definitions[256];
+-  mac_ptr = dwarf2_per_objfile->macinfo.buffer + offset;
++  mac_ptr = dwarf_parse_macro_header (opcode_definitions, abfd, mac_ptr,
++                                    &offset_size, section_is_gnu);
++  if (mac_ptr == NULL)
++    {
++      /* We already issued a complaint.  */
++      return;
++    }
+   /* Determines if GDB is still before first DW_MACINFO_start_file.  If true
+      GDB is still reading the definitions from command line.  First
+@@ -14795,13 +14908,15 @@
+       /* Do we at least have room for a macinfo type byte?  */
+       if (mac_ptr >= mac_end)
+       {
+-        dwarf2_macros_too_long_complaint ();
++        dwarf2_macros_too_long_complaint (section);
+         break;
+       }
+       macinfo_type = read_1_byte (abfd, mac_ptr);
+       mac_ptr++;
++      /* Note that we rely on the fact that the corresponding GNU and
++       DWARF constants are the same.  */
+       switch (macinfo_type)
+       {
+         /* A zero macinfo type indicates the end of the macro
+@@ -14809,29 +14924,45 @@
+       case 0:
+         break;
+-        case DW_MACINFO_define:
+-        case DW_MACINFO_undef:
++        case DW_MACRO_GNU_define:
++        case DW_MACRO_GNU_undef:
++      case DW_MACRO_GNU_define_indirect:
++      case DW_MACRO_GNU_undef_indirect:
+           {
+             unsigned int bytes_read;
+             int line;
+             char *body;
++          int is_define;
+-            line = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
+-            mac_ptr += bytes_read;
+-            body = read_direct_string (abfd, mac_ptr, &bytes_read);
+-            mac_ptr += bytes_read;
++          line = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
++          mac_ptr += bytes_read;
++
++          if (macinfo_type == DW_MACRO_GNU_define
++              || macinfo_type == DW_MACRO_GNU_undef)
++            {
++              body = read_direct_string (abfd, mac_ptr, &bytes_read);
++              mac_ptr += bytes_read;
++            }
++          else
++            {
++              LONGEST str_offset;
++
++              str_offset = read_offset_1 (abfd, mac_ptr, offset_size);
++              mac_ptr += offset_size;
++              body = read_indirect_string_at_offset (abfd, str_offset);
++            }
++
++          is_define = (macinfo_type == DW_MACRO_GNU_define
++                       || macinfo_type == DW_MACRO_GNU_define_indirect);
+             if (! current_file)
+             {
+               /* DWARF violation as no main source is present.  */
+               complaint (&symfile_complaints,
+                          _("debug info with no main source gives macro %s "
+                            "on line %d: %s"),
+-                         macinfo_type == DW_MACINFO_define ?
+-                           _("definition") :
+-                             macinfo_type == DW_MACINFO_undef ?
+-                               _("undefinition") :
+-                               _("something-or-other"), line, body);
++                         is_define ? _("definition") : _("undefinition"),
++                         line, body);
+               break;
+             }
+           if ((line == 0 && !at_commandline)
+@@ -14839,21 +14970,21 @@
+             complaint (&symfile_complaints,
+                        _("debug info gives %s macro %s with %s line %d: %s"),
+                        at_commandline ? _("command-line") : _("in-file"),
+-                       macinfo_type == DW_MACINFO_define ?
+-                         _("definition") :
+-                           macinfo_type == DW_MACINFO_undef ?
+-                             _("undefinition") :
+-                             _("something-or-other"),
++                       is_define ? _("definition") : _("undefinition"),
+                        line == 0 ? _("zero") : _("non-zero"), line, body);
+-          if (macinfo_type == DW_MACINFO_define)
++          if (is_define)
+             parse_macro_definition (current_file, line, body);
+-          else if (macinfo_type == DW_MACINFO_undef)
+-            macro_undef (current_file, line, body);
++          else
++            {
++              gdb_assert (macinfo_type == DW_MACRO_GNU_undef
++                          || macinfo_type == DW_MACRO_GNU_undef_indirect);
++              macro_undef (current_file, line, body);
++            }
+           }
+           break;
+-        case DW_MACINFO_start_file:
++        case DW_MACRO_GNU_start_file:
+           {
+             unsigned int bytes_read;
+             int line, file;
+@@ -14873,17 +15004,18 @@
+           if (at_commandline)
+             {
+-              /* This DW_MACINFO_start_file was executed in the pass one.  */
++              /* This DW_MACRO_GNU_start_file was executed in the
++                 pass one.  */
+               at_commandline = 0;
+             }
+           else
+             current_file = macro_start_file (file, line,
+                                              current_file, comp_dir,
+-                                             lh, cu->objfile);
++                                             lh, objfile);
+           }
+           break;
+-        case DW_MACINFO_end_file:
++        case DW_MACRO_GNU_end_file:
+           if (! current_file)
+           complaint (&symfile_complaints,
+                      _("macro debug info has an unmatched "
+@@ -14893,7 +15025,7 @@
+               current_file = current_file->included_by;
+               if (! current_file)
+                 {
+-                  enum dwarf_macinfo_record_type next_type;
++                  enum dwarf_macro_record_type next_type;
+                   /* GCC circa March 2002 doesn't produce the zero
+                      type byte marking the end of the compilation
+@@ -14903,7 +15035,7 @@
+                   /* Do we at least have room for a macinfo type byte?  */
+                   if (mac_ptr >= mac_end)
+                     {
+-                    dwarf2_macros_too_long_complaint ();
++                    dwarf2_macros_too_long_complaint (section);
+                       return;
+                     }
+@@ -14920,23 +15052,199 @@
+             }
+           break;
++      case DW_MACRO_GNU_transparent_include:
++        {
++          LONGEST offset;
++
++          offset = read_offset_1 (abfd, mac_ptr, offset_size);
++          mac_ptr += offset_size;
++
++          dwarf_decode_macro_bytes (abfd,
++                                    section->buffer + offset,
++                                    mac_end, current_file,
++                                    lh, comp_dir,
++                                    section, section_is_gnu,
++                                    offset_size, objfile);
++        }
++        break;
++
+         case DW_MACINFO_vendor_ext:
+-          {
+-            unsigned int bytes_read;
+-            int constant;
++        if (!section_is_gnu)
++          {
++            unsigned int bytes_read;
++            int constant;
+-            constant = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
+-            mac_ptr += bytes_read;
+-            read_direct_string (abfd, mac_ptr, &bytes_read);
+-            mac_ptr += bytes_read;
++            constant = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
++            mac_ptr += bytes_read;
++            read_direct_string (abfd, mac_ptr, &bytes_read);
++            mac_ptr += bytes_read;
+-            /* We don't recognize any vendor extensions.  */
+-          }
+-          break;
++            /* We don't recognize any vendor extensions.  */
++            break;
++          }
++        /* FALLTHROUGH */
++
++      default:
++        mac_ptr = skip_unknown_opcode (macinfo_type, opcode_definitions,
++                                       mac_ptr, abfd, offset_size,
++                                       section);
++        if (mac_ptr == NULL)
++          return;
++        break;
+         }
+     } while (macinfo_type != 0);
+ }
++static void
++dwarf_decode_macros (struct line_header *lh, unsigned int offset,
++                     char *comp_dir, bfd *abfd,
++                     struct dwarf2_cu *cu,
++                   struct dwarf2_section_info *section,
++                   int section_is_gnu)
++{
++  gdb_byte *mac_ptr, *mac_end;
++  struct macro_source_file *current_file = 0;
++  enum dwarf_macro_record_type macinfo_type;
++  unsigned int offset_size = cu->header.offset_size;
++  gdb_byte *opcode_definitions[256];
++
++  dwarf2_read_section (dwarf2_per_objfile->objfile, section);
++  if (section->buffer == NULL)
++    {
++      complaint (&symfile_complaints, _("missing %s section"),
++               section->asection->name);
++      return;
++    }
++
++  /* First pass: Find the name of the base filename.
++     This filename is needed in order to process all macros whose definition
++     (or undefinition) comes from the command line.  These macros are defined
++     before the first DW_MACINFO_start_file entry, and yet still need to be
++     associated to the base file.
++
++     To determine the base file name, we scan the macro definitions until we
++     reach the first DW_MACINFO_start_file entry.  We then initialize
++     CURRENT_FILE accordingly so that any macro definition found before the
++     first DW_MACINFO_start_file can still be associated to the base file.  */
++
++  mac_ptr = section->buffer + offset;
++  mac_end = section->buffer + section->size;
++
++  mac_ptr = dwarf_parse_macro_header (opcode_definitions, abfd, mac_ptr,
++                                    &offset_size, section_is_gnu);
++  if (mac_ptr == NULL)
++    {
++      /* We already issued a complaint.  */
++      return;
++    }
++
++  do
++    {
++      /* Do we at least have room for a macinfo type byte?  */
++      if (mac_ptr >= mac_end)
++        {
++        /* Complaint is printed during the second pass as GDB will probably
++           stop the first pass earlier upon finding
++           DW_MACINFO_start_file.  */
++        break;
++        }
++
++      macinfo_type = read_1_byte (abfd, mac_ptr);
++      mac_ptr++;
++
++      /* Note that we rely on the fact that the corresponding GNU and
++       DWARF constants are the same.  */
++      switch (macinfo_type)
++        {
++          /* A zero macinfo type indicates the end of the macro
++             information.  */
++        case 0:
++        break;
++
++      case DW_MACRO_GNU_define:
++      case DW_MACRO_GNU_undef:
++        /* Only skip the data by MAC_PTR.  */
++        {
++          unsigned int bytes_read;
++
++          read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
++          mac_ptr += bytes_read;
++          read_direct_string (abfd, mac_ptr, &bytes_read);
++          mac_ptr += bytes_read;
++        }
++        break;
++
++      case DW_MACRO_GNU_start_file:
++        {
++          unsigned int bytes_read;
++          int line, file;
++
++          line = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
++          mac_ptr += bytes_read;
++          file = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
++          mac_ptr += bytes_read;
++
++          current_file = macro_start_file (file, line, current_file,
++                                           comp_dir, lh, cu->objfile);
++        }
++        break;
++
++      case DW_MACRO_GNU_end_file:
++        /* No data to skip by MAC_PTR.  */
++        break;
++
++      case DW_MACRO_GNU_define_indirect:
++      case DW_MACRO_GNU_undef_indirect:
++        {
++          unsigned int bytes_read;
++
++          read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
++          mac_ptr += bytes_read;
++          mac_ptr += offset_size;
++        }
++        break;
++
++      case DW_MACRO_GNU_transparent_include:
++        /* Note that, according to the spec, a transparent include
++           chain cannot call DW_MACRO_GNU_start_file.  So, we can just
++           skip this opcode.  */
++        mac_ptr += offset_size;
++        break;
++
++      case DW_MACINFO_vendor_ext:
++        /* Only skip the data by MAC_PTR.  */
++        if (!section_is_gnu)
++          {
++            unsigned int bytes_read;
++
++            read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
++            mac_ptr += bytes_read;
++            read_direct_string (abfd, mac_ptr, &bytes_read);
++            mac_ptr += bytes_read;
++          }
++        /* FALLTHROUGH */
++
++      default:
++        mac_ptr = skip_unknown_opcode (macinfo_type, opcode_definitions,
++                                       mac_ptr, abfd, offset_size,
++                                       section);
++        if (mac_ptr == NULL)
++          return;
++        break;
++      }
++    } while (macinfo_type != 0 && current_file == NULL);
++
++  /* Second pass: Process all entries.
++
++     Use the AT_COMMAND_LINE flag to determine whether we are still processing
++     command-line macro definitions/undefinitions.  This flag is unset when we
++     reach the first DW_MACINFO_start_file entry.  */
++
++  dwarf_decode_macro_bytes (abfd, section->buffer + offset, mac_end,
++                          current_file, lh, comp_dir, section, section_is_gnu,
++                          offset_size, cu->objfile);
++}
++
+ /* Check if the attribute's form is a DW_FORM_block*
+    if so return true else false.  */
+ static int
+@@ -15663,6 +15971,7 @@
+   munmap_section_buffer (&data->line);
+   munmap_section_buffer (&data->loc);
+   munmap_section_buffer (&data->macinfo);
++  munmap_section_buffer (&data->macro);
+   munmap_section_buffer (&data->str);
+   munmap_section_buffer (&data->ranges);
+   munmap_section_buffer (&data->frame);
+--- src/gdb/symfile.h  2011/06/10 21:48:04     1.93
++++ src/gdb/symfile.h  2011/07/26 17:04:23     1.94
+@@ -582,6 +582,7 @@
+   struct dwarf2_section_names line;
+   struct dwarf2_section_names loc;
+   struct dwarf2_section_names macinfo;
++  struct dwarf2_section_names macro;
+   struct dwarf2_section_names str;
+   struct dwarf2_section_names ranges;
+   struct dwarf2_section_names types;
+
+
+
+Re: FYI: implement new DWARF macro proposal
+http://sourceware.org/ml/gdb-patches/2011-07/msg00759.html
+http://sourceware.org/ml/gdb-cvs/2011-07/msg00224.html
+
+### src/gdb/ChangeLog  2011/07/26 21:09:05     1.13229
+### src/gdb/ChangeLog  2011/07/27 14:45:36     1.13230
+## -1,3 +1,10 @@
++2011-07-27  Tom Tromey  <tromey@redhat.com>
++
++      * xcoffread.c (dwarf2_xcoff_names): Add 'macro' and 'sentinel'
++      entries.
++      * symfile.h (struct dwarf2_debug_sections) <sentinel>: New field.
++      * dwarf2read.c (dwarf2_elf_names): Add sentinel entry.
++
+ 2011-07-26  Sterling Augustine  <saugustine@google.com>
+       * cli/cli-dump.c (dump_binary_file): Change parameter type to
+--- src/gdb/dwarf2read.c       2011/07/26 17:04:23     1.555
++++ src/gdb/dwarf2read.c       2011/07/27 14:45:37     1.556
+@@ -271,7 +271,8 @@
+   { ".debug_types", ".zdebug_types" },
+   { ".debug_frame", ".zdebug_frame" },
+   { ".eh_frame", NULL },
+-  { ".gdb_index", ".zgdb_index" }
++  { ".gdb_index", ".zgdb_index" },
++  23
+ };
+ /* local data types */
+--- src/gdb/symfile.h  2011/07/26 17:04:23     1.94
++++ src/gdb/symfile.h  2011/07/27 14:45:37     1.95
+@@ -589,6 +589,9 @@
+   struct dwarf2_section_names frame;
+   struct dwarf2_section_names eh_frame;
+   struct dwarf2_section_names gdb_index;
++  /* This field has no meaning, but exists solely to catch changes to
++     this structure which are not reflected in some instance.  */
++  int sentinel;
+ };
+ extern int dwarf2_has_info (struct objfile *,
+--- src/gdb/xcoffread.c        2011/06/07 12:31:07     1.89
++++ src/gdb/xcoffread.c        2011/07/27 14:45:37     1.90
+@@ -160,12 +160,14 @@
+   { ".dwline", NULL },
+   { ".dwloc", NULL },
+   { NULL, NULL }, /* debug_macinfo */
++  { NULL, NULL }, /* debug_macro */
+   { ".dwstr", NULL },
+   { ".dwrnges", NULL },
+   { NULL, NULL }, /* debug_types */
+   { ".dwframe", NULL },
+   { NULL, NULL }, /* eh_frame */
+-  { NULL, NULL } /* gdb_index */
++  { NULL, NULL }, /* gdb_index */
++  23
+ };
+ static void
+
+
+
+[patch][python] Fix sigsegv when a printer fails to return a value and string_print is set.
+http://sourceware.org/ml/gdb-patches/2011-07/msg00719.html
+http://sourceware.org/ml/gdb-cvs/2011-07/msg00234.html
+
+### src/gdb/ChangeLog  2011/07/27 19:31:30     1.13236
+### src/gdb/ChangeLog  2011/07/28 10:36:37     1.13237
+## -1,3 +1,8 @@
++2011-07-28  Phil Muldoon  <pmuldoon@redhat.com>
++
++      * varobj.c (value_get_print_value): Move hint check later into the
++      function.  Comment function.  Free thevalue before reusing it.
++
+ 2011-07-27  Jan Kratochvil  <jan.kratochvil@redhat.com>
+           Pedro Alves  <pedro@codesourcery.com>
+--- src/gdb/varobj.c   2011/07/18 09:21:43     1.180
++++ src/gdb/varobj.c   2011/07/28 10:36:40     1.181
+@@ -2610,25 +2610,21 @@
+       if (PyObject_HasAttr (value_formatter, gdbpy_to_string_cst))
+         {
+-          char *hint;
+           struct value *replacement;
+           PyObject *output = NULL;
+-          hint = gdbpy_get_display_hint (value_formatter);
+-          if (hint)
+-            {
+-              if (!strcmp (hint, "string"))
+-                string_print = 1;
+-              xfree (hint);
+-            }
+-
+           output = apply_varobj_pretty_printer (value_formatter,
+                                                 &replacement,
+                                                 stb);
++
++          /* If we have string like output ...  */
+           if (output)
+             {
+               make_cleanup_py_decref (output);
++              /* If this is a lazy string, extract it.  For lazy
++                 strings we always print as a string, so set
++                 string_print.  */
+               if (gdbpy_is_lazy_string (output))
+                 {
+                   gdbpy_extract_lazy_string (output, &str_addr, &type,
+@@ -2638,12 +2634,27 @@
+                 }
+               else
+                 {
++                  /* If it is a regular (non-lazy) string, extract
++                     it and copy the contents into THEVALUE.  If the
++                     hint says to print it as a string, set
++                     string_print.  Otherwise just return the extracted
++                     string as a value.  */
++
+                   PyObject *py_str
+                     = python_string_to_target_python_string (output);
+                   if (py_str)
+                     {
+                       char *s = PyString_AsString (py_str);
++                      char *hint;
++
++                      hint = gdbpy_get_display_hint (value_formatter);
++                      if (hint)
++                        {
++                          if (!strcmp (hint, "string"))
++                            string_print = 1;
++                          xfree (hint);
++                        }
+                       len = PyString_Size (py_str);
+                       thevalue = xmemdup (s, len + 1, len + 1);
+@@ -2662,6 +2673,9 @@
+                     gdbpy_print_stack ();
+                 }
+             }
++          /* If the printer returned a replacement value, set VALUE
++             to REPLACEMENT.  If there is not a replacement value,
++             just use the value passed to this function.  */
+           if (replacement)
+             value = replacement;
+         }
+@@ -2672,12 +2686,18 @@
+   get_formatted_print_options (&opts, format_code[(int) format]);
+   opts.deref_ref = 0;
+   opts.raw = 1;
++
++  /* If the THEVALUE has contents, it is a regular string.  */
+   if (thevalue)
+     LA_PRINT_STRING (stb, type, thevalue, len, encoding, 0, &opts);
+   else if (string_print)
++    /* Otherwise, if string_print is set, and it is not a regular
++       string, it is a lazy string.  */
+     val_print_string (type, encoding, str_addr, len, stb, &opts);
+   else
++    /* All other cases.  */
+     common_val_print (value, stb, 0, &opts, current_language);
++
+   thevalue = ui_file_xstrdup (stb, NULL);
+   do_cleanups (old_chain);
+### src/gdb/testsuite/ChangeLog        2011/07/27 21:18:39     1.2816
+### src/gdb/testsuite/ChangeLog        2011/07/28 10:36:40     1.2817
+## -1,3 +1,10 @@
++2011-07-28  Phil Muldoon  <pmuldoon@redhat.com>
++
++      * gdb.python/py-mi.exp: Test printers returning string hint, and
++      also not returning a value.
++      * gdb.python/py-prettyprint.c: Add testcase for above.
++      * gdb.python/py-prettyprint.py: Add test printer for above.
++
+ 2011-07-27  Jan Kratochvil  <jan.kratochvil@redhat.com>
+       * gdb.dwarf2/dw2-simple-locdesc.S: Change DWARF version to 3.
+--- src/gdb/testsuite/gdb.python/py-mi.exp     2011/07/26 18:38:55     1.13
++++ src/gdb/testsuite/gdb.python/py-mi.exp     2011/07/28 10:36:40     1.14
+@@ -284,6 +284,13 @@ mi_list_varobj_children nstype2 {
+     { {nstype2.<error at 0>} {<error at 0>} 6 {char \[6\]} }
+ } "list children after setting exception flag"
++mi_create_varobj me me \
++  "create me varobj"
++
++mi_gdb_test "-var-evaluate-expression me" \
++      "\\^done,value=\"<error reading variable: Cannot access memory.>.*\"" \
++      "evaluate me varobj"
++
+ # C++ MI tests
+ gdb_exit
+ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
+--- src/gdb/testsuite/gdb.python/py-prettyprint.c      2011/04/29 12:45:46     1.12
++++ src/gdb/testsuite/gdb.python/py-prettyprint.c      2011/07/28 10:36:40     1.13
+@@ -149,6 +149,11 @@
+ typedef struct justchildren nostring_type;
++struct memory_error
++{
++  const char *s;
++};
++
+ struct container
+ {
+   string name;
+@@ -227,6 +232,7 @@
+   /* Clearing by being `static' could invoke an other GDB C++ bug.  */
+   struct nullstr nullstr;
+   nostring_type nstype, nstype2;
++  struct memory_error me;
+   struct ns ns, ns2;
+   struct lazystring estring, estring2;
+   struct hint_error hint_error;
+@@ -234,6 +240,8 @@
+   nstype.elements = narray;
+   nstype.len = 0;
++  me.s = "blah";
++
+   init_ss(&ss, 1, 2);
+   init_ss(ssa+0, 3, 4);
+   init_ss(ssa+1, 5, 6);
+--- src/gdb/testsuite/gdb.python/py-prettyprint.py     2011/04/11 17:40:41     1.11
++++ src/gdb/testsuite/gdb.python/py-prettyprint.py     2011/07/28 10:36:40     1.12
+@@ -17,6 +17,7 @@
+ # printers.
+ import re
++import gdb
+ # Test returning a Value from a printer.
+ class string_print:
+@@ -186,6 +187,18 @@
+         yield 's', self.val['s']
+         yield 'x', self.val['x']
++class MemoryErrorString:
++    "Raise an error"
++
++    def __init__(self, val):
++        self.val = val
++
++    def to_string(self):
++        raise gdb.MemoryError ("Cannot access memory.");
++
++    def display_hint (self):
++        return 'string'
++
+ def lookup_function (val):
+     "Look-up and return a pretty-printer that can print val."
+@@ -261,6 +274,8 @@
+     pretty_printers_dict[re.compile ('^struct hint_error$')]  = pp_hint_error
+     pretty_printers_dict[re.compile ('^hint_error$')]  = pp_hint_error
++    pretty_printers_dict[re.compile ('^memory_error$')]  = MemoryErrorString
++
+ pretty_printers_dict = {}
+ register_pretty_printers ()
+
+
+
+commit 84be2b4d0a55c95697c9ecc72bb31c2fbd316127
+Author: ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date:   Tue Jul 26 14:28:23 2011 +0000
+
+       * cp-demangle.c (d_print_init): Initialize pack_index field.
+       (d_print_comp): Check for NULL template argument.
+       * testsuite/demangle-expected: Add test case.
+    
+    
+    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176791 138bc75d-0d04-0410-961f-82ee72b054a4
+
+### a/libiberty/ChangeLog
+### b/libiberty/ChangeLog
+## -1,3 +1,9 @@
++2011-07-26  Ian Lance Taylor  <iant@google.com>
++
++      * cp-demangle.c (d_print_init): Initialize pack_index field.
++      (d_print_comp): Check for NULL template argument.
++      * testsuite/demangle-expected: Add test case.
++
+ 2011-07-22  Gerald Pfeifer  <gerald@pfeifer.com>
+       PR target/49817
+--- a/libiberty/cp-demangle.c
++++ b/libiberty/cp-demangle.c
+@@ -1,5 +1,5 @@
+ /* Demangler for g++ V3 ABI.
+-   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
++   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+    Free Software Foundation, Inc.
+    Written by Ian Lance Taylor <ian@wasabisystems.com>.
+@@ -3306,6 +3306,7 @@ d_print_init (struct d_print_info *dpi, demangle_callbackref callback,
+   dpi->last_char = '\0';
+   dpi->templates = NULL;
+   dpi->modifiers = NULL;
++  dpi->pack_index = 0;
+   dpi->flush_count = 0;
+   dpi->callback = callback;
+@@ -3893,6 +3894,13 @@ d_print_comp (struct d_print_info *dpi, int options,
+           struct demangle_component *a = d_lookup_template_argument (dpi, sub);
+           if (a && a->type == DEMANGLE_COMPONENT_TEMPLATE_ARGLIST)
+             a = d_index_template_argument (a, dpi->pack_index);
++
++          if (a == NULL)
++            {
++              d_print_error (dpi);
++              return;
++            }
++
+           sub = a;
+         }
+--- a/libiberty/testsuite/demangle-expected
++++ b/libiberty/testsuite/demangle-expected
+@@ -4010,6 +4010,12 @@ K<1, &S::m>::f()
+ _ZN1KILi1EXadL_ZN1S1mEEEE1fEv
+ K<1, &S::m>::f()
+ #
++# Used to crash -- binutils PR 13030.
++--format=gnu-v3
++_ZSt10_ConstructI10CellBorderIS0_EEvPT_DpOT0_
++_ZSt10_ConstructI10CellBorderIS0_EEvPT_DpOT0_
++_ZSt10_ConstructI10CellBorderIS0_EEvPT_DpOT0_
++#
+ # Ada (GNAT) tests.
+ #
+ # Simple test.
+
+
+
+http://sourceware.org/ml/gdb-cvs/2011-08/msg00047.html
+
+### src/gdb/ChangeLog  2011/08/08 21:41:12     1.13259
+### src/gdb/ChangeLog  2011/08/09 12:45:39     1.13260
+## -1,3 +1,13 @@
++2011-08-09  Phil Muldoon  <pmuldoon@redhat.com>
++
++      * python/lib/gdb/__init__.py: Auto-load files in command and
++      function directories.
++      * python/python.c (finish_python_initialization): Use
++      os.path.join.
++      * python/lib/gdb/command/pretty_printers.py: Self register
++      command.
++      * NEWS: Document auto-loading.
++
+ 2011-08-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
+       * dwarf2loc.c (dwarf2_evaluate_loc_desc_full) <DWARF_VALUE_STACK>
+--- src/gdb/NEWS       2011/07/26 20:57:53     1.446
++++ src/gdb/NEWS       2011/08/09 12:45:39     1.447
+@@ -23,6 +23,11 @@
+   ** A prompt subsitution hook (prompt_hook) is now available to the
+      Python API.
++  ** Python commands and convenience-functions located in
++    'data-directory'/python/gdb/command and
++    'data-directory'/python/gdb/function are now automatically loaded
++     on GDB start-up.
++
+ * libthread-db-search-path now supports two special values: $sdir and $pdir.
+   $sdir specifies the default system locations of shared libraries.
+   $pdir specifies the directory where the libpthread used by the application
+### src/gdb/doc/ChangeLog      2011/07/26 16:59:23     1.1202
+### src/gdb/doc/ChangeLog      2011/08/09 12:45:39     1.1203
+## -1,3 +1,8 @@
++2011-08-09  Phil Muldoon  <pmuldoon@redhat.com>
++
++      * gdb.texinfo (Python): Document command and function
++      auto-loading.
++
+ 2011-07-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
+           Eli Zaretskii  <eliz@gnu.org>
+--- src/gdb/doc/gdb.texinfo    2011/07/26 20:57:54     1.851
++++ src/gdb/doc/gdb.texinfo    2011/08/09 12:45:39     1.852
+@@ -20845,6 +20845,12 @@
+ is automatically added to the Python Search Path in order to allow
+ the Python interpreter to locate all scripts installed at this location.
++Additionally, @value{GDBN} commands and convenience functions which
++are written in Python and are located in the
++@file{@var{data-directory}/python/gdb/command} or
++@file{@var{data-directory}/python/gdb/function} directories are
++automatically imported when @value{GDBN} starts.
++
+ @menu
+ * Python Commands::             Accessing Python from @value{GDBN}.
+ * Python API::                  Accessing @value{GDBN} from Python.
+--- src/gdb/python/python.c    2011/07/22 09:22:50     1.68
++++ src/gdb/python/python.c    2011/08/09 12:45:40     1.69
+@@ -1302,13 +1302,13 @@
+   sys.path.insert (0, gdb.PYTHONDIR)\n\
+ \n\
+   # Tell python where to find submodules of gdb.\n\
+-  gdb.__path__ = [gdb.PYTHONDIR + '/gdb']\n\
++  gdb.__path__ = [os.path.join (gdb.PYTHONDIR, 'gdb')]\n\
+ \n\
+   # The gdb module is implemented in C rather than in Python.  As a result,\n\
+   # the associated __init.py__ script is not not executed by default when\n\
+   # the gdb module gets imported.  Execute that script manually if it\n\
+   # exists.\n\
+-  ipy = gdb.PYTHONDIR + '/gdb/__init__.py'\n\
++  ipy = os.path.join (gdb.PYTHONDIR, 'gdb', '__init__.py')\n\
+   if os.path.exists (ipy):\n\
+     execfile (ipy)\n\
+ \n\
+--- src/gdb/python/lib/gdb/__init__.py 2011/01/01 15:33:26     1.3
++++ src/gdb/python/lib/gdb/__init__.py 2011/08/09 12:45:40     1.4
+@@ -13,6 +13,29 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-import gdb.command.pretty_printers
++import traceback
+-gdb.command.pretty_printers.register_pretty_printer_commands()
++# Auto-load all functions/commands.
++
++# Modules to auto-load, and the paths where those modules exist.
++
++module_dict = {
++  'gdb.function': os.path.join(gdb.PYTHONDIR, 'gdb', 'function'),
++  'gdb.command': os.path.join(gdb.PYTHONDIR, 'gdb', 'command')
++}
++
++# Iterate the dictionary, collating the Python files in each module
++# path.  Construct the module name, and import.
++
++for module, location in module_dict.iteritems():
++  if os.path.exists(location):
++     py_files = filter(lambda x: x.endswith('.py') and x != '__init__.py',
++                       os.listdir(location))
++
++     for py_file in py_files:
++       # Construct from foo.py, gdb.module.foo
++       py_file = module + '.' + py_file[:-3]
++       try:
++         exec('import ' + py_file)
++       except:
++         print >> sys.stderr, traceback.format_exc()
+--- src/gdb/python/lib/gdb/command/pretty_printers.py  2011/01/01 15:33:27     1.4
++++ src/gdb/python/lib/gdb/command/pretty_printers.py  2011/08/09 12:45:40     1.5
+@@ -368,3 +368,5 @@
+     InfoPrettyPrinter()
+     EnablePrettyPrinter()
+     DisablePrettyPrinter()
++
++register_pretty_printer_commands()
+
+
+
+http://sourceware.org/ml/gdb-patches/2011-08/msg00505.html
+Subject: fix "info os processes" race -> crash (ext-run.exp racy FAIL)
+http://sourceware.org/ml/gdb-cvs/2011-08/msg00116.html
+
+### src/gdb/ChangeLog  2011/08/26 17:58:57     1.13281
+### src/gdb/ChangeLog  2011/08/26 18:58:02     1.13282
+## -1,3 +1,8 @@
++2011-08-26  Pedro Alves  <pedro@codesourcery.com>
++
++      * common/linux-osdata.c (get_cores_used_by_process): Don't assume
++      opening /proc/PID/task always succeeds.
++
+ 2011-08-26  Aleksandar Ristovski <aristovski@qnx.com>
+       * linespec.c (symtab_from_filename): Check for the end of string.
+--- src/gdb/common/linux-osdata.c      2011/07/21 23:46:09     1.1
++++ src/gdb/common/linux-osdata.c      2011/08/26 18:58:04     1.2
+@@ -259,27 +259,29 @@
+   sprintf (taskdir, "/proc/%d/task", pid);
+   dir = opendir (taskdir);
+-
+-  while ((dp = readdir (dir)) != NULL)
++  if (dir)
+     {
+-      pid_t tid;
+-      int core;
++      while ((dp = readdir (dir)) != NULL)
++      {
++        pid_t tid;
++        int core;
+-      if (!isdigit (dp->d_name[0])
+-        || NAMELEN (dp) > sizeof ("4294967295") - 1)
+-      continue;
++        if (!isdigit (dp->d_name[0])
++            || NAMELEN (dp) > sizeof ("4294967295") - 1)
++          continue;
+-      tid = atoi (dp->d_name);
+-      core = linux_common_core_of_thread (ptid_build (pid, tid, 0));
++        tid = atoi (dp->d_name);
++        core = linux_common_core_of_thread (ptid_build (pid, tid, 0));
+-      if (core >= 0)
+-      {
+-        ++cores[core];
+-        ++task_count;
++        if (core >= 0)
++          {
++            ++cores[core];
++            ++task_count;
++          }
+       }
+-    }
+-  closedir (dir);
++      closedir (dir);
++    }
+   return task_count;
+ }
+
+
+
+Fix for https://bugzilla.redhat.com/show_bug.cgi?id=750341
+http://sourceware.org/ml/gdb-patches/2011-10/msg00570.html
+
+
+http://sourceware.org/ml/gdb-cvs/2011-10/msg00154.html
+
+### src/gdb/ChangeLog  2011/10/20 13:34:13     1.13446
+### src/gdb/ChangeLog  2011/10/20 20:06:11     1.13447
+## -1,3 +1,15 @@
++2011-10-20  Aleksandar Ristovski  <aristovski@qnx.com>
++
++      * cp-namespace.c (cp_scan_for_anonymous_namespaces): Changed function
++      arguments by adding OBJFILE.  Instead of getting objfile from
++      symbol's symtab, use new argument OBJFILE.
++      * cp-support.h (cp_scan_for_anonymous_namespaces): Changed function
++      arguments by adding OBJFILE.
++      * gdb/dwarf2read.c (new_symbol_full): Change call to
++      cp_scan_for_anonymous_namespaces to match new signature.
++      * gdb/stabsread.c (define_symbol): Change call to
++      cp_scan_for_anonymous_namespaces to match new signature.
++
+ 2011-10-20  Phil Muldoon  <pmuldoon@redhat.com>
+         PR python/13308
+--- src/gdb/cp-namespace.c     2011/06/29 22:05:15     1.54
++++ src/gdb/cp-namespace.c     2011/10/20 20:06:13     1.55
+@@ -53,7 +53,8 @@
+    anonymous namespace; if so, add an appropriate using directive.  */
+ void
+-cp_scan_for_anonymous_namespaces (const struct symbol *symbol)
++cp_scan_for_anonymous_namespaces (const struct symbol *const symbol,
++                                struct objfile *const objfile)
+ {
+   if (SYMBOL_DEMANGLED_NAME (symbol) != NULL)
+     {
+@@ -96,7 +97,7 @@
+                namespace given by the previous component if there is
+                one, or to the global namespace if there isn't.  */
+             cp_add_using_directive (dest, src, NULL, NULL, NULL,
+-                                    &SYMBOL_SYMTAB (symbol)->objfile->objfile_obstack);
++                                    &objfile->objfile_obstack);
+           }
+         /* The "+ 2" is for the "::".  */
+         previous_component = next_component + 2;
+--- src/gdb/cp-support.h       2011/08/18 16:17:38     1.45
++++ src/gdb/cp-support.h       2011/10/20 20:06:13     1.46
+@@ -197,7 +197,8 @@
+                               const char *processing_current_prefix,
+                               int processing_has_namespace_info);
+-extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol);
++extern void cp_scan_for_anonymous_namespaces (const struct symbol *symbol,
++                                            struct objfile *objfile);
+ extern struct symbol *cp_lookup_symbol_nonlocal (const char *name,
+                                                const struct block *block,
+--- src/gdb/dwarf2read.c       2011/10/20 01:11:34     1.576
++++ src/gdb/dwarf2read.c       2011/10/20 20:06:13     1.577
+@@ -11992,7 +11992,7 @@
+        namespaces based on the demangled name.  */
+       if (!processing_has_namespace_info
+         && cu->language == language_cplus)
+-      cp_scan_for_anonymous_namespaces (sym);
++      cp_scan_for_anonymous_namespaces (sym, objfile);
+     }
+   return (sym);
+ }
+--- src/gdb/stabsread.c        2011/05/18 16:30:36     1.138
++++ src/gdb/stabsread.c        2011/10/20 20:06:14     1.139
+@@ -729,7 +729,7 @@
+       SYMBOL_SET_NAMES (sym, string, p - string, 1, objfile);
+       if (SYMBOL_LANGUAGE (sym) == language_cplus)
+-      cp_scan_for_anonymous_namespaces (sym);
++      cp_scan_for_anonymous_namespaces (sym, objfile);
+     }
+   p++;
diff --git a/gdb/patches/gdb-vla-frame-set.patch b/gdb/patches/gdb-vla-frame-set.patch
new file mode 100644 (file)
index 0000000..87ddca1
--- /dev/null
@@ -0,0 +1,91 @@
+commit 51dab9e418741ac7065cd5a6ec9b57285e90227c
+https://bugzilla.redhat.com/show_bug.cgi?id=738482
+
+--- a/gdb/printcmd.c
++++ b/gdb/printcmd.c
+@@ -1981,6 +1981,10 @@ print_variable_and_value (const char *name, struct symbol *var,
+       struct value_print_options opts;
+       val = read_var_value (var, frame);
++
++      make_cleanup_restore_selected_frame ();
++      select_frame (frame);
++
+       get_user_print_options (&opts);
+       common_val_print (val, stream, indent, &opts, current_language);
+     }
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/vla-frame.c
+@@ -0,0 +1,31 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++   Copyright 2011 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++#include <string.h>
++
++int
++main (int argc, char **argv)
++{
++  char s[2 + argc];
++  void (*f) (char *) = 0;
++
++  memset (s, 0, sizeof (s));
++  s[0] = 'X';
++
++  f (s);
++  return 0;
++}
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/vla-frame.exp
+@@ -0,0 +1,38 @@
++# Copyright 2011 Free Software Foundation, Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++
++set testfile vla-frame
++set executable ${testfile}
++
++if { [prepare_for_testing ${testfile}.exp ${executable}] } {
++    return -1
++}
++
++if ![runto_main] {
++    return -1
++}
++
++set test "continue"
++gdb_test_multiple $test $test {
++    -re "Continuing\\.\r\n\r\nProgram received signal SIGSEGV, Segmentation fault\\.\r\n0x0+ in \\?\\? \\(\\)\r\n$gdb_prompt $" {
++      pass $test
++    }
++    -re "\r\n$gdb_prompt $" {
++      untested ${testfile}.exp
++      return
++    }
++}
++
++gdb_test "bt full" "\r\n +s = \"X\\\\000\"\r\n.*"
diff --git a/gdb/patches/gdb-x86_64-i386-syscall-restart.patch b/gdb/patches/gdb-x86_64-i386-syscall-restart.patch
new file mode 100644 (file)
index 0000000..d5d6b10
--- /dev/null
@@ -0,0 +1,121 @@
+http://sourceware.org/ml/gdb-patches/2009-11/msg00592.html
+Subject: [patch] Fix syscall restarts for amd64->i386 biarch
+
+Hi,
+
+tested only on recent Linux kernels, it should apply also on vanilla ones.
+There were various changes of the kernels behavior in the past.
+
+FSF GDB HEAD state:
+kernel debugger inferior state
+x86_64 x86_64   x86_64   PASS
+x86_64 x86_64   i386     FAIL without this patch, PASS with this patch
+x86_64 i386     i386     PASS on recent kernels
+                         (FAIL: kernel-2.6.31.5-127.fc12.x86_64 - Fedora 12)
+                         (PASS: kernel-2.6.32-0.55.rc8.git1.fc13.x86_64)
+i386   i386     i386     PASS
+
+
+Currently gdb.base/interrupt.exp fails on amd64 host running under
+--target_board unix/-m32 with:
+       continue
+       Continuing.
+       Unknown error 512
+
+<linux/errno.h>:
+/*
+ * These should never be seen by user programs.  To return one of ERESTART*
+ * codes, signal_pending() MUST be set.  Note that ptrace can observe these
+ * at syscall exit tracing, but they will never be left for the debugged user
+ * process to see.
+ */
+#define ERESTARTSYS     512
+
+"Unknown error 512" printed above is printed by the inferior itself, not by GDB.
+
+It is because GDB reads it as 0xfffffffffffffe00 but writes it back as
+0xfffffe00.
++      /* Sign-extend %eax as during return from a syscall it is being checked
++       for -ERESTART* values -512 being above 0xfffffffffffffe00; tested by
++       interrupt.exp.  */
+
+
+Quote of Roland McGrath from IRC:
+
+roland: in the user_regset model, there are 64-bit user_regset flavors and
+32-bit user_regset flavors, so at the kabi level the (kernel) caller can say
+what it means: calls on the 32-bit user_regset flavor will behave as if on
+a 32-bit kernel/userland.  in ptrace, there is no way for x86_64 ptrace calls
+to say "i think of the inferior as being 32 bits, so act accordingly" (tho ppc
+and/or sparc have ptr
+roland: ace requests that do that iirc)
+roland: ergo 64-bit ptrace callers must either save/restore full 64-bits so
+the kernel's sign-extension choices are preserved, or else grok magic ways to
+expand stored 32-bit register contents to 64-bit values to stuff via 64-bit
+ptrace
+[...]
+roland: there is a "32-bit-flavored task", but it's not really true that it
+has 32-bit registers.  there is no 32-bit-only userland condition.  any task
+can always ljmp to the 64-bit code segment and run 64-bit insns including
+a 64-bit syscall
+roland: so a 64-bit debugger should see and be able to fiddle the full
+registers.  it can even change cs via ptrace to force the inferior into
+running 32 or 64 bit code.
+
+
+Saving whole 64bits for i386 targets on x86_64 hosts does not much match the
+GDB architecture as `struct type' for these registers still should be 32bit
+etc.   Therefore provided just this exception.
+
+The problem is reproducible only if one does an inferior call during the
+interruption to do full inferior save/restore from GDB regcache.
+
+Regression tested on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
+
+
+Thanks,
+Jan
+
+
+gdb/
+2009-11-29  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * amd64-nat.c (amd64_collect_native_gregset): Do not pre-clear %eax.
+       Sign extend it afterwards.
+
+--- a/gdb/amd64-nat.c
++++ b/gdb/amd64-nat.c
+@@ -131,9 +131,9 @@ amd64_collect_native_gregset (const struct regcache *regcache,
+     {
+       num_regs = amd64_native_gregset32_num_regs;
+-      /* Make sure %eax, %ebx, %ecx, %edx, %esi, %edi, %ebp, %esp and
++      /* Make sure %ebx, %ecx, %edx, %esi, %edi, %ebp, %esp and
+          %eip get zero-extended to 64 bits.  */
+-      for (i = 0; i <= I386_EIP_REGNUM; i++)
++      for (i = I386_ECX_REGNUM; i <= I386_EIP_REGNUM; i++)
+       {
+         if (regnum == -1 || regnum == i)
+           memset (regs + amd64_native_gregset_reg_offset (gdbarch, i), 0, 8);
+@@ -159,4 +159,20 @@ amd64_collect_native_gregset (const struct regcache *regcache,
+           regcache_raw_collect (regcache, i, regs + offset);
+       }
+     }
++
++  if (gdbarch_ptr_bit (gdbarch) == 32)
++    {
++      /* Sign-extend %eax as during return from a syscall it is being checked
++       for -ERESTART* values -512 being above 0xfffffffffffffe00; tested by
++       interrupt.exp.  */
++
++      int i = I386_EAX_REGNUM;
++
++      if (regnum == -1 || regnum == i)
++      {
++        void *ptr = regs + amd64_native_gregset_reg_offset (gdbarch, i);
++
++        *(int64_t *) ptr = *(int32_t *) ptr;
++      }
++    }
+ }
+
index 30404d3911f5f4d82d15d81477936170bb7269f9..9362e7039ff0f25d3bfabc30a661092e5a9c779d 100644 (file)
@@ -38,8 +38,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/gdk-pixbuf2/gdk-pixbuf2.nm b/gdk-pixbuf2/gdk-pixbuf2.nm
new file mode 100644 (file)
index 0000000..7fa3659
--- /dev/null
@@ -0,0 +1,49 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = gdk-pixbuf2
+version    = 2.24.0
+major_ver  = 2.24
+release    = 1
+
+groups     = System/Libraries
+url        = http://www.gtk.org/
+license    = LGPLv2+
+summary    = An image loading library.
+
+description
+       gdk-pixbuf is an image loading library that can be extended by loadable
+       modules for new image formats.
+end
+
+thisapp    = gdk-pixbuf-%{version}
+
+source_dl  = http://download.gnome.org/sources/gdk-pixbuf/%{major_ver}/
+sources    = %{thisapp}.tar.xz
+
+build
+       requires
+               glib2-devel
+               libpng-devel
+               libjpeg-devel
+               libtiff-devel
+       end
+
+       configure_options += \
+               --disable-rpath
+end
+
+packages
+       package %{name}
+       end
+
+       package %{name}-devel
+               template DEVEL
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
index 0f13892ac67246573426fa008bca479a825997ce..2ba29cdde8849fd7c94d8c8694d73ab02b1d974b 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = gettext
 version    = 0.18.1.1
-release    = 2
+release    = 3
 
 groups     = System/Base
 url        = http://www.gnu.org/software/gettext/
@@ -30,6 +30,7 @@ source_dl  = http://ftp.gnu.org/pub/gnu/gettext/
 build
        requires
                bison
+               libcroco-devel
                libxml2-devel
        end
 
@@ -46,7 +47,7 @@ end
 
 packages
        package %{name}
-       
+
        package %{name}-devel
                template DEVEL
 
@@ -64,4 +65,8 @@ packages
                        /usr/lib/preloadable_libintl.so
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 9922894b3ce300f789eb7180bb8f15ae72b28e27..f58df707693809edd9a23298ccd249907d6ab825 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = ghostscript
-version    = 9.02
+version    = 9.04
 release    = 1
 
 groups     = Applications/Printing
@@ -41,4 +41,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 2317c878c11001297633d5a73bccfd2af0540b7e..7501f7de43bbcd24ca3ae950158cbc08286c8cad 100644 (file)
@@ -27,6 +27,7 @@ build
                gettext
                libcurl-devel
                openssl-devel
+               perl-ExtUtils-MakeMaker
                perl-devel
                zlib-devel
        end
@@ -62,6 +63,10 @@ packages
                        rsync
                        /usr/bin/vi
                end
-       
+
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 792c03b1eff95b0bd503904c8443b84a02f40fa9..67c7fb097a1d6ba55aa90a2f61facf0c334bf336 100644 (file)
@@ -4,9 +4,9 @@
 ###############################################################################
 
 name       = glib2
-ver_major  = 2.30
-version    = %{ver_major}.0
-release    = 2
+ver_major  = 2.31
+version    = %{ver_major}.2
+release    = 1
 thisapp    = glib-%{version}
 
 groups     = System/Libraries
@@ -22,7 +22,7 @@ description
        object system.
 end
 
-source_dl  = http://ftp.gnome.org/pub/gnome/sources/glib/%{version_major}/
+source_dl  = http://ftp.gnome.org/pub/gnome/sources/glib/%{ver_major}/
 sources    = %{thisapp}.tar.xz
 
 build
@@ -57,4 +57,8 @@ packages
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 997cd19e126cb1ee567585499bbb3988639fa050..88ceb394d49877cc3ec2f031b14f190902025fda 100644 (file)
@@ -3,11 +3,9 @@
 # Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
 ###############################################################################
 
-# TODO tzdata
-
 name       = glibc
 version    = 2.14
-release    = 2
+release    = 5
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
 groups     = System/Base
@@ -25,8 +23,11 @@ description
        Linux system will not function.
 end
 
+# The version of the ports addon.
+ports_version = %{version}
+
 source_dl  = http://ftp.gnu.org/gnu/glibc/
-sources    = %{thisapp}.tar.xz
+sources    = %{thisapp}.tar.xz glibc-ports-%{ports_version}.tar.xz
 
 build
        # Optimize glibc for kernel
@@ -57,7 +58,21 @@ build
 
        export QUALITY_AGENT_RPATH_ALLOW_ORIGIN=yes
 
-       prepare_cmds
+       prepare
+               # Extract source tarballs.
+               %{MACRO_EXTRACT_TARBALL}
+
+               # Create link for ports addon.
+               ln -svf ../glibc-ports-%{ports_version} ports
+
+               # Apply the patches.
+               %{MACRO_PATCHES}
+
+               if [ "%{DISTRO_ARCH}" = "armv5tel" ]; then
+                       sed -i configure \
+                               -e "s/libc_cv_gcc_static_libgcc=-static-libgcc/libc_cv_gcc_static_libgcc=/"
+               fi
+
                # In the vi_VN.TCVN locale, bash enters an infinite loop at startup. It is
                # unknown whether this is a bash bug or a Glibc problem. Disable
                # installation of this locale in order to avoid the problem.
@@ -132,27 +147,36 @@ build
                        -e "s/tst-sigset2//g"
        end
 
+       configure_options = \
+               --build=%{DISTRO_BUILDTARGET} \
+               --host=%{DISTRO_BUILDTARGET} \
+               --prefix=/usr \
+               --libexecdir=/usr/lib/glibc \
+               --disable-profile \
+               --enable-add-ons \
+               --enable-kernel=%{OPTIMIZED_KERNEL} \
+               --with-selinux \
+               --disable-werror \
+               --enable-bind-now \
+               --enable-__thread \
+               --enable-tls \
+               --enable-experimental-malloc \
+               --with-gd \
+               --with-nss-crypt
+
+       if "%{DISTRO_ARCH}" == "armv5tel"
+               # Disable hardware FP for ARM.
+               configure_options += \
+                       --without-fp
+       end
+
        build
-               mkdir %{DIR_SRC}/glibc-build
+               mkdir -p %{DIR_SRC}/glibc-build
                cd %{DIR_SRC}/glibc-build
 
                CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \
                ../%{thisapp}/configure \
-                       --build=%{DISTRO_BUILDTARGET} \
-                       --host=%{DISTRO_BUILDTARGET} \
-                       --prefix=/usr \
-                       --libexecdir=/usr/lib/glibc \
-                       --disable-profile \
-                       --enable-add-ons \
-                       --enable-kernel=%{OPTIMIZED_KERNEL} \
-                       --with-selinux \
-                       --disable-werror \
-                       --enable-bind-now \
-                       --enable-__thread \
-                       --enable-tls \
-                       --enable-experimental-malloc \
-                       --with-gd \
-                       --with-nss-crypt
+                       %{configure_options}
 
                sed -i config.make \
                        -e "s/^build-pic-default=.*/build-pic-default=yes/"
@@ -193,6 +217,7 @@ build
                # Timezone
                cp -v --remove-destination %{BUILDROOT}/usr/share/zoneinfo/GMT \
                        %{BUILDROOT}/etc/localtime
+               rm -rf %{BUILDROOT}/usr/share/zoneinfo
 
                # Configuration
                cp -vf %{DIR_SOURCE}/{ld.so.conf,nsswitch.conf} %{BUILDROOT}/etc
@@ -215,16 +240,23 @@ build
                # Move some libs to correct place
                mv -v %{BUILDROOT}/lib/lib{memusage,pcprofile}.so %{BUILDROOT}/usr/lib/
        end
+
+       keep_libraries
+               /usr/lib/libc_nonshared.a
+               /usr/lib/libpthread_nonshared.a
+       end
 end
 
 packages
        package glibc
-               requires = glibc-common=%{thisver}      
+               requires = glibc-common=%{thisver}
        end
 
        package glibc-common
                # XXX description and summary are missing
 
+               requires = tzdata
+
                files
                        /usr/bin
                        /usr/sbin
@@ -307,4 +339,8 @@ packages
                        /usr/lib/libpcprofile.so
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/glibc/patches/glibc-2.10.1-sanitize_env.patch.off b/glibc/patches/glibc-2.10.1-sanitize_env.patch.off
deleted file mode 100644 (file)
index 5d0e942..0000000
+++ /dev/null
@@ -1,1062 +0,0 @@
-From: http://sisyphus.ru/srpm/Sisyphus/glibc/patches/10
-
-I added MUDFLAP_OPTIONS to sysdeps/generic/unsecvars.h.
-
-diff -Naur glibc-2.8-20080929.orig/argp/argp-help.c glibc-2.8-20080929/argp/argp-help.c
---- glibc-2.8-20080929.orig/argp/argp-help.c   2007-03-15 20:08:18.000000000 +0000
-+++ glibc-2.8-20080929/argp/argp-help.c        2008-10-15 00:30:49.000000000 +0000
-@@ -165,7 +165,7 @@
- static void
- fill_in_uparams (const struct argp_state *state)
- {
--  const char *var = getenv ("ARGP_HELP_FMT");
-+  const char *var = __secure_getenv ("ARGP_HELP_FMT");
- #define SKIPWS(p) do { while (isspace (*p)) p++; } while (0);
-diff -Naur glibc-2.8-20080929.orig/catgets/catgets.c glibc-2.8-20080929/catgets/catgets.c
---- glibc-2.8-20080929.orig/catgets/catgets.c  2002-05-15 03:46:42.000000000 +0000
-+++ glibc-2.8-20080929/catgets/catgets.c       2008-10-15 00:30:49.000000000 +0000
-@@ -50,7 +50,7 @@
-         || (__libc_enable_secure && strchr (env_var, '/') != NULL))
-       env_var = "C";
--      nlspath = getenv ("NLSPATH");
-+      nlspath = __secure_getenv ("NLSPATH");
-       if (nlspath != NULL && *nlspath != '\0')
-       {
-         /* Append the system dependent directory.  */
-diff -Naur glibc-2.8-20080929.orig/debug/pcprofile.c glibc-2.8-20080929/debug/pcprofile.c
---- glibc-2.8-20080929.orig/debug/pcprofile.c  2001-07-06 04:54:45.000000000 +0000
-+++ glibc-2.8-20080929/debug/pcprofile.c       2008-10-15 00:30:49.000000000 +0000
-@@ -38,7 +38,7 @@
- {
-   /* See whether the environment variable `PCPROFILE_OUTPUT' is defined.
-      If yes, it should name a FIFO.  We open it and mark ourself as active.  */
--  const char *outfile = getenv ("PCPROFILE_OUTPUT");
-+  const char *outfile = __secure_getenv ("PCPROFILE_OUTPUT");
-   if (outfile != NULL && *outfile != '\0')
-     {
-diff -Naur glibc-2.8-20080929.orig/debug/segfault.c glibc-2.8-20080929/debug/segfault.c
---- glibc-2.8-20080929.orig/debug/segfault.c   2007-08-22 06:52:12.000000000 +0000
-+++ glibc-2.8-20080929/debug/segfault.c        2008-10-15 00:30:49.000000000 +0000
-@@ -149,7 +149,7 @@
- install_handler (void)
- {
-   struct sigaction sa;
--  const char *sigs = getenv ("SEGFAULT_SIGNALS");
-+  const char *sigs = __secure_getenv ("SEGFAULT_SIGNALS");
-   const char *name;
-   sa.sa_handler = (void *) catch_segfault;
-@@ -157,7 +157,7 @@
-   sa.sa_flags = SA_RESTART;
-   /* Maybe we are expected to use an alternative stack.  */
--  if (getenv ("SEGFAULT_USE_ALTSTACK") != 0)
-+  if (__secure_getenv ("SEGFAULT_USE_ALTSTACK") != 0)
-     {
-       void *stack_mem = malloc (2 * SIGSTKSZ);
-       struct sigaltstack ss;
-@@ -203,7 +203,7 @@
-     }
-   /* Preserve the output file name if there is any given.  */
--  name = getenv ("SEGFAULT_OUTPUT_NAME");
-+  name = __secure_getenv ("SEGFAULT_OUTPUT_NAME");
-   if (name != NULL && name[0] != '\0')
-     {
-       int ret = access (name, R_OK | W_OK);
-diff -Naur glibc-2.8-20080929.orig/elf/Versions glibc-2.8-20080929/elf/Versions
---- glibc-2.8-20080929.orig/elf/Versions       2008-03-08 05:42:26.000000000 +0000
-+++ glibc-2.8-20080929/elf/Versions    2008-10-15 00:30:49.000000000 +0000
-@@ -60,6 +60,8 @@
-     _dl_make_stack_executable;
-     # Only here for gdb while a better method is developed.
-     _dl_debug_state;
-+    # For sanitizing environment.
-+    __libc_security_mask;
-     # Pointer protection.
-     __pointer_chk_guard;
-   }
-diff -Naur glibc-2.8-20080929.orig/elf/dl-support.c glibc-2.8-20080929/elf/dl-support.c
---- glibc-2.8-20080929.orig/elf/dl-support.c   2007-06-20 03:18:16.000000000 +0000
-+++ glibc-2.8-20080929/elf/dl-support.c        2008-10-15 00:30:49.000000000 +0000
-@@ -163,6 +163,7 @@
- internal_function
- _dl_aux_init (ElfW(auxv_t) *av)
- {
-+  int security_mask = 0;
-   int seen = 0;
-   uid_t uid = 0;
-   gid_t gid = 0;
-@@ -196,25 +197,27 @@
-       break;
- #endif
-       case AT_UID:
-+      if (seen & 1) break;
-       uid ^= av->a_un.a_val;
-       seen |= 1;
-       break;
-       case AT_EUID:
-+      if (seen & 2) break;
-       uid ^= av->a_un.a_val;
-       seen |= 2;
-       break;
-       case AT_GID:
-+      if (seen & 4) break;
-       gid ^= av->a_un.a_val;
-       seen |= 4;
-       break;
-       case AT_EGID:
-+      if (seen & 8) break;
-       gid ^= av->a_un.a_val;
-       seen |= 8;
-       break;
-       case AT_SECURE:
--      seen = -1;
--      __libc_enable_secure = av->a_un.a_val;
--      __libc_enable_secure_decided = 1;
-+      security_mask |= av->a_un.a_val != 0;
-       break;
- # ifdef DL_PLATFORM_AUXV
-       DL_PLATFORM_AUXV
-@@ -222,7 +225,9 @@
-       }
-   if (seen == 0xf)
-     {
--      __libc_enable_secure = uid != 0 || gid != 0;
-+      security_mask |= ((uid != 0) << 1) | ((gid != 0) << 2);
-+      __libc_security_mask = security_mask;
-+      __libc_enable_secure = __libc_security_mask != 0;
-       __libc_enable_secure_decided = 1;
-     }
- }
-@@ -239,19 +244,19 @@
-   if (!_dl_pagesize)
-     _dl_pagesize = __getpagesize ();
--  _dl_verbose = *(getenv ("LD_WARN") ?: "") == '\0' ? 0 : 1;
-+  _dl_verbose = *(__secure_getenv ("LD_WARN") ?: "") == '\0' ? 0 : 1;
-   /* Initialize the data structures for the search paths for shared
-      objects.  */
--  _dl_init_paths (getenv ("LD_LIBRARY_PATH"));
-+  _dl_init_paths (__secure_getenv ("LD_LIBRARY_PATH"));
--  _dl_lazy = *(getenv ("LD_BIND_NOW") ?: "") == '\0';
-+  _dl_lazy = *(__secure_getenv ("LD_BIND_NOW") ?: "") == '\0';
--  _dl_bind_not = *(getenv ("LD_BIND_NOT") ?: "") != '\0';
-+  _dl_bind_not = *(__secure_getenv ("LD_BIND_NOT") ?: "") != '\0';
--  _dl_dynamic_weak = *(getenv ("LD_DYNAMIC_WEAK") ?: "") == '\0';
-+  _dl_dynamic_weak = *(__secure_getenv ("LD_DYNAMIC_WEAK") ?: "") == '\0';
--  _dl_profile_output = getenv ("LD_PROFILE_OUTPUT");
-+  _dl_profile_output = __secure_getenv ("LD_PROFILE_OUTPUT");
-   if (_dl_profile_output == NULL || _dl_profile_output[0] == '\0')
-     _dl_profile_output
-       = &"/var/tmp\0/var/profile"[__libc_enable_secure ? 9 : 0];
-@@ -264,6 +269,8 @@
-       EXTRA_UNSECURE_ENVVARS
- #endif
-       ;
-+      static const char restricted_envvars[] =
-+      RESTRICTED_ENVVARS;
-       const char *cp = unsecure_envvars;
-       while (cp < unsecure_envvars + sizeof (unsecure_envvars))
-@@ -272,8 +279,31 @@
-         cp = (const char *) __rawmemchr (cp, '\0') + 1;
-       }
--      if (__access ("/etc/suid-debug", F_OK) != 0)
--      __unsetenv ("MALLOC_CHECK_");
-+      if (__libc_security_mask & 2)
-+      {
-+        static const char unsecure_uid_envvars[] =
-+          UNSECURE_UID_ENVVARS;
-+
-+        cp = unsecure_uid_envvars;
-+        while (cp < unsecure_uid_envvars + sizeof (unsecure_uid_envvars))
-+          {
-+            __unsetenv (cp);
-+            cp = (const char *) __rawmemchr (cp, '\0') + 1;
-+          }
-+      }
-+
-+      /* This loop is buggy: it will only check the first occurrence of each
-+       variable (but will correctly remove all in case of a match).  This
-+       may be a problem if the list is later re-ordered or accessed by an
-+       application with something other than the glibc getenv().  */
-+      cp = restricted_envvars;
-+      while (cp < restricted_envvars + sizeof (restricted_envvars))
-+      {
-+        const char *value = getenv (cp);
-+        if (value && (value[0] == '.' || strchr(value, '/')))
-+          __unsetenv (cp);
-+        cp = (const char *) __rawmemchr (cp, '\0') + 1;
-+      }
-     }
- #ifdef DL_PLATFORM_INIT
-diff -Naur glibc-2.8-20080929.orig/elf/dl-sysdep.c glibc-2.8-20080929/elf/dl-sysdep.c
---- glibc-2.8-20080929.orig/elf/dl-sysdep.c    2008-03-08 07:28:36.000000000 +0000
-+++ glibc-2.8-20080929/elf/dl-sysdep.c 2008-10-15 00:30:49.000000000 +0000
-@@ -54,8 +54,10 @@
- #ifdef NEED_DL_BASE_ADDR
- ElfW(Addr) _dl_base_addr;
- #endif
--int __libc_enable_secure attribute_relro = 0;
-+int __libc_enable_secure attribute_relro = 1;
- INTVARDEF(__libc_enable_secure)
-+int __libc_security_mask attribute_relro = 0x7fffffff;
-+INTVARDEF(__libc_security_mask)
- int __libc_multiple_libcs = 0;        /* Defining this here avoids the inclusion
-                                  of init-first.  */
- /* This variable contains the lowest stack address ever used.  */
-@@ -80,6 +82,10 @@
- # define DL_STACK_END(cookie) ((void *) (cookie))
- #endif
-+#ifdef HAVE_AUX_XID
-+#undef HAVE_AUX_XID
-+#endif
-+
- ElfW(Addr)
- _dl_sysdep_start (void **start_argptr,
-                 void (*dl_main) (const ElfW(Phdr) *phdr, ElfW(Word) phnum,
-@@ -89,19 +95,19 @@
-   ElfW(Word) phnum = 0;
-   ElfW(Addr) user_entry;
-   ElfW(auxv_t) *av;
--#ifdef HAVE_AUX_SECURE
-+  int security_mask = 0;
-+#if 0
- # define set_seen(tag) (tag)  /* Evaluate for the side effects.  */
--# define set_seen_secure() ((void) 0)
- #else
-   uid_t uid = 0;
-   gid_t gid = 0;
-   unsigned int seen = 0;
--# define set_seen_secure() (seen = -1)
- # ifdef HAVE_AUX_XID
- #  define set_seen(tag) (tag) /* Evaluate for the side effects.  */
- # else
- #  define M(type) (1 << (type))
- #  define set_seen(tag) seen |= M ((tag)->a_type)
-+#  define is_seen(tag) seen & M ((tag)->a_type)
- # endif
- #endif
- #ifdef NEED_DL_SYSINFO
-@@ -135,21 +141,18 @@
-       _dl_base_addr = av->a_un.a_val;
-       break;
- #endif
--#ifndef HAVE_AUX_SECURE
-       case AT_UID:
-       case AT_EUID:
-+      if (is_seen (av)) break;
-       uid ^= av->a_un.a_val;
-       break;
-       case AT_GID:
-       case AT_EGID:
-+      if (is_seen (av)) break;
-       gid ^= av->a_un.a_val;
-       break;
--#endif
-       case AT_SECURE:
--#ifndef HAVE_AUX_SECURE
--      seen = -1;
--#endif
--      INTUSE(__libc_enable_secure) = av->a_un.a_val;
-+      security_mask |= av->a_un.a_val != 0;
-       break;
-       case AT_PLATFORM:
-       GLRO(dl_platform) = (void *) av->a_un.a_val;
-@@ -178,8 +181,6 @@
- #endif
-       }
--#ifndef HAVE_AUX_SECURE
--  if (seen != -1)
-     {
-       /* Fill in the values we have not gotten from the kernel through the
-        auxiliary vector.  */
-@@ -191,12 +192,12 @@
-       SEE (GID, gid, gid);
-       SEE (EGID, gid, egid);
- # endif
--
--      /* If one of the two pairs of IDs does not match this is a setuid
--       or setgid run.  */
--      INTUSE(__libc_enable_secure) = uid | gid;
-     }
--#endif
-+  /* If one of the two pairs of IDs does not match
-+     this is a setuid or setgid run.  */
-+  security_mask |= ((uid != 0) << 1) | ((gid != 0) << 2);
-+  INTUSE(__libc_security_mask) = security_mask;
-+  INTUSE(__libc_enable_secure) = security_mask != 0;
- #ifndef HAVE_AUX_PAGESIZE
-   if (GLRO(dl_pagesize) == 0)
-diff -Naur glibc-2.8-20080929.orig/elf/enbl-secure.c glibc-2.8-20080929/elf/enbl-secure.c
---- glibc-2.8-20080929.orig/elf/enbl-secure.c  2005-12-14 08:46:07.000000000 +0000
-+++ glibc-2.8-20080929/elf/enbl-secure.c       2008-10-15 00:30:49.000000000 +0000
-@@ -27,11 +27,17 @@
- int __libc_enable_secure_decided;
- /* Safest assumption, if somehow the initializer isn't run.  */
- int __libc_enable_secure = 1;
-+int __libc_security_mask = 0x7fffffff;
- void
- __libc_init_secure (void)
- {
-   if (__libc_enable_secure_decided == 0)
--    __libc_enable_secure = (__geteuid () != __getuid ()
--                          || __getegid () != __getgid ());
-+    {
-+      __libc_security_mask =
-+      ((__geteuid () != __getuid ()) << 1) |
-+      ((__getegid () != __getgid ()) << 2);
-+      __libc_enable_secure = __libc_security_mask != 0;
-+      __libc_security_mask |= __libc_enable_secure;
-+    }
- }
-diff -Naur glibc-2.8-20080929.orig/elf/rtld.c glibc-2.8-20080929/elf/rtld.c
---- glibc-2.8-20080929.orig/elf/rtld.c 2008-03-08 07:29:40.000000000 +0000
-+++ glibc-2.8-20080929/elf/rtld.c      2008-10-15 00:30:49.000000000 +0000
-@@ -2500,6 +2500,7 @@
-   GLRO(dl_profile_output)
-     = &"/var/tmp\0/var/profile"[INTUSE(__libc_enable_secure) ? 9 : 0];
-+  if (__builtin_expect (!INTUSE(__libc_enable_secure), 1))
-   while ((envline = _dl_next_ld_env_entry (&runp)) != NULL)
-     {
-       size_t len = 0;
-@@ -2566,8 +2567,7 @@
-       case 9:
-         /* Test whether we want to see the content of the auxiliary
-            array passed up from the kernel.  */
--        if (!INTUSE(__libc_enable_secure)
--            && memcmp (envline, "SHOW_AUXV", 9) == 0)
-+        if (memcmp (envline, "SHOW_AUXV", 9) == 0)
-           _dl_show_auxv ();
-         break;
-@@ -2580,8 +2580,7 @@
-       case 11:
-         /* Path where the binary is found.  */
--        if (!INTUSE(__libc_enable_secure)
--            && memcmp (envline, "ORIGIN_PATH", 11) == 0)
-+        if (memcmp (envline, "ORIGIN_PATH", 11) == 0)
-           GLRO(dl_origin_path) = &envline[12];
-         break;
-@@ -2600,8 +2599,7 @@
-             break;
-           }
--        if (!INTUSE(__libc_enable_secure)
--            && memcmp (envline, "DYNAMIC_WEAK", 12) == 0)
-+        if (memcmp (envline, "DYNAMIC_WEAK", 12) == 0)
-           GLRO(dl_dynamic_weak) = 1;
-         break;
-@@ -2611,8 +2609,7 @@
- #ifdef EXTRA_LD_ENVVARS_13
-         EXTRA_LD_ENVVARS_13
- #endif
--        if (!INTUSE(__libc_enable_secure)
--            && memcmp (envline, "USE_LOAD_BIAS", 13) == 0)
-+        if (memcmp (envline, "USE_LOAD_BIAS", 13) == 0)
-           {
-             GLRO(dl_use_load_bias) = envline[14] == '1' ? -1 : 0;
-             break;
-@@ -2624,8 +2621,7 @@
-       case 14:
-         /* Where to place the profiling data file.  */
--        if (!INTUSE(__libc_enable_secure)
--            && memcmp (envline, "PROFILE_OUTPUT", 14) == 0
-+        if (memcmp (envline, "PROFILE_OUTPUT", 14) == 0
-             && envline[15] != '\0')
-           GLRO(dl_profile_output) = &envline[15];
-         break;
-@@ -2669,16 +2665,39 @@
-       EXTRA_UNSECURE_ENVVARS
- #endif
-       UNSECURE_ENVVARS;
-+      static const char restricted_envvars[] =
-+      RESTRICTED_ENVVARS;
-       const char *nextp;
--      nextp = unsecure_envvars;
--      do
-+      for (nextp = unsecure_envvars; *nextp != '\0';
-+         nextp = (char *) rawmemchr (nextp, '\0') + 1)
-       {
-         unsetenv (nextp);
--        /* We could use rawmemchr but this need not be fast.  */
--        nextp = (char *) (strchr) (nextp, '\0') + 1;
-       }
--      while (*nextp != '\0');
-+
-+      if (__builtin_expect (INTUSE(__libc_security_mask) & 2, 0))
-+      {
-+        static const char unsecure_uid_envvars[] =
-+          UNSECURE_UID_ENVVARS;
-+
-+        for (nextp = unsecure_uid_envvars; *nextp != '\0';
-+             nextp = (char *) rawmemchr (nextp, '\0') + 1)
-+          {
-+            unsetenv (nextp);
-+          }
-+      }
-+
-+      /* This loop is buggy: it will only check the first occurrence of each
-+       variable (but will correctly remove all in case of a match).  This
-+       may be a problem if the list is later re-ordered or accessed by an
-+       application with something other than the glibc getenv().  */
-+      for (nextp = restricted_envvars; *nextp != '\0';
-+         nextp = (char *) rawmemchr (nextp, '\0') + 1)
-+      {
-+        const char *value = getenv (nextp);
-+        if (value && (value[0] == '.' || strchr(value, '/')))
-+          unsetenv (nextp);
-+      }
-       if (__access ("/etc/suid-debug", F_OK) != 0)
-         {
-diff -Naur glibc-2.8-20080929.orig/gmon/gmon.c glibc-2.8-20080929/gmon/gmon.c
---- glibc-2.8-20080929.orig/gmon/gmon.c        2008-03-19 06:43:31.000000000 +0000
-+++ glibc-2.8-20080929/gmon/gmon.c     2008-10-15 00:30:49.000000000 +0000
-@@ -326,8 +326,8 @@
- # define O_NOFOLLOW   0
- #endif
--    env = getenv ("GMON_OUT_PREFIX");
--    if (env != NULL && !__libc_enable_secure)
-+    env = __secure_getenv ("GMON_OUT_PREFIX");
-+    if (env != NULL)
-       {
-       size_t len = strlen (env);
-       char buf[len + 20];
-diff -Naur glibc-2.8-20080929.orig/iconv/gconv_cache.c glibc-2.8-20080929/iconv/gconv_cache.c
---- glibc-2.8-20080929.orig/iconv/gconv_cache.c        2007-07-28 19:00:25.000000000 +0000
-+++ glibc-2.8-20080929/iconv/gconv_cache.c     2008-10-15 00:30:49.000000000 +0000
-@@ -55,7 +55,7 @@
-   /* We cannot use the cache if the GCONV_PATH environment variable is
-      set.  */
--  __gconv_path_envvar = getenv ("GCONV_PATH");
-+  __gconv_path_envvar = __secure_getenv ("GCONV_PATH");
-   if (__gconv_path_envvar != NULL)
-     return -1;
-diff -Naur glibc-2.8-20080929.orig/include/unistd.h glibc-2.8-20080929/include/unistd.h
---- glibc-2.8-20080929.orig/include/unistd.h   2006-07-31 05:57:52.000000000 +0000
-+++ glibc-2.8-20080929/include/unistd.h        2008-10-15 00:30:49.000000000 +0000
-@@ -142,10 +142,12 @@
-    and some functions contained in the C library ignore various
-    environment variables that normally affect them.  */
- extern int __libc_enable_secure attribute_relro;
-+extern int __libc_security_mask attribute_relro;
- extern int __libc_enable_secure_decided;
- #ifdef IS_IN_rtld
- /* XXX The #ifdef should go.  */
- extern int __libc_enable_secure_internal attribute_relro attribute_hidden;
-+extern int __libc_security_mask_internal attribute_relro attribute_hidden;
- #endif
-diff -Naur glibc-2.8-20080929.orig/intl/dcigettext.c glibc-2.8-20080929/intl/dcigettext.c
---- glibc-2.8-20080929.orig/intl/dcigettext.c  2008-03-31 00:37:17.000000000 +0000
-+++ glibc-2.8-20080929/intl/dcigettext.c       2008-10-15 00:30:49.000000000 +0000
-@@ -1391,7 +1391,7 @@
-       if (!output_charset_cached)
-       {
--        const char *value = getenv ("OUTPUT_CHARSET");
-+        const char *value = __secure_getenv ("OUTPUT_CHARSET");
-         if (value != NULL && value[0] != '\0')
-           {
-diff -Naur glibc-2.8-20080929.orig/io/getdirname.c glibc-2.8-20080929/io/getdirname.c
---- glibc-2.8-20080929.orig/io/getdirname.c    2001-07-06 04:54:53.000000000 +0000
-+++ glibc-2.8-20080929/io/getdirname.c 2008-10-15 00:30:49.000000000 +0000
-@@ -31,7 +31,7 @@
-   char *pwd;
-   struct stat64 dotstat, pwdstat;
--  pwd = getenv ("PWD");
-+  pwd = __secure_getenv ("PWD");
-   if (pwd != NULL
-       && stat64 (".", &dotstat) == 0
-       && stat64 (pwd, &pwdstat) == 0
-diff -Naur glibc-2.8-20080929.orig/libidn/toutf8.c glibc-2.8-20080929/libidn/toutf8.c
---- glibc-2.8-20080929.orig/libidn/toutf8.c    2005-02-22 01:25:30.000000000 +0000
-+++ glibc-2.8-20080929/libidn/toutf8.c 2008-10-15 00:30:49.000000000 +0000
-@@ -74,7 +74,7 @@
- const char *
- stringprep_locale_charset (void)
- {
--  const char *charset = getenv ("CHARSET");   /* flawfinder: ignore */
-+  const char *charset = __secure_getenv ("CHARSET");
-   if (charset && *charset)
-     return charset;
-diff -Naur glibc-2.8-20080929.orig/locale/newlocale.c glibc-2.8-20080929/locale/newlocale.c
---- glibc-2.8-20080929.orig/locale/newlocale.c 2008-03-31 00:37:03.000000000 +0000
-+++ glibc-2.8-20080929/locale/newlocale.c      2008-10-15 00:30:49.000000000 +0000
-@@ -104,7 +104,7 @@
-   locale_path = NULL;
-   locale_path_len = 0;
--  locpath_var = getenv ("LOCPATH");
-+  locpath_var = __secure_getenv ("LOCPATH");
-   if (locpath_var != NULL && locpath_var[0] != '\0')
-     {
-       if (__argz_create_sep (locpath_var, ':',
-diff -Naur glibc-2.8-20080929.orig/locale/setlocale.c glibc-2.8-20080929/locale/setlocale.c
---- glibc-2.8-20080929.orig/locale/setlocale.c 2008-03-31 00:37:03.000000000 +0000
-+++ glibc-2.8-20080929/locale/setlocale.c      2008-10-15 00:30:49.000000000 +0000
-@@ -246,7 +246,7 @@
-   locale_path = NULL;
-   locale_path_len = 0;
--  locpath_var = getenv ("LOCPATH");
-+  locpath_var = __secure_getenv ("LOCPATH");
-   if (locpath_var != NULL && locpath_var[0] != '\0')
-     {
-       if (__argz_create_sep (locpath_var, ':',
-diff -Naur glibc-2.8-20080929.orig/malloc/arena.c glibc-2.8-20080929/malloc/arena.c
---- glibc-2.8-20080929.orig/malloc/arena.c     2007-12-12 00:11:27.000000000 +0000
-+++ glibc-2.8-20080929/malloc/arena.c  2008-10-15 00:30:49.000000000 +0000
-@@ -494,10 +494,10 @@
- #  undef NO_STARTER
- # endif
- #endif
-+  s = NULL;
- #ifdef _LIBC
-   secure = __libc_enable_secure;
--  s = NULL;
--  if (__builtin_expect (_environ != NULL, 1))
-+  if (! secure && __builtin_expect (_environ != NULL, 1))
-     {
-       char **runp = _environ;
-       char *envline;
-@@ -520,26 +520,20 @@
-               s = &envline[7];
-             break;
-           case 8:
--            if (! secure)
--              {
-                 if (memcmp (envline, "TOP_PAD_", 8) == 0)
-                   mALLOPt(M_TOP_PAD, atoi(&envline[9]));
-                 else if (memcmp (envline, "PERTURB_", 8) == 0)
-                   mALLOPt(M_PERTURB, atoi(&envline[9]));
--              }
-             break;
-           case 9:
--            if (! secure && memcmp (envline, "MMAP_MAX_", 9) == 0)
-+            if (memcmp (envline, "MMAP_MAX_", 9) == 0)
-               mALLOPt(M_MMAP_MAX, atoi(&envline[10]));
-             break;
-           case 15:
--            if (! secure)
--              {
-                 if (memcmp (envline, "TRIM_THRESHOLD_", 15) == 0)
-                   mALLOPt(M_TRIM_THRESHOLD, atoi(&envline[16]));
-                 else if (memcmp (envline, "MMAP_THRESHOLD_", 15) == 0)
-                   mALLOPt(M_MMAP_THRESHOLD, atoi(&envline[16]));
--              }
-             break;
-           default:
-             break;
-diff -Naur glibc-2.8-20080929.orig/malloc/memusage.c glibc-2.8-20080929/malloc/memusage.c
---- glibc-2.8-20080929.orig/malloc/memusage.c  2006-12-08 17:13:24.000000000 +0000
-+++ glibc-2.8-20080929/malloc/memusage.c       2008-10-15 00:30:49.000000000 +0000
-@@ -214,7 +214,7 @@
- static void
- me (void)
- {
--  const char *env = getenv ("MEMUSAGE_PROG_NAME");
-+  const char *env = __secure_getenv ("MEMUSAGE_PROG_NAME");
-   size_t prog_len = strlen (__progname);
-   initialized = -1;
-@@ -250,7 +250,7 @@
-       if (!start_sp)
-       start_sp = GETSP ();
--      outname = getenv ("MEMUSAGE_OUTPUT");
-+      outname = __secure_getenv ("MEMUSAGE_OUTPUT");
-       if (outname != NULL && outname[0] != '\0'
-         && (access (outname, R_OK | W_OK) == 0 || errno == ENOENT))
-       {
-@@ -273,7 +273,7 @@
-             /* Determine the buffer size.  We use the default if the
-                environment variable is not present.  */
-             buffer_size = DEFAULT_BUFFER_SIZE;
--            if (getenv ("MEMUSAGE_BUFFER_SIZE") != NULL)
-+            if (__secure_getenv ("MEMUSAGE_BUFFER_SIZE") != NULL)
-               {
-                 buffer_size = atoi (getenv ("MEMUSAGE_BUFFER_SIZE"));
-                 if (buffer_size == 0 || buffer_size > DEFAULT_BUFFER_SIZE)
-@@ -281,7 +281,7 @@
-               }
-             /* Possibly enable timer-based stack pointer retrieval.  */
--            if (getenv ("MEMUSAGE_NO_TIMER") == NULL)
-+            if (__secure_getenv ("MEMUSAGE_NO_TIMER") == NULL)
-               {
-                 struct sigaction act;
-@@ -302,7 +302,7 @@
-           }
-       }
--      if (!not_me && getenv ("MEMUSAGE_TRACE_MMAP") != NULL)
-+      if (!not_me && __secure_getenv ("MEMUSAGE_TRACE_MMAP") != NULL)
-       trace_mmap = true;
-     }
- }
-diff -Naur glibc-2.8-20080929.orig/nis/nis_defaults.c glibc-2.8-20080929/nis/nis_defaults.c
---- glibc-2.8-20080929.orig/nis/nis_defaults.c 2006-10-11 16:22:34.000000000 +0000
-+++ glibc-2.8-20080929/nis/nis_defaults.c      2008-10-15 00:30:49.000000000 +0000
-@@ -358,7 +358,7 @@
-   char *cptr = defaults;
-   if (cptr == NULL)
--    cptr = getenv ("NIS_DEFAULTS");
-+    cptr = __secure_getenv ("NIS_DEFAULTS");
-   if (cptr != NULL)
-     {
-@@ -385,7 +385,7 @@
-   char *cptr = defaults;
-   if (cptr == NULL)
--    cptr = getenv ("NIS_DEFAULTS");
-+    cptr = __secure_getenv ("NIS_DEFAULTS");
-   if (cptr != NULL)
-     {
-@@ -417,7 +417,7 @@
-       return searchttl (defaults);
-     }
--  cptr = getenv ("NIS_DEFAULTS");
-+  cptr = __secure_getenv ("NIS_DEFAULTS");
-   if (cptr == NULL)
-     return DEFAULT_TTL;
-@@ -445,7 +445,7 @@
-     result = searchaccess (param, result);
-   else
-     {
--      cptr = getenv ("NIS_DEFAULTS");
-+      cptr = __secure_getenv ("NIS_DEFAULTS");
-       if (cptr != NULL && strstr (cptr, "access=") != NULL)
-       result = searchaccess (cptr, result);
-     }
-diff -Naur glibc-2.8-20080929.orig/nis/nis_local_names.c glibc-2.8-20080929/nis/nis_local_names.c
---- glibc-2.8-20080929.orig/nis/nis_local_names.c      2006-04-07 06:52:01.000000000 +0000
-+++ glibc-2.8-20080929/nis/nis_local_names.c   2008-10-15 00:30:49.000000000 +0000
-@@ -30,7 +30,7 @@
-   char *cptr;
-   if (__nisgroup[0] == '\0'
--      && (cptr = getenv ("NIS_GROUP")) != NULL
-+      && (cptr = __secure_getenv ("NIS_GROUP")) != NULL
-       && strlen (cptr) < NIS_MAXNAMELEN)
-     {
-       char *cp = stpcpy (__nisgroup, cptr);
-diff -Naur glibc-2.8-20080929.orig/nis/nis_subr.c glibc-2.8-20080929/nis/nis_subr.c
---- glibc-2.8-20080929.orig/nis/nis_subr.c     2007-07-28 20:43:36.000000000 +0000
-+++ glibc-2.8-20080929/nis/nis_subr.c  2008-10-15 00:30:49.000000000 +0000
-@@ -178,7 +178,7 @@
-     }
-   /* Get the search path, where we have to search "name" */
--  path = getenv ("NIS_PATH");
-+  path = __secure_getenv ("NIS_PATH");
-   if (path == NULL)
-     path = strdupa ("$");
-   else
-diff -Naur glibc-2.8-20080929.orig/posix/execvp.c glibc-2.8-20080929/posix/execvp.c
---- glibc-2.8-20080929.orig/posix/execvp.c     2007-01-03 23:01:15.000000000 +0000
-+++ glibc-2.8-20080929/posix/execvp.c  2008-10-15 00:30:49.000000000 +0000
-@@ -90,7 +90,7 @@
-     {
-       size_t pathlen;
-       size_t alloclen = 0;
--      char *path = getenv ("PATH");
-+      char *path = __secure_getenv ("PATH");
-       if (path == NULL)
-       {
-         pathlen = confstr (_CS_PATH, (char *) NULL, 0);
-@@ -116,11 +116,11 @@
-       if (path == NULL)
-       {
-         /* There is no `PATH' in the environment.
--           The default search path is the current directory
--           followed by the path `confstr' returns for `_CS_PATH'.  */
-+           The default search path is what `confstr' returns
-+           for `_CS_PATH'.  */
-         path = name + pathlen + len + 1;
--        path[0] = ':';
--        (void) confstr (_CS_PATH, path + 1, pathlen);
-+        path[0] = '\0';
-+        (void) confstr (_CS_PATH, path, pathlen);
-       }
-       /* Copy the file name at the top.  */
-diff -Naur glibc-2.8-20080929.orig/posix/glob.c glibc-2.8-20080929/posix/glob.c
---- glibc-2.8-20080929.orig/posix/glob.c       2007-10-15 04:59:03.000000000 +0000
-+++ glibc-2.8-20080929/posix/glob.c    2008-10-15 00:30:49.000000000 +0000
-@@ -557,7 +557,7 @@
-             && (dirname[2] == '\0' || dirname[2] == '/')))
-       {
-         /* Look up home directory.  */
--        const char *home_dir = getenv ("HOME");
-+        const char *home_dir = __secure_getenv ("HOME");
- # ifdef _AMIGA
-         if (home_dir == NULL || home_dir[0] == '\0')
-           home_dir = "SYS:";
-diff -Naur glibc-2.8-20080929.orig/posix/wordexp.c glibc-2.8-20080929/posix/wordexp.c
---- glibc-2.8-20080929.orig/posix/wordexp.c    2007-01-25 00:43:39.000000000 +0000
-+++ glibc-2.8-20080929/posix/wordexp.c 2008-10-15 00:30:49.000000000 +0000
-@@ -320,7 +320,7 @@
-        results are unspecified.  We do a lookup on the uid if
-        HOME is unset. */
--      home = getenv ("HOME");
-+      home = __secure_getenv ("HOME");
-       if (home != NULL)
-       {
-         *word = w_addstr (*word, word_length, max_length, home);
-@@ -1493,7 +1493,7 @@
-       }
-     }
-   else
--    value = getenv (env);
-+    value = __secure_getenv (env);
-   if (value == NULL && (flags & WRDE_UNDEF))
-     {
-@@ -2262,7 +2262,7 @@
-   /* Find out what the field separators are.
-    * There are two types: whitespace and non-whitespace.
-    */
--  ifs = getenv ("IFS");
-+  ifs = __secure_getenv ("IFS");
-   if (ifs == NULL)
-     /* IFS unset - use <space><tab><newline>. */
-diff -Naur glibc-2.8-20080929.orig/resolv/res_hconf.c glibc-2.8-20080929/resolv/res_hconf.c
---- glibc-2.8-20080929.orig/resolv/res_hconf.c 2007-11-23 03:03:31.000000000 +0000
-+++ glibc-2.8-20080929/resolv/res_hconf.c      2008-10-15 00:30:49.000000000 +0000
-@@ -304,7 +304,7 @@
-   memset (&_res_hconf, '\0', sizeof (_res_hconf));
--  hconf_name = getenv (ENV_HOSTCONF);
-+  hconf_name = __secure_getenv (ENV_HOSTCONF);
-   if (hconf_name == NULL)
-     hconf_name = _PATH_HOSTCONF;
-@@ -323,23 +323,23 @@
-       fclose (fp);
-     }
--  envval = getenv (ENV_SPOOF);
-+  envval = __secure_getenv (ENV_SPOOF);
-   if (envval)
-     arg_spoof (ENV_SPOOF, 1, envval);
--  envval = getenv (ENV_MULTI);
-+  envval = __secure_getenv (ENV_MULTI);
-   if (envval)
-     arg_bool (ENV_MULTI, 1, envval, HCONF_FLAG_MULTI);
--  envval = getenv (ENV_REORDER);
-+  envval = __secure_getenv (ENV_REORDER);
-   if (envval)
-     arg_bool (ENV_REORDER, 1, envval, HCONF_FLAG_REORDER);
--  envval = getenv (ENV_TRIM_ADD);
-+  envval = __secure_getenv (ENV_TRIM_ADD);
-   if (envval)
-     arg_trimdomain_list (ENV_TRIM_ADD, 1, envval);
--  envval = getenv (ENV_TRIM_OVERR);
-+  envval = __secure_getenv (ENV_TRIM_OVERR);
-   if (envval)
-     {
-       _res_hconf.num_trimdomains = 0;
-diff -Naur glibc-2.8-20080929.orig/resolv/res_init.c glibc-2.8-20080929/resolv/res_init.c
---- glibc-2.8-20080929.orig/resolv/res_init.c  2008-04-07 17:20:25.000000000 +0000
-+++ glibc-2.8-20080929/resolv/res_init.c       2008-10-15 00:30:49.000000000 +0000
-@@ -201,7 +201,7 @@
- #endif
-       /* Allow user to override the local domain definition */
--      if ((cp = getenv("LOCALDOMAIN")) != NULL) {
-+      if ((cp = __secure_getenv("LOCALDOMAIN")) != NULL) {
-               (void)strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);
-               statp->defdname[sizeof(statp->defdname) - 1] = '\0';
-               haveenv++;
-@@ -470,7 +470,7 @@
- #endif /* !RFC1535 */
-       }
--      if ((cp = getenv("RES_OPTIONS")) != NULL)
-+      if ((cp = __secure_getenv("RES_OPTIONS")) != NULL)
-               res_setoptions(statp, cp, "env");
-       statp->options |= RES_INIT;
-       return (0);
-diff -Naur glibc-2.8-20080929.orig/resolv/res_query.c glibc-2.8-20080929/resolv/res_query.c
---- glibc-2.8-20080929.orig/resolv/res_query.c 2007-02-09 23:43:25.000000000 +0000
-+++ glibc-2.8-20080929/resolv/res_query.c      2008-10-15 00:30:49.000000000 +0000
-@@ -474,7 +474,7 @@
-       if (statp->options & RES_NOALIASES)
-               return (NULL);
--      file = getenv("HOSTALIASES");
-+      file = __secure_getenv("HOSTALIASES");
-       if (file == NULL || (fp = fopen(file, "r")) == NULL)
-               return (NULL);
-       setbuf(fp, NULL);
-diff -Naur glibc-2.8-20080929.orig/stdlib/fmtmsg.c glibc-2.8-20080929/stdlib/fmtmsg.c
---- glibc-2.8-20080929.orig/stdlib/fmtmsg.c    2006-05-15 18:41:18.000000000 +0000
-+++ glibc-2.8-20080929/stdlib/fmtmsg.c 2008-10-15 00:30:49.000000000 +0000
-@@ -205,8 +205,8 @@
- static void
- init (void)
- {
--  const char *msgverb_var = getenv ("MSGVERB");
--  const char *sevlevel_var = getenv ("SEV_LEVEL");
-+  const char *msgverb_var = __secure_getenv ("MSGVERB");
-+  const char *sevlevel_var = __secure_getenv ("SEV_LEVEL");
-   if (msgverb_var != NULL && msgverb_var[0] != '\0')
-     {
-diff -Naur glibc-2.8-20080929.orig/sunrpc/rpc_svcout.c glibc-2.8-20080929/sunrpc/rpc_svcout.c
---- glibc-2.8-20080929.orig/sunrpc/rpc_svcout.c        2005-11-21 15:43:03.000000000 +0000
-+++ glibc-2.8-20080929/sunrpc/rpc_svcout.c     2008-10-15 00:30:49.000000000 +0000
-@@ -897,7 +897,7 @@
-   f_print (fout, "\t\t_rpcpmstart = 1;\n");
-   if (logflag)
-     open_log_file (infile, "\t\t");
--  f_print (fout, "\t\tif ((netid = getenv(\"NLSPROVIDER\")) == NULL) {\n");
-+  f_print (fout, "\t\tif ((netid = __secure_getenv(\"NLSPROVIDER\")) == NULL) {\n");
-   sprintf (_errbuf, "cannot get transport name");
-   print_err_message ("\t\t\t");
-   f_print (fout, "\t\t} else if ((nconf = getnetconfigent(netid)) == NULL) {\n");
-diff -Naur glibc-2.8-20080929.orig/sysdeps/generic/unsecvars.h glibc-2.8-20080929/sysdeps/generic/unsecvars.h
---- glibc-2.8-20080929.orig/sysdeps/generic/unsecvars.h        2006-10-11 16:24:05.000000000 +0000
-+++ glibc-2.8-20080929/sysdeps/generic/unsecvars.h     2008-10-15 00:32:09.000000000 +0000
-@@ -2,25 +2,87 @@
-    all stuffed in a single string which means they have to be terminated
-    with a '\0' explicitly.  */
- #define UNSECURE_ENVVARS \
--  "GCONV_PATH\0"                                                            \
--  "GETCONF_DIR\0"                                                           \
--  "HOSTALIASES\0"                                                           \
--  "LD_AUDIT\0"                                                                      \
--  "LD_DEBUG\0"                                                                      \
--  "LD_DEBUG_OUTPUT\0"                                                       \
--  "LD_DYNAMIC_WEAK\0"                                                       \
--  "LD_LIBRARY_PATH\0"                                                       \
--  "LD_ORIGIN_PATH\0"                                                        \
--  "LD_PRELOAD\0"                                                            \
--  "LD_PROFILE\0"                                                            \
--  "LD_SHOW_AUXV\0"                                                          \
--  "LD_USE_LOAD_BIAS\0"                                                              \
--  "LOCALDOMAIN\0"                                                           \
--  "LOCPATH\0"                                                               \
--  "MALLOC_TRACE\0"                                                          \
--  "NIS_PATH\0"                                                                      \
--  "NLSPATH\0"                                                               \
--  "RESOLV_HOST_CONF\0"                                                              \
--  "RES_OPTIONS\0"                                                           \
--  "TMPDIR\0"                                                                \
-+  "ARGP_HELP_FMT\0"                                                   \
-+  "DATEMSK\0"                                                         \
-+  "GCONV_PATH\0"                                                      \
-+  "GETCONF_DIR\0"                                                     \
-+  "GMON_OUT_PREFIX\0"                                                 \
-+  "HESIOD_CONFIG\0"                                                   \
-+  "HES_DOMAIN\0"                                                      \
-+  "HOSTALIASES\0"                                                     \
-+  "LD_AUDIT\0"                                                                \
-+  "LD_BIND_NOT\0"                                                     \
-+  "LD_BIND_NOW\0"                                                     \
-+  "LD_DEBUG\0"                                                                \
-+  "LD_DEBUG_OUTPUT\0"                                                 \
-+  "LD_DYNAMIC_WEAK\0"                                                 \
-+  "LD_HWCAP_MASK\0"                                                   \
-+  "LD_LIBRARY_PATH\0"                                                 \
-+  "LD_ORIGIN_PATH\0"                                                  \
-+  "LD_POINTER_GUARD\0"                                                        \
-+  "LD_PRELOAD\0"                                                      \
-+  "LD_PROFILE\0"                                                      \
-+  "LD_PROFILE_OUTPUT\0"                                                       \
-+  "LD_SHOW_AUXV\0"                                                    \
-+  "LD_TRACE_LOADED_OBJECTS\0"                                         \
-+  "LD_TRACE_PRELINKING\0"                                             \
-+  "LD_USE_LOAD_BIAS\0"                                                        \
-+  "LD_VERBOSE\0"                                                      \
-+  "LD_WARN\0"                                                         \
-+  "LOCALDOMAIN\0"                                                     \
-+  "LOCPATH\0"                                                         \
-+  "MALLOC_CHECK_\0"                                                   \
-+  "MALLOC_MMAP_MAX_\0"                                                        \
-+  "MALLOC_MMAP_THRESHOLD_\0"                                          \
-+  "MALLOC_PERTURB_\0"                                                 \
-+  "MALLOC_TOP_PAD_\0"                                                 \
-+  "MALLOC_TRACE\0"                                                    \
-+  "MALLOC_TRIM_THRESHOLD_\0"                                          \
-+  "MEMUSAGE_BUFFER_SIZE\0"                                            \
-+  "MEMUSAGE_NO_TIMER\0"                                                       \
-+  "MEMUSAGE_OUTPUT\0"                                                 \
-+  "MEMUSAGE_PROG_NAME\0"                                              \
-+  "MEMUSAGE_TRACE_MMAP\0"                                             \
-+  "MSGVERB\0"                                                         \
-+  "MUDFLAP_OPTIONS\0"                                                 \
-+  "NIS_DEFAULTS\0"                                                    \
-+  "NIS_GROUP\0"                                                               \
-+  "NIS_PATH\0"                                                                \
-+  "NLSPATH\0"                                                         \
-+  "PCPROFILE_OUTPUT\0"                                                        \
-+  "POSIXLY_CORRECT\0"                                                 \
-+  "PWD\0"                                                             \
-+  "RESOLV_ADD_TRIM_DOMAINS\0"                                         \
-+  "RESOLV_HOST_CONF\0"                                                        \
-+  "RESOLV_MULTI\0"                                                    \
-+  "RESOLV_OVERRIDE_TRIM_DOMAINS\0"                                    \
-+  "RESOLV_REORDER\0"                                                  \
-+  "RESOLV_SPOOF_CHECK\0"                                              \
-+  "RES_OPTIONS\0"                                                     \
-+  "SEGFAULT_OUTPUT_NAME\0"                                            \
-+  "SEGFAULT_SIGNALS\0"                                                        \
-+  "SEGFAULT_USE_ALTSTACK\0"                                           \
-+  "SEV_LEVEL\0"                                                               \
-+  "TZ\0"                                                              \
-   "TZDIR\0"
-+
-+#define UNSECURE_UID_ENVVARS \
-+  "TMPDIR\0"
-+
-+#define RESTRICTED_ENVVARS \
-+  "LANG\0"                                                            \
-+  "LANGUAGE\0"                                                                \
-+  "LC_ADDRESS\0"                                                      \
-+  "LC_ALL\0"                                                          \
-+  "LC_COLLATE\0"                                                      \
-+  "LC_CTYPE\0"                                                                \
-+  "LC_IDENTIFICATION\0"                                                       \
-+  "LC_MEASUREMENT\0"                                                  \
-+  "LC_MESSAGES\0"                                                     \
-+  "LC_MONETARY\0"                                                     \
-+  "LC_NAME\0"                                                         \
-+  "LC_NUMERIC\0"                                                      \
-+  "LC_PAPER\0"                                                                \
-+  "LC_TELEPHONE\0"                                                    \
-+  "LC_TIME\0"                                                         \
-+  "LC_XXX\0"
-diff -Naur glibc-2.8-20080929.orig/sysdeps/posix/spawni.c glibc-2.8-20080929/sysdeps/posix/spawni.c
---- glibc-2.8-20080929.orig/sysdeps/posix/spawni.c     2006-06-04 22:16:05.000000000 +0000
-+++ glibc-2.8-20080929/sysdeps/posix/spawni.c  2008-10-15 00:30:49.000000000 +0000
-@@ -227,16 +227,15 @@
-     }
-   /* We have to search for FILE on the path.  */
--  path = getenv ("PATH");
-+  path = __secure_getenv ("PATH");
-   if (path == NULL)
-     {
-       /* There is no `PATH' in the environment.
--       The default search path is the current directory
--       followed by the path `confstr' returns for `_CS_PATH'.  */
-+       The default search path is ehat `confstr' returns
-+       for `_CS_PATH'.  */
-       len = confstr (_CS_PATH, (char *) NULL, 0);
--      path = (char *) __alloca (1 + len);
--      path[0] = ':';
--      (void) confstr (_CS_PATH, path + 1, len);
-+      path = (char *) __alloca (len);
-+      (void) confstr (_CS_PATH, path, len);
-     }
-   len = strlen (file) + 1;
-diff -Naur glibc-2.8-20080929.orig/sysdeps/unix/sysv/linux/dl-librecon.h glibc-2.8-20080929/sysdeps/unix/sysv/linux/dl-librecon.h
---- glibc-2.8-20080929.orig/sysdeps/unix/sysv/linux/dl-librecon.h      2004-03-05 10:14:48.000000000 +0000
-+++ glibc-2.8-20080929/sysdeps/unix/sysv/linux/dl-librecon.h   2008-10-15 00:30:49.000000000 +0000
-@@ -53,7 +53,7 @@
- #define DL_OSVERSION_INIT \
-   do {                                                                              \
--    char *assume_kernel = getenv ("LD_ASSUME_KERNEL");                              \
-+    char *assume_kernel = __secure_getenv ("LD_ASSUME_KERNEL");                     \
-     if (assume_kernel)                                                              \
-       _dl_osversion_init (assume_kernel);                                   \
-   } while (0)
-diff -Naur glibc-2.8-20080929.orig/sysdeps/unix/sysv/linux/i386/dl-librecon.h glibc-2.8-20080929/sysdeps/unix/sysv/linux/i386/dl-librecon.h
---- glibc-2.8-20080929.orig/sysdeps/unix/sysv/linux/i386/dl-librecon.h 2004-10-14 01:53:55.000000000 +0000
-+++ glibc-2.8-20080929/sysdeps/unix/sysv/linux/i386/dl-librecon.h      2008-10-15 00:30:49.000000000 +0000
-@@ -57,6 +57,7 @@
- /* Extra unsecure variables.  The names are all stuffed in a single
-    string which means they have to be terminated with a '\0' explicitly.  */
- #define EXTRA_UNSECURE_ENVVARS \
-+  "LD_LIBRARY_VERSION\0"                                                    \
-   "LD_AOUT_LIBRARY_PATH\0"                                                  \
-   "LD_AOUT_PRELOAD\0"
-diff -Naur glibc-2.8-20080929.orig/time/getdate.c glibc-2.8-20080929/time/getdate.c
---- glibc-2.8-20080929.orig/time/getdate.c     2007-12-10 01:40:43.000000000 +0000
-+++ glibc-2.8-20080929/time/getdate.c  2008-10-15 00:30:49.000000000 +0000
-@@ -115,7 +115,7 @@
-   struct stat64 st;
-   int mday_ok = 0;
--  datemsk = getenv ("DATEMSK");
-+  datemsk = __secure_getenv ("DATEMSK");
-   if (datemsk == NULL || *datemsk == '\0')
-     return 1;
-diff -Naur glibc-2.8-20080929.orig/time/tzfile.c glibc-2.8-20080929/time/tzfile.c
---- glibc-2.8-20080929.orig/time/tzfile.c      2007-11-06 01:03:43.000000000 +0000
-+++ glibc-2.8-20080929/time/tzfile.c   2008-10-15 00:30:49.000000000 +0000
-@@ -149,7 +149,7 @@
-       unsigned int len, tzdir_len;
-       char *new, *tmp;
--      tzdir = getenv ("TZDIR");
-+      tzdir = __secure_getenv ("TZDIR");
-       if (tzdir == NULL || *tzdir == '\0')
-       {
-         tzdir = default_tzdir;
-diff -Naur glibc-2.8-20080929.orig/time/tzset.c glibc-2.8-20080929/time/tzset.c
---- glibc-2.8-20080929.orig/time/tzset.c       2008-03-19 06:43:34.000000000 +0000
-+++ glibc-2.8-20080929/time/tzset.c    2008-10-15 00:30:49.000000000 +0000
-@@ -383,8 +383,11 @@
-     return;
-   is_initialized = 1;
--  /* Examine the TZ environment variable.  */
--  tz = getenv ("TZ");
-+  /* Examine the TZ environment variable.  This doesn't really have to be
-+     a __secure_getenv() call as __tzfile_read() tries to only read files
-+     found under a trusted directory, but this helps reduce the amount of
-+     security-critical code.  */
-+  tz = __secure_getenv ("TZ");
-   if (tz == NULL && !explicit)
-     /* Use the site-wide default.  This is a file name which means we
-        would not see changes to the file if we compare only the file
diff --git a/glibc/patches/glibc-2.14-arm-hardened.patch0 b/glibc/patches/glibc-2.14-arm-hardened.patch0
new file mode 100644 (file)
index 0000000..0a1080a
--- /dev/null
@@ -0,0 +1,48 @@
+patch by David Lamparter to fix build errors for hardened/arm systems.
+the logic in setjmp/__longjmp incorrectly tie to "PIC" to figure out
+whether the code is going into a shared library when it should be using
+"SHARED".  otherwise, building static PIC code goes wrong.
+
+https://bugs.gentoo.org/336914
+http://sourceware.org/ml/libc-ports/2011-09/msg00018.html
+
+--- ports/sysdeps/arm/eabi/setjmp.S
++++ ports/sysdeps/arm/eabi/setjmp.S
+@@ -37,7 +37,7 @@
+       add     a3, a3, a4
+       ldr     a3, [a3, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET]
+ #else
+-#ifdef PIC
++#ifdef SHARED
+       ldr     a3, 1f
+       ldr     a4, Lrtld_global_ro
+ 0:    add     a3, pc, a3
+@@ -84,7 +84,7 @@
+ Lrtld_local_ro:
+       .long   C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF)
+ #else
+-#ifdef PIC
++#ifdef SHARED
+ 1:    .long   _GLOBAL_OFFSET_TABLE_ - 0b - 8
+ Lrtld_global_ro:
+       .long   C_SYMBOL_NAME(_rtld_global_ro)(GOT)
+--- ports/sysdeps/arm/eabi/__longjmp.S
++++ ports/sysdeps/arm/eabi/__longjmp.S
+@@ -43,7 +43,7 @@
+       add     a2, a2, a3
+       ldr     a2, [a2, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET]
+ #else
+-#ifdef PIC
++#ifdef SHARED
+       ldr     a2, 1f
+       ldr     a3, Lrtld_global_ro
+ 0:    add     a2, pc, a2
+@@ -87,7 +87,7 @@
+ Lrtld_local_ro:
+       .long   C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF)
+ #else
+-#ifdef PIC
++#ifdef SHARED
+ 1:    .long   _GLOBAL_OFFSET_TABLE_ - 0b - 8
+ Lrtld_global_ro:
+       .long   C_SYMBOL_NAME(_rtld_global_ro)(GOT)
index 730e1f4c7893a1f8e6d655ecd6f406c12bb5f592..6348b9f2747fd6cb4f2e3a152a6d34ddc4de9d39 100644 (file)
@@ -4,8 +4,10 @@
 ###############################################################################
 
 name       = gmp
-version    = 5.0.1
-release    = 0
+version    = 5.0.2
+release    = 1
+
+compat_version = 4.3.2
 
 groups     = System/Libraries
 url        = http://gmplib.org/
@@ -13,17 +15,17 @@ license    = LGPLv3+
 summary    = A GNU arbitrary precision library.
 
 description
-       The gmp package contains GNU MP, a library for arbitrary precision \
-       arithmetic, signed integers operations, rational numbers and floating \
-       point numbers. GNU MP is designed for speed, for both small and very \
-       large operands. GNU MP is fast because it uses fullwords as the basic \
-       arithmetic type, it uses fast algorithms, it carefully optimizes \
-       assembly code for many CPUs' most common inner loops, and it generally \
+       The gmp package contains GNU MP, a library for arbitrary precision
+       arithmetic, signed integers operations, rational numbers and floating
+       point numbers. GNU MP is designed for speed, for both small and very
+       large operands. GNU MP is fast because it uses fullwords as the basic
+       arithmetic type, it uses fast algorithms, it carefully optimizes
+       assembly code for many CPUs' most common inner loops, and it generally
        emphasizes speed over simplicity/elegance in its operations.
 end
 
-source_dl  =
-sources    = %{thisapp}.tar.bz2
+source_dl += ftp://ftp.gmplib.org/pub/%{thisapp}/ ftp://ftp.gmplib.org/pub/%{name}-%{compat_version}/
+sources    = %{thisapp}.tar.bz2 %{name}-%{compat_version}.tar.bz2
 
 build
        requires
@@ -31,33 +33,145 @@ build
                m4
        end
 
+       # Build different versions of gmp to enhance the speed
+       # of the OS.
+       build_versions = base
+
+       export ABI = standard
+
+       if "%{DISTRO_ARCH}" == "x86_64"
+               ABI = 64
+       end
+
+       if "%{DISTRO_ARCH}" == "i686"
+               # Build sse2 enabled version of gmp.
+               build_versions += sse2
+
+               ABI = 32
+       end
+
+       configure_options += \
+               --prefix=/usr \
+               --enable-cxx \
+               --enable-mpbsd \
+               --disable-static
+
+       prepare_cmds
+               for version in %{build_versions}; do
+                       mkdir build-${version}
+
+                       cd build-${version}
+                       ln -svf ../configure .
+                       cd ..
+               done
+       end
+
+       build_one
+               CFLAGS="${CFLAGS}" \
+               CXXFLAGS="${CXXFLAGS}" \
+                       ./configure \
+                               %{configure_options}
+
+               # Kill RPATHs.
+               sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
+                       -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
+                       -e 's|-lstdc++ -lm|-lstdc++|' \
+                       -i libtool
+
+               export LD_LIBRARY_PATH=$(pwd)/.libs
+               make %{PARALLELISMFLAGS} \
+                       CFLAGS="${CFLAGS}" \
+                       CXXFLAGS="${CXXFLAGS}"
+       end
+
        build
-               if [ "%{MACHINE}" = "x86_64" ]; then
-                       ABI=64
-               else
-                       ABI=32
-               fi
+               for version in %{build_versions}; do
+                       cd build-${version}
+
+                       CFLAGS="%{CFLAGS}"
+                       CXXFLAGS="%{CXXFLAGS}"
+                       if [ "${version}" = "sse2" ]; then
+                               # Enable sse2.
+                               CFLAGS="${CFLAGS} -march=pentium4"
+                               CXXFLAGS="${CXXFLAGS} -march=pentium4"
+                       fi
 
-               ABI=%{ABI} \
-               ./configure \
-                       --prefix=/usr \
-                       --enable-cxx \
-                       --enable-mpbsd \
-                       --disable-static
+                       %{build_one}
 
-               make %{PARALLELISMFLAGS}
+                       cd ..
+               done
+
+               # Build compat version of library.
+               cd %{DIR_SRC}/%{name}-%{compat_version}
+               %{build_one}
        end
 
        test
+               for version in %{build_versions}; do
+                       cd build-${version}
+
+                       export LD_LIBRARY_PATH=$(pwd)/.libs
+                       make check
+
+                       cd ..
+               done
+
+               # Check compat version of library.
+               cd %{DIR_SRC}/%{name}-%{compat_version}
+
+               export LD_LIBRARY_PATH=$(pwd)/.libs
                make check
        end
+
+       install
+               for version in %{build_versions}; do
+                       cd build-${version}
+
+                       if [ "${version}" = "sse2" ]; then
+                               # Manually install sse2 libs.
+                               mkdir -pv %{BUILDROOT}/usr/lib/sse2
+
+                               install -m 755 .libs/libgmp.so.*.* %{BUILDROOT}/usr/lib/sse2
+                               cp -a .libs/libgmp.so.[^.]* %{BUILDROOT}/usr/lib/sse2
+                               chmod 755 %{BUILDROOT}/usr/lib/sse2/libgmp.so.[^.]*
+
+                               install -m 755 .libs/libgmpxx.so.*.* %{BUILDROOT}/usr/lib/sse2
+                               cp -a .libs/libgmpxx.so.? %{BUILDROOT}/usr/lib/sse2
+                               chmod 755 %{BUILDROOT}/usr/lib/sse2/libgmpxx.so.?
+
+                               install -m 755 .libs/libmp.so.*.* %{BUILDROOT}/usr/lib/sse2
+                               cp -a .libs/libmp.so.? %{BUILDROOT}/usr/lib/sse2
+                               chmod 755 %{BUILDROOT}/usr/lib/sse2/libmp.so.?
+                       else
+                               make install DESTDIR="%{BUILDROOT}"
+                       fi
+
+                       cd ..
+               done
+
+               # Install compat version of library.
+               cd %{DIR_SRC}/%{name}-%{compat_version}
+               install -m 644 .libs/libgmp.so.3.5.2 %{BUILDROOT}/usr/lib/
+               ln -svf libgmp.so.3.5.2 %{BUILDROOT}/usr/lib/libgmp.so.3
+       end
 end
 
 packages
        package %{name}
-       end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-compat
+               summary = Compatibility version of %{thisapp} (%{compat_version}).
+
+               files
+                       /usr/lib/libgmp.so.3*
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 8e35ca8fd4dd8e9a2d7cce21a5ddbf7f3f362976..d5b10b89232c35c1695c791ea6803538e8d4fa11 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = gnupg
-version    = 2.0.17
+version    = 2.0.18
 release    = 1
 
 groups     = Security/Tools
@@ -20,7 +20,7 @@ description
        standard as described by several RFCs.
 end
 
-source_dl  =
+source_dl  = ftp://ftp.gnupg.org/gcrypt/gnupg/
 sources    = %{thisapp}.tar.bz2
 
 build
@@ -41,5 +41,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index e321030d7938d33632e2cd96593c56d86d05d30d..4414df6c4979b618c149d3936e47be04774a713c 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = gnutls
-version    = 3.0.3
+version    = 3.0.8
 release    = 1
 
 groups     = System/Libraries
@@ -25,7 +25,7 @@ sources    = %{thisapp}.tar.xz
 build
        requires
                libtasn1-devel
-               nettle-devel
+               nettle-devel>=2.4
                p11-kit-devel>=0.4
                zlib-devel
        end
@@ -45,6 +45,7 @@ end
 packages
        package %{name}
                requires
+                       nettle>=2.4
                        p11-kit>=0.4
                end
        end
@@ -52,4 +53,8 @@ packages
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index fc9232eb5ff2f34fa1c7a0b13218155a34f3c485..9c9cd1696d1508308523bd2c7c0582aff1eb9733 100644 (file)
@@ -48,10 +48,14 @@ packages
        package %{name}-libs
                template LIBS
        end
-       
+
        package %{name}-devel
                template DEVEL
-       
+
                requires = %{name}=%{thisver}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index add112c0b308a038c106956c76d2c7390acdc20a..acdd33b99c275a567b21adbe1f699cfc7b6c00e4 100644 (file)
@@ -32,4 +32,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index c6476b2303794232456fbbc3f730167e7647d4a6..f50b4cbfddb25ba02b9898a0981817c130378d33 100644 (file)
@@ -4,10 +4,10 @@
 ###############################################################################
 
 name       = grep
-version    = 2.9
-release    = 1
+version    = 2.10
+release    = 2
 
-groups     = Base Build Applications/Text
+groups     = Applications/Text
 url        = http://www.gnu.org/software/grep/
 license    = GPLv3+
 summary    = A pattern matching utilities.
@@ -18,7 +18,7 @@ description
        prints the matching lines. GNU's grep utilities include grep, egrep and fgrep.
 end
 
-source_dl  =
+source_dl  = ftp://ftp.gnu.org/gnu/grep/
 sources    = %{thisapp}.tar.xz
 
 build
@@ -36,5 +36,10 @@ end
 
 packages
        package %{name}
+               groups += Base Build
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 344e745bc993000733739b52024574b806d51d8a..1a4fa8cd2cf4fae4a0641c0fba4d93c4893004ca 100644 (file)
@@ -72,4 +72,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
similarity index 100%
rename from grub/grub.default
rename to grub/default/grub
index 4adffac602c70dcfcd057d0788a97148e166003e..cea1a68bdb96a87a22e22e85337785a2a038ae08 100644 (file)
@@ -5,9 +5,10 @@
 
 name       = grub
 version    = 1.99
-release    = 1
+release    = 3
+sup_arches = i686
 
-groups     = Base System/Boot
+groups     = System/Boot
 url        = http://www.gnu.org/software/grub/
 license    = GPLv2+
 summary    = Grand Unified Boot Loader.
@@ -51,6 +52,9 @@ build
                # Install splash background
                mkdir -pv %{BUILDROOT}/boot/grub
                install %{DIR_SOURCE}/splash.png %{BUILDROOT}/boot/grub
+
+               # Install empty configuration file.
+               touch %{BUILDROOT}/boot/grub/grub.cfg
        end
 end
 
@@ -68,6 +72,11 @@ packages
                        /usr/share/X11/fonts/misc/unifont.pcf.gz
                end
 
+               configfiles
+                       /boot/grub/grub.cfg
+                       /etc/default/grub
+               end
+
                # Generate grub compatible font for graphical boot menu
                # This only converts Latin-1, Latin Extended A+B, Arrows, Box and Block characters
                script postin
@@ -75,4 +84,8 @@ packages
                                --range=0x0000-0x0241,0x2190-0x21FF,0x2500-0x259f /usr/share/X11/fonts/misc/unifont.pcf.gz
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/grubby/grubby.nm b/grubby/grubby.nm
new file mode 100644 (file)
index 0000000..92c1a58
--- /dev/null
@@ -0,0 +1,46 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = grubby
+version    = 8.3
+release    = 1
+
+groups     = System/Base
+url        = http://git.fedorahosted.org/git/grubby.git
+license    = GPLv2+
+summary    = Command line tool for updating bootloader configs.
+
+description
+       grubby  is  a command line tool for updating and displaying information about
+       the configuration files for the grub, lilo, elilo (ia64), yaboot (powerpc)
+       and zipl (s390) boot loaders. It is primarily designed to be used from scripts
+       which install new kernels and need to find information about the current boot
+       environment.
+end
+
+sources = %{thisapp}.tar.bz2
+
+build
+       requires
+               glib2-devel
+               libblkid-devel
+               popt-devel
+               util-linux
+       end
+
+       test
+               make test
+       end
+
+       make_install_targets += mandir=/usr/share/man
+end
+
+packages
+       package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
index 792f8720a714e41a4bc959ff0d69ab4d50262e6e..6331c7c038c231b50d2b7e72b3fe083ba4788ab3 100644 (file)
@@ -29,8 +29,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index ef8e08fe4ee14a73fb578b260852d4ecadbc844f..3c72e701bab693d97db8cedc8fa4aaaac2c19f84 100644 (file)
@@ -50,4 +50,8 @@ packages
 
                requires = gmp-devel libtool-devel
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 18c8e257fb259078fd41d64b5d70da7439517fb7..d6f391754a2b59c105cd0bb667719fb908efddf8 100644 (file)
@@ -32,8 +32,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index e84c0a65df14a1e8643ad26fe4e6b65840484e00..dd0981ab858997173b4bc7af4370225a39ca89e9 100644 (file)
@@ -32,8 +32,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 5dd403a5282f8d87b8a957979642d11a9aca1560..02a28ed0cc467eb3acfb4f2a3d2ce14561db2a31 100644 (file)
@@ -36,8 +36,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index b3d2baab0b92abf9a8824f41180e07e933e7ef71..624226a451b4aba8fa6a9c70bf1a4d15af0215f6 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = gzip
 version    = 1.4
-release    = 1
+release    = 2
 
-groups     = Base Build Applications/Compression
+groups     = Applications/Compression
 url        = http://www.gzip.org/
 license    = GPLv2
 summary    = The GNU data compression program.
@@ -46,5 +46,10 @@ end
 
 packages
        package %{name}
+               groups += Base Build
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 4ccd35f65bdb325cb913b49cbaa45a9c5b493e3a..285b050caf2d6d4b82b3ab35aae01d4c3bbb791d 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = hdparm
 version    = 9.37
-release    = 1
+release    = 2
 
-groups     = Base Applications/Hardware
+groups     = Applications/Hardware
 url        = http://sourceforge.net/projects/hdparm/
 license    = BSD
 summary    = A utility for displaying and/or setting hard disk parameters.
@@ -32,5 +32,10 @@ end
 
 packages
        package %{name}
+               groups += Base
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 208f1ff1abbb44af998f514ba49d8f647f007b56..a1ded21655ab3feef773198cb22cd18672c4433f 100644 (file)
@@ -34,4 +34,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 0571e0f152c0d383681365479a878696571db586..507c0ea6467da0f313978ed918e4109e2a084171 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = hostapd
-version    = 0.6.9
+version    = 0.7.3
 release    = 1
 
 groups     = Networking/Tools
@@ -19,7 +19,7 @@ description
        RADIUS authentication server.
 end
 
-source_dl  =
+source_dl  = http://hostap.epitest.fi/releases/
 
 build
        requires
@@ -47,4 +47,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 16eb31de4601fee694c10069c84386898115f1b4..cd3a8a2f65ed164a6ea21d6ec4c4157f6d84294c 100644 (file)
@@ -45,4 +45,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index efd8b877cf2f7cf355b2e6b1457738dfdcbb0753..b823f48204c58c9dba52de276878e9c8c5fb60cb 100644 (file)
@@ -4,10 +4,10 @@
 ###############################################################################
 
 name       = htop
-version    = 0.9
-release    = 1
+version    = 1.0
+release    = 2
 
-groups     = Base Applications/System
+groups     = Applications/System
 url        = http://htop.sourceforge.net/
 license    = GPL+
 summary    = Interactive process viewer.
@@ -17,7 +17,7 @@ description
        top(1).
 end
 
-source_dl  =
+source_dl  = http://sourceforge.net/projects/htop/files
 
 build
        requires
@@ -34,5 +34,10 @@ end
 
 packages
        package %{name}
+               groups += Base
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
diff --git a/ibod/ibod.nm b/ibod/ibod.nm
new file mode 100644 (file)
index 0000000..964881b
--- /dev/null
@@ -0,0 +1,66 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = ibod
+version    = 1.4
+release    = 2
+
+groups     = Networking/Tools
+url        = http://www.datenwelt.net/oss/ibod/
+license    = GPLv2
+summary    = An ISDN bandwidth monitor.
+
+description
+       Ibod is a daemon program for GNU/Linux that constantly monitors \
+       the ISDN interface for inbound and outbound traffic throughput.
+end
+
+sources    = %{thisapp}.tar.bz2
+
+build
+       build
+               gcc %{CFLAGS} ibod.c -o ibod
+       end
+
+       install
+               mkdir -pv %{BUILDROOT}/usr/bin
+               mkdir -pv %{BUILDROOT}/usr/share/man/man{1,4}
+               mkdir -pv %{BUILDROOT}/etc/isdn
+               install -m 0755 ibod %{BUILDROOT}/usr/bin
+               install -m 0644 ibod.1 %{BUILDROOT}/usr/share/man/man1
+               install -m 0644 ibod.cf.4 %{BUILDROOT}/usr/share/man/man4
+               install -m 0644 ibod.cf %{BUILDROOT}/etc/isdn
+       end
+end
+
+packages
+       package %{name}
+               configfiles
+                       /etc/isdn/ibod.cf
+               end
+
+               prerequires += systemd-units
+
+               # There isn't any chance at the moment to determine the names of
+               # spawned instances by a systemd service file.
+               #
+               # So we aren't able to stop any ibod process before uninstalling the package.
+               script postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postun
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
diff --git a/ibod/patches/ibod-1.4-config.patch b/ibod/patches/ibod-1.4-config.patch
new file mode 100644 (file)
index 0000000..6c92ddc
--- /dev/null
@@ -0,0 +1,11 @@
+--- isdn4k-utils-07022001/ibod.h.orig  Wed Nov  1 21:06:07 2000
++++ isdn4k-utils-07022001/ibod.h       Wed Nov  1 21:06:29 2000
+@@ -10,7 +10,7 @@
+ #define STAYUP                        0
+ #define STAYUP_TIME           30
+-#define IBOD_DEFAULT_DIR      "/etc/ppp"
++#define IBOD_DEFAULT_DIR      "/etc/isdn"
+ #define MAX_STR_LEN           512
+ #define ISDN_INFO_DEV         "/dev/isdninfo"
+ #define ISDN_CTLR_DEV         "/dev/isdnctrl"
diff --git a/ibod/patches/ibod-1.4-configuration-cli.patch b/ibod/patches/ibod-1.4-configuration-cli.patch
new file mode 100644 (file)
index 0000000..656d479
--- /dev/null
@@ -0,0 +1,74 @@
+Author: Michael Tremer <michael.tremer@ipfire.org>
+
+diff -Nur ibod-1.4/ibod.c ibod-1.4-conf/ibod.c
+--- ibod-1.4/ibod.c    2000-04-11 05:34:17.000000000 +0000
++++ ibod-1.4-conf/ibod.c       2011-11-11 18:50:45.510054466 +0000
+@@ -23,7 +23,7 @@
+ static void get_if_state();
+ static int bring_up_slave();
+ static int bring_down_slave();
+-static char *home;
++static char *config_file;
+ static Conf cf;
+ static struct timeval timeout, tv_last, tv_up;
+ static int usageflags[ISDN_MAX_CHANNELS];
+@@ -48,12 +48,16 @@
+     channels_last = -1;
++
+     /* Find out where to look for configuration file */
+-    if ((home = getenv("IBOD_HOME")) == NULL)
+-        home = IBOD_DEFAULT_DIR;
++    if (argc > 1) {
++        config_file = argv[1];
++    } else {
++        config_file = IBOD_DEFAULT_CONF;
++    }
+     /* Setup initial attributes */
+-    if (setattr(home) == -1) {
++    if (setattr(config_file) == -1) {
+         closelog();
+         exit(1);
+     }
+@@ -185,10 +189,9 @@
+ }
+-static int setattr(char *home)
++static int setattr(char *config_filename)
+ {
+     FILE *fd;
+-    char config_filename[MAX_STR_LEN];
+     char linebuf[MAX_STR_LEN];
+     char *key, *value;
+     int  val;
+@@ -202,7 +205,6 @@
+     cf.stayup_time = STAYUP_TIME;
+     /* Open config file */
+-    sprintf(config_filename, "%s/ibod.cf", home);
+     if ((fd = fopen(config_filename, "r")) == NULL) {
+         syslog(LOG_ERR, "%s: %s\n", config_filename, strerror(errno));
+         return -1;
+@@ -288,7 +290,7 @@
+ static void reread(int sig)
+ {
+-    (void) setattr(home);
++    (void) setattr(config_file);
+     setinterval();
+diff -Nur ibod-1.4/ibod.h ibod-1.4-conf/ibod.h
+--- ibod-1.4/ibod.h    2011-11-11 19:00:45.623454321 +0000
++++ ibod-1.4-conf/ibod.h       2011-11-11 18:45:39.703353901 +0000
+@@ -11,6 +11,7 @@
+ #define STAYUP_TIME           30
+ #define IBOD_DEFAULT_DIR      "/etc/isdn"
++#define IBOD_DEFAULT_CONF     IBOD_DEFAULT_DIR "/ibod.cf"
+ #define MAX_STR_LEN           512
+ #define ISDN_INFO_DEV         "/dev/isdninfo"
+ #define ISDN_CTLR_DEV         "/dev/isdnctrl"
diff --git a/ibod/patches/ibod-1.4-license.patch b/ibod/patches/ibod-1.4-license.patch
new file mode 100644 (file)
index 0000000..df72fb8
--- /dev/null
@@ -0,0 +1,346 @@
+diff -Nur ibod/LICENSE ibod-1.5.0/LICENSE
+--- ibod/LICENSE       1970-01-01 01:00:00.000000000 +0100
++++ ibod-1.5.0/LICENSE 2001-01-10 11:16:33.000000000 +0100
+@@ -0,0 +1,342 @@
++                  GNU GENERAL PUBLIC LICENSE
++                     Version 2, June 1991
++
++ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
++                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
++ Everyone is permitted to copy and distribute verbatim copies
++ of this license document, but changing it is not allowed.
++
++                          Preamble
++
++  The licenses for most software are designed to take away your
++freedom to share and change it.  By contrast, the GNU General Public
++License is intended to guarantee your freedom to share and change free
++software--to make sure the software is free for all its users.  This
++General Public License applies to most of the Free Software
++Foundation's software and to any other program whose authors commit to
++using it.  (Some other Free Software Foundation software is covered by
++the GNU Library General Public License instead.)  You can apply it to
++your programs, too.
++
++  When we speak of free software, we are referring to freedom, not
++price.  Our General Public Licenses are designed to make sure that you
++have the freedom to distribute copies of free software (and charge for
++this service if you wish), that you receive source code or can get it
++if you want it, that you can change the software or use pieces of it
++in new free programs; and that you know you can do these things.
++
++  To protect your rights, we need to make restrictions that forbid
++anyone to deny you these rights or to ask you to surrender the rights.
++These restrictions translate to certain responsibilities for you if you
++distribute copies of the software, or if you modify it.
++
++  For example, if you distribute copies of such a program, whether
++gratis or for a fee, you must give the recipients all the rights that
++you have.  You must make sure that they, too, receive or can get the
++source code.  And you must show them these terms so they know their
++rights.
++
++  We protect your rights with two steps: (1) copyright the software, and
++(2) offer you this license which gives you legal permission to copy,
++distribute and/or modify the software.
++
++  Also, for each author's protection and ours, we want to make certain
++that everyone understands that there is no warranty for this free
++software.  If the software is modified by someone else and passed on, we
++want its recipients to know that what they have is not the original, so
++that any problems introduced by others will not reflect on the original
++authors' reputations.
++
++  Finally, any free program is threatened constantly by software
++patents.  We wish to avoid the danger that redistributors of a free
++program will individually obtain patent licenses, in effect making the
++program proprietary.  To prevent this, we have made it clear that any
++patent must be licensed for everyone's free use or not licensed at all.
++
++  The precise terms and conditions for copying, distribution and
++modification follow.
++\f
++                  GNU GENERAL PUBLIC LICENSE
++   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
++
++  0. This License applies to any program or other work which contains
++a notice placed by the copyright holder saying it may be distributed
++under the terms of this General Public License.  The "Program", below,
++refers to any such program or work, and a "work based on the Program"
++means either the Program or any derivative work under copyright law:
++that is to say, a work containing the Program or a portion of it,
++either verbatim or with modifications and/or translated into another
++language.  (Hereinafter, translation is included without limitation in
++the term "modification".)  Each licensee is addressed as "you".
++
++Activities other than copying, distribution and modification are not
++covered by this License; they are outside its scope.  The act of
++running the Program is not restricted, and the output from the Program
++is covered only if its contents constitute a work based on the
++Program (independent of having been made by running the Program).
++Whether that is true depends on what the Program does.
++
++  1. You may copy and distribute verbatim copies of the Program's
++source code as you receive it, in any medium, provided that you
++conspicuously and appropriately publish on each copy an appropriate
++copyright notice and disclaimer of warranty; keep intact all the
++notices that refer to this License and to the absence of any warranty;
++and give any other recipients of the Program a copy of this License
++along with the Program.
++
++You may charge a fee for the physical act of transferring a copy, and
++you may at your option offer warranty protection in exchange for a fee.
++
++  2. You may modify your copy or copies of the Program or any portion
++of it, thus forming a work based on the Program, and copy and
++distribute such modifications or work under the terms of Section 1
++above, provided that you also meet all of these conditions:
++
++    a) You must cause the modified files to carry prominent notices
++    stating that you changed the files and the date of any change.
++
++    b) You must cause any work that you distribute or publish, that in
++    whole or in part contains or is derived from the Program or any
++    part thereof, to be licensed as a whole at no charge to all third
++    parties under the terms of this License.
++
++    c) If the modified program normally reads commands interactively
++    when run, you must cause it, when started running for such
++    interactive use in the most ordinary way, to print or display an
++    announcement including an appropriate copyright notice and a
++    notice that there is no warranty (or else, saying that you provide
++    a warranty) and that users may redistribute the program under
++    these conditions, and telling the user how to view a copy of this
++    License.  (Exception: if the Program itself is interactive but
++    does not normally print such an announcement, your work based on
++    the Program is not required to print an announcement.)
++\f
++These requirements apply to the modified work as a whole.  If
++identifiable sections of that work are not derived from the Program,
++and can be reasonably considered independent and separate works in
++themselves, then this License, and its terms, do not apply to those
++sections when you distribute them as separate works.  But when you
++distribute the same sections as part of a whole which is a work based
++on the Program, the distribution of the whole must be on the terms of
++this License, whose permissions for other licensees extend to the
++entire whole, and thus to each and every part regardless of who wrote it.
++
++Thus, it is not the intent of this section to claim rights or contest
++your rights to work written entirely by you; rather, the intent is to
++exercise the right to control the distribution of derivative or
++collective works based on the Program.
++
++In addition, mere aggregation of another work not based on the Program
++with the Program (or with a work based on the Program) on a volume of
++a storage or distribution medium does not bring the other work under
++the scope of this License.
++
++  3. You may copy and distribute the Program (or a work based on it,
++under Section 2) in object code or executable form under the terms of
++Sections 1 and 2 above provided that you also do one of the following:
++
++    a) Accompany it with the complete corresponding machine-readable
++    source code, which must be distributed under the terms of Sections
++    1 and 2 above on a medium customarily used for software interchange; or,
++
++    b) Accompany it with a written offer, valid for at least three
++    years, to give any third party, for a charge no more than your
++    cost of physically performing source distribution, a complete
++    machine-readable copy of the corresponding source code, to be
++    distributed under the terms of Sections 1 and 2 above on a medium
++    customarily used for software interchange; or,
++
++    c) Accompany it with the information you received as to the offer
++    to distribute corresponding source code.  (This alternative is
++    allowed only for noncommercial distribution and only if you
++    received the program in object code or executable form with such
++    an offer, in accord with Subsection b above.)
++
++The source code for a work means the preferred form of the work for
++making modifications to it.  For an executable work, complete source
++code means all the source code for all modules it contains, plus any
++associated interface definition files, plus the scripts used to
++control compilation and installation of the executable.  However, as a
++special exception, the source code distributed need not include
++anything that is normally distributed (in either source or binary
++form) with the major components (compiler, kernel, and so on) of the
++operating system on which the executable runs, unless that component
++itself accompanies the executable.
++
++If distribution of executable or object code is made by offering
++access to copy from a designated place, then offering equivalent
++access to copy the source code from the same place counts as
++distribution of the source code, even though third parties are not
++compelled to copy the source along with the object code.
++\f
++  4. You may not copy, modify, sublicense, or distribute the Program
++except as expressly provided under this License.  Any attempt
++otherwise to copy, modify, sublicense or distribute the Program is
++void, and will automatically terminate your rights under this License.
++However, parties who have received copies, or rights, from you under
++this License will not have their licenses terminated so long as such
++parties remain in full compliance.
++
++  5. You are not required to accept this License, since you have not
++signed it.  However, nothing else grants you permission to modify or
++distribute the Program or its derivative works.  These actions are
++prohibited by law if you do not accept this License.  Therefore, by
++modifying or distributing the Program (or any work based on the
++Program), you indicate your acceptance of this License to do so, and
++all its terms and conditions for copying, distributing or modifying
++the Program or works based on it.
++
++  6. Each time you redistribute the Program (or any work based on the
++Program), the recipient automatically receives a license from the
++original licensor to copy, distribute or modify the Program subject to
++these terms and conditions.  You may not impose any further
++restrictions on the recipients' exercise of the rights granted herein.
++You are not responsible for enforcing compliance by third parties to
++this License.
++
++  7. If, as a consequence of a court judgment or allegation of patent
++infringement or for any other reason (not limited to patent issues),
++conditions are imposed on you (whether by court order, agreement or
++otherwise) that contradict the conditions of this License, they do not
++excuse you from the conditions of this License.  If you cannot
++distribute so as to satisfy simultaneously your obligations under this
++License and any other pertinent obligations, then as a consequence you
++may not distribute the Program at all.  For example, if a patent
++license would not permit royalty-free redistribution of the Program by
++all those who receive copies directly or indirectly through you, then
++the only way you could satisfy both it and this License would be to
++refrain entirely from distribution of the Program.
++
++If any portion of this section is held invalid or unenforceable under
++any particular circumstance, the balance of the section is intended to
++apply and the section as a whole is intended to apply in other
++circumstances.
++
++It is not the purpose of this section to induce you to infringe any
++patents or other property right claims or to contest validity of any
++such claims; this section has the sole purpose of protecting the
++integrity of the free software distribution system, which is
++implemented by public license practices.  Many people have made
++generous contributions to the wide range of software distributed
++through that system in reliance on consistent application of that
++system; it is up to the author/donor to decide if he or she is willing
++to distribute software through any other system and a licensee cannot
++impose that choice.
++
++This section is intended to make thoroughly clear what is believed to
++be a consequence of the rest of this License.
++\f
++  8. If the distribution and/or use of the Program is restricted in
++certain countries either by patents or by copyrighted interfaces, the
++original copyright holder who places the Program under this License
++may add an explicit geographical distribution limitation excluding
++those countries, so that distribution is permitted only in or among
++countries not thus excluded.  In such case, this License incorporates
++the limitation as if written in the body of this License.
++
++  9. The Free Software Foundation may publish revised and/or new versions
++of the General Public License from time to time.  Such new versions will
++be similar in spirit to the present version, but may differ in detail to
++address new problems or concerns.
++
++Each version is given a distinguishing version number.  If the Program
++specifies a version number of this License which applies to it and "any
++later version", you have the option of following the terms and conditions
++either of that version or of any later version published by the Free
++Software Foundation.  If the Program does not specify a version number of
++this License, you may choose any version ever published by the Free Software
++Foundation.
++
++  10. If you wish to incorporate parts of the Program into other free
++programs whose distribution conditions are different, write to the author
++to ask for permission.  For software which is copyrighted by the Free
++Software Foundation, write to the Free Software Foundation; we sometimes
++make exceptions for this.  Our decision will be guided by the two goals
++of preserving the free status of all derivatives of our free software and
++of promoting the sharing and reuse of software generally.
++
++                          NO WARRANTY
++
++  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
++FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
++OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
++PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
++OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
++TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
++PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
++REPAIR OR CORRECTION.
++
++  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
++REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
++INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
++OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
++TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
++YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
++PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
++POSSIBILITY OF SUCH DAMAGES.
++
++                   END OF TERMS AND CONDITIONS
++\f
++          How to Apply These Terms to Your New Programs
++
++  If you develop a new program, and you want it to be of the greatest
++possible use to the public, the best way to achieve this is to make it
++free software which everyone can redistribute and change under these terms.
++
++  To do so, attach the following notices to the program.  It is safest
++to attach them to the start of each source file to most effectively
++convey the exclusion of warranty; and each file should have at least
++the "copyright" line and a pointer to where the full notice is found.
++
++    <one line to give the program's name and a brief idea of what it does.>
++    Copyright (C) <year>  <name of author>
++
++    This program is free software; you can redistribute it and/or modify
++    it under the terms of the GNU General Public License as published by
++    the Free Software Foundation; either version 2 of the License, or
++    (at your option) any later version.
++
++    This program is distributed in the hope that it will be useful,
++    but WITHOUT ANY WARRANTY; without even the implied warranty of
++    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++    GNU General Public License for more details.
++
++    You should have received a copy of the GNU General Public License
++    along with this program; if not, write to the Free Software
++    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
++
++
++Also add information on how to contact you by electronic and paper mail.
++
++If the program is interactive, make it output a short notice like this
++when it starts in an interactive mode:
++
++    Gnomovision version 69, Copyright (C) year name of author
++    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
++    This is free software, and you are welcome to redistribute it
++    under certain conditions; type `show c' for details.
++
++The hypothetical commands `show w' and `show c' should show the appropriate
++parts of the General Public License.  Of course, the commands you use may
++be called something other than `show w' and `show c'; they could even be
++mouse-clicks or menu items--whatever suits your program.
++
++You should also get your employer (if you work as a programmer) or your
++school, if any, to sign a "copyright disclaimer" for the program, if
++necessary.  Here is a sample; alter the names:
++
++  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
++  `Gnomovision' (which makes passes at compilers) written by James Hacker.
++
++  <signature of Ty Coon>, 1 April 1989
++  Ty Coon, President of Vice
++
++This General Public License does not permit incorporating your program into
++proprietary programs.  If your program is a subroutine library, you may
++consider it more useful to permit linking proprietary applications with the
++library.  If this is what you want to do, use the GNU Library General
++Public License instead of this License.
++
++
diff --git a/ibod/systemd/ibod@.service b/ibod/systemd/ibod@.service
new file mode 100644 (file)
index 0000000..a2fde5c
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=ibod on %I
+BindTo=dev-%I.device
+After=dev-%I.device network.service
+Requires=network.service
+
+[Service]
+ExecStart=/usr/bin/ibod /run/network/isdn/%I/ibod.cf
+UtmpIdentifier=%I
+KillMode=process
index 793e1f5f43a0d4b6c3de817e1ba8a244b6a121b2..d41e4e0ec716692c2cb75cf359db14a7d6cfafd0 100644 (file)
@@ -3,12 +3,9 @@
 # Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
 ###############################################################################
 
-# XXX man pages are missing
-# XXX initscripts for daemons are missing
-
 name       = icecream
-version    = 0.9.6
-release    = 3
+version    = 0.9.7
+release    = 2
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
 groups     = Development/Compilers
@@ -16,19 +13,20 @@ url        = http://en.opensuse.org/Icecream
 license    = GPLv2+
 summary    = Distributed compiler.
 
-
 description
-       Icecream is a distributed compile system. It allows parallel compiling by \
-       distributing the compile jobs to several nodes of a compile network running the \
-       icecc daemon. The icecc scheduler routes the jobs and provides status and \
-       statistics information to the icecc monitor. Each compile node can accept one \
-       or more compile jobs depending on the number of processors and the settings of \
-       the daemon. Link jobs and other jobs which cannot be distributed are executed \
+       Icecream is a distributed compile system. It allows parallel compiling by
+       distributing the compile jobs to several nodes of a compile network running the
+       icecc daemon. The icecc scheduler routes the jobs and provides status and
+       statistics information to the icecc monitor. Each compile node can accept one
+       or more compile jobs depending on the number of processors and the settings of
+       the daemon. Link jobs and other jobs which cannot be distributed are executed
        locally on the node where the compilation is started.
 end
 
-source_dl  =
-sources    = icecc-%{version}.tar.bz2
+source_dl  = ftp://ftp.suse.com/pub/projects/icecream/
+sources    = \
+       icecc-%{version}.tar.bz2 \
+       icecream-manpages.tar.bz2
 
 build
        requires
@@ -41,6 +39,13 @@ build
                --disable-static \
                --enable-shared
 
+       prepare
+               cd %{DIR_SRC} && %{MACRO_EXTRACT} %{DIR_DL}/icecc-%{version}.tar.bz2
+               cd %{DIR_APP} && %{MACRO_EXTRACT} %{DIR_DL}/icecream-manpages.tar.bz2
+
+               %{MACRO_PATCHES}
+       end
+
        install_cmds
                ICECREAM_TARGET_PLATFORM=$(echo %{DISTRO_MACHINE} | sed -e "s/-gnu//g")
 
@@ -57,15 +62,62 @@ build
 
                # create default working dir
                mkdir -pv %{BUILDROOT}/var/cache/icecream
+
+               # install manpages
+               mkdir -pv %{BUILDROOT}/usr/share/man/man{1,7,8}
+               mv mans/scheduler.1 mans/icecc-scheduler.1
+               for i in mans/*.1 mans/*.7; do
+                       install -m 644 $i %{BUILDROOT}/usr/share/man/man${i##*.}
+               done
+
+               # Remove unwanted symlinks.
+               rm -rvf %{BUILDROOT}/usr/bin/c++
+               rm -rvf %{BUILDROOT}/usr/bin/cc
+               rm -rvf %{BUILDROOT}/usr/bin/g++
+               rm -rvf %{BUILDROOT}/usr/bin/gcc
+
+               # Create Logfiles.
+               mkdir -pv %{BUILDROOT}/var/log
+               touch %{BUILDROOT}/var/log/icecc{d,-scheduler}.log
        end
 end
 
 packages
        package %{name}
-               requires = gcc-c++ /usr/bin/ldd
+               requires
+                       gcc-c++
+                       /usr/bin/ldd
+               end
+
+               prerequires += systemd-units
+
+               script postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       /bin/systemctl --no-reload disable iceccd.service \
+                               icecc-scheduler.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop iceccd.service \
+                               icecc-scheduler.service >/dev/null 2>&1 || :
+               end
+
+               script postun
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl try-restart iceccd.service \
+                               icecc-scheduler.service >/dev/null 2>&1 || :
+               end
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/icecream/systemd/icecc-scheduler.service b/icecream/systemd/icecc-scheduler.service
new file mode 100644 (file)
index 0000000..38a1402
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=Icecream job scheduler
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/icecc-scheduler -vvv -d -p 8765 -l /var/log/icecc-scheduler.log
+
+[Install]
+WantedBy=multi-user.target
diff --git a/icecream/systemd/iceccd.service b/icecream/systemd/iceccd.service
new file mode 100644 (file)
index 0000000..aab8d30
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=Icecream daemon
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/iceccd -vvv -d -s localhost -m 2 -l /var/log/iceccd.log
+
+[Install]
+WantedBy=multi-user.target
index bee6dac1ceda601cdf413d6859894bcb58490e00..0f812e6839d843dea3857ac72c3242f8e482b5dd 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = iftop
 version    = 0.17
-release    = 1
+release    = 2
 
-groups     = Base Applications/System
+groups     = Applications/System
 url        = http://www.ex-parrot.com/pdw/iftop/
 license    = GPL+
 summary    = Interactive traffic listings
@@ -32,5 +32,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 41cff18ef061b44e8baadb3c9fe9fa0da6f40157..12e842c56b09bd153772ee0191867deea344e11c 100644 (file)
@@ -28,4 +28,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/initscripts/functions b/initscripts/functions
deleted file mode 100644 (file)
index c5451ff..0000000
+++ /dev/null
@@ -1,284 +0,0 @@
-#!/bin/sh
-###############################################################################
-#                                                                             #
-# IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt                 #
-#                                                                             #
-# This program is free software: you can redistribute it and/or modify        #
-# it under the terms of the GNU General Public License as published by        #
-# the Free Software Foundation, either version 3 of the License, or           #
-# (at your option) any later version.                                         #
-#                                                                             #
-# This program is distributed in the hope that it will be useful,             #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
-# GNU General Public License for more details.                                #
-#                                                                             #
-# You should have received a copy of the GNU General Public License           #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
-#                                                                             #
-###############################################################################
-#
-# Partly based on scripts by DJ Lucas - dj@linuxfromscratch.org
-#
-
-# Distro Information
-DISTRO="$(</etc/system-release)" # The distro name
-DISTRO_CONTACT="http://bugtracker.ipfire.org" # Bug report address
-
-# This sets default terminal options.
-# stty sane - this has been removed as nobody recalls
-# the reason for it in the first place - if no problems arize,
-# then it will be removed completely at a later date.
-
-# Setup default values for the environment
-umask 022
-
-# If we boot, we should only allow the
-# use tools that are available in /bin:/sbin
-if [ -n "${UPSTART_JOB}" ]; then
-       PATH="/bin:/sbin"
-fi
-
-# Find current screen size
-if [ -z "${COLUMNS}" ]; then
-       COLUMNS=$(stty size)
-       COLUMNS=${COLUMNS##* }
-fi
-
-# When using remote connections, such as a serial port, stty size returns 0
-if [ "${COLUMNS}" = "0" ]; then
-       COLUMNS=80
-fi
-
-## Measurements for positioning result messages
-COL=$((${COLUMNS} - 8))
-WCOL=$((${COL} - 2))
-
-# Set Cursur Position Commands, used via echo -e
-SET_COL="\\033[${COL}G"      # at the $COL char
-SET_WCOL="\\033[${WCOL}G"    # at the $WCOL char
-CURS_UP="\\033[1A\\033[0G"   # Up one line, at the 0'th char
-
-# Normal colors
-CLR_NORM_BLK="\\033[0;30m"    # black
-CLR_NORM_RED="\\033[0;31m"    # red
-CLR_NORM_GRN="\\033[0;32m"    # green
-CLR_NORM_YEL="\\033[0;33m"    # yellow
-CLR_NORM_BLU="\\033[0;34m"    # blue
-CLR_NORM_MAG="\\033[0;35m"    # magenta
-CLR_NORM_CYN="\\033[0;36m"    # cyan
-CLR_NORM_WHT="\\033[0;37m"    # white
-CLR_NORM_GRY="\\033[0;39m"    # grey
-
-# Emphased colors
-CLR_BOLD_BLK="\\033[1;30m"    # black
-CLR_BOLD_RED="\\033[1;31m"    # red
-CLR_BOLD_GRN="\\033[1;32m"    # green
-CLR_BOLD_YEL="\\033[1;33m"    # yellow
-CLR_BOLD_BLU="\\033[1;34m"    # blue
-CLR_BOLD_MAG="\\033[1;35m"    # magenta
-CLR_BOLD_CYN="\\033[1;36m"    # cyan
-CLR_BOLD_WHT="\\033[1;37m"    # white
-CLR_BOLD_GRY="\\033[1;39m"    # grey
-
-# Background colors
-CLR_BACK_BLK="\\033[40m"      # black
-CLR_BACK_RED="\\033[41m"      # red
-CLR_BACK_GRN="\\033[42m"      # green
-CLR_BACK_YEL="\\033[43m"      # yellow
-CLR_BACK_BLU="\\033[44m"      # blue
-CLR_BACK_MAG="\\033[45m"      # magenta
-CLR_BACK_CYN="\\033[46m"      # cyan
-CLR_BACK_WHT="\\033[47m"      # white
-
-# Action colors
-BOLD=$CLR_BOLD_GRY
-DONE=$CLR_BOLD_GRN
-SKIP=$CLR_BOLD_BLU
-WARN=$CLR_BOLD_MAG
-FAIL=$CLR_BOLD_RED
-NORMAL=$CLR_NORM_GRY
-
-# Color hooks
-BRACKET_L="${CLR_BOLD_BLU}[${NORMAL}"
-BRACKET_R="${CLR_BOLD_BLU}]${NORMAL}"
-
-# Define custom colors used in messages printed to the screen
-BRACKET=${CLR_BOLD_BLU} # Blue
-FAILURE=${CLR_BOLD_RED} # Red
-INFO=${CLR_BOLD_CYN}    # Cyan
-NORMAL=${CLR_NORM_GRY}  # Grey
-SUCCESS=${CLR_BOLD_GRN} # Green
-WARNING=${CLR_BOLD_YEL} # Yellow
-
-# Prefix boot messages for easier reading on framebuffer consoles
-PREFIX_SUCCESS=" ${SUCCESS}*${NORMAL} "
-PREFIX_WARNING="${WARNING}**${NORMAL} "
-PREFIX_FAILURE="${FAILURE}***${NORMAL}"
-
-welcome_message="Welcome to ${INFO}${DISTRO}${NORMAL}"
-welcome_message_length=$((${#DISTRO} + 11))
-
-# Error message displayed when a script's exit value is not zero
-print_error_msg() {
-       # ${link} and ${error_value} are defined by the rc script
-       echo -e "${FAILURE}FAILURE:  You should not be reading this error message."
-       echo -e ""
-       echo -e -n "${FAILURE}It means that an unforseen error took place in"
-       echo -e -n "${INFO} ${link}"
-       echo -e "${FAILURE},"
-       echo -e "${FAILURE}which exited with a return value of ${error_value}."
-       echo -e ""
-       echo -e -n "${FAILURE}If you are able to track this error down to a bug"
-       echo -e "${FAILURE}in one of the files"
-       echo -e -n "provided by ${INFO}${DISTRO}${FAILURE}, "
-       echo -e -n "${FAILURE}please be so kind to inform us at "
-       echo -e "${INFO}${DISTRO_CONTACT}${FAILURE}.${NORMAL}"
-       echo -e ""
-       echo -e "${INFO}Press Enter to continue..."
-       echo -e "${NORMAL}"
-       read ENTER
-}
-
-################################################################################
-# log_success_msg()                                                            #
-# Usage: log_success_msg [$MESSAGE | "message"]                                #
-#                                                                              #
-# Purpose: Print a successful status message to the screen and optionally      #
-#          a boot log file.                                                    #
-#                                                                              #
-# Inputs: accepts one string value, either a quoted string or optionally       #
-#         the value of $MESSAGE if set in the running environment.             #
-#                                                                              #
-# Return values: Not used                                                      #
-################################################################################
-log_success_msg() {
-       echo -n -e "${PREFIX_SUCCESS}${INDENT}${@}"
-       echo -e "${SET_COL}${BRACKET}[${SUCCESS}  OK  ${BRACKET}]${NORMAL}"
-}
-
-################################################################################
-# log_failure_msg()                                                            #
-# Usage: log_failure_msg [$MESSAGE | "message"]                                #
-#                                                                              #
-# Purpose: Print a failure status message to the screen and optionally         #
-#          a boot log file.                                                    #
-#                                                                              #
-# Inputs: accepts one string value, either a quoted string or optionally       #
-#         the value of $MESSAGE if set in the running environment.             #
-#                                                                              #
-# Return values: Not used                                                      #
-################################################################################
-log_failure_msg() {
-       echo -n -e "${PREFIX_FAILURE}${INDENT}${@}"
-       echo -e "${SET_COL}${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"
-}
-
-################################################################################
-# log_warning_msg()                                                            #
-# Usage: log_warning_msg [$MESSAGE | "message"]                                #
-#                                                                              #
-# Purpose: Print a warning status message to the screen and optionally         #
-#          a boot log file.                                                    #
-#                                                                              #
-# Inputs: accepts one string value, either a quoted string or optionally       #
-#         the value of $MESSAGE if set in the running environment.             #
-#                                                                              #
-# Return values: Not used                                                      #
-################################################################################
-log_warning_msg() {
-       echo -n -e "${PREFIX_WARNING}${INDENT}${@}"
-       echo -e "${SET_COL}${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}"
-}
-
-############################## evaluate_retval() ###############################
-# evaluate_retval requires that you pass exactly one evaluation parameter of   #
-# (start, stop, other) based on the previous action that is being evaluated.   #
-# This function is intended for use with start_daemon and killproc to          #
-# interpret the LSB exit codes properly, othewise the checks only for success  #
-# or failure.                                                                  #
-################################################################################
-evaluate_retval() {
-       local error_value="${?}"
-
-       # Handle LSB defined return values
-       case "${1}" in
-               start)
-                       case "${error_value}" in
-                               0)
-                                       log_success_msg "Starting ${MESSAGE} "
-                                       return "${error_value}"
-                                       ;;
-                               2)
-                                       log_failure_msg "Starting ${MESSAGE} Error: Invalid argument!"
-                                       return "${error_value}"
-                                       ;;
-                               5)
-                                       log_failure_msg "Starting ${MESSAGE} Error: Not available!"
-                                       return "${error_value}"
-                                       ;;
-                               *)
-                                       log_failure_msg "Starting ${MESSAGE} Error: General failure!"
-                                       return "${error_value}"
-                                       ;;
-                       esac
-                       ;;
-
-               stop)
-                       case "${error_value}" in
-                               0)
-                                       log_success_msg "Stopping ${MESSAGE} "
-                                       return "${error_value}"
-                                       ;;
-                               2)
-                                       log_failure_msg "Stopping ${MESSAGE} Error: Invalid argument!"
-                                       return "${error_value}"
-                                       ;;
-                               5)
-                                       log_failure_msg "Stopping ${MESSAGE} Error: Not available!"
-                                       return "${error_value}"
-                                       ;;
-                               7)
-                                       log_warning_msg "Stopping ${MESSAGE} Warning: Not running!"
-                                       return "${error_value}"
-                                       ;;
-                               *)
-                                       log_failure_msg "Stopping ${MESSAGE} Error: General failure!"
-                                       return "${error_value}"
-                                       ;;
-                       esac
-                       ;;
-
-               force-reload)
-                       message="Forcefully reloading "
-                       ;;
-
-               reload)
-                       message="Reloading "
-                       ;;
-
-               restart)
-                       message="Restarting "
-                       ;;
-
-               try-restart)
-                       message="Trying restart "
-                       ;;
-
-               standard)
-                       # $message or $MESSAGE must be set, but not both in order
-                       # to use the 'standard' target.
-                       ;;
-       esac
-
-       # Print messages for the generic force-reload, reload, restart, 
-       # and try-restart targets
-       if [ "${error_value}" = "0" ]; then
-               log_success_msg "${message}${MESSAGE} "
-               return "${error_value}"
-       else
-               log_failure_msg "${message}${MESSAGE} "
-               return "${error_value}"
-       fi
-}
index ca0e7af051dd1dc19497248f8cf0065e3c56cfcf..a7bcb8d788ca8c014ec122b15de1c2c515afee15 100644 (file)
@@ -6,9 +6,9 @@
 name       = initscripts
 epoch      = 1
 version    = 2.99
-release    = 6
+release    = 12
 
-groups     = Base System/Boot
+groups     = System/Boot
 url        =
 license    = GPLv3+
 summary    = The set of scripts that initalize the system.
@@ -44,16 +44,8 @@ build
        install
                cd src && make install clean DESTDIR=%{BUILDROOT}
 
-               mkdir -pv %{BUILDROOT}/etc/{init,sysconfig}
-
-               cp -vf %{DIR_SOURCE}/functions %{BUILDROOT}/etc/init/
-
-               for i in %{DIR_SOURCE}/sysconfig/*; do
-                       install -v -m 644 $i %{BUILDROOT}/etc/sysconfig/
-               done
-               chmod -v 755 %{BUILDROOT}/etc/sysconfig/rc.local
-
-               cp -vf %{DIR_SOURCE}/sysctl.conf %{BUILDROOT}/etc
+               # Install rc.local
+               install -v -m 755 %{DIR_SOURCE}/rc.local %{BUILDROT}/etc/rc.local
 
                # Install udev rules
                mkdir -pv %{BUILDROOT}/lib/udev/rules.d/
@@ -63,6 +55,8 @@ end
 
 packages
        package %{name}
+               groups += Base
+
                requires
                        bash
                        coreutils
@@ -76,5 +70,43 @@ packages
                        udev
                        util-linux
                end
+
+               configfiles
+                       /etc/rc.local
+               end
+
+               prerequires = coreutils shadow-utils
+
+               script prein
+                       groupadd -g 22 -r -f utmp
+               end
+
+               script postin
+                       touch /var/log/{b,w}tmp /var/run/utmp
+                       chown root:utmp /var/log/{b,w}tmp /var/run/utmp
+                       chmod 664 /var/log/wtmp /var/run/utmp
+                       chmod 600 /var/log/btmp
+
+                       # Just search for new unit files that were just installed.
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+
+                       # Enable rc.local as default.
+                       /bin/systemctl --no-reload enable rc-local.service >/dev/null 2>&1 || :
+               end
+
+               # Disable the service that is to be removed and stop it if it is still running.
+               script preun
+                       /bin/systemctl --no-reload disable rc-local.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop rc-local.service >/dev/null 2>&1 || :
+               end
+
+               # Just tell systemd that unitfiles have been removed.
+               script postun
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
diff --git a/initscripts/rc.local b/initscripts/rc.local
new file mode 100644 (file)
index 0000000..0bd2d37
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+#
+# This script will be executed at the end of the boot process.
+# You can put your own initialization stuff in here.
index 9a979e40666489fddbafc3b7fafed84113ac8e41..a6b0f3135db9c3ba730ffacab1ca7e7064e8a4ff 100644 (file)
@@ -1,5 +1,5 @@
 
-PROGS = console_init ipcalc securetty
+PROGS = ipcalc securetty
 
 CC = gcc
 CFLAGS += -D_GNU_SOURCE $(shell pkg-config --cflags glib-2.0)
@@ -15,7 +15,6 @@ test: ipcalc
 install: $(PROGS)
        # Install binaries
        -mkdir -pv $(DESTDIR)/lib/udev $(DESTDIR)/{,s}bin
-       install -v -m 755 console_init $(DESTDIR)/lib/udev/
        install -v -m 755 ipcalc $(DESTDIR)/bin
        install -v -m 755 securetty $(DESTDIR)/sbin
 
@@ -25,9 +24,6 @@ install: $(PROGS)
        install -v -m 644 ipcalc.1 $(DESTDIR)/usr/share/man/man1
        install -v -m 644 securetty.8 $(DESTDIR)/usr/share/man/man8
 
-console_init: console_init.o shvar.o
-       $(CC) $(LDFLAGS) $(shell pkg-config --libs glib-2.0) -o $@ $?
-
 ipcalc: ipcalc.o
        $(CC) $(LDFLAGS) -o $@ $< -lpopt
 
diff --git a/initscripts/src/console_init.c b/initscripts/src/console_init.c
deleted file mode 100644 (file)
index 22083a8..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (c) 2008-2009 Red Hat, Inc. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- *
- */
-
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <linux/kd.h>
-
-#include "shvar.h"
-
-static char *lang = NULL;
-static char *font = NULL;
-static char *acm = NULL;
-static char *unimap = NULL;
-static char *keymap = NULL;
-
-static int linux_console(int fd) {
-       unsigned char twelve = 12;
-
-       if (ioctl(fd, TIOCLINUX, &twelve) >= 0) 
-               return 1;
-       return 0;
-}
-
-static int configured_as_utf8() {
-        shvarFile *i18nfile = NULL;
-
-        if ((i18nfile = svNewFile("/etc/sysconfig/i18n")) == NULL)
-                return 1; /* assume UTF-8 */
-
-        lang = svGetValue(i18nfile, "LANG");
-        font = svGetValue(i18nfile, "SYSFONT");
-        acm = svGetValue(i18nfile, "SYSFONTACM");
-        unimap = svGetValue(i18nfile, "UNIMAP");
-        svCloseFile(i18nfile);
-        if (!lang)
-                return 1;
-        if (g_str_has_suffix(lang,".utf8") || g_str_has_suffix(lang,".UTF-8"))
-                return 1;
-       return 0;
-}
-
-static int read_keymap() {
-       shvarFile *keyboard = NULL;
-       char *tmp;
-       struct stat sb;
-       
-       if (!stat("/etc/sysconfig/console/default.kmap",&sb)) {
-               keymap = "/etc/sysconfig/console/default.kmap";
-               return 0;
-       }
-
-       if ((keyboard = svNewFile("/etc/sysconfig/keyboard")) == NULL)
-               return 0;
-
-       tmp = svGetValue(keyboard, "KEYMAP");
-       if (tmp)
-               keymap = tmp;
-       tmp = svGetValue(keyboard, "KEYTABLE");
-       if (tmp) {
-               if (keymap) free(keymap);
-               asprintf(&keymap, "%s.map", tmp);
-       }
-       return 0;
-}
-
-static void set_font(char *device) {
-       int pid;
-       
-       if ( (pid = fork()) == 0) {
-               char *args[] = { "setfont", "latarcyrheb-sun16", "-C", NULL,
-                                NULL, NULL, NULL, NULL, NULL };
-
-               if (font)
-                       args[1] = font;
-               args[3] = device;
-               if (acm) {
-                       args[4] = "-m"; 
-                       args[5] = acm;
-                       if (unimap) {
-                               args[6] = "-u";
-                               args[7] = unimap;
-                       }
-               } else  if (unimap) {
-                       args[4] = "-u";
-                       args[5] = unimap;
-               }
-               execv("/bin/setfont", args);
-               exit(1);
-       }
-}
-
-static void set_keyboard(int fd, int utf8) {
-       if (ioctl(fd, KDSKBMODE, utf8 ? K_UNICODE : K_XLATE))
-               perror("could not set keyboard mode");
-}
-
-static void set_terminal(int fd, int utf8) {
-       if (utf8)
-               write(fd, "\033%G", 3);
-       else
-               write(fd, "\033%@", 3);
-}
-
-static void set_keymap(int fd, int utf8) {
-       int pid;
-       
-       if ((pid = fork()) == 0) {
-               char *args[] = { "loadkeys", "-q", NULL, NULL, NULL };
-               dup2(fd, 0);
-               dup2(fd, 1);
-               
-               if (utf8) {
-                       args[2] = "-u";
-                       args[3] = keymap;
-               } else {
-                       args[2] = keymap;
-               }
-               execv("/bin/loadkeys", args);
-               exit(1);
-       }
-}
-
-int main(int argc, char **argv) {
-       char *device;
-       int dev;
-
-       if (argc < 2) {
-               printf("usage: console_init <device>\n");
-               exit(1);
-       }
-       chdir("/dev");
-       device = argv[1];
-       dev = open(device, O_RDWR);
-       if (linux_console(dev)) {
-               int utf8 = configured_as_utf8();
-
-               set_keyboard(dev, utf8);
-               set_terminal(dev, utf8);
-               set_font(device);
-               read_keymap();
-               if (keymap)
-                       set_keymap(dev,utf8);
-       }
-       return 0;
-}
diff --git a/initscripts/sysconfig/clock b/initscripts/sysconfig/clock
deleted file mode 100644 (file)
index 99132e1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-UTC=no
diff --git a/initscripts/sysconfig/createfiles b/initscripts/sysconfig/createfiles
deleted file mode 100644 (file)
index 8d1f89d..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-########################################################################
-# Begin /etc/sysconfig/createfiles
-#
-# Description : Createfiles script config file
-#
-# Authors     :
-#
-# Version     : 00.00
-#
-# Notes       : The syntax of this file is as follows:
-#              if type is equal to "file" or "dir"
-#              <filename> <type> <permissions> <user> <group>
-#              if type is equal to "dev"
-#              <filename> <type> <permissions> <user> <group> <devtype> <major> <minor>
-#
-#              <filename> is the name of the file which is to be created
-#              <type> is either file, dir, or dev.
-#                      file creates a new file
-#                      dir creates a new directory
-#                      dev creates a new device
-#              <devtype> is either block, char or pipe
-#                      block creates a block device
-#                      char creates a character deivce
-#                      pipe creates a pipe, this will ignore the <major> and <minor> fields
-#              <major> and <minor> are the major and minor numbers used for the device.
-########################################################################
-
-# End /etc/sysconfig/createfiles
diff --git a/initscripts/sysconfig/modules b/initscripts/sysconfig/modules
deleted file mode 100644 (file)
index d6fc14c..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-########################################################################
-# Begin /etc/sysconfig/modules
-#
-# Description : Module auto-loading configuration
-#
-# Authors     :
-#
-# Version     : 00.00
-#
-# Notes       : The syntax of this file is as follows:
-#              <module> [<arg1> <arg2> ...]
-#
-# Each module should be on it's own line, and any options that you want
-# passed to the module should follow it.  The line deliminator is either
-# a space or a tab.
-########################################################################
-
-# For dialin with pppd
-ppp_generic
-
-# End /etc/sysconfig/modules
diff --git a/initscripts/sysconfig/network b/initscripts/sysconfig/network
deleted file mode 100644 (file)
index 45e537e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-HOSTNAME=ipfire.localdomain
diff --git a/initscripts/sysconfig/rc b/initscripts/sysconfig/rc
deleted file mode 100644 (file)
index ffb70d9..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# Begin /etc/sysconfig/rc
-
-# Author: DJ Lucas - dj@linuxfromscratch.org
-# Version: 1.0 LSB V.3.1
-
-# Global variable inherited by initscripts are in caps
-# Local variables for the rc script are in lowercase
-
-# Source site specific rc configuration
-. /etc/sysconfig/rc.site
-
-# This sets default terminal options.
-# stty sane - this has been removed as nobody recalls
-# the reason for it in the first place - if no problems arize,
-# then it will be removed completely at a later date.
-
-# Setup default values for the environment
-umask 022
-PATH="/bin:/sbin"
-
-# Find current screen size
-if [ -z "${COLUMNS}" ]; then
-        COLUMNS=$(stty size)
-        COLUMNS=${COLUMNS##* }
-fi
-
-# When using remote connections, such as a serial port, stty size returns 0
-if [ "${COLUMNS}" = "0" ]; then
-        COLUMNS=80
-fi
-
-## Measurements for positioning result messages
-COL=$((${COLUMNS} - 8))
-WCOL=$((${COL} - 2))
-
-# Set Cursur Position Commands, used via echo -e
-SET_COL="\\033[${COL}G"      # at the $COL char
-SET_WCOL="\\033[${WCOL}G"    # at the $WCOL char
-CURS_UP="\\033[1A\\033[0G"   # Up one line, at the 0'th char
-
-# Bootlogging and interactive startup require a valid tempfs mount
-# if this mount is not present, disable them
-if [ "${TEMPFS_MOUNT}" = "" -o ! -d "${TEMPFS_MOUNT}" ]; then
-    TEMPFS_MOUNT=""
-    iprompt=""
-    BOOTLOG_ENAB=""
-fi
-
-# Export the environment variables so they are inherited by the scripts
-export PATH SET_COL SET_WCOL CURS_UP TEMPFS_MOUNT BOOTLOG_ENAB RUNLEVEL
-
-# End /etc/sysconfig/rc
diff --git a/initscripts/sysconfig/rc.local b/initscripts/sysconfig/rc.local
deleted file mode 100644 (file)
index 90347d7..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-###############################################################################
-#                                                                             #
-# IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
-#                                                                             #
-# This program is free software: you can redistribute it and/or modify        #
-# it under the terms of the GNU General Public License as published by        #
-# the Free Software Foundation, either version 3 of the License, or           #
-# (at your option) any later version.                                         #
-#                                                                             #
-# This program is distributed in the hope that it will be useful,             #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
-# GNU General Public License for more details.                                #
-#                                                                             #
-# You should have received a copy of the GNU General Public License           #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
-#                                                                             #
-###############################################################################
-# Used for private calls after boot                                           #
-###############################################################################
-
-# power button shutdown
-if grep -q '^button' /proc/modules ; then
-    head -1 /proc/acpi/event | grep -q 'button/power PWRF' && init 0 &
-fi
diff --git a/initscripts/sysconfig/rc.site b/initscripts/sysconfig/rc.site
deleted file mode 100644 (file)
index 82b7cc7..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-# Set base directory information
-RC_BASE="/etc"
-RC_FUNCTIONS="${RC_BASE}/init.d/ipfire-functions"
-
-# Location of network device scripts and config files
-NETWORK_SCRIPTS="/etc/init.d/networking"
-NETWORK_DEVICES="/etc/sysconfig/network-devices"
-
-# Directory to store boot process accounting information
-# Used for boot logging and interactive flag when rootfs
-# is not writable
-TEMPFS_MOUNT="${RC_BASE}/init.d/boottemp"
-
-# Bootlogging (requires a tempfs mount)
-BOOTLOG_ENAB="yes"
-
-# Distro Information
-DISTRO="$(cat /etc/system-release)" # The distro name
-DISTRO_CONTACT="http://bugtracker.ipfire.org" # Bug report address
-DISTRO_MINI="ipfire" # Short name used in filenames for distro config
-
-# Define custom colors used in messages printed to the screen
-BRACKET="\\033[1;34m" # Blue
-FAILURE="\\033[1;31m" # Red
-INFO="\\033[1;36m"    # Cyan
-NORMAL="\\033[0;39m"  # Grey
-SUCCESS="\\033[1;32m" # Green
-WARNING="\\033[1;33m" # Yellow
-
-# Prefix boot messages for easier reading on framebuffer consoles
-PREFIX_SUCCESS=" ${SUCCESS}*${NORMAL} "
-PREFIX_WARNING="${WARNING}**${NORMAL} "
-PREFIX_FAILURE="${FAILURE}***${NORMAL}"
-
-# Export varialbles so that they are inherited by the initscripts
-export RC_BASE RC_FUNCTIONS TEMPFS_MOUNT BOOTLOG_ENAB
-export NETWORK_DEVICES NETWORK_SCRIPTS
-export DISTRO DISTRO_CONTACT DISTRO_MINI
-export BRACKET FAILURE INFO NORMAL SUCCESS WARNING
-export PREFIX_SUCCESS PREFIX_WARNING PREFIX_FAILURE
-
-# Interactive startup
-iprompt="yes" # Wether to display the interactive boot promp
-itime="2" # The ammount of time (in seconds) to display the prompt
-dlen="$(( 11 + ${#DISTRO} ))" # The total length of the distro welcome string
-ilen="38" # The total length of the interactive message
-welcome_message="Welcome to ${INFO}${DISTRO}${NORMAL}"
-i_message="Press '${FAILURE}I${NORMAL}' to enter interactive startup"
-
-# Error message displayed when a script's exit value is not zero
-print_error_msg()
-{
-    # ${link} and ${error_value} are defined by the rc script
-    echo -e "${FAILURE}FAILURE:  You should not be reading this error message."
-    echo -e ""
-    echo -e -n "${FAILURE}It means that an unforseen error took place in"
-    echo -e -n "${INFO} ${link}"
-    echo -e "${FAILURE},"
-    echo -e "${FAILURE}which exited with a return value of ${error_value}."
-    echo -e ""
-    echo -e -n "${FAILURE}If you are able to track this error down to a bug"
-    echo -e "${FAILURE}in one of the files"
-    echo -e -n "provided by ${INFO}${DISTRO}${FAILURE}, "
-    echo -e -n "${FAILURE}please be so kind to inform us at "
-    echo -e "${INFO}${DISTRO_CONTACT}${FAILURE}.${NORMAL}"
-    echo -e ""
-    echo -e "${INFO}Press Enter to continue..."
-    echo -e "${NORMAL}"
-    read ENTER
-}
-
diff --git a/initscripts/sysctl.conf b/initscripts/sysctl.conf
deleted file mode 100644 (file)
index 25d8c92..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-net.ipv4.ip_forward = 1
-net.ipv4.ip_dynaddr = 1
-net.ipv4.icmp_echo_ignore_broadcasts = 1
-net.ipv4.icmp_ignore_bogus_error_responses = 1
-
-net.ipv4.tcp_sack = 0
-net.ipv4.tcp_timestamps = 0
-net.ipv4.tcp_syncookies = 1
-net.ipv4.tcp_fin_timeout = 30
-net.ipv4.tcp_window_scaling = 0
-net.ipv4.tcp_syn_retries = 3
-net.ipv4.tcp_synack_retries = 3
-
-net.ipv4.conf.default.rp_filter = 0
-net.ipv4.conf.default.accept_redirects = 0
-net.ipv4.conf.default.accept_source_route = 0
-net.ipv4.conf.default.log_martians = 1
-
-net.ipv4.conf.all.rp_filter = 0
-net.ipv4.conf.all.accept_redirects = 0
-net.ipv4.conf.all.accept_source_route = 0
-net.ipv4.conf.all.log_martians = 1
-
-# IPv6 settings
-net.ipv6.conf.default.forwarding = 1
-net.ipv6.conf.default.autoconf = 0
-
-kernel.printk = 1 4 1 7
diff --git a/initscripts/systemd/rc-local.service b/initscripts/systemd/rc-local.service
new file mode 100644 (file)
index 0000000..04daed0
--- /dev/null
@@ -0,0 +1,15 @@
+[Unit]
+Description=/etc/rc.local Compatiblity
+ConditionFileIsExecuteable=/etc/rc.local
+Requires=multi-user.target
+After=multi-user.target network.target
+
+[Service]
+Type=forking
+ExecStart=/etc/rc.local
+TimeoutSec=0
+StandardOutput=tty
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/initscripts/udev/10-console.rules b/initscripts/udev/10-console.rules
deleted file mode 100644 (file)
index e7609c5..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# do not edit this file, it will be overwritten on update
-
-ACTION!="add", GOTO="console_end"
-
-# Console initialization - keyboard, font, etc.
-KERNEL=="tty0",                RUN+="/lib/udev/console_init %k"
-
-# Check and set up serial and serial-like consoles if necessary
-KERNEL=="console",     RUN+="/lib/udev/console_check %k"
-KERNEL=="ttySG*",      RUN+="/lib/udev/console_check %k"
-KERNEL=="xvc*",                RUN+="/lib/udev/console_check %k"
-KERNEL=="hvsi*",       RUN+="/lib/udev/console_check %k"
-KERNEL=="hvc*",                RUN+="/lib/udev/console_check %k"
-
-LABEL="console_end"
index 23608e23ce6c829a7501c3ab48a01ccccf8e53ac..fde1b3ae8034b756ee9aa0b5fd74a4aaa9c912ee 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = intltool
-version    = 0.40.5
+version    = 0.40.6
 release    = 1
 arch       = noarch
 
@@ -19,14 +19,14 @@ description
        them in the po files.
 end
 
-source_dl  =
+source_dl  = http://ftp.gnome.org/pub/gnome/sources/intltool/0.40/
 sources    = %{thisapp}.tar.bz2
 
 build
        requires
                expat-devel
                gettext
-               perl-XML-Parser
+               perl(XML::Parser)
        end
 
        configure_options += \
@@ -35,6 +35,9 @@ end
 
 packages
        package %{name}
-               requires = gettext perl-XML-Parser
+               requires
+                       gettext
+                       perl(XML::Parser)
+               end
        end
 end
diff --git a/iperf/iperf.nm b/iperf/iperf.nm
new file mode 100644 (file)
index 0000000..d7612c5
--- /dev/null
@@ -0,0 +1,37 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = iperf
+version    = 2.0.5
+release    = 1
+
+maintainer = Christian Schmidt <christian.schmidt@ipfire.org>
+groups     = Applications/Internet
+url        = http://www..sourceforge.net/projects/iperf/files/
+license    = GPLv3+ and LGPLv3+
+summary    = Measurement tool for TCP/UDP bandwidth performance
+
+description
+       Iperf is a tool to measure maximum TCP bandwidth, allowing the tuning of
+       various parameters and UDP characteristics. Iperf reports bandwidth, delay
+       jitter, datagram loss.
+end
+
+source_dl = http://sourceforge.net/projects/iperf/files
+
+build
+       requires
+               gcc-c++
+       end
+end
+
+packages
+       package %{name}
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
index 14fe817cc01dcb21a70998dc5c8993ce25918538..bf13e4a9d049c1bdd9fbaecdc90f076f2a41683e 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = iproute2
 version    = 2.6.39
-release    = 1
+release    = 2
 
-groups     = Base Networking/Tools
+groups     = Networking/Tools
 url        = http://www.linuxfoundation.org/en/Net:Iproute2
 license    = GPLv2+
 summary    = Advanced IP routing and network device configuration tools.
@@ -41,5 +41,10 @@ end
 
 packages
        package %{name}
+               groups += Base
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index b7ce6aa3dcade3e1df4d959fffa9f584743d96b2..ef8c3d04d281bcccc93c18cbe6429f00897e235d 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = iptables
-version    = 1.4.12
+version    = 1.4.12.1
 release    = 1
 
 groups     = Networking/Tools
@@ -18,7 +18,7 @@ description
        you should install this package.
 end
 
-source_dl  =
+source_dl  = http://ftp.netfilter.org/pub/iptables/
 sources    = %{thisapp}.tar.bz2
 
 build
@@ -79,8 +79,12 @@ packages
        package %{name}
                groups += Base
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 27b5fdef8b83d147693923e67cf42ccb5d313826..d45eb92a887e14963d50a1fcce46b434b27e5831 100644 (file)
@@ -5,21 +5,21 @@
 
 name       = iputils
 version    = s20071127
-release    = 1
+release    = 3
 
-groups     = Base Networking/Tools
+groups     = Networking/Tools
 url        = http://www.skbuff.net/iputils
 license    = BSD
 summary    = Network monitoring tools including ping.
 
 description
-       The iputils package contains basic utilities for monitoring a network, \
-       including ping. The ping command sends a series of ICMP protocol \
-       ECHO_REQUEST packets to a specified network host to discover whether \
+       The iputils package contains basic utilities for monitoring a network,
+       including ping. The ping command sends a series of ICMP protocol
+       ECHO_REQUEST packets to a specified network host to discover whether
        the target machine is alive and receiving network traffic.
 end
 
-source_dl  =
+source_dl  = http://www.skbuff.net/iputils/
 sources    = %{thisapp}.tar.bz2
 
 patches    = %{thisapp}-addrcache.patch
@@ -37,12 +37,19 @@ patches   += %{thisapp}-output.patch
 
 build
        requires
+               docbook-utils
                libcap-devel
                libidn-devel
        end
 
+       # Generate manpages with docbook.
+       build_cmds
+               make -C doc man
+       end
+
        install
                mkdir -pv %{BUILDROOT}/{bin,sbin} %{BUILDROOT}/usr/sbin
+               mkdir -pv %{BUILDROOT}/usr/share/man/man8
 
                install -cp clockdiff   %{BUILDROOT}/usr/sbin/
                install -cp arping      %{BUILDROOT}/sbin/
@@ -52,11 +59,20 @@ build
                install -cp tracepath   %{BUILDROOT}/bin/
                install -cp tracepath6  %{BUILDROOT}/bin/
 
+               install -cp doc/clockdiff.8 %{BUILDROOT}/usr/share/man/man8/
+               install -cp doc/arping.8 %{BUILDROOT}/usr/share/man/man8/
+               install -cp doc/ping.8 %{BUILDROOT}/usr/share/man/man8/
+               install -cp doc/rdisc.8 %{BUILDROOT}/usr/share/man/man8/
+               install -cp doc/tracepath.8 %{BUILDROOT}/usr/share/man/man8/
+
                ln -svf ../../sbin/arping       %{BUILDROOT}/usr/sbin/arping
                ln -svf ../../bin/ping6         %{BUILDROOT}/usr/sbin/
                ln -svf ../../bin/tracepath     %{BUILDROOT}/usr/sbin/
                ln -svf ../../bin/tracepath6    %{BUILDROOT}/usr/sbin/
 
+               ln -s ping.8 %{BUILDROOT}/usr/share/man/man8/ping6.8
+               ln -s tracepath.8 %{BUILDROOT}/usr/share/man/man8/tracepath6.8
+
                setcap cap_net_admin=ep %{BUILDROOT}/bin/ping
                setcap cap_net_admin=ep %{BUILDROOT}/bin/ping6
        end
@@ -64,5 +80,10 @@ end
 
 packages
        package %{name}
+               groups += Base
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 01e61c8df35d6808034f87423ab7ddd5e880d463..ac1dbd4932eb1fcedadd92230d4b1da20160d451 100644 (file)
@@ -78,21 +78,25 @@ end
 packages
        package %{name}
        end
-       
+
        package libiscsi
                template LIBS
-       
+
                files
                        /usr/lib*/libiscsi.so.*
                end
        end
-       
+
        package libiscsi-devel
                template DEVEL
-       
+
                files
                        /usr/lib/libiscsi.so
                        /usr/include
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/isdn4k-utils/40-isdn.rules b/isdn4k-utils/40-isdn.rules
new file mode 100644 (file)
index 0000000..1a31cb6
--- /dev/null
@@ -0,0 +1,4 @@
+# do not edit this file, it will be overwritten on update
+
+SUBSYSTEM=="capi", KERNEL=="capi", NAME="capi20", GROUP="dialout"
+SUBSYSTEM=="tty", KERNEL=="capi[0-9]*", NAME="capi/%n"
diff --git a/isdn4k-utils/capi20.conf b/isdn4k-utils/capi20.conf
new file mode 100644 (file)
index 0000000..c0ac223
--- /dev/null
@@ -0,0 +1,18 @@
+# libcapi20 features autodetection of connected CAPI
+# devices. In case you need to select a special device
+# use the remote configuration file:
+#   ~/.capi20rc
+# if it doesn't exist look for
+#   /etc/capi20.conf
+# 
+# To set the remote machine, the above file need to have
+# the following line
+#   REMOTE <driver> <remote hostname|ip-address> <remote port>
+#  
+# Drivers:
+#      * fritzbox      - Remote CAPI via FRITZ!Box
+#      * rcapi         - Melware Remote CAPI
+# 
+# If this doesn't exist, the library tries the old, normal way
+# of using the local /dev/isdn/capi20.
+# REMOTE fritzbox 192.168.178.1 5031
diff --git a/isdn4k-utils/isdn4k-utils.nm b/isdn4k-utils/isdn4k-utils.nm
new file mode 100644 (file)
index 0000000..49998d5
--- /dev/null
@@ -0,0 +1,121 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = isdn4k-utils
+version    = 3.2
+devel_ver  = CVS-2010-05-01
+release    = 4
+thisapp    = %{name}-%{devel_ver}-patched
+
+groups     = Networking/Tools
+url        =
+license    = GPLv2+ and GPL+ and MIT and BSD and zlib
+summary    = Utilities for configuring an ISDN subsystem.
+
+description
+       The isdn4k-utils package contains a collection of utilities needed
+       for configuring and running an ISDN subsystem.
+end
+
+source_dl  = ftp://ftp.isdn4linux.de/pub/isdn4linux/utils/
+sources    = %{thisapp}.tar.bz2
+
+build
+       requires
+               autoconf
+               automake
+               libpcap-devel
+               libtool
+               ncurses-devel
+               ppp-devel
+               perl
+       end
+
+       CFLAGS += \
+               -D_FILE_OFFSET_BITS=64 \
+               -D_LARGEFILE_SOURCE
+
+       prepare_cmds
+               # remove useless files
+               find -type d -name CVS | xargs rm -rf
+
+               # enable capi20.new
+               rm -rf capi20 && mv capi20.new capi20
+
+               # Reconfigure the whole package
+               for i in */configure; do
+                       cd `dirname $i`
+                       autoreconf --force --install || exit 1
+                       cd ..
+               done
+
+               # Set configuration
+               mv .config.rpm .config
+               sed -e "s/^CONFIG_BUILDX11=.*/#&/" -i .config
+               sed -e "s/^CONFIG_VBOX=.*/#&/" -i .config
+               sed -e "s/^CONFIG_XMONISDN=.*/#&/" -i .config
+               sed -e "s/^CONFIG_XISDNLOAD=.*/#&/" -i .config
+               echo "CONFIG_GENMAN=y" >> .config
+               echo "CONFIG_FAQ=y" >> .config
+               echo "CONFIG_FAQDIR='/usr/share/doc/isdn4k-utils'" >> .config
+               echo "CONFIG_DATADIR='/usr/share/isdn'" >> .config
+               echo "LIBDIR='/usr/lib'" >> .config
+               echo "CONFIG_FIRMWAREDIR='/usr/share/isdn'" >> .config
+               echo "CONFIG_CARD_SBINDIR='/sbin'" >> .config
+               sed -e "s,',,g" .config > .config.h
+       end
+
+       build
+               make subconfig
+
+               make CFLAGS="%{CFLAGS}"
+       end
+
+       install
+               mkdir -pv %{BUILDROOT}/usr/sbin
+               make install CFLAGS="%{CFLAGS}" DESTDIR="%{BUILDROOT}"
+
+               # Install udev rules for isdn.
+               mkdir -pv %{BUILDROOT}/lib/udev/rules.d/
+               install -m 644 %{DIR_SOURCE}/40-isdn.rules %{BUILDROOT}/lib/udev/rules.d/
+
+               # Install config files for capi.
+               mkdir -pv %{BUILDROOT}/etc
+               install -m 644 capiinit/capi.conf %{BUILDROOT}/etc
+               install -m 644 %{DIR_SOURCE}/capi20.conf %{BUILDROOT}/etc
+       end
+end
+
+packages
+       package %{name}
+               prerequires += systemd-units
+
+               script postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       /bin/systemctl --no-reload disable capi.service isdn.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop capi.service isdn.service >/dev/null 2>&1 || :
+               end
+
+               script postun
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl try-restart capi.service isdn.service >/dev/null 2>&1 || :
+               end
+       end
+
+       package %{name}-devel
+               template DEVEL
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
diff --git a/isdn4k-utils/patches/isdn4k-utils-0202131200-true.patch b/isdn4k-utils/patches/isdn4k-utils-0202131200-true.patch
new file mode 100644 (file)
index 0000000..33ef17c
--- /dev/null
@@ -0,0 +1,13 @@
+--- isdn4k-utils/imon/imon.c.orig      Fri Feb 22 17:24:54 2002
++++ isdn4k-utils/imon/imon.c   Fri Feb 22 17:28:00 2002
+@@ -63,6 +63,10 @@
+ #include <linux/isdn.h>
++#ifndef TRUE
++#define TRUE 1
++#endif
++
+ #define KEY_Q                81
+ #define KEY_q               113
diff --git a/isdn4k-utils/patches/isdn4k-utils-CVS-2004-11-18-autoconf25x.patch b/isdn4k-utils/patches/isdn4k-utils-CVS-2004-11-18-autoconf25x.patch
new file mode 100644 (file)
index 0000000..fa8dd31
--- /dev/null
@@ -0,0 +1,564 @@
+--- isdn4k-utils-CVS-2004-11-18/vbox/configure.in.ac25x        1998-11-23 10:18:04.000000000 +0100
++++ isdn4k-utils-CVS-2004-11-18/vbox/configure.in      2004-11-18 17:47:52.638741078 +0100
+@@ -17,9 +17,9 @@
+ AC_PREFIX_DEFAULT()
+-AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE}")
+-AC_DEFINE_UNQUOTED(VERSION, "${VERSION}")
+-AC_DEFINE_UNQUOTED(VERDATE, "${VERDATE}")
++AC_DEFINE_UNQUOTED(PACKAGE, "${PACKAGE}", [package])
++AC_DEFINE_UNQUOTED(VERSION, "${VERSION}", [version])
++AC_DEFINE_UNQUOTED(VERDATE, "${VERDATE}", [verdate])
+ AC_SUBST(PACKAGE)
+ AC_SUBST(VERSION)
+@@ -87,7 +87,7 @@
+ AC_MSG_RESULT(${VBOX_SPOOLDIR})
+-AC_DEFINE_UNQUOTED(SPOOLDIR, "${VBOX_SPOOLDIR}")
++AC_DEFINE_UNQUOTED(SPOOLDIR, "${VBOX_SPOOLDIR}", [spool dir])
+ AC_SUBST(VBOX_SPOOLDIR)
+    dnl #===============#
+@@ -105,7 +105,7 @@
+ AC_MSG_RESULT(${VBOX_LOGDIR})
+-AC_DEFINE_UNQUOTED(LOGFILEDIR, "${VBOX_LOGDIR}")
++AC_DEFINE_UNQUOTED(LOGFILEDIR, "${VBOX_LOGDIR}", [log dir])
+ AC_SUBST(VBOX_LOGDIR)
+    dnl #===============#
+@@ -123,7 +123,7 @@
+ AC_MSG_RESULT(${VBOX_PIDDIR})
+-AC_DEFINE_UNQUOTED(PIDFILEDIR, "${VBOX_PIDDIR}")
++AC_DEFINE_UNQUOTED(PIDFILEDIR, "${VBOX_PIDDIR}", [pid dir])
+ AC_SUBST(VBOX_PIDDIR)
+    dnl #================#
+@@ -141,7 +141,7 @@
+ AC_MSG_RESULT(${VBOX_LCKDIR})
+-AC_DEFINE_UNQUOTED(LCKFILEDIR, "${VBOX_LCKDIR}")
++AC_DEFINE_UNQUOTED(LCKFILEDIR, "${VBOX_LCKDIR}", [lock dir])
+ AC_SUBST(VBOX_LCKDIR)
+    dnl #===================#
+@@ -159,7 +159,7 @@
+ AC_MSG_RESULT(${ISDN_GLOBAL_CONFIG})
+-AC_DEFINE_UNQUOTED(I4LCONFDIR, "${ISDN_GLOBAL_CONFIG}")
++AC_DEFINE_UNQUOTED(I4LCONFDIR, "${ISDN_GLOBAL_CONFIG}", [global config])
+ dnl #------------------------------------------------------------------------#
+ dnl # Check and optimize compiler flags:                                     #
+--- isdn4k-utils-CVS-2004-11-18/vbox/acinclude.m4.ac25x        2002-07-06 02:11:19.000000000 +0200
++++ isdn4k-utils-CVS-2004-11-18/vbox/acinclude.m4      2004-11-18 17:47:52.639740930 +0100
+@@ -49,23 +49,23 @@
+          cos,
+          AC_CHECK_LIB(dl,
+             dlerror,
+-            [AC_CHECK_LIB(${gnd_1st_tcl_lib_test},
++            AC_CHECK_LIB(${gnd_1st_tcl_lib_test},
+                Tcl_CreateInterp,
+                LINK_TCL_LIBS="${gnd_tcl_lib_dir} -l${gnd_1st_tcl_lib_test} -lm -ldl",
+-               [AC_CHECK_LIB(${gnd_2nd_tcl_lib_test},
++               AC_CHECK_LIB(${gnd_2nd_tcl_lib_test},
+                   Tcl_CreateInterp,
+                   LINK_TCL_LIBS="${gnd_tcl_lib_dir} -l${gnd_2nd_tcl_lib_test} -lm -ldl",
+-                  [AC_CHECK_LIB(${gnd_3rd_tcl_lib_test},
++                  AC_CHECK_LIB(${gnd_3rd_tcl_lib_test},
+                      Tcl_CreateInterp,
+                      LINK_TCL_LIBS="${gnd_tcl_lib_dir} -l${gnd_3rd_tcl_lib_test} -lm -ldl",
+                      ,
+                      ${gnd_tcl_lib_dir} -lm -ldl
+-                  )],
++                  ),
+                   ${gnd_tcl_lib_dir} -lm -ldl
+-               )],
++               ),
+                ${gnd_tcl_lib_dir} -lm -ldl
+-            )],
+-         )],
++            ),
++         ),
+       )
+       if (test "${LINK_TCL_LIBS}" != "")
+@@ -154,7 +154,7 @@
+          AC_CHECK_LIB(ncurses,
+             resizeterm,
+-            AC_DEFINE(HAVE_RESIZETERM)
++            AC_DEFINE(HAVE_RESIZETERM, 1, [have resizeterm])
+ )
+       fi
+--- isdn4k-utils-CVS-2004-11-18/vbox/aclocal.m4.ac25x  2002-07-06 02:11:19.000000000 +0200
++++ isdn4k-utils-CVS-2004-11-18/vbox/aclocal.m4        2004-11-18 17:47:52.640740782 +0100
+@@ -61,23 +61,23 @@
+          cos,
+          [AC_CHECK_LIB(dl,
+             dlerror,
+-            [AC_CHECK_LIB(${gnd_1st_tcl_lib_test},
++            AC_CHECK_LIB(${gnd_1st_tcl_lib_test},
+                Tcl_CreateInterp,
+                LINK_TCL_LIBS="${gnd_tcl_lib_dir} -l${gnd_1st_tcl_lib_test} -lm -ldl",
+-               [AC_CHECK_LIB(${gnd_2nd_tcl_lib_test},
++               AC_CHECK_LIB(${gnd_2nd_tcl_lib_test},
+                   Tcl_CreateInterp,
+                   LINK_TCL_LIBS="${gnd_tcl_lib_dir} -l${gnd_2nd_tcl_lib_test} -lm -ldl",
+-                  [AC_CHECK_LIB(${gnd_3rd_tcl_lib_test},
++                  AC_CHECK_LIB(${gnd_3rd_tcl_lib_test},
+                      Tcl_CreateInterp,
+                      LINK_TCL_LIBS="${gnd_tcl_lib_dir} -l${gnd_3rd_tcl_lib_test} -lm -ldl",
+                      ,
+                      ${gnd_tcl_lib_dir} -lm -ldl
+-                  )],
++                  ),
+                   ${gnd_tcl_lib_dir} -lm -ldl
+-               )],
++               ),
+                ${gnd_tcl_lib_dir} -lm -ldl
+-            )],
+-         )],
++            ),
++         ),
+       )
+       if (test "${LINK_TCL_LIBS}" != "")
+@@ -103,15 +103,7 @@
+                HAVE_TCL_INCL="y"
+                LINK_TCL_INCL="${gnd_tcl_inc_dir}"
+-            fi
+-         else
+-            AC_MSG_CHECKING("for tcl header in /usr/include/tcl8.3/tcl.h")
+-            if (test -e "/usr/include/tcl8.3/tcl.h")
+-            then
+-               AC_MSG_RESULT("yes")
+-               HAVE_TCL_INCL="y"
+-               LINK_TCL_INCL="-I/usr/include/tcl8.3"
+-            else
++                      else
+                AC_MSG_RESULT("no")
+             fi
+          fi
+--- isdn4k-utils-CVS-2004-11-18/ipppd/configure.in.ac25x       2004-08-30 16:56:36.000000000 +0200
++++ isdn4k-utils-CVS-2004-11-18/ipppd/configure.in     2004-11-18 17:55:56.899083430 +0100
+@@ -17,21 +17,21 @@
+ AC_PROG_CC
+ dnl Checks for libraries.
+-AC_CHECK_LIB(bsd, daemon,HAVE_LIBBSD=1; AC_DEFINE(HAVE_LIBBSD),
++AC_CHECK_LIB(bsd, daemon,HAVE_LIBBSD=1; AC_DEFINE(HAVE_LIBBSD,1,[libbsd]),
+       [AC_MSG_WARN(Could not find libbsd, build disabled)])
+ dnl Replace `main' with a function in -lcrypt:
+-AC_CHECK_LIB(crypt, main,HAVE_LIBCRYPT=1; AC_DEFINE(HAVE_LIBCRYPT))
+-AC_CHECK_LIB(des, des_ecb_encrypt, HAVE_LIBDES=1; AC_DEFINE(HAVE_LIBDES))
+-AC_CHECK_LIB(ssl, DES_ecb_encrypt, HAVE_LIBSSL=1; AC_DEFINE(HAVE_LIBSSL))
++AC_CHECK_LIB(crypt, main,HAVE_LIBCRYPT=1; AC_DEFINE(HAVE_LIBCRYPT,1,[libcrypt]))
++AC_CHECK_LIB(des, des_ecb_encrypt, HAVE_LIBDES=1; AC_DEFINE(HAVE_LIBDES,1,[libdes]))
++AC_CHECK_LIB(ssl, DES_ecb_encrypt, HAVE_LIBSSL=1; AC_DEFINE(HAVE_LIBSSL,1,[libssl]))
+ dnl Checks for header files.
+ AC_HEADER_STDC
+ AC_HEADER_SYS_WAIT
+ AC_CHECK_HEADERS(fcntl.h limits.h paths.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h)
+-AC_CHECK_HEADER(shadow.h, HAVE_SHADOW_H=1; AC_DEFINE(HAVE_SHADOW_H))
+-AC_CHECK_HEADER(linux/isdn_lzscomp.h, HAVE_LZSCOMP_H=1; AC_DEFINE(HAVE_LZSCOMP_H))
+-AC_CHECK_HEADER(pcap-bpf.h, [HAVE_PCAP_BPF_H=1; AC_DEFINE(HAVE_PCAP_BPF_H)],
+-      [AC_CHECK_HEADER(net/bpf.h, [HAVE_NET_BPF_H=1; AC_DEFINE(HAVE_NET_BPF_H)],
++AC_CHECK_HEADER(shadow.h, HAVE_SHADOW_H=1; AC_DEFINE(HAVE_SHADOW_H,1,[have shadow.h]))
++AC_CHECK_HEADER(linux/isdn_lzscomp.h, HAVE_LZSCOMP_H=1; AC_DEFINE(HAVE_LZSCOMP_H,1,[isdn_lzscomp.h]))
++AC_CHECK_HEADER(pcap-bpf.h, [HAVE_PCAP_BPF_H=1; AC_DEFINE(HAVE_PCAP_BPF_H,1,[pcap-bpf.h])],
++      [AC_CHECK_HEADER(net/bpf.h, [HAVE_NET_BPF_H=1; AC_DEFINE(HAVE_NET_BPF_H,1,[net/bpf.h])],
+               [AC_MSG_ERROR(Could not find pcap header file)])])
+ dnl Checks for typedefs, structures, and compiler characteristics.
+@@ -51,62 +51,63 @@
+ AC_ARG_WITH(sbin,
+       [  --with-sbin=DIR         Set directory where ipppd is istalled. [/sbin]],
+       CONFIG_SBINDIR="${withval}"
+-      AC_DEFINE(CONFIG_SBINDIR,"${withval}"),
++      AC_DEFINE(CONFIG_SBINDIR,"${withval}",[sbin dir]),
+ )
+ dnl Optional man directory
+ AC_ARG_WITH(sbin,
+       [  --with-man=DIR          Set manpage directory. [/usr/man]],
+       CONFIG_MANDIR="${withval}"
+-      AC_DEFINE(CONFIG_MANDIR,"${withval}"),
++      AC_DEFINE(CONFIG_MANDIR,"${withval}",[man dir]),
+ )
+ dnl Optional /var/run directory
+ AC_ARG_WITH(sbin,
+       [  --with-varrun=DIR       Set directory for .pid files. [/var/run]],
+       CONFIG_RUNDIR="${withval}"
+-      AC_DEFINE(CONFIG_RUNDIR,"${withval}"),
++      AC_DEFINE(CONFIG_RUNDIR,"${withval}",[/var/run dir]),
+ )
+ dnl Optional MSCHAP
+ AC_ARG_ENABLE(mschap,
+       [  --enable-mschap         Enable Microsoft chap authentication [no]],
+       CONFIG_IPPPD_MSCHAP="y"
+-      AC_DEFINE(CONFIG_IPPPD_MSCHAP,"y"),
++      AC_DEFINE(CONFIG_IPPPD_MSCHAP,"y",[support M$-chap]),
+ )
+ dnl Optional RADIUS
+ AC_ARG_ENABLE(radius,
+       [  --enable-radius         Enable RADIUS authentication [no]],
+       CONFIG_IPPPD_RADIUS="y"
+-      AC_DEFINE(CONFIG_IPPPD_RADIUS,"y"),
++      AC_DEFINE(CONFIG_IPPPD_RADIUS,"y",[support radius]),
+ )
+ dnl Optional radiusclient config file
+ AC_ARG_WITH(radiusclient_config,
+       [  --with-radiusclient=FILE Set filename for radiusclient configuration],
+       RADIUS_CLIENT_CONFIG_FILE="${withval}"
+-      AC_DEFINE(RADIUS_CLIENT_CONFIG_FILE,"${withval}"),
++      AC_DEFINE(RADIUS_CLIENT_CONFIG_FILE,"${withval}",[radius config]),
+ )
+ dnl Optional RADIUS_WTMP_LOGGING
+ AC_ARG_ENABLE(radius_wtmp_logging,
+       [  --enable-radius-wtmp       Enable RADIUS_WTMP_LOGGING authentication [no]],
+       CONFIG_IPPPD_RADIUS_WTMP_LOGGING="y"
+-      AC_DEFINE(CONFIG_IPPPD_RADIUS_WTMP_LOGGING,"y"),
++      AC_DEFINE(CONFIG_IPPPD_RADIUS_WTMP_LOGGING,"y",[radius logging]),
+ )
+ dnl Optional DEBUGGING
+ AC_ARG_ENABLE(debug,
+       [  --enable-debug          Enable debugging [no]],
+       CONFIG_IPPPD_DEBUGFLAGS="-DDEBUGALL"
+-      AC_DEFINE(CONFIG_IPPPD_DEBUGFLAGS,"-DDEBUGALL"),
++      AC_DEFINE(CONFIG_IPPPD_DEBUGFLAGS,"-DDEBUGALL",[options]),
+ )
+ AC_ARG_ENABLE(ippp-filter,
+       [  --enable-ippp-filter    Enable IPPP Filters (needs kernel supports) [no]],
+       CONFIG_IPPP_FILTER="y"
+       AC_DEFINE(CONFIG_IPPP_FILTER,"y"),
++      AC_DEFINE(CONFIG_IPPP_FILTER,"y", [ipppd filter]),
+ )
+ AC_SUBST(I4LVERSION)
+--- isdn4k-utils-CVS-2004-11-18/isdnlog/configure.in.ac25x     2004-10-28 03:53:29.000000000 +0200
++++ isdn4k-utils-CVS-2004-11-18/isdnlog/configure.in   2004-11-18 17:47:52.642740487 +0100
+@@ -79,45 +79,46 @@
+ dnl To make it possible to set variables in policy.h
+ dnl they have to be defined with AC_DEFINE...
+ dnl
+-AC_DEFINE_UNQUOTED(OLDCONFDIR,"$OLDCONFDIR")
+-AC_DEFINE_UNQUOTED(OLDCONFFILE,"$OLDCONFFILE")
+-AC_DEFINE_UNQUOTED(DATADIR,"$datadir")
+-AC_DEFINE_UNQUOTED(SERV_PORT,$SERV_PORT)
+-AC_DEFINE_UNQUOTED(USERFILE,"$USERFILE")
+-AC_DEFINE_UNQUOTED(LOGFILE,"$LOGFILE")
+-AC_DEFINE_UNQUOTED(CHARGEFILE,"$CHARGEFILE")
+-AC_DEFINE_UNQUOTED(RELOADCMD,"$RELOADCMD")
+-AC_DEFINE_UNQUOTED(STOPCMD,"$STOPCMD")
+-AC_DEFINE_UNQUOTED(REBOOTCMD,"$REBOOTCMD")
++AC_DEFINE_UNQUOTED(OLDCONFDIR,"$OLDCONFDIR", [old config dir])
++AC_DEFINE_UNQUOTED(OLDCONFFILE,"$OLDCONFFILE", [old config file])
++AC_DEFINE_UNQUOTED(DATADIR,"$datadir", [data dir])
++AC_DEFINE_UNQUOTED(SERV_PORT,$SERV_PORT, [server port])
++AC_DEFINE_UNQUOTED(USERFILE,"$USERFILE", [user file])
++AC_DEFINE_UNQUOTED(LOGFILE,"$LOGFILE", [log file])
++AC_DEFINE_UNQUOTED(CHARGEFILE,"$CHARGEFILE", [charge file])
++AC_DEFINE_UNQUOTED(RELOADCMD,"$RELOADCMD", [reload command])
++AC_DEFINE_UNQUOTED(STOPCMD,"$STOPCMD", [stop command])
++AC_DEFINE_UNQUOTED(REBOOTCMD,"$REBOOTCMD", [reboot command])
++
+ if test "$CONFIG_ISDN_LOG_DE" = "y" ; then
+       NATION="de"
+       NATION_MACRO="ISDN_DE"
+-      AC_DEFINE(ISDN_DE)
++      AC_DEFINE(ISDN_DE, 1, [German ISDN])
+ fi
+ if test "$CONFIG_ISDN_LOG_AT" = "y" ; then
+       NATION="at"
+       NATION_MACRO="ISDN_AT"
+-      AC_DEFINE(ISDN_AT)
++      AC_DEFINE(ISDN_AT, 1, [Austrian ISDN])
+ fi
+ if test "$CONFIG_ISDN_LOG_CH" = "y" ; then
+       NATION="ch"
+       NATION_MACRO="ISDN_CH"
+-      AC_DEFINE(ISDN_CH)
++      AC_DEFINE(ISDN_CH, 1, [Swiss ISDN])
+ fi
+ if test "$CONFIG_ISDN_LOG_NL" = "y" ; then
+       NATION="nl"
+       NATION_MACRO="ISDN_NL"
+-      AC_DEFINE(ISDN_NL)
++      AC_DEFINE(ISDN_NL, 1, [Dutch ISDN])
+ fi
+ if test "$CONFIG_ISDN_LOG_LU" = "y" ; then
+       NATION="lu"
+       NATION_MACRO="ISDN_LU"
+-      AC_DEFINE(ISDN_LU)
++      AC_DEFINE(ISDN_LU, 1, [Luxembourg ISDN])
+ fi
+ if test "$CONFIG_ISDN_LOG_XX" = "y" ; then
+       NATION=$CONFIG_ISDN_LOG_CC
+       NATION_MACRO="ISDN_XX"
+-      AC_DEFINE(ISDN_XX)
++      AC_DEFINE(ISDN_XX, 1, [Other country])
+ fi
+ dnl Checks for programs.
+@@ -130,17 +131,17 @@
+ dnl Checks for libraries.
+ if test -e tools/cdb/i4l_cdb.c  ; then
+-    AC_DEFINE(USE_CDB)
++    AC_DEFINE(USE_CDB, 1, [Use CDB])
+     CDBEXTRALIBS="tools/cdb/i4l_cdb.a"
+     DBEXT=".cdb"
+     RDBEXT=".cdb"
+     AC_MSG_RESULT(Using 'cdb' as database)
+ else
+-AC_CHECK_LIB(gdbm, gdbm_open, DBMLIB=-lgdbm; AC_DEFINE(HAVE_LIBGDBM),
+-      [AC_CHECK_LIB(dbm, dbm_open, DBMLIB=-ldbm; AC_DEFINE(HAVE_LIBDBM),
+-              [AC_CHECK_LIB(db, dbm_open, DBMLIB=-ldb; AC_DEFINE(HAVE_LIBDB))])])
++AC_CHECK_LIB(gdbm, gdbm_open, DBMLIB=-lgdbm; AC_DEFINE(HAVE_LIBGDBM, 1, [Use libgdbm]),
++      AC_CHECK_LIB(dbm, dbm_open, DBMLIB=-ldbm; AC_DEFINE(HAVE_LIBDBM, 1, [Use libdbm]),
++              AC_CHECK_LIB(db, dbm_open, DBMLIB=-ldb; AC_DEFINE(HAVE_LIBDB, 1, [use libdb]))))
+ fi
+-AC_DEFINE_UNQUOTED(RDBEXT,"$RDBEXT")
++AC_DEFINE_UNQUOTED(RDBEXT,"$RDBEXT",[rdb extension])
+ dnl log database support
+ AC_CHECK_POSTGRES
+@@ -158,7 +159,7 @@
+ dnl Manual config
+ AC_ARG_WITH(isdnlib,
+       [  --with-isdnlib=DIR      Set isdn library [../lib]],
+-      LIBISDNDIR=$withval; AC_DEFINE_UNQUOTED(LIBISDNDIR,"$withval"))
++      LIBISDNDIR=$withval; AC_DEFINE_UNQUOTED(LIBISDNDIR,"$withval",[libisdn dir]))
+ AC_ARG_WITH(area-lib,
+       [  --with-area-lib=STRING  Set area library type [area]],
+       ALIB=$withval)
+@@ -167,16 +168,16 @@
+       CHARGECOUNTRY=$withval)
+ AC_ARG_WITH(oldconfdir,
+       [  --with-oldconfdir=DIR   Set old config directory [/etc/isdnlog]],
+-      OLDCONFDIR=$withval; AC_DEFINE_UNQUOTED(OLDCONFDIR,"$withval"))
++      OLDCONFDIR=$withval; AC_DEFINE_UNQUOTED(OLDCONFDIR,"$withval", [old config dir]))
+ AC_ARG_WITH(oldconf,
+       [  --with-oldconf=NAME     Set old config file name [isdnlog.conf]],
+-      OLDCONFFILE=$withval; AC_DEFINE_UNQUOTED(OLDCONFFILE,"$withval"))
++      OLDCONFFILE=$withval; AC_DEFINE_UNQUOTED(OLDCONFFILE,"$withval", [old config file]))
+ AC_ARG_WITH(datadir,
+         [  --with-datadir=DIR      Set data directory [/usr/lib/isdn]],
+-        datadir=$withval; AC_DEFINE_UNQUOTED(DATADIR,"$withval"))
++        datadir=$withval; AC_DEFINE_UNQUOTED(DATADIR,"$withval", [data dir]))
+ AC_ARG_WITH(sport,
+       [  --with-sport=INT        Set server port [20011]],
+-      SERV_PORT=$withval; AC_DEFINE_UNQUOTED(SERV_PORT,$withval))
++      SERV_PORT=$withval; AC_DEFINE_UNQUOTED(SERV_PORT,$withval, [server port]))
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+@@ -196,28 +197,28 @@
+ if test "$ALIB" = "area" ; then
+       LIBAREA=1
+-      AC_DEFINE(LIBAREA)
++      AC_DEFINE(LIBAREA, 1, [libarea])
+ fi
+ case "$CHARGECOUNTRY" in
+       DE)
+               NATION="de"
+               NATION_MACRO="ISDN_DE"
+-              AC_DEFINE(ISDN_DE)
++              AC_DEFINE(ISDN_DE, 1, [German ISDN])
+               ;;
+       AT)
+               NATION="at"
+               NATION_MACRO="ISDN_AT"
+-              AC_DEFINE(ISDN_AT)
++              AC_DEFINE(ISDN_AT, 1, [Austrian ISDN])
+               ;;
+       CH)
+               NATION="ch"
+               NATION_MACRO="ISDN_CH"
+-              AC_DEFINE(ISDN_CH)
++              AC_DEFINE(ISDN_CH, 1, [Swiss ISDN])
+               ;;
+       NL)
+               NATION="nl"
+               NATION_MACRO="ISDN_NL"
+-              AC_DEFINE(ISDN_NL)
++              AC_DEFINE(ISDN_NL, 1, [Dutch ISDN])
+               ;;
+ esac
+--- isdn4k-utils-CVS-2004-11-18/isdnlog/aclocal.m4.ac25x       2002-07-19 21:03:55.000000000 +0200
++++ isdn4k-utils-CVS-2004-11-18/isdnlog/aclocal.m4     2004-11-18 17:47:52.643740339 +0100
+@@ -45,13 +45,13 @@
+       if test "$pqdir" != "no" ; then
+               AC_MSG_RESULT("yes")
+               POSTGRES=1
+-              AC_DEFINE_UNQUOTED(POSTGRES,1)
++              AC_DEFINE_UNQUOTED(POSTGRES,1,[postgres support])
+       else
+               AC_MSG_RESULT("no POSTGRES DISABLED")
+               pqdir=""
+       fi
+       POSTGRESDIR="$pqdir"
+-      AC_DEFINE_UNQUOTED(POSTGRESDIR,"$pqdir")
++      AC_DEFINE_UNQUOTED(POSTGRESDIR,"$pqdir",[postgres dir])
+       AC_SUBST(POSTGRES)
+       AC_SUBST(POSTGRESDIR)
+ ])
+@@ -108,13 +108,13 @@
+       if test "$mydir" != "no" ; then
+               AC_MSG_RESULT("yes")
+               MYSQLDB=1
+-              AC_DEFINE_UNQUOTED(MYSQLDB,1)
++              AC_DEFINE_UNQUOTED(MYSQLDB,1,[MySQL support])
+       else
+               AC_MSG_RESULT("no MYSQL DISABLED")
+               mydir=""
+       fi
+       MYSQLDIR="$mydir"
+-      AC_DEFINE_UNQUOTED(MYSQLDIR,"$mydir")
++      AC_DEFINE_UNQUOTED(MYSQLDIR,"$mydir",[MySQL dir])
+       AC_SUBST(MYSQLDB)
+       AC_SUBST(MYSQLDIR)
+ ])
+@@ -134,7 +134,7 @@
+       if test "$oradir" != "no" ; then
+               AC_MSG_RESULT("yes")
+               ORACLE=1
+-              AC_DEFINE_UNQUOTED(ORACLE,1)
++              AC_DEFINE_UNQUOTED(ORACLE,1,[oracle support, unsupported])
+       else
+               AC_MSG_RESULT("no ORACLE DISABLED")
+       fi
+--- isdn4k-utils-CVS-2004-11-18/vbox3/configure.in.ac25x       1998-11-10 19:36:19.000000000 +0100
++++ isdn4k-utils-CVS-2004-11-18/vbox3/configure.in     2004-11-18 17:47:52.644740191 +0100
+@@ -17,11 +17,9 @@
+ ## programs ###############################################################
+ AC_PROG_CC
+-AC_PROG_CC_WORKS
+-AC_PROG_CC_GNU
+ AC_PROG_RANLIB
+-AM_PROG_INSTALL
++AC_PROG_INSTALL
+ ## libraries ##############################################################
+--- isdn4k-utils-CVS-2004-11-18/vbox3/vboxgetty/Makefile.am.ac25x      1998-11-10 19:36:25.000000000 +0100
++++ isdn4k-utils-CVS-2004-11-18/vbox3/vboxgetty/Makefile.am    2004-11-18 17:47:52.644740191 +0100
+@@ -12,7 +12,7 @@
+ ## vboxgetty ##############################################################
+-DEFS                 += -DSYSCONFDIR='"$(sysconfdir)"' -DPKGDATADIR='"$(pkgdatadir)"' -DLOGDIR='"$(packagelogdir)"' -DLOCKDIR='"$(packagelockdir)"' -DPIDDIR='"$(packagepiddir)"'
++DEFS                  = -DSYSCONFDIR='"$(sysconfdir)"' -DPKGDATADIR='"$(pkgdatadir)"' -DLOGDIR='"$(packagelogdir)"' -DLOCKDIR='"$(packagelockdir)"' -DPIDDIR='"$(packagepiddir)"'
+ INCLUDES              = $(all_includes) $(tcl_include)
+--- isdn4k-utils-CVS-2004-11-18/isdnctrl/configure.in.ac25x    2002-07-19 23:23:54.000000000 +0200
++++ isdn4k-utils-CVS-2004-11-18/isdnctrl/configure.in  2004-11-18 17:47:52.645740043 +0100
+@@ -30,21 +30,21 @@
+ AC_ARG_WITH(sbin,
+       [  --with-sbin=DIR         Set dir where binary is istalled. [/sbin]],
+       CONFIG_SBINDIR="${withval}"
+-      AC_DEFINE(CONFIG_SBINDIR,"${withval}"),
++      AC_DEFINE(CONFIG_SBINDIR,"${withval}",[sbin dir]),
+ )
+ dnl Optional man directory
+ AC_ARG_WITH(man,
+       [  --with-man=DIR          Set manpage dir. [/usr/man]],
+       CONFIG_MANDIR="${withval}"
+-      AC_DEFINE(CONFIG_MANDIR,"${withval}"),
++      AC_DEFINE(CONFIG_MANDIR,"${withval}",[man dir]),
+ )
+ dnl Optional config-file-option
+ AC_ARG_ENABLE(cfile,
+       [  --enable-cfile          Enable configfile option [no]],
+       CONFIG_ISDNCTRL_CONF=y
+-      AC_DEFINE(CONFIG_ISDNCTRL_CONF,y),
++      AC_DEFINE(CONFIG_ISDNCTRL_CONF,y,[enable config file]),
+ )
+ AC_SUBST(INSTALL)
+--- isdn4k-utils-CVS-2004-11-18/imon/configure.in.ac25x        2002-07-19 21:03:53.000000000 +0200
++++ isdn4k-utils-CVS-2004-11-18/imon/configure.in      2004-11-18 17:47:52.646739895 +0100
+@@ -38,14 +38,14 @@
+ AC_ARG_WITH(sbin,
+       [  --with-sbin=DIR         Set dir where binary is istalled. [/sbin]],
+       CONFIG_SBINDIR="${withval}"
+-      AC_DEFINE(CONFIG_SBINDIR,"${withval}"),
++      AC_DEFINE(CONFIG_SBINDIR,"${withval}",[kernel directory]),
+ )
+ dnl Optional man directory
+ AC_ARG_WITH(man,
+-      [  --with-man=DIR          Set manpage dir. [/usr/man]],
++      [  --with-man=DIR          Set manpage dir. [/usr/share/man]],
+       CONFIG_MANDIR="${withval}"
+-      AC_DEFINE(CONFIG_MANDIR,"${withval}"),
++      AC_DEFINE(CONFIG_MANDIR,"${withval}",[man directory]),
+ )
+ AC_SUBST(INSTALL)
+--- isdn4k-utils-CVS-2004-11-18/eicon/configure.in.ac25x       2002-07-19 20:42:01.000000000 +0200
++++ isdn4k-utils-CVS-2004-11-18/eicon/configure.in     2004-11-18 17:47:52.646739895 +0100
+@@ -35,21 +35,21 @@
+ AC_ARG_WITH(firmware,
+       [  --with-firmware=DIR     Set dir where firmware istalled. [/usr/lib/isdn]],
+       CONFIG_DATADIR="${withval}"
+-      AC_DEFINE(CONFIG_DATADIR,"${withval}"),
++      AC_DEFINE(CONFIG_DATADIR,"${withval}",[data dir]),
+ )
+ dnl Optional sbin directory
+ AC_ARG_WITH(sbin,
+       [  --with-sbin=DIR         Set dir where binary is istalled. [/sbin]],
+       CONFIG_SBINDIR="${withval}"
+-      AC_DEFINE(CONFIG_SBINDIR,"${withval}"),
++      AC_DEFINE(CONFIG_SBINDIR,"${withval}",[sbin dir]),
+ )
+ dnl Optional man directory
+ AC_ARG_WITH(man,
+       [  --with-man=DIR          Set manpage dir. [/usr/man]],
+       CONFIG_MANDIR="${withval}"
+-      AC_DEFINE(CONFIG_MANDIR,"${withval}"),
++      AC_DEFINE(CONFIG_MANDIR,"${withval}",[man dir]),
+ )
+ dnl Check, if user wants dump option for debugging
+@@ -58,10 +58,10 @@
+       CONFIG_EICONCTRL_DEBUG="y"
+ )
+-AC_DEFINE(HAVE_XLOG)
++AC_DEFINE(HAVE_XLOG,1,[define if you have xlog])
+ AC_SUBST(HAVE_XLOG)
+-AC_DEFINE(HAVE_TRACE)
++AC_DEFINE(HAVE_TRACE,1,[define if you have trace])
+ AC_SUBST(HAVE_TRACE)
+ AC_SUBST(HAVE_NPCI)
diff --git a/isdn4k-utils/patches/isdn4k-utils-CVS-2006-07-20-capi.patch b/isdn4k-utils/patches/isdn4k-utils-CVS-2006-07-20-capi.patch
new file mode 100644 (file)
index 0000000..e0283fe
--- /dev/null
@@ -0,0 +1,12 @@
+diff -up isdn4k-utils-CVS-2006-07-20/capi20/capidyn.c.orig isdn4k-utils-CVS-2006-07-20/capi20/capidyn.c
+--- isdn4k-utils-CVS-2006-07-20/capi20/capidyn.c.orig  2009-01-19 15:18:10.000000000 +0100
++++ isdn4k-utils-CVS-2006-07-20/capi20/capidyn.c       2009-01-19 15:19:30.000000000 +0100
+@@ -26,7 +26,7 @@
+ #include <dlfcn.h>
+-#define LIBCAPI       "libcapi20.so"
++#define LIBCAPI       "libcapi20.so.3"
+ static int loadlib(void);
+ /* ---------------------------------------------------------------------- */
diff --git a/isdn4k-utils/patches/isdn4k-utils-CVS-2009-10-20-ipfire.patch b/isdn4k-utils/patches/isdn4k-utils-CVS-2009-10-20-ipfire.patch
new file mode 100644 (file)
index 0000000..4e28211
--- /dev/null
@@ -0,0 +1,808 @@
+--- isdn4k-utils-CVS-2003-09-23/act2000/Makefile.in.redhat     2002-07-19 21:03:49.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/act2000/Makefile.in    2003-09-30 17:44:24.000000000 +0200
+@@ -5,8 +5,8 @@
+ #
+ #
+ SHELL                 = /bin/sh
+-CFLAGS                        = -Wall -O2
+-INCLUDES              = -I.
++CFLAGS                        = $(CFLAGS)
++INCLUDES              = -I. -I@CONFIG_KERNELDIR@/include -I@CONFIG_KERNELDIR@/drivers/isdn/act2000
+ DEFS                  =
+ LDFLAGS                       = -L../lib @LIBS@
+ PROGRAM                       = actctrl
+@@ -18,9 +18,9 @@
+ MANDIR                        = @CONFIG_MANDIR@
+ MAN8DIR                       = $(MANDIR)/man8
+ INSTALL                       = @INSTALL@
+-INSTALL_PROGRAM       = $(INSTALL) -o 0 -g 0 -m 0750
+-INSTALL_DATA  = $(INSTALL) -o 0 -g 0 -m 0644
+-INSTALL_MAN           = $(INSTALL) -o 0 -g 0 -m 0644
++INSTALL_PROGRAM       = $(INSTALL) -m 0750
++INSTALL_DATA  = $(INSTALL) -m 0644
++INSTALL_MAN           = $(INSTALL) -m 0644
+ prefix                        = @prefix@
+ exec_prefix           = @exec_prefix@
+ CC                            = @CC@
+--- isdn4k-utils-CVS-2003-09-23/areacode/Makefile.in.redhat    1999-06-19 11:39:59.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/areacode/Makefile.in   2003-09-30 17:44:24.000000000 +0200
+@@ -12,7 +12,7 @@
+       # only ones that _really_ exist on _every_ system.
+       #
+       BUILDOPTS   := $(DATAOPTS)
+-      INSTALLOPTS := $(DATAOPTS) INSTALL="install -o 0 -g 0 -m 644"
++      INSTALLOPTS := $(DATAOPTS) INSTALL="install -m 644"
+ endif
+ all: .depend
+--- isdn4k-utils-CVS-2003-09-23/avmb1/Makefile.in.redhat       2002-07-19 21:03:50.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/avmb1/Makefile.in      2003-09-30 17:44:24.000000000 +0200
+@@ -5,7 +5,7 @@
+ #
+ #
+ SHELL                 = /bin/sh
+-CFLAGS                        = -Wall -O2
++CFLAGS                        = $(CFLAGS)
+ LDFLAGS                       = -L../lib @LIBS@
+ INCLUDES              = -I.
+ PROGRAMS              = avmcapictrl
+@@ -15,8 +15,8 @@
+ MANDIR                        = @CONFIG_MANDIR@
+ MAN8DIR                       = $(MANDIR)/man8
+ INSTALL                       = @INSTALL@
+-INSTALL_PROGRAM       = $(INSTALL) -o 0 -g 0 -m 0750
+-INSTALL_MAN           = $(INSTALL) -o 0 -g 0 -m 0644
++INSTALL_PROGRAM       = $(INSTALL) -m 0750
++INSTALL_MAN           = $(INSTALL) -m 0644
+ prefix                        = @prefix@
+ exec_prefix           = @exec_prefix@
+ CC                            = @CC@
+--- isdn4k-utils-CVS-2003-09-23/capifax/Makefile.am.redhat     2000-03-03 16:54:12.000000000 +0100
++++ isdn4k-utils-CVS-2003-09-23/capifax/Makefile.am    2003-09-30 17:44:24.000000000 +0200
+@@ -8,7 +8,7 @@
+                         stamp-h.in
+ INCLUDES = -I../capi20 $(all_includes)
+-CFLAGS = -Wall -O2
++CFLAGS = -Wall $(CFLAGS)
+ LDFLAGS = -L../capi20/.libs -L../capi20 $(all_libraries)
+ LDADD = -lcapi20
+--- isdn4k-utils-CVS-2003-09-23/capiinfo/Makefile.am.redhat    2000-10-20 19:14:20.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/capiinfo/Makefile.am   2003-09-30 17:44:24.000000000 +0200
+@@ -8,7 +8,7 @@
+                         stamp-h.in comperr
+ INCLUDES = -I../capi20 $(all_includes)
+-CFLAGS = -Wall -O2
++CFLAGS = -Wall $(CFLAGS)
+ LDFLAGS = -L../capi20/.libs -L../capi20 $(all_libraries)
+ LDADD = -lcapi20
+--- isdn4k-utils-CVS-2003-09-23/capiinit/Makefile.am.redhat    2000-03-17 17:19:43.000000000 +0100
++++ isdn4k-utils-CVS-2003-09-23/capiinit/Makefile.am   2003-09-30 17:44:24.000000000 +0200
+@@ -8,7 +8,7 @@
+                         stamp-h.in comperr core
+ INCLUDES = $(all_includes)
+-CFLAGS = -Wall -O2 -D_GNU_SOURCE # -g
++CFLAGS = -Wall -D_GNU_SOURCE $(CFLAGS)
+ LDFLAGS = $(all_libraries)
+ LDADD = 
+--- isdn4k-utils-CVS-2003-09-23/divertctrl/Makefile.in.redhat  2002-07-19 21:03:51.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/divertctrl/Makefile.in 2003-09-30 17:44:24.000000000 +0200
+@@ -5,16 +5,16 @@
+ #
+ #
+ SHELL                 = /bin/sh
+-CFLAGS                        = -Wall -O2
+-INCLUDES              = -I.
++CFLAGS                        = -Wall $(CFLAGS)
++INCLUDES              = -I. -I@CONFIG_KERNELDIR@/include -I@CONFIG_KERNELDIR@/drivers/isdn/divert
+ DEFS                  =
+ LDFLAGS                       = -L../lib @LIBS@
+ PROGRAM                       = divertctrl
+ MODULES                       = divertctrl.o
+ MANPAGE                       = divertctrl.8
+ INSTALL                       = @INSTALL@
+-INSTALL_PROGRAM       = $(INSTALL) -o 0 -g 0 -m 0750
+-INSTALL_MAN           = $(INSTALL) -o 0 -g 0 -m 0644
++INSTALL_PROGRAM       = $(INSTALL) -m 0750
++INSTALL_MAN           = $(INSTALL) -m 0644
+ prefix                        = @prefix@
+ exec_prefix           = @exec_prefix@
+ ifeq (../.config,$(wildcard ../.config))
+--- isdn4k-utils-CVS-2003-09-23/doc/Makefile.in.redhat 1999-12-24 15:14:50.000000000 +0100
++++ isdn4k-utils-CVS-2003-09-23/doc/Makefile.in        2003-09-30 17:44:24.000000000 +0200
+@@ -9,7 +9,7 @@
+ SED                           = @SED@
+ MANDIR                        = @CONFIG_MANDIR@
+ MANPAGES              = ttyI.4 isdninfo.4 isdn_audio.4 isdnctrl.4 isdn_cause.7
+-INSTALL_MAN           = @INSTALL@ -o 0 -g 0 -m 0644
++INSTALL_MAN           = @INSTALL@ -m 0644
+ prefix                        = @prefix@
+ %.1: %.man
+--- isdn4k-utils-CVS-2003-09-23/eicon/Makefile.in.redhat       2002-07-19 20:42:01.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/eicon/Makefile.in      2003-09-30 17:44:24.000000000 +0200
+@@ -7,8 +7,8 @@
+ #
+ SHELL                 = /bin/sh
+-CFLAGS                        = -Wall -O2 -DUNIX -DLINUX
+-INCLUDES              = -I. -Iinclude
++CFLAGS                        = -Wall -DUNIX -DLINUX $(CFLAGS)
++INCLUDES              = -I. -Iinclude -I@CONFIG_KERNELDIR@/include -I@CONFIG_KERNELDIR@/drivers/isdn/eicon
+ LDFLAGS                       = -L../lib @LIBS@
+ PROGRAMS              = 
+ PROGRAM                       = eiconctrl
+@@ -22,9 +22,9 @@
+ DATA_DIR              = @CONFIG_DATADIR@
+ MANDIR                        = @CONFIG_MANDIR@
+ MAN8DIR                       = $(MANDIR)/man8
+-INSTALL_PROGRAM       = $(INSTALL) -o 0 -g 0 -m 0750
+-INSTALL_DATA  = $(INSTALL) -o 0 -g 0 -m 0644
+-INSTALL_MAN           = $(INSTALL) -o 0 -g 0 -m 0644
++INSTALL_PROGRAM       = $(INSTALL) -m 0750
++INSTALL_DATA  = $(INSTALL) -m 0644
++INSTALL_MAN           = $(INSTALL) -m 0644
+ CC                            = @CC@
+ COPTS                 = -DDATADIR=\"$(shell echo $(DESTDIR)$(DATA_DIR))\"
+--- isdn4k-utils-CVS-2003-09-23/hisax/Makefile.in.redhat       2002-07-19 21:03:51.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/hisax/Makefile.in      2003-09-30 17:44:24.000000000 +0200
+@@ -6,7 +6,7 @@
+ #
+ #
+ SHELL                 = /bin/sh
+-CFLAGS                        = -Wall -O2 -I.
++CFLAGS                        = -Wall $(CFLAGS) -I. -I@CONFIG_KERNELDIR@/include
+ LDFLAGS                       = -L../lib @LIBS@
+ PROGRAMS              =
+ MODULES                       = hisaxctrl.o
+@@ -16,9 +16,9 @@
+ DATADIR                       = @CONFIG_DATADIR@
+ MANDIR                        = @CONFIG_MANDIR@
+ MAN8DIR                       = $(MANDIR)/man8
+-INSTALL_PROGRAM       = $(INSTALL) -o 0 -g 0 -m 0750
+-INSTALL_DATA  = $(INSTALL) -o 0 -g 0 -m 0644
+-INSTALL_MAN           = $(INSTALL) -o 0 -g 0 -m 0644
++INSTALL_PROGRAM       = $(INSTALL) -m 0750
++INSTALL_DATA  = $(INSTALL) -m 0644
++INSTALL_MAN           = $(INSTALL) -m 0644
+ prefix                        = @prefix@
+ exec_prefix           = @exec_prefix@
+ ifeq ("@CONFIG_HISAXCTRL@","y")
+--- isdn4k-utils-CVS-2003-09-23/icn/Makefile.in.redhat 2002-07-19 21:03:52.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/icn/Makefile.in        2003-09-30 17:44:24.000000000 +0200
+@@ -5,8 +5,8 @@
+ #
+ #
+ SHELL                 = /bin/sh
+-CFLAGS                        = -Wall -O2
+-INCLUDES              = -I.
++CFLAGS                        = -Wall $(CFLAGS)
++INCLUDES              = -I. -I@CONFIG_KERNELDIR@/include -I@CONFIG_KERNELDIR@/drivers/isdn/icn
+ DEFS                  =
+ LDFLAGS                       = -L../lib @LIBS@
+ PROGRAM                       = icnctrl
+@@ -17,9 +17,9 @@
+ DATADIR                       = @CONFIG_DATADIR@
+ MANDIR                        = @CONFIG_MANDIR@
+ MAN8DIR                       = $(MANDIR)/man8
+-INSTALL_PROGRAM       = $(INSTALL) -o 0 -g 0 -m 0750
+-INSTALL_DATA  = $(INSTALL) -o 0 -g 0 -m 0644
+-INSTALL_MAN           = $(INSTALL) -o 0 -g 0 -m 0644
++INSTALL_PROGRAM       = $(INSTALL) -m 0750
++INSTALL_DATA  = $(INSTALL) -m 0644
++INSTALL_MAN           = $(INSTALL) -m 0644
+ CC                            = @CC@
+ COPTS                 =
+--- isdn4k-utils-CVS-2003-09-23/imon/Makefile.in.redhat        2002-07-19 21:03:53.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/imon/Makefile.in       2003-09-30 17:44:24.000000000 +0200
+@@ -7,8 +7,8 @@
+ #
+ #
+ SHELL                 = /bin/sh
+-CFLAGS                        = -Wall -O2
+-INCLUDES              = -I.
++CFLAGS                        = -Wall $(CFLAGS)
++INCLUDES              = -I. -I@CONFIG_KERNELDIR@/include
+ LDFLAGS                       = -L../lib @LIBS@
+ PROGRAM                       = imon
+ MODULES                       = imon.o
+@@ -18,8 +18,8 @@
+ SBINDIR                       = @CONFIG_SBINDIR@
+ MAN8DIR                       = $(MANDIR)/man8
+ INSTALL                       = @INSTALL@
+-INSTALL_PROGRAM       = $(INSTALL) -o 0 -g 0 -m 0750
+-INSTALL_MAN           = $(INSTALL) -o 0 -g 0 -m 0644
++INSTALL_PROGRAM       = $(INSTALL) -m 0750
++INSTALL_MAN           = $(INSTALL) -m 0644
+ prefix                        = @prefix@
+ exec_prefix           = @exec_prefix@
+ CC                            = @CC@
+--- isdn4k-utils-CVS-2003-09-23/imontty/Makefile.redhat        2002-07-19 23:23:53.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/imontty/Makefile       2003-09-30 17:44:24.000000000 +0200
+@@ -15,14 +15,14 @@
+       # Manual config standalone
+       #
+       CONFIG_SBINDRIR := /sbin
+-      MAN8DIR         := /usr/man/man8
++      MAN8DIR         := /usr/share/man/man8
+ endif
+ INSTALL=install
+-INSTALL_MAN=$(INSTALL) -o 0 -g 0 -m 0644
++INSTALL_MAN=$(INSTALL) -m 0644
+ MANPAGE=imontty.8
+-CCFLAGS=-O2
++CCFLAGS=$(CFLAGS) -I$(CONFIG_KERNELDIR)/include
+ #CCFLAGS=-I$(ISDN_INCLUDE) -g
+ # nothing to change behind this line
+--- isdn4k-utils-CVS-2003-09-23/ipppstats/Makefile.in.redhat   2002-07-19 21:03:54.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/ipppstats/Makefile.in  2003-09-30 17:44:24.000000000 +0200
+@@ -6,14 +6,14 @@
+ MANDIR       = @CONFIG_MANDIR@
+ CC           = @CC@
+ INSTALL      = @INSTALL@
+-INSTALL_SBIN = $(INSTALL) -m 755 -o 0 -g 0
+-INSTALL_DATA = $(INSTALL) -m 644 -o 0 -g 0
+-INSTALL_DIR  = $(INSTALL) -m 755 -o 0 -g 0 -d
++INSTALL_SBIN = $(INSTALL) -m 755
++INSTALL_DATA = $(INSTALL) -m 644
++INSTALL_DIR  = $(INSTALL) -m 755 -d
+ PPPSTATSRCS  = ipppstats.c
+ PPPSTATOBJS  = ipppstats.o
+-CFLAGS       = -fomit-frame-pointer -O2
++CFLAGS       = $(CFLAGS) -I@CONFIG_KERNELDIR@/include
+ all: ipppstats
+--- isdn4k-utils-CVS-2003-09-23/iprofd/Makefile.in.redhat      2002-07-19 23:23:53.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/iprofd/Makefile.in     2003-09-30 17:44:24.000000000 +0200
+@@ -5,8 +5,8 @@
+ #
+ #
+ SHELL                 = /bin/sh
+-CFLAGS                        = -Wall -O2
+-INCLUDES              = -I.
++CFLAGS                        = -Wall $(CFLAGS)
++INCLUDES              = -I. -I@CONFIG_KERNELDIR@/include
+ LDFLAGS                       = -L../lib @LIBS@
+ PROGRAM                       = iprofd
+ MODULES                       = iprofd.o
+@@ -15,8 +15,8 @@
+ MANDIR                        = @CONFIG_MANDIR@
+ MAN8DIR                       = $(MANDIR)/man8
+ INSTALL                       = @INSTALL@
+-INSTALL_PROGRAM       = $(INSTALL) -o 0 -g 0 -m 0750
+-INSTALL_MAN           = $(INSTALL) -o 0 -g 0 -m 0644
++INSTALL_PROGRAM       = $(INSTALL) -m 0750
++INSTALL_MAN           = $(INSTALL) -m 0644
+ prefix                        = @prefix@
+ exec_prefix           = @exec_prefix@
+ CC                            = @CC@
+--- isdn4k-utils-CVS-2003-09-23/isdnctrl/Makefile.in.redhat    2002-07-19 23:23:54.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/isdnctrl/Makefile.in   2003-09-30 17:44:24.000000000 +0200
+@@ -5,8 +5,8 @@
+ #
+ #
+ SHELL                   = /bin/sh
+-CFLAGS                        = -Wall -O2
+-INCLUDES              = -I.
++CFLAGS                        = -Wall $(CFLAGS)
++INCLUDES              = -I. -I@CONFIG_KERNELDIR@/include
+ LDFLAGS                       = @LIBS@ 
+ PROGRAM                       = isdnctrl
+ MODULES                       = isdnctrl.o
+@@ -15,8 +15,8 @@
+ MANDIR                        = @CONFIG_MANDIR@
+ MAN8DIR                       = $(MANDIR)/man8
+ INSTALL                       = @INSTALL@
+-INSTALL_PROGRAM       = $(INSTALL) -o 0 -g 0 -m 0750
+-INSTALL_MAN           = $(INSTALL) -o 0 -g 0 -m 0644
++INSTALL_PROGRAM       = $(INSTALL) -m 0750
++INSTALL_MAN           = $(INSTALL) -m 0644
+ CC                            = @CC@ -DVERSION=\"@I4LVERSION@\"
+ prefix                        = @prefix@
+ exec_prefix           = @exec_prefix@
+--- isdn4k-utils-CVS-2003-09-23/isdnlog/samples/callerid.conf.redhat   2000-09-08 10:55:51.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/isdnlog/samples/callerid.conf  2003-09-30 17:44:24.000000000 +0200
+@@ -2,38 +2,31 @@
+ # 
+ # More information: See the isdnlog documentation
++#INTERFACE = ippp0      # Isdn network interface. This information  is  required
++                        # with the "-hx" / hangup="value" option.
++
++
+ [MSN]
+ NUMBER = 4711
+ ALIAS  = Phone
+ SI     = 1
+ ZONE   = 1
+-START = {
+-  [FLAG]
+-  FLAGS = I|O|R|C|B|A|E|H
+-  PROGRAM = /bin/myprog \$1 \$2 \$3 Phone
+-}
++#START = {
++#  [FLAG]
++#  FLAGS = I|O|R|C|B|A|E|H
++#  PROGRAM = /bin/myprog \$1 \$2 \$3 Phone
++#}
+ [MSN]
+ NUMBER = 4711
+ ALIAS  = HDLC
+ SI     = 7
+ ZONE   = 1
+-START = {
+-  [FLAG]
+-  FLAGS = I|O|R|C|B|A|E|
+-  PROGRAM = /bin/myprog \$1 \$2 \$3 HDLC @/home/user1/parameter
+-}
+-
+-[MSN]
+-NUMBER = 4712
+-ALIAS  = Modem
+-SI     = 1
+-ZONE   = 1
+-START = {
+-  [FLAG]
+-  FLAGS = I|O|R|C|B|A|E|H
+-  PROGRAM = /bin/myprog \$1 \$2 \$3 Modem
+-}
++#START = {
++#  [FLAG]
++#  FLAGS = I|O|R|C|B|A|E|
++#  PROGRAM = /bin/myprog \$1 \$2 \$3 HDLC @/home/user1/parameter
++#}
+ [NUMBER]
+ NUMBER = 01910
+--- isdn4k-utils-CVS-2003-09-23/isdnlog/tools/cdb/Makefile.in.redhat   2000-08-15 17:16:23.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/isdnlog/tools/cdb/Makefile.in  2003-09-30 17:44:24.000000000 +0200
+@@ -20,7 +20,7 @@
+ BINDIR:=$(DESTDIR)@prefix@/bin
+ INCDIR:=$(DESTDIR)@prefix@/include
+-CFLAGS:=-Wall -O2
++CFLAGS:=-Wall $(CFLAGS)
+ all: depend $(FILES)
+@@ -46,7 +46,7 @@
+       install -d -m0755 $(MAN1DIR) $(MAN3DIR) $(LIBDIR) $(BINDIR) \
+               $(INCDIR)
+-install:
++install: install-dirs
+       install -m0755 $(BINS) $(BINDIR)
+       install -m0644 $(MAN1) $(MAN1DIR)
+       install -m0644 $(MAN3) $(MAN3DIR)
+--- isdn4k-utils-CVS-2003-09-23/isdnlog/tools/dest/Makefile.in.redhat  2003-07-25 23:23:15.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/isdnlog/tools/dest/Makefile.in 2003-09-30 17:44:24.000000000 +0200
+@@ -6,7 +6,7 @@
+ -include ../../../.config
+ BZIP2                 = @BZIP2@
+ SHELL                 = /bin/sh
+-CFLAGS                        = -Wall -g
++CFLAGS                        = -Wall $(CFLAGS)
+ INCLUDES              =
+ LDFLAGS                       = @DBMLIB@
+ export DBEXT          = @DBEXT@
+@@ -20,9 +20,9 @@
+ SBINDIR                       = @CONFIG_SBINDIR@
+ MAN8DIR                       = $(MANDIR)/man8
+ INSTALL                       = @INSTALL@
+-INSTALL_PROGRAM               = $(INSTALL) -o 0 -g 0 -m 0750
+-INSTALL_MAN           = $(INSTALL) -o 0 -g 0 -m 0644
+-INSTALL_DATA          = $(INSTALL) -o 0 -g 0 -m 0644
++INSTALL_PROGRAM               = $(INSTALL) -m 0750
++INSTALL_MAN           = $(INSTALL) -m 0644
++INSTALL_DATA          = $(INSTALL) -m 0644
+ prefix                        = @prefix@
+ exec_prefix           = @exec_prefix@
+ DATADIR                       = @datadir@
+--- isdn4k-utils-CVS-2003-09-23/isdnlog/tools/zone/Makefile.in.redhat  2003-03-11 14:08:00.000000000 +0100
++++ isdn4k-utils-CVS-2003-09-23/isdnlog/tools/zone/Makefile.in 2003-09-30 17:44:24.000000000 +0200
+@@ -5,7 +5,7 @@
+ #
+ BZIP2                 = @BZIP2@
+ SHELL                 = /bin/sh
+-CFLAGS                        = -Wall -g
++CFLAGS                        = -Wall $(CFLAGS)
+ INCLUDES              =
+ LDFLAGS                       = @DBMLIB@
+ CDBEXTRALIBS          = @CDBEXTRALIBS@
+@@ -20,8 +20,8 @@
+ SBINDIR                       = @CONFIG_SBINDIR@
+ MAN8DIR                       = $(MANDIR)/man8
+ INSTALL                       = @INSTALL@
+-INSTALL_PROGRAM               = $(INSTALL) -o 0 -g 0 -m 0750
+-INSTALL_MAN           = $(INSTALL) -o 0 -g 0 -m 0644
++INSTALL_PROGRAM               = $(INSTALL) -m 0750
++INSTALL_MAN           = $(INSTALL) -m 0644
+ prefix                        = @prefix@
+ exec_prefix           = @exec_prefix@
+ #CC                   = @CC@ -V2.7.2.3
+--- isdn4k-utils-CVS-2003-09-23/isdnlog/Makefile.in.redhat     2003-08-26 21:46:11.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/isdnlog/Makefile.in    2003-09-30 17:44:24.000000000 +0200
+@@ -1542,10 +1542,10 @@
+ # autoconf isdnlog specific stuff
+ #
+ INSTALL                       := @INSTALL@
+-INSTALL_DIR           := $(INSTALL) -m 0755 -o 0 -g 0 -d
+-INSTALL_SBIN          := $(INSTALL) -m 0700 -o 0 -g 0
+-INSTALL_BIN           := $(INSTALL) -m 0755 -o 0 -g 0
+-INSTALL_DATA          := $(INSTALL) -m 0644 -o 0 -g 0
++INSTALL_DIR           := $(INSTALL) -m 0755 -d
++INSTALL_SBIN          := $(INSTALL) -m 0700
++INSTALL_BIN           := $(INSTALL) -m 0755
++INSTALL_DATA          := $(INSTALL) -m 0644
+ BZIP2                   := @BZIP2@
+ BUNZIP2                 := $(BZIP2) -f -d
+@@ -1600,9 +1600,9 @@
+ SUBDIRS     += $(LIBISDNDIR)
+ endif
+-# export CFLAGS  = -Wall -pipe -O6 -fomit-frame-pointer -fforce-mem -fforce-addr -funroll-loops -fstrength-reduce
++# export CFLAGS  = -Wall -pipe -frame-pointer -fforce-mem -fforce-addr -funroll-loops -fstrength-reduce
+-export CFLAGS  = -Wall -pipe
++export CFLAGS  = -Wall $(CFLAGS)
+ ifndef _CC
+ export _CC  = gcc
+ endif
+--- isdn4k-utils-CVS-2003-09-23/lib/Makefile.in.redhat 1999-12-12 18:22:36.000000000 +0100
++++ isdn4k-utils-CVS-2003-09-23/lib/Makefile.in        2003-09-30 17:44:24.000000000 +0200
+@@ -11,7 +11,7 @@
+       # Install as root with numeric Id's, since these are the
+       # only ones that _really_ exist on _every_ system.
+       #
+-      INSTALLOPTS += INSTALL= install -o 0 -g 0 -m 644
++      INSTALLOPTS += INSTALL= install -m 644
+ endif
+ all: .depend
+--- isdn4k-utils-CVS-2003-09-23/loop/Makefile.in.redhat        2002-07-19 21:03:56.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/loop/Makefile.in       2003-09-30 17:44:24.000000000 +0200
+@@ -5,16 +5,16 @@
+ #
+ #
+ SHELL                 = /bin/sh
+-CFLAGS                        = -Wall -O2
+-INCLUDES              = -I.
++CFLAGS                        = -Wall $(CFLAGS)
++INCLUDES              = -I. -I@CONFIG_KERNELDIR@/include -I@CONFIG_KERNELDIR@/drivers/isdn/loopctrl
+ DEFS                  =
+ LDFLAGS                       = -L../lib @LIBS@
+ PROGRAM                       = loopctrl
+ MODULES                       = loopctrl.o
+ MANPAGE                       = loopctrl.8
+ INSTALL                       = @INSTALL@
+-INSTALL_PROGRAM       = $(INSTALL) -o 0 -g 0 -m 0750
+-INSTALL_MAN           = $(INSTALL) -o 0 -g 0 -m 0644
++INSTALL_PROGRAM       = $(INSTALL) -m 0750
++INSTALL_MAN           = $(INSTALL) -m 0644
+ prefix                        = @prefix@
+ exec_prefix           = @exec_prefix@
+ ifeq (../.config,$(wildcard ../.config))
+--- isdn4k-utils-CVS-2003-09-23/pcbit/Makefile.in.redhat       2002-07-19 21:03:57.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/pcbit/Makefile.in      2003-09-30 17:44:24.000000000 +0200
+@@ -5,8 +5,8 @@
+ #
+ #
+ SHELL                 = /bin/sh
+-CFLAGS                        = -Wall -Wstrict-prototypes -O2 -g
+-INCLUDES              = -I. -DDEBUG 
++CFLAGS                        = -Wall -Wstrict-prototypes $(CFLAGS)
++INCLUDES              = -I. -DDEBUG -I@CONFIG_KERNELDIR@/drivers/isdn/pcbit
+ LDFLAGS                       = -L../lib @LIBS@
+ PROGRAM                       = pcbitctl
+ MODULES                       = pcbitctl.o convhexbin.o
+@@ -15,8 +15,8 @@
+ MANDIR                        = @CONFIG_MANDIR@
+ MAN8DIR                       = $(MANDIR)/man8
+ INSTALL                       = @INSTALL@
+-INSTALL_PROGRAM               = $(INSTALL) -o 0 -g 0 -m 0750
+-INSTALL_MAN           = $(INSTALL) -o 0 -g 0 -m 0644
++INSTALL_PROGRAM               = $(INSTALL) -m 0750
++INSTALL_MAN           = $(INSTALL) -m 0644
+ prefix                        = @prefix@
+ exec_prefix           = @exec_prefix@
+ CC                            = @CC@
+--- isdn4k-utils-CVS-2003-09-23/rcapid/Makefile.am.redhat      2002-07-19 23:23:54.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/rcapid/Makefile.am     2003-09-30 17:44:24.000000000 +0200
+@@ -8,7 +8,7 @@
+                         stamp-h.in comperr
+ INCLUDES = -I../capi20 $(all_includes)
+-CFLAGS = -Wall -O2
++CFLAGS = -Wall $(CFLAGS)
+ LDFLAGS = -L../capi20/.libs -L../capi20 $(all_libraries)
+ LDADD = -lcapi20
+--- isdn4k-utils-CVS-2003-09-23/vbox/examples/vboxd.conf.example.redhat        1997-04-28 18:51:29.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/vbox/examples/vboxd.conf.example       2003-09-30 17:44:24.000000000 +0200
+@@ -5,7 +5,7 @@
+ # login (server startup) time. If access is 'yes' the host can login
+ # and count messages without special access.
+-L:localhost:Y
++#L:localhost:Y
+ L:*:N
+ # Full access list
+@@ -13,7 +13,7 @@
+ # All hosts in the full access list (begins with 'A') are checked if the
+ # server gets the 'login' command.
+-A:localhost:RW:michael:xxx:/var/spool/vbox/michael:incoming
+-A:localhost:RW:nicole:xxx:/var/spool/vbox/nicole:incoming
++#A:localhost:RW:michael:xxx:/var/spool/vbox/michael:incoming
++#A:localhost:RW:nicole:xxx:/var/spool/vbox/nicole:incoming
+ A:*:!:!:!:!:!
+--- isdn4k-utils-CVS-2003-09-23/vbox/examples/vboxgetty.conf.example.redhat    1997-10-22 22:46:58.000000000 +0200
++++ isdn4k-utils-CVS-2003-09-23/vbox/examples/vboxgetty.conf.example   2003-09-30 17:44:24.000000000 +0200
+@@ -20,18 +20,18 @@
+ # Settings for port ttyI6
+-port /dev/ttyI6
+-  modeminit           ATZ&B512&E7830022
+-  user                        nicole
+-  group                       users
+-  spooldir            /var/spool/vbox/nicole
++#port /dev/ttyI6
++#  modeminit          ATZ&B512&E7830022
++#  user                       nicole
++#  group                      users
++#  spooldir           /var/spool/vbox/nicole
+ # Settings for port ttyI7
+-port /dev/ttyI7
+-  modeminit           ATZ&B512&E7850413
+-  user                        michael
+-  group                       users
+-  spooldir            /var/spool/vbox/michael
++#port /dev/ttyI7
++#  modeminit          ATZ&B512&E7850413
++#  user                       michael
++#  group                      users
++#  spooldir           /var/spool/vbox/michael
+--- isdn4k-utils-CVS-2003-09-23/xisdnload/Imakefile.redhat     1998-03-08 19:54:01.000000000 +0100
++++ isdn4k-utils-CVS-2003-09-23/xisdnload/Imakefile    2003-09-30 17:44:24.000000000 +0200
+@@ -21,7 +21,7 @@
+            OBJS = xisdnload.o
+  OSMAJORVERSION = OSMajorVersion
+  OSMINORVERSION = OSMinorVersion
+-      DEFINES = -DOSMAJORVERSION=$(OSMAJORVERSION) -DOSMINORVERSION=$(OSMINORVERSION) -DREGEX_NUMBER
++      DEFINES = -D_GNU_SOURCE -DOSMAJORVERSION=$(OSMAJORVERSION) -DOSMINORVERSION=$(OSMINORVERSION) -DREGEX_NUMBER
+ AllTarget(xisdnload)
+ NormalProgramTarget(xisdnload,$(OBJS),$(DEPLIBS),$(LOCAL_LIBRARIES),NullParameter)
+--- isdn4k-utils-CVS-2003-09-23/.config.rpm.redhat     1998-11-23 13:12:04.000000000 +0100
++++ isdn4k-utils-CVS-2003-09-23/.config.rpm    2003-09-30 17:59:55.000000000 +0200
+@@ -5,16 +5,16 @@
+ #
+ # Code maturity level options
+ #
+-CONFIG_EXPERIMENTAL=y
++# CONFIG_EXPERIMENTAL is not set
+ #
+ # General configuration
+ #
+ CONFIG_BUILDX11=y
+-CONFIG_KERNELDIR='/usr/src/linux'
++CONFIG_KERNELDIR='/usr/src/linux-2.4'
+ CONFIG_BINDIR='/usr/bin'
+-CONFIG_SBINDIR='/sbin'
+-CONFIG_MANDIR='/usr/man'
++CONFIG_SBINDIR='/usr/sbin'
++CONFIG_MANDIR='/usr/share/man'
+ CONFIG_RUNDIR='/var/run'
+ CONFIG_LOCKDIR='/var/lock'
+ CONFIG_LOCKFILE='LCK..'
+@@ -23,11 +23,9 @@
+ CONFIG_CALLERIDFILE='callerid.conf'
+ CONFIG_USERCONFFILE='~/.isdn'
+ CONFIG_COUNTRYCODE='49'
+-CONFIG_AREACODE=''
++CONFIG_AREACODE='9999'
+ CONFIG_COUNTRY_PREFIX='+'
+ CONFIG_AREA_PREFIX='0'
+-CONFIG_DATADIR='/usr/lib/isdn'
+-CONFIG_LIB_AREACODE=y
+ #
+ # Runtime configuration tools
+@@ -36,18 +34,20 @@
+ CONFIG_ISDNCTRL_CONF=y
+ CONFIG_ISDNCTRL_TIMRU=y
+ CONFIG_IPROFD=y
++#CONFIG_DIVERTCTRL=y
+ #
+ # Card configuration tools
+ #
+-# CONFIG_TELESCTRL is not set
++CONFIG_TELESCTRL=y
+ CONFIG_HISAXCTRL=y
+ CONFIG_ICNCTRL=y
+ # CONFIG_ICNCTRL_DEBUG is not set
+ CONFIG_PCBITCTL=y
+ CONFIG_AVMCAPICTRL=y
++#CONFIG_EICONCTRL=y
+ CONFIG_LOOPCTRL=y
+-CONFIG_LOOPCTRL_LOOPDIR='/usr/src/linux/drivers/isdn/isdnloop'
++CONFIG_LOOPCTRL_LOOPDIR='/usr/src/linux-2.4/drivers/isdn/isdnloop'
+ # CONFIG_LOOPCTRL_DEBUG is not set
+ #
+@@ -64,14 +64,20 @@
+ CONFIG_ISDNLOG_USERFILE='isdnlog.users'
+ CONFIG_ISDNLOG_CHARGEFILE='charge.dat'
+ CONFIG_ISDNLOG_LOGFILE='/var/log/isdn.log'
+-CONFIG_ISDNLOG_RELOADCMD='reload'
+-CONFIG_ISDNLOG_STOPCMD='stop'
++CONFIG_ISDNLOG_RELOADCMD='/etc/rc.d/init.d/isdn restart'
++CONFIG_ISDNLOG_STOPCMD='/etc/rc.d/init.d/isdn stop'
+ CONFIG_ISDNLOG_REBOOTCMD='/sbin/reboot'
+ CONFIG_ISDNLOG_OLDI4LCONFDIR='/etc/isdnlog'
+ CONFIG_ISDNLOG_OLDI4LCONFFILE='isdnlog.conf'
+ # CONFIG_ISDNLOG_POSTGRES is not set
+ # CONFIG_ISDNLOG_MYSQLDB is not set
++# CONFIG_ISDNLOG_ORACLE is not set
+ CONFIG_ISDN_LOG_DE=y
++CONFIG_ISDN_LOG_CC_DE=y
++CONFIG_ISDN_LOG_DEST_DE=y
++# CONFIG_ISDN_LOG_DEST_AT is not set
++# CONFIG_ISDN_LOG_DEST_NL is not set
++# CONFIG_ISDN_LOG_DEST_CH is not set
+ CONFIG_IPPPSTATS=y
+ CONFIG_XISDNLOAD=y
+ CONFIG_XMONISDN=y
+@@ -79,8 +85,8 @@
+ #
+ # Options for xmonisdn
+ #
+-CONFIG_XMONISDN_UPCMD='/sbin/netup'
+-CONFIG_XMONISDN_DOWNCMD='/sbin/netdown'
++CONFIG_XMONISDN_UPCMD='/sbin/ifup'
++CONFIG_XMONISDN_DOWNCMD='/sbin/ifdown'
+ #
+ # Applications
+@@ -94,23 +100,22 @@
+ VBOX_LOGDIR='/var/log/vbox'
+ VBOX_PIDDIR='/var/run'
+ VBOX_LOCKDIR='/var/lock'
+-VBOX_DOCDIR='/usr/doc/vbox'
+-VBOX_TCL='tcl8.0'
++VBOX_DOCDIR='/usr/share/doc/vbox'
++VBOX_TCL='tcl8.5'
++# VBOX_SUSPEND_ID is not set
+ CONFIG_IPPPD=y
+ #
+ # Options for ipppd
+ #
+-CONFIG_IPPPD_MSCHAP=y
++# CONFIG_IPPPD_MSCHAP is not set
++CONFIG_IPPP_FILTER=y
+ # CONFIG_IPPPD_RADIUS is not set
+ # CONFIG_RADIUS_WTMP_LOGGING is not set
+ RADIUS_CLIENT_CONFIG_FILE=''
+ CONFIG_CAPIFAX=y
+ CONFIG_RCAPID=y
+-#
+-# Documentation
+-#
+-CONFIG_GENMAN=y
+-CONFIG_FAQ=y
+-CONFIG_FAQDIR='/usr/doc/faq/isdn4linux'
++# CAPI plugins
++CONFIG_PPPDCAPIPLUGIN=y
++
+--- isdn4k-utils-CVS-2003-09-23/ipppd/ccp.c.redhat     2000-11-12 17:06:42.000000000 +0100
++++ isdn4k-utils-CVS-2003-09-23/ipppd/ccp.c    2004-01-20 19:14:07.000000000 +0100
+@@ -41,7 +41,7 @@
+ #include "compressions.h"
+-#if 0
++#if HAVE_LZSCOMP_H
+ #include <linux/isdn_lzscomp.h>
+ #else
+ #include "../ipppcomp/isdn_lzscomp.h"
+--- isdn4k-utils-CVS-2005-02-16/ipppd/Makefile.in.redhat       2004-08-30 16:56:36.000000000 +0200
++++ isdn4k-utils-CVS-2005-02-16/ipppd/Makefile.in      2005-02-16 18:42:54.119955183 +0100
+@@ -15,10 +15,10 @@
+ MANDIR        := @CONFIG_MANDIR@
+ CC            := @CC@
+ INSTALL       := @INSTALL@
+-INSTALL_DIR   := $(INSTALL) -m 0755 -o 0 -g 0 -d
+-INSTALL_SBIN  := $(INSTALL) -m 0700 -o 0 -g 0
+-INSTALL_BIN   := $(INSTALL) -m 0755 -o 0 -g 0
+-INSTALL_DATA  := $(INSTALL) -m 0644 -o 0 -g 0
++INSTALL_DIR   := $(INSTALL) -m 0755 -d
++INSTALL_SBIN  := $(INSTALL) -m 0700 
++INSTALL_BIN   := $(INSTALL) -m 0755
++INSTALL_DATA  := $(INSTALL) -m 0644
+ RADIUS_CLIENT_CONFIG_FILE := @RADIUS_CLIENT_CONFIG_FILE@
+ ifeq (@CONFIG_IPPPD_MSCHAP@,y)
+@@ -73,7 +73,7 @@
+ DEBUG_FLAGS   = @CONFIG_IPPPD_DEBUGFLAGS@
+ COMPILE_FLAGS = @CFLAGS@
+-CFLAGS        = -O2 -fomit-frame-pointer -Wall
++CFLAGS        = $(CFLAGS)
+ VER           = 2.2.0
+ # it's a hack
+--- isdn4k-utils-CVS-2005-02-16/isdnlog/tools/Makefile.cflags  2005-02-16 18:53:15.393382578 +0100
++++ isdn4k-utils-CVS-2005-02-16/isdnlog/tools/Makefile 2005-02-16 18:53:51.914999474 +0100
+@@ -1,4 +1,4 @@
+-CC=gcc -m486 -O2 -Wall -DSTANDALONE -I. -I.. -I../isdnlog -I../connect -I../../lib
++CC=gcc $(CFLAGS) -DSTANDALONE -I. -I.. -I../isdnlog -I../connect -I../../lib
+ #CC=gcc -m486 -O2 -g -pg -Wall -DSTANDALONE -I. -I.. -I../isdnlog
+ all: rate-at
+--- isdn4k-utils-CVS-2005-02-16/lib/Makefile.cflags    2005-02-16 19:04:04.338731270 +0100
++++ isdn4k-utils-CVS-2005-02-16/lib/Makefile   2005-02-16 19:04:24.150811068 +0100
+@@ -28,7 +28,7 @@
+ # USER CONFIGURATION AREA
+ ######################################################################
+-CFLAGS      = -g -Wall -pipe #-O6
++CFLAGS      = $(CFLAGS)
+ DEFS        =
+ ifndef _CC
+ export _CC  = gcc
+diff -up isdn4k-utils-CVS-2009-10-20/Makefile.me isdn4k-utils-CVS-2009-10-20/Makefile
+--- isdn4k-utils-CVS-2009-10-20/Makefile.me    2009-10-20 12:28:37.000000000 +0200
++++ isdn4k-utils-CVS-2009-10-20/Makefile       2009-10-20 12:29:14.000000000 +0200
+@@ -18,8 +18,8 @@ LIBDIR:=/usr/lib
+ # Following line is important for lib and isdnlog (sl).
+ export ROOTDIR=$(shell pwd)
+-ifeq (.config,$(wildcard .config))
+-include .config
++ifeq (.config.h,$(wildcard .config.h))
++include .config.h
+ do-it-all:      subtargets
+ else
+ CONFIGURATION = config
+@@ -134,14 +134,8 @@ rootperm:
+ install:
+       set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i install; done
+-      @: || if [ -c $(DESTDIR)/dev/isdnctrl0 ] && ls -l $(DESTDIR)/dev/isdnctrl0 | egrep "[[:space:]]45,[[:space:]]+64[[:space:]]" > /dev/null; \
+-      then \
+-              /bin/echo -e '(some) ISDN devices already exist, not creating them.\nUse scripts/makedev.sh manually if necessary.'; \
+-      else \
+-              sh scripts/makedev.sh $(DESTDIR) ; \
+-      fi
+-uninstall: rootperm
++uninstall:
+       set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i uninstall; done
+ #
diff --git a/isdn4k-utils/patches/isdn4k-utils-CVS-2010-05-01-capi-soname.patch b/isdn4k-utils/patches/isdn4k-utils-CVS-2010-05-01-capi-soname.patch
new file mode 100644 (file)
index 0000000..a22f79a
--- /dev/null
@@ -0,0 +1,44 @@
+*** isdn4k-utils/capi20.new/capi20.c.org       2010-05-07 20:56:21.000000000 +0200
+--- isdn4k-utils/capi20.new/capi20.c   2010-05-07 22:01:45.000000000 +0200
+***************
+*** 590,598 ****
+       psDir = opendir( pnModuleDir );
+       if ( psDir != NULL ) {
+               /* read entry by entry */
+               while ( ( psEntry = readdir( psDir ) ) != NULL )  {
+!                      /* skip ".", ".." and files which do not end with "so" */
+                       nLen = strlen( psEntry -> d_name );
+  
+                       switch ( nLen ) {
+                               case 1:
+--- 590,598 ----
+       psDir = opendir( pnModuleDir );
+       if ( psDir != NULL ) {
+               /* read entry by entry */
+               while ( ( psEntry = readdir( psDir ) ) != NULL )  {
+!                      /* skip ".", ".." and files which do not end with "so.?" */
+                       nLen = strlen( psEntry -> d_name );
+  
+                       switch ( nLen ) {
+                               case 1:
+***************
+*** 605,613 ****
+                                               continue;
+                                       }
+                                       break;
+                               default:
+!                                      if ( strncmp( psEntry -> d_name + nLen - 3, ".so", nLen ) ) {
+                                               continue;
+                                       }
+                                       break;
+                       }
+--- 605,613 ----
+                                               continue;
+                                       }
+                                       break;
+                               default:
+!                                      if ( strncmp( psEntry -> d_name + nLen - 5, ".so.0", 4 ) ) {
+                                               continue;
+                                       }
+                                       break;
+                       }
diff --git a/isdn4k-utils/patches/isdn4k-utils-CVS-2010-05-01-capi.patch b/isdn4k-utils/patches/isdn4k-utils-CVS-2010-05-01-capi.patch
new file mode 100644 (file)
index 0000000..f5998eb
--- /dev/null
@@ -0,0 +1,12 @@
+diff -up isdn4k-utils-CVS-2006-07-20/capi20.new/capidyn.c.orig isdn4k-utils-CVS-2006-07-20/capi20.new/capidyn.c
+--- isdn4k-utils-CVS-2006-07-20/capi20.new/capidyn.c.orig      2009-01-19 15:18:10.000000000 +0100
++++ isdn4k-utils-CVS-2006-07-20/capi20.new/capidyn.c   2009-01-19 15:19:30.000000000 +0100
+@@ -26,7 +26,7 @@
+ #include <dlfcn.h>
+-#define LIBCAPI       "libcapi20.so"
++#define LIBCAPI       "libcapi20.so.3"
+ static int loadlib(void);
+ /* ---------------------------------------------------------------------- */
diff --git a/isdn4k-utils/patches/isdn4k-utils-autoconf-2.6.4-quoting.patch b/isdn4k-utils/patches/isdn4k-utils-autoconf-2.6.4-quoting.patch
new file mode 100644 (file)
index 0000000..c4b3144
--- /dev/null
@@ -0,0 +1,14 @@
+diff -up isdn4k-utils-CVS-2009-10-20-patched/isdnlog/configure.in.orig isdn4k-utils-CVS-2009-10-20-patched/isdnlog/configure.in
+--- isdn4k-utils-CVS-2009-10-20-patched/isdnlog/configure.in.orig      2010-05-03 14:50:46.000000000 +0200
++++ isdn4k-utils-CVS-2009-10-20-patched/isdnlog/configure.in   2010-05-03 14:58:15.000000000 +0200
+@@ -140,8 +140,8 @@ if test -e tools/cdb/i4l_cdb.c  ; then
+     AC_MSG_RESULT(Using 'cdb' as database)
+ else
+ AC_CHECK_LIB(gdbm, gdbm_open, DBMLIB=-lgdbm; AC_DEFINE(HAVE_LIBGDBM, 1, [Use libgdbm]),
+-      AC_CHECK_LIB(dbm, dbm_open, DBMLIB=-ldbm; AC_DEFINE(HAVE_LIBDBM, 1, [Use libdbm]),
+-              AC_CHECK_LIB(db, dbm_open, DBMLIB=-ldb; AC_DEFINE(HAVE_LIBDB, 1, [use libdb]))))
++      [AC_CHECK_LIB(dbm, dbm_open, DBMLIB=-ldbm; AC_DEFINE(HAVE_LIBDBM, 1, [Use libdbm]),
++              [AC_CHECK_LIB(db, dbm_open, DBMLIB=-ldb; AC_DEFINE(HAVE_LIBDB, 1, [use libdb]))])])
+ fi
+ AC_DEFINE_UNQUOTED(RDBEXT,"$RDBEXT",[rdb extension])
diff --git a/isdn4k-utils/patches/isdn4k-utils-capiinit.patch b/isdn4k-utils/patches/isdn4k-utils-capiinit.patch
new file mode 100644 (file)
index 0000000..7593d07
--- /dev/null
@@ -0,0 +1,41 @@
+--- isdn4k-utils.orig/capiinit/capiinit.c      2006-04-18 19:27:03.689945766 +0200
++++ isdn4k-utils/capiinit/capiinit.c   2006-04-18 19:36:53.130636890 +0200
+@@ -1251,6 +1251,7 @@
+       if (check_procfs() < 0) return -1;
+       if (check_for_kernelcapi() < 0) return -1;
+       if (check_for_capi() < 0) return -1;
++      sleep(5); /* wait until the device node is created successfully by udev */
+       if (check_for_devcapi() < 0) return -1;
+       if (check_for_capifs() < 0) return 0; /* only warning */
+       if (check_for_capifs_mounted() < 0) return -1;
+--- isdn4k-utils.orig/capiinit/capi.conf       2006-04-18 19:37:43.515250539 +0200
++++ isdn4k-utils/capiinit/capi.conf    2006-04-18 19:37:53.953559630 +0200
+@@ -1,10 +1,10 @@
+ # card                file    proto   io      irq     mem     cardnr  options
+ #b1isa                b1.t4   DSS1    0x150   7       -       -       P2P
+-b1pci         b1.t4   DSS1    -       -       -       -
+-c4            c4.bin  DSS1    -       -       -       -
+-c4            -       DSS1    -       -       -       -
+-c4            -       DSS1    -       -       -       -       P2P
+-c4            -       DSS1    -       -       -       -       P2P
++#b1pci                b1.t4   DSS1    -       -       -       -
++#c4           c4.bin  DSS1    -       -       -       -
++#c4           -       DSS1    -       -       -       -
++#c4           -       DSS1    -       -       -       -       P2P
++#c4           -       DSS1    -       -       -       -       P2P
+ #c2           c2.bin  DSS1    -       -       -       -
+ #c2           -       DSS1    -       -       -       -
+ #t1isa                t1.t4   DSS1    0x340   9       -       0
+--- isdn4k-utils-CVS-2003-09-23/capiinit/capiinit.c.capi       2006-04-18 20:53:22.437430551 +0200
++++ isdn4k-utils-CVS-2003-09-23/capiinit/capiinit.c    2006-04-19 11:50:56.385891286 +0200
+@@ -1495,8 +1496,8 @@
+               unload_module("capiutil");
+               if ((mp = mounted("capifs")) != 0 && strcmp(mp, "/dev/capi") == 0)
+                       system("umount /dev/capi");
+-              if (filesystem_available("capifs"))
+-                      unload_filesystem("capifs");
++              /*if (filesystem_available("capifs"))
++                      unload_filesystem("capifs"); */
+       }
+       if (cardname && cname[0] == 0) {
+               fprintf(stderr,"ERROR: card \"%s\"  not found\n", cardname);
diff --git a/isdn4k-utils/patches/isdn4k-utils-man.patch b/isdn4k-utils/patches/isdn4k-utils-man.patch
new file mode 100644 (file)
index 0000000..55eb37b
--- /dev/null
@@ -0,0 +1,20 @@
+--- isdn4k-utils/xmonisdn/Makefile.in.man      Mon Oct 18 04:35:44 1999
++++ isdn4k-utils/xmonisdn/Makefile.in  Tue Jun 19 21:36:11 2001
+@@ -51,7 +51,7 @@
+       CFLAGS= ; MAKEFLAGS= ; $(MAKE) -f Makefile EXTRA_DEFINES="$(I4LU_DEFINES)"
+       rm -rf X11
+-xmonisdn.man: xmonisdn.man.in Makefile
++xmonisdn.man: xmonisdn.man.in
+       MANDATE=`grep CHECKIN $< | awk '{print $$4}'`; \
+       sed \
+          -e "s#\@MANDATE\@#$${MANDATE}#g" \
+@@ -60,7 +60,7 @@
+            -e s,\@CONFIG_XMONISDN_DOWNCMD\@,${CONFIG_XMONISDN_DOWNCMD},g \
+          < $< > $@
+-config:
++config: xmonisdn.man
+       @cp Makefile.in GNUmakefile
+       @xmkmf
diff --git a/isdn4k-utils/patches/isdn4k-utils-misc-overflow-in-capi-subsystem.patch b/isdn4k-utils/patches/isdn4k-utils-misc-overflow-in-capi-subsystem.patch
new file mode 100644 (file)
index 0000000..c840672
--- /dev/null
@@ -0,0 +1,17 @@
+diff -up isdn4k-utils-CVS-2006-07-20/capi20/convert.c.orig isdn4k-utils-CVS-2006-07-20/capi20/convert.c
+--- isdn4k-utils-CVS-2006-07-20/capi20/convert.c.orig  2009-01-19 17:24:26.000000000 +0100
++++ isdn4k-utils-CVS-2006-07-20/capi20/convert.c       2009-01-19 17:25:42.000000000 +0100
+@@ -894,8 +894,12 @@ static char *p = 0;
+ static void bufprint(char *fmt,...)
+ {
+       va_list f;
++      size_t remain = (p >= buf && p < buf+sizeof(buf))
++                                ? buf+sizeof(buf)-p
++                                : 0;
++
+       va_start(f, fmt);
+-      vsprintf(p, fmt, f);
++      vsnprintf(p, remain, fmt, f);
+       va_end(f);
+       p += strlen(p);
+ }
diff --git a/isdn4k-utils/patches/isdn4k-utils-sh-linux.patch b/isdn4k-utils/patches/isdn4k-utils-sh-linux.patch
new file mode 100644 (file)
index 0000000..c63d42d
--- /dev/null
@@ -0,0 +1,11 @@
+--- isdn4k-utils-CVS-2006-07-20/ipppd/main.c.org       2008-07-06 00:10:14.000000000 +0900
++++ isdn4k-utils-CVS-2006-07-20/ipppd/main.c   2008-07-06 00:11:11.000000000 +0900
+@@ -1302,7 +1302,7 @@
+          * what gets passed for a va_list is like a void * in some sense.
+          */
+         a = va_arg(args, void *);
+-#ifdef __alpha__       /* always do this? */
++#if defined(__alpha__) || defined(__sh__)       /* always do this? */
+       n = fmtmsg(buf, buflen + 1, f, a);
+ #else
+       n = vfmtmsg(buf, buflen + 1, f, a);
diff --git a/isdn4k-utils/patches/isdn4k-utils-statfs.patch b/isdn4k-utils/patches/isdn4k-utils-statfs.patch
new file mode 100644 (file)
index 0000000..7c6b2c3
--- /dev/null
@@ -0,0 +1,84 @@
+--- isdn4k-utils-CVS-2005-03-09/vbox/src/vboxgetty.c.old       2000-11-30 16:35:20.000000000 +0100
++++ isdn4k-utils-CVS-2005-03-09/vbox/src/vboxgetty.c   2005-04-20 16:30:31.000000000 +0200
+@@ -434,7 +434,7 @@
+ static int check_spool_space(unsigned long need)
+ {
+       struct statfs stat;
+-      unsigned long have;
++      unsigned long long have;
+       log(L_DEBUG, "Checking free space on \"%s\"...\n", setup.spool);
+@@ -449,7 +449,7 @@
+       {
+               have = (stat.f_bfree * stat.f_bsize);
+-              log_line(L_JUNK, "%ld bytes available; %ld bytes needed... ", have, need);
++              log_line(L_JUNK, "%lld bytes available; %ld bytes needed... ", have, need);
+               if (have >= need)
+               {
+--- isdn4k-utils-CVS-2005-03-09/eurofile/src/wuauth/extensions.h.old   2005-04-20 16:35:37.000000000 +0200
++++ isdn4k-utils-CVS-2005-03-09/eurofile/src/wuauth/extensions.h       2005-04-20 16:37:02.000000000 +0200
+@@ -42,3 +42,8 @@
+ #define ARG8    entry->arg[8]
+ #define ARG9    entry->arg[9]
+ #define ARG     entry->arg
++
++#if defined(HAVE_STATVFS) || defined(HAVE_SYS_VFS) || defined (HAVE_SYS_MOUNT)
++unsigned long long getSize(s);
++#endif
++
+--- isdn4k-utils-CVS-2005-03-09/eurofile/src/wuauth/extensions.c.old   2005-04-20 16:20:17.000000000 +0200
++++ isdn4k-utils-CVS-2005-03-09/eurofile/src/wuauth/extensions.c       2005-04-20 16:24:56.000000000 +0200
+@@ -154,7 +154,7 @@
+ }
+ #if defined(HAVE_STATVFS)
+-int getSize(s)
++unsigned long long getSize(s)
+ char *s;
+ {
+     int c;
+@@ -163,10 +163,10 @@
+     if (( c = statvfs(s, &buf)) != 0)
+         return(0);
+-    return(buf.f_bavail * buf.f_frsize / 1024);
++    return((unsigned long long)(buf.f_bavail * buf.f_frsize / 1024));
+ }
+ #elif defined(HAVE_SYS_VFS) || defined (HAVE_SYS_MOUNT)
+-int getSize(s)
++unsigned long long getSize(s)
+ char *s;
+ {
+     int c;
+@@ -175,7 +175,7 @@
+     if (( c = statfs(s, &buf)) != 0)
+         return(0);
+-    return(buf.f_bavail * buf.f_bsize / 1024);
++    return((unsigned long long)(buf.f_bavail * buf.f_bsize / 1024));
+ }
+ #endif
+@@ -236,7 +236,7 @@
+             case 'F':
+ #if defined(HAVE_STATVFS) || defined(HAVE_SYS_VFS) || defined(HAVE_SYS_MOUNT)
+-                sprintf(outptr, "%lu", getSize("."));
++                sprintf(outptr, "%llu",(unsigned long long)getSize("."));
+ #endif
+                 break;
+--- isdn4k-utils-CVS-2005-03-09/eurofile/src/wuauth/divfunc.c.old      2001-03-01 15:59:14.000000000 +0100
++++ isdn4k-utils-CVS-2005-03-09/eurofile/src/wuauth/divfunc.c  2005-04-20 16:34:26.000000000 +0200
+@@ -121,7 +121,7 @@
+             case 'F':
+ #if defined(HAVE_STATVFS) || defined(HAVE_SYS_VFS) || defined(HAVE_SYS_MOUNT)
+-                sprintf(outptr, "%lu", getSize("."));
++                sprintf(outptr, "%llu",(unsigned long long)getSize("."));
+ #endif
+                 break;
diff --git a/isdn4k-utils/patches/ppp-userpass.patch b/isdn4k-utils/patches/ppp-userpass.patch
new file mode 100644 (file)
index 0000000..82111ca
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/pppdcapiplugin/Rules.make.orig   2009-10-20 11:07:28.000000000 +0200
++++ b/pppdcapiplugin/Rules.make        2010-07-22 20:17:24.000000000 +0200
+@@ -24,7 +24,7 @@
+       $(CC) -o $@ $(LDFLAGS) capiplugin.o capiconn.o -lcapi20dyn
+ userpass.so: userpass.o
+-      $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $(MYCFLAGS) -nostdlib userpass.o
++      $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $(MYCFLAGS) userpass.o
+ %.o: %.c
+       $(CC) $(CFLAGS) $(MYCFLAGS) -c -o $@ $<
diff --git a/isdn4k-utils/systemd/capi.service b/isdn4k-utils/systemd/capi.service
new file mode 100644 (file)
index 0000000..fc504fc
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=Capi services for passiv ISDN cards
+After=syslog.target
+
+[Service]
+ExecStart=/usr/sbin/capiinit start
+ExecStop=/usr/sbin/capiinit stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/isdn4k-utils/systemd/isdn.service b/isdn4k-utils/systemd/isdn.service
new file mode 100644 (file)
index 0000000..3442737
--- /dev/null
@@ -0,0 +1,15 @@
+[Unit]
+Description=ISDN Services
+Requires=syslog.target network.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/libexec/isdn start
+ExecStop=/usr/libexec/isdn stop
+Environment=BOOTUP=serial
+Environment=CONSOLETYPE=serial
+StandardError=syslog
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
index ff42e14538ca099386acd57aa0fe4d3cec634ba1..55e5ffd76d3a6e100e1b1b526f7c230e56c02494 100644 (file)
--- a/iw/iw.nm
+++ b/iw/iw.nm
@@ -36,4 +36,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index e3cc1bb6c9dfaa976f97049813352f670c2acb13..ecc5149f6fbfebf5bf57cef24ff1aabb5d569f77 100644 (file)
@@ -31,4 +31,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 607a0ade226b0f3baa90faf4ceffb6e146ba86a6..cfe605a4ea01549bf2327f64141e33d5eda4ce72 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = jwhois
 version    = 4.0
-release    = 0
+release    = 1
 
-groups     = Base Applications/Internet
+groups     = Applications/Internet
 url        = http://www.gnu.org/software/jwhois/
 license    = GPLv3
 summary    = Internet whois/nicname client.
@@ -41,5 +41,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index daed6ac6269880f22452a263778bcc8e78752d7b..2fe9da16c781edf3887aeb59d17b9c6d49c73bf1 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = kbd
-version    = 1.15
+version    = 1.15.3
 release    = 1
 epoch      = 1
 
@@ -14,8 +14,8 @@ license    = GPLv2+
 summary    = Tools for configuring the console (keyboard, virtual terminals, etc.).
 
 description
-       The kbd package contains tools for managing a Linux \
-       system's console's behavior, including the keyboard, the screen \
+       The kbd package contains tools for managing a Linux
+       system's console's behavior, including the keyboard, the screen
        fonts, the virtual terminals and font files.
 end
 
@@ -24,13 +24,43 @@ sources   += kbd-latarcyrheb-16-fixed.tar.bz2
 sources   += kbd-latsun-fonts.tar.bz2
 
 build
+       requires
+               bison
+               flex
+               gettext
+       end
+
        configure_options += \
-               --datadir=/lib/kbd
-       
-       # Adding our own fonts
+               --datadir=/lib/kbd \
+               --disable-rpath \
+               --enable-nls
+
        prepare_cmds
+               # Adding our own fonts.
+               cd %{DIR_APP}
                %{MACRO_EXTRACT} %{DIR_DL}/kbd-latarcyrheb-16-fixed.tar.bz2
                %{MACRO_EXTRACT} %{DIR_DL}/kbd-latsun-fonts.tar.bz2
+
+               # 7-bit maps are obsolete; so are non-euro maps
+               cd %{DIR_APP}/data/keymaps/i386
+               mv qwerty/fi.map qwerty/fi-old.map
+               cp qwerty/fi-latin9.map qwerty/fi.map
+               cp qwerty/pt-latin9.map qwerty/pt.map
+               cp qwerty/sv-latin1.map qwerty/se-latin1.map
+               mv azerty/fr.map azerty/fr-old.map
+               cp azerty/fr-latin9.map azerty/fr.map
+               cp azerty/fr-latin9.map azerty/fr-latin0.map
+
+               # Rename conflicting keymaps
+               mv dvorak/no.map dvorak/no-dvorak.map
+               mv fgGIod/trf.map fgGIod/trf-fgGIod.map
+               mv olpc/es.map olpc/es-olpc.map
+               mv olpc/pt.map olpc/pt-olpc.map
+               mv qwerty/cz.map qwerty/cz-qwerty.map
+
+               # remove obsolete "gr" translation
+               cd %{DIR_APP}/po
+               rm -f gr.po gr.gmo
        end
 
        install_cmds
@@ -42,4 +72,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/kbd/patches/kbd-1.15-po.patch b/kbd/patches/kbd-1.15-po.patch
deleted file mode 100644 (file)
index 0221f60..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-diff -up kbd-1.15/po/Makefile.in_old kbd-1.15/po/Makefile.in
---- kbd-1.15/po/Makefile.in_old        2008-10-23 21:03:59.000000000 +0200
-+++ kbd-1.15/po/Makefile.in    2008-12-09 15:35:58.000000000 +0100
-@@ -4,10 +4,10 @@ srcdir = @srcdir@
- prefix        = @prefix@
- datarootdir   = @datarootdir@
--datadir       = @datadir@
--localedir     = $(DESTDIR)$(datadir)/locale
--gnulocaledir  = $(DESTDIR)$(datadir)/locale
--gettextsrcdir = $(DESTDIR)$(datadir)/gettext/po
-+datadir       = $(DESTDIR)@datadir@
-+localedir     = $(DESTDIR)@localedir@
-+gnulocaledir  = $(DESTDIR)@localedir@
-+gettextsrcdir = $(datadir)/gettext/po
- FOREIGN       = @FOREIGN@
- HAVE_XGETTEXT = @HAVE_XGETTEXT@
-@@ -36,10 +36,10 @@ INCLUDES = -I.. -I$(INTL)
- COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
- # Enter here all .po files
--POFILES =  cs.po da.po de.po el.po es.po fr.po gr.po nl.po pl.po \
-+POFILES =  cs.po da.po de.po el.po es.po fr.po nl.po pl.po \
-  ro.po ru.po sv.po tr.po
- # the same but with .gmo
--GMOFILES = cs.gmo da.gmo de.gmo el.gmo es.gmo fr.gmo gr.gmo nl.gmo \
-+GMOFILES = cs.gmo da.gmo de.gmo el.gmo es.gmo fr.gmo nl.gmo \
-  pl.gmo ro.gmo ru.gmo sv.gmo tr.gmo
- CATALOGS = $(GMOFILES)
diff --git a/kbd/patches/kbd-1.15-quiet_doc.patch b/kbd/patches/kbd-1.15-quiet_doc.patch
deleted file mode 100644 (file)
index eca867b..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-diff -up kbd-1.15/man/man1/loadkeys.1.in_old kbd-1.15/man/man1/loadkeys.1.in
---- kbd-1.15/man/man1/loadkeys.1.in_old        2008-10-23 21:03:59.000000000 +0200
-+++ kbd-1.15/man/man1/loadkeys.1.in    2009-03-05 13:11:08.000000000 +0100
-@@ -19,6 +19,8 @@ loadkeys \- load keyboard translation ta
- ] [
- .I -m --mktable
- ] [
-+.I -q --quiet
-+] [
- .I -s --clearstrings
- ] [
- .I -v --verbose
-@@ -148,6 +150,10 @@ command (and does not modify the current
- .B loadkeys
- prints its version number and a short usage message to the programs
- standard error output and exits.
-+.TP
-+.B \-q \-\-quiet
-+.B loadkeys
-+suppresses all normal output.
- .SH WARNING
- Note that anyone having read access to
- .B /dev/console
-diff -up kbd-1.15/src/loadkeys.c_old kbd-1.15/src/loadkeys.c
---- kbd-1.15/src/loadkeys.c_old        2008-10-23 21:03:59.000000000 +0200
-+++ kbd-1.15/src/loadkeys.c    2009-03-05 13:09:00.000000000 +0100
-@@ -1966,6 +1966,7 @@ usage(void) {
- "  -d --default       load \"%s\"\n"
- "  -h --help          display this help text\n"
- "  -m --mktable       output a \"defkeymap.c\" to stdout\n"
-+"  -q --quiet         suppress all normal output\n"
- "  -s --clearstrings  clear kernel string table\n"
- "  -u --unicode       implicit conversion to Unicode\n"
- "  -v --verbose       report the changes\n"), PACKAGE_VERSION, DEFMAP);
diff --git a/kbd/patches/kbd-1.15-sparc.patch b/kbd/patches/kbd-1.15-sparc.patch
deleted file mode 100644 (file)
index a858a25..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-diff -up kbd-1.15/man/man8/kbdrate.8_old kbd-1.15/man/man8/kbdrate.8
---- kbd-1.15/man/man8/kbdrate.8_old    2008-12-10 14:20:33.000000000 +0100
-+++ kbd-1.15/man/man8/kbdrate.8        2008-12-10 14:41:10.000000000 +0100
-@@ -22,7 +22,7 @@ Using
- without any options will reset the repeat rate to 10.9 characters per second (cps)
- and the delay to 250 milliseconds (ms) for Intel- and M68K-based systems.
- These are the IBM defaults. On SPARC-based systems it will reset the repeat rate
--to 5 cps and the delay to 200 ms.
-+to 20 cps and the delay to 200 ms.
- .SH OPTIONS
- .TP
-@@ -69,3 +69,5 @@ When these ioctls fail an ioport interfa
- .I /etc/rc.local
- .br
- .I /dev/port
-+.br
-+.I /dev/kbd
-diff -up kbd-1.15/src/kbdrate.c_old kbd-1.15/src/kbdrate.c
---- kbd-1.15/src/kbdrate.c_old 2008-12-10 14:00:25.000000000 +0100
-+++ kbd-1.15/src/kbdrate.c     2008-12-10 14:20:11.000000000 +0100
-@@ -77,7 +77,6 @@ beats rebuilding the kernel!
- #ifdef __sparc__
- #include <asm/param.h>
--#include <asm/kbio.h>
- #endif
- #ifndef KDKBDREP
-@@ -109,11 +108,15 @@ static int valid_delays[] = { 250, 500, 
- static int
- KDKBDREP_ioctl_ok(double rate, int delay, int silent) {
-+#if defined(KDKBDREP) && !defined(__sparc__)
-       /*
-        * This ioctl is defined in <linux/kd.h> but is not
-        * implemented anywhere - must be in some m68k patches.
-+         * We cannot blindly try unimplemented ioctls on sparc64 -
-+         * the 32<->64bit transition layer does not like it.
-        * Since 2.4.9 also on i386.
--       */
-+         */
-+
-       struct my_kbd_repeat kbdrep_s;
-       /* don't change, just test */
-@@ -177,6 +180,9 @@ KDKBDREP_ioctl_ok(double rate, int delay
-                       rate, kbdrep_s.delay );
-       return 1;                       /* success! */
-+#else /* no KDKBDREP or __sparc__ */
-+        return 0;
-+#endif /* KDKBDREP */
- }
- static int
-@@ -221,7 +227,7 @@ sigalrmhandler( int sig ) {
- int
- main( int argc, char **argv ) {
- #ifdef __sparc__
--      double      rate = 5.0;      /* Default rate */
-+        double      rate = 20.0;      /* Default rate */
-       int         delay = 200;     /* Default delay */
- #else
-       double      rate = 10.9;     /* Default rate */
-@@ -272,7 +278,9 @@ main( int argc, char **argv ) {
-       /* The ioport way */
-+        /* The ioport way - will crash on sparc */
-+#ifndef __sparc__
-       for (i = 0; i < RATE_COUNT; i++)
-               if (rate * 10 >= valid_rates[i]) {
-                       value &= 0x60;
-@@ -335,5 +343,7 @@ main( int argc, char **argv ) {
-                       valid_rates[value & 0x1f] / 10.0,
-                       valid_delays[ (value & 0x60) >> 5 ] );
-+#endif
-+
-       return 0;
- }
-diff -up kbd-1.15/src/setleds.c_old kbd-1.15/src/setleds.c
---- kbd-1.15/src/setleds.c_old 2008-12-10 14:00:02.000000000 +0100
-+++ kbd-1.15/src/setleds.c     2008-12-10 14:00:16.000000000 +0100
-@@ -14,10 +14,6 @@
- #include "nls.h"
- #include "version.h"
--#ifdef __sparc__
--#include <asm/kbio.h>
--#endif
--
- static void
- usage(void)
- {
diff --git a/kbd/patches/kbd-1.15.3-dumpkeys-man.patch b/kbd/patches/kbd-1.15.3-dumpkeys-man.patch
new file mode 100644 (file)
index 0000000..e77718b
--- /dev/null
@@ -0,0 +1,18 @@
+diff -up kbd-1.15.3/man/man1/dumpkeys.1.in.orig kbd-1.15.3/man/man1/dumpkeys.1.in
+--- kbd-1.15.3/man/man1/dumpkeys.1.in.orig     2011-08-23 13:06:16.905892768 +0200
++++ kbd-1.15.3/man/man1/dumpkeys.1.in  2011-08-23 13:15:18.264853435 +0200
+@@ -156,6 +156,14 @@ output of
+ .BR dumpkeys .
+ .LP
+ .TP
++.B \-1 \-\-separate-lines
++This forces
++.B dumpkeys
++to write one line per (modifier,keycode) pair. It prefixes the word
++.I plain
++for plain keycodes.
++.LP
++.TP
+ .B \-\-funcs-only
+ When this option is given,
+ .B dumpkeys
diff --git a/kbd/patches/kbd-1.15.3-fix-es-translation.patch b/kbd/patches/kbd-1.15.3-fix-es-translation.patch
new file mode 100644 (file)
index 0000000..9d43d8d
--- /dev/null
@@ -0,0 +1,12 @@
+diff -up kbd-1.15.3/po/es.po.orig kbd-1.15.3/po/es.po
+--- kbd-1.15.3/po/es.po.orig   2011-08-22 15:18:35.262343023 +0200
++++ kbd-1.15.3/po/es.po        2011-08-22 15:19:14.844340262 +0200
+@@ -1363,7 +1363,7 @@ msgstr "No se encontró nada que guardar
+ #: src/setfont.c:682
+ #, c-format
+ msgid "Saved %d-char %dx%d font file on %s\n"
+-msgstr "Se ha guardado el fichero de tipos %2$dx%3$d de %1$d caracteres en %s\n"
++msgstr "Se ha guardado el fichero de tipos %dx%d de %d caracteres en %s\n"
+ #: src/setkeycodes.c:21
+ #, c-format
diff --git a/keepalived/keepalived.nm b/keepalived/keepalived.nm
new file mode 100644 (file)
index 0000000..8c825a3
--- /dev/null
@@ -0,0 +1,79 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = keepalived
+version    = 1.2.2
+release    = 2
+
+groups     = Applications/System
+url        = http://www.keepalived.org/
+license    = GPLv2+
+summary    = High Availability monitor built upon LVS, VRRP and service pollers.
+
+description
+       The main goal of the keepalived project is to add a strong & robust keepalive
+       facility to the Linux Virtual Server project. This project is written in C with
+       multilayer TCP/IP stack checks. Keepalived implements a framework based on
+       three family checks : Layer3, Layer4 & Layer5/7. This framework gives the
+       daemon the ability to check the state of an LVS server pool. When one of the
+       servers of the LVS server pool is down, keepalived informs the linux kernel via
+       a setsockopt call to remove this server entry from the LVS topology. In
+       addition keepalived implements an independent VRRPv2 stack to handle director
+       failover. So in short keepalived is a userspace daemon for LVS cluster nodes
+       healthchecks and LVS directors failover.
+end
+
+source_dl  = http://www.keepalived.org/software/
+
+build
+       requires
+               libnl-devel
+               openssl-devel
+               popt-devel
+       end
+
+       configure_options += \
+               --sysconfdir=/etc
+
+#              --with-kernel-dir=$(ls -1d --sort t /lib/modules/*/build | head 1)
+
+       make_targets += STRIP=/bin/true
+
+       test
+               # A build could silently have LVS support disabled if the kernel includes can't
+               # be properly found, we need to avoid that.
+               if ! grep -q "IPVS_SUPPORT='_WITH_LVS_'" config.log; then
+                       echo "ERROR: We do not want keeepalived lacking LVS support."
+                       exit 1
+               fi
+       end
+
+       install_cmds
+               rm -rvf %{BUILDROOT}/etc/rc.d \
+                       %{BUILDROOT}/etc/keepalived/samples
+       end
+end
+
+packages
+       package %{name}
+               postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               postun
+                       /bin/systemctl --no-reload disabled keepalived.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop keepalived.service >/dev/null 2>&1 || :
+               end
+
+               postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl try-restart keepalived.service >/dev/null 2>&1 || :
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
diff --git a/keepalived/patches/keepalived-1.1.14-installmodules.patch b/keepalived/patches/keepalived-1.1.14-installmodules.patch
new file mode 100644 (file)
index 0000000..a5fc93c
--- /dev/null
@@ -0,0 +1,20 @@
+diff -Naupr keepalived-1.1.14.orig/keepalived/Makefile.in keepalived-1.1.14/keepalived/Makefile.in
+--- keepalived-1.1.14.orig/keepalived/Makefile.in      2007-09-13 15:44:39.000000000 +0200
++++ keepalived-1.1.14/keepalived/Makefile.in   2007-09-14 12:38:43.000000000 +0200
+@@ -99,13 +99,13 @@ uninstall:
+ install:
+       install -d $(DESTDIR)$(sbindir)
+-      install -m 700 $(BIN)/$(EXEC) $(DESTDIR)$(sbindir)/
++      install -m 755 $(BIN)/$(EXEC) $(DESTDIR)$(sbindir)/
+       install -d $(DESTDIR)$(init_dir)
+       install -m 755 etc/init.d/keepalived.init $(DESTDIR)$(init_dir)/keepalived
+       install -d $(DESTDIR)$(sysconf_dir)
+-      install -m 755 etc/init.d/keepalived.sysconfig $(DESTDIR)$(sysconf_dir)/keepalived
++      install -m 644 etc/init.d/keepalived.sysconfig $(DESTDIR)$(sysconf_dir)/keepalived
+       install -d $(DESTDIR)$(sysconfdir)/keepalived/samples
+-      install -m 644 etc/keepalived/keepalived.conf $(DESTDIR)$(sysconfdir)/keepalived/
++      install -m 640 etc/keepalived/keepalived.conf $(DESTDIR)$(sysconfdir)/keepalived/
+       install -m 644 ../doc/samples/* $(DESTDIR)$(sysconfdir)/keepalived/samples/
+       install -d $(DESTDIR)$(mandir)/man5
+       install -d $(DESTDIR)$(mandir)/man8
diff --git a/keepalived/patches/keepalived-1.1.19-fix-ipvs-loading.patch b/keepalived/patches/keepalived-1.1.19-fix-ipvs-loading.patch
new file mode 100644 (file)
index 0000000..912914b
--- /dev/null
@@ -0,0 +1,12 @@
+diff -Naupr keepalived-1.1.19.orig/keepalived/check/ipvswrapper.c keepalived-1.1.19/keepalived/check/ipvswrapper.c
+--- keepalived-1.1.19.orig/keepalived/check/ipvswrapper.c      2009-09-28 13:03:40.000000000 +0200
++++ keepalived-1.1.19/keepalived/check/ipvswrapper.c   2009-11-24 22:41:56.220195007 +0100
+@@ -789,7 +789,7 @@ string_to_number(const char *s, int min,
+ static int
+ modprobe_ipvs(void)
+ {
+-      char *argv[] = { "/sbin/modprobe", "-s", "-k", "--", "ip_vs", NULL };
++      char *argv[] = { "/sbin/modprobe", "-s", "--", "ip_vs", NULL };
+       int child;
+       int status;
+       int rc;
diff --git a/keepalived/patches/keepalived-1.2.2-ip_vs.h-pathfix.patch b/keepalived/patches/keepalived-1.2.2-ip_vs.h-pathfix.patch
new file mode 100644 (file)
index 0000000..468fc0e
--- /dev/null
@@ -0,0 +1,12 @@
+diff -up keepalived-1.2.2/configure.pathfix keepalived-1.2.2/configure
+--- keepalived-1.2.2/configure.pathfix 2011-09-19 12:31:19.615258629 -0400
++++ keepalived-1.2.2/configure 2011-09-19 12:31:38.872000057 -0400
+@@ -3973,7 +3973,7 @@ $as_echo "$as_me: WARNING: Cannot determ
+ IPVS_SUPPORT="_WITHOUT_LVS_"
+ if test "$enable_lvs" != "no"; then
+-  ac_fn_c_check_header_mongrel "$LINENO" "net/ip_vs.h" "ac_cv_header_net_ip_vs_h" "$ac_includes_default"
++  ac_fn_c_check_header_mongrel "$LINENO" "linux/ip_vs.h" "ac_cv_header_net_ip_vs_h" "$ac_includes_default"
+ if test "x$ac_cv_header_net_ip_vs_h" = x""yes; then :
+   IPVS_SUPPORT="_WITH_LVS_"
+ else
diff --git a/keepalived/systemd/keepalived.service b/keepalived/systemd/keepalived.service
new file mode 100644 (file)
index 0000000..438ed78
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=LVS and VRRP High Availability Monitor
+After=syslog.target network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/keepalived
+
+[Install]
+WantedBy=multi-user.target
diff --git a/kernel/config.armv5tel-versatile b/kernel/config.armv5tel-versatile
new file mode 100644 (file)
index 0000000..bee5a61
--- /dev/null
@@ -0,0 +1,1449 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Linux/arm 3.1.1-2.ip3.armv5tel Kernel Configuration
+#
+CONFIG_ARM=y
+CONFIG_MIGHT_HAVE_PCI=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_HAVE_SCHED_CLOCK=y
+# CONFIG_ARCH_USES_GETTIMEOFFSET is not set
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_KTIME_SCALAR=y
+CONFIG_HAVE_PROC_CPU=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_VECTORS_BASE=0xffff0000
+# CONFIG_ARM_PATCH_PHYS_VIRT is not set
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_HAVE_IRQ_WORK=y
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_CROSS_COMPILE=""
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_HAVE_KERNEL_GZIP=y
+CONFIG_HAVE_KERNEL_LZMA=y
+CONFIG_HAVE_KERNEL_LZO=y
+CONFIG_KERNEL_GZIP=y
+# CONFIG_KERNEL_LZMA is not set
+# CONFIG_KERNEL_LZO is not set
+CONFIG_DEFAULT_HOSTNAME="(none)"
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_FHANDLE is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+CONFIG_HAVE_GENERIC_HARDIRQS=y
+
+#
+# IRQ subsystem
+#
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_HAVE_SPARSE_IRQ=y
+CONFIG_GENERIC_IRQ_SHOW=y
+# CONFIG_SPARSE_IRQ is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_TINY_RCU=y
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_RCU_TRACE is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_NAMESPACES=y
+CONFIG_UTS_NS=y
+CONFIG_IPC_NS=y
+CONFIG_USER_NS=y
+CONFIG_PID_NS=y
+CONFIG_NET_NS=y
+# CONFIG_SCHED_AUTOGROUP is not set
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
+CONFIG_RD_XZ=y
+CONFIG_RD_LZO=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+# CONFIG_EXPERT is not set
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+# CONFIG_EMBEDDED is not set
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_PERF_USE_VMALLOC=y
+
+#
+# Kernel Performance Events And Counters
+#
+# CONFIG_PERF_EVENTS is not set
+# CONFIG_PERF_COUNTERS is not set
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_COMPAT_BRK=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+
+#
+# GCOV-based kernel profiling
+#
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+CONFIG_LBDAF=y
+CONFIG_BLK_DEV_BSG=y
+# CONFIG_BLK_DEV_BSGLIB is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+# CONFIG_INLINE_SPIN_TRYLOCK is not set
+# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK is not set
+# CONFIG_INLINE_SPIN_LOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
+CONFIG_INLINE_SPIN_UNLOCK=y
+# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
+CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
+# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_READ_TRYLOCK is not set
+# CONFIG_INLINE_READ_LOCK is not set
+# CONFIG_INLINE_READ_LOCK_BH is not set
+# CONFIG_INLINE_READ_LOCK_IRQ is not set
+# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
+CONFIG_INLINE_READ_UNLOCK=y
+# CONFIG_INLINE_READ_UNLOCK_BH is not set
+CONFIG_INLINE_READ_UNLOCK_IRQ=y
+# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_WRITE_TRYLOCK is not set
+# CONFIG_INLINE_WRITE_LOCK is not set
+# CONFIG_INLINE_WRITE_LOCK_BH is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
+CONFIG_INLINE_WRITE_UNLOCK=y
+# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
+CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
+# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
+# CONFIG_MUTEX_SPIN_ON_OWNER is not set
+CONFIG_FREEZER=y
+
+#
+# System Type
+#
+CONFIG_MMU=y
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+CONFIG_ARCH_VERSATILE=y
+# CONFIG_ARCH_VEXPRESS is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_BCMRING is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CNS3XXX is not set
+# CONFIG_ARCH_GEMINI is not set
+# CONFIG_ARCH_PRIMA2 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_MXS is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_DOVE is not set
+# CONFIG_ARCH_KIRKWOOD is not set
+# CONFIG_ARCH_LPC32XX is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_W90X900 is not set
+# CONFIG_ARCH_NUC93X is not set
+# CONFIG_ARCH_TEGRA is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_MSM is not set
+# CONFIG_ARCH_SHMOBILE is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_S5P64X0 is not set
+# CONFIG_ARCH_S5PC100 is not set
+# CONFIG_ARCH_S5PV210 is not set
+# CONFIG_ARCH_EXYNOS4 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_TCC_926 is not set
+# CONFIG_ARCH_U300 is not set
+# CONFIG_ARCH_U8500 is not set
+# CONFIG_ARCH_NOMADIK is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP is not set
+# CONFIG_PLAT_SPEAR is not set
+# CONFIG_ARCH_VT8500 is not set
+# CONFIG_ARCH_ZYNQ is not set
+
+#
+# System MMU
+#
+
+#
+# Versatile platform type
+#
+CONFIG_ARCH_VERSATILE_PB=y
+CONFIG_MACH_VERSATILE_AB=y
+# CONFIG_MACH_VERSATILE_DT is not set
+CONFIG_PLAT_VERSATILE_CLCD=y
+CONFIG_PLAT_VERSATILE_FPGA_IRQ=y
+CONFIG_PLAT_VERSATILE_SCHED_CLOCK=y
+CONFIG_PLAT_VERSATILE=y
+CONFIG_ARM_TIMER_SP804=y
+
+#
+# Processor Type
+#
+CONFIG_CPU_ARM926T=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5TJ=y
+CONFIG_CPU_PABRT_LEGACY=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+CONFIG_CPU_USE_DOMAINS=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
+CONFIG_ARM_L1_CACHE_SHIFT=5
+CONFIG_ARM_VIC=y
+CONFIG_ARM_VIC_NR=2
+CONFIG_ICST=y
+
+#
+# Bus support
+#
+CONFIG_ARM_AMBA=y
+# CONFIG_PCI is not set
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_HZ=100
+# CONFIG_AEABI is not set
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+CONFIG_HAVE_ARCH_PFN_VALID=y
+# CONFIG_HIGHMEM is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=999999
+# CONFIG_COMPACTION is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_KSM is not set
+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+CONFIG_NEED_PER_CPU_KM=y
+# CONFIG_CLEANCACHE is not set
+CONFIG_FORCE_MAX_ZONEORDER=11
+CONFIG_LEDS=y
+CONFIG_LEDS_CPU=y
+CONFIG_ALIGNMENT_TRAP=y
+# CONFIG_UACCESS_WITH_MEMCPY is not set
+# CONFIG_SECCOMP is not set
+# CONFIG_CC_STACKPROTECTOR is not set
+# CONFIG_DEPRECATED_PARAM_STRUCT is not set
+
+#
+# Boot options
+#
+# CONFIG_USE_OF is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="root=1f03 mem=32M"
+CONFIG_CMDLINE_FROM_BOOTLOADER=y
+# CONFIG_CMDLINE_EXTEND is not set
+# CONFIG_CMDLINE_FORCE is not set
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
+# CONFIG_AUTO_ZRELADDR is not set
+
+#
+# CPU Power Management
+#
+# CONFIG_CPU_IDLE is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
+CONFIG_VFP=y
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
+CONFIG_HAVE_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_ARTHUR is not set
+
+#
+# Power management options
+#
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_PM_SLEEP=y
+# CONFIG_PM_RUNTIME is not set
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+# CONFIG_APM_EMULATION is not set
+CONFIG_PM_CLK=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE_DEMUX is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+CONFIG_INET_LRO=y
+# CONFIG_INET_DIAG is not set
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_RDS is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_L2TP is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_PHONET is not set
+# CONFIG_IEEE802154 is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+# CONFIG_BATMAN_ADV is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+CONFIG_WIRELESS=y
+# CONFIG_CFG80211 is not set
+# CONFIG_LIB80211 is not set
+
+#
+# CFG80211 needs to be enabled for MAC80211
+#
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+# CONFIG_CAIF is not set
+# CONFIG_CEPH_LIB is not set
+# CONFIG_NFC is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH=""
+# CONFIG_DEVTMPFS is not set
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_TESTS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_MTD_AR7_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_SM_FTL is not set
+# CONFIG_MTD_OOPS is not set
+# CONFIG_MTD_SWAP is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_NOSWAP=y
+# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
+# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
+# CONFIG_MTD_CFI_GEOMETRY is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_OTP is not set
+CONFIG_MTD_CFI_INTELEXT=y
+# CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_PHYSMAP=y
+# CONFIG_MTD_PHYSMAP_COMPAT is not set
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+# CONFIG_MTD_PLATRAM is not set
+# CONFIG_MTD_PISMO is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+
+#
+# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
+#
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_RBD is not set
+# CONFIG_SENSORS_LIS3LV02D is not set
+# CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI_MOD=y
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+CONFIG_MII=y
+# CONFIG_PHYLIB is not set
+CONFIG_NET_ETHERNET=y
+# CONFIG_AX88796 is not set
+CONFIG_SMC91X=y
+# CONFIG_DM9000 is not set
+# CONFIG_ETHOC is not set
+# CONFIG_SMC911X is not set
+# CONFIG_SMSC911X is not set
+# CONFIG_DNET is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 is not set
+# CONFIG_KS8851_MLL is not set
+# CONFIG_FTMAC100 is not set
+CONFIG_NETDEV_1000=y
+# CONFIG_STMMAC_ETH is not set
+# CONFIG_FTGMAC100 is not set
+CONFIG_NETDEV_10000=y
+CONFIG_WLAN=y
+# CONFIG_HOSTAP is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+# CONFIG_WAN is not set
+
+#
+# CAIF transport drivers
+#
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+# CONFIG_INPUT_SPARSEKMAP is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ADP5588 is not set
+# CONFIG_KEYBOARD_ADP5589 is not set
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_QT1070 is not set
+# CONFIG_KEYBOARD_QT2160 is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_TCA6416 is not set
+# CONFIG_KEYBOARD_MAX7359 is not set
+# CONFIG_KEYBOARD_MCS is not set
+# CONFIG_KEYBOARD_MPR121 is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_OPENCORES is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_SENTELIC is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MOUSE_SYNAPTICS_I2C is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+# CONFIG_SERIO_SERPORT is not set
+CONFIG_SERIO_AMBAKMI=y
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_SERIO_ALTERA_PS2 is not set
+# CONFIG_SERIO_PS2MULT is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=16
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_N_GSM is not set
+# CONFIG_TRACE_SINK is not set
+CONFIG_DEVKMEM=y
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=m
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_TIMBERDALE is not set
+# CONFIG_SERIAL_ALTERA_JTAGUART is not set
+# CONFIG_SERIAL_ALTERA_UART is not set
+# CONFIG_SERIAL_XILINX_PS_UART is not set
+# CONFIG_HVC_DCC is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=m
+# CONFIG_HW_RANDOM_TIMERIOMEM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_RAMOOPS is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_COMPAT=y
+CONFIG_I2C_CHARDEV=m
+# CONFIG_I2C_MUX is not set
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_DESIGNWARE is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_PXA_PCI is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_VERSATILE is not set
+# CONFIG_I2C_XILINX is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_SPI is not set
+
+#
+# PPS support
+#
+# CONFIG_PPS is not set
+
+#
+# PPS generators support
+#
+
+#
+# PTP clock support
+#
+
+#
+# Enable Device Drivers -> PPS to see the PTP clock options.
+#
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+# CONFIG_GPIOLIB is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+CONFIG_BCMA_POSSIBLE=y
+
+#
+# Broadcom specific AMBA
+#
+# CONFIG_BCMA is not set
+CONFIG_MFD_SUPPORT=y
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_88PM860X is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_TPS6105X is not set
+# CONFIG_TPS6507X is not set
+# CONFIG_TWL4030_CORE is not set
+# CONFIG_MFD_STMPE is not set
+# CONFIG_MFD_TC3589X is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_PMIC_ADP5520 is not set
+# CONFIG_MFD_MAX8925 is not set
+# CONFIG_MFD_MAX8997 is not set
+# CONFIG_MFD_MAX8998 is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM831X_I2C is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_WM8994 is not set
+# CONFIG_MFD_PCF50633 is not set
+# CONFIG_ABX500_CORE is not set
+# CONFIG_MFD_WL1273_CORE is not set
+# CONFIG_REGULATOR is not set
+# CONFIG_MEDIA_SUPPORT is not set
+
+#
+# Graphics support
+#
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_WMT_GE_ROPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+CONFIG_FB_ARMCLCD=y
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_BROADSHEET is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+CONFIG_FONTS=y
+# CONFIG_FONT_8x8 is not set
+# CONFIG_FONT_8x16 is not set
+# CONFIG_FONT_6x11 is not set
+# CONFIG_FONT_7x14 is not set
+# CONFIG_FONT_PEARL_8x8 is not set
+CONFIG_FONT_ACORN_8x8=y
+# CONFIG_FONT_MINI_4x6 is not set
+# CONFIG_FONT_SUN8x16 is not set
+# CONFIG_FONT_SUN12x22 is not set
+# CONFIG_FONT_10x18 is not set
+# CONFIG_LOGO is not set
+CONFIG_SOUND=y
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SOUND_OSS_CORE_PRECLAIM=y
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+# CONFIG_SND_SEQUENCER is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PCM_OSS_PLUGINS=y
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+CONFIG_SND_VMASTER=y
+# CONFIG_SND_RAWMIDI_SEQ is not set
+# CONFIG_SND_OPL3_LIB_SEQ is not set
+# CONFIG_SND_OPL4_LIB_SEQ is not set
+# CONFIG_SND_SBAWE_SEQ is not set
+# CONFIG_SND_EMU10K1_SEQ is not set
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_DRIVERS=y
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_ALOOP is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+# CONFIG_SND_AC97_POWER_SAVE is not set
+CONFIG_SND_ARM=y
+CONFIG_SND_ARMAACI=m
+# CONFIG_SND_SOC is not set
+# CONFIG_SOUND_PRIME is not set
+CONFIG_AC97_BUS=m
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HIDRAW is not set
+# CONFIG_HID_PID is not set
+
+#
+# Special HID drivers
+#
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+# CONFIG_USB is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# OTG and related infrastructure
+#
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+# CONFIG_MMC_CLKGATE is not set
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_MINORS=8
+CONFIG_MMC_BLOCK_BOUNCE=y
+# CONFIG_SDIO_UART is not set
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+CONFIG_MMC_ARMMMCI=m
+# CONFIG_MMC_SDHCI is not set
+# CONFIG_MMC_SDHCI_PXAV3 is not set
+# CONFIG_MMC_SDHCI_PXAV2 is not set
+# CONFIG_MMC_DW is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+# CONFIG_DMADEVICES is not set
+# CONFIG_AUXDISPLAY is not set
+# CONFIG_UIO is not set
+
+#
+# Virtio drivers
+#
+# CONFIG_VIRTIO_BALLOON is not set
+# CONFIG_STAGING is not set
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_HAVE_MACH_CLKDEV=y
+CONFIG_CLKSRC_MMIO=y
+CONFIG_IOMMU_SUPPORT=y
+# CONFIG_VIRT_DRIVERS is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+# CONFIG_NILFS2_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+CONFIG_EXPORTFS=y
+CONFIG_FILE_LOCKING=y
+CONFIG_FSNOTIFY=y
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_FANOTIFY is not set
+# CONFIG_QUOTA is not set
+# CONFIG_QUOTACTL is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# Caches
+#
+# CONFIG_FSCACHE is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+# CONFIG_MSDOS_FS is not set
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+# CONFIG_TMPFS is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_LOGFS is not set
+CONFIG_CRAMFS=y
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+CONFIG_MINIX_FS=y
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+CONFIG_ROMFS_FS=y
+CONFIG_ROMFS_BACKED_BY_BLOCK=y
+# CONFIG_ROMFS_BACKED_BY_MTD is not set
+# CONFIG_ROMFS_BACKED_BY_BOTH is not set
+CONFIG_ROMFS_ON_BLOCK=y
+# CONFIG_PSTORE is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+CONFIG_ROOT_NFS=y
+CONFIG_NFSD=y
+CONFIG_NFSD_V3=y
+# CONFIG_NFSD_V3_ACL is not set
+# CONFIG_NFSD_V4 is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_CEPH_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_NLS=m
+CONFIG_NLS_DEFAULT="iso8859-1"
+# CONFIG_NLS_CODEPAGE_437 is not set
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+CONFIG_NLS_CODEPAGE_850=m
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=m
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_STRIP_ASM_SYMS is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_SECTION_MISMATCH is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+# CONFIG_LOCKUP_DETECTOR is not set
+# CONFIG_HARDLOCKUP_DETECTOR is not set
+# CONFIG_DETECT_HUNG_TASK is not set
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_KMEMLEAK is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_SPARSE_RCU_POINTER is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_ATOMIC_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_TEST_LIST_SORT is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_DEBUG_CREDENTIALS is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_TRACING_SUPPORT=y
+CONFIG_FTRACE=y
+# CONFIG_FUNCTION_TRACER is not set
+# CONFIG_IRQSOFF_TRACER is not set
+# CONFIG_SCHED_TRACER is not set
+# CONFIG_ENABLE_DEFAULT_TRACERS is not set
+CONFIG_BRANCH_PROFILE_NONE=y
+# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
+# CONFIG_PROFILE_ALL_BRANCHES is not set
+# CONFIG_STACK_TRACER is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_DMA_API_DEBUG is not set
+# CONFIG_ATOMIC64_SELFTEST is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+# CONFIG_TEST_KSTRTOX is not set
+# CONFIG_STRICT_DEVMEM is not set
+CONFIG_DEBUG_USER=y
+CONFIG_DEBUG_LL=y
+# CONFIG_EARLY_PRINTK is not set
+# CONFIG_DEBUG_ICEDCC is not set
+# CONFIG_OC_ETM is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY_DMESG_RESTRICT is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+CONFIG_DEFAULT_SECURITY_DAC=y
+CONFIG_DEFAULT_SECURITY=""
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+CONFIG_CRYPTO_ALGAPI=m
+CONFIG_CRYPTO_ALGAPI2=m
+CONFIG_CRYPTO_RNG=m
+CONFIG_CRYPTO_RNG2=m
+# CONFIG_CRYPTO_MANAGER is not set
+# CONFIG_CRYPTO_MANAGER2 is not set
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+# CONFIG_CRYPTO_CBC is not set
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_VMAC is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_GHASH is not set
+# CONFIG_CRYPTO_MD4 is not set
+# CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=m
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_ZLIB is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+CONFIG_CRYPTO_ANSI_CPRNG=m
+# CONFIG_CRYPTO_USER_API_HASH is not set
+# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
+CONFIG_CRYPTO_HW=y
+# CONFIG_BINARY_PRINTF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+# CONFIG_CRC8 is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_XZ_DEC=y
+CONFIG_XZ_DEC_X86=y
+CONFIG_XZ_DEC_POWERPC=y
+CONFIG_XZ_DEC_IA64=y
+CONFIG_XZ_DEC_ARM=y
+CONFIG_XZ_DEC_ARMTHUMB=y
+CONFIG_XZ_DEC_SPARC=y
+CONFIG_XZ_DEC_BCJ=y
+# CONFIG_XZ_DEC_TEST is not set
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DECOMPRESS_BZIP2=y
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_DECOMPRESS_XZ=y
+CONFIG_DECOMPRESS_LZO=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_NLATTR=y
+CONFIG_GENERIC_ATOMIC64=y
+# CONFIG_AVERAGE is not set
+# CONFIG_CORDIC is not set
similarity index 72%
rename from kernel/config
rename to kernel/config.i686
index cdaedd1f0b2fd6977d3b2105dc1c84fdb3cd88d8..0cb854c3119ed7c1fca5725eecd3a36e25612ed4 100644 (file)
@@ -1,6 +1,6 @@
 #
-# Automatically generated make config: don't edit
-# Linux/i386 3.0.4 Kernel Configuration
+# Automatically generated file; DO NOT EDIT.
+# Linux/i386 3.1.1-1.ip3.i686 Kernel Configuration
 #
 # CONFIG_64BIT is not set
 CONFIG_X86_32=y
@@ -50,6 +50,7 @@ CONFIG_X86_32_SMP=y
 CONFIG_X86_HT=y
 CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-ecx -fcall-saved-edx"
 CONFIG_KTIME_SCALAR=y
+CONFIG_ARCH_CPU_PROBE_RELEASE=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 CONFIG_HAVE_IRQ_WORK=y
 CONFIG_IRQ_WORK=y
@@ -61,7 +62,7 @@ CONFIG_EXPERIMENTAL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
 CONFIG_CROSS_COMPILE=""
 CONFIG_LOCALVERSION=""
-CONFIG_LOCALVERSION_AUTO=y
+# CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_HAVE_KERNEL_GZIP=y
 CONFIG_HAVE_KERNEL_BZIP2=y
 CONFIG_HAVE_KERNEL_LZMA=y
@@ -69,8 +70,8 @@ CONFIG_HAVE_KERNEL_XZ=y
 CONFIG_HAVE_KERNEL_LZO=y
 # CONFIG_KERNEL_GZIP is not set
 # CONFIG_KERNEL_BZIP2 is not set
-CONFIG_KERNEL_LZMA=y
-# CONFIG_KERNEL_XZ is not set
+# CONFIG_KERNEL_LZMA is not set
+CONFIG_KERNEL_XZ=y
 # CONFIG_KERNEL_LZO is not set
 CONFIG_DEFAULT_HOSTNAME="(none)"
 CONFIG_SWAP=y
@@ -79,9 +80,12 @@ CONFIG_SYSVIPC_SYSCTL=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_POSIX_MQUEUE_SYSCTL=y
 CONFIG_BSD_PROCESS_ACCT=y
-CONFIG_BSD_PROCESS_ACCT_V3=y
-# CONFIG_FHANDLE is not set
-# CONFIG_TASKSTATS is not set
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+CONFIG_FHANDLE=y
+CONFIG_TASKSTATS=y
+CONFIG_TASK_DELAY_ACCT=y
+CONFIG_TASK_XACCT=y
+CONFIG_TASK_IO_ACCOUNTING=y
 CONFIG_AUDIT=y
 CONFIG_AUDITSYSCALL=y
 CONFIG_AUDIT_WATCH=y
@@ -97,7 +101,7 @@ CONFIG_GENERIC_IRQ_PROBE=y
 CONFIG_GENERIC_IRQ_SHOW=y
 CONFIG_GENERIC_PENDING_IRQ=y
 CONFIG_IRQ_FORCED_THREADING=y
-CONFIG_SPARSE_IRQ=y
+# CONFIG_SPARSE_IRQ is not set
 
 #
 # RCU Subsystem
@@ -109,8 +113,7 @@ CONFIG_RCU_FANOUT=32
 # CONFIG_RCU_FANOUT_EXACT is not set
 CONFIG_RCU_FAST_NO_HZ=y
 # CONFIG_TREE_RCU_TRACE is not set
-CONFIG_IKCONFIG=y
-# CONFIG_IKCONFIG_PROC is not set
+# CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=18
 CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
 CONFIG_CGROUPS=y
@@ -124,11 +127,11 @@ CONFIG_RESOURCE_COUNTERS=y
 CONFIG_CGROUP_MEM_RES_CTLR=y
 CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
 # CONFIG_CGROUP_MEM_RES_CTLR_SWAP_ENABLED is not set
-# CONFIG_CGROUP_PERF is not set
+CONFIG_CGROUP_PERF=y
 CONFIG_CGROUP_SCHED=y
 CONFIG_FAIR_GROUP_SCHED=y
 CONFIG_RT_GROUP_SCHED=y
-CONFIG_BLK_CGROUP=m
+CONFIG_BLK_CGROUP=y
 # CONFIG_DEBUG_BLK_CGROUP is not set
 CONFIG_NAMESPACES=y
 CONFIG_UTS_NS=y
@@ -154,12 +157,13 @@ CONFIG_ANON_INODES=y
 CONFIG_UID16=y
 CONFIG_SYSCTL_SYSCALL=y
 CONFIG_KALLSYMS=y
-# CONFIG_KALLSYMS_ALL is not set
+CONFIG_KALLSYMS_ALL=y
 CONFIG_HOTPLUG=y
 CONFIG_PRINTK=y
 CONFIG_BUG=y
 CONFIG_ELF_CORE=y
 CONFIG_PCSPKR_PLATFORM=y
+CONFIG_HAVE_PCSPKR_PLATFORM=y
 CONFIG_BASE_FULL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
@@ -184,9 +188,10 @@ CONFIG_SLUB_DEBUG=y
 # CONFIG_SLAB is not set
 CONFIG_SLUB=y
 # CONFIG_PROFILING is not set
+CONFIG_TRACEPOINTS=y
 CONFIG_HAVE_OPROFILE=y
 # CONFIG_KPROBES is not set
-# CONFIG_JUMP_LABEL is not set
+CONFIG_JUMP_LABEL=y
 CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
 CONFIG_USER_RETURN_NOTIFIER=y
 CONFIG_HAVE_IOREMAP_PROT=y
@@ -203,6 +208,7 @@ CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
 CONFIG_HAVE_USER_RETURN_NOTIFIER=y
 CONFIG_HAVE_PERF_EVENTS_NMI=y
 CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
 
 #
 # GCOV-based kernel profiling
@@ -213,27 +219,30 @@ CONFIG_SLABINFO=y
 CONFIG_RT_MUTEXES=y
 CONFIG_BASE_SMALL=0
 CONFIG_MODULES=y
-CONFIG_MODULE_FORCE_LOAD=y
+# CONFIG_MODULE_FORCE_LOAD is not set
 CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
 # CONFIG_MODVERSIONS is not set
-# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_MODULE_SRCVERSION_ALL=y
 CONFIG_STOP_MACHINE=y
 CONFIG_BLOCK=y
 CONFIG_LBDAF=y
 CONFIG_BLK_DEV_BSG=y
-# CONFIG_BLK_DEV_INTEGRITY is not set
+CONFIG_BLK_DEV_BSGLIB=y
+CONFIG_BLK_DEV_INTEGRITY=y
+CONFIG_BLK_DEV_THROTTLING=y
 
 #
 # IO Schedulers
 #
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_DEADLINE=y
-CONFIG_IOSCHED_CFQ=m
+CONFIG_IOSCHED_CFQ=y
 CONFIG_CFQ_GROUP_IOSCHED=y
-CONFIG_DEFAULT_DEADLINE=y
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
 # CONFIG_DEFAULT_NOOP is not set
-CONFIG_DEFAULT_IOSCHED="deadline"
+CONFIG_DEFAULT_IOSCHED="cfq"
 CONFIG_PREEMPT_NOTIFIERS=y
 CONFIG_PADATA=y
 # CONFIG_INLINE_SPIN_TRYLOCK is not set
@@ -278,13 +287,22 @@ CONFIG_SMP=y
 CONFIG_X86_MPPARSE=y
 CONFIG_X86_BIGSMP=y
 CONFIG_X86_EXTENDED_PLATFORM=y
-# CONFIG_X86_MRST is not set
+# CONFIG_X86_INTEL_MID is not set
 # CONFIG_X86_RDC321X is not set
 # CONFIG_X86_32_NON_STANDARD is not set
 CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
 # CONFIG_X86_32_IRIS is not set
 CONFIG_SCHED_OMIT_FRAME_POINTER=y
-# CONFIG_PARAVIRT_GUEST is not set
+CONFIG_PARAVIRT_GUEST=y
+CONFIG_PARAVIRT_TIME_ACCOUNTING=y
+# CONFIG_XEN_PRIVILEGED_GUEST is not set
+CONFIG_KVM_CLOCK=y
+CONFIG_KVM_GUEST=y
+# CONFIG_LGUEST_GUEST is not set
+CONFIG_PARAVIRT=y
+# CONFIG_PARAVIRT_SPINLOCKS is not set
+CONFIG_PARAVIRT_CLOCK=y
+# CONFIG_PARAVIRT_DEBUG is not set
 CONFIG_NO_BOOTMEM=y
 # CONFIG_MEMTEST is not set
 # CONFIG_M386 is not set
@@ -316,6 +334,7 @@ CONFIG_X86_GENERIC=y
 CONFIG_X86_INTERNODE_CACHE_SHIFT=6
 CONFIG_X86_CMPXCHG=y
 CONFIG_CMPXCHG_LOCAL=y
+CONFIG_CMPXCHG_DOUBLE=y
 CONFIG_X86_L1_CACHE_SHIFT=6
 CONFIG_X86_XADD=y
 CONFIG_X86_PPRO_FENCE=y
@@ -341,39 +360,38 @@ CONFIG_HPET_TIMER=y
 CONFIG_HPET_EMULATE_RTC=y
 CONFIG_DMI=y
 # CONFIG_IOMMU_HELPER is not set
-CONFIG_IOMMU_API=y
 CONFIG_NR_CPUS=256
 CONFIG_SCHED_SMT=y
 CONFIG_SCHED_MC=y
-# CONFIG_IRQ_TIME_ACCOUNTING is not set
+CONFIG_IRQ_TIME_ACCOUNTING=y
 CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT_VOLUNTARY is not set
 # CONFIG_PREEMPT is not set
 CONFIG_X86_LOCAL_APIC=y
 CONFIG_X86_IO_APIC=y
-# CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS is not set
+CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
 CONFIG_X86_MCE=y
 CONFIG_X86_MCE_INTEL=y
 CONFIG_X86_MCE_AMD=y
 # CONFIG_X86_ANCIENT_MCE is not set
 CONFIG_X86_MCE_THRESHOLD=y
-CONFIG_X86_MCE_INJECT=m
+# CONFIG_X86_MCE_INJECT is not set
 CONFIG_X86_THERMAL_VECTOR=y
 CONFIG_VM86=y
-# CONFIG_TOSHIBA is not set
-# CONFIG_I8K is not set
-CONFIG_X86_REBOOTFIXUPS=y
-CONFIG_MICROCODE=y
+CONFIG_TOSHIBA=m
+CONFIG_I8K=m
+# CONFIG_X86_REBOOTFIXUPS is not set
+CONFIG_MICROCODE=m
 CONFIG_MICROCODE_INTEL=y
 CONFIG_MICROCODE_AMD=y
 CONFIG_MICROCODE_OLD_INTERFACE=y
 CONFIG_X86_MSR=y
 CONFIG_X86_CPUID=y
-CONFIG_NOHIGHMEM=y
-# CONFIG_HIGHMEM4G is not set
+# CONFIG_NOHIGHMEM is not set
+CONFIG_HIGHMEM4G=y
 # CONFIG_HIGHMEM64G is not set
 CONFIG_PAGE_OFFSET=0xC0000000
-# CONFIG_X86_PAE is not set
+CONFIG_HIGHMEM=y
 # CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
 # CONFIG_ARCH_DMA_ADDR_T_64BIT is not set
 CONFIG_ARCH_FLATMEM_ENABLE=y
@@ -397,7 +415,7 @@ CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
 CONFIG_MMU_NOTIFIER=y
 CONFIG_KSM=y
-CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
 CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
 CONFIG_MEMORY_FAILURE=y
 # CONFIG_HWPOISON_INJECT is not set
@@ -405,15 +423,17 @@ CONFIG_TRANSPARENT_HUGEPAGE=y
 CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
 # CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set
 CONFIG_CLEANCACHE=y
-CONFIG_X86_CHECK_BIOS_CORRUPTION=y
-CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y
+CONFIG_HIGHPTE=y
+# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
 CONFIG_X86_RESERVE_LOW=64
 # CONFIG_MATH_EMULATION is not set
 CONFIG_MTRR=y
-# CONFIG_MTRR_SANITIZER is not set
+CONFIG_MTRR_SANITIZER=y
+CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=1
+CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
 CONFIG_X86_PAT=y
 CONFIG_ARCH_USES_PG_UNCACHED=y
-# CONFIG_EFI is not set
+CONFIG_EFI=y
 CONFIG_SECCOMP=y
 # CONFIG_HZ_100 is not set
 # CONFIG_HZ_250 is not set
@@ -422,23 +442,35 @@ CONFIG_HZ_300=y
 CONFIG_HZ=300
 CONFIG_SCHED_HRTICK=y
 CONFIG_KEXEC=y
-CONFIG_PHYSICAL_START=0x1000000
-# CONFIG_RELOCATABLE is not set
-CONFIG_PHYSICAL_ALIGN=0x1000000
-# CONFIG_HOTPLUG_CPU is not set
+CONFIG_CRASH_DUMP=y
+# CONFIG_KEXEC_JUMP is not set
+CONFIG_PHYSICAL_START=0x400000
+CONFIG_RELOCATABLE=y
+CONFIG_X86_NEED_RELOCS=y
+CONFIG_PHYSICAL_ALIGN=0x400000
+CONFIG_HOTPLUG_CPU=y
 # CONFIG_CMDLINE_BOOL is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 
 #
 # Power management and ACPI options
 #
-# CONFIG_SUSPEND is not set
-# CONFIG_HIBERNATION is not set
-# CONFIG_PM_RUNTIME is not set
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_HIBERNATE_CALLBACKS=y
+CONFIG_HIBERNATION=y
+CONFIG_PM_STD_PARTITION=""
+CONFIG_PM_SLEEP=y
+CONFIG_PM_SLEEP_SMP=y
+CONFIG_PM_RUNTIME=y
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
 CONFIG_ACPI=y
+CONFIG_ACPI_SLEEP=y
 CONFIG_ACPI_PROCFS=y
 CONFIG_ACPI_PROCFS_POWER=y
-# CONFIG_ACPI_EC_DEBUGFS is not set
-CONFIG_ACPI_PROC_EVENT=y
+CONFIG_ACPI_EC_DEBUGFS=m
+# CONFIG_ACPI_PROC_EVENT is not set
 CONFIG_ACPI_AC=y
 CONFIG_ACPI_BATTERY=y
 CONFIG_ACPI_BUTTON=y
@@ -447,23 +479,32 @@ CONFIG_ACPI_FAN=y
 CONFIG_ACPI_DOCK=y
 CONFIG_ACPI_PROCESSOR=y
 CONFIG_ACPI_IPMI=m
+CONFIG_ACPI_HOTPLUG_CPU=y
 CONFIG_ACPI_PROCESSOR_AGGREGATOR=m
 CONFIG_ACPI_THERMAL=y
 # CONFIG_ACPI_CUSTOM_DSDT is not set
-CONFIG_ACPI_BLACKLIST_YEAR=2001
+CONFIG_ACPI_BLACKLIST_YEAR=1999
 # CONFIG_ACPI_DEBUG is not set
 CONFIG_ACPI_PCI_SLOT=y
 CONFIG_X86_PM_TIMER=y
-# CONFIG_ACPI_CONTAINER is not set
-# CONFIG_ACPI_SBS is not set
-CONFIG_ACPI_HED=m
+CONFIG_ACPI_CONTAINER=y
+CONFIG_ACPI_SBS=m
+CONFIG_ACPI_HED=y
 CONFIG_ACPI_CUSTOM_METHOD=m
 CONFIG_ACPI_APEI=y
-CONFIG_ACPI_APEI_GHES=m
+CONFIG_ACPI_APEI_GHES=y
 CONFIG_ACPI_APEI_PCIEAER=y
-CONFIG_ACPI_APEI_EINJ=m
+CONFIG_ACPI_APEI_MEMORY_FAILURE=y
+# CONFIG_ACPI_APEI_EINJ is not set
 # CONFIG_ACPI_APEI_ERST_DEBUG is not set
-# CONFIG_SFI is not set
+CONFIG_SFI=y
+CONFIG_X86_APM_BOOT=y
+CONFIG_APM=y
+# CONFIG_APM_IGNORE_USER_SUSPEND is not set
+# CONFIG_APM_DO_ENABLE is not set
+CONFIG_APM_CPU_IDLE=y
+# CONFIG_APM_DISPLAY_BLANK is not set
+# CONFIG_APM_ALLOW_INTS is not set
 
 #
 # CPU Frequency scaling
@@ -473,13 +514,13 @@ CONFIG_CPU_FREQ_TABLE=y
 CONFIG_CPU_FREQ_STAT=m
 CONFIG_CPU_FREQ_STAT_DETAILS=y
 # CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
-CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
 # CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
 CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
 CONFIG_CPU_FREQ_GOV_POWERSAVE=m
-CONFIG_CPU_FREQ_GOV_USERSPACE=m
-CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=m
 CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
 
 #
@@ -487,26 +528,25 @@ CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
 #
 CONFIG_X86_PCC_CPUFREQ=m
 CONFIG_X86_ACPI_CPUFREQ=m
-CONFIG_X86_POWERNOW_K6=m
-CONFIG_X86_POWERNOW_K7=m
+# CONFIG_X86_POWERNOW_K6 is not set
+CONFIG_X86_POWERNOW_K7=y
 CONFIG_X86_POWERNOW_K7_ACPI=y
 CONFIG_X86_POWERNOW_K8=m
-CONFIG_X86_GX_SUSPMOD=m
-CONFIG_X86_SPEEDSTEP_CENTRINO=m
-CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE=y
-CONFIG_X86_SPEEDSTEP_ICH=m
-CONFIG_X86_SPEEDSTEP_SMI=m
+# CONFIG_X86_GX_SUSPMOD is not set
+# CONFIG_X86_SPEEDSTEP_CENTRINO is not set
+CONFIG_X86_SPEEDSTEP_ICH=y
+CONFIG_X86_SPEEDSTEP_SMI=y
 CONFIG_X86_P4_CLOCKMOD=m
-CONFIG_X86_CPUFREQ_NFORCE2=m
-CONFIG_X86_LONGRUN=m
-CONFIG_X86_LONGHAUL=m
-CONFIG_X86_E_POWERSAVER=m
+# CONFIG_X86_CPUFREQ_NFORCE2 is not set
+CONFIG_X86_LONGRUN=y
+# CONFIG_X86_LONGHAUL is not set
+# CONFIG_X86_E_POWERSAVER is not set
 
 #
 # shared options
 #
-CONFIG_X86_SPEEDSTEP_LIB=m
-CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK=y
+CONFIG_X86_SPEEDSTEP_LIB=y
+# CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK is not set
 CONFIG_CPU_IDLE=y
 CONFIG_CPU_IDLE_GOV_LADDER=y
 CONFIG_CPU_IDLE_GOV_MENU=y
@@ -519,27 +559,24 @@ CONFIG_PCI=y
 # CONFIG_PCI_GOBIOS is not set
 # CONFIG_PCI_GOMMCONFIG is not set
 # CONFIG_PCI_GODIRECT is not set
-# CONFIG_PCI_GOOLPC is not set
 CONFIG_PCI_GOANY=y
 CONFIG_PCI_BIOS=y
 CONFIG_PCI_DIRECT=y
 CONFIG_PCI_MMCONFIG=y
-CONFIG_PCI_OLPC=y
 CONFIG_PCI_DOMAINS=y
 # CONFIG_PCI_CNB20LE_QUIRK is not set
-CONFIG_DMAR=y
-CONFIG_DMAR_DEFAULT_ON=y
-CONFIG_DMAR_FLOPPY_WA=y
 CONFIG_PCIEPORTBUS=y
+CONFIG_HOTPLUG_PCI_PCIE=y
 CONFIG_PCIEAER=y
-# CONFIG_PCIE_ECRC is not set
-# CONFIG_PCIEAER_INJECT is not set
+CONFIG_PCIE_ECRC=y
+CONFIG_PCIEAER_INJECT=m
 CONFIG_PCIEASPM=y
 # CONFIG_PCIEASPM_DEBUG is not set
+CONFIG_PCIE_PME=y
 CONFIG_ARCH_SUPPORTS_MSI=y
 CONFIG_PCI_MSI=y
 # CONFIG_PCI_DEBUG is not set
-CONFIG_PCI_STUB=m
+CONFIG_PCI_STUB=y
 CONFIG_HT_IRQ=y
 CONFIG_PCI_IOV=y
 CONFIG_PCI_IOAPIC=y
@@ -548,11 +585,10 @@ CONFIG_ISA_DMA_API=y
 # CONFIG_ISA is not set
 # CONFIG_MCA is not set
 # CONFIG_SCx200 is not set
-CONFIG_OLPC=y
+# CONFIG_OLPC is not set
 CONFIG_AMD_NB=y
 CONFIG_PCCARD=m
-CONFIG_PCMCIA=m
-CONFIG_PCMCIA_LOAD_CIS=y
+# CONFIG_PCMCIA is not set
 CONFIG_CARDBUS=y
 
 #
@@ -564,17 +600,22 @@ CONFIG_YENTA_RICOH=y
 CONFIG_YENTA_TI=y
 CONFIG_YENTA_ENE_TUNE=y
 CONFIG_YENTA_TOSHIBA=y
-CONFIG_PD6729=m
-CONFIG_I82092=m
-CONFIG_PCCARD_NONSTATIC=y
-# CONFIG_HOTPLUG_PCI is not set
+CONFIG_HOTPLUG_PCI=y
+CONFIG_HOTPLUG_PCI_FAKE=m
+CONFIG_HOTPLUG_PCI_COMPAQ=m
+# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
+CONFIG_HOTPLUG_PCI_IBM=m
+CONFIG_HOTPLUG_PCI_ACPI=y
+CONFIG_HOTPLUG_PCI_ACPI_IBM=m
+# CONFIG_HOTPLUG_PCI_CPCI is not set
+# CONFIG_HOTPLUG_PCI_SHPC is not set
 # CONFIG_RAPIDIO is not set
 
 #
 # Executable file formats / Emulations
 #
 CONFIG_BINFMT_ELF=y
-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
 CONFIG_HAVE_AOUT=y
 CONFIG_BINFMT_MISC=y
 CONFIG_HAVE_ATOMIC_IOMAP=y
@@ -584,28 +625,25 @@ CONFIG_NET=y
 #
 # Networking options
 #
-CONFIG_PACKET=m
+CONFIG_PACKET=y
 CONFIG_UNIX=y
 CONFIG_XFRM=y
-CONFIG_XFRM_USER=m
-# CONFIG_XFRM_SUB_POLICY is not set
+CONFIG_XFRM_USER=y
+CONFIG_XFRM_SUB_POLICY=y
 CONFIG_XFRM_MIGRATE=y
-# CONFIG_XFRM_STATISTICS is not set
+CONFIG_XFRM_STATISTICS=y
 CONFIG_XFRM_IPCOMP=m
 CONFIG_NET_KEY=m
 CONFIG_NET_KEY_MIGRATE=y
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 CONFIG_IP_ADVANCED_ROUTER=y
-# CONFIG_IP_FIB_TRIE_STATS is not set
+CONFIG_IP_FIB_TRIE_STATS=y
 CONFIG_IP_MULTIPLE_TABLES=y
 CONFIG_IP_ROUTE_MULTIPATH=y
 CONFIG_IP_ROUTE_VERBOSE=y
 CONFIG_IP_ROUTE_CLASSID=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-CONFIG_IP_PNP_BOOTP=y
-# CONFIG_IP_PNP_RARP is not set
+# CONFIG_IP_PNP is not set
 CONFIG_NET_IPIP=m
 CONFIG_NET_IPGRE_DEMUX=m
 CONFIG_NET_IPGRE=m
@@ -614,7 +652,7 @@ CONFIG_IP_MROUTE=y
 CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
 CONFIG_IP_PIMSM_V1=y
 CONFIG_IP_PIMSM_V2=y
-CONFIG_ARPD=y
+# CONFIG_ARPD is not set
 CONFIG_SYN_COOKIES=y
 CONFIG_INET_AH=m
 CONFIG_INET_ESP=m
@@ -627,11 +665,24 @@ CONFIG_INET_XFRM_MODE_BEET=m
 CONFIG_INET_LRO=y
 CONFIG_INET_DIAG=m
 CONFIG_INET_TCP_DIAG=m
-# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_ADVANCED=y
+CONFIG_TCP_CONG_BIC=m
 CONFIG_TCP_CONG_CUBIC=y
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+CONFIG_TCP_CONG_LP=m
+CONFIG_TCP_CONG_VENO=m
+CONFIG_TCP_CONG_YEAH=m
+CONFIG_TCP_CONG_ILLINOIS=m
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
 CONFIG_DEFAULT_TCP_CONG="cubic"
 CONFIG_TCP_MD5SIG=y
-CONFIG_IPV6=y
+CONFIG_IPV6=m
 CONFIG_IPV6_PRIVACY=y
 CONFIG_IPV6_ROUTER_PREF=y
 CONFIG_IPV6_ROUTE_INFO=y
@@ -692,7 +743,7 @@ CONFIG_NF_CONNTRACK_SIP=m
 CONFIG_NF_CONNTRACK_TFTP=m
 CONFIG_NF_CT_NETLINK=m
 CONFIG_NETFILTER_TPROXY=m
-CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XTABLES=y
 
 #
 # Xtables combined modules
@@ -745,6 +796,7 @@ CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
 CONFIG_NETFILTER_XT_MATCH_HELPER=m
 CONFIG_NETFILTER_XT_MATCH_HL=m
 CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
+# CONFIG_NETFILTER_XT_MATCH_IPVS is not set
 CONFIG_NETFILTER_XT_MATCH_LENGTH=m
 CONFIG_NETFILTER_XT_MATCH_LIMIT=m
 CONFIG_NETFILTER_XT_MATCH_MAC=m
@@ -778,17 +830,52 @@ CONFIG_IP_SET_HASH_IPPORTIP=m
 CONFIG_IP_SET_HASH_IPPORTNET=m
 CONFIG_IP_SET_HASH_NET=m
 CONFIG_IP_SET_HASH_NETPORT=m
+CONFIG_IP_SET_HASH_NETIFACE=m
 CONFIG_IP_SET_LIST_SET=m
-# CONFIG_IP_VS is not set
+CONFIG_IP_VS=m
+CONFIG_IP_VS_IPV6=y
+# CONFIG_IP_VS_DEBUG is not set
+CONFIG_IP_VS_TAB_BITS=12
+
+#
+# IPVS transport protocol load balancing support
+#
+CONFIG_IP_VS_PROTO_TCP=y
+CONFIG_IP_VS_PROTO_UDP=y
+CONFIG_IP_VS_PROTO_AH_ESP=y
+CONFIG_IP_VS_PROTO_ESP=y
+CONFIG_IP_VS_PROTO_AH=y
+CONFIG_IP_VS_PROTO_SCTP=y
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+CONFIG_IP_VS_SED=m
+CONFIG_IP_VS_NQ=m
+
+#
+# IPVS application helper
+#
+CONFIG_IP_VS_FTP=m
+CONFIG_IP_VS_NFCT=y
+CONFIG_IP_VS_PE_SIP=m
 
 #
 # IP: Netfilter Configuration
 #
 CONFIG_NF_DEFRAG_IPV4=m
 CONFIG_NF_CONNTRACK_IPV4=m
-CONFIG_NF_CONNTRACK_PROC_COMPAT=y
+# CONFIG_NF_CONNTRACK_PROC_COMPAT is not set
 # CONFIG_IP_NF_QUEUE is not set
-CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_IPTABLES=y
 CONFIG_IP_NF_MATCH_AH=m
 CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
@@ -818,7 +905,7 @@ CONFIG_IP_NF_TARGET_CLUSTERIP=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_TARGET_TTL=m
 CONFIG_IP_NF_RAW=m
-# CONFIG_IP_NF_SECURITY is not set
+CONFIG_IP_NF_SECURITY=m
 CONFIG_IP_NF_ARPTABLES=m
 CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
@@ -844,7 +931,7 @@ CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_REJECT=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_RAW=m
-# CONFIG_IP6_NF_SECURITY is not set
+CONFIG_IP6_NF_SECURITY=m
 CONFIG_BRIDGE_NF_EBTABLES=m
 CONFIG_BRIDGE_EBT_BROUTE=m
 CONFIG_BRIDGE_EBT_T_FILTER=m
@@ -868,7 +955,12 @@ CONFIG_BRIDGE_EBT_LOG=m
 # CONFIG_BRIDGE_EBT_ULOG is not set
 CONFIG_BRIDGE_EBT_NFLOG=m
 # CONFIG_IP_DCCP is not set
-# CONFIG_IP_SCTP is not set
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_RDS is not set
 # CONFIG_TIPC is not set
 CONFIG_ATM=m
@@ -876,7 +968,7 @@ CONFIG_ATM_CLIP=m
 # CONFIG_ATM_CLIP_NO_ICMP is not set
 # CONFIG_ATM_LANE is not set
 CONFIG_ATM_BR2684=m
-CONFIG_ATM_BR2684_IPFILTER=y
+# CONFIG_ATM_BR2684_IPFILTER is not set
 CONFIG_L2TP=m
 CONFIG_L2TP_DEBUGFS=m
 CONFIG_L2TP_V3=y
@@ -930,7 +1022,7 @@ CONFIG_NET_SCH_DRR=m
 CONFIG_NET_SCH_MQPRIO=m
 CONFIG_NET_SCH_CHOKE=m
 CONFIG_NET_SCH_QFQ=m
-# CONFIG_NET_SCH_INGRESS is not set
+CONFIG_NET_SCH_INGRESS=m
 
 #
 # Classification
@@ -946,7 +1038,7 @@ CONFIG_CLS_U32_MARK=y
 CONFIG_NET_CLS_RSVP=m
 CONFIG_NET_CLS_RSVP6=m
 CONFIG_NET_CLS_FLOW=m
-# CONFIG_NET_CLS_CGROUP is not set
+CONFIG_NET_CLS_CGROUP=m
 CONFIG_NET_EMATCH=y
 CONFIG_NET_EMATCH_STACK=32
 CONFIG_NET_EMATCH_CMP=m
@@ -967,7 +1059,8 @@ CONFIG_NET_ACT_SKBEDIT=m
 CONFIG_NET_ACT_CSUM=m
 CONFIG_NET_CLS_IND=y
 CONFIG_NET_SCH_FIFO=y
-CONFIG_DCB=y
+# CONFIG_DCB is not set
+CONFIG_DNS_RESOLVER=y
 # CONFIG_BATMAN_ADV is not set
 CONFIG_RPS=y
 CONFIG_RFS_ACCEL=y
@@ -977,10 +1070,39 @@ CONFIG_XPS=y
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NET_DROP_MONITOR is not set
 # CONFIG_HAMRADIO is not set
 # CONFIG_CAN is not set
 # CONFIG_IRDA is not set
-# CONFIG_BT is not set
+CONFIG_BT=m
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_CMTP=m
+CONFIG_BT_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIBTUSB=m
+CONFIG_BT_HCIBTSDIO=m
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_BT_MRVL=m
+CONFIG_BT_MRVL_SDIO=m
+CONFIG_BT_ATH3K=m
+CONFIG_BT_WILINK=m
 # CONFIG_AF_RXRPC is not set
 CONFIG_FIB_RULES=y
 CONFIG_WIRELESS=y
@@ -994,7 +1116,7 @@ CONFIG_NL80211_TESTMODE=y
 # CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
 # CONFIG_CFG80211_REG_DEBUG is not set
 CONFIG_CFG80211_DEFAULT_PS=y
-# CONFIG_CFG80211_DEBUGFS is not set
+CONFIG_CFG80211_DEBUGFS=y
 # CONFIG_CFG80211_INTERNAL_REGDB is not set
 CONFIG_CFG80211_WEXT=y
 CONFIG_WIRELESS_EXT_SYSFS=y
@@ -1009,18 +1131,18 @@ CONFIG_MAC80211_RC_MINSTREL=y
 CONFIG_MAC80211_RC_MINSTREL_HT=y
 CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
 CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
-# CONFIG_MAC80211_MESH is not set
+CONFIG_MAC80211_MESH=y
 CONFIG_MAC80211_LEDS=y
-# CONFIG_MAC80211_DEBUGFS is not set
+CONFIG_MAC80211_DEBUGFS=y
 # CONFIG_MAC80211_DEBUG_MENU is not set
 # CONFIG_WIMAX is not set
 CONFIG_RFKILL=m
 CONFIG_RFKILL_LEDS=y
 CONFIG_RFKILL_INPUT=y
-CONFIG_RFKILL_REGULATOR=m
 # CONFIG_NET_9P is not set
 # CONFIG_CAIF is not set
 # CONFIG_CEPH_LIB is not set
+# CONFIG_NFC is not set
 
 #
 # Device Drivers
@@ -1035,37 +1157,23 @@ CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=y
-CONFIG_FIRMWARE_IN_KERNEL=y
+# CONFIG_FIRMWARE_IN_KERNEL is not set
 CONFIG_EXTRA_FIRMWARE=""
 # CONFIG_DEBUG_DRIVER is not set
 # CONFIG_DEBUG_DEVRES is not set
 # CONFIG_SYS_HYPERVISOR is not set
-CONFIG_CONNECTOR=m
+CONFIG_CONNECTOR=y
+CONFIG_PROC_EVENTS=y
 # CONFIG_MTD is not set
-CONFIG_OF=y
-
-#
-# Device Tree and Open Firmware support
-#
-CONFIG_PROC_DEVICETREE=y
-CONFIG_OF_PROMTREE=y
-CONFIG_OF_ADDRESS=y
-CONFIG_OF_IRQ=y
-CONFIG_OF_DEVICE=y
-CONFIG_OF_GPIO=y
-CONFIG_OF_I2C=m
-CONFIG_OF_NET=y
-CONFIG_OF_MDIO=y
-CONFIG_OF_PCI=y
 CONFIG_PARPORT=m
 CONFIG_PARPORT_PC=m
 CONFIG_PARPORT_SERIAL=m
-CONFIG_PARPORT_PC_FIFO=y
-CONFIG_PARPORT_PC_SUPERIO=y
-CONFIG_PARPORT_PC_PCMCIA=m
+# CONFIG_PARPORT_PC_FIFO is not set
+# CONFIG_PARPORT_PC_SUPERIO is not set
 # CONFIG_PARPORT_GSC is not set
 # CONFIG_PARPORT_AX88796 is not set
 CONFIG_PARPORT_1284=y
+CONFIG_PARPORT_NOT_PC=y
 CONFIG_PNP=y
 # CONFIG_PNP_DEBUG_MESSAGES is not set
 
@@ -1080,23 +1188,24 @@ CONFIG_BLK_CPQ_DA=m
 CONFIG_BLK_CPQ_CISS_DA=m
 # CONFIG_CISS_SCSI_TAPE is not set
 CONFIG_BLK_DEV_DAC960=m
-# CONFIG_BLK_DEV_UMEM is not set
+CONFIG_BLK_DEV_UMEM=m
 # CONFIG_BLK_DEV_COW_COMMON is not set
 CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
 CONFIG_BLK_DEV_CRYPTOLOOP=m
 # CONFIG_BLK_DEV_DRBD is not set
 # CONFIG_BLK_DEV_NBD is not set
-CONFIG_BLK_DEV_OSD=m
+# CONFIG_BLK_DEV_OSD is not set
 CONFIG_BLK_DEV_SX8=m
 # CONFIG_BLK_DEV_UB is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=16
-CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_SIZE=16384
 # CONFIG_BLK_DEV_XIP is not set
 # CONFIG_CDROM_PKTCDVD is not set
 # CONFIG_ATA_OVER_ETH is not set
 CONFIG_VIRTIO_BLK=m
-CONFIG_BLK_DEV_HD=y
+# CONFIG_BLK_DEV_HD is not set
 # CONFIG_BLK_DEV_RBD is not set
 CONFIG_SENSORS_LIS3LV02D=m
 CONFIG_MISC_DEVICES=y
@@ -1105,50 +1214,53 @@ CONFIG_MISC_DEVICES=y
 # CONFIG_PHANTOM is not set
 # CONFIG_INTEL_MID_PTI is not set
 # CONFIG_SGI_IOC4 is not set
-# CONFIG_TIFM_CORE is not set
+CONFIG_TIFM_CORE=m
+CONFIG_TIFM_7XX1=m
 CONFIG_ICS932S401=m
-# CONFIG_ENCLOSURE_SERVICES is not set
+CONFIG_ENCLOSURE_SERVICES=m
+# CONFIG_CS5535_MFGPT is not set
 CONFIG_HP_ILO=m
-CONFIG_APDS9802ALS=m
-CONFIG_ISL29003=m
-CONFIG_ISL29020=m
-CONFIG_SENSORS_TSL2550=m
-CONFIG_SENSORS_BH1780=m
-CONFIG_SENSORS_BH1770=m
-CONFIG_SENSORS_APDS990X=m
-CONFIG_HMC6352=m
+# CONFIG_APDS9802ALS is not set
+# CONFIG_ISL29003 is not set
+# CONFIG_ISL29020 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_SENSORS_BH1780 is not set
+# CONFIG_SENSORS_BH1770 is not set
+# CONFIG_SENSORS_APDS990X is not set
+# CONFIG_HMC6352 is not set
 CONFIG_DS1682=m
 CONFIG_VMWARE_BALLOON=m
-CONFIG_BMP085=m
+# CONFIG_BMP085 is not set
 CONFIG_PCH_PHUB=m
-CONFIG_C2PORT=m
-# CONFIG_C2PORT_DURAMAR_2150 is not set
+CONFIG_USB_SWITCH_FSA9480=m
+# CONFIG_C2PORT is not set
 
 #
 # EEPROM support
 #
 CONFIG_EEPROM_AT24=m
-# CONFIG_EEPROM_LEGACY is not set
+CONFIG_EEPROM_LEGACY=m
 CONFIG_EEPROM_MAX6875=m
 CONFIG_EEPROM_93CX6=m
 CONFIG_CB710_CORE=m
 # CONFIG_CB710_DEBUG is not set
 CONFIG_CB710_DEBUG_ASSUMPTIONS=y
+# CONFIG_IWMC3200TOP is not set
 
 #
 # Texas Instruments shared transport line discipline
 #
 CONFIG_TI_ST=m
-CONFIG_SENSORS_LIS3_I2C=m
+# CONFIG_SENSORS_LIS3_I2C is not set
 CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set
 
 #
 # SCSI device support
 #
-CONFIG_SCSI_MOD=m
+CONFIG_SCSI_MOD=y
 CONFIG_RAID_ATTRS=m
-CONFIG_SCSI=m
+CONFIG_SCSI=y
 CONFIG_SCSI_DMA=y
 CONFIG_SCSI_TGT=m
 CONFIG_SCSI_NETLINK=y
@@ -1163,9 +1275,10 @@ CONFIG_BLK_DEV_SD=m
 CONFIG_BLK_DEV_SR=m
 CONFIG_BLK_DEV_SR_VENDOR=y
 CONFIG_CHR_DEV_SG=m
-# CONFIG_CHR_DEV_SCH is not set
+CONFIG_CHR_DEV_SCH=m
+CONFIG_SCSI_ENCLOSURE=m
 CONFIG_SCSI_MULTI_LUN=y
-# CONFIG_SCSI_CONSTANTS is not set
+CONFIG_SCSI_CONSTANTS=y
 CONFIG_SCSI_LOGGING=y
 CONFIG_SCSI_SCAN_ASYNC=y
 CONFIG_SCSI_WAIT_SCAN=m
@@ -1175,13 +1288,14 @@ CONFIG_SCSI_WAIT_SCAN=m
 #
 CONFIG_SCSI_SPI_ATTRS=m
 CONFIG_SCSI_FC_ATTRS=m
-# CONFIG_SCSI_FC_TGT_ATTRS is not set
+CONFIG_SCSI_FC_TGT_ATTRS=y
 CONFIG_SCSI_ISCSI_ATTRS=m
 CONFIG_SCSI_SAS_ATTRS=m
 CONFIG_SCSI_SAS_LIBSAS=m
 CONFIG_SCSI_SAS_ATA=y
 CONFIG_SCSI_SAS_HOST_SMP=y
-# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_SRP_ATTRS=m
+CONFIG_SCSI_SRP_TGT_ATTRS=y
 CONFIG_SCSI_LOWLEVEL=y
 CONFIG_ISCSI_TCP=m
 CONFIG_ISCSI_BOOT_SYSFS=m
@@ -1213,6 +1327,7 @@ CONFIG_SCSI_AIC94XX=m
 # CONFIG_AIC94XX_DEBUG is not set
 CONFIG_SCSI_MVSAS=m
 # CONFIG_SCSI_MVSAS_DEBUG is not set
+CONFIG_SCSI_MVSAS_TASKLET=y
 CONFIG_SCSI_DPT_I2O=m
 CONFIG_SCSI_ADVANSYS=m
 CONFIG_SCSI_ARCMSR=m
@@ -1270,12 +1385,6 @@ CONFIG_SCSI_PMCRAID=m
 CONFIG_SCSI_PM8001=m
 # CONFIG_SCSI_SRP is not set
 CONFIG_SCSI_BFA_FC=m
-CONFIG_SCSI_LOWLEVEL_PCMCIA=y
-CONFIG_PCMCIA_AHA152X=m
-CONFIG_PCMCIA_FDOMAIN=m
-CONFIG_PCMCIA_NINJA_SCSI=m
-CONFIG_PCMCIA_QLOGIC=m
-CONFIG_PCMCIA_SYM53C500=m
 CONFIG_SCSI_DH=m
 CONFIG_SCSI_DH_RDAC=m
 CONFIG_SCSI_DH_HP_SW=m
@@ -1285,7 +1394,7 @@ CONFIG_SCSI_OSD_INITIATOR=m
 CONFIG_SCSI_OSD_ULD=m
 CONFIG_SCSI_OSD_DPRINT_SENSE=1
 # CONFIG_SCSI_OSD_DEBUG is not set
-CONFIG_ATA=m
+CONFIG_ATA=y
 # CONFIG_ATA_NONSTANDARD is not set
 CONFIG_ATA_VERBOSE_ERROR=y
 CONFIG_ATA_ACPI=y
@@ -1294,7 +1403,7 @@ CONFIG_SATA_PMP=y
 #
 # Controllers with non-SFF native interface
 #
-CONFIG_SATA_AHCI=m
+CONFIG_SATA_AHCI=y
 CONFIG_SATA_AHCI_PLATFORM=m
 CONFIG_SATA_INIC162X=m
 CONFIG_SATA_ACARD_AHCI=m
@@ -1312,7 +1421,7 @@ CONFIG_ATA_BMDMA=y
 #
 # SATA SFF controllers with BMDMA
 #
-CONFIG_ATA_PIIX=m
+CONFIG_ATA_PIIX=y
 CONFIG_SATA_MV=m
 CONFIG_SATA_NV=m
 CONFIG_SATA_PROMISE=m
@@ -1343,7 +1452,7 @@ CONFIG_PATA_HPT366=m
 CONFIG_PATA_HPT37X=m
 CONFIG_PATA_HPT3X2N=m
 CONFIG_PATA_HPT3X3=m
-CONFIG_PATA_HPT3X3_DMA=y
+# CONFIG_PATA_HPT3X3_DMA is not set
 CONFIG_PATA_IT8213=m
 CONFIG_PATA_IT821X=m
 CONFIG_PATA_JMICRON=m
@@ -1355,9 +1464,9 @@ CONFIG_PATA_OLDPIIX=m
 CONFIG_PATA_OPTIDMA=m
 CONFIG_PATA_PDC2027X=m
 CONFIG_PATA_PDC_OLD=m
-CONFIG_PATA_RADISYS=m
+# CONFIG_PATA_RADISYS is not set
 CONFIG_PATA_RDC=m
-CONFIG_PATA_SC1200=m
+# CONFIG_PATA_SC1200 is not set
 CONFIG_PATA_SCH=m
 CONFIG_PATA_SERVERWORKS=m
 CONFIG_PATA_SIL680=m
@@ -1374,7 +1483,6 @@ CONFIG_PATA_CMD640_PCI=m
 CONFIG_PATA_MPIIX=m
 CONFIG_PATA_NS87410=m
 CONFIG_PATA_OPTI=m
-CONFIG_PATA_PCMCIA=m
 CONFIG_PATA_RZ1000=m
 
 #
@@ -1382,39 +1490,40 @@ CONFIG_PATA_RZ1000=m
 #
 CONFIG_PATA_ACPI=m
 CONFIG_ATA_GENERIC=m
-CONFIG_PATA_LEGACY=m
+# CONFIG_PATA_LEGACY is not set
 CONFIG_MD=y
-CONFIG_BLK_DEV_MD=m
+CONFIG_BLK_DEV_MD=y
+CONFIG_MD_AUTODETECT=y
 CONFIG_MD_LINEAR=m
 CONFIG_MD_RAID0=m
 CONFIG_MD_RAID1=m
 CONFIG_MD_RAID10=m
 CONFIG_MD_RAID456=m
-CONFIG_MULTICORE_RAID456=y
+# CONFIG_MULTICORE_RAID456 is not set
 CONFIG_MD_MULTIPATH=m
-# CONFIG_MD_FAULTY is not set
-CONFIG_BLK_DEV_DM=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=y
 # CONFIG_DM_DEBUG is not set
 CONFIG_DM_CRYPT=m
-CONFIG_DM_SNAPSHOT=m
-CONFIG_DM_MIRROR=m
+CONFIG_DM_SNAPSHOT=y
+CONFIG_DM_MIRROR=y
 CONFIG_DM_RAID=m
 CONFIG_DM_LOG_USERSPACE=m
-CONFIG_DM_ZERO=m
+CONFIG_DM_ZERO=y
 CONFIG_DM_MULTIPATH=m
 CONFIG_DM_MULTIPATH_QL=m
 CONFIG_DM_MULTIPATH_ST=m
-CONFIG_DM_DELAY=m
+# CONFIG_DM_DELAY is not set
 CONFIG_DM_UEVENT=y
-CONFIG_DM_FLAKEY=m
+# CONFIG_DM_FLAKEY is not set
 # CONFIG_TARGET_CORE is not set
 CONFIG_FUSION=y
 CONFIG_FUSION_SPI=m
-# CONFIG_FUSION_FC is not set
+CONFIG_FUSION_FC=m
 CONFIG_FUSION_SAS=m
-CONFIG_FUSION_MAX_SGE=128
+CONFIG_FUSION_MAX_SGE=40
 CONFIG_FUSION_CTL=m
-# CONFIG_FUSION_LOGGING is not set
+CONFIG_FUSION_LOGGING=y
 
 #
 # IEEE 1394 (FireWire) support
@@ -1423,10 +1532,10 @@ CONFIG_FIREWIRE=m
 CONFIG_FIREWIRE_OHCI=m
 CONFIG_FIREWIRE_OHCI_DEBUG=y
 CONFIG_FIREWIRE_SBP2=m
-CONFIG_FIREWIRE_NET=m
+# CONFIG_FIREWIRE_NET is not set
 # CONFIG_FIREWIRE_NOSY is not set
 CONFIG_I2O=m
-CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y
+# CONFIG_I2O_LCT_NOTIFY_ON_CHANGES is not set
 CONFIG_I2O_EXT_ADAPTEC=y
 CONFIG_I2O_CONFIG=m
 CONFIG_I2O_CONFIG_OLD_IOCTL=y
@@ -1443,7 +1552,7 @@ CONFIG_MACVLAN=m
 CONFIG_MACVTAP=m
 # CONFIG_EQUALIZER is not set
 CONFIG_TUN=m
-# CONFIG_VETH is not set
+CONFIG_VETH=m
 # CONFIG_NET_SB1000 is not set
 # CONFIG_ARCNET is not set
 CONFIG_MII=m
@@ -1466,9 +1575,9 @@ CONFIG_NATIONAL_PHY=m
 CONFIG_STE10XP=m
 CONFIG_LSI_ET1011C_PHY=m
 CONFIG_MICREL_PHY=m
-# CONFIG_FIXED_PHY is not set
+CONFIG_FIXED_PHY=y
 CONFIG_MDIO_BITBANG=m
-CONFIG_MDIO_GPIO=m
+# CONFIG_MDIO_GPIO is not set
 CONFIG_NET_ETHERNET=y
 CONFIG_HAPPYMEAL=m
 CONFIG_SUNGEM=m
@@ -1482,7 +1591,7 @@ CONFIG_NET_TULIP=y
 CONFIG_DE2104X=m
 CONFIG_DE2104X_DSL=0
 CONFIG_TULIP=m
-CONFIG_TULIP_MWI=y
+# CONFIG_TULIP_MWI is not set
 CONFIG_TULIP_MMIO=y
 CONFIG_TULIP_NAPI=y
 CONFIG_TULIP_NAPI_HW_MITIGATION=y
@@ -1516,7 +1625,7 @@ CONFIG_NE2K_PCI=m
 CONFIG_8139CP=m
 CONFIG_8139TOO=m
 # CONFIG_8139TOO_PIO is not set
-CONFIG_8139TOO_TUNE_TWISTER=y
+# CONFIG_8139TOO_TUNE_TWISTER is not set
 CONFIG_8139TOO_8129=y
 # CONFIG_8139_OLD_RX_RESET is not set
 CONFIG_R6040=m
@@ -1524,14 +1633,17 @@ CONFIG_SIS900=m
 CONFIG_EPIC100=m
 CONFIG_SMSC9420=m
 CONFIG_SUNDANCE=m
-CONFIG_SUNDANCE_MMIO=y
+# CONFIG_SUNDANCE_MMIO is not set
 CONFIG_TLAN=m
-CONFIG_KS8842=m
-CONFIG_KS8851_MLL=m
+# CONFIG_KS8842 is not set
+# CONFIG_KS8851_MLL is not set
 CONFIG_VIA_RHINE=m
 CONFIG_VIA_RHINE_MMIO=y
 CONFIG_SC92031=m
-# CONFIG_NET_POCKET is not set
+CONFIG_NET_POCKET=y
+CONFIG_ATP=m
+CONFIG_DE600=m
+CONFIG_DE620=m
 CONFIG_ATL2=m
 CONFIG_NETDEV_1000=y
 CONFIG_ACENIC=m
@@ -1550,6 +1662,7 @@ CONFIG_R8169=m
 CONFIG_SIS190=m
 CONFIG_SKGE=m
 # CONFIG_SKGE_DEBUG is not set
+CONFIG_SKGE_GENESIS=y
 CONFIG_SKY2=m
 # CONFIG_SKY2_DEBUG is not set
 CONFIG_VIA_VELOCITY=m
@@ -1563,7 +1676,7 @@ CONFIG_ATL1C=m
 CONFIG_JME=m
 CONFIG_STMMAC_ETH=m
 # CONFIG_STMMAC_DA is not set
-CONFIG_STMMAC_DUAL_MAC=y
+# CONFIG_STMMAC_DUAL_MAC is not set
 CONFIG_PCH_GBE=m
 CONFIG_NETDEV_10000=y
 CONFIG_MDIO=m
@@ -1575,7 +1688,6 @@ CONFIG_CHELSIO_T4VF=m
 CONFIG_ENIC=m
 CONFIG_IXGBE=m
 CONFIG_IXGBE_DCA=y
-CONFIG_IXGBE_DCB=y
 CONFIG_IXGBEVF=m
 CONFIG_IXGB=m
 CONFIG_S2IO=m
@@ -1597,18 +1709,14 @@ CONFIG_SFC=m
 CONFIG_BE2NET=m
 # CONFIG_TR is not set
 CONFIG_WLAN=y
-CONFIG_PCMCIA_RAYCS=m
 CONFIG_LIBERTAS_THINFIRM=m
 # CONFIG_LIBERTAS_THINFIRM_DEBUG is not set
 CONFIG_LIBERTAS_THINFIRM_USB=m
 CONFIG_AIRO=m
 CONFIG_ATMEL=m
 CONFIG_PCI_ATMEL=m
-CONFIG_PCMCIA_ATMEL=m
 CONFIG_AT76C50X_USB=m
-CONFIG_AIRO_CS=m
-CONFIG_PCMCIA_WL3501=m
-CONFIG_PRISM54=m
+# CONFIG_PRISM54 is not set
 CONFIG_USB_ZD1201=m
 CONFIG_USB_NET_RNDIS_WLAN=m
 CONFIG_RTL8180=m
@@ -1620,24 +1728,27 @@ CONFIG_MWL8K=m
 CONFIG_ATH_COMMON=m
 # CONFIG_ATH_DEBUG is not set
 CONFIG_ATH5K=m
-# CONFIG_ATH5K_DEBUG is not set
+CONFIG_ATH5K_DEBUG=y
+# CONFIG_ATH5K_TRACER is not set
 CONFIG_ATH5K_PCI=y
 CONFIG_ATH9K_HW=m
 CONFIG_ATH9K_COMMON=m
 CONFIG_ATH9K=m
 CONFIG_ATH9K_PCI=y
 CONFIG_ATH9K_AHB=y
-# CONFIG_ATH9K_DEBUGFS is not set
+CONFIG_ATH9K_DEBUGFS=y
 CONFIG_ATH9K_RATE_CONTROL=y
 CONFIG_ATH9K_HTC=m
 # CONFIG_ATH9K_HTC_DEBUGFS is not set
 CONFIG_CARL9170=m
 CONFIG_CARL9170_LEDS=y
+# CONFIG_CARL9170_DEBUGFS is not set
 CONFIG_CARL9170_WPC=y
 CONFIG_B43=m
+CONFIG_B43_SSB=y
 CONFIG_B43_PCI_AUTOSELECT=y
 CONFIG_B43_PCICORE_AUTOSELECT=y
-CONFIG_B43_PCMCIA=y
+CONFIG_B43_SDIO=y
 CONFIG_B43_PIO=y
 CONFIG_B43_PHY_N=y
 CONFIG_B43_PHY_LP=y
@@ -1657,10 +1768,9 @@ CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
 # CONFIG_B43LEGACY_PIO_MODE is not set
 CONFIG_HOSTAP=m
 CONFIG_HOSTAP_FIRMWARE=y
-# CONFIG_HOSTAP_FIRMWARE_NVRAM is not set
+CONFIG_HOSTAP_FIRMWARE_NVRAM=y
 CONFIG_HOSTAP_PLX=m
 CONFIG_HOSTAP_PCI=m
-CONFIG_HOSTAP_CS=m
 CONFIG_IPW2100=m
 CONFIG_IPW2100_MONITOR=y
 # CONFIG_IPW2100_DEBUG is not set
@@ -1678,6 +1788,8 @@ CONFIG_IWLAGN=m
 # Debugging Options
 #
 # CONFIG_IWLWIFI_DEBUG is not set
+CONFIG_IWLWIFI_DEBUGFS=y
+# CONFIG_IWLWIFI_DEVICE_TRACING is not set
 CONFIG_IWLWIFI_DEVICE_SVTOOL=y
 # CONFIG_IWL_P2P is not set
 CONFIG_IWLWIFI_LEGACY=m
@@ -1686,22 +1798,22 @@ CONFIG_IWLWIFI_LEGACY=m
 # Debugging Options
 #
 # CONFIG_IWLWIFI_LEGACY_DEBUG is not set
+CONFIG_IWLWIFI_LEGACY_DEBUGFS=y
+# CONFIG_IWLWIFI_LEGACY_DEVICE_TRACING is not set
 CONFIG_IWL4965=m
 CONFIG_IWL3945=m
+# CONFIG_IWM is not set
 CONFIG_LIBERTAS=m
 CONFIG_LIBERTAS_USB=m
-CONFIG_LIBERTAS_CS=m
+CONFIG_LIBERTAS_SDIO=m
 # CONFIG_LIBERTAS_DEBUG is not set
 CONFIG_LIBERTAS_MESH=y
 CONFIG_HERMES=m
-CONFIG_HERMES_PRISM=y
+# CONFIG_HERMES_PRISM is not set
 CONFIG_HERMES_CACHE_FW_ON_INIT=y
 CONFIG_PLX_HERMES=m
 CONFIG_TMD_HERMES=m
 CONFIG_NORTEL_HERMES=m
-CONFIG_PCI_HERMES=m
-CONFIG_PCMCIA_HERMES=m
-CONFIG_PCMCIA_SPECTRUM=m
 CONFIG_ORINOCO_USB=m
 CONFIG_P54_COMMON=m
 CONFIG_P54_USB=m
@@ -1713,15 +1825,15 @@ CONFIG_RT2500PCI=m
 CONFIG_RT61PCI=m
 CONFIG_RT2800PCI=m
 CONFIG_RT2800PCI_RT33XX=y
-# CONFIG_RT2800PCI_RT35XX is not set
-# CONFIG_RT2800PCI_RT53XX is not set
+CONFIG_RT2800PCI_RT35XX=y
+CONFIG_RT2800PCI_RT53XX=y
 CONFIG_RT2500USB=m
 CONFIG_RT73USB=m
 CONFIG_RT2800USB=m
 CONFIG_RT2800USB_RT33XX=y
-# CONFIG_RT2800USB_RT35XX is not set
-# CONFIG_RT2800USB_RT53XX is not set
-# CONFIG_RT2800USB_UNKNOWN is not set
+CONFIG_RT2800USB_RT35XX=y
+CONFIG_RT2800USB_RT53XX=y
+CONFIG_RT2800USB_UNKNOWN=y
 CONFIG_RT2800_LIB=m
 CONFIG_RT2X00_LIB_PCI=m
 CONFIG_RT2X00_LIB_USB=m
@@ -1729,19 +1841,26 @@ CONFIG_RT2X00_LIB=m
 CONFIG_RT2X00_LIB_FIRMWARE=y
 CONFIG_RT2X00_LIB_CRYPTO=y
 CONFIG_RT2X00_LIB_LEDS=y
+CONFIG_RT2X00_LIB_DEBUGFS=y
 # CONFIG_RT2X00_DEBUG is not set
 CONFIG_RTL8192CE=m
 CONFIG_RTL8192SE=m
+CONFIG_RTL8192DE=m
 CONFIG_RTL8192CU=m
 CONFIG_RTLWIFI=m
 CONFIG_RTL8192C_COMMON=m
 CONFIG_WL1251=m
+CONFIG_WL1251_SDIO=m
 CONFIG_WL12XX_MENU=m
 CONFIG_WL12XX=m
 # CONFIG_WL12XX_HT is not set
+CONFIG_WL12XX_SDIO=m
+# CONFIG_WL12XX_SDIO_TEST is not set
+CONFIG_WL12XX_PLATFORM_DATA=y
 CONFIG_ZD1211RW=m
 # CONFIG_ZD1211RW_DEBUG is not set
 CONFIG_MWIFIEX=m
+CONFIG_MWIFIEX_SDIO=m
 
 #
 # Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -1779,29 +1898,19 @@ CONFIG_USB_NET_CX82310_ETH=m
 CONFIG_USB_NET_KALMIA=m
 CONFIG_USB_HSO=m
 CONFIG_USB_NET_INT51X1=m
-# CONFIG_USB_IPHETH is not set
-# CONFIG_USB_SIERRA_NET is not set
+CONFIG_USB_IPHETH=m
+CONFIG_USB_SIERRA_NET=m
 CONFIG_USB_VL600=m
-CONFIG_NET_PCMCIA=y
-CONFIG_PCMCIA_3C589=m
-CONFIG_PCMCIA_3C574=m
-CONFIG_PCMCIA_FMVJ18X=m
-CONFIG_PCMCIA_PCNET=m
-CONFIG_PCMCIA_NMCLAN=m
-CONFIG_PCMCIA_SMC91C92=m
-CONFIG_PCMCIA_XIRC2PS=m
-CONFIG_PCMCIA_AXNET=m
 # CONFIG_WAN is not set
 CONFIG_ATM_DRIVERS=y
-CONFIG_ATM_DUMMY=m
+# CONFIG_ATM_DUMMY is not set
 CONFIG_ATM_TCP=m
 CONFIG_ATM_LANAI=m
 CONFIG_ATM_ENI=m
 # CONFIG_ATM_ENI_DEBUG is not set
 # CONFIG_ATM_ENI_TUNE_BURST is not set
 CONFIG_ATM_FIRESTREAM=m
-CONFIG_ATM_ZATM=m
-# CONFIG_ATM_ZATM_DEBUG is not set
+# CONFIG_ATM_ZATM is not set
 CONFIG_ATM_NICSTAR=m
 # CONFIG_ATM_NICSTAR_USE_SUNI is not set
 # CONFIG_ATM_NICSTAR_USE_IDT77105 is not set
@@ -1809,16 +1918,10 @@ CONFIG_ATM_IDT77252=m
 # CONFIG_ATM_IDT77252_DEBUG is not set
 # CONFIG_ATM_IDT77252_RCV_ALL is not set
 CONFIG_ATM_IDT77252_USE_SUNI=y
-CONFIG_ATM_AMBASSADOR=m
-# CONFIG_ATM_AMBASSADOR_DEBUG is not set
-CONFIG_ATM_HORIZON=m
-# CONFIG_ATM_HORIZON_DEBUG is not set
-CONFIG_ATM_IA=m
-# CONFIG_ATM_IA_DEBUG is not set
-CONFIG_ATM_FORE200E=m
-# CONFIG_ATM_FORE200E_USE_TASKLET is not set
-CONFIG_ATM_FORE200E_TX_RETRY=16
-CONFIG_ATM_FORE200E_DEBUG=0
+# CONFIG_ATM_AMBASSADOR is not set
+# CONFIG_ATM_HORIZON is not set
+# CONFIG_ATM_IA is not set
+# CONFIG_ATM_FORE200E is not set
 CONFIG_ATM_HE=m
 # CONFIG_ATM_HE_USE_SUNI is not set
 CONFIG_ATM_SOLOS=m
@@ -1841,16 +1944,13 @@ CONFIG_PPPOE=m
 CONFIG_PPTP=m
 CONFIG_PPPOATM=m
 CONFIG_PPPOL2TP=m
-CONFIG_SLIP=m
-CONFIG_SLIP_COMPRESSED=y
+# CONFIG_SLIP is not set
 CONFIG_SLHC=m
-CONFIG_SLIP_SMART=y
-CONFIG_SLIP_MODE_SLIP6=y
 # CONFIG_NET_FC is not set
 CONFIG_NETCONSOLE=m
 CONFIG_NETCONSOLE_DYNAMIC=y
 CONFIG_NETPOLL=y
-# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NETPOLL_TRAP=y
 CONFIG_NET_POLL_CONTROLLER=y
 CONFIG_VIRTIO_NET=m
 CONFIG_VMXNET3=m
@@ -1861,7 +1961,8 @@ CONFIG_ISDN_PPP_VJ=y
 CONFIG_ISDN_MPP=y
 CONFIG_IPPP_FILTER=y
 CONFIG_ISDN_PPP_BSDCOMP=m
-# CONFIG_ISDN_AUDIO is not set
+CONFIG_ISDN_AUDIO=y
+CONFIG_ISDN_TTY_FAX=y
 
 #
 # ISDN feature submodules
@@ -1882,9 +1983,9 @@ CONFIG_ISDN_DRV_HISAX=m
 #
 CONFIG_HISAX_EURO=y
 CONFIG_DE_AOC=y
-# CONFIG_HISAX_NO_SENDCOMPLETE is not set
-# CONFIG_HISAX_NO_LLC is not set
-# CONFIG_HISAX_NO_KEYPAD is not set
+CONFIG_HISAX_NO_SENDCOMPLETE=y
+CONFIG_HISAX_NO_LLC=y
+CONFIG_HISAX_NO_KEYPAD=y
 CONFIG_HISAX_1TR6=y
 CONFIG_HISAX_NI1=y
 CONFIG_HISAX_MAX_CARDS=8
@@ -1915,10 +2016,6 @@ CONFIG_HISAX_ENTERNOW_PCI=y
 #
 # HiSax PCMCIA card service modules
 #
-CONFIG_HISAX_SEDLBAUER_CS=m
-CONFIG_HISAX_ELSA_CS=m
-CONFIG_HISAX_AVM_A1_CS=m
-CONFIG_HISAX_TELES_CS=m
 
 #
 # HiSax sub driver modules
@@ -1931,32 +2028,39 @@ CONFIG_HISAX_FRITZ_PCIPNP=m
 #
 # Active cards
 #
-# CONFIG_ISDN_CAPI is not set
+CONFIG_ISDN_CAPI=m
+CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y
+CONFIG_CAPI_TRACE=y
+CONFIG_ISDN_CAPI_MIDDLEWARE=y
+CONFIG_ISDN_CAPI_CAPI20=m
+CONFIG_ISDN_CAPI_CAPIDRV=m
+
+#
+# CAPI hardware drivers
+#
+CONFIG_CAPI_AVM=y
+CONFIG_ISDN_DRV_AVMB1_B1PCI=m
+CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y
+CONFIG_ISDN_DRV_AVMB1_T1PCI=m
+CONFIG_ISDN_DRV_AVMB1_C4=m
+CONFIG_CAPI_EICON=y
+CONFIG_ISDN_DIVAS=m
+CONFIG_ISDN_DIVAS_BRIPCI=y
+CONFIG_ISDN_DIVAS_PRIPCI=y
+CONFIG_ISDN_DIVAS_DIVACAPI=m
+CONFIG_ISDN_DIVAS_USERIDI=m
+CONFIG_ISDN_DIVAS_MAINT=m
 CONFIG_ISDN_DRV_GIGASET=m
-CONFIG_GIGASET_I4L=y
+CONFIG_GIGASET_CAPI=y
+# CONFIG_GIGASET_I4L is not set
 # CONFIG_GIGASET_DUMMYLL is not set
 CONFIG_GIGASET_BASE=m
 CONFIG_GIGASET_M105=m
 CONFIG_GIGASET_M101=m
 # CONFIG_GIGASET_DEBUG is not set
 CONFIG_HYSDN=m
-CONFIG_MISDN=m
-CONFIG_MISDN_DSP=m
-CONFIG_MISDN_L1OIP=m
-
-#
-# mISDN hardware drivers
-#
-CONFIG_MISDN_HFCPCI=m
-CONFIG_MISDN_HFCMULTI=m
-CONFIG_MISDN_HFCUSB=m
-CONFIG_MISDN_AVMFRITZ=m
-CONFIG_MISDN_SPEEDFAX=m
-CONFIG_MISDN_INFINEON=m
-CONFIG_MISDN_W6692=m
-CONFIG_MISDN_NETJET=m
-CONFIG_MISDN_IPAC=m
-CONFIG_MISDN_ISAR=m
+CONFIG_HYSDN_CAPI=y
+# CONFIG_MISDN is not set
 CONFIG_ISDN_HDLC=m
 # CONFIG_PHONE is not set
 
@@ -1983,22 +2087,22 @@ CONFIG_INPUT_EVDEV=y
 # Input Device Drivers
 #
 CONFIG_INPUT_KEYBOARD=y
-CONFIG_KEYBOARD_ADP5588=m
-CONFIG_KEYBOARD_ADP5589=m
+# CONFIG_KEYBOARD_ADP5588 is not set
+# CONFIG_KEYBOARD_ADP5589 is not set
 CONFIG_KEYBOARD_ATKBD=y
-CONFIG_KEYBOARD_QT1070=m
-CONFIG_KEYBOARD_QT2160=m
+# CONFIG_KEYBOARD_QT1070 is not set
+# CONFIG_KEYBOARD_QT2160 is not set
 # CONFIG_KEYBOARD_LKKBD is not set
 CONFIG_KEYBOARD_GPIO=m
 CONFIG_KEYBOARD_GPIO_POLLED=m
-CONFIG_KEYBOARD_TCA6416=m
-CONFIG_KEYBOARD_MATRIX=m
-CONFIG_KEYBOARD_LM8323=m
-CONFIG_KEYBOARD_MAX7359=m
-CONFIG_KEYBOARD_MCS=m
-CONFIG_KEYBOARD_MPR121=m
+# CONFIG_KEYBOARD_TCA6416 is not set
+# CONFIG_KEYBOARD_MATRIX is not set
+# CONFIG_KEYBOARD_LM8323 is not set
+# CONFIG_KEYBOARD_MAX7359 is not set
+# CONFIG_KEYBOARD_MCS is not set
+# CONFIG_KEYBOARD_MPR121 is not set
 # CONFIG_KEYBOARD_NEWTON is not set
-CONFIG_KEYBOARD_OPENCORES=m
+# CONFIG_KEYBOARD_OPENCORES is not set
 # CONFIG_KEYBOARD_STOWAWAY is not set
 # CONFIG_KEYBOARD_SUNKBD is not set
 # CONFIG_KEYBOARD_XTKBD is not set
@@ -2012,17 +2116,35 @@ CONFIG_MOUSE_PS2_TRACKPOINT=y
 CONFIG_MOUSE_PS2_ELANTECH=y
 CONFIG_MOUSE_PS2_SENTELIC=y
 CONFIG_MOUSE_PS2_TOUCHKIT=y
-CONFIG_MOUSE_PS2_OLPC=y
 CONFIG_MOUSE_SERIAL=m
-# CONFIG_MOUSE_APPLETOUCH is not set
-# CONFIG_MOUSE_BCM5974 is not set
-# CONFIG_MOUSE_VSXXXAA is not set
+CONFIG_MOUSE_APPLETOUCH=m
+CONFIG_MOUSE_BCM5974=m
+CONFIG_MOUSE_VSXXXAA=m
 # CONFIG_MOUSE_GPIO is not set
 CONFIG_MOUSE_SYNAPTICS_I2C=m
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TABLET is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
-# CONFIG_INPUT_MISC is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_AD714X is not set
+CONFIG_INPUT_PCSPKR=m
+# CONFIG_INPUT_MMA8450 is not set
+# CONFIG_INPUT_MPU3050 is not set
+CONFIG_INPUT_APANEL=m
+CONFIG_INPUT_WISTRON_BTNS=m
+CONFIG_INPUT_ATLAS_BTNS=m
+CONFIG_INPUT_ATI_REMOTE=m
+CONFIG_INPUT_ATI_REMOTE2=m
+CONFIG_INPUT_KEYSPAN_REMOTE=m
+# CONFIG_INPUT_KXTJ9 is not set
+CONFIG_INPUT_POWERMATE=m
+CONFIG_INPUT_YEALINK=m
+CONFIG_INPUT_CM109=m
+CONFIG_INPUT_UINPUT=m
+# CONFIG_INPUT_PCF8574 is not set
+CONFIG_INPUT_GPIO_ROTARY_ENCODER=m
+# CONFIG_INPUT_ADXL34X is not set
+# CONFIG_INPUT_CMA3000 is not set
 
 #
 # Hardware I/O ports
@@ -2034,9 +2156,9 @@ CONFIG_SERIO_SERPORT=m
 # CONFIG_SERIO_PARKBD is not set
 # CONFIG_SERIO_PCIPS2 is not set
 CONFIG_SERIO_LIBPS2=y
-# CONFIG_SERIO_RAW is not set
+CONFIG_SERIO_RAW=m
 CONFIG_SERIO_ALTERA_PS2=m
-CONFIG_SERIO_PS2MULT=m
+# CONFIG_SERIO_PS2MULT is not set
 # CONFIG_GAMEPORT is not set
 
 #
@@ -2046,16 +2168,25 @@ CONFIG_VT=y
 CONFIG_CONSOLE_TRANSLATIONS=y
 CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
-# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_VT_HW_CONSOLE_BINDING=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
-CONFIG_LEGACY_PTYS=y
-CONFIG_LEGACY_PTY_COUNT=256
-# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_NONSTANDARD=y
+CONFIG_ROCKETPORT=m
+CONFIG_CYCLADES=m
+# CONFIG_CYZ_INTR is not set
+# CONFIG_MOXA_INTELLIO is not set
+# CONFIG_MOXA_SMARTIO is not set
+CONFIG_SYNCLINK=m
+CONFIG_SYNCLINKMP=m
+CONFIG_SYNCLINK_GT=m
 CONFIG_NOZOMI=m
+# CONFIG_ISI is not set
+CONFIG_N_HDLC=m
 CONFIG_N_GSM=m
-CONFIG_TRACE_ROUTER=m
-CONFIG_TRACE_SINK=m
+# CONFIG_TRACE_SINK is not set
+# CONFIG_STALDRV is not set
 
 #
 # Serial drivers
@@ -2065,27 +2196,28 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_FIX_EARLYCON_MEM=y
 CONFIG_SERIAL_8250_PCI=y
 CONFIG_SERIAL_8250_PNP=y
-# CONFIG_SERIAL_8250_CS is not set
-CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_NR_UARTS=32
 CONFIG_SERIAL_8250_RUNTIME_UARTS=4
-# CONFIG_SERIAL_8250_EXTENDED is not set
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+CONFIG_SERIAL_8250_RSA=y
 
 #
 # Non-8250 serial port support
 #
 # CONFIG_SERIAL_MFD_HSU is not set
-CONFIG_SERIAL_UARTLITE=m
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
-# CONFIG_SERIAL_JSM is not set
-# CONFIG_SERIAL_OF_PLATFORM is not set
-CONFIG_SERIAL_TIMBERDALE=m
+CONFIG_SERIAL_JSM=m
+# CONFIG_SERIAL_TIMBERDALE is not set
 # CONFIG_SERIAL_ALTERA_JTAGUART is not set
 # CONFIG_SERIAL_ALTERA_UART is not set
-CONFIG_SERIAL_PCH_UART=m
-CONFIG_SERIAL_XILINX_PS_UART=m
+# CONFIG_SERIAL_PCH_UART is not set
+# CONFIG_SERIAL_XILINX_PS_UART is not set
 CONFIG_PRINTER=m
-# CONFIG_LP_CONSOLE is not set
+CONFIG_LP_CONSOLE=y
 CONFIG_PPDEV=m
 CONFIG_HVC_DRIVER=y
 CONFIG_VIRTIO_CONSOLE=m
@@ -2095,48 +2227,33 @@ CONFIG_IPMI_DEVICE_INTERFACE=m
 CONFIG_IPMI_SI=m
 CONFIG_IPMI_WATCHDOG=m
 CONFIG_IPMI_POWEROFF=m
-CONFIG_HW_RANDOM=m
+CONFIG_HW_RANDOM=y
 CONFIG_HW_RANDOM_TIMERIOMEM=m
 CONFIG_HW_RANDOM_INTEL=m
 CONFIG_HW_RANDOM_AMD=m
 CONFIG_HW_RANDOM_GEODE=m
 CONFIG_HW_RANDOM_VIA=m
 CONFIG_HW_RANDOM_VIRTIO=m
-CONFIG_NVRAM=m
-# CONFIG_R3964 is not set
+CONFIG_NVRAM=y
+CONFIG_R3964=m
 # CONFIG_APPLICOM is not set
-# CONFIG_SONYPI is not set
-
-#
-# PCMCIA character devices
-#
-# CONFIG_SYNCLINK_CS is not set
-# CONFIG_CARDMAN_4000 is not set
-# CONFIG_CARDMAN_4040 is not set
-CONFIG_IPWIRELESS=m
-# CONFIG_MWAVE is not set
-# CONFIG_PC8736x_GPIO is not set
-# CONFIG_NSC_GPIO is not set
-CONFIG_RAW_DRIVER=m
-CONFIG_MAX_RAW_DEVS=256
+CONFIG_SONYPI=m
+CONFIG_MWAVE=m
+CONFIG_PC8736x_GPIO=m
+CONFIG_NSC_GPIO=m
+CONFIG_RAW_DRIVER=y
+CONFIG_MAX_RAW_DEVS=8192
 CONFIG_HPET=y
-CONFIG_HPET_MMAP=y
-# CONFIG_HANGCHECK_TIMER is not set
+# CONFIG_HPET_MMAP is not set
+CONFIG_HANGCHECK_TIMER=m
 # CONFIG_TCG_TPM is not set
 # CONFIG_TELCLOCK is not set
 # CONFIG_RAMOOPS is not set
 CONFIG_I2C=m
 CONFIG_I2C_BOARDINFO=y
-# CONFIG_I2C_COMPAT is not set
+CONFIG_I2C_COMPAT=y
 CONFIG_I2C_CHARDEV=m
-CONFIG_I2C_MUX=m
-
-#
-# Multiplexer I2C Chip support
-#
-CONFIG_I2C_MUX_GPIO=m
-CONFIG_I2C_MUX_PCA9541=m
-CONFIG_I2C_MUX_PCA954x=m
+# CONFIG_I2C_MUX is not set
 CONFIG_I2C_HELPER_AUTO=y
 CONFIG_I2C_SMBUS=m
 CONFIG_I2C_ALGOBIT=m
@@ -2174,15 +2291,14 @@ CONFIG_I2C_SCMI=m
 #
 # I2C system bus drivers (mostly embedded / system-on-chip)
 #
-CONFIG_I2C_GPIO=m
-CONFIG_I2C_INTEL_MID=m
-CONFIG_I2C_OCORES=m
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_INTEL_MID is not set
+# CONFIG_I2C_OCORES is not set
 CONFIG_I2C_PCA_PLATFORM=m
-CONFIG_I2C_PXA=m
-CONFIG_I2C_PXA_PCI=y
+# CONFIG_I2C_PXA_PCI is not set
 CONFIG_I2C_SIMTEC=m
-CONFIG_I2C_XILINX=m
-CONFIG_I2C_EG20T=m
+# CONFIG_I2C_XILINX is not set
+# CONFIG_I2C_EG20T is not set
 
 #
 # External I2C/SMBus adapter drivers
@@ -2190,7 +2306,7 @@ CONFIG_I2C_EG20T=m
 CONFIG_I2C_DIOLAN_U2C=m
 CONFIG_I2C_PARPORT=m
 CONFIG_I2C_PARPORT_LIGHT=m
-CONFIG_I2C_TAOS_EVM=m
+# CONFIG_I2C_TAOS_EVM is not set
 CONFIG_I2C_TINY_USB=m
 
 #
@@ -2223,38 +2339,37 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
 CONFIG_GPIOLIB=y
 # CONFIG_DEBUG_GPIO is not set
 CONFIG_GPIO_SYSFS=y
-CONFIG_GPIO_MAX730X=m
 
 #
 # Memory mapped GPIO drivers:
 #
-CONFIG_GPIO_BASIC_MMIO_CORE=m
-CONFIG_GPIO_BASIC_MMIO=m
-CONFIG_GPIO_IT8761E=m
+# CONFIG_GPIO_GENERIC_PLATFORM is not set
+# CONFIG_GPIO_IT8761E is not set
 CONFIG_GPIO_SCH=m
-CONFIG_GPIO_VX855=m
+# CONFIG_GPIO_VX855 is not set
 
 #
 # I2C GPIO expanders:
 #
-CONFIG_GPIO_MAX7300=m
-CONFIG_GPIO_MAX732X=m
-CONFIG_GPIO_PCA953X=m
-CONFIG_GPIO_PCF857X=m
-CONFIG_GPIO_ADP5588=m
+# CONFIG_GPIO_MAX7300 is not set
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+# CONFIG_GPIO_ADP5588 is not set
 
 #
 # PCI GPIO expanders:
 #
-CONFIG_GPIO_LANGWELL=y
-CONFIG_GPIO_PCH=m
-CONFIG_GPIO_ML_IOH=m
-CONFIG_GPIO_TIMBERDALE=y
-CONFIG_GPIO_RDC321X=m
+# CONFIG_GPIO_CS5535 is not set
+# CONFIG_GPIO_LANGWELL is not set
+# CONFIG_GPIO_PCH is not set
+# CONFIG_GPIO_ML_IOH is not set
+# CONFIG_GPIO_RDC321X is not set
 
 #
 # SPI GPIO expanders:
 #
+# CONFIG_GPIO_MCP23S08 is not set
 
 #
 # AC97 GPIO expanders:
@@ -2263,18 +2378,17 @@ CONFIG_GPIO_RDC321X=m
 #
 # MODULbus GPIO expanders:
 #
-CONFIG_GPIO_JANZ_TTL=m
 CONFIG_W1=m
 CONFIG_W1_CON=y
 
 #
 # 1-wire Bus Masters
 #
-CONFIG_W1_MASTER_MATROX=m
+# CONFIG_W1_MASTER_MATROX is not set
 CONFIG_W1_MASTER_DS2490=m
 CONFIG_W1_MASTER_DS2482=m
 CONFIG_W1_MASTER_DS1WM=m
-CONFIG_W1_MASTER_GPIO=m
+# CONFIG_W1_MASTER_GPIO is not set
 
 #
 # 1-wire Slaves
@@ -2293,21 +2407,17 @@ CONFIG_POWER_SUPPLY=y
 # CONFIG_POWER_SUPPLY_DEBUG is not set
 # CONFIG_PDA_POWER is not set
 # CONFIG_TEST_POWER is not set
-CONFIG_BATTERY_DS2760=m
-CONFIG_BATTERY_DS2780=m
-CONFIG_BATTERY_DS2782=m
-CONFIG_BATTERY_OLPC=m
-CONFIG_BATTERY_BQ20Z75=m
-CONFIG_BATTERY_BQ27x00=m
-CONFIG_BATTERY_BQ27X00_I2C=y
-CONFIG_BATTERY_BQ27X00_PLATFORM=y
-CONFIG_BATTERY_MAX17040=m
-CONFIG_BATTERY_MAX17042=m
-CONFIG_CHARGER_PCF50633=m
-CONFIG_CHARGER_ISP1704=m
-CONFIG_CHARGER_MAX8903=m
-CONFIG_CHARGER_GPIO=m
-CONFIG_HWMON=m
+# CONFIG_BATTERY_DS2760 is not set
+# CONFIG_BATTERY_DS2780 is not set
+# CONFIG_BATTERY_DS2782 is not set
+# CONFIG_BATTERY_BQ20Z75 is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+# CONFIG_BATTERY_MAX17040 is not set
+# CONFIG_BATTERY_MAX17042 is not set
+# CONFIG_CHARGER_ISP1704 is not set
+# CONFIG_CHARGER_MAX8903 is not set
+# CONFIG_CHARGER_GPIO is not set
+CONFIG_HWMON=y
 CONFIG_HWMON_VID=m
 # CONFIG_HWMON_DEBUG_CHIP is not set
 
@@ -2344,12 +2454,12 @@ CONFIG_SENSORS_FSCHMD=m
 CONFIG_SENSORS_G760A=m
 CONFIG_SENSORS_GL518SM=m
 CONFIG_SENSORS_GL520SM=m
-CONFIG_SENSORS_GPIO_FAN=m
+# CONFIG_SENSORS_GPIO_FAN is not set
 CONFIG_SENSORS_CORETEMP=m
 CONFIG_SENSORS_IBMAEM=m
 CONFIG_SENSORS_IBMPEX=m
 CONFIG_SENSORS_IT87=m
-CONFIG_SENSORS_JC42=m
+# CONFIG_SENSORS_JC42 is not set
 CONFIG_SENSORS_LINEAGE=m
 CONFIG_SENSORS_LM63=m
 CONFIG_SENSORS_LM73=m
@@ -2368,17 +2478,21 @@ CONFIG_SENSORS_LTC4215=m
 CONFIG_SENSORS_LTC4245=m
 CONFIG_SENSORS_LTC4261=m
 CONFIG_SENSORS_LM95241=m
+CONFIG_SENSORS_LM95245=m
 CONFIG_SENSORS_MAX16065=m
 CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_MAX1668=m
 CONFIG_SENSORS_MAX6639=m
 CONFIG_SENSORS_MAX6642=m
 CONFIG_SENSORS_MAX6650=m
+CONFIG_SENSORS_NTC_THERMISTOR=m
 CONFIG_SENSORS_PC87360=m
 CONFIG_SENSORS_PC87427=m
 CONFIG_SENSORS_PCF8591=m
 CONFIG_PMBUS=m
 CONFIG_SENSORS_PMBUS=m
 CONFIG_SENSORS_ADM1275=m
+CONFIG_SENSORS_LM25066=m
 CONFIG_SENSORS_MAX16064=m
 CONFIG_SENSORS_MAX34440=m
 CONFIG_SENSORS_MAX8688=m
@@ -2387,15 +2501,17 @@ CONFIG_SENSORS_UCD9200=m
 CONFIG_SENSORS_SHT15=m
 CONFIG_SENSORS_SHT21=m
 CONFIG_SENSORS_SIS5595=m
-CONFIG_SENSORS_SMM665=m
+# CONFIG_SENSORS_SMM665 is not set
 CONFIG_SENSORS_DME1737=m
 CONFIG_SENSORS_EMC1403=m
-CONFIG_SENSORS_EMC2103=m
+# CONFIG_SENSORS_EMC2103 is not set
 CONFIG_SENSORS_EMC6W201=m
 CONFIG_SENSORS_SMSC47M1=m
 CONFIG_SENSORS_SMSC47M192=m
 CONFIG_SENSORS_SMSC47B397=m
+CONFIG_SENSORS_SCH56XX_COMMON=m
 CONFIG_SENSORS_SCH5627=m
+CONFIG_SENSORS_SCH5636=m
 CONFIG_SENSORS_ADS1015=m
 CONFIG_SENSORS_ADS7828=m
 CONFIG_SENSORS_AMC6821=m
@@ -2425,25 +2541,27 @@ CONFIG_SENSORS_APPLESMC=m
 CONFIG_SENSORS_ACPI_POWER=m
 CONFIG_SENSORS_ATK0110=m
 CONFIG_THERMAL=y
+CONFIG_THERMAL_HWMON=y
 CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_CORE=y
 CONFIG_WATCHDOG_NOWAYOUT=y
 
 #
 # Watchdog Device Drivers
 #
 CONFIG_SOFT_WATCHDOG=m
-CONFIG_ACQUIRE_WDT=m
-CONFIG_ADVANTECH_WDT=m
+# CONFIG_ACQUIRE_WDT is not set
+# CONFIG_ADVANTECH_WDT is not set
 CONFIG_ALIM1535_WDT=m
 CONFIG_ALIM7101_WDT=m
 CONFIG_F71808E_WDT=m
 CONFIG_SP5100_TCO=m
-CONFIG_SC520_WDT=m
+# CONFIG_SC520_WDT is not set
 CONFIG_SBC_FITPC2_WATCHDOG=m
-CONFIG_EUROTECH_WDT=m
+# CONFIG_EUROTECH_WDT is not set
 CONFIG_IB700_WDT=m
 CONFIG_IBMASR=m
-CONFIG_WAFER_WDT=m
+# CONFIG_WAFER_WDT is not set
 CONFIG_I6300ESB_WDT=m
 CONFIG_ITCO_WDT=m
 # CONFIG_ITCO_VENDOR_SUPPORT is not set
@@ -2451,22 +2569,22 @@ CONFIG_IT8712F_WDT=m
 CONFIG_IT87_WDT=m
 CONFIG_HP_WATCHDOG=m
 CONFIG_HPWDT_NMI_DECODING=y
-CONFIG_SC1200_WDT=m
-CONFIG_PC87413_WDT=m
+# CONFIG_SC1200_WDT is not set
+# CONFIG_PC87413_WDT is not set
 CONFIG_NV_TCO=m
-CONFIG_60XX_WDT=m
-CONFIG_SBC8360_WDT=m
-CONFIG_SBC7240_WDT=m
-CONFIG_CPU5_WDT=m
+# CONFIG_60XX_WDT is not set
+# CONFIG_SBC8360_WDT is not set
+# CONFIG_SBC7240_WDT is not set
+# CONFIG_CPU5_WDT is not set
 CONFIG_SMSC_SCH311X_WDT=m
-CONFIG_SMSC37B787_WDT=m
+# CONFIG_SMSC37B787_WDT is not set
 CONFIG_W83627HF_WDT=m
 CONFIG_W83697HF_WDT=m
 CONFIG_W83697UG_WDT=m
 CONFIG_W83877F_WDT=m
 CONFIG_W83977F_WDT=m
 CONFIG_MACHZ_WDT=m
-CONFIG_SBC_EPX_C3_WATCHDOG=m
+# CONFIG_SBC_EPX_C3_WATCHDOG is not set
 
 #
 # PCI-based Watchdog Cards
@@ -2489,8 +2607,8 @@ CONFIG_SSB_BLOCKIO=y
 CONFIG_SSB_PCIHOST_POSSIBLE=y
 CONFIG_SSB_PCIHOST=y
 CONFIG_SSB_B43_PCI_BRIDGE=y
-CONFIG_SSB_PCMCIAHOST_POSSIBLE=y
-CONFIG_SSB_PCMCIAHOST=y
+CONFIG_SSB_SDIOHOST_POSSIBLE=y
+CONFIG_SSB_SDIOHOST=y
 # CONFIG_SSB_DEBUG is not set
 CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
 CONFIG_SSB_DRIVER_PCICORE=y
@@ -2499,52 +2617,28 @@ CONFIG_BCMA_POSSIBLE=y
 #
 # Broadcom specific AMBA
 #
-CONFIG_BCMA=m
-CONFIG_BCMA_HOST_PCI_POSSIBLE=y
-CONFIG_BCMA_HOST_PCI=y
-# CONFIG_BCMA_DEBUG is not set
+# CONFIG_BCMA is not set
 CONFIG_MFD_SUPPORT=y
 CONFIG_MFD_CORE=m
-# CONFIG_MFD_SM501 is not set
+CONFIG_MFD_SM501=m
+CONFIG_MFD_SM501_GPIO=y
 # CONFIG_HTC_PASIC3 is not set
 # CONFIG_UCB1400_CORE is not set
-CONFIG_TPS6105X=m
-CONFIG_TPS65010=m
-CONFIG_TPS6507X=m
+# CONFIG_TPS6105X is not set
+# CONFIG_TPS65010 is not set
+# CONFIG_TPS6507X is not set
 # CONFIG_MFD_TMIO is not set
 CONFIG_MFD_WM8400=m
-CONFIG_MFD_PCF50633=m
-CONFIG_PCF50633_ADC=m
-CONFIG_PCF50633_GPIO=m
-CONFIG_ABX500_CORE=y
-# CONFIG_AB8500_CORE is not set
-# CONFIG_MFD_CS5535 is not set
-CONFIG_MFD_TIMBERDALE=m
+# CONFIG_MFD_PCF50633 is not set
+# CONFIG_ABX500_CORE is not set
+CONFIG_MFD_CS5535=m
+# CONFIG_MFD_TIMBERDALE is not set
 CONFIG_LPC_SCH=m
-CONFIG_MFD_RDC321X=m
-CONFIG_MFD_JANZ_CMODIO=m
+# CONFIG_MFD_RDC321X is not set
+# CONFIG_MFD_JANZ_CMODIO is not set
 CONFIG_MFD_VX855=m
 CONFIG_MFD_WL1273_CORE=m
-CONFIG_REGULATOR=y
-# CONFIG_REGULATOR_DEBUG is not set
-CONFIG_REGULATOR_DUMMY=y
-CONFIG_REGULATOR_FIXED_VOLTAGE=m
-CONFIG_REGULATOR_VIRTUAL_CONSUMER=m
-CONFIG_REGULATOR_USERSPACE_CONSUMER=m
-CONFIG_REGULATOR_BQ24022=m
-CONFIG_REGULATOR_MAX1586=m
-CONFIG_REGULATOR_MAX8649=m
-CONFIG_REGULATOR_MAX8660=m
-CONFIG_REGULATOR_MAX8952=m
-CONFIG_REGULATOR_WM8400=m
-CONFIG_REGULATOR_PCF50633=m
-CONFIG_REGULATOR_LP3971=m
-CONFIG_REGULATOR_LP3972=m
-CONFIG_REGULATOR_TPS6105X=m
-CONFIG_REGULATOR_TPS65023=m
-CONFIG_REGULATOR_TPS6507X=m
-CONFIG_REGULATOR_ISL6271A=m
-CONFIG_REGULATOR_AD5398=m
+# CONFIG_REGULATOR is not set
 CONFIG_MEDIA_SUPPORT=m
 
 #
@@ -2553,8 +2647,9 @@ CONFIG_MEDIA_SUPPORT=m
 CONFIG_MEDIA_CONTROLLER=y
 CONFIG_VIDEO_DEV=m
 CONFIG_VIDEO_V4L2_COMMON=m
-# CONFIG_VIDEO_V4L2_SUBDEV_API is not set
+CONFIG_VIDEO_V4L2_SUBDEV_API=y
 CONFIG_DVB_CORE=m
+CONFIG_DVB_NET=y
 CONFIG_VIDEO_MEDIA=m
 
 #
@@ -2571,6 +2666,7 @@ CONFIG_IR_RC6_DECODER=m
 CONFIG_IR_JVC_DECODER=m
 CONFIG_IR_SONY_DECODER=m
 CONFIG_IR_RC5_SZ_DECODER=m
+CONFIG_IR_MCE_KBD_DECODER=m
 CONFIG_IR_LIRC_CODEC=m
 CONFIG_IR_ENE=m
 CONFIG_IR_IMON=m
@@ -2584,7 +2680,11 @@ CONFIG_IR_WINBOND_CIR=m
 CONFIG_RC_LOOPBACK=m
 CONFIG_MEDIA_ATTACH=y
 CONFIG_MEDIA_TUNER=m
-# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
+CONFIG_MEDIA_TUNER_CUSTOMISE=y
+
+#
+# Customize TV tuners
+#
 CONFIG_MEDIA_TUNER_SIMPLE=m
 CONFIG_MEDIA_TUNER_TDA8290=m
 CONFIG_MEDIA_TUNER_TDA827X=m
@@ -2599,6 +2699,7 @@ CONFIG_MEDIA_TUNER_MT2131=m
 CONFIG_MEDIA_TUNER_QT1010=m
 CONFIG_MEDIA_TUNER_XC2028=m
 CONFIG_MEDIA_TUNER_XC5000=m
+CONFIG_MEDIA_TUNER_XC4000=m
 CONFIG_MEDIA_TUNER_MXL5005S=m
 CONFIG_MEDIA_TUNER_MXL5007T=m
 CONFIG_MEDIA_TUNER_MC44S803=m
@@ -2616,6 +2717,7 @@ CONFIG_VIDEO_TVEEPROM=m
 CONFIG_VIDEO_TUNER=m
 CONFIG_VIDEOBUF2_CORE=m
 CONFIG_VIDEOBUF2_MEMOPS=m
+CONFIG_VIDEOBUF2_DMA_CONTIG=m
 CONFIG_VIDEOBUF2_VMALLOC=m
 CONFIG_VIDEO_CAPTURE_DRIVERS=y
 # CONFIG_VIDEO_ADV_DEBUG is not set
@@ -2653,6 +2755,7 @@ CONFIG_VIDEO_BT866=m
 CONFIG_VIDEO_KS0127=m
 CONFIG_VIDEO_SAA7110=m
 CONFIG_VIDEO_SAA711X=m
+CONFIG_VIDEO_TVP5150=m
 CONFIG_VIDEO_VPX3220=m
 
 #
@@ -2678,6 +2781,11 @@ CONFIG_VIDEO_ADV7175=m
 # Camera sensor devices
 #
 CONFIG_VIDEO_OV7670=m
+CONFIG_VIDEO_MT9V011=m
+
+#
+# Flash devices
+#
 
 #
 # Video improvement chips
@@ -2689,7 +2797,7 @@ CONFIG_VIDEO_UPD64083=m
 # Miscelaneous helper chips
 #
 CONFIG_VIDEO_M52790=m
-CONFIG_VIDEO_VIVI=m
+# CONFIG_VIDEO_VIVI is not set
 CONFIG_VIDEO_BT848=m
 CONFIG_VIDEO_BT848_DVB=y
 CONFIG_VIDEO_BWQCAM=m
@@ -2720,7 +2828,7 @@ CONFIG_VIDEO_CX88_DVB=m
 CONFIG_VIDEO_CX88_MPEG=m
 CONFIG_VIDEO_CX88_VP3054=m
 CONFIG_VIDEO_CX23885=m
-CONFIG_MEDIA_ALTERA_CI=m
+# CONFIG_MEDIA_ALTERA_CI is not set
 CONFIG_VIDEO_AU0828=m
 CONFIG_VIDEO_IVTV=m
 CONFIG_VIDEO_FB_IVTV=m
@@ -2731,6 +2839,7 @@ CONFIG_VIDEO_CAFE_CCIC=m
 CONFIG_VIDEO_SR030PC30=m
 CONFIG_VIDEO_VIA_CAMERA=m
 CONFIG_VIDEO_NOON010PC30=m
+# CONFIG_VIDEO_M5MOLS is not set
 CONFIG_SOC_CAMERA=m
 CONFIG_SOC_CAMERA_IMX074=m
 CONFIG_SOC_CAMERA_MT9M001=m
@@ -2742,6 +2851,7 @@ CONFIG_SOC_CAMERA_RJ54N1=m
 CONFIG_SOC_CAMERA_TW9910=m
 CONFIG_SOC_CAMERA_PLATFORM=m
 CONFIG_SOC_CAMERA_OV2640=m
+CONFIG_SOC_CAMERA_OV5642=m
 CONFIG_SOC_CAMERA_OV6650=m
 CONFIG_SOC_CAMERA_OV772X=m
 CONFIG_SOC_CAMERA_OV9640=m
@@ -2770,6 +2880,7 @@ CONFIG_USB_GSPCA_OV534_9=m
 CONFIG_USB_GSPCA_PAC207=m
 CONFIG_USB_GSPCA_PAC7302=m
 CONFIG_USB_GSPCA_PAC7311=m
+CONFIG_USB_GSPCA_SE401=m
 CONFIG_USB_GSPCA_SN9C2028=m
 CONFIG_USB_GSPCA_SN9C20X=m
 CONFIG_USB_GSPCA_SONIXB=m
@@ -2793,42 +2904,49 @@ CONFIG_USB_GSPCA_VC032X=m
 CONFIG_USB_GSPCA_VICAM=m
 CONFIG_USB_GSPCA_XIRLINK_CIT=m
 CONFIG_USB_GSPCA_ZC3XX=m
-# CONFIG_VIDEO_PVRUSB2 is not set
+CONFIG_VIDEO_PVRUSB2=m
+CONFIG_VIDEO_PVRUSB2_SYSFS=y
+CONFIG_VIDEO_PVRUSB2_DVB=y
+# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
 CONFIG_VIDEO_HDPVR=m
-# CONFIG_VIDEO_EM28XX is not set
+CONFIG_VIDEO_EM28XX=m
+CONFIG_VIDEO_EM28XX_ALSA=m
+CONFIG_VIDEO_EM28XX_DVB=m
+CONFIG_VIDEO_EM28XX_RC=y
 CONFIG_VIDEO_TLG2300=m
 CONFIG_VIDEO_CX231XX=m
 CONFIG_VIDEO_CX231XX_RC=y
 CONFIG_VIDEO_CX231XX_ALSA=m
 CONFIG_VIDEO_CX231XX_DVB=m
-# CONFIG_VIDEO_USBVISION is not set
+CONFIG_VIDEO_USBVISION=m
 # CONFIG_USB_ET61X251 is not set
 # CONFIG_USB_SN9C102 is not set
 CONFIG_USB_PWC=m
 # CONFIG_USB_PWC_DEBUG is not set
 CONFIG_USB_PWC_INPUT_EVDEV=y
-# CONFIG_USB_ZR364XX is not set
-# CONFIG_USB_STKWEBCAM is not set
+CONFIG_USB_ZR364XX=m
+CONFIG_USB_STKWEBCAM=m
 CONFIG_USB_S2255=m
 CONFIG_V4L_MEM2MEM_DRIVERS=y
 # CONFIG_VIDEO_MEM2MEM_TESTDEV is not set
 CONFIG_RADIO_ADAPTERS=y
-# CONFIG_RADIO_MAXIRADIO is not set
+CONFIG_RADIO_MAXIRADIO=m
 CONFIG_I2C_SI4713=m
 CONFIG_RADIO_SI4713=m
-# CONFIG_USB_DSBR is not set
-# CONFIG_RADIO_SI470X is not set
-# CONFIG_USB_MR800 is not set
+CONFIG_USB_DSBR=m
+CONFIG_RADIO_SI470X=y
+CONFIG_USB_SI470X=m
+CONFIG_I2C_SI470X=m
+CONFIG_USB_MR800=m
 # CONFIG_RADIO_TEA5764 is not set
-CONFIG_RADIO_SAA7706H=m
-CONFIG_RADIO_TEF6862=m
-CONFIG_RADIO_TIMBERDALE=m
+# CONFIG_RADIO_SAA7706H is not set
+# CONFIG_RADIO_TEF6862 is not set
 CONFIG_RADIO_WL1273=m
 
 #
 # Texas Instruments WL128x FM driver (ST based)
 #
-CONFIG_RADIO_WL128X=m
+# CONFIG_RADIO_WL128X is not set
 CONFIG_DVB_MAX_ADAPTERS=8
 CONFIG_DVB_DYNAMIC_MINORS=y
 CONFIG_DVB_CAPTURE_DRIVERS=y
@@ -2889,6 +3007,7 @@ CONFIG_SMS_SIANO_MDTV=m
 # Siano module components
 #
 CONFIG_SMS_USB_DRV=m
+# CONFIG_SMS_SDIO_DRV is not set
 
 #
 # Supported FlexCopII (B2C2) Adapters
@@ -2936,10 +3055,19 @@ CONFIG_DVB_HOPPER=m
 #
 CONFIG_DVB_NGENE=m
 
+#
+# Supported ddbridge ('Octopus') Adapters
+#
+# CONFIG_DVB_DDBRIDGE is not set
+
 #
 # Supported DVB Frontends
 #
-# CONFIG_DVB_FE_CUSTOMISE is not set
+CONFIG_DVB_FE_CUSTOMISE=y
+
+#
+# Customise DVB Frontends
+#
 
 #
 # Multistandard (satellite) frontends
@@ -2949,6 +3077,12 @@ CONFIG_DVB_STB6100=m
 CONFIG_DVB_STV090x=m
 CONFIG_DVB_STV6110x=m
 
+#
+# Multistandard (cable + terrestrial) frontends
+#
+CONFIG_DVB_DRXK=m
+CONFIG_DVB_TDA18271C2DD=m
+
 #
 # DVB-S (satellite) frontends
 #
@@ -2983,6 +3117,8 @@ CONFIG_DVB_SP8870=m
 CONFIG_DVB_SP887X=m
 CONFIG_DVB_CX22700=m
 CONFIG_DVB_CX22702=m
+CONFIG_DVB_S5H1432=m
+CONFIG_DVB_DRXD=m
 CONFIG_DVB_L64781=m
 CONFIG_DVB_TDA1004X=m
 CONFIG_DVB_NXT6000=m
@@ -2992,10 +3128,12 @@ CONFIG_DVB_DIB3000MB=m
 CONFIG_DVB_DIB3000MC=m
 CONFIG_DVB_DIB7000M=m
 CONFIG_DVB_DIB7000P=m
+CONFIG_DVB_DIB9000=m
 CONFIG_DVB_TDA10048=m
 CONFIG_DVB_AF9013=m
 CONFIG_DVB_EC100=m
 CONFIG_DVB_STV0367=m
+CONFIG_DVB_CXD2820R=m
 
 #
 # DVB-C (cable) frontends
@@ -3021,6 +3159,7 @@ CONFIG_DVB_S5H1411=m
 #
 # ISDB-T (terrestrial) frontends
 #
+CONFIG_DVB_S921=m
 CONFIG_DVB_DIB8000=m
 CONFIG_DVB_MB86A20S=m
 
@@ -3038,6 +3177,7 @@ CONFIG_DVB_LNBP21=m
 CONFIG_DVB_ISL6405=m
 CONFIG_DVB_ISL6421=m
 CONFIG_DVB_ISL6423=m
+CONFIG_DVB_LGS8GL5=m
 CONFIG_DVB_LGS8GXX=m
 CONFIG_DVB_ATBM8830=m
 CONFIG_DVB_TDA665x=m
@@ -3051,26 +3191,39 @@ CONFIG_DVB_IX2505V=m
 #
 # Graphics support
 #
-CONFIG_AGP=m
-CONFIG_AGP_ALI=m
-CONFIG_AGP_ATI=m
-CONFIG_AGP_AMD=m
-CONFIG_AGP_AMD64=m
-CONFIG_AGP_INTEL=m
-CONFIG_AGP_NVIDIA=m
-CONFIG_AGP_SIS=m
-CONFIG_AGP_SWORKS=m
-CONFIG_AGP_VIA=m
-CONFIG_AGP_EFFICEON=m
+CONFIG_AGP=y
+CONFIG_AGP_ALI=y
+CONFIG_AGP_ATI=y
+CONFIG_AGP_AMD=y
+CONFIG_AGP_AMD64=y
+CONFIG_AGP_INTEL=y
+CONFIG_AGP_NVIDIA=y
+CONFIG_AGP_SIS=y
+CONFIG_AGP_SWORKS=y
+CONFIG_AGP_VIA=y
+CONFIG_AGP_EFFICEON=y
 CONFIG_VGA_ARB=y
 CONFIG_VGA_ARB_MAX_GPUS=16
 CONFIG_VGA_SWITCHEROO=y
-# CONFIG_DRM is not set
+CONFIG_DRM=m
+CONFIG_DRM_KMS_HELPER=m
+CONFIG_DRM_TTM=m
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_RADEON_KMS=y
+CONFIG_DRM_I810=m
+CONFIG_DRM_I915=m
+CONFIG_DRM_I915_KMS=y
+CONFIG_DRM_MGA=m
+CONFIG_DRM_SIS=m
+CONFIG_DRM_VIA=m
+CONFIG_DRM_SAVAGE=m
 CONFIG_STUB_POULSBO=m
 CONFIG_VGASTATE=m
 CONFIG_VIDEO_OUTPUT_CONTROL=m
 CONFIG_FB=y
-CONFIG_FIRMWARE_EDID=y
+# CONFIG_FIRMWARE_EDID is not set
 CONFIG_FB_DDC=m
 CONFIG_FB_BOOT_VESA_SUPPORT=y
 CONFIG_FB_CFB_FILLRECT=y
@@ -3080,14 +3233,10 @@ CONFIG_FB_CFB_IMAGEBLIT=y
 CONFIG_FB_SYS_FILLRECT=m
 CONFIG_FB_SYS_COPYAREA=m
 CONFIG_FB_SYS_IMAGEBLIT=m
-CONFIG_FB_FOREIGN_ENDIAN=y
-CONFIG_FB_BOTH_ENDIAN=y
-# CONFIG_FB_BIG_ENDIAN is not set
-# CONFIG_FB_LITTLE_ENDIAN is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
 CONFIG_FB_SYS_FOPS=m
 # CONFIG_FB_WMT_GE_ROPS is not set
 CONFIG_FB_DEFERRED_IO=y
-CONFIG_FB_HECUBA=m
 CONFIG_FB_SVGALIB=m
 # CONFIG_FB_MACMODES is not set
 CONFIG_FB_BACKLIGHT=y
@@ -3098,32 +3247,30 @@ CONFIG_FB_TILEBLITTING=y
 # Frame buffer hardware drivers
 #
 CONFIG_FB_CIRRUS=m
-CONFIG_FB_PM2=m
-CONFIG_FB_PM2_FIFO_DISCONNECT=y
-CONFIG_FB_CYBER2000=m
-CONFIG_FB_CYBER2000_DDC=y
-CONFIG_FB_ARC=m
-CONFIG_FB_ASILIANT=y
-CONFIG_FB_IMSTT=y
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ARC is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
 CONFIG_FB_VGA16=m
-CONFIG_FB_UVESA=m
+# CONFIG_FB_UVESA is not set
 CONFIG_FB_VESA=y
-CONFIG_FB_N411=m
-CONFIG_FB_HGA=m
-CONFIG_FB_S1D13XXX=m
+CONFIG_FB_EFI=y
+# CONFIG_FB_N411 is not set
+# CONFIG_FB_HGA is not set
+# CONFIG_FB_S1D13XXX is not set
 CONFIG_FB_NVIDIA=m
 CONFIG_FB_NVIDIA_I2C=y
 # CONFIG_FB_NVIDIA_DEBUG is not set
 CONFIG_FB_NVIDIA_BACKLIGHT=y
 CONFIG_FB_RIVA=m
-CONFIG_FB_RIVA_I2C=y
+# CONFIG_FB_RIVA_I2C is not set
 # CONFIG_FB_RIVA_DEBUG is not set
 CONFIG_FB_RIVA_BACKLIGHT=y
 CONFIG_FB_I810=m
 CONFIG_FB_I810_GTF=y
 CONFIG_FB_I810_I2C=y
-CONFIG_FB_LE80578=m
-CONFIG_FB_CARILLO_RANCH=m
+# CONFIG_FB_LE80578 is not set
 CONFIG_FB_MATROX=m
 CONFIG_FB_MATROX_MILLENIUM=y
 CONFIG_FB_MATROX_MYSTIQUE=y
@@ -3146,9 +3293,7 @@ CONFIG_FB_S3_DDC=y
 CONFIG_FB_SAVAGE=m
 CONFIG_FB_SAVAGE_I2C=y
 CONFIG_FB_SAVAGE_ACCEL=y
-CONFIG_FB_SIS=m
-CONFIG_FB_SIS_300=y
-CONFIG_FB_SIS_315=y
+# CONFIG_FB_SIS is not set
 CONFIG_FB_VIA=m
 # CONFIG_FB_VIA_DIRECT_PROCFS is not set
 CONFIG_FB_VIA_X_COMPATIBILITY=y
@@ -3158,43 +3303,43 @@ CONFIG_FB_3DFX=m
 CONFIG_FB_3DFX_ACCEL=y
 CONFIG_FB_3DFX_I2C=y
 CONFIG_FB_VOODOO1=m
-CONFIG_FB_VT8623=m
+# CONFIG_FB_VT8623 is not set
 CONFIG_FB_TRIDENT=m
-CONFIG_FB_ARK=m
-CONFIG_FB_PM3=m
-CONFIG_FB_CARMINE=m
-CONFIG_FB_CARMINE_DRAM_EVAL=y
-# CONFIG_CARMINE_DRAM_CUSTOM is not set
+# CONFIG_FB_ARK is not set
+# CONFIG_FB_PM3 is not set
+# CONFIG_FB_CARMINE is not set
 CONFIG_FB_GEODE=y
-CONFIG_FB_GEODE_LX=m
-CONFIG_FB_GEODE_GX=m
-CONFIG_FB_GEODE_GX1=m
-CONFIG_FB_TMIO=m
-CONFIG_FB_TMIO_ACCELL=y
+CONFIG_FB_GEODE_LX=y
+CONFIG_FB_GEODE_GX=y
+# CONFIG_FB_GEODE_GX1 is not set
+# CONFIG_FB_TMIO is not set
+CONFIG_FB_SM501=m
 CONFIG_FB_UDL=m
-# CONFIG_FB_VIRTUAL is not set
+CONFIG_FB_VIRTUAL=m
 CONFIG_FB_METRONOME=m
 CONFIG_FB_MB862XX=m
 CONFIG_FB_MB862XX_PCI_GDC=y
 CONFIG_FB_MB862XX_I2C=y
-CONFIG_FB_BROADSHEET=m
+# CONFIG_FB_BROADSHEET is not set
 CONFIG_BACKLIGHT_LCD_SUPPORT=y
 CONFIG_LCD_CLASS_DEVICE=m
 CONFIG_LCD_PLATFORM=m
 CONFIG_BACKLIGHT_CLASS_DEVICE=y
-CONFIG_BACKLIGHT_GENERIC=m
-# CONFIG_BACKLIGHT_PROGEAR is not set
-# CONFIG_BACKLIGHT_CARILLO_RANCH is not set
+# CONFIG_BACKLIGHT_GENERIC is not set
+CONFIG_BACKLIGHT_PROGEAR=m
 CONFIG_BACKLIGHT_APPLE=m
-CONFIG_BACKLIGHT_SAHARA=m
-CONFIG_BACKLIGHT_ADP8860=m
-CONFIG_BACKLIGHT_ADP8870=m
-CONFIG_BACKLIGHT_PCF50633=m
+# CONFIG_BACKLIGHT_SAHARA is not set
+# CONFIG_BACKLIGHT_ADP8860 is not set
+# CONFIG_BACKLIGHT_ADP8870 is not set
 
 #
 # Display device support
 #
-# CONFIG_DISPLAY_SUPPORT is not set
+CONFIG_DISPLAY_SUPPORT=m
+
+#
+# Display hardware drivers
+#
 
 #
 # Console display driver support
@@ -3205,7 +3350,7 @@ CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=128
 CONFIG_DUMMY_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
-# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
 # CONFIG_FONTS is not set
 CONFIG_FONT_8x8=y
 CONFIG_FONT_8x16=y
@@ -3232,10 +3377,12 @@ CONFIG_SND_SEQUENCER_OSS=y
 CONFIG_SND_HRTIMER=m
 CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
 CONFIG_SND_DYNAMIC_MINORS=y
-CONFIG_SND_SUPPORT_OLD_API=y
+# CONFIG_SND_SUPPORT_OLD_API is not set
 CONFIG_SND_VERBOSE_PROCFS=y
-# CONFIG_SND_VERBOSE_PRINTK is not set
-# CONFIG_SND_DEBUG is not set
+CONFIG_SND_VERBOSE_PRINTK=y
+CONFIG_SND_DEBUG=y
+# CONFIG_SND_DEBUG_VERBOSE is not set
+CONFIG_SND_PCM_XRUN_DEBUG=y
 CONFIG_SND_VMASTER=y
 CONFIG_SND_DMA_SGBUF=y
 CONFIG_SND_RAWMIDI_SEQ=m
@@ -3248,7 +3395,7 @@ CONFIG_SND_OPL3_LIB=m
 CONFIG_SND_VX_LIB=m
 CONFIG_SND_AC97_CODEC=m
 CONFIG_SND_DRIVERS=y
-# CONFIG_SND_PCSP is not set
+CONFIG_SND_PCSP=m
 CONFIG_SND_DUMMY=m
 CONFIG_SND_ALOOP=m
 CONFIG_SND_VIRMIDI=m
@@ -3261,6 +3408,7 @@ CONFIG_SND_AC97_POWER_SAVE=y
 CONFIG_SND_AC97_POWER_SAVE_DEFAULT=0
 CONFIG_SND_SB_COMMON=m
 CONFIG_SND_SB16_DSP=m
+CONFIG_SND_TEA575X=m
 CONFIG_SND_PCI=y
 CONFIG_SND_AD1889=m
 CONFIG_SND_ALS300=m
@@ -3272,10 +3420,10 @@ CONFIG_SND_ATIIXP_MODEM=m
 CONFIG_SND_AU8810=m
 CONFIG_SND_AU8820=m
 CONFIG_SND_AU8830=m
-CONFIG_SND_AW2=m
+# CONFIG_SND_AW2 is not set
 CONFIG_SND_AZT3328=m
 CONFIG_SND_BT87X=m
-CONFIG_SND_BT87X_OVERCLOCK=y
+# CONFIG_SND_BT87X_OVERCLOCK is not set
 CONFIG_SND_CA0106=m
 CONFIG_SND_CMIPCI=m
 CONFIG_SND_OXYGEN_LIB=m
@@ -3310,8 +3458,8 @@ CONFIG_SND_ES1968_INPUT=y
 CONFIG_SND_ES1968_RADIO=y
 CONFIG_SND_FM801=m
 CONFIG_SND_FM801_TEA575X_BOOL=y
-CONFIG_SND_TEA575X=m
 CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_HDA_PREALLOC_SIZE=64
 CONFIG_SND_HDA_HWDEP=y
 CONFIG_SND_HDA_RECONFIG=y
 CONFIG_SND_HDA_INPUT_BEEP=y
@@ -3319,6 +3467,7 @@ CONFIG_SND_HDA_INPUT_BEEP_MODE=1
 CONFIG_SND_HDA_INPUT_JACK=y
 # CONFIG_SND_HDA_PATCH_LOADER is not set
 CONFIG_SND_HDA_CODEC_REALTEK=y
+CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS=y
 CONFIG_SND_HDA_CODEC_ANALOG=y
 CONFIG_SND_HDA_CODEC_SIGMATEL=y
 CONFIG_SND_HDA_CODEC_VIA=y
@@ -3326,6 +3475,7 @@ CONFIG_SND_HDA_CODEC_HDMI=y
 CONFIG_SND_HDA_CODEC_CIRRUS=y
 CONFIG_SND_HDA_CODEC_CONEXANT=y
 CONFIG_SND_HDA_CODEC_CA0110=y
+CONFIG_SND_HDA_CODEC_CA0132=y
 CONFIG_SND_HDA_CODEC_CMEDIA=y
 CONFIG_SND_HDA_CODEC_SI3054=y
 CONFIG_SND_HDA_GENERIC=y
@@ -3361,142 +3511,70 @@ CONFIG_SND_USB_AUDIO=m
 CONFIG_SND_USB_UA101=m
 CONFIG_SND_USB_USX2Y=m
 CONFIG_SND_USB_CAIAQ=m
-# CONFIG_SND_USB_CAIAQ_INPUT is not set
+CONFIG_SND_USB_CAIAQ_INPUT=y
 CONFIG_SND_USB_US122L=m
 CONFIG_SND_USB_6FIRE=m
-# CONFIG_SND_FIREWIRE is not set
-CONFIG_SND_PCMCIA=y
-CONFIG_SND_VXPOCKET=m
-CONFIG_SND_PDAUDIOCF=m
-CONFIG_SND_SOC=m
-CONFIG_SND_SOC_CACHE_LZO=y
-CONFIG_SND_SOC_I2C_AND_SPI=m
-CONFIG_SND_SOC_ALL_CODECS=m
-CONFIG_SND_SOC_WM_HUBS=m
-CONFIG_SND_SOC_AD193X=m
-CONFIG_SND_SOC_AD73311=m
-CONFIG_SND_SOC_ADS117X=m
-CONFIG_SND_SOC_AK4535=m
-CONFIG_SND_SOC_AK4641=m
-CONFIG_SND_SOC_AK4642=m
-CONFIG_SND_SOC_AK4671=m
-CONFIG_SND_SOC_ALC5623=m
-CONFIG_SND_SOC_CS42L51=m
-CONFIG_SND_SOC_CS4270=m
-CONFIG_SND_SOC_CS4271=m
-CONFIG_SND_SOC_CX20442=m
-CONFIG_SND_SOC_L3=m
-CONFIG_SND_SOC_DA7210=m
-CONFIG_SND_SOC_DFBMCS320=m
-CONFIG_SND_SOC_MAX98088=m
-CONFIG_SND_SOC_MAX98095=m
-CONFIG_SND_SOC_MAX9850=m
-CONFIG_SND_SOC_PCM3008=m
-CONFIG_SND_SOC_SGTL5000=m
-CONFIG_SND_SOC_SPDIF=m
-CONFIG_SND_SOC_SSM2602=m
-CONFIG_SND_SOC_TLV320AIC23=m
-CONFIG_SND_SOC_TVL320AIC32X4=m
-CONFIG_SND_SOC_TLV320AIC3X=m
-CONFIG_SND_SOC_TLV320DAC33=m
-CONFIG_SND_SOC_UDA134X=m
-CONFIG_SND_SOC_UDA1380=m
-CONFIG_SND_SOC_WL1273=m
-CONFIG_SND_SOC_WM1250_EV1=m
-CONFIG_SND_SOC_WM8400=m
-CONFIG_SND_SOC_WM8510=m
-CONFIG_SND_SOC_WM8523=m
-CONFIG_SND_SOC_WM8580=m
-CONFIG_SND_SOC_WM8711=m
-CONFIG_SND_SOC_WM8727=m
-CONFIG_SND_SOC_WM8728=m
-CONFIG_SND_SOC_WM8731=m
-CONFIG_SND_SOC_WM8737=m
-CONFIG_SND_SOC_WM8741=m
-CONFIG_SND_SOC_WM8750=m
-CONFIG_SND_SOC_WM8753=m
-CONFIG_SND_SOC_WM8776=m
-CONFIG_SND_SOC_WM8804=m
-CONFIG_SND_SOC_WM8900=m
-CONFIG_SND_SOC_WM8903=m
-CONFIG_SND_SOC_WM8904=m
-CONFIG_SND_SOC_WM8915=m
-CONFIG_SND_SOC_WM8940=m
-CONFIG_SND_SOC_WM8955=m
-CONFIG_SND_SOC_WM8960=m
-CONFIG_SND_SOC_WM8961=m
-CONFIG_SND_SOC_WM8962=m
-CONFIG_SND_SOC_WM8971=m
-CONFIG_SND_SOC_WM8974=m
-CONFIG_SND_SOC_WM8978=m
-CONFIG_SND_SOC_WM8985=m
-CONFIG_SND_SOC_WM8988=m
-CONFIG_SND_SOC_WM8990=m
-CONFIG_SND_SOC_WM8991=m
-CONFIG_SND_SOC_WM8993=m
-CONFIG_SND_SOC_WM8995=m
-CONFIG_SND_SOC_WM9081=m
-CONFIG_SND_SOC_LM4857=m
-CONFIG_SND_SOC_MAX9877=m
-CONFIG_SND_SOC_TPA6130A2=m
-CONFIG_SND_SOC_WM2000=m
-CONFIG_SND_SOC_WM9090=m
+CONFIG_SND_FIREWIRE=y
+CONFIG_SND_FIREWIRE_LIB=m
+CONFIG_SND_FIREWIRE_SPEAKERS=m
+# CONFIG_SND_ISIGHT is not set
+# CONFIG_SND_SOC is not set
 # CONFIG_SOUND_PRIME is not set
 CONFIG_AC97_BUS=m
 CONFIG_HID_SUPPORT=y
-CONFIG_HID=m
+CONFIG_HID=y
 CONFIG_HIDRAW=y
 
 #
 # USB Input Devices
 #
-CONFIG_USB_HID=m
-# CONFIG_HID_PID is not set
+CONFIG_USB_HID=y
+CONFIG_HID_PID=y
 CONFIG_USB_HIDDEV=y
 
 #
 # Special HID drivers
 #
-CONFIG_HID_A4TECH=m
-CONFIG_HID_ACRUX=m
-# CONFIG_HID_ACRUX_FF is not set
-CONFIG_HID_APPLE=m
-CONFIG_HID_BELKIN=m
-CONFIG_HID_CHERRY=m
-CONFIG_HID_CHICONY=m
+CONFIG_HID_A4TECH=y
+# CONFIG_HID_ACRUX is not set
+CONFIG_HID_APPLE=y
+CONFIG_HID_BELKIN=y
+CONFIG_HID_CHERRY=y
+CONFIG_HID_CHICONY=y
 # CONFIG_HID_PRODIKEYS is not set
-CONFIG_HID_CYPRESS=m
-CONFIG_HID_DRAGONRISE=m
-# CONFIG_DRAGONRISE_FF is not set
+CONFIG_HID_CYPRESS=y
+# CONFIG_HID_DRAGONRISE is not set
 # CONFIG_HID_EMS_FF is not set
-CONFIG_HID_EZKEY=m
+# CONFIG_HID_ELECOM is not set
+CONFIG_HID_EZKEY=y
+# CONFIG_HID_HOLTEK is not set
 CONFIG_HID_KEYTOUCH=m
-CONFIG_HID_KYE=m
-CONFIG_HID_UCLOGIC=m
-CONFIG_HID_WALTOP=m
+CONFIG_HID_KYE=y
+# CONFIG_HID_UCLOGIC is not set
+# CONFIG_HID_WALTOP is not set
 CONFIG_HID_GYRATION=m
 CONFIG_HID_TWINHAN=m
-CONFIG_HID_KENSINGTON=m
+CONFIG_HID_KENSINGTON=y
 CONFIG_HID_LCPOWER=m
-CONFIG_HID_LOGITECH=m
+CONFIG_HID_LOGITECH=y
 # CONFIG_LOGITECH_FF is not set
 # CONFIG_LOGIRUMBLEPAD2_FF is not set
 # CONFIG_LOGIG940_FF is not set
 # CONFIG_LOGIWII_FF is not set
-CONFIG_HID_MICROSOFT=m
-CONFIG_HID_MONTEREY=m
-CONFIG_HID_MULTITOUCH=m
-CONFIG_HID_NTRIG=m
+# CONFIG_HID_MAGICMOUSE is not set
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_MONTEREY=y
+# CONFIG_HID_MULTITOUCH is not set
+# CONFIG_HID_NTRIG is not set
 CONFIG_HID_ORTEK=m
-CONFIG_HID_PANTHERLORD=m
-# CONFIG_PANTHERLORD_FF is not set
+# CONFIG_HID_PANTHERLORD is not set
 CONFIG_HID_PETALYNX=m
 CONFIG_HID_PICOLCD=m
 CONFIG_HID_PICOLCD_FB=y
 CONFIG_HID_PICOLCD_BACKLIGHT=y
 CONFIG_HID_PICOLCD_LCD=y
 CONFIG_HID_PICOLCD_LEDS=y
-CONFIG_HID_QUANTA=m
+# CONFIG_HID_QUANTA is not set
 CONFIG_HID_ROCCAT=m
 CONFIG_HID_ROCCAT_COMMON=m
 CONFIG_HID_ROCCAT_ARVO=m
@@ -3505,23 +3583,22 @@ CONFIG_HID_ROCCAT_KONEPLUS=m
 CONFIG_HID_ROCCAT_KOVAPLUS=m
 CONFIG_HID_ROCCAT_PYRA=m
 CONFIG_HID_SAMSUNG=m
-CONFIG_HID_SONY=m
+# CONFIG_HID_SONY is not set
+CONFIG_HID_SPEEDLINK=m
 CONFIG_HID_SUNPLUS=m
-CONFIG_HID_GREENASIA=m
-# CONFIG_GREENASIA_FF is not set
-CONFIG_HID_SMARTJOYPLUS=m
-# CONFIG_SMARTJOYPLUS_FF is not set
+# CONFIG_HID_GREENASIA is not set
+# CONFIG_HID_SMARTJOYPLUS is not set
 CONFIG_HID_TOPSEED=m
-CONFIG_HID_THRUSTMASTER=m
-# CONFIG_THRUSTMASTER_FF is not set
-CONFIG_HID_ZEROPLUS=m
-# CONFIG_ZEROPLUS_FF is not set
+# CONFIG_HID_THRUSTMASTER is not set
+# CONFIG_HID_WACOM is not set
+# CONFIG_HID_WIIMOTE is not set
+# CONFIG_HID_ZEROPLUS is not set
 CONFIG_HID_ZYDACRON=m
 CONFIG_USB_SUPPORT=y
 CONFIG_USB_ARCH_HAS_HCD=y
 CONFIG_USB_ARCH_HAS_OHCI=y
 CONFIG_USB_ARCH_HAS_EHCI=y
-CONFIG_USB=m
+CONFIG_USB=y
 # CONFIG_USB_DEBUG is not set
 CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 
@@ -3530,48 +3607,46 @@ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 #
 CONFIG_USB_DEVICEFS=y
 # CONFIG_USB_DEVICE_CLASS is not set
-CONFIG_USB_DYNAMIC_MINORS=y
-# CONFIG_USB_MON is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+CONFIG_USB_SUSPEND=y
+# CONFIG_USB_OTG is not set
+CONFIG_USB_MON=m
 CONFIG_USB_WUSB=m
-# CONFIG_USB_WUSB_CBAF is not set
+CONFIG_USB_WUSB_CBAF=m
+# CONFIG_USB_WUSB_CBAF_DEBUG is not set
 
 #
 # USB Host Controller Drivers
 #
-CONFIG_USB_C67X00_HCD=m
+# CONFIG_USB_C67X00_HCD is not set
 CONFIG_USB_XHCI_HCD=m
 # CONFIG_USB_XHCI_HCD_DEBUGGING is not set
-CONFIG_USB_EHCI_HCD=m
+CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_EHCI_TT_NEWSCHED=y
-CONFIG_USB_OXU210HP_HCD=m
-CONFIG_USB_ISP116X_HCD=m
-CONFIG_USB_ISP1760_HCD=m
+# CONFIG_USB_OXU210HP_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
 CONFIG_USB_ISP1362_HCD=m
-CONFIG_USB_OHCI_HCD=m
-CONFIG_USB_OHCI_HCD_SSB=y
+CONFIG_USB_OHCI_HCD=y
 # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
 # CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
 CONFIG_USB_OHCI_LITTLE_ENDIAN=y
-CONFIG_USB_UHCI_HCD=m
+CONFIG_USB_UHCI_HCD=y
+# CONFIG_USB_U132_HCD is not set
 CONFIG_USB_SL811_HCD=m
 CONFIG_USB_SL811_HCD_ISO=y
-CONFIG_USB_SL811_CS=m
-CONFIG_USB_R8A66597_HCD=m
+# CONFIG_USB_R8A66597_HCD is not set
 CONFIG_USB_WHCI_HCD=m
 CONFIG_USB_HWA_HCD=m
 
-#
-# Enable Host or Gadget support to see Inventra options
-#
-
 #
 # USB Device Class drivers
 #
 CONFIG_USB_ACM=m
 CONFIG_USB_PRINTER=m
 CONFIG_USB_WDM=m
-# CONFIG_USB_TMC is not set
+CONFIG_USB_TMC=m
 
 #
 # NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
@@ -3583,6 +3658,7 @@ CONFIG_USB_WDM=m
 CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_DEBUG is not set
 CONFIG_USB_STORAGE_REALTEK=m
+CONFIG_REALTEK_AUTOPM=y
 CONFIG_USB_STORAGE_DATAFAB=m
 CONFIG_USB_STORAGE_FREECOM=m
 CONFIG_USB_STORAGE_ISD200=m
@@ -3596,44 +3672,101 @@ CONFIG_USB_STORAGE_KARMA=m
 CONFIG_USB_STORAGE_CYPRESS_ATACB=m
 CONFIG_USB_STORAGE_ENE_UB6250=m
 CONFIG_USB_UAS=m
-CONFIG_USB_LIBUSUAL=y
+# CONFIG_USB_LIBUSUAL is not set
 
 #
 # USB Imaging devices
 #
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_MICROTEK is not set
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
 
 #
 # USB port drivers
 #
-# CONFIG_USB_USS720 is not set
-# CONFIG_USB_SERIAL is not set
+CONFIG_USB_USS720=m
+CONFIG_USB_SERIAL=m
+CONFIG_USB_EZUSB=y
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_AIRCABLE=m
+CONFIG_USB_SERIAL_ARK3116=m
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_CH341=m
+CONFIG_USB_SERIAL_WHITEHEAT=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_CP210X=m
+CONFIG_USB_SERIAL_CYPRESS_M8=m
+# CONFIG_USB_SERIAL_EMPEG is not set
+CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_FUNSOFT=m
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+CONFIG_USB_SERIAL_IR=m
+CONFIG_USB_SERIAL_EDGEPORT=m
+CONFIG_USB_SERIAL_EDGEPORT_TI=m
+# CONFIG_USB_SERIAL_GARMIN is not set
+CONFIG_USB_SERIAL_IPW=m
+CONFIG_USB_SERIAL_IUU=m
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+CONFIG_USB_SERIAL_KLSI=m
+# CONFIG_USB_SERIAL_KOBIL_SCT is not set
+CONFIG_USB_SERIAL_MCT_U232=m
+CONFIG_USB_SERIAL_MOS7720=m
+CONFIG_USB_SERIAL_MOS7715_PARPORT=y
+CONFIG_USB_SERIAL_MOS7840=m
+CONFIG_USB_SERIAL_MOTOROLA=m
+# CONFIG_USB_SERIAL_NAVMAN is not set
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_OTI6858=m
+CONFIG_USB_SERIAL_QCAUX=m
+CONFIG_USB_SERIAL_QUALCOMM=m
+CONFIG_USB_SERIAL_SPCP8X5=m
+# CONFIG_USB_SERIAL_HP4X is not set
+# CONFIG_USB_SERIAL_SAFE is not set
+CONFIG_USB_SERIAL_SIEMENS_MPI=m
+CONFIG_USB_SERIAL_SIERRAWIRELESS=m
+# CONFIG_USB_SERIAL_SYMBOL is not set
+# CONFIG_USB_SERIAL_TI is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_WWAN=m
+CONFIG_USB_SERIAL_OPTION=m
+# CONFIG_USB_SERIAL_OMNINET is not set
+# CONFIG_USB_SERIAL_OPTICON is not set
+# CONFIG_USB_SERIAL_VIVOPAY_SERIAL is not set
+# CONFIG_USB_SERIAL_ZIO is not set
+CONFIG_USB_SERIAL_SSU100=m
+# CONFIG_USB_SERIAL_DEBUG is not set
 
 #
 # USB Miscellaneous drivers
 #
-# CONFIG_USB_EMI62 is not set
-# CONFIG_USB_EMI26 is not set
-# CONFIG_USB_ADUTUX is not set
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
+CONFIG_USB_ADUTUX=m
 CONFIG_USB_SEVSEG=m
 # CONFIG_USB_RIO500 is not set
 # CONFIG_USB_LEGOTOWER is not set
-# CONFIG_USB_LCD is not set
-# CONFIG_USB_LED is not set
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
 # CONFIG_USB_CYPRESS_CY7C63 is not set
 # CONFIG_USB_CYTHERM is not set
 # CONFIG_USB_IDMOUSE is not set
-# CONFIG_USB_FTDI_ELAN is not set
+CONFIG_USB_FTDI_ELAN=m
 # CONFIG_USB_APPLEDISPLAY is not set
-# CONFIG_USB_SISUSBVGA is not set
+CONFIG_USB_SISUSBVGA=m
+CONFIG_USB_SISUSBVGA_CON=y
 # CONFIG_USB_LD is not set
 # CONFIG_USB_TRANCEVIBRATOR is not set
-# CONFIG_USB_IOWARRIOR is not set
+CONFIG_USB_IOWARRIOR=m
 # CONFIG_USB_TEST is not set
 # CONFIG_USB_ISIGHTFW is not set
 CONFIG_USB_YUREX=m
-# CONFIG_USB_ATM is not set
+CONFIG_USB_ATM=m
+CONFIG_USB_SPEEDTOUCH=m
+CONFIG_USB_CXACRU=m
+CONFIG_USB_UEAGLEATM=m
+CONFIG_USB_XUSBATM=m
 # CONFIG_USB_GADGET is not set
 
 #
@@ -3646,8 +3779,48 @@ CONFIG_UWB=m
 CONFIG_UWB_HWA=m
 CONFIG_UWB_WHCI=m
 CONFIG_UWB_I1480U=m
-# CONFIG_MMC is not set
-# CONFIG_MEMSTICK is not set
+CONFIG_MMC=m
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+# CONFIG_MMC_CLKGATE is not set
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=m
+CONFIG_MMC_BLOCK_MINORS=8
+CONFIG_MMC_BLOCK_BOUNCE=y
+CONFIG_SDIO_UART=m
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+CONFIG_MMC_SDHCI=m
+CONFIG_MMC_SDHCI_PCI=m
+CONFIG_MMC_RICOH_MMC=y
+CONFIG_MMC_SDHCI_PLTFM=m
+CONFIG_MMC_WBSD=m
+CONFIG_MMC_TIFM_SD=m
+CONFIG_MMC_CB710=m
+CONFIG_MMC_VIA_SDMMC=m
+CONFIG_MMC_VUB300=m
+CONFIG_MMC_USHC=m
+CONFIG_MEMSTICK=m
+# CONFIG_MEMSTICK_DEBUG is not set
+
+#
+# MemoryStick drivers
+#
+# CONFIG_MEMSTICK_UNSAFE_RESUME is not set
+CONFIG_MSPRO_BLOCK=m
+
+#
+# MemoryStick Host Controller Drivers
+#
+CONFIG_MEMSTICK_TIFM_MS=m
+CONFIG_MEMSTICK_JMICRON_38X=m
+CONFIG_MEMSTICK_R592=m
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
 
@@ -3656,18 +3829,14 @@ CONFIG_LEDS_CLASS=y
 #
 CONFIG_LEDS_LM3530=m
 CONFIG_LEDS_ALIX2=m
-CONFIG_LEDS_PCA9532=m
-CONFIG_LEDS_PCA9532_GPIO=y
-CONFIG_LEDS_GPIO=m
-CONFIG_LEDS_GPIO_PLATFORM=y
-CONFIG_LEDS_GPIO_OF=y
+# CONFIG_LEDS_PCA9532 is not set
+# CONFIG_LEDS_GPIO is not set
 CONFIG_LEDS_LP3944=m
 CONFIG_LEDS_LP5521=m
 CONFIG_LEDS_LP5523=m
-# CONFIG_LEDS_CLEVO_MAIL is not set
-CONFIG_LEDS_PCA955X=m
-CONFIG_LEDS_REGULATOR=m
-CONFIG_LEDS_BD2802=m
+CONFIG_LEDS_CLEVO_MAIL=m
+# CONFIG_LEDS_PCA955X is not set
+# CONFIG_LEDS_BD2802 is not set
 CONFIG_LEDS_INTEL_SS4200=m
 CONFIG_LEDS_LT3593=m
 CONFIG_LEDS_DELL_NETBOOKS=m
@@ -3676,8 +3845,8 @@ CONFIG_LEDS_TRIGGERS=y
 #
 # LED Triggers
 #
-# CONFIG_LEDS_TRIGGER_TIMER is not set
-# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
+CONFIG_LEDS_TRIGGER_TIMER=m
+CONFIG_LEDS_TRIGGER_HEARTBEAT=m
 CONFIG_LEDS_TRIGGER_BACKLIGHT=m
 CONFIG_LEDS_TRIGGER_GPIO=m
 CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
@@ -3685,10 +3854,33 @@ CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
 #
 # iptables trigger is under Netfilter config (LED target)
 #
-# CONFIG_NFC_DEVICES is not set
 # CONFIG_ACCESSIBILITY is not set
 # CONFIG_INFINIBAND is not set
-# CONFIG_EDAC is not set
+CONFIG_EDAC=y
+
+#
+# Reporting subsystems
+#
+# CONFIG_EDAC_DEBUG is not set
+CONFIG_EDAC_DECODE_MCE=m
+CONFIG_EDAC_MCE_INJ=m
+CONFIG_EDAC_MM_EDAC=m
+CONFIG_EDAC_MCE=y
+CONFIG_EDAC_AMD76X=m
+CONFIG_EDAC_E7XXX=m
+CONFIG_EDAC_E752X=m
+CONFIG_EDAC_I82875P=m
+CONFIG_EDAC_I82975X=m
+CONFIG_EDAC_I3000=m
+CONFIG_EDAC_I3200=m
+CONFIG_EDAC_X38=m
+CONFIG_EDAC_I5400=m
+CONFIG_EDAC_I7CORE=m
+CONFIG_EDAC_I82860=m
+CONFIG_EDAC_R82600=m
+CONFIG_EDAC_I5000=m
+CONFIG_EDAC_I5100=m
+CONFIG_EDAC_I7300=m
 CONFIG_RTC_LIB=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_HCTOSYS=y
@@ -3721,7 +3913,7 @@ CONFIG_RTC_DRV_PCF8583=m
 CONFIG_RTC_DRV_M41T80=m
 CONFIG_RTC_DRV_M41T80_WDT=y
 CONFIG_RTC_DRV_BQ32K=m
-CONFIG_RTC_DRV_S35390A=m
+# CONFIG_RTC_DRV_S35390A is not set
 CONFIG_RTC_DRV_FM3130=m
 CONFIG_RTC_DRV_RX8581=m
 CONFIG_RTC_DRV_RX8025=m
@@ -3741,14 +3933,13 @@ CONFIG_RTC_DRV_DS1511=m
 CONFIG_RTC_DRV_DS1553=m
 CONFIG_RTC_DRV_DS1742=m
 CONFIG_RTC_DRV_STK17TA8=m
-CONFIG_RTC_DRV_M48T86=m
+# CONFIG_RTC_DRV_M48T86 is not set
 CONFIG_RTC_DRV_M48T35=m
 CONFIG_RTC_DRV_M48T59=m
 CONFIG_RTC_DRV_MSM6242=m
 CONFIG_RTC_DRV_BQ4802=m
 CONFIG_RTC_DRV_RP5C01=m
 CONFIG_RTC_DRV_V3020=m
-CONFIG_RTC_DRV_PCF50633=m
 
 #
 # on-CPU RTC drivers
@@ -3759,7 +3950,7 @@ CONFIG_DMADEVICES=y
 #
 # DMA Devices
 #
-CONFIG_INTEL_MID_DMAC=m
+# CONFIG_INTEL_MID_DMAC is not set
 CONFIG_INTEL_IOATDMA=m
 CONFIG_TIMB_DMA=m
 CONFIG_PCH_DMA=m
@@ -3768,8 +3959,8 @@ CONFIG_DMA_ENGINE=y
 #
 # DMA Clients
 #
-# CONFIG_NET_DMA is not set
-# CONFIG_ASYNC_TX_DMA is not set
+CONFIG_NET_DMA=y
+CONFIG_ASYNC_TX_DMA=y
 # CONFIG_DMATEST is not set
 CONFIG_DCA=m
 # CONFIG_AUXDISPLAY is not set
@@ -3777,23 +3968,105 @@ CONFIG_UIO=m
 # CONFIG_UIO_CIF is not set
 # CONFIG_UIO_PDRV is not set
 # CONFIG_UIO_PDRV_GENIRQ is not set
-# CONFIG_UIO_AEC is not set
-# CONFIG_UIO_SERCOS3 is not set
+CONFIG_UIO_AEC=m
+CONFIG_UIO_SERCOS3=m
 CONFIG_UIO_PCI_GENERIC=m
-CONFIG_UIO_NETX=m
-# CONFIG_STAGING is not set
+# CONFIG_UIO_NETX is not set
+CONFIG_VIRTIO=m
+CONFIG_VIRTIO_RING=m
+
+#
+# Virtio drivers
+#
+CONFIG_VIRTIO_PCI=m
+CONFIG_VIRTIO_BALLOON=m
+CONFIG_STAGING=y
+CONFIG_ET131X=m
+# CONFIG_ET131X_DEBUG is not set
+# CONFIG_SLICOSS is not set
+# CONFIG_VIDEO_GO7007 is not set
+# CONFIG_VIDEO_CX25821 is not set
+# CONFIG_VIDEO_TM6000 is not set
+# CONFIG_DVB_CXD2099 is not set
+# CONFIG_USBIP_CORE is not set
+# CONFIG_W35UND is not set
+# CONFIG_PRISM2_USB is not set
+# CONFIG_ECHO is not set
+# CONFIG_BRCMUTIL is not set
+# CONFIG_BRCMSMAC is not set
+# CONFIG_BRCMFMAC is not set
+# CONFIG_COMEDI is not set
+# CONFIG_ASUS_OLED is not set
+# CONFIG_PANEL is not set
+# CONFIG_R8187SE is not set
+# CONFIG_RTL8192U is not set
+# CONFIG_RTL8192E is not set
+# CONFIG_R8712U is not set
+# CONFIG_RTS_PSTOR is not set
+# CONFIG_TRANZPORT is not set
+# CONFIG_POHMELFS is not set
+# CONFIG_IDE_PHISON is not set
+# CONFIG_LINE6_USB is not set
+CONFIG_DRM_VMWGFX=m
+CONFIG_DRM_NOUVEAU=m
+CONFIG_DRM_NOUVEAU_BACKLIGHT=y
+CONFIG_DRM_NOUVEAU_DEBUG=y
+
+#
+# I2C encoder or helper chips
+#
+# CONFIG_DRM_I2C_CH7006 is not set
+# CONFIG_DRM_I2C_SIL164 is not set
+# CONFIG_USB_SERIAL_QUATECH2 is not set
+# CONFIG_USB_SERIAL_QUATECH_USB2 is not set
+# CONFIG_VT6655 is not set
+# CONFIG_VT6656 is not set
+CONFIG_HYPERV=m
+CONFIG_HYPERV_STORAGE=m
+CONFIG_HYPERV_BLOCK=m
+CONFIG_HYPERV_NET=m
+CONFIG_HYPERV_UTILS=m
+CONFIG_HYPERV_MOUSE=m
+# CONFIG_VME_BUS is not set
+# CONFIG_DX_SEP is not set
+# CONFIG_IIO is not set
+# CONFIG_XVMALLOC is not set
+# CONFIG_ZRAM is not set
+# CONFIG_ZCACHE is not set
+# CONFIG_FB_SM7XX is not set
+# CONFIG_VIDEO_DT3155 is not set
+# CONFIG_CRYSTALHD is not set
+# CONFIG_FB_XGI is not set
+# CONFIG_LIRC_STAGING is not set
+# CONFIG_EASYCAP is not set
+# CONFIG_SOLO6X10 is not set
+# CONFIG_ACPI_QUICKSTART is not set
+# CONFIG_ATH6K_LEGACY is not set
+# CONFIG_USB_ENESTORAGE is not set
+# CONFIG_BCM_WIMAX is not set
+# CONFIG_FT1000 is not set
+
+#
+# Speakup console speech
+#
+# CONFIG_SPEAKUP is not set
+# CONFIG_TOUCHSCREEN_CLEARPAD_TM1217 is not set
+# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set
+# CONFIG_DRM_PSB is not set
+# CONFIG_ALTERA_STAPL is not set
+# CONFIG_INTEL_MEI is not set
 CONFIG_X86_PLATFORM_DEVICES=y
-# CONFIG_ACER_WMI is not set
+CONFIG_ACER_WMI=m
 CONFIG_ACERHDF=m
 CONFIG_ASUS_LAPTOP=m
-# CONFIG_DELL_LAPTOP is not set
+CONFIG_DELL_LAPTOP=m
 CONFIG_DELL_WMI=m
 CONFIG_DELL_WMI_AIO=m
 CONFIG_FUJITSU_LAPTOP=m
 # CONFIG_FUJITSU_LAPTOP_DEBUG is not set
 CONFIG_TC1100_WMI=m
 CONFIG_HP_ACCEL=m
-# CONFIG_HP_WMI is not set
+CONFIG_HP_WMI=m
 CONFIG_MSI_LAPTOP=m
 CONFIG_PANASONIC_LAPTOP=m
 CONFIG_COMPAL_LAPTOP=m
@@ -3808,22 +4081,35 @@ CONFIG_THINKPAD_ACPI_ALSA_SUPPORT=y
 CONFIG_THINKPAD_ACPI_VIDEO=y
 CONFIG_THINKPAD_ACPI_HOTKEY_POLL=y
 CONFIG_SENSORS_HDAPS=m
-CONFIG_INTEL_MENLOW=m
+# CONFIG_INTEL_MENLOW is not set
+CONFIG_EEEPC_LAPTOP=m
+CONFIG_ASUS_WMI=m
+CONFIG_ASUS_NB_WMI=m
+CONFIG_EEEPC_WMI=m
 CONFIG_ACPI_WMI=m
 CONFIG_MSI_WMI=m
-CONFIG_ACPI_ASUS=m
+# CONFIG_ACPI_ASUS is not set
 CONFIG_TOPSTAR_LAPTOP=m
 CONFIG_ACPI_TOSHIBA=m
 CONFIG_TOSHIBA_BT_RFKILL=m
 CONFIG_ACPI_CMPC=m
 CONFIG_INTEL_IPS=m
-CONFIG_IBM_RTL=m
-CONFIG_XO1_RFKILL=m
+# CONFIG_IBM_RTL is not set
 CONFIG_XO15_EBOOK=m
 CONFIG_SAMSUNG_LAPTOP=m
 CONFIG_MXM_WMI=m
 CONFIG_INTEL_OAKTRAIL=m
+CONFIG_SAMSUNG_Q10=m
 CONFIG_CLKSRC_I8253=y
+CONFIG_CLKEVT_I8253=y
+CONFIG_I8253_LOCK=y
+CONFIG_CLKBLD_I8253=y
+CONFIG_IOMMU_API=y
+CONFIG_IOMMU_SUPPORT=y
+CONFIG_DMAR=y
+CONFIG_DMAR_DEFAULT_ON=y
+CONFIG_DMAR_FLOPPY_WA=y
+CONFIG_VIRT_DRIVERS=y
 
 #
 # Firmware Drivers
@@ -3831,12 +4117,13 @@ CONFIG_CLKSRC_I8253=y
 CONFIG_EDD=m
 # CONFIG_EDD_OFF is not set
 CONFIG_FIRMWARE_MEMMAP=y
+CONFIG_EFI_VARS=y
 CONFIG_DELL_RBU=m
 CONFIG_DCDBAS=m
 CONFIG_DMIID=y
-CONFIG_DMI_SYSFS=m
+CONFIG_DMI_SYSFS=y
 # CONFIG_ISCSI_IBFT_FIND is not set
-CONFIG_SIGMA=m
+# CONFIG_SIGMA is not set
 # CONFIG_GOOGLE_FIRMWARE is not set
 
 #
@@ -3844,15 +4131,15 @@ CONFIG_SIGMA=m
 #
 # CONFIG_EXT2_FS is not set
 # CONFIG_EXT3_FS is not set
-CONFIG_EXT4_FS=m
+CONFIG_EXT4_FS=y
 CONFIG_EXT4_USE_FOR_EXT23=y
 CONFIG_EXT4_FS_XATTR=y
 CONFIG_EXT4_FS_POSIX_ACL=y
 CONFIG_EXT4_FS_SECURITY=y
 # CONFIG_EXT4_DEBUG is not set
-CONFIG_JBD2=m
+CONFIG_JBD2=y
 # CONFIG_JBD2_DEBUG is not set
-CONFIG_FS_MBCACHE=m
+CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 CONFIG_REISERFS_PROC_INFO=y
@@ -3871,19 +4158,20 @@ CONFIG_BTRFS_FS=m
 CONFIG_BTRFS_FS_POSIX_ACL=y
 # CONFIG_NILFS2_FS is not set
 CONFIG_FS_POSIX_ACL=y
-CONFIG_EXPORTFS=m
+CONFIG_EXPORTFS=y
 CONFIG_FILE_LOCKING=y
 CONFIG_FSNOTIFY=y
 CONFIG_DNOTIFY=y
 CONFIG_INOTIFY_USER=y
 CONFIG_FANOTIFY=y
-# CONFIG_FANOTIFY_ACCESS_PERMISSIONS is not set
+CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
 CONFIG_QUOTA=y
 CONFIG_QUOTA_NETLINK_INTERFACE=y
-CONFIG_PRINT_QUOTA_WARNING=y
+# CONFIG_PRINT_QUOTA_WARNING is not set
 # CONFIG_QUOTA_DEBUG is not set
+CONFIG_QUOTA_TREE=y
 # CONFIG_QFMT_V1 is not set
-# CONFIG_QFMT_V2 is not set
+CONFIG_QFMT_V2=y
 CONFIG_QUOTACTL=y
 CONFIG_AUTOFS4_FS=y
 CONFIG_FUSE_FS=m
@@ -3895,12 +4183,12 @@ CONFIG_GENERIC_ACL=y
 #
 CONFIG_FSCACHE=m
 CONFIG_FSCACHE_STATS=y
-CONFIG_FSCACHE_HISTOGRAM=y
+# CONFIG_FSCACHE_HISTOGRAM is not set
 # CONFIG_FSCACHE_DEBUG is not set
 # CONFIG_FSCACHE_OBJECT_LIST is not set
 CONFIG_CACHEFILES=m
 # CONFIG_CACHEFILES_DEBUG is not set
-CONFIG_CACHEFILES_HISTOGRAM=y
+# CONFIG_CACHEFILES_HISTOGRAM is not set
 
 #
 # CD-ROM/DVD Filesystems
@@ -3918,7 +4206,7 @@ CONFIG_FAT_FS=m
 CONFIG_MSDOS_FS=m
 CONFIG_VFAT_FS=m
 CONFIG_FAT_DEFAULT_CODEPAGE=437
-CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
 # CONFIG_NTFS_FS is not set
 
 #
@@ -3936,6 +4224,7 @@ CONFIG_CONFIGFS_FS=m
 CONFIG_MISC_FILESYSTEMS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
+# CONFIG_ECRYPT_FS is not set
 # CONFIG_HFS_FS is not set
 # CONFIG_HFSPLUS_FS is not set
 # CONFIG_BEFS_FS is not set
@@ -3943,12 +4232,7 @@ CONFIG_MISC_FILESYSTEMS=y
 # CONFIG_EFS_FS is not set
 # CONFIG_LOGFS is not set
 # CONFIG_CRAMFS is not set
-CONFIG_SQUASHFS=m
-CONFIG_SQUASHFS_XATTR=y
-CONFIG_SQUASHFS_LZO=y
-CONFIG_SQUASHFS_XZ=y
-# CONFIG_SQUASHFS_EMBEDDED is not set
-CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
+# CONFIG_SQUASHFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_OMFS_FS is not set
@@ -3963,28 +4247,40 @@ CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=m
 CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
-# CONFIG_NFS_V4 is not set
+CONFIG_NFS_V4=y
+CONFIG_NFS_V4_1=y
+CONFIG_PNFS_FILE_LAYOUT=m
+CONFIG_PNFS_BLOCK=m
+CONFIG_PNFS_OBJLAYOUT=m
 CONFIG_NFS_FSCACHE=y
+# CONFIG_NFS_USE_LEGACY_DNS is not set
+CONFIG_NFS_USE_KERNEL_DNS=y
+# CONFIG_NFS_USE_NEW_IDMAPPER is not set
 CONFIG_NFSD=m
-# CONFIG_NFSD_DEPRECATED is not set
 CONFIG_NFSD_V2_ACL=y
 CONFIG_NFSD_V3=y
 CONFIG_NFSD_V3_ACL=y
-# CONFIG_NFSD_V4 is not set
+CONFIG_NFSD_V4=y
 CONFIG_LOCKD=m
 CONFIG_LOCKD_V4=y
 CONFIG_NFS_ACL_SUPPORT=m
 CONFIG_NFS_COMMON=y
 CONFIG_SUNRPC=m
+CONFIG_SUNRPC_GSS=m
+CONFIG_SUNRPC_BACKCHANNEL=y
+CONFIG_RPCSEC_GSS_KRB5=m
 # CONFIG_CEPH_FS is not set
 CONFIG_CIFS=m
 CONFIG_CIFS_STATS=y
-CONFIG_CIFS_STATS2=y
+# CONFIG_CIFS_STATS2 is not set
 # CONFIG_CIFS_WEAK_PW_HASH is not set
+# CONFIG_CIFS_UPCALL is not set
 CONFIG_CIFS_XATTR=y
 CONFIG_CIFS_POSIX=y
 # CONFIG_CIFS_DEBUG2 is not set
-# CONFIG_CIFS_FSCACHE is not set
+CONFIG_CIFS_DFS_UPCALL=y
+CONFIG_CIFS_FSCACHE=y
+CONFIG_CIFS_ACL=y
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
 # CONFIG_AFS_FS is not set
@@ -3992,49 +4288,67 @@ CONFIG_CIFS_POSIX=y
 #
 # Partition Types
 #
-# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
 CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+CONFIG_LDM_PARTITION=y
+# CONFIG_LDM_DEBUG is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+CONFIG_EFI_PARTITION=y
+# CONFIG_SYSV68_PARTITION is not set
 CONFIG_NLS=y
-CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_DEFAULT="utf-8"
 CONFIG_NLS_CODEPAGE_437=y
-# CONFIG_NLS_CODEPAGE_737 is not set
-# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
-# CONFIG_NLS_CODEPAGE_855 is not set
-# CONFIG_NLS_CODEPAGE_857 is not set
-# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
-# CONFIG_NLS_CODEPAGE_862 is not set
-# CONFIG_NLS_CODEPAGE_863 is not set
-# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
-# CONFIG_NLS_CODEPAGE_869 is not set
-# CONFIG_NLS_CODEPAGE_936 is not set
-# CONFIG_NLS_CODEPAGE_950 is not set
-# CONFIG_NLS_CODEPAGE_932 is not set
-# CONFIG_NLS_CODEPAGE_949 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_ISO8859_8 is not set
-# CONFIG_NLS_CODEPAGE_1250 is not set
-# CONFIG_NLS_CODEPAGE_1251 is not set
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
 CONFIG_NLS_ASCII=y
-CONFIG_NLS_ISO8859_1=y
-# CONFIG_NLS_ISO8859_2 is not set
-# CONFIG_NLS_ISO8859_3 is not set
-# CONFIG_NLS_ISO8859_4 is not set
-# CONFIG_NLS_ISO8859_5 is not set
-# CONFIG_NLS_ISO8859_6 is not set
-# CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_9 is not set
-# CONFIG_NLS_ISO8859_13 is not set
-# CONFIG_NLS_ISO8859_14 is not set
-CONFIG_NLS_ISO8859_15=y
-# CONFIG_NLS_KOI8_R is not set
-# CONFIG_NLS_KOI8_U is not set
-CONFIG_NLS_UTF8=y
-# CONFIG_DLM is not set
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+CONFIG_DLM=m
+# CONFIG_DLM_DEBUG is not set
 
 #
 # Kernel hacking
@@ -4043,21 +4357,25 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
 CONFIG_PRINTK_TIME=y
 CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
 # CONFIG_ENABLE_WARN_DEPRECATED is not set
-# CONFIG_ENABLE_MUST_CHECK is not set
-CONFIG_FRAME_WARN=1024
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=2048
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_STRIP_ASM_SYMS=y
 # CONFIG_UNUSED_SYMBOLS is not set
 CONFIG_DEBUG_FS=y
-# CONFIG_HEADERS_CHECK is not set
+CONFIG_HEADERS_CHECK=y
 # CONFIG_DEBUG_SECTION_MISMATCH is not set
 CONFIG_DEBUG_KERNEL=y
-# CONFIG_DEBUG_SHIRQ is not set
-# CONFIG_LOCKUP_DETECTOR is not set
-# CONFIG_HARDLOCKUP_DETECTOR is not set
+CONFIG_DEBUG_SHIRQ=y
+CONFIG_LOCKUP_DETECTOR=y
+CONFIG_HARDLOCKUP_DETECTOR=y
+# CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=0
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
 # CONFIG_DETECT_HUNG_TASK is not set
-# CONFIG_SCHED_DEBUG is not set
-# CONFIG_SCHEDSTATS is not set
+CONFIG_SCHED_DEBUG=y
+CONFIG_SCHEDSTATS=y
 CONFIG_TIMER_STATS=y
 # CONFIG_DEBUG_OBJECTS is not set
 # CONFIG_SLUB_DEBUG_ON is not set
@@ -4071,24 +4389,26 @@ CONFIG_TIMER_STATS=y
 # CONFIG_PROVE_LOCKING is not set
 # CONFIG_SPARSE_RCU_POINTER is not set
 # CONFIG_LOCK_STAT is not set
-# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_ATOMIC_SLEEP is not set
 # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+CONFIG_STACKTRACE=y
 # CONFIG_DEBUG_STACK_USAGE is not set
 # CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_HIGHMEM is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_VIRTUAL is not set
 # CONFIG_DEBUG_WRITECOUNT is not set
 CONFIG_DEBUG_MEMORY_INIT=y
-# CONFIG_DEBUG_LIST is not set
+CONFIG_DEBUG_LIST=y
 # CONFIG_TEST_LIST_SORT is not set
 # CONFIG_DEBUG_SG is not set
 # CONFIG_DEBUG_NOTIFIERS is not set
 # CONFIG_DEBUG_CREDENTIALS is not set
 CONFIG_ARCH_WANT_FRAME_POINTERS=y
-# CONFIG_FRAME_POINTER is not set
-# CONFIG_BOOT_PRINTK_DELAY is not set
+CONFIG_FRAME_POINTER=y
+CONFIG_BOOT_PRINTK_DELAY=y
 # CONFIG_RCU_TORTURE_TEST is not set
 CONFIG_RCU_CPU_STALL_TIMEOUT=60
 # CONFIG_BACKTRACE_SELF_TEST is not set
@@ -4096,10 +4416,13 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=60
 # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
 # CONFIG_DEBUG_PER_CPU_MAPS is not set
 # CONFIG_LKDTM is not set
+# CONFIG_CPU_NOTIFIER_ERROR_INJECT is not set
 # CONFIG_FAULT_INJECTION is not set
 CONFIG_SYSCTL_SYSCALL_CHECK=y
 # CONFIG_DEBUG_PAGEALLOC is not set
 CONFIG_USER_STACKTRACE_SUPPORT=y
+CONFIG_NOP_TRACER=y
+CONFIG_HAVE_FTRACE_NMI_ENTER=y
 CONFIG_HAVE_FUNCTION_TRACER=y
 CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
 CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
@@ -4108,11 +4431,35 @@ CONFIG_HAVE_DYNAMIC_FTRACE=y
 CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
 CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
 CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_TRACER_MAX_TRACE=y
+CONFIG_RING_BUFFER=y
+CONFIG_FTRACE_NMI_ENTER=y
+CONFIG_EVENT_TRACING=y
+CONFIG_EVENT_POWER_TRACING_DEPRECATED=y
+CONFIG_CONTEXT_SWITCH_TRACER=y
+CONFIG_TRACING=y
+CONFIG_GENERIC_TRACER=y
 CONFIG_TRACING_SUPPORT=y
-# CONFIG_FTRACE is not set
+CONFIG_FTRACE=y
+CONFIG_FUNCTION_TRACER=y
+# CONFIG_IRQSOFF_TRACER is not set
+CONFIG_SCHED_TRACER=y
+CONFIG_FTRACE_SYSCALLS=y
+CONFIG_BRANCH_PROFILE_NONE=y
+# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
+# CONFIG_PROFILE_ALL_BRANCHES is not set
+CONFIG_STACK_TRACER=y
+CONFIG_BLK_DEV_IO_TRACE=y
+CONFIG_DYNAMIC_FTRACE=y
+CONFIG_FUNCTION_PROFILER=y
+CONFIG_FTRACE_MCOUNT_RECORD=y
+# CONFIG_FTRACE_STARTUP_TEST is not set
+# CONFIG_MMIOTRACE is not set
+CONFIG_RING_BUFFER_BENCHMARK=m
 # CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
 # CONFIG_FIREWIRE_OHCI_REMOTE_DMA is not set
-# CONFIG_DYNAMIC_DEBUG is not set
+# CONFIG_BUILD_DOCSRC is not set
+CONFIG_DYNAMIC_DEBUG=y
 # CONFIG_DMA_API_DEBUG is not set
 # CONFIG_ATOMIC64_SELFTEST is not set
 CONFIG_ASYNC_RAID6_TEST=m
@@ -4125,9 +4472,9 @@ CONFIG_STRICT_DEVMEM=y
 CONFIG_X86_VERBOSE_BOOTUP=y
 CONFIG_EARLY_PRINTK=y
 # CONFIG_EARLY_PRINTK_DBGP is not set
-# CONFIG_DEBUG_STACKOVERFLOW is not set
+CONFIG_DEBUG_STACKOVERFLOW=y
 # CONFIG_X86_PTDUMP is not set
-# CONFIG_DEBUG_NX_TEST is not set
+CONFIG_DEBUG_NX_TEST=m
 CONFIG_DOUBLEFAULT=y
 # CONFIG_IOMMU_STRESS is not set
 CONFIG_HAVE_MMIOTRACE_SUPPORT=y
@@ -4140,7 +4487,7 @@ CONFIG_IO_DELAY_0X80=y
 # CONFIG_IO_DELAY_UDELAY is not set
 # CONFIG_IO_DELAY_NONE is not set
 CONFIG_DEFAULT_IO_DELAY_TYPE=0
-# CONFIG_DEBUG_BOOT_PARAMS is not set
+CONFIG_DEBUG_BOOT_PARAMS=y
 # CONFIG_CPA_DEBUG is not set
 CONFIG_OPTIMIZE_INLINING=y
 # CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
@@ -4220,7 +4567,7 @@ CONFIG_GRKERNSEC_FORKFAIL=y
 CONFIG_GRKERNSEC_TIME=y
 CONFIG_GRKERNSEC_PROC_IPADDR=y
 CONFIG_GRKERNSEC_RWXMAP_LOG=y
-# CONFIG_GRKERNSEC_AUDIT_TEXTREL is not set
+CONFIG_GRKERNSEC_AUDIT_TEXTREL=y
 
 #
 # Executable Protections
@@ -4246,7 +4593,7 @@ CONFIG_GRKERNSEC_SYSCTL_ON=y
 # Logging Options
 #
 CONFIG_GRKERNSEC_FLOODTIME=10
-CONFIG_GRKERNSEC_FLOODBURST=4
+CONFIG_GRKERNSEC_FLOODBURST=6
 
 #
 # PaX
@@ -4293,7 +4640,8 @@ CONFIG_PAX_MEMORY_STACKLEAK=y
 CONFIG_PAX_MEMORY_UDEREF=y
 CONFIG_PAX_REFCOUNT=y
 CONFIG_PAX_USERCOPY=y
-# CONFIG_KEYS is not set
+CONFIG_KEYS=y
+CONFIG_KEYS_DEBUG_PROC_KEYS=y
 CONFIG_SECURITY_DMESG_RESTRICT=y
 CONFIG_SECURITY=y
 CONFIG_SECURITYFS=y
@@ -4313,9 +4661,9 @@ CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
 # CONFIG_SECURITY_TOMOYO is not set
 # CONFIG_SECURITY_APPARMOR is not set
 # CONFIG_IMA is not set
-# CONFIG_DEFAULT_SECURITY_SELINUX is not set
-CONFIG_DEFAULT_SECURITY_DAC=y
-CONFIG_DEFAULT_SECURITY=""
+CONFIG_DEFAULT_SECURITY_SELINUX=y
+# CONFIG_DEFAULT_SECURITY_DAC is not set
+CONFIG_DEFAULT_SECURITY="selinux"
 CONFIG_XOR_BLOCKS=m
 CONFIG_ASYNC_CORE=m
 CONFIG_ASYNC_MEMCPY=m
@@ -4329,59 +4677,60 @@ CONFIG_CRYPTO=y
 #
 # Crypto core or helper
 #
+CONFIG_CRYPTO_FIPS=y
 CONFIG_CRYPTO_ALGAPI=y
 CONFIG_CRYPTO_ALGAPI2=y
-CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD=y
 CONFIG_CRYPTO_AEAD2=y
-CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_BLKCIPHER2=y
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_HASH2=y
-CONFIG_CRYPTO_RNG=m
+CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_PCOMP=m
 CONFIG_CRYPTO_PCOMP2=y
-CONFIG_CRYPTO_MANAGER=m
+CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_MANAGER2=y
-CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
+# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
 CONFIG_CRYPTO_GF128MUL=m
 # CONFIG_CRYPTO_NULL is not set
 CONFIG_CRYPTO_PCRYPT=m
 CONFIG_CRYPTO_WORKQUEUE=y
-CONFIG_CRYPTO_CRYPTD=m
+CONFIG_CRYPTO_CRYPTD=y
 CONFIG_CRYPTO_AUTHENC=m
-# CONFIG_CRYPTO_TEST is not set
+CONFIG_CRYPTO_TEST=m
 
 #
 # Authenticated Encryption with Associated Data
 #
 CONFIG_CRYPTO_CCM=m
 CONFIG_CRYPTO_GCM=m
-CONFIG_CRYPTO_SEQIV=m
+CONFIG_CRYPTO_SEQIV=y
 
 #
 # Block modes
 #
-CONFIG_CRYPTO_CBC=m
-CONFIG_CRYPTO_CTR=m
-# CONFIG_CRYPTO_CTS is not set
-CONFIG_CRYPTO_ECB=m
-# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_CTR=y
+CONFIG_CRYPTO_CTS=m
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_LRW=m
 CONFIG_CRYPTO_PCBC=m
-# CONFIG_CRYPTO_XTS is not set
+CONFIG_CRYPTO_XTS=m
 
 #
 # Hash modes
 #
-CONFIG_CRYPTO_HMAC=m
-# CONFIG_CRYPTO_XCBC is not set
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_XCBC=m
 CONFIG_CRYPTO_VMAC=m
 
 #
 # Digest
 #
-CONFIG_CRYPTO_CRC32C=m
-CONFIG_CRYPTO_CRC32C_INTEL=m
+CONFIG_CRYPTO_CRC32C=y
+CONFIG_CRYPTO_CRC32C_INTEL=y
 CONFIG_CRYPTO_GHASH=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=y
@@ -4393,29 +4742,29 @@ CONFIG_CRYPTO_RMD320=m
 CONFIG_CRYPTO_SHA1=m
 CONFIG_CRYPTO_SHA256=y
 CONFIG_CRYPTO_SHA512=m
-# CONFIG_CRYPTO_TGR192 is not set
-# CONFIG_CRYPTO_WP512 is not set
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_WP512=m
 
 #
 # Ciphers
 #
-CONFIG_CRYPTO_AES=m
-CONFIG_CRYPTO_AES_586=m
-CONFIG_CRYPTO_AES_NI_INTEL=m
-# CONFIG_CRYPTO_ANUBIS is not set
+CONFIG_CRYPTO_AES=y
+CONFIG_CRYPTO_AES_586=y
+CONFIG_CRYPTO_AES_NI_INTEL=y
+CONFIG_CRYPTO_ANUBIS=m
 CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_BLOWFISH=m
-# CONFIG_CRYPTO_CAMELLIA is not set
+CONFIG_CRYPTO_CAMELLIA=m
 CONFIG_CRYPTO_CAST5=m
 CONFIG_CRYPTO_CAST6=m
 CONFIG_CRYPTO_DES=m
-# CONFIG_CRYPTO_FCRYPT is not set
-# CONFIG_CRYPTO_KHAZAD is not set
-# CONFIG_CRYPTO_SALSA20 is not set
-# CONFIG_CRYPTO_SALSA20_586 is not set
-# CONFIG_CRYPTO_SEED is not set
+CONFIG_CRYPTO_FCRYPT=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_SALSA20=m
+CONFIG_CRYPTO_SALSA20_586=m
+CONFIG_CRYPTO_SEED=m
 CONFIG_CRYPTO_SERPENT=m
-# CONFIG_CRYPTO_TEA is not set
+CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_TWOFISH_COMMON=m
 CONFIG_CRYPTO_TWOFISH_586=m
@@ -4431,9 +4780,9 @@ CONFIG_CRYPTO_LZO=m
 # Random Number Generation
 #
 CONFIG_CRYPTO_ANSI_CPRNG=m
-CONFIG_CRYPTO_USER_API=m
-CONFIG_CRYPTO_USER_API_HASH=m
-CONFIG_CRYPTO_USER_API_SKCIPHER=m
+CONFIG_CRYPTO_USER_API=y
+CONFIG_CRYPTO_USER_API_HASH=y
+CONFIG_CRYPTO_USER_API_SKCIPHER=y
 CONFIG_CRYPTO_HW=y
 CONFIG_CRYPTO_DEV_PADLOCK=m
 CONFIG_CRYPTO_DEV_PADLOCK_AES=m
@@ -4451,13 +4800,10 @@ CONFIG_VIRTUALIZATION=y
 CONFIG_KVM=m
 CONFIG_KVM_INTEL=m
 CONFIG_KVM_AMD=m
+CONFIG_KVM_MMU_AUDIT=y
 CONFIG_VHOST_NET=m
-CONFIG_LGUEST=m
-CONFIG_VIRTIO=m
-CONFIG_VIRTIO_RING=m
-CONFIG_VIRTIO_PCI=m
-CONFIG_VIRTIO_BALLOON=m
-# CONFIG_BINARY_PRINTF is not set
+# CONFIG_LGUEST is not set
+CONFIG_BINARY_PRINTF=y
 
 #
 # Library routines
@@ -4466,16 +4812,17 @@ CONFIG_RAID6_PQ=m
 CONFIG_BITREVERSE=y
 CONFIG_GENERIC_FIND_FIRST_BIT=y
 CONFIG_CRC_CCITT=m
-CONFIG_CRC16=m
+CONFIG_CRC16=y
 CONFIG_CRC_T10DIF=m
 CONFIG_CRC_ITU_T=m
 CONFIG_CRC32=y
 CONFIG_CRC7=m
 CONFIG_LIBCRC32C=m
+CONFIG_CRC8=m
 CONFIG_AUDIT_GENERIC=y
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=m
-CONFIG_LZO_COMPRESS=m
+CONFIG_LZO_COMPRESS=y
 CONFIG_LZO_DECOMPRESS=y
 CONFIG_XZ_DEC=y
 CONFIG_XZ_DEC_X86=y
@@ -4491,6 +4838,7 @@ CONFIG_DECOMPRESS_BZIP2=y
 CONFIG_DECOMPRESS_LZMA=y
 CONFIG_DECOMPRESS_XZ=y
 CONFIG_DECOMPRESS_LZO=y
+CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_TEXTSEARCH=y
 CONFIG_TEXTSEARCH_KMP=m
 CONFIG_TEXTSEARCH_BM=m
@@ -4502,3 +4850,5 @@ CONFIG_CHECK_SIGNATURE=y
 CONFIG_CPU_RMAP=y
 CONFIG_NLATTR=y
 CONFIG_AVERAGE=y
+CONFIG_CORDIC=m
+CONFIG_LLIST=y
diff --git a/kernel/config.i686-PAE b/kernel/config.i686-PAE
new file mode 100644 (file)
index 0000000..6344c96
--- /dev/null
@@ -0,0 +1,4870 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Linux/i386 3.1.1-1.ip3.i686.PAE Kernel Configuration
+#
+# CONFIG_64BIT is not set
+CONFIG_X86_32=y
+# CONFIG_X86_64 is not set
+CONFIG_X86=y
+CONFIG_INSTRUCTION_DECODER=y
+CONFIG_OUTPUT_FORMAT="elf32-i386"
+CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig"
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_CLOCKSOURCE_WATCHDOG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_MMU=y
+CONFIG_ZONE_DMA=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NEED_SG_DMA_LENGTH=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_GENERIC_IOMAP=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+# CONFIG_GENERIC_TIME_VSYSCALL is not set
+CONFIG_ARCH_HAS_CPU_RELAX=y
+CONFIG_ARCH_HAS_DEFAULT_IDLE=y
+CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
+CONFIG_HAVE_SETUP_PER_CPU_AREA=y
+CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
+CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
+# CONFIG_HAVE_CPUMASK_OF_CPU_MAP is not set
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+# CONFIG_ZONE_DMA32 is not set
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+# CONFIG_AUDIT_ARCH is not set
+CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
+CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
+CONFIG_HAVE_INTEL_TXT=y
+CONFIG_X86_32_SMP=y
+CONFIG_X86_HT=y
+CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-ecx -fcall-saved-edx"
+CONFIG_KTIME_SCALAR=y
+CONFIG_ARCH_CPU_PROBE_RELEASE=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_HAVE_IRQ_WORK=y
+CONFIG_IRQ_WORK=y
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_CROSS_COMPILE=""
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_HAVE_KERNEL_GZIP=y
+CONFIG_HAVE_KERNEL_BZIP2=y
+CONFIG_HAVE_KERNEL_LZMA=y
+CONFIG_HAVE_KERNEL_XZ=y
+CONFIG_HAVE_KERNEL_LZO=y
+# CONFIG_KERNEL_GZIP is not set
+# CONFIG_KERNEL_BZIP2 is not set
+# CONFIG_KERNEL_LZMA is not set
+CONFIG_KERNEL_XZ=y
+# CONFIG_KERNEL_LZO is not set
+CONFIG_DEFAULT_HOSTNAME="(none)"
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_POSIX_MQUEUE_SYSCTL=y
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+CONFIG_FHANDLE=y
+CONFIG_TASKSTATS=y
+CONFIG_TASK_DELAY_ACCT=y
+CONFIG_TASK_XACCT=y
+CONFIG_TASK_IO_ACCOUNTING=y
+CONFIG_AUDIT=y
+CONFIG_AUDITSYSCALL=y
+CONFIG_AUDIT_WATCH=y
+CONFIG_AUDIT_TREE=y
+CONFIG_HAVE_GENERIC_HARDIRQS=y
+
+#
+# IRQ subsystem
+#
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_HAVE_SPARSE_IRQ=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_PENDING_IRQ=y
+CONFIG_IRQ_FORCED_THREADING=y
+# CONFIG_SPARSE_IRQ is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_TREE_RCU=y
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_RCU_TRACE is not set
+CONFIG_RCU_FANOUT=32
+# CONFIG_RCU_FANOUT_EXACT is not set
+CONFIG_RCU_FAST_NO_HZ=y
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=18
+CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
+CONFIG_CGROUPS=y
+# CONFIG_CGROUP_DEBUG is not set
+CONFIG_CGROUP_FREEZER=y
+CONFIG_CGROUP_DEVICE=y
+CONFIG_CPUSETS=y
+CONFIG_PROC_PID_CPUSET=y
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_RESOURCE_COUNTERS=y
+CONFIG_CGROUP_MEM_RES_CTLR=y
+CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
+# CONFIG_CGROUP_MEM_RES_CTLR_SWAP_ENABLED is not set
+CONFIG_CGROUP_PERF=y
+CONFIG_CGROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_RT_GROUP_SCHED=y
+CONFIG_BLK_CGROUP=y
+# CONFIG_DEBUG_BLK_CGROUP is not set
+CONFIG_NAMESPACES=y
+CONFIG_UTS_NS=y
+CONFIG_IPC_NS=y
+CONFIG_USER_NS=y
+CONFIG_PID_NS=y
+CONFIG_NET_NS=y
+CONFIG_SCHED_AUTOGROUP=y
+CONFIG_MM_OWNER=y
+# CONFIG_SYSFS_DEPRECATED is not set
+CONFIG_RELAY=y
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
+CONFIG_RD_XZ=y
+CONFIG_RD_LZO=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+# CONFIG_EXPERT is not set
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_PCSPKR_PLATFORM=y
+CONFIG_HAVE_PCSPKR_PLATFORM=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+# CONFIG_EMBEDDED is not set
+CONFIG_HAVE_PERF_EVENTS=y
+
+#
+# Kernel Performance Events And Counters
+#
+CONFIG_PERF_EVENTS=y
+CONFIG_PERF_COUNTERS=y
+# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_PCI_QUIRKS=y
+CONFIG_SLUB_DEBUG=y
+# CONFIG_COMPAT_BRK is not set
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_PROFILING is not set
+CONFIG_TRACEPOINTS=y
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_JUMP_LABEL=y
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_USER_RETURN_NOTIFIER=y
+CONFIG_HAVE_IOREMAP_PROT=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_OPTPROBES=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+CONFIG_HAVE_DMA_ATTRS=y
+CONFIG_USE_GENERIC_SMP_HELPERS=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_HW_BREAKPOINT=y
+CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
+CONFIG_HAVE_USER_RETURN_NOTIFIER=y
+CONFIG_HAVE_PERF_EVENTS_NMI=y
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
+
+#
+# GCOV-based kernel profiling
+#
+# CONFIG_GCOV_KERNEL is not set
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_STOP_MACHINE=y
+CONFIG_BLOCK=y
+CONFIG_LBDAF=y
+CONFIG_BLK_DEV_BSG=y
+CONFIG_BLK_DEV_BSGLIB=y
+CONFIG_BLK_DEV_INTEGRITY=y
+CONFIG_BLK_DEV_THROTTLING=y
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_CFQ_GROUP_IOSCHED=y
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+CONFIG_PREEMPT_NOTIFIERS=y
+CONFIG_PADATA=y
+# CONFIG_INLINE_SPIN_TRYLOCK is not set
+# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK is not set
+# CONFIG_INLINE_SPIN_LOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
+CONFIG_INLINE_SPIN_UNLOCK=y
+# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
+CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
+# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_READ_TRYLOCK is not set
+# CONFIG_INLINE_READ_LOCK is not set
+# CONFIG_INLINE_READ_LOCK_BH is not set
+# CONFIG_INLINE_READ_LOCK_IRQ is not set
+# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
+CONFIG_INLINE_READ_UNLOCK=y
+# CONFIG_INLINE_READ_UNLOCK_BH is not set
+CONFIG_INLINE_READ_UNLOCK_IRQ=y
+# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_WRITE_TRYLOCK is not set
+# CONFIG_INLINE_WRITE_LOCK is not set
+# CONFIG_INLINE_WRITE_LOCK_BH is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
+CONFIG_INLINE_WRITE_UNLOCK=y
+# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
+CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
+# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
+CONFIG_MUTEX_SPIN_ON_OWNER=y
+CONFIG_FREEZER=y
+
+#
+# Processor type and features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_SMP=y
+CONFIG_X86_MPPARSE=y
+CONFIG_X86_BIGSMP=y
+CONFIG_X86_EXTENDED_PLATFORM=y
+# CONFIG_X86_INTEL_MID is not set
+# CONFIG_X86_RDC321X is not set
+# CONFIG_X86_32_NON_STANDARD is not set
+CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
+# CONFIG_X86_32_IRIS is not set
+CONFIG_SCHED_OMIT_FRAME_POINTER=y
+CONFIG_PARAVIRT_GUEST=y
+CONFIG_PARAVIRT_TIME_ACCOUNTING=y
+# CONFIG_XEN is not set
+# CONFIG_XEN_PRIVILEGED_GUEST is not set
+CONFIG_KVM_CLOCK=y
+CONFIG_KVM_GUEST=y
+# CONFIG_LGUEST_GUEST is not set
+CONFIG_PARAVIRT=y
+# CONFIG_PARAVIRT_SPINLOCKS is not set
+CONFIG_PARAVIRT_CLOCK=y
+# CONFIG_PARAVIRT_DEBUG is not set
+CONFIG_NO_BOOTMEM=y
+# CONFIG_MEMTEST is not set
+# CONFIG_M386 is not set
+# CONFIG_M486 is not set
+# CONFIG_M586 is not set
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+CONFIG_M686=y
+# CONFIG_MPENTIUMII is not set
+# CONFIG_MPENTIUMIII is not set
+# CONFIG_MPENTIUMM is not set
+# CONFIG_MPENTIUM4 is not set
+# CONFIG_MK6 is not set
+# CONFIG_MK7 is not set
+# CONFIG_MK8 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MEFFICEON is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MELAN is not set
+# CONFIG_MGEODEGX1 is not set
+# CONFIG_MGEODE_LX is not set
+# CONFIG_MCYRIXIII is not set
+# CONFIG_MVIAC3_2 is not set
+# CONFIG_MVIAC7 is not set
+# CONFIG_MCORE2 is not set
+# CONFIG_MATOM is not set
+CONFIG_X86_GENERIC=y
+CONFIG_X86_INTERNODE_CACHE_SHIFT=7
+CONFIG_X86_CMPXCHG=y
+CONFIG_CMPXCHG_LOCAL=y
+CONFIG_CMPXCHG_DOUBLE=y
+CONFIG_X86_L1_CACHE_SHIFT=6
+CONFIG_X86_XADD=y
+CONFIG_X86_PPRO_FENCE=y
+CONFIG_X86_WP_WORKS_OK=y
+CONFIG_X86_INVLPG=y
+CONFIG_X86_BSWAP=y
+CONFIG_X86_POPAD_OK=y
+CONFIG_X86_ALIGNMENT_16=y
+CONFIG_X86_INTEL_USERCOPY=y
+CONFIG_X86_USE_PPRO_CHECKSUM=y
+CONFIG_X86_TSC=y
+CONFIG_X86_CMPXCHG64=y
+CONFIG_X86_CMOV=y
+CONFIG_X86_MINIMUM_CPU_FAMILY=5
+CONFIG_X86_DEBUGCTLMSR=y
+CONFIG_CPU_SUP_INTEL=y
+CONFIG_CPU_SUP_CYRIX_32=y
+CONFIG_CPU_SUP_AMD=y
+CONFIG_CPU_SUP_CENTAUR=y
+CONFIG_CPU_SUP_TRANSMETA_32=y
+CONFIG_CPU_SUP_UMC_32=y
+CONFIG_HPET_TIMER=y
+CONFIG_HPET_EMULATE_RTC=y
+CONFIG_DMI=y
+# CONFIG_IOMMU_HELPER is not set
+CONFIG_NR_CPUS=256
+CONFIG_SCHED_SMT=y
+CONFIG_SCHED_MC=y
+CONFIG_IRQ_TIME_ACCOUNTING=y
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_X86_LOCAL_APIC=y
+CONFIG_X86_IO_APIC=y
+CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y
+CONFIG_X86_MCE=y
+CONFIG_X86_MCE_INTEL=y
+CONFIG_X86_MCE_AMD=y
+# CONFIG_X86_ANCIENT_MCE is not set
+CONFIG_X86_MCE_THRESHOLD=y
+# CONFIG_X86_MCE_INJECT is not set
+CONFIG_X86_THERMAL_VECTOR=y
+CONFIG_VM86=y
+CONFIG_TOSHIBA=m
+CONFIG_I8K=m
+# CONFIG_X86_REBOOTFIXUPS is not set
+CONFIG_MICROCODE=m
+CONFIG_MICROCODE_INTEL=y
+CONFIG_MICROCODE_AMD=y
+CONFIG_MICROCODE_OLD_INTERFACE=y
+CONFIG_X86_MSR=y
+CONFIG_X86_CPUID=y
+# CONFIG_NOHIGHMEM is not set
+# CONFIG_HIGHMEM4G is not set
+CONFIG_HIGHMEM64G=y
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_HIGHMEM=y
+CONFIG_X86_PAE=y
+CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
+CONFIG_ARCH_DMA_ADDR_T_64BIT=y
+CONFIG_NUMA=y
+# CONFIG_NUMA_EMU is not set
+CONFIG_NODES_SHIFT=3
+CONFIG_HAVE_ARCH_BOOTMEM=y
+CONFIG_HAVE_ARCH_ALLOC_REMAP=y
+CONFIG_ARCH_HAVE_MEMORY_PRESENT=y
+CONFIG_NEED_NODE_MEMMAP_SIZE=y
+CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
+CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_ILLEGAL_POINTER_VALUE=0
+CONFIG_SELECT_MEMORY_MODEL=y
+# CONFIG_FLATMEM_MANUAL is not set
+CONFIG_DISCONTIGMEM_MANUAL=y
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_DISCONTIGMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_NEED_MULTIPLE_NODES=y
+CONFIG_HAVE_MEMORY_PRESENT=y
+CONFIG_SPARSEMEM_STATIC=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_COMPACTION=y
+CONFIG_MIGRATION=y
+CONFIG_PHYS_ADDR_T_64BIT=y
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_MMU_NOTIFIER=y
+CONFIG_KSM=y
+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
+CONFIG_MEMORY_FAILURE=y
+# CONFIG_HWPOISON_INJECT is not set
+CONFIG_TRANSPARENT_HUGEPAGE=y
+CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
+# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set
+CONFIG_CLEANCACHE=y
+CONFIG_HIGHPTE=y
+# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
+CONFIG_X86_RESERVE_LOW=64
+# CONFIG_MATH_EMULATION is not set
+CONFIG_MTRR=y
+CONFIG_MTRR_SANITIZER=y
+CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=1
+CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
+CONFIG_X86_PAT=y
+CONFIG_ARCH_USES_PG_UNCACHED=y
+CONFIG_EFI=y
+CONFIG_SECCOMP=y
+# CONFIG_HZ_100 is not set
+# CONFIG_HZ_250 is not set
+CONFIG_HZ_300=y
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=300
+CONFIG_SCHED_HRTICK=y
+CONFIG_KEXEC=y
+CONFIG_CRASH_DUMP=y
+# CONFIG_KEXEC_JUMP is not set
+CONFIG_PHYSICAL_START=0x400000
+CONFIG_RELOCATABLE=y
+CONFIG_X86_NEED_RELOCS=y
+CONFIG_PHYSICAL_ALIGN=0x400000
+CONFIG_HOTPLUG_CPU=y
+# CONFIG_CMDLINE_BOOL is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_USE_PERCPU_NUMA_NODE_ID=y
+
+#
+# Power management and ACPI options
+#
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_HIBERNATE_CALLBACKS=y
+CONFIG_HIBERNATION=y
+CONFIG_PM_STD_PARTITION=""
+CONFIG_PM_SLEEP=y
+CONFIG_PM_SLEEP_SMP=y
+CONFIG_PM_RUNTIME=y
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_ACPI=y
+CONFIG_ACPI_SLEEP=y
+CONFIG_ACPI_PROCFS=y
+CONFIG_ACPI_PROCFS_POWER=y
+CONFIG_ACPI_EC_DEBUGFS=m
+# CONFIG_ACPI_PROC_EVENT is not set
+CONFIG_ACPI_AC=y
+CONFIG_ACPI_BATTERY=y
+CONFIG_ACPI_BUTTON=y
+CONFIG_ACPI_VIDEO=m
+CONFIG_ACPI_FAN=y
+CONFIG_ACPI_DOCK=y
+CONFIG_ACPI_PROCESSOR=y
+CONFIG_ACPI_IPMI=m
+CONFIG_ACPI_HOTPLUG_CPU=y
+CONFIG_ACPI_PROCESSOR_AGGREGATOR=m
+CONFIG_ACPI_THERMAL=y
+# CONFIG_ACPI_NUMA is not set
+# CONFIG_ACPI_CUSTOM_DSDT is not set
+CONFIG_ACPI_BLACKLIST_YEAR=1999
+# CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_PCI_SLOT=y
+CONFIG_X86_PM_TIMER=y
+CONFIG_ACPI_CONTAINER=y
+CONFIG_ACPI_SBS=m
+CONFIG_ACPI_HED=y
+CONFIG_ACPI_CUSTOM_METHOD=m
+CONFIG_ACPI_APEI=y
+CONFIG_ACPI_APEI_GHES=y
+CONFIG_ACPI_APEI_PCIEAER=y
+CONFIG_ACPI_APEI_MEMORY_FAILURE=y
+# CONFIG_ACPI_APEI_EINJ is not set
+# CONFIG_ACPI_APEI_ERST_DEBUG is not set
+CONFIG_SFI=y
+CONFIG_X86_APM_BOOT=y
+CONFIG_APM=y
+# CONFIG_APM_IGNORE_USER_SUSPEND is not set
+# CONFIG_APM_DO_ENABLE is not set
+CONFIG_APM_CPU_IDLE=y
+# CONFIG_APM_DISPLAY_BLANK is not set
+# CONFIG_APM_ALLOW_INTS is not set
+
+#
+# CPU Frequency scaling
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+CONFIG_CPU_FREQ_STAT=m
+CONFIG_CPU_FREQ_STAT_DETAILS=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=m
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=m
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
+
+#
+# x86 CPU frequency scaling drivers
+#
+CONFIG_X86_PCC_CPUFREQ=m
+CONFIG_X86_ACPI_CPUFREQ=m
+# CONFIG_X86_POWERNOW_K6 is not set
+CONFIG_X86_POWERNOW_K7=y
+CONFIG_X86_POWERNOW_K7_ACPI=y
+CONFIG_X86_POWERNOW_K8=m
+# CONFIG_X86_GX_SUSPMOD is not set
+# CONFIG_X86_SPEEDSTEP_CENTRINO is not set
+CONFIG_X86_SPEEDSTEP_ICH=y
+CONFIG_X86_SPEEDSTEP_SMI=y
+CONFIG_X86_P4_CLOCKMOD=m
+# CONFIG_X86_CPUFREQ_NFORCE2 is not set
+CONFIG_X86_LONGRUN=y
+# CONFIG_X86_LONGHAUL is not set
+# CONFIG_X86_E_POWERSAVER is not set
+
+#
+# shared options
+#
+CONFIG_X86_SPEEDSTEP_LIB=y
+# CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK is not set
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
+CONFIG_INTEL_IDLE=y
+
+#
+# Bus options (PCI etc.)
+#
+CONFIG_PCI=y
+# CONFIG_PCI_GOBIOS is not set
+# CONFIG_PCI_GOMMCONFIG is not set
+# CONFIG_PCI_GODIRECT is not set
+CONFIG_PCI_GOANY=y
+CONFIG_PCI_BIOS=y
+CONFIG_PCI_DIRECT=y
+CONFIG_PCI_MMCONFIG=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCI_CNB20LE_QUIRK is not set
+CONFIG_PCIEPORTBUS=y
+CONFIG_HOTPLUG_PCI_PCIE=y
+CONFIG_PCIEAER=y
+CONFIG_PCIE_ECRC=y
+CONFIG_PCIEAER_INJECT=m
+CONFIG_PCIEASPM=y
+# CONFIG_PCIEASPM_DEBUG is not set
+CONFIG_PCIE_PME=y
+CONFIG_ARCH_SUPPORTS_MSI=y
+CONFIG_PCI_MSI=y
+# CONFIG_PCI_DEBUG is not set
+CONFIG_PCI_STUB=y
+CONFIG_HT_IRQ=y
+CONFIG_PCI_IOV=y
+CONFIG_PCI_IOAPIC=y
+CONFIG_PCI_LABEL=y
+CONFIG_ISA_DMA_API=y
+# CONFIG_ISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SCx200 is not set
+CONFIG_AMD_NB=y
+CONFIG_PCCARD=m
+# CONFIG_PCMCIA is not set
+CONFIG_CARDBUS=y
+
+#
+# PC-card bridges
+#
+CONFIG_YENTA=m
+CONFIG_YENTA_O2=y
+CONFIG_YENTA_RICOH=y
+CONFIG_YENTA_TI=y
+CONFIG_YENTA_ENE_TUNE=y
+CONFIG_YENTA_TOSHIBA=y
+CONFIG_HOTPLUG_PCI=y
+CONFIG_HOTPLUG_PCI_FAKE=m
+CONFIG_HOTPLUG_PCI_COMPAQ=m
+# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
+CONFIG_HOTPLUG_PCI_IBM=m
+CONFIG_HOTPLUG_PCI_ACPI=y
+CONFIG_HOTPLUG_PCI_ACPI_IBM=m
+# CONFIG_HOTPLUG_PCI_CPCI is not set
+# CONFIG_HOTPLUG_PCI_SHPC is not set
+# CONFIG_RAPIDIO is not set
+
+#
+# Executable file formats / Emulations
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
+CONFIG_HAVE_AOUT=y
+CONFIG_BINFMT_MISC=y
+CONFIG_HAVE_ATOMIC_IOMAP=y
+CONFIG_HAVE_TEXT_POKE_SMP=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=y
+CONFIG_XFRM_SUB_POLICY=y
+CONFIG_XFRM_MIGRATE=y
+CONFIG_XFRM_STATISTICS=y
+CONFIG_XFRM_IPCOMP=m
+CONFIG_NET_KEY=m
+CONFIG_NET_KEY_MIGRATE=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_IP_FIB_TRIE_STATS=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_VERBOSE=y
+CONFIG_IP_ROUTE_CLASSID=y
+# CONFIG_IP_PNP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE_DEMUX=m
+CONFIG_NET_IPGRE=m
+CONFIG_NET_IPGRE_BROADCAST=y
+CONFIG_IP_MROUTE=y
+CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_XFRM_TUNNEL=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=m
+CONFIG_INET_XFRM_MODE_TUNNEL=m
+CONFIG_INET_XFRM_MODE_BEET=m
+CONFIG_INET_LRO=y
+CONFIG_INET_DIAG=m
+CONFIG_INET_TCP_DIAG=m
+CONFIG_TCP_CONG_ADVANCED=y
+CONFIG_TCP_CONG_BIC=m
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+CONFIG_TCP_CONG_LP=m
+CONFIG_TCP_CONG_VENO=m
+CONFIG_TCP_CONG_YEAH=m
+CONFIG_TCP_CONG_ILLINOIS=m
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
+CONFIG_TCP_MD5SIG=y
+CONFIG_IPV6=m
+CONFIG_IPV6_PRIVACY=y
+CONFIG_IPV6_ROUTER_PREF=y
+CONFIG_IPV6_ROUTE_INFO=y
+CONFIG_IPV6_OPTIMISTIC_DAD=y
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_IPV6_MIP6=m
+CONFIG_INET6_XFRM_TUNNEL=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_SIT_6RD=y
+CONFIG_IPV6_NDISC_NODETYPE=y
+CONFIG_IPV6_TUNNEL=m
+CONFIG_IPV6_MULTIPLE_TABLES=y
+CONFIG_IPV6_SUBTREES=y
+CONFIG_IPV6_MROUTE=y
+CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
+CONFIG_IPV6_PIMSM_V2=y
+# CONFIG_NETLABEL is not set
+CONFIG_NETWORK_SECMARK=y
+# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_NETFILTER_ADVANCED=y
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CONNTRACK_MARK=y
+CONFIG_NF_CONNTRACK_SECMARK=y
+CONFIG_NF_CONNTRACK_ZONES=y
+CONFIG_NF_CONNTRACK_EVENTS=y
+CONFIG_NF_CONNTRACK_TIMESTAMP=y
+CONFIG_NF_CT_PROTO_DCCP=m
+CONFIG_NF_CT_PROTO_GRE=m
+CONFIG_NF_CT_PROTO_SCTP=m
+CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CONNTRACK_AMANDA=m
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_H323=m
+CONFIG_NF_CONNTRACK_IRC=m
+CONFIG_NF_CONNTRACK_BROADCAST=m
+CONFIG_NF_CONNTRACK_NETBIOS_NS=m
+CONFIG_NF_CONNTRACK_SNMP=m
+CONFIG_NF_CONNTRACK_PPTP=m
+CONFIG_NF_CONNTRACK_SANE=m
+CONFIG_NF_CONNTRACK_SIP=m
+CONFIG_NF_CONNTRACK_TFTP=m
+CONFIG_NF_CT_NETLINK=m
+CONFIG_NETFILTER_TPROXY=m
+CONFIG_NETFILTER_XTABLES=y
+
+#
+# Xtables combined modules
+#
+CONFIG_NETFILTER_XT_MARK=m
+CONFIG_NETFILTER_XT_CONNMARK=m
+CONFIG_NETFILTER_XT_SET=m
+
+#
+# Xtables targets
+#
+CONFIG_NETFILTER_XT_TARGET_AUDIT=m
+CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
+CONFIG_NETFILTER_XT_TARGET_CT=m
+CONFIG_NETFILTER_XT_TARGET_DSCP=m
+CONFIG_NETFILTER_XT_TARGET_HL=m
+CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m
+CONFIG_NETFILTER_XT_TARGET_LED=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+CONFIG_NETFILTER_XT_TARGET_RATEEST=m
+CONFIG_NETFILTER_XT_TARGET_TEE=m
+CONFIG_NETFILTER_XT_TARGET_TPROXY=m
+CONFIG_NETFILTER_XT_TARGET_TRACE=m
+CONFIG_NETFILTER_XT_TARGET_SECMARK=m
+CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
+CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m
+
+#
+# Xtables matches
+#
+CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
+CONFIG_NETFILTER_XT_MATCH_CLUSTER=m
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_NETFILTER_XT_MATCH_CPU=m
+CONFIG_NETFILTER_XT_MATCH_DCCP=m
+CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m
+CONFIG_NETFILTER_XT_MATCH_DSCP=m
+CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_HL=m
+CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
+# CONFIG_NETFILTER_XT_MATCH_IPVS is not set
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
+CONFIG_NETFILTER_XT_MATCH_OSF=m
+CONFIG_NETFILTER_XT_MATCH_OWNER=m
+CONFIG_NETFILTER_XT_MATCH_POLICY=m
+CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+CONFIG_NETFILTER_XT_MATCH_RATEEST=m
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_SOCKET=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+CONFIG_NETFILTER_XT_MATCH_TIME=m
+CONFIG_NETFILTER_XT_MATCH_U32=m
+CONFIG_IP_SET=m
+CONFIG_IP_SET_MAX=256
+CONFIG_IP_SET_BITMAP_IP=m
+CONFIG_IP_SET_BITMAP_IPMAC=m
+CONFIG_IP_SET_BITMAP_PORT=m
+CONFIG_IP_SET_HASH_IP=m
+CONFIG_IP_SET_HASH_IPPORT=m
+CONFIG_IP_SET_HASH_IPPORTIP=m
+CONFIG_IP_SET_HASH_IPPORTNET=m
+CONFIG_IP_SET_HASH_NET=m
+CONFIG_IP_SET_HASH_NETPORT=m
+CONFIG_IP_SET_HASH_NETIFACE=m
+CONFIG_IP_SET_LIST_SET=m
+CONFIG_IP_VS=m
+CONFIG_IP_VS_IPV6=y
+# CONFIG_IP_VS_DEBUG is not set
+CONFIG_IP_VS_TAB_BITS=12
+
+#
+# IPVS transport protocol load balancing support
+#
+CONFIG_IP_VS_PROTO_TCP=y
+CONFIG_IP_VS_PROTO_UDP=y
+CONFIG_IP_VS_PROTO_AH_ESP=y
+CONFIG_IP_VS_PROTO_ESP=y
+CONFIG_IP_VS_PROTO_AH=y
+CONFIG_IP_VS_PROTO_SCTP=y
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+CONFIG_IP_VS_SED=m
+CONFIG_IP_VS_NQ=m
+
+#
+# IPVS application helper
+#
+CONFIG_IP_VS_FTP=m
+CONFIG_IP_VS_NFCT=y
+CONFIG_IP_VS_PE_SIP=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_NF_DEFRAG_IPV4=m
+CONFIG_NF_CONNTRACK_IPV4=m
+# CONFIG_NF_CONNTRACK_PROC_COMPAT is not set
+# CONFIG_IP_NF_QUEUE is not set
+CONFIG_IP_NF_IPTABLES=y
+CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+# CONFIG_IP_NF_TARGET_ULOG is not set
+CONFIG_NF_NAT=m
+CONFIG_NF_NAT_NEEDED=y
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_NF_NAT_SNMP_BASIC=m
+CONFIG_NF_NAT_PROTO_DCCP=m
+CONFIG_NF_NAT_PROTO_GRE=m
+CONFIG_NF_NAT_PROTO_UDPLITE=m
+CONFIG_NF_NAT_PROTO_SCTP=m
+CONFIG_NF_NAT_FTP=m
+CONFIG_NF_NAT_IRC=m
+CONFIG_NF_NAT_TFTP=m
+CONFIG_NF_NAT_AMANDA=m
+CONFIG_NF_NAT_PPTP=m
+CONFIG_NF_NAT_H323=m
+CONFIG_NF_NAT_SIP=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_SECURITY=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration
+#
+CONFIG_NF_DEFRAG_IPV6=m
+CONFIG_NF_CONNTRACK_IPV6=m
+# CONFIG_IP6_NF_QUEUE is not set
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_MH=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_TARGET_HL=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_REJECT=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_RAW=m
+CONFIG_IP6_NF_SECURITY=m
+CONFIG_BRIDGE_NF_EBTABLES=m
+CONFIG_BRIDGE_EBT_BROUTE=m
+CONFIG_BRIDGE_EBT_T_FILTER=m
+CONFIG_BRIDGE_EBT_T_NAT=m
+CONFIG_BRIDGE_EBT_802_3=m
+CONFIG_BRIDGE_EBT_AMONG=m
+CONFIG_BRIDGE_EBT_ARP=m
+CONFIG_BRIDGE_EBT_IP=m
+CONFIG_BRIDGE_EBT_IP6=m
+CONFIG_BRIDGE_EBT_LIMIT=m
+CONFIG_BRIDGE_EBT_MARK=m
+CONFIG_BRIDGE_EBT_PKTTYPE=m
+CONFIG_BRIDGE_EBT_STP=m
+CONFIG_BRIDGE_EBT_VLAN=m
+CONFIG_BRIDGE_EBT_ARPREPLY=m
+CONFIG_BRIDGE_EBT_DNAT=m
+CONFIG_BRIDGE_EBT_MARK_T=m
+CONFIG_BRIDGE_EBT_REDIRECT=m
+CONFIG_BRIDGE_EBT_SNAT=m
+CONFIG_BRIDGE_EBT_LOG=m
+# CONFIG_BRIDGE_EBT_ULOG is not set
+CONFIG_BRIDGE_EBT_NFLOG=m
+# CONFIG_IP_DCCP is not set
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+# CONFIG_RDS is not set
+# CONFIG_TIPC is not set
+CONFIG_ATM=m
+CONFIG_ATM_CLIP=m
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+# CONFIG_ATM_LANE is not set
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
+CONFIG_L2TP=m
+CONFIG_L2TP_DEBUGFS=m
+CONFIG_L2TP_V3=y
+CONFIG_L2TP_IP=m
+CONFIG_L2TP_ETH=m
+CONFIG_STP=m
+CONFIG_GARP=m
+CONFIG_BRIDGE=m
+CONFIG_BRIDGE_IGMP_SNOOPING=y
+CONFIG_NET_DSA=y
+CONFIG_NET_DSA_TAG_DSA=y
+CONFIG_NET_DSA_TAG_EDSA=y
+CONFIG_NET_DSA_TAG_TRAILER=y
+CONFIG_NET_DSA_MV88E6XXX=y
+CONFIG_NET_DSA_MV88E6060=y
+CONFIG_NET_DSA_MV88E6XXX_NEED_PPU=y
+CONFIG_NET_DSA_MV88E6131=y
+CONFIG_NET_DSA_MV88E6123_61_65=y
+CONFIG_VLAN_8021Q=m
+CONFIG_VLAN_8021Q_GVRP=y
+# CONFIG_DECNET is not set
+CONFIG_LLC=m
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_PHONET is not set
+# CONFIG_IEEE802154 is not set
+CONFIG_NET_SCHED=y
+
+#
+# Queueing/Scheduling
+#
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+CONFIG_NET_SCH_HFSC=m
+CONFIG_NET_SCH_ATM=m
+CONFIG_NET_SCH_PRIO=m
+CONFIG_NET_SCH_MULTIQ=m
+CONFIG_NET_SCH_RED=m
+CONFIG_NET_SCH_SFB=m
+CONFIG_NET_SCH_SFQ=m
+CONFIG_NET_SCH_TEQL=m
+CONFIG_NET_SCH_TBF=m
+CONFIG_NET_SCH_GRED=m
+CONFIG_NET_SCH_DSMARK=m
+CONFIG_NET_SCH_NETEM=m
+CONFIG_NET_SCH_DRR=m
+CONFIG_NET_SCH_MQPRIO=m
+CONFIG_NET_SCH_CHOKE=m
+CONFIG_NET_SCH_QFQ=m
+CONFIG_NET_SCH_INGRESS=m
+
+#
+# Classification
+#
+CONFIG_NET_CLS=y
+CONFIG_NET_CLS_BASIC=m
+CONFIG_NET_CLS_TCINDEX=m
+CONFIG_NET_CLS_ROUTE4=m
+CONFIG_NET_CLS_FW=m
+CONFIG_NET_CLS_U32=m
+CONFIG_CLS_U32_PERF=y
+CONFIG_CLS_U32_MARK=y
+CONFIG_NET_CLS_RSVP=m
+CONFIG_NET_CLS_RSVP6=m
+CONFIG_NET_CLS_FLOW=m
+CONFIG_NET_CLS_CGROUP=m
+CONFIG_NET_EMATCH=y
+CONFIG_NET_EMATCH_STACK=32
+CONFIG_NET_EMATCH_CMP=m
+CONFIG_NET_EMATCH_NBYTE=m
+CONFIG_NET_EMATCH_U32=m
+CONFIG_NET_EMATCH_META=m
+CONFIG_NET_EMATCH_TEXT=m
+CONFIG_NET_CLS_ACT=y
+CONFIG_NET_ACT_POLICE=m
+CONFIG_NET_ACT_GACT=m
+CONFIG_GACT_PROB=y
+CONFIG_NET_ACT_MIRRED=m
+CONFIG_NET_ACT_IPT=m
+CONFIG_NET_ACT_NAT=m
+CONFIG_NET_ACT_PEDIT=m
+CONFIG_NET_ACT_SIMP=m
+CONFIG_NET_ACT_SKBEDIT=m
+CONFIG_NET_ACT_CSUM=m
+CONFIG_NET_CLS_IND=y
+CONFIG_NET_SCH_FIFO=y
+# CONFIG_DCB is not set
+CONFIG_DNS_RESOLVER=y
+# CONFIG_BATMAN_ADV is not set
+CONFIG_RPS=y
+CONFIG_RFS_ACCEL=y
+CONFIG_XPS=y
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_NET_DROP_MONITOR is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+CONFIG_BT=m
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_CMTP=m
+CONFIG_BT_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIBTUSB=m
+CONFIG_BT_HCIBTSDIO=m
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_BT_MRVL=m
+CONFIG_BT_MRVL_SDIO=m
+CONFIG_BT_ATH3K=m
+CONFIG_BT_WILINK=m
+# CONFIG_AF_RXRPC is not set
+CONFIG_FIB_RULES=y
+CONFIG_WIRELESS=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_WEXT_CORE=y
+CONFIG_WEXT_PROC=y
+CONFIG_WEXT_SPY=y
+CONFIG_WEXT_PRIV=y
+CONFIG_CFG80211=m
+CONFIG_NL80211_TESTMODE=y
+# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
+# CONFIG_CFG80211_REG_DEBUG is not set
+CONFIG_CFG80211_DEFAULT_PS=y
+CONFIG_CFG80211_DEBUGFS=y
+# CONFIG_CFG80211_INTERNAL_REGDB is not set
+CONFIG_CFG80211_WEXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
+CONFIG_LIB80211=m
+CONFIG_LIB80211_CRYPT_WEP=m
+CONFIG_LIB80211_CRYPT_CCMP=m
+CONFIG_LIB80211_CRYPT_TKIP=m
+# CONFIG_LIB80211_DEBUG is not set
+CONFIG_MAC80211=m
+CONFIG_MAC80211_HAS_RC=y
+CONFIG_MAC80211_RC_MINSTREL=y
+CONFIG_MAC80211_RC_MINSTREL_HT=y
+CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
+CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
+CONFIG_MAC80211_MESH=y
+CONFIG_MAC80211_LEDS=y
+CONFIG_MAC80211_DEBUGFS=y
+# CONFIG_MAC80211_DEBUG_MENU is not set
+# CONFIG_WIMAX is not set
+CONFIG_RFKILL=m
+CONFIG_RFKILL_LEDS=y
+CONFIG_RFKILL_INPUT=y
+# CONFIG_NET_9P is not set
+# CONFIG_CAIF is not set
+# CONFIG_CEPH_LIB is not set
+# CONFIG_NFC is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH=""
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_FIRMWARE_IN_KERNEL is not set
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_CONNECTOR=y
+CONFIG_PROC_EVENTS=y
+# CONFIG_MTD is not set
+CONFIG_PARPORT=m
+CONFIG_PARPORT_PC=m
+CONFIG_PARPORT_SERIAL=m
+# CONFIG_PARPORT_PC_FIFO is not set
+# CONFIG_PARPORT_PC_SUPERIO is not set
+# CONFIG_PARPORT_GSC is not set
+# CONFIG_PARPORT_AX88796 is not set
+CONFIG_PARPORT_1284=y
+CONFIG_PARPORT_NOT_PC=y
+CONFIG_PNP=y
+# CONFIG_PNP_DEBUG_MESSAGES is not set
+
+#
+# Protocols
+#
+CONFIG_PNPACPI=y
+CONFIG_BLK_DEV=y
+CONFIG_BLK_DEV_FD=m
+# CONFIG_PARIDE is not set
+CONFIG_BLK_CPQ_DA=m
+CONFIG_BLK_CPQ_CISS_DA=m
+# CONFIG_CISS_SCSI_TAPE is not set
+CONFIG_BLK_DEV_DAC960=m
+CONFIG_BLK_DEV_UMEM=m
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+# CONFIG_BLK_DEV_DRBD is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_OSD is not set
+CONFIG_BLK_DEV_SX8=m
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=16384
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_VIRTIO_BLK=m
+# CONFIG_BLK_DEV_HD is not set
+# CONFIG_BLK_DEV_RBD is not set
+CONFIG_SENSORS_LIS3LV02D=m
+CONFIG_MISC_DEVICES=y
+# CONFIG_AD525X_DPOT is not set
+# CONFIG_IBM_ASM is not set
+# CONFIG_PHANTOM is not set
+# CONFIG_INTEL_MID_PTI is not set
+# CONFIG_SGI_IOC4 is not set
+CONFIG_TIFM_CORE=m
+CONFIG_TIFM_7XX1=m
+CONFIG_ICS932S401=m
+CONFIG_ENCLOSURE_SERVICES=m
+# CONFIG_CS5535_MFGPT is not set
+CONFIG_HP_ILO=m
+# CONFIG_APDS9802ALS is not set
+# CONFIG_ISL29003 is not set
+# CONFIG_ISL29020 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_SENSORS_BH1780 is not set
+# CONFIG_SENSORS_BH1770 is not set
+# CONFIG_SENSORS_APDS990X is not set
+# CONFIG_HMC6352 is not set
+CONFIG_DS1682=m
+CONFIG_VMWARE_BALLOON=m
+# CONFIG_BMP085 is not set
+CONFIG_PCH_PHUB=m
+CONFIG_USB_SWITCH_FSA9480=m
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+CONFIG_EEPROM_AT24=m
+CONFIG_EEPROM_LEGACY=m
+CONFIG_EEPROM_MAX6875=m
+CONFIG_EEPROM_93CX6=m
+CONFIG_CB710_CORE=m
+# CONFIG_CB710_DEBUG is not set
+CONFIG_CB710_DEBUG_ASSUMPTIONS=y
+# CONFIG_IWMC3200TOP is not set
+
+#
+# Texas Instruments shared transport line discipline
+#
+CONFIG_TI_ST=m
+# CONFIG_SENSORS_LIS3_I2C is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI_MOD=y
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+CONFIG_SCSI_TGT=m
+CONFIG_SCSI_NETLINK=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+CONFIG_BLK_DEV_SR=m
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=m
+CONFIG_CHR_DEV_SCH=m
+CONFIG_SCSI_ENCLOSURE=m
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_LOGGING=y
+CONFIG_SCSI_SCAN_ASYNC=y
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+CONFIG_SCSI_FC_TGT_ATTRS=y
+CONFIG_SCSI_ISCSI_ATTRS=m
+CONFIG_SCSI_SAS_ATTRS=m
+CONFIG_SCSI_SAS_LIBSAS=m
+CONFIG_SCSI_SAS_ATA=y
+CONFIG_SCSI_SAS_HOST_SMP=y
+CONFIG_SCSI_SRP_ATTRS=m
+CONFIG_SCSI_SRP_TGT_ATTRS=y
+CONFIG_SCSI_LOWLEVEL=y
+CONFIG_ISCSI_TCP=m
+CONFIG_ISCSI_BOOT_SYSFS=m
+CONFIG_SCSI_CXGB3_ISCSI=m
+CONFIG_SCSI_CXGB4_ISCSI=m
+CONFIG_SCSI_BNX2_ISCSI=m
+CONFIG_SCSI_BNX2X_FCOE=m
+CONFIG_BE2ISCSI=m
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+CONFIG_SCSI_HPSA=m
+CONFIG_SCSI_3W_9XXX=m
+CONFIG_SCSI_3W_SAS=m
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
+CONFIG_AIC7XXX_RESET_DELAY_MS=5000
+CONFIG_AIC7XXX_DEBUG_ENABLE=y
+CONFIG_AIC7XXX_DEBUG_MASK=0
+CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=32
+CONFIG_AIC79XX_RESET_DELAY_MS=4000
+# CONFIG_AIC79XX_DEBUG_ENABLE is not set
+CONFIG_AIC79XX_DEBUG_MASK=0
+# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
+CONFIG_SCSI_AIC94XX=m
+# CONFIG_AIC94XX_DEBUG is not set
+CONFIG_SCSI_MVSAS=m
+# CONFIG_SCSI_MVSAS_DEBUG is not set
+CONFIG_SCSI_MVSAS_TASKLET=y
+CONFIG_SCSI_DPT_I2O=m
+CONFIG_SCSI_ADVANSYS=m
+CONFIG_SCSI_ARCMSR=m
+# CONFIG_SCSI_ARCMSR_AER is not set
+CONFIG_MEGARAID_NEWGEN=y
+CONFIG_MEGARAID_MM=m
+CONFIG_MEGARAID_MAILBOX=m
+CONFIG_MEGARAID_LEGACY=m
+CONFIG_MEGARAID_SAS=m
+CONFIG_SCSI_MPT2SAS=m
+CONFIG_SCSI_MPT2SAS_MAX_SGE=128
+# CONFIG_SCSI_MPT2SAS_LOGGING is not set
+CONFIG_SCSI_HPTIOP=m
+CONFIG_SCSI_BUSLOGIC=m
+CONFIG_SCSI_FLASHPOINT=y
+CONFIG_VMWARE_PVSCSI=m
+CONFIG_LIBFC=m
+CONFIG_LIBFCOE=m
+CONFIG_FCOE=m
+CONFIG_FCOE_FNIC=m
+CONFIG_SCSI_DMX3191D=m
+CONFIG_SCSI_EATA=m
+CONFIG_SCSI_EATA_TAGGED_QUEUE=y
+# CONFIG_SCSI_EATA_LINKED_COMMANDS is not set
+CONFIG_SCSI_EATA_MAX_TAGS=16
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_GDTH=m
+CONFIG_SCSI_ISCI=m
+CONFIG_SCSI_IPS=m
+CONFIG_SCSI_INITIO=m
+CONFIG_SCSI_INIA100=m
+CONFIG_SCSI_PPA=m
+CONFIG_SCSI_IMM=m
+# CONFIG_SCSI_IZIP_EPP16 is not set
+# CONFIG_SCSI_IZIP_SLOW_CTR is not set
+CONFIG_SCSI_STEX=m
+CONFIG_SCSI_SYM53C8XX_2=m
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+CONFIG_SCSI_SYM53C8XX_MMIO=y
+CONFIG_SCSI_IPR=m
+CONFIG_SCSI_IPR_TRACE=y
+CONFIG_SCSI_IPR_DUMP=y
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_QLA_FC=m
+CONFIG_SCSI_QLA_ISCSI=m
+CONFIG_SCSI_LPFC=m
+# CONFIG_SCSI_LPFC_DEBUG_FS is not set
+CONFIG_SCSI_DC395x=m
+CONFIG_SCSI_DC390T=m
+CONFIG_SCSI_NSP32=m
+# CONFIG_SCSI_DEBUG is not set
+CONFIG_SCSI_PMCRAID=m
+CONFIG_SCSI_PM8001=m
+# CONFIG_SCSI_SRP is not set
+CONFIG_SCSI_BFA_FC=m
+CONFIG_SCSI_DH=m
+CONFIG_SCSI_DH_RDAC=m
+CONFIG_SCSI_DH_HP_SW=m
+CONFIG_SCSI_DH_EMC=m
+CONFIG_SCSI_DH_ALUA=m
+CONFIG_SCSI_OSD_INITIATOR=m
+CONFIG_SCSI_OSD_ULD=m
+CONFIG_SCSI_OSD_DPRINT_SENSE=1
+# CONFIG_SCSI_OSD_DEBUG is not set
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+CONFIG_ATA_VERBOSE_ERROR=y
+CONFIG_ATA_ACPI=y
+CONFIG_SATA_PMP=y
+
+#
+# Controllers with non-SFF native interface
+#
+CONFIG_SATA_AHCI=y
+CONFIG_SATA_AHCI_PLATFORM=m
+CONFIG_SATA_INIC162X=m
+CONFIG_SATA_ACARD_AHCI=m
+CONFIG_SATA_SIL24=m
+CONFIG_ATA_SFF=y
+
+#
+# SFF controllers with custom DMA interface
+#
+CONFIG_PDC_ADMA=m
+CONFIG_SATA_QSTOR=m
+CONFIG_SATA_SX4=m
+CONFIG_ATA_BMDMA=y
+
+#
+# SATA SFF controllers with BMDMA
+#
+CONFIG_ATA_PIIX=y
+CONFIG_SATA_MV=m
+CONFIG_SATA_NV=m
+CONFIG_SATA_PROMISE=m
+CONFIG_SATA_SIL=m
+CONFIG_SATA_SIS=m
+CONFIG_SATA_SVW=m
+CONFIG_SATA_ULI=m
+CONFIG_SATA_VIA=m
+CONFIG_SATA_VITESSE=m
+
+#
+# PATA SFF controllers with BMDMA
+#
+CONFIG_PATA_ALI=m
+CONFIG_PATA_AMD=m
+CONFIG_PATA_ARASAN_CF=m
+CONFIG_PATA_ARTOP=m
+CONFIG_PATA_ATIIXP=m
+CONFIG_PATA_ATP867X=m
+CONFIG_PATA_CMD64X=m
+CONFIG_PATA_CS5520=m
+CONFIG_PATA_CS5530=m
+CONFIG_PATA_CS5535=m
+CONFIG_PATA_CS5536=m
+CONFIG_PATA_CYPRESS=m
+CONFIG_PATA_EFAR=m
+CONFIG_PATA_HPT366=m
+CONFIG_PATA_HPT37X=m
+CONFIG_PATA_HPT3X2N=m
+CONFIG_PATA_HPT3X3=m
+# CONFIG_PATA_HPT3X3_DMA is not set
+CONFIG_PATA_IT8213=m
+CONFIG_PATA_IT821X=m
+CONFIG_PATA_JMICRON=m
+CONFIG_PATA_MARVELL=m
+CONFIG_PATA_NETCELL=m
+CONFIG_PATA_NINJA32=m
+CONFIG_PATA_NS87415=m
+CONFIG_PATA_OLDPIIX=m
+CONFIG_PATA_OPTIDMA=m
+CONFIG_PATA_PDC2027X=m
+CONFIG_PATA_PDC_OLD=m
+# CONFIG_PATA_RADISYS is not set
+CONFIG_PATA_RDC=m
+# CONFIG_PATA_SC1200 is not set
+CONFIG_PATA_SCH=m
+CONFIG_PATA_SERVERWORKS=m
+CONFIG_PATA_SIL680=m
+CONFIG_PATA_SIS=m
+CONFIG_PATA_TOSHIBA=m
+CONFIG_PATA_TRIFLEX=m
+CONFIG_PATA_VIA=m
+CONFIG_PATA_WINBOND=m
+
+#
+# PIO-only SFF controllers
+#
+CONFIG_PATA_CMD640_PCI=m
+CONFIG_PATA_MPIIX=m
+CONFIG_PATA_NS87410=m
+CONFIG_PATA_OPTI=m
+CONFIG_PATA_RZ1000=m
+
+#
+# Generic fallback / legacy drivers
+#
+CONFIG_PATA_ACPI=m
+CONFIG_ATA_GENERIC=m
+# CONFIG_PATA_LEGACY is not set
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=y
+CONFIG_MD_AUTODETECT=y
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID456=m
+# CONFIG_MULTICORE_RAID456 is not set
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=y
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=y
+CONFIG_DM_MIRROR=y
+CONFIG_DM_RAID=m
+CONFIG_DM_LOG_USERSPACE=m
+CONFIG_DM_ZERO=y
+CONFIG_DM_MULTIPATH=m
+CONFIG_DM_MULTIPATH_QL=m
+CONFIG_DM_MULTIPATH_ST=m
+# CONFIG_DM_DELAY is not set
+CONFIG_DM_UEVENT=y
+# CONFIG_DM_FLAKEY is not set
+# CONFIG_TARGET_CORE is not set
+CONFIG_FUSION=y
+CONFIG_FUSION_SPI=m
+CONFIG_FUSION_FC=m
+CONFIG_FUSION_SAS=m
+CONFIG_FUSION_MAX_SGE=40
+CONFIG_FUSION_CTL=m
+CONFIG_FUSION_LOGGING=y
+
+#
+# IEEE 1394 (FireWire) support
+#
+CONFIG_FIREWIRE=m
+CONFIG_FIREWIRE_OHCI=m
+CONFIG_FIREWIRE_OHCI_DEBUG=y
+CONFIG_FIREWIRE_SBP2=m
+# CONFIG_FIREWIRE_NET is not set
+# CONFIG_FIREWIRE_NOSY is not set
+CONFIG_I2O=m
+# CONFIG_I2O_LCT_NOTIFY_ON_CHANGES is not set
+CONFIG_I2O_EXT_ADAPTEC=y
+CONFIG_I2O_EXT_ADAPTEC_DMA64=y
+CONFIG_I2O_CONFIG=m
+CONFIG_I2O_CONFIG_OLD_IOCTL=y
+CONFIG_I2O_BUS=m
+CONFIG_I2O_BLOCK=m
+CONFIG_I2O_SCSI=m
+CONFIG_I2O_PROC=m
+# CONFIG_MACINTOSH_DRIVERS is not set
+CONFIG_NETDEVICES=y
+CONFIG_IFB=m
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_MACVLAN=m
+CONFIG_MACVTAP=m
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
+CONFIG_VETH=m
+# CONFIG_NET_SB1000 is not set
+# CONFIG_ARCNET is not set
+CONFIG_MII=m
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=m
+CONFIG_DAVICOM_PHY=m
+CONFIG_QSEMI_PHY=m
+CONFIG_LXT_PHY=m
+CONFIG_CICADA_PHY=m
+CONFIG_VITESSE_PHY=m
+CONFIG_SMSC_PHY=m
+CONFIG_BROADCOM_PHY=m
+CONFIG_ICPLUS_PHY=m
+CONFIG_REALTEK_PHY=m
+CONFIG_NATIONAL_PHY=m
+CONFIG_STE10XP=m
+CONFIG_LSI_ET1011C_PHY=m
+CONFIG_MICREL_PHY=m
+CONFIG_FIXED_PHY=y
+CONFIG_MDIO_BITBANG=m
+# CONFIG_MDIO_GPIO is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_HAPPYMEAL=m
+CONFIG_SUNGEM=m
+CONFIG_CASSINI=m
+CONFIG_NET_VENDOR_3COM=y
+CONFIG_VORTEX=m
+CONFIG_TYPHOON=m
+CONFIG_ETHOC=m
+CONFIG_DNET=m
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_DE2104X_DSL=0
+CONFIG_TULIP=m
+# CONFIG_TULIP_MWI is not set
+CONFIG_TULIP_MMIO=y
+CONFIG_TULIP_NAPI=y
+CONFIG_TULIP_NAPI_HW_MITIGATION=y
+CONFIG_DE4X5=m
+CONFIG_WINBOND_840=m
+CONFIG_DM9102=m
+CONFIG_ULI526X=m
+CONFIG_PCMCIA_XIRCOM=m
+CONFIG_HP100=m
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+CONFIG_AMD8111_ETH=m
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_KSZ884X_PCI=m
+CONFIG_B44=m
+CONFIG_B44_PCI_AUTOSELECT=y
+CONFIG_B44_PCICORE_AUTOSELECT=y
+CONFIG_B44_PCI=y
+CONFIG_FORCEDETH=m
+CONFIG_E100=m
+CONFIG_FEALNX=m
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+CONFIG_8139TOO_8129=y
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_R6040=m
+CONFIG_SIS900=m
+CONFIG_EPIC100=m
+CONFIG_SMSC9420=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+CONFIG_TLAN=m
+# CONFIG_KS8842 is not set
+# CONFIG_KS8851_MLL is not set
+CONFIG_VIA_RHINE=m
+CONFIG_VIA_RHINE_MMIO=y
+CONFIG_SC92031=m
+CONFIG_NET_POCKET=y
+CONFIG_ATP=m
+CONFIG_DE600=m
+CONFIG_DE620=m
+CONFIG_ATL2=m
+CONFIG_NETDEV_1000=y
+CONFIG_ACENIC=m
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+CONFIG_DL2K=m
+CONFIG_E1000=m
+CONFIG_E1000E=m
+CONFIG_IP1000=m
+CONFIG_IGB=m
+CONFIG_IGB_DCA=y
+CONFIG_IGBVF=m
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+CONFIG_SIS190=m
+CONFIG_SKGE=m
+# CONFIG_SKGE_DEBUG is not set
+CONFIG_SKGE_GENESIS=y
+CONFIG_SKY2=m
+# CONFIG_SKY2_DEBUG is not set
+CONFIG_VIA_VELOCITY=m
+CONFIG_TIGON3=m
+CONFIG_BNX2=m
+CONFIG_CNIC=m
+CONFIG_QLA3XXX=m
+CONFIG_ATL1=m
+CONFIG_ATL1E=m
+CONFIG_ATL1C=m
+CONFIG_JME=m
+CONFIG_STMMAC_ETH=m
+# CONFIG_STMMAC_DA is not set
+# CONFIG_STMMAC_DUAL_MAC is not set
+CONFIG_PCH_GBE=m
+CONFIG_NETDEV_10000=y
+CONFIG_MDIO=m
+CONFIG_CHELSIO_T1=m
+CONFIG_CHELSIO_T1_1G=y
+CONFIG_CHELSIO_T3=m
+CONFIG_CHELSIO_T4=m
+CONFIG_CHELSIO_T4VF=m
+CONFIG_ENIC=m
+CONFIG_IXGBE=m
+CONFIG_IXGBE_DCA=y
+CONFIG_IXGBEVF=m
+CONFIG_IXGB=m
+CONFIG_S2IO=m
+CONFIG_VXGE=m
+# CONFIG_VXGE_DEBUG_TRACE_ALL is not set
+CONFIG_MYRI10GE=m
+CONFIG_MYRI10GE_DCA=y
+CONFIG_NETXEN_NIC=m
+CONFIG_NIU=m
+CONFIG_MLX4_EN=m
+CONFIG_MLX4_CORE=m
+CONFIG_MLX4_DEBUG=y
+CONFIG_TEHUTI=m
+CONFIG_BNX2X=m
+CONFIG_QLCNIC=m
+CONFIG_QLGE=m
+CONFIG_BNA=m
+CONFIG_SFC=m
+CONFIG_BE2NET=m
+# CONFIG_TR is not set
+CONFIG_WLAN=y
+CONFIG_LIBERTAS_THINFIRM=m
+# CONFIG_LIBERTAS_THINFIRM_DEBUG is not set
+CONFIG_LIBERTAS_THINFIRM_USB=m
+CONFIG_AIRO=m
+CONFIG_ATMEL=m
+CONFIG_PCI_ATMEL=m
+CONFIG_AT76C50X_USB=m
+# CONFIG_PRISM54 is not set
+CONFIG_USB_ZD1201=m
+CONFIG_USB_NET_RNDIS_WLAN=m
+CONFIG_RTL8180=m
+CONFIG_RTL8187=m
+CONFIG_RTL8187_LEDS=y
+CONFIG_ADM8211=m
+CONFIG_MAC80211_HWSIM=m
+CONFIG_MWL8K=m
+CONFIG_ATH_COMMON=m
+# CONFIG_ATH_DEBUG is not set
+CONFIG_ATH5K=m
+CONFIG_ATH5K_DEBUG=y
+# CONFIG_ATH5K_TRACER is not set
+CONFIG_ATH5K_PCI=y
+CONFIG_ATH9K_HW=m
+CONFIG_ATH9K_COMMON=m
+CONFIG_ATH9K=m
+CONFIG_ATH9K_PCI=y
+CONFIG_ATH9K_AHB=y
+CONFIG_ATH9K_DEBUGFS=y
+CONFIG_ATH9K_RATE_CONTROL=y
+CONFIG_ATH9K_HTC=m
+# CONFIG_ATH9K_HTC_DEBUGFS is not set
+CONFIG_CARL9170=m
+CONFIG_CARL9170_LEDS=y
+# CONFIG_CARL9170_DEBUGFS is not set
+CONFIG_CARL9170_WPC=y
+CONFIG_B43=m
+CONFIG_B43_SSB=y
+CONFIG_B43_PCI_AUTOSELECT=y
+CONFIG_B43_PCICORE_AUTOSELECT=y
+CONFIG_B43_SDIO=y
+CONFIG_B43_PIO=y
+CONFIG_B43_PHY_N=y
+CONFIG_B43_PHY_LP=y
+CONFIG_B43_LEDS=y
+CONFIG_B43_HWRNG=y
+# CONFIG_B43_DEBUG is not set
+CONFIG_B43LEGACY=m
+CONFIG_B43LEGACY_PCI_AUTOSELECT=y
+CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y
+CONFIG_B43LEGACY_LEDS=y
+CONFIG_B43LEGACY_HWRNG=y
+# CONFIG_B43LEGACY_DEBUG is not set
+CONFIG_B43LEGACY_DMA=y
+CONFIG_B43LEGACY_PIO=y
+CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
+# CONFIG_B43LEGACY_DMA_MODE is not set
+# CONFIG_B43LEGACY_PIO_MODE is not set
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_FIRMWARE_NVRAM=y
+CONFIG_HOSTAP_PLX=m
+CONFIG_HOSTAP_PCI=m
+CONFIG_IPW2100=m
+CONFIG_IPW2100_MONITOR=y
+# CONFIG_IPW2100_DEBUG is not set
+CONFIG_IPW2200=m
+CONFIG_IPW2200_MONITOR=y
+CONFIG_IPW2200_RADIOTAP=y
+CONFIG_IPW2200_PROMISCUOUS=y
+CONFIG_IPW2200_QOS=y
+# CONFIG_IPW2200_DEBUG is not set
+CONFIG_LIBIPW=m
+# CONFIG_LIBIPW_DEBUG is not set
+CONFIG_IWLAGN=m
+
+#
+# Debugging Options
+#
+# CONFIG_IWLWIFI_DEBUG is not set
+CONFIG_IWLWIFI_DEBUGFS=y
+# CONFIG_IWLWIFI_DEVICE_TRACING is not set
+CONFIG_IWLWIFI_DEVICE_SVTOOL=y
+# CONFIG_IWL_P2P is not set
+CONFIG_IWLWIFI_LEGACY=m
+
+#
+# Debugging Options
+#
+# CONFIG_IWLWIFI_LEGACY_DEBUG is not set
+CONFIG_IWLWIFI_LEGACY_DEBUGFS=y
+# CONFIG_IWLWIFI_LEGACY_DEVICE_TRACING is not set
+CONFIG_IWL4965=m
+CONFIG_IWL3945=m
+# CONFIG_IWM is not set
+CONFIG_LIBERTAS=m
+CONFIG_LIBERTAS_USB=m
+CONFIG_LIBERTAS_SDIO=m
+# CONFIG_LIBERTAS_DEBUG is not set
+CONFIG_LIBERTAS_MESH=y
+CONFIG_HERMES=m
+# CONFIG_HERMES_PRISM is not set
+CONFIG_HERMES_CACHE_FW_ON_INIT=y
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_NORTEL_HERMES=m
+CONFIG_ORINOCO_USB=m
+CONFIG_P54_COMMON=m
+CONFIG_P54_USB=m
+CONFIG_P54_PCI=m
+CONFIG_P54_LEDS=y
+CONFIG_RT2X00=m
+CONFIG_RT2400PCI=m
+CONFIG_RT2500PCI=m
+CONFIG_RT61PCI=m
+CONFIG_RT2800PCI=m
+CONFIG_RT2800PCI_RT33XX=y
+CONFIG_RT2800PCI_RT35XX=y
+CONFIG_RT2800PCI_RT53XX=y
+CONFIG_RT2500USB=m
+CONFIG_RT73USB=m
+CONFIG_RT2800USB=m
+CONFIG_RT2800USB_RT33XX=y
+CONFIG_RT2800USB_RT35XX=y
+CONFIG_RT2800USB_RT53XX=y
+CONFIG_RT2800USB_UNKNOWN=y
+CONFIG_RT2800_LIB=m
+CONFIG_RT2X00_LIB_PCI=m
+CONFIG_RT2X00_LIB_USB=m
+CONFIG_RT2X00_LIB=m
+CONFIG_RT2X00_LIB_FIRMWARE=y
+CONFIG_RT2X00_LIB_CRYPTO=y
+CONFIG_RT2X00_LIB_LEDS=y
+CONFIG_RT2X00_LIB_DEBUGFS=y
+# CONFIG_RT2X00_DEBUG is not set
+CONFIG_RTL8192CE=m
+CONFIG_RTL8192SE=m
+CONFIG_RTL8192DE=m
+CONFIG_RTL8192CU=m
+CONFIG_RTLWIFI=m
+CONFIG_RTL8192C_COMMON=m
+CONFIG_WL1251=m
+CONFIG_WL1251_SDIO=m
+CONFIG_WL12XX_MENU=m
+CONFIG_WL12XX=m
+# CONFIG_WL12XX_HT is not set
+CONFIG_WL12XX_SDIO=m
+# CONFIG_WL12XX_SDIO_TEST is not set
+CONFIG_WL12XX_PLATFORM_DATA=y
+CONFIG_ZD1211RW=m
+# CONFIG_ZD1211RW_DEBUG is not set
+CONFIG_MWIFIEX=m
+CONFIG_MWIFIEX_SDIO=m
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_AX8817X=m
+CONFIG_USB_NET_CDCETHER=m
+CONFIG_USB_NET_CDC_EEM=m
+CONFIG_USB_NET_CDC_NCM=m
+CONFIG_USB_NET_DM9601=m
+CONFIG_USB_NET_SMSC75XX=m
+CONFIG_USB_NET_SMSC95XX=m
+CONFIG_USB_NET_GL620A=m
+CONFIG_USB_NET_NET1080=m
+CONFIG_USB_NET_PLUSB=m
+CONFIG_USB_NET_MCS7830=m
+CONFIG_USB_NET_RNDIS_HOST=m
+CONFIG_USB_NET_CDC_SUBSET=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_KC2190=y
+CONFIG_USB_NET_ZAURUS=m
+CONFIG_USB_NET_CX82310_ETH=m
+CONFIG_USB_NET_KALMIA=m
+CONFIG_USB_HSO=m
+CONFIG_USB_NET_INT51X1=m
+CONFIG_USB_IPHETH=m
+CONFIG_USB_SIERRA_NET=m
+CONFIG_USB_VL600=m
+# CONFIG_WAN is not set
+CONFIG_ATM_DRIVERS=y
+# CONFIG_ATM_DUMMY is not set
+CONFIG_ATM_TCP=m
+CONFIG_ATM_LANAI=m
+CONFIG_ATM_ENI=m
+# CONFIG_ATM_ENI_DEBUG is not set
+# CONFIG_ATM_ENI_TUNE_BURST is not set
+CONFIG_ATM_FIRESTREAM=m
+# CONFIG_ATM_ZATM is not set
+CONFIG_ATM_NICSTAR=m
+# CONFIG_ATM_NICSTAR_USE_SUNI is not set
+# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set
+CONFIG_ATM_IDT77252=m
+# CONFIG_ATM_IDT77252_DEBUG is not set
+# CONFIG_ATM_IDT77252_RCV_ALL is not set
+CONFIG_ATM_IDT77252_USE_SUNI=y
+# CONFIG_ATM_AMBASSADOR is not set
+# CONFIG_ATM_HORIZON is not set
+# CONFIG_ATM_IA is not set
+# CONFIG_ATM_FORE200E is not set
+CONFIG_ATM_HE=m
+# CONFIG_ATM_HE_USE_SUNI is not set
+CONFIG_ATM_SOLOS=m
+
+#
+# CAIF transport drivers
+#
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+CONFIG_PPTP=m
+CONFIG_PPPOATM=m
+CONFIG_PPPOL2TP=m
+# CONFIG_SLIP is not set
+CONFIG_SLHC=m
+# CONFIG_NET_FC is not set
+CONFIG_NETCONSOLE=m
+CONFIG_NETCONSOLE_DYNAMIC=y
+CONFIG_NETPOLL=y
+CONFIG_NETPOLL_TRAP=y
+CONFIG_NET_POLL_CONTROLLER=y
+CONFIG_VIRTIO_NET=m
+CONFIG_VMXNET3=m
+CONFIG_ISDN=y
+CONFIG_ISDN_I4L=m
+CONFIG_ISDN_PPP=y
+CONFIG_ISDN_PPP_VJ=y
+CONFIG_ISDN_MPP=y
+CONFIG_IPPP_FILTER=y
+CONFIG_ISDN_PPP_BSDCOMP=m
+CONFIG_ISDN_AUDIO=y
+CONFIG_ISDN_TTY_FAX=y
+
+#
+# ISDN feature submodules
+#
+CONFIG_ISDN_DIVERSION=m
+
+#
+# ISDN4Linux hardware drivers
+#
+
+#
+# Passive cards
+#
+CONFIG_ISDN_DRV_HISAX=m
+
+#
+# D-channel protocol features
+#
+CONFIG_HISAX_EURO=y
+CONFIG_DE_AOC=y
+CONFIG_HISAX_NO_SENDCOMPLETE=y
+CONFIG_HISAX_NO_LLC=y
+CONFIG_HISAX_NO_KEYPAD=y
+CONFIG_HISAX_1TR6=y
+CONFIG_HISAX_NI1=y
+CONFIG_HISAX_MAX_CARDS=8
+
+#
+# HiSax supported cards
+#
+CONFIG_HISAX_16_3=y
+CONFIG_HISAX_TELESPCI=y
+CONFIG_HISAX_S0BOX=y
+CONFIG_HISAX_FRITZPCI=y
+CONFIG_HISAX_AVM_A1_PCMCIA=y
+CONFIG_HISAX_ELSA=y
+CONFIG_HISAX_DIEHLDIVA=y
+CONFIG_HISAX_SEDLBAUER=y
+CONFIG_HISAX_NETJET=y
+CONFIG_HISAX_NETJET_U=y
+CONFIG_HISAX_NICCY=y
+CONFIG_HISAX_BKM_A4T=y
+CONFIG_HISAX_SCT_QUADRO=y
+CONFIG_HISAX_GAZEL=y
+CONFIG_HISAX_HFC_PCI=y
+CONFIG_HISAX_W6692=y
+CONFIG_HISAX_HFC_SX=y
+CONFIG_HISAX_ENTERNOW_PCI=y
+# CONFIG_HISAX_DEBUG is not set
+
+#
+# HiSax PCMCIA card service modules
+#
+
+#
+# HiSax sub driver modules
+#
+CONFIG_HISAX_ST5481=m
+CONFIG_HISAX_HFCUSB=m
+CONFIG_HISAX_HFC4S8S=m
+CONFIG_HISAX_FRITZ_PCIPNP=m
+
+#
+# Active cards
+#
+CONFIG_ISDN_CAPI=m
+CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y
+CONFIG_CAPI_TRACE=y
+CONFIG_ISDN_CAPI_MIDDLEWARE=y
+CONFIG_ISDN_CAPI_CAPI20=m
+CONFIG_ISDN_CAPI_CAPIDRV=m
+
+#
+# CAPI hardware drivers
+#
+CONFIG_CAPI_AVM=y
+CONFIG_ISDN_DRV_AVMB1_B1PCI=m
+CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y
+CONFIG_ISDN_DRV_AVMB1_T1PCI=m
+CONFIG_ISDN_DRV_AVMB1_C4=m
+CONFIG_CAPI_EICON=y
+CONFIG_ISDN_DIVAS=m
+CONFIG_ISDN_DIVAS_BRIPCI=y
+CONFIG_ISDN_DIVAS_PRIPCI=y
+CONFIG_ISDN_DIVAS_DIVACAPI=m
+CONFIG_ISDN_DIVAS_USERIDI=m
+CONFIG_ISDN_DIVAS_MAINT=m
+CONFIG_ISDN_DRV_GIGASET=m
+CONFIG_GIGASET_CAPI=y
+# CONFIG_GIGASET_I4L is not set
+# CONFIG_GIGASET_DUMMYLL is not set
+CONFIG_GIGASET_BASE=m
+CONFIG_GIGASET_M105=m
+CONFIG_GIGASET_M101=m
+# CONFIG_GIGASET_DEBUG is not set
+CONFIG_HYSDN=m
+CONFIG_HYSDN_CAPI=y
+# CONFIG_MISDN is not set
+CONFIG_ISDN_HDLC=m
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+CONFIG_INPUT_POLLDEV=m
+CONFIG_INPUT_SPARSEKMAP=m
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ADP5588 is not set
+# CONFIG_KEYBOARD_ADP5589 is not set
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_QT1070 is not set
+# CONFIG_KEYBOARD_QT2160 is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+CONFIG_KEYBOARD_GPIO=m
+CONFIG_KEYBOARD_GPIO_POLLED=m
+# CONFIG_KEYBOARD_TCA6416 is not set
+# CONFIG_KEYBOARD_MATRIX is not set
+# CONFIG_KEYBOARD_LM8323 is not set
+# CONFIG_KEYBOARD_MAX7359 is not set
+# CONFIG_KEYBOARD_MCS is not set
+# CONFIG_KEYBOARD_MPR121 is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_OPENCORES is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=m
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_LIFEBOOK=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+CONFIG_MOUSE_PS2_ELANTECH=y
+CONFIG_MOUSE_PS2_SENTELIC=y
+CONFIG_MOUSE_PS2_TOUCHKIT=y
+CONFIG_MOUSE_SERIAL=m
+CONFIG_MOUSE_APPLETOUCH=m
+CONFIG_MOUSE_BCM5974=m
+CONFIG_MOUSE_VSXXXAA=m
+# CONFIG_MOUSE_GPIO is not set
+CONFIG_MOUSE_SYNAPTICS_I2C=m
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_AD714X is not set
+CONFIG_INPUT_PCSPKR=m
+# CONFIG_INPUT_MMA8450 is not set
+# CONFIG_INPUT_MPU3050 is not set
+CONFIG_INPUT_APANEL=m
+CONFIG_INPUT_WISTRON_BTNS=m
+CONFIG_INPUT_ATLAS_BTNS=m
+CONFIG_INPUT_ATI_REMOTE=m
+CONFIG_INPUT_ATI_REMOTE2=m
+CONFIG_INPUT_KEYSPAN_REMOTE=m
+# CONFIG_INPUT_KXTJ9 is not set
+CONFIG_INPUT_POWERMATE=m
+CONFIG_INPUT_YEALINK=m
+CONFIG_INPUT_CM109=m
+CONFIG_INPUT_UINPUT=m
+# CONFIG_INPUT_PCF8574 is not set
+CONFIG_INPUT_GPIO_ROTARY_ENCODER=m
+# CONFIG_INPUT_ADXL34X is not set
+# CONFIG_INPUT_CMA3000 is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=m
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PARKBD is not set
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+CONFIG_SERIO_RAW=m
+CONFIG_SERIO_ALTERA_PS2=m
+# CONFIG_SERIO_PS2MULT is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_NONSTANDARD=y
+CONFIG_ROCKETPORT=m
+CONFIG_CYCLADES=m
+# CONFIG_CYZ_INTR is not set
+# CONFIG_MOXA_INTELLIO is not set
+# CONFIG_MOXA_SMARTIO is not set
+CONFIG_SYNCLINK=m
+CONFIG_SYNCLINKMP=m
+CONFIG_SYNCLINK_GT=m
+CONFIG_NOZOMI=m
+# CONFIG_ISI is not set
+CONFIG_N_HDLC=m
+CONFIG_N_GSM=m
+# CONFIG_TRACE_SINK is not set
+# CONFIG_STALDRV is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_PNP=y
+CONFIG_SERIAL_8250_NR_UARTS=32
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_MFD_HSU is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_JSM=m
+# CONFIG_SERIAL_TIMBERDALE is not set
+# CONFIG_SERIAL_ALTERA_JTAGUART is not set
+# CONFIG_SERIAL_ALTERA_UART is not set
+# CONFIG_SERIAL_PCH_UART is not set
+# CONFIG_SERIAL_XILINX_PS_UART is not set
+CONFIG_PRINTER=m
+CONFIG_LP_CONSOLE=y
+CONFIG_PPDEV=m
+CONFIG_HVC_DRIVER=y
+CONFIG_VIRTIO_CONSOLE=m
+CONFIG_IPMI_HANDLER=m
+# CONFIG_IPMI_PANIC_EVENT is not set
+CONFIG_IPMI_DEVICE_INTERFACE=m
+CONFIG_IPMI_SI=m
+CONFIG_IPMI_WATCHDOG=m
+CONFIG_IPMI_POWEROFF=m
+CONFIG_HW_RANDOM=y
+CONFIG_HW_RANDOM_TIMERIOMEM=m
+CONFIG_HW_RANDOM_INTEL=m
+CONFIG_HW_RANDOM_AMD=m
+CONFIG_HW_RANDOM_GEODE=m
+CONFIG_HW_RANDOM_VIA=m
+CONFIG_HW_RANDOM_VIRTIO=m
+CONFIG_NVRAM=y
+CONFIG_R3964=m
+# CONFIG_APPLICOM is not set
+CONFIG_SONYPI=m
+CONFIG_MWAVE=m
+CONFIG_PC8736x_GPIO=m
+CONFIG_NSC_GPIO=m
+CONFIG_RAW_DRIVER=y
+CONFIG_MAX_RAW_DEVS=8192
+CONFIG_HPET=y
+# CONFIG_HPET_MMAP is not set
+CONFIG_HANGCHECK_TIMER=m
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+# CONFIG_RAMOOPS is not set
+CONFIG_I2C=m
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_COMPAT=y
+CONFIG_I2C_CHARDEV=m
+# CONFIG_I2C_MUX is not set
+CONFIG_I2C_HELPER_AUTO=y
+CONFIG_I2C_SMBUS=m
+CONFIG_I2C_ALGOBIT=m
+CONFIG_I2C_ALGOPCA=m
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# PC SMBus host controller drivers
+#
+CONFIG_I2C_ALI1535=m
+CONFIG_I2C_ALI1563=m
+CONFIG_I2C_ALI15X3=m
+CONFIG_I2C_AMD756=m
+CONFIG_I2C_AMD756_S4882=m
+CONFIG_I2C_AMD8111=m
+CONFIG_I2C_I801=m
+CONFIG_I2C_ISCH=m
+CONFIG_I2C_PIIX4=m
+CONFIG_I2C_NFORCE2=m
+CONFIG_I2C_NFORCE2_S4985=m
+CONFIG_I2C_SIS5595=m
+CONFIG_I2C_SIS630=m
+CONFIG_I2C_SIS96X=m
+CONFIG_I2C_VIA=m
+CONFIG_I2C_VIAPRO=m
+
+#
+# ACPI drivers
+#
+CONFIG_I2C_SCMI=m
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_INTEL_MID is not set
+# CONFIG_I2C_OCORES is not set
+CONFIG_I2C_PCA_PLATFORM=m
+# CONFIG_I2C_PXA_PCI is not set
+CONFIG_I2C_SIMTEC=m
+# CONFIG_I2C_XILINX is not set
+# CONFIG_I2C_EG20T is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+CONFIG_I2C_DIOLAN_U2C=m
+CONFIG_I2C_PARPORT=m
+CONFIG_I2C_PARPORT_LIGHT=m
+# CONFIG_I2C_TAOS_EVM is not set
+CONFIG_I2C_TINY_USB=m
+
+#
+# Other I2C/SMBus bus drivers
+#
+CONFIG_I2C_STUB=m
+CONFIG_SCx200_ACB=m
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_SPI is not set
+
+#
+# PPS support
+#
+# CONFIG_PPS is not set
+
+#
+# PPS generators support
+#
+
+#
+# PTP clock support
+#
+
+#
+# Enable Device Drivers -> PPS to see the PTP clock options.
+#
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
+CONFIG_GPIO_SYSFS=y
+
+#
+# Memory mapped GPIO drivers:
+#
+# CONFIG_GPIO_GENERIC_PLATFORM is not set
+# CONFIG_GPIO_IT8761E is not set
+CONFIG_GPIO_SCH=m
+# CONFIG_GPIO_VX855 is not set
+
+#
+# I2C GPIO expanders:
+#
+# CONFIG_GPIO_MAX7300 is not set
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+# CONFIG_GPIO_ADP5588 is not set
+
+#
+# PCI GPIO expanders:
+#
+# CONFIG_GPIO_CS5535 is not set
+# CONFIG_GPIO_LANGWELL is not set
+# CONFIG_GPIO_PCH is not set
+# CONFIG_GPIO_ML_IOH is not set
+# CONFIG_GPIO_RDC321X is not set
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_GPIO_MCP23S08 is not set
+
+#
+# AC97 GPIO expanders:
+#
+
+#
+# MODULbus GPIO expanders:
+#
+CONFIG_W1=m
+CONFIG_W1_CON=y
+
+#
+# 1-wire Bus Masters
+#
+# CONFIG_W1_MASTER_MATROX is not set
+CONFIG_W1_MASTER_DS2490=m
+CONFIG_W1_MASTER_DS2482=m
+CONFIG_W1_MASTER_DS1WM=m
+# CONFIG_W1_MASTER_GPIO is not set
+
+#
+# 1-wire Slaves
+#
+CONFIG_W1_SLAVE_THERM=m
+CONFIG_W1_SLAVE_SMEM=m
+CONFIG_W1_SLAVE_DS2408=m
+CONFIG_W1_SLAVE_DS2423=m
+CONFIG_W1_SLAVE_DS2431=m
+CONFIG_W1_SLAVE_DS2433=m
+CONFIG_W1_SLAVE_DS2433_CRC=y
+CONFIG_W1_SLAVE_DS2760=m
+CONFIG_W1_SLAVE_DS2780=m
+CONFIG_W1_SLAVE_BQ27000=m
+CONFIG_POWER_SUPPLY=y
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_TEST_POWER is not set
+# CONFIG_BATTERY_DS2760 is not set
+# CONFIG_BATTERY_DS2780 is not set
+# CONFIG_BATTERY_DS2782 is not set
+# CONFIG_BATTERY_BQ20Z75 is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+# CONFIG_BATTERY_MAX17040 is not set
+# CONFIG_BATTERY_MAX17042 is not set
+# CONFIG_CHARGER_ISP1704 is not set
+# CONFIG_CHARGER_MAX8903 is not set
+# CONFIG_CHARGER_GPIO is not set
+CONFIG_HWMON=y
+CONFIG_HWMON_VID=m
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Native drivers
+#
+CONFIG_SENSORS_ABITUGURU=m
+CONFIG_SENSORS_ABITUGURU3=m
+CONFIG_SENSORS_AD7414=m
+CONFIG_SENSORS_AD7418=m
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ADM1025=m
+CONFIG_SENSORS_ADM1026=m
+CONFIG_SENSORS_ADM1029=m
+CONFIG_SENSORS_ADM1031=m
+CONFIG_SENSORS_ADM9240=m
+CONFIG_SENSORS_ADT7411=m
+CONFIG_SENSORS_ADT7462=m
+CONFIG_SENSORS_ADT7470=m
+CONFIG_SENSORS_ADT7475=m
+CONFIG_SENSORS_ASC7621=m
+CONFIG_SENSORS_K8TEMP=m
+CONFIG_SENSORS_K10TEMP=m
+CONFIG_SENSORS_FAM15H_POWER=m
+CONFIG_SENSORS_ASB100=m
+CONFIG_SENSORS_ATXP1=m
+CONFIG_SENSORS_DS620=m
+CONFIG_SENSORS_DS1621=m
+CONFIG_SENSORS_I5K_AMB=m
+CONFIG_SENSORS_F71805F=m
+CONFIG_SENSORS_F71882FG=m
+CONFIG_SENSORS_F75375S=m
+CONFIG_SENSORS_FSCHMD=m
+CONFIG_SENSORS_G760A=m
+CONFIG_SENSORS_GL518SM=m
+CONFIG_SENSORS_GL520SM=m
+# CONFIG_SENSORS_GPIO_FAN is not set
+CONFIG_SENSORS_CORETEMP=m
+CONFIG_SENSORS_IBMAEM=m
+CONFIG_SENSORS_IBMPEX=m
+CONFIG_SENSORS_IT87=m
+# CONFIG_SENSORS_JC42 is not set
+CONFIG_SENSORS_LINEAGE=m
+CONFIG_SENSORS_LM63=m
+CONFIG_SENSORS_LM73=m
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM77=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM87=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_LM92=m
+CONFIG_SENSORS_LM93=m
+CONFIG_SENSORS_LTC4151=m
+CONFIG_SENSORS_LTC4215=m
+CONFIG_SENSORS_LTC4245=m
+CONFIG_SENSORS_LTC4261=m
+CONFIG_SENSORS_LM95241=m
+CONFIG_SENSORS_LM95245=m
+CONFIG_SENSORS_MAX16065=m
+CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_MAX1668=m
+CONFIG_SENSORS_MAX6639=m
+CONFIG_SENSORS_MAX6642=m
+CONFIG_SENSORS_MAX6650=m
+CONFIG_SENSORS_NTC_THERMISTOR=m
+CONFIG_SENSORS_PC87360=m
+CONFIG_SENSORS_PC87427=m
+CONFIG_SENSORS_PCF8591=m
+CONFIG_PMBUS=m
+CONFIG_SENSORS_PMBUS=m
+CONFIG_SENSORS_ADM1275=m
+CONFIG_SENSORS_LM25066=m
+CONFIG_SENSORS_MAX16064=m
+CONFIG_SENSORS_MAX34440=m
+CONFIG_SENSORS_MAX8688=m
+CONFIG_SENSORS_UCD9000=m
+CONFIG_SENSORS_UCD9200=m
+CONFIG_SENSORS_SHT15=m
+CONFIG_SENSORS_SHT21=m
+CONFIG_SENSORS_SIS5595=m
+# CONFIG_SENSORS_SMM665 is not set
+CONFIG_SENSORS_DME1737=m
+CONFIG_SENSORS_EMC1403=m
+# CONFIG_SENSORS_EMC2103 is not set
+CONFIG_SENSORS_EMC6W201=m
+CONFIG_SENSORS_SMSC47M1=m
+CONFIG_SENSORS_SMSC47M192=m
+CONFIG_SENSORS_SMSC47B397=m
+CONFIG_SENSORS_SCH56XX_COMMON=m
+CONFIG_SENSORS_SCH5627=m
+CONFIG_SENSORS_SCH5636=m
+CONFIG_SENSORS_ADS1015=m
+CONFIG_SENSORS_ADS7828=m
+CONFIG_SENSORS_AMC6821=m
+CONFIG_SENSORS_THMC50=m
+CONFIG_SENSORS_TMP102=m
+CONFIG_SENSORS_TMP401=m
+CONFIG_SENSORS_TMP421=m
+CONFIG_SENSORS_VIA_CPUTEMP=m
+CONFIG_SENSORS_VIA686A=m
+CONFIG_SENSORS_VT1211=m
+CONFIG_SENSORS_VT8231=m
+CONFIG_SENSORS_W83781D=m
+CONFIG_SENSORS_W83791D=m
+CONFIG_SENSORS_W83792D=m
+CONFIG_SENSORS_W83793=m
+CONFIG_SENSORS_W83795=m
+# CONFIG_SENSORS_W83795_FANCTRL is not set
+CONFIG_SENSORS_W83L785TS=m
+CONFIG_SENSORS_W83L786NG=m
+CONFIG_SENSORS_W83627HF=m
+CONFIG_SENSORS_W83627EHF=m
+CONFIG_SENSORS_APPLESMC=m
+
+#
+# ACPI drivers
+#
+CONFIG_SENSORS_ACPI_POWER=m
+CONFIG_SENSORS_ATK0110=m
+CONFIG_THERMAL=y
+CONFIG_THERMAL_HWMON=y
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_CORE=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+CONFIG_SOFT_WATCHDOG=m
+# CONFIG_ACQUIRE_WDT is not set
+# CONFIG_ADVANTECH_WDT is not set
+CONFIG_ALIM1535_WDT=m
+CONFIG_ALIM7101_WDT=m
+CONFIG_F71808E_WDT=m
+CONFIG_SP5100_TCO=m
+# CONFIG_SC520_WDT is not set
+CONFIG_SBC_FITPC2_WATCHDOG=m
+# CONFIG_EUROTECH_WDT is not set
+CONFIG_IB700_WDT=m
+CONFIG_IBMASR=m
+# CONFIG_WAFER_WDT is not set
+CONFIG_I6300ESB_WDT=m
+CONFIG_ITCO_WDT=m
+# CONFIG_ITCO_VENDOR_SUPPORT is not set
+CONFIG_IT8712F_WDT=m
+CONFIG_IT87_WDT=m
+CONFIG_HP_WATCHDOG=m
+CONFIG_HPWDT_NMI_DECODING=y
+# CONFIG_SC1200_WDT is not set
+# CONFIG_PC87413_WDT is not set
+CONFIG_NV_TCO=m
+# CONFIG_60XX_WDT is not set
+# CONFIG_SBC8360_WDT is not set
+# CONFIG_SBC7240_WDT is not set
+# CONFIG_CPU5_WDT is not set
+CONFIG_SMSC_SCH311X_WDT=m
+# CONFIG_SMSC37B787_WDT is not set
+CONFIG_W83627HF_WDT=m
+CONFIG_W83697HF_WDT=m
+CONFIG_W83697UG_WDT=m
+CONFIG_W83877F_WDT=m
+CONFIG_W83977F_WDT=m
+CONFIG_MACHZ_WDT=m
+# CONFIG_SBC_EPX_C3_WATCHDOG is not set
+
+#
+# PCI-based Watchdog Cards
+#
+CONFIG_PCIPCWATCHDOG=m
+CONFIG_WDTPCI=m
+
+#
+# USB-based Watchdog Cards
+#
+CONFIG_USBPCWATCHDOG=m
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB=m
+CONFIG_SSB_SPROM=y
+CONFIG_SSB_BLOCKIO=y
+CONFIG_SSB_PCIHOST_POSSIBLE=y
+CONFIG_SSB_PCIHOST=y
+CONFIG_SSB_B43_PCI_BRIDGE=y
+CONFIG_SSB_SDIOHOST_POSSIBLE=y
+CONFIG_SSB_SDIOHOST=y
+# CONFIG_SSB_DEBUG is not set
+CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
+CONFIG_SSB_DRIVER_PCICORE=y
+CONFIG_BCMA_POSSIBLE=y
+
+#
+# Broadcom specific AMBA
+#
+# CONFIG_BCMA is not set
+CONFIG_MFD_SUPPORT=y
+CONFIG_MFD_CORE=m
+CONFIG_MFD_SM501=m
+CONFIG_MFD_SM501_GPIO=y
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_UCB1400_CORE is not set
+# CONFIG_TPS6105X is not set
+# CONFIG_TPS65010 is not set
+# CONFIG_TPS6507X is not set
+# CONFIG_MFD_TMIO is not set
+CONFIG_MFD_WM8400=m
+# CONFIG_MFD_PCF50633 is not set
+# CONFIG_ABX500_CORE is not set
+CONFIG_MFD_CS5535=m
+# CONFIG_MFD_TIMBERDALE is not set
+CONFIG_LPC_SCH=m
+# CONFIG_MFD_RDC321X is not set
+# CONFIG_MFD_JANZ_CMODIO is not set
+CONFIG_MFD_VX855=m
+CONFIG_MFD_WL1273_CORE=m
+# CONFIG_REGULATOR is not set
+CONFIG_MEDIA_SUPPORT=m
+
+#
+# Multimedia core support
+#
+CONFIG_MEDIA_CONTROLLER=y
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_V4L2_COMMON=m
+CONFIG_VIDEO_V4L2_SUBDEV_API=y
+CONFIG_DVB_CORE=m
+CONFIG_DVB_NET=y
+CONFIG_VIDEO_MEDIA=m
+
+#
+# Multimedia drivers
+#
+CONFIG_VIDEO_SAA7146=m
+CONFIG_VIDEO_SAA7146_VV=m
+CONFIG_RC_CORE=m
+CONFIG_LIRC=m
+CONFIG_RC_MAP=m
+CONFIG_IR_NEC_DECODER=m
+CONFIG_IR_RC5_DECODER=m
+CONFIG_IR_RC6_DECODER=m
+CONFIG_IR_JVC_DECODER=m
+CONFIG_IR_SONY_DECODER=m
+CONFIG_IR_RC5_SZ_DECODER=m
+CONFIG_IR_MCE_KBD_DECODER=m
+CONFIG_IR_LIRC_CODEC=m
+CONFIG_IR_ENE=m
+CONFIG_IR_IMON=m
+CONFIG_IR_MCEUSB=m
+CONFIG_IR_ITE_CIR=m
+CONFIG_IR_FINTEK=m
+CONFIG_IR_NUVOTON=m
+CONFIG_IR_REDRAT3=m
+CONFIG_IR_STREAMZAP=m
+CONFIG_IR_WINBOND_CIR=m
+CONFIG_RC_LOOPBACK=m
+CONFIG_MEDIA_ATTACH=y
+CONFIG_MEDIA_TUNER=m
+CONFIG_MEDIA_TUNER_CUSTOMISE=y
+
+#
+# Customize TV tuners
+#
+CONFIG_MEDIA_TUNER_SIMPLE=m
+CONFIG_MEDIA_TUNER_TDA8290=m
+CONFIG_MEDIA_TUNER_TDA827X=m
+CONFIG_MEDIA_TUNER_TDA18271=m
+CONFIG_MEDIA_TUNER_TDA9887=m
+CONFIG_MEDIA_TUNER_TEA5761=m
+CONFIG_MEDIA_TUNER_TEA5767=m
+CONFIG_MEDIA_TUNER_MT20XX=m
+CONFIG_MEDIA_TUNER_MT2060=m
+CONFIG_MEDIA_TUNER_MT2266=m
+CONFIG_MEDIA_TUNER_MT2131=m
+CONFIG_MEDIA_TUNER_QT1010=m
+CONFIG_MEDIA_TUNER_XC2028=m
+CONFIG_MEDIA_TUNER_XC5000=m
+CONFIG_MEDIA_TUNER_XC4000=m
+CONFIG_MEDIA_TUNER_MXL5005S=m
+CONFIG_MEDIA_TUNER_MXL5007T=m
+CONFIG_MEDIA_TUNER_MC44S803=m
+CONFIG_MEDIA_TUNER_MAX2165=m
+CONFIG_MEDIA_TUNER_TDA18218=m
+CONFIG_MEDIA_TUNER_TDA18212=m
+CONFIG_VIDEO_V4L2=m
+CONFIG_VIDEOBUF_GEN=m
+CONFIG_VIDEOBUF_DMA_SG=m
+CONFIG_VIDEOBUF_VMALLOC=m
+CONFIG_VIDEOBUF_DMA_CONTIG=m
+CONFIG_VIDEOBUF_DVB=m
+CONFIG_VIDEO_BTCX=m
+CONFIG_VIDEO_TVEEPROM=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_VIDEOBUF2_CORE=m
+CONFIG_VIDEOBUF2_MEMOPS=m
+CONFIG_VIDEOBUF2_DMA_CONTIG=m
+CONFIG_VIDEOBUF2_VMALLOC=m
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+CONFIG_VIDEO_IR_I2C=m
+
+#
+# Audio decoders, processors and mixers
+#
+CONFIG_VIDEO_TVAUDIO=m
+CONFIG_VIDEO_TDA7432=m
+CONFIG_VIDEO_TDA9840=m
+CONFIG_VIDEO_TEA6415C=m
+CONFIG_VIDEO_TEA6420=m
+CONFIG_VIDEO_MSP3400=m
+CONFIG_VIDEO_CS5345=m
+CONFIG_VIDEO_CS53L32A=m
+CONFIG_VIDEO_WM8775=m
+CONFIG_VIDEO_WM8739=m
+CONFIG_VIDEO_VP27SMPX=m
+
+#
+# RDS decoders
+#
+CONFIG_VIDEO_SAA6588=m
+
+#
+# Video decoders
+#
+CONFIG_VIDEO_ADV7180=m
+CONFIG_VIDEO_BT819=m
+CONFIG_VIDEO_BT856=m
+CONFIG_VIDEO_BT866=m
+CONFIG_VIDEO_KS0127=m
+CONFIG_VIDEO_SAA7110=m
+CONFIG_VIDEO_SAA711X=m
+CONFIG_VIDEO_TVP5150=m
+CONFIG_VIDEO_VPX3220=m
+
+#
+# Video and audio decoders
+#
+CONFIG_VIDEO_SAA717X=m
+CONFIG_VIDEO_CX25840=m
+
+#
+# MPEG video encoders
+#
+CONFIG_VIDEO_CX2341X=m
+
+#
+# Video encoders
+#
+CONFIG_VIDEO_SAA7127=m
+CONFIG_VIDEO_SAA7185=m
+CONFIG_VIDEO_ADV7170=m
+CONFIG_VIDEO_ADV7175=m
+
+#
+# Camera sensor devices
+#
+CONFIG_VIDEO_OV7670=m
+CONFIG_VIDEO_MT9V011=m
+
+#
+# Flash devices
+#
+
+#
+# Video improvement chips
+#
+CONFIG_VIDEO_UPD64031A=m
+CONFIG_VIDEO_UPD64083=m
+
+#
+# Miscelaneous helper chips
+#
+CONFIG_VIDEO_M52790=m
+# CONFIG_VIDEO_VIVI is not set
+CONFIG_VIDEO_BT848=m
+CONFIG_VIDEO_BT848_DVB=y
+CONFIG_VIDEO_BWQCAM=m
+CONFIG_VIDEO_CQCAM=m
+CONFIG_VIDEO_W9966=m
+CONFIG_VIDEO_CPIA2=m
+CONFIG_VIDEO_ZORAN=m
+CONFIG_VIDEO_ZORAN_DC30=m
+CONFIG_VIDEO_ZORAN_ZR36060=m
+CONFIG_VIDEO_ZORAN_BUZ=m
+CONFIG_VIDEO_ZORAN_DC10=m
+CONFIG_VIDEO_ZORAN_LML33=m
+CONFIG_VIDEO_ZORAN_LML33R10=m
+CONFIG_VIDEO_ZORAN_AVS6EYES=m
+CONFIG_VIDEO_MEYE=m
+CONFIG_VIDEO_SAA7134=m
+CONFIG_VIDEO_SAA7134_ALSA=m
+CONFIG_VIDEO_SAA7134_RC=y
+CONFIG_VIDEO_SAA7134_DVB=m
+CONFIG_VIDEO_MXB=m
+CONFIG_VIDEO_HEXIUM_ORION=m
+CONFIG_VIDEO_HEXIUM_GEMINI=m
+CONFIG_VIDEO_TIMBERDALE=m
+CONFIG_VIDEO_CX88=m
+CONFIG_VIDEO_CX88_ALSA=m
+CONFIG_VIDEO_CX88_BLACKBIRD=m
+CONFIG_VIDEO_CX88_DVB=m
+CONFIG_VIDEO_CX88_MPEG=m
+CONFIG_VIDEO_CX88_VP3054=m
+CONFIG_VIDEO_CX23885=m
+# CONFIG_MEDIA_ALTERA_CI is not set
+CONFIG_VIDEO_AU0828=m
+CONFIG_VIDEO_IVTV=m
+CONFIG_VIDEO_FB_IVTV=m
+CONFIG_VIDEO_CX18=m
+CONFIG_VIDEO_CX18_ALSA=m
+CONFIG_VIDEO_SAA7164=m
+CONFIG_VIDEO_CAFE_CCIC=m
+CONFIG_VIDEO_SR030PC30=m
+CONFIG_VIDEO_VIA_CAMERA=m
+CONFIG_VIDEO_NOON010PC30=m
+# CONFIG_VIDEO_M5MOLS is not set
+CONFIG_SOC_CAMERA=m
+CONFIG_SOC_CAMERA_IMX074=m
+CONFIG_SOC_CAMERA_MT9M001=m
+CONFIG_SOC_CAMERA_MT9M111=m
+CONFIG_SOC_CAMERA_MT9T031=m
+CONFIG_SOC_CAMERA_MT9T112=m
+CONFIG_SOC_CAMERA_MT9V022=m
+CONFIG_SOC_CAMERA_RJ54N1=m
+CONFIG_SOC_CAMERA_TW9910=m
+CONFIG_SOC_CAMERA_PLATFORM=m
+CONFIG_SOC_CAMERA_OV2640=m
+CONFIG_SOC_CAMERA_OV5642=m
+CONFIG_SOC_CAMERA_OV6650=m
+CONFIG_SOC_CAMERA_OV772X=m
+CONFIG_SOC_CAMERA_OV9640=m
+CONFIG_SOC_CAMERA_OV9740=m
+CONFIG_V4L_USB_DRIVERS=y
+CONFIG_USB_VIDEO_CLASS=m
+CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
+CONFIG_USB_GSPCA=m
+CONFIG_USB_M5602=m
+CONFIG_USB_STV06XX=m
+CONFIG_USB_GL860=m
+CONFIG_USB_GSPCA_BENQ=m
+CONFIG_USB_GSPCA_CONEX=m
+CONFIG_USB_GSPCA_CPIA1=m
+CONFIG_USB_GSPCA_ETOMS=m
+CONFIG_USB_GSPCA_FINEPIX=m
+CONFIG_USB_GSPCA_JEILINJ=m
+CONFIG_USB_GSPCA_KINECT=m
+CONFIG_USB_GSPCA_KONICA=m
+CONFIG_USB_GSPCA_MARS=m
+CONFIG_USB_GSPCA_MR97310A=m
+CONFIG_USB_GSPCA_NW80X=m
+CONFIG_USB_GSPCA_OV519=m
+CONFIG_USB_GSPCA_OV534=m
+CONFIG_USB_GSPCA_OV534_9=m
+CONFIG_USB_GSPCA_PAC207=m
+CONFIG_USB_GSPCA_PAC7302=m
+CONFIG_USB_GSPCA_PAC7311=m
+CONFIG_USB_GSPCA_SE401=m
+CONFIG_USB_GSPCA_SN9C2028=m
+CONFIG_USB_GSPCA_SN9C20X=m
+CONFIG_USB_GSPCA_SONIXB=m
+CONFIG_USB_GSPCA_SONIXJ=m
+CONFIG_USB_GSPCA_SPCA500=m
+CONFIG_USB_GSPCA_SPCA501=m
+CONFIG_USB_GSPCA_SPCA505=m
+CONFIG_USB_GSPCA_SPCA506=m
+CONFIG_USB_GSPCA_SPCA508=m
+CONFIG_USB_GSPCA_SPCA561=m
+CONFIG_USB_GSPCA_SPCA1528=m
+CONFIG_USB_GSPCA_SQ905=m
+CONFIG_USB_GSPCA_SQ905C=m
+CONFIG_USB_GSPCA_SQ930X=m
+CONFIG_USB_GSPCA_STK014=m
+CONFIG_USB_GSPCA_STV0680=m
+CONFIG_USB_GSPCA_SUNPLUS=m
+CONFIG_USB_GSPCA_T613=m
+CONFIG_USB_GSPCA_TV8532=m
+CONFIG_USB_GSPCA_VC032X=m
+CONFIG_USB_GSPCA_VICAM=m
+CONFIG_USB_GSPCA_XIRLINK_CIT=m
+CONFIG_USB_GSPCA_ZC3XX=m
+CONFIG_VIDEO_PVRUSB2=m
+CONFIG_VIDEO_PVRUSB2_SYSFS=y
+CONFIG_VIDEO_PVRUSB2_DVB=y
+# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
+CONFIG_VIDEO_HDPVR=m
+CONFIG_VIDEO_EM28XX=m
+CONFIG_VIDEO_EM28XX_ALSA=m
+CONFIG_VIDEO_EM28XX_DVB=m
+CONFIG_VIDEO_EM28XX_RC=y
+CONFIG_VIDEO_TLG2300=m
+CONFIG_VIDEO_CX231XX=m
+CONFIG_VIDEO_CX231XX_RC=y
+CONFIG_VIDEO_CX231XX_ALSA=m
+CONFIG_VIDEO_CX231XX_DVB=m
+CONFIG_VIDEO_USBVISION=m
+# CONFIG_USB_ET61X251 is not set
+# CONFIG_USB_SN9C102 is not set
+CONFIG_USB_PWC=m
+# CONFIG_USB_PWC_DEBUG is not set
+CONFIG_USB_PWC_INPUT_EVDEV=y
+CONFIG_USB_ZR364XX=m
+CONFIG_USB_STKWEBCAM=m
+CONFIG_USB_S2255=m
+CONFIG_V4L_MEM2MEM_DRIVERS=y
+# CONFIG_VIDEO_MEM2MEM_TESTDEV is not set
+CONFIG_RADIO_ADAPTERS=y
+CONFIG_RADIO_MAXIRADIO=m
+CONFIG_I2C_SI4713=m
+CONFIG_RADIO_SI4713=m
+CONFIG_USB_DSBR=m
+CONFIG_RADIO_SI470X=y
+CONFIG_USB_SI470X=m
+CONFIG_I2C_SI470X=m
+CONFIG_USB_MR800=m
+# CONFIG_RADIO_TEA5764 is not set
+# CONFIG_RADIO_SAA7706H is not set
+# CONFIG_RADIO_TEF6862 is not set
+CONFIG_RADIO_WL1273=m
+
+#
+# Texas Instruments WL128x FM driver (ST based)
+#
+# CONFIG_RADIO_WL128X is not set
+CONFIG_DVB_MAX_ADAPTERS=8
+CONFIG_DVB_DYNAMIC_MINORS=y
+CONFIG_DVB_CAPTURE_DRIVERS=y
+
+#
+# Supported SAA7146 based PCI Adapters
+#
+CONFIG_TTPCI_EEPROM=m
+CONFIG_DVB_AV7110=m
+CONFIG_DVB_AV7110_OSD=y
+CONFIG_DVB_BUDGET_CORE=m
+CONFIG_DVB_BUDGET=m
+CONFIG_DVB_BUDGET_CI=m
+CONFIG_DVB_BUDGET_AV=m
+CONFIG_DVB_BUDGET_PATCH=m
+
+#
+# Supported USB Adapters
+#
+CONFIG_DVB_USB=m
+# CONFIG_DVB_USB_DEBUG is not set
+CONFIG_DVB_USB_A800=m
+CONFIG_DVB_USB_DIBUSB_MB=m
+CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y
+CONFIG_DVB_USB_DIBUSB_MC=m
+CONFIG_DVB_USB_DIB0700=m
+CONFIG_DVB_USB_UMT_010=m
+CONFIG_DVB_USB_CXUSB=m
+CONFIG_DVB_USB_M920X=m
+CONFIG_DVB_USB_GL861=m
+CONFIG_DVB_USB_AU6610=m
+CONFIG_DVB_USB_DIGITV=m
+CONFIG_DVB_USB_VP7045=m
+CONFIG_DVB_USB_VP702X=m
+CONFIG_DVB_USB_GP8PSK=m
+CONFIG_DVB_USB_NOVA_T_USB2=m
+CONFIG_DVB_USB_TTUSB2=m
+CONFIG_DVB_USB_DTT200U=m
+CONFIG_DVB_USB_OPERA1=m
+CONFIG_DVB_USB_AF9005=m
+CONFIG_DVB_USB_AF9005_REMOTE=m
+CONFIG_DVB_USB_DW2102=m
+CONFIG_DVB_USB_CINERGY_T2=m
+CONFIG_DVB_USB_ANYSEE=m
+CONFIG_DVB_USB_DTV5100=m
+CONFIG_DVB_USB_AF9015=m
+CONFIG_DVB_USB_CE6230=m
+CONFIG_DVB_USB_FRIIO=m
+CONFIG_DVB_USB_EC168=m
+CONFIG_DVB_USB_AZ6027=m
+CONFIG_DVB_USB_LME2510=m
+CONFIG_DVB_USB_TECHNISAT_USB2=m
+CONFIG_DVB_TTUSB_BUDGET=m
+CONFIG_DVB_TTUSB_DEC=m
+CONFIG_SMS_SIANO_MDTV=m
+
+#
+# Siano module components
+#
+CONFIG_SMS_USB_DRV=m
+# CONFIG_SMS_SDIO_DRV is not set
+
+#
+# Supported FlexCopII (B2C2) Adapters
+#
+CONFIG_DVB_B2C2_FLEXCOP=m
+CONFIG_DVB_B2C2_FLEXCOP_PCI=m
+CONFIG_DVB_B2C2_FLEXCOP_USB=m
+# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set
+
+#
+# Supported BT878 Adapters
+#
+CONFIG_DVB_BT8XX=m
+
+#
+# Supported Pluto2 Adapters
+#
+CONFIG_DVB_PLUTO2=m
+
+#
+# Supported SDMC DM1105 Adapters
+#
+CONFIG_DVB_DM1105=m
+
+#
+# Supported FireWire (IEEE 1394) Adapters
+#
+CONFIG_DVB_FIREDTV=m
+CONFIG_DVB_FIREDTV_INPUT=y
+
+#
+# Supported Earthsoft PT1 Adapters
+#
+CONFIG_DVB_PT1=m
+
+#
+# Supported Mantis Adapters
+#
+CONFIG_MANTIS_CORE=m
+CONFIG_DVB_MANTIS=m
+CONFIG_DVB_HOPPER=m
+
+#
+# Supported nGene Adapters
+#
+CONFIG_DVB_NGENE=m
+
+#
+# Supported ddbridge ('Octopus') Adapters
+#
+# CONFIG_DVB_DDBRIDGE is not set
+
+#
+# Supported DVB Frontends
+#
+CONFIG_DVB_FE_CUSTOMISE=y
+
+#
+# Customise DVB Frontends
+#
+
+#
+# Multistandard (satellite) frontends
+#
+CONFIG_DVB_STB0899=m
+CONFIG_DVB_STB6100=m
+CONFIG_DVB_STV090x=m
+CONFIG_DVB_STV6110x=m
+
+#
+# Multistandard (cable + terrestrial) frontends
+#
+CONFIG_DVB_DRXK=m
+CONFIG_DVB_TDA18271C2DD=m
+
+#
+# DVB-S (satellite) frontends
+#
+CONFIG_DVB_CX24110=m
+CONFIG_DVB_CX24123=m
+CONFIG_DVB_MT312=m
+CONFIG_DVB_ZL10036=m
+CONFIG_DVB_ZL10039=m
+CONFIG_DVB_S5H1420=m
+CONFIG_DVB_STV0288=m
+CONFIG_DVB_STB6000=m
+CONFIG_DVB_STV0299=m
+CONFIG_DVB_STV6110=m
+CONFIG_DVB_STV0900=m
+CONFIG_DVB_TDA8083=m
+CONFIG_DVB_TDA10086=m
+CONFIG_DVB_TDA8261=m
+CONFIG_DVB_VES1X93=m
+CONFIG_DVB_TUNER_ITD1000=m
+CONFIG_DVB_TUNER_CX24113=m
+CONFIG_DVB_TDA826X=m
+CONFIG_DVB_TUA6100=m
+CONFIG_DVB_CX24116=m
+CONFIG_DVB_SI21XX=m
+CONFIG_DVB_DS3000=m
+CONFIG_DVB_MB86A16=m
+
+#
+# DVB-T (terrestrial) frontends
+#
+CONFIG_DVB_SP8870=m
+CONFIG_DVB_SP887X=m
+CONFIG_DVB_CX22700=m
+CONFIG_DVB_CX22702=m
+CONFIG_DVB_S5H1432=m
+CONFIG_DVB_DRXD=m
+CONFIG_DVB_L64781=m
+CONFIG_DVB_TDA1004X=m
+CONFIG_DVB_NXT6000=m
+CONFIG_DVB_MT352=m
+CONFIG_DVB_ZL10353=m
+CONFIG_DVB_DIB3000MB=m
+CONFIG_DVB_DIB3000MC=m
+CONFIG_DVB_DIB7000M=m
+CONFIG_DVB_DIB7000P=m
+CONFIG_DVB_DIB9000=m
+CONFIG_DVB_TDA10048=m
+CONFIG_DVB_AF9013=m
+CONFIG_DVB_EC100=m
+CONFIG_DVB_STV0367=m
+CONFIG_DVB_CXD2820R=m
+
+#
+# DVB-C (cable) frontends
+#
+CONFIG_DVB_VES1820=m
+CONFIG_DVB_TDA10021=m
+CONFIG_DVB_TDA10023=m
+CONFIG_DVB_STV0297=m
+
+#
+# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
+#
+CONFIG_DVB_NXT200X=m
+CONFIG_DVB_OR51211=m
+CONFIG_DVB_OR51132=m
+CONFIG_DVB_BCM3510=m
+CONFIG_DVB_LGDT330X=m
+CONFIG_DVB_LGDT3305=m
+CONFIG_DVB_S5H1409=m
+CONFIG_DVB_AU8522=m
+CONFIG_DVB_S5H1411=m
+
+#
+# ISDB-T (terrestrial) frontends
+#
+CONFIG_DVB_S921=m
+CONFIG_DVB_DIB8000=m
+CONFIG_DVB_MB86A20S=m
+
+#
+# Digital terrestrial only tuners/PLL
+#
+CONFIG_DVB_PLL=m
+CONFIG_DVB_TUNER_DIB0070=m
+CONFIG_DVB_TUNER_DIB0090=m
+
+#
+# SEC control devices for DVB-S
+#
+CONFIG_DVB_LNBP21=m
+CONFIG_DVB_ISL6405=m
+CONFIG_DVB_ISL6421=m
+CONFIG_DVB_ISL6423=m
+CONFIG_DVB_LGS8GL5=m
+CONFIG_DVB_LGS8GXX=m
+CONFIG_DVB_ATBM8830=m
+CONFIG_DVB_TDA665x=m
+CONFIG_DVB_IX2505V=m
+
+#
+# Tools to develop new frontends
+#
+# CONFIG_DVB_DUMMY_FE is not set
+
+#
+# Graphics support
+#
+CONFIG_AGP=y
+CONFIG_AGP_ALI=y
+CONFIG_AGP_ATI=y
+CONFIG_AGP_AMD=y
+CONFIG_AGP_AMD64=y
+CONFIG_AGP_INTEL=y
+CONFIG_AGP_NVIDIA=y
+CONFIG_AGP_SIS=y
+CONFIG_AGP_SWORKS=y
+CONFIG_AGP_VIA=y
+CONFIG_AGP_EFFICEON=y
+CONFIG_VGA_ARB=y
+CONFIG_VGA_ARB_MAX_GPUS=16
+CONFIG_VGA_SWITCHEROO=y
+CONFIG_DRM=m
+CONFIG_DRM_KMS_HELPER=m
+CONFIG_DRM_TTM=m
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_RADEON_KMS=y
+CONFIG_DRM_I810=m
+CONFIG_DRM_I915=m
+CONFIG_DRM_I915_KMS=y
+CONFIG_DRM_MGA=m
+CONFIG_DRM_SIS=m
+CONFIG_DRM_VIA=m
+CONFIG_DRM_SAVAGE=m
+CONFIG_STUB_POULSBO=m
+CONFIG_VGASTATE=m
+CONFIG_VIDEO_OUTPUT_CONTROL=m
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+CONFIG_FB_DDC=m
+CONFIG_FB_BOOT_VESA_SUPPORT=y
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+CONFIG_FB_SYS_FILLRECT=m
+CONFIG_FB_SYS_COPYAREA=m
+CONFIG_FB_SYS_IMAGEBLIT=m
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+CONFIG_FB_SYS_FOPS=m
+# CONFIG_FB_WMT_GE_ROPS is not set
+CONFIG_FB_DEFERRED_IO=y
+CONFIG_FB_SVGALIB=m
+# CONFIG_FB_MACMODES is not set
+CONFIG_FB_BACKLIGHT=y
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+
+#
+# Frame buffer hardware drivers
+#
+CONFIG_FB_CIRRUS=m
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ARC is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+CONFIG_FB_VGA16=m
+# CONFIG_FB_UVESA is not set
+CONFIG_FB_VESA=y
+CONFIG_FB_EFI=y
+# CONFIG_FB_N411 is not set
+# CONFIG_FB_HGA is not set
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_NVIDIA=m
+CONFIG_FB_NVIDIA_I2C=y
+# CONFIG_FB_NVIDIA_DEBUG is not set
+CONFIG_FB_NVIDIA_BACKLIGHT=y
+CONFIG_FB_RIVA=m
+# CONFIG_FB_RIVA_I2C is not set
+# CONFIG_FB_RIVA_DEBUG is not set
+CONFIG_FB_RIVA_BACKLIGHT=y
+CONFIG_FB_I810=m
+CONFIG_FB_I810_GTF=y
+CONFIG_FB_I810_I2C=y
+# CONFIG_FB_LE80578 is not set
+CONFIG_FB_MATROX=m
+CONFIG_FB_MATROX_MILLENIUM=y
+CONFIG_FB_MATROX_MYSTIQUE=y
+CONFIG_FB_MATROX_G=y
+CONFIG_FB_MATROX_I2C=m
+CONFIG_FB_MATROX_MAVEN=m
+CONFIG_FB_RADEON=m
+CONFIG_FB_RADEON_I2C=y
+CONFIG_FB_RADEON_BACKLIGHT=y
+# CONFIG_FB_RADEON_DEBUG is not set
+CONFIG_FB_ATY128=m
+CONFIG_FB_ATY128_BACKLIGHT=y
+CONFIG_FB_ATY=m
+CONFIG_FB_ATY_CT=y
+CONFIG_FB_ATY_GENERIC_LCD=y
+CONFIG_FB_ATY_GX=y
+CONFIG_FB_ATY_BACKLIGHT=y
+CONFIG_FB_S3=m
+CONFIG_FB_S3_DDC=y
+CONFIG_FB_SAVAGE=m
+CONFIG_FB_SAVAGE_I2C=y
+CONFIG_FB_SAVAGE_ACCEL=y
+# CONFIG_FB_SIS is not set
+CONFIG_FB_VIA=m
+# CONFIG_FB_VIA_DIRECT_PROCFS is not set
+CONFIG_FB_VIA_X_COMPATIBILITY=y
+CONFIG_FB_NEOMAGIC=m
+CONFIG_FB_KYRO=m
+CONFIG_FB_3DFX=m
+CONFIG_FB_3DFX_ACCEL=y
+CONFIG_FB_3DFX_I2C=y
+CONFIG_FB_VOODOO1=m
+# CONFIG_FB_VT8623 is not set
+CONFIG_FB_TRIDENT=m
+# CONFIG_FB_ARK is not set
+# CONFIG_FB_PM3 is not set
+# CONFIG_FB_CARMINE is not set
+CONFIG_FB_GEODE=y
+CONFIG_FB_GEODE_LX=y
+CONFIG_FB_GEODE_GX=y
+# CONFIG_FB_GEODE_GX1 is not set
+# CONFIG_FB_TMIO is not set
+CONFIG_FB_SM501=m
+CONFIG_FB_UDL=m
+CONFIG_FB_VIRTUAL=m
+CONFIG_FB_METRONOME=m
+CONFIG_FB_MB862XX=m
+CONFIG_FB_MB862XX_PCI_GDC=y
+CONFIG_FB_MB862XX_I2C=y
+# CONFIG_FB_BROADSHEET is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=m
+CONFIG_LCD_PLATFORM=m
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+# CONFIG_BACKLIGHT_GENERIC is not set
+CONFIG_BACKLIGHT_PROGEAR=m
+CONFIG_BACKLIGHT_APPLE=m
+# CONFIG_BACKLIGHT_SAHARA is not set
+# CONFIG_BACKLIGHT_ADP8860 is not set
+# CONFIG_BACKLIGHT_ADP8870 is not set
+
+#
+# Display device support
+#
+CONFIG_DISPLAY_SUPPORT=m
+
+#
+# Display hardware drivers
+#
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+CONFIG_VGACON_SOFT_SCROLLBACK=y
+CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=128
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_LOGO_LINUX_CLUT224=y
+CONFIG_SOUND=m
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SOUND_OSS_CORE_PRECLAIM=y
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
+CONFIG_SND_JACK=y
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PCM_OSS_PLUGINS=y
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SND_HRTIMER=m
+CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
+CONFIG_SND_DYNAMIC_MINORS=y
+# CONFIG_SND_SUPPORT_OLD_API is not set
+CONFIG_SND_VERBOSE_PROCFS=y
+CONFIG_SND_VERBOSE_PRINTK=y
+CONFIG_SND_DEBUG=y
+# CONFIG_SND_DEBUG_VERBOSE is not set
+CONFIG_SND_PCM_XRUN_DEBUG=y
+CONFIG_SND_VMASTER=y
+CONFIG_SND_DMA_SGBUF=y
+CONFIG_SND_RAWMIDI_SEQ=m
+CONFIG_SND_OPL3_LIB_SEQ=m
+# CONFIG_SND_OPL4_LIB_SEQ is not set
+# CONFIG_SND_SBAWE_SEQ is not set
+CONFIG_SND_EMU10K1_SEQ=m
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_DRIVERS=y
+CONFIG_SND_PCSP=m
+CONFIG_SND_DUMMY=m
+CONFIG_SND_ALOOP=m
+CONFIG_SND_VIRMIDI=m
+CONFIG_SND_MTPAV=m
+CONFIG_SND_MTS64=m
+CONFIG_SND_SERIAL_U16550=m
+CONFIG_SND_MPU401=m
+CONFIG_SND_PORTMAN2X4=m
+CONFIG_SND_AC97_POWER_SAVE=y
+CONFIG_SND_AC97_POWER_SAVE_DEFAULT=0
+CONFIG_SND_SB_COMMON=m
+CONFIG_SND_SB16_DSP=m
+CONFIG_SND_TEA575X=m
+CONFIG_SND_PCI=y
+CONFIG_SND_AD1889=m
+CONFIG_SND_ALS300=m
+CONFIG_SND_ALS4000=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ASIHPI=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_ATIIXP_MODEM=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+# CONFIG_SND_AW2 is not set
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+# CONFIG_SND_BT87X_OVERCLOCK is not set
+CONFIG_SND_CA0106=m
+CONFIG_SND_CMIPCI=m
+CONFIG_SND_OXYGEN_LIB=m
+CONFIG_SND_OXYGEN=m
+CONFIG_SND_CS4281=m
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_CS5530=m
+CONFIG_SND_CS5535AUDIO=m
+CONFIG_SND_CTXFI=m
+CONFIG_SND_DARLA20=m
+CONFIG_SND_GINA20=m
+CONFIG_SND_LAYLA20=m
+CONFIG_SND_DARLA24=m
+CONFIG_SND_GINA24=m
+CONFIG_SND_LAYLA24=m
+CONFIG_SND_MONA=m
+CONFIG_SND_MIA=m
+CONFIG_SND_ECHO3G=m
+CONFIG_SND_INDIGO=m
+CONFIG_SND_INDIGOIO=m
+CONFIG_SND_INDIGODJ=m
+CONFIG_SND_INDIGOIOX=m
+CONFIG_SND_INDIGODJX=m
+CONFIG_SND_EMU10K1=m
+CONFIG_SND_EMU10K1X=m
+CONFIG_SND_ENS1370=m
+CONFIG_SND_ENS1371=m
+CONFIG_SND_ES1938=m
+CONFIG_SND_ES1968=m
+CONFIG_SND_ES1968_INPUT=y
+CONFIG_SND_ES1968_RADIO=y
+CONFIG_SND_FM801=m
+CONFIG_SND_FM801_TEA575X_BOOL=y
+CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_HDA_PREALLOC_SIZE=64
+CONFIG_SND_HDA_HWDEP=y
+CONFIG_SND_HDA_RECONFIG=y
+CONFIG_SND_HDA_INPUT_BEEP=y
+CONFIG_SND_HDA_INPUT_BEEP_MODE=1
+CONFIG_SND_HDA_INPUT_JACK=y
+# CONFIG_SND_HDA_PATCH_LOADER is not set
+CONFIG_SND_HDA_CODEC_REALTEK=y
+CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS=y
+CONFIG_SND_HDA_CODEC_ANALOG=y
+CONFIG_SND_HDA_CODEC_SIGMATEL=y
+CONFIG_SND_HDA_CODEC_VIA=y
+CONFIG_SND_HDA_CODEC_HDMI=y
+CONFIG_SND_HDA_CODEC_CIRRUS=y
+CONFIG_SND_HDA_CODEC_CONEXANT=y
+CONFIG_SND_HDA_CODEC_CA0110=y
+CONFIG_SND_HDA_CODEC_CA0132=y
+CONFIG_SND_HDA_CODEC_CMEDIA=y
+CONFIG_SND_HDA_CODEC_SI3054=y
+CONFIG_SND_HDA_GENERIC=y
+# CONFIG_SND_HDA_POWER_SAVE is not set
+CONFIG_SND_HDSP=m
+CONFIG_SND_HDSPM=m
+CONFIG_SND_ICE1712=m
+CONFIG_SND_ICE1724=m
+CONFIG_SND_INTEL8X0=m
+CONFIG_SND_INTEL8X0M=m
+CONFIG_SND_KORG1212=m
+CONFIG_SND_LOLA=m
+CONFIG_SND_LX6464ES=m
+CONFIG_SND_MAESTRO3=m
+CONFIG_SND_MAESTRO3_INPUT=y
+CONFIG_SND_MIXART=m
+CONFIG_SND_NM256=m
+CONFIG_SND_PCXHR=m
+CONFIG_SND_RIPTIDE=m
+CONFIG_SND_RME32=m
+CONFIG_SND_RME96=m
+CONFIG_SND_RME9652=m
+CONFIG_SND_SIS7019=m
+CONFIG_SND_SONICVIBES=m
+CONFIG_SND_TRIDENT=m
+CONFIG_SND_VIA82XX=m
+CONFIG_SND_VIA82XX_MODEM=m
+CONFIG_SND_VIRTUOSO=m
+CONFIG_SND_VX222=m
+CONFIG_SND_YMFPCI=m
+CONFIG_SND_USB=y
+CONFIG_SND_USB_AUDIO=m
+CONFIG_SND_USB_UA101=m
+CONFIG_SND_USB_USX2Y=m
+CONFIG_SND_USB_CAIAQ=m
+CONFIG_SND_USB_CAIAQ_INPUT=y
+CONFIG_SND_USB_US122L=m
+CONFIG_SND_USB_6FIRE=m
+CONFIG_SND_FIREWIRE=y
+CONFIG_SND_FIREWIRE_LIB=m
+CONFIG_SND_FIREWIRE_SPEAKERS=m
+# CONFIG_SND_ISIGHT is not set
+# CONFIG_SND_SOC is not set
+# CONFIG_SOUND_PRIME is not set
+CONFIG_AC97_BUS=m
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+CONFIG_HIDRAW=y
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+CONFIG_HID_PID=y
+CONFIG_USB_HIDDEV=y
+
+#
+# Special HID drivers
+#
+CONFIG_HID_A4TECH=y
+# CONFIG_HID_ACRUX is not set
+CONFIG_HID_APPLE=y
+CONFIG_HID_BELKIN=y
+CONFIG_HID_CHERRY=y
+CONFIG_HID_CHICONY=y
+# CONFIG_HID_PRODIKEYS is not set
+CONFIG_HID_CYPRESS=y
+# CONFIG_HID_DRAGONRISE is not set
+# CONFIG_HID_EMS_FF is not set
+# CONFIG_HID_ELECOM is not set
+CONFIG_HID_EZKEY=y
+# CONFIG_HID_HOLTEK is not set
+CONFIG_HID_KEYTOUCH=m
+CONFIG_HID_KYE=y
+# CONFIG_HID_UCLOGIC is not set
+# CONFIG_HID_WALTOP is not set
+CONFIG_HID_GYRATION=m
+CONFIG_HID_TWINHAN=m
+CONFIG_HID_KENSINGTON=y
+CONFIG_HID_LCPOWER=m
+CONFIG_HID_LOGITECH=y
+# CONFIG_LOGITECH_FF is not set
+# CONFIG_LOGIRUMBLEPAD2_FF is not set
+# CONFIG_LOGIG940_FF is not set
+# CONFIG_LOGIWII_FF is not set
+# CONFIG_HID_MAGICMOUSE is not set
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_MONTEREY=y
+# CONFIG_HID_MULTITOUCH is not set
+# CONFIG_HID_NTRIG is not set
+CONFIG_HID_ORTEK=m
+# CONFIG_HID_PANTHERLORD is not set
+CONFIG_HID_PETALYNX=m
+CONFIG_HID_PICOLCD=m
+CONFIG_HID_PICOLCD_FB=y
+CONFIG_HID_PICOLCD_BACKLIGHT=y
+CONFIG_HID_PICOLCD_LCD=y
+CONFIG_HID_PICOLCD_LEDS=y
+# CONFIG_HID_QUANTA is not set
+CONFIG_HID_ROCCAT=m
+CONFIG_HID_ROCCAT_COMMON=m
+CONFIG_HID_ROCCAT_ARVO=m
+CONFIG_HID_ROCCAT_KONE=m
+CONFIG_HID_ROCCAT_KONEPLUS=m
+CONFIG_HID_ROCCAT_KOVAPLUS=m
+CONFIG_HID_ROCCAT_PYRA=m
+CONFIG_HID_SAMSUNG=m
+# CONFIG_HID_SONY is not set
+CONFIG_HID_SPEEDLINK=m
+CONFIG_HID_SUNPLUS=m
+# CONFIG_HID_GREENASIA is not set
+# CONFIG_HID_SMARTJOYPLUS is not set
+CONFIG_HID_TOPSEED=m
+# CONFIG_HID_THRUSTMASTER is not set
+# CONFIG_HID_WACOM is not set
+# CONFIG_HID_WIIMOTE is not set
+# CONFIG_HID_ZEROPLUS is not set
+CONFIG_HID_ZYDACRON=m
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DEVICE_CLASS is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+CONFIG_USB_SUSPEND=y
+# CONFIG_USB_OTG is not set
+CONFIG_USB_MON=m
+CONFIG_USB_WUSB=m
+CONFIG_USB_WUSB_CBAF=m
+# CONFIG_USB_WUSB_CBAF_DEBUG is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+CONFIG_USB_XHCI_HCD=m
+# CONFIG_USB_XHCI_HCD_DEBUGGING is not set
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+CONFIG_USB_EHCI_TT_NEWSCHED=y
+# CONFIG_USB_OXU210HP_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
+CONFIG_USB_ISP1362_HCD=m
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=y
+# CONFIG_USB_U132_HCD is not set
+CONFIG_USB_SL811_HCD=m
+CONFIG_USB_SL811_HCD_ISO=y
+# CONFIG_USB_R8A66597_HCD is not set
+CONFIG_USB_WHCI_HCD=m
+CONFIG_USB_HWA_HCD=m
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_WDM=m
+CONFIG_USB_TMC=m
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
+#
+
+#
+# also be needed; see USB_STORAGE Help for more info
+#
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_REALTEK=m
+CONFIG_REALTEK_AUTOPM=y
+CONFIG_USB_STORAGE_DATAFAB=m
+CONFIG_USB_STORAGE_FREECOM=m
+CONFIG_USB_STORAGE_ISD200=m
+CONFIG_USB_STORAGE_USBAT=m
+CONFIG_USB_STORAGE_SDDR09=m
+CONFIG_USB_STORAGE_SDDR55=m
+CONFIG_USB_STORAGE_JUMPSHOT=m
+CONFIG_USB_STORAGE_ALAUDA=m
+CONFIG_USB_STORAGE_ONETOUCH=m
+CONFIG_USB_STORAGE_KARMA=m
+CONFIG_USB_STORAGE_CYPRESS_ATACB=m
+CONFIG_USB_STORAGE_ENE_UB6250=m
+CONFIG_USB_UAS=m
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+
+#
+# USB port drivers
+#
+CONFIG_USB_USS720=m
+CONFIG_USB_SERIAL=m
+CONFIG_USB_EZUSB=y
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_AIRCABLE=m
+CONFIG_USB_SERIAL_ARK3116=m
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_CH341=m
+CONFIG_USB_SERIAL_WHITEHEAT=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_CP210X=m
+CONFIG_USB_SERIAL_CYPRESS_M8=m
+# CONFIG_USB_SERIAL_EMPEG is not set
+CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_FUNSOFT=m
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+CONFIG_USB_SERIAL_IR=m
+CONFIG_USB_SERIAL_EDGEPORT=m
+CONFIG_USB_SERIAL_EDGEPORT_TI=m
+# CONFIG_USB_SERIAL_GARMIN is not set
+CONFIG_USB_SERIAL_IPW=m
+CONFIG_USB_SERIAL_IUU=m
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+CONFIG_USB_SERIAL_KLSI=m
+# CONFIG_USB_SERIAL_KOBIL_SCT is not set
+CONFIG_USB_SERIAL_MCT_U232=m
+CONFIG_USB_SERIAL_MOS7720=m
+CONFIG_USB_SERIAL_MOS7715_PARPORT=y
+CONFIG_USB_SERIAL_MOS7840=m
+CONFIG_USB_SERIAL_MOTOROLA=m
+# CONFIG_USB_SERIAL_NAVMAN is not set
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_OTI6858=m
+CONFIG_USB_SERIAL_QCAUX=m
+CONFIG_USB_SERIAL_QUALCOMM=m
+CONFIG_USB_SERIAL_SPCP8X5=m
+# CONFIG_USB_SERIAL_HP4X is not set
+# CONFIG_USB_SERIAL_SAFE is not set
+CONFIG_USB_SERIAL_SIEMENS_MPI=m
+CONFIG_USB_SERIAL_SIERRAWIRELESS=m
+# CONFIG_USB_SERIAL_SYMBOL is not set
+# CONFIG_USB_SERIAL_TI is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_WWAN=m
+CONFIG_USB_SERIAL_OPTION=m
+# CONFIG_USB_SERIAL_OMNINET is not set
+# CONFIG_USB_SERIAL_OPTICON is not set
+# CONFIG_USB_SERIAL_VIVOPAY_SERIAL is not set
+# CONFIG_USB_SERIAL_ZIO is not set
+CONFIG_USB_SERIAL_SSU100=m
+# CONFIG_USB_SERIAL_DEBUG is not set
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
+CONFIG_USB_ADUTUX=m
+CONFIG_USB_SEVSEG=m
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_IDMOUSE is not set
+CONFIG_USB_FTDI_ELAN=m
+# CONFIG_USB_APPLEDISPLAY is not set
+CONFIG_USB_SISUSBVGA=m
+CONFIG_USB_SISUSBVGA_CON=y
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+CONFIG_USB_IOWARRIOR=m
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_ISIGHTFW is not set
+CONFIG_USB_YUREX=m
+CONFIG_USB_ATM=m
+CONFIG_USB_SPEEDTOUCH=m
+CONFIG_USB_CXACRU=m
+CONFIG_USB_UEAGLEATM=m
+CONFIG_USB_XUSBATM=m
+# CONFIG_USB_GADGET is not set
+
+#
+# OTG and related infrastructure
+#
+CONFIG_USB_OTG_UTILS=y
+# CONFIG_USB_GPIO_VBUS is not set
+CONFIG_NOP_USB_XCEIV=m
+CONFIG_UWB=m
+CONFIG_UWB_HWA=m
+CONFIG_UWB_WHCI=m
+CONFIG_UWB_I1480U=m
+CONFIG_MMC=m
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+# CONFIG_MMC_CLKGATE is not set
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=m
+CONFIG_MMC_BLOCK_MINORS=8
+CONFIG_MMC_BLOCK_BOUNCE=y
+CONFIG_SDIO_UART=m
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+CONFIG_MMC_SDHCI=m
+CONFIG_MMC_SDHCI_PCI=m
+CONFIG_MMC_RICOH_MMC=y
+CONFIG_MMC_SDHCI_PLTFM=m
+CONFIG_MMC_WBSD=m
+CONFIG_MMC_TIFM_SD=m
+CONFIG_MMC_CB710=m
+CONFIG_MMC_VIA_SDMMC=m
+CONFIG_MMC_VUB300=m
+CONFIG_MMC_USHC=m
+CONFIG_MEMSTICK=m
+# CONFIG_MEMSTICK_DEBUG is not set
+
+#
+# MemoryStick drivers
+#
+# CONFIG_MEMSTICK_UNSAFE_RESUME is not set
+CONFIG_MSPRO_BLOCK=m
+
+#
+# MemoryStick Host Controller Drivers
+#
+CONFIG_MEMSTICK_TIFM_MS=m
+CONFIG_MEMSTICK_JMICRON_38X=m
+CONFIG_MEMSTICK_R592=m
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+CONFIG_LEDS_LM3530=m
+CONFIG_LEDS_ALIX2=m
+# CONFIG_LEDS_PCA9532 is not set
+# CONFIG_LEDS_GPIO is not set
+CONFIG_LEDS_LP3944=m
+CONFIG_LEDS_LP5521=m
+CONFIG_LEDS_LP5523=m
+CONFIG_LEDS_CLEVO_MAIL=m
+# CONFIG_LEDS_PCA955X is not set
+# CONFIG_LEDS_BD2802 is not set
+CONFIG_LEDS_INTEL_SS4200=m
+CONFIG_LEDS_LT3593=m
+CONFIG_LEDS_DELL_NETBOOKS=m
+CONFIG_LEDS_TRIGGERS=y
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGER_TIMER=m
+CONFIG_LEDS_TRIGGER_HEARTBEAT=m
+CONFIG_LEDS_TRIGGER_BACKLIGHT=m
+CONFIG_LEDS_TRIGGER_GPIO=m
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
+
+#
+# iptables trigger is under Netfilter config (LED target)
+#
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_INFINIBAND is not set
+CONFIG_EDAC=y
+
+#
+# Reporting subsystems
+#
+# CONFIG_EDAC_DEBUG is not set
+CONFIG_EDAC_DECODE_MCE=m
+CONFIG_EDAC_MCE_INJ=m
+CONFIG_EDAC_MM_EDAC=m
+CONFIG_EDAC_MCE=y
+CONFIG_EDAC_AMD76X=m
+CONFIG_EDAC_E7XXX=m
+CONFIG_EDAC_E752X=m
+CONFIG_EDAC_I82875P=m
+CONFIG_EDAC_I82975X=m
+CONFIG_EDAC_I3000=m
+CONFIG_EDAC_I3200=m
+CONFIG_EDAC_X38=m
+CONFIG_EDAC_I5400=m
+CONFIG_EDAC_I7CORE=m
+CONFIG_EDAC_I82860=m
+CONFIG_EDAC_R82600=m
+CONFIG_EDAC_I5000=m
+CONFIG_EDAC_I5100=m
+CONFIG_EDAC_I7300=m
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+CONFIG_RTC_DRV_DS1307=m
+CONFIG_RTC_DRV_DS1374=m
+CONFIG_RTC_DRV_DS1672=m
+CONFIG_RTC_DRV_DS3232=m
+CONFIG_RTC_DRV_MAX6900=m
+CONFIG_RTC_DRV_RS5C372=m
+CONFIG_RTC_DRV_ISL1208=m
+CONFIG_RTC_DRV_ISL12022=m
+CONFIG_RTC_DRV_X1205=m
+CONFIG_RTC_DRV_PCF8563=m
+CONFIG_RTC_DRV_PCF8583=m
+CONFIG_RTC_DRV_M41T80=m
+CONFIG_RTC_DRV_M41T80_WDT=y
+CONFIG_RTC_DRV_BQ32K=m
+# CONFIG_RTC_DRV_S35390A is not set
+CONFIG_RTC_DRV_FM3130=m
+CONFIG_RTC_DRV_RX8581=m
+CONFIG_RTC_DRV_RX8025=m
+CONFIG_RTC_DRV_EM3027=m
+CONFIG_RTC_DRV_RV3029C2=m
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+CONFIG_RTC_DRV_CMOS=y
+CONFIG_RTC_DRV_DS1286=m
+CONFIG_RTC_DRV_DS1511=m
+CONFIG_RTC_DRV_DS1553=m
+CONFIG_RTC_DRV_DS1742=m
+CONFIG_RTC_DRV_STK17TA8=m
+# CONFIG_RTC_DRV_M48T86 is not set
+CONFIG_RTC_DRV_M48T35=m
+CONFIG_RTC_DRV_M48T59=m
+CONFIG_RTC_DRV_MSM6242=m
+CONFIG_RTC_DRV_BQ4802=m
+CONFIG_RTC_DRV_RP5C01=m
+CONFIG_RTC_DRV_V3020=m
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_DMADEVICES=y
+# CONFIG_DMADEVICES_DEBUG is not set
+
+#
+# DMA Devices
+#
+# CONFIG_INTEL_MID_DMAC is not set
+CONFIG_INTEL_IOATDMA=m
+CONFIG_TIMB_DMA=m
+CONFIG_PCH_DMA=m
+CONFIG_DMA_ENGINE=y
+
+#
+# DMA Clients
+#
+CONFIG_NET_DMA=y
+CONFIG_ASYNC_TX_DMA=y
+# CONFIG_DMATEST is not set
+CONFIG_DCA=m
+# CONFIG_AUXDISPLAY is not set
+CONFIG_UIO=m
+# CONFIG_UIO_CIF is not set
+# CONFIG_UIO_PDRV is not set
+# CONFIG_UIO_PDRV_GENIRQ is not set
+CONFIG_UIO_AEC=m
+CONFIG_UIO_SERCOS3=m
+CONFIG_UIO_PCI_GENERIC=m
+# CONFIG_UIO_NETX is not set
+CONFIG_VIRTIO=m
+CONFIG_VIRTIO_RING=m
+
+#
+# Virtio drivers
+#
+CONFIG_VIRTIO_PCI=m
+CONFIG_VIRTIO_BALLOON=m
+CONFIG_STAGING=y
+CONFIG_ET131X=m
+# CONFIG_ET131X_DEBUG is not set
+# CONFIG_SLICOSS is not set
+# CONFIG_VIDEO_GO7007 is not set
+# CONFIG_VIDEO_CX25821 is not set
+# CONFIG_VIDEO_TM6000 is not set
+# CONFIG_DVB_CXD2099 is not set
+# CONFIG_USBIP_CORE is not set
+# CONFIG_W35UND is not set
+# CONFIG_PRISM2_USB is not set
+# CONFIG_ECHO is not set
+# CONFIG_BRCMUTIL is not set
+# CONFIG_BRCMSMAC is not set
+# CONFIG_BRCMFMAC is not set
+# CONFIG_COMEDI is not set
+# CONFIG_ASUS_OLED is not set
+# CONFIG_PANEL is not set
+# CONFIG_R8187SE is not set
+# CONFIG_RTL8192U is not set
+# CONFIG_RTL8192E is not set
+# CONFIG_R8712U is not set
+# CONFIG_RTS_PSTOR is not set
+# CONFIG_TRANZPORT is not set
+# CONFIG_POHMELFS is not set
+# CONFIG_IDE_PHISON is not set
+# CONFIG_LINE6_USB is not set
+CONFIG_DRM_VMWGFX=m
+CONFIG_DRM_NOUVEAU=m
+CONFIG_DRM_NOUVEAU_BACKLIGHT=y
+CONFIG_DRM_NOUVEAU_DEBUG=y
+
+#
+# I2C encoder or helper chips
+#
+# CONFIG_DRM_I2C_CH7006 is not set
+# CONFIG_DRM_I2C_SIL164 is not set
+# CONFIG_USB_SERIAL_QUATECH2 is not set
+# CONFIG_USB_SERIAL_QUATECH_USB2 is not set
+# CONFIG_VT6655 is not set
+# CONFIG_VT6656 is not set
+CONFIG_HYPERV=m
+CONFIG_HYPERV_STORAGE=m
+CONFIG_HYPERV_BLOCK=m
+CONFIG_HYPERV_NET=m
+CONFIG_HYPERV_UTILS=m
+CONFIG_HYPERV_MOUSE=m
+# CONFIG_VME_BUS is not set
+# CONFIG_DX_SEP is not set
+# CONFIG_IIO is not set
+# CONFIG_XVMALLOC is not set
+# CONFIG_ZRAM is not set
+# CONFIG_ZCACHE is not set
+# CONFIG_FB_SM7XX is not set
+# CONFIG_VIDEO_DT3155 is not set
+# CONFIG_CRYSTALHD is not set
+# CONFIG_FB_XGI is not set
+# CONFIG_LIRC_STAGING is not set
+# CONFIG_EASYCAP is not set
+# CONFIG_SOLO6X10 is not set
+# CONFIG_ACPI_QUICKSTART is not set
+# CONFIG_ATH6K_LEGACY is not set
+# CONFIG_USB_ENESTORAGE is not set
+# CONFIG_BCM_WIMAX is not set
+# CONFIG_FT1000 is not set
+
+#
+# Speakup console speech
+#
+# CONFIG_SPEAKUP is not set
+# CONFIG_TOUCHSCREEN_CLEARPAD_TM1217 is not set
+# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set
+# CONFIG_DRM_PSB is not set
+# CONFIG_ALTERA_STAPL is not set
+# CONFIG_INTEL_MEI is not set
+CONFIG_X86_PLATFORM_DEVICES=y
+CONFIG_ACER_WMI=m
+CONFIG_ACERHDF=m
+CONFIG_ASUS_LAPTOP=m
+CONFIG_DELL_LAPTOP=m
+CONFIG_DELL_WMI=m
+CONFIG_DELL_WMI_AIO=m
+CONFIG_FUJITSU_LAPTOP=m
+# CONFIG_FUJITSU_LAPTOP_DEBUG is not set
+CONFIG_TC1100_WMI=m
+CONFIG_HP_ACCEL=m
+CONFIG_HP_WMI=m
+CONFIG_MSI_LAPTOP=m
+CONFIG_PANASONIC_LAPTOP=m
+CONFIG_COMPAL_LAPTOP=m
+CONFIG_SONY_LAPTOP=m
+CONFIG_SONYPI_COMPAT=y
+CONFIG_IDEAPAD_LAPTOP=m
+CONFIG_THINKPAD_ACPI=m
+CONFIG_THINKPAD_ACPI_ALSA_SUPPORT=y
+# CONFIG_THINKPAD_ACPI_DEBUGFACILITIES is not set
+# CONFIG_THINKPAD_ACPI_DEBUG is not set
+# CONFIG_THINKPAD_ACPI_UNSAFE_LEDS is not set
+CONFIG_THINKPAD_ACPI_VIDEO=y
+CONFIG_THINKPAD_ACPI_HOTKEY_POLL=y
+CONFIG_SENSORS_HDAPS=m
+# CONFIG_INTEL_MENLOW is not set
+CONFIG_EEEPC_LAPTOP=m
+CONFIG_ASUS_WMI=m
+CONFIG_ASUS_NB_WMI=m
+CONFIG_EEEPC_WMI=m
+CONFIG_ACPI_WMI=m
+CONFIG_MSI_WMI=m
+# CONFIG_ACPI_ASUS is not set
+CONFIG_TOPSTAR_LAPTOP=m
+CONFIG_ACPI_TOSHIBA=m
+CONFIG_TOSHIBA_BT_RFKILL=m
+CONFIG_ACPI_CMPC=m
+CONFIG_INTEL_IPS=m
+# CONFIG_IBM_RTL is not set
+CONFIG_XO15_EBOOK=m
+CONFIG_SAMSUNG_LAPTOP=m
+CONFIG_MXM_WMI=m
+CONFIG_INTEL_OAKTRAIL=m
+CONFIG_SAMSUNG_Q10=m
+CONFIG_CLKSRC_I8253=y
+CONFIG_CLKEVT_I8253=y
+CONFIG_I8253_LOCK=y
+CONFIG_CLKBLD_I8253=y
+CONFIG_IOMMU_API=y
+CONFIG_IOMMU_SUPPORT=y
+CONFIG_DMAR=y
+CONFIG_DMAR_DEFAULT_ON=y
+CONFIG_DMAR_FLOPPY_WA=y
+CONFIG_VIRT_DRIVERS=y
+
+#
+# Firmware Drivers
+#
+CONFIG_EDD=m
+# CONFIG_EDD_OFF is not set
+CONFIG_FIRMWARE_MEMMAP=y
+CONFIG_EFI_VARS=y
+CONFIG_DELL_RBU=m
+CONFIG_DCDBAS=m
+CONFIG_DMIID=y
+CONFIG_DMI_SYSFS=y
+# CONFIG_ISCSI_IBFT_FIND is not set
+# CONFIG_SIGMA is not set
+# CONFIG_GOOGLE_FIRMWARE is not set
+
+#
+# File systems
+#
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+CONFIG_EXT4_FS=y
+CONFIG_EXT4_USE_FOR_EXT23=y
+CONFIG_EXT4_FS_XATTR=y
+CONFIG_EXT4_FS_POSIX_ACL=y
+CONFIG_EXT4_FS_SECURITY=y
+# CONFIG_EXT4_DEBUG is not set
+CONFIG_JBD2=y
+# CONFIG_JBD2_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+CONFIG_REISERFS_PROC_INFO=y
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
+# CONFIG_JFS_FS is not set
+CONFIG_XFS_FS=m
+CONFIG_XFS_QUOTA=y
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_XFS_RT=y
+# CONFIG_XFS_DEBUG is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+CONFIG_BTRFS_FS=m
+CONFIG_BTRFS_FS_POSIX_ACL=y
+# CONFIG_NILFS2_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_EXPORTFS=y
+CONFIG_FILE_LOCKING=y
+CONFIG_FSNOTIFY=y
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_FANOTIFY=y
+CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
+CONFIG_QUOTA=y
+CONFIG_QUOTA_NETLINK_INTERFACE=y
+# CONFIG_PRINT_QUOTA_WARNING is not set
+# CONFIG_QUOTA_DEBUG is not set
+CONFIG_QUOTA_TREE=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+CONFIG_AUTOFS4_FS=y
+CONFIG_FUSE_FS=m
+CONFIG_CUSE=m
+CONFIG_GENERIC_ACL=y
+
+#
+# Caches
+#
+CONFIG_FSCACHE=m
+CONFIG_FSCACHE_STATS=y
+# CONFIG_FSCACHE_HISTOGRAM is not set
+# CONFIG_FSCACHE_DEBUG is not set
+# CONFIG_FSCACHE_OBJECT_LIST is not set
+CONFIG_CACHEFILES=m
+# CONFIG_CACHEFILES_DEBUG is not set
+# CONFIG_CACHEFILES_HISTOGRAM is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_TMPFS_XATTR=y
+CONFIG_HUGETLBFS=y
+CONFIG_HUGETLB_PAGE=y
+CONFIG_CONFIGFS_FS=m
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_ECRYPT_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_LOGFS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_PSTORE=y
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_EXOFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_V4_1=y
+CONFIG_PNFS_FILE_LAYOUT=m
+CONFIG_PNFS_BLOCK=m
+CONFIG_PNFS_OBJLAYOUT=m
+CONFIG_NFS_FSCACHE=y
+# CONFIG_NFS_USE_LEGACY_DNS is not set
+CONFIG_NFS_USE_KERNEL_DNS=y
+# CONFIG_NFS_USE_NEW_IDMAPPER is not set
+CONFIG_NFSD=m
+CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+CONFIG_LOCKD=m
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=m
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=m
+CONFIG_SUNRPC_GSS=m
+CONFIG_SUNRPC_BACKCHANNEL=y
+CONFIG_RPCSEC_GSS_KRB5=m
+# CONFIG_CEPH_FS is not set
+CONFIG_CIFS=m
+CONFIG_CIFS_STATS=y
+# CONFIG_CIFS_STATS2 is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+# CONFIG_CIFS_UPCALL is not set
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
+# CONFIG_CIFS_DEBUG2 is not set
+CONFIG_CIFS_DFS_UPCALL=y
+CONFIG_CIFS_FSCACHE=y
+CONFIG_CIFS_ACL=y
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+CONFIG_LDM_PARTITION=y
+# CONFIG_LDM_DEBUG is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+CONFIG_EFI_PARTITION=y
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="utf-8"
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=y
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+CONFIG_DLM=m
+# CONFIG_DLM_DEBUG is not set
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_PRINTK_TIME=y
+CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=2048
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_STRIP_ASM_SYMS=y
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+CONFIG_HEADERS_CHECK=y
+# CONFIG_DEBUG_SECTION_MISMATCH is not set
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DEBUG_SHIRQ=y
+CONFIG_LOCKUP_DETECTOR=y
+CONFIG_HARDLOCKUP_DETECTOR=y
+# CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=0
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
+# CONFIG_DETECT_HUNG_TASK is not set
+CONFIG_SCHED_DEBUG=y
+CONFIG_SCHEDSTATS=y
+CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS is not set
+# CONFIG_DEBUG_KMEMLEAK is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_SPARSE_RCU_POINTER is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_ATOMIC_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+CONFIG_STACKTRACE=y
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_HIGHMEM is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_VIRTUAL is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+CONFIG_DEBUG_MEMORY_INIT=y
+CONFIG_DEBUG_LIST=y
+# CONFIG_TEST_LIST_SORT is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_DEBUG_CREDENTIALS is not set
+CONFIG_ARCH_WANT_FRAME_POINTERS=y
+CONFIG_FRAME_POINTER=y
+CONFIG_BOOT_PRINTK_DELAY=y
+# CONFIG_RCU_TORTURE_TEST is not set
+CONFIG_RCU_CPU_STALL_TIMEOUT=60
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
+# CONFIG_DEBUG_PER_CPU_MAPS is not set
+# CONFIG_LKDTM is not set
+# CONFIG_CPU_NOTIFIER_ERROR_INJECT is not set
+# CONFIG_FAULT_INJECTION is not set
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+# CONFIG_DEBUG_PAGEALLOC is not set
+CONFIG_USER_STACKTRACE_SUPPORT=y
+CONFIG_NOP_TRACER=y
+CONFIG_HAVE_FTRACE_NMI_ENTER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
+CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_TRACER_MAX_TRACE=y
+CONFIG_RING_BUFFER=y
+CONFIG_FTRACE_NMI_ENTER=y
+CONFIG_EVENT_TRACING=y
+CONFIG_EVENT_POWER_TRACING_DEPRECATED=y
+CONFIG_CONTEXT_SWITCH_TRACER=y
+CONFIG_TRACING=y
+CONFIG_GENERIC_TRACER=y
+CONFIG_TRACING_SUPPORT=y
+CONFIG_FTRACE=y
+CONFIG_FUNCTION_TRACER=y
+# CONFIG_IRQSOFF_TRACER is not set
+CONFIG_SCHED_TRACER=y
+CONFIG_FTRACE_SYSCALLS=y
+CONFIG_BRANCH_PROFILE_NONE=y
+# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
+# CONFIG_PROFILE_ALL_BRANCHES is not set
+CONFIG_STACK_TRACER=y
+CONFIG_BLK_DEV_IO_TRACE=y
+CONFIG_DYNAMIC_FTRACE=y
+CONFIG_FUNCTION_PROFILER=y
+CONFIG_FTRACE_MCOUNT_RECORD=y
+# CONFIG_FTRACE_STARTUP_TEST is not set
+# CONFIG_MMIOTRACE is not set
+CONFIG_RING_BUFFER_BENCHMARK=m
+# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
+# CONFIG_FIREWIRE_OHCI_REMOTE_DMA is not set
+# CONFIG_BUILD_DOCSRC is not set
+CONFIG_DYNAMIC_DEBUG=y
+# CONFIG_DMA_API_DEBUG is not set
+# CONFIG_ATOMIC64_SELFTEST is not set
+CONFIG_ASYNC_RAID6_TEST=m
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+CONFIG_HAVE_ARCH_KMEMCHECK=y
+# CONFIG_TEST_KSTRTOX is not set
+CONFIG_STRICT_DEVMEM=y
+CONFIG_X86_VERBOSE_BOOTUP=y
+CONFIG_EARLY_PRINTK=y
+# CONFIG_EARLY_PRINTK_DBGP is not set
+CONFIG_DEBUG_STACKOVERFLOW=y
+# CONFIG_X86_PTDUMP is not set
+CONFIG_DEBUG_NX_TEST=m
+CONFIG_DOUBLEFAULT=y
+# CONFIG_IOMMU_STRESS is not set
+CONFIG_HAVE_MMIOTRACE_SUPPORT=y
+CONFIG_IO_DELAY_TYPE_0X80=0
+CONFIG_IO_DELAY_TYPE_0XED=1
+CONFIG_IO_DELAY_TYPE_UDELAY=2
+CONFIG_IO_DELAY_TYPE_NONE=3
+CONFIG_IO_DELAY_0X80=y
+# CONFIG_IO_DELAY_0XED is not set
+# CONFIG_IO_DELAY_UDELAY is not set
+# CONFIG_IO_DELAY_NONE is not set
+CONFIG_DEFAULT_IO_DELAY_TYPE=0
+CONFIG_DEBUG_BOOT_PARAMS=y
+# CONFIG_CPA_DEBUG is not set
+CONFIG_OPTIMIZE_INLINING=y
+# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
+
+#
+# Security options
+#
+
+#
+# Grsecurity
+#
+CONFIG_GRKERNSEC=y
+# CONFIG_GRKERNSEC_LOW is not set
+# CONFIG_GRKERNSEC_MEDIUM is not set
+CONFIG_GRKERNSEC_HIGH=y
+# CONFIG_GRKERNSEC_CUSTOM is not set
+
+#
+# Address Space Protection
+#
+CONFIG_GRKERNSEC_KMEM=y
+CONFIG_GRKERNSEC_VM86=y
+# CONFIG_GRKERNSEC_IO is not set
+CONFIG_GRKERNSEC_PROC_MEMMAP=y
+CONFIG_GRKERNSEC_BRUTE=y
+CONFIG_GRKERNSEC_MODHARDEN=y
+CONFIG_GRKERNSEC_HIDESYM=y
+CONFIG_GRKERNSEC_KERN_LOCKOUT=y
+
+#
+# Role Based Access Control Options
+#
+CONFIG_GRKERNSEC_NO_RBAC=y
+# CONFIG_GRKERNSEC_ACL_HIDEKERN is not set
+CONFIG_GRKERNSEC_ACL_MAXTRIES=3
+CONFIG_GRKERNSEC_ACL_TIMEOUT=30
+
+#
+# Filesystem Protections
+#
+CONFIG_GRKERNSEC_PROC=y
+# CONFIG_GRKERNSEC_PROC_USER is not set
+CONFIG_GRKERNSEC_PROC_USERGROUP=y
+CONFIG_GRKERNSEC_PROC_GID=10
+CONFIG_GRKERNSEC_PROC_ADD=y
+CONFIG_GRKERNSEC_LINK=y
+CONFIG_GRKERNSEC_FIFO=y
+CONFIG_GRKERNSEC_SYSFS_RESTRICT=y
+# CONFIG_GRKERNSEC_ROFS is not set
+CONFIG_GRKERNSEC_CHROOT=y
+CONFIG_GRKERNSEC_CHROOT_MOUNT=y
+CONFIG_GRKERNSEC_CHROOT_DOUBLE=y
+CONFIG_GRKERNSEC_CHROOT_PIVOT=y
+CONFIG_GRKERNSEC_CHROOT_CHDIR=y
+CONFIG_GRKERNSEC_CHROOT_CHMOD=y
+CONFIG_GRKERNSEC_CHROOT_FCHDIR=y
+CONFIG_GRKERNSEC_CHROOT_MKNOD=y
+CONFIG_GRKERNSEC_CHROOT_SHMAT=y
+CONFIG_GRKERNSEC_CHROOT_UNIX=y
+CONFIG_GRKERNSEC_CHROOT_FINDTASK=y
+CONFIG_GRKERNSEC_CHROOT_NICE=y
+CONFIG_GRKERNSEC_CHROOT_SYSCTL=y
+CONFIG_GRKERNSEC_CHROOT_CAPS=y
+
+#
+# Kernel Auditing
+#
+# CONFIG_GRKERNSEC_AUDIT_GROUP is not set
+# CONFIG_GRKERNSEC_EXECLOG is not set
+CONFIG_GRKERNSEC_RESLOG=y
+# CONFIG_GRKERNSEC_CHROOT_EXECLOG is not set
+# CONFIG_GRKERNSEC_AUDIT_PTRACE is not set
+# CONFIG_GRKERNSEC_AUDIT_CHDIR is not set
+CONFIG_GRKERNSEC_AUDIT_MOUNT=y
+CONFIG_GRKERNSEC_SIGNAL=y
+CONFIG_GRKERNSEC_FORKFAIL=y
+CONFIG_GRKERNSEC_TIME=y
+CONFIG_GRKERNSEC_PROC_IPADDR=y
+CONFIG_GRKERNSEC_RWXMAP_LOG=y
+CONFIG_GRKERNSEC_AUDIT_TEXTREL=y
+
+#
+# Executable Protections
+#
+CONFIG_GRKERNSEC_DMESG=y
+CONFIG_GRKERNSEC_HARDEN_PTRACE=y
+# CONFIG_GRKERNSEC_TPE is not set
+
+#
+# Network Protections
+#
+CONFIG_GRKERNSEC_RANDNET=y
+CONFIG_GRKERNSEC_BLACKHOLE=y
+# CONFIG_GRKERNSEC_SOCKET is not set
+
+#
+# Sysctl support
+#
+CONFIG_GRKERNSEC_SYSCTL=y
+CONFIG_GRKERNSEC_SYSCTL_ON=y
+
+#
+# Logging Options
+#
+CONFIG_GRKERNSEC_FLOODTIME=10
+CONFIG_GRKERNSEC_FLOODBURST=6
+
+#
+# PaX
+#
+CONFIG_ARCH_TRACK_EXEC_LIMIT=y
+CONFIG_PAX_PER_CPU_PGD=y
+CONFIG_PAX=y
+
+#
+# PaX Control
+#
+# CONFIG_PAX_SOFTMODE is not set
+CONFIG_PAX_EI_PAX=y
+CONFIG_PAX_PT_PAX_FLAGS=y
+# CONFIG_PAX_NO_ACL_FLAGS is not set
+CONFIG_PAX_HAVE_ACL_FLAGS=y
+# CONFIG_PAX_HOOK_ACL_FLAGS is not set
+
+#
+# Non-executable pages
+#
+CONFIG_PAX_NOEXEC=y
+CONFIG_PAX_PAGEEXEC=y
+CONFIG_PAX_SEGMEXEC=y
+CONFIG_PAX_EMUTRAMP=y
+CONFIG_PAX_MPROTECT=y
+# CONFIG_PAX_MPROTECT_COMPAT is not set
+CONFIG_PAX_ELFRELOCS=y
+CONFIG_PAX_KERNEXEC=y
+CONFIG_PAX_KERNEXEC_MODULE_TEXT=4
+
+#
+# Address Space Layout Randomization
+#
+CONFIG_PAX_ASLR=y
+CONFIG_PAX_RANDKSTACK=y
+CONFIG_PAX_RANDUSTACK=y
+CONFIG_PAX_RANDMMAP=y
+
+#
+# Miscellaneous hardening features
+#
+CONFIG_PAX_MEMORY_SANITIZE=y
+CONFIG_PAX_MEMORY_STACKLEAK=y
+CONFIG_PAX_MEMORY_UDEREF=y
+CONFIG_PAX_REFCOUNT=y
+CONFIG_PAX_USERCOPY=y
+CONFIG_KEYS=y
+CONFIG_KEYS_DEBUG_PROC_KEYS=y
+CONFIG_SECURITY_DMESG_RESTRICT=y
+CONFIG_SECURITY=y
+CONFIG_SECURITYFS=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_NETWORK_XFRM=y
+# CONFIG_SECURITY_PATH is not set
+CONFIG_INTEL_TXT=y
+CONFIG_LSM_MMAP_MIN_ADDR=65536
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+CONFIG_SECURITY_SELINUX_AVC_STATS=y
+CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
+# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set
+# CONFIG_SECURITY_TOMOYO is not set
+# CONFIG_SECURITY_APPARMOR is not set
+# CONFIG_IMA is not set
+CONFIG_DEFAULT_SECURITY_SELINUX=y
+# CONFIG_DEFAULT_SECURITY_DAC is not set
+CONFIG_DEFAULT_SECURITY="selinux"
+CONFIG_XOR_BLOCKS=m
+CONFIG_ASYNC_CORE=m
+CONFIG_ASYNC_MEMCPY=m
+CONFIG_ASYNC_XOR=m
+CONFIG_ASYNC_PQ=m
+CONFIG_ASYNC_RAID6_RECOV=m
+CONFIG_ASYNC_TX_DISABLE_PQ_VAL_DMA=y
+CONFIG_ASYNC_TX_DISABLE_XOR_VAL_DMA=y
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+CONFIG_CRYPTO_FIPS=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_PCOMP=m
+CONFIG_CRYPTO_PCOMP2=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
+CONFIG_CRYPTO_GF128MUL=m
+# CONFIG_CRYPTO_NULL is not set
+CONFIG_CRYPTO_PCRYPT=m
+CONFIG_CRYPTO_WORKQUEUE=y
+CONFIG_CRYPTO_CRYPTD=y
+CONFIG_CRYPTO_AUTHENC=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Authenticated Encryption with Associated Data
+#
+CONFIG_CRYPTO_CCM=m
+CONFIG_CRYPTO_GCM=m
+CONFIG_CRYPTO_SEQIV=y
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_CTR=y
+CONFIG_CRYPTO_CTS=m
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_XTS=m
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_XCBC=m
+CONFIG_CRYPTO_VMAC=m
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+CONFIG_CRYPTO_CRC32C_INTEL=y
+CONFIG_CRYPTO_GHASH=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_RMD128=m
+CONFIG_CRYPTO_RMD160=m
+CONFIG_CRYPTO_RMD256=m
+CONFIG_CRYPTO_RMD320=m
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=y
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_WP512=m
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+CONFIG_CRYPTO_AES_586=y
+CONFIG_CRYPTO_AES_NI_INTEL=y
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_DES=m
+CONFIG_CRYPTO_FCRYPT=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_SALSA20=m
+CONFIG_CRYPTO_SALSA20_586=m
+CONFIG_CRYPTO_SEED=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+CONFIG_CRYPTO_TWOFISH_586=m
+
+#
+# Compression
+#
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_ZLIB=m
+CONFIG_CRYPTO_LZO=m
+
+#
+# Random Number Generation
+#
+CONFIG_CRYPTO_ANSI_CPRNG=m
+CONFIG_CRYPTO_USER_API=y
+CONFIG_CRYPTO_USER_API_HASH=y
+CONFIG_CRYPTO_USER_API_SKCIPHER=y
+CONFIG_CRYPTO_HW=y
+CONFIG_CRYPTO_DEV_PADLOCK=m
+CONFIG_CRYPTO_DEV_PADLOCK_AES=m
+CONFIG_CRYPTO_DEV_PADLOCK_SHA=m
+CONFIG_CRYPTO_DEV_GEODE=m
+CONFIG_CRYPTO_DEV_HIFN_795X=m
+CONFIG_CRYPTO_DEV_HIFN_795X_RNG=y
+CONFIG_HAVE_KVM=y
+CONFIG_HAVE_KVM_IRQCHIP=y
+CONFIG_HAVE_KVM_EVENTFD=y
+CONFIG_KVM_APIC_ARCHITECTURE=y
+CONFIG_KVM_MMIO=y
+CONFIG_KVM_ASYNC_PF=y
+CONFIG_VIRTUALIZATION=y
+CONFIG_KVM=m
+CONFIG_KVM_INTEL=m
+CONFIG_KVM_AMD=m
+CONFIG_KVM_MMU_AUDIT=y
+CONFIG_VHOST_NET=m
+# CONFIG_LGUEST is not set
+CONFIG_BINARY_PRINTF=y
+
+#
+# Library routines
+#
+CONFIG_RAID6_PQ=m
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_FIRST_BIT=y
+CONFIG_CRC_CCITT=m
+CONFIG_CRC16=y
+CONFIG_CRC_T10DIF=m
+CONFIG_CRC_ITU_T=m
+CONFIG_CRC32=y
+CONFIG_CRC7=m
+CONFIG_LIBCRC32C=m
+CONFIG_CRC8=m
+CONFIG_AUDIT_GENERIC=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_XZ_DEC=y
+CONFIG_XZ_DEC_X86=y
+CONFIG_XZ_DEC_POWERPC=y
+CONFIG_XZ_DEC_IA64=y
+CONFIG_XZ_DEC_ARM=y
+CONFIG_XZ_DEC_ARMTHUMB=y
+CONFIG_XZ_DEC_SPARC=y
+CONFIG_XZ_DEC_BCJ=y
+# CONFIG_XZ_DEC_TEST is not set
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DECOMPRESS_BZIP2=y
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_DECOMPRESS_XZ=y
+CONFIG_DECOMPRESS_LZO=y
+CONFIG_GENERIC_ALLOCATOR=y
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_CHECK_SIGNATURE=y
+CONFIG_CPU_RMAP=y
+CONFIG_NLATTR=y
+CONFIG_AVERAGE=y
+CONFIG_CORDIC=m
+CONFIG_LLIST=y
index 01b2f6989354ca8d74c4cbe84eb6d554a427491f..67a98bd149dc00c6d6d3bea206aec1bfd1030cd1 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = kernel
-version    = 3.0.4
+version    = 3.1.4
 release    = 2
 thisapp    = linux-%{version}
 
@@ -22,20 +22,78 @@ description
 end
 
 # Version helper variables.
-localversion = -%{DISTRO_SNAME}%{release}
-fullver      = %{version}%{localversion}
+localversion = %{release}.%{DISTRO_DISTTAG}.%{DISTRO_ARCH}
+fullver      = %{version}-%{localversion}
 
-sources      = %{thisapp}.tar.gz
+source_dl    = http://www.kernel.org/pub/linux/kernel/v3.x/
+sources      = %{thisapp}.tar.xz
 
 build
+       # icecream cannot be used to compile the kernel.
+       # Because the PaX patch does use GCC plugins to harden the kernel which
+       # are not available on the remote compilers, we need to disable it here.
+       export ICECC=no
+
        requires
+               binutils-devel
+               elfutils-devel
+               gettext
                module-init-tools
                ncurses-devel
+               net-tools
+               newt-devel
+               pciutils-devel
                perl
+               python-devel
+               slang-devel
+               xz-lzma-compat
+       end
+
+       # A list of kernels to build.
+       kernels =
+
+       # Should we build cpupower?
+       build_cpupower = 1
+
+       kernel_target = bzImage
+       if "%{DISTRO_ARCH}" == "i686"
+               # Build a default and PAE-enabled kernel for the
+               # i686 architecture.
+               build_kernel_default = 1
+               build_kernel_pae = 1
+
+               kernel_arch  = x86
+               kernel_image = arch/%{kernel_arch}/boot/bzImage
+
+       end
+
+       if "%{DISTRO_ARCH}" == "armv5tel"
+               # Build versatile kernel.
+               build_kernel_versatile = 1
+
+               kernel_arch  = arm
+               kernel_image = arch/%{kernel_arch}/boot/zImage
+
+               # ARM does not support cpupower.
+               build_cpupower = 0
+       end
+
+       # Build default kernel.
+       if "%{build_kernel_default}" == "1"
+               kernels += default
+       end
+
+       # Build PAE-enabled kernel.
+       if "%{build_kernel_pae}" == "1"
+               kernels += PAE
+       end
+
+       # Build ARM versatile kernel.
+       if "%{build_kernel_versatile}" == "1"
+               kernels += versatile
        end
 
        prepare_cmds
-               echo "%{localversion}" > localversion-%{DISTRO_SNAME}
                rm -f %{DIR_APP}/localversion-grsec
 
                sed -e "s/^HOSTCFLAGS.*=.*/& -fPIC/g" -i Makefile
@@ -43,32 +101,148 @@ build
                cp -vf %{DIR_SOURCE}/%{DISTRO_SNAME}_logo.ppm \
                        drivers/video/logo/logo_linux_clut224.ppm
 
-               make mrproper
+               # Get rid of unwanted files resulting from patch fuzz.
+               find . \( -name "*.orig" -o -name "*~" \) -exec rm -f {} \; >/dev/null
+
+               # Remove unnecessary SCM files.
+               find . -name .gitignore -exec rm -f {} \; >/dev/null
+
+               # This prevents scripts/setlocalversion from mucking with our version numbers.
+               touch .scmversion
 
-               # Install configuration file
-               cp -f %{DIR_SOURCE}/config %{DIR_APP}/.config
+               mkdir -pv configs
+               configure_kernel() {
+                       local flavour=${1}
+                       local suffix
+                       if [ "${flavour}" != "default" ]; then
+                               suffix="-${flavour}"
+                       fi
+
+                       # This is the place, where the configuration files
+                       # should be dynamically generated.
+                       # For now, we just copy pregenerated ones.
+                       cp %{DIR_SOURCE}/config.%{arch}${suffix} .config
+
+                       make ARCH=%{kernel_arch} oldnoconfig
+                       mv .config configs/config.${flavour}
+               }
+
+               # Generate configuration files for all kernels we are going to
+               # build.
+               for kernel in %{kernels}; do
+                       configure_kernel ${kernel}
+               done
        end
 
        build
-               yes "" | make oldconfig
+               build_kernel() {
+                       local flavour=${1}
+                       local suffix
+                       local localversion="%{localversion}"
+                       local fullversion="%{fullver}"
+                       if [ "${flavour}" != "default" ]; then
+                               suffix="-${flavour}"
+                               localversion="${localversion}.${flavour}"
+                               fullversion="${fullversion}.${flavour}"
+                       fi
 
-               # Check headers
-               make ARCH=x86 headers_check
+                       # Label the build.
+                       sed -i Makefile \
+                               -e "s/^EXTRAVERSION.*/EXTRAVERSION = -${localversion}/"
 
-               make CC="gcc -nopie" %{PARALLELISMFLAGS}
-       end
+                       # Clean up the source tree.
+                       make mrproper
 
-       install
-               make modules_install INSTALL_MOD_PATH=%{BUILDROOT}
+                       # Install configuration file.
+                       cp configs/config.${flavour} .config
+
+                       # Run the build.
+                       make ARCH=%{kernel_arch} oldnoconfig >/dev/null
+                       make ARCH=%{kernel_arch} CC="gcc -fno-PIE" %{kernel_target} modules %{PARALLELISMFLAGS}
 
-               mkdir -pv %{BUILDROOT}/boot
-               cp -v arch/x86/boot/bzImage %{BUILDROOT}/boot/vmlinuz-%{fullver}
-               cp -v System.map %{BUILDROOT}/boot/System.map-%{fullver}
+                       # Install the results.
+                       mkdir -pv %{BUILDROOT}/boot %{BUILDROOT}/lib/modules/${fullversion}
+                       install -m 755 %{kernel_image} %{BUILDROOT}/boot/vmlinuz-${fullversion}
+                       install -m 644 .config %{BUILDROOT}/boot/config-${fullversion}
+                       install -m 644 System.map %{BUILDROOT}/boot/System.map-${fullversion}
 
-               mkdir -pv %{BUILDROOT}/lib/modules/%{fullver}/extra
+                       # Create empty initramfs (20M).
+                       dd if=/dev/zero of=%{BUILDROOT}/boot/initramfs-${fullversion}.img bs=1M count=20
 
-               rm -vf %{BUILDROOT}/lib/modules/%{fullver}/{build,source}
+                       # Install modules.
+                       make ARCH=%{kernel_arch} INSTALL_MOD_PATH=%{BUILDROOT} mod-fw= \
+                               KERNELRELEASE=${fullversion} modules_install
+                       make ARCH=%{kernel_arch} INSTALL_MOD_PATH=%{BUILDROOT} \
+                               KERNELRELEASE=${fullversion} vdso_install
 
+                       # Create an empty settings file for dracut
+                       mkdir -pv %{BUILDROOT}/etc/ld.so.conf.d
+                       echo "# Placeholder file, no vDSO hwcap entries used in this kernel." \
+                               > %{BUILDROOT}/etc/ld.so.conf.d/kernel-${fullversion}.conf
+
+                       # And now the scary looking part.
+                       #
+                       # Recreate source and build links.
+                       rm -vf %{BUILDROOT}/lib/modules/${fullversion}/{build,source}
+                       mkdir -pv %{BUILDROOT}/lib/modules/${fullversion}/build
+                       ln -svf build %{BUILDROOT}/lib/modules/${fullversion}/source
+
+                       # Create dirs for extra modules.
+                       mkdir -pv %{BUILDROOT}/lib/modules/${fullversion}/extra
+
+                       cp -v --parents $(find -type f -name "Makefile*" -o -name "Kconfig*") \
+                               %{BUILDROOT}/lib/modules/${fullversion}/build
+                       cp -v Module.symvers System.map \
+                               %{BUILDROOT}/lib/modules/${fullversion}/build
+                       rm -vrf %{BUILDROOT}/lib/modules/${fullversion}/build/{Documentation,scripts,include}
+
+                       cp -v .config %{BUILDROOT}/lib/modules/${fullversion}/build
+                       cp -va scripts %{BUILDROOT}/lib/modules/${fullversion}/build
+                       find %{BUILDROOT}/lib/modules/${fullversion}/build/scripts -name "*.o" \
+                               -exec rm -vf {} \;
+
+                       cp -va --parents arch/%{kernel_arch}/include \
+                               %{BUILDROOT}/lib/modules/${fullversion}/build
+                       cp -va include %{BUILDROOT}/lib/modules/${fullversion}/build/include
+
+                       # Make sure we can build external modules.
+                       touch -r %{BUILDROOT}/lib/modules/${fullversion}/build/Makefile \
+                               %{BUILDROOT}/lib/modules/${fullversion}/build/include/linux/version.h
+                       touch -r %{BUILDROOT}/lib/modules/${fullversion}/build/.config \
+                               %{BUILDROOT}/lib/modules/${fullversion}/build/autoconf.h
+                       cp -v %{BUILDROOT}/lib/modules/${fullversion}/build/.config \
+                               %{BUILDROOT}/lib/modules/${fullversion}/build/include/config/auto.conf
+
+                       find %{BUILDROOT}/lib/modules/${fullversion} -name "*.ko" -type f | \
+                               xargs chmod u+x
+
+                       # Move all development files to /usr/src.
+                       mkdir -pv %{BUILDROOT}/usr/src/kernels
+                       mv -v %{BUILDROOT}/lib/modules/${fullversion}/build \
+                               %{BUILDROOT}/usr/src/kernels/${fullversion}
+                       ln -svf ../../../usr/src/kernels/${fullversion} \
+                               %{BUILDROOT}/lib/modules/${fullversion}/build
+
+                       find %{BUILDROOT}/usr/src/kernels -name ".*.cmd" -exec rm -f {} \;
+               }
+
+               for kernel in %{kernels}; do
+                       build_kernel ${kernel}
+               done
+
+               # Build tools.
+               # cpupower
+               if [ "%{build_cpupower}" = "1" ]; then
+                       chmod +x tools/power/cpupower/utils/version-gen.sh
+                       make -C tools/power/cpupower CPUFREQ_BENCH=false %{PARALLELISMFLAGS}
+
+                       cd tools/power/cpupower/debug/i386
+                       make %{PARALLELISMFLAGS} centrino-decode powernow-k8-decode
+                       cd -
+               fi
+       end
+
+       install
                # Install the header files
                make ARCH=x86 INSTALL_HDR_PATH=dest headers_install
                mkdir -pv %{BUILDROOT}/usr/include
@@ -81,24 +255,146 @@ build
                        %{BUILDROOT}/usr/include/asm*/io.h \
                        %{BUILDROOT}/usr/include/asm*/irq.h
 
-               # Create an empty settings file for dracut
-               mkdir -vp %{BUILDROOT}/etc/ld.so.conf.d/
-               echo "# Placeholder file, no vDSO hwcap entries used in this kernel." \
-               > %{BUILDROOT}/etc/ld.so.conf.d/kernel-%{fullver}.conf
-
                # Remove all firmware files which are distributed by linux-firmware
                rm -rfv %{BUILDROOT}/lib/firmware
+
+               # Install tools.
+               # XXX Man pages cannot be created because they need asciidoc.
+               make -C tools/perf DESTDIR=%{BUILDROOT} \
+                       HAVE_CPLUS_DEMANGLE=1 prefix=/usr perfexecdir=lib/perf-core \
+                       install #install-man
+
+               # cpupower
+               if [ "%{build_cpupower}" = "1" ]; then
+                       make -C tools/power/cpupower DESTDIR=%{BUILDROOT} libdir=/usr/lib \
+                               mandir=/usr/share/man CPUFREQ_BENCH=false install
+                       cd tools/power/cpupower/debug/i386
+                       install -m 755 centrino-decode %{BUILDROOT}/usr/bin/centrino-decode
+                       install -m 755 powernow-k8-decode %{BUILDROOT}/usr/bin/powernow-k8-decode
+                       cd -
+                       chmod 0755 %{BUILDROOT}/usr/lib/libcpupower.so*
+               fi
        end
 end
 
 packages
-       package kernel
+       template KERNEL
+               kernel_name = kernel
+               kernel_release = %{fullver}
+
+               summary = The Linux kernel %{kernel_release}.
+
+               prerequires = dracut grubby module-init-tools
+               provides = kernel=%{kernel_release}
                requires
-                       dracut
+                       %{prerequires}
                        linux-firmware
                end
+
+               files
+                       /boot/System.map-%{kernel_release}
+                       /boot/vmlinuz-%{kernel_release}
+                       /boot/initramfs-%{kernel_release}.img
+                       /etc/ld.so.conf.d/kernel-%{kernel_release}.conf
+                       /lib/modules/%{kernel_release}
+               end
+
+               _posttrans
+                       /sbin/new-kernel-pkg --package %{kernel_name} --mkinitrd --dracut --depmod --update %{kernel_release} || exit $?
+                       /sbin/new-kernel-pkg --package %{kernel_name} --rpmposttrans %{kernel_release} || exit $?
+               end
+
+               script posttransin
+                       %{_posttrans}
+               end
+
+               script posttransup
+                       %{_posttrans}
+               end
+
+               script postin
+                       /sbin/new-kernel-pkg --package kernel%{?-v:-%{-v*}} --install %{KVERREL}%{?-v:.%{-v*}}
+               end
+
+               script postup
+                       /sbin/new-kernel-pkg --package %{kernel_name} --install %{kernel_release}
+               end
+
+               script preun
+                       /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{kernel_release}
+               end
        end
-       
+
+       template KERNELDEVEL
+               kernel_release = %{fullver}
+
+               summary = Development files of kernel-%{kernel_release}.
+               description
+                       %{summary}
+
+                       Install this package in order to compile modules for
+                       kernel release %{kernel_release}.
+               end
+
+               filter_requires
+                       perl>=[0-9]\:.*
+               end
+
+               files
+                       /lib/modules/%{kernel_release}/build
+                       /lib/modules/%{kernel_release}/source
+                       /usr/src/kernels/%{kernel_release}
+               end
+       end
+
+       if "%{build_kernel_default}" == "1"
+               package kernel
+                       template KERNEL
+
+                       kernel_name = kernel
+                       kernel_release = %{fullver}
+               end
+
+               package kernel-devel
+                       template KERNELDEVEL
+
+                       kernel_name = kernel
+                       kernel_release = %{fullver}
+               end
+       end
+
+       if "%{build_kernel_pae}" == "1"
+               package kernel-PAE
+                       template KERNEL
+
+                       kernel_name = kernel-PAE
+                       kernel_release = %{fullver}.PAE
+               end
+
+               package kernel-PAE-devel
+                       template KERNELDEVEL
+
+                       kernel_name = kernel-PAE
+                       kernel_release = %{fullver}.PAE
+               end
+       end
+
+       if "%{build_kernel_versatile}" == "1"
+               package kernel-versatile
+                       template KERNEL
+
+                       kernel_name = kernel-versatile
+                       kernel_release = %{fullver}.versatile
+               end
+
+               package kernel-versatile-devel
+                       kernel KERNELDEVEL
+
+                       kernel_name = kernel-versatile
+                       kernel_release = %{fullver}.versatile
+               end
+       end
+
        package kernel-headers
                summary = Header files of the kernel release %{fullver}.
                desciption = %{summary}
@@ -107,5 +403,21 @@ packages
                        /usr/include
                end
        end
-       
+
+       package kernel-tools
+               summary = Assortment of tools for the Linux kernel.
+               description = %{summary}
+
+               filter_requires
+                       perl>=[0-9]\:.*
+               end
+
+               files
+                       /
+                       !/boot
+                       !/lib/modules
+                       !/usr/include
+                       !/usr/src
+               end
+       end
 end
similarity index 78%
rename from kernel/patches/grsecurity-2.2.2-3.0.4-201109261052.patch
rename to kernel/patches/grsecurity-2.2.2-3.1.3-201111262001.patch
index cce98cf9edca949a2b539b93b10312b41fc41f6d..2cd8ff113ae6a9c12ea3198c1ebebd3378c4ad86 100644 (file)
@@ -1,6 +1,6 @@
-diff -urNp linux-3.0.4/arch/alpha/include/asm/elf.h linux-3.0.4/arch/alpha/include/asm/elf.h
---- linux-3.0.4/arch/alpha/include/asm/elf.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/alpha/include/asm/elf.h   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/alpha/include/asm/elf.h linux-3.1.3/arch/alpha/include/asm/elf.h
+--- linux-3.1.3/arch/alpha/include/asm/elf.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/alpha/include/asm/elf.h   2011-11-16 18:39:07.000000000 -0500
 @@ -90,6 +90,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_N
  
  #define ELF_ET_DYN_BASE               (TASK_UNMAPPED_BASE + 0x1000000)
@@ -15,9 +15,9 @@ diff -urNp linux-3.0.4/arch/alpha/include/asm/elf.h linux-3.0.4/arch/alpha/inclu
  /* $0 is set by ld.so to a pointer to a function which might be 
     registered using atexit.  This provides a mean for the dynamic
     linker to call DT_FINI functions for shared libraries that have
-diff -urNp linux-3.0.4/arch/alpha/include/asm/pgtable.h linux-3.0.4/arch/alpha/include/asm/pgtable.h
---- linux-3.0.4/arch/alpha/include/asm/pgtable.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/alpha/include/asm/pgtable.h       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/alpha/include/asm/pgtable.h linux-3.1.3/arch/alpha/include/asm/pgtable.h
+--- linux-3.1.3/arch/alpha/include/asm/pgtable.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/alpha/include/asm/pgtable.h       2011-11-16 18:39:07.000000000 -0500
 @@ -101,6 +101,17 @@ struct vm_area_struct;
  #define PAGE_SHARED   __pgprot(_PAGE_VALID | __ACCESS_BITS)
  #define PAGE_COPY     __pgprot(_PAGE_VALID | __ACCESS_BITS | _PAGE_FOW)
@@ -36,10 +36,10 @@ diff -urNp linux-3.0.4/arch/alpha/include/asm/pgtable.h linux-3.0.4/arch/alpha/i
  #define PAGE_KERNEL   __pgprot(_PAGE_VALID | _PAGE_ASM | _PAGE_KRE | _PAGE_KWE)
  
  #define _PAGE_NORMAL(x) __pgprot(_PAGE_VALID | __ACCESS_BITS | (x))
-diff -urNp linux-3.0.4/arch/alpha/kernel/module.c linux-3.0.4/arch/alpha/kernel/module.c
---- linux-3.0.4/arch/alpha/kernel/module.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/alpha/kernel/module.c     2011-08-23 21:47:55.000000000 -0400
-@@ -182,7 +182,7 @@ apply_relocate_add(Elf64_Shdr *sechdrs, 
+diff -urNp linux-3.1.3/arch/alpha/kernel/module.c linux-3.1.3/arch/alpha/kernel/module.c
+--- linux-3.1.3/arch/alpha/kernel/module.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/alpha/kernel/module.c     2011-11-16 18:39:07.000000000 -0500
+@@ -160,7 +160,7 @@ apply_relocate_add(Elf64_Shdr *sechdrs, 
  
        /* The small sections were sorted to the end of the segment.
           The following should definitely cover them.  */
@@ -48,10 +48,10 @@ diff -urNp linux-3.0.4/arch/alpha/kernel/module.c linux-3.0.4/arch/alpha/kernel/
        got = sechdrs[me->arch.gotsecindex].sh_addr;
  
        for (i = 0; i < n; i++) {
-diff -urNp linux-3.0.4/arch/alpha/kernel/osf_sys.c linux-3.0.4/arch/alpha/kernel/osf_sys.c
---- linux-3.0.4/arch/alpha/kernel/osf_sys.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/alpha/kernel/osf_sys.c    2011-08-23 21:47:55.000000000 -0400
-@@ -1145,7 +1145,7 @@ arch_get_unmapped_area_1(unsigned long a
+diff -urNp linux-3.1.3/arch/alpha/kernel/osf_sys.c linux-3.1.3/arch/alpha/kernel/osf_sys.c
+--- linux-3.1.3/arch/alpha/kernel/osf_sys.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/alpha/kernel/osf_sys.c    2011-11-16 18:39:07.000000000 -0500
+@@ -1147,7 +1147,7 @@ arch_get_unmapped_area_1(unsigned long a
                /* At this point:  (!vma || addr < vma->vm_end). */
                if (limit - len < addr)
                        return -ENOMEM;
@@ -60,7 +60,7 @@ diff -urNp linux-3.0.4/arch/alpha/kernel/osf_sys.c linux-3.0.4/arch/alpha/kernel
                        return addr;
                addr = vma->vm_end;
                vma = vma->vm_next;
-@@ -1181,6 +1181,10 @@ arch_get_unmapped_area(struct file *filp
+@@ -1183,6 +1183,10 @@ arch_get_unmapped_area(struct file *filp
           merely specific addresses, but regions of memory -- perhaps
           this feature should be incorporated into all ports?  */
  
@@ -71,7 +71,7 @@ diff -urNp linux-3.0.4/arch/alpha/kernel/osf_sys.c linux-3.0.4/arch/alpha/kernel
        if (addr) {
                addr = arch_get_unmapped_area_1 (PAGE_ALIGN(addr), len, limit);
                if (addr != (unsigned long) -ENOMEM)
-@@ -1188,8 +1192,8 @@ arch_get_unmapped_area(struct file *filp
+@@ -1190,8 +1194,8 @@ arch_get_unmapped_area(struct file *filp
        }
  
        /* Next, try allocating at TASK_UNMAPPED_BASE.  */
@@ -82,9 +82,9 @@ diff -urNp linux-3.0.4/arch/alpha/kernel/osf_sys.c linux-3.0.4/arch/alpha/kernel
        if (addr != (unsigned long) -ENOMEM)
                return addr;
  
-diff -urNp linux-3.0.4/arch/alpha/mm/fault.c linux-3.0.4/arch/alpha/mm/fault.c
---- linux-3.0.4/arch/alpha/mm/fault.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/alpha/mm/fault.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/alpha/mm/fault.c linux-3.1.3/arch/alpha/mm/fault.c
+--- linux-3.1.3/arch/alpha/mm/fault.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/alpha/mm/fault.c  2011-11-16 18:39:07.000000000 -0500
 @@ -54,6 +54,124 @@ __load_new_mm_context(struct mm_struct *
        __reload_thread(pcb);
  }
@@ -192,7 +192,7 @@ diff -urNp linux-3.0.4/arch/alpha/mm/fault.c linux-3.0.4/arch/alpha/mm/fault.c
 +      return 1;
 +}
 +
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
 +{
 +      unsigned long i;
 +
@@ -241,9 +241,9 @@ diff -urNp linux-3.0.4/arch/alpha/mm/fault.c linux-3.0.4/arch/alpha/mm/fault.c
        } else if (!cause) {
                /* Allow reads even for write-only mappings */
                if (!(vma->vm_flags & (VM_READ | VM_WRITE)))
-diff -urNp linux-3.0.4/arch/arm/include/asm/elf.h linux-3.0.4/arch/arm/include/asm/elf.h
---- linux-3.0.4/arch/arm/include/asm/elf.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/arm/include/asm/elf.h     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/arm/include/asm/elf.h linux-3.1.3/arch/arm/include/asm/elf.h
+--- linux-3.1.3/arch/arm/include/asm/elf.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/arm/include/asm/elf.h     2011-11-16 18:39:07.000000000 -0500
 @@ -116,7 +116,14 @@ int dump_task_regs(struct task_struct *t
     the loader.  We need to make sure that it is out of the way of the program
     that it will "exec", and that there is sufficient room for the brk.  */
@@ -271,9 +271,9 @@ diff -urNp linux-3.0.4/arch/arm/include/asm/elf.h linux-3.0.4/arch/arm/include/a
  extern int vectors_user_mapping(void);
  #define arch_setup_additional_pages(bprm, uses_interp) vectors_user_mapping()
  #define ARCH_HAS_SETUP_ADDITIONAL_PAGES
-diff -urNp linux-3.0.4/arch/arm/include/asm/kmap_types.h linux-3.0.4/arch/arm/include/asm/kmap_types.h
---- linux-3.0.4/arch/arm/include/asm/kmap_types.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/arm/include/asm/kmap_types.h      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/arm/include/asm/kmap_types.h linux-3.1.3/arch/arm/include/asm/kmap_types.h
+--- linux-3.1.3/arch/arm/include/asm/kmap_types.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/arm/include/asm/kmap_types.h      2011-11-16 18:39:07.000000000 -0500
 @@ -21,6 +21,7 @@ enum km_type {
        KM_L1_CACHE,
        KM_L2_CACHE,
@@ -282,9 +282,9 @@ diff -urNp linux-3.0.4/arch/arm/include/asm/kmap_types.h linux-3.0.4/arch/arm/in
        KM_TYPE_NR
  };
  
-diff -urNp linux-3.0.4/arch/arm/include/asm/uaccess.h linux-3.0.4/arch/arm/include/asm/uaccess.h
---- linux-3.0.4/arch/arm/include/asm/uaccess.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/arm/include/asm/uaccess.h 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/arm/include/asm/uaccess.h linux-3.1.3/arch/arm/include/asm/uaccess.h
+--- linux-3.1.3/arch/arm/include/asm/uaccess.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/arm/include/asm/uaccess.h 2011-11-16 18:39:07.000000000 -0500
 @@ -22,6 +22,8 @@
  #define VERIFY_READ 0
  #define VERIFY_WRITE 1
@@ -340,9 +340,9 @@ diff -urNp linux-3.0.4/arch/arm/include/asm/uaccess.h linux-3.0.4/arch/arm/inclu
        if (access_ok(VERIFY_WRITE, to, n))
                n = __copy_to_user(to, from, n);
        return n;
-diff -urNp linux-3.0.4/arch/arm/kernel/armksyms.c linux-3.0.4/arch/arm/kernel/armksyms.c
---- linux-3.0.4/arch/arm/kernel/armksyms.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/arm/kernel/armksyms.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/arm/kernel/armksyms.c linux-3.1.3/arch/arm/kernel/armksyms.c
+--- linux-3.1.3/arch/arm/kernel/armksyms.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/arm/kernel/armksyms.c     2011-11-16 18:39:07.000000000 -0500
 @@ -98,8 +98,8 @@ EXPORT_SYMBOL(__strncpy_from_user);
  #ifdef CONFIG_MMU
  EXPORT_SYMBOL(copy_page);
@@ -354,18 +354,18 @@ diff -urNp linux-3.0.4/arch/arm/kernel/armksyms.c linux-3.0.4/arch/arm/kernel/ar
  EXPORT_SYMBOL(__clear_user);
  
  EXPORT_SYMBOL(__get_user_1);
-diff -urNp linux-3.0.4/arch/arm/kernel/process.c linux-3.0.4/arch/arm/kernel/process.c
---- linux-3.0.4/arch/arm/kernel/process.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/arm/kernel/process.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/arm/kernel/process.c linux-3.1.3/arch/arm/kernel/process.c
+--- linux-3.1.3/arch/arm/kernel/process.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/arm/kernel/process.c      2011-11-16 18:39:07.000000000 -0500
 @@ -28,7 +28,6 @@
  #include <linux/tick.h>
  #include <linux/utsname.h>
  #include <linux/uaccess.h>
 -#include <linux/random.h>
  #include <linux/hw_breakpoint.h>
+ #include <linux/cpuidle.h>
  
- #include <asm/cacheflush.h>
-@@ -479,12 +478,6 @@ unsigned long get_wchan(struct task_stru
+@@ -481,12 +480,6 @@ unsigned long get_wchan(struct task_stru
        return 0;
  }
  
@@ -378,9 +378,9 @@ diff -urNp linux-3.0.4/arch/arm/kernel/process.c linux-3.0.4/arch/arm/kernel/pro
  #ifdef CONFIG_MMU
  /*
   * The vectors page is always readable from user space for the
-diff -urNp linux-3.0.4/arch/arm/kernel/traps.c linux-3.0.4/arch/arm/kernel/traps.c
---- linux-3.0.4/arch/arm/kernel/traps.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/arm/kernel/traps.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/arm/kernel/traps.c linux-3.1.3/arch/arm/kernel/traps.c
+--- linux-3.1.3/arch/arm/kernel/traps.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/arm/kernel/traps.c        2011-11-16 18:40:08.000000000 -0500
 @@ -257,6 +257,8 @@ static int __die(const char *str, int er
  
  static DEFINE_SPINLOCK(die_lock);
@@ -400,9 +400,9 @@ diff -urNp linux-3.0.4/arch/arm/kernel/traps.c linux-3.0.4/arch/arm/kernel/traps
        if (ret != NOTIFY_STOP)
                do_exit(SIGSEGV);
  }
-diff -urNp linux-3.0.4/arch/arm/lib/copy_from_user.S linux-3.0.4/arch/arm/lib/copy_from_user.S
---- linux-3.0.4/arch/arm/lib/copy_from_user.S  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/arm/lib/copy_from_user.S  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/arm/lib/copy_from_user.S linux-3.1.3/arch/arm/lib/copy_from_user.S
+--- linux-3.1.3/arch/arm/lib/copy_from_user.S  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/arm/lib/copy_from_user.S  2011-11-16 18:39:07.000000000 -0500
 @@ -16,7 +16,7 @@
  /*
   * Prototype:
@@ -426,9 +426,9 @@ diff -urNp linux-3.0.4/arch/arm/lib/copy_from_user.S linux-3.0.4/arch/arm/lib/co
  
        .pushsection .fixup,"ax"
        .align 0
-diff -urNp linux-3.0.4/arch/arm/lib/copy_to_user.S linux-3.0.4/arch/arm/lib/copy_to_user.S
---- linux-3.0.4/arch/arm/lib/copy_to_user.S    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/arm/lib/copy_to_user.S    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/arm/lib/copy_to_user.S linux-3.1.3/arch/arm/lib/copy_to_user.S
+--- linux-3.1.3/arch/arm/lib/copy_to_user.S    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/arm/lib/copy_to_user.S    2011-11-16 18:39:07.000000000 -0500
 @@ -16,7 +16,7 @@
  /*
   * Prototype:
@@ -452,9 +452,9 @@ diff -urNp linux-3.0.4/arch/arm/lib/copy_to_user.S linux-3.0.4/arch/arm/lib/copy
  ENDPROC(__copy_to_user_std)
  
        .pushsection .fixup,"ax"
-diff -urNp linux-3.0.4/arch/arm/lib/uaccess.S linux-3.0.4/arch/arm/lib/uaccess.S
---- linux-3.0.4/arch/arm/lib/uaccess.S 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/arm/lib/uaccess.S 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/arm/lib/uaccess.S linux-3.1.3/arch/arm/lib/uaccess.S
+--- linux-3.1.3/arch/arm/lib/uaccess.S 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/arm/lib/uaccess.S 2011-11-16 18:39:07.000000000 -0500
 @@ -20,7 +20,7 @@
  
  #define PAGE_SHIFT 12
@@ -508,9 +508,9 @@ diff -urNp linux-3.0.4/arch/arm/lib/uaccess.S linux-3.0.4/arch/arm/lib/uaccess.S
  
                .pushsection .fixup,"ax"
                .align  0
-diff -urNp linux-3.0.4/arch/arm/lib/uaccess_with_memcpy.c linux-3.0.4/arch/arm/lib/uaccess_with_memcpy.c
---- linux-3.0.4/arch/arm/lib/uaccess_with_memcpy.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/arm/lib/uaccess_with_memcpy.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/arm/lib/uaccess_with_memcpy.c linux-3.1.3/arch/arm/lib/uaccess_with_memcpy.c
+--- linux-3.1.3/arch/arm/lib/uaccess_with_memcpy.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/arm/lib/uaccess_with_memcpy.c     2011-11-16 18:39:07.000000000 -0500
 @@ -103,7 +103,7 @@ out:
  }
  
@@ -520,9 +520,9 @@ diff -urNp linux-3.0.4/arch/arm/lib/uaccess_with_memcpy.c linux-3.0.4/arch/arm/l
  {
        /*
         * This test is stubbed out of the main function above to keep
-diff -urNp linux-3.0.4/arch/arm/mach-ux500/mbox-db5500.c linux-3.0.4/arch/arm/mach-ux500/mbox-db5500.c
---- linux-3.0.4/arch/arm/mach-ux500/mbox-db5500.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/arm/mach-ux500/mbox-db5500.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/arm/mach-ux500/mbox-db5500.c linux-3.1.3/arch/arm/mach-ux500/mbox-db5500.c
+--- linux-3.1.3/arch/arm/mach-ux500/mbox-db5500.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/arm/mach-ux500/mbox-db5500.c      2011-11-16 18:40:08.000000000 -0500
 @@ -168,7 +168,7 @@ static ssize_t mbox_read_fifo(struct dev
        return sprintf(buf, "0x%X\n", mbox_value);
  }
@@ -532,9 +532,9 @@ diff -urNp linux-3.0.4/arch/arm/mach-ux500/mbox-db5500.c linux-3.0.4/arch/arm/ma
  
  static int mbox_show(struct seq_file *s, void *data)
  {
-diff -urNp linux-3.0.4/arch/arm/mm/fault.c linux-3.0.4/arch/arm/mm/fault.c
---- linux-3.0.4/arch/arm/mm/fault.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/arm/mm/fault.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/arm/mm/fault.c linux-3.1.3/arch/arm/mm/fault.c
+--- linux-3.1.3/arch/arm/mm/fault.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/arm/mm/fault.c    2011-11-16 18:39:07.000000000 -0500
 @@ -182,6 +182,13 @@ __do_user_fault(struct task_struct *tsk,
        }
  #endif
@@ -549,12 +549,12 @@ diff -urNp linux-3.0.4/arch/arm/mm/fault.c linux-3.0.4/arch/arm/mm/fault.c
        tsk->thread.address = addr;
        tsk->thread.error_code = fsr;
        tsk->thread.trap_no = 14;
-@@ -379,6 +386,33 @@ do_page_fault(unsigned long addr, unsign
+@@ -383,6 +390,33 @@ do_page_fault(unsigned long addr, unsign
  }
  #endif                                        /* CONFIG_MMU */
  
 +#ifdef CONFIG_PAX_PAGEEXEC
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
 +{
 +      long i;
 +
@@ -583,9 +583,9 @@ diff -urNp linux-3.0.4/arch/arm/mm/fault.c linux-3.0.4/arch/arm/mm/fault.c
  /*
   * First Level Translation Fault Handler
   *
-diff -urNp linux-3.0.4/arch/arm/mm/mmap.c linux-3.0.4/arch/arm/mm/mmap.c
---- linux-3.0.4/arch/arm/mm/mmap.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/arm/mm/mmap.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/arm/mm/mmap.c linux-3.1.3/arch/arm/mm/mmap.c
+--- linux-3.1.3/arch/arm/mm/mmap.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/arm/mm/mmap.c     2011-11-16 18:39:07.000000000 -0500
 @@ -65,6 +65,10 @@ arch_get_unmapped_area(struct file *filp
        if (len > TASK_SIZE)
                return -ENOMEM;
@@ -635,9 +635,9 @@ diff -urNp linux-3.0.4/arch/arm/mm/mmap.c linux-3.0.4/arch/arm/mm/mmap.c
                        /*
                         * Remember the place where we stopped the search:
                         */
-diff -urNp linux-3.0.4/arch/avr32/include/asm/elf.h linux-3.0.4/arch/avr32/include/asm/elf.h
---- linux-3.0.4/arch/avr32/include/asm/elf.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/avr32/include/asm/elf.h   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/avr32/include/asm/elf.h linux-3.1.3/arch/avr32/include/asm/elf.h
+--- linux-3.1.3/arch/avr32/include/asm/elf.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/avr32/include/asm/elf.h   2011-11-16 18:39:07.000000000 -0500
 @@ -84,8 +84,14 @@ typedef struct user_fpu_struct elf_fpreg
     the loader.  We need to make sure that it is out of the way of the program
     that it will "exec", and that there is sufficient room for the brk.  */
@@ -654,9 +654,9 @@ diff -urNp linux-3.0.4/arch/avr32/include/asm/elf.h linux-3.0.4/arch/avr32/inclu
  
  /* This yields a mask that user programs can use to figure out what
     instruction set this CPU supports.  This could be done in user space,
-diff -urNp linux-3.0.4/arch/avr32/include/asm/kmap_types.h linux-3.0.4/arch/avr32/include/asm/kmap_types.h
---- linux-3.0.4/arch/avr32/include/asm/kmap_types.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/avr32/include/asm/kmap_types.h    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/avr32/include/asm/kmap_types.h linux-3.1.3/arch/avr32/include/asm/kmap_types.h
+--- linux-3.1.3/arch/avr32/include/asm/kmap_types.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/avr32/include/asm/kmap_types.h    2011-11-16 18:39:07.000000000 -0500
 @@ -22,7 +22,8 @@ D(10)        KM_IRQ0,
  D(11) KM_IRQ1,
  D(12) KM_SOFTIRQ0,
@@ -667,15 +667,15 @@ diff -urNp linux-3.0.4/arch/avr32/include/asm/kmap_types.h linux-3.0.4/arch/avr3
  };
  
  #undef D
-diff -urNp linux-3.0.4/arch/avr32/mm/fault.c linux-3.0.4/arch/avr32/mm/fault.c
---- linux-3.0.4/arch/avr32/mm/fault.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/avr32/mm/fault.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/avr32/mm/fault.c linux-3.1.3/arch/avr32/mm/fault.c
+--- linux-3.1.3/arch/avr32/mm/fault.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/avr32/mm/fault.c  2011-11-16 18:39:07.000000000 -0500
 @@ -41,6 +41,23 @@ static inline int notify_page_fault(stru
  
  int exception_trace = 1;
  
 +#ifdef CONFIG_PAX_PAGEEXEC
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
 +{
 +      unsigned long i;
 +
@@ -711,9 +711,9 @@ diff -urNp linux-3.0.4/arch/avr32/mm/fault.c linux-3.0.4/arch/avr32/mm/fault.c
                if (exception_trace && printk_ratelimit())
                        printk("%s%s[%d]: segfault at %08lx pc %08lx "
                               "sp %08lx ecr %lu\n",
-diff -urNp linux-3.0.4/arch/frv/include/asm/kmap_types.h linux-3.0.4/arch/frv/include/asm/kmap_types.h
---- linux-3.0.4/arch/frv/include/asm/kmap_types.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/frv/include/asm/kmap_types.h      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/frv/include/asm/kmap_types.h linux-3.1.3/arch/frv/include/asm/kmap_types.h
+--- linux-3.1.3/arch/frv/include/asm/kmap_types.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/frv/include/asm/kmap_types.h      2011-11-16 18:39:07.000000000 -0500
 @@ -23,6 +23,7 @@ enum km_type {
        KM_IRQ1,
        KM_SOFTIRQ0,
@@ -722,9 +722,9 @@ diff -urNp linux-3.0.4/arch/frv/include/asm/kmap_types.h linux-3.0.4/arch/frv/in
        KM_TYPE_NR
  };
  
-diff -urNp linux-3.0.4/arch/frv/mm/elf-fdpic.c linux-3.0.4/arch/frv/mm/elf-fdpic.c
---- linux-3.0.4/arch/frv/mm/elf-fdpic.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/frv/mm/elf-fdpic.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/frv/mm/elf-fdpic.c linux-3.1.3/arch/frv/mm/elf-fdpic.c
+--- linux-3.1.3/arch/frv/mm/elf-fdpic.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/frv/mm/elf-fdpic.c        2011-11-16 18:39:07.000000000 -0500
 @@ -73,8 +73,7 @@ unsigned long arch_get_unmapped_area(str
        if (addr) {
                addr = PAGE_ALIGN(addr);
@@ -753,9 +753,9 @@ diff -urNp linux-3.0.4/arch/frv/mm/elf-fdpic.c linux-3.0.4/arch/frv/mm/elf-fdpic
                                goto success;
                        addr = vma->vm_end;
                }
-diff -urNp linux-3.0.4/arch/ia64/include/asm/elf.h linux-3.0.4/arch/ia64/include/asm/elf.h
---- linux-3.0.4/arch/ia64/include/asm/elf.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/ia64/include/asm/elf.h    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/ia64/include/asm/elf.h linux-3.1.3/arch/ia64/include/asm/elf.h
+--- linux-3.1.3/arch/ia64/include/asm/elf.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/ia64/include/asm/elf.h    2011-11-16 18:39:07.000000000 -0500
 @@ -42,6 +42,13 @@
   */
  #define ELF_ET_DYN_BASE               (TASK_UNMAPPED_BASE + 0x800000000UL)
@@ -770,9 +770,9 @@ diff -urNp linux-3.0.4/arch/ia64/include/asm/elf.h linux-3.0.4/arch/ia64/include
  #define PT_IA_64_UNWIND               0x70000001
  
  /* IA-64 relocations: */
-diff -urNp linux-3.0.4/arch/ia64/include/asm/pgtable.h linux-3.0.4/arch/ia64/include/asm/pgtable.h
---- linux-3.0.4/arch/ia64/include/asm/pgtable.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/ia64/include/asm/pgtable.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/ia64/include/asm/pgtable.h linux-3.1.3/arch/ia64/include/asm/pgtable.h
+--- linux-3.1.3/arch/ia64/include/asm/pgtable.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/ia64/include/asm/pgtable.h        2011-11-16 18:39:07.000000000 -0500
 @@ -12,7 +12,7 @@
   *    David Mosberger-Tang <davidm@hpl.hp.com>
   */
@@ -800,9 +800,9 @@ diff -urNp linux-3.0.4/arch/ia64/include/asm/pgtable.h linux-3.0.4/arch/ia64/inc
  #define PAGE_GATE     __pgprot(__ACCESS_BITS | _PAGE_PL_0 | _PAGE_AR_X_RX)
  #define PAGE_KERNEL   __pgprot(__DIRTY_BITS  | _PAGE_PL_0 | _PAGE_AR_RWX)
  #define PAGE_KERNELRX __pgprot(__ACCESS_BITS | _PAGE_PL_0 | _PAGE_AR_RX)
-diff -urNp linux-3.0.4/arch/ia64/include/asm/spinlock.h linux-3.0.4/arch/ia64/include/asm/spinlock.h
---- linux-3.0.4/arch/ia64/include/asm/spinlock.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/ia64/include/asm/spinlock.h       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/ia64/include/asm/spinlock.h linux-3.1.3/arch/ia64/include/asm/spinlock.h
+--- linux-3.1.3/arch/ia64/include/asm/spinlock.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/ia64/include/asm/spinlock.h       2011-11-16 18:39:07.000000000 -0500
 @@ -72,7 +72,7 @@ static __always_inline void __ticket_spi
        unsigned short  *p = (unsigned short *)&lock->lock + 1, tmp;
  
@@ -812,9 +812,9 @@ diff -urNp linux-3.0.4/arch/ia64/include/asm/spinlock.h linux-3.0.4/arch/ia64/in
  }
  
  static __always_inline void __ticket_spin_unlock_wait(arch_spinlock_t *lock)
-diff -urNp linux-3.0.4/arch/ia64/include/asm/uaccess.h linux-3.0.4/arch/ia64/include/asm/uaccess.h
---- linux-3.0.4/arch/ia64/include/asm/uaccess.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/ia64/include/asm/uaccess.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/ia64/include/asm/uaccess.h linux-3.1.3/arch/ia64/include/asm/uaccess.h
+--- linux-3.1.3/arch/ia64/include/asm/uaccess.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/ia64/include/asm/uaccess.h        2011-11-16 18:39:07.000000000 -0500
 @@ -257,7 +257,7 @@ __copy_from_user (void *to, const void _
        const void *__cu_from = (from);                                                 \
        long __cu_len = (n);                                                            \
@@ -833,10 +833,10 @@ diff -urNp linux-3.0.4/arch/ia64/include/asm/uaccess.h linux-3.0.4/arch/ia64/inc
                __cu_len = __copy_user((__force void __user *) __cu_to, __cu_from, __cu_len);   \
        __cu_len;                                                                       \
  })
-diff -urNp linux-3.0.4/arch/ia64/kernel/module.c linux-3.0.4/arch/ia64/kernel/module.c
---- linux-3.0.4/arch/ia64/kernel/module.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/ia64/kernel/module.c      2011-08-23 21:47:55.000000000 -0400
-@@ -315,8 +315,7 @@ module_alloc (unsigned long size)
+diff -urNp linux-3.1.3/arch/ia64/kernel/module.c linux-3.1.3/arch/ia64/kernel/module.c
+--- linux-3.1.3/arch/ia64/kernel/module.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/ia64/kernel/module.c      2011-11-16 18:39:07.000000000 -0500
+@@ -307,8 +307,7 @@ plt_target (struct plt_entry *plt)
  void
  module_free (struct module *mod, void *module_region)
  {
@@ -846,7 +846,7 @@ diff -urNp linux-3.0.4/arch/ia64/kernel/module.c linux-3.0.4/arch/ia64/kernel/mo
                unw_remove_unwind_table(mod->arch.init_unw_table);
                mod->arch.init_unw_table = NULL;
        }
-@@ -502,15 +501,39 @@ module_frob_arch_sections (Elf_Ehdr *ehd
+@@ -494,15 +493,39 @@ module_frob_arch_sections (Elf_Ehdr *ehd
  }
  
  static inline int
@@ -888,7 +888,7 @@ diff -urNp linux-3.0.4/arch/ia64/kernel/module.c linux-3.0.4/arch/ia64/kernel/mo
  }
  
  static inline int
-@@ -693,7 +716,14 @@ do_reloc (struct module *mod, uint8_t r_
+@@ -685,7 +708,14 @@ do_reloc (struct module *mod, uint8_t r_
                break;
  
              case RV_BDREL:
@@ -904,7 +904,7 @@ diff -urNp linux-3.0.4/arch/ia64/kernel/module.c linux-3.0.4/arch/ia64/kernel/mo
                break;
  
              case RV_LTV:
-@@ -828,15 +858,15 @@ apply_relocate_add (Elf64_Shdr *sechdrs,
+@@ -820,15 +850,15 @@ apply_relocate_add (Elf64_Shdr *sechdrs,
                 *     addresses have been selected...
                 */
                uint64_t gp;
@@ -924,9 +924,9 @@ diff -urNp linux-3.0.4/arch/ia64/kernel/module.c linux-3.0.4/arch/ia64/kernel/mo
                mod->arch.gp = gp;
                DEBUGP("%s: placing gp at 0x%lx\n", __func__, gp);
        }
-diff -urNp linux-3.0.4/arch/ia64/kernel/sys_ia64.c linux-3.0.4/arch/ia64/kernel/sys_ia64.c
---- linux-3.0.4/arch/ia64/kernel/sys_ia64.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/ia64/kernel/sys_ia64.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/ia64/kernel/sys_ia64.c linux-3.1.3/arch/ia64/kernel/sys_ia64.c
+--- linux-3.1.3/arch/ia64/kernel/sys_ia64.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/ia64/kernel/sys_ia64.c    2011-11-16 18:39:07.000000000 -0500
 @@ -43,6 +43,13 @@ arch_get_unmapped_area (struct file *fil
        if (REGION_NUMBER(addr) == RGN_HPAGE)
                addr = 0;
@@ -959,9 +959,9 @@ diff -urNp linux-3.0.4/arch/ia64/kernel/sys_ia64.c linux-3.0.4/arch/ia64/kernel/
                        /* Remember the address where we stopped this search:  */
                        mm->free_area_cache = addr + len;
                        return addr;
-diff -urNp linux-3.0.4/arch/ia64/kernel/vmlinux.lds.S linux-3.0.4/arch/ia64/kernel/vmlinux.lds.S
---- linux-3.0.4/arch/ia64/kernel/vmlinux.lds.S 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/ia64/kernel/vmlinux.lds.S 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/ia64/kernel/vmlinux.lds.S linux-3.1.3/arch/ia64/kernel/vmlinux.lds.S
+--- linux-3.1.3/arch/ia64/kernel/vmlinux.lds.S 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/ia64/kernel/vmlinux.lds.S 2011-11-16 18:39:07.000000000 -0500
 @@ -199,7 +199,7 @@ SECTIONS {
        /* Per-cpu data: */
        . = ALIGN(PERCPU_PAGE_SIZE);
@@ -971,15 +971,15 @@ diff -urNp linux-3.0.4/arch/ia64/kernel/vmlinux.lds.S linux-3.0.4/arch/ia64/kern
        /*
         * ensure percpu data fits
         * into percpu page size
-diff -urNp linux-3.0.4/arch/ia64/mm/fault.c linux-3.0.4/arch/ia64/mm/fault.c
---- linux-3.0.4/arch/ia64/mm/fault.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/ia64/mm/fault.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/ia64/mm/fault.c linux-3.1.3/arch/ia64/mm/fault.c
+--- linux-3.1.3/arch/ia64/mm/fault.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/ia64/mm/fault.c   2011-11-16 18:39:07.000000000 -0500
 @@ -73,6 +73,23 @@ mapped_kernel_page_is_present (unsigned 
        return pte_present(pte);
  }
  
 +#ifdef CONFIG_PAX_PAGEEXEC
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
 +{
 +      unsigned long i;
 +
@@ -1023,9 +1023,9 @@ diff -urNp linux-3.0.4/arch/ia64/mm/fault.c linux-3.0.4/arch/ia64/mm/fault.c
        /*
         * If for any reason at all we couldn't handle the fault, make
         * sure we exit gracefully rather than endlessly redo the
-diff -urNp linux-3.0.4/arch/ia64/mm/hugetlbpage.c linux-3.0.4/arch/ia64/mm/hugetlbpage.c
---- linux-3.0.4/arch/ia64/mm/hugetlbpage.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/ia64/mm/hugetlbpage.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/ia64/mm/hugetlbpage.c linux-3.1.3/arch/ia64/mm/hugetlbpage.c
+--- linux-3.1.3/arch/ia64/mm/hugetlbpage.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/ia64/mm/hugetlbpage.c     2011-11-16 18:39:07.000000000 -0500
 @@ -171,7 +171,7 @@ unsigned long hugetlb_get_unmapped_area(
                /* At this point:  (!vmm || addr < vmm->vm_end). */
                if (REGION_OFFSET(addr) + len > RGN_MAP_LIMIT)
@@ -1035,9 +1035,9 @@ diff -urNp linux-3.0.4/arch/ia64/mm/hugetlbpage.c linux-3.0.4/arch/ia64/mm/huget
                        return addr;
                addr = ALIGN(vmm->vm_end, HPAGE_SIZE);
        }
-diff -urNp linux-3.0.4/arch/ia64/mm/init.c linux-3.0.4/arch/ia64/mm/init.c
---- linux-3.0.4/arch/ia64/mm/init.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/ia64/mm/init.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/ia64/mm/init.c linux-3.1.3/arch/ia64/mm/init.c
+--- linux-3.1.3/arch/ia64/mm/init.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/ia64/mm/init.c    2011-11-16 18:39:07.000000000 -0500
 @@ -120,6 +120,19 @@ ia64_init_addr_space (void)
                vma->vm_start = current->thread.rbs_bot & PAGE_MASK;
                vma->vm_end = vma->vm_start + PAGE_SIZE;
@@ -1058,9 +1058,9 @@ diff -urNp linux-3.0.4/arch/ia64/mm/init.c linux-3.0.4/arch/ia64/mm/init.c
                vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
                down_write(&current->mm->mmap_sem);
                if (insert_vm_struct(current->mm, vma)) {
-diff -urNp linux-3.0.4/arch/m32r/lib/usercopy.c linux-3.0.4/arch/m32r/lib/usercopy.c
---- linux-3.0.4/arch/m32r/lib/usercopy.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/m32r/lib/usercopy.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/m32r/lib/usercopy.c linux-3.1.3/arch/m32r/lib/usercopy.c
+--- linux-3.1.3/arch/m32r/lib/usercopy.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/m32r/lib/usercopy.c       2011-11-16 18:39:07.000000000 -0500
 @@ -14,6 +14,9 @@
  unsigned long
  __generic_copy_to_user(void __user *to, const void *from, unsigned long n)
@@ -1081,9 +1081,9 @@ diff -urNp linux-3.0.4/arch/m32r/lib/usercopy.c linux-3.0.4/arch/m32r/lib/userco
        prefetchw(to);
        if (access_ok(VERIFY_READ, from, n))
                __copy_user_zeroing(to,from,n);
-diff -urNp linux-3.0.4/arch/mips/include/asm/elf.h linux-3.0.4/arch/mips/include/asm/elf.h
---- linux-3.0.4/arch/mips/include/asm/elf.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/mips/include/asm/elf.h    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/mips/include/asm/elf.h linux-3.1.3/arch/mips/include/asm/elf.h
+--- linux-3.1.3/arch/mips/include/asm/elf.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/mips/include/asm/elf.h    2011-11-16 18:39:07.000000000 -0500
 @@ -372,13 +372,16 @@ extern const char *__elf_platform;
  #define ELF_ET_DYN_BASE         (TASK_SIZE / 3 * 2)
  #endif
@@ -1105,9 +1105,9 @@ diff -urNp linux-3.0.4/arch/mips/include/asm/elf.h linux-3.0.4/arch/mips/include
 -#define arch_randomize_brk arch_randomize_brk
 -
  #endif /* _ASM_ELF_H */
-diff -urNp linux-3.0.4/arch/mips/include/asm/page.h linux-3.0.4/arch/mips/include/asm/page.h
---- linux-3.0.4/arch/mips/include/asm/page.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/mips/include/asm/page.h   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/mips/include/asm/page.h linux-3.1.3/arch/mips/include/asm/page.h
+--- linux-3.1.3/arch/mips/include/asm/page.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/mips/include/asm/page.h   2011-11-16 18:39:07.000000000 -0500
 @@ -93,7 +93,7 @@ extern void copy_user_highpage(struct pa
    #ifdef CONFIG_CPU_MIPS32
      typedef struct { unsigned long pte_low, pte_high; } pte_t;
@@ -1117,9 +1117,9 @@ diff -urNp linux-3.0.4/arch/mips/include/asm/page.h linux-3.0.4/arch/mips/includ
    #else
       typedef struct { unsigned long long pte; } pte_t;
       #define pte_val(x)       ((x).pte)
-diff -urNp linux-3.0.4/arch/mips/include/asm/system.h linux-3.0.4/arch/mips/include/asm/system.h
---- linux-3.0.4/arch/mips/include/asm/system.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/mips/include/asm/system.h 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/mips/include/asm/system.h linux-3.1.3/arch/mips/include/asm/system.h
+--- linux-3.1.3/arch/mips/include/asm/system.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/mips/include/asm/system.h 2011-11-16 18:39:07.000000000 -0500
 @@ -230,6 +230,6 @@ extern void per_cpu_trap_init(void);
   */
  #define __ARCH_WANT_UNLOCKED_CTXSW
@@ -1128,9 +1128,9 @@ diff -urNp linux-3.0.4/arch/mips/include/asm/system.h linux-3.0.4/arch/mips/incl
 +#define arch_align_stack(x) ((x) & ~0xfUL)
  
  #endif /* _ASM_SYSTEM_H */
-diff -urNp linux-3.0.4/arch/mips/kernel/binfmt_elfn32.c linux-3.0.4/arch/mips/kernel/binfmt_elfn32.c
---- linux-3.0.4/arch/mips/kernel/binfmt_elfn32.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/mips/kernel/binfmt_elfn32.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/mips/kernel/binfmt_elfn32.c linux-3.1.3/arch/mips/kernel/binfmt_elfn32.c
+--- linux-3.1.3/arch/mips/kernel/binfmt_elfn32.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/mips/kernel/binfmt_elfn32.c       2011-11-16 18:39:07.000000000 -0500
 @@ -50,6 +50,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_N
  #undef ELF_ET_DYN_BASE
  #define ELF_ET_DYN_BASE         (TASK32_SIZE / 3 * 2)
@@ -1145,9 +1145,9 @@ diff -urNp linux-3.0.4/arch/mips/kernel/binfmt_elfn32.c linux-3.0.4/arch/mips/ke
  #include <asm/processor.h>
  #include <linux/module.h>
  #include <linux/elfcore.h>
-diff -urNp linux-3.0.4/arch/mips/kernel/binfmt_elfo32.c linux-3.0.4/arch/mips/kernel/binfmt_elfo32.c
---- linux-3.0.4/arch/mips/kernel/binfmt_elfo32.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/mips/kernel/binfmt_elfo32.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/mips/kernel/binfmt_elfo32.c linux-3.1.3/arch/mips/kernel/binfmt_elfo32.c
+--- linux-3.1.3/arch/mips/kernel/binfmt_elfo32.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/mips/kernel/binfmt_elfo32.c       2011-11-16 18:39:07.000000000 -0500
 @@ -52,6 +52,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_N
  #undef ELF_ET_DYN_BASE
  #define ELF_ET_DYN_BASE         (TASK32_SIZE / 3 * 2)
@@ -1162,10 +1162,10 @@ diff -urNp linux-3.0.4/arch/mips/kernel/binfmt_elfo32.c linux-3.0.4/arch/mips/ke
  #include <asm/processor.h>
  
  /*
-diff -urNp linux-3.0.4/arch/mips/kernel/process.c linux-3.0.4/arch/mips/kernel/process.c
---- linux-3.0.4/arch/mips/kernel/process.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/mips/kernel/process.c     2011-08-23 21:47:55.000000000 -0400
-@@ -473,15 +473,3 @@ unsigned long get_wchan(struct task_stru
+diff -urNp linux-3.1.3/arch/mips/kernel/process.c linux-3.1.3/arch/mips/kernel/process.c
+--- linux-3.1.3/arch/mips/kernel/process.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/mips/kernel/process.c     2011-11-16 18:39:07.000000000 -0500
+@@ -481,15 +481,3 @@ unsigned long get_wchan(struct task_stru
  out:
        return pc;
  }
@@ -1181,15 +1181,15 @@ diff -urNp linux-3.0.4/arch/mips/kernel/process.c linux-3.0.4/arch/mips/kernel/p
 -
 -      return sp & ALMASK;
 -}
-diff -urNp linux-3.0.4/arch/mips/mm/fault.c linux-3.0.4/arch/mips/mm/fault.c
---- linux-3.0.4/arch/mips/mm/fault.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/mips/mm/fault.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/mips/mm/fault.c linux-3.1.3/arch/mips/mm/fault.c
+--- linux-3.1.3/arch/mips/mm/fault.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/mips/mm/fault.c   2011-11-16 18:39:07.000000000 -0500
 @@ -28,6 +28,23 @@
  #include <asm/highmem.h>              /* For VMALLOC_END */
  #include <linux/kdebug.h>
  
 +#ifdef CONFIG_PAX_PAGEEXEC
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
 +{
 +      unsigned long i;
 +
@@ -1208,13 +1208,13 @@ diff -urNp linux-3.0.4/arch/mips/mm/fault.c linux-3.0.4/arch/mips/mm/fault.c
  /*
   * This routine handles page faults.  It determines the address,
   * and the problem, and then passes it off to one of the appropriate
-diff -urNp linux-3.0.4/arch/mips/mm/mmap.c linux-3.0.4/arch/mips/mm/mmap.c
---- linux-3.0.4/arch/mips/mm/mmap.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/mips/mm/mmap.c    2011-08-23 21:47:55.000000000 -0400
-@@ -48,14 +48,18 @@ unsigned long arch_get_unmapped_area(str
-       do_color_align = 0;
-       if (filp || (flags & MAP_SHARED))
+diff -urNp linux-3.1.3/arch/mips/mm/mmap.c linux-3.1.3/arch/mips/mm/mmap.c
+--- linux-3.1.3/arch/mips/mm/mmap.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/mips/mm/mmap.c    2011-11-16 18:39:07.000000000 -0500
+@@ -95,6 +95,11 @@ static unsigned long arch_get_unmapped_a
                do_color_align = 1;
+       /* requesting a specific address */
 +
 +#ifdef CONFIG_PAX_RANDMMAP
 +      if (!(current->mm->pax_flags & MF_PAX_RANDMMAP))
@@ -1223,27 +1223,46 @@ diff -urNp linux-3.0.4/arch/mips/mm/mmap.c linux-3.0.4/arch/mips/mm/mmap.c
        if (addr) {
                if (do_color_align)
                        addr = COLOUR_ALIGN(addr, pgoff);
-               else
+@@ -102,8 +107,7 @@ static unsigned long arch_get_unmapped_a
                        addr = PAGE_ALIGN(addr);
-               vmm = find_vma(current->mm, addr);
+               vma = find_vma(mm, addr);
 -              if (TASK_SIZE - len >= addr &&
--                  (!vmm || addr + len <= vmm->vm_start))
+-                  (!vma || addr + len <= vma->vm_start))
 +              if (TASK_SIZE - len >= addr && check_heap_stack_gap(vmm, addr, len))
                        return addr;
        }
-       addr = current->mm->mmap_base;
-@@ -68,7 +72,7 @@ unsigned long arch_get_unmapped_area(str
-               /* At this point:  (!vmm || addr < vmm->vm_end). */
-               if (TASK_SIZE - len < addr)
-                       return -ENOMEM;
--              if (!vmm || addr + len <= vmm->vm_start)
-+              if (check_heap_stack_gap(vmm, addr, len))
-                       return addr;
-               addr = vmm->vm_end;
-               if (do_color_align)
-@@ -93,30 +97,3 @@ void arch_pick_mmap_layout(struct mm_str
-       mm->get_unmapped_area = arch_get_unmapped_area;
-       mm->unmap_area = arch_unmap_area;
+@@ -118,7 +122,7 @@ static unsigned long arch_get_unmapped_a
+                       /* At this point:  (!vma || addr < vma->vm_end). */
+                       if (TASK_SIZE - len < addr)
+                               return -ENOMEM;
+-                      if (!vma || addr + len <= vma->vm_start)
++                      if (check_heap_stack_gap(vmm, addr, len))
+                               return addr;
+                       addr = vma->vm_end;
+                       if (do_color_align)
+@@ -145,7 +149,7 @@ static unsigned long arch_get_unmapped_a
+               /* make sure it can fit in the remaining address space */
+               if (likely(addr > len)) {
+                       vma = find_vma(mm, addr - len);
+-                      if (!vma || addr <= vma->vm_start) {
++                      if (check_heap_stack_gap(vmm, addr - len, len))
+                               /* cache the address as a hint for next time */
+                               return mm->free_area_cache = addr - len;
+                       }
+@@ -165,7 +169,7 @@ static unsigned long arch_get_unmapped_a
+                        * return with success:
+                        */
+                       vma = find_vma(mm, addr);
+-                      if (likely(!vma || addr + len <= vma->vm_start)) {
++                      if (check_heap_stack_gap(vmm, addr, len)) {
+                               /* cache the address as a hint for next time */
+                               return mm->free_area_cache = addr;
+                       }
+@@ -242,30 +246,3 @@ void arch_pick_mmap_layout(struct mm_str
+               mm->unmap_area = arch_unmap_area_topdown;
+       }
  }
 -
 -static inline unsigned long brk_rnd(void)
@@ -1272,9 +1291,9 @@ diff -urNp linux-3.0.4/arch/mips/mm/mmap.c linux-3.0.4/arch/mips/mm/mmap.c
 -
 -      return ret;
 -}
-diff -urNp linux-3.0.4/arch/parisc/include/asm/elf.h linux-3.0.4/arch/parisc/include/asm/elf.h
---- linux-3.0.4/arch/parisc/include/asm/elf.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/parisc/include/asm/elf.h  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/parisc/include/asm/elf.h linux-3.1.3/arch/parisc/include/asm/elf.h
+--- linux-3.1.3/arch/parisc/include/asm/elf.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/parisc/include/asm/elf.h  2011-11-16 18:39:07.000000000 -0500
 @@ -342,6 +342,13 @@ struct pt_regs;   /* forward declaration..
  
  #define ELF_ET_DYN_BASE         (TASK_UNMAPPED_BASE + 0x01000000)
@@ -1289,9 +1308,9 @@ diff -urNp linux-3.0.4/arch/parisc/include/asm/elf.h linux-3.0.4/arch/parisc/inc
  /* This yields a mask that user programs can use to figure out what
     instruction set this CPU supports.  This could be done in user space,
     but it's not easy, and we've already done it here.  */
-diff -urNp linux-3.0.4/arch/parisc/include/asm/pgtable.h linux-3.0.4/arch/parisc/include/asm/pgtable.h
---- linux-3.0.4/arch/parisc/include/asm/pgtable.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/parisc/include/asm/pgtable.h      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/parisc/include/asm/pgtable.h linux-3.1.3/arch/parisc/include/asm/pgtable.h
+--- linux-3.1.3/arch/parisc/include/asm/pgtable.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/parisc/include/asm/pgtable.h      2011-11-16 18:39:07.000000000 -0500
 @@ -210,6 +210,17 @@ struct vm_area_struct;
  #define PAGE_EXECREAD   __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_READ | _PAGE_EXEC |_PAGE_ACCESSED)
  #define PAGE_COPY       PAGE_EXECREAD
@@ -1310,9 +1329,9 @@ diff -urNp linux-3.0.4/arch/parisc/include/asm/pgtable.h linux-3.0.4/arch/parisc
  #define PAGE_KERNEL   __pgprot(_PAGE_KERNEL)
  #define PAGE_KERNEL_EXEC      __pgprot(_PAGE_KERNEL_EXEC)
  #define PAGE_KERNEL_RWX       __pgprot(_PAGE_KERNEL_RWX)
-diff -urNp linux-3.0.4/arch/parisc/kernel/module.c linux-3.0.4/arch/parisc/kernel/module.c
---- linux-3.0.4/arch/parisc/kernel/module.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/parisc/kernel/module.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/parisc/kernel/module.c linux-3.1.3/arch/parisc/kernel/module.c
+--- linux-3.1.3/arch/parisc/kernel/module.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/parisc/kernel/module.c    2011-11-16 18:39:07.000000000 -0500
 @@ -98,16 +98,38 @@
  
  /* three functions to determine where in the module core
@@ -1404,7 +1423,7 @@ diff -urNp linux-3.0.4/arch/parisc/kernel/module.c linux-3.0.4/arch/parisc/kerne
        return (Elf_Addr)fdesc;
  }
  #endif /* CONFIG_64BIT */
-@@ -857,7 +879,7 @@ register_unwind_table(struct module *me,
+@@ -845,7 +867,7 @@ register_unwind_table(struct module *me,
  
        table = (unsigned char *)sechdrs[me->arch.unwind_section].sh_addr;
        end = table + sechdrs[me->arch.unwind_section].sh_size;
@@ -1413,9 +1432,9 @@ diff -urNp linux-3.0.4/arch/parisc/kernel/module.c linux-3.0.4/arch/parisc/kerne
  
        DEBUGP("register_unwind_table(), sect = %d at 0x%p - 0x%p (gp=0x%lx)\n",
               me->arch.unwind_section, table, end, gp);
-diff -urNp linux-3.0.4/arch/parisc/kernel/sys_parisc.c linux-3.0.4/arch/parisc/kernel/sys_parisc.c
---- linux-3.0.4/arch/parisc/kernel/sys_parisc.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/parisc/kernel/sys_parisc.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/parisc/kernel/sys_parisc.c linux-3.1.3/arch/parisc/kernel/sys_parisc.c
+--- linux-3.1.3/arch/parisc/kernel/sys_parisc.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/parisc/kernel/sys_parisc.c        2011-11-16 18:39:07.000000000 -0500
 @@ -43,7 +43,7 @@ static unsigned long get_unshared_area(u
                /* At this point:  (!vma || addr < vma->vm_end). */
                if (TASK_SIZE - len < addr)
@@ -1443,9 +1462,9 @@ diff -urNp linux-3.0.4/arch/parisc/kernel/sys_parisc.c linux-3.0.4/arch/parisc/k
  
        if (filp) {
                addr = get_shared_area(filp->f_mapping, addr, len, pgoff);
-diff -urNp linux-3.0.4/arch/parisc/kernel/traps.c linux-3.0.4/arch/parisc/kernel/traps.c
---- linux-3.0.4/arch/parisc/kernel/traps.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/parisc/kernel/traps.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/parisc/kernel/traps.c linux-3.1.3/arch/parisc/kernel/traps.c
+--- linux-3.1.3/arch/parisc/kernel/traps.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/parisc/kernel/traps.c     2011-11-16 18:39:07.000000000 -0500
 @@ -733,9 +733,7 @@ void notrace handle_interruption(int cod
  
                        down_read(&current->mm->mmap_sem);
@@ -1457,9 +1476,9 @@ diff -urNp linux-3.0.4/arch/parisc/kernel/traps.c linux-3.0.4/arch/parisc/kernel
                                fault_address = regs->iaoq[0];
                                fault_space = regs->iasq[0];
  
-diff -urNp linux-3.0.4/arch/parisc/mm/fault.c linux-3.0.4/arch/parisc/mm/fault.c
---- linux-3.0.4/arch/parisc/mm/fault.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/parisc/mm/fault.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/parisc/mm/fault.c linux-3.1.3/arch/parisc/mm/fault.c
+--- linux-3.1.3/arch/parisc/mm/fault.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/parisc/mm/fault.c 2011-11-16 18:39:07.000000000 -0500
 @@ -15,6 +15,7 @@
  #include <linux/sched.h>
  #include <linux/interrupt.h>
@@ -1575,7 +1594,7 @@ diff -urNp linux-3.0.4/arch/parisc/mm/fault.c linux-3.0.4/arch/parisc/mm/fault.c
 +      return 1;
 +}
 +
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
 +{
 +      unsigned long i;
 +
@@ -1629,9 +1648,9 @@ diff -urNp linux-3.0.4/arch/parisc/mm/fault.c linux-3.0.4/arch/parisc/mm/fault.c
  
        /*
         * If for any reason at all we couldn't handle the fault, make
-diff -urNp linux-3.0.4/arch/powerpc/include/asm/elf.h linux-3.0.4/arch/powerpc/include/asm/elf.h
---- linux-3.0.4/arch/powerpc/include/asm/elf.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/include/asm/elf.h 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/powerpc/include/asm/elf.h linux-3.1.3/arch/powerpc/include/asm/elf.h
+--- linux-3.1.3/arch/powerpc/include/asm/elf.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/include/asm/elf.h 2011-11-16 18:39:07.000000000 -0500
 @@ -178,8 +178,19 @@ typedef elf_fpreg_t elf_vsrreghalf_t32[E
     the loader.  We need to make sure that it is out of the way of the program
     that it will "exec", and that there is sufficient room for the brk.  */
@@ -1664,9 +1683,9 @@ diff -urNp linux-3.0.4/arch/powerpc/include/asm/elf.h linux-3.0.4/arch/powerpc/i
  #endif /* __KERNEL__ */
  
  /*
-diff -urNp linux-3.0.4/arch/powerpc/include/asm/kmap_types.h linux-3.0.4/arch/powerpc/include/asm/kmap_types.h
---- linux-3.0.4/arch/powerpc/include/asm/kmap_types.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/include/asm/kmap_types.h  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/powerpc/include/asm/kmap_types.h linux-3.1.3/arch/powerpc/include/asm/kmap_types.h
+--- linux-3.1.3/arch/powerpc/include/asm/kmap_types.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/include/asm/kmap_types.h  2011-11-16 18:39:07.000000000 -0500
 @@ -27,6 +27,7 @@ enum km_type {
        KM_PPC_SYNC_PAGE,
        KM_PPC_SYNC_ICACHE,
@@ -1675,9 +1694,9 @@ diff -urNp linux-3.0.4/arch/powerpc/include/asm/kmap_types.h linux-3.0.4/arch/po
        KM_TYPE_NR
  };
  
-diff -urNp linux-3.0.4/arch/powerpc/include/asm/mman.h linux-3.0.4/arch/powerpc/include/asm/mman.h
---- linux-3.0.4/arch/powerpc/include/asm/mman.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/include/asm/mman.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/powerpc/include/asm/mman.h linux-3.1.3/arch/powerpc/include/asm/mman.h
+--- linux-3.1.3/arch/powerpc/include/asm/mman.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/include/asm/mman.h        2011-11-16 18:39:07.000000000 -0500
 @@ -44,7 +44,7 @@ static inline unsigned long arch_calc_vm
  }
  #define arch_calc_vm_prot_bits(prot) arch_calc_vm_prot_bits(prot)
@@ -1687,9 +1706,9 @@ diff -urNp linux-3.0.4/arch/powerpc/include/asm/mman.h linux-3.0.4/arch/powerpc/
  {
        return (vm_flags & VM_SAO) ? __pgprot(_PAGE_SAO) : __pgprot(0);
  }
-diff -urNp linux-3.0.4/arch/powerpc/include/asm/page_64.h linux-3.0.4/arch/powerpc/include/asm/page_64.h
---- linux-3.0.4/arch/powerpc/include/asm/page_64.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/include/asm/page_64.h     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/powerpc/include/asm/page_64.h linux-3.1.3/arch/powerpc/include/asm/page_64.h
+--- linux-3.1.3/arch/powerpc/include/asm/page_64.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/include/asm/page_64.h     2011-11-16 18:39:07.000000000 -0500
 @@ -155,15 +155,18 @@ do {                                             \
   * stack by default, so in the absence of a PT_GNU_STACK program header
   * we turn execute permission off.
@@ -1711,9 +1730,9 @@ diff -urNp linux-3.0.4/arch/powerpc/include/asm/page_64.h linux-3.0.4/arch/power
  
  #include <asm-generic/getorder.h>
  
-diff -urNp linux-3.0.4/arch/powerpc/include/asm/page.h linux-3.0.4/arch/powerpc/include/asm/page.h
---- linux-3.0.4/arch/powerpc/include/asm/page.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/include/asm/page.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/powerpc/include/asm/page.h linux-3.1.3/arch/powerpc/include/asm/page.h
+--- linux-3.1.3/arch/powerpc/include/asm/page.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/include/asm/page.h        2011-11-16 18:39:07.000000000 -0500
 @@ -129,8 +129,9 @@ extern phys_addr_t kernstart_addr;
   * and needs to be executable.  This means the whole heap ends
   * up being executable.
@@ -1736,9 +1755,9 @@ diff -urNp linux-3.0.4/arch/powerpc/include/asm/page.h linux-3.0.4/arch/powerpc/
  #ifndef __ASSEMBLY__
  
  #undef STRICT_MM_TYPECHECKS
-diff -urNp linux-3.0.4/arch/powerpc/include/asm/pgtable.h linux-3.0.4/arch/powerpc/include/asm/pgtable.h
---- linux-3.0.4/arch/powerpc/include/asm/pgtable.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/include/asm/pgtable.h     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/powerpc/include/asm/pgtable.h linux-3.1.3/arch/powerpc/include/asm/pgtable.h
+--- linux-3.1.3/arch/powerpc/include/asm/pgtable.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/include/asm/pgtable.h     2011-11-16 18:39:07.000000000 -0500
 @@ -2,6 +2,7 @@
  #define _ASM_POWERPC_PGTABLE_H
  #ifdef __KERNEL__
@@ -1747,9 +1766,9 @@ diff -urNp linux-3.0.4/arch/powerpc/include/asm/pgtable.h linux-3.0.4/arch/power
  #ifndef __ASSEMBLY__
  #include <asm/processor.h>            /* For TASK_SIZE */
  #include <asm/mmu.h>
-diff -urNp linux-3.0.4/arch/powerpc/include/asm/pte-hash32.h linux-3.0.4/arch/powerpc/include/asm/pte-hash32.h
---- linux-3.0.4/arch/powerpc/include/asm/pte-hash32.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/include/asm/pte-hash32.h  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/powerpc/include/asm/pte-hash32.h linux-3.1.3/arch/powerpc/include/asm/pte-hash32.h
+--- linux-3.1.3/arch/powerpc/include/asm/pte-hash32.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/include/asm/pte-hash32.h  2011-11-16 18:39:07.000000000 -0500
 @@ -21,6 +21,7 @@
  #define _PAGE_FILE    0x004   /* when !present: nonlinear file mapping */
  #define _PAGE_USER    0x004   /* usermode access allowed */
@@ -1758,10 +1777,10 @@ diff -urNp linux-3.0.4/arch/powerpc/include/asm/pte-hash32.h linux-3.0.4/arch/po
  #define _PAGE_COHERENT        0x010   /* M: enforce memory coherence (SMP systems) */
  #define _PAGE_NO_CACHE        0x020   /* I: cache inhibit */
  #define _PAGE_WRITETHRU       0x040   /* W: cache write-through */
-diff -urNp linux-3.0.4/arch/powerpc/include/asm/reg.h linux-3.0.4/arch/powerpc/include/asm/reg.h
---- linux-3.0.4/arch/powerpc/include/asm/reg.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/include/asm/reg.h 2011-08-23 21:47:55.000000000 -0400
-@@ -209,6 +209,7 @@
+diff -urNp linux-3.1.3/arch/powerpc/include/asm/reg.h linux-3.1.3/arch/powerpc/include/asm/reg.h
+--- linux-3.1.3/arch/powerpc/include/asm/reg.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/include/asm/reg.h 2011-11-16 18:39:07.000000000 -0500
+@@ -212,6 +212,7 @@
  #define SPRN_DBCR     0x136   /* e300 Data Breakpoint Control Reg */
  #define SPRN_DSISR    0x012   /* Data Storage Interrupt Status Register */
  #define   DSISR_NOHPTE                0x40000000      /* no translation found */
@@ -1769,10 +1788,10 @@ diff -urNp linux-3.0.4/arch/powerpc/include/asm/reg.h linux-3.0.4/arch/powerpc/i
  #define   DSISR_PROTFAULT     0x08000000      /* protection fault */
  #define   DSISR_ISSTORE               0x02000000      /* access was a store */
  #define   DSISR_DABRMATCH     0x00400000      /* hit data breakpoint */
-diff -urNp linux-3.0.4/arch/powerpc/include/asm/system.h linux-3.0.4/arch/powerpc/include/asm/system.h
---- linux-3.0.4/arch/powerpc/include/asm/system.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/include/asm/system.h      2011-08-23 21:47:55.000000000 -0400
-@@ -531,7 +531,7 @@ __cmpxchg_local(volatile void *ptr, unsi
+diff -urNp linux-3.1.3/arch/powerpc/include/asm/system.h linux-3.1.3/arch/powerpc/include/asm/system.h
+--- linux-3.1.3/arch/powerpc/include/asm/system.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/include/asm/system.h      2011-11-16 18:39:07.000000000 -0500
+@@ -530,7 +530,7 @@ __cmpxchg_local(volatile void *ptr, unsi
  #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
  #endif
  
@@ -1781,9 +1800,9 @@ diff -urNp linux-3.0.4/arch/powerpc/include/asm/system.h linux-3.0.4/arch/powerp
  
  /* Used in very early kernel initialization. */
  extern unsigned long reloc_offset(void);
-diff -urNp linux-3.0.4/arch/powerpc/include/asm/uaccess.h linux-3.0.4/arch/powerpc/include/asm/uaccess.h
---- linux-3.0.4/arch/powerpc/include/asm/uaccess.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/include/asm/uaccess.h     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/powerpc/include/asm/uaccess.h linux-3.1.3/arch/powerpc/include/asm/uaccess.h
+--- linux-3.1.3/arch/powerpc/include/asm/uaccess.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/include/asm/uaccess.h     2011-11-16 18:39:07.000000000 -0500
 @@ -13,6 +13,8 @@
  #define VERIFY_READ   0
  #define VERIFY_WRITE  1
@@ -1961,10 +1980,10 @@ diff -urNp linux-3.0.4/arch/powerpc/include/asm/uaccess.h linux-3.0.4/arch/power
  extern unsigned long __clear_user(void __user *addr, unsigned long size);
  
  static inline unsigned long clear_user(void __user *addr, unsigned long size)
-diff -urNp linux-3.0.4/arch/powerpc/kernel/exceptions-64e.S linux-3.0.4/arch/powerpc/kernel/exceptions-64e.S
---- linux-3.0.4/arch/powerpc/kernel/exceptions-64e.S   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/kernel/exceptions-64e.S   2011-08-23 21:47:55.000000000 -0400
-@@ -567,6 +567,7 @@ storage_fault_common:
+diff -urNp linux-3.1.3/arch/powerpc/kernel/exceptions-64e.S linux-3.1.3/arch/powerpc/kernel/exceptions-64e.S
+--- linux-3.1.3/arch/powerpc/kernel/exceptions-64e.S   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/kernel/exceptions-64e.S   2011-11-16 18:39:07.000000000 -0500
+@@ -587,6 +587,7 @@ storage_fault_common:
        std     r14,_DAR(r1)
        std     r15,_DSISR(r1)
        addi    r3,r1,STACK_FRAME_OVERHEAD
@@ -1972,7 +1991,7 @@ diff -urNp linux-3.0.4/arch/powerpc/kernel/exceptions-64e.S linux-3.0.4/arch/pow
        mr      r4,r14
        mr      r5,r15
        ld      r14,PACA_EXGEN+EX_R14(r13)
-@@ -576,8 +577,7 @@ storage_fault_common:
+@@ -596,8 +597,7 @@ storage_fault_common:
        cmpdi   r3,0
        bne-    1f
        b       .ret_from_except_lite
@@ -1982,10 +2001,10 @@ diff -urNp linux-3.0.4/arch/powerpc/kernel/exceptions-64e.S linux-3.0.4/arch/pow
        addi    r3,r1,STACK_FRAME_OVERHEAD
        ld      r4,_DAR(r1)
        bl      .bad_page_fault
-diff -urNp linux-3.0.4/arch/powerpc/kernel/exceptions-64s.S linux-3.0.4/arch/powerpc/kernel/exceptions-64s.S
---- linux-3.0.4/arch/powerpc/kernel/exceptions-64s.S   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/kernel/exceptions-64s.S   2011-08-23 21:47:55.000000000 -0400
-@@ -956,10 +956,10 @@ handle_page_fault:
+diff -urNp linux-3.1.3/arch/powerpc/kernel/exceptions-64s.S linux-3.1.3/arch/powerpc/kernel/exceptions-64s.S
+--- linux-3.1.3/arch/powerpc/kernel/exceptions-64s.S   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/kernel/exceptions-64s.S   2011-11-16 18:39:07.000000000 -0500
+@@ -1014,10 +1014,10 @@ handle_page_fault:
  11:   ld      r4,_DAR(r1)
        ld      r5,_DSISR(r1)
        addi    r3,r1,STACK_FRAME_OVERHEAD
@@ -1997,9 +2016,9 @@ diff -urNp linux-3.0.4/arch/powerpc/kernel/exceptions-64s.S linux-3.0.4/arch/pow
        mr      r5,r3
        addi    r3,r1,STACK_FRAME_OVERHEAD
        lwz     r4,_DAR(r1)
-diff -urNp linux-3.0.4/arch/powerpc/kernel/module_32.c linux-3.0.4/arch/powerpc/kernel/module_32.c
---- linux-3.0.4/arch/powerpc/kernel/module_32.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/kernel/module_32.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/powerpc/kernel/module_32.c linux-3.1.3/arch/powerpc/kernel/module_32.c
+--- linux-3.1.3/arch/powerpc/kernel/module_32.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/kernel/module_32.c        2011-11-16 18:39:07.000000000 -0500
 @@ -162,7 +162,7 @@ int module_frob_arch_sections(Elf32_Ehdr
                        me->arch.core_plt_section = i;
        }
@@ -2009,7 +2028,7 @@ diff -urNp linux-3.0.4/arch/powerpc/kernel/module_32.c linux-3.0.4/arch/powerpc/
                return -ENOEXEC;
        }
  
-@@ -203,11 +203,16 @@ static uint32_t do_plt_call(void *locati
+@@ -192,11 +192,16 @@ static uint32_t do_plt_call(void *locati
  
        DEBUGP("Doing plt for call to 0x%x at 0x%x\n", val, (unsigned int)location);
        /* Init, or core PLT? */
@@ -2029,52 +2048,10 @@ diff -urNp linux-3.0.4/arch/powerpc/kernel/module_32.c linux-3.0.4/arch/powerpc/
  
        /* Find this entry, or if that fails, the next avail. entry */
        while (entry->jump[0]) {
-diff -urNp linux-3.0.4/arch/powerpc/kernel/module.c linux-3.0.4/arch/powerpc/kernel/module.c
---- linux-3.0.4/arch/powerpc/kernel/module.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/kernel/module.c   2011-08-23 21:47:55.000000000 -0400
-@@ -31,11 +31,24 @@
- LIST_HEAD(module_bug_list);
-+#ifdef CONFIG_PAX_KERNEXEC
- void *module_alloc(unsigned long size)
- {
-       if (size == 0)
-               return NULL;
-+      return vmalloc(size);
-+}
-+
-+void *module_alloc_exec(unsigned long size)
-+#else
-+void *module_alloc(unsigned long size)
-+#endif
-+
-+{
-+      if (size == 0)
-+              return NULL;
-+
-       return vmalloc_exec(size);
- }
-@@ -45,6 +58,13 @@ void module_free(struct module *mod, voi
-       vfree(module_region);
- }
-+#ifdef CONFIG_PAX_KERNEXEC
-+void module_free_exec(struct module *mod, void *module_region)
-+{
-+      module_free(mod, module_region);
-+}
-+#endif
-+
- static const Elf_Shdr *find_section(const Elf_Ehdr *hdr,
-                                   const Elf_Shdr *sechdrs,
-                                   const char *name)
-diff -urNp linux-3.0.4/arch/powerpc/kernel/process.c linux-3.0.4/arch/powerpc/kernel/process.c
---- linux-3.0.4/arch/powerpc/kernel/process.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/kernel/process.c  2011-08-23 21:48:14.000000000 -0400
-@@ -676,8 +676,8 @@ void show_regs(struct pt_regs * regs)
+diff -urNp linux-3.1.3/arch/powerpc/kernel/process.c linux-3.1.3/arch/powerpc/kernel/process.c
+--- linux-3.1.3/arch/powerpc/kernel/process.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/kernel/process.c  2011-11-16 18:40:08.000000000 -0500
+@@ -682,8 +682,8 @@ void show_regs(struct pt_regs * regs)
         * Lookup NIP late so we have the best change of getting the
         * above info out without failing
         */
@@ -2085,7 +2062,7 @@ diff -urNp linux-3.0.4/arch/powerpc/kernel/process.c linux-3.0.4/arch/powerpc/ke
  #endif
        show_stack(current, (unsigned long *) regs->gpr[1]);
        if (!user_mode(regs))
-@@ -1183,10 +1183,10 @@ void show_stack(struct task_struct *tsk,
+@@ -1187,10 +1187,10 @@ void show_stack(struct task_struct *tsk,
                newsp = stack[0];
                ip = stack[STACK_FRAME_LR_SAVE];
                if (!firstframe || ip != lr) {
@@ -2098,7 +2075,7 @@ diff -urNp linux-3.0.4/arch/powerpc/kernel/process.c linux-3.0.4/arch/powerpc/ke
                                       (void *)current->ret_stack[curr_frame].ret);
                                curr_frame--;
                        }
-@@ -1206,7 +1206,7 @@ void show_stack(struct task_struct *tsk,
+@@ -1210,7 +1210,7 @@ void show_stack(struct task_struct *tsk,
                        struct pt_regs *regs = (struct pt_regs *)
                                (sp + STACK_FRAME_OVERHEAD);
                        lr = regs->link;
@@ -2107,7 +2084,7 @@ diff -urNp linux-3.0.4/arch/powerpc/kernel/process.c linux-3.0.4/arch/powerpc/ke
                               regs->trap, (void *)regs->nip, (void *)lr);
                        firstframe = 1;
                }
-@@ -1281,58 +1281,3 @@ void thread_info_cache_init(void)
+@@ -1285,58 +1285,3 @@ void thread_info_cache_init(void)
  }
  
  #endif /* THREAD_SHIFT < PAGE_SHIFT */
@@ -2166,9 +2143,9 @@ diff -urNp linux-3.0.4/arch/powerpc/kernel/process.c linux-3.0.4/arch/powerpc/ke
 -
 -      return ret;
 -}
-diff -urNp linux-3.0.4/arch/powerpc/kernel/signal_32.c linux-3.0.4/arch/powerpc/kernel/signal_32.c
---- linux-3.0.4/arch/powerpc/kernel/signal_32.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/kernel/signal_32.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/powerpc/kernel/signal_32.c linux-3.1.3/arch/powerpc/kernel/signal_32.c
+--- linux-3.1.3/arch/powerpc/kernel/signal_32.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/kernel/signal_32.c        2011-11-16 18:39:07.000000000 -0500
 @@ -859,7 +859,7 @@ int handle_rt_signal32(unsigned long sig
        /* Save user registers on the stack */
        frame = &rt_sf->uc.uc_mcontext;
@@ -2178,9 +2155,9 @@ diff -urNp linux-3.0.4/arch/powerpc/kernel/signal_32.c linux-3.0.4/arch/powerpc/
                if (save_user_regs(regs, frame, 0, 1))
                        goto badframe;
                regs->link = current->mm->context.vdso_base + vdso32_rt_sigtramp;
-diff -urNp linux-3.0.4/arch/powerpc/kernel/signal_64.c linux-3.0.4/arch/powerpc/kernel/signal_64.c
---- linux-3.0.4/arch/powerpc/kernel/signal_64.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/kernel/signal_64.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/powerpc/kernel/signal_64.c linux-3.1.3/arch/powerpc/kernel/signal_64.c
+--- linux-3.1.3/arch/powerpc/kernel/signal_64.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/kernel/signal_64.c        2011-11-16 18:39:07.000000000 -0500
 @@ -430,7 +430,7 @@ int handle_rt_signal64(int signr, struct
        current->thread.fpscr.val = 0;
  
@@ -2190,9 +2167,9 @@ diff -urNp linux-3.0.4/arch/powerpc/kernel/signal_64.c linux-3.0.4/arch/powerpc/
                regs->link = current->mm->context.vdso_base + vdso64_rt_sigtramp;
        } else {
                err |= setup_trampoline(__NR_rt_sigreturn, &frame->tramp[0]);
-diff -urNp linux-3.0.4/arch/powerpc/kernel/traps.c linux-3.0.4/arch/powerpc/kernel/traps.c
---- linux-3.0.4/arch/powerpc/kernel/traps.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/kernel/traps.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/powerpc/kernel/traps.c linux-3.1.3/arch/powerpc/kernel/traps.c
+--- linux-3.1.3/arch/powerpc/kernel/traps.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/kernel/traps.c    2011-11-16 18:40:08.000000000 -0500
 @@ -98,6 +98,8 @@ static void pmac_backlight_unblank(void)
  static inline void pmac_backlight_unblank(void) { }
  #endif
@@ -2211,9 +2188,9 @@ diff -urNp linux-3.0.4/arch/powerpc/kernel/traps.c linux-3.0.4/arch/powerpc/kern
        oops_exit();
        do_exit(err);
  
-diff -urNp linux-3.0.4/arch/powerpc/kernel/vdso.c linux-3.0.4/arch/powerpc/kernel/vdso.c
---- linux-3.0.4/arch/powerpc/kernel/vdso.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/kernel/vdso.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/powerpc/kernel/vdso.c linux-3.1.3/arch/powerpc/kernel/vdso.c
+--- linux-3.1.3/arch/powerpc/kernel/vdso.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/kernel/vdso.c     2011-11-16 18:39:07.000000000 -0500
 @@ -36,6 +36,7 @@
  #include <asm/firmware.h>
  #include <asm/vdso.h>
@@ -2240,9 +2217,9 @@ diff -urNp linux-3.0.4/arch/powerpc/kernel/vdso.c linux-3.0.4/arch/powerpc/kerne
        if (IS_ERR_VALUE(vdso_base)) {
                rc = vdso_base;
                goto fail_mmapsem;
-diff -urNp linux-3.0.4/arch/powerpc/lib/usercopy_64.c linux-3.0.4/arch/powerpc/lib/usercopy_64.c
---- linux-3.0.4/arch/powerpc/lib/usercopy_64.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/lib/usercopy_64.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/powerpc/lib/usercopy_64.c linux-3.1.3/arch/powerpc/lib/usercopy_64.c
+--- linux-3.1.3/arch/powerpc/lib/usercopy_64.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/lib/usercopy_64.c 2011-11-16 18:39:07.000000000 -0500
 @@ -9,22 +9,6 @@
  #include <linux/module.h>
  #include <asm/uaccess.h>
@@ -2274,9 +2251,9 @@ diff -urNp linux-3.0.4/arch/powerpc/lib/usercopy_64.c linux-3.0.4/arch/powerpc/l
 -EXPORT_SYMBOL(copy_to_user);
  EXPORT_SYMBOL(copy_in_user);
  
-diff -urNp linux-3.0.4/arch/powerpc/mm/fault.c linux-3.0.4/arch/powerpc/mm/fault.c
---- linux-3.0.4/arch/powerpc/mm/fault.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/mm/fault.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/powerpc/mm/fault.c linux-3.1.3/arch/powerpc/mm/fault.c
+--- linux-3.1.3/arch/powerpc/mm/fault.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/mm/fault.c        2011-11-16 18:39:07.000000000 -0500
 @@ -32,6 +32,10 @@
  #include <linux/perf_event.h>
  #include <linux/magic.h>
@@ -2311,7 +2288,7 @@ diff -urNp linux-3.0.4/arch/powerpc/mm/fault.c linux-3.0.4/arch/powerpc/mm/fault
 +      return 1;
 +}
 +
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
 +{
 +      unsigned long i;
 +
@@ -2381,9 +2358,9 @@ diff -urNp linux-3.0.4/arch/powerpc/mm/fault.c linux-3.0.4/arch/powerpc/mm/fault
                _exception(SIGSEGV, regs, code, address);
                return 0;
        }
-diff -urNp linux-3.0.4/arch/powerpc/mm/mmap_64.c linux-3.0.4/arch/powerpc/mm/mmap_64.c
---- linux-3.0.4/arch/powerpc/mm/mmap_64.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/mm/mmap_64.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/powerpc/mm/mmap_64.c linux-3.1.3/arch/powerpc/mm/mmap_64.c
+--- linux-3.1.3/arch/powerpc/mm/mmap_64.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/mm/mmap_64.c      2011-11-16 18:39:07.000000000 -0500
 @@ -99,10 +99,22 @@ void arch_pick_mmap_layout(struct mm_str
         */
        if (mmap_is_legacy()) {
@@ -2407,9 +2384,9 @@ diff -urNp linux-3.0.4/arch/powerpc/mm/mmap_64.c linux-3.0.4/arch/powerpc/mm/mma
                mm->get_unmapped_area = arch_get_unmapped_area_topdown;
                mm->unmap_area = arch_unmap_area_topdown;
        }
-diff -urNp linux-3.0.4/arch/powerpc/mm/slice.c linux-3.0.4/arch/powerpc/mm/slice.c
---- linux-3.0.4/arch/powerpc/mm/slice.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/powerpc/mm/slice.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/powerpc/mm/slice.c linux-3.1.3/arch/powerpc/mm/slice.c
+--- linux-3.1.3/arch/powerpc/mm/slice.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/powerpc/mm/slice.c        2011-11-16 18:39:07.000000000 -0500
 @@ -98,7 +98,7 @@ static int slice_area_is_free(struct mm_
        if ((mm->task_size - len) < addr)
                return 0;
@@ -2476,9 +2453,9 @@ diff -urNp linux-3.0.4/arch/powerpc/mm/slice.c linux-3.0.4/arch/powerpc/mm/slice
        /* If hint, make sure it matches our alignment restrictions */
        if (!fixed && addr) {
                addr = _ALIGN_UP(addr, 1ul << pshift);
-diff -urNp linux-3.0.4/arch/s390/include/asm/elf.h linux-3.0.4/arch/s390/include/asm/elf.h
---- linux-3.0.4/arch/s390/include/asm/elf.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/s390/include/asm/elf.h    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/s390/include/asm/elf.h linux-3.1.3/arch/s390/include/asm/elf.h
+--- linux-3.1.3/arch/s390/include/asm/elf.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/s390/include/asm/elf.h    2011-11-16 18:39:07.000000000 -0500
 @@ -162,8 +162,14 @@ extern unsigned int vdso_enabled;
     the loader.  We need to make sure that it is out of the way of the program
     that it will "exec", and that there is sufficient room for the brk.  */
@@ -2496,7 +2473,7 @@ diff -urNp linux-3.0.4/arch/s390/include/asm/elf.h linux-3.0.4/arch/s390/include
  
  /* This yields a mask that user programs can use to figure out what
     instruction set this CPU supports. */
-@@ -210,7 +216,4 @@ struct linux_binprm;
+@@ -211,7 +217,4 @@ struct linux_binprm;
  #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
  int arch_setup_additional_pages(struct linux_binprm *, int);
  
@@ -2504,10 +2481,10 @@ diff -urNp linux-3.0.4/arch/s390/include/asm/elf.h linux-3.0.4/arch/s390/include
 -#define arch_randomize_brk arch_randomize_brk
 -
  #endif
-diff -urNp linux-3.0.4/arch/s390/include/asm/system.h linux-3.0.4/arch/s390/include/asm/system.h
---- linux-3.0.4/arch/s390/include/asm/system.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/s390/include/asm/system.h 2011-08-23 21:47:55.000000000 -0400
-@@ -255,7 +255,7 @@ extern void (*_machine_restart)(char *co
+diff -urNp linux-3.1.3/arch/s390/include/asm/system.h linux-3.1.3/arch/s390/include/asm/system.h
+--- linux-3.1.3/arch/s390/include/asm/system.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/s390/include/asm/system.h 2011-11-16 18:39:07.000000000 -0500
+@@ -256,7 +256,7 @@ extern void (*_machine_restart)(char *co
  extern void (*_machine_halt)(void);
  extern void (*_machine_power_off)(void);
  
@@ -2516,9 +2493,9 @@ diff -urNp linux-3.0.4/arch/s390/include/asm/system.h linux-3.0.4/arch/s390/incl
  
  static inline int tprot(unsigned long addr)
  {
-diff -urNp linux-3.0.4/arch/s390/include/asm/uaccess.h linux-3.0.4/arch/s390/include/asm/uaccess.h
---- linux-3.0.4/arch/s390/include/asm/uaccess.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/s390/include/asm/uaccess.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/s390/include/asm/uaccess.h linux-3.1.3/arch/s390/include/asm/uaccess.h
+--- linux-3.1.3/arch/s390/include/asm/uaccess.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/s390/include/asm/uaccess.h        2011-11-16 18:39:07.000000000 -0500
 @@ -235,6 +235,10 @@ static inline unsigned long __must_check
  copy_to_user(void __user *to, const void *from, unsigned long n)
  {
@@ -2551,10 +2528,10 @@ diff -urNp linux-3.0.4/arch/s390/include/asm/uaccess.h linux-3.0.4/arch/s390/inc
        if (unlikely(sz != -1 && sz < n)) {
                copy_from_user_overflow();
                return n;
-diff -urNp linux-3.0.4/arch/s390/kernel/module.c linux-3.0.4/arch/s390/kernel/module.c
---- linux-3.0.4/arch/s390/kernel/module.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/s390/kernel/module.c      2011-08-23 21:47:55.000000000 -0400
-@@ -168,11 +168,11 @@ module_frob_arch_sections(Elf_Ehdr *hdr,
+diff -urNp linux-3.1.3/arch/s390/kernel/module.c linux-3.1.3/arch/s390/kernel/module.c
+--- linux-3.1.3/arch/s390/kernel/module.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/s390/kernel/module.c      2011-11-16 18:39:07.000000000 -0500
+@@ -161,11 +161,11 @@ module_frob_arch_sections(Elf_Ehdr *hdr,
  
        /* Increase core size by size of got & plt and set start
           offsets for got and plt. */
@@ -2571,7 +2548,7 @@ diff -urNp linux-3.0.4/arch/s390/kernel/module.c linux-3.0.4/arch/s390/kernel/mo
        return 0;
  }
  
-@@ -258,7 +258,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base
+@@ -242,7 +242,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base
                if (info->got_initialized == 0) {
                        Elf_Addr *gotent;
  
@@ -2580,7 +2557,7 @@ diff -urNp linux-3.0.4/arch/s390/kernel/module.c linux-3.0.4/arch/s390/kernel/mo
                                info->got_offset;
                        *gotent = val;
                        info->got_initialized = 1;
-@@ -282,7 +282,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base
+@@ -266,7 +266,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base
                else if (r_type == R_390_GOTENT ||
                         r_type == R_390_GOTPLTENT)
                        *(unsigned int *) loc =
@@ -2589,7 +2566,7 @@ diff -urNp linux-3.0.4/arch/s390/kernel/module.c linux-3.0.4/arch/s390/kernel/mo
                else if (r_type == R_390_GOT64 ||
                         r_type == R_390_GOTPLT64)
                        *(unsigned long *) loc = val;
-@@ -296,7 +296,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base
+@@ -280,7 +280,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base
        case R_390_PLTOFF64:    /* 16 bit offset from GOT to PLT. */
                if (info->plt_initialized == 0) {
                        unsigned int *ip;
@@ -2598,7 +2575,7 @@ diff -urNp linux-3.0.4/arch/s390/kernel/module.c linux-3.0.4/arch/s390/kernel/mo
                                info->plt_offset;
  #ifndef CONFIG_64BIT
                        ip[0] = 0x0d105810; /* basr 1,0; l 1,6(1); br 1 */
-@@ -321,7 +321,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base
+@@ -305,7 +305,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base
                               val - loc + 0xffffUL < 0x1ffffeUL) ||
                              (r_type == R_390_PLT32DBL &&
                               val - loc + 0xffffffffULL < 0x1fffffffeULL)))
@@ -2607,7 +2584,7 @@ diff -urNp linux-3.0.4/arch/s390/kernel/module.c linux-3.0.4/arch/s390/kernel/mo
                                        me->arch.plt_offset +
                                        info->plt_offset;
                        val += rela->r_addend - loc;
-@@ -343,7 +343,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base
+@@ -327,7 +327,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base
        case R_390_GOTOFF32:    /* 32 bit offset to GOT.  */
        case R_390_GOTOFF64:    /* 64 bit offset to GOT. */
                val = val + rela->r_addend -
@@ -2616,7 +2593,7 @@ diff -urNp linux-3.0.4/arch/s390/kernel/module.c linux-3.0.4/arch/s390/kernel/mo
                if (r_type == R_390_GOTOFF16)
                        *(unsigned short *) loc = val;
                else if (r_type == R_390_GOTOFF32)
-@@ -353,7 +353,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base
+@@ -337,7 +337,7 @@ apply_rela(Elf_Rela *rela, Elf_Addr base
                break;
        case R_390_GOTPC:       /* 32 bit PC relative offset to GOT. */
        case R_390_GOTPCDBL:    /* 32 bit PC rel. off. to GOT shifted by 1. */
@@ -2625,9 +2602,9 @@ diff -urNp linux-3.0.4/arch/s390/kernel/module.c linux-3.0.4/arch/s390/kernel/mo
                        rela->r_addend - loc;
                if (r_type == R_390_GOTPC)
                        *(unsigned int *) loc = val;
-diff -urNp linux-3.0.4/arch/s390/kernel/process.c linux-3.0.4/arch/s390/kernel/process.c
---- linux-3.0.4/arch/s390/kernel/process.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/s390/kernel/process.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/s390/kernel/process.c linux-3.1.3/arch/s390/kernel/process.c
+--- linux-3.1.3/arch/s390/kernel/process.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/s390/kernel/process.c     2011-11-16 18:39:07.000000000 -0500
 @@ -319,39 +319,3 @@ unsigned long get_wchan(struct task_stru
        }
        return 0;
@@ -2668,9 +2645,9 @@ diff -urNp linux-3.0.4/arch/s390/kernel/process.c linux-3.0.4/arch/s390/kernel/p
 -              return base;
 -      return ret;
 -}
-diff -urNp linux-3.0.4/arch/s390/kernel/setup.c linux-3.0.4/arch/s390/kernel/setup.c
---- linux-3.0.4/arch/s390/kernel/setup.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/s390/kernel/setup.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/s390/kernel/setup.c linux-3.1.3/arch/s390/kernel/setup.c
+--- linux-3.1.3/arch/s390/kernel/setup.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/s390/kernel/setup.c       2011-11-16 18:39:07.000000000 -0500
 @@ -271,7 +271,7 @@ static int __init early_parse_mem(char *
  }
  early_param("mem", early_parse_mem);
@@ -2680,9 +2657,9 @@ diff -urNp linux-3.0.4/arch/s390/kernel/setup.c linux-3.0.4/arch/s390/kernel/set
  EXPORT_SYMBOL_GPL(user_mode);
  
  static int set_amode_and_uaccess(unsigned long user_amode,
-diff -urNp linux-3.0.4/arch/s390/mm/mmap.c linux-3.0.4/arch/s390/mm/mmap.c
---- linux-3.0.4/arch/s390/mm/mmap.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/s390/mm/mmap.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/s390/mm/mmap.c linux-3.1.3/arch/s390/mm/mmap.c
+--- linux-3.1.3/arch/s390/mm/mmap.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/s390/mm/mmap.c    2011-11-16 18:39:07.000000000 -0500
 @@ -91,10 +91,22 @@ void arch_pick_mmap_layout(struct mm_str
         */
        if (mmap_is_legacy()) {
@@ -2729,9 +2706,9 @@ diff -urNp linux-3.0.4/arch/s390/mm/mmap.c linux-3.0.4/arch/s390/mm/mmap.c
                mm->get_unmapped_area = s390_get_unmapped_area_topdown;
                mm->unmap_area = arch_unmap_area_topdown;
        }
-diff -urNp linux-3.0.4/arch/score/include/asm/system.h linux-3.0.4/arch/score/include/asm/system.h
---- linux-3.0.4/arch/score/include/asm/system.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/score/include/asm/system.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/score/include/asm/system.h linux-3.1.3/arch/score/include/asm/system.h
+--- linux-3.1.3/arch/score/include/asm/system.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/score/include/asm/system.h        2011-11-16 18:39:07.000000000 -0500
 @@ -17,7 +17,7 @@ do {                                                         \
  #define finish_arch_switch(prev)      do {} while (0)
  
@@ -2741,9 +2718,9 @@ diff -urNp linux-3.0.4/arch/score/include/asm/system.h linux-3.0.4/arch/score/in
  
  #define mb()          barrier()
  #define rmb()         barrier()
-diff -urNp linux-3.0.4/arch/score/kernel/process.c linux-3.0.4/arch/score/kernel/process.c
---- linux-3.0.4/arch/score/kernel/process.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/score/kernel/process.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/score/kernel/process.c linux-3.1.3/arch/score/kernel/process.c
+--- linux-3.1.3/arch/score/kernel/process.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/score/kernel/process.c    2011-11-16 18:39:07.000000000 -0500
 @@ -161,8 +161,3 @@ unsigned long get_wchan(struct task_stru
  
        return task_pt_regs(task)->cp0_epc;
@@ -2753,9 +2730,9 @@ diff -urNp linux-3.0.4/arch/score/kernel/process.c linux-3.0.4/arch/score/kernel
 -{
 -      return sp;
 -}
-diff -urNp linux-3.0.4/arch/sh/mm/mmap.c linux-3.0.4/arch/sh/mm/mmap.c
---- linux-3.0.4/arch/sh/mm/mmap.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sh/mm/mmap.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sh/mm/mmap.c linux-3.1.3/arch/sh/mm/mmap.c
+--- linux-3.1.3/arch/sh/mm/mmap.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sh/mm/mmap.c      2011-11-16 18:39:07.000000000 -0500
 @@ -74,8 +74,7 @@ unsigned long arch_get_unmapped_area(str
                        addr = PAGE_ALIGN(addr);
  
@@ -2830,9 +2807,9 @@ diff -urNp linux-3.0.4/arch/sh/mm/mmap.c linux-3.0.4/arch/sh/mm/mmap.c
  
  bottomup:
        /*
-diff -urNp linux-3.0.4/arch/sparc/include/asm/atomic_64.h linux-3.0.4/arch/sparc/include/asm/atomic_64.h
---- linux-3.0.4/arch/sparc/include/asm/atomic_64.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/include/asm/atomic_64.h     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/include/asm/atomic_64.h linux-3.1.3/arch/sparc/include/asm/atomic_64.h
+--- linux-3.1.3/arch/sparc/include/asm/atomic_64.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/include/asm/atomic_64.h     2011-11-16 18:39:07.000000000 -0500
 @@ -14,18 +14,40 @@
  #define ATOMIC64_INIT(i)      { (i) }
  
@@ -2915,7 +2892,7 @@ diff -urNp linux-3.0.4/arch/sparc/include/asm/atomic_64.h linux-3.0.4/arch/sparc
  #define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0)
  
  #define atomic_sub_and_test(i, v) (atomic_sub_ret(i, v) == 0)
-@@ -59,30 +101,65 @@ extern long atomic64_sub_ret(long, atomi
+@@ -59,25 +101,60 @@ extern long atomic64_sub_ret(long, atomi
  #define atomic64_dec_and_test(v) (atomic64_sub_ret(1, v) == 0)
  
  #define atomic_inc(v) atomic_add(1, v)
@@ -2954,7 +2931,7 @@ diff -urNp linux-3.0.4/arch/sparc/include/asm/atomic_64.h linux-3.0.4/arch/sparc
 +      return xchg(&v->counter, new);
 +}
  
- static inline int atomic_add_unless(atomic_t *v, int a, int u)
+ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
  {
 -      int c, old;
 +      int c, old, new;
@@ -2979,13 +2956,7 @@ diff -urNp linux-3.0.4/arch/sparc/include/asm/atomic_64.h linux-3.0.4/arch/sparc
                if (likely(old == c))
                        break;
                c = old;
-       }
--      return c != (u);
-+      return c != u;
- }
- #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
-@@ -90,20 +167,35 @@ static inline int atomic_add_unless(atom
+@@ -89,20 +166,35 @@ static inline int __atomic_add_unless(at
  #define atomic64_cmpxchg(v, o, n) \
        ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
  #define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
@@ -3025,9 +2996,9 @@ diff -urNp linux-3.0.4/arch/sparc/include/asm/atomic_64.h linux-3.0.4/arch/sparc
  }
  
  #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
-diff -urNp linux-3.0.4/arch/sparc/include/asm/cache.h linux-3.0.4/arch/sparc/include/asm/cache.h
---- linux-3.0.4/arch/sparc/include/asm/cache.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/include/asm/cache.h 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/include/asm/cache.h linux-3.1.3/arch/sparc/include/asm/cache.h
+--- linux-3.1.3/arch/sparc/include/asm/cache.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/include/asm/cache.h 2011-11-16 18:39:07.000000000 -0500
 @@ -10,7 +10,7 @@
  #define ARCH_SLAB_MINALIGN    __alignof__(unsigned long long)
  
@@ -3037,9 +3008,9 @@ diff -urNp linux-3.0.4/arch/sparc/include/asm/cache.h linux-3.0.4/arch/sparc/inc
  
  #ifdef CONFIG_SPARC32
  #define SMP_CACHE_BYTES_SHIFT 5
-diff -urNp linux-3.0.4/arch/sparc/include/asm/elf_32.h linux-3.0.4/arch/sparc/include/asm/elf_32.h
---- linux-3.0.4/arch/sparc/include/asm/elf_32.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/include/asm/elf_32.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/include/asm/elf_32.h linux-3.1.3/arch/sparc/include/asm/elf_32.h
+--- linux-3.1.3/arch/sparc/include/asm/elf_32.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/include/asm/elf_32.h        2011-11-16 18:39:07.000000000 -0500
 @@ -114,6 +114,13 @@ typedef struct {
  
  #define ELF_ET_DYN_BASE         (TASK_UNMAPPED_BASE)
@@ -3054,9 +3025,9 @@ diff -urNp linux-3.0.4/arch/sparc/include/asm/elf_32.h linux-3.0.4/arch/sparc/in
  /* This yields a mask that user programs can use to figure out what
     instruction set this cpu supports.  This can NOT be done in userspace
     on Sparc.  */
-diff -urNp linux-3.0.4/arch/sparc/include/asm/elf_64.h linux-3.0.4/arch/sparc/include/asm/elf_64.h
---- linux-3.0.4/arch/sparc/include/asm/elf_64.h        2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/arch/sparc/include/asm/elf_64.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/include/asm/elf_64.h linux-3.1.3/arch/sparc/include/asm/elf_64.h
+--- linux-3.1.3/arch/sparc/include/asm/elf_64.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/include/asm/elf_64.h        2011-11-16 18:39:07.000000000 -0500
 @@ -180,6 +180,13 @@ typedef struct {
  #define ELF_ET_DYN_BASE               0x0000010000000000UL
  #define COMPAT_ELF_ET_DYN_BASE        0x0000000070000000UL
@@ -3071,9 +3042,9 @@ diff -urNp linux-3.0.4/arch/sparc/include/asm/elf_64.h linux-3.0.4/arch/sparc/in
  extern unsigned long sparc64_elf_hwcap;
  #define ELF_HWCAP     sparc64_elf_hwcap
  
-diff -urNp linux-3.0.4/arch/sparc/include/asm/pgtable_32.h linux-3.0.4/arch/sparc/include/asm/pgtable_32.h
---- linux-3.0.4/arch/sparc/include/asm/pgtable_32.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/include/asm/pgtable_32.h    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/include/asm/pgtable_32.h linux-3.1.3/arch/sparc/include/asm/pgtable_32.h
+--- linux-3.1.3/arch/sparc/include/asm/pgtable_32.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/include/asm/pgtable_32.h    2011-11-16 18:39:07.000000000 -0500
 @@ -45,6 +45,13 @@ BTFIXUPDEF_SIMM13(user_ptrs_per_pgd)
  BTFIXUPDEF_INT(page_none)
  BTFIXUPDEF_INT(page_copy)
@@ -3105,9 +3076,9 @@ diff -urNp linux-3.0.4/arch/sparc/include/asm/pgtable_32.h linux-3.0.4/arch/spar
  extern unsigned long page_kernel;
  
  #ifdef MODULE
-diff -urNp linux-3.0.4/arch/sparc/include/asm/pgtsrmmu.h linux-3.0.4/arch/sparc/include/asm/pgtsrmmu.h
---- linux-3.0.4/arch/sparc/include/asm/pgtsrmmu.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/include/asm/pgtsrmmu.h      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/include/asm/pgtsrmmu.h linux-3.1.3/arch/sparc/include/asm/pgtsrmmu.h
+--- linux-3.1.3/arch/sparc/include/asm/pgtsrmmu.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/include/asm/pgtsrmmu.h      2011-11-16 18:39:07.000000000 -0500
 @@ -115,6 +115,13 @@
                                    SRMMU_EXEC | SRMMU_REF)
  #define SRMMU_PAGE_RDONLY  __pgprot(SRMMU_VALID | SRMMU_CACHE | \
@@ -3122,9 +3093,9 @@ diff -urNp linux-3.0.4/arch/sparc/include/asm/pgtsrmmu.h linux-3.0.4/arch/sparc/
  #define SRMMU_PAGE_KERNEL  __pgprot(SRMMU_VALID | SRMMU_CACHE | SRMMU_PRIV | \
                                    SRMMU_DIRTY | SRMMU_REF)
  
-diff -urNp linux-3.0.4/arch/sparc/include/asm/spinlock_64.h linux-3.0.4/arch/sparc/include/asm/spinlock_64.h
---- linux-3.0.4/arch/sparc/include/asm/spinlock_64.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/include/asm/spinlock_64.h   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/include/asm/spinlock_64.h linux-3.1.3/arch/sparc/include/asm/spinlock_64.h
+--- linux-3.1.3/arch/sparc/include/asm/spinlock_64.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/include/asm/spinlock_64.h   2011-11-16 18:39:07.000000000 -0500
 @@ -92,14 +92,19 @@ static inline void arch_spin_lock_flags(
  
  /* Multi-reader locks, these are much saner than the 32-bit Sparc ones... */
@@ -3222,9 +3193,9 @@ diff -urNp linux-3.0.4/arch/sparc/include/asm/spinlock_64.h linux-3.0.4/arch/spa
  {
        unsigned long mask, tmp1, tmp2, result;
  
-diff -urNp linux-3.0.4/arch/sparc/include/asm/thread_info_32.h linux-3.0.4/arch/sparc/include/asm/thread_info_32.h
---- linux-3.0.4/arch/sparc/include/asm/thread_info_32.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/include/asm/thread_info_32.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/include/asm/thread_info_32.h linux-3.1.3/arch/sparc/include/asm/thread_info_32.h
+--- linux-3.1.3/arch/sparc/include/asm/thread_info_32.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/include/asm/thread_info_32.h        2011-11-16 18:39:07.000000000 -0500
 @@ -50,6 +50,8 @@ struct thread_info {
        unsigned long           w_saved;
  
@@ -3234,9 +3205,9 @@ diff -urNp linux-3.0.4/arch/sparc/include/asm/thread_info_32.h linux-3.0.4/arch/
  };
  
  /*
-diff -urNp linux-3.0.4/arch/sparc/include/asm/thread_info_64.h linux-3.0.4/arch/sparc/include/asm/thread_info_64.h
---- linux-3.0.4/arch/sparc/include/asm/thread_info_64.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/include/asm/thread_info_64.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/include/asm/thread_info_64.h linux-3.1.3/arch/sparc/include/asm/thread_info_64.h
+--- linux-3.1.3/arch/sparc/include/asm/thread_info_64.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/include/asm/thread_info_64.h        2011-11-16 18:39:07.000000000 -0500
 @@ -63,6 +63,8 @@ struct thread_info {
        struct pt_regs          *kern_una_regs;
        unsigned int            kern_una_insn;
@@ -3246,9 +3217,9 @@ diff -urNp linux-3.0.4/arch/sparc/include/asm/thread_info_64.h linux-3.0.4/arch/
        unsigned long           fpregs[0] __attribute__ ((aligned(64)));
  };
  
-diff -urNp linux-3.0.4/arch/sparc/include/asm/uaccess_32.h linux-3.0.4/arch/sparc/include/asm/uaccess_32.h
---- linux-3.0.4/arch/sparc/include/asm/uaccess_32.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/include/asm/uaccess_32.h    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/include/asm/uaccess_32.h linux-3.1.3/arch/sparc/include/asm/uaccess_32.h
+--- linux-3.1.3/arch/sparc/include/asm/uaccess_32.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/include/asm/uaccess_32.h    2011-11-16 18:39:07.000000000 -0500
 @@ -249,27 +249,46 @@ extern unsigned long __copy_user(void __
  
  static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n)
@@ -3300,9 +3271,9 @@ diff -urNp linux-3.0.4/arch/sparc/include/asm/uaccess_32.h linux-3.0.4/arch/spar
        return __copy_user((__force void __user *) to, from, n);
  }
  
-diff -urNp linux-3.0.4/arch/sparc/include/asm/uaccess_64.h linux-3.0.4/arch/sparc/include/asm/uaccess_64.h
---- linux-3.0.4/arch/sparc/include/asm/uaccess_64.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/include/asm/uaccess_64.h    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/include/asm/uaccess_64.h linux-3.1.3/arch/sparc/include/asm/uaccess_64.h
+--- linux-3.1.3/arch/sparc/include/asm/uaccess_64.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/include/asm/uaccess_64.h    2011-11-16 18:39:07.000000000 -0500
 @@ -10,6 +10,7 @@
  #include <linux/compiler.h>
  #include <linux/string.h>
@@ -3345,9 +3316,9 @@ diff -urNp linux-3.0.4/arch/sparc/include/asm/uaccess_64.h linux-3.0.4/arch/spar
        if (unlikely(ret))
                ret = copy_to_user_fixup(to, from, size);
        return ret;
-diff -urNp linux-3.0.4/arch/sparc/include/asm/uaccess.h linux-3.0.4/arch/sparc/include/asm/uaccess.h
---- linux-3.0.4/arch/sparc/include/asm/uaccess.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/include/asm/uaccess.h       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/include/asm/uaccess.h linux-3.1.3/arch/sparc/include/asm/uaccess.h
+--- linux-3.1.3/arch/sparc/include/asm/uaccess.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/include/asm/uaccess.h       2011-11-16 18:39:07.000000000 -0500
 @@ -1,5 +1,13 @@
  #ifndef ___ASM_SPARC_UACCESS_H
  #define ___ASM_SPARC_UACCESS_H
@@ -3362,9 +3333,9 @@ diff -urNp linux-3.0.4/arch/sparc/include/asm/uaccess.h linux-3.0.4/arch/sparc/i
  #if defined(__sparc__) && defined(__arch64__)
  #include <asm/uaccess_64.h>
  #else
-diff -urNp linux-3.0.4/arch/sparc/kernel/Makefile linux-3.0.4/arch/sparc/kernel/Makefile
---- linux-3.0.4/arch/sparc/kernel/Makefile     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/kernel/Makefile     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/kernel/Makefile linux-3.1.3/arch/sparc/kernel/Makefile
+--- linux-3.1.3/arch/sparc/kernel/Makefile     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/kernel/Makefile     2011-11-16 18:39:07.000000000 -0500
 @@ -3,7 +3,7 @@
  #
  
@@ -3374,9 +3345,9 @@ diff -urNp linux-3.0.4/arch/sparc/kernel/Makefile linux-3.0.4/arch/sparc/kernel/
  
  extra-y     := head_$(BITS).o
  extra-y     += init_task.o
-diff -urNp linux-3.0.4/arch/sparc/kernel/process_32.c linux-3.0.4/arch/sparc/kernel/process_32.c
---- linux-3.0.4/arch/sparc/kernel/process_32.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/kernel/process_32.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/kernel/process_32.c linux-3.1.3/arch/sparc/kernel/process_32.c
+--- linux-3.1.3/arch/sparc/kernel/process_32.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/kernel/process_32.c 2011-11-16 18:40:08.000000000 -0500
 @@ -204,7 +204,7 @@ void __show_backtrace(unsigned long fp)
                       rw->ins[4], rw->ins[5],
                       rw->ins[6],
@@ -3412,9 +3383,9 @@ diff -urNp linux-3.0.4/arch/sparc/kernel/process_32.c linux-3.0.4/arch/sparc/ker
                fp = rw->ins[6];
        } while (++count < 16);
        printk("\n");
-diff -urNp linux-3.0.4/arch/sparc/kernel/process_64.c linux-3.0.4/arch/sparc/kernel/process_64.c
---- linux-3.0.4/arch/sparc/kernel/process_64.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/kernel/process_64.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/kernel/process_64.c linux-3.1.3/arch/sparc/kernel/process_64.c
+--- linux-3.1.3/arch/sparc/kernel/process_64.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/kernel/process_64.c 2011-11-16 18:40:08.000000000 -0500
 @@ -180,14 +180,14 @@ static void show_regwindow(struct pt_reg
        printk("i4: %016lx i5: %016lx i6: %016lx i7: %016lx\n",
               rwk->ins[4], rwk->ins[5], rwk->ins[6], rwk->ins[7]);
@@ -3450,9 +3421,9 @@ diff -urNp linux-3.0.4/arch/sparc/kernel/process_64.c linux-3.0.4/arch/sparc/ker
                               (void *) gp->tpc,
                               (void *) gp->o7,
                               (void *) gp->i7,
-diff -urNp linux-3.0.4/arch/sparc/kernel/sys_sparc_32.c linux-3.0.4/arch/sparc/kernel/sys_sparc_32.c
---- linux-3.0.4/arch/sparc/kernel/sys_sparc_32.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/kernel/sys_sparc_32.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/kernel/sys_sparc_32.c linux-3.1.3/arch/sparc/kernel/sys_sparc_32.c
+--- linux-3.1.3/arch/sparc/kernel/sys_sparc_32.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/kernel/sys_sparc_32.c       2011-11-16 18:39:07.000000000 -0500
 @@ -56,7 +56,7 @@ unsigned long arch_get_unmapped_area(str
        if (ARCH_SUN4C && len > 0x20000000)
                return -ENOMEM;
@@ -3471,9 +3442,9 @@ diff -urNp linux-3.0.4/arch/sparc/kernel/sys_sparc_32.c linux-3.0.4/arch/sparc/k
                        return addr;
                addr = vmm->vm_end;
                if (flags & MAP_SHARED)
-diff -urNp linux-3.0.4/arch/sparc/kernel/sys_sparc_64.c linux-3.0.4/arch/sparc/kernel/sys_sparc_64.c
---- linux-3.0.4/arch/sparc/kernel/sys_sparc_64.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/kernel/sys_sparc_64.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/kernel/sys_sparc_64.c linux-3.1.3/arch/sparc/kernel/sys_sparc_64.c
+--- linux-3.1.3/arch/sparc/kernel/sys_sparc_64.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/kernel/sys_sparc_64.c       2011-11-16 18:39:07.000000000 -0500
 @@ -124,7 +124,7 @@ unsigned long arch_get_unmapped_area(str
                /* We do not accept a shared mapping if it would violate
                 * cache aliasing constraints.
@@ -3621,9 +3592,9 @@ diff -urNp linux-3.0.4/arch/sparc/kernel/sys_sparc_64.c linux-3.0.4/arch/sparc/k
                mm->get_unmapped_area = arch_get_unmapped_area_topdown;
                mm->unmap_area = arch_unmap_area_topdown;
        }
-diff -urNp linux-3.0.4/arch/sparc/kernel/traps_32.c linux-3.0.4/arch/sparc/kernel/traps_32.c
---- linux-3.0.4/arch/sparc/kernel/traps_32.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/kernel/traps_32.c   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/kernel/traps_32.c linux-3.1.3/arch/sparc/kernel/traps_32.c
+--- linux-3.1.3/arch/sparc/kernel/traps_32.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/kernel/traps_32.c   2011-11-16 18:40:08.000000000 -0500
 @@ -44,6 +44,8 @@ static void instruction_dump(unsigned lo
  #define __SAVE __asm__ __volatile__("save %sp, -0x40, %sp\n\t")
  #define __RESTORE __asm__ __volatile__("restore %g0, %g0, %g0\n\t")
@@ -3653,9 +3624,9 @@ diff -urNp linux-3.0.4/arch/sparc/kernel/traps_32.c linux-3.0.4/arch/sparc/kerne
        do_exit(SIGSEGV);
  }
  
-diff -urNp linux-3.0.4/arch/sparc/kernel/traps_64.c linux-3.0.4/arch/sparc/kernel/traps_64.c
---- linux-3.0.4/arch/sparc/kernel/traps_64.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/kernel/traps_64.c   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/kernel/traps_64.c linux-3.1.3/arch/sparc/kernel/traps_64.c
+--- linux-3.1.3/arch/sparc/kernel/traps_64.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/kernel/traps_64.c   2011-11-16 18:40:08.000000000 -0500
 @@ -75,7 +75,7 @@ static void dump_tl1_traplog(struct tl1_
                       i + 1,
                       p->trapstack[i].tstate, p->trapstack[i].tpc,
@@ -3793,9 +3764,9 @@ diff -urNp linux-3.0.4/arch/sparc/kernel/traps_64.c linux-3.0.4/arch/sparc/kerne
        do_exit(SIGSEGV);
  }
  EXPORT_SYMBOL(die_if_kernel);
-diff -urNp linux-3.0.4/arch/sparc/kernel/unaligned_64.c linux-3.0.4/arch/sparc/kernel/unaligned_64.c
---- linux-3.0.4/arch/sparc/kernel/unaligned_64.c       2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/arch/sparc/kernel/unaligned_64.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/kernel/unaligned_64.c linux-3.1.3/arch/sparc/kernel/unaligned_64.c
+--- linux-3.1.3/arch/sparc/kernel/unaligned_64.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/kernel/unaligned_64.c       2011-11-16 18:40:08.000000000 -0500
 @@ -279,7 +279,7 @@ static void log_unaligned(struct pt_regs
        static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 5);
  
@@ -3805,9 +3776,9 @@ diff -urNp linux-3.0.4/arch/sparc/kernel/unaligned_64.c linux-3.0.4/arch/sparc/k
                       regs->tpc, (void *) regs->tpc);
        }
  }
-diff -urNp linux-3.0.4/arch/sparc/lib/atomic_64.S linux-3.0.4/arch/sparc/lib/atomic_64.S
---- linux-3.0.4/arch/sparc/lib/atomic_64.S     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/lib/atomic_64.S     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/lib/atomic_64.S linux-3.1.3/arch/sparc/lib/atomic_64.S
+--- linux-3.1.3/arch/sparc/lib/atomic_64.S     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/lib/atomic_64.S     2011-11-16 18:39:07.000000000 -0500
 @@ -18,7 +18,12 @@
  atomic_add: /* %o0 = increment, %o1 = atomic_ptr */
        BACKOFF_SETUP(%o2)
@@ -4042,9 +4013,9 @@ diff -urNp linux-3.0.4/arch/sparc/lib/atomic_64.S linux-3.0.4/arch/sparc/lib/ato
        casx    [%o1], %g1, %g7
        cmp     %g1, %g7
        bne,pn  %xcc, BACKOFF_LABEL(2f, 1b)
-diff -urNp linux-3.0.4/arch/sparc/lib/ksyms.c linux-3.0.4/arch/sparc/lib/ksyms.c
---- linux-3.0.4/arch/sparc/lib/ksyms.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/lib/ksyms.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/lib/ksyms.c linux-3.1.3/arch/sparc/lib/ksyms.c
+--- linux-3.1.3/arch/sparc/lib/ksyms.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/lib/ksyms.c 2011-11-16 18:39:07.000000000 -0500
 @@ -142,12 +142,18 @@ EXPORT_SYMBOL(__downgrade_write);
  
  /* Atomic counter implementation. */
@@ -4064,9 +4035,9 @@ diff -urNp linux-3.0.4/arch/sparc/lib/ksyms.c linux-3.0.4/arch/sparc/lib/ksyms.c
  EXPORT_SYMBOL(atomic64_sub_ret);
  
  /* Atomic bit operations. */
-diff -urNp linux-3.0.4/arch/sparc/lib/Makefile linux-3.0.4/arch/sparc/lib/Makefile
---- linux-3.0.4/arch/sparc/lib/Makefile        2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/arch/sparc/lib/Makefile        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/lib/Makefile linux-3.1.3/arch/sparc/lib/Makefile
+--- linux-3.1.3/arch/sparc/lib/Makefile        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/lib/Makefile        2011-11-16 18:39:07.000000000 -0500
 @@ -2,7 +2,7 @@
  #
  
@@ -4076,9 +4047,9 @@ diff -urNp linux-3.0.4/arch/sparc/lib/Makefile linux-3.0.4/arch/sparc/lib/Makefi
  
  lib-$(CONFIG_SPARC32) += mul.o rem.o sdiv.o udiv.o umul.o urem.o ashrdi3.o
  lib-$(CONFIG_SPARC32) += memcpy.o memset.o
-diff -urNp linux-3.0.4/arch/sparc/Makefile linux-3.0.4/arch/sparc/Makefile
---- linux-3.0.4/arch/sparc/Makefile    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/Makefile    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/Makefile linux-3.1.3/arch/sparc/Makefile
+--- linux-3.1.3/arch/sparc/Makefile    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/Makefile    2011-11-16 18:40:08.000000000 -0500
 @@ -75,7 +75,7 @@ drivers-$(CONFIG_OPROFILE)   += arch/sparc
  # Export what is needed by arch/sparc/boot/Makefile
  export VMLINUX_INIT VMLINUX_MAIN
@@ -4088,9 +4059,9 @@ diff -urNp linux-3.0.4/arch/sparc/Makefile linux-3.0.4/arch/sparc/Makefile
  VMLINUX_MAIN += $(patsubst %/, %/lib.a, $(libs-y)) $(libs-y)
  VMLINUX_MAIN += $(drivers-y) $(net-y)
  
-diff -urNp linux-3.0.4/arch/sparc/mm/fault_32.c linux-3.0.4/arch/sparc/mm/fault_32.c
---- linux-3.0.4/arch/sparc/mm/fault_32.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/mm/fault_32.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/mm/fault_32.c linux-3.1.3/arch/sparc/mm/fault_32.c
+--- linux-3.1.3/arch/sparc/mm/fault_32.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/mm/fault_32.c       2011-11-16 18:39:07.000000000 -0500
 @@ -22,6 +22,9 @@
  #include <linux/interrupt.h>
  #include <linux/module.h>
@@ -4351,7 +4322,7 @@ diff -urNp linux-3.0.4/arch/sparc/mm/fault_32.c linux-3.0.4/arch/sparc/mm/fault_
 +      return 1;
 +}
 +
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
 +{
 +      unsigned long i;
 +
@@ -4395,9 +4366,9 @@ diff -urNp linux-3.0.4/arch/sparc/mm/fault_32.c linux-3.0.4/arch/sparc/mm/fault_
                /* Allow reads even for write-only mappings */
                if(!(vma->vm_flags & (VM_READ | VM_EXEC)))
                        goto bad_area;
-diff -urNp linux-3.0.4/arch/sparc/mm/fault_64.c linux-3.0.4/arch/sparc/mm/fault_64.c
---- linux-3.0.4/arch/sparc/mm/fault_64.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/mm/fault_64.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/mm/fault_64.c linux-3.1.3/arch/sparc/mm/fault_64.c
+--- linux-3.1.3/arch/sparc/mm/fault_64.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/mm/fault_64.c       2011-11-16 18:40:08.000000000 -0500
 @@ -21,6 +21,9 @@
  #include <linux/kprobes.h>
  #include <linux/kdebug.h>
@@ -4856,7 +4827,7 @@ diff -urNp linux-3.0.4/arch/sparc/mm/fault_64.c linux-3.0.4/arch/sparc/mm/fault_
 +      return 1;
 +}
 +
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
 +{
 +      unsigned long i;
 +
@@ -4905,9 +4876,9 @@ diff -urNp linux-3.0.4/arch/sparc/mm/fault_64.c linux-3.0.4/arch/sparc/mm/fault_
        /* Pure DTLB misses do not tell us whether the fault causing
         * load/store/atomic was a write or not, it only says that there
         * was no match.  So in such a case we (carefully) read the
-diff -urNp linux-3.0.4/arch/sparc/mm/hugetlbpage.c linux-3.0.4/arch/sparc/mm/hugetlbpage.c
---- linux-3.0.4/arch/sparc/mm/hugetlbpage.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/mm/hugetlbpage.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/mm/hugetlbpage.c linux-3.1.3/arch/sparc/mm/hugetlbpage.c
+--- linux-3.1.3/arch/sparc/mm/hugetlbpage.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/mm/hugetlbpage.c    2011-11-16 18:39:07.000000000 -0500
 @@ -68,7 +68,7 @@ full_search:
                        }
                        return -ENOMEM;
@@ -4967,9 +4938,9 @@ diff -urNp linux-3.0.4/arch/sparc/mm/hugetlbpage.c linux-3.0.4/arch/sparc/mm/hug
                        return addr;
        }
        if (mm->get_unmapped_area == arch_get_unmapped_area)
-diff -urNp linux-3.0.4/arch/sparc/mm/init_32.c linux-3.0.4/arch/sparc/mm/init_32.c
---- linux-3.0.4/arch/sparc/mm/init_32.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/mm/init_32.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/mm/init_32.c linux-3.1.3/arch/sparc/mm/init_32.c
+--- linux-3.1.3/arch/sparc/mm/init_32.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/mm/init_32.c        2011-11-16 18:39:07.000000000 -0500
 @@ -316,6 +316,9 @@ extern void device_scan(void);
  pgprot_t PAGE_SHARED __read_mostly;
  EXPORT_SYMBOL(PAGE_SHARED);
@@ -5004,9 +4975,9 @@ diff -urNp linux-3.0.4/arch/sparc/mm/init_32.c linux-3.0.4/arch/sparc/mm/init_32
        protection_map[12] = PAGE_READONLY;
        protection_map[13] = PAGE_READONLY;
        protection_map[14] = PAGE_SHARED;
-diff -urNp linux-3.0.4/arch/sparc/mm/Makefile linux-3.0.4/arch/sparc/mm/Makefile
---- linux-3.0.4/arch/sparc/mm/Makefile 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/mm/Makefile 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/mm/Makefile linux-3.1.3/arch/sparc/mm/Makefile
+--- linux-3.1.3/arch/sparc/mm/Makefile 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/mm/Makefile 2011-11-16 18:39:07.000000000 -0500
 @@ -2,7 +2,7 @@
  #
  
@@ -5014,11 +4985,11 @@ diff -urNp linux-3.0.4/arch/sparc/mm/Makefile linux-3.0.4/arch/sparc/mm/Makefile
 -ccflags-y := -Werror
 +#ccflags-y := -Werror
  
- obj-$(CONFIG_SPARC64)   += ultra.o tlb.o tsb.o
+ obj-$(CONFIG_SPARC64)   += ultra.o tlb.o tsb.o gup.o
  obj-y                   += fault_$(BITS).o
-diff -urNp linux-3.0.4/arch/sparc/mm/srmmu.c linux-3.0.4/arch/sparc/mm/srmmu.c
---- linux-3.0.4/arch/sparc/mm/srmmu.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/sparc/mm/srmmu.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/sparc/mm/srmmu.c linux-3.1.3/arch/sparc/mm/srmmu.c
+--- linux-3.1.3/arch/sparc/mm/srmmu.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/sparc/mm/srmmu.c  2011-11-16 18:39:07.000000000 -0500
 @@ -2200,6 +2200,13 @@ void __init ld_mmu_srmmu(void)
        PAGE_SHARED = pgprot_val(SRMMU_PAGE_SHARED);
        BTFIXUPSET_INT(page_copy, pgprot_val(SRMMU_PAGE_COPY));
@@ -5033,9 +5004,9 @@ diff -urNp linux-3.0.4/arch/sparc/mm/srmmu.c linux-3.0.4/arch/sparc/mm/srmmu.c
        BTFIXUPSET_INT(page_kernel, pgprot_val(SRMMU_PAGE_KERNEL));
        page_kernel = pgprot_val(SRMMU_PAGE_KERNEL);
  
-diff -urNp linux-3.0.4/arch/um/include/asm/kmap_types.h linux-3.0.4/arch/um/include/asm/kmap_types.h
---- linux-3.0.4/arch/um/include/asm/kmap_types.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/um/include/asm/kmap_types.h       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/um/include/asm/kmap_types.h linux-3.1.3/arch/um/include/asm/kmap_types.h
+--- linux-3.1.3/arch/um/include/asm/kmap_types.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/um/include/asm/kmap_types.h       2011-11-16 18:39:07.000000000 -0500
 @@ -23,6 +23,7 @@ enum km_type {
        KM_IRQ1,
        KM_SOFTIRQ0,
@@ -5044,9 +5015,9 @@ diff -urNp linux-3.0.4/arch/um/include/asm/kmap_types.h linux-3.0.4/arch/um/incl
        KM_TYPE_NR
  };
  
-diff -urNp linux-3.0.4/arch/um/include/asm/page.h linux-3.0.4/arch/um/include/asm/page.h
---- linux-3.0.4/arch/um/include/asm/page.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/um/include/asm/page.h     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/um/include/asm/page.h linux-3.1.3/arch/um/include/asm/page.h
+--- linux-3.1.3/arch/um/include/asm/page.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/um/include/asm/page.h     2011-11-16 18:39:07.000000000 -0500
 @@ -14,6 +14,9 @@
  #define PAGE_SIZE     (_AC(1, UL) << PAGE_SHIFT)
  #define PAGE_MASK     (~(PAGE_SIZE-1))
@@ -5057,9 +5028,9 @@ diff -urNp linux-3.0.4/arch/um/include/asm/page.h linux-3.0.4/arch/um/include/as
  #ifndef __ASSEMBLY__
  
  struct page;
-diff -urNp linux-3.0.4/arch/um/kernel/process.c linux-3.0.4/arch/um/kernel/process.c
---- linux-3.0.4/arch/um/kernel/process.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/um/kernel/process.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/um/kernel/process.c linux-3.1.3/arch/um/kernel/process.c
+--- linux-3.1.3/arch/um/kernel/process.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/um/kernel/process.c       2011-11-16 18:39:07.000000000 -0500
 @@ -404,22 +404,6 @@ int singlestepping(void * t)
        return 2;
  }
@@ -5083,9 +5054,35 @@ diff -urNp linux-3.0.4/arch/um/kernel/process.c linux-3.0.4/arch/um/kernel/proce
  unsigned long get_wchan(struct task_struct *p)
  {
        unsigned long stack_page, sp, ip;
-diff -urNp linux-3.0.4/arch/um/sys-i386/syscalls.c linux-3.0.4/arch/um/sys-i386/syscalls.c
---- linux-3.0.4/arch/um/sys-i386/syscalls.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/um/sys-i386/syscalls.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/um/Makefile linux-3.1.3/arch/um/Makefile
+--- linux-3.1.3/arch/um/Makefile       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/um/Makefile       2011-11-16 18:39:07.000000000 -0500
+@@ -49,6 +49,10 @@ USER_CFLAGS = $(patsubst $(KERNEL_DEFINE
+       $(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \
+       $(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64
++ifdef CONSTIFY_PLUGIN
++USER_CFLAGS   += $(CONSTIFY_PLUGIN) -fplugin-arg-constify_plugin-no-constify
++endif
++
+ include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
+ #This will adjust *FLAGS accordingly to the platform.
+diff -urNp linux-3.1.3/arch/um/sys-i386/shared/sysdep/system.h linux-3.1.3/arch/um/sys-i386/shared/sysdep/system.h
+--- linux-3.1.3/arch/um/sys-i386/shared/sysdep/system.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/um/sys-i386/shared/sysdep/system.h        2011-11-16 18:39:07.000000000 -0500
+@@ -17,7 +17,7 @@
+ # define AT_VECTOR_SIZE_ARCH 1
+ #endif
+-extern unsigned long arch_align_stack(unsigned long sp);
++#define arch_align_stack(x) ((x) & ~0xfUL)
+ void default_idle(void);
+diff -urNp linux-3.1.3/arch/um/sys-i386/syscalls.c linux-3.1.3/arch/um/sys-i386/syscalls.c
+--- linux-3.1.3/arch/um/sys-i386/syscalls.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/um/sys-i386/syscalls.c    2011-11-16 18:39:07.000000000 -0500
 @@ -11,6 +11,21 @@
  #include "asm/uaccess.h"
  #include "asm/unistd.h"
@@ -5108,9 +5105,21 @@ diff -urNp linux-3.0.4/arch/um/sys-i386/syscalls.c linux-3.0.4/arch/um/sys-i386/
  /*
   * The prototype on i386 is:
   *
-diff -urNp linux-3.0.4/arch/x86/boot/bitops.h linux-3.0.4/arch/x86/boot/bitops.h
---- linux-3.0.4/arch/x86/boot/bitops.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/boot/bitops.h 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/um/sys-x86_64/shared/sysdep/system.h linux-3.1.3/arch/um/sys-x86_64/shared/sysdep/system.h
+--- linux-3.1.3/arch/um/sys-x86_64/shared/sysdep/system.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/um/sys-x86_64/shared/sysdep/system.h      2011-11-16 18:39:07.000000000 -0500
+@@ -17,7 +17,7 @@
+ # define AT_VECTOR_SIZE_ARCH 1
+ #endif
+-extern unsigned long arch_align_stack(unsigned long sp);
++#define arch_align_stack(x) ((x) & ~0xfUL)
+ void default_idle(void);
+diff -urNp linux-3.1.3/arch/x86/boot/bitops.h linux-3.1.3/arch/x86/boot/bitops.h
+--- linux-3.1.3/arch/x86/boot/bitops.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/boot/bitops.h 2011-11-16 18:39:07.000000000 -0500
 @@ -26,7 +26,7 @@ static inline int variable_test_bit(int 
        u8 v;
        const u32 *p = (const u32 *)addr;
@@ -5129,9 +5138,9 @@ diff -urNp linux-3.0.4/arch/x86/boot/bitops.h linux-3.0.4/arch/x86/boot/bitops.h
  }
  
  #endif /* BOOT_BITOPS_H */
-diff -urNp linux-3.0.4/arch/x86/boot/boot.h linux-3.0.4/arch/x86/boot/boot.h
---- linux-3.0.4/arch/x86/boot/boot.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/boot/boot.h   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/boot/boot.h linux-3.1.3/arch/x86/boot/boot.h
+--- linux-3.1.3/arch/x86/boot/boot.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/boot/boot.h   2011-11-16 18:39:07.000000000 -0500
 @@ -85,7 +85,7 @@ static inline void io_delay(void)
  static inline u16 ds(void)
  {
@@ -5150,9 +5159,9 @@ diff -urNp linux-3.0.4/arch/x86/boot/boot.h linux-3.0.4/arch/x86/boot/boot.h
            : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len));
        return diff;
  }
-diff -urNp linux-3.0.4/arch/x86/boot/compressed/head_32.S linux-3.0.4/arch/x86/boot/compressed/head_32.S
---- linux-3.0.4/arch/x86/boot/compressed/head_32.S     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/boot/compressed/head_32.S     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/boot/compressed/head_32.S linux-3.1.3/arch/x86/boot/compressed/head_32.S
+--- linux-3.1.3/arch/x86/boot/compressed/head_32.S     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/boot/compressed/head_32.S     2011-11-16 18:39:07.000000000 -0500
 @@ -76,7 +76,7 @@ ENTRY(startup_32)
        notl    %eax
        andl    %eax, %ebx
@@ -5181,9 +5190,9 @@ diff -urNp linux-3.0.4/arch/x86/boot/compressed/head_32.S linux-3.0.4/arch/x86/b
        addl    %ebx, -__PAGE_OFFSET(%ebx, %ecx)
        jmp     1b
  2:
-diff -urNp linux-3.0.4/arch/x86/boot/compressed/head_64.S linux-3.0.4/arch/x86/boot/compressed/head_64.S
---- linux-3.0.4/arch/x86/boot/compressed/head_64.S     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/boot/compressed/head_64.S     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/boot/compressed/head_64.S linux-3.1.3/arch/x86/boot/compressed/head_64.S
+--- linux-3.1.3/arch/x86/boot/compressed/head_64.S     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/boot/compressed/head_64.S     2011-11-16 18:39:07.000000000 -0500
 @@ -91,7 +91,7 @@ ENTRY(startup_32)
        notl    %eax
        andl    %eax, %ebx
@@ -5202,9 +5211,9 @@ diff -urNp linux-3.0.4/arch/x86/boot/compressed/head_64.S linux-3.0.4/arch/x86/b
  #endif
  
        /* Target address to relocate to for decompression */
-diff -urNp linux-3.0.4/arch/x86/boot/compressed/Makefile linux-3.0.4/arch/x86/boot/compressed/Makefile
---- linux-3.0.4/arch/x86/boot/compressed/Makefile      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/boot/compressed/Makefile      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/boot/compressed/Makefile linux-3.1.3/arch/x86/boot/compressed/Makefile
+--- linux-3.1.3/arch/x86/boot/compressed/Makefile      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/boot/compressed/Makefile      2011-11-16 18:39:07.000000000 -0500
 @@ -14,6 +14,9 @@ cflags-$(CONFIG_X86_64) := -mcmodel=smal
  KBUILD_CFLAGS += $(cflags-y)
  KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
@@ -5215,9 +5224,9 @@ diff -urNp linux-3.0.4/arch/x86/boot/compressed/Makefile linux-3.0.4/arch/x86/bo
  
  KBUILD_AFLAGS  := $(KBUILD_CFLAGS) -D__ASSEMBLY__
  GCOV_PROFILE := n
-diff -urNp linux-3.0.4/arch/x86/boot/compressed/misc.c linux-3.0.4/arch/x86/boot/compressed/misc.c
---- linux-3.0.4/arch/x86/boot/compressed/misc.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/boot/compressed/misc.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/boot/compressed/misc.c linux-3.1.3/arch/x86/boot/compressed/misc.c
+--- linux-3.1.3/arch/x86/boot/compressed/misc.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/boot/compressed/misc.c        2011-11-16 18:39:07.000000000 -0500
 @@ -310,7 +310,7 @@ static void parse_elf(void *output)
                case PT_LOAD:
  #ifdef CONFIG_RELOCATABLE
@@ -5236,9 +5245,9 @@ diff -urNp linux-3.0.4/arch/x86/boot/compressed/misc.c linux-3.0.4/arch/x86/boot
                error("Wrong destination address");
  #endif
  
-diff -urNp linux-3.0.4/arch/x86/boot/compressed/relocs.c linux-3.0.4/arch/x86/boot/compressed/relocs.c
---- linux-3.0.4/arch/x86/boot/compressed/relocs.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/boot/compressed/relocs.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/boot/compressed/relocs.c linux-3.1.3/arch/x86/boot/compressed/relocs.c
+--- linux-3.1.3/arch/x86/boot/compressed/relocs.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/boot/compressed/relocs.c      2011-11-16 18:39:07.000000000 -0500
 @@ -13,8 +13,11 @@
  
  static void die(char *fmt, ...);
@@ -5431,9 +5440,9 @@ diff -urNp linux-3.0.4/arch/x86/boot/compressed/relocs.c linux-3.0.4/arch/x86/bo
        read_shdrs(fp);
        read_strtabs(fp);
        read_symtabs(fp);
-diff -urNp linux-3.0.4/arch/x86/boot/cpucheck.c linux-3.0.4/arch/x86/boot/cpucheck.c
---- linux-3.0.4/arch/x86/boot/cpucheck.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/boot/cpucheck.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/boot/cpucheck.c linux-3.1.3/arch/x86/boot/cpucheck.c
+--- linux-3.1.3/arch/x86/boot/cpucheck.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/boot/cpucheck.c       2011-11-16 18:39:07.000000000 -0500
 @@ -74,7 +74,7 @@ static int has_fpu(void)
        u16 fcw = -1, fsw = -1;
        u32 cr0;
@@ -5529,9 +5538,9 @@ diff -urNp linux-3.0.4/arch/x86/boot/cpucheck.c linux-3.0.4/arch/x86/boot/cpuche
  
                err = check_flags();
        }
-diff -urNp linux-3.0.4/arch/x86/boot/header.S linux-3.0.4/arch/x86/boot/header.S
---- linux-3.0.4/arch/x86/boot/header.S 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/boot/header.S 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/boot/header.S linux-3.1.3/arch/x86/boot/header.S
+--- linux-3.1.3/arch/x86/boot/header.S 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/boot/header.S 2011-11-16 18:39:07.000000000 -0500
 @@ -224,7 +224,7 @@ setup_data:                .quad 0                 # 64-bit physical
                                                # single linked list of
                                                # struct setup_data
@@ -5541,10 +5550,10 @@ diff -urNp linux-3.0.4/arch/x86/boot/header.S linux-3.0.4/arch/x86/boot/header.S
  
  #define ZO_INIT_SIZE  (ZO__end - ZO_startup_32 + ZO_z_extract_offset)
  #define VO_INIT_SIZE  (VO__end - VO__text)
-diff -urNp linux-3.0.4/arch/x86/boot/Makefile linux-3.0.4/arch/x86/boot/Makefile
---- linux-3.0.4/arch/x86/boot/Makefile 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/boot/Makefile 2011-08-23 21:47:55.000000000 -0400
-@@ -69,6 +69,9 @@ KBUILD_CFLAGS        := $(LINUXINCLUDE) -g -Os 
+diff -urNp linux-3.1.3/arch/x86/boot/Makefile linux-3.1.3/arch/x86/boot/Makefile
+--- linux-3.1.3/arch/x86/boot/Makefile 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/boot/Makefile 2011-11-16 18:39:07.000000000 -0500
+@@ -63,6 +63,9 @@ KBUILD_CFLAGS        := $(LINUXINCLUDE) -g -Os 
                   $(call cc-option, -fno-stack-protector) \
                   $(call cc-option, -mpreferred-stack-boundary=2)
  KBUILD_CFLAGS += $(call cc-option, -m32)
@@ -5554,9 +5563,9 @@ diff -urNp linux-3.0.4/arch/x86/boot/Makefile linux-3.0.4/arch/x86/boot/Makefile
  KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
  GCOV_PROFILE := n
  
-diff -urNp linux-3.0.4/arch/x86/boot/memory.c linux-3.0.4/arch/x86/boot/memory.c
---- linux-3.0.4/arch/x86/boot/memory.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/boot/memory.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/boot/memory.c linux-3.1.3/arch/x86/boot/memory.c
+--- linux-3.1.3/arch/x86/boot/memory.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/boot/memory.c 2011-11-16 18:39:07.000000000 -0500
 @@ -19,7 +19,7 @@
  
  static int detect_memory_e820(void)
@@ -5566,9 +5575,9 @@ diff -urNp linux-3.0.4/arch/x86/boot/memory.c linux-3.0.4/arch/x86/boot/memory.c
        struct biosregs ireg, oreg;
        struct e820entry *desc = boot_params.e820_map;
        static struct e820entry buf; /* static so it is zeroed */
-diff -urNp linux-3.0.4/arch/x86/boot/video.c linux-3.0.4/arch/x86/boot/video.c
---- linux-3.0.4/arch/x86/boot/video.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/boot/video.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/boot/video.c linux-3.1.3/arch/x86/boot/video.c
+--- linux-3.1.3/arch/x86/boot/video.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/boot/video.c  2011-11-16 18:39:07.000000000 -0500
 @@ -96,7 +96,7 @@ static void store_mode_params(void)
  static unsigned int get_entry(void)
  {
@@ -5578,9 +5587,9 @@ diff -urNp linux-3.0.4/arch/x86/boot/video.c linux-3.0.4/arch/x86/boot/video.c
        int key;
        unsigned int v;
  
-diff -urNp linux-3.0.4/arch/x86/boot/video-vesa.c linux-3.0.4/arch/x86/boot/video-vesa.c
---- linux-3.0.4/arch/x86/boot/video-vesa.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/boot/video-vesa.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/boot/video-vesa.c linux-3.1.3/arch/x86/boot/video-vesa.c
+--- linux-3.1.3/arch/x86/boot/video-vesa.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/boot/video-vesa.c     2011-11-16 18:39:07.000000000 -0500
 @@ -200,6 +200,7 @@ static void vesa_store_pm_info(void)
  
        boot_params.screen_info.vesapm_seg = oreg.es;
@@ -5589,77 +5598,86 @@ diff -urNp linux-3.0.4/arch/x86/boot/video-vesa.c linux-3.0.4/arch/x86/boot/vide
  }
  
  /*
-diff -urNp linux-3.0.4/arch/x86/crypto/aes-x86_64-asm_64.S linux-3.0.4/arch/x86/crypto/aes-x86_64-asm_64.S
---- linux-3.0.4/arch/x86/crypto/aes-x86_64-asm_64.S    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/crypto/aes-x86_64-asm_64.S    2011-09-17 18:31:51.000000000 -0400
-@@ -71,6 +71,12 @@ FUNC:       movq    r1,r2;                  \
+diff -urNp linux-3.1.3/arch/x86/crypto/aes-x86_64-asm_64.S linux-3.1.3/arch/x86/crypto/aes-x86_64-asm_64.S
+--- linux-3.1.3/arch/x86/crypto/aes-x86_64-asm_64.S    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/crypto/aes-x86_64-asm_64.S    2011-11-16 18:39:07.000000000 -0500
+@@ -8,6 +8,8 @@
+  * including this sentence is retained in full.
+  */
++#include <asm/alternative-asm.h>
++
+ .extern crypto_ft_tab
+ .extern crypto_it_tab
+ .extern crypto_fl_tab
+@@ -71,6 +73,8 @@ FUNC:        movq    r1,r2;                  \
        je      B192;                   \
        leaq    32(r9),r9;
  
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+#define ret   orb $0x80, 0x7(%rsp); ret
-+#else
-+#define ret   ret
-+#endif
++#define ret   pax_force_retaddr; ret
 +
  #define epilogue(r1,r2,r3,r4,r5,r6,r7,r8,r9) \
        movq    r1,r2;                  \
        movq    r3,r4;                  \
-diff -urNp linux-3.0.4/arch/x86/crypto/salsa20-x86_64-asm_64.S linux-3.0.4/arch/x86/crypto/salsa20-x86_64-asm_64.S
---- linux-3.0.4/arch/x86/crypto/salsa20-x86_64-asm_64.S        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/crypto/salsa20-x86_64-asm_64.S        2011-09-17 18:31:51.000000000 -0400
-@@ -790,6 +790,9 @@ ECRYPT_encrypt_bytes:
+diff -urNp linux-3.1.3/arch/x86/crypto/salsa20-x86_64-asm_64.S linux-3.1.3/arch/x86/crypto/salsa20-x86_64-asm_64.S
+--- linux-3.1.3/arch/x86/crypto/salsa20-x86_64-asm_64.S        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/crypto/salsa20-x86_64-asm_64.S        2011-11-16 18:39:07.000000000 -0500
+@@ -1,3 +1,5 @@
++#include <asm/alternative-asm.h>
++
+ # enter ECRYPT_encrypt_bytes
+ .text
+ .p2align 5
+@@ -790,6 +792,7 @@ ECRYPT_encrypt_bytes:
        add     %r11,%rsp
        mov     %rdi,%rax
        mov     %rsi,%rdx
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  #   bytesatleast65:
  ._bytesatleast65:
-@@ -891,6 +894,9 @@ ECRYPT_keysetup:
+@@ -891,6 +894,7 @@ ECRYPT_keysetup:
        add     %r11,%rsp
        mov     %rdi,%rax
        mov     %rsi,%rdx
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  # enter ECRYPT_ivsetup
  .text
-@@ -917,4 +923,7 @@ ECRYPT_ivsetup:
+@@ -917,4 +921,5 @@ ECRYPT_ivsetup:
        add     %r11,%rsp
        mov     %rdi,%rax
        mov     %rsi,%rdx
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
-diff -urNp linux-3.0.4/arch/x86/crypto/twofish-x86_64-asm_64.S linux-3.0.4/arch/x86/crypto/twofish-x86_64-asm_64.S
---- linux-3.0.4/arch/x86/crypto/twofish-x86_64-asm_64.S        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/crypto/twofish-x86_64-asm_64.S        2011-09-17 18:31:51.000000000 -0400
-@@ -269,6 +269,9 @@ twofish_enc_blk:
+diff -urNp linux-3.1.3/arch/x86/crypto/twofish-x86_64-asm_64.S linux-3.1.3/arch/x86/crypto/twofish-x86_64-asm_64.S
+--- linux-3.1.3/arch/x86/crypto/twofish-x86_64-asm_64.S        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/crypto/twofish-x86_64-asm_64.S        2011-11-16 18:39:07.000000000 -0500
+@@ -21,6 +21,7 @@
+ .text
+ #include <asm/asm-offsets.h>
++#include <asm/alternative-asm.h>
+ #define a_offset      0
+ #define b_offset      4
+@@ -269,6 +270,7 @@ twofish_enc_blk:
  
        popq    R1
        movq    $1,%rax
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  
  twofish_dec_blk:
-@@ -321,4 +324,7 @@ twofish_dec_blk:
+@@ -321,4 +323,5 @@ twofish_dec_blk:
  
        popq    R1
        movq    $1,%rax
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
-diff -urNp linux-3.0.4/arch/x86/ia32/ia32_aout.c linux-3.0.4/arch/x86/ia32/ia32_aout.c
---- linux-3.0.4/arch/x86/ia32/ia32_aout.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/ia32/ia32_aout.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/ia32/ia32_aout.c linux-3.1.3/arch/x86/ia32/ia32_aout.c
+--- linux-3.1.3/arch/x86/ia32/ia32_aout.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/ia32/ia32_aout.c      2011-11-16 18:40:08.000000000 -0500
 @@ -162,6 +162,8 @@ static int aout_core_dump(long signr, st
        unsigned long dump_start, dump_size;
        struct user32 dump;
@@ -5669,18 +5687,20 @@ diff -urNp linux-3.0.4/arch/x86/ia32/ia32_aout.c linux-3.0.4/arch/x86/ia32/ia32_
        fs = get_fs();
        set_fs(KERNEL_DS);
        has_dumped = 1;
-diff -urNp linux-3.0.4/arch/x86/ia32/ia32entry.S linux-3.0.4/arch/x86/ia32/ia32entry.S
---- linux-3.0.4/arch/x86/ia32/ia32entry.S      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/ia32/ia32entry.S      2011-08-25 17:36:37.000000000 -0400
-@@ -13,6 +13,7 @@
+diff -urNp linux-3.1.3/arch/x86/ia32/ia32entry.S linux-3.1.3/arch/x86/ia32/ia32entry.S
+--- linux-3.1.3/arch/x86/ia32/ia32entry.S      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/ia32/ia32entry.S      2011-11-17 18:27:57.000000000 -0500
+@@ -13,7 +13,9 @@
  #include <asm/thread_info.h>  
  #include <asm/segment.h>
  #include <asm/irqflags.h>
 +#include <asm/pgtable.h>
  #include <linux/linkage.h>
++#include <asm/alternative-asm.h>
  
  /* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this.  */
-@@ -95,6 +96,29 @@ ENTRY(native_irq_enable_sysexit)
+ #include <linux/elf-em.h>
+@@ -95,6 +97,29 @@ ENTRY(native_irq_enable_sysexit)
  ENDPROC(native_irq_enable_sysexit)
  #endif
  
@@ -5701,16 +5721,16 @@ diff -urNp linux-3.0.4/arch/x86/ia32/ia32entry.S linux-3.0.4/arch/x86/ia32/ia32e
 +#endif
 +      .endm
 +
-+      .macro pax_erase_kstack
++.macro pax_erase_kstack
 +#ifdef CONFIG_PAX_MEMORY_STACKLEAK
 +      call pax_erase_kstack
 +#endif
-+      .endm
++.endm
 +
  /*
   * 32bit SYSENTER instruction entry.
   *
-@@ -121,7 +145,7 @@ ENTRY(ia32_sysenter_target)
+@@ -121,7 +146,7 @@ ENTRY(ia32_sysenter_target)
        CFI_REGISTER    rsp,rbp
        SWAPGS_UNSAFE_STACK
        movq    PER_CPU_VAR(kernel_stack), %rsp
@@ -5719,7 +5739,7 @@ diff -urNp linux-3.0.4/arch/x86/ia32/ia32entry.S linux-3.0.4/arch/x86/ia32/ia32e
        /*
         * No need to follow this irqs on/off section: the syscall
         * disabled irqs, here we enable it straight after entry:
-@@ -134,7 +158,8 @@ ENTRY(ia32_sysenter_target)
+@@ -134,7 +159,8 @@ ENTRY(ia32_sysenter_target)
        CFI_REL_OFFSET rsp,0
        pushfq_cfi
        /*CFI_REL_OFFSET rflags,0*/
@@ -5729,8 +5749,8 @@ diff -urNp linux-3.0.4/arch/x86/ia32/ia32entry.S linux-3.0.4/arch/x86/ia32/ia32e
        CFI_REGISTER rip,r10
        pushq_cfi $__USER32_CS
        /*CFI_REL_OFFSET cs,0*/
-@@ -146,6 +171,12 @@ ENTRY(ia32_sysenter_target)
-       SAVE_ARGS 0,0,1
+@@ -146,6 +172,12 @@ ENTRY(ia32_sysenter_target)
+       SAVE_ARGS 0,1,0
        /* no need to do an access_ok check here because rbp has been
           32bit zero extended */ 
 +
@@ -5742,7 +5762,7 @@ diff -urNp linux-3.0.4/arch/x86/ia32/ia32entry.S linux-3.0.4/arch/x86/ia32/ia32e
  1:    movl    (%rbp),%ebp
        .section __ex_table,"a"
        .quad 1b,ia32_badarg
-@@ -168,6 +199,8 @@ sysenter_dispatch:
+@@ -168,6 +200,8 @@ sysenter_dispatch:
        testl   $_TIF_ALLWORK_MASK,TI_flags(%r10)
        jnz     sysexit_audit
  sysexit_from_sys_call:
@@ -5751,7 +5771,7 @@ diff -urNp linux-3.0.4/arch/x86/ia32/ia32entry.S linux-3.0.4/arch/x86/ia32/ia32e
        andl    $~TS_COMPAT,TI_status(%r10)
        /* clear IF, that popfq doesn't enable interrupts early */
        andl  $~0x200,EFLAGS-R11(%rsp) 
-@@ -194,6 +227,9 @@ sysexit_from_sys_call:
+@@ -194,6 +228,9 @@ sysexit_from_sys_call:
        movl %eax,%esi                  /* 2nd arg: syscall number */
        movl $AUDIT_ARCH_I386,%edi      /* 1st arg: audit arch */
        call audit_syscall_entry
@@ -5761,7 +5781,7 @@ diff -urNp linux-3.0.4/arch/x86/ia32/ia32entry.S linux-3.0.4/arch/x86/ia32/ia32e
        movl RAX-ARGOFFSET(%rsp),%eax   /* reload syscall number */
        cmpq $(IA32_NR_syscalls-1),%rax
        ja ia32_badsys
-@@ -246,6 +282,9 @@ sysenter_tracesys:
+@@ -246,6 +283,9 @@ sysenter_tracesys:
        movq    $-ENOSYS,RAX(%rsp)/* ptrace can change this for a bad syscall */
        movq    %rsp,%rdi        /* &pt_regs -> arg1 */
        call    syscall_trace_enter
@@ -5771,7 +5791,7 @@ diff -urNp linux-3.0.4/arch/x86/ia32/ia32entry.S linux-3.0.4/arch/x86/ia32/ia32e
        LOAD_ARGS32 ARGOFFSET  /* reload args from stack in case ptrace changed it */
        RESTORE_REST
        cmpq    $(IA32_NR_syscalls-1),%rax
-@@ -277,19 +316,24 @@ ENDPROC(ia32_sysenter_target)
+@@ -277,19 +317,24 @@ ENDPROC(ia32_sysenter_target)
  ENTRY(ia32_cstar_target)
        CFI_STARTPROC32 simple
        CFI_SIGNAL_FRAME
@@ -5793,12 +5813,12 @@ diff -urNp linux-3.0.4/arch/x86/ia32/ia32entry.S linux-3.0.4/arch/x86/ia32/ia32e
         * disabled irqs and here we enable it straight after entry:
         */
        ENABLE_INTERRUPTS(CLBR_NONE)
--      SAVE_ARGS 8,1,1
-+      SAVE_ARGS 8*6,1,1
+-      SAVE_ARGS 8,0,0
++      SAVE_ARGS 8*6,0,0
        movl    %eax,%eax       /* zero extension */
        movq    %rax,ORIG_RAX-ARGOFFSET(%rsp)
        movq    %rcx,RIP-ARGOFFSET(%rsp)
-@@ -305,6 +349,12 @@ ENTRY(ia32_cstar_target)
+@@ -305,6 +350,12 @@ ENTRY(ia32_cstar_target)
        /* no need to do an access_ok check here because r8 has been
           32bit zero extended */ 
        /* hardware stack frame is complete now */      
@@ -5811,16 +5831,16 @@ diff -urNp linux-3.0.4/arch/x86/ia32/ia32entry.S linux-3.0.4/arch/x86/ia32/ia32e
  1:    movl    (%r8),%r9d
        .section __ex_table,"a"
        .quad 1b,ia32_badarg
-@@ -327,6 +377,8 @@ cstar_dispatch:
+@@ -327,6 +378,8 @@ cstar_dispatch:
        testl $_TIF_ALLWORK_MASK,TI_flags(%r10)
        jnz sysretl_audit
  sysretl_from_sys_call:
 +      pax_exit_kernel_user
 +      pax_erase_kstack
        andl $~TS_COMPAT,TI_status(%r10)
-       RESTORE_ARGS 1,-ARG_SKIP,1,1,1
+       RESTORE_ARGS 0,-ARG_SKIP,0,0,0
        movl RIP-ARGOFFSET(%rsp),%ecx
-@@ -364,6 +416,9 @@ cstar_tracesys:
+@@ -364,6 +417,9 @@ cstar_tracesys:
        movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
        movq %rsp,%rdi        /* &pt_regs -> arg1 */
        call syscall_trace_enter
@@ -5830,7 +5850,7 @@ diff -urNp linux-3.0.4/arch/x86/ia32/ia32entry.S linux-3.0.4/arch/x86/ia32/ia32e
        LOAD_ARGS32 ARGOFFSET, 1  /* reload args from stack in case ptrace changed it */
        RESTORE_REST
        xchgl %ebp,%r9d
-@@ -409,6 +464,7 @@ ENTRY(ia32_syscall)
+@@ -409,6 +465,7 @@ ENTRY(ia32_syscall)
        CFI_REL_OFFSET  rip,RIP-RIP
        PARAVIRT_ADJUST_EXCEPTION_FRAME
        SWAPGS
@@ -5838,7 +5858,7 @@ diff -urNp linux-3.0.4/arch/x86/ia32/ia32entry.S linux-3.0.4/arch/x86/ia32/ia32e
        /*
         * No need to follow this irqs on/off section: the syscall
         * disabled irqs and here we enable it straight after entry:
-@@ -441,6 +497,9 @@ ia32_tracesys:                      
+@@ -441,6 +498,9 @@ ia32_tracesys:                      
        movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
        movq %rsp,%rdi        /* &pt_regs -> arg1 */
        call syscall_trace_enter
@@ -5848,10 +5868,45 @@ diff -urNp linux-3.0.4/arch/x86/ia32/ia32entry.S linux-3.0.4/arch/x86/ia32/ia32e
        LOAD_ARGS32 ARGOFFSET  /* reload args from stack in case ptrace changed it */
        RESTORE_REST
        cmpq $(IA32_NR_syscalls-1),%rax
-diff -urNp linux-3.0.4/arch/x86/ia32/ia32_signal.c linux-3.0.4/arch/x86/ia32/ia32_signal.c
---- linux-3.0.4/arch/x86/ia32/ia32_signal.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/ia32/ia32_signal.c    2011-08-23 21:47:55.000000000 -0400
-@@ -403,7 +403,7 @@ static void __user *get_sigframe(struct 
+@@ -455,6 +515,7 @@ ia32_badsys:
+ quiet_ni_syscall:
+       movq $-ENOSYS,%rax
++      pax_force_retaddr
+       ret
+       CFI_ENDPROC
+       
+diff -urNp linux-3.1.3/arch/x86/ia32/ia32_signal.c linux-3.1.3/arch/x86/ia32/ia32_signal.c
+--- linux-3.1.3/arch/x86/ia32/ia32_signal.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/ia32/ia32_signal.c    2011-11-16 18:39:07.000000000 -0500
+@@ -169,7 +169,7 @@ asmlinkage long sys32_sigaltstack(const 
+       }
+       seg = get_fs();
+       set_fs(KERNEL_DS);
+-      ret = do_sigaltstack(uss_ptr ? &uss : NULL, &uoss, regs->sp);
++      ret = do_sigaltstack(uss_ptr ? (const stack_t __force_user *)&uss : NULL, (stack_t __force_user *)&uoss, regs->sp);
+       set_fs(seg);
+       if (ret >= 0 && uoss_ptr)  {
+               if (!access_ok(VERIFY_WRITE, uoss_ptr, sizeof(stack_ia32_t)))
+@@ -370,7 +370,7 @@ static int ia32_setup_sigcontext(struct 
+  */
+ static void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
+                                size_t frame_size,
+-                               void **fpstate)
++                               void __user **fpstate)
+ {
+       unsigned long sp;
+@@ -391,7 +391,7 @@ static void __user *get_sigframe(struct 
+       if (used_math()) {
+               sp = sp - sig_xstate_ia32_size;
+-              *fpstate = (struct _fpstate_ia32 *) sp;
++              *fpstate = (struct _fpstate_ia32 __user *) sp;
+               if (save_i387_xstate_ia32(*fpstate) < 0)
+                       return (void __user *) -1L;
+       }
+@@ -399,7 +399,7 @@ static void __user *get_sigframe(struct 
        sp -= frame_size;
        /* Align the stack pointer according to the i386 ABI,
         * i.e. so that on function entry ((sp + 4) & 15) == 0. */
@@ -5860,16 +5915,16 @@ diff -urNp linux-3.0.4/arch/x86/ia32/ia32_signal.c linux-3.0.4/arch/x86/ia32/ia3
        return (void __user *) sp;
  }
  
-@@ -461,7 +461,7 @@ int ia32_setup_frame(int sig, struct k_s
+@@ -457,7 +457,7 @@ int ia32_setup_frame(int sig, struct k_s
                 * These are actually not used anymore, but left because some
                 * gdb versions depend on them as a marker.
                 */
 -              put_user_ex(*((u64 *)&code), (u64 *)frame->retcode);
-+              put_user_ex(*((const u64 *)&code), (u64 *)frame->retcode);
++              put_user_ex(*((const u64 *)&code), (u64 __user *)frame->retcode);
        } put_user_catch(err);
  
        if (err)
-@@ -503,7 +503,7 @@ int ia32_setup_rt_frame(int sig, struct 
+@@ -499,7 +499,7 @@ int ia32_setup_rt_frame(int sig, struct 
                0xb8,
                __NR_ia32_rt_sigreturn,
                0x80cd,
@@ -5878,7 +5933,7 @@ diff -urNp linux-3.0.4/arch/x86/ia32/ia32_signal.c linux-3.0.4/arch/x86/ia32/ia3
        };
  
        frame = get_sigframe(ka, regs, sizeof(*frame), &fpstate);
-@@ -533,16 +533,18 @@ int ia32_setup_rt_frame(int sig, struct 
+@@ -529,16 +529,18 @@ int ia32_setup_rt_frame(int sig, struct 
  
                if (ka->sa.sa_flags & SA_RESTORER)
                        restorer = ka->sa.sa_restorer;
@@ -5896,14 +5951,108 @@ diff -urNp linux-3.0.4/arch/x86/ia32/ia32_signal.c linux-3.0.4/arch/x86/ia32/ia3
                 * versions need it.
                 */
 -              put_user_ex(*((u64 *)&code), (u64 *)frame->retcode);
-+              put_user_ex(*((const u64 *)&code), (u64 *)frame->retcode);
++              put_user_ex(*((const u64 *)&code), (u64 __user *)frame->retcode);
        } put_user_catch(err);
  
        if (err)
-diff -urNp linux-3.0.4/arch/x86/include/asm/alternative.h linux-3.0.4/arch/x86/include/asm/alternative.h
---- linux-3.0.4/arch/x86/include/asm/alternative.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/alternative.h     2011-08-23 21:47:55.000000000 -0400
-@@ -93,7 +93,7 @@ static inline int alternatives_text_rese
+diff -urNp linux-3.1.3/arch/x86/ia32/sys_ia32.c linux-3.1.3/arch/x86/ia32/sys_ia32.c
+--- linux-3.1.3/arch/x86/ia32/sys_ia32.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/ia32/sys_ia32.c       2011-11-16 18:39:07.000000000 -0500
+@@ -69,8 +69,8 @@ asmlinkage long sys32_ftruncate64(unsign
+  */
+ static int cp_stat64(struct stat64 __user *ubuf, struct kstat *stat)
+ {
+-      typeof(ubuf->st_uid) uid = 0;
+-      typeof(ubuf->st_gid) gid = 0;
++      typeof(((struct stat64 *)0)->st_uid) uid = 0;
++      typeof(((struct stat64 *)0)->st_gid) gid = 0;
+       SET_UID(uid, stat->uid);
+       SET_GID(gid, stat->gid);
+       if (!access_ok(VERIFY_WRITE, ubuf, sizeof(struct stat64)) ||
+@@ -308,8 +308,8 @@ asmlinkage long sys32_rt_sigprocmask(int
+       }
+       set_fs(KERNEL_DS);
+       ret = sys_rt_sigprocmask(how,
+-                               set ? (sigset_t __user *)&s : NULL,
+-                               oset ? (sigset_t __user *)&s : NULL,
++                               set ? (sigset_t __force_user *)&s : NULL,
++                               oset ? (sigset_t __force_user *)&s : NULL,
+                                sigsetsize);
+       set_fs(old_fs);
+       if (ret)
+@@ -332,7 +332,7 @@ asmlinkage long sys32_alarm(unsigned int
+       return alarm_setitimer(seconds);
+ }
+-asmlinkage long sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr,
++asmlinkage long sys32_waitpid(compat_pid_t pid, unsigned int __user *stat_addr,
+                             int options)
+ {
+       return compat_sys_wait4(pid, stat_addr, options, NULL);
+@@ -353,7 +353,7 @@ asmlinkage long sys32_sched_rr_get_inter
+       mm_segment_t old_fs = get_fs();
+       set_fs(KERNEL_DS);
+-      ret = sys_sched_rr_get_interval(pid, (struct timespec __user *)&t);
++      ret = sys_sched_rr_get_interval(pid, (struct timespec __force_user *)&t);
+       set_fs(old_fs);
+       if (put_compat_timespec(&t, interval))
+               return -EFAULT;
+@@ -369,7 +369,7 @@ asmlinkage long sys32_rt_sigpending(comp
+       mm_segment_t old_fs = get_fs();
+       set_fs(KERNEL_DS);
+-      ret = sys_rt_sigpending((sigset_t __user *)&s, sigsetsize);
++      ret = sys_rt_sigpending((sigset_t __force_user *)&s, sigsetsize);
+       set_fs(old_fs);
+       if (!ret) {
+               switch (_NSIG_WORDS) {
+@@ -394,7 +394,7 @@ asmlinkage long sys32_rt_sigqueueinfo(in
+       if (copy_siginfo_from_user32(&info, uinfo))
+               return -EFAULT;
+       set_fs(KERNEL_DS);
+-      ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *)&info);
++      ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __force_user *)&info);
+       set_fs(old_fs);
+       return ret;
+ }
+@@ -439,7 +439,7 @@ asmlinkage long sys32_sendfile(int out_f
+               return -EFAULT;
+       set_fs(KERNEL_DS);
+-      ret = sys_sendfile(out_fd, in_fd, offset ? (off_t __user *)&of : NULL,
++      ret = sys_sendfile(out_fd, in_fd, offset ? (off_t __force_user *)&of : NULL,
+                          count);
+       set_fs(old_fs);
+diff -urNp linux-3.1.3/arch/x86/include/asm/alternative-asm.h linux-3.1.3/arch/x86/include/asm/alternative-asm.h
+--- linux-3.1.3/arch/x86/include/asm/alternative-asm.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/alternative-asm.h 2011-11-16 18:39:07.000000000 -0500
+@@ -15,6 +15,20 @@
+       .endm
+ #endif
++#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
++      .macro pax_force_retaddr rip=0
++      btsq $63,\rip(%rsp)
++      .endm
++      .macro pax_force_fptr ptr
++      btsq $63,\ptr
++      .endm
++#else
++      .macro pax_force_retaddr rip=0
++      .endm
++      .macro pax_force_fptr ptr
++      .endm
++#endif
++
+ .macro altinstruction_entry orig alt feature orig_len alt_len
+       .long \orig - .
+       .long \alt - .
+diff -urNp linux-3.1.3/arch/x86/include/asm/alternative.h linux-3.1.3/arch/x86/include/asm/alternative.h
+--- linux-3.1.3/arch/x86/include/asm/alternative.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/alternative.h     2011-11-16 18:39:07.000000000 -0500
+@@ -89,7 +89,7 @@ static inline int alternatives_text_rese
        ".section .discard,\"aw\",@progbits\n"                          \
        "        .byte 0xff + (664f-663f) - (662b-661b)\n" /* rlen <= slen */   \
        ".previous\n"                                                   \
@@ -5912,9 +6061,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/alternative.h linux-3.0.4/arch/x86/i
        "663:\n\t" newinstr "\n664:\n"          /* replacement     */   \
        ".previous"
  
-diff -urNp linux-3.0.4/arch/x86/include/asm/apic.h linux-3.0.4/arch/x86/include/asm/apic.h
---- linux-3.0.4/arch/x86/include/asm/apic.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/apic.h    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/apic.h linux-3.1.3/arch/x86/include/asm/apic.h
+--- linux-3.1.3/arch/x86/include/asm/apic.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/apic.h    2011-11-16 18:39:07.000000000 -0500
 @@ -45,7 +45,7 @@ static inline void generic_apic_probe(vo
  
  #ifdef CONFIG_X86_LOCAL_APIC
@@ -5924,9 +6073,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/apic.h linux-3.0.4/arch/x86/include/
  extern int local_apic_timer_c2_ok;
  
  extern int disable_apic;
-diff -urNp linux-3.0.4/arch/x86/include/asm/apm.h linux-3.0.4/arch/x86/include/asm/apm.h
---- linux-3.0.4/arch/x86/include/asm/apm.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/apm.h     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/apm.h linux-3.1.3/arch/x86/include/asm/apm.h
+--- linux-3.1.3/arch/x86/include/asm/apm.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/apm.h     2011-11-16 18:39:07.000000000 -0500
 @@ -34,7 +34,7 @@ static inline void apm_bios_call_asm(u32
        __asm__ __volatile__(APM_DO_ZERO_SEGS
                "pushl %%edi\n\t"
@@ -5945,9 +6094,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/apm.h linux-3.0.4/arch/x86/include/a
                "setc %%bl\n\t"
                "popl %%ebp\n\t"
                "popl %%edi\n\t"
-diff -urNp linux-3.0.4/arch/x86/include/asm/atomic64_32.h linux-3.0.4/arch/x86/include/asm/atomic64_32.h
---- linux-3.0.4/arch/x86/include/asm/atomic64_32.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/atomic64_32.h     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/atomic64_32.h linux-3.1.3/arch/x86/include/asm/atomic64_32.h
+--- linux-3.1.3/arch/x86/include/asm/atomic64_32.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/atomic64_32.h     2011-11-16 18:39:07.000000000 -0500
 @@ -12,6 +12,14 @@ typedef struct {
        u64 __aligned(8) counter;
  } atomic64_t;
@@ -6097,9 +6246,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/atomic64_32.h linux-3.0.4/arch/x86/i
   * atomic64_sub - subtract the atomic64 variable
   * @i: integer value to subtract
   * @v: pointer to type atomic64_t
-diff -urNp linux-3.0.4/arch/x86/include/asm/atomic64_64.h linux-3.0.4/arch/x86/include/asm/atomic64_64.h
---- linux-3.0.4/arch/x86/include/asm/atomic64_64.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/atomic64_64.h     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/atomic64_64.h linux-3.1.3/arch/x86/include/asm/atomic64_64.h
+--- linux-3.1.3/arch/x86/include/asm/atomic64_64.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/atomic64_64.h     2011-11-16 18:39:07.000000000 -0500
 @@ -18,7 +18,19 @@
   */
  static inline long atomic64_read(const atomic64_t *v)
@@ -6421,9 +6570,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/atomic64_64.h linux-3.0.4/arch/x86/i
  }
  
  #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
-diff -urNp linux-3.0.4/arch/x86/include/asm/atomic.h linux-3.0.4/arch/x86/include/asm/atomic.h
---- linux-3.0.4/arch/x86/include/asm/atomic.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/atomic.h  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/atomic.h linux-3.1.3/arch/x86/include/asm/atomic.h
+--- linux-3.1.3/arch/x86/include/asm/atomic.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/atomic.h  2011-11-16 18:39:07.000000000 -0500
 @@ -22,7 +22,18 @@
   */
  static inline int atomic_read(const atomic_t *v)
@@ -6752,11 +6901,11 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/atomic.h linux-3.0.4/arch/x86/includ
 +}
 +
  /**
-  * atomic_add_unless - add unless the number is already a given value
+  * __atomic_add_unless - add unless the number is already a given value
   * @v: pointer of type atomic_t
-@@ -231,21 +447,77 @@ static inline int atomic_xchg(atomic_t *
+@@ -231,12 +447,25 @@ static inline int atomic_xchg(atomic_t *
   */
- static inline int atomic_add_unless(atomic_t *v, int a, int u)
+ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
  {
 -      int c, old;
 +      int c, old, new;
@@ -6783,13 +6932,10 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/atomic.h linux-3.0.4/arch/x86/includ
                if (likely(old == c))
                        break;
                c = old;
-       }
--      return c != (u);
-+      return c != u;
+@@ -244,6 +473,48 @@ static inline int __atomic_add_unless(at
+       return c;
  }
  
- #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
 +/**
 + * atomic_inc_not_zero_hint - increment if not null
 + * @v: pointer of type atomic_t
@@ -6809,7 +6955,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/atomic.h linux-3.0.4/arch/x86/includ
 +
 +      /* sanity test, should be removed by compiler if hint is a constant */
 +      if (!hint)
-+              return atomic_inc_not_zero(v);
++              return __atomic_add_unless(v, 1, 0);
 +
 +      do {
 +              asm volatile("incl %0\n"
@@ -6832,13 +6978,12 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/atomic.h linux-3.0.4/arch/x86/includ
 +
 +      return 0;
 +}
-+
  /*
   * atomic_dec_if_positive - decrement by 1 if old value positive
-  * @v: pointer of type atomic_t
-diff -urNp linux-3.0.4/arch/x86/include/asm/bitops.h linux-3.0.4/arch/x86/include/asm/bitops.h
---- linux-3.0.4/arch/x86/include/asm/bitops.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/bitops.h  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/bitops.h linux-3.1.3/arch/x86/include/asm/bitops.h
+--- linux-3.1.3/arch/x86/include/asm/bitops.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/bitops.h  2011-11-16 18:39:07.000000000 -0500
 @@ -38,7 +38,7 @@
   * a mask operation on a byte.
   */
@@ -6848,9 +6993,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/bitops.h linux-3.0.4/arch/x86/includ
  #define CONST_MASK(nr)                        (1 << ((nr) & 7))
  
  /**
-diff -urNp linux-3.0.4/arch/x86/include/asm/boot.h linux-3.0.4/arch/x86/include/asm/boot.h
---- linux-3.0.4/arch/x86/include/asm/boot.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/boot.h    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/boot.h linux-3.1.3/arch/x86/include/asm/boot.h
+--- linux-3.1.3/arch/x86/include/asm/boot.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/boot.h    2011-11-16 18:39:07.000000000 -0500
 @@ -11,10 +11,15 @@
  #include <asm/pgtable_types.h>
  
@@ -6868,9 +7013,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/boot.h linux-3.0.4/arch/x86/include/
  /* Minimum kernel alignment, as a power of two */
  #ifdef CONFIG_X86_64
  #define MIN_KERNEL_ALIGN_LG2  PMD_SHIFT
-diff -urNp linux-3.0.4/arch/x86/include/asm/cacheflush.h linux-3.0.4/arch/x86/include/asm/cacheflush.h
---- linux-3.0.4/arch/x86/include/asm/cacheflush.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/cacheflush.h      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/cacheflush.h linux-3.1.3/arch/x86/include/asm/cacheflush.h
+--- linux-3.1.3/arch/x86/include/asm/cacheflush.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/cacheflush.h      2011-11-16 18:39:07.000000000 -0500
 @@ -26,7 +26,7 @@ static inline unsigned long get_page_mem
        unsigned long pg_flags = pg->flags & _PGMT_MASK;
  
@@ -6880,9 +7025,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/cacheflush.h linux-3.0.4/arch/x86/in
        else if (pg_flags == _PGMT_WC)
                return _PAGE_CACHE_WC;
        else if (pg_flags == _PGMT_UC_MINUS)
-diff -urNp linux-3.0.4/arch/x86/include/asm/cache.h linux-3.0.4/arch/x86/include/asm/cache.h
---- linux-3.0.4/arch/x86/include/asm/cache.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/cache.h   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/cache.h linux-3.1.3/arch/x86/include/asm/cache.h
+--- linux-3.1.3/arch/x86/include/asm/cache.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/cache.h   2011-11-16 18:39:07.000000000 -0500
 @@ -5,12 +5,13 @@
  
  /* L1 cache line size */
@@ -6899,9 +7044,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/cache.h linux-3.0.4/arch/x86/include
  
  #ifdef CONFIG_X86_VSMP
  #ifdef CONFIG_SMP
-diff -urNp linux-3.0.4/arch/x86/include/asm/checksum_32.h linux-3.0.4/arch/x86/include/asm/checksum_32.h
---- linux-3.0.4/arch/x86/include/asm/checksum_32.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/checksum_32.h     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/checksum_32.h linux-3.1.3/arch/x86/include/asm/checksum_32.h
+--- linux-3.1.3/arch/x86/include/asm/checksum_32.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/checksum_32.h     2011-11-16 18:39:07.000000000 -0500
 @@ -31,6 +31,14 @@ asmlinkage __wsum csum_partial_copy_gene
                                            int len, __wsum sum,
                                            int *src_err_ptr, int *dst_err_ptr);
@@ -6935,9 +7080,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/checksum_32.h linux-3.0.4/arch/x86/i
                                                 len, sum, NULL, err_ptr);
  
        if (len)
-diff -urNp linux-3.0.4/arch/x86/include/asm/cpufeature.h linux-3.0.4/arch/x86/include/asm/cpufeature.h
---- linux-3.0.4/arch/x86/include/asm/cpufeature.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/cpufeature.h      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/cpufeature.h linux-3.1.3/arch/x86/include/asm/cpufeature.h
+--- linux-3.1.3/arch/x86/include/asm/cpufeature.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/cpufeature.h      2011-11-16 18:39:07.000000000 -0500
 @@ -358,7 +358,7 @@ static __always_inline __pure bool __sta
                             ".section .discard,\"aw\",@progbits\n"
                             " .byte 0xff + (4f-3f) - (2b-1b)\n" /* size check */
@@ -6947,9 +7092,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/cpufeature.h linux-3.0.4/arch/x86/in
                             "3: movb $1,%0\n"
                             "4:\n"
                             ".previous\n"
-diff -urNp linux-3.0.4/arch/x86/include/asm/desc_defs.h linux-3.0.4/arch/x86/include/asm/desc_defs.h
---- linux-3.0.4/arch/x86/include/asm/desc_defs.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/desc_defs.h       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/desc_defs.h linux-3.1.3/arch/x86/include/asm/desc_defs.h
+--- linux-3.1.3/arch/x86/include/asm/desc_defs.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/desc_defs.h       2011-11-16 18:39:07.000000000 -0500
 @@ -31,6 +31,12 @@ struct desc_struct {
                        unsigned base1: 8, type: 4, s: 1, dpl: 2, p: 1;
                        unsigned limit: 4, avl: 1, l: 1, d: 1, g: 1, base2: 8;
@@ -6963,9 +7108,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/desc_defs.h linux-3.0.4/arch/x86/inc
        };
  } __attribute__((packed));
  
-diff -urNp linux-3.0.4/arch/x86/include/asm/desc.h linux-3.0.4/arch/x86/include/asm/desc.h
---- linux-3.0.4/arch/x86/include/asm/desc.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/desc.h    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/desc.h linux-3.1.3/arch/x86/include/asm/desc.h
+--- linux-3.1.3/arch/x86/include/asm/desc.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/desc.h    2011-11-16 18:39:07.000000000 -0500
 @@ -4,6 +4,7 @@
  #include <asm/desc_defs.h>
  #include <asm/ldt.h>
@@ -7144,9 +7289,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/desc.h linux-3.0.4/arch/x86/include/
 +#endif
 +
  #endif /* _ASM_X86_DESC_H */
-diff -urNp linux-3.0.4/arch/x86/include/asm/e820.h linux-3.0.4/arch/x86/include/asm/e820.h
---- linux-3.0.4/arch/x86/include/asm/e820.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/e820.h    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/e820.h linux-3.1.3/arch/x86/include/asm/e820.h
+--- linux-3.1.3/arch/x86/include/asm/e820.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/e820.h    2011-11-16 18:39:07.000000000 -0500
 @@ -69,7 +69,7 @@ struct e820map {
  #define ISA_START_ADDRESS     0xa0000
  #define ISA_END_ADDRESS               0x100000
@@ -7156,9 +7301,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/e820.h linux-3.0.4/arch/x86/include/
  #define BIOS_END              0x00100000
  
  #define BIOS_ROM_BASE         0xffe00000
-diff -urNp linux-3.0.4/arch/x86/include/asm/elf.h linux-3.0.4/arch/x86/include/asm/elf.h
---- linux-3.0.4/arch/x86/include/asm/elf.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/elf.h     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/elf.h linux-3.1.3/arch/x86/include/asm/elf.h
+--- linux-3.1.3/arch/x86/include/asm/elf.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/elf.h     2011-11-16 18:39:07.000000000 -0500
 @@ -237,7 +237,25 @@ extern int force_personality32;
     the loader.  We need to make sure that it is out of the way of the program
     that it will "exec", and that there is sufficient room for the brk.  */
@@ -7213,9 +7358,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/elf.h linux-3.0.4/arch/x86/include/a
 -#define arch_randomize_brk arch_randomize_brk
 -
  #endif /* _ASM_X86_ELF_H */
-diff -urNp linux-3.0.4/arch/x86/include/asm/emergency-restart.h linux-3.0.4/arch/x86/include/asm/emergency-restart.h
---- linux-3.0.4/arch/x86/include/asm/emergency-restart.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/emergency-restart.h       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/emergency-restart.h linux-3.1.3/arch/x86/include/asm/emergency-restart.h
+--- linux-3.1.3/arch/x86/include/asm/emergency-restart.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/emergency-restart.h       2011-11-16 18:39:07.000000000 -0500
 @@ -15,6 +15,6 @@ enum reboot_type {
  
  extern enum reboot_type reboot_type;
@@ -7224,14 +7369,14 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/emergency-restart.h linux-3.0.4/arch
 +extern void machine_emergency_restart(void) __noreturn;
  
  #endif /* _ASM_X86_EMERGENCY_RESTART_H */
-diff -urNp linux-3.0.4/arch/x86/include/asm/futex.h linux-3.0.4/arch/x86/include/asm/futex.h
---- linux-3.0.4/arch/x86/include/asm/futex.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/futex.h   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/futex.h linux-3.1.3/arch/x86/include/asm/futex.h
+--- linux-3.1.3/arch/x86/include/asm/futex.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/futex.h   2011-11-16 18:39:07.000000000 -0500
 @@ -12,16 +12,18 @@
  #include <asm/system.h>
  
  #define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg)   \
-+      typecheck(u32 *, uaddr);                                \
++      typecheck(u32 __user *, uaddr);                         \
        asm volatile("1:\t" insn "\n"                           \
                     "2:\t.section .fixup,\"ax\"\n"             \
                     "3:\tmov\t%3, %1\n"                        \
@@ -7239,11 +7384,11 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/futex.h linux-3.0.4/arch/x86/include
                     "\t.previous\n"                            \
                     _ASM_EXTABLE(1b, 3b)                       \
 -                   : "=r" (oldval), "=r" (ret), "+m" (*uaddr) \
-+                   : "=r" (oldval), "=r" (ret), "+m" (*(u32 *)____m(uaddr))\
++                   : "=r" (oldval), "=r" (ret), "+m" (*(u32 __user *)____m(uaddr))\
                     : "i" (-EFAULT), "0" (oparg), "1" (0))
  
  #define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg)   \
-+      typecheck(u32 *, uaddr);                                \
++      typecheck(u32 __user *, uaddr);                         \
        asm volatile("1:\tmovl  %2, %0\n"                       \
                     "\tmovl\t%0, %3\n"                         \
                     "\t" insn "\n"                             \
@@ -7252,7 +7397,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/futex.h linux-3.0.4/arch/x86/include
                     _ASM_EXTABLE(2b, 4b)                       \
                     : "=&a" (oldval), "=&r" (ret),             \
 -                     "+m" (*uaddr), "=&r" (tem)               \
-+                     "+m" (*(u32 *)____m(uaddr)), "=&r" (tem) \
++                     "+m" (*(u32 __user *)____m(uaddr)), "=&r" (tem)  \
                     : "r" (oparg), "i" (-EFAULT), "1" (0))
  
  static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr)
@@ -7281,14 +7426,14 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/futex.h linux-3.0.4/arch/x86/include
                     "\t.previous\n"
                     _ASM_EXTABLE(1b, 3b)
 -                   : "+r" (ret), "=a" (oldval), "+m" (*uaddr)
-+                   : "+r" (ret), "=a" (oldval), "+m" (*(u32 *)____m(uaddr))
++                   : "+r" (ret), "=a" (oldval), "+m" (*(u32 __user *)____m(uaddr))
                     : "i" (-EFAULT), "r" (newval), "1" (oldval)
                     : "memory"
        );
-diff -urNp linux-3.0.4/arch/x86/include/asm/hw_irq.h linux-3.0.4/arch/x86/include/asm/hw_irq.h
---- linux-3.0.4/arch/x86/include/asm/hw_irq.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/hw_irq.h  2011-08-23 21:47:55.000000000 -0400
-@@ -137,8 +137,8 @@ extern void setup_ioapic_dest(void);
+diff -urNp linux-3.1.3/arch/x86/include/asm/hw_irq.h linux-3.1.3/arch/x86/include/asm/hw_irq.h
+--- linux-3.1.3/arch/x86/include/asm/hw_irq.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/hw_irq.h  2011-11-16 18:39:07.000000000 -0500
+@@ -136,8 +136,8 @@ extern void setup_ioapic_dest(void);
  extern void enable_IO_APIC(void);
  
  /* Statistics */
@@ -7299,16 +7444,16 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/hw_irq.h linux-3.0.4/arch/x86/includ
  
  /* EISA */
  extern void eisa_set_level_irq(unsigned int irq);
-diff -urNp linux-3.0.4/arch/x86/include/asm/i387.h linux-3.0.4/arch/x86/include/asm/i387.h
---- linux-3.0.4/arch/x86/include/asm/i387.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/i387.h    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/i387.h linux-3.1.3/arch/x86/include/asm/i387.h
+--- linux-3.1.3/arch/x86/include/asm/i387.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/i387.h    2011-11-16 18:39:07.000000000 -0500
 @@ -92,6 +92,11 @@ static inline int fxrstor_checking(struc
  {
        int err;
  
 +#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF)
 +      if ((unsigned long)fx < PAX_USER_SHADOW_BASE)
-+              fx = (struct i387_fxsave_struct *)((void *)fx + PAX_USER_SHADOW_BASE);
++              fx = (struct i387_fxsave_struct __user *)((void *)fx + PAX_USER_SHADOW_BASE);
 +#endif
 +
        /* See comment in fxsave() below. */
@@ -7351,10 +7496,10 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/i387.h linux-3.0.4/arch/x86/include/
        else
                clts();
  }
-diff -urNp linux-3.0.4/arch/x86/include/asm/io.h linux-3.0.4/arch/x86/include/asm/io.h
---- linux-3.0.4/arch/x86/include/asm/io.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/io.h      2011-08-23 21:47:55.000000000 -0400
-@@ -196,6 +196,17 @@ extern void set_iounmap_nonlazy(void);
+diff -urNp linux-3.1.3/arch/x86/include/asm/io.h linux-3.1.3/arch/x86/include/asm/io.h
+--- linux-3.1.3/arch/x86/include/asm/io.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/io.h      2011-11-16 18:39:07.000000000 -0500
+@@ -194,6 +194,17 @@ extern void set_iounmap_nonlazy(void);
  
  #include <linux/vmalloc.h>
  
@@ -7372,10 +7517,10 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/io.h linux-3.0.4/arch/x86/include/as
  /*
   * Convert a virtual cached pointer to an uncached pointer
   */
-diff -urNp linux-3.0.4/arch/x86/include/asm/irqflags.h linux-3.0.4/arch/x86/include/asm/irqflags.h
---- linux-3.0.4/arch/x86/include/asm/irqflags.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/irqflags.h        2011-08-23 21:47:55.000000000 -0400
-@@ -140,6 +140,11 @@ static inline unsigned long arch_local_i
+diff -urNp linux-3.1.3/arch/x86/include/asm/irqflags.h linux-3.1.3/arch/x86/include/asm/irqflags.h
+--- linux-3.1.3/arch/x86/include/asm/irqflags.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/irqflags.h        2011-11-16 18:39:07.000000000 -0500
+@@ -141,6 +141,11 @@ static inline notrace unsigned long arch
        sti;                                    \
        sysexit
  
@@ -7387,9 +7532,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/irqflags.h linux-3.0.4/arch/x86/incl
  #else
  #define INTERRUPT_RETURN              iret
  #define ENABLE_INTERRUPTS_SYSEXIT     sti; sysexit
-diff -urNp linux-3.0.4/arch/x86/include/asm/kprobes.h linux-3.0.4/arch/x86/include/asm/kprobes.h
---- linux-3.0.4/arch/x86/include/asm/kprobes.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/kprobes.h 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/kprobes.h linux-3.1.3/arch/x86/include/asm/kprobes.h
+--- linux-3.1.3/arch/x86/include/asm/kprobes.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/kprobes.h 2011-11-16 18:39:07.000000000 -0500
 @@ -37,13 +37,8 @@ typedef u8 kprobe_opcode_t;
  #define RELATIVEJUMP_SIZE 5
  #define RELATIVECALL_OPCODE 0xe8
@@ -7406,19 +7551,19 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/kprobes.h linux-3.0.4/arch/x86/inclu
  
  #define flush_insn_slot(p)    do { } while (0)
  
-diff -urNp linux-3.0.4/arch/x86/include/asm/kvm_host.h linux-3.0.4/arch/x86/include/asm/kvm_host.h
---- linux-3.0.4/arch/x86/include/asm/kvm_host.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/kvm_host.h        2011-08-26 19:49:56.000000000 -0400
-@@ -441,7 +441,7 @@ struct kvm_arch {
-       unsigned int n_used_mmu_pages;
+diff -urNp linux-3.1.3/arch/x86/include/asm/kvm_host.h linux-3.1.3/arch/x86/include/asm/kvm_host.h
+--- linux-3.1.3/arch/x86/include/asm/kvm_host.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/kvm_host.h        2011-11-16 18:39:07.000000000 -0500
+@@ -456,7 +456,7 @@ struct kvm_arch {
        unsigned int n_requested_mmu_pages;
        unsigned int n_max_mmu_pages;
+       unsigned int indirect_shadow_pages;
 -      atomic_t invlpg_counter;
 +      atomic_unchecked_t invlpg_counter;
        struct hlist_head mmu_page_hash[KVM_NUM_MMU_PAGES];
        /*
         * Hash table of struct kvm_mmu_page.
-@@ -619,7 +619,7 @@ struct kvm_x86_ops {
+@@ -636,7 +636,7 @@ struct kvm_x86_ops {
                               enum x86_intercept_stage stage);
  
        const struct trace_print_flags *exit_reasons_str;
@@ -7427,9 +7572,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/kvm_host.h linux-3.0.4/arch/x86/incl
  
  struct kvm_arch_async_pf {
        u32 token;
-diff -urNp linux-3.0.4/arch/x86/include/asm/local.h linux-3.0.4/arch/x86/include/asm/local.h
---- linux-3.0.4/arch/x86/include/asm/local.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/local.h   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/local.h linux-3.1.3/arch/x86/include/asm/local.h
+--- linux-3.1.3/arch/x86/include/asm/local.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/local.h   2011-11-16 18:39:07.000000000 -0500
 @@ -18,26 +18,58 @@ typedef struct {
  
  static inline void local_inc(local_t *l)
@@ -7582,9 +7727,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/local.h linux-3.0.4/arch/x86/include
                     : "+r" (i), "+m" (l->a.counter)
                     : : "memory");
        return i + __i;
-diff -urNp linux-3.0.4/arch/x86/include/asm/mman.h linux-3.0.4/arch/x86/include/asm/mman.h
---- linux-3.0.4/arch/x86/include/asm/mman.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/mman.h    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/mman.h linux-3.1.3/arch/x86/include/asm/mman.h
+--- linux-3.1.3/arch/x86/include/asm/mman.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/mman.h    2011-11-16 18:39:07.000000000 -0500
 @@ -5,4 +5,14 @@
  
  #include <asm-generic/mman.h>
@@ -7600,9 +7745,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/mman.h linux-3.0.4/arch/x86/include/
 +#endif
 +
  #endif /* _ASM_X86_MMAN_H */
-diff -urNp linux-3.0.4/arch/x86/include/asm/mmu_context.h linux-3.0.4/arch/x86/include/asm/mmu_context.h
---- linux-3.0.4/arch/x86/include/asm/mmu_context.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/mmu_context.h     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/mmu_context.h linux-3.1.3/arch/x86/include/asm/mmu_context.h
+--- linux-3.1.3/arch/x86/include/asm/mmu_context.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/mmu_context.h     2011-11-16 18:39:07.000000000 -0500
 @@ -24,6 +24,18 @@ void destroy_context(struct mm_struct *m
  
  static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
@@ -7723,9 +7868,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/mmu_context.h linux-3.0.4/arch/x86/i
  }
  
  #define activate_mm(prev, next)                       \
-diff -urNp linux-3.0.4/arch/x86/include/asm/mmu.h linux-3.0.4/arch/x86/include/asm/mmu.h
---- linux-3.0.4/arch/x86/include/asm/mmu.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/mmu.h     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/mmu.h linux-3.1.3/arch/x86/include/asm/mmu.h
+--- linux-3.1.3/arch/x86/include/asm/mmu.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/mmu.h     2011-11-16 18:39:07.000000000 -0500
 @@ -9,7 +9,7 @@
   * we put the segment information here.
   */
@@ -7756,9 +7901,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/mmu.h linux-3.0.4/arch/x86/include/a
  } mm_context_t;
  
  #ifdef CONFIG_SMP
-diff -urNp linux-3.0.4/arch/x86/include/asm/module.h linux-3.0.4/arch/x86/include/asm/module.h
---- linux-3.0.4/arch/x86/include/asm/module.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/module.h  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/module.h linux-3.1.3/arch/x86/include/asm/module.h
+--- linux-3.1.3/arch/x86/include/asm/module.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/module.h  2011-11-16 18:39:07.000000000 -0500
 @@ -5,6 +5,7 @@
  
  #ifdef CONFIG_X86_64
@@ -7767,42 +7912,30 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/module.h linux-3.0.4/arch/x86/includ
  #elif defined CONFIG_M386
  #define MODULE_PROC_FAMILY "386 "
  #elif defined CONFIG_M486
-@@ -59,8 +60,30 @@
+@@ -59,8 +60,18 @@
  #error unknown processor family
  #endif
  
 -#ifdef CONFIG_X86_32
 -# define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY
-+#ifdef CONFIG_PAX_MEMORY_UDEREF
-+#define MODULE_PAX_UDEREF "UDEREF "
-+#else
-+#define MODULE_PAX_UDEREF ""
-+#endif
-+
 +#ifdef CONFIG_PAX_KERNEXEC
 +#define MODULE_PAX_KERNEXEC "KERNEXEC "
 +#else
 +#define MODULE_PAX_KERNEXEC ""
  #endif
  
-+#ifdef CONFIG_PAX_REFCOUNT
-+#define MODULE_PAX_REFCOUNT "REFCOUNT "
-+#else
-+#define MODULE_PAX_REFCOUNT ""
-+#endif
-+
-+#ifdef CONFIG_GRKERNSEC
-+#define MODULE_GRSEC "GRSECURITY "
++#ifdef CONFIG_PAX_MEMORY_UDEREF
++#define MODULE_PAX_UDEREF "UDEREF "
 +#else
-+#define MODULE_GRSEC ""
++#define MODULE_PAX_UDEREF ""
 +#endif
 +
-+#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_GRSEC MODULE_PAX_KERNEXEC MODULE_PAX_UDEREF MODULE_PAX_REFCOUNT
++#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_PAX_KERNEXEC MODULE_PAX_UDEREF
 +
  #endif /* _ASM_X86_MODULE_H */
-diff -urNp linux-3.0.4/arch/x86/include/asm/page_64_types.h linux-3.0.4/arch/x86/include/asm/page_64_types.h
---- linux-3.0.4/arch/x86/include/asm/page_64_types.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/page_64_types.h   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/page_64_types.h linux-3.1.3/arch/x86/include/asm/page_64_types.h
+--- linux-3.1.3/arch/x86/include/asm/page_64_types.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/page_64_types.h   2011-11-16 18:39:07.000000000 -0500
 @@ -56,7 +56,7 @@ void copy_page(void *to, void *from);
  
  /* duplicated to the one in bootmem.h */
@@ -7812,10 +7945,10 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/page_64_types.h linux-3.0.4/arch/x86
  
  extern unsigned long __phys_addr(unsigned long);
  #define __phys_reloc_hide(x)  (x)
-diff -urNp linux-3.0.4/arch/x86/include/asm/paravirt.h linux-3.0.4/arch/x86/include/asm/paravirt.h
---- linux-3.0.4/arch/x86/include/asm/paravirt.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/paravirt.h        2011-08-23 21:47:55.000000000 -0400
-@@ -658,6 +658,18 @@ static inline void set_pgd(pgd_t *pgdp, 
+diff -urNp linux-3.1.3/arch/x86/include/asm/paravirt.h linux-3.1.3/arch/x86/include/asm/paravirt.h
+--- linux-3.1.3/arch/x86/include/asm/paravirt.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/paravirt.h        2011-11-16 18:39:07.000000000 -0500
+@@ -667,6 +667,18 @@ static inline void set_pgd(pgd_t *pgdp, 
                            val);
  }
  
@@ -7834,7 +7967,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/paravirt.h linux-3.0.4/arch/x86/incl
  static inline void pgd_clear(pgd_t *pgdp)
  {
        set_pgd(pgdp, __pgd(0));
-@@ -739,6 +751,21 @@ static inline void __set_fixmap(unsigned
+@@ -748,6 +760,21 @@ static inline void __set_fixmap(unsigned
        pv_mmu_ops.set_fixmap(idx, phys, flags);
  }
  
@@ -7856,7 +7989,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/paravirt.h linux-3.0.4/arch/x86/incl
  #if defined(CONFIG_SMP) && defined(CONFIG_PARAVIRT_SPINLOCKS)
  
  static inline int arch_spin_is_locked(struct arch_spinlock *lock)
-@@ -955,7 +982,7 @@ extern void default_banner(void);
+@@ -964,7 +991,7 @@ extern void default_banner(void);
  
  #define PARA_PATCH(struct, off)        ((PARAVIRT_PATCH_##struct + (off)) / 4)
  #define PARA_SITE(ptype, clobbers, ops) _PVSITE(ptype, clobbers, ops, .long, 4)
@@ -7865,7 +7998,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/paravirt.h linux-3.0.4/arch/x86/incl
  #endif
  
  #define INTERRUPT_RETURN                                              \
-@@ -1032,6 +1059,21 @@ extern void default_banner(void);
+@@ -1041,6 +1068,21 @@ extern void default_banner(void);
        PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_irq_enable_sysexit),    \
                  CLBR_NONE,                                            \
                  jmp PARA_INDIRECT(pv_cpu_ops+PV_CPU_irq_enable_sysexit))
@@ -7887,10 +8020,10 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/paravirt.h linux-3.0.4/arch/x86/incl
  #endif        /* CONFIG_X86_32 */
  
  #endif /* __ASSEMBLY__ */
-diff -urNp linux-3.0.4/arch/x86/include/asm/paravirt_types.h linux-3.0.4/arch/x86/include/asm/paravirt_types.h
---- linux-3.0.4/arch/x86/include/asm/paravirt_types.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/paravirt_types.h  2011-08-23 21:47:55.000000000 -0400
-@@ -78,19 +78,19 @@ struct pv_init_ops {
+diff -urNp linux-3.1.3/arch/x86/include/asm/paravirt_types.h linux-3.1.3/arch/x86/include/asm/paravirt_types.h
+--- linux-3.1.3/arch/x86/include/asm/paravirt_types.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/paravirt_types.h  2011-11-16 18:39:07.000000000 -0500
+@@ -84,20 +84,20 @@ struct pv_init_ops {
         */
        unsigned (*patch)(u8 type, u16 clobber, void *insnbuf,
                          unsigned long addr, unsigned len);
@@ -7907,13 +8040,14 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/paravirt_types.h linux-3.0.4/arch/x8
  
  struct pv_time_ops {
        unsigned long long (*sched_clock)(void);
+       unsigned long long (*steal_clock)(int cpu);
        unsigned long (*get_tsc_khz)(void);
 -};
 +} __no_const;
  
  struct pv_cpu_ops {
        /* hooks for various privileged instructions */
-@@ -186,7 +186,7 @@ struct pv_cpu_ops {
+@@ -193,7 +193,7 @@ struct pv_cpu_ops {
  
        void (*start_context_switch)(struct task_struct *prev);
        void (*end_context_switch)(struct task_struct *next);
@@ -7922,7 +8056,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/paravirt_types.h linux-3.0.4/arch/x8
  
  struct pv_irq_ops {
        /*
-@@ -217,7 +217,7 @@ struct pv_apic_ops {
+@@ -224,7 +224,7 @@ struct pv_apic_ops {
                                 unsigned long start_eip,
                                 unsigned long start_esp);
  #endif
@@ -7931,7 +8065,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/paravirt_types.h linux-3.0.4/arch/x8
  
  struct pv_mmu_ops {
        unsigned long (*read_cr2)(void);
-@@ -306,6 +306,7 @@ struct pv_mmu_ops {
+@@ -313,6 +313,7 @@ struct pv_mmu_ops {
        struct paravirt_callee_save make_pud;
  
        void (*set_pgd)(pgd_t *pudp, pgd_t pgdval);
@@ -7939,7 +8073,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/paravirt_types.h linux-3.0.4/arch/x8
  #endif        /* PAGETABLE_LEVELS == 4 */
  #endif        /* PAGETABLE_LEVELS >= 3 */
  
-@@ -317,6 +318,12 @@ struct pv_mmu_ops {
+@@ -324,6 +325,12 @@ struct pv_mmu_ops {
           an mfn.  We can tell which is which from the index. */
        void (*set_fixmap)(unsigned /* enum fixed_addresses */ idx,
                           phys_addr_t phys, pgprot_t flags);
@@ -7952,7 +8086,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/paravirt_types.h linux-3.0.4/arch/x8
  };
  
  struct arch_spinlock;
-@@ -327,7 +334,7 @@ struct pv_lock_ops {
+@@ -334,7 +341,7 @@ struct pv_lock_ops {
        void (*spin_lock_flags)(struct arch_spinlock *lock, unsigned long flags);
        int (*spin_trylock)(struct arch_spinlock *lock);
        void (*spin_unlock)(struct arch_spinlock *lock);
@@ -7961,9 +8095,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/paravirt_types.h linux-3.0.4/arch/x8
  
  /* This contains all the paravirt structures: we get a convenient
   * number for each function using the offset which we use to indicate
-diff -urNp linux-3.0.4/arch/x86/include/asm/pgalloc.h linux-3.0.4/arch/x86/include/asm/pgalloc.h
---- linux-3.0.4/arch/x86/include/asm/pgalloc.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/pgalloc.h 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/pgalloc.h linux-3.1.3/arch/x86/include/asm/pgalloc.h
+--- linux-3.1.3/arch/x86/include/asm/pgalloc.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/pgalloc.h 2011-11-16 18:39:07.000000000 -0500
 @@ -63,6 +63,13 @@ static inline void pmd_populate_kernel(s
                                       pmd_t *pmd, pte_t *pte)
  {
@@ -7978,9 +8112,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/pgalloc.h linux-3.0.4/arch/x86/inclu
        set_pmd(pmd, __pmd(__pa(pte) | _PAGE_TABLE));
  }
  
-diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable-2level.h linux-3.0.4/arch/x86/include/asm/pgtable-2level.h
---- linux-3.0.4/arch/x86/include/asm/pgtable-2level.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/pgtable-2level.h  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable-2level.h linux-3.1.3/arch/x86/include/asm/pgtable-2level.h
+--- linux-3.1.3/arch/x86/include/asm/pgtable-2level.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/pgtable-2level.h  2011-11-16 18:39:07.000000000 -0500
 @@ -18,7 +18,9 @@ static inline void native_set_pte(pte_t 
  
  static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd)
@@ -7991,9 +8125,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable-2level.h linux-3.0.4/arch/x8
  }
  
  static inline void native_set_pte_atomic(pte_t *ptep, pte_t pte)
-diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable_32.h linux-3.0.4/arch/x86/include/asm/pgtable_32.h
---- linux-3.0.4/arch/x86/include/asm/pgtable_32.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/pgtable_32.h      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable_32.h linux-3.1.3/arch/x86/include/asm/pgtable_32.h
+--- linux-3.1.3/arch/x86/include/asm/pgtable_32.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/pgtable_32.h      2011-11-16 18:39:07.000000000 -0500
 @@ -25,9 +25,6 @@
  struct mm_struct;
  struct vm_area_struct;
@@ -8037,9 +8171,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable_32.h linux-3.0.4/arch/x86/in
  /*
   * kern_addr_valid() is (1) for FLATMEM and (0) for
   * SPARSEMEM and DISCONTIGMEM
-diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable_32_types.h linux-3.0.4/arch/x86/include/asm/pgtable_32_types.h
---- linux-3.0.4/arch/x86/include/asm/pgtable_32_types.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/pgtable_32_types.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable_32_types.h linux-3.1.3/arch/x86/include/asm/pgtable_32_types.h
+--- linux-3.1.3/arch/x86/include/asm/pgtable_32_types.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/pgtable_32_types.h        2011-11-16 18:39:07.000000000 -0500
 @@ -8,7 +8,7 @@
   */
  #ifdef CONFIG_X86_PAE
@@ -8069,9 +8203,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable_32_types.h linux-3.0.4/arch/
  #define MODULES_VADDR VMALLOC_START
  #define MODULES_END   VMALLOC_END
  #define MODULES_LEN   (MODULES_VADDR - MODULES_END)
-diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable-3level.h linux-3.0.4/arch/x86/include/asm/pgtable-3level.h
---- linux-3.0.4/arch/x86/include/asm/pgtable-3level.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/pgtable-3level.h  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable-3level.h linux-3.1.3/arch/x86/include/asm/pgtable-3level.h
+--- linux-3.1.3/arch/x86/include/asm/pgtable-3level.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/pgtable-3level.h  2011-11-16 18:39:07.000000000 -0500
 @@ -38,12 +38,16 @@ static inline void native_set_pte_atomic
  
  static inline void native_set_pmd(pmd_t *pmdp, pmd_t pmd)
@@ -8089,9 +8223,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable-3level.h linux-3.0.4/arch/x8
  }
  
  /*
-diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable_64.h linux-3.0.4/arch/x86/include/asm/pgtable_64.h
---- linux-3.0.4/arch/x86/include/asm/pgtable_64.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/pgtable_64.h      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable_64.h linux-3.1.3/arch/x86/include/asm/pgtable_64.h
+--- linux-3.1.3/arch/x86/include/asm/pgtable_64.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/pgtable_64.h      2011-11-16 18:39:07.000000000 -0500
 @@ -16,10 +16,13 @@
  
  extern pud_t level3_kernel_pgt[512];
@@ -8132,9 +8266,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable_64.h linux-3.0.4/arch/x86/in
        *pgdp = pgd;
  }
  
-diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable_64_types.h linux-3.0.4/arch/x86/include/asm/pgtable_64_types.h
---- linux-3.0.4/arch/x86/include/asm/pgtable_64_types.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/pgtable_64_types.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable_64_types.h linux-3.1.3/arch/x86/include/asm/pgtable_64_types.h
+--- linux-3.1.3/arch/x86/include/asm/pgtable_64_types.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/pgtable_64_types.h        2011-11-16 18:39:07.000000000 -0500
 @@ -59,5 +59,10 @@ typedef struct { pteval_t pte; } pte_t;
  #define MODULES_VADDR    _AC(0xffffffffa0000000, UL)
  #define MODULES_END      _AC(0xffffffffff000000, UL)
@@ -8146,9 +8280,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable_64_types.h linux-3.0.4/arch/
 +#define ktva_ktla(addr)               (addr)
  
  #endif /* _ASM_X86_PGTABLE_64_DEFS_H */
-diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable.h linux-3.0.4/arch/x86/include/asm/pgtable.h
---- linux-3.0.4/arch/x86/include/asm/pgtable.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/pgtable.h 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable.h linux-3.1.3/arch/x86/include/asm/pgtable.h
+--- linux-3.1.3/arch/x86/include/asm/pgtable.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/pgtable.h 2011-11-16 18:39:07.000000000 -0500
 @@ -44,6 +44,7 @@ extern struct mm_struct *pgd_page_get_mm
  
  #ifndef __PAGETABLE_PUD_FOLDED
@@ -8326,9 +8460,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable.h linux-3.0.4/arch/x86/inclu
  
  #include <asm-generic/pgtable.h>
  #endif        /* __ASSEMBLY__ */
-diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable_types.h linux-3.0.4/arch/x86/include/asm/pgtable_types.h
---- linux-3.0.4/arch/x86/include/asm/pgtable_types.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/pgtable_types.h   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/pgtable_types.h linux-3.1.3/arch/x86/include/asm/pgtable_types.h
+--- linux-3.1.3/arch/x86/include/asm/pgtable_types.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/pgtable_types.h   2011-11-16 18:39:07.000000000 -0500
 @@ -16,13 +16,12 @@
  #define _PAGE_BIT_PSE         7       /* 4 MB (or 2MB) page */
  #define _PAGE_BIT_PAT         7       /* on 4KB pages */
@@ -8376,18 +8510,16 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable_types.h linux-3.0.4/arch/x86
  #define __PAGE_KERNEL_EXEC                                            \
        (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_GLOBAL)
  #define __PAGE_KERNEL         (__PAGE_KERNEL_EXEC | _PAGE_NX)
-@@ -106,8 +109,8 @@
+@@ -106,7 +109,7 @@
  #define __PAGE_KERNEL_WC              (__PAGE_KERNEL | _PAGE_CACHE_WC)
  #define __PAGE_KERNEL_NOCACHE         (__PAGE_KERNEL | _PAGE_PCD | _PAGE_PWT)
  #define __PAGE_KERNEL_UC_MINUS                (__PAGE_KERNEL | _PAGE_PCD)
 -#define __PAGE_KERNEL_VSYSCALL                (__PAGE_KERNEL_RX | _PAGE_USER)
--#define __PAGE_KERNEL_VSYSCALL_NOCACHE        (__PAGE_KERNEL_VSYSCALL | _PAGE_PCD | _PAGE_PWT)
 +#define __PAGE_KERNEL_VSYSCALL                (__PAGE_KERNEL_RO | _PAGE_USER)
-+#define __PAGE_KERNEL_VSYSCALL_NOCACHE        (__PAGE_KERNEL_RO | _PAGE_PCD | _PAGE_PWT | _PAGE_USER)
+ #define __PAGE_KERNEL_VVAR            (__PAGE_KERNEL_RO | _PAGE_USER)
+ #define __PAGE_KERNEL_VVAR_NOCACHE    (__PAGE_KERNEL_VVAR | _PAGE_PCD | _PAGE_PWT)
  #define __PAGE_KERNEL_LARGE           (__PAGE_KERNEL | _PAGE_PSE)
- #define __PAGE_KERNEL_LARGE_NOCACHE   (__PAGE_KERNEL | _PAGE_CACHE_UC | _PAGE_PSE)
- #define __PAGE_KERNEL_LARGE_EXEC      (__PAGE_KERNEL_EXEC | _PAGE_PSE)
-@@ -166,8 +169,8 @@
+@@ -168,8 +171,8 @@
   * bits are combined, this will alow user to access the high address mapped
   * VDSO in the presence of CONFIG_COMPAT_VDSO
   */
@@ -8398,7 +8530,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable_types.h linux-3.0.4/arch/x86
  #define PGD_IDENT_ATTR         0x001          /* PRESENT (no other attributes) */
  #endif
  
-@@ -205,7 +208,17 @@ static inline pgdval_t pgd_flags(pgd_t p
+@@ -207,7 +210,17 @@ static inline pgdval_t pgd_flags(pgd_t p
  {
        return native_pgd_val(pgd) & PTE_FLAGS_MASK;
  }
@@ -8416,7 +8548,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable_types.h linux-3.0.4/arch/x86
  #if PAGETABLE_LEVELS > 3
  typedef struct { pudval_t pud; } pud_t;
  
-@@ -219,8 +232,6 @@ static inline pudval_t native_pud_val(pu
+@@ -221,8 +234,6 @@ static inline pudval_t native_pud_val(pu
        return pud.pud;
  }
  #else
@@ -8425,7 +8557,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable_types.h linux-3.0.4/arch/x86
  static inline pudval_t native_pud_val(pud_t pud)
  {
        return native_pgd_val(pud.pgd);
-@@ -240,8 +251,6 @@ static inline pmdval_t native_pmd_val(pm
+@@ -242,8 +253,6 @@ static inline pmdval_t native_pmd_val(pm
        return pmd.pmd;
  }
  #else
@@ -8434,7 +8566,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable_types.h linux-3.0.4/arch/x86
  static inline pmdval_t native_pmd_val(pmd_t pmd)
  {
        return native_pgd_val(pmd.pud.pgd);
-@@ -281,7 +290,6 @@ typedef struct page *pgtable_t;
+@@ -283,7 +292,6 @@ typedef struct page *pgtable_t;
  
  extern pteval_t __supported_pte_mask;
  extern void set_nx(void);
@@ -8442,9 +8574,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/pgtable_types.h linux-3.0.4/arch/x86
  
  #define pgprot_writecombine   pgprot_writecombine
  extern pgprot_t pgprot_writecombine(pgprot_t prot);
-diff -urNp linux-3.0.4/arch/x86/include/asm/processor.h linux-3.0.4/arch/x86/include/asm/processor.h
---- linux-3.0.4/arch/x86/include/asm/processor.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/processor.h       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/processor.h linux-3.1.3/arch/x86/include/asm/processor.h
+--- linux-3.1.3/arch/x86/include/asm/processor.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/processor.h       2011-11-16 18:39:07.000000000 -0500
 @@ -266,7 +266,7 @@ struct tss_struct {
  
  } ____cacheline_aligned;
@@ -8454,7 +8586,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/processor.h linux-3.0.4/arch/x86/inc
  
  /*
   * Save the original ist values for checking stack pointers during debugging
-@@ -860,11 +860,18 @@ static inline void spin_lock_prefetch(co
+@@ -858,11 +858,18 @@ static inline void spin_lock_prefetch(co
   */
  #define TASK_SIZE             PAGE_OFFSET
  #define TASK_SIZE_MAX         TASK_SIZE
@@ -8475,7 +8607,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/processor.h linux-3.0.4/arch/x86/inc
        .vm86_info              = NULL,                                   \
        .sysenter_cs            = __KERNEL_CS,                            \
        .io_bitmap_ptr          = NULL,                                   \
-@@ -878,7 +885,7 @@ static inline void spin_lock_prefetch(co
+@@ -876,7 +883,7 @@ static inline void spin_lock_prefetch(co
   */
  #define INIT_TSS  {                                                     \
        .x86_tss = {                                                      \
@@ -8484,7 +8616,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/processor.h linux-3.0.4/arch/x86/inc
                .ss0            = __KERNEL_DS,                            \
                .ss1            = __KERNEL_CS,                            \
                .io_bitmap_base = INVALID_IO_BITMAP_OFFSET,               \
-@@ -889,11 +896,7 @@ static inline void spin_lock_prefetch(co
+@@ -887,11 +894,7 @@ static inline void spin_lock_prefetch(co
  extern unsigned long thread_saved_pc(struct task_struct *tsk);
  
  #define THREAD_SIZE_LONGS      (THREAD_SIZE/sizeof(unsigned long))
@@ -8497,7 +8629,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/processor.h linux-3.0.4/arch/x86/inc
  
  /*
   * The below -8 is to reserve 8 bytes on top of the ring0 stack.
-@@ -908,7 +911,7 @@ extern unsigned long thread_saved_pc(str
+@@ -906,7 +909,7 @@ extern unsigned long thread_saved_pc(str
  #define task_pt_regs(task)                                             \
  ({                                                                     \
         struct pt_regs *__regs__;                                       \
@@ -8506,7 +8638,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/processor.h linux-3.0.4/arch/x86/inc
         __regs__ - 1;                                                   \
  })
  
-@@ -918,13 +921,13 @@ extern unsigned long thread_saved_pc(str
+@@ -916,13 +919,13 @@ extern unsigned long thread_saved_pc(str
  /*
   * User space process size. 47bits minus one guard page.
   */
@@ -8522,7 +8654,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/processor.h linux-3.0.4/arch/x86/inc
  
  #define TASK_SIZE             (test_thread_flag(TIF_IA32) ? \
                                        IA32_PAGE_OFFSET : TASK_SIZE_MAX)
-@@ -935,11 +938,11 @@ extern unsigned long thread_saved_pc(str
+@@ -933,11 +936,11 @@ extern unsigned long thread_saved_pc(str
  #define STACK_TOP_MAX         TASK_SIZE_MAX
  
  #define INIT_THREAD  { \
@@ -8536,7 +8668,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/processor.h linux-3.0.4/arch/x86/inc
  }
  
  /*
-@@ -961,6 +964,10 @@ extern void start_thread(struct pt_regs 
+@@ -959,6 +962,10 @@ extern void start_thread(struct pt_regs 
   */
  #define TASK_UNMAPPED_BASE    (PAGE_ALIGN(TASK_SIZE / 3))
  
@@ -8547,10 +8679,10 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/processor.h linux-3.0.4/arch/x86/inc
  #define KSTK_EIP(task)                (task_pt_regs(task)->ip)
  
  /* Get/set a process' ability to use the timestamp counter instruction */
-diff -urNp linux-3.0.4/arch/x86/include/asm/ptrace.h linux-3.0.4/arch/x86/include/asm/ptrace.h
---- linux-3.0.4/arch/x86/include/asm/ptrace.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/ptrace.h  2011-08-23 21:47:55.000000000 -0400
-@@ -153,28 +153,29 @@ static inline unsigned long regs_return_
+diff -urNp linux-3.1.3/arch/x86/include/asm/ptrace.h linux-3.1.3/arch/x86/include/asm/ptrace.h
+--- linux-3.1.3/arch/x86/include/asm/ptrace.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/ptrace.h  2011-11-16 18:39:07.000000000 -0500
+@@ -156,28 +156,29 @@ static inline unsigned long regs_return_
  }
  
  /*
@@ -8586,9 +8718,28 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/ptrace.h linux-3.0.4/arch/x86/includ
  #endif
  }
  
-diff -urNp linux-3.0.4/arch/x86/include/asm/reboot.h linux-3.0.4/arch/x86/include/asm/reboot.h
---- linux-3.0.4/arch/x86/include/asm/reboot.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/reboot.h  2011-08-23 21:47:55.000000000 -0400
+@@ -193,15 +194,16 @@ static inline int v8086_mode(struct pt_r
+ #ifdef CONFIG_X86_64
+ static inline bool user_64bit_mode(struct pt_regs *regs)
+ {
++      unsigned long cs = regs->cs & 0xffff;
+ #ifndef CONFIG_PARAVIRT
+       /*
+        * On non-paravirt systems, this is the only long mode CPL 3
+        * selector.  We do not allow long mode selectors in the LDT.
+        */
+-      return regs->cs == __USER_CS;
++      return cs == __USER_CS;
+ #else
+       /* Headers are too twisted for this to go in paravirt.h. */
+-      return regs->cs == __USER_CS || regs->cs == pv_info.extra_user_64bit_cs;
++      return cs == __USER_CS || cs == pv_info.extra_user_64bit_cs;
+ #endif
+ }
+ #endif
+diff -urNp linux-3.1.3/arch/x86/include/asm/reboot.h linux-3.1.3/arch/x86/include/asm/reboot.h
+--- linux-3.1.3/arch/x86/include/asm/reboot.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/reboot.h  2011-11-16 18:39:07.000000000 -0500
 @@ -6,19 +6,19 @@
  struct pt_regs;
  
@@ -8615,9 +8766,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/reboot.h linux-3.0.4/arch/x86/includ
  /* These must match dispatch_table in reboot_32.S */
  #define MRR_BIOS      0
  #define MRR_APM               1
-diff -urNp linux-3.0.4/arch/x86/include/asm/rwsem.h linux-3.0.4/arch/x86/include/asm/rwsem.h
---- linux-3.0.4/arch/x86/include/asm/rwsem.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/rwsem.h   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/rwsem.h linux-3.1.3/arch/x86/include/asm/rwsem.h
+--- linux-3.1.3/arch/x86/include/asm/rwsem.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/rwsem.h   2011-11-16 18:39:07.000000000 -0500
 @@ -64,6 +64,14 @@ static inline void __down_read(struct rw
  {
        asm volatile("# beginning down_read\n\t"
@@ -8742,9 +8893,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/rwsem.h linux-3.0.4/arch/x86/include
                     : "+r" (tmp), "+m" (sem->count)
                     : : "memory");
  
-diff -urNp linux-3.0.4/arch/x86/include/asm/segment.h linux-3.0.4/arch/x86/include/asm/segment.h
---- linux-3.0.4/arch/x86/include/asm/segment.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/segment.h 2011-09-17 00:53:42.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/segment.h linux-3.1.3/arch/x86/include/asm/segment.h
+--- linux-3.1.3/arch/x86/include/asm/segment.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/segment.h 2011-11-16 18:39:07.000000000 -0500
 @@ -64,10 +64,15 @@
   *  26 - ESPFIX small SS
   *  27 - per-cpu                      [ offset to per-cpu data area ]
@@ -8795,7 +8946,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/segment.h linux-3.0.4/arch/x86/inclu
  
  #else
 @@ -165,6 +178,8 @@
- #define __USER32_CS   (GDT_ENTRY_DEFAULT_USER32_CS * 8 + 3)
+ #define __USER32_CS   (GDT_ENTRY_DEFAULT_USER32_CS*8+3)
  #define __USER32_DS   __USER_DS
  
 +#define GDT_ENTRY_KERNEXEC_KERNEL_CS 7
@@ -8811,9 +8962,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/segment.h linux-3.0.4/arch/x86/inclu
  #define __KERNEL_DS   (GDT_ENTRY_KERNEL_DS*8)
  #define __USER_DS     (GDT_ENTRY_DEFAULT_USER_DS*8+3)
  #define __USER_CS     (GDT_ENTRY_DEFAULT_USER_CS*8+3)
-diff -urNp linux-3.0.4/arch/x86/include/asm/smp.h linux-3.0.4/arch/x86/include/asm/smp.h
---- linux-3.0.4/arch/x86/include/asm/smp.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/smp.h     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/smp.h linux-3.1.3/arch/x86/include/asm/smp.h
+--- linux-3.1.3/arch/x86/include/asm/smp.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/smp.h     2011-11-16 18:39:07.000000000 -0500
 @@ -36,7 +36,7 @@ DECLARE_PER_CPU(cpumask_var_t, cpu_core_
  /* cpus sharing the last level cache: */
  DECLARE_PER_CPU(cpumask_var_t, cpu_llc_shared_map);
@@ -8849,17 +9000,17 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/smp.h linux-3.0.4/arch/x86/include/a
  #define safe_smp_processor_id()               smp_processor_id()
  
  #endif
-diff -urNp linux-3.0.4/arch/x86/include/asm/spinlock.h linux-3.0.4/arch/x86/include/asm/spinlock.h
---- linux-3.0.4/arch/x86/include/asm/spinlock.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/spinlock.h        2011-08-23 21:47:55.000000000 -0400
-@@ -249,6 +249,14 @@ static inline int arch_write_can_lock(ar
+diff -urNp linux-3.1.3/arch/x86/include/asm/spinlock.h linux-3.1.3/arch/x86/include/asm/spinlock.h
+--- linux-3.1.3/arch/x86/include/asm/spinlock.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/spinlock.h        2011-11-16 18:39:07.000000000 -0500
+@@ -248,6 +248,14 @@ static inline int arch_write_can_lock(ar
  static inline void arch_read_lock(arch_rwlock_t *rw)
  {
-       asm volatile(LOCK_PREFIX " subl $1,(%0)\n\t"
+       asm volatile(LOCK_PREFIX READ_LOCK_SIZE(dec) " (%0)\n\t"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX " addl $1,(%0)\n"
++                   LOCK_PREFIX READ_LOCK_SIZE(inc) " (%0)\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
@@ -8867,14 +9018,14 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/spinlock.h linux-3.0.4/arch/x86/incl
                     "jns 1f\n"
                     "call __read_lock_failed\n\t"
                     "1:\n"
-@@ -258,6 +266,14 @@ static inline void arch_read_lock(arch_r
+@@ -257,6 +265,14 @@ static inline void arch_read_lock(arch_r
  static inline void arch_write_lock(arch_rwlock_t *rw)
  {
-       asm volatile(LOCK_PREFIX " subl %1,(%0)\n\t"
+       asm volatile(LOCK_PREFIX WRITE_LOCK_SUB(%1) "(%0)\n\t"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX " addl %1,(%0)\n"
++                   LOCK_PREFIX WRITE_LOCK_ADD(%1) "(%0)\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
@@ -8882,41 +9033,41 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/spinlock.h linux-3.0.4/arch/x86/incl
                     "jz 1f\n"
                     "call __write_lock_failed\n\t"
                     "1:\n"
-@@ -286,12 +302,29 @@ static inline int arch_write_trylock(arc
+@@ -286,13 +302,29 @@ static inline int arch_write_trylock(arc
  
  static inline void arch_read_unlock(arch_rwlock_t *rw)
  {
--      asm volatile(LOCK_PREFIX "incl %0" :"+m" (rw->lock) : : "memory");
-+      asm volatile(LOCK_PREFIX "incl %0\n"
+-      asm volatile(LOCK_PREFIX READ_LOCK_SIZE(inc) " %0"
++      asm volatile(LOCK_PREFIX READ_LOCK_SIZE(inc) " %0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX "decl %0\n"
++                   LOCK_PREFIX READ_LOCK_SIZE(dec) " %0\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
 +
-+                   :"+m" (rw->lock) : : "memory");
+                    :"+m" (rw->lock) : : "memory");
  }
  
  static inline void arch_write_unlock(arch_rwlock_t *rw)
  {
--      asm volatile(LOCK_PREFIX "addl %1, %0"
-+      asm volatile(LOCK_PREFIX "addl %1, %0\n"
+-      asm volatile(LOCK_PREFIX WRITE_LOCK_ADD(%1) "%0"
++      asm volatile(LOCK_PREFIX WRITE_LOCK_ADD(%1) "%0\n"
 +
 +#ifdef CONFIG_PAX_REFCOUNT
 +                   "jno 0f\n"
-+                   LOCK_PREFIX "subl %1, %0\n"
++                   LOCK_PREFIX WRITE_LOCK_SUB(%1) "%0\n"
 +                   "int $4\n0:\n"
 +                   _ASM_EXTABLE(0b, 0b)
 +#endif
 +
-                    : "+m" (rw->lock) : "i" (RW_LOCK_BIAS) : "memory");
+                    : "+m" (rw->write) : "i" (RW_LOCK_BIAS) : "memory");
  }
  
-diff -urNp linux-3.0.4/arch/x86/include/asm/stackprotector.h linux-3.0.4/arch/x86/include/asm/stackprotector.h
---- linux-3.0.4/arch/x86/include/asm/stackprotector.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/stackprotector.h  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/stackprotector.h linux-3.1.3/arch/x86/include/asm/stackprotector.h
+--- linux-3.1.3/arch/x86/include/asm/stackprotector.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/stackprotector.h  2011-11-16 18:39:07.000000000 -0500
 @@ -48,7 +48,7 @@
   * head_32 for boot CPU and setup_per_cpu_areas() for others.
   */
@@ -8935,9 +9086,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/stackprotector.h linux-3.0.4/arch/x8
        asm volatile ("mov %0, %%gs" : : "r" (0));
  #endif
  }
-diff -urNp linux-3.0.4/arch/x86/include/asm/stacktrace.h linux-3.0.4/arch/x86/include/asm/stacktrace.h
---- linux-3.0.4/arch/x86/include/asm/stacktrace.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/stacktrace.h      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/stacktrace.h linux-3.1.3/arch/x86/include/asm/stacktrace.h
+--- linux-3.1.3/arch/x86/include/asm/stacktrace.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/stacktrace.h      2011-11-16 18:39:07.000000000 -0500
 @@ -11,28 +11,20 @@
  
  extern int kstack_depth_to_print;
@@ -8988,9 +9139,21 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/stacktrace.h linux-3.0.4/arch/x86/in
  };
  
  void dump_trace(struct task_struct *tsk, struct pt_regs *regs,
-diff -urNp linux-3.0.4/arch/x86/include/asm/system.h linux-3.0.4/arch/x86/include/asm/system.h
---- linux-3.0.4/arch/x86/include/asm/system.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/system.h  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/sys_ia32.h linux-3.1.3/arch/x86/include/asm/sys_ia32.h
+--- linux-3.1.3/arch/x86/include/asm/sys_ia32.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/sys_ia32.h        2011-11-16 18:39:07.000000000 -0500
+@@ -40,7 +40,7 @@ asmlinkage long sys32_rt_sigprocmask(int
+                                    compat_sigset_t __user *, unsigned int);
+ asmlinkage long sys32_alarm(unsigned int);
+-asmlinkage long sys32_waitpid(compat_pid_t, unsigned int *, int);
++asmlinkage long sys32_waitpid(compat_pid_t, unsigned int __user *, int);
+ asmlinkage long sys32_sysfs(int, u32, u32);
+ asmlinkage long sys32_sched_rr_get_interval(compat_pid_t,
+diff -urNp linux-3.1.3/arch/x86/include/asm/system.h linux-3.1.3/arch/x86/include/asm/system.h
+--- linux-3.1.3/arch/x86/include/asm/system.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/system.h  2011-11-16 18:39:07.000000000 -0500
 @@ -129,7 +129,7 @@ do {                                                                       \
             "call __switch_to\n\t"                                       \
             "movq "__percpu_arg([current_task])",%%rsi\n\t"              \
@@ -9033,9 +9196,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/system.h linux-3.0.4/arch/x86/includ
  
  /*
   * Force strict CPU ordering.
-diff -urNp linux-3.0.4/arch/x86/include/asm/thread_info.h linux-3.0.4/arch/x86/include/asm/thread_info.h
---- linux-3.0.4/arch/x86/include/asm/thread_info.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/thread_info.h     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/thread_info.h linux-3.1.3/arch/x86/include/asm/thread_info.h
+--- linux-3.1.3/arch/x86/include/asm/thread_info.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/thread_info.h     2011-11-16 18:39:07.000000000 -0500
 @@ -10,6 +10,7 @@
  #include <linux/compiler.h>
  #include <asm/page.h>
@@ -9045,7 +9208,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/thread_info.h linux-3.0.4/arch/x86/i
  /*
   * low level task data that entry.S needs immediate access to
 @@ -24,7 +25,6 @@ struct exec_domain;
- #include <asm/atomic.h>
+ #include <linux/atomic.h>
  
  struct thread_info {
 -      struct task_struct      *task;          /* main task structure */
@@ -9183,9 +9346,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/thread_info.h linux-3.0.4/arch/x86/i
 +
  #endif
  #endif /* _ASM_X86_THREAD_INFO_H */
-diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess_32.h linux-3.0.4/arch/x86/include/asm/uaccess_32.h
---- linux-3.0.4/arch/x86/include/asm/uaccess_32.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/uaccess_32.h      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_32.h linux-3.1.3/arch/x86/include/asm/uaccess_32.h
+--- linux-3.1.3/arch/x86/include/asm/uaccess_32.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/uaccess_32.h      2011-11-16 18:40:08.000000000 -0500
 @@ -43,6 +43,11 @@ unsigned long __must_check __copy_from_u
  static __always_inline unsigned long __must_check
  __copy_to_user_inatomic(void __user *to, const void *from, unsigned long n)
@@ -9353,9 +9516,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess_32.h linux-3.0.4/arch/x86/in
        return n;
  }
  
-diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess_64.h linux-3.0.4/arch/x86/include/asm/uaccess_64.h
---- linux-3.0.4/arch/x86/include/asm/uaccess_64.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/uaccess_64.h      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess_64.h linux-3.1.3/arch/x86/include/asm/uaccess_64.h
+--- linux-3.1.3/arch/x86/include/asm/uaccess_64.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/uaccess_64.h      2011-11-16 18:40:08.000000000 -0500
 @@ -10,6 +10,9 @@
  #include <asm/alternative.h>
  #include <asm/cpufeature.h>
@@ -9453,7 +9616,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess_64.h linux-3.0.4/arch/x86/in
 +                      src += PAX_USER_SHADOW_BASE;
 +#endif
 +
-+              return copy_user_generic(dst, (__force const void *)src, size);
++              return copy_user_generic(dst, (__force_kernel const void *)src, size);
 +      }
        switch (size) {
 -      case 1:__get_user_asm(*(u8 *)dst, (u8 __user *)src,
@@ -9502,7 +9665,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess_64.h linux-3.0.4/arch/x86/in
 +                      src += PAX_USER_SHADOW_BASE;
 +#endif
 +
-+              return copy_user_generic(dst, (__force const void *)src, size);
++              return copy_user_generic(dst, (__force_kernel const void *)src, size);
        }
  }
  
@@ -9516,6 +9679,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess_64.h linux-3.0.4/arch/x86/in
  
        might_fault();
 -      if (!__builtin_constant_p(size))
+-              return copy_user_generic((__force void *)dst, src, size);
 +
 +      pax_track_stack();
 +
@@ -9542,7 +9706,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess_64.h linux-3.0.4/arch/x86/in
 +                      dst += PAX_USER_SHADOW_BASE;
 +#endif
 +
-               return copy_user_generic((__force void *)dst, src, size);
++              return copy_user_generic((__force_kernel void *)dst, src, size);
 +      }
        switch (size) {
 -      case 1:__put_user_asm(*(u8 *)src, (u8 __user *)dst,
@@ -9584,13 +9748,14 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess_64.h linux-3.0.4/arch/x86/in
                               ret, "q", "", "er", 8);
                return ret;
        default:
+-              return copy_user_generic((__force void *)dst, src, size);
 +
 +#ifdef CONFIG_PAX_MEMORY_UDEREF
 +              if ((unsigned long)dst < PAX_USER_SHADOW_BASE)
 +                      dst += PAX_USER_SHADOW_BASE;
 +#endif
 +
-               return copy_user_generic((__force void *)dst, src, size);
++              return copy_user_generic((__force_kernel void *)dst, src, size);
        }
  }
  
@@ -9603,6 +9768,8 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess_64.h linux-3.0.4/arch/x86/in
  
        might_fault();
 -      if (!__builtin_constant_p(size))
+-              return copy_user_generic((__force void *)dst,
+-                                       (__force void *)src, size);
 +
 +      if ((int)size < 0)
 +              return size;
@@ -9623,9 +9790,8 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess_64.h linux-3.0.4/arch/x86/in
 +                      dst += PAX_USER_SHADOW_BASE;
 +#endif
 +
-               return copy_user_generic((__force void *)dst,
--                                       (__force void *)src, size);
-+                                       (__force const void *)src, size);
++              return copy_user_generic((__force_kernel void *)dst,
++                                       (__force_kernel const void *)src, size);
 +      }
        switch (size) {
        case 1: {
@@ -9666,6 +9832,8 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess_64.h linux-3.0.4/arch/x86/in
                return ret;
        }
        default:
+-              return copy_user_generic((__force void *)dst,
+-                                       (__force void *)src, size);
 +
 +#ifdef CONFIG_PAX_MEMORY_UDEREF
 +              if ((unsigned long)src < PAX_USER_SHADOW_BASE)
@@ -9674,9 +9842,8 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess_64.h linux-3.0.4/arch/x86/in
 +                      dst += PAX_USER_SHADOW_BASE;
 +#endif
 +
-               return copy_user_generic((__force void *)dst,
--                                       (__force void *)src, size);
-+                                       (__force const void *)src, size);
++              return copy_user_generic((__force_kernel void *)dst,
++                                       (__force_kernel const void *)src, size);
        }
  }
  
@@ -9684,6 +9851,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess_64.h linux-3.0.4/arch/x86/in
  static __must_check __always_inline int
  __copy_from_user_inatomic(void *dst, const void __user *src, unsigned size)
  {
+-      return copy_user_generic(dst, (__force const void *)src, size);
 +      pax_track_stack();
 +
 +      if ((int)size < 0)
@@ -9697,13 +9865,14 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess_64.h linux-3.0.4/arch/x86/in
 +              src += PAX_USER_SHADOW_BASE;
 +#endif
 +
-       return copy_user_generic(dst, (__force const void *)src, size);
++      return copy_user_generic(dst, (__force_kernel const void *)src, size);
  }
  
 -static __must_check __always_inline int
 +static __must_check __always_inline unsigned long
  __copy_to_user_inatomic(void __user *dst, const void *src, unsigned size)
  {
+-      return copy_user_generic((__force void *)dst, src, size);
 +      if ((int)size < 0)
 +              return size;
 +
@@ -9715,7 +9884,7 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess_64.h linux-3.0.4/arch/x86/in
 +              dst += PAX_USER_SHADOW_BASE;
 +#endif
 +
-       return copy_user_generic((__force void *)dst, src, size);
++      return copy_user_generic((__force_kernel void *)dst, src, size);
  }
  
 -extern long __copy_user_nocache(void *dst, const void __user *src,
@@ -9756,13 +9925,14 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess_64.h linux-3.0.4/arch/x86/in
  }
  
 -unsigned long
+-copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest);
 +extern unsigned long
- copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest);
++copy_user_handle_tail(char __user *to, char __user *from, unsigned len, unsigned zerorest);
  
  #endif /* _ASM_X86_UACCESS_64_H */
-diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess.h linux-3.0.4/arch/x86/include/asm/uaccess.h
---- linux-3.0.4/arch/x86/include/asm/uaccess.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/uaccess.h 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/uaccess.h linux-3.1.3/arch/x86/include/asm/uaccess.h
+--- linux-3.1.3/arch/x86/include/asm/uaccess.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/uaccess.h 2011-11-16 18:39:07.000000000 -0500
 @@ -7,12 +7,15 @@
  #include <linux/compiler.h>
  #include <linux/thread_info.h>
@@ -9862,6 +10032,15 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess.h linux-3.0.4/arch/x86/inclu
                     "3:\n"                                             \
                     _ASM_EXTABLE(1b, 2b - 1b)                          \
                     _ASM_EXTABLE(2b, 3b - 2b)                          \
+@@ -252,7 +294,7 @@ extern void __put_user_8(void);
+       __typeof__(*(ptr)) __pu_val;                            \
+       __chk_user_ptr(ptr);                                    \
+       might_fault();                                          \
+-      __pu_val = x;                                           \
++      __pu_val = (x);                                         \
+       switch (sizeof(*(ptr))) {                               \
+       case 1:                                                 \
+               __put_user_x(1, __pu_val, ptr, __ret_pu);       \
 @@ -373,7 +415,7 @@ do {                                                                       \
  } while (0)
  
@@ -9973,9 +10152,21 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/uaccess.h linux-3.0.4/arch/x86/inclu
  } while (0)
  
  #ifdef CONFIG_X86_WP_WORKS_OK
-diff -urNp linux-3.0.4/arch/x86/include/asm/x86_init.h linux-3.0.4/arch/x86/include/asm/x86_init.h
---- linux-3.0.4/arch/x86/include/asm/x86_init.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/x86_init.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/vdso.h linux-3.1.3/arch/x86/include/asm/vdso.h
+--- linux-3.1.3/arch/x86/include/asm/vdso.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/vdso.h    2011-11-16 18:39:07.000000000 -0500
+@@ -11,7 +11,7 @@ extern const char VDSO32_PRELINK[];
+ #define VDSO32_SYMBOL(base, name)                                     \
+ ({                                                                    \
+       extern const char VDSO32_##name[];                              \
+-      (void *)(VDSO32_##name - VDSO32_PRELINK + (unsigned long)(base)); \
++      (void __user *)(VDSO32_##name - VDSO32_PRELINK + (unsigned long)(base)); \
+ })
+ #endif
+diff -urNp linux-3.1.3/arch/x86/include/asm/x86_init.h linux-3.1.3/arch/x86/include/asm/x86_init.h
+--- linux-3.1.3/arch/x86/include/asm/x86_init.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/x86_init.h        2011-11-16 18:39:07.000000000 -0500
 @@ -28,7 +28,7 @@ struct x86_init_mpparse {
        void (*mpc_oem_bus_info)(struct mpc_bus *m, char *name);
        void (*find_smp_config)(void);
@@ -10093,9 +10284,9 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/x86_init.h linux-3.0.4/arch/x86/incl
  
  extern struct x86_init_ops x86_init;
  extern struct x86_cpuinit_ops x86_cpuinit;
-diff -urNp linux-3.0.4/arch/x86/include/asm/xsave.h linux-3.0.4/arch/x86/include/asm/xsave.h
---- linux-3.0.4/arch/x86/include/asm/xsave.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/include/asm/xsave.h   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/include/asm/xsave.h linux-3.1.3/arch/x86/include/asm/xsave.h
+--- linux-3.1.3/arch/x86/include/asm/xsave.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/include/asm/xsave.h   2011-11-16 18:39:07.000000000 -0500
 @@ -65,6 +65,11 @@ static inline int xsave_user(struct xsav
  {
        int err;
@@ -10108,7 +10299,12 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/xsave.h linux-3.0.4/arch/x86/include
        /*
         * Clear the xsave header first, so that reserved fields are
         * initialized to zero.
-@@ -100,6 +105,11 @@ static inline int xrestore_user(struct x
+@@ -96,10 +101,15 @@ static inline int xsave_user(struct xsav
+ static inline int xrestore_user(struct xsave_struct __user *buf, u64 mask)
+ {
+       int err;
+-      struct xsave_struct *xstate = ((__force struct xsave_struct *)buf);
++      struct xsave_struct *xstate = ((__force_kernel struct xsave_struct *)buf);
        u32 lmask = mask;
        u32 hmask = mask >> 32;
  
@@ -10120,10 +10316,10 @@ diff -urNp linux-3.0.4/arch/x86/include/asm/xsave.h linux-3.0.4/arch/x86/include
        __asm__ __volatile__("1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n"
                             "2:\n"
                             ".section .fixup,\"ax\"\n"
-diff -urNp linux-3.0.4/arch/x86/Kconfig linux-3.0.4/arch/x86/Kconfig
---- linux-3.0.4/arch/x86/Kconfig       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/Kconfig       2011-09-17 00:58:36.000000000 -0400
-@@ -229,7 +229,7 @@ config X86_HT
+diff -urNp linux-3.1.3/arch/x86/Kconfig linux-3.1.3/arch/x86/Kconfig
+--- linux-3.1.3/arch/x86/Kconfig       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/Kconfig       2011-11-16 18:40:08.000000000 -0500
+@@ -236,7 +236,7 @@ config X86_HT
  
  config X86_32_LAZY_GS
        def_bool y
@@ -10132,7 +10328,7 @@ diff -urNp linux-3.0.4/arch/x86/Kconfig linux-3.0.4/arch/x86/Kconfig
  
  config ARCH_HWEIGHT_CFLAGS
        string
-@@ -1018,7 +1018,7 @@ choice
+@@ -1019,7 +1019,7 @@ choice
  
  config NOHIGHMEM
        bool "off"
@@ -10141,7 +10337,7 @@ diff -urNp linux-3.0.4/arch/x86/Kconfig linux-3.0.4/arch/x86/Kconfig
        ---help---
          Linux can use up to 64 Gigabytes of physical memory on x86 systems.
          However, the address space of 32-bit x86 processors is only 4
-@@ -1055,7 +1055,7 @@ config NOHIGHMEM
+@@ -1056,7 +1056,7 @@ config NOHIGHMEM
  
  config HIGHMEM4G
        bool "4GB"
@@ -10150,7 +10346,7 @@ diff -urNp linux-3.0.4/arch/x86/Kconfig linux-3.0.4/arch/x86/Kconfig
        ---help---
          Select this if you have a 32-bit processor and between 1 and 4
          gigabytes of physical RAM.
-@@ -1109,7 +1109,7 @@ config PAGE_OFFSET
+@@ -1110,7 +1110,7 @@ config PAGE_OFFSET
        hex
        default 0xB0000000 if VMSPLIT_3G_OPT
        default 0x80000000 if VMSPLIT_2G
@@ -10159,7 +10355,7 @@ diff -urNp linux-3.0.4/arch/x86/Kconfig linux-3.0.4/arch/x86/Kconfig
        default 0x40000000 if VMSPLIT_1G
        default 0xC0000000
        depends on X86_32
-@@ -1483,6 +1483,7 @@ config SECCOMP
+@@ -1484,6 +1484,7 @@ config SECCOMP
  
  config CC_STACKPROTECTOR
        bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
@@ -10167,7 +10363,7 @@ diff -urNp linux-3.0.4/arch/x86/Kconfig linux-3.0.4/arch/x86/Kconfig
        ---help---
          This option turns on the -fstack-protector GCC feature. This
          feature puts, at the beginning of functions, a canary value on
-@@ -1540,6 +1541,7 @@ config KEXEC_JUMP
+@@ -1541,6 +1542,7 @@ config KEXEC_JUMP
  config PHYSICAL_START
        hex "Physical address where the kernel is loaded" if (EXPERT || CRASH_DUMP)
        default "0x1000000"
@@ -10175,7 +10371,7 @@ diff -urNp linux-3.0.4/arch/x86/Kconfig linux-3.0.4/arch/x86/Kconfig
        ---help---
          This gives the physical address where the kernel is loaded.
  
-@@ -1603,6 +1605,7 @@ config X86_NEED_RELOCS
+@@ -1604,6 +1606,7 @@ config X86_NEED_RELOCS
  config PHYSICAL_ALIGN
        hex "Alignment value to which kernel should be aligned" if X86_32
        default "0x1000000"
@@ -10183,7 +10379,7 @@ diff -urNp linux-3.0.4/arch/x86/Kconfig linux-3.0.4/arch/x86/Kconfig
        range 0x2000 0x1000000
        ---help---
          This value puts the alignment restrictions on physical address
-@@ -1634,9 +1637,10 @@ config HOTPLUG_CPU
+@@ -1635,9 +1638,10 @@ config HOTPLUG_CPU
          Say N if you want to disable CPU hotplug.
  
  config COMPAT_VDSO
@@ -10195,10 +10391,10 @@ diff -urNp linux-3.0.4/arch/x86/Kconfig linux-3.0.4/arch/x86/Kconfig
        ---help---
          Map the 32-bit VDSO to the predictable old-style address too.
  
-diff -urNp linux-3.0.4/arch/x86/Kconfig.cpu linux-3.0.4/arch/x86/Kconfig.cpu
---- linux-3.0.4/arch/x86/Kconfig.cpu   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/Kconfig.cpu   2011-08-23 21:47:55.000000000 -0400
-@@ -338,7 +338,7 @@ config X86_PPRO_FENCE
+diff -urNp linux-3.1.3/arch/x86/Kconfig.cpu linux-3.1.3/arch/x86/Kconfig.cpu
+--- linux-3.1.3/arch/x86/Kconfig.cpu   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/Kconfig.cpu   2011-11-16 18:39:07.000000000 -0500
+@@ -341,7 +341,7 @@ config X86_PPRO_FENCE
  
  config X86_F00F_BUG
        def_bool y
@@ -10207,7 +10403,7 @@ diff -urNp linux-3.0.4/arch/x86/Kconfig.cpu linux-3.0.4/arch/x86/Kconfig.cpu
  
  config X86_INVD_BUG
        def_bool y
-@@ -362,7 +362,7 @@ config X86_POPAD_OK
+@@ -365,7 +365,7 @@ config X86_POPAD_OK
  
  config X86_ALIGNMENT_16
        def_bool y
@@ -10216,7 +10412,7 @@ diff -urNp linux-3.0.4/arch/x86/Kconfig.cpu linux-3.0.4/arch/x86/Kconfig.cpu
  
  config X86_INTEL_USERCOPY
        def_bool y
-@@ -408,7 +408,7 @@ config X86_CMPXCHG64
+@@ -411,7 +411,7 @@ config X86_CMPXCHG64
  # generates cmov.
  config X86_CMOV
        def_bool y
@@ -10225,9 +10421,9 @@ diff -urNp linux-3.0.4/arch/x86/Kconfig.cpu linux-3.0.4/arch/x86/Kconfig.cpu
  
  config X86_MINIMUM_CPU_FAMILY
        int
-diff -urNp linux-3.0.4/arch/x86/Kconfig.debug linux-3.0.4/arch/x86/Kconfig.debug
---- linux-3.0.4/arch/x86/Kconfig.debug 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/Kconfig.debug 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/Kconfig.debug linux-3.1.3/arch/x86/Kconfig.debug
+--- linux-3.1.3/arch/x86/Kconfig.debug 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/Kconfig.debug 2011-11-16 18:39:07.000000000 -0500
 @@ -81,7 +81,7 @@ config X86_PTDUMP
  config DEBUG_RODATA
        bool "Write protect kernel read-only data structures"
@@ -10246,9 +10442,9 @@ diff -urNp linux-3.0.4/arch/x86/Kconfig.debug linux-3.0.4/arch/x86/Kconfig.debug
        ---help---
          This option helps catch unintended modifications to loadable
          kernel module's text and read-only data. It also prevents execution
-diff -urNp linux-3.0.4/arch/x86/kernel/acpi/realmode/Makefile linux-3.0.4/arch/x86/kernel/acpi/realmode/Makefile
---- linux-3.0.4/arch/x86/kernel/acpi/realmode/Makefile 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/acpi/realmode/Makefile 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/acpi/realmode/Makefile linux-3.1.3/arch/x86/kernel/acpi/realmode/Makefile
+--- linux-3.1.3/arch/x86/kernel/acpi/realmode/Makefile 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/acpi/realmode/Makefile 2011-11-16 18:39:07.000000000 -0500
 @@ -41,6 +41,9 @@ KBUILD_CFLAGS        := $(LINUXINCLUDE) -g -Os 
                   $(call cc-option, -fno-stack-protector) \
                   $(call cc-option, -mpreferred-stack-boundary=2)
@@ -10259,9 +10455,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/acpi/realmode/Makefile linux-3.0.4/arch/x
  KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
  GCOV_PROFILE := n
  
-diff -urNp linux-3.0.4/arch/x86/kernel/acpi/realmode/wakeup.S linux-3.0.4/arch/x86/kernel/acpi/realmode/wakeup.S
---- linux-3.0.4/arch/x86/kernel/acpi/realmode/wakeup.S 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/acpi/realmode/wakeup.S 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/acpi/realmode/wakeup.S linux-3.1.3/arch/x86/kernel/acpi/realmode/wakeup.S
+--- linux-3.1.3/arch/x86/kernel/acpi/realmode/wakeup.S 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/acpi/realmode/wakeup.S 2011-11-16 18:40:08.000000000 -0500
 @@ -108,6 +108,9 @@ wakeup_code:
        /* Do any other stuff... */
  
@@ -10280,9 +10476,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/acpi/realmode/wakeup.S linux-3.0.4/arch/x
  #else
        pushw   $0
        pushw   trampoline_segment
-diff -urNp linux-3.0.4/arch/x86/kernel/acpi/sleep.c linux-3.0.4/arch/x86/kernel/acpi/sleep.c
---- linux-3.0.4/arch/x86/kernel/acpi/sleep.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/acpi/sleep.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/acpi/sleep.c linux-3.1.3/arch/x86/kernel/acpi/sleep.c
+--- linux-3.1.3/arch/x86/kernel/acpi/sleep.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/acpi/sleep.c   2011-11-16 18:39:07.000000000 -0500
 @@ -94,8 +94,12 @@ int acpi_suspend_lowlevel(void)
        header->trampoline_segment = trampoline_address() >> 4;
  #ifdef CONFIG_SMP
@@ -10296,9 +10492,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/acpi/sleep.c linux-3.0.4/arch/x86/kernel/
        initial_gs = per_cpu_offset(smp_processor_id());
  #endif
        initial_code = (unsigned long)wakeup_long64;
-diff -urNp linux-3.0.4/arch/x86/kernel/acpi/wakeup_32.S linux-3.0.4/arch/x86/kernel/acpi/wakeup_32.S
---- linux-3.0.4/arch/x86/kernel/acpi/wakeup_32.S       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/acpi/wakeup_32.S       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/acpi/wakeup_32.S linux-3.1.3/arch/x86/kernel/acpi/wakeup_32.S
+--- linux-3.1.3/arch/x86/kernel/acpi/wakeup_32.S       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/acpi/wakeup_32.S       2011-11-16 18:39:07.000000000 -0500
 @@ -30,13 +30,11 @@ wakeup_pmode_return:
        # and restore the stack ... but you need gdt for this to work
        movl    saved_context_esp, %esp
@@ -10315,10 +10511,33 @@ diff -urNp linux-3.0.4/arch/x86/kernel/acpi/wakeup_32.S linux-3.0.4/arch/x86/ker
  
  bogus_magic:
        jmp     bogus_magic
-diff -urNp linux-3.0.4/arch/x86/kernel/alternative.c linux-3.0.4/arch/x86/kernel/alternative.c
---- linux-3.0.4/arch/x86/kernel/alternative.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/alternative.c  2011-08-23 21:47:55.000000000 -0400
-@@ -313,7 +313,7 @@ static void alternatives_smp_lock(const 
+diff -urNp linux-3.1.3/arch/x86/kernel/alternative.c linux-3.1.3/arch/x86/kernel/alternative.c
+--- linux-3.1.3/arch/x86/kernel/alternative.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/alternative.c  2011-11-16 18:39:07.000000000 -0500
+@@ -276,6 +276,13 @@ void __init_or_module apply_alternatives
+        */
+       for (a = start; a < end; a++) {
+               instr = (u8 *)&a->instr_offset + a->instr_offset;
++
++#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC)
++              instr += ____LOAD_PHYSICAL_ADDR - LOAD_PHYSICAL_ADDR;
++              if (instr < (u8 *)_text || (u8 *)_einittext <= instr)
++                      instr -= ____LOAD_PHYSICAL_ADDR - LOAD_PHYSICAL_ADDR;
++#endif
++
+               replacement = (u8 *)&a->repl_offset + a->repl_offset;
+               BUG_ON(a->replacementlen > a->instrlen);
+               BUG_ON(a->instrlen > sizeof(insnbuf));
+@@ -307,10 +314,16 @@ static void alternatives_smp_lock(const 
+       for (poff = start; poff < end; poff++) {
+               u8 *ptr = (u8 *)poff + *poff;
++#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC)
++              ptr += ____LOAD_PHYSICAL_ADDR - LOAD_PHYSICAL_ADDR;
++              if (ptr < (u8 *)_text || (u8 *)_einittext <= ptr)
++                      ptr -= ____LOAD_PHYSICAL_ADDR - LOAD_PHYSICAL_ADDR;
++#endif
++
                if (!*poff || ptr < text || ptr >= text_end)
                        continue;
                /* turn DS segment override prefix into lock prefix */
@@ -10327,7 +10546,16 @@ diff -urNp linux-3.0.4/arch/x86/kernel/alternative.c linux-3.0.4/arch/x86/kernel
                        text_poke(ptr, ((unsigned char []){0xf0}), 1);
        };
        mutex_unlock(&text_mutex);
-@@ -334,7 +334,7 @@ static void alternatives_smp_unlock(cons
+@@ -328,10 +341,16 @@ static void alternatives_smp_unlock(cons
+       for (poff = start; poff < end; poff++) {
+               u8 *ptr = (u8 *)poff + *poff;
++#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC)
++              ptr += ____LOAD_PHYSICAL_ADDR - LOAD_PHYSICAL_ADDR;
++              if (ptr < (u8 *)_text || (u8 *)_einittext <= ptr)
++                      ptr -= ____LOAD_PHYSICAL_ADDR - LOAD_PHYSICAL_ADDR;
++#endif
++
                if (!*poff || ptr < text || ptr >= text_end)
                        continue;
                /* turn lock prefix into DS segment override prefix */
@@ -10336,7 +10564,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/alternative.c linux-3.0.4/arch/x86/kernel
                        text_poke(ptr, ((unsigned char []){0x3E}), 1);
        };
        mutex_unlock(&text_mutex);
-@@ -503,7 +503,7 @@ void __init_or_module apply_paravirt(str
+@@ -500,7 +519,7 @@ void __init_or_module apply_paravirt(str
  
                BUG_ON(p->len > MAX_PATCH_LEN);
                /* prep the buffer with the original instructions */
@@ -10345,7 +10573,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/alternative.c linux-3.0.4/arch/x86/kernel
                used = pv_init_ops.patch(p->instrtype, p->clobbers, insnbuf,
                                         (unsigned long)p->instr, p->len);
  
-@@ -571,7 +571,7 @@ void __init alternative_instructions(voi
+@@ -568,7 +587,7 @@ void __init alternative_instructions(voi
        if (smp_alt_once)
                free_init_pages("SMP alternatives",
                                (unsigned long)__smp_locks,
@@ -10354,7 +10582,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/alternative.c linux-3.0.4/arch/x86/kernel
  
        restart_nmi();
  }
-@@ -588,13 +588,17 @@ void __init alternative_instructions(voi
+@@ -585,13 +604,17 @@ void __init alternative_instructions(voi
   * instructions. And on the local CPU you need to be protected again NMI or MCE
   * handlers seeing an inconsistent instruction while you patch.
   */
@@ -10374,7 +10602,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/alternative.c linux-3.0.4/arch/x86/kernel
        local_irq_restore(flags);
        /* Could also do a CLFLUSH here to speed up CPU recovery; but
           that causes hangs on some VIA CPUs. */
-@@ -616,36 +620,22 @@ void *__init_or_module text_poke_early(v
+@@ -613,36 +636,22 @@ void *__init_or_module text_poke_early(v
   */
  void *__kprobes text_poke(void *addr, const void *opcode, size_t len)
  {
@@ -10419,10 +10647,10 @@ diff -urNp linux-3.0.4/arch/x86/kernel/alternative.c linux-3.0.4/arch/x86/kernel
        return addr;
  }
  
-diff -urNp linux-3.0.4/arch/x86/kernel/apic/apic.c linux-3.0.4/arch/x86/kernel/apic/apic.c
---- linux-3.0.4/arch/x86/kernel/apic/apic.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/apic/apic.c    2011-08-23 21:48:14.000000000 -0400
-@@ -173,7 +173,7 @@ int first_system_vector = 0xfe;
+diff -urNp linux-3.1.3/arch/x86/kernel/apic/apic.c linux-3.1.3/arch/x86/kernel/apic/apic.c
+--- linux-3.1.3/arch/x86/kernel/apic/apic.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/apic/apic.c    2011-11-16 18:40:08.000000000 -0500
+@@ -174,7 +174,7 @@ int first_system_vector = 0xfe;
  /*
   * Debug level, exported for io_apic.c
   */
@@ -10431,7 +10659,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/apic/apic.c linux-3.0.4/arch/x86/kernel/a
  
  int pic_mode;
  
-@@ -1834,7 +1834,7 @@ void smp_error_interrupt(struct pt_regs 
+@@ -1835,7 +1835,7 @@ void smp_error_interrupt(struct pt_regs 
        apic_write(APIC_ESR, 0);
        v1 = apic_read(APIC_ESR);
        ack_APIC_irq();
@@ -10440,7 +10668,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/apic/apic.c linux-3.0.4/arch/x86/kernel/a
  
        apic_printk(APIC_DEBUG, KERN_DEBUG "APIC error on CPU%d: %02x(%02x)",
                    smp_processor_id(), v0 , v1);
-@@ -2190,6 +2190,8 @@ static int __cpuinit apic_cluster_num(vo
+@@ -2209,6 +2209,8 @@ static int __cpuinit apic_cluster_num(vo
        u16 *bios_cpu_apicid;
        DECLARE_BITMAP(clustermap, NUM_APIC_CLUSTERS);
  
@@ -10449,9 +10677,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/apic/apic.c linux-3.0.4/arch/x86/kernel/a
        bios_cpu_apicid = early_per_cpu_ptr(x86_bios_cpu_apicid);
        bitmap_zero(clustermap, NUM_APIC_CLUSTERS);
  
-diff -urNp linux-3.0.4/arch/x86/kernel/apic/io_apic.c linux-3.0.4/arch/x86/kernel/apic/io_apic.c
---- linux-3.0.4/arch/x86/kernel/apic/io_apic.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/apic/io_apic.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/apic/io_apic.c linux-3.1.3/arch/x86/kernel/apic/io_apic.c
+--- linux-3.1.3/arch/x86/kernel/apic/io_apic.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/apic/io_apic.c 2011-11-16 18:39:07.000000000 -0500
 @@ -1028,7 +1028,7 @@ int IO_APIC_get_PCI_irq_vector(int bus, 
  }
  EXPORT_SYMBOL(IO_APIC_get_PCI_irq_vector);
@@ -10470,7 +10698,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/apic/io_apic.c linux-3.0.4/arch/x86/kerne
  {
        raw_spin_unlock(&vector_lock);
  }
-@@ -2364,7 +2364,7 @@ static void ack_apic_edge(struct irq_dat
+@@ -2405,7 +2405,7 @@ static void ack_apic_edge(struct irq_dat
        ack_APIC_irq();
  }
  
@@ -10479,7 +10707,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/apic/io_apic.c linux-3.0.4/arch/x86/kerne
  
  /*
   * IO-APIC versions below 0x20 don't support EOI register.
-@@ -2472,7 +2472,7 @@ static void ack_apic_level(struct irq_da
+@@ -2513,7 +2513,7 @@ static void ack_apic_level(struct irq_da
         * at the cpu.
         */
        if (!(v & (1 << (i & 0x1f)))) {
@@ -10488,9 +10716,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/apic/io_apic.c linux-3.0.4/arch/x86/kerne
  
                eoi_ioapic_irq(irq, cfg);
        }
-diff -urNp linux-3.0.4/arch/x86/kernel/apm_32.c linux-3.0.4/arch/x86/kernel/apm_32.c
---- linux-3.0.4/arch/x86/kernel/apm_32.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/apm_32.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/apm_32.c linux-3.1.3/arch/x86/kernel/apm_32.c
+--- linux-3.1.3/arch/x86/kernel/apm_32.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/apm_32.c       2011-11-16 18:39:07.000000000 -0500
 @@ -413,7 +413,7 @@ static DEFINE_MUTEX(apm_mutex);
   * This is for buggy BIOS's that refer to (real mode) segment 0x40
   * even though they are called in protected mode.
@@ -10562,9 +10790,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/apm_32.c linux-3.0.4/arch/x86/kernel/apm_
  
        proc_create("apm", 0, NULL, &apm_file_ops);
  
-diff -urNp linux-3.0.4/arch/x86/kernel/asm-offsets_64.c linux-3.0.4/arch/x86/kernel/asm-offsets_64.c
---- linux-3.0.4/arch/x86/kernel/asm-offsets_64.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/asm-offsets_64.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/asm-offsets_64.c linux-3.1.3/arch/x86/kernel/asm-offsets_64.c
+--- linux-3.1.3/arch/x86/kernel/asm-offsets_64.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/asm-offsets_64.c       2011-11-16 18:39:07.000000000 -0500
 @@ -69,6 +69,7 @@ int main(void)
        BLANK();
  #undef ENTRY
@@ -10573,9 +10801,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/asm-offsets_64.c linux-3.0.4/arch/x86/ker
        OFFSET(TSS_ist, tss_struct, x86_tss.ist);
        BLANK();
  
-diff -urNp linux-3.0.4/arch/x86/kernel/asm-offsets.c linux-3.0.4/arch/x86/kernel/asm-offsets.c
---- linux-3.0.4/arch/x86/kernel/asm-offsets.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/asm-offsets.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/asm-offsets.c linux-3.1.3/arch/x86/kernel/asm-offsets.c
+--- linux-3.1.3/arch/x86/kernel/asm-offsets.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/asm-offsets.c  2011-11-16 18:39:07.000000000 -0500
 @@ -33,6 +33,8 @@ void common(void) {
        OFFSET(TI_status, thread_info, status);
        OFFSET(TI_addr_limit, thread_info, addr_limit);
@@ -10612,9 +10840,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/asm-offsets.c linux-3.0.4/arch/x86/kernel
  #ifdef CONFIG_XEN
        BLANK();
        OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
-diff -urNp linux-3.0.4/arch/x86/kernel/cpu/amd.c linux-3.0.4/arch/x86/kernel/cpu/amd.c
---- linux-3.0.4/arch/x86/kernel/cpu/amd.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/cpu/amd.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/cpu/amd.c linux-3.1.3/arch/x86/kernel/cpu/amd.c
+--- linux-3.1.3/arch/x86/kernel/cpu/amd.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/cpu/amd.c      2011-11-16 18:39:07.000000000 -0500
 @@ -647,7 +647,7 @@ static unsigned int __cpuinit amd_size_c
                                                        unsigned int size)
  {
@@ -10624,9 +10852,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/cpu/amd.c linux-3.0.4/arch/x86/kernel/cpu
                /* Duron Rev A0 */
                if (c->x86_model == 3 && c->x86_mask == 0)
                        size = 64;
-diff -urNp linux-3.0.4/arch/x86/kernel/cpu/common.c linux-3.0.4/arch/x86/kernel/cpu/common.c
---- linux-3.0.4/arch/x86/kernel/cpu/common.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/cpu/common.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/cpu/common.c linux-3.1.3/arch/x86/kernel/cpu/common.c
+--- linux-3.1.3/arch/x86/kernel/cpu/common.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/cpu/common.c   2011-11-16 18:39:07.000000000 -0500
 @@ -83,60 +83,6 @@ static const struct cpu_dev __cpuinitcon
  
  static const struct cpu_dev *this_cpu __cpuinitdata = &default_cpu;
@@ -10771,9 +10999,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/cpu/common.c linux-3.0.4/arch/x86/kernel/
        struct thread_struct *thread = &curr->thread;
  
        if (cpumask_test_and_set_cpu(cpu, cpu_initialized_mask)) {
-diff -urNp linux-3.0.4/arch/x86/kernel/cpu/intel.c linux-3.0.4/arch/x86/kernel/cpu/intel.c
---- linux-3.0.4/arch/x86/kernel/cpu/intel.c    2011-09-02 18:11:26.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/cpu/intel.c    2011-08-29 23:30:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/cpu/intel.c linux-3.1.3/arch/x86/kernel/cpu/intel.c
+--- linux-3.1.3/arch/x86/kernel/cpu/intel.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/cpu/intel.c    2011-11-16 18:39:07.000000000 -0500
 @@ -172,7 +172,7 @@ static void __cpuinit trap_init_f00f_bug
         * Update the IDT descriptor and reload the IDT so that
         * it uses the read-only mapped virtual address.
@@ -10783,9 +11011,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/cpu/intel.c linux-3.0.4/arch/x86/kernel/c
        load_idt(&idt_descr);
  }
  #endif
-diff -urNp linux-3.0.4/arch/x86/kernel/cpu/Makefile linux-3.0.4/arch/x86/kernel/cpu/Makefile
---- linux-3.0.4/arch/x86/kernel/cpu/Makefile   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/cpu/Makefile   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/cpu/Makefile linux-3.1.3/arch/x86/kernel/cpu/Makefile
+--- linux-3.1.3/arch/x86/kernel/cpu/Makefile   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/cpu/Makefile   2011-11-16 18:39:07.000000000 -0500
 @@ -8,10 +8,6 @@ CFLAGS_REMOVE_common.o = -pg
  CFLAGS_REMOVE_perf_event.o = -pg
  endif
@@ -10797,18 +11025,18 @@ diff -urNp linux-3.0.4/arch/x86/kernel/cpu/Makefile linux-3.0.4/arch/x86/kernel/
  obj-y                 := intel_cacheinfo.o scattered.o topology.o
  obj-y                 += proc.o capflags.o powerflags.o common.o
  obj-y                 += vmware.o hypervisor.o sched.o mshyperv.o
-diff -urNp linux-3.0.4/arch/x86/kernel/cpu/mcheck/mce.c linux-3.0.4/arch/x86/kernel/cpu/mcheck/mce.c
---- linux-3.0.4/arch/x86/kernel/cpu/mcheck/mce.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/cpu/mcheck/mce.c       2011-08-23 21:47:55.000000000 -0400
-@@ -46,6 +46,7 @@
- #include <asm/ipi.h>
+diff -urNp linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce.c linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce.c
+--- linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce.c       2011-11-16 18:39:07.000000000 -0500
+@@ -42,6 +42,7 @@
+ #include <asm/processor.h>
  #include <asm/mce.h>
  #include <asm/msr.h>
 +#include <asm/local.h>
  
  #include "mce-internal.h"
  
-@@ -208,7 +209,7 @@ static void print_mce(struct mce *m)
+@@ -205,7 +206,7 @@ static void print_mce(struct mce *m)
                        !(m->mcgstatus & MCG_STATUS_EIPV) ? " !INEXACT!" : "",
                                m->cs, m->ip);
  
@@ -10817,7 +11045,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/cpu/mcheck/mce.c linux-3.0.4/arch/x86/ker
                        print_symbol("{%s}", m->ip);
                pr_cont("\n");
        }
-@@ -236,10 +237,10 @@ static void print_mce(struct mce *m)
+@@ -233,10 +234,10 @@ static void print_mce(struct mce *m)
  
  #define PANIC_TIMEOUT 5 /* 5 seconds */
  
@@ -10830,7 +11058,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/cpu/mcheck/mce.c linux-3.0.4/arch/x86/ker
  
  /* Panic in progress. Enable interrupts and wait for final IPI */
  static void wait_for_panic(void)
-@@ -263,7 +264,7 @@ static void mce_panic(char *msg, struct 
+@@ -260,7 +261,7 @@ static void mce_panic(char *msg, struct 
                /*
                 * Make sure only one CPU runs in machine check panic
                 */
@@ -10839,7 +11067,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/cpu/mcheck/mce.c linux-3.0.4/arch/x86/ker
                        wait_for_panic();
                barrier();
  
-@@ -271,7 +272,7 @@ static void mce_panic(char *msg, struct 
+@@ -268,7 +269,7 @@ static void mce_panic(char *msg, struct 
                console_verbose();
        } else {
                /* Don't log too much for fake panic */
@@ -10848,7 +11076,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/cpu/mcheck/mce.c linux-3.0.4/arch/x86/ker
                        return;
        }
        /* First print corrected ones that are still unlogged */
-@@ -638,7 +639,7 @@ static int mce_timed_out(u64 *t)
+@@ -610,7 +611,7 @@ static int mce_timed_out(u64 *t)
         * might have been modified by someone else.
         */
        rmb();
@@ -10857,42 +11085,43 @@ diff -urNp linux-3.0.4/arch/x86/kernel/cpu/mcheck/mce.c linux-3.0.4/arch/x86/ker
                wait_for_panic();
        if (!monarch_timeout)
                goto out;
-@@ -1452,14 +1453,14 @@ void __cpuinit mcheck_cpu_init(struct cp
+@@ -1429,7 +1430,7 @@ void __cpuinit mcheck_cpu_init(struct cp
   */
  
- static DEFINE_SPINLOCK(mce_state_lock);
--static int            open_count;             /* #times opened */
-+static local_t                open_count;             /* #times opened */
- static int            open_exclu;             /* already open exclusive? */
+ static DEFINE_SPINLOCK(mce_chrdev_state_lock);
+-static int mce_chrdev_open_count;     /* #times opened */
++static local_t mce_chrdev_open_count; /* #times opened */
+ static int mce_chrdev_open_exclu;     /* already open exclusive? */
  
- static int mce_open(struct inode *inode, struct file *file)
- {
-       spin_lock(&mce_state_lock);
+ static int mce_chrdev_open(struct inode *inode, struct file *file)
+@@ -1437,7 +1438,7 @@ static int mce_chrdev_open(struct inode 
+       spin_lock(&mce_chrdev_state_lock);
  
--      if (open_exclu || (open_count && (file->f_flags & O_EXCL))) {
-+      if (open_exclu || (local_read(&open_count) && (file->f_flags & O_EXCL))) {
-               spin_unlock(&mce_state_lock);
+       if (mce_chrdev_open_exclu ||
+-          (mce_chrdev_open_count && (file->f_flags & O_EXCL))) {
++          (local_read(&mce_chrdev_open_count) && (file->f_flags & O_EXCL))) {
+               spin_unlock(&mce_chrdev_state_lock);
  
                return -EBUSY;
-@@ -1467,7 +1468,7 @@ static int mce_open(struct inode *inode,
+@@ -1445,7 +1446,7 @@ static int mce_chrdev_open(struct inode 
  
        if (file->f_flags & O_EXCL)
-               open_exclu = 1;
--      open_count++;
-+      local_inc(&open_count);
+               mce_chrdev_open_exclu = 1;
+-      mce_chrdev_open_count++;
++      local_inc(&mce_chrdev_open_count);
  
-       spin_unlock(&mce_state_lock);
+       spin_unlock(&mce_chrdev_state_lock);
  
-@@ -1478,7 +1479,7 @@ static int mce_release(struct inode *ino
+@@ -1456,7 +1457,7 @@ static int mce_chrdev_release(struct ino
  {
-       spin_lock(&mce_state_lock);
+       spin_lock(&mce_chrdev_state_lock);
  
--      open_count--;
-+      local_dec(&open_count);
-       open_exclu = 0;
+-      mce_chrdev_open_count--;
++      local_dec(&mce_chrdev_open_count);
+       mce_chrdev_open_exclu = 0;
  
-       spin_unlock(&mce_state_lock);
-@@ -2163,7 +2164,7 @@ struct dentry *mce_get_debugfs_dir(void)
+       spin_unlock(&mce_chrdev_state_lock);
+@@ -2147,7 +2148,7 @@ struct dentry *mce_get_debugfs_dir(void)
  static void mce_reset(void)
  {
        cpu_missing = 0;
@@ -10901,9 +11130,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/cpu/mcheck/mce.c linux-3.0.4/arch/x86/ker
        atomic_set(&mce_executing, 0);
        atomic_set(&mce_callin, 0);
        atomic_set(&global_nwo, 0);
-diff -urNp linux-3.0.4/arch/x86/kernel/cpu/mcheck/mce-inject.c linux-3.0.4/arch/x86/kernel/cpu/mcheck/mce-inject.c
---- linux-3.0.4/arch/x86/kernel/cpu/mcheck/mce-inject.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/cpu/mcheck/mce-inject.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce-inject.c linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce-inject.c
+--- linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce-inject.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/cpu/mcheck/mce-inject.c        2011-11-16 18:39:07.000000000 -0500
 @@ -215,7 +215,9 @@ static int inject_init(void)
        if (!alloc_cpumask_var(&mce_inject_cpumask, GFP_KERNEL))
                return -ENOMEM;
@@ -10915,9 +11144,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/cpu/mcheck/mce-inject.c linux-3.0.4/arch/
        register_die_notifier(&mce_raise_nb);
        return 0;
  }
-diff -urNp linux-3.0.4/arch/x86/kernel/cpu/mtrr/main.c linux-3.0.4/arch/x86/kernel/cpu/mtrr/main.c
---- linux-3.0.4/arch/x86/kernel/cpu/mtrr/main.c        2011-09-02 18:11:26.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/cpu/mtrr/main.c        2011-08-29 23:26:21.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/cpu/mtrr/main.c linux-3.1.3/arch/x86/kernel/cpu/mtrr/main.c
+--- linux-3.1.3/arch/x86/kernel/cpu/mtrr/main.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/cpu/mtrr/main.c        2011-11-16 18:39:07.000000000 -0500
 @@ -62,7 +62,7 @@ static DEFINE_MUTEX(mtrr_mutex);
  u64 size_or_mask, size_and_mask;
  static bool mtrr_aps_delayed_init;
@@ -10927,9 +11156,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/cpu/mtrr/main.c linux-3.0.4/arch/x86/kern
  
  const struct mtrr_ops *mtrr_if;
  
-diff -urNp linux-3.0.4/arch/x86/kernel/cpu/mtrr/mtrr.h linux-3.0.4/arch/x86/kernel/cpu/mtrr/mtrr.h
---- linux-3.0.4/arch/x86/kernel/cpu/mtrr/mtrr.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/cpu/mtrr/mtrr.h        2011-08-26 19:49:56.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/cpu/mtrr/mtrr.h linux-3.1.3/arch/x86/kernel/cpu/mtrr/mtrr.h
+--- linux-3.1.3/arch/x86/kernel/cpu/mtrr/mtrr.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/cpu/mtrr/mtrr.h        2011-11-16 18:39:07.000000000 -0500
 @@ -25,7 +25,7 @@ struct mtrr_ops {
        int     (*validate_add_page)(unsigned long base, unsigned long size,
                                     unsigned int type);
@@ -10939,10 +11168,10 @@ diff -urNp linux-3.0.4/arch/x86/kernel/cpu/mtrr/mtrr.h linux-3.0.4/arch/x86/kern
  
  extern int generic_get_free_region(unsigned long base, unsigned long size,
                                   int replace_reg);
-diff -urNp linux-3.0.4/arch/x86/kernel/cpu/perf_event.c linux-3.0.4/arch/x86/kernel/cpu/perf_event.c
---- linux-3.0.4/arch/x86/kernel/cpu/perf_event.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/cpu/perf_event.c       2011-08-23 21:48:14.000000000 -0400
-@@ -781,6 +781,8 @@ static int x86_schedule_events(struct cp
+diff -urNp linux-3.1.3/arch/x86/kernel/cpu/perf_event.c linux-3.1.3/arch/x86/kernel/cpu/perf_event.c
+--- linux-3.1.3/arch/x86/kernel/cpu/perf_event.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/cpu/perf_event.c       2011-11-16 18:40:08.000000000 -0500
+@@ -795,6 +795,8 @@ static int x86_schedule_events(struct cp
        int i, j, w, wmax, num = 0;
        struct hw_perf_event *hwc;
  
@@ -10951,18 +11180,18 @@ diff -urNp linux-3.0.4/arch/x86/kernel/cpu/perf_event.c linux-3.0.4/arch/x86/ker
        bitmap_zero(used_mask, X86_PMC_IDX_MAX);
  
        for (i = 0; i < n; i++) {
-@@ -1872,7 +1874,7 @@ perf_callchain_user(struct perf_callchai
+@@ -1919,7 +1921,7 @@ perf_callchain_user(struct perf_callchai
                        break;
  
                perf_callchain_store(entry, frame.return_address);
 -              fp = frame.next_frame;
-+              fp = (__force const void __user *)frame.next_frame;
++              fp = (const void __force_user *)frame.next_frame;
        }
  }
  
-diff -urNp linux-3.0.4/arch/x86/kernel/crash.c linux-3.0.4/arch/x86/kernel/crash.c
---- linux-3.0.4/arch/x86/kernel/crash.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/crash.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/crash.c linux-3.1.3/arch/x86/kernel/crash.c
+--- linux-3.1.3/arch/x86/kernel/crash.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/crash.c        2011-11-16 18:39:07.000000000 -0500
 @@ -42,7 +42,7 @@ static void kdump_nmi_callback(int cpu, 
        regs = args->regs;
  
@@ -10972,9 +11201,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/crash.c linux-3.0.4/arch/x86/kernel/crash
                crash_fixup_ss_esp(&fixed_regs, regs);
                regs = &fixed_regs;
        }
-diff -urNp linux-3.0.4/arch/x86/kernel/doublefault_32.c linux-3.0.4/arch/x86/kernel/doublefault_32.c
---- linux-3.0.4/arch/x86/kernel/doublefault_32.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/doublefault_32.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/doublefault_32.c linux-3.1.3/arch/x86/kernel/doublefault_32.c
+--- linux-3.1.3/arch/x86/kernel/doublefault_32.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/doublefault_32.c       2011-11-16 18:39:07.000000000 -0500
 @@ -11,7 +11,7 @@
  
  #define DOUBLEFAULT_STACKSIZE (1024)
@@ -11006,9 +11235,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/doublefault_32.c linux-3.0.4/arch/x86/ker
                .fs             = __KERNEL_PERCPU,
  
                .__cr3          = __pa_nodebug(swapper_pg_dir),
-diff -urNp linux-3.0.4/arch/x86/kernel/dumpstack_32.c linux-3.0.4/arch/x86/kernel/dumpstack_32.c
---- linux-3.0.4/arch/x86/kernel/dumpstack_32.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/dumpstack_32.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/dumpstack_32.c linux-3.1.3/arch/x86/kernel/dumpstack_32.c
+--- linux-3.1.3/arch/x86/kernel/dumpstack_32.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/dumpstack_32.c 2011-11-16 18:39:07.000000000 -0500
 @@ -38,15 +38,13 @@ void dump_trace(struct task_struct *task
                bp = stack_frame(task, regs);
  
@@ -11072,10 +11301,26 @@ diff -urNp linux-3.0.4/arch/x86/kernel/dumpstack_32.c linux-3.0.4/arch/x86/kerne
        if (ip < PAGE_OFFSET)
                return 0;
        if (probe_kernel_address((unsigned short *)ip, ud2))
-diff -urNp linux-3.0.4/arch/x86/kernel/dumpstack_64.c linux-3.0.4/arch/x86/kernel/dumpstack_64.c
---- linux-3.0.4/arch/x86/kernel/dumpstack_64.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/dumpstack_64.c 2011-08-23 21:47:55.000000000 -0400
-@@ -147,9 +147,9 @@ void dump_trace(struct task_struct *task
+@@ -139,3 +139,15 @@ int is_valid_bugaddr(unsigned long ip)
+       return ud2 == 0x0b0f;
+ }
++
++#ifdef CONFIG_PAX_MEMORY_STACKLEAK
++void pax_check_alloca(unsigned long size)
++{
++      unsigned long sp = (unsigned long)&sp, stack_left;
++
++      /* all kernel stacks are of the same size */
++      stack_left = sp & (THREAD_SIZE - 1);
++      BUG_ON(stack_left < 256 || size >= stack_left - 256);
++}
++EXPORT_SYMBOL(pax_check_alloca);
++#endif
+diff -urNp linux-3.1.3/arch/x86/kernel/dumpstack_64.c linux-3.1.3/arch/x86/kernel/dumpstack_64.c
+--- linux-3.1.3/arch/x86/kernel/dumpstack_64.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/dumpstack_64.c 2011-11-16 18:39:07.000000000 -0500
+@@ -119,9 +119,9 @@ void dump_trace(struct task_struct *task
        unsigned long *irq_stack_end =
                (unsigned long *)per_cpu(irq_stack_ptr, cpu);
        unsigned used = 0;
@@ -11086,7 +11331,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/dumpstack_64.c linux-3.0.4/arch/x86/kerne
  
        if (!task)
                task = current;
-@@ -167,10 +167,10 @@ void dump_trace(struct task_struct *task
+@@ -142,10 +142,10 @@ void dump_trace(struct task_struct *task
         * current stack address. If the stacks consist of nested
         * exceptions
         */
@@ -11098,7 +11343,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/dumpstack_64.c linux-3.0.4/arch/x86/kerne
                estack_end = in_exception_stack(cpu, (unsigned long)stack,
                                                &used, &id);
  
-@@ -178,7 +178,7 @@ void dump_trace(struct task_struct *task
+@@ -153,7 +153,7 @@ void dump_trace(struct task_struct *task
                        if (ops->stack(data, id) < 0)
                                break;
  
@@ -11107,7 +11352,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/dumpstack_64.c linux-3.0.4/arch/x86/kerne
                                             data, estack_end, &graph);
                        ops->stack(data, "<EOE>");
                        /*
-@@ -197,7 +197,7 @@ void dump_trace(struct task_struct *task
+@@ -172,7 +172,7 @@ void dump_trace(struct task_struct *task
                        if (in_irq_stack(stack, irq_stack, irq_stack_end)) {
                                if (ops->stack(data, "IRQ") < 0)
                                        break;
@@ -11116,7 +11361,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/dumpstack_64.c linux-3.0.4/arch/x86/kerne
                                        ops, data, irq_stack_end, &graph);
                                /*
                                 * We link to the next stack (which would be
-@@ -218,7 +218,8 @@ void dump_trace(struct task_struct *task
+@@ -191,7 +191,8 @@ void dump_trace(struct task_struct *task
        /*
         * This handles the process stack:
         */
@@ -11126,9 +11371,60 @@ diff -urNp linux-3.0.4/arch/x86/kernel/dumpstack_64.c linux-3.0.4/arch/x86/kerne
        put_cpu();
  }
  EXPORT_SYMBOL(dump_trace);
-diff -urNp linux-3.0.4/arch/x86/kernel/dumpstack.c linux-3.0.4/arch/x86/kernel/dumpstack.c
---- linux-3.0.4/arch/x86/kernel/dumpstack.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/dumpstack.c    2011-08-23 21:48:14.000000000 -0400
+@@ -305,3 +306,50 @@ int is_valid_bugaddr(unsigned long ip)
+       return ud2 == 0x0b0f;
+ }
++
++#ifdef CONFIG_PAX_MEMORY_STACKLEAK
++void pax_check_alloca(unsigned long size)
++{
++      unsigned long sp = (unsigned long)&sp, stack_start, stack_end;
++      unsigned cpu, used;
++      char *id;
++
++      /* check the process stack first */
++      stack_start = (unsigned long)task_stack_page(current);
++      stack_end = stack_start + THREAD_SIZE;
++      if (likely(stack_start <= sp && sp < stack_end)) {
++              unsigned long stack_left = sp & (THREAD_SIZE - 1);
++              BUG_ON(stack_left < 256 || size >= stack_left - 256);
++              return;
++      }
++
++      cpu = get_cpu();
++
++      /* check the irq stacks */
++      stack_end = (unsigned long)per_cpu(irq_stack_ptr, cpu);
++      stack_start = stack_end - IRQ_STACK_SIZE;
++      if (stack_start <= sp && sp < stack_end) {
++              unsigned long stack_left = sp & (IRQ_STACK_SIZE - 1);
++              put_cpu();
++              BUG_ON(stack_left < 256 || size >= stack_left - 256);
++              return;
++      }
++
++      /* check the exception stacks */
++      used = 0;
++      stack_end = (unsigned long)in_exception_stack(cpu, sp, &used, &id);
++      stack_start = stack_end - EXCEPTION_STKSZ;
++      if (stack_end && stack_start <= sp && sp < stack_end) {
++              unsigned long stack_left = sp & (EXCEPTION_STKSZ - 1);
++              put_cpu();
++              BUG_ON(stack_left < 256 || size >= stack_left - 256);
++              return;
++      }
++
++      put_cpu();
++
++      /* unknown stack */
++      BUG();
++}
++EXPORT_SYMBOL(pax_check_alloca);
++#endif
+diff -urNp linux-3.1.3/arch/x86/kernel/dumpstack.c linux-3.1.3/arch/x86/kernel/dumpstack.c
+--- linux-3.1.3/arch/x86/kernel/dumpstack.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/dumpstack.c    2011-11-16 18:40:08.000000000 -0500
 @@ -2,6 +2,9 @@
   *  Copyright (C) 1991, 1992  Linus Torvalds
   *  Copyright (C) 2000, 2001, 2002 Andi Kleen, SuSE Labs
@@ -11272,9 +11568,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/dumpstack.c linux-3.0.4/arch/x86/kernel/d
                report_bug(regs->ip, regs);
  
        if (__die(str, regs, err))
-diff -urNp linux-3.0.4/arch/x86/kernel/early_printk.c linux-3.0.4/arch/x86/kernel/early_printk.c
---- linux-3.0.4/arch/x86/kernel/early_printk.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/early_printk.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/early_printk.c linux-3.1.3/arch/x86/kernel/early_printk.c
+--- linux-3.1.3/arch/x86/kernel/early_printk.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/early_printk.c 2011-11-16 18:40:08.000000000 -0500
 @@ -7,6 +7,7 @@
  #include <linux/pci_regs.h>
  #include <linux/pci_ids.h>
@@ -11292,10 +11588,10 @@ diff -urNp linux-3.0.4/arch/x86/kernel/early_printk.c linux-3.0.4/arch/x86/kerne
        va_start(ap, fmt);
        n = vscnprintf(buf, sizeof(buf), fmt, ap);
        early_console->write(early_console, buf, n);
-diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/entry_32.S
---- linux-3.0.4/arch/x86/kernel/entry_32.S     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/entry_32.S     2011-08-30 18:23:52.000000000 -0400
-@@ -185,13 +185,146 @@
+diff -urNp linux-3.1.3/arch/x86/kernel/entry_32.S linux-3.1.3/arch/x86/kernel/entry_32.S
+--- linux-3.1.3/arch/x86/kernel/entry_32.S     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/entry_32.S     2011-11-16 18:40:08.000000000 -0500
+@@ -186,13 +186,146 @@
        /*CFI_REL_OFFSET gs, PT_GS*/
  .endm
  .macro SET_KERNEL_GS reg
@@ -11443,7 +11739,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
        cld
        PUSH_GS
        pushl_cfi %fs
-@@ -214,7 +347,7 @@
+@@ -215,7 +348,7 @@
        CFI_REL_OFFSET ecx, 0
        pushl_cfi %ebx
        CFI_REL_OFFSET ebx, 0
@@ -11452,7 +11748,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
        movl %edx, %ds
        movl %edx, %es
        movl $(__KERNEL_PERCPU), %edx
-@@ -222,6 +355,15 @@
+@@ -223,6 +356,15 @@
        SET_KERNEL_GS %edx
  .endm
  
@@ -11468,7 +11764,16 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
  .macro RESTORE_INT_REGS
        popl_cfi %ebx
        CFI_RESTORE ebx
-@@ -332,7 +474,15 @@ check_userspace:
+@@ -308,7 +450,7 @@ ENTRY(ret_from_fork)
+       popfl_cfi
+       jmp syscall_exit
+       CFI_ENDPROC
+-END(ret_from_fork)
++ENDPROC(ret_from_fork)
+ /*
+  * Interrupt exit functions should be protected against kprobes
+@@ -333,7 +475,15 @@ check_userspace:
        movb PT_CS(%esp), %al
        andl $(X86_EFLAGS_VM | SEGMENT_RPL_MASK), %eax
        cmpl $USER_RPL, %eax
@@ -11484,16 +11789,27 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
  
  ENTRY(resume_userspace)
        LOCKDEP_SYS_EXIT
-@@ -344,7 +494,7 @@ ENTRY(resume_userspace)
+@@ -345,8 +495,8 @@ ENTRY(resume_userspace)
        andl $_TIF_WORK_MASK, %ecx      # is there any work to be done on
                                        # int/exception return?
        jne work_pending
 -      jmp restore_all
+-END(ret_from_exception)
 +      jmp restore_all_pax
- END(ret_from_exception)
++ENDPROC(ret_from_exception)
  
  #ifdef CONFIG_PREEMPT
-@@ -394,23 +544,34 @@ sysenter_past_esp:
+ ENTRY(resume_kernel)
+@@ -361,7 +511,7 @@ need_resched:
+       jz restore_all
+       call preempt_schedule_irq
+       jmp need_resched
+-END(resume_kernel)
++ENDPROC(resume_kernel)
+ #endif
+       CFI_ENDPROC
+ /*
+@@ -395,23 +545,34 @@ sysenter_past_esp:
        /*CFI_REL_OFFSET cs, 0*/
        /*
         * Push current_thread_info()->sysenter_return to the stack.
@@ -11531,7 +11847,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
        movl %ebp,PT_EBP(%esp)
  .section __ex_table,"a"
        .align 4
-@@ -433,12 +594,24 @@ sysenter_do_call:
+@@ -434,12 +595,24 @@ sysenter_do_call:
        testl $_TIF_ALLWORK_MASK, %ecx
        jne sysexit_audit
  sysenter_exit:
@@ -11556,7 +11872,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
        PTGS_TO_GS
        ENABLE_INTERRUPTS_SYSEXIT
  
-@@ -455,6 +628,9 @@ sysenter_audit:
+@@ -456,6 +629,9 @@ sysenter_audit:
        movl %eax,%edx                  /* 2nd arg: syscall number */
        movl $AUDIT_ARCH_I386,%eax      /* 1st arg: audit arch */
        call audit_syscall_entry
@@ -11566,7 +11882,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
        pushl_cfi %ebx
        movl PT_EAX(%esp),%eax          /* reload syscall number */
        jmp sysenter_do_call
-@@ -481,11 +657,17 @@ sysexit_audit:
+@@ -482,11 +658,17 @@ sysexit_audit:
  
        CFI_ENDPROC
  .pushsection .fixup,"ax"
@@ -11586,7 +11902,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
  .popsection
        PTGS_TO_GS_EX
  ENDPROC(ia32_sysenter_target)
-@@ -518,6 +700,15 @@ syscall_exit:
+@@ -519,6 +701,15 @@ syscall_exit:
        testl $_TIF_ALLWORK_MASK, %ecx  # current->work
        jne syscall_exit_work
  
@@ -11602,7 +11918,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
  restore_all:
        TRACE_IRQS_IRET
  restore_all_notrace:
-@@ -577,14 +768,34 @@ ldt_ss:
+@@ -578,14 +769,34 @@ ldt_ss:
   * compensating for the offset by changing to the ESPFIX segment with
   * a base address that matches for the difference.
   */
@@ -11640,7 +11956,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
        pushl_cfi $__ESPFIX_SS
        pushl_cfi %eax                  /* new kernel esp */
        /* Disable interrupts, but do not irqtrace this section: we
-@@ -613,29 +824,23 @@ work_resched:
+@@ -614,34 +825,28 @@ work_resched:
        movl TI_flags(%ebp), %ecx
        andl $_TIF_WORK_MASK, %ecx      # is there any work to be done other
                                        # than syscall tracing?
@@ -11674,7 +11990,13 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
  #endif
        xorl %edx, %edx
        call do_notify_resume
-@@ -648,6 +853,9 @@ syscall_trace_entry:
+       jmp resume_userspace_sig
+-END(work_pending)
++ENDPROC(work_pending)
+       # perform syscall exit tracing
+       ALIGN
+@@ -649,11 +854,14 @@ syscall_trace_entry:
        movl $-ENOSYS,PT_EAX(%esp)
        movl %esp, %eax
        call syscall_trace_enter
@@ -11684,7 +12006,19 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
        /* What it returned is what we'll actually use.  */
        cmpl $(nr_syscalls), %eax
        jnae syscall_call
-@@ -670,6 +878,10 @@ END(syscall_exit_work)
+       jmp syscall_exit
+-END(syscall_trace_entry)
++ENDPROC(syscall_trace_entry)
+       # perform syscall exit tracing
+       ALIGN
+@@ -666,20 +874,24 @@ syscall_exit_work:
+       movl %esp, %eax
+       call syscall_trace_leave
+       jmp resume_userspace
+-END(syscall_exit_work)
++ENDPROC(syscall_exit_work)
+       CFI_ENDPROC
  
        RING0_INT_FRAME                 # can't unwind into user space anyway
  syscall_fault:
@@ -11695,7 +12029,18 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
        GET_THREAD_INFO(%ebp)
        movl $-EFAULT,PT_EAX(%esp)
        jmp resume_userspace
-@@ -752,6 +964,36 @@ ptregs_clone:
+-END(syscall_fault)
++ENDPROC(syscall_fault)
+ syscall_badsys:
+       movl $-ENOSYS,PT_EAX(%esp)
+       jmp resume_userspace
+-END(syscall_badsys)
++ENDPROC(syscall_badsys)
+       CFI_ENDPROC
+ /*
+  * End of kprobes section
+@@ -753,6 +965,36 @@ ptregs_clone:
        CFI_ENDPROC
  ENDPROC(ptregs_clone)
  
@@ -11732,7 +12077,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
  .macro FIXUP_ESPFIX_STACK
  /*
   * Switch back for ESPFIX stack to the normal zerobased stack
-@@ -761,8 +1003,15 @@ ENDPROC(ptregs_clone)
+@@ -762,8 +1004,15 @@ ENDPROC(ptregs_clone)
   * normal stack and adjusts ESP with the matching offset.
   */
        /* fixup the stack */
@@ -11750,7 +12095,189 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
        shl $16, %eax
        addl %esp, %eax                 /* the adjusted stack pointer */
        pushl_cfi $__KERNEL_DS
-@@ -1213,7 +1462,6 @@ return_to_handler:
+@@ -816,7 +1065,7 @@ vector=vector+1
+   .endr
+ 2:    jmp common_interrupt
+ .endr
+-END(irq_entries_start)
++ENDPROC(irq_entries_start)
+ .previous
+ END(interrupt)
+@@ -864,7 +1113,7 @@ ENTRY(coprocessor_error)
+       pushl_cfi $do_coprocessor_error
+       jmp error_code
+       CFI_ENDPROC
+-END(coprocessor_error)
++ENDPROC(coprocessor_error)
+ ENTRY(simd_coprocessor_error)
+       RING0_INT_FRAME
+@@ -885,7 +1134,7 @@ ENTRY(simd_coprocessor_error)
+ #endif
+       jmp error_code
+       CFI_ENDPROC
+-END(simd_coprocessor_error)
++ENDPROC(simd_coprocessor_error)
+ ENTRY(device_not_available)
+       RING0_INT_FRAME
+@@ -893,7 +1142,7 @@ ENTRY(device_not_available)
+       pushl_cfi $do_device_not_available
+       jmp error_code
+       CFI_ENDPROC
+-END(device_not_available)
++ENDPROC(device_not_available)
+ #ifdef CONFIG_PARAVIRT
+ ENTRY(native_iret)
+@@ -902,12 +1151,12 @@ ENTRY(native_iret)
+       .align 4
+       .long native_iret, iret_exc
+ .previous
+-END(native_iret)
++ENDPROC(native_iret)
+ ENTRY(native_irq_enable_sysexit)
+       sti
+       sysexit
+-END(native_irq_enable_sysexit)
++ENDPROC(native_irq_enable_sysexit)
+ #endif
+ ENTRY(overflow)
+@@ -916,7 +1165,7 @@ ENTRY(overflow)
+       pushl_cfi $do_overflow
+       jmp error_code
+       CFI_ENDPROC
+-END(overflow)
++ENDPROC(overflow)
+ ENTRY(bounds)
+       RING0_INT_FRAME
+@@ -924,7 +1173,7 @@ ENTRY(bounds)
+       pushl_cfi $do_bounds
+       jmp error_code
+       CFI_ENDPROC
+-END(bounds)
++ENDPROC(bounds)
+ ENTRY(invalid_op)
+       RING0_INT_FRAME
+@@ -932,7 +1181,7 @@ ENTRY(invalid_op)
+       pushl_cfi $do_invalid_op
+       jmp error_code
+       CFI_ENDPROC
+-END(invalid_op)
++ENDPROC(invalid_op)
+ ENTRY(coprocessor_segment_overrun)
+       RING0_INT_FRAME
+@@ -940,35 +1189,35 @@ ENTRY(coprocessor_segment_overrun)
+       pushl_cfi $do_coprocessor_segment_overrun
+       jmp error_code
+       CFI_ENDPROC
+-END(coprocessor_segment_overrun)
++ENDPROC(coprocessor_segment_overrun)
+ ENTRY(invalid_TSS)
+       RING0_EC_FRAME
+       pushl_cfi $do_invalid_TSS
+       jmp error_code
+       CFI_ENDPROC
+-END(invalid_TSS)
++ENDPROC(invalid_TSS)
+ ENTRY(segment_not_present)
+       RING0_EC_FRAME
+       pushl_cfi $do_segment_not_present
+       jmp error_code
+       CFI_ENDPROC
+-END(segment_not_present)
++ENDPROC(segment_not_present)
+ ENTRY(stack_segment)
+       RING0_EC_FRAME
+       pushl_cfi $do_stack_segment
+       jmp error_code
+       CFI_ENDPROC
+-END(stack_segment)
++ENDPROC(stack_segment)
+ ENTRY(alignment_check)
+       RING0_EC_FRAME
+       pushl_cfi $do_alignment_check
+       jmp error_code
+       CFI_ENDPROC
+-END(alignment_check)
++ENDPROC(alignment_check)
+ ENTRY(divide_error)
+       RING0_INT_FRAME
+@@ -976,7 +1225,7 @@ ENTRY(divide_error)
+       pushl_cfi $do_divide_error
+       jmp error_code
+       CFI_ENDPROC
+-END(divide_error)
++ENDPROC(divide_error)
+ #ifdef CONFIG_X86_MCE
+ ENTRY(machine_check)
+@@ -985,7 +1234,7 @@ ENTRY(machine_check)
+       pushl_cfi machine_check_vector
+       jmp error_code
+       CFI_ENDPROC
+-END(machine_check)
++ENDPROC(machine_check)
+ #endif
+ ENTRY(spurious_interrupt_bug)
+@@ -994,7 +1243,7 @@ ENTRY(spurious_interrupt_bug)
+       pushl_cfi $do_spurious_interrupt_bug
+       jmp error_code
+       CFI_ENDPROC
+-END(spurious_interrupt_bug)
++ENDPROC(spurious_interrupt_bug)
+ /*
+  * End of kprobes section
+  */
+@@ -1109,7 +1358,7 @@ BUILD_INTERRUPT3(xen_hvm_callback_vector
+ ENTRY(mcount)
+       ret
+-END(mcount)
++ENDPROC(mcount)
+ ENTRY(ftrace_caller)
+       cmpl $0, function_trace_stop
+@@ -1138,7 +1387,7 @@ ftrace_graph_call:
+ .globl ftrace_stub
+ ftrace_stub:
+       ret
+-END(ftrace_caller)
++ENDPROC(ftrace_caller)
+ #else /* ! CONFIG_DYNAMIC_FTRACE */
+@@ -1174,7 +1423,7 @@ trace:
+       popl %ecx
+       popl %eax
+       jmp ftrace_stub
+-END(mcount)
++ENDPROC(mcount)
+ #endif /* CONFIG_DYNAMIC_FTRACE */
+ #endif /* CONFIG_FUNCTION_TRACER */
+@@ -1195,7 +1444,7 @@ ENTRY(ftrace_graph_caller)
+       popl %ecx
+       popl %eax
+       ret
+-END(ftrace_graph_caller)
++ENDPROC(ftrace_graph_caller)
+ .globl return_to_handler
+ return_to_handler:
+@@ -1209,7 +1458,6 @@ return_to_handler:
        jmp *%ecx
  #endif
  
@@ -11758,7 +12285,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
  #include "syscall_table_32.S"
  
  syscall_table_size=(.-sys_call_table)
-@@ -1259,9 +1507,12 @@ error_code:
+@@ -1255,15 +1503,18 @@ error_code:
        movl $-1, PT_ORIG_EAX(%esp)     # no syscall to restart
        REG_TO_PTGS %ecx
        SET_KERNEL_GS %ecx
@@ -11772,7 +12299,23 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
        TRACE_IRQS_OFF
        movl %esp,%eax                  # pt_regs pointer
        call *%edi
-@@ -1346,6 +1597,9 @@ nmi_stack_correct:
+       jmp ret_from_exception
+       CFI_ENDPROC
+-END(page_fault)
++ENDPROC(page_fault)
+ /*
+  * Debug traps and NMI can happen at the one SYSENTER instruction
+@@ -1305,7 +1556,7 @@ debug_stack_correct:
+       call do_debug
+       jmp ret_from_exception
+       CFI_ENDPROC
+-END(debug)
++ENDPROC(debug)
+ /*
+  * NMI is doubly nasty. It can happen _while_ we're handling
+@@ -1342,6 +1593,9 @@ nmi_stack_correct:
        xorl %edx,%edx          # zero error code
        movl %esp,%eax          # pt_regs pointer
        call do_nmi
@@ -11782,7 +12325,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
        jmp restore_all_notrace
        CFI_ENDPROC
  
-@@ -1382,6 +1636,9 @@ nmi_espfix_stack:
+@@ -1378,12 +1632,15 @@ nmi_espfix_stack:
        FIXUP_ESPFIX_STACK              # %eax == %esp
        xorl %edx,%edx                  # zero error code
        call do_nmi
@@ -11792,18 +12335,116 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_32.S linux-3.0.4/arch/x86/kernel/en
        RESTORE_REGS
        lss 12+4(%esp), %esp            # back to espfix stack
        CFI_ADJUST_CFA_OFFSET -24
-diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/entry_64.S
---- linux-3.0.4/arch/x86/kernel/entry_64.S     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/entry_64.S     2011-09-17 18:31:51.000000000 -0400
-@@ -53,6 +53,7 @@
+       jmp irq_return
+       CFI_ENDPROC
+-END(nmi)
++ENDPROC(nmi)
+ ENTRY(int3)
+       RING0_INT_FRAME
+@@ -1395,14 +1652,14 @@ ENTRY(int3)
+       call do_int3
+       jmp ret_from_exception
+       CFI_ENDPROC
+-END(int3)
++ENDPROC(int3)
+ ENTRY(general_protection)
+       RING0_EC_FRAME
+       pushl_cfi $do_general_protection
+       jmp error_code
+       CFI_ENDPROC
+-END(general_protection)
++ENDPROC(general_protection)
+ #ifdef CONFIG_KVM_GUEST
+ ENTRY(async_page_fault)
+@@ -1410,7 +1667,7 @@ ENTRY(async_page_fault)
+       pushl_cfi $do_async_page_fault
+       jmp error_code
+       CFI_ENDPROC
+-END(async_page_fault)
++ENDPROC(async_page_fault)
+ #endif
+ /*
+diff -urNp linux-3.1.3/arch/x86/kernel/entry_64.S linux-3.1.3/arch/x86/kernel/entry_64.S
+--- linux-3.1.3/arch/x86/kernel/entry_64.S     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/entry_64.S     2011-11-17 18:28:56.000000000 -0500
+@@ -55,6 +55,8 @@
  #include <asm/paravirt.h>
  #include <asm/ftrace.h>
  #include <asm/percpu.h>
 +#include <asm/pgtable.h>
++#include <asm/alternative-asm.h>
  
  /* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this.  */
  #include <linux/elf-em.h>
-@@ -176,6 +177,264 @@ ENTRY(native_usergs_sysret64)
+@@ -68,8 +70,9 @@
+ #ifdef CONFIG_FUNCTION_TRACER
+ #ifdef CONFIG_DYNAMIC_FTRACE
+ ENTRY(mcount)
++      pax_force_retaddr
+       retq
+-END(mcount)
++ENDPROC(mcount)
+ ENTRY(ftrace_caller)
+       cmpl $0, function_trace_stop
+@@ -92,8 +95,9 @@ GLOBAL(ftrace_graph_call)
+ #endif
+ GLOBAL(ftrace_stub)
++      pax_force_retaddr
+       retq
+-END(ftrace_caller)
++ENDPROC(ftrace_caller)
+ #else /* ! CONFIG_DYNAMIC_FTRACE */
+ ENTRY(mcount)
+@@ -112,6 +116,7 @@ ENTRY(mcount)
+ #endif
+ GLOBAL(ftrace_stub)
++      pax_force_retaddr
+       retq
+ trace:
+@@ -121,12 +126,13 @@ trace:
+       movq 8(%rbp), %rsi
+       subq $MCOUNT_INSN_SIZE, %rdi
++      pax_force_fptr ftrace_trace_function
+       call   *ftrace_trace_function
+       MCOUNT_RESTORE_FRAME
+       jmp ftrace_stub
+-END(mcount)
++ENDPROC(mcount)
+ #endif /* CONFIG_DYNAMIC_FTRACE */
+ #endif /* CONFIG_FUNCTION_TRACER */
+@@ -146,8 +152,9 @@ ENTRY(ftrace_graph_caller)
+       MCOUNT_RESTORE_FRAME
++      pax_force_retaddr
+       retq
+-END(ftrace_graph_caller)
++ENDPROC(ftrace_graph_caller)
+ GLOBAL(return_to_handler)
+       subq  $24, %rsp
+@@ -163,6 +170,7 @@ GLOBAL(return_to_handler)
+       movq 8(%rsp), %rdx
+       movq (%rsp), %rax
+       addq $24, %rsp
++      pax_force_fptr %rdi
+       jmp *%rdi
+ #endif
+@@ -178,6 +186,269 @@ ENTRY(native_usergs_sysret64)
  ENDPROC(native_usergs_sysret64)
  #endif /* CONFIG_PARAVIRT */
  
@@ -11857,6 +12498,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
 +#endif
 +
 +      popq %rdi
++      pax_force_retaddr
 +      retq
 +ENDPROC(pax_enter_kernel)
 +
@@ -11881,6 +12523,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
 +#endif
 +
 +      popq %rdi
++      pax_force_retaddr
 +      retq
 +ENDPROC(pax_exit_kernel)
 +#endif
@@ -11955,6 +12598,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
 +
 +      popq %rbx
 +      popq %rdi
++      pax_force_retaddr
 +      retq
 +ENDPROC(pax_enter_kernel_user)
 +
@@ -12004,15 +12648,16 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
 +#endif
 +
 +      popq %rdi
++      pax_force_retaddr
 +      retq
 +ENDPROC(pax_exit_kernel_user)
 +#endif
 +
-+      .macro pax_erase_kstack
++.macro pax_erase_kstack
 +#ifdef CONFIG_PAX_MEMORY_STACKLEAK
 +      call pax_erase_kstack
 +#endif
-+      .endm
++.endm
 +
 +#ifdef CONFIG_PAX_MEMORY_STACKLEAK
 +/*
@@ -12062,22 +12707,48 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
 +      popq %r10
 +      popq %rax
 +      popq %rdi
++      pax_force_retaddr
 +      ret
 +ENDPROC(pax_erase_kstack)
 +#endif
  
  .macro TRACE_IRQS_IRETQ offset=ARGOFFSET
  #ifdef CONFIG_TRACE_IRQFLAGS
-@@ -318,7 +577,7 @@ ENTRY(save_args)
-       leaq -RBP+8(%rsp),%rdi  /* arg1 for handler */
-       movq_cfi rbp, 8         /* push %rbp */
-       leaq 8(%rsp), %rbp              /* mov %rsp, %ebp */
+@@ -319,7 +590,7 @@ ENDPROC(native_usergs_sysret64)
+       movq %rsp, %rsi
+       leaq -RBP(%rsp),%rdi    /* arg1 for handler */
 -      testl $3, CS(%rdi)
 +      testb $3, CS(%rdi)
        je 1f
        SWAPGS
        /*
-@@ -409,7 +668,7 @@ ENTRY(ret_from_fork)
+@@ -350,9 +621,10 @@ ENTRY(save_rest)
+       movq_cfi r15, R15+16
+       movq %r11, 8(%rsp)      /* return address */
+       FIXUP_TOP_OF_STACK %r11, 16
++      pax_force_retaddr
+       ret
+       CFI_ENDPROC
+-END(save_rest)
++ENDPROC(save_rest)
+ /* save complete stack frame */
+       .pushsection .kprobes.text, "ax"
+@@ -381,9 +653,10 @@ ENTRY(save_paranoid)
+       js 1f   /* negative -> in kernel */
+       SWAPGS
+       xorl %ebx,%ebx
+-1:    ret
++1:    pax_force_retaddr
++      ret
+       CFI_ENDPROC
+-END(save_paranoid)
++ENDPROC(save_paranoid)
+       .popsection
+ /*
+@@ -405,7 +678,7 @@ ENTRY(ret_from_fork)
  
        RESTORE_REST
  
@@ -12086,7 +12757,16 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
        je   int_ret_from_sys_call
  
        testl $_TIF_IA32, TI_flags(%rcx)        # 32-bit compat task needs IRET
-@@ -455,7 +714,7 @@ END(ret_from_fork)
+@@ -415,7 +688,7 @@ ENTRY(ret_from_fork)
+       jmp ret_from_sys_call                   # go to the SYSRET fastpath
+       CFI_ENDPROC
+-END(ret_from_fork)
++ENDPROC(ret_from_fork)
+ /*
+  * System call entry. Up to 6 arguments in registers are supported.
+@@ -451,7 +724,7 @@ END(ret_from_fork)
  ENTRY(system_call)
        CFI_STARTPROC   simple
        CFI_SIGNAL_FRAME
@@ -12095,7 +12775,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
        CFI_REGISTER    rip,rcx
        /*CFI_REGISTER  rflags,r11*/
        SWAPGS_UNSAFE_STACK
-@@ -468,12 +727,13 @@ ENTRY(system_call_after_swapgs)
+@@ -464,12 +737,13 @@ ENTRY(system_call_after_swapgs)
  
        movq    %rsp,PER_CPU_VAR(old_rsp)
        movq    PER_CPU_VAR(kernel_stack),%rsp
@@ -12105,12 +12785,12 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
         * and short:
         */
        ENABLE_INTERRUPTS(CLBR_NONE)
--      SAVE_ARGS 8,1
-+      SAVE_ARGS 8*6,1
+-      SAVE_ARGS 8,0
++      SAVE_ARGS 8*6,0
        movq  %rax,ORIG_RAX-ARGOFFSET(%rsp)
        movq  %rcx,RIP-ARGOFFSET(%rsp)
        CFI_REL_OFFSET rip,RIP-ARGOFFSET
-@@ -502,6 +762,8 @@ sysret_check:
+@@ -498,6 +772,8 @@ sysret_check:
        andl %edi,%edx
        jnz  sysret_careful
        CFI_REMEMBER_STATE
@@ -12119,7 +12799,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
        /*
         * sysretq will re-enable interrupts:
         */
-@@ -560,6 +822,9 @@ auditsys:
+@@ -556,6 +832,9 @@ auditsys:
        movq %rax,%rsi                  /* 2nd arg: syscall number */
        movl $AUDIT_ARCH_X86_64,%edi    /* 1st arg: audit arch */
        call audit_syscall_entry
@@ -12129,7 +12809,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
        LOAD_ARGS 0             /* reload call-clobbered registers */
        jmp system_call_fastpath
  
-@@ -590,6 +855,9 @@ tracesys:
+@@ -586,6 +865,9 @@ tracesys:
        FIXUP_TOP_OF_STACK %rdi
        movq %rsp,%rdi
        call syscall_trace_enter
@@ -12139,7 +12819,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
        /*
         * Reload arg registers from stack in case ptrace changed them.
         * We don't reload %rax because syscall_trace_enter() returned
-@@ -611,7 +879,7 @@ tracesys:
+@@ -607,7 +889,7 @@ tracesys:
  GLOBAL(int_ret_from_sys_call)
        DISABLE_INTERRUPTS(CLBR_NONE)
        TRACE_IRQS_OFF
@@ -12148,9 +12828,66 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
        je retint_restore_args
        movl $_TIF_ALLWORK_MASK,%edi
        /* edi: mask to check */
-@@ -793,6 +1061,16 @@ END(interrupt)
+@@ -664,7 +946,7 @@ int_restore_rest:
+       TRACE_IRQS_OFF
+       jmp int_with_check
+       CFI_ENDPROC
+-END(system_call)
++ENDPROC(system_call)
+ /*
+  * Certain special system calls that need to save a complete full stack frame.
+@@ -680,7 +962,7 @@ ENTRY(\label)
+       call \func
+       jmp ptregscall_common
+       CFI_ENDPROC
+-END(\label)
++ENDPROC(\label)
+       .endm
+       PTREGSCALL stub_clone, sys_clone, %r8
+@@ -698,9 +980,10 @@ ENTRY(ptregscall_common)
+       movq_cfi_restore R12+8, r12
+       movq_cfi_restore RBP+8, rbp
+       movq_cfi_restore RBX+8, rbx
++      pax_force_retaddr
+       ret $REST_SKIP          /* pop extended registers */
+       CFI_ENDPROC
+-END(ptregscall_common)
++ENDPROC(ptregscall_common)
+ ENTRY(stub_execve)
+       CFI_STARTPROC
+@@ -715,7 +998,7 @@ ENTRY(stub_execve)
+       RESTORE_REST
+       jmp int_ret_from_sys_call
+       CFI_ENDPROC
+-END(stub_execve)
++ENDPROC(stub_execve)
+ /*
+  * sigreturn is special because it needs to restore all registers on return.
+@@ -733,7 +1016,7 @@ ENTRY(stub_rt_sigreturn)
+       RESTORE_REST
+       jmp int_ret_from_sys_call
+       CFI_ENDPROC
+-END(stub_rt_sigreturn)
++ENDPROC(stub_rt_sigreturn)
+ /*
+  * Build the entry stubs and pointer table with some assembler magic.
+@@ -768,7 +1051,7 @@ vector=vector+1
+ 2:    jmp common_interrupt
+ .endr
+       CFI_ENDPROC
+-END(irq_entries_start)
++ENDPROC(irq_entries_start)
+ .previous
+ END(interrupt)
+@@ -789,6 +1072,16 @@ END(interrupt)
        CFI_ADJUST_CFA_OFFSET ORIG_RAX-RBP
-       call save_args
+       SAVE_ARGS_IRQ
        PARTIAL_FRAME 0
 +#ifdef CONFIG_PAX_MEMORY_UDEREF
 +      testb $3, CS(%rdi)
@@ -12165,8 +12902,8 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
        call \func
        .endm
  
-@@ -825,7 +1103,7 @@ ret_from_intr:
-       CFI_ADJUST_CFA_OFFSET   -8
+@@ -820,7 +1113,7 @@ ret_from_intr:
  exit_intr:
        GET_THREAD_INFO(%rcx)
 -      testl $3,CS-ARGOFFSET(%rsp)
@@ -12174,7 +12911,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
        je retint_kernel
  
        /* Interrupt came from user space */
-@@ -847,12 +1125,18 @@ retint_swapgs:          /* return to user-space 
+@@ -842,12 +1135,16 @@ retint_swapgs:          /* return to user-space 
         * The iretq could re-enable interrupts:
         */
        DISABLE_INTERRUPTS(CLBR_ANY)
@@ -12187,13 +12924,29 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
  retint_restore_args:  /* return to kernel space */
        DISABLE_INTERRUPTS(CLBR_ANY)
 +      pax_exit_kernel
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80,0x7+RIP-ARGOFFSET(%rsp)
-+#endif
++      pax_force_retaddr RIP-ARGOFFSET
        /*
         * The iretq could re-enable interrupts:
         */
-@@ -1027,6 +1311,16 @@ ENTRY(\sym)
+@@ -936,7 +1233,7 @@ ENTRY(retint_kernel)
+ #endif
+       CFI_ENDPROC
+-END(common_interrupt)
++ENDPROC(common_interrupt)
+ /*
+  * End of kprobes section
+  */
+@@ -952,7 +1249,7 @@ ENTRY(\sym)
+       interrupt \do_sym
+       jmp ret_from_intr
+       CFI_ENDPROC
+-END(\sym)
++ENDPROC(\sym)
+ .endm
+ #ifdef CONFIG_SMP
+@@ -1017,12 +1314,22 @@ ENTRY(\sym)
        CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
        call error_entry
        DEFAULT_FRAME 0
@@ -12210,7 +12963,14 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
        movq %rsp,%rdi          /* pt_regs pointer */
        xorl %esi,%esi          /* no error code */
        call \do_sym
-@@ -1044,6 +1338,16 @@ ENTRY(\sym)
+       jmp error_exit          /* %ebx: no swapgs flag */
+       CFI_ENDPROC
+-END(\sym)
++ENDPROC(\sym)
+ .endm
+ .macro paranoidzeroentry sym do_sym
+@@ -1034,15 +1341,25 @@ ENTRY(\sym)
        CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
        call save_paranoid
        TRACE_IRQS_OFF
@@ -12227,8 +12987,10 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
        movq %rsp,%rdi          /* pt_regs pointer */
        xorl %esi,%esi          /* no error code */
        call \do_sym
-@@ -1052,7 +1356,7 @@ ENTRY(\sym)
- END(\sym)
+       jmp paranoid_exit       /* %ebx: no swapgs flag */
+       CFI_ENDPROC
+-END(\sym)
++ENDPROC(\sym)
  .endm
  
 -#define INIT_TSS_IST(x) PER_CPU_VAR(init_tss) + (TSS_ist + ((x) - 1) * 8)
@@ -12236,7 +12998,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
  .macro paranoidzeroentry_ist sym do_sym ist
  ENTRY(\sym)
        INTR_FRAME
-@@ -1062,8 +1366,24 @@ ENTRY(\sym)
+@@ -1052,14 +1369,30 @@ ENTRY(\sym)
        CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
        call save_paranoid
        TRACE_IRQS_OFF
@@ -12261,7 +13023,14 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
        subq $EXCEPTION_STKSZ, INIT_TSS_IST(\ist)
        call \do_sym
        addq $EXCEPTION_STKSZ, INIT_TSS_IST(\ist)
-@@ -1080,6 +1400,16 @@ ENTRY(\sym)
+       jmp paranoid_exit       /* %ebx: no swapgs flag */
+       CFI_ENDPROC
+-END(\sym)
++ENDPROC(\sym)
+ .endm
+ .macro errorentry sym do_sym
+@@ -1070,13 +1403,23 @@ ENTRY(\sym)
        CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
        call error_entry
        DEFAULT_FRAME 0
@@ -12278,7 +13047,15 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
        movq %rsp,%rdi                  /* pt_regs pointer */
        movq ORIG_RAX(%rsp),%rsi        /* get error code */
        movq $-1,ORIG_RAX(%rsp)         /* no syscall to restart */
-@@ -1099,6 +1429,16 @@ ENTRY(\sym)
+       call \do_sym
+       jmp error_exit                  /* %ebx: no swapgs flag */
+       CFI_ENDPROC
+-END(\sym)
++ENDPROC(\sym)
+ .endm
+       /* error code is on the stack already */
+@@ -1089,13 +1432,23 @@ ENTRY(\sym)
        call save_paranoid
        DEFAULT_FRAME 0
        TRACE_IRQS_OFF
@@ -12295,7 +13072,85 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
        movq %rsp,%rdi                  /* pt_regs pointer */
        movq ORIG_RAX(%rsp),%rsi        /* get error code */
        movq $-1,ORIG_RAX(%rsp)         /* no syscall to restart */
-@@ -1361,16 +1701,35 @@ ENTRY(paranoid_exit)
+       call \do_sym
+       jmp paranoid_exit               /* %ebx: no swapgs flag */
+       CFI_ENDPROC
+-END(\sym)
++ENDPROC(\sym)
+ .endm
+ zeroentry divide_error do_divide_error
+@@ -1125,9 +1478,10 @@ gs_change:
+ 2:    mfence          /* workaround */
+       SWAPGS
+       popfq_cfi
++      pax_force_retaddr
+       ret
+       CFI_ENDPROC
+-END(native_load_gs_index)
++ENDPROC(native_load_gs_index)
+       .section __ex_table,"a"
+       .align 8
+@@ -1149,13 +1503,14 @@ ENTRY(kernel_thread_helper)
+        * Here we are in the child and the registers are set as they were
+        * at kernel_thread() invocation in the parent.
+        */
++      pax_force_fptr %rsi
+       call *%rsi
+       # exit
+       mov %eax, %edi
+       call do_exit
+       ud2                     # padding for call trace
+       CFI_ENDPROC
+-END(kernel_thread_helper)
++ENDPROC(kernel_thread_helper)
+ /*
+  * execve(). This function needs to use IRET, not SYSRET, to set up all state properly.
+@@ -1184,9 +1539,10 @@ ENTRY(kernel_execve)
+       je int_ret_from_sys_call
+       RESTORE_ARGS
+       UNFAKE_STACK_FRAME
++      pax_force_retaddr
+       ret
+       CFI_ENDPROC
+-END(kernel_execve)
++ENDPROC(kernel_execve)
+ /* Call softirq on interrupt stack. Interrupts are off. */
+ ENTRY(call_softirq)
+@@ -1204,9 +1560,10 @@ ENTRY(call_softirq)
+       CFI_DEF_CFA_REGISTER    rsp
+       CFI_ADJUST_CFA_OFFSET   -8
+       decl PER_CPU_VAR(irq_count)
++      pax_force_retaddr
+       ret
+       CFI_ENDPROC
+-END(call_softirq)
++ENDPROC(call_softirq)
+ #ifdef CONFIG_XEN
+ zeroentry xen_hypervisor_callback xen_do_hypervisor_callback
+@@ -1244,7 +1601,7 @@ ENTRY(xen_do_hypervisor_callback)   # do
+       decl PER_CPU_VAR(irq_count)
+       jmp  error_exit
+       CFI_ENDPROC
+-END(xen_do_hypervisor_callback)
++ENDPROC(xen_do_hypervisor_callback)
+ /*
+  * Hypervisor uses this for application faults while it executes.
+@@ -1303,7 +1660,7 @@ ENTRY(xen_failsafe_callback)
+       SAVE_ALL
+       jmp error_exit
+       CFI_ENDPROC
+-END(xen_failsafe_callback)
++ENDPROC(xen_failsafe_callback)
+ apicinterrupt XEN_HVM_EVTCHN_CALLBACK \
+       xen_hvm_callback_vector xen_evtchn_do_upcall
+@@ -1352,16 +1709,31 @@ ENTRY(paranoid_exit)
        TRACE_IRQS_OFF
        testl %ebx,%ebx                         /* swapgs needed? */
        jnz paranoid_restore
@@ -12307,9 +13162,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
 +      TRACE_IRQS_IRETQ 0
 +      SWAPGS_UNSAFE_STACK
 +      RESTORE_ALL 8
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80,0x7(%rsp)
-+#endif
++      pax_force_retaddr
 +      jmp irq_return
 +#endif
  paranoid_swapgs:
@@ -12326,13 +13179,20 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
 +      pax_exit_kernel
        TRACE_IRQS_IRETQ 0
        RESTORE_ALL 8
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80,0x7(%rsp)
-+#endif
++      pax_force_retaddr
        jmp irq_return
  paranoid_userspace:
        GET_THREAD_INFO(%rcx)
-@@ -1426,7 +1785,7 @@ ENTRY(error_entry)
+@@ -1390,7 +1762,7 @@ paranoid_schedule:
+       TRACE_IRQS_OFF
+       jmp paranoid_userspace
+       CFI_ENDPROC
+-END(paranoid_exit)
++ENDPROC(paranoid_exit)
+ /*
+  * Exception entry point. This expects an error code/orig_rax on the stack.
+@@ -1417,12 +1789,13 @@ ENTRY(error_entry)
        movq_cfi r14, R14+8
        movq_cfi r15, R15+8
        xorl %ebx,%ebx
@@ -12341,7 +13201,31 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
        je error_kernelspace
  error_swapgs:
        SWAPGS
-@@ -1490,6 +1849,16 @@ ENTRY(nmi)
+ error_sti:
+       TRACE_IRQS_OFF
++      pax_force_retaddr
+       ret
+ /*
+@@ -1449,7 +1822,7 @@ bstep_iret:
+       movq %rcx,RIP+8(%rsp)
+       jmp error_swapgs
+       CFI_ENDPROC
+-END(error_entry)
++ENDPROC(error_entry)
+ /* ebx:       no swapgs flag (1: don't need swapgs, 0: need it) */
+@@ -1469,7 +1842,7 @@ ENTRY(error_exit)
+       jnz retint_careful
+       jmp retint_swapgs
+       CFI_ENDPROC
+-END(error_exit)
++ENDPROC(error_exit)
+       /* runs on exception stack */
+@@ -1481,6 +1854,16 @@ ENTRY(nmi)
        CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
        call save_paranoid
        DEFAULT_FRAME 0
@@ -12358,7 +13242,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
        /* paranoidentry do_nmi, 0; without TRACE_IRQS_OFF */
        movq %rsp,%rdi
        movq $-1,%rsi
-@@ -1500,12 +1869,32 @@ ENTRY(nmi)
+@@ -1491,12 +1874,28 @@ ENTRY(nmi)
        DISABLE_INTERRUPTS(CLBR_NONE)
        testl %ebx,%ebx                         /* swapgs needed? */
        jnz nmi_restore
@@ -12369,9 +13253,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
 +      pax_exit_kernel
 +      SWAPGS_UNSAFE_STACK
 +      RESTORE_ALL 8
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80,0x7(%rsp)
-+#endif
++      pax_force_retaddr
 +      jmp irq_return
 +#endif
  nmi_swapgs:
@@ -12386,15 +13268,30 @@ diff -urNp linux-3.0.4/arch/x86/kernel/entry_64.S linux-3.0.4/arch/x86/kernel/en
  nmi_restore:
 +      pax_exit_kernel
        RESTORE_ALL 8
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80,0x7(%rsp)
-+#endif
++      pax_force_retaddr
        jmp irq_return
  nmi_userspace:
        GET_THREAD_INFO(%rcx)
-diff -urNp linux-3.0.4/arch/x86/kernel/ftrace.c linux-3.0.4/arch/x86/kernel/ftrace.c
---- linux-3.0.4/arch/x86/kernel/ftrace.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/ftrace.c       2011-08-23 21:47:55.000000000 -0400
+@@ -1525,14 +1924,14 @@ nmi_schedule:
+       jmp paranoid_exit
+       CFI_ENDPROC
+ #endif
+-END(nmi)
++ENDPROC(nmi)
+ ENTRY(ignore_sysret)
+       CFI_STARTPROC
+       mov $-ENOSYS,%eax
+       sysret
+       CFI_ENDPROC
+-END(ignore_sysret)
++ENDPROC(ignore_sysret)
+ /*
+  * End of kprobes section
+diff -urNp linux-3.1.3/arch/x86/kernel/ftrace.c linux-3.1.3/arch/x86/kernel/ftrace.c
+--- linux-3.1.3/arch/x86/kernel/ftrace.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/ftrace.c       2011-11-16 18:39:07.000000000 -0500
 @@ -126,7 +126,7 @@ static void *mod_code_ip;          /* holds the 
  static const void *mod_code_newcode;  /* holds the text to write to the IP */
  
@@ -12452,9 +13349,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/ftrace.c linux-3.0.4/arch/x86/kernel/ftra
        if (probe_kernel_read(code, (void *)ip, MCOUNT_INSN_SIZE))
                return -EFAULT;
  
-diff -urNp linux-3.0.4/arch/x86/kernel/head32.c linux-3.0.4/arch/x86/kernel/head32.c
---- linux-3.0.4/arch/x86/kernel/head32.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/head32.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/head32.c linux-3.1.3/arch/x86/kernel/head32.c
+--- linux-3.1.3/arch/x86/kernel/head32.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/head32.c       2011-11-16 18:39:07.000000000 -0500
 @@ -19,6 +19,7 @@
  #include <asm/io_apic.h>
  #include <asm/bios_ebda.h>
@@ -12472,9 +13369,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/head32.c linux-3.0.4/arch/x86/kernel/head
  
  #ifdef CONFIG_BLK_DEV_INITRD
        /* Reserve INITRD */
-diff -urNp linux-3.0.4/arch/x86/kernel/head_32.S linux-3.0.4/arch/x86/kernel/head_32.S
---- linux-3.0.4/arch/x86/kernel/head_32.S      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/head_32.S      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/head_32.S linux-3.1.3/arch/x86/kernel/head_32.S
+--- linux-3.1.3/arch/x86/kernel/head_32.S      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/head_32.S      2011-11-16 18:39:07.000000000 -0500
 @@ -25,6 +25,12 @@
  /* Physical address */
  #define pa(X) ((X) - __PAGE_OFFSET)
@@ -12909,9 +13806,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/head_32.S linux-3.0.4/arch/x86/kernel/hea
 +      /* Be sure this is zeroed to avoid false validations in Xen */
 +      .fill PAGE_SIZE_asm - GDT_SIZE,1,0
 +      .endr
-diff -urNp linux-3.0.4/arch/x86/kernel/head_64.S linux-3.0.4/arch/x86/kernel/head_64.S
---- linux-3.0.4/arch/x86/kernel/head_64.S      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/head_64.S      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/head_64.S linux-3.1.3/arch/x86/kernel/head_64.S
+--- linux-3.1.3/arch/x86/kernel/head_64.S      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/head_64.S      2011-11-16 18:39:07.000000000 -0500
 @@ -19,6 +19,7 @@
  #include <asm/cache.h>
  #include <asm/processor-flags.h>
@@ -13181,9 +14078,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/head_64.S linux-3.0.4/arch/x86/kernel/hea
  
        __PAGE_ALIGNED_BSS
        .align PAGE_SIZE
-diff -urNp linux-3.0.4/arch/x86/kernel/i386_ksyms_32.c linux-3.0.4/arch/x86/kernel/i386_ksyms_32.c
---- linux-3.0.4/arch/x86/kernel/i386_ksyms_32.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/i386_ksyms_32.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/i386_ksyms_32.c linux-3.1.3/arch/x86/kernel/i386_ksyms_32.c
+--- linux-3.1.3/arch/x86/kernel/i386_ksyms_32.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/i386_ksyms_32.c        2011-11-16 18:39:07.000000000 -0500
 @@ -20,8 +20,12 @@ extern void cmpxchg8b_emu(void);
  EXPORT_SYMBOL(cmpxchg8b_emu);
  #endif
@@ -13205,9 +14102,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/i386_ksyms_32.c linux-3.0.4/arch/x86/kern
 +#ifdef CONFIG_PAX_KERNEXEC
 +EXPORT_SYMBOL(__LOAD_PHYSICAL_ADDR);
 +#endif
-diff -urNp linux-3.0.4/arch/x86/kernel/i8259.c linux-3.0.4/arch/x86/kernel/i8259.c
---- linux-3.0.4/arch/x86/kernel/i8259.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/i8259.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/i8259.c linux-3.1.3/arch/x86/kernel/i8259.c
+--- linux-3.1.3/arch/x86/kernel/i8259.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/i8259.c        2011-11-16 18:39:07.000000000 -0500
 @@ -210,7 +210,7 @@ spurious_8259A_irq:
                               "spurious 8259A interrupt: IRQ%d.\n", irq);
                        spurious_irq_mask |= irqmask;
@@ -13217,9 +14114,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/i8259.c linux-3.0.4/arch/x86/kernel/i8259
                /*
                 * Theoretically we do not have to handle this IRQ,
                 * but in Linux this does not cause problems and is
-diff -urNp linux-3.0.4/arch/x86/kernel/init_task.c linux-3.0.4/arch/x86/kernel/init_task.c
---- linux-3.0.4/arch/x86/kernel/init_task.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/init_task.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/init_task.c linux-3.1.3/arch/x86/kernel/init_task.c
+--- linux-3.1.3/arch/x86/kernel/init_task.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/init_task.c    2011-11-16 18:39:07.000000000 -0500
 @@ -20,8 +20,7 @@ static struct sighand_struct init_sighan
   * way process stacks are handled. This is done by having a special
   * "init_task" linker map entry..
@@ -13238,9 +14135,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/init_task.c linux-3.0.4/arch/x86/kernel/i
 -
 +struct tss_struct init_tss[NR_CPUS] ____cacheline_internodealigned_in_smp = { [0 ... NR_CPUS-1] = INIT_TSS };
 +EXPORT_SYMBOL(init_tss);
-diff -urNp linux-3.0.4/arch/x86/kernel/ioport.c linux-3.0.4/arch/x86/kernel/ioport.c
---- linux-3.0.4/arch/x86/kernel/ioport.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/ioport.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/ioport.c linux-3.1.3/arch/x86/kernel/ioport.c
+--- linux-3.1.3/arch/x86/kernel/ioport.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/ioport.c       2011-11-16 18:40:08.000000000 -0500
 @@ -6,6 +6,7 @@
  #include <linux/sched.h>
  #include <linux/kernel.h>
@@ -13284,9 +14181,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/ioport.c linux-3.0.4/arch/x86/kernel/iopo
                if (!capable(CAP_SYS_RAWIO))
                        return -EPERM;
        }
-diff -urNp linux-3.0.4/arch/x86/kernel/irq_32.c linux-3.0.4/arch/x86/kernel/irq_32.c
---- linux-3.0.4/arch/x86/kernel/irq_32.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/irq_32.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/irq_32.c linux-3.1.3/arch/x86/kernel/irq_32.c
+--- linux-3.1.3/arch/x86/kernel/irq_32.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/irq_32.c       2011-11-16 18:39:07.000000000 -0500
 @@ -36,7 +36,7 @@ static int check_stack_overflow(void)
        __asm__ __volatile__("andl %%esp,%0" :
                             "=r" (sp) : "0" (THREAD_SIZE - 1));
@@ -13426,9 +14323,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/irq_32.c linux-3.0.4/arch/x86/kernel/irq_
                /*
                 * Shouldn't happen, we returned above if in_interrupt():
                 */
-diff -urNp linux-3.0.4/arch/x86/kernel/irq.c linux-3.0.4/arch/x86/kernel/irq.c
---- linux-3.0.4/arch/x86/kernel/irq.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/irq.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/irq.c linux-3.1.3/arch/x86/kernel/irq.c
+--- linux-3.1.3/arch/x86/kernel/irq.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/irq.c  2011-11-16 18:39:07.000000000 -0500
 @@ -17,7 +17,7 @@
  #include <asm/mce.h>
  #include <asm/hw_irq.h>
@@ -13463,9 +14360,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/irq.c linux-3.0.4/arch/x86/kernel/irq.c
  #endif
        return sum;
  }
-diff -urNp linux-3.0.4/arch/x86/kernel/kgdb.c linux-3.0.4/arch/x86/kernel/kgdb.c
---- linux-3.0.4/arch/x86/kernel/kgdb.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/kgdb.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/kgdb.c linux-3.1.3/arch/x86/kernel/kgdb.c
+--- linux-3.1.3/arch/x86/kernel/kgdb.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/kgdb.c 2011-11-16 18:39:07.000000000 -0500
 @@ -124,11 +124,11 @@ char *dbg_get_reg(int regno, void *mem, 
  #ifdef CONFIG_X86_32
        switch (regno) {
@@ -13504,10 +14401,10 @@ diff -urNp linux-3.0.4/arch/x86/kernel/kgdb.c linux-3.0.4/arch/x86/kernel/kgdb.c
                        if (user_mode(regs))
                                return single_step_cont(regs, args);
                        break;
-diff -urNp linux-3.0.4/arch/x86/kernel/kprobes.c linux-3.0.4/arch/x86/kernel/kprobes.c
---- linux-3.0.4/arch/x86/kernel/kprobes.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/kprobes.c      2011-08-23 21:47:55.000000000 -0400
-@@ -115,8 +115,11 @@ static void __kprobes __synthesize_relat
+diff -urNp linux-3.1.3/arch/x86/kernel/kprobes.c linux-3.1.3/arch/x86/kernel/kprobes.c
+--- linux-3.1.3/arch/x86/kernel/kprobes.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/kprobes.c      2011-11-16 18:39:07.000000000 -0500
+@@ -117,8 +117,11 @@ static void __kprobes __synthesize_relat
        } __attribute__((packed)) *insn;
  
        insn = (struct __arch_relative_insn *)from;
@@ -13519,7 +14416,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/kprobes.c linux-3.0.4/arch/x86/kernel/kpr
  }
  
  /* Insert a jump instruction at address 'from', which jumps to address 'to'.*/
-@@ -153,7 +156,7 @@ static int __kprobes can_boost(kprobe_op
+@@ -155,7 +158,7 @@ static int __kprobes can_boost(kprobe_op
        kprobe_opcode_t opcode;
        kprobe_opcode_t *orig_opcodes = opcodes;
  
@@ -13528,7 +14425,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/kprobes.c linux-3.0.4/arch/x86/kernel/kpr
                return 0;       /* Page fault may occur on this address. */
  
  retry:
-@@ -314,7 +317,9 @@ static int __kprobes __copy_instruction(
+@@ -316,7 +319,9 @@ static int __kprobes __copy_instruction(
                }
        }
        insn_get_length(&insn);
@@ -13538,7 +14435,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/kprobes.c linux-3.0.4/arch/x86/kernel/kpr
  
  #ifdef CONFIG_X86_64
        if (insn_rip_relative(&insn)) {
-@@ -338,7 +343,9 @@ static int __kprobes __copy_instruction(
+@@ -340,7 +345,9 @@ static int __kprobes __copy_instruction(
                          (u8 *) dest;
                BUG_ON((s64) (s32) newdisp != newdisp); /* Sanity check.  */
                disp = (u8 *) dest + insn_offset_displacement(&insn);
@@ -13548,7 +14445,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/kprobes.c linux-3.0.4/arch/x86/kernel/kpr
        }
  #endif
        return insn.length;
-@@ -352,12 +359,12 @@ static void __kprobes arch_copy_kprobe(s
+@@ -354,12 +361,12 @@ static void __kprobes arch_copy_kprobe(s
         */
        __copy_instruction(p->ainsn.insn, p->addr, 0);
  
@@ -13563,7 +14460,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/kprobes.c linux-3.0.4/arch/x86/kernel/kpr
  }
  
  int __kprobes arch_prepare_kprobe(struct kprobe *p)
-@@ -474,7 +481,7 @@ static void __kprobes setup_singlestep(s
+@@ -476,7 +483,7 @@ static void __kprobes setup_singlestep(s
                 * nor set current_kprobe, because it doesn't use single
                 * stepping.
                 */
@@ -13572,7 +14469,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/kprobes.c linux-3.0.4/arch/x86/kernel/kpr
                preempt_enable_no_resched();
                return;
        }
-@@ -493,7 +500,7 @@ static void __kprobes setup_singlestep(s
+@@ -495,7 +502,7 @@ static void __kprobes setup_singlestep(s
        if (p->opcode == BREAKPOINT_INSTRUCTION)
                regs->ip = (unsigned long)p->addr;
        else
@@ -13581,7 +14478,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/kprobes.c linux-3.0.4/arch/x86/kernel/kpr
  }
  
  /*
-@@ -572,7 +579,7 @@ static int __kprobes kprobe_handler(stru
+@@ -574,7 +581,7 @@ static int __kprobes kprobe_handler(stru
                                setup_singlestep(p, regs, kcb, 0);
                        return 1;
                }
@@ -13590,7 +14487,17 @@ diff -urNp linux-3.0.4/arch/x86/kernel/kprobes.c linux-3.0.4/arch/x86/kernel/kpr
                /*
                 * The breakpoint instruction was removed right
                 * after we hit it.  Another cpu has removed
-@@ -817,7 +824,7 @@ static void __kprobes resume_execution(s
+@@ -682,6 +689,9 @@ static void __used __kprobes kretprobe_t
+                       "       movq %rax, 152(%rsp)\n"
+                       RESTORE_REGS_STRING
+                       "       popfq\n"
++#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
++                      "       btsq $63,(%rsp)\n"
++#endif
+ #else
+                       "       pushf\n"
+                       SAVE_REGS_STRING
+@@ -819,7 +829,7 @@ static void __kprobes resume_execution(s
                struct pt_regs *regs, struct kprobe_ctlblk *kcb)
  {
        unsigned long *tos = stack_addr(regs);
@@ -13599,7 +14506,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/kprobes.c linux-3.0.4/arch/x86/kernel/kpr
        unsigned long orig_ip = (unsigned long)p->addr;
        kprobe_opcode_t *insn = p->ainsn.insn;
  
-@@ -999,7 +1006,7 @@ int __kprobes kprobe_exceptions_notify(s
+@@ -1001,7 +1011,7 @@ int __kprobes kprobe_exceptions_notify(s
        struct die_args *args = data;
        int ret = NOTIFY_DONE;
  
@@ -13608,7 +14515,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/kprobes.c linux-3.0.4/arch/x86/kernel/kpr
                return ret;
  
        switch (val) {
-@@ -1381,7 +1388,7 @@ int __kprobes arch_prepare_optimized_kpr
+@@ -1383,7 +1393,7 @@ int __kprobes arch_prepare_optimized_kpr
         * Verify if the address gap is in 2GB range, because this uses
         * a relative jump.
         */
@@ -13617,7 +14524,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/kprobes.c linux-3.0.4/arch/x86/kernel/kpr
        if (abs(rel) > 0x7fffffff)
                return -ERANGE;
  
-@@ -1402,11 +1409,11 @@ int __kprobes arch_prepare_optimized_kpr
+@@ -1404,11 +1414,11 @@ int __kprobes arch_prepare_optimized_kpr
        synthesize_set_arg1(buf + TMPL_MOVE_IDX, (unsigned long)op);
  
        /* Set probe function call */
@@ -13631,7 +14538,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/kprobes.c linux-3.0.4/arch/x86/kernel/kpr
  
        flush_icache_range((unsigned long) buf,
                           (unsigned long) buf + TMPL_END_IDX +
-@@ -1428,7 +1435,7 @@ static void __kprobes setup_optimize_kpr
+@@ -1430,7 +1440,7 @@ static void __kprobes setup_optimize_kpr
                        ((long)op->kp.addr + RELATIVEJUMP_SIZE));
  
        /* Backup instructions which will be replaced by jump address */
@@ -13640,10 +14547,10 @@ diff -urNp linux-3.0.4/arch/x86/kernel/kprobes.c linux-3.0.4/arch/x86/kernel/kpr
               RELATIVE_ADDR_SIZE);
  
        insn_buf[0] = RELATIVEJUMP_OPCODE;
-diff -urNp linux-3.0.4/arch/x86/kernel/kvm.c linux-3.0.4/arch/x86/kernel/kvm.c
---- linux-3.0.4/arch/x86/kernel/kvm.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/kvm.c  2011-08-24 18:10:12.000000000 -0400
-@@ -426,6 +426,7 @@ static void __init paravirt_ops_setup(vo
+diff -urNp linux-3.1.3/arch/x86/kernel/kvm.c linux-3.1.3/arch/x86/kernel/kvm.c
+--- linux-3.1.3/arch/x86/kernel/kvm.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/kvm.c  2011-11-16 18:39:07.000000000 -0500
+@@ -437,6 +437,7 @@ static void __init paravirt_ops_setup(vo
                pv_mmu_ops.set_pud = kvm_set_pud;
  #if PAGETABLE_LEVELS == 4
                pv_mmu_ops.set_pgd = kvm_set_pgd;
@@ -13651,9 +14558,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/kvm.c linux-3.0.4/arch/x86/kernel/kvm.c
  #endif
  #endif
                pv_mmu_ops.flush_tlb_user = kvm_flush_tlb;
-diff -urNp linux-3.0.4/arch/x86/kernel/ldt.c linux-3.0.4/arch/x86/kernel/ldt.c
---- linux-3.0.4/arch/x86/kernel/ldt.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/ldt.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/ldt.c linux-3.1.3/arch/x86/kernel/ldt.c
+--- linux-3.1.3/arch/x86/kernel/ldt.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/ldt.c  2011-11-16 18:39:07.000000000 -0500
 @@ -67,13 +67,13 @@ static int alloc_ldt(mm_context_t *pc, i
        if (reload) {
  #ifdef CONFIG_SMP
@@ -13718,9 +14625,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/ldt.c linux-3.0.4/arch/x86/kernel/ldt.c
        fill_ldt(&ldt, &ldt_info);
        if (oldmode)
                ldt.avl = 0;
-diff -urNp linux-3.0.4/arch/x86/kernel/machine_kexec_32.c linux-3.0.4/arch/x86/kernel/machine_kexec_32.c
---- linux-3.0.4/arch/x86/kernel/machine_kexec_32.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/machine_kexec_32.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/machine_kexec_32.c linux-3.1.3/arch/x86/kernel/machine_kexec_32.c
+--- linux-3.1.3/arch/x86/kernel/machine_kexec_32.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/machine_kexec_32.c     2011-11-16 18:39:07.000000000 -0500
 @@ -27,7 +27,7 @@
  #include <asm/cacheflush.h>
  #include <asm/debugreg.h>
@@ -13748,29 +14655,29 @@ diff -urNp linux-3.0.4/arch/x86/kernel/machine_kexec_32.c linux-3.0.4/arch/x86/k
  
        relocate_kernel_ptr = control_page;
        page_list[PA_CONTROL_PAGE] = __pa(control_page);
-diff -urNp linux-3.0.4/arch/x86/kernel/microcode_intel.c linux-3.0.4/arch/x86/kernel/microcode_intel.c
---- linux-3.0.4/arch/x86/kernel/microcode_intel.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/microcode_intel.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/microcode_intel.c linux-3.1.3/arch/x86/kernel/microcode_intel.c
+--- linux-3.1.3/arch/x86/kernel/microcode_intel.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/microcode_intel.c      2011-11-16 18:39:07.000000000 -0500
 @@ -440,13 +440,13 @@ static enum ucode_state request_microcod
  
  static int get_ucode_user(void *to, const void *from, size_t n)
  {
 -      return copy_from_user(to, from, n);
-+      return copy_from_user(to, (__force const void __user *)from, n);
++      return copy_from_user(to, (const void __force_user *)from, n);
  }
  
  static enum ucode_state
  request_microcode_user(int cpu, const void __user *buf, size_t size)
  {
 -      return generic_load_microcode(cpu, (void *)buf, size, &get_ucode_user);
-+      return generic_load_microcode(cpu, (__force void *)buf, size, &get_ucode_user);
++      return generic_load_microcode(cpu, (__force_kernel void *)buf, size, &get_ucode_user);
  }
  
  static void microcode_fini_cpu(int cpu)
-diff -urNp linux-3.0.4/arch/x86/kernel/module.c linux-3.0.4/arch/x86/kernel/module.c
---- linux-3.0.4/arch/x86/kernel/module.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/module.c       2011-08-23 21:47:55.000000000 -0400
-@@ -36,21 +36,66 @@
+diff -urNp linux-3.1.3/arch/x86/kernel/module.c linux-3.1.3/arch/x86/kernel/module.c
+--- linux-3.1.3/arch/x86/kernel/module.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/module.c       2011-11-16 18:39:07.000000000 -0500
+@@ -36,15 +36,60 @@
  #define DEBUGP(fmt...)
  #endif
  
@@ -13796,12 +14703,6 @@ diff -urNp linux-3.0.4/arch/x86/kernel/module.c linux-3.0.4/arch/x86/kernel/modu
 +
 +}
 +
- /* Free memory returned from module_alloc */
- void module_free(struct module *mod, void *module_region)
- {
-       vfree(module_region);
- }
 +#ifdef CONFIG_PAX_KERNEXEC
 +#ifdef CONFIG_X86_32
 +void *module_alloc_exec(unsigned long size)
@@ -13836,10 +14737,10 @@ diff -urNp linux-3.0.4/arch/x86/kernel/module.c linux-3.0.4/arch/x86/kernel/modu
 +#endif
 +#endif
 +
- /* We don't need anything special. */
- int module_frob_arch_sections(Elf_Ehdr *hdr,
-                             Elf_Shdr *sechdrs,
-@@ -70,14 +115,16 @@ int apply_relocate(Elf32_Shdr *sechdrs,
+ #ifdef CONFIG_X86_32
+ int apply_relocate(Elf32_Shdr *sechdrs,
+                  const char *strtab,
+@@ -55,14 +100,16 @@ int apply_relocate(Elf32_Shdr *sechdrs,
        unsigned int i;
        Elf32_Rel *rel = (void *)sechdrs[relsec].sh_addr;
        Elf32_Sym *sym;
@@ -13859,7 +14760,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/module.c linux-3.0.4/arch/x86/kernel/modu
                /* This is the symbol it is referring to.  Note that all
                   undefined symbols have been resolved.  */
                sym = (Elf32_Sym *)sechdrs[symindex].sh_addr
-@@ -86,11 +133,15 @@ int apply_relocate(Elf32_Shdr *sechdrs,
+@@ -71,11 +118,15 @@ int apply_relocate(Elf32_Shdr *sechdrs,
                switch (ELF32_R_TYPE(rel[i].r_info)) {
                case R_386_32:
                        /* We add the value into the location given */
@@ -13877,7 +14778,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/module.c linux-3.0.4/arch/x86/kernel/modu
                        break;
                default:
                        printk(KERN_ERR "module %s: Unknown relocation: %u\n",
-@@ -146,21 +197,30 @@ int apply_relocate_add(Elf64_Shdr *sechd
+@@ -120,21 +171,30 @@ int apply_relocate_add(Elf64_Shdr *sechd
                case R_X86_64_NONE:
                        break;
                case R_X86_64_64:
@@ -13908,9 +14809,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/module.c linux-3.0.4/arch/x86/kernel/modu
  #if 0
                        if ((s64)val != *(s32 *)loc)
                                goto overflow;
-diff -urNp linux-3.0.4/arch/x86/kernel/paravirt.c linux-3.0.4/arch/x86/kernel/paravirt.c
---- linux-3.0.4/arch/x86/kernel/paravirt.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/paravirt.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/paravirt.c linux-3.1.3/arch/x86/kernel/paravirt.c
+--- linux-3.1.3/arch/x86/kernel/paravirt.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/paravirt.c     2011-11-17 18:29:42.000000000 -0500
 @@ -53,6 +53,9 @@ u64 _paravirt_ident_64(u64 x)
  {
        return x;
@@ -13921,15 +14822,6 @@ diff -urNp linux-3.0.4/arch/x86/kernel/paravirt.c linux-3.0.4/arch/x86/kernel/pa
  
  void __init default_banner(void)
  {
-@@ -122,7 +125,7 @@ unsigned paravirt_patch_jmp(void *insnbu
-  * corresponding structure. */
- static void *get_call_destination(u8 type)
- {
--      struct paravirt_patch_template tmpl = {
-+      const struct paravirt_patch_template tmpl = {
-               .pv_init_ops = pv_init_ops,
-               .pv_time_ops = pv_time_ops,
-               .pv_cpu_ops = pv_cpu_ops,
 @@ -133,6 +136,9 @@ static void *get_call_destination(u8 typ
                .pv_lock_ops = pv_lock_ops,
  #endif
@@ -13972,7 +14864,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/paravirt.c linux-3.0.4/arch/x86/kernel/pa
  
        return insn_len;
  }
-@@ -294,22 +304,22 @@ void arch_flush_lazy_mmu_mode(void)
+@@ -302,7 +312,7 @@ void arch_flush_lazy_mmu_mode(void)
        preempt_enable();
  }
  
@@ -13981,7 +14873,8 @@ diff -urNp linux-3.0.4/arch/x86/kernel/paravirt.c linux-3.0.4/arch/x86/kernel/pa
        .name = "bare hardware",
        .paravirt_enabled = 0,
        .kernel_rpl = 0,
-       .shared_kernel_pmd = 1, /* Only used when CONFIG_X86_PAE is set */
+@@ -313,16 +323,16 @@ struct pv_info pv_info = {
+ #endif
  };
  
 -struct pv_init_ops pv_init_ops = {
@@ -13992,6 +14885,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/paravirt.c linux-3.0.4/arch/x86/kernel/pa
 -struct pv_time_ops pv_time_ops = {
 +struct pv_time_ops pv_time_ops __read_only = {
        .sched_clock = native_sched_clock,
+       .steal_clock = native_steal_clock,
  };
  
 -struct pv_irq_ops pv_irq_ops = {
@@ -13999,7 +14893,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/paravirt.c linux-3.0.4/arch/x86/kernel/pa
        .save_fl = __PV_IS_CALLEE_SAVE(native_save_fl),
        .restore_fl = __PV_IS_CALLEE_SAVE(native_restore_fl),
        .irq_disable = __PV_IS_CALLEE_SAVE(native_irq_disable),
-@@ -321,7 +331,7 @@ struct pv_irq_ops pv_irq_ops = {
+@@ -334,7 +344,7 @@ struct pv_irq_ops pv_irq_ops = {
  #endif
  };
  
@@ -14008,7 +14902,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/paravirt.c linux-3.0.4/arch/x86/kernel/pa
        .cpuid = native_cpuid,
        .get_debugreg = native_get_debugreg,
        .set_debugreg = native_set_debugreg,
-@@ -382,21 +392,26 @@ struct pv_cpu_ops pv_cpu_ops = {
+@@ -395,21 +405,26 @@ struct pv_cpu_ops pv_cpu_ops = {
        .end_context_switch = paravirt_nop,
  };
  
@@ -14038,7 +14932,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/paravirt.c linux-3.0.4/arch/x86/kernel/pa
  
        .read_cr2 = native_read_cr2,
        .write_cr2 = native_write_cr2,
-@@ -446,6 +461,7 @@ struct pv_mmu_ops pv_mmu_ops = {
+@@ -459,6 +474,7 @@ struct pv_mmu_ops pv_mmu_ops = {
        .make_pud = PTE_IDENT,
  
        .set_pgd = native_set_pgd,
@@ -14046,7 +14940,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/paravirt.c linux-3.0.4/arch/x86/kernel/pa
  #endif
  #endif /* PAGETABLE_LEVELS >= 3 */
  
-@@ -465,6 +481,12 @@ struct pv_mmu_ops pv_mmu_ops = {
+@@ -478,6 +494,12 @@ struct pv_mmu_ops pv_mmu_ops = {
        },
  
        .set_fixmap = native_set_fixmap,
@@ -14059,9 +14953,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/paravirt.c linux-3.0.4/arch/x86/kernel/pa
  };
  
  EXPORT_SYMBOL_GPL(pv_time_ops);
-diff -urNp linux-3.0.4/arch/x86/kernel/paravirt-spinlocks.c linux-3.0.4/arch/x86/kernel/paravirt-spinlocks.c
---- linux-3.0.4/arch/x86/kernel/paravirt-spinlocks.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/paravirt-spinlocks.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/paravirt-spinlocks.c linux-3.1.3/arch/x86/kernel/paravirt-spinlocks.c
+--- linux-3.1.3/arch/x86/kernel/paravirt-spinlocks.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/paravirt-spinlocks.c   2011-11-16 18:39:07.000000000 -0500
 @@ -13,7 +13,7 @@ default_spin_lock_flags(arch_spinlock_t 
        arch_spin_lock(lock);
  }
@@ -14071,9 +14965,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/paravirt-spinlocks.c linux-3.0.4/arch/x86
  #ifdef CONFIG_SMP
        .spin_is_locked = __ticket_spin_is_locked,
        .spin_is_contended = __ticket_spin_is_contended,
-diff -urNp linux-3.0.4/arch/x86/kernel/pci-iommu_table.c linux-3.0.4/arch/x86/kernel/pci-iommu_table.c
---- linux-3.0.4/arch/x86/kernel/pci-iommu_table.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/pci-iommu_table.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/pci-iommu_table.c linux-3.1.3/arch/x86/kernel/pci-iommu_table.c
+--- linux-3.1.3/arch/x86/kernel/pci-iommu_table.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/pci-iommu_table.c      2011-11-16 18:40:08.000000000 -0500
 @@ -2,7 +2,7 @@
  #include <asm/iommu_table.h>
  #include <linux/string.h>
@@ -14092,10 +14986,10 @@ diff -urNp linux-3.0.4/arch/x86/kernel/pci-iommu_table.c linux-3.0.4/arch/x86/ke
        /* Simple cyclic dependency checker. */
        for (p = start; p < finish; p++) {
                q = find_dependents_of(start, finish, p);
-diff -urNp linux-3.0.4/arch/x86/kernel/process_32.c linux-3.0.4/arch/x86/kernel/process_32.c
---- linux-3.0.4/arch/x86/kernel/process_32.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/process_32.c   2011-08-23 21:47:55.000000000 -0400
-@@ -65,6 +65,7 @@ asmlinkage void ret_from_fork(void) __as
+diff -urNp linux-3.1.3/arch/x86/kernel/process_32.c linux-3.1.3/arch/x86/kernel/process_32.c
+--- linux-3.1.3/arch/x86/kernel/process_32.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/process_32.c   2011-11-16 18:39:07.000000000 -0500
+@@ -66,6 +66,7 @@ asmlinkage void ret_from_fork(void) __as
  unsigned long thread_saved_pc(struct task_struct *tsk)
  {
        return ((unsigned long *)tsk->thread.sp)[3];
@@ -14103,7 +14997,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/process_32.c linux-3.0.4/arch/x86/kernel/
  }
  
  #ifndef CONFIG_SMP
-@@ -126,15 +127,14 @@ void __show_regs(struct pt_regs *regs, i
+@@ -128,15 +129,14 @@ void __show_regs(struct pt_regs *regs, i
        unsigned long sp;
        unsigned short ss, gs;
  
@@ -14121,7 +15015,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/process_32.c linux-3.0.4/arch/x86/kernel/
  
        show_regs_common();
  
-@@ -196,13 +196,14 @@ int copy_thread(unsigned long clone_flag
+@@ -198,13 +198,14 @@ int copy_thread(unsigned long clone_flag
        struct task_struct *tsk;
        int err;
  
@@ -14137,7 +15031,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/process_32.c linux-3.0.4/arch/x86/kernel/
  
        p->thread.ip = (unsigned long) ret_from_fork;
  
-@@ -292,7 +293,7 @@ __switch_to(struct task_struct *prev_p, 
+@@ -294,7 +295,7 @@ __switch_to(struct task_struct *prev_p, 
        struct thread_struct *prev = &prev_p->thread,
                                 *next = &next_p->thread;
        int cpu = smp_processor_id();
@@ -14146,7 +15040,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/process_32.c linux-3.0.4/arch/x86/kernel/
        bool preload_fpu;
  
        /* never put a printk in __switch_to... printk() calls wake_up*() indirectly */
-@@ -327,6 +328,10 @@ __switch_to(struct task_struct *prev_p, 
+@@ -329,6 +330,10 @@ __switch_to(struct task_struct *prev_p, 
         */
        lazy_save_gs(prev->gs);
  
@@ -14157,7 +15051,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/process_32.c linux-3.0.4/arch/x86/kernel/
        /*
         * Load the per-thread Thread-Local Storage descriptor.
         */
-@@ -362,6 +367,9 @@ __switch_to(struct task_struct *prev_p, 
+@@ -364,6 +369,9 @@ __switch_to(struct task_struct *prev_p, 
         */
        arch_end_context_switch(next_p);
  
@@ -14167,7 +15061,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/process_32.c linux-3.0.4/arch/x86/kernel/
        if (preload_fpu)
                __math_state_restore();
  
-@@ -371,8 +379,6 @@ __switch_to(struct task_struct *prev_p, 
+@@ -373,8 +381,6 @@ __switch_to(struct task_struct *prev_p, 
        if (prev->gs | next->gs)
                lazy_load_gs(next->gs);
  
@@ -14176,15 +15070,15 @@ diff -urNp linux-3.0.4/arch/x86/kernel/process_32.c linux-3.0.4/arch/x86/kernel/
        return prev_p;
  }
  
-@@ -402,4 +408,3 @@ unsigned long get_wchan(struct task_stru
+@@ -404,4 +410,3 @@ unsigned long get_wchan(struct task_stru
        } while (count++ < 16);
        return 0;
  }
 -
-diff -urNp linux-3.0.4/arch/x86/kernel/process_64.c linux-3.0.4/arch/x86/kernel/process_64.c
---- linux-3.0.4/arch/x86/kernel/process_64.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/process_64.c   2011-08-23 21:47:55.000000000 -0400
-@@ -87,7 +87,7 @@ static void __exit_idle(void)
+diff -urNp linux-3.1.3/arch/x86/kernel/process_64.c linux-3.1.3/arch/x86/kernel/process_64.c
+--- linux-3.1.3/arch/x86/kernel/process_64.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/process_64.c   2011-11-16 18:39:07.000000000 -0500
+@@ -88,7 +88,7 @@ static void __exit_idle(void)
  void exit_idle(void)
  {
        /* idle loop has pid 0 */
@@ -14193,7 +15087,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/process_64.c linux-3.0.4/arch/x86/kernel/
                return;
        __exit_idle();
  }
-@@ -260,8 +260,7 @@ int copy_thread(unsigned long clone_flag
+@@ -262,8 +262,7 @@ int copy_thread(unsigned long clone_flag
        struct pt_regs *childregs;
        struct task_struct *me = current;
  
@@ -14203,7 +15097,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/process_64.c linux-3.0.4/arch/x86/kernel/
        *childregs = *regs;
  
        childregs->ax = 0;
-@@ -273,6 +272,7 @@ int copy_thread(unsigned long clone_flag
+@@ -275,6 +274,7 @@ int copy_thread(unsigned long clone_flag
        p->thread.sp = (unsigned long) childregs;
        p->thread.sp0 = (unsigned long) (childregs+1);
        p->thread.usersp = me->thread.usersp;
@@ -14211,7 +15105,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/process_64.c linux-3.0.4/arch/x86/kernel/
  
        set_tsk_thread_flag(p, TIF_FORK);
  
-@@ -375,7 +375,7 @@ __switch_to(struct task_struct *prev_p, 
+@@ -377,7 +377,7 @@ __switch_to(struct task_struct *prev_p, 
        struct thread_struct *prev = &prev_p->thread;
        struct thread_struct *next = &next_p->thread;
        int cpu = smp_processor_id();
@@ -14220,7 +15114,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/process_64.c linux-3.0.4/arch/x86/kernel/
        unsigned fsindex, gsindex;
        bool preload_fpu;
  
-@@ -471,10 +471,9 @@ __switch_to(struct task_struct *prev_p, 
+@@ -473,10 +473,9 @@ __switch_to(struct task_struct *prev_p, 
        prev->usersp = percpu_read(old_rsp);
        percpu_write(old_rsp, next->usersp);
        percpu_write(current_task, next_p);
@@ -14233,7 +15127,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/process_64.c linux-3.0.4/arch/x86/kernel/
  
        /*
         * Now maybe reload the debug registers and handle I/O bitmaps
-@@ -536,12 +535,11 @@ unsigned long get_wchan(struct task_stru
+@@ -538,12 +537,11 @@ unsigned long get_wchan(struct task_stru
        if (!p || p == current || p->state == TASK_RUNNING)
                return 0;
        stack = (unsigned long)task_stack_page(p);
@@ -14248,9 +15142,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/process_64.c linux-3.0.4/arch/x86/kernel/
                        return 0;
                ip = *(u64 *)(fp+8);
                if (!in_sched_functions(ip))
-diff -urNp linux-3.0.4/arch/x86/kernel/process.c linux-3.0.4/arch/x86/kernel/process.c
---- linux-3.0.4/arch/x86/kernel/process.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/process.c      2011-08-30 18:23:52.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/process.c linux-3.1.3/arch/x86/kernel/process.c
+--- linux-3.1.3/arch/x86/kernel/process.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/process.c      2011-11-16 18:39:07.000000000 -0500
 @@ -48,16 +48,33 @@ void free_thread_xstate(struct task_stru
  
  void free_thread_info(struct thread_info *ti)
@@ -14340,7 +15234,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/process.c linux-3.0.4/arch/x86/kernel/pro
  {
        local_irq_disable();
        /*
-@@ -668,16 +688,37 @@ static int __init idle_setup(char *str)
+@@ -645,16 +665,37 @@ static int __init idle_setup(char *str)
  }
  early_param("idle", idle_setup);
  
@@ -14388,10 +15282,10 @@ diff -urNp linux-3.0.4/arch/x86/kernel/process.c linux-3.0.4/arch/x86/kernel/pro
 +#endif
 +}
 +#endif
-diff -urNp linux-3.0.4/arch/x86/kernel/ptrace.c linux-3.0.4/arch/x86/kernel/ptrace.c
---- linux-3.0.4/arch/x86/kernel/ptrace.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/ptrace.c       2011-08-23 21:47:55.000000000 -0400
-@@ -821,7 +821,7 @@ long arch_ptrace(struct task_struct *chi
+diff -urNp linux-3.1.3/arch/x86/kernel/ptrace.c linux-3.1.3/arch/x86/kernel/ptrace.c
+--- linux-3.1.3/arch/x86/kernel/ptrace.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/ptrace.c       2011-11-16 18:39:07.000000000 -0500
+@@ -822,7 +822,7 @@ long arch_ptrace(struct task_struct *chi
                 unsigned long addr, unsigned long data)
  {
        int ret;
@@ -14400,7 +15294,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/ptrace.c linux-3.0.4/arch/x86/kernel/ptra
  
        switch (request) {
        /* read the word at location addr in the USER area. */
-@@ -906,14 +906,14 @@ long arch_ptrace(struct task_struct *chi
+@@ -907,14 +907,14 @@ long arch_ptrace(struct task_struct *chi
                if ((int) addr < 0)
                        return -EIO;
                ret = do_get_thread_area(child, addr,
@@ -14417,7 +15311,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/ptrace.c linux-3.0.4/arch/x86/kernel/ptra
                break;
  #endif
  
-@@ -1330,7 +1330,7 @@ static void fill_sigtrap_info(struct tas
+@@ -1331,7 +1331,7 @@ static void fill_sigtrap_info(struct tas
        memset(info, 0, sizeof(*info));
        info->si_signo = SIGTRAP;
        info->si_code = si_code;
@@ -14426,9 +15320,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/ptrace.c linux-3.0.4/arch/x86/kernel/ptra
  }
  
  void user_single_step_siginfo(struct task_struct *tsk,
-diff -urNp linux-3.0.4/arch/x86/kernel/pvclock.c linux-3.0.4/arch/x86/kernel/pvclock.c
---- linux-3.0.4/arch/x86/kernel/pvclock.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/pvclock.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/pvclock.c linux-3.1.3/arch/x86/kernel/pvclock.c
+--- linux-3.1.3/arch/x86/kernel/pvclock.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/pvclock.c      2011-11-16 18:39:07.000000000 -0500
 @@ -81,11 +81,11 @@ unsigned long pvclock_tsc_khz(struct pvc
        return pv_tsc_khz;
  }
@@ -14457,9 +15351,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/pvclock.c linux-3.0.4/arch/x86/kernel/pvc
        } while (unlikely(last != ret));
  
        return ret;
-diff -urNp linux-3.0.4/arch/x86/kernel/reboot.c linux-3.0.4/arch/x86/kernel/reboot.c
---- linux-3.0.4/arch/x86/kernel/reboot.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/reboot.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/reboot.c linux-3.1.3/arch/x86/kernel/reboot.c
+--- linux-3.1.3/arch/x86/kernel/reboot.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/reboot.c       2011-11-16 18:39:07.000000000 -0500
 @@ -35,7 +35,7 @@ void (*pm_power_off)(void);
  EXPORT_SYMBOL(pm_power_off);
  
@@ -14591,9 +15485,18 @@ diff -urNp linux-3.0.4/arch/x86/kernel/reboot.c linux-3.0.4/arch/x86/kernel/rebo
  }
  
  struct machine_ops machine_ops = {
-diff -urNp linux-3.0.4/arch/x86/kernel/setup.c linux-3.0.4/arch/x86/kernel/setup.c
---- linux-3.0.4/arch/x86/kernel/setup.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/setup.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/setup.c linux-3.1.3/arch/x86/kernel/setup.c
+--- linux-3.1.3/arch/x86/kernel/setup.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/setup.c        2011-11-16 18:39:07.000000000 -0500
+@@ -447,7 +447,7 @@ static void __init parse_setup_data(void
+               switch (data->type) {
+               case SETUP_E820_EXT:
+-                      parse_e820_ext(data);
++                      parse_e820_ext((struct setup_data __force_kernel *)data);
+                       break;
+               case SETUP_DTB:
+                       add_dtb(pa_data);
 @@ -650,7 +650,7 @@ static void __init trim_bios_range(void)
         * area (640->1Mb) as ram even though it is not.
         * take them out.
@@ -14623,9 +15526,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/setup.c linux-3.0.4/arch/x86/kernel/setup
        data_resource.end = virt_to_phys(_edata)-1;
        bss_resource.start = virt_to_phys(&__bss_start);
        bss_resource.end = virt_to_phys(&__bss_stop)-1;
-diff -urNp linux-3.0.4/arch/x86/kernel/setup_percpu.c linux-3.0.4/arch/x86/kernel/setup_percpu.c
---- linux-3.0.4/arch/x86/kernel/setup_percpu.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/setup_percpu.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/setup_percpu.c linux-3.1.3/arch/x86/kernel/setup_percpu.c
+--- linux-3.1.3/arch/x86/kernel/setup_percpu.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/setup_percpu.c 2011-11-16 18:39:07.000000000 -0500
 @@ -21,19 +21,17 @@
  #include <asm/cpu.h>
  #include <asm/stackprotector.h>
@@ -14689,9 +15592,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/setup_percpu.c linux-3.0.4/arch/x86/kerne
                /*
                 * Up to this point, the boot CPU has been using .init.data
                 * area.  Reload any changed state for the boot CPU.
-diff -urNp linux-3.0.4/arch/x86/kernel/signal.c linux-3.0.4/arch/x86/kernel/signal.c
---- linux-3.0.4/arch/x86/kernel/signal.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/signal.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/signal.c linux-3.1.3/arch/x86/kernel/signal.c
+--- linux-3.1.3/arch/x86/kernel/signal.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/signal.c       2011-11-16 19:39:49.000000000 -0500
 @@ -198,7 +198,7 @@ static unsigned long align_sigframe(unsi
         * Align the stack pointer according to the i386 ABI,
         * i.e. so that on function entry ((sp + 4) & 15) == 0.
@@ -14757,16 +15660,16 @@ diff -urNp linux-3.0.4/arch/x86/kernel/signal.c linux-3.0.4/arch/x86/kernel/sign
        } put_user_catch(err);
  
        if (err)
-@@ -769,6 +772,8 @@ static void do_signal(struct pt_regs *re
+@@ -762,6 +765,8 @@ static void do_signal(struct pt_regs *re
+       siginfo_t info;
        int signr;
-       sigset_t *oldset;
  
 +      pax_track_stack();
 +
        /*
         * We want the common case to go fast, which is why we may in certain
         * cases get here from kernel mode. Just return without doing anything
-@@ -776,7 +781,7 @@ static void do_signal(struct pt_regs *re
+@@ -769,7 +774,7 @@ static void do_signal(struct pt_regs *re
         * X86_32: vm86 regs switched out by assembly code before reaching
         * here, so testing against kernel CS suffices.
         */
@@ -14774,10 +15677,10 @@ diff -urNp linux-3.0.4/arch/x86/kernel/signal.c linux-3.0.4/arch/x86/kernel/sign
 +      if (!user_mode_novm(regs))
                return;
  
-       if (current_thread_info()->status & TS_RESTORE_SIGMASK)
-diff -urNp linux-3.0.4/arch/x86/kernel/smpboot.c linux-3.0.4/arch/x86/kernel/smpboot.c
---- linux-3.0.4/arch/x86/kernel/smpboot.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/smpboot.c      2011-08-23 21:47:55.000000000 -0400
+       signr = get_signal_to_deliver(&info, &ka, regs, NULL);
+diff -urNp linux-3.1.3/arch/x86/kernel/smpboot.c linux-3.1.3/arch/x86/kernel/smpboot.c
+--- linux-3.1.3/arch/x86/kernel/smpboot.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/smpboot.c      2011-11-16 18:39:07.000000000 -0500
 @@ -709,17 +709,20 @@ static int __cpuinit do_boot_cpu(int api
        set_idle_for_cpu(cpu, c_idle.idle);
  do_rest:
@@ -14815,9 +15718,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/smpboot.c linux-3.0.4/arch/x86/kernel/smp
        err = do_boot_cpu(apicid, cpu);
        if (err) {
                pr_debug("do_boot_cpu failed %d\n", err);
-diff -urNp linux-3.0.4/arch/x86/kernel/step.c linux-3.0.4/arch/x86/kernel/step.c
---- linux-3.0.4/arch/x86/kernel/step.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/step.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/step.c linux-3.1.3/arch/x86/kernel/step.c
+--- linux-3.1.3/arch/x86/kernel/step.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/step.c 2011-11-16 18:39:07.000000000 -0500
 @@ -27,10 +27,10 @@ unsigned long convert_ip_to_linear(struc
                struct desc_struct *desc;
                unsigned long base;
@@ -14851,26 +15754,17 @@ diff -urNp linux-3.0.4/arch/x86/kernel/step.c linux-3.0.4/arch/x86/kernel/step.c
        copied = access_process_vm(child, addr, opcode, sizeof(opcode), 0);
        for (i = 0; i < copied; i++) {
                switch (opcode[i]) {
-@@ -74,7 +78,7 @@ static int is_setting_trap_flag(struct t
- #ifdef CONFIG_X86_64
-               case 0x40 ... 0x4f:
--                      if (regs->cs != __USER_CS)
-+                      if ((regs->cs & 0xffff) != __USER_CS)
-                               /* 32-bit mode: register increment */
-                               return 0;
-                       /* 64-bit mode: REX prefix */
-diff -urNp linux-3.0.4/arch/x86/kernel/syscall_table_32.S linux-3.0.4/arch/x86/kernel/syscall_table_32.S
---- linux-3.0.4/arch/x86/kernel/syscall_table_32.S     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/syscall_table_32.S     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/syscall_table_32.S linux-3.1.3/arch/x86/kernel/syscall_table_32.S
+--- linux-3.1.3/arch/x86/kernel/syscall_table_32.S     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/syscall_table_32.S     2011-11-16 18:39:07.000000000 -0500
 @@ -1,3 +1,4 @@
 +.section .rodata,"a",@progbits
  ENTRY(sys_call_table)
        .long sys_restart_syscall       /* 0 - old "setup()" system call, used for restarting */
        .long sys_exit
-diff -urNp linux-3.0.4/arch/x86/kernel/sys_i386_32.c linux-3.0.4/arch/x86/kernel/sys_i386_32.c
---- linux-3.0.4/arch/x86/kernel/sys_i386_32.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/sys_i386_32.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/sys_i386_32.c linux-3.1.3/arch/x86/kernel/sys_i386_32.c
+--- linux-3.1.3/arch/x86/kernel/sys_i386_32.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/sys_i386_32.c  2011-11-16 18:39:07.000000000 -0500
 @@ -24,17 +24,224 @@
  
  #include <asm/syscalls.h>
@@ -15108,9 +16002,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/sys_i386_32.c linux-3.0.4/arch/x86/kernel
 +
 +      return addr;
  }
-diff -urNp linux-3.0.4/arch/x86/kernel/sys_x86_64.c linux-3.0.4/arch/x86/kernel/sys_x86_64.c
---- linux-3.0.4/arch/x86/kernel/sys_x86_64.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/sys_x86_64.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/sys_x86_64.c linux-3.1.3/arch/x86/kernel/sys_x86_64.c
+--- linux-3.1.3/arch/x86/kernel/sys_x86_64.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/sys_x86_64.c   2011-11-16 18:39:07.000000000 -0500
 @@ -32,8 +32,8 @@ out:
        return error;
  }
@@ -15248,10 +16142,10 @@ diff -urNp linux-3.0.4/arch/x86/kernel/sys_x86_64.c linux-3.0.4/arch/x86/kernel/
        mm->cached_hole_size = ~0UL;
  
        return addr;
-diff -urNp linux-3.0.4/arch/x86/kernel/tboot.c linux-3.0.4/arch/x86/kernel/tboot.c
---- linux-3.0.4/arch/x86/kernel/tboot.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/tboot.c        2011-08-23 21:47:55.000000000 -0400
-@@ -217,7 +217,7 @@ static int tboot_setup_sleep(void)
+diff -urNp linux-3.1.3/arch/x86/kernel/tboot.c linux-3.1.3/arch/x86/kernel/tboot.c
+--- linux-3.1.3/arch/x86/kernel/tboot.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/tboot.c        2011-11-16 18:39:07.000000000 -0500
+@@ -218,7 +218,7 @@ static int tboot_setup_sleep(void)
  
  void tboot_shutdown(u32 shutdown_type)
  {
@@ -15260,7 +16154,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/tboot.c linux-3.0.4/arch/x86/kernel/tboot
  
        if (!tboot_enabled())
                return;
-@@ -239,7 +239,7 @@ void tboot_shutdown(u32 shutdown_type)
+@@ -240,7 +240,7 @@ void tboot_shutdown(u32 shutdown_type)
  
        switch_to_tboot_pt();
  
@@ -15269,7 +16163,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/tboot.c linux-3.0.4/arch/x86/kernel/tboot
        shutdown();
  
        /* should not reach here */
-@@ -296,7 +296,7 @@ void tboot_sleep(u8 sleep_state, u32 pm1
+@@ -297,7 +297,7 @@ void tboot_sleep(u8 sleep_state, u32 pm1
        tboot_shutdown(acpi_shutdown_map[sleep_state]);
  }
  
@@ -15278,7 +16172,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/tboot.c linux-3.0.4/arch/x86/kernel/tboot
  
  static int tboot_wait_for_aps(int num_aps)
  {
-@@ -320,9 +320,9 @@ static int __cpuinit tboot_cpu_callback(
+@@ -321,9 +321,9 @@ static int __cpuinit tboot_cpu_callback(
  {
        switch (action) {
        case CPU_DYING:
@@ -15290,7 +16184,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/tboot.c linux-3.0.4/arch/x86/kernel/tboot
                                return NOTIFY_BAD;
                break;
        }
-@@ -341,7 +341,7 @@ static __init int tboot_late_init(void)
+@@ -342,7 +342,7 @@ static __init int tboot_late_init(void)
  
        tboot_create_trampoline();
  
@@ -15299,9 +16193,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/tboot.c linux-3.0.4/arch/x86/kernel/tboot
        register_hotcpu_notifier(&tboot_cpu_notifier);
        return 0;
  }
-diff -urNp linux-3.0.4/arch/x86/kernel/time.c linux-3.0.4/arch/x86/kernel/time.c
---- linux-3.0.4/arch/x86/kernel/time.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/time.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/time.c linux-3.1.3/arch/x86/kernel/time.c
+--- linux-3.1.3/arch/x86/kernel/time.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/time.c 2011-11-16 18:39:07.000000000 -0500
 @@ -30,9 +30,9 @@ unsigned long profile_pc(struct pt_regs 
  {
        unsigned long pc = instruction_pointer(regs);
@@ -15332,9 +16226,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/time.c linux-3.0.4/arch/x86/kernel/time.c
        }
        return pc;
  }
-diff -urNp linux-3.0.4/arch/x86/kernel/tls.c linux-3.0.4/arch/x86/kernel/tls.c
---- linux-3.0.4/arch/x86/kernel/tls.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/tls.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/tls.c linux-3.1.3/arch/x86/kernel/tls.c
+--- linux-3.1.3/arch/x86/kernel/tls.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/tls.c  2011-11-16 18:39:07.000000000 -0500
 @@ -85,6 +85,11 @@ int do_set_thread_area(struct task_struc
        if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX)
                return -EINVAL;
@@ -15347,9 +16241,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/tls.c linux-3.0.4/arch/x86/kernel/tls.c
        set_tls_desc(p, idx, &info, 1);
  
        return 0;
-diff -urNp linux-3.0.4/arch/x86/kernel/trampoline_32.S linux-3.0.4/arch/x86/kernel/trampoline_32.S
---- linux-3.0.4/arch/x86/kernel/trampoline_32.S        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/trampoline_32.S        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/trampoline_32.S linux-3.1.3/arch/x86/kernel/trampoline_32.S
+--- linux-3.1.3/arch/x86/kernel/trampoline_32.S        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/trampoline_32.S        2011-11-16 18:39:07.000000000 -0500
 @@ -32,6 +32,12 @@
  #include <asm/segment.h>
  #include <asm/page_types.h>
@@ -15372,9 +16266,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/trampoline_32.S linux-3.0.4/arch/x86/kern
  
        # These need to be in the same 64K segment as the above;
        # hence we don't use the boot_gdt_descr defined in head.S
-diff -urNp linux-3.0.4/arch/x86/kernel/trampoline_64.S linux-3.0.4/arch/x86/kernel/trampoline_64.S
---- linux-3.0.4/arch/x86/kernel/trampoline_64.S        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/trampoline_64.S        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/trampoline_64.S linux-3.1.3/arch/x86/kernel/trampoline_64.S
+--- linux-3.1.3/arch/x86/kernel/trampoline_64.S        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/trampoline_64.S        2011-11-16 18:39:07.000000000 -0500
 @@ -90,7 +90,7 @@ startup_32:
        movl    $__KERNEL_DS, %eax      # Initialize the %ds segment register
        movl    %eax, %ds
@@ -15393,9 +16287,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/trampoline_64.S linux-3.0.4/arch/x86/kern
        .long   tgdt - r_base
        .short 0
        .quad   0x00cf9b000000ffff      # __KERNEL32_CS
-diff -urNp linux-3.0.4/arch/x86/kernel/traps.c linux-3.0.4/arch/x86/kernel/traps.c
---- linux-3.0.4/arch/x86/kernel/traps.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/traps.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/traps.c linux-3.1.3/arch/x86/kernel/traps.c
+--- linux-3.1.3/arch/x86/kernel/traps.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/traps.c        2011-11-16 18:39:07.000000000 -0500
 @@ -70,12 +70,6 @@ asmlinkage int system_call(void);
  
  /* Do we ignore FPU interrupts ? */
@@ -15575,9 +16469,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/traps.c linux-3.0.4/arch/x86/kernel/traps
  
        if (!tsk_used_math(tsk)) {
                local_irq_enable();
-diff -urNp linux-3.0.4/arch/x86/kernel/verify_cpu.S linux-3.0.4/arch/x86/kernel/verify_cpu.S
---- linux-3.0.4/arch/x86/kernel/verify_cpu.S   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/verify_cpu.S   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/verify_cpu.S linux-3.1.3/arch/x86/kernel/verify_cpu.S
+--- linux-3.1.3/arch/x86/kernel/verify_cpu.S   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/verify_cpu.S   2011-11-16 18:40:08.000000000 -0500
 @@ -20,6 +20,7 @@
   *    arch/x86/boot/compressed/head_64.S: Boot cpu verification
   *    arch/x86/kernel/trampoline_64.S: secondary processor verification
@@ -15586,9 +16480,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/verify_cpu.S linux-3.0.4/arch/x86/kernel/
   *
   *    verify_cpu, returns the status of longmode and SSE in register %eax.
   *            0: Success    1: Failure
-diff -urNp linux-3.0.4/arch/x86/kernel/vm86_32.c linux-3.0.4/arch/x86/kernel/vm86_32.c
---- linux-3.0.4/arch/x86/kernel/vm86_32.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/vm86_32.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/vm86_32.c linux-3.1.3/arch/x86/kernel/vm86_32.c
+--- linux-3.1.3/arch/x86/kernel/vm86_32.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/vm86_32.c      2011-11-16 18:40:08.000000000 -0500
 @@ -41,6 +41,7 @@
  #include <linux/ptrace.h>
  #include <linux/audit.h>
@@ -15653,9 +16547,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/vm86_32.c linux-3.0.4/arch/x86/kernel/vm8
        if (get_user(segoffs, intr_ptr))
                goto cannot_handle;
        if ((segoffs >> 16) == BIOSSEG)
-diff -urNp linux-3.0.4/arch/x86/kernel/vmlinux.lds.S linux-3.0.4/arch/x86/kernel/vmlinux.lds.S
---- linux-3.0.4/arch/x86/kernel/vmlinux.lds.S  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/vmlinux.lds.S  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/vmlinux.lds.S linux-3.1.3/arch/x86/kernel/vmlinux.lds.S
+--- linux-3.1.3/arch/x86/kernel/vmlinux.lds.S  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/vmlinux.lds.S  2011-11-16 18:39:07.000000000 -0500
 @@ -26,6 +26,13 @@
  #include <asm/page_types.h>
  #include <asm/cache.h>
@@ -15670,7 +16564,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/vmlinux.lds.S linux-3.0.4/arch/x86/kernel
  
  #undef i386     /* in case the preprocessor is a 32bit one */
  
-@@ -69,31 +76,46 @@ jiffies_64 = jiffies;
+@@ -69,30 +76,43 @@ jiffies_64 = jiffies;
  
  PHDRS {
        text PT_LOAD FLAGS(5);          /* R_E */
@@ -15683,9 +16577,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/vmlinux.lds.S linux-3.0.4/arch/x86/kernel
 +      rodata PT_LOAD FLAGS(4);        /* R__ */
 +#endif
        data PT_LOAD FLAGS(6);          /* RW_ */
- #ifdef CONFIG_X86_64
-       user PT_LOAD FLAGS(5);          /* R_E */
-+#endif
+-#ifdef CONFIG_X86_64
 +      init.begin PT_LOAD FLAGS(6);    /* RW_ */
  #ifdef CONFIG_SMP
        percpu PT_LOAD FLAGS(6);        /* RW_ */
@@ -15724,7 +16616,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/vmlinux.lds.S linux-3.0.4/arch/x86/kernel
                HEAD_TEXT
  #ifdef CONFIG_X86_32
                . = ALIGN(PAGE_SIZE);
-@@ -109,13 +131,47 @@ SECTIONS
+@@ -108,13 +128,47 @@ SECTIONS
                IRQENTRY_TEXT
                *(.fixup)
                *(.gnu.warning)
@@ -15776,7 +16668,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/vmlinux.lds.S linux-3.0.4/arch/x86/kernel
  
  #if defined(CONFIG_DEBUG_RODATA)
        /* .text should occupy whole number of pages */
-@@ -127,16 +183,20 @@ SECTIONS
+@@ -126,16 +180,20 @@ SECTIONS
  
        /* Data */
        .data : AT(ADDR(.data) - LOAD_OFFSET) {
@@ -15800,7 +16692,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/vmlinux.lds.S linux-3.0.4/arch/x86/kernel
  
                PAGE_ALIGNED_DATA(PAGE_SIZE)
  
-@@ -208,12 +268,19 @@ SECTIONS
+@@ -176,12 +234,19 @@ SECTIONS
  #endif /* CONFIG_X86_64 */
  
        /* Init code and data - will be freed after init */
@@ -15823,7 +16715,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/vmlinux.lds.S linux-3.0.4/arch/x86/kernel
        /*
         * percpu offsets are zero-based on SMP.  PERCPU_VADDR() changes the
         * output PHDR, so the next output section - .init.text - should
-@@ -222,12 +289,27 @@ SECTIONS
+@@ -190,12 +255,27 @@ SECTIONS
        PERCPU_VADDR(INTERNODE_CACHE_BYTES, 0, :percpu)
  #endif
  
@@ -15856,7 +16748,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/vmlinux.lds.S linux-3.0.4/arch/x86/kernel
  
        /*
         * Code and data for a variety of lowlevel trampolines, to be
-@@ -301,19 +383,12 @@ SECTIONS
+@@ -269,19 +349,12 @@ SECTIONS
        }
  
        . = ALIGN(8);
@@ -15877,7 +16769,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/vmlinux.lds.S linux-3.0.4/arch/x86/kernel
        PERCPU_SECTION(INTERNODE_CACHE_BYTES)
  #endif
  
-@@ -332,16 +407,10 @@ SECTIONS
+@@ -300,16 +373,10 @@ SECTIONS
        .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
                __smp_locks = .;
                *(.smp_locks)
@@ -15895,7 +16787,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/vmlinux.lds.S linux-3.0.4/arch/x86/kernel
        /* BSS */
        . = ALIGN(PAGE_SIZE);
        .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
-@@ -357,6 +426,7 @@ SECTIONS
+@@ -325,6 +392,7 @@ SECTIONS
                __brk_base = .;
                . += 64 * 1024;         /* 64k alignment slop space */
                *(.brk_reservation)     /* areas brk users have reserved */
@@ -15903,7 +16795,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/vmlinux.lds.S linux-3.0.4/arch/x86/kernel
                __brk_limit = .;
        }
  
-@@ -383,13 +453,12 @@ SECTIONS
+@@ -351,13 +419,12 @@ SECTIONS
   * for the boot processor.
   */
  #define INIT_PER_CPU(x) init_per_cpu__##x = x + __per_cpu_load
@@ -15918,30 +16810,60 @@ diff -urNp linux-3.0.4/arch/x86/kernel/vmlinux.lds.S linux-3.0.4/arch/x86/kernel
           "kernel image bigger than KERNEL_IMAGE_SIZE");
  
  #ifdef CONFIG_SMP
-diff -urNp linux-3.0.4/arch/x86/kernel/vsyscall_64.c linux-3.0.4/arch/x86/kernel/vsyscall_64.c
---- linux-3.0.4/arch/x86/kernel/vsyscall_64.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/vsyscall_64.c  2011-08-23 21:47:55.000000000 -0400
-@@ -53,7 +53,7 @@ DEFINE_VVAR(int, vgetcpu_mode);
- DEFINE_VVAR(struct vsyscall_gtod_data, vsyscall_gtod_data) =
- {
+diff -urNp linux-3.1.3/arch/x86/kernel/vsyscall_64.c linux-3.1.3/arch/x86/kernel/vsyscall_64.c
+--- linux-3.1.3/arch/x86/kernel/vsyscall_64.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/vsyscall_64.c  2011-11-16 18:39:07.000000000 -0500
+@@ -56,15 +56,13 @@ DEFINE_VVAR(struct vsyscall_gtod_data, v
        .lock = __SEQLOCK_UNLOCKED(__vsyscall_gtod_data.lock),
--      .sysctl_enabled = 1,
-+      .sysctl_enabled = 0,
  };
  
- void update_vsyscall_tz(void)
-@@ -231,7 +231,7 @@ static long __vsyscall(3) venosys_1(void
- static ctl_table kernel_table2[] = {
-       { .procname = "vsyscall64",
-         .data = &vsyscall_gtod_data.sysctl_enabled, .maxlen = sizeof(int),
--        .mode = 0644,
-+        .mode = 0444,
-         .proc_handler = proc_dointvec },
-       {}
- };
-diff -urNp linux-3.0.4/arch/x86/kernel/x8664_ksyms_64.c linux-3.0.4/arch/x86/kernel/x8664_ksyms_64.c
---- linux-3.0.4/arch/x86/kernel/x8664_ksyms_64.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/x8664_ksyms_64.c       2011-08-23 21:47:55.000000000 -0400
+-static enum { EMULATE, NATIVE, NONE } vsyscall_mode = NATIVE;
++static enum { EMULATE, NONE } vsyscall_mode = EMULATE;
+ static int __init vsyscall_setup(char *str)
+ {
+       if (str) {
+               if (!strcmp("emulate", str))
+                       vsyscall_mode = EMULATE;
+-              else if (!strcmp("native", str))
+-                      vsyscall_mode = NATIVE;
+               else if (!strcmp("none", str))
+                       vsyscall_mode = NONE;
+               else
+@@ -177,7 +175,7 @@ bool emulate_vsyscall(struct pt_regs *re
+       tsk = current;
+       if (seccomp_mode(&tsk->seccomp))
+-              do_exit(SIGKILL);
++              do_group_exit(SIGKILL);
+       switch (vsyscall_nr) {
+       case 0:
+@@ -219,8 +217,7 @@ bool emulate_vsyscall(struct pt_regs *re
+       return true;
+ sigsegv:
+-      force_sig(SIGSEGV, current);
+-      return true;
++      do_group_exit(SIGKILL);
+ }
+ /*
+@@ -273,10 +270,7 @@ void __init map_vsyscall(void)
+       extern char __vvar_page;
+       unsigned long physaddr_vvar_page = __pa_symbol(&__vvar_page);
+-      __set_fixmap(VSYSCALL_FIRST_PAGE, physaddr_vsyscall,
+-                   vsyscall_mode == NATIVE
+-                   ? PAGE_KERNEL_VSYSCALL
+-                   : PAGE_KERNEL_VVAR);
++      __set_fixmap(VSYSCALL_FIRST_PAGE, physaddr_vsyscall, PAGE_KERNEL_VVAR);
+       BUILD_BUG_ON((unsigned long)__fix_to_virt(VSYSCALL_FIRST_PAGE) !=
+                    (unsigned long)VSYSCALL_START);
+diff -urNp linux-3.1.3/arch/x86/kernel/x8664_ksyms_64.c linux-3.1.3/arch/x86/kernel/x8664_ksyms_64.c
+--- linux-3.1.3/arch/x86/kernel/x8664_ksyms_64.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/x8664_ksyms_64.c       2011-11-16 18:39:07.000000000 -0500
 @@ -29,8 +29,6 @@ EXPORT_SYMBOL(__put_user_8);
  EXPORT_SYMBOL(copy_user_generic_string);
  EXPORT_SYMBOL(copy_user_generic_unrolled);
@@ -15951,9 +16873,9 @@ diff -urNp linux-3.0.4/arch/x86/kernel/x8664_ksyms_64.c linux-3.0.4/arch/x86/ker
  
  EXPORT_SYMBOL(copy_page);
  EXPORT_SYMBOL(clear_page);
-diff -urNp linux-3.0.4/arch/x86/kernel/xsave.c linux-3.0.4/arch/x86/kernel/xsave.c
---- linux-3.0.4/arch/x86/kernel/xsave.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kernel/xsave.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kernel/xsave.c linux-3.1.3/arch/x86/kernel/xsave.c
+--- linux-3.1.3/arch/x86/kernel/xsave.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kernel/xsave.c        2011-11-16 18:39:07.000000000 -0500
 @@ -130,7 +130,7 @@ int check_for_xstate(struct i387_fxsave_
            fx_sw_user->xstate_size > fx_sw_user->extended_size)
                return -EINVAL;
@@ -15968,7 +16890,7 @@ diff -urNp linux-3.0.4/arch/x86/kernel/xsave.c linux-3.0.4/arch/x86/kernel/xsave
         */
        xrstor_state(init_xstate_buf, pcntxt_mask & ~XSTATE_FPSSE);
 -      return fxrstor_checking((__force struct i387_fxsave_struct *)buf);
-+      return fxrstor_checking((struct i387_fxsave_struct __user *)buf);
++      return fxrstor_checking((struct i387_fxsave_struct __force_kernel *)buf);
  }
  
  /*
@@ -15977,13 +16899,13 @@ diff -urNp linux-3.0.4/arch/x86/kernel/xsave.c linux-3.0.4/arch/x86/kernel/xsave
                err = restore_user_xstate(buf);
        else
 -              err = fxrstor_checking((__force struct i387_fxsave_struct *)
-+              err = fxrstor_checking((struct i387_fxsave_struct __user *)
++              err = fxrstor_checking((struct i387_fxsave_struct __force_kernel *)
                                       buf);
        if (unlikely(err)) {
                /*
-diff -urNp linux-3.0.4/arch/x86/kvm/emulate.c linux-3.0.4/arch/x86/kvm/emulate.c
---- linux-3.0.4/arch/x86/kvm/emulate.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kvm/emulate.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kvm/emulate.c linux-3.1.3/arch/x86/kvm/emulate.c
+--- linux-3.1.3/arch/x86/kvm/emulate.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kvm/emulate.c 2011-11-16 18:39:07.000000000 -0500
 @@ -96,7 +96,7 @@
  #define Src2ImmByte (2<<29)
  #define Src2One     (3<<29)
@@ -16018,9 +16940,9 @@ diff -urNp linux-3.0.4/arch/x86/kvm/emulate.c linux-3.0.4/arch/x86/kvm/emulate.c
                switch ((_dst).bytes) {                                      \
                case 1:                                                      \
                        ____emulate_2op(_op,_src,_dst,_eflags,_bx,_by,"b",u8); \
-diff -urNp linux-3.0.4/arch/x86/kvm/lapic.c linux-3.0.4/arch/x86/kvm/lapic.c
---- linux-3.0.4/arch/x86/kvm/lapic.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kvm/lapic.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/kvm/lapic.c linux-3.1.3/arch/x86/kvm/lapic.c
+--- linux-3.1.3/arch/x86/kvm/lapic.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kvm/lapic.c   2011-11-16 18:39:07.000000000 -0500
 @@ -53,7 +53,7 @@
  #define APIC_BUS_CYCLE_NS 1
  
@@ -16030,10 +16952,10 @@ diff -urNp linux-3.0.4/arch/x86/kvm/lapic.c linux-3.0.4/arch/x86/kvm/lapic.c
  
  #define APIC_LVT_NUM                  6
  /* 14 is the version for Xeon and Pentium 8.4.8*/
-diff -urNp linux-3.0.4/arch/x86/kvm/mmu.c linux-3.0.4/arch/x86/kvm/mmu.c
---- linux-3.0.4/arch/x86/kvm/mmu.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kvm/mmu.c     2011-08-23 21:47:55.000000000 -0400
-@@ -3238,7 +3238,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *
+diff -urNp linux-3.1.3/arch/x86/kvm/mmu.c linux-3.1.3/arch/x86/kvm/mmu.c
+--- linux-3.1.3/arch/x86/kvm/mmu.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kvm/mmu.c     2011-11-16 18:39:07.000000000 -0500
+@@ -3552,7 +3552,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *
  
        pgprintk("%s: gpa %llx bytes %d\n", __func__, gpa, bytes);
  
@@ -16042,7 +16964,7 @@ diff -urNp linux-3.0.4/arch/x86/kvm/mmu.c linux-3.0.4/arch/x86/kvm/mmu.c
  
        /*
         * Assume that the pte write on a page table of the same type
-@@ -3270,7 +3270,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *
+@@ -3584,7 +3584,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *
        }
  
        spin_lock(&vcpu->kvm->mmu_lock);
@@ -16051,10 +16973,19 @@ diff -urNp linux-3.0.4/arch/x86/kvm/mmu.c linux-3.0.4/arch/x86/kvm/mmu.c
                gentry = 0;
        kvm_mmu_free_some_pages(vcpu);
        ++vcpu->kvm->stat.mmu_pte_write;
-diff -urNp linux-3.0.4/arch/x86/kvm/paging_tmpl.h linux-3.0.4/arch/x86/kvm/paging_tmpl.h
---- linux-3.0.4/arch/x86/kvm/paging_tmpl.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kvm/paging_tmpl.h     2011-08-23 21:48:14.000000000 -0400
-@@ -583,6 +583,8 @@ static int FNAME(page_fault)(struct kvm_
+diff -urNp linux-3.1.3/arch/x86/kvm/paging_tmpl.h linux-3.1.3/arch/x86/kvm/paging_tmpl.h
+--- linux-3.1.3/arch/x86/kvm/paging_tmpl.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kvm/paging_tmpl.h     2011-11-16 19:40:44.000000000 -0500
+@@ -197,7 +197,7 @@ retry_walk:
+               if (unlikely(kvm_is_error_hva(host_addr)))
+                       goto error;
+-              ptep_user = (pt_element_t __user *)((void *)host_addr + offset);
++              ptep_user = (pt_element_t __force_user *)((void *)host_addr + offset);
+               if (unlikely(__copy_from_user(&pte, ptep_user, sizeof(pte))))
+                       goto error;
+@@ -575,6 +575,8 @@ static int FNAME(page_fault)(struct kvm_
        unsigned long mmu_seq;
        bool map_writable;
  
@@ -16062,8 +16993,8 @@ diff -urNp linux-3.0.4/arch/x86/kvm/paging_tmpl.h linux-3.0.4/arch/x86/kvm/pagin
 +
        pgprintk("%s: addr %lx err %x\n", __func__, addr, error_code);
  
-       r = mmu_topup_memory_caches(vcpu);
-@@ -703,7 +705,7 @@ static void FNAME(invlpg)(struct kvm_vcp
+       if (unlikely(error_code & PFERR_RSVD_MASK))
+@@ -701,7 +703,7 @@ static void FNAME(invlpg)(struct kvm_vcp
        if (need_flush)
                kvm_flush_remote_tlbs(vcpu->kvm);
  
@@ -16072,10 +17003,10 @@ diff -urNp linux-3.0.4/arch/x86/kvm/paging_tmpl.h linux-3.0.4/arch/x86/kvm/pagin
  
        spin_unlock(&vcpu->kvm->mmu_lock);
  
-diff -urNp linux-3.0.4/arch/x86/kvm/svm.c linux-3.0.4/arch/x86/kvm/svm.c
---- linux-3.0.4/arch/x86/kvm/svm.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kvm/svm.c     2011-08-23 21:47:55.000000000 -0400
-@@ -3377,7 +3377,11 @@ static void reload_tss(struct kvm_vcpu *
+diff -urNp linux-3.1.3/arch/x86/kvm/svm.c linux-3.1.3/arch/x86/kvm/svm.c
+--- linux-3.1.3/arch/x86/kvm/svm.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kvm/svm.c     2011-11-16 18:39:07.000000000 -0500
+@@ -3381,7 +3381,11 @@ static void reload_tss(struct kvm_vcpu *
        int cpu = raw_smp_processor_id();
  
        struct svm_cpu_data *sd = per_cpu(svm_data, cpu);
@@ -16087,7 +17018,7 @@ diff -urNp linux-3.0.4/arch/x86/kvm/svm.c linux-3.0.4/arch/x86/kvm/svm.c
        load_TR_desc();
  }
  
-@@ -3755,6 +3759,10 @@ static void svm_vcpu_run(struct kvm_vcpu
+@@ -3759,6 +3763,10 @@ static void svm_vcpu_run(struct kvm_vcpu
  #endif
  #endif
  
@@ -16098,10 +17029,10 @@ diff -urNp linux-3.0.4/arch/x86/kvm/svm.c linux-3.0.4/arch/x86/kvm/svm.c
        reload_tss(vcpu);
  
        local_irq_disable();
-diff -urNp linux-3.0.4/arch/x86/kvm/vmx.c linux-3.0.4/arch/x86/kvm/vmx.c
---- linux-3.0.4/arch/x86/kvm/vmx.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kvm/vmx.c     2011-08-23 21:47:55.000000000 -0400
-@@ -797,7 +797,11 @@ static void reload_tss(void)
+diff -urNp linux-3.1.3/arch/x86/kvm/vmx.c linux-3.1.3/arch/x86/kvm/vmx.c
+--- linux-3.1.3/arch/x86/kvm/vmx.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kvm/vmx.c     2011-11-16 18:39:07.000000000 -0500
+@@ -1251,7 +1251,11 @@ static void reload_tss(void)
        struct desc_struct *descs;
  
        descs = (void *)gdt->address;
@@ -16113,7 +17044,7 @@ diff -urNp linux-3.0.4/arch/x86/kvm/vmx.c linux-3.0.4/arch/x86/kvm/vmx.c
        load_TR_desc();
  }
  
-@@ -1747,8 +1751,11 @@ static __init int hardware_setup(void)
+@@ -2520,8 +2524,11 @@ static __init int hardware_setup(void)
        if (!cpu_has_vmx_flexpriority())
                flexpriority_enabled = 0;
  
@@ -16127,16 +17058,16 @@ diff -urNp linux-3.0.4/arch/x86/kvm/vmx.c linux-3.0.4/arch/x86/kvm/vmx.c
  
        if (enable_ept && !cpu_has_vmx_ept_2m_page())
                kvm_disable_largepages();
-@@ -2814,7 +2821,7 @@ static int vmx_vcpu_setup(struct vcpu_vm
+@@ -3535,7 +3542,7 @@ static void vmx_set_constant_host_state(
        vmcs_writel(HOST_IDTR_BASE, dt.address);   /* 22.2.4 */
  
-       asm("mov $.Lkvm_vmx_return, %0" : "=r"(kvm_vmx_return));
--      vmcs_writel(HOST_RIP, kvm_vmx_return); /* 22.2.5 */
-+      vmcs_writel(HOST_RIP, ktla_ktva(kvm_vmx_return)); /* 22.2.5 */
-       vmcs_write32(VM_EXIT_MSR_STORE_COUNT, 0);
-       vmcs_write32(VM_EXIT_MSR_LOAD_COUNT, 0);
-       vmcs_write64(VM_EXIT_MSR_LOAD_ADDR, __pa(vmx->msr_autoload.host));
-@@ -4211,6 +4218,12 @@ static void __noclone vmx_vcpu_run(struc
+       asm("mov $.Lkvm_vmx_return, %0" : "=r"(tmpl));
+-      vmcs_writel(HOST_RIP, tmpl); /* 22.2.5 */
++      vmcs_writel(HOST_RIP, ktla_ktva(tmpl)); /* 22.2.5 */
+       rdmsr(MSR_IA32_SYSENTER_CS, low32, high32);
+       vmcs_write32(HOST_IA32_SYSENTER_CS, low32);
+@@ -6021,6 +6028,12 @@ static void __noclone vmx_vcpu_run(struc
                "jmp .Lkvm_vmx_return \n\t"
                ".Llaunched: " __ex(ASM_VMX_VMRESUME) "\n\t"
                ".Lkvm_vmx_return: "
@@ -16149,7 +17080,7 @@ diff -urNp linux-3.0.4/arch/x86/kvm/vmx.c linux-3.0.4/arch/x86/kvm/vmx.c
                /* Save guest registers, load host registers, keep flags */
                "mov %0, %c[wordsize](%%"R"sp) \n\t"
                "pop %0 \n\t"
-@@ -4259,6 +4272,11 @@ static void __noclone vmx_vcpu_run(struc
+@@ -6069,6 +6082,11 @@ static void __noclone vmx_vcpu_run(struc
  #endif
                [cr2]"i"(offsetof(struct vcpu_vmx, vcpu.arch.cr2)),
                [wordsize]"i"(sizeof(ulong))
@@ -16161,9 +17092,9 @@ diff -urNp linux-3.0.4/arch/x86/kvm/vmx.c linux-3.0.4/arch/x86/kvm/vmx.c
              : "cc", "memory"
                , R"ax", R"bx", R"di", R"si"
  #ifdef CONFIG_X86_64
-@@ -4276,7 +4294,16 @@ static void __noclone vmx_vcpu_run(struc
-       vmx->idt_vectoring_info = vmcs_read32(IDT_VECTORING_INFO_FIELD);
+@@ -6097,7 +6115,16 @@ static void __noclone vmx_vcpu_run(struc
+               }
+       }
  
 -      asm("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS));
 +      asm("mov %0, %%ds; mov %0, %%es; mov %0, %%ss" : : "r"(__KERNEL_DS));
@@ -16176,13 +17107,24 @@ diff -urNp linux-3.0.4/arch/x86/kvm/vmx.c linux-3.0.4/arch/x86/kvm/vmx.c
 +      __set_fs(current_thread_info()->addr_limit);
 +#endif
 +
-       vmx->launched = 1;
+       vmx->loaded_vmcs->launched = 1;
  
        vmx->exit_reason = vmcs_read32(VM_EXIT_REASON);
-diff -urNp linux-3.0.4/arch/x86/kvm/x86.c linux-3.0.4/arch/x86/kvm/x86.c
---- linux-3.0.4/arch/x86/kvm/x86.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/kvm/x86.c     2011-08-23 21:47:55.000000000 -0400
-@@ -2057,6 +2057,8 @@ long kvm_arch_dev_ioctl(struct file *fil
+diff -urNp linux-3.1.3/arch/x86/kvm/x86.c linux-3.1.3/arch/x86/kvm/x86.c
+--- linux-3.1.3/arch/x86/kvm/x86.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/kvm/x86.c     2011-11-16 18:39:07.000000000 -0500
+@@ -1334,8 +1334,8 @@ static int xen_hvm_config(struct kvm_vcp
+ {
+       struct kvm *kvm = vcpu->kvm;
+       int lm = is_long_mode(vcpu);
+-      u8 *blob_addr = lm ? (u8 *)(long)kvm->arch.xen_hvm_config.blob_addr_64
+-              : (u8 *)(long)kvm->arch.xen_hvm_config.blob_addr_32;
++      u8 __user *blob_addr = lm ? (u8 __user *)(long)kvm->arch.xen_hvm_config.blob_addr_64
++              : (u8 __user *)(long)kvm->arch.xen_hvm_config.blob_addr_32;
+       u8 blob_size = lm ? kvm->arch.xen_hvm_config.blob_size_64
+               : kvm->arch.xen_hvm_config.blob_size_32;
+       u32 page_num = data & ~PAGE_MASK;
+@@ -2137,6 +2137,8 @@ long kvm_arch_dev_ioctl(struct file *fil
                if (n < msr_list.nmsrs)
                        goto out;
                r = -EFAULT;
@@ -16191,7 +17133,7 @@ diff -urNp linux-3.0.4/arch/x86/kvm/x86.c linux-3.0.4/arch/x86/kvm/x86.c
                if (copy_to_user(user_msr_list->indices, &msrs_to_save,
                                 num_msrs_to_save * sizeof(u32)))
                        goto out;
-@@ -2229,15 +2231,20 @@ static int kvm_vcpu_ioctl_set_cpuid2(str
+@@ -2312,15 +2314,20 @@ static int kvm_vcpu_ioctl_set_cpuid2(str
                                     struct kvm_cpuid2 *cpuid,
                                     struct kvm_cpuid_entry2 __user *entries)
  {
@@ -16215,7 +17157,7 @@ diff -urNp linux-3.0.4/arch/x86/kvm/x86.c linux-3.0.4/arch/x86/kvm/x86.c
        vcpu->arch.cpuid_nent = cpuid->nent;
        kvm_apic_set_version(vcpu);
        kvm_x86_ops->cpuid_update(vcpu);
-@@ -2252,15 +2259,19 @@ static int kvm_vcpu_ioctl_get_cpuid2(str
+@@ -2335,15 +2342,19 @@ static int kvm_vcpu_ioctl_get_cpuid2(str
                                     struct kvm_cpuid2 *cpuid,
                                     struct kvm_cpuid_entry2 __user *entries)
  {
@@ -16238,7 +17180,7 @@ diff -urNp linux-3.0.4/arch/x86/kvm/x86.c linux-3.0.4/arch/x86/kvm/x86.c
        return 0;
  
  out:
-@@ -2579,7 +2590,7 @@ static int kvm_vcpu_ioctl_set_lapic(stru
+@@ -2718,7 +2729,7 @@ static int kvm_vcpu_ioctl_set_lapic(stru
  static int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu,
                                    struct kvm_interrupt *irq)
  {
@@ -16247,19 +17189,19 @@ diff -urNp linux-3.0.4/arch/x86/kvm/x86.c linux-3.0.4/arch/x86/kvm/x86.c
                return -EINVAL;
        if (irqchip_in_kernel(vcpu->kvm))
                return -ENXIO;
-@@ -4878,7 +4889,7 @@ void kvm_after_handle_nmi(struct kvm_vcp
+@@ -5089,7 +5100,7 @@ static void kvm_set_mmio_spte_mask(void)
+       kvm_mmu_set_mmio_spte_mask(mask);
  }
- EXPORT_SYMBOL_GPL(kvm_after_handle_nmi);
  
 -int kvm_arch_init(void *opaque)
 +int kvm_arch_init(const void *opaque)
  {
        int r;
        struct kvm_x86_ops *ops = (struct kvm_x86_ops *)opaque;
-diff -urNp linux-3.0.4/arch/x86/lguest/boot.c linux-3.0.4/arch/x86/lguest/boot.c
---- linux-3.0.4/arch/x86/lguest/boot.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lguest/boot.c 2011-08-23 21:47:55.000000000 -0400
-@@ -1176,9 +1176,10 @@ static __init int early_put_chars(u32 vt
+diff -urNp linux-3.1.3/arch/x86/lguest/boot.c linux-3.1.3/arch/x86/lguest/boot.c
+--- linux-3.1.3/arch/x86/lguest/boot.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lguest/boot.c 2011-11-16 18:39:07.000000000 -0500
+@@ -1184,9 +1184,10 @@ static __init int early_put_chars(u32 vt
   * Rebooting also tells the Host we're finished, but the RESTART flag tells the
   * Launcher to reboot us.
   */
@@ -16271,9 +17213,9 @@ diff -urNp linux-3.0.4/arch/x86/lguest/boot.c linux-3.0.4/arch/x86/lguest/boot.c
  }
  
  /*G:050
-diff -urNp linux-3.0.4/arch/x86/lib/atomic64_32.c linux-3.0.4/arch/x86/lib/atomic64_32.c
---- linux-3.0.4/arch/x86/lib/atomic64_32.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/atomic64_32.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/lib/atomic64_32.c linux-3.1.3/arch/x86/lib/atomic64_32.c
+--- linux-3.1.3/arch/x86/lib/atomic64_32.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/atomic64_32.c     2011-11-16 18:39:07.000000000 -0500
 @@ -8,18 +8,30 @@
  
  long long atomic64_read_cx8(long long, const atomic64_t *v);
@@ -16352,9 +17294,9 @@ diff -urNp linux-3.0.4/arch/x86/lib/atomic64_32.c linux-3.0.4/arch/x86/lib/atomi
  long long atomic64_dec_if_positive_386(atomic64_t *v);
  EXPORT_SYMBOL(atomic64_dec_if_positive_386);
  int atomic64_inc_not_zero_386(atomic64_t *v);
-diff -urNp linux-3.0.4/arch/x86/lib/atomic64_386_32.S linux-3.0.4/arch/x86/lib/atomic64_386_32.S
---- linux-3.0.4/arch/x86/lib/atomic64_386_32.S 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/atomic64_386_32.S 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/lib/atomic64_386_32.S linux-3.1.3/arch/x86/lib/atomic64_386_32.S
+--- linux-3.1.3/arch/x86/lib/atomic64_386_32.S 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/atomic64_386_32.S 2011-11-16 18:39:07.000000000 -0500
 @@ -48,6 +48,10 @@ BEGIN(read)
        movl  (v), %eax
        movl 4(v), %edx
@@ -16610,16 +17552,14 @@ diff -urNp linux-3.0.4/arch/x86/lib/atomic64_386_32.S linux-3.0.4/arch/x86/lib/a
        js 1f
        movl %eax,  (v)
        movl %edx, 4(v)
-diff -urNp linux-3.0.4/arch/x86/lib/atomic64_cx8_32.S linux-3.0.4/arch/x86/lib/atomic64_cx8_32.S
---- linux-3.0.4/arch/x86/lib/atomic64_cx8_32.S 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/atomic64_cx8_32.S 2011-09-17 18:31:51.000000000 -0400
-@@ -35,10 +35,24 @@ ENTRY(atomic64_read_cx8)
+diff -urNp linux-3.1.3/arch/x86/lib/atomic64_cx8_32.S linux-3.1.3/arch/x86/lib/atomic64_cx8_32.S
+--- linux-3.1.3/arch/x86/lib/atomic64_cx8_32.S 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/atomic64_cx8_32.S 2011-11-16 18:39:07.000000000 -0500
+@@ -35,10 +35,20 @@ ENTRY(atomic64_read_cx8)
        CFI_STARTPROC
  
        read64 %ecx
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
        CFI_ENDPROC
  ENDPROC(atomic64_read_cx8)
@@ -16628,9 +17568,7 @@ diff -urNp linux-3.0.4/arch/x86/lib/atomic64_cx8_32.S linux-3.0.4/arch/x86/lib/a
 +      CFI_STARTPROC
 +
 +      read64 %ecx
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
 +      ret
 +      CFI_ENDPROC
 +ENDPROC(atomic64_read_unchecked_cx8)
@@ -16638,13 +17576,11 @@ diff -urNp linux-3.0.4/arch/x86/lib/atomic64_cx8_32.S linux-3.0.4/arch/x86/lib/a
  ENTRY(atomic64_set_cx8)
        CFI_STARTPROC
  
-@@ -48,10 +62,29 @@ ENTRY(atomic64_set_cx8)
+@@ -48,10 +58,25 @@ ENTRY(atomic64_set_cx8)
        cmpxchg8b (%esi)
        jne 1b
  
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
        CFI_ENDPROC
  ENDPROC(atomic64_set_cx8)
@@ -16658,9 +17594,7 @@ diff -urNp linux-3.0.4/arch/x86/lib/atomic64_cx8_32.S linux-3.0.4/arch/x86/lib/a
 +      cmpxchg8b (%esi)
 +      jne 1b
 +
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
 +      ret
 +      CFI_ENDPROC
 +ENDPROC(atomic64_set_unchecked_cx8)
@@ -16668,13 +17602,11 @@ diff -urNp linux-3.0.4/arch/x86/lib/atomic64_cx8_32.S linux-3.0.4/arch/x86/lib/a
  ENTRY(atomic64_xchg_cx8)
        CFI_STARTPROC
  
-@@ -62,12 +95,15 @@ ENTRY(atomic64_xchg_cx8)
+@@ -62,12 +87,13 @@ ENTRY(atomic64_xchg_cx8)
        cmpxchg8b (%esi)
        jne 1b
  
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
        CFI_ENDPROC
  ENDPROC(atomic64_xchg_cx8)
@@ -16686,7 +17618,7 @@ diff -urNp linux-3.0.4/arch/x86/lib/atomic64_cx8_32.S linux-3.0.4/arch/x86/lib/a
        CFI_STARTPROC
        SAVE ebp
        SAVE ebx
-@@ -84,27 +120,46 @@ ENTRY(atomic64_\func\()_return_cx8)
+@@ -84,27 +110,44 @@ ENTRY(atomic64_\func\()_return_cx8)
        movl %edx, %ecx
        \ins\()l %esi, %ebx
        \insc\()l %edi, %ecx
@@ -16717,9 +17649,7 @@ diff -urNp linux-3.0.4/arch/x86/lib/atomic64_cx8_32.S linux-3.0.4/arch/x86/lib/a
        RESTORE esi
        RESTORE ebx
        RESTORE ebp
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
        CFI_ENDPROC
 -ENDPROC(atomic64_\func\()_return_cx8)
@@ -16738,7 +17668,7 @@ diff -urNp linux-3.0.4/arch/x86/lib/atomic64_cx8_32.S linux-3.0.4/arch/x86/lib/a
        CFI_STARTPROC
        SAVE ebx
  
-@@ -114,21 +169,41 @@ ENTRY(atomic64_\func\()_return_cx8)
+@@ -114,21 +157,39 @@ ENTRY(atomic64_\func\()_return_cx8)
        movl %edx, %ecx
        \ins\()l $1, %ebx
        \insc\()l $0, %ecx
@@ -16766,9 +17696,7 @@ diff -urNp linux-3.0.4/arch/x86/lib/atomic64_cx8_32.S linux-3.0.4/arch/x86/lib/a
 +.endif
 +
        RESTORE ebx
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
        CFI_ENDPROC
 -ENDPROC(atomic64_\func\()_return_cx8)
@@ -16782,7 +17710,7 @@ diff -urNp linux-3.0.4/arch/x86/lib/atomic64_cx8_32.S linux-3.0.4/arch/x86/lib/a
  
  ENTRY(atomic64_dec_if_positive_cx8)
        CFI_STARTPROC
-@@ -140,6 +215,13 @@ ENTRY(atomic64_dec_if_positive_cx8)
+@@ -140,6 +201,13 @@ ENTRY(atomic64_dec_if_positive_cx8)
        movl %edx, %ecx
        subl $1, %ebx
        sbb $0, %ecx
@@ -16796,17 +17724,15 @@ diff -urNp linux-3.0.4/arch/x86/lib/atomic64_cx8_32.S linux-3.0.4/arch/x86/lib/a
        js 2f
        LOCK_PREFIX
        cmpxchg8b (%esi)
-@@ -149,6 +231,9 @@ ENTRY(atomic64_dec_if_positive_cx8)
+@@ -149,6 +217,7 @@ ENTRY(atomic64_dec_if_positive_cx8)
        movl %ebx, %eax
        movl %ecx, %edx
        RESTORE ebx
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
        CFI_ENDPROC
  ENDPROC(atomic64_dec_if_positive_cx8)
-@@ -174,6 +259,13 @@ ENTRY(atomic64_add_unless_cx8)
+@@ -174,6 +243,13 @@ ENTRY(atomic64_add_unless_cx8)
        movl %edx, %ecx
        addl %esi, %ebx
        adcl %edi, %ecx
@@ -16820,17 +17746,15 @@ diff -urNp linux-3.0.4/arch/x86/lib/atomic64_cx8_32.S linux-3.0.4/arch/x86/lib/a
        LOCK_PREFIX
        cmpxchg8b (%ebp)
        jne 1b
-@@ -184,6 +276,9 @@ ENTRY(atomic64_add_unless_cx8)
+@@ -184,6 +260,7 @@ ENTRY(atomic64_add_unless_cx8)
        CFI_ADJUST_CFA_OFFSET -8
        RESTORE ebx
        RESTORE ebp
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  4:
        cmpl %edx, 4(%esp)
-@@ -206,6 +301,13 @@ ENTRY(atomic64_inc_not_zero_cx8)
+@@ -206,6 +283,13 @@ ENTRY(atomic64_inc_not_zero_cx8)
        movl %edx, %ecx
        addl $1, %ebx
        adcl $0, %ecx
@@ -16844,19 +17768,17 @@ diff -urNp linux-3.0.4/arch/x86/lib/atomic64_cx8_32.S linux-3.0.4/arch/x86/lib/a
        LOCK_PREFIX
        cmpxchg8b (%esi)
        jne 1b
-@@ -213,6 +315,9 @@ ENTRY(atomic64_inc_not_zero_cx8)
+@@ -213,6 +297,7 @@ ENTRY(atomic64_inc_not_zero_cx8)
        movl $1, %eax
  3:
        RESTORE ebx
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  4:
        testl %edx, %edx
-diff -urNp linux-3.0.4/arch/x86/lib/checksum_32.S linux-3.0.4/arch/x86/lib/checksum_32.S
---- linux-3.0.4/arch/x86/lib/checksum_32.S     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/checksum_32.S     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/lib/checksum_32.S linux-3.1.3/arch/x86/lib/checksum_32.S
+--- linux-3.1.3/arch/x86/lib/checksum_32.S     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/checksum_32.S     2011-11-16 18:39:07.000000000 -0500
 @@ -28,7 +28,8 @@
  #include <linux/linkage.h>
  #include <asm/dwarf2.h>
@@ -17101,40 +18023,34 @@ diff -urNp linux-3.0.4/arch/x86/lib/checksum_32.S linux-3.0.4/arch/x86/lib/check
                                
  #undef ROUND
  #undef ROUND1         
-diff -urNp linux-3.0.4/arch/x86/lib/clear_page_64.S linux-3.0.4/arch/x86/lib/clear_page_64.S
---- linux-3.0.4/arch/x86/lib/clear_page_64.S   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/clear_page_64.S   2011-09-17 18:31:51.000000000 -0400
-@@ -11,6 +11,9 @@ ENTRY(clear_page_c)
+diff -urNp linux-3.1.3/arch/x86/lib/clear_page_64.S linux-3.1.3/arch/x86/lib/clear_page_64.S
+--- linux-3.1.3/arch/x86/lib/clear_page_64.S   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/clear_page_64.S   2011-11-16 18:39:07.000000000 -0500
+@@ -11,6 +11,7 @@ ENTRY(clear_page_c)
        movl $4096/8,%ecx
        xorl %eax,%eax
        rep stosq
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
        CFI_ENDPROC
  ENDPROC(clear_page_c)
-@@ -20,6 +23,9 @@ ENTRY(clear_page_c_e)
+@@ -20,6 +21,7 @@ ENTRY(clear_page_c_e)
        movl $4096,%ecx
        xorl %eax,%eax
        rep stosb
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
        CFI_ENDPROC
  ENDPROC(clear_page_c_e)
-@@ -43,6 +49,9 @@ ENTRY(clear_page)
+@@ -43,6 +45,7 @@ ENTRY(clear_page)
        leaq    64(%rdi),%rdi
        jnz     .Lloop
        nop
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
        CFI_ENDPROC
  .Lclear_page_end:
-@@ -58,7 +67,7 @@ ENDPROC(clear_page)
+@@ -58,7 +61,7 @@ ENDPROC(clear_page)
  
  #include <asm/cpufeature.h>
  
@@ -17143,30 +18059,43 @@ diff -urNp linux-3.0.4/arch/x86/lib/clear_page_64.S linux-3.0.4/arch/x86/lib/cle
  1:    .byte 0xeb                                      /* jmp <disp8> */
        .byte (clear_page_c - clear_page) - (2f - 1b)   /* offset */
  2:    .byte 0xeb                                      /* jmp <disp8> */
-diff -urNp linux-3.0.4/arch/x86/lib/copy_page_64.S linux-3.0.4/arch/x86/lib/copy_page_64.S
---- linux-3.0.4/arch/x86/lib/copy_page_64.S    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/copy_page_64.S    2011-09-17 18:31:51.000000000 -0400
-@@ -8,6 +8,9 @@ copy_page_c:
+diff -urNp linux-3.1.3/arch/x86/lib/cmpxchg16b_emu.S linux-3.1.3/arch/x86/lib/cmpxchg16b_emu.S
+--- linux-3.1.3/arch/x86/lib/cmpxchg16b_emu.S  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/cmpxchg16b_emu.S  2011-11-16 18:39:07.000000000 -0500
+@@ -53,11 +53,13 @@ this_cpu_cmpxchg16b_emu:
+       popf
+       mov $1, %al
++      pax_force_retaddr
+       ret
+  not_same:
+       popf
+       xor %al,%al
++      pax_force_retaddr
+       ret
+ CFI_ENDPROC
+diff -urNp linux-3.1.3/arch/x86/lib/copy_page_64.S linux-3.1.3/arch/x86/lib/copy_page_64.S
+--- linux-3.1.3/arch/x86/lib/copy_page_64.S    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/copy_page_64.S    2011-11-16 18:39:07.000000000 -0500
+@@ -9,6 +9,7 @@ copy_page_c:
        CFI_STARTPROC
        movl $4096/8,%ecx
        rep movsq
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
        CFI_ENDPROC
  ENDPROC(copy_page_c)
-@@ -94,6 +97,9 @@ ENTRY(copy_page)
+@@ -95,6 +96,7 @@ ENTRY(copy_page)
        CFI_RESTORE r13
        addq    $3*8,%rsp
        CFI_ADJUST_CFA_OFFSET -3*8
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  .Lcopy_page_end:
        CFI_ENDPROC
-@@ -104,7 +110,7 @@ ENDPROC(copy_page)
+@@ -105,7 +107,7 @@ ENDPROC(copy_page)
  
  #include <asm/cpufeature.h>
  
@@ -17175,9 +18104,9 @@ diff -urNp linux-3.0.4/arch/x86/lib/copy_page_64.S linux-3.0.4/arch/x86/lib/copy
  1:    .byte 0xeb                                      /* jmp <disp8> */
        .byte (copy_page_c - copy_page) - (2f - 1b)     /* offset */
  2:
-diff -urNp linux-3.0.4/arch/x86/lib/copy_user_64.S linux-3.0.4/arch/x86/lib/copy_user_64.S
---- linux-3.0.4/arch/x86/lib/copy_user_64.S    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/copy_user_64.S    2011-09-17 18:31:51.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/lib/copy_user_64.S linux-3.1.3/arch/x86/lib/copy_user_64.S
+--- linux-3.1.3/arch/x86/lib/copy_user_64.S    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/copy_user_64.S    2011-11-16 18:39:07.000000000 -0500
 @@ -16,6 +16,7 @@
  #include <asm/thread_info.h>
  #include <asm/cpufeature.h>
@@ -17195,7 +18124,7 @@ diff -urNp linux-3.0.4/arch/x86/lib/copy_user_64.S linux-3.0.4/arch/x86/lib/copy
  2:    .byte 0xe9                      /* near jump with 32bit immediate */
        .long \alt1-1b /* offset */   /* or alternatively to alt1 */
  3:    .byte 0xe9                      /* near jump with 32bit immediate */
-@@ -71,47 +72,22 @@
+@@ -71,47 +72,20 @@
  #endif
        .endm
  
@@ -17242,46 +18171,45 @@ diff -urNp linux-3.0.4/arch/x86/lib/copy_user_64.S linux-3.0.4/arch/x86/lib/copy
        stosb
  bad_to_user:
        movl %edx,%eax
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
        CFI_ENDPROC
  ENDPROC(bad_from_user)
-@@ -179,6 +155,9 @@ ENTRY(copy_user_generic_unrolled)
+@@ -179,6 +153,7 @@ ENTRY(copy_user_generic_unrolled)
        decl %ecx
        jnz 21b
  23:   xor %eax,%eax
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  
        .section .fixup,"ax"
-@@ -251,6 +230,9 @@ ENTRY(copy_user_generic_string)
+@@ -251,6 +226,7 @@ ENTRY(copy_user_generic_string)
  3:    rep
        movsb
  4:    xorl %eax,%eax
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  
        .section .fixup,"ax"
-@@ -287,6 +269,9 @@ ENTRY(copy_user_enhanced_fast_string)
+@@ -287,6 +263,7 @@ ENTRY(copy_user_enhanced_fast_string)
  1:    rep
        movsb
  2:    xorl %eax,%eax
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  
        .section .fixup,"ax"
-diff -urNp linux-3.0.4/arch/x86/lib/copy_user_nocache_64.S linux-3.0.4/arch/x86/lib/copy_user_nocache_64.S
---- linux-3.0.4/arch/x86/lib/copy_user_nocache_64.S    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/copy_user_nocache_64.S    2011-09-17 18:31:51.000000000 -0400
-@@ -14,6 +14,7 @@
+diff -urNp linux-3.1.3/arch/x86/lib/copy_user_nocache_64.S linux-3.1.3/arch/x86/lib/copy_user_nocache_64.S
+--- linux-3.1.3/arch/x86/lib/copy_user_nocache_64.S    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/copy_user_nocache_64.S    2011-11-16 18:39:07.000000000 -0500
+@@ -8,12 +8,14 @@
+ #include <linux/linkage.h>
+ #include <asm/dwarf2.h>
++#include <asm/alternative-asm.h>
+ #define FIX_ALIGNMENT 1
  #include <asm/current.h>
  #include <asm/asm-offsets.h>
  #include <asm/thread_info.h>
@@ -17289,7 +18217,7 @@ diff -urNp linux-3.0.4/arch/x86/lib/copy_user_nocache_64.S linux-3.0.4/arch/x86/
  
        .macro ALIGN_DESTINATION
  #ifdef FIX_ALIGNMENT
-@@ -50,6 +51,15 @@
+@@ -50,6 +52,15 @@
   */
  ENTRY(__copy_user_nocache)
        CFI_STARTPROC
@@ -17305,67 +18233,76 @@ diff -urNp linux-3.0.4/arch/x86/lib/copy_user_nocache_64.S linux-3.0.4/arch/x86/
        cmpl $8,%edx
        jb 20f          /* less then 8 bytes, go to byte copy loop */
        ALIGN_DESTINATION
-@@ -98,6 +108,9 @@ ENTRY(__copy_user_nocache)
+@@ -98,6 +109,7 @@ ENTRY(__copy_user_nocache)
        jnz 21b
  23:   xorl %eax,%eax
        sfence
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  
        .section .fixup,"ax"
-diff -urNp linux-3.0.4/arch/x86/lib/csum-copy_64.S linux-3.0.4/arch/x86/lib/csum-copy_64.S
---- linux-3.0.4/arch/x86/lib/csum-copy_64.S    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/csum-copy_64.S    2011-09-17 18:31:51.000000000 -0400
-@@ -228,6 +228,9 @@ ENTRY(csum_partial_copy_generic)
+diff -urNp linux-3.1.3/arch/x86/lib/csum-copy_64.S linux-3.1.3/arch/x86/lib/csum-copy_64.S
+--- linux-3.1.3/arch/x86/lib/csum-copy_64.S    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/csum-copy_64.S    2011-11-16 18:39:07.000000000 -0500
+@@ -8,6 +8,7 @@
+ #include <linux/linkage.h>
+ #include <asm/dwarf2.h>
+ #include <asm/errno.h>
++#include <asm/alternative-asm.h>
+ /*
+  * Checksum copy with exception handling.
+@@ -228,6 +229,7 @@ ENTRY(csum_partial_copy_generic)
        CFI_RESTORE rbp
        addq $7*8, %rsp
        CFI_ADJUST_CFA_OFFSET -7*8
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
        CFI_RESTORE_STATE
  
-diff -urNp linux-3.0.4/arch/x86/lib/csum-wrappers_64.c linux-3.0.4/arch/x86/lib/csum-wrappers_64.c
---- linux-3.0.4/arch/x86/lib/csum-wrappers_64.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/csum-wrappers_64.c        2011-08-23 21:47:55.000000000 -0400
-@@ -52,6 +52,12 @@ csum_partial_copy_from_user(const void _
+diff -urNp linux-3.1.3/arch/x86/lib/csum-wrappers_64.c linux-3.1.3/arch/x86/lib/csum-wrappers_64.c
+--- linux-3.1.3/arch/x86/lib/csum-wrappers_64.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/csum-wrappers_64.c        2011-11-16 18:39:07.000000000 -0500
+@@ -52,7 +52,13 @@ csum_partial_copy_from_user(const void _
                        len -= 2;
                }
        }
+-      isum = csum_partial_copy_generic((__force const void *)src,
 +
 +#ifdef CONFIG_PAX_MEMORY_UDEREF
 +      if ((unsigned long)src < PAX_USER_SHADOW_BASE)
 +              src += PAX_USER_SHADOW_BASE;
 +#endif
 +
-       isum = csum_partial_copy_generic((__force const void *)src,
++      isum = csum_partial_copy_generic((const void __force_kernel *)src,
                                dst, len, isum, errp, NULL);
        if (unlikely(*errp))
-@@ -105,6 +111,12 @@ csum_partial_copy_to_user(const void *sr
+               goto out_err;
+@@ -105,7 +111,13 @@ csum_partial_copy_to_user(const void *sr
        }
  
        *errp = 0;
+-      return csum_partial_copy_generic(src, (void __force *)dst,
 +
 +#ifdef CONFIG_PAX_MEMORY_UDEREF
 +      if ((unsigned long)dst < PAX_USER_SHADOW_BASE)
 +              dst += PAX_USER_SHADOW_BASE;
 +#endif
 +
-       return csum_partial_copy_generic(src, (void __force *)dst,
++      return csum_partial_copy_generic(src, (void __force_kernel *)dst,
                                         len, isum, NULL, errp);
  }
-diff -urNp linux-3.0.4/arch/x86/lib/getuser.S linux-3.0.4/arch/x86/lib/getuser.S
---- linux-3.0.4/arch/x86/lib/getuser.S 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/getuser.S 2011-08-23 21:47:55.000000000 -0400
-@@ -33,14 +33,35 @@
+ EXPORT_SYMBOL(csum_partial_copy_to_user);
+diff -urNp linux-3.1.3/arch/x86/lib/getuser.S linux-3.1.3/arch/x86/lib/getuser.S
+--- linux-3.1.3/arch/x86/lib/getuser.S 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/getuser.S 2011-11-16 18:39:07.000000000 -0500
+@@ -33,15 +33,38 @@
  #include <asm/asm-offsets.h>
  #include <asm/thread_info.h>
  #include <asm/asm.h>
 +#include <asm/segment.h>
 +#include <asm/pgtable.h>
++#include <asm/alternative-asm.h>
 +
 +#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_MEMORY_UDEREF)
 +#define __copyuser_seg gs;
@@ -17395,9 +18332,11 @@ diff -urNp linux-3.0.4/arch/x86/lib/getuser.S linux-3.0.4/arch/x86/lib/getuser.S
 +
 +1:    __copyuser_seg movzb (%_ASM_AX),%edx
        xor %eax,%eax
++      pax_force_retaddr
        ret
        CFI_ENDPROC
-@@ -49,11 +70,24 @@ ENDPROC(__get_user_1)
+ ENDPROC(__get_user_1)
+@@ -49,12 +72,26 @@ ENDPROC(__get_user_1)
  ENTRY(__get_user_2)
        CFI_STARTPROC
        add $1,%_ASM_AX
@@ -17421,9 +18360,11 @@ diff -urNp linux-3.0.4/arch/x86/lib/getuser.S linux-3.0.4/arch/x86/lib/getuser.S
 +
 +2:    __copyuser_seg movzwl -1(%_ASM_AX),%edx
        xor %eax,%eax
++      pax_force_retaddr
        ret
        CFI_ENDPROC
-@@ -62,11 +96,24 @@ ENDPROC(__get_user_2)
+ ENDPROC(__get_user_2)
+@@ -62,12 +99,26 @@ ENDPROC(__get_user_2)
  ENTRY(__get_user_4)
        CFI_STARTPROC
        add $3,%_ASM_AX
@@ -17447,9 +18388,11 @@ diff -urNp linux-3.0.4/arch/x86/lib/getuser.S linux-3.0.4/arch/x86/lib/getuser.S
 +
 +3:    __copyuser_seg mov -3(%_ASM_AX),%edx
        xor %eax,%eax
++      pax_force_retaddr
        ret
        CFI_ENDPROC
-@@ -80,6 +127,15 @@ ENTRY(__get_user_8)
+ ENDPROC(__get_user_4)
+@@ -80,8 +131,18 @@ ENTRY(__get_user_8)
        GET_THREAD_INFO(%_ASM_DX)
        cmp TI_addr_limit(%_ASM_DX),%_ASM_AX
        jae     bad_get_user
@@ -17464,10 +18407,21 @@ diff -urNp linux-3.0.4/arch/x86/lib/getuser.S linux-3.0.4/arch/x86/lib/getuser.S
 +
  4:    movq -7(%_ASM_AX),%_ASM_DX
        xor %eax,%eax
++      pax_force_retaddr
+       ret
+       CFI_ENDPROC
+ ENDPROC(__get_user_8)
+@@ -91,6 +152,7 @@ bad_get_user:
+       CFI_STARTPROC
+       xor %edx,%edx
+       mov $(-EFAULT),%_ASM_AX
++      pax_force_retaddr
        ret
-diff -urNp linux-3.0.4/arch/x86/lib/insn.c linux-3.0.4/arch/x86/lib/insn.c
---- linux-3.0.4/arch/x86/lib/insn.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/insn.c    2011-08-23 21:47:55.000000000 -0400
+       CFI_ENDPROC
+ END(bad_get_user)
+diff -urNp linux-3.1.3/arch/x86/lib/insn.c linux-3.1.3/arch/x86/lib/insn.c
+--- linux-3.1.3/arch/x86/lib/insn.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/insn.c    2011-11-16 18:39:07.000000000 -0500
 @@ -21,6 +21,11 @@
  #include <linux/string.h>
  #include <asm/inat.h>
@@ -17491,141 +18445,125 @@ diff -urNp linux-3.0.4/arch/x86/lib/insn.c linux-3.0.4/arch/x86/lib/insn.c
        insn->x86_64 = x86_64 ? 1 : 0;
        insn->opnd_bytes = 4;
        if (x86_64)
-diff -urNp linux-3.0.4/arch/x86/lib/iomap_copy_64.S linux-3.0.4/arch/x86/lib/iomap_copy_64.S
---- linux-3.0.4/arch/x86/lib/iomap_copy_64.S   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/iomap_copy_64.S   2011-09-17 18:31:51.000000000 -0400
-@@ -25,6 +25,9 @@ ENTRY(__iowrite32_copy)
+diff -urNp linux-3.1.3/arch/x86/lib/iomap_copy_64.S linux-3.1.3/arch/x86/lib/iomap_copy_64.S
+--- linux-3.1.3/arch/x86/lib/iomap_copy_64.S   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/iomap_copy_64.S   2011-11-16 18:39:07.000000000 -0500
+@@ -17,6 +17,7 @@
+ #include <linux/linkage.h>
+ #include <asm/dwarf2.h>
++#include <asm/alternative-asm.h>
+ /*
+  * override generic version in lib/iomap_copy.c
+@@ -25,6 +26,7 @@ ENTRY(__iowrite32_copy)
        CFI_STARTPROC
        movl %edx,%ecx
        rep movsd
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
        CFI_ENDPROC
  ENDPROC(__iowrite32_copy)
-diff -urNp linux-3.0.4/arch/x86/lib/memcpy_64.S linux-3.0.4/arch/x86/lib/memcpy_64.S
---- linux-3.0.4/arch/x86/lib/memcpy_64.S       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/memcpy_64.S       2011-09-17 18:31:51.000000000 -0400
-@@ -34,6 +34,9 @@
+diff -urNp linux-3.1.3/arch/x86/lib/memcpy_64.S linux-3.1.3/arch/x86/lib/memcpy_64.S
+--- linux-3.1.3/arch/x86/lib/memcpy_64.S       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/memcpy_64.S       2011-11-16 18:39:07.000000000 -0500
+@@ -34,6 +34,7 @@
        rep movsq
        movl %edx, %ecx
        rep movsb
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  .Lmemcpy_e:
        .previous
-@@ -51,6 +54,9 @@
+@@ -51,6 +52,7 @@
  
        movl %edx, %ecx
        rep movsb
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  .Lmemcpy_e_e:
        .previous
-@@ -141,6 +147,9 @@ ENTRY(memcpy)
+@@ -141,6 +143,7 @@ ENTRY(memcpy)
        movq %r9,       1*8(%rdi)
        movq %r10,      -2*8(%rdi, %rdx)
        movq %r11,      -1*8(%rdi, %rdx)
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        retq
        .p2align 4
  .Lless_16bytes:
-@@ -153,6 +162,9 @@ ENTRY(memcpy)
+@@ -153,6 +156,7 @@ ENTRY(memcpy)
        movq -1*8(%rsi, %rdx),  %r9
        movq %r8,       0*8(%rdi)
        movq %r9,       -1*8(%rdi, %rdx)
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        retq
        .p2align 4
  .Lless_8bytes:
-@@ -166,6 +178,9 @@ ENTRY(memcpy)
+@@ -166,6 +170,7 @@ ENTRY(memcpy)
        movl -4(%rsi, %rdx), %r8d
        movl %ecx, (%rdi)
        movl %r8d, -4(%rdi, %rdx)
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        retq
        .p2align 4
  .Lless_3bytes:
-@@ -183,6 +198,9 @@ ENTRY(memcpy)
+@@ -183,6 +188,7 @@ ENTRY(memcpy)
        jnz .Lloop_1
  
  .Lend:
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        retq
        CFI_ENDPROC
  ENDPROC(memcpy)
-diff -urNp linux-3.0.4/arch/x86/lib/memmove_64.S linux-3.0.4/arch/x86/lib/memmove_64.S
---- linux-3.0.4/arch/x86/lib/memmove_64.S      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/memmove_64.S      2011-09-17 18:31:51.000000000 -0400
-@@ -201,6 +201,9 @@ ENTRY(memmove)
+diff -urNp linux-3.1.3/arch/x86/lib/memmove_64.S linux-3.1.3/arch/x86/lib/memmove_64.S
+--- linux-3.1.3/arch/x86/lib/memmove_64.S      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/memmove_64.S      2011-11-16 18:39:07.000000000 -0500
+@@ -202,6 +202,7 @@ ENTRY(memmove)
        movb (%rsi), %r11b
        movb %r11b, (%rdi)
  13:
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        retq
        CFI_ENDPROC
  
-@@ -209,6 +212,9 @@ ENTRY(memmove)
+@@ -210,6 +211,7 @@ ENTRY(memmove)
        /* Forward moving data. */
        movq %rdx, %rcx
        rep movsb
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        retq
  .Lmemmove_end_forward_efs:
        .previous
-diff -urNp linux-3.0.4/arch/x86/lib/memset_64.S linux-3.0.4/arch/x86/lib/memset_64.S
---- linux-3.0.4/arch/x86/lib/memset_64.S       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/memset_64.S       2011-09-17 18:31:51.000000000 -0400
-@@ -31,6 +31,9 @@
+diff -urNp linux-3.1.3/arch/x86/lib/memset_64.S linux-3.1.3/arch/x86/lib/memset_64.S
+--- linux-3.1.3/arch/x86/lib/memset_64.S       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/memset_64.S       2011-11-16 18:39:07.000000000 -0500
+@@ -31,6 +31,7 @@
        movl %r8d,%ecx
        rep stosb
        movq %r9,%rax
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  .Lmemset_e:
        .previous
-@@ -53,6 +56,9 @@
+@@ -53,6 +54,7 @@
        movl %edx,%ecx
        rep stosb
        movq %r9,%rax
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  .Lmemset_e_e:
        .previous
-@@ -121,6 +127,9 @@ ENTRY(__memset)
+@@ -121,6 +123,7 @@ ENTRY(__memset)
  
  .Lende:
        movq    %r10,%rax
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  
        CFI_RESTORE_STATE
-diff -urNp linux-3.0.4/arch/x86/lib/mmx_32.c linux-3.0.4/arch/x86/lib/mmx_32.c
---- linux-3.0.4/arch/x86/lib/mmx_32.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/mmx_32.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/lib/mmx_32.c linux-3.1.3/arch/x86/lib/mmx_32.c
+--- linux-3.1.3/arch/x86/lib/mmx_32.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/mmx_32.c  2011-11-16 18:39:07.000000000 -0500
 @@ -29,6 +29,7 @@ void *_mmx_memcpy(void *to, const void *
  {
        void *p;
@@ -17941,27 +18879,48 @@ diff -urNp linux-3.0.4/arch/x86/lib/mmx_32.c linux-3.0.4/arch/x86/lib/mmx_32.c
  
                from += 64;
                to += 64;
-diff -urNp linux-3.0.4/arch/x86/lib/putuser.S linux-3.0.4/arch/x86/lib/putuser.S
---- linux-3.0.4/arch/x86/lib/putuser.S 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/putuser.S 2011-08-23 21:47:55.000000000 -0400
-@@ -15,7 +15,8 @@
+diff -urNp linux-3.1.3/arch/x86/lib/msr-reg.S linux-3.1.3/arch/x86/lib/msr-reg.S
+--- linux-3.1.3/arch/x86/lib/msr-reg.S 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/msr-reg.S 2011-11-16 18:39:07.000000000 -0500
+@@ -3,6 +3,7 @@
+ #include <asm/dwarf2.h>
+ #include <asm/asm.h>
+ #include <asm/msr.h>
++#include <asm/alternative-asm.h>
+ #ifdef CONFIG_X86_64
+ /*
+@@ -37,6 +38,7 @@ ENTRY(native_\op\()_safe_regs)
+       movl    %edi, 28(%r10)
+       popq_cfi %rbp
+       popq_cfi %rbx
++      pax_force_retaddr
+       ret
+ 3:
+       CFI_RESTORE_STATE
+diff -urNp linux-3.1.3/arch/x86/lib/putuser.S linux-3.1.3/arch/x86/lib/putuser.S
+--- linux-3.1.3/arch/x86/lib/putuser.S 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/putuser.S 2011-11-16 18:39:07.000000000 -0500
+@@ -15,7 +15,9 @@
  #include <asm/thread_info.h>
  #include <asm/errno.h>
  #include <asm/asm.h>
 -
 +#include <asm/segment.h>
 +#include <asm/pgtable.h>
++#include <asm/alternative-asm.h>
  
  /*
   * __put_user_X
-@@ -29,52 +30,119 @@
+@@ -29,52 +31,119 @@
   * as they get called from within inline assembly.
   */
  
 -#define ENTER CFI_STARTPROC ; \
 -              GET_THREAD_INFO(%_ASM_BX)
+-#define EXIT  ret ; \
 +#define ENTER CFI_STARTPROC
- #define EXIT  ret ; \
++#define EXIT  pax_force_retaddr; ret ; \
                CFI_ENDPROC
  
 +#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF)
@@ -18081,87 +19040,83 @@ diff -urNp linux-3.0.4/arch/x86/lib/putuser.S linux-3.0.4/arch/x86/lib/putuser.S
  #endif
        xor %eax,%eax
        EXIT
-diff -urNp linux-3.0.4/arch/x86/lib/rwlock_64.S linux-3.0.4/arch/x86/lib/rwlock_64.S
---- linux-3.0.4/arch/x86/lib/rwlock_64.S       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/rwlock_64.S       2011-09-17 18:31:51.000000000 -0400
-@@ -17,6 +17,9 @@ ENTRY(__write_lock_failed)
-       LOCK_PREFIX
-       subl $RW_LOCK_BIAS,(%rdi)
-       jnz  __write_lock_failed
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
+diff -urNp linux-3.1.3/arch/x86/lib/rwlock.S linux-3.1.3/arch/x86/lib/rwlock.S
+--- linux-3.1.3/arch/x86/lib/rwlock.S  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/rwlock.S  2011-11-16 18:39:07.000000000 -0500
+@@ -23,6 +23,7 @@ ENTRY(__write_lock_failed)
+       WRITE_LOCK_SUB($RW_LOCK_BIAS) (%__lock_ptr)
+       jnz     0b
+       ENDFRAME
++      pax_force_retaddr
        ret
        CFI_ENDPROC
  END(__write_lock_failed)
-@@ -33,6 +36,9 @@ ENTRY(__read_lock_failed)
-       LOCK_PREFIX
-       decl (%rdi)
-       js __read_lock_failed
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
+@@ -39,6 +40,7 @@ ENTRY(__read_lock_failed)
+       READ_LOCK_SIZE(dec) (%__lock_ptr)
+       js      0b
+       ENDFRAME
++      pax_force_retaddr
        ret
        CFI_ENDPROC
  END(__read_lock_failed)
-diff -urNp linux-3.0.4/arch/x86/lib/rwsem_64.S linux-3.0.4/arch/x86/lib/rwsem_64.S
---- linux-3.0.4/arch/x86/lib/rwsem_64.S        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/rwsem_64.S        2011-09-17 18:31:51.000000000 -0400
-@@ -51,6 +51,9 @@ ENTRY(call_rwsem_down_read_failed)
-       popq_cfi %rdx
-       CFI_RESTORE rdx
+diff -urNp linux-3.1.3/arch/x86/lib/rwsem.S linux-3.1.3/arch/x86/lib/rwsem.S
+--- linux-3.1.3/arch/x86/lib/rwsem.S   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/rwsem.S   2011-11-16 18:39:07.000000000 -0500
+@@ -94,6 +94,7 @@ ENTRY(call_rwsem_down_read_failed)
+       __ASM_SIZE(pop,_cfi) %__ASM_REG(dx)
+       CFI_RESTORE __ASM_REG(dx)
        restore_common_regs
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
        CFI_ENDPROC
  ENDPROC(call_rwsem_down_read_failed)
-@@ -61,6 +64,9 @@ ENTRY(call_rwsem_down_write_failed)
+@@ -104,6 +105,7 @@ ENTRY(call_rwsem_down_write_failed)
        movq %rax,%rdi
        call rwsem_down_write_failed
        restore_common_regs
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
        CFI_ENDPROC
  ENDPROC(call_rwsem_down_write_failed)
-@@ -73,6 +79,9 @@ ENTRY(call_rwsem_wake)
+@@ -117,7 +119,8 @@ ENTRY(call_rwsem_wake)
        movq %rax,%rdi
        call rwsem_wake
        restore_common_regs
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
- 1:    ret
+-1:    ret
++1:    pax_force_retaddr
++      ret
        CFI_ENDPROC
  ENDPROC(call_rwsem_wake)
-@@ -88,6 +97,9 @@ ENTRY(call_rwsem_downgrade_wake)
-       popq_cfi %rdx
-       CFI_RESTORE rdx
+@@ -131,6 +134,7 @@ ENTRY(call_rwsem_downgrade_wake)
+       __ASM_SIZE(pop,_cfi) %__ASM_REG(dx)
+       CFI_RESTORE __ASM_REG(dx)
        restore_common_regs
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
        CFI_ENDPROC
  ENDPROC(call_rwsem_downgrade_wake)
-diff -urNp linux-3.0.4/arch/x86/lib/thunk_64.S linux-3.0.4/arch/x86/lib/thunk_64.S
---- linux-3.0.4/arch/x86/lib/thunk_64.S        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/thunk_64.S        2011-09-17 18:31:51.000000000 -0400
-@@ -50,5 +50,8 @@
+diff -urNp linux-3.1.3/arch/x86/lib/thunk_64.S linux-3.1.3/arch/x86/lib/thunk_64.S
+--- linux-3.1.3/arch/x86/lib/thunk_64.S        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/thunk_64.S        2011-11-16 18:39:07.000000000 -0500
+@@ -8,6 +8,7 @@
+ #include <linux/linkage.h>
+ #include <asm/dwarf2.h>
+ #include <asm/calling.h>
++#include <asm/alternative-asm.h>
+       /* rdi: arg1 ... normal C conventions. rax is saved/restored. */
+       .macro THUNK name, func, put_ret_addr_in_rdi=0
+@@ -41,5 +42,6 @@
        SAVE_ARGS
  restore:
        RESTORE_ARGS
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
-       ret     
++      pax_force_retaddr
+       ret
        CFI_ENDPROC
-diff -urNp linux-3.0.4/arch/x86/lib/usercopy_32.c linux-3.0.4/arch/x86/lib/usercopy_32.c
---- linux-3.0.4/arch/x86/lib/usercopy_32.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/usercopy_32.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/lib/usercopy_32.c linux-3.1.3/arch/x86/lib/usercopy_32.c
+--- linux-3.1.3/arch/x86/lib/usercopy_32.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/usercopy_32.c     2011-11-16 18:39:07.000000000 -0500
 @@ -43,7 +43,7 @@ do {                                                                    \
        __asm__ __volatile__(                                              \
                "       testl %1,%1\n"                                     \
@@ -18782,9 +19737,9 @@ diff -urNp linux-3.0.4/arch/x86/lib/usercopy_32.c linux-3.0.4/arch/x86/lib/userc
 +}
 +EXPORT_SYMBOL(set_fs);
 +#endif
-diff -urNp linux-3.0.4/arch/x86/lib/usercopy_64.c linux-3.0.4/arch/x86/lib/usercopy_64.c
---- linux-3.0.4/arch/x86/lib/usercopy_64.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/lib/usercopy_64.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/lib/usercopy_64.c linux-3.1.3/arch/x86/lib/usercopy_64.c
+--- linux-3.1.3/arch/x86/lib/usercopy_64.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/lib/usercopy_64.c     2011-11-16 18:39:07.000000000 -0500
 @@ -42,6 +42,12 @@ long
  __strncpy_from_user(char *dst, const char __user *src, long count)
  {
@@ -18816,6 +19771,9 @@ diff -urNp linux-3.0.4/arch/x86/lib/usercopy_64.c linux-3.0.4/arch/x86/lib/userc
  unsigned long copy_in_user(void __user *to, const void __user *from, unsigned len)
  {
 -      if (access_ok(VERIFY_WRITE, to, len) && access_ok(VERIFY_READ, from, len)) { 
+-              return copy_user_generic((__force void *)to, (__force void *)from, len);
+-      } 
+-      return len;             
 +      if (access_ok(VERIFY_WRITE, to, len) && access_ok(VERIFY_READ, from, len)) {
 +
 +#ifdef CONFIG_PAX_MEMORY_UDEREF
@@ -18825,25 +19783,32 @@ diff -urNp linux-3.0.4/arch/x86/lib/usercopy_64.c linux-3.0.4/arch/x86/lib/userc
 +                      from += PAX_USER_SHADOW_BASE;
 +#endif
 +
-               return copy_user_generic((__force void *)to, (__force void *)from, len);
--      } 
--      return len;             
++              return copy_user_generic((void __force_kernel *)to, (void __force_kernel *)from, len);
 +      }
 +      return len;
  }
  EXPORT_SYMBOL(copy_in_user);
  
-diff -urNp linux-3.0.4/arch/x86/Makefile linux-3.0.4/arch/x86/Makefile
---- linux-3.0.4/arch/x86/Makefile      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/Makefile      2011-08-23 21:48:14.000000000 -0400
-@@ -44,6 +44,7 @@ ifeq ($(CONFIG_X86_32),y)
- else
-         BITS := 64
+@@ -164,7 +184,7 @@ EXPORT_SYMBOL(copy_in_user);
+  * it is not necessary to optimize tail handling.
+  */
+ unsigned long
+-copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest)
++copy_user_handle_tail(char __user *to, char __user *from, unsigned len, unsigned zerorest)
+ {
+       char c;
+       unsigned zero_len;
+diff -urNp linux-3.1.3/arch/x86/Makefile linux-3.1.3/arch/x86/Makefile
+--- linux-3.1.3/arch/x86/Makefile      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/Makefile      2011-11-17 18:30:30.000000000 -0500
+@@ -46,6 +46,7 @@ else
          UTS_MACHINE := x86_64
-+        biarch := $(call cc-option,-m64)
          CHECKFLAGS += -D__x86_64__ -m64
  
++        biarch := $(call cc-option,-m64)
          KBUILD_AFLAGS += -m64
+         KBUILD_CFLAGS += -m64
 @@ -195,3 +196,12 @@ define archhelp
    echo  '                  FDARGS="..."  arguments for the booted kernel'
    echo  '                  FDINITRD=file initrd for the booted kernel'
@@ -18857,9 +19822,9 @@ diff -urNp linux-3.0.4/arch/x86/Makefile linux-3.0.4/arch/x86/Makefile
 +
 +archprepare:
 +      $(if $(LDFLAGS_BUILD_ID),,$(error $(OLD_LD)))
-diff -urNp linux-3.0.4/arch/x86/mm/extable.c linux-3.0.4/arch/x86/mm/extable.c
---- linux-3.0.4/arch/x86/mm/extable.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/extable.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/extable.c linux-3.1.3/arch/x86/mm/extable.c
+--- linux-3.1.3/arch/x86/mm/extable.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/extable.c  2011-11-16 18:39:07.000000000 -0500
 @@ -8,7 +8,7 @@ int fixup_exception(struct pt_regs *regs
        const struct exception_table_entry *fixup;
  
@@ -18869,10 +19834,10 @@ diff -urNp linux-3.0.4/arch/x86/mm/extable.c linux-3.0.4/arch/x86/mm/extable.c
                extern u32 pnp_bios_fault_eip, pnp_bios_fault_esp;
                extern u32 pnp_bios_is_utter_crap;
                pnp_bios_is_utter_crap = 1;
-diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
---- linux-3.0.4/arch/x86/mm/fault.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/fault.c    2011-08-23 21:48:14.000000000 -0400
-@@ -13,10 +13,18 @@
+diff -urNp linux-3.1.3/arch/x86/mm/fault.c linux-3.1.3/arch/x86/mm/fault.c
+--- linux-3.1.3/arch/x86/mm/fault.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/fault.c    2011-11-16 20:43:50.000000000 -0500
+@@ -13,11 +13,18 @@
  #include <linux/perf_event.h>         /* perf_sw_event                */
  #include <linux/hugetlb.h>            /* hstate_index_to_shift        */
  #include <linux/prefetch.h>           /* prefetchw                    */
@@ -18882,7 +19847,7 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
  #include <asm/traps.h>                        /* dotraplinkage, ...           */
  #include <asm/pgalloc.h>              /* pgd_*(), ...                 */
  #include <asm/kmemcheck.h>            /* kmemcheck_*(), ...           */
-+#include <asm/vsyscall.h>
+ #include <asm/vsyscall.h>
 +#include <asm/tlbflush.h>
 +
 +#if defined(CONFIG_X86_64) && defined(CONFIG_PAX_MEMORY_UDEREF)
@@ -18891,7 +19856,7 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
  
  /*
   * Page fault error code bits:
-@@ -54,7 +62,7 @@ static inline int __kprobes notify_page_
+@@ -55,7 +62,7 @@ static inline int __kprobes notify_page_
        int ret = 0;
  
        /* kprobe_running() needs smp_processor_id() */
@@ -18900,34 +19865,38 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
                preempt_disable();
                if (kprobe_running() && kprobe_fault_handler(regs, 14))
                        ret = 1;
-@@ -115,7 +123,10 @@ check_prefetch_opcode(struct pt_regs *re
+@@ -116,7 +123,10 @@ check_prefetch_opcode(struct pt_regs *re
                return !instr_lo || (instr_lo>>1) == 1;
        case 0x00:
                /* Prefetch instruction is 0x0F0D or 0x0F18 */
 -              if (probe_kernel_address(instr, opcode))
 +              if (user_mode(regs)) {
-+                      if (__copy_from_user_inatomic(&opcode, (__force unsigned char __user *)(instr), 1))
++                      if (__copy_from_user_inatomic(&opcode, (unsigned char __force_user *)(instr), 1))
 +                              return 0;
 +              } else if (probe_kernel_address(instr, opcode))
                        return 0;
  
                *prefetch = (instr_lo == 0xF) &&
-@@ -149,7 +160,10 @@ is_prefetch(struct pt_regs *regs, unsign
+@@ -150,7 +160,10 @@ is_prefetch(struct pt_regs *regs, unsign
        while (instr < max_instr) {
                unsigned char opcode;
  
 -              if (probe_kernel_address(instr, opcode))
 +              if (user_mode(regs)) {
-+                      if (__copy_from_user_inatomic(&opcode, (__force unsigned char __user *)(instr), 1))
++                      if (__copy_from_user_inatomic(&opcode, (unsigned char __force_user *)(instr), 1))
 +                              break;
 +              } else if (probe_kernel_address(instr, opcode))
                        break;
  
                instr++;
-@@ -180,6 +194,30 @@ force_sig_info_fault(int si_signo, int s
+@@ -181,6 +194,34 @@ force_sig_info_fault(int si_signo, int s
        force_sig_info(si_signo, &info, tsk);
  }
  
++#if defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC)
++static bool pax_is_fetch_fault(struct pt_regs *regs, unsigned long error_code, unsigned long address);
++#endif
++
 +#ifdef CONFIG_PAX_EMUTRAMP
 +static int pax_handle_fetch_fault(struct pt_regs *regs);
 +#endif
@@ -18955,7 +19924,7 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
  DEFINE_SPINLOCK(pgd_lock);
  LIST_HEAD(pgd_list);
  
-@@ -230,10 +268,22 @@ void vmalloc_sync_all(void)
+@@ -231,10 +272,22 @@ void vmalloc_sync_all(void)
        for (address = VMALLOC_START & PMD_MASK;
             address >= TASK_SIZE && address < FIXADDR_TOP;
             address += PMD_SIZE) {
@@ -18978,7 +19947,7 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
                        spinlock_t *pgt_lock;
                        pmd_t *ret;
  
-@@ -241,8 +291,13 @@ void vmalloc_sync_all(void)
+@@ -242,8 +295,13 @@ void vmalloc_sync_all(void)
                        pgt_lock = &pgd_page_get_mm(page)->page_table_lock;
  
                        spin_lock(pgt_lock);
@@ -18993,7 +19962,7 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
  
                        if (!ret)
                                break;
-@@ -276,6 +331,11 @@ static noinline __kprobes int vmalloc_fa
+@@ -277,6 +335,11 @@ static noinline __kprobes int vmalloc_fa
         * an interrupt in the middle of a task switch..
         */
        pgd_paddr = read_cr3();
@@ -19005,7 +19974,7 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
        pmd_k = vmalloc_sync_one(__va(pgd_paddr), address);
        if (!pmd_k)
                return -1;
-@@ -371,7 +431,14 @@ static noinline __kprobes int vmalloc_fa
+@@ -372,7 +435,14 @@ static noinline __kprobes int vmalloc_fa
         * happen within a race in page table update. In the later
         * case just flush:
         */
@@ -19020,7 +19989,7 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
        pgd_ref = pgd_offset_k(address);
        if (pgd_none(*pgd_ref))
                return -1;
-@@ -533,7 +600,7 @@ static int is_errata93(struct pt_regs *r
+@@ -534,7 +604,7 @@ static int is_errata93(struct pt_regs *r
  static int is_errata100(struct pt_regs *regs, unsigned long address)
  {
  #ifdef CONFIG_X86_64
@@ -19029,7 +19998,7 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
                return 1;
  #endif
        return 0;
-@@ -560,7 +627,7 @@ static int is_f00f_bug(struct pt_regs *r
+@@ -561,7 +631,7 @@ static int is_f00f_bug(struct pt_regs *r
  }
  
  static const char nx_warning[] = KERN_CRIT
@@ -19038,7 +20007,7 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
  
  static void
  show_fault_oops(struct pt_regs *regs, unsigned long error_code,
-@@ -569,14 +636,25 @@ show_fault_oops(struct pt_regs *regs, un
+@@ -570,14 +640,25 @@ show_fault_oops(struct pt_regs *regs, un
        if (!oops_may_print())
                return;
  
@@ -19066,40 +20035,12 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
  
        printk(KERN_ALERT "BUG: unable to handle kernel ");
        if (address < PAGE_SIZE)
-@@ -702,6 +780,66 @@ __bad_area_nosemaphore(struct pt_regs *r
-                      unsigned long address, int si_code)
- {
-       struct task_struct *tsk = current;
-+#if defined(CONFIG_X86_64) || defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC)
-+      struct mm_struct *mm = tsk->mm;
-+#endif
-+
-+#ifdef CONFIG_X86_64
-+      if (mm && (error_code & PF_INSTR) && mm->context.vdso) {
-+              if (regs->ip == VSYSCALL_ADDR(__NR_vgettimeofday) ||
-+                  regs->ip == VSYSCALL_ADDR(__NR_vtime) ||
-+                  regs->ip == VSYSCALL_ADDR(__NR_vgetcpu)) {
-+                      regs->ip += mm->context.vdso - PAGE_SIZE - VSYSCALL_START;
-+                      return;
-+              }
-+      }
-+#endif
-+
+@@ -733,6 +814,21 @@ __bad_area_nosemaphore(struct pt_regs *r
+               }
+ #endif
 +#if defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC)
-+      if (mm && (error_code & PF_USER)) {
-+              unsigned long ip = regs->ip;
-+
-+              if (v8086_mode(regs))
-+                      ip = ((regs->cs & 0xffff) << 4) + (ip & 0xffff);
-+
-+              /*
-+               * It's possible to have interrupts off here:
-+               */
-+              local_irq_enable();
-+
-+#ifdef CONFIG_PAX_PAGEEXEC
-+              if ((mm->pax_flags & MF_PAX_PAGEEXEC) &&
-+                  (((__supported_pte_mask & _PAGE_NX) && (error_code & PF_INSTR)) || (!(error_code & (PF_PROT | PF_WRITE)) && ip == address))) {
++              if (pax_is_fetch_fault(regs, error_code, address)) {
 +
 +#ifdef CONFIG_PAX_EMUTRAMP
 +                      switch (pax_handle_fetch_fault(regs)) {
@@ -19108,32 +20049,24 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
 +                      }
 +#endif
 +
-+                      pax_report_fault(regs, (void *)ip, (void *)regs->sp);
++                      pax_report_fault(regs, (void *)regs->ip, (void *)regs->sp);
 +                      do_group_exit(SIGKILL);
 +              }
 +#endif
 +
-+#ifdef CONFIG_PAX_SEGMEXEC
-+              if ((mm->pax_flags & MF_PAX_SEGMEXEC) && !(error_code & (PF_PROT | PF_WRITE)) && (ip + SEGMEXEC_TASK_SIZE == address)) {
-+
-+#ifdef CONFIG_PAX_EMUTRAMP
-+                      switch (pax_handle_fetch_fault(regs)) {
-+                      case 2:
-+                              return;
-+                      }
-+#endif
-+
-+                      pax_report_fault(regs, (void *)ip, (void *)regs->sp);
-+                      do_group_exit(SIGKILL);
-+              }
-+#endif
-+
-+      }
-+#endif
+               if (unlikely(show_unhandled_signals))
+                       show_signal_msg(regs, error_code, address, tsk);
  
-       /* User mode accesses just cause a SIGSEGV */
-       if (error_code & PF_USER) {
-@@ -871,6 +1009,99 @@ static int spurious_fault_check(unsigned
+@@ -829,7 +925,7 @@ do_sigbus(struct pt_regs *regs, unsigned
+       if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) {
+               printk(KERN_ERR
+       "MCE: Killing %s:%d due to hardware memory corruption fault at %lx\n",
+-                      tsk->comm, tsk->pid, address);
++                      tsk->comm, task_pid_nr(tsk), address);
+               code = BUS_MCEERR_AR;
+       }
+ #endif
+@@ -884,6 +980,99 @@ static int spurious_fault_check(unsigned
        return 1;
  }
  
@@ -19233,7 +20166,7 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
  /*
   * Handle a spurious fault caused by a stale TLB entry.
   *
-@@ -943,6 +1174,9 @@ int show_unhandled_signals = 1;
+@@ -956,6 +1145,9 @@ int show_unhandled_signals = 1;
  static inline int
  access_error(unsigned long error_code, struct vm_area_struct *vma)
  {
@@ -19243,7 +20176,7 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
        if (error_code & PF_WRITE) {
                /* write, present and write, not present: */
                if (unlikely(!(vma->vm_flags & VM_WRITE)))
-@@ -976,19 +1210,33 @@ do_page_fault(struct pt_regs *regs, unsi
+@@ -989,19 +1181,33 @@ do_page_fault(struct pt_regs *regs, unsi
  {
        struct vm_area_struct *vma;
        struct task_struct *tsk;
@@ -19265,7 +20198,7 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
 +              }
 +              if (address < PAX_USER_SHADOW_BASE) {
 +                      printk(KERN_ERR "PAX: please report this to pageexec@freemail.hu\n");
-+                      printk(KERN_ERR "PAX: faulting IP: %pA\n", (void *)regs->ip);
++                      printk(KERN_ERR "PAX: faulting IP: %pS\n", (void *)regs->ip);
 +                      show_trace_log_lvl(NULL, NULL, (void *)regs->sp, regs->bp, KERN_ERR);
 +              } else
 +                      address -= PAX_USER_SHADOW_BASE;
@@ -19281,7 +20214,7 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
        /*
         * Detect and handle instructions that would cause a page fault for
         * both a tracked kernel page and a userspace page.
-@@ -1048,7 +1296,7 @@ do_page_fault(struct pt_regs *regs, unsi
+@@ -1061,7 +1267,7 @@ do_page_fault(struct pt_regs *regs, unsi
         * User-mode registers count as a user access even for any
         * potential system fault or CPU buglet:
         */
@@ -19290,7 +20223,7 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
                local_irq_enable();
                error_code |= PF_USER;
        } else {
-@@ -1103,6 +1351,11 @@ retry:
+@@ -1116,6 +1322,11 @@ retry:
                might_sleep();
        }
  
@@ -19302,7 +20235,7 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
        vma = find_vma(mm, address);
        if (unlikely(!vma)) {
                bad_area(regs, error_code, address);
-@@ -1114,18 +1367,24 @@ retry:
+@@ -1127,18 +1338,24 @@ retry:
                bad_area(regs, error_code, address);
                return;
        }
@@ -19338,11 +20271,42 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
        if (unlikely(expand_stack(vma, address))) {
                bad_area(regs, error_code, address);
                return;
-@@ -1180,3 +1439,199 @@ good_area:
+@@ -1193,3 +1410,240 @@ good_area:
  
        up_read(&mm->mmap_sem);
  }
 +
++#if defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC)
++static bool pax_is_fetch_fault(struct pt_regs *regs, unsigned long error_code, unsigned long address)
++{
++      struct mm_struct *mm = current->mm;
++      unsigned long ip = regs->ip;
++
++      if (v8086_mode(regs))
++              ip = ((regs->cs & 0xffff) << 4) + (ip & 0xffff);
++
++#ifdef CONFIG_PAX_PAGEEXEC
++      if (mm->pax_flags & MF_PAX_PAGEEXEC) {
++              if ((__supported_pte_mask & _PAGE_NX) && (error_code & PF_INSTR))
++                      return true;
++              if (!(error_code & (PF_PROT | PF_WRITE)) && ip == address)
++                      return true;
++              return false;
++      }
++#endif
++
++#ifdef CONFIG_PAX_SEGMEXEC
++      if (mm->pax_flags & MF_PAX_SEGMEXEC) {
++              if (!(error_code & (PF_PROT | PF_WRITE)) && (ip + SEGMEXEC_TASK_SIZE == address))
++                      return true;
++              return false;
++      }
++#endif
++
++      return false;
++}
++#endif
++
 +#ifdef CONFIG_PAX_EMUTRAMP
 +static int pax_handle_fetch_fault_32(struct pt_regs *regs)
 +{
@@ -19484,14 +20448,14 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
 +#endif
 +
 +#if defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC)
-+void pax_report_insns(void *pc, void *sp)
++void pax_report_insns(struct pt_regs *regs, void *pc, void *sp)
 +{
 +      long i;
 +
 +      printk(KERN_ERR "PAX: bytes at PC: ");
 +      for (i = 0; i < 20; i++) {
 +              unsigned char c;
-+              if (get_user(c, (__force unsigned char __user *)pc+i))
++              if (get_user(c, (unsigned char __force_user *)pc+i))
 +                      printk(KERN_CONT "?? ");
 +              else
 +                      printk(KERN_CONT "%02x ", c);
@@ -19501,14 +20465,24 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
 +      printk(KERN_ERR "PAX: bytes at SP-%lu: ", (unsigned long)sizeof(long));
 +      for (i = -1; i < 80 / (long)sizeof(long); i++) {
 +              unsigned long c;
-+              if (get_user(c, (__force unsigned long __user *)sp+i))
++              if (get_user(c, (unsigned long __force_user *)sp+i)) {
 +#ifdef CONFIG_X86_32
 +                      printk(KERN_CONT "???????? ");
 +#else
-+                      printk(KERN_CONT "???????????????? ");
++                      if ((regs->cs == __USER32_CS || (regs->cs & SEGMENT_LDT)))
++                              printk(KERN_CONT "???????? ???????? ");
++                      else
++                              printk(KERN_CONT "???????????????? ");
 +#endif
-+              else
-+                      printk(KERN_CONT "%0*lx ", 2 * (int)sizeof(long), c);
++              } else {
++#ifdef CONFIG_X86_64
++                      if ((regs->cs == __USER32_CS || (regs->cs & SEGMENT_LDT))) {
++                              printk(KERN_CONT "%08x ", (unsigned int)c);
++                              printk(KERN_CONT "%08x ", (unsigned int)(c >> 32));
++                      } else
++#endif
++                              printk(KERN_CONT "%0*lx ", 2 * (int)sizeof(long), c);
++              }
 +      }
 +      printk("\n");
 +}
@@ -19531,17 +20505,17 @@ diff -urNp linux-3.0.4/arch/x86/mm/fault.c linux-3.0.4/arch/x86/mm/fault.c
 +      set_fs(KERNEL_DS);
 +      pagefault_disable();
 +      pax_open_kernel();
-+      ret = __copy_to_user_inatomic((__force void __user *)dst, src, size);
++      ret = __copy_to_user_inatomic((void __force_user *)dst, src, size);
 +      pax_close_kernel();
 +      pagefault_enable();
 +      set_fs(old_fs);
 +
 +      return ret ? -EFAULT : 0;
 +}
-diff -urNp linux-3.0.4/arch/x86/mm/gup.c linux-3.0.4/arch/x86/mm/gup.c
---- linux-3.0.4/arch/x86/mm/gup.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/gup.c      2011-08-23 21:47:55.000000000 -0400
-@@ -263,7 +263,7 @@ int __get_user_pages_fast(unsigned long 
+diff -urNp linux-3.1.3/arch/x86/mm/gup.c linux-3.1.3/arch/x86/mm/gup.c
+--- linux-3.1.3/arch/x86/mm/gup.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/gup.c      2011-11-16 18:39:07.000000000 -0500
+@@ -253,7 +253,7 @@ int __get_user_pages_fast(unsigned long 
        addr = start;
        len = (unsigned long) nr_pages << PAGE_SHIFT;
        end = start + len;
@@ -19550,9 +20524,9 @@ diff -urNp linux-3.0.4/arch/x86/mm/gup.c linux-3.0.4/arch/x86/mm/gup.c
                                        (void __user *)start, len)))
                return 0;
  
-diff -urNp linux-3.0.4/arch/x86/mm/highmem_32.c linux-3.0.4/arch/x86/mm/highmem_32.c
---- linux-3.0.4/arch/x86/mm/highmem_32.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/highmem_32.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/highmem_32.c linux-3.1.3/arch/x86/mm/highmem_32.c
+--- linux-3.1.3/arch/x86/mm/highmem_32.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/highmem_32.c       2011-11-16 18:39:07.000000000 -0500
 @@ -44,7 +44,10 @@ void *kmap_atomic_prot(struct page *page
        idx = type + KM_TYPE_NR*smp_processor_id();
        vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
@@ -19564,9 +20538,9 @@ diff -urNp linux-3.0.4/arch/x86/mm/highmem_32.c linux-3.0.4/arch/x86/mm/highmem_
  
        return (void *)vaddr;
  }
-diff -urNp linux-3.0.4/arch/x86/mm/hugetlbpage.c linux-3.0.4/arch/x86/mm/hugetlbpage.c
---- linux-3.0.4/arch/x86/mm/hugetlbpage.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/hugetlbpage.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/hugetlbpage.c linux-3.1.3/arch/x86/mm/hugetlbpage.c
+--- linux-3.1.3/arch/x86/mm/hugetlbpage.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/hugetlbpage.c      2011-11-16 18:39:07.000000000 -0500
 @@ -266,13 +266,20 @@ static unsigned long hugetlb_get_unmappe
        struct hstate *h = hstate_file(file);
        struct mm_struct *mm = current->mm;
@@ -19774,9 +20748,9 @@ diff -urNp linux-3.0.4/arch/x86/mm/hugetlbpage.c linux-3.0.4/arch/x86/mm/hugetlb
                        return addr;
        }
        if (mm->get_unmapped_area == arch_get_unmapped_area)
-diff -urNp linux-3.0.4/arch/x86/mm/init_32.c linux-3.0.4/arch/x86/mm/init_32.c
---- linux-3.0.4/arch/x86/mm/init_32.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/init_32.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/init_32.c linux-3.1.3/arch/x86/mm/init_32.c
+--- linux-3.1.3/arch/x86/mm/init_32.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/init_32.c  2011-11-16 18:39:07.000000000 -0500
 @@ -74,36 +74,6 @@ static __init void *alloc_low_page(void)
  }
  
@@ -20051,9 +21025,9 @@ diff -urNp linux-3.0.4/arch/x86/mm/init_32.c linux-3.0.4/arch/x86/mm/init_32.c
        set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT);
        printk(KERN_INFO "Write protecting the kernel text: %luk\n",
                size >> 10);
-diff -urNp linux-3.0.4/arch/x86/mm/init_64.c linux-3.0.4/arch/x86/mm/init_64.c
---- linux-3.0.4/arch/x86/mm/init_64.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/init_64.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/init_64.c linux-3.1.3/arch/x86/mm/init_64.c
+--- linux-3.1.3/arch/x86/mm/init_64.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/init_64.c  2011-11-16 18:39:07.000000000 -0500
 @@ -75,7 +75,7 @@ early_param("gbpages", parse_direct_gbpa
   * around without checking the pgd every time.
   */
@@ -20132,6 +21106,24 @@ diff -urNp linux-3.0.4/arch/x86/mm/init_64.c linux-3.0.4/arch/x86/mm/init_64.c
                }
                pmd = pmd_offset(pud, phys);
                BUG_ON(!pmd_none(*pmd));
+@@ -330,7 +344,7 @@ static __ref void *alloc_low_page(unsign
+       if (pfn >= pgt_buf_top)
+               panic("alloc_low_page: ran out of memory");
+-      adr = early_memremap(pfn * PAGE_SIZE, PAGE_SIZE);
++      adr = (void __force_kernel *)early_memremap(pfn * PAGE_SIZE, PAGE_SIZE);
+       clear_page(adr);
+       *phys  = pfn * PAGE_SIZE;
+       return adr;
+@@ -346,7 +360,7 @@ static __ref void *map_low_page(void *vi
+       phys = __pa(virt);
+       left = phys & (PAGE_SIZE - 1);
+-      adr = early_memremap(phys & PAGE_MASK, PAGE_SIZE);
++      adr = (void __force_kernel *)early_memremap(phys & PAGE_MASK, PAGE_SIZE);
+       adr = (void *)(((unsigned long)adr) | left);
+       return adr;
 @@ -693,6 +707,12 @@ void __init mem_init(void)
  
        pci_iommu_alloc();
@@ -20165,9 +21157,9 @@ diff -urNp linux-3.0.4/arch/x86/mm/init_64.c linux-3.0.4/arch/x86/mm/init_64.c
                return "[vdso]";
        if (vma == &gate_vma)
                return "[vsyscall]";
-diff -urNp linux-3.0.4/arch/x86/mm/init.c linux-3.0.4/arch/x86/mm/init.c
---- linux-3.0.4/arch/x86/mm/init.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/init.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/init.c linux-3.1.3/arch/x86/mm/init.c
+--- linux-3.1.3/arch/x86/mm/init.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/init.c     2011-11-17 18:31:28.000000000 -0500
 @@ -31,7 +31,7 @@ int direct_gbpages
  static void __init find_early_table_space(unsigned long end, int use_pse,
                                          int use_gbpages)
@@ -20177,7 +21169,7 @@ diff -urNp linux-3.0.4/arch/x86/mm/init.c linux-3.0.4/arch/x86/mm/init.c
        phys_addr_t base;
  
        puds = (end + PUD_SIZE - 1) >> PUD_SHIFT;
-@@ -313,12 +313,34 @@ unsigned long __init_refok init_memory_m
+@@ -312,8 +312,29 @@ unsigned long __init_refok init_memory_m
   */
  int devmem_is_allowed(unsigned long pagenr)
  {
@@ -20208,12 +21200,7 @@ diff -urNp linux-3.0.4/arch/x86/mm/init.c linux-3.0.4/arch/x86/mm/init.c
        if (iomem_is_exclusive(pagenr << PAGE_SHIFT))
                return 0;
        if (!page_is_ram(pagenr))
-               return 1;
-+
-       return 0;
- }
-@@ -373,6 +395,86 @@ void free_init_pages(char *what, unsigne
+@@ -372,6 +393,86 @@ void free_init_pages(char *what, unsigne
  
  void free_initmem(void)
  {
@@ -20300,9 +21287,9 @@ diff -urNp linux-3.0.4/arch/x86/mm/init.c linux-3.0.4/arch/x86/mm/init.c
        free_init_pages("unused kernel memory",
                        (unsigned long)(&__init_begin),
                        (unsigned long)(&__init_end));
-diff -urNp linux-3.0.4/arch/x86/mm/iomap_32.c linux-3.0.4/arch/x86/mm/iomap_32.c
---- linux-3.0.4/arch/x86/mm/iomap_32.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/iomap_32.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/iomap_32.c linux-3.1.3/arch/x86/mm/iomap_32.c
+--- linux-3.1.3/arch/x86/mm/iomap_32.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/iomap_32.c 2011-11-16 18:39:07.000000000 -0500
 @@ -64,7 +64,11 @@ void *kmap_atomic_prot_pfn(unsigned long
        type = kmap_atomic_idx_push();
        idx = type + KM_TYPE_NR * smp_processor_id();
@@ -20315,9 +21302,9 @@ diff -urNp linux-3.0.4/arch/x86/mm/iomap_32.c linux-3.0.4/arch/x86/mm/iomap_32.c
        arch_flush_lazy_mmu_mode();
  
        return (void *)vaddr;
-diff -urNp linux-3.0.4/arch/x86/mm/ioremap.c linux-3.0.4/arch/x86/mm/ioremap.c
---- linux-3.0.4/arch/x86/mm/ioremap.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/ioremap.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/ioremap.c linux-3.1.3/arch/x86/mm/ioremap.c
+--- linux-3.1.3/arch/x86/mm/ioremap.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/ioremap.c  2011-11-16 18:39:07.000000000 -0500
 @@ -97,7 +97,7 @@ static void __iomem *__ioremap_caller(re
        for (pfn = phys_addr >> PAGE_SHIFT; pfn <= last_pfn; pfn++) {
                int is_ram = page_is_ram(pfn);
@@ -20346,9 +21333,9 @@ diff -urNp linux-3.0.4/arch/x86/mm/ioremap.c linux-3.0.4/arch/x86/mm/ioremap.c
  
        /*
         * The boot-ioremap range spans multiple pmds, for which
-diff -urNp linux-3.0.4/arch/x86/mm/kmemcheck/kmemcheck.c linux-3.0.4/arch/x86/mm/kmemcheck/kmemcheck.c
---- linux-3.0.4/arch/x86/mm/kmemcheck/kmemcheck.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/kmemcheck/kmemcheck.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/kmemcheck/kmemcheck.c linux-3.1.3/arch/x86/mm/kmemcheck/kmemcheck.c
+--- linux-3.1.3/arch/x86/mm/kmemcheck/kmemcheck.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/kmemcheck/kmemcheck.c      2011-11-16 18:39:07.000000000 -0500
 @@ -622,9 +622,9 @@ bool kmemcheck_fault(struct pt_regs *reg
         * memory (e.g. tracked pages)? For now, we need this to avoid
         * invoking kmemcheck for PnP BIOS calls.
@@ -20361,9 +21348,9 @@ diff -urNp linux-3.0.4/arch/x86/mm/kmemcheck/kmemcheck.c linux-3.0.4/arch/x86/mm
                return false;
  
        pte = kmemcheck_pte_lookup(address);
-diff -urNp linux-3.0.4/arch/x86/mm/mmap.c linux-3.0.4/arch/x86/mm/mmap.c
---- linux-3.0.4/arch/x86/mm/mmap.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/mmap.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/mmap.c linux-3.1.3/arch/x86/mm/mmap.c
+--- linux-3.1.3/arch/x86/mm/mmap.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/mmap.c     2011-11-16 18:39:07.000000000 -0500
 @@ -49,7 +49,7 @@ static unsigned int stack_maxrandom_size
   * Leave an at least ~128 MB hole with possible stack randomization.
   */
@@ -20445,9 +21432,9 @@ diff -urNp linux-3.0.4/arch/x86/mm/mmap.c linux-3.0.4/arch/x86/mm/mmap.c
                mm->get_unmapped_area = arch_get_unmapped_area_topdown;
                mm->unmap_area = arch_unmap_area_topdown;
        }
-diff -urNp linux-3.0.4/arch/x86/mm/mmio-mod.c linux-3.0.4/arch/x86/mm/mmio-mod.c
---- linux-3.0.4/arch/x86/mm/mmio-mod.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/mmio-mod.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/mmio-mod.c linux-3.1.3/arch/x86/mm/mmio-mod.c
+--- linux-3.1.3/arch/x86/mm/mmio-mod.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/mmio-mod.c 2011-11-16 18:39:07.000000000 -0500
 @@ -195,7 +195,7 @@ static void pre(struct kmmio_probe *p, s
                break;
        default:
@@ -20475,9 +21462,9 @@ diff -urNp linux-3.0.4/arch/x86/mm/mmio-mod.c linux-3.0.4/arch/x86/mm/mmio-mod.c
        };
        map.map_id = trace->id;
  
-diff -urNp linux-3.0.4/arch/x86/mm/pageattr.c linux-3.0.4/arch/x86/mm/pageattr.c
---- linux-3.0.4/arch/x86/mm/pageattr.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/pageattr.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/pageattr.c linux-3.1.3/arch/x86/mm/pageattr.c
+--- linux-3.1.3/arch/x86/mm/pageattr.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/pageattr.c 2011-11-16 18:39:07.000000000 -0500
 @@ -261,7 +261,7 @@ static inline pgprot_t static_protection
         */
  #ifdef CONFIG_PCI_BIOS
@@ -20562,9 +21549,9 @@ diff -urNp linux-3.0.4/arch/x86/mm/pageattr.c linux-3.0.4/arch/x86/mm/pageattr.c
  }
  
  static int
-diff -urNp linux-3.0.4/arch/x86/mm/pageattr-test.c linux-3.0.4/arch/x86/mm/pageattr-test.c
---- linux-3.0.4/arch/x86/mm/pageattr-test.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/pageattr-test.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/pageattr-test.c linux-3.1.3/arch/x86/mm/pageattr-test.c
+--- linux-3.1.3/arch/x86/mm/pageattr-test.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/pageattr-test.c    2011-11-16 18:39:07.000000000 -0500
 @@ -36,7 +36,7 @@ enum {
  
  static int pte_testbit(pte_t pte)
@@ -20574,9 +21561,9 @@ diff -urNp linux-3.0.4/arch/x86/mm/pageattr-test.c linux-3.0.4/arch/x86/mm/pagea
  }
  
  struct split_state {
-diff -urNp linux-3.0.4/arch/x86/mm/pat.c linux-3.0.4/arch/x86/mm/pat.c
---- linux-3.0.4/arch/x86/mm/pat.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/pat.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/pat.c linux-3.1.3/arch/x86/mm/pat.c
+--- linux-3.1.3/arch/x86/mm/pat.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/pat.c      2011-11-16 18:39:07.000000000 -0500
 @@ -361,7 +361,7 @@ int free_memtype(u64 start, u64 end)
  
        if (!entry) {
@@ -20624,9 +21611,9 @@ diff -urNp linux-3.0.4/arch/x86/mm/pat.c linux-3.0.4/arch/x86/mm/pat.c
                                cattr_name(want_flags),
                                (unsigned long long)paddr,
                                (unsigned long long)(paddr + size),
-diff -urNp linux-3.0.4/arch/x86/mm/pf_in.c linux-3.0.4/arch/x86/mm/pf_in.c
---- linux-3.0.4/arch/x86/mm/pf_in.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/pf_in.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/pf_in.c linux-3.1.3/arch/x86/mm/pf_in.c
+--- linux-3.1.3/arch/x86/mm/pf_in.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/pf_in.c    2011-11-16 18:39:07.000000000 -0500
 @@ -148,7 +148,7 @@ enum reason_type get_ins_type(unsigned l
        int i;
        enum reason_type rv = OTHERS;
@@ -20672,9 +21659,9 @@ diff -urNp linux-3.0.4/arch/x86/mm/pf_in.c linux-3.0.4/arch/x86/mm/pf_in.c
        p += skip_prefix(p, &prf);
        p += get_opcode(p, &opcode);
        for (i = 0; i < ARRAY_SIZE(imm_wop); i++)
-diff -urNp linux-3.0.4/arch/x86/mm/pgtable_32.c linux-3.0.4/arch/x86/mm/pgtable_32.c
---- linux-3.0.4/arch/x86/mm/pgtable_32.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/pgtable_32.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/pgtable_32.c linux-3.1.3/arch/x86/mm/pgtable_32.c
+--- linux-3.1.3/arch/x86/mm/pgtable_32.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/pgtable_32.c       2011-11-16 18:39:07.000000000 -0500
 @@ -48,10 +48,13 @@ void set_pte_vaddr(unsigned long vaddr, 
                return;
        }
@@ -20689,9 +21676,9 @@ diff -urNp linux-3.0.4/arch/x86/mm/pgtable_32.c linux-3.0.4/arch/x86/mm/pgtable_
  
        /*
         * It's enough to flush this one mapping.
-diff -urNp linux-3.0.4/arch/x86/mm/pgtable.c linux-3.0.4/arch/x86/mm/pgtable.c
---- linux-3.0.4/arch/x86/mm/pgtable.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/pgtable.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/pgtable.c linux-3.1.3/arch/x86/mm/pgtable.c
+--- linux-3.1.3/arch/x86/mm/pgtable.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/pgtable.c  2011-11-16 18:39:07.000000000 -0500
 @@ -84,10 +84,52 @@ static inline void pgd_list_del(pgd_t *p
        list_del(&page->lru);
  }
@@ -20937,9 +21924,9 @@ diff -urNp linux-3.0.4/arch/x86/mm/pgtable.c linux-3.0.4/arch/x86/mm/pgtable.c
        pgd_dtor(pgd);
        paravirt_pgd_free(mm, pgd);
        free_page((unsigned long)pgd);
-diff -urNp linux-3.0.4/arch/x86/mm/setup_nx.c linux-3.0.4/arch/x86/mm/setup_nx.c
---- linux-3.0.4/arch/x86/mm/setup_nx.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/setup_nx.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/setup_nx.c linux-3.1.3/arch/x86/mm/setup_nx.c
+--- linux-3.1.3/arch/x86/mm/setup_nx.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/setup_nx.c 2011-11-16 18:39:07.000000000 -0500
 @@ -5,8 +5,10 @@
  #include <asm/pgtable.h>
  #include <asm/proto.h>
@@ -20969,9 +21956,9 @@ diff -urNp linux-3.0.4/arch/x86/mm/setup_nx.c linux-3.0.4/arch/x86/mm/setup_nx.c
                __supported_pte_mask &= ~_PAGE_NX;
  }
  
-diff -urNp linux-3.0.4/arch/x86/mm/tlb.c linux-3.0.4/arch/x86/mm/tlb.c
---- linux-3.0.4/arch/x86/mm/tlb.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/mm/tlb.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/mm/tlb.c linux-3.1.3/arch/x86/mm/tlb.c
+--- linux-3.1.3/arch/x86/mm/tlb.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/mm/tlb.c      2011-11-16 18:39:07.000000000 -0500
 @@ -65,7 +65,11 @@ void leave_mm(int cpu)
                BUG();
        cpumask_clear_cpu(cpu,
@@ -20984,12 +21971,40 @@ diff -urNp linux-3.0.4/arch/x86/mm/tlb.c linux-3.0.4/arch/x86/mm/tlb.c
  }
  EXPORT_SYMBOL_GPL(leave_mm);
  
-diff -urNp linux-3.0.4/arch/x86/net/bpf_jit_comp.c linux-3.0.4/arch/x86/net/bpf_jit_comp.c
---- linux-3.0.4/arch/x86/net/bpf_jit_comp.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/net/bpf_jit_comp.c    2011-08-23 21:47:55.000000000 -0400
-@@ -589,7 +589,9 @@ cond_branch:                       f_offset = addrs[i + filt
-                                       module_free(NULL, image);
-                                       return;
+diff -urNp linux-3.1.3/arch/x86/net/bpf_jit_comp.c linux-3.1.3/arch/x86/net/bpf_jit_comp.c
+--- linux-3.1.3/arch/x86/net/bpf_jit_comp.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/net/bpf_jit_comp.c    2011-11-20 19:21:53.000000000 -0500
+@@ -117,6 +117,10 @@ static inline void bpf_flush_icache(void
+       set_fs(old_fs);
+ }
++struct bpf_jit_work {
++      struct work_struct work;
++      void *image;
++};
+ void bpf_jit_compile(struct sk_filter *fp)
+ {
+@@ -141,6 +145,10 @@ void bpf_jit_compile(struct sk_filter *f
+       if (addrs == NULL)
+               return;
++      fp->work = kmalloc(sizeof(*fp->work), GFP_KERNEL);
++      if (!fp->work)
++              goto out;
++
+       /* Before first pass, make a rough estimation of addrs[]
+        * each bpf instruction is translated to less than 64 bytes
+        */
+@@ -585,11 +593,12 @@ cond_branch:                     f_offset = addrs[i + filt
+                       if (image) {
+                               if (unlikely(proglen + ilen > oldproglen)) {
+                                       pr_err("bpb_jit_compile fatal error\n");
+-                                      kfree(addrs);
+-                                      module_free(NULL, image);
+-                                      return;
++                                      module_free_exec(NULL, image);
++                                      goto out;
                                }
 +                              pax_open_kernel();
                                memcpy(image + proglen, temp, ilen);
@@ -20997,7 +22012,7 @@ diff -urNp linux-3.0.4/arch/x86/net/bpf_jit_comp.c linux-3.0.4/arch/x86/net/bpf_
                        }
                        proglen += ilen;
                        addrs[i] = proglen;
-@@ -609,7 +611,7 @@ cond_branch:                       f_offset = addrs[i + filt
+@@ -609,7 +618,7 @@ cond_branch:                       f_offset = addrs[i + filt
                        break;
                }
                if (proglen == oldproglen) {
@@ -21006,10 +22021,144 @@ diff -urNp linux-3.0.4/arch/x86/net/bpf_jit_comp.c linux-3.0.4/arch/x86/net/bpf_
                                                   proglen,
                                                   sizeof(struct work_struct)));
                        if (!image)
-diff -urNp linux-3.0.4/arch/x86/oprofile/backtrace.c linux-3.0.4/arch/x86/oprofile/backtrace.c
---- linux-3.0.4/arch/x86/oprofile/backtrace.c  2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/arch/x86/oprofile/backtrace.c  2011-08-23 21:47:55.000000000 -0400
-@@ -148,7 +148,7 @@ x86_backtrace(struct pt_regs * const reg
+@@ -631,24 +640,27 @@ cond_branch:                     f_offset = addrs[i + filt
+               fp->bpf_func = (void *)image;
+       }
+ out:
++      kfree(fp->work);
+       kfree(addrs);
+       return;
+ }
+ static void jit_free_defer(struct work_struct *arg)
+ {
+-      module_free(NULL, arg);
++      module_free_exec(NULL, ((struct bpf_jit_work*)arg)->image);
++      kfree(arg);
+ }
+ /* run from softirq, we must use a work_struct to call
+- * module_free() from process context
++ * module_free_exec() from process context
+  */
+ void bpf_jit_free(struct sk_filter *fp)
+ {
+       if (fp->bpf_func != sk_run_filter) {
+-              struct work_struct *work = (struct work_struct *)fp->bpf_func;
++              struct work_struct *work = &fp->work->work;
+               INIT_WORK(work, jit_free_defer);
++              fp->work->image = fp->bpf_func;
+               schedule_work(work);
+       }
+ }
+diff -urNp linux-3.1.3/arch/x86/net/bpf_jit.S linux-3.1.3/arch/x86/net/bpf_jit.S
+--- linux-3.1.3/arch/x86/net/bpf_jit.S 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/net/bpf_jit.S 2011-11-16 18:39:07.000000000 -0500
+@@ -9,6 +9,7 @@
+  */
+ #include <linux/linkage.h>
+ #include <asm/dwarf2.h>
++#include <asm/alternative-asm.h>
+ /*
+  * Calling convention :
+@@ -35,6 +36,7 @@ sk_load_word:
+       jle     bpf_slow_path_word
+       mov     (SKBDATA,%rsi),%eax
+       bswap   %eax                    /* ntohl() */
++      pax_force_retaddr
+       ret
+@@ -53,6 +55,7 @@ sk_load_half:
+       jle     bpf_slow_path_half
+       movzwl  (SKBDATA,%rsi),%eax
+       rol     $8,%ax                  # ntohs()
++      pax_force_retaddr
+       ret
+ sk_load_byte_ind:
+@@ -66,6 +69,7 @@ sk_load_byte:
+       cmp     %esi,%r9d   /* if (offset >= hlen) goto bpf_slow_path_byte */
+       jle     bpf_slow_path_byte
+       movzbl  (SKBDATA,%rsi),%eax
++      pax_force_retaddr
+       ret
+ /**
+@@ -82,6 +86,7 @@ ENTRY(sk_load_byte_msh)
+       movzbl  (SKBDATA,%rsi),%ebx
+       and     $15,%bl
+       shl     $2,%bl
++      pax_force_retaddr
+       ret
+       CFI_ENDPROC
+ ENDPROC(sk_load_byte_msh)
+@@ -91,6 +96,7 @@ bpf_error:
+       xor             %eax,%eax
+       mov             -8(%rbp),%rbx
+       leaveq
++      pax_force_retaddr
+       ret
+ /* rsi contains offset and can be scratched */
+@@ -113,6 +119,7 @@ bpf_slow_path_word:
+       js      bpf_error
+       mov     -12(%rbp),%eax
+       bswap   %eax
++      pax_force_retaddr
+       ret
+ bpf_slow_path_half:
+@@ -121,12 +128,14 @@ bpf_slow_path_half:
+       mov     -12(%rbp),%ax
+       rol     $8,%ax
+       movzwl  %ax,%eax
++      pax_force_retaddr
+       ret
+ bpf_slow_path_byte:
+       bpf_slow_path_common(1)
+       js      bpf_error
+       movzbl  -12(%rbp),%eax
++      pax_force_retaddr
+       ret
+ bpf_slow_path_byte_msh:
+@@ -137,4 +146,5 @@ bpf_slow_path_byte_msh:
+       and     $15,%al
+       shl     $2,%al
+       xchg    %eax,%ebx
++      pax_force_retaddr
+       ret
+diff -urNp linux-3.1.3/arch/x86/oprofile/backtrace.c linux-3.1.3/arch/x86/oprofile/backtrace.c
+--- linux-3.1.3/arch/x86/oprofile/backtrace.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/oprofile/backtrace.c  2011-11-16 18:39:07.000000000 -0500
+@@ -46,11 +46,11 @@ dump_user_backtrace_32(struct stack_fram
+       struct stack_frame_ia32 *fp;
+       unsigned long bytes;
+-      bytes = copy_from_user_nmi(bufhead, head, sizeof(bufhead));
++      bytes = copy_from_user_nmi(bufhead, (const char __force_user *)head, sizeof(bufhead));
+       if (bytes != sizeof(bufhead))
+               return NULL;
+-      fp = (struct stack_frame_ia32 *) compat_ptr(bufhead[0].next_frame);
++      fp = (struct stack_frame_ia32 __force_kernel *) compat_ptr(bufhead[0].next_frame);
+       oprofile_add_trace(bufhead[0].return_address);
+@@ -92,7 +92,7 @@ static struct stack_frame *dump_user_bac
+       struct stack_frame bufhead[2];
+       unsigned long bytes;
+-      bytes = copy_from_user_nmi(bufhead, head, sizeof(bufhead));
++      bytes = copy_from_user_nmi(bufhead, (const char __force_user *)head, sizeof(bufhead));
+       if (bytes != sizeof(bufhead))
+               return NULL;
+@@ -111,7 +111,7 @@ x86_backtrace(struct pt_regs * const reg
  {
        struct stack_frame *head = (struct stack_frame *)frame_pointer(regs);
  
@@ -21018,9 +22167,9 @@ diff -urNp linux-3.0.4/arch/x86/oprofile/backtrace.c linux-3.0.4/arch/x86/oprofi
                unsigned long stack = kernel_stack_pointer(regs);
                if (depth)
                        dump_trace(NULL, regs, (unsigned long *)stack, 0,
-diff -urNp linux-3.0.4/arch/x86/pci/mrst.c linux-3.0.4/arch/x86/pci/mrst.c
---- linux-3.0.4/arch/x86/pci/mrst.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/pci/mrst.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/pci/mrst.c linux-3.1.3/arch/x86/pci/mrst.c
+--- linux-3.1.3/arch/x86/pci/mrst.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/pci/mrst.c    2011-11-16 18:39:07.000000000 -0500
 @@ -234,7 +234,9 @@ int __init pci_mrst_init(void)
        printk(KERN_INFO "Moorestown platform detected, using MRST PCI ops\n");
        pci_mmcfg_late_init();
@@ -21032,9 +22181,9 @@ diff -urNp linux-3.0.4/arch/x86/pci/mrst.c linux-3.0.4/arch/x86/pci/mrst.c
        /* Continue with standard init */
        return 1;
  }
-diff -urNp linux-3.0.4/arch/x86/pci/pcbios.c linux-3.0.4/arch/x86/pci/pcbios.c
---- linux-3.0.4/arch/x86/pci/pcbios.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/pci/pcbios.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/pci/pcbios.c linux-3.1.3/arch/x86/pci/pcbios.c
+--- linux-3.1.3/arch/x86/pci/pcbios.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/pci/pcbios.c  2011-11-16 18:39:07.000000000 -0500
 @@ -79,50 +79,93 @@ union bios32 {
  static struct {
        unsigned long address;
@@ -21170,7 +22319,7 @@ diff -urNp linux-3.0.4/arch/x86/pci/pcbios.c linux-3.0.4/arch/x86/pci/pcbios.c
                        : "memory");
                local_irq_restore(flags);
  
-@@ -188,7 +234,10 @@ static int pci_bios_read(unsigned int se
+@@ -189,7 +235,10 @@ static int pci_bios_read(unsigned int se
  
        switch (len) {
        case 1:
@@ -21182,7 +22331,7 @@ diff -urNp linux-3.0.4/arch/x86/pci/pcbios.c linux-3.0.4/arch/x86/pci/pcbios.c
                        "jc 1f\n\t"
                        "xor %%ah, %%ah\n"
                        "1:"
-@@ -197,7 +246,8 @@ static int pci_bios_read(unsigned int se
+@@ -198,7 +247,8 @@ static int pci_bios_read(unsigned int se
                        : "1" (PCIBIOS_READ_CONFIG_BYTE),
                          "b" (bx),
                          "D" ((long)reg),
@@ -21192,7 +22341,7 @@ diff -urNp linux-3.0.4/arch/x86/pci/pcbios.c linux-3.0.4/arch/x86/pci/pcbios.c
                /*
                 * Zero-extend the result beyond 8 bits, do not trust the
                 * BIOS having done it:
-@@ -205,7 +255,10 @@ static int pci_bios_read(unsigned int se
+@@ -206,7 +256,10 @@ static int pci_bios_read(unsigned int se
                *value &= 0xff;
                break;
        case 2:
@@ -21204,7 +22353,7 @@ diff -urNp linux-3.0.4/arch/x86/pci/pcbios.c linux-3.0.4/arch/x86/pci/pcbios.c
                        "jc 1f\n\t"
                        "xor %%ah, %%ah\n"
                        "1:"
-@@ -214,7 +267,8 @@ static int pci_bios_read(unsigned int se
+@@ -215,7 +268,8 @@ static int pci_bios_read(unsigned int se
                        : "1" (PCIBIOS_READ_CONFIG_WORD),
                          "b" (bx),
                          "D" ((long)reg),
@@ -21214,7 +22363,7 @@ diff -urNp linux-3.0.4/arch/x86/pci/pcbios.c linux-3.0.4/arch/x86/pci/pcbios.c
                /*
                 * Zero-extend the result beyond 16 bits, do not trust the
                 * BIOS having done it:
-@@ -222,7 +276,10 @@ static int pci_bios_read(unsigned int se
+@@ -223,7 +277,10 @@ static int pci_bios_read(unsigned int se
                *value &= 0xffff;
                break;
        case 4:
@@ -21226,7 +22375,7 @@ diff -urNp linux-3.0.4/arch/x86/pci/pcbios.c linux-3.0.4/arch/x86/pci/pcbios.c
                        "jc 1f\n\t"
                        "xor %%ah, %%ah\n"
                        "1:"
-@@ -231,7 +288,8 @@ static int pci_bios_read(unsigned int se
+@@ -232,7 +289,8 @@ static int pci_bios_read(unsigned int se
                        : "1" (PCIBIOS_READ_CONFIG_DWORD),
                          "b" (bx),
                          "D" ((long)reg),
@@ -21236,7 +22385,7 @@ diff -urNp linux-3.0.4/arch/x86/pci/pcbios.c linux-3.0.4/arch/x86/pci/pcbios.c
                break;
        }
  
-@@ -254,7 +312,10 @@ static int pci_bios_write(unsigned int s
+@@ -256,7 +314,10 @@ static int pci_bios_write(unsigned int s
  
        switch (len) {
        case 1:
@@ -21248,7 +22397,7 @@ diff -urNp linux-3.0.4/arch/x86/pci/pcbios.c linux-3.0.4/arch/x86/pci/pcbios.c
                        "jc 1f\n\t"
                        "xor %%ah, %%ah\n"
                        "1:"
-@@ -263,10 +324,14 @@ static int pci_bios_write(unsigned int s
+@@ -265,10 +326,14 @@ static int pci_bios_write(unsigned int s
                          "c" (value),
                          "b" (bx),
                          "D" ((long)reg),
@@ -21265,7 +22414,7 @@ diff -urNp linux-3.0.4/arch/x86/pci/pcbios.c linux-3.0.4/arch/x86/pci/pcbios.c
                        "jc 1f\n\t"
                        "xor %%ah, %%ah\n"
                        "1:"
-@@ -275,10 +340,14 @@ static int pci_bios_write(unsigned int s
+@@ -277,10 +342,14 @@ static int pci_bios_write(unsigned int s
                          "c" (value),
                          "b" (bx),
                          "D" ((long)reg),
@@ -21282,7 +22431,7 @@ diff -urNp linux-3.0.4/arch/x86/pci/pcbios.c linux-3.0.4/arch/x86/pci/pcbios.c
                        "jc 1f\n\t"
                        "xor %%ah, %%ah\n"
                        "1:"
-@@ -287,7 +356,8 @@ static int pci_bios_write(unsigned int s
+@@ -289,7 +358,8 @@ static int pci_bios_write(unsigned int s
                          "c" (value),
                          "b" (bx),
                          "D" ((long)reg),
@@ -21292,7 +22441,7 @@ diff -urNp linux-3.0.4/arch/x86/pci/pcbios.c linux-3.0.4/arch/x86/pci/pcbios.c
                break;
        }
  
-@@ -392,10 +462,13 @@ struct irq_routing_table * pcibios_get_i
+@@ -394,10 +464,13 @@ struct irq_routing_table * pcibios_get_i
  
        DBG("PCI: Fetching IRQ routing table... ");
        __asm__("push %%es\n\t"
@@ -21307,7 +22456,7 @@ diff -urNp linux-3.0.4/arch/x86/pci/pcbios.c linux-3.0.4/arch/x86/pci/pcbios.c
                "jc 1f\n\t"
                "xor %%ah, %%ah\n"
                "1:"
-@@ -406,7 +479,8 @@ struct irq_routing_table * pcibios_get_i
+@@ -408,7 +481,8 @@ struct irq_routing_table * pcibios_get_i
                  "1" (0),
                  "D" ((long) &opt),
                  "S" (&pci_indirect),
@@ -21317,7 +22466,7 @@ diff -urNp linux-3.0.4/arch/x86/pci/pcbios.c linux-3.0.4/arch/x86/pci/pcbios.c
                : "memory");
        DBG("OK  ret=%d, size=%d, map=%x\n", ret, opt.size, map);
        if (ret & 0xff00)
-@@ -430,7 +504,10 @@ int pcibios_set_irq_routing(struct pci_d
+@@ -432,7 +506,10 @@ int pcibios_set_irq_routing(struct pci_d
  {
        int ret;
  
@@ -21329,7 +22478,7 @@ diff -urNp linux-3.0.4/arch/x86/pci/pcbios.c linux-3.0.4/arch/x86/pci/pcbios.c
                "jc 1f\n\t"
                "xor %%ah, %%ah\n"
                "1:"
-@@ -438,7 +515,8 @@ int pcibios_set_irq_routing(struct pci_d
+@@ -440,7 +517,8 @@ int pcibios_set_irq_routing(struct pci_d
                : "0" (PCIBIOS_SET_PCI_HW_INT),
                  "b" ((dev->bus->number << 8) | dev->devfn),
                  "c" ((irq << 8) | (pin + 10)),
@@ -21339,9 +22488,9 @@ diff -urNp linux-3.0.4/arch/x86/pci/pcbios.c linux-3.0.4/arch/x86/pci/pcbios.c
        return !(ret & 0xff00);
  }
  EXPORT_SYMBOL(pcibios_set_irq_routing);
-diff -urNp linux-3.0.4/arch/x86/platform/efi/efi_32.c linux-3.0.4/arch/x86/platform/efi/efi_32.c
---- linux-3.0.4/arch/x86/platform/efi/efi_32.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/platform/efi/efi_32.c 2011-09-19 09:16:58.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/platform/efi/efi_32.c linux-3.1.3/arch/x86/platform/efi/efi_32.c
+--- linux-3.1.3/arch/x86/platform/efi/efi_32.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/platform/efi/efi_32.c 2011-11-16 18:39:07.000000000 -0500
 @@ -38,70 +38,56 @@
   */
  
@@ -21396,9 +22545,9 @@ diff -urNp linux-3.0.4/arch/x86/platform/efi/efi_32.c linux-3.0.4/arch/x86/platf
  
 +#ifdef CONFIG_PAX_KERNEXEC
 +      pack_descriptor(&d, 0, 0xFFFFF, 0x9B, 0xC);
-+      write_gdt_entry(get_cpu_gdt_table(0), GDT_ENTRY_EFI_CS, &d, DESCTYPE_S);
++      write_gdt_entry(get_cpu_gdt_table(0), GDT_ENTRY_KERNEXEC_EFI_CS, &d, DESCTYPE_S);
 +      pack_descriptor(&d, 0, 0xFFFFF, 0x93, 0xC);
-+      write_gdt_entry(get_cpu_gdt_table(0), GDT_ENTRY_EFI_DS, &d, DESCTYPE_S);
++      write_gdt_entry(get_cpu_gdt_table(0), GDT_ENTRY_KERNEXEC_EFI_DS, &d, DESCTYPE_S);
 +#endif
 +
        gdt_descr.address = __pa(get_cpu_gdt_table(0));
@@ -21416,8 +22565,8 @@ diff -urNp linux-3.0.4/arch/x86/platform/efi/efi_32.c linux-3.0.4/arch/x86/platf
 +      struct desc_struct d;
 +
 +      memset(&d, 0, sizeof d);
-+      write_gdt_entry(get_cpu_gdt_table(0), GDT_ENTRY_EFI_CS, &d, DESCTYPE_S);
-+      write_gdt_entry(get_cpu_gdt_table(0), GDT_ENTRY_EFI_DS, &d, DESCTYPE_S);
++      write_gdt_entry(get_cpu_gdt_table(0), GDT_ENTRY_KERNEXEC_EFI_CS, &d, DESCTYPE_S);
++      write_gdt_entry(get_cpu_gdt_table(0), GDT_ENTRY_KERNEXEC_EFI_DS, &d, DESCTYPE_S);
 +#endif
 +
        gdt_descr.address = (unsigned long)get_cpu_gdt_table(0);
@@ -21439,9 +22588,9 @@ diff -urNp linux-3.0.4/arch/x86/platform/efi/efi_32.c linux-3.0.4/arch/x86/platf
  
        /*
         * After the lock is released, the original page table is restored.
-diff -urNp linux-3.0.4/arch/x86/platform/efi/efi_stub_32.S linux-3.0.4/arch/x86/platform/efi/efi_stub_32.S
---- linux-3.0.4/arch/x86/platform/efi/efi_stub_32.S    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/platform/efi/efi_stub_32.S    2011-09-19 09:16:58.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/platform/efi/efi_stub_32.S linux-3.1.3/arch/x86/platform/efi/efi_stub_32.S
+--- linux-3.1.3/arch/x86/platform/efi/efi_stub_32.S    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/platform/efi/efi_stub_32.S    2011-11-16 18:39:07.000000000 -0500
 @@ -6,7 +6,9 @@
   */
  
@@ -21550,81 +22699,75 @@ diff -urNp linux-3.0.4/arch/x86/platform/efi/efi_stub_32.S linux-3.0.4/arch/x86/
  saved_return_addr:
        .long 0
  efi_rt_function_ptr:
-diff -urNp linux-3.0.4/arch/x86/platform/efi/efi_stub_64.S linux-3.0.4/arch/x86/platform/efi/efi_stub_64.S
---- linux-3.0.4/arch/x86/platform/efi/efi_stub_64.S    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/platform/efi/efi_stub_64.S    2011-09-17 18:31:51.000000000 -0400
-@@ -40,6 +40,9 @@ ENTRY(efi_call0)
+diff -urNp linux-3.1.3/arch/x86/platform/efi/efi_stub_64.S linux-3.1.3/arch/x86/platform/efi/efi_stub_64.S
+--- linux-3.1.3/arch/x86/platform/efi/efi_stub_64.S    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/platform/efi/efi_stub_64.S    2011-11-16 18:39:07.000000000 -0500
+@@ -7,6 +7,7 @@
+  */
+ #include <linux/linkage.h>
++#include <asm/alternative-asm.h>
+ #define SAVE_XMM                      \
+       mov %rsp, %rax;                 \
+@@ -40,6 +41,7 @@ ENTRY(efi_call0)
        call *%rdi
        addq $32, %rsp
        RESTORE_XMM
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  ENDPROC(efi_call0)
  
-@@ -50,6 +53,9 @@ ENTRY(efi_call1)
+@@ -50,6 +52,7 @@ ENTRY(efi_call1)
        call *%rdi
        addq $32, %rsp
        RESTORE_XMM
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  ENDPROC(efi_call1)
  
-@@ -60,6 +66,9 @@ ENTRY(efi_call2)
+@@ -60,6 +63,7 @@ ENTRY(efi_call2)
        call *%rdi
        addq $32, %rsp
        RESTORE_XMM
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  ENDPROC(efi_call2)
  
-@@ -71,6 +80,9 @@ ENTRY(efi_call3)
+@@ -71,6 +75,7 @@ ENTRY(efi_call3)
        call *%rdi
        addq $32, %rsp
        RESTORE_XMM
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  ENDPROC(efi_call3)
  
-@@ -83,6 +95,9 @@ ENTRY(efi_call4)
+@@ -83,6 +88,7 @@ ENTRY(efi_call4)
        call *%rdi
        addq $32, %rsp
        RESTORE_XMM
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  ENDPROC(efi_call4)
  
-@@ -96,6 +111,9 @@ ENTRY(efi_call5)
+@@ -96,6 +102,7 @@ ENTRY(efi_call5)
        call *%rdi
        addq $48, %rsp
        RESTORE_XMM
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  ENDPROC(efi_call5)
  
-@@ -112,5 +130,8 @@ ENTRY(efi_call6)
+@@ -112,5 +119,6 @@ ENTRY(efi_call6)
        call *%rdi
        addq $48, %rsp
        RESTORE_XMM
-+#ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+      orb $0x80, 0x7(%rsp)
-+#endif
++      pax_force_retaddr
        ret
  ENDPROC(efi_call6)
-diff -urNp linux-3.0.4/arch/x86/platform/mrst/mrst.c linux-3.0.4/arch/x86/platform/mrst/mrst.c
---- linux-3.0.4/arch/x86/platform/mrst/mrst.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/platform/mrst/mrst.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/platform/mrst/mrst.c linux-3.1.3/arch/x86/platform/mrst/mrst.c
+--- linux-3.1.3/arch/x86/platform/mrst/mrst.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/platform/mrst/mrst.c  2011-11-16 18:39:07.000000000 -0500
 @@ -239,14 +239,16 @@ static int mrst_i8042_detect(void)
  }
  
@@ -21644,21 +22787,21 @@ diff -urNp linux-3.0.4/arch/x86/platform/mrst/mrst.c linux-3.0.4/arch/x86/platfo
  }
  
  /*
-diff -urNp linux-3.0.4/arch/x86/platform/uv/tlb_uv.c linux-3.0.4/arch/x86/platform/uv/tlb_uv.c
---- linux-3.0.4/arch/x86/platform/uv/tlb_uv.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/platform/uv/tlb_uv.c  2011-08-23 21:48:14.000000000 -0400
-@@ -373,6 +373,8 @@ static void reset_with_ipi(struct bau_ta
-       cpumask_t mask;
+diff -urNp linux-3.1.3/arch/x86/platform/uv/tlb_uv.c linux-3.1.3/arch/x86/platform/uv/tlb_uv.c
+--- linux-3.1.3/arch/x86/platform/uv/tlb_uv.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/platform/uv/tlb_uv.c  2011-11-16 19:39:11.000000000 -0500
+@@ -377,6 +377,8 @@ static void reset_with_ipi(struct pnmask
+       struct bau_control *smaster = bcp->socket_master;
        struct reset_args reset_args;
  
 +      pax_track_stack();
 +
        reset_args.sender = sender;
-       cpus_clear(mask);
+       cpus_clear(*mask);
        /* find a single cpu for each uvhub in this distribution mask */
-diff -urNp linux-3.0.4/arch/x86/power/cpu.c linux-3.0.4/arch/x86/power/cpu.c
---- linux-3.0.4/arch/x86/power/cpu.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/power/cpu.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/power/cpu.c linux-3.1.3/arch/x86/power/cpu.c
+--- linux-3.1.3/arch/x86/power/cpu.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/power/cpu.c   2011-11-16 18:39:07.000000000 -0500
 @@ -130,7 +130,7 @@ static void do_fpu_end(void)
  static void fix_processor_context(void)
  {
@@ -21678,10 +22821,10 @@ diff -urNp linux-3.0.4/arch/x86/power/cpu.c linux-3.0.4/arch/x86/power/cpu.c
  
        syscall_init();                         /* This sets MSR_*STAR and related */
  #endif
-diff -urNp linux-3.0.4/arch/x86/vdso/Makefile linux-3.0.4/arch/x86/vdso/Makefile
---- linux-3.0.4/arch/x86/vdso/Makefile 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/vdso/Makefile 2011-08-23 21:47:55.000000000 -0400
-@@ -136,7 +136,7 @@ quiet_cmd_vdso = VDSO    $@
+diff -urNp linux-3.1.3/arch/x86/vdso/Makefile linux-3.1.3/arch/x86/vdso/Makefile
+--- linux-3.1.3/arch/x86/vdso/Makefile 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/vdso/Makefile 2011-11-16 18:39:07.000000000 -0500
+@@ -137,7 +137,7 @@ quiet_cmd_vdso = VDSO    $@
                       -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
                 sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
  
@@ -21690,9 +22833,9 @@ diff -urNp linux-3.0.4/arch/x86/vdso/Makefile linux-3.0.4/arch/x86/vdso/Makefile
  GCOV_PROFILE := n
  
  #
-diff -urNp linux-3.0.4/arch/x86/vdso/vdso32-setup.c linux-3.0.4/arch/x86/vdso/vdso32-setup.c
---- linux-3.0.4/arch/x86/vdso/vdso32-setup.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/vdso/vdso32-setup.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/vdso/vdso32-setup.c linux-3.1.3/arch/x86/vdso/vdso32-setup.c
+--- linux-3.1.3/arch/x86/vdso/vdso32-setup.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/vdso/vdso32-setup.c   2011-11-16 18:39:07.000000000 -0500
 @@ -25,6 +25,7 @@
  #include <asm/tlbflush.h>
  #include <asm/vdso.h>
@@ -21775,100 +22918,58 @@ diff -urNp linux-3.0.4/arch/x86/vdso/vdso32-setup.c linux-3.0.4/arch/x86/vdso/vd
                return &gate_vma;
        return NULL;
  }
-diff -urNp linux-3.0.4/arch/x86/vdso/vma.c linux-3.0.4/arch/x86/vdso/vma.c
---- linux-3.0.4/arch/x86/vdso/vma.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/vdso/vma.c    2011-08-23 21:47:55.000000000 -0400
-@@ -15,18 +15,19 @@
- #include <asm/proto.h>
+diff -urNp linux-3.1.3/arch/x86/vdso/vma.c linux-3.1.3/arch/x86/vdso/vma.c
+--- linux-3.1.3/arch/x86/vdso/vma.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/vdso/vma.c    2011-11-16 18:39:07.000000000 -0500
+@@ -16,8 +16,6 @@
  #include <asm/vdso.h>
+ #include <asm/page.h>
  
 -unsigned int __read_mostly vdso_enabled = 1;
 -
  extern char vdso_start[], vdso_end[];
  extern unsigned short vdso_sync_cpuid;
-+extern char __vsyscall_0;
  
- static struct page **vdso_pages;
-+static struct page *vsyscall_page;
- static unsigned vdso_size;
- static int __init init_vdso_vars(void)
+@@ -97,13 +95,15 @@ static unsigned long vdso_addr(unsigned 
+ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
  {
--      int npages = (vdso_end - vdso_start + PAGE_SIZE - 1) / PAGE_SIZE;
--      int i;
-+      size_t nbytes = vdso_end - vdso_start;
-+      size_t npages = (nbytes + PAGE_SIZE - 1) / PAGE_SIZE;
-+      size_t i;
-       vdso_size = npages << PAGE_SHIFT;
-       vdso_pages = kmalloc(sizeof(struct page *) * npages, GFP_KERNEL);
-@@ -34,19 +35,19 @@ static int __init init_vdso_vars(void)
-               goto oom;
-       for (i = 0; i < npages; i++) {
-               struct page *p;
--              p = alloc_page(GFP_KERNEL);
-+              p = alloc_page(GFP_KERNEL | __GFP_ZERO);
-               if (!p)
-                       goto oom;
-               vdso_pages[i] = p;
--              copy_page(page_address(p), vdso_start + i*PAGE_SIZE);
-+              memcpy(page_address(p), vdso_start + i*PAGE_SIZE, nbytes > PAGE_SIZE ? PAGE_SIZE : nbytes);
-+              nbytes -= PAGE_SIZE;
-       }
-+      vsyscall_page = pfn_to_page((__pa_symbol(&__vsyscall_0)) >> PAGE_SHIFT);
-       return 0;
-  oom:
--      printk("Cannot allocate vdso\n");
--      vdso_enabled = 0;
--      return -ENOMEM;
-+      panic("Cannot allocate vdso\n");
- }
- subsys_initcall(init_vdso_vars);
-@@ -80,37 +81,35 @@ int arch_setup_additional_pages(struct l
-       unsigned long addr;
+       struct mm_struct *mm = current->mm;
+-      unsigned long addr;
++      unsigned long addr = 0;
        int ret;
  
 -      if (!vdso_enabled)
 -              return 0;
 -
        down_write(&mm->mmap_sem);
--      addr = vdso_addr(mm->start_stack, vdso_size);
--      addr = get_unmapped_area(NULL, addr, vdso_size, 0, 0);
-+      addr = vdso_addr(mm->start_stack, vdso_size + PAGE_SIZE);
-+      addr = get_unmapped_area(NULL, addr, vdso_size + PAGE_SIZE, 0, 0);
++
++#ifdef CONFIG_PAX_RANDMMAP
++      if (!(mm->pax_flags & MF_PAX_RANDMMAP))
++#endif
++
+       addr = vdso_addr(mm->start_stack, vdso_size);
+       addr = get_unmapped_area(NULL, addr, vdso_size, 0, 0);
        if (IS_ERR_VALUE(addr)) {
-               ret = addr;
+@@ -111,26 +111,18 @@ int arch_setup_additional_pages(struct l
                goto up_fail;
        }
  
 -      current->mm->context.vdso = (void *)addr;
-+      mm->context.vdso = addr + PAGE_SIZE;
++      mm->context.vdso = addr;
  
--      ret = install_special_mapping(mm, addr, vdso_size,
-+      ret = install_special_mapping(mm, addr, PAGE_SIZE,
+       ret = install_special_mapping(mm, addr, vdso_size,
                                      VM_READ|VM_EXEC|
--                                    VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC|
-+                                    VM_MAYREAD|VM_MAYEXEC|
+                                     VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC|
                                      VM_ALWAYSDUMP,
--                                    vdso_pages);
-+                                    &vsyscall_page);
-       if (ret) {
+                                     vdso_pages);
+-      if (ret) {
 -              current->mm->context.vdso = NULL;
-+              mm->context.vdso = 0;
-               goto up_fail;
-       }
-+      ret = install_special_mapping(mm, addr + PAGE_SIZE, vdso_size,
-+                                    VM_READ|VM_EXEC|
-+                                    VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC|
-+                                    VM_ALWAYSDUMP,
-+                                    vdso_pages);
+-              goto up_fail;
+-      }
++
 +      if (ret)
 +              mm->context.vdso = 0;
-+
  up_fail:
        up_write(&mm->mmap_sem);
        return ret;
@@ -21880,9 +22981,9 @@ diff -urNp linux-3.0.4/arch/x86/vdso/vma.c linux-3.0.4/arch/x86/vdso/vma.c
 -      return 0;
 -}
 -__setup("vdso=", vdso_setup);
-diff -urNp linux-3.0.4/arch/x86/xen/enlighten.c linux-3.0.4/arch/x86/xen/enlighten.c
---- linux-3.0.4/arch/x86/xen/enlighten.c       2011-09-02 18:11:26.000000000 -0400
-+++ linux-3.0.4/arch/x86/xen/enlighten.c       2011-08-29 23:26:21.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/xen/enlighten.c linux-3.1.3/arch/x86/xen/enlighten.c
+--- linux-3.1.3/arch/x86/xen/enlighten.c       2011-11-26 19:57:27.000000000 -0500
++++ linux-3.1.3/arch/x86/xen/enlighten.c       2011-11-26 19:58:40.000000000 -0500
 @@ -85,8 +85,6 @@ EXPORT_SYMBOL_GPL(xen_start_info);
  
  struct shared_info xen_dummy_shared_info;
@@ -21892,7 +22993,7 @@ diff -urNp linux-3.0.4/arch/x86/xen/enlighten.c linux-3.0.4/arch/x86/xen/enlight
  RESERVE_BRK(shared_info_page_brk, PAGE_SIZE);
  __read_mostly int xen_have_vector_callback;
  EXPORT_SYMBOL_GPL(xen_have_vector_callback);
-@@ -1010,7 +1008,7 @@ static const struct pv_apic_ops xen_apic
+@@ -1028,7 +1026,7 @@ static const struct pv_apic_ops xen_apic
  #endif
  };
  
@@ -21901,7 +23002,7 @@ diff -urNp linux-3.0.4/arch/x86/xen/enlighten.c linux-3.0.4/arch/x86/xen/enlight
  {
        struct sched_shutdown r = { .reason = reason };
  
-@@ -1018,17 +1016,17 @@ static void xen_reboot(int reason)
+@@ -1036,17 +1034,17 @@ static void xen_reboot(int reason)
                BUG();
  }
  
@@ -21922,7 +23023,7 @@ diff -urNp linux-3.0.4/arch/x86/xen/enlighten.c linux-3.0.4/arch/x86/xen/enlight
  {
        xen_reboot(SHUTDOWN_poweroff);
  }
-@@ -1134,7 +1132,17 @@ asmlinkage void __init xen_start_kernel(
+@@ -1152,7 +1150,17 @@ asmlinkage void __init xen_start_kernel(
        __userpte_alloc_gfp &= ~__GFP_HIGHMEM;
  
        /* Work out if we support NX */
@@ -21941,7 +23042,7 @@ diff -urNp linux-3.0.4/arch/x86/xen/enlighten.c linux-3.0.4/arch/x86/xen/enlight
  
        xen_setup_features();
  
-@@ -1165,13 +1173,6 @@ asmlinkage void __init xen_start_kernel(
+@@ -1183,13 +1191,6 @@ asmlinkage void __init xen_start_kernel(
  
        machine_ops = xen_machine_ops;
  
@@ -21955,10 +23056,10 @@ diff -urNp linux-3.0.4/arch/x86/xen/enlighten.c linux-3.0.4/arch/x86/xen/enlight
        xen_smp_init();
  
  #ifdef CONFIG_ACPI_NUMA
-diff -urNp linux-3.0.4/arch/x86/xen/mmu.c linux-3.0.4/arch/x86/xen/mmu.c
---- linux-3.0.4/arch/x86/xen/mmu.c     2011-09-02 18:11:26.000000000 -0400
-+++ linux-3.0.4/arch/x86/xen/mmu.c     2011-08-29 23:26:21.000000000 -0400
-@@ -1683,6 +1683,8 @@ pgd_t * __init xen_setup_kernel_pagetabl
+diff -urNp linux-3.1.3/arch/x86/xen/mmu.c linux-3.1.3/arch/x86/xen/mmu.c
+--- linux-3.1.3/arch/x86/xen/mmu.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/xen/mmu.c     2011-11-16 18:39:07.000000000 -0500
+@@ -1768,6 +1768,8 @@ pgd_t * __init xen_setup_kernel_pagetabl
        convert_pfn_mfn(init_level4_pgt);
        convert_pfn_mfn(level3_ident_pgt);
        convert_pfn_mfn(level3_kernel_pgt);
@@ -21967,7 +23068,7 @@ diff -urNp linux-3.0.4/arch/x86/xen/mmu.c linux-3.0.4/arch/x86/xen/mmu.c
  
        l3 = m2v(pgd[pgd_index(__START_KERNEL_map)].pgd);
        l2 = m2v(l3[pud_index(__START_KERNEL_map)].pud);
-@@ -1701,7 +1703,10 @@ pgd_t * __init xen_setup_kernel_pagetabl
+@@ -1786,7 +1788,10 @@ pgd_t * __init xen_setup_kernel_pagetabl
        set_page_prot(init_level4_pgt, PAGE_KERNEL_RO);
        set_page_prot(level3_ident_pgt, PAGE_KERNEL_RO);
        set_page_prot(level3_kernel_pgt, PAGE_KERNEL_RO);
@@ -21978,7 +23079,7 @@ diff -urNp linux-3.0.4/arch/x86/xen/mmu.c linux-3.0.4/arch/x86/xen/mmu.c
        set_page_prot(level2_kernel_pgt, PAGE_KERNEL_RO);
        set_page_prot(level2_fixmap_pgt, PAGE_KERNEL_RO);
  
-@@ -1913,6 +1918,7 @@ static void __init xen_post_allocator_in
+@@ -2000,6 +2005,7 @@ static void __init xen_post_allocator_in
        pv_mmu_ops.set_pud = xen_set_pud;
  #if PAGETABLE_LEVELS == 4
        pv_mmu_ops.set_pgd = xen_set_pgd;
@@ -21986,7 +23087,7 @@ diff -urNp linux-3.0.4/arch/x86/xen/mmu.c linux-3.0.4/arch/x86/xen/mmu.c
  #endif
  
        /* This will work as long as patching hasn't happened yet
-@@ -1994,6 +2000,7 @@ static const struct pv_mmu_ops xen_mmu_o
+@@ -2081,6 +2087,7 @@ static const struct pv_mmu_ops xen_mmu_o
        .pud_val = PV_CALLEE_SAVE(xen_pud_val),
        .make_pud = PV_CALLEE_SAVE(xen_make_pud),
        .set_pgd = xen_set_pgd_hyper,
@@ -21994,10 +23095,10 @@ diff -urNp linux-3.0.4/arch/x86/xen/mmu.c linux-3.0.4/arch/x86/xen/mmu.c
  
        .alloc_pud = xen_alloc_pmd_init,
        .release_pud = xen_release_pmd_init,
-diff -urNp linux-3.0.4/arch/x86/xen/smp.c linux-3.0.4/arch/x86/xen/smp.c
---- linux-3.0.4/arch/x86/xen/smp.c     2011-09-02 18:11:26.000000000 -0400
-+++ linux-3.0.4/arch/x86/xen/smp.c     2011-08-29 23:26:21.000000000 -0400
-@@ -193,11 +193,6 @@ static void __init xen_smp_prepare_boot_
+diff -urNp linux-3.1.3/arch/x86/xen/smp.c linux-3.1.3/arch/x86/xen/smp.c
+--- linux-3.1.3/arch/x86/xen/smp.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/xen/smp.c     2011-11-16 18:39:07.000000000 -0500
+@@ -194,11 +194,6 @@ static void __init xen_smp_prepare_boot_
  {
        BUG_ON(smp_processor_id() != 0);
        native_smp_prepare_boot_cpu();
@@ -22009,7 +23110,7 @@ diff -urNp linux-3.0.4/arch/x86/xen/smp.c linux-3.0.4/arch/x86/xen/smp.c
        xen_filter_cpu_maps();
        xen_setup_vcpu_info_placement();
  }
-@@ -265,12 +260,12 @@ cpu_initialize_context(unsigned int cpu,
+@@ -275,12 +270,12 @@ cpu_initialize_context(unsigned int cpu,
        gdt = get_cpu_gdt_table(cpu);
  
        ctxt->flags = VGCF_IN_KERNEL;
@@ -22025,7 +23126,7 @@ diff -urNp linux-3.0.4/arch/x86/xen/smp.c linux-3.0.4/arch/x86/xen/smp.c
  #else
        ctxt->gs_base_kernel = per_cpu_offset(cpu);
  #endif
-@@ -321,13 +316,12 @@ static int __cpuinit xen_cpu_up(unsigned
+@@ -331,13 +326,12 @@ static int __cpuinit xen_cpu_up(unsigned
        int rc;
  
        per_cpu(current_task, cpu) = idle;
@@ -22041,9 +23142,9 @@ diff -urNp linux-3.0.4/arch/x86/xen/smp.c linux-3.0.4/arch/x86/xen/smp.c
  #endif
        xen_setup_runstate_info(cpu);
        xen_setup_timer(cpu);
-diff -urNp linux-3.0.4/arch/x86/xen/xen-asm_32.S linux-3.0.4/arch/x86/xen/xen-asm_32.S
---- linux-3.0.4/arch/x86/xen/xen-asm_32.S      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/xen/xen-asm_32.S      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/xen/xen-asm_32.S linux-3.1.3/arch/x86/xen/xen-asm_32.S
+--- linux-3.1.3/arch/x86/xen/xen-asm_32.S      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/xen/xen-asm_32.S      2011-11-16 18:39:07.000000000 -0500
 @@ -83,14 +83,14 @@ ENTRY(xen_iret)
        ESP_OFFSET=4    # bytes pushed onto stack
  
@@ -22065,9 +23166,9 @@ diff -urNp linux-3.0.4/arch/x86/xen/xen-asm_32.S linux-3.0.4/arch/x86/xen/xen-as
  #else
        movl xen_vcpu, %eax
  #endif
-diff -urNp linux-3.0.4/arch/x86/xen/xen-head.S linux-3.0.4/arch/x86/xen/xen-head.S
---- linux-3.0.4/arch/x86/xen/xen-head.S        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/arch/x86/xen/xen-head.S        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/xen/xen-head.S linux-3.1.3/arch/x86/xen/xen-head.S
+--- linux-3.1.3/arch/x86/xen/xen-head.S        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/xen/xen-head.S        2011-11-16 18:39:07.000000000 -0500
 @@ -19,6 +19,17 @@ ENTRY(startup_xen)
  #ifdef CONFIG_X86_32
        mov %esi,xen_start_info
@@ -22086,9 +23187,9 @@ diff -urNp linux-3.0.4/arch/x86/xen/xen-head.S linux-3.0.4/arch/x86/xen/xen-head
  #else
        mov %rsi,xen_start_info
        mov $init_thread_union+THREAD_SIZE,%rsp
-diff -urNp linux-3.0.4/arch/x86/xen/xen-ops.h linux-3.0.4/arch/x86/xen/xen-ops.h
---- linux-3.0.4/arch/x86/xen/xen-ops.h 2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/arch/x86/xen/xen-ops.h 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/arch/x86/xen/xen-ops.h linux-3.1.3/arch/x86/xen/xen-ops.h
+--- linux-3.1.3/arch/x86/xen/xen-ops.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/arch/x86/xen/xen-ops.h 2011-11-16 18:39:07.000000000 -0500
 @@ -10,8 +10,6 @@
  extern const char xen_hypervisor_callback[];
  extern const char xen_failsafe_callback[];
@@ -22098,9 +23199,9 @@ diff -urNp linux-3.0.4/arch/x86/xen/xen-ops.h linux-3.0.4/arch/x86/xen/xen-ops.h
  struct trap_info;
  void xen_copy_trap_info(struct trap_info *traps);
  
-diff -urNp linux-3.0.4/block/blk-iopoll.c linux-3.0.4/block/blk-iopoll.c
---- linux-3.0.4/block/blk-iopoll.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/block/blk-iopoll.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/block/blk-iopoll.c linux-3.1.3/block/blk-iopoll.c
+--- linux-3.1.3/block/blk-iopoll.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/block/blk-iopoll.c     2011-11-16 18:39:07.000000000 -0500
 @@ -77,7 +77,7 @@ void blk_iopoll_complete(struct blk_iopo
  }
  EXPORT_SYMBOL(blk_iopoll_complete);
@@ -22110,10 +23211,10 @@ diff -urNp linux-3.0.4/block/blk-iopoll.c linux-3.0.4/block/blk-iopoll.c
  {
        struct list_head *list = &__get_cpu_var(blk_cpu_iopoll);
        int rearm = 0, budget = blk_iopoll_budget;
-diff -urNp linux-3.0.4/block/blk-map.c linux-3.0.4/block/blk-map.c
---- linux-3.0.4/block/blk-map.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/block/blk-map.c        2011-08-23 21:47:55.000000000 -0400
-@@ -301,7 +301,7 @@ int blk_rq_map_kern(struct request_queue
+diff -urNp linux-3.1.3/block/blk-map.c linux-3.1.3/block/blk-map.c
+--- linux-3.1.3/block/blk-map.c        2011-11-26 19:57:27.000000000 -0500
++++ linux-3.1.3/block/blk-map.c        2011-11-26 19:58:40.000000000 -0500
+@@ -302,7 +302,7 @@ int blk_rq_map_kern(struct request_queue
        if (!len || !kbuf)
                return -EINVAL;
  
@@ -22122,9 +23223,9 @@ diff -urNp linux-3.0.4/block/blk-map.c linux-3.0.4/block/blk-map.c
        if (do_copy)
                bio = bio_copy_kern(q, kbuf, len, gfp_mask, reading);
        else
-diff -urNp linux-3.0.4/block/blk-softirq.c linux-3.0.4/block/blk-softirq.c
---- linux-3.0.4/block/blk-softirq.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/block/blk-softirq.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/block/blk-softirq.c linux-3.1.3/block/blk-softirq.c
+--- linux-3.1.3/block/blk-softirq.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/block/blk-softirq.c    2011-11-16 18:39:07.000000000 -0500
 @@ -17,7 +17,7 @@ static DEFINE_PER_CPU(struct list_head, 
   * Softirq action handler - move entries to local list and loop over them
   * while passing them to the queue registered handler.
@@ -22134,9 +23235,9 @@ diff -urNp linux-3.0.4/block/blk-softirq.c linux-3.0.4/block/blk-softirq.c
  {
        struct list_head *cpu_list, local_list;
  
-diff -urNp linux-3.0.4/block/bsg.c linux-3.0.4/block/bsg.c
---- linux-3.0.4/block/bsg.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/block/bsg.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/block/bsg.c linux-3.1.3/block/bsg.c
+--- linux-3.1.3/block/bsg.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/block/bsg.c    2011-11-16 18:39:07.000000000 -0500
 @@ -176,16 +176,24 @@ static int blk_fill_sgv4_hdr_rq(struct r
                                struct sg_io_v4 *hdr, struct bsg_device *bd,
                                fmode_t has_write_perm)
@@ -22153,8 +23254,8 @@ diff -urNp linux-3.0.4/block/bsg.c linux-3.0.4/block/bsg.c
 +      } else
 +              cmdptr = tmpcmd;
  
--      if (copy_from_user(rq->cmd, (void *)(unsigned long)hdr->request,
-+      if (copy_from_user(cmdptr, (void *)(unsigned long)hdr->request,
+-      if (copy_from_user(rq->cmd, (void __user *)(unsigned long)hdr->request,
++      if (copy_from_user(cmdptr, (void __user *)(unsigned long)hdr->request,
                           hdr->request_len))
                return -EFAULT;
  
@@ -22164,9 +23265,21 @@ diff -urNp linux-3.0.4/block/bsg.c linux-3.0.4/block/bsg.c
        if (hdr->subprotocol == BSG_SUB_PROTOCOL_SCSI_CMD) {
                if (blk_verify_command(rq->cmd, has_write_perm))
                        return -EPERM;
-diff -urNp linux-3.0.4/block/scsi_ioctl.c linux-3.0.4/block/scsi_ioctl.c
---- linux-3.0.4/block/scsi_ioctl.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/block/scsi_ioctl.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/block/compat_ioctl.c linux-3.1.3/block/compat_ioctl.c
+--- linux-3.1.3/block/compat_ioctl.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/block/compat_ioctl.c   2011-11-16 18:39:07.000000000 -0500
+@@ -340,7 +340,7 @@ static int compat_fd_ioctl(struct block_
+               err |= __get_user(f->spec1, &uf->spec1);
+               err |= __get_user(f->fmt_gap, &uf->fmt_gap);
+               err |= __get_user(name, &uf->name);
+-              f->name = compat_ptr(name);
++              f->name = (void __force_kernel *)compat_ptr(name);
+               if (err) {
+                       err = -EFAULT;
+                       goto out;
+diff -urNp linux-3.1.3/block/scsi_ioctl.c linux-3.1.3/block/scsi_ioctl.c
+--- linux-3.1.3/block/scsi_ioctl.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/block/scsi_ioctl.c     2011-11-16 18:39:07.000000000 -0500
 @@ -222,8 +222,20 @@ EXPORT_SYMBOL(blk_verify_command);
  static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq,
                             struct sg_io_hdr *hdr, fmode_t mode)
@@ -22218,9 +23331,9 @@ diff -urNp linux-3.0.4/block/scsi_ioctl.c linux-3.0.4/block/scsi_ioctl.c
        if (in_len && copy_from_user(buffer, sic->data + cmdlen, in_len))
                goto error;
  
-diff -urNp linux-3.0.4/crypto/cryptd.c linux-3.0.4/crypto/cryptd.c
---- linux-3.0.4/crypto/cryptd.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/crypto/cryptd.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/crypto/cryptd.c linux-3.1.3/crypto/cryptd.c
+--- linux-3.1.3/crypto/cryptd.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/crypto/cryptd.c        2011-11-16 18:39:07.000000000 -0500
 @@ -63,7 +63,7 @@ struct cryptd_blkcipher_ctx {
  
  struct cryptd_blkcipher_request_ctx {
@@ -22239,30 +23352,9 @@ diff -urNp linux-3.0.4/crypto/cryptd.c linux-3.0.4/crypto/cryptd.c
  
  static void cryptd_queue_worker(struct work_struct *work);
  
-diff -urNp linux-3.0.4/crypto/gf128mul.c linux-3.0.4/crypto/gf128mul.c
---- linux-3.0.4/crypto/gf128mul.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/crypto/gf128mul.c      2011-08-23 21:47:55.000000000 -0400
-@@ -182,7 +182,7 @@ void gf128mul_lle(be128 *r, const be128 
-       for (i = 0; i < 7; ++i)
-               gf128mul_x_lle(&p[i + 1], &p[i]);
--      memset(r, 0, sizeof(r));
-+      memset(r, 0, sizeof(*r));
-       for (i = 0;;) {
-               u8 ch = ((u8 *)b)[15 - i];
-@@ -220,7 +220,7 @@ void gf128mul_bbe(be128 *r, const be128 
-       for (i = 0; i < 7; ++i)
-               gf128mul_x_bbe(&p[i + 1], &p[i]);
--      memset(r, 0, sizeof(r));
-+      memset(r, 0, sizeof(*r));
-       for (i = 0;;) {
-               u8 ch = ((u8 *)b)[i];
-diff -urNp linux-3.0.4/crypto/serpent.c linux-3.0.4/crypto/serpent.c
---- linux-3.0.4/crypto/serpent.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/crypto/serpent.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/crypto/serpent.c linux-3.1.3/crypto/serpent.c
+--- linux-3.1.3/crypto/serpent.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/crypto/serpent.c       2011-11-16 18:40:10.000000000 -0500
 @@ -224,6 +224,8 @@ static int serpent_setkey(struct crypto_
        u32 r0,r1,r2,r3,r4;
        int i;
@@ -22272,9 +23364,9 @@ diff -urNp linux-3.0.4/crypto/serpent.c linux-3.0.4/crypto/serpent.c
        /* Copy key, add padding */
  
        for (i = 0; i < keylen; ++i)
-diff -urNp linux-3.0.4/Documentation/dontdiff linux-3.0.4/Documentation/dontdiff
---- linux-3.0.4/Documentation/dontdiff 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/Documentation/dontdiff 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/Documentation/dontdiff linux-3.1.3/Documentation/dontdiff
+--- linux-3.1.3/Documentation/dontdiff 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/Documentation/dontdiff 2011-11-16 18:39:07.000000000 -0500
 @@ -5,6 +5,7 @@
  *.cis
  *.cpio
@@ -22303,7 +23395,13 @@ diff -urNp linux-3.0.4/Documentation/dontdiff linux-3.0.4/Documentation/dontdiff
  SCCS
  System.map*
  TAGS
-@@ -98,6 +102,8 @@ bzImage*
+@@ -93,19 +97,24 @@ bounds.h
+ bsetup
+ btfixupprep
+ build
++builtin-policy.h
+ bvmlinux
+ bzImage*
  capability_names.h
  capflags.c
  classlist.h*
@@ -22312,7 +23410,25 @@ diff -urNp linux-3.0.4/Documentation/dontdiff linux-3.0.4/Documentation/dontdiff
  comp*.log
  compile.h*
  conf
-@@ -126,12 +132,14 @@ fore200e_pca_fw.c*
+ config
+ config-*
+ config_data.h*
++config.c
+ config.mak
+ config.mak.autogen
++config.tmp
+ conmakehash
+ consolemap_deftbl.c*
+ cpustr.h
+@@ -119,6 +128,7 @@ dslm
+ elf2ecoff
+ elfconfig.h*
+ evergreen_reg_safe.h
++exception_policy.conf
+ fixdep
+ flask.h
+ fore200e_mkfirm
+@@ -126,12 +136,14 @@ fore200e_pca_fw.c*
  gconf
  gconf.glade.h
  gen-devlist
@@ -22327,15 +23443,16 @@ diff -urNp linux-3.0.4/Documentation/dontdiff linux-3.0.4/Documentation/dontdiff
  hpet_example
  hugepage-mmap
  hugepage-shm
-@@ -146,7 +154,6 @@ int32.c
+@@ -146,7 +158,7 @@ int32.c
  int4.c
  int8.c
  kallsyms
 -kconfig
++kern_constants.h
  keywords.c
  ksym.c*
  ksym.h*
-@@ -154,7 +161,6 @@ kxgettext
+@@ -154,7 +166,6 @@ kxgettext
  lkc_defs.h
  lex.c
  lex.*.c
@@ -22343,7 +23460,15 @@ diff -urNp linux-3.0.4/Documentation/dontdiff linux-3.0.4/Documentation/dontdiff
  logo_*.c
  logo_*_clut224.c
  logo_*_mono.c
-@@ -174,6 +180,7 @@ mkboot
+@@ -166,7 +177,6 @@ machtypes.h
+ map
+ map_hugetlb
+ maui_boot.h
+-media
+ mconf
+ miboot*
+ mk_elfconfig
+@@ -174,6 +184,7 @@ mkboot
  mkbugboot
  mkcpustr
  mkdep
@@ -22351,7 +23476,7 @@ diff -urNp linux-3.0.4/Documentation/dontdiff linux-3.0.4/Documentation/dontdiff
  mkprep
  mkregtable
  mktables
-@@ -209,6 +216,7 @@ r300_reg_safe.h
+@@ -209,6 +220,7 @@ r300_reg_safe.h
  r420_reg_safe.h
  r600_reg_safe.h
  recordmcount
@@ -22359,7 +23484,7 @@ diff -urNp linux-3.0.4/Documentation/dontdiff linux-3.0.4/Documentation/dontdiff
  relocs
  rlim_names.h
  rn50_reg_safe.h
-@@ -219,6 +227,7 @@ setup
+@@ -219,6 +231,7 @@ setup
  setup.bin
  setup.elf
  sImage
@@ -22367,7 +23492,15 @@ diff -urNp linux-3.0.4/Documentation/dontdiff linux-3.0.4/Documentation/dontdiff
  sm_tbl*
  split-include
  syscalltab.h
-@@ -246,7 +255,9 @@ vmlinux
+@@ -229,6 +242,7 @@ tftpboot.img
+ timeconst.h
+ times.h*
+ trix_boot.h
++user_constants.h
+ utsrelease.h*
+ vdso-syms.lds
+ vdso.lds
+@@ -246,7 +260,9 @@ vmlinux
  vmlinux-*
  vmlinux.aout
  vmlinux.bin.all
@@ -22377,7 +23510,7 @@ diff -urNp linux-3.0.4/Documentation/dontdiff linux-3.0.4/Documentation/dontdiff
  vmlinuz
  voffset.h
  vsyscall.lds
-@@ -254,6 +265,7 @@ vsyscall_32.lds
+@@ -254,9 +270,11 @@ vsyscall_32.lds
  wanxlfw.inc
  uImage
  unifdef
@@ -22385,10 +23518,14 @@ diff -urNp linux-3.0.4/Documentation/dontdiff linux-3.0.4/Documentation/dontdiff
  wakeup.bin
  wakeup.elf
  wakeup.lds
-diff -urNp linux-3.0.4/Documentation/kernel-parameters.txt linux-3.0.4/Documentation/kernel-parameters.txt
---- linux-3.0.4/Documentation/kernel-parameters.txt    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/Documentation/kernel-parameters.txt    2011-08-23 21:47:55.000000000 -0400
-@@ -1883,6 +1883,13 @@ bytes respectively. Such letter suffixes
+ zImage*
+ zconf.hash.c
++zconf.lex.c
+ zoffset.h
+diff -urNp linux-3.1.3/Documentation/kernel-parameters.txt linux-3.1.3/Documentation/kernel-parameters.txt
+--- linux-3.1.3/Documentation/kernel-parameters.txt    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/Documentation/kernel-parameters.txt    2011-11-16 18:39:07.000000000 -0500
+@@ -1898,6 +1898,13 @@ bytes respectively. Such letter suffixes
                        the specified number of seconds.  This is to be used if
                        your oopses keep scrolling off the screen.
  
@@ -22402,9 +23539,9 @@ diff -urNp linux-3.0.4/Documentation/kernel-parameters.txt linux-3.0.4/Documenta
        pcbit=          [HW,ISDN]
  
        pcd.            [PARIDE]
-diff -urNp linux-3.0.4/drivers/acpi/apei/cper.c linux-3.0.4/drivers/acpi/apei/cper.c
---- linux-3.0.4/drivers/acpi/apei/cper.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/acpi/apei/cper.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/acpi/apei/cper.c linux-3.1.3/drivers/acpi/apei/cper.c
+--- linux-3.1.3/drivers/acpi/apei/cper.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/acpi/apei/cper.c       2011-11-16 18:39:07.000000000 -0500
 @@ -38,12 +38,12 @@
   */
  u64 cper_next_record_id(void)
@@ -22422,9 +23559,9 @@ diff -urNp linux-3.0.4/drivers/acpi/apei/cper.c linux-3.0.4/drivers/acpi/apei/cp
  }
  EXPORT_SYMBOL_GPL(cper_next_record_id);
  
-diff -urNp linux-3.0.4/drivers/acpi/ec_sys.c linux-3.0.4/drivers/acpi/ec_sys.c
---- linux-3.0.4/drivers/acpi/ec_sys.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/acpi/ec_sys.c  2011-08-24 19:06:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/acpi/ec_sys.c linux-3.1.3/drivers/acpi/ec_sys.c
+--- linux-3.1.3/drivers/acpi/ec_sys.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/acpi/ec_sys.c  2011-11-16 18:39:07.000000000 -0500
 @@ -11,6 +11,7 @@
  #include <linux/kernel.h>
  #include <linux/acpi.h>
@@ -22474,9 +23611,9 @@ diff -urNp linux-3.0.4/drivers/acpi/ec_sys.c linux-3.0.4/drivers/acpi/ec_sys.c
                err = ec_write(*off, byte_write);
                if (err)
                        return err;
-diff -urNp linux-3.0.4/drivers/acpi/proc.c linux-3.0.4/drivers/acpi/proc.c
---- linux-3.0.4/drivers/acpi/proc.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/acpi/proc.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/acpi/proc.c linux-3.1.3/drivers/acpi/proc.c
+--- linux-3.1.3/drivers/acpi/proc.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/acpi/proc.c    2011-11-16 18:39:07.000000000 -0500
 @@ -342,19 +342,13 @@ acpi_system_write_wakeup_device(struct f
                                size_t count, loff_t * ppos)
  {
@@ -22511,9 +23648,9 @@ diff -urNp linux-3.0.4/drivers/acpi/proc.c linux-3.0.4/drivers/acpi/proc.c
                        if (device_can_wakeup(&dev->dev)) {
                                bool enable = !device_may_wakeup(&dev->dev);
                                device_set_wakeup_enable(&dev->dev, enable);
-diff -urNp linux-3.0.4/drivers/acpi/processor_driver.c linux-3.0.4/drivers/acpi/processor_driver.c
---- linux-3.0.4/drivers/acpi/processor_driver.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/acpi/processor_driver.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/acpi/processor_driver.c linux-3.1.3/drivers/acpi/processor_driver.c
+--- linux-3.1.3/drivers/acpi/processor_driver.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/acpi/processor_driver.c        2011-11-16 18:39:07.000000000 -0500
 @@ -473,7 +473,7 @@ static int __cpuinit acpi_processor_add(
                return 0;
  #endif
@@ -22523,10 +23660,10 @@ diff -urNp linux-3.0.4/drivers/acpi/processor_driver.c linux-3.0.4/drivers/acpi/
  
        /*
         * Buggy BIOS check
-diff -urNp linux-3.0.4/drivers/ata/libata-core.c linux-3.0.4/drivers/ata/libata-core.c
---- linux-3.0.4/drivers/ata/libata-core.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/ata/libata-core.c      2011-08-23 21:47:55.000000000 -0400
-@@ -4753,7 +4753,7 @@ void ata_qc_free(struct ata_queued_cmd *
+diff -urNp linux-3.1.3/drivers/ata/libata-core.c linux-3.1.3/drivers/ata/libata-core.c
+--- linux-3.1.3/drivers/ata/libata-core.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ata/libata-core.c      2011-11-16 18:39:07.000000000 -0500
+@@ -4733,7 +4733,7 @@ void ata_qc_free(struct ata_queued_cmd *
        struct ata_port *ap;
        unsigned int tag;
  
@@ -22535,7 +23672,7 @@ diff -urNp linux-3.0.4/drivers/ata/libata-core.c linux-3.0.4/drivers/ata/libata-
        ap = qc->ap;
  
        qc->flags = 0;
-@@ -4769,7 +4769,7 @@ void __ata_qc_complete(struct ata_queued
+@@ -4749,7 +4749,7 @@ void __ata_qc_complete(struct ata_queued
        struct ata_port *ap;
        struct ata_link *link;
  
@@ -22544,7 +23681,7 @@ diff -urNp linux-3.0.4/drivers/ata/libata-core.c linux-3.0.4/drivers/ata/libata-
        WARN_ON_ONCE(!(qc->flags & ATA_QCFLAG_ACTIVE));
        ap = qc->ap;
        link = qc->dev->link;
-@@ -5774,6 +5774,7 @@ static void ata_finalize_port_ops(struct
+@@ -5754,6 +5754,7 @@ static void ata_finalize_port_ops(struct
                return;
  
        spin_lock(&lock);
@@ -22552,7 +23689,7 @@ diff -urNp linux-3.0.4/drivers/ata/libata-core.c linux-3.0.4/drivers/ata/libata-
  
        for (cur = ops->inherits; cur; cur = cur->inherits) {
                void **inherit = (void **)cur;
-@@ -5787,8 +5788,9 @@ static void ata_finalize_port_ops(struct
+@@ -5767,8 +5768,9 @@ static void ata_finalize_port_ops(struct
                if (IS_ERR(*pp))
                        *pp = NULL;
  
@@ -22563,10 +23700,10 @@ diff -urNp linux-3.0.4/drivers/ata/libata-core.c linux-3.0.4/drivers/ata/libata-
        spin_unlock(&lock);
  }
  
-diff -urNp linux-3.0.4/drivers/ata/libata-eh.c linux-3.0.4/drivers/ata/libata-eh.c
---- linux-3.0.4/drivers/ata/libata-eh.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/ata/libata-eh.c        2011-08-23 21:48:14.000000000 -0400
-@@ -2518,6 +2518,8 @@ void ata_eh_report(struct ata_port *ap)
+diff -urNp linux-3.1.3/drivers/ata/libata-eh.c linux-3.1.3/drivers/ata/libata-eh.c
+--- linux-3.1.3/drivers/ata/libata-eh.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ata/libata-eh.c        2011-11-16 18:40:10.000000000 -0500
+@@ -2515,6 +2515,8 @@ void ata_eh_report(struct ata_port *ap)
  {
        struct ata_link *link;
  
@@ -22575,9 +23712,9 @@ diff -urNp linux-3.0.4/drivers/ata/libata-eh.c linux-3.0.4/drivers/ata/libata-eh
        ata_for_each_link(link, ap, HOST_FIRST)
                ata_eh_link_report(link);
  }
-diff -urNp linux-3.0.4/drivers/ata/pata_arasan_cf.c linux-3.0.4/drivers/ata/pata_arasan_cf.c
---- linux-3.0.4/drivers/ata/pata_arasan_cf.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/ata/pata_arasan_cf.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/ata/pata_arasan_cf.c linux-3.1.3/drivers/ata/pata_arasan_cf.c
+--- linux-3.1.3/drivers/ata/pata_arasan_cf.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ata/pata_arasan_cf.c   2011-11-16 18:39:07.000000000 -0500
 @@ -862,7 +862,9 @@ static int __devinit arasan_cf_probe(str
        /* Handle platform specific quirks */
        if (pdata->quirk) {
@@ -22589,9 +23726,9 @@ diff -urNp linux-3.0.4/drivers/ata/pata_arasan_cf.c linux-3.0.4/drivers/ata/pata
                        ap->pio_mask = 0;
                }
                if (pdata->quirk & CF_BROKEN_MWDMA)
-diff -urNp linux-3.0.4/drivers/atm/adummy.c linux-3.0.4/drivers/atm/adummy.c
---- linux-3.0.4/drivers/atm/adummy.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/atm/adummy.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/atm/adummy.c linux-3.1.3/drivers/atm/adummy.c
+--- linux-3.1.3/drivers/atm/adummy.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/atm/adummy.c   2011-11-16 18:39:07.000000000 -0500
 @@ -114,7 +114,7 @@ adummy_send(struct atm_vcc *vcc, struct 
                vcc->pop(vcc, skb);
        else
@@ -22601,9 +23738,9 @@ diff -urNp linux-3.0.4/drivers/atm/adummy.c linux-3.0.4/drivers/atm/adummy.c
  
        return 0;
  }
-diff -urNp linux-3.0.4/drivers/atm/ambassador.c linux-3.0.4/drivers/atm/ambassador.c
---- linux-3.0.4/drivers/atm/ambassador.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/atm/ambassador.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/atm/ambassador.c linux-3.1.3/drivers/atm/ambassador.c
+--- linux-3.1.3/drivers/atm/ambassador.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/atm/ambassador.c       2011-11-16 18:39:07.000000000 -0500
 @@ -454,7 +454,7 @@ static void tx_complete (amb_dev * dev, 
    PRINTD (DBG_FLOW|DBG_TX, "tx_complete %p %p", dev, tx);
    
@@ -22631,7 +23768,7 @@ diff -urNp linux-3.0.4/drivers/atm/ambassador.c linux-3.0.4/drivers/atm/ambassad
        }
        
      } else {
-@@ -1342,7 +1342,7 @@ static int amb_send (struct atm_vcc * at
+@@ -1338,7 +1338,7 @@ static int amb_send (struct atm_vcc * at
    }
    
    if (check_area (skb->data, skb->len)) {
@@ -22640,9 +23777,9 @@ diff -urNp linux-3.0.4/drivers/atm/ambassador.c linux-3.0.4/drivers/atm/ambassad
      return -ENOMEM; // ?
    }
    
-diff -urNp linux-3.0.4/drivers/atm/atmtcp.c linux-3.0.4/drivers/atm/atmtcp.c
---- linux-3.0.4/drivers/atm/atmtcp.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/atm/atmtcp.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/atm/atmtcp.c linux-3.1.3/drivers/atm/atmtcp.c
+--- linux-3.1.3/drivers/atm/atmtcp.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/atm/atmtcp.c   2011-11-16 18:39:07.000000000 -0500
 @@ -207,7 +207,7 @@ static int atmtcp_v_send(struct atm_vcc 
                if (vcc->pop) vcc->pop(vcc,skb);
                else dev_kfree_skb(skb);
@@ -22692,9 +23829,9 @@ diff -urNp linux-3.0.4/drivers/atm/atmtcp.c linux-3.0.4/drivers/atm/atmtcp.c
  done:
        if (vcc->pop) vcc->pop(vcc,skb);
        else dev_kfree_skb(skb);
-diff -urNp linux-3.0.4/drivers/atm/eni.c linux-3.0.4/drivers/atm/eni.c
---- linux-3.0.4/drivers/atm/eni.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/atm/eni.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/atm/eni.c linux-3.1.3/drivers/atm/eni.c
+--- linux-3.1.3/drivers/atm/eni.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/atm/eni.c      2011-11-16 18:39:07.000000000 -0500
 @@ -526,7 +526,7 @@ static int rx_aal0(struct atm_vcc *vcc)
                DPRINTK(DEV_LABEL "(itf %d): trashing empty cell\n",
                    vcc->dev->number);
@@ -22740,10 +23877,19 @@ diff -urNp linux-3.0.4/drivers/atm/eni.c linux-3.0.4/drivers/atm/eni.c
                wake_up(&eni_dev->tx_wait);
  dma_complete++;
        }
-diff -urNp linux-3.0.4/drivers/atm/firestream.c linux-3.0.4/drivers/atm/firestream.c
---- linux-3.0.4/drivers/atm/firestream.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/atm/firestream.c       2011-08-23 21:47:55.000000000 -0400
-@@ -749,7 +749,7 @@ static void process_txdone_queue (struct
+@@ -1568,7 +1568,7 @@ tx_complete++;
+ /*--------------------------------- entries ---------------------------------*/
+-static const char *media_name[] __devinitdata = {
++static const char *media_name[] __devinitconst = {
+     "MMF", "SMF", "MMF", "03?", /*  0- 3 */
+     "UTP", "05?", "06?", "07?", /*  4- 7 */
+     "TAXI","09?", "10?", "11?", /*  8-11 */
+diff -urNp linux-3.1.3/drivers/atm/firestream.c linux-3.1.3/drivers/atm/firestream.c
+--- linux-3.1.3/drivers/atm/firestream.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/atm/firestream.c       2011-11-16 18:39:07.000000000 -0500
+@@ -750,7 +750,7 @@ static void process_txdone_queue (struct
                                }
                        }
  
@@ -22752,7 +23898,7 @@ diff -urNp linux-3.0.4/drivers/atm/firestream.c linux-3.0.4/drivers/atm/firestre
  
                        fs_dprintk (FS_DEBUG_TXMEM, "i");
                        fs_dprintk (FS_DEBUG_ALLOC, "Free t-skb: %p\n", skb);
-@@ -816,7 +816,7 @@ static void process_incoming (struct fs_
+@@ -817,7 +817,7 @@ static void process_incoming (struct fs_
  #endif
                                skb_put (skb, qe->p1 & 0xffff); 
                                ATM_SKB(skb)->vcc = atm_vcc;
@@ -22761,7 +23907,7 @@ diff -urNp linux-3.0.4/drivers/atm/firestream.c linux-3.0.4/drivers/atm/firestre
                                __net_timestamp(skb);
                                fs_dprintk (FS_DEBUG_ALLOC, "Free rec-skb: %p (pushed)\n", skb);
                                atm_vcc->push (atm_vcc, skb);
-@@ -837,12 +837,12 @@ static void process_incoming (struct fs_
+@@ -838,12 +838,12 @@ static void process_incoming (struct fs_
                                kfree (pe);
                        }
                        if (atm_vcc)
@@ -22776,9 +23922,9 @@ diff -urNp linux-3.0.4/drivers/atm/firestream.c linux-3.0.4/drivers/atm/firestre
                        break;
                default: /* Hmm. Haven't written the code to handle the others yet... -- REW */
                        printk (KERN_WARNING "Don't know what to do with RX status %x: %s.\n", 
-diff -urNp linux-3.0.4/drivers/atm/fore200e.c linux-3.0.4/drivers/atm/fore200e.c
---- linux-3.0.4/drivers/atm/fore200e.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/atm/fore200e.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/atm/fore200e.c linux-3.1.3/drivers/atm/fore200e.c
+--- linux-3.1.3/drivers/atm/fore200e.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/atm/fore200e.c 2011-11-16 18:39:07.000000000 -0500
 @@ -933,9 +933,9 @@ fore200e_tx_irq(struct fore200e* fore200
  #endif
                /* check error condition */
@@ -22835,9 +23981,9 @@ diff -urNp linux-3.0.4/drivers/atm/fore200e.c linux-3.0.4/drivers/atm/fore200e.c
  
            fore200e->tx_sat++;
            DPRINTK(2, "tx queue of device %s is saturated, PDU dropped - heartbeat is %08x\n",
-diff -urNp linux-3.0.4/drivers/atm/he.c linux-3.0.4/drivers/atm/he.c
---- linux-3.0.4/drivers/atm/he.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/atm/he.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/atm/he.c linux-3.1.3/drivers/atm/he.c
+--- linux-3.1.3/drivers/atm/he.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/atm/he.c       2011-11-16 18:39:07.000000000 -0500
 @@ -1709,7 +1709,7 @@ he_service_rbrq(struct he_dev *he_dev, i
  
                if (RBRQ_HBUF_ERR(he_dev->rbrq_head)) {
@@ -22919,10 +24065,10 @@ diff -urNp linux-3.0.4/drivers/atm/he.c linux-3.0.4/drivers/atm/he.c
  
        return 0;
  }
-diff -urNp linux-3.0.4/drivers/atm/horizon.c linux-3.0.4/drivers/atm/horizon.c
---- linux-3.0.4/drivers/atm/horizon.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/atm/horizon.c  2011-08-23 21:47:55.000000000 -0400
-@@ -1034,7 +1034,7 @@ static void rx_schedule (hrz_dev * dev, 
+diff -urNp linux-3.1.3/drivers/atm/horizon.c linux-3.1.3/drivers/atm/horizon.c
+--- linux-3.1.3/drivers/atm/horizon.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/atm/horizon.c  2011-11-16 18:39:07.000000000 -0500
+@@ -1035,7 +1035,7 @@ static void rx_schedule (hrz_dev * dev, 
        {
          struct atm_vcc * vcc = ATM_SKB(skb)->vcc;
          // VC layer stats
@@ -22931,7 +24077,7 @@ diff -urNp linux-3.0.4/drivers/atm/horizon.c linux-3.0.4/drivers/atm/horizon.c
          __net_timestamp(skb);
          // end of our responsibility
          vcc->push (vcc, skb);
-@@ -1186,7 +1186,7 @@ static void tx_schedule (hrz_dev * const
+@@ -1187,7 +1187,7 @@ static void tx_schedule (hrz_dev * const
        dev->tx_iovec = NULL;
        
        // VC layer stats
@@ -22940,10 +24086,10 @@ diff -urNp linux-3.0.4/drivers/atm/horizon.c linux-3.0.4/drivers/atm/horizon.c
        
        // free the skb
        hrz_kfree_skb (skb);
-diff -urNp linux-3.0.4/drivers/atm/idt77252.c linux-3.0.4/drivers/atm/idt77252.c
---- linux-3.0.4/drivers/atm/idt77252.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/atm/idt77252.c 2011-08-23 21:47:55.000000000 -0400
-@@ -811,7 +811,7 @@ drain_scq(struct idt77252_dev *card, str
+diff -urNp linux-3.1.3/drivers/atm/idt77252.c linux-3.1.3/drivers/atm/idt77252.c
+--- linux-3.1.3/drivers/atm/idt77252.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/atm/idt77252.c 2011-11-16 18:39:07.000000000 -0500
+@@ -812,7 +812,7 @@ drain_scq(struct idt77252_dev *card, str
                else
                        dev_kfree_skb(skb);
  
@@ -22952,7 +24098,7 @@ diff -urNp linux-3.0.4/drivers/atm/idt77252.c linux-3.0.4/drivers/atm/idt77252.c
        }
  
        atomic_dec(&scq->used);
-@@ -1074,13 +1074,13 @@ dequeue_rx(struct idt77252_dev *card, st
+@@ -1075,13 +1075,13 @@ dequeue_rx(struct idt77252_dev *card, st
                        if ((sb = dev_alloc_skb(64)) == NULL) {
                                printk("%s: Can't allocate buffers for aal0.\n",
                                       card->name);
@@ -22968,7 +24114,7 @@ diff -urNp linux-3.0.4/drivers/atm/idt77252.c linux-3.0.4/drivers/atm/idt77252.c
                                dev_kfree_skb(sb);
                                break;
                        }
-@@ -1097,7 +1097,7 @@ dequeue_rx(struct idt77252_dev *card, st
+@@ -1098,7 +1098,7 @@ dequeue_rx(struct idt77252_dev *card, st
                        ATM_SKB(sb)->vcc = vcc;
                        __net_timestamp(sb);
                        vcc->push(vcc, sb);
@@ -22977,7 +24123,7 @@ diff -urNp linux-3.0.4/drivers/atm/idt77252.c linux-3.0.4/drivers/atm/idt77252.c
  
                        cell += ATM_CELL_PAYLOAD;
                }
-@@ -1134,13 +1134,13 @@ dequeue_rx(struct idt77252_dev *card, st
+@@ -1135,13 +1135,13 @@ dequeue_rx(struct idt77252_dev *card, st
                                 "(CDC: %08x)\n",
                                 card->name, len, rpp->len, readl(SAR_REG_CDC));
                        recycle_rx_pool_skb(card, rpp);
@@ -22993,7 +24139,7 @@ diff -urNp linux-3.0.4/drivers/atm/idt77252.c linux-3.0.4/drivers/atm/idt77252.c
                        return;
                }
                if (skb_queue_len(&rpp->queue) > 1) {
-@@ -1151,7 +1151,7 @@ dequeue_rx(struct idt77252_dev *card, st
+@@ -1152,7 +1152,7 @@ dequeue_rx(struct idt77252_dev *card, st
                                RXPRINTK("%s: Can't alloc RX skb.\n",
                                         card->name);
                                recycle_rx_pool_skb(card, rpp);
@@ -23002,7 +24148,7 @@ diff -urNp linux-3.0.4/drivers/atm/idt77252.c linux-3.0.4/drivers/atm/idt77252.c
                                return;
                        }
                        if (!atm_charge(vcc, skb->truesize)) {
-@@ -1170,7 +1170,7 @@ dequeue_rx(struct idt77252_dev *card, st
+@@ -1171,7 +1171,7 @@ dequeue_rx(struct idt77252_dev *card, st
                        __net_timestamp(skb);
  
                        vcc->push(vcc, skb);
@@ -23011,7 +24157,7 @@ diff -urNp linux-3.0.4/drivers/atm/idt77252.c linux-3.0.4/drivers/atm/idt77252.c
  
                        return;
                }
-@@ -1192,7 +1192,7 @@ dequeue_rx(struct idt77252_dev *card, st
+@@ -1193,7 +1193,7 @@ dequeue_rx(struct idt77252_dev *card, st
                __net_timestamp(skb);
  
                vcc->push(vcc, skb);
@@ -23020,7 +24166,7 @@ diff -urNp linux-3.0.4/drivers/atm/idt77252.c linux-3.0.4/drivers/atm/idt77252.c
  
                if (skb->truesize > SAR_FB_SIZE_3)
                        add_rx_skb(card, 3, SAR_FB_SIZE_3, 1);
-@@ -1303,14 +1303,14 @@ idt77252_rx_raw(struct idt77252_dev *car
+@@ -1304,14 +1304,14 @@ idt77252_rx_raw(struct idt77252_dev *car
                if (vcc->qos.aal != ATM_AAL0) {
                        RPRINTK("%s: raw cell for non AAL0 vc %u.%u\n",
                                card->name, vpi, vci);
@@ -23037,7 +24183,7 @@ diff -urNp linux-3.0.4/drivers/atm/idt77252.c linux-3.0.4/drivers/atm/idt77252.c
                        goto drop;
                }
  
-@@ -1329,7 +1329,7 @@ idt77252_rx_raw(struct idt77252_dev *car
+@@ -1330,7 +1330,7 @@ idt77252_rx_raw(struct idt77252_dev *car
                ATM_SKB(sb)->vcc = vcc;
                __net_timestamp(sb);
                vcc->push(vcc, sb);
@@ -23046,7 +24192,7 @@ diff -urNp linux-3.0.4/drivers/atm/idt77252.c linux-3.0.4/drivers/atm/idt77252.c
  
  drop:
                skb_pull(queue, 64);
-@@ -1954,13 +1954,13 @@ idt77252_send_skb(struct atm_vcc *vcc, s
+@@ -1955,13 +1955,13 @@ idt77252_send_skb(struct atm_vcc *vcc, s
  
        if (vc == NULL) {
                printk("%s: NULL connection in send().\n", card->name);
@@ -23062,7 +24208,7 @@ diff -urNp linux-3.0.4/drivers/atm/idt77252.c linux-3.0.4/drivers/atm/idt77252.c
                dev_kfree_skb(skb);
                return -EINVAL;
        }
-@@ -1972,14 +1972,14 @@ idt77252_send_skb(struct atm_vcc *vcc, s
+@@ -1973,14 +1973,14 @@ idt77252_send_skb(struct atm_vcc *vcc, s
                break;
        default:
                printk("%s: Unsupported AAL: %d\n", card->name, vcc->qos.aal);
@@ -23079,7 +24225,7 @@ diff -urNp linux-3.0.4/drivers/atm/idt77252.c linux-3.0.4/drivers/atm/idt77252.c
                dev_kfree_skb(skb);
                return -EINVAL;
        }
-@@ -1987,7 +1987,7 @@ idt77252_send_skb(struct atm_vcc *vcc, s
+@@ -1988,7 +1988,7 @@ idt77252_send_skb(struct atm_vcc *vcc, s
  
        err = queue_skb(card, vc, skb, oam);
        if (err) {
@@ -23088,7 +24234,7 @@ diff -urNp linux-3.0.4/drivers/atm/idt77252.c linux-3.0.4/drivers/atm/idt77252.c
                dev_kfree_skb(skb);
                return err;
        }
-@@ -2010,7 +2010,7 @@ idt77252_send_oam(struct atm_vcc *vcc, v
+@@ -2011,7 +2011,7 @@ idt77252_send_oam(struct atm_vcc *vcc, v
        skb = dev_alloc_skb(64);
        if (!skb) {
                printk("%s: Out of memory in send_oam().\n", card->name);
@@ -23097,10 +24243,10 @@ diff -urNp linux-3.0.4/drivers/atm/idt77252.c linux-3.0.4/drivers/atm/idt77252.c
                return -ENOMEM;
        }
        atomic_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
-diff -urNp linux-3.0.4/drivers/atm/iphase.c linux-3.0.4/drivers/atm/iphase.c
---- linux-3.0.4/drivers/atm/iphase.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/atm/iphase.c   2011-08-23 21:47:55.000000000 -0400
-@@ -1120,7 +1120,7 @@ static int rx_pkt(struct atm_dev *dev)  
+diff -urNp linux-3.1.3/drivers/atm/iphase.c linux-3.1.3/drivers/atm/iphase.c
+--- linux-3.1.3/drivers/atm/iphase.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/atm/iphase.c   2011-11-16 18:39:07.000000000 -0500
+@@ -1121,7 +1121,7 @@ static int rx_pkt(struct atm_dev *dev)  
        status = (u_short) (buf_desc_ptr->desc_mode);  
        if (status & (RX_CER | RX_PTE | RX_OFL))  
        {  
@@ -23109,7 +24255,7 @@ diff -urNp linux-3.0.4/drivers/atm/iphase.c linux-3.0.4/drivers/atm/iphase.c
                IF_ERR(printk("IA: bad packet, dropping it");)  
                  if (status & RX_CER) { 
                      IF_ERR(printk(" cause: packet CRC error\n");)
-@@ -1143,7 +1143,7 @@ static int rx_pkt(struct atm_dev *dev)  
+@@ -1144,7 +1144,7 @@ static int rx_pkt(struct atm_dev *dev)  
        len = dma_addr - buf_addr;  
          if (len > iadev->rx_buf_sz) {
             printk("Over %d bytes sdu received, dropped!!!\n", iadev->rx_buf_sz);
@@ -23118,7 +24264,7 @@ diff -urNp linux-3.0.4/drivers/atm/iphase.c linux-3.0.4/drivers/atm/iphase.c
           goto out_free_desc;
          }
                  
-@@ -1293,7 +1293,7 @@ static void rx_dle_intr(struct atm_dev *
+@@ -1294,7 +1294,7 @@ static void rx_dle_intr(struct atm_dev *
            ia_vcc = INPH_IA_VCC(vcc);
            if (ia_vcc == NULL)
            {
@@ -23127,7 +24273,7 @@ diff -urNp linux-3.0.4/drivers/atm/iphase.c linux-3.0.4/drivers/atm/iphase.c
               dev_kfree_skb_any(skb);
               atm_return(vcc, atm_guess_pdu2truesize(len));
               goto INCR_DLE;
-@@ -1305,7 +1305,7 @@ static void rx_dle_intr(struct atm_dev *
+@@ -1306,7 +1306,7 @@ static void rx_dle_intr(struct atm_dev *
            if ((length > iadev->rx_buf_sz) || (length > 
                                (skb->len - sizeof(struct cpcs_trailer))))
            {
@@ -23136,7 +24282,7 @@ diff -urNp linux-3.0.4/drivers/atm/iphase.c linux-3.0.4/drivers/atm/iphase.c
               IF_ERR(printk("rx_dle_intr: Bad  AAL5 trailer %d (skb len %d)", 
                                                              length, skb->len);)
               dev_kfree_skb_any(skb);
-@@ -1321,7 +1321,7 @@ static void rx_dle_intr(struct atm_dev *
+@@ -1322,7 +1322,7 @@ static void rx_dle_intr(struct atm_dev *
  
          IF_RX(printk("rx_dle_intr: skb push");)  
          vcc->push(vcc,skb);  
@@ -23145,7 +24291,7 @@ diff -urNp linux-3.0.4/drivers/atm/iphase.c linux-3.0.4/drivers/atm/iphase.c
            iadev->rx_pkt_cnt++;
        }  
  INCR_DLE:
-@@ -2801,15 +2801,15 @@ static int ia_ioctl(struct atm_dev *dev,
+@@ -2802,15 +2802,15 @@ static int ia_ioctl(struct atm_dev *dev,
           {
               struct k_sonet_stats *stats;
               stats = &PRIV(_ia_dev[board])->sonet_stats;
@@ -23170,7 +24316,7 @@ diff -urNp linux-3.0.4/drivers/atm/iphase.c linux-3.0.4/drivers/atm/iphase.c
           }
              ia_cmds.status = 0;
              break;
-@@ -2914,7 +2914,7 @@ static int ia_pkt_tx (struct atm_vcc *vc
+@@ -2915,7 +2915,7 @@ static int ia_pkt_tx (struct atm_vcc *vc
        if ((desc == 0) || (desc > iadev->num_tx_desc))  
        {  
                IF_ERR(printk(DEV_LABEL "invalid desc for send: %d\n", desc);) 
@@ -23179,7 +24325,7 @@ diff -urNp linux-3.0.4/drivers/atm/iphase.c linux-3.0.4/drivers/atm/iphase.c
                if (vcc->pop)   
                    vcc->pop(vcc, skb);   
                else  
-@@ -3019,14 +3019,14 @@ static int ia_pkt_tx (struct atm_vcc *vc
+@@ -3020,14 +3020,14 @@ static int ia_pkt_tx (struct atm_vcc *vc
          ATM_DESC(skb) = vcc->vci;
          skb_queue_tail(&iadev->tx_dma_q, skb);
  
@@ -23196,9 +24342,9 @@ diff -urNp linux-3.0.4/drivers/atm/iphase.c linux-3.0.4/drivers/atm/iphase.c
            if (iavcc->vc_desc_cnt > 10) {
               vcc->tx_quota =  vcc->tx_quota * 3 / 4;
              printk("Tx1:  vcc->tx_quota = %d \n", (u32)vcc->tx_quota );
-diff -urNp linux-3.0.4/drivers/atm/lanai.c linux-3.0.4/drivers/atm/lanai.c
---- linux-3.0.4/drivers/atm/lanai.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/atm/lanai.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/atm/lanai.c linux-3.1.3/drivers/atm/lanai.c
+--- linux-3.1.3/drivers/atm/lanai.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/atm/lanai.c    2011-11-16 18:39:07.000000000 -0500
 @@ -1303,7 +1303,7 @@ static void lanai_send_one_aal5(struct l
        vcc_tx_add_aal5_trailer(lvcc, skb->len, 0, 0);
        lanai_endtx(lanai, lvcc);
@@ -23253,9 +24399,9 @@ diff -urNp linux-3.0.4/drivers/atm/lanai.c linux-3.0.4/drivers/atm/lanai.c
        lvcc->stats.x.aal5.service_rxcrc++;
        lvcc->rx.buf.ptr = &lvcc->rx.buf.start[SERVICE_GET_END(s) * 4];
        cardvcc_write(lvcc, SERVICE_GET_END(s), vcc_rxreadptr);
-diff -urNp linux-3.0.4/drivers/atm/nicstar.c linux-3.0.4/drivers/atm/nicstar.c
---- linux-3.0.4/drivers/atm/nicstar.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/atm/nicstar.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/atm/nicstar.c linux-3.1.3/drivers/atm/nicstar.c
+--- linux-3.1.3/drivers/atm/nicstar.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/atm/nicstar.c  2011-11-16 18:39:07.000000000 -0500
 @@ -1654,7 +1654,7 @@ static int ns_send(struct atm_vcc *vcc, 
        if ((vc = (vc_map *) vcc->dev_data) == NULL) {
                printk("nicstar%d: vcc->dev_data == NULL on ns_send().\n",
@@ -23457,9 +24603,9 @@ diff -urNp linux-3.0.4/drivers/atm/nicstar.c linux-3.0.4/drivers/atm/nicstar.c
                        }
                }
  
-diff -urNp linux-3.0.4/drivers/atm/solos-pci.c linux-3.0.4/drivers/atm/solos-pci.c
---- linux-3.0.4/drivers/atm/solos-pci.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/atm/solos-pci.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/atm/solos-pci.c linux-3.1.3/drivers/atm/solos-pci.c
+--- linux-3.1.3/drivers/atm/solos-pci.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/atm/solos-pci.c        2011-11-16 18:40:10.000000000 -0500
 @@ -714,7 +714,7 @@ void solos_bh(unsigned long card_arg)
                                }
                                atm_charge(vcc, skb->truesize);
@@ -23487,9 +24633,9 @@ diff -urNp linux-3.0.4/drivers/atm/solos-pci.c linux-3.0.4/drivers/atm/solos-pci
                                solos_pop(vcc, oldskb);
                        } else
                                dev_kfree_skb_irq(oldskb);
-diff -urNp linux-3.0.4/drivers/atm/suni.c linux-3.0.4/drivers/atm/suni.c
---- linux-3.0.4/drivers/atm/suni.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/atm/suni.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/atm/suni.c linux-3.1.3/drivers/atm/suni.c
+--- linux-3.1.3/drivers/atm/suni.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/atm/suni.c     2011-11-16 18:39:07.000000000 -0500
 @@ -50,8 +50,8 @@ static DEFINE_SPINLOCK(sunis_lock);
  
  
@@ -23501,9 +24647,9 @@ diff -urNp linux-3.0.4/drivers/atm/suni.c linux-3.0.4/drivers/atm/suni.c
  
  
  static void suni_hz(unsigned long from_timer)
-diff -urNp linux-3.0.4/drivers/atm/uPD98402.c linux-3.0.4/drivers/atm/uPD98402.c
---- linux-3.0.4/drivers/atm/uPD98402.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/atm/uPD98402.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/atm/uPD98402.c linux-3.1.3/drivers/atm/uPD98402.c
+--- linux-3.1.3/drivers/atm/uPD98402.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/atm/uPD98402.c 2011-11-16 18:39:07.000000000 -0500
 @@ -42,7 +42,7 @@ static int fetch_stats(struct atm_dev *d
        struct sonet_stats tmp;
        int error = 0;
@@ -23548,10 +24694,10 @@ diff -urNp linux-3.0.4/drivers/atm/uPD98402.c linux-3.0.4/drivers/atm/uPD98402.c
        return 0;
  }
  
-diff -urNp linux-3.0.4/drivers/atm/zatm.c linux-3.0.4/drivers/atm/zatm.c
---- linux-3.0.4/drivers/atm/zatm.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/atm/zatm.c     2011-08-23 21:47:55.000000000 -0400
-@@ -459,7 +459,7 @@ printk("dummy: 0x%08lx, 0x%08lx\n",dummy
+diff -urNp linux-3.1.3/drivers/atm/zatm.c linux-3.1.3/drivers/atm/zatm.c
+--- linux-3.1.3/drivers/atm/zatm.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/atm/zatm.c     2011-11-16 18:39:07.000000000 -0500
+@@ -460,7 +460,7 @@ printk("dummy: 0x%08lx, 0x%08lx\n",dummy
                }
                if (!size) {
                        dev_kfree_skb_irq(skb);
@@ -23560,7 +24706,7 @@ diff -urNp linux-3.0.4/drivers/atm/zatm.c linux-3.0.4/drivers/atm/zatm.c
                        continue;
                }
                if (!atm_charge(vcc,skb->truesize)) {
-@@ -469,7 +469,7 @@ printk("dummy: 0x%08lx, 0x%08lx\n",dummy
+@@ -470,7 +470,7 @@ printk("dummy: 0x%08lx, 0x%08lx\n",dummy
                skb->len = size;
                ATM_SKB(skb)->vcc = vcc;
                vcc->push(vcc,skb);
@@ -23569,7 +24715,7 @@ diff -urNp linux-3.0.4/drivers/atm/zatm.c linux-3.0.4/drivers/atm/zatm.c
        }
        zout(pos & 0xffff,MTA(mbx));
  #if 0 /* probably a stupid idea */
-@@ -733,7 +733,7 @@ if (*ZATM_PRV_DSC(skb) != (uPD98401_TXPD
+@@ -734,7 +734,7 @@ if (*ZATM_PRV_DSC(skb) != (uPD98401_TXPD
                        skb_queue_head(&zatm_vcc->backlog,skb);
                        break;
                }
@@ -23578,9 +24724,21 @@ diff -urNp linux-3.0.4/drivers/atm/zatm.c linux-3.0.4/drivers/atm/zatm.c
        wake_up(&zatm_vcc->tx_wait);
  }
  
-diff -urNp linux-3.0.4/drivers/base/power/wakeup.c linux-3.0.4/drivers/base/power/wakeup.c
---- linux-3.0.4/drivers/base/power/wakeup.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/base/power/wakeup.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/base/devtmpfs.c linux-3.1.3/drivers/base/devtmpfs.c
+--- linux-3.1.3/drivers/base/devtmpfs.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/base/devtmpfs.c        2011-11-16 18:39:07.000000000 -0500
+@@ -368,7 +368,7 @@ int devtmpfs_mount(const char *mntdir)
+       if (!thread)
+               return 0;
+-      err = sys_mount("devtmpfs", (char *)mntdir, "devtmpfs", MS_SILENT, NULL);
++      err = sys_mount((char __force_user *)"devtmpfs", (char __force_user *)mntdir, (char __force_user *)"devtmpfs", MS_SILENT, NULL);
+       if (err)
+               printk(KERN_INFO "devtmpfs: error mounting %i\n", err);
+       else
+diff -urNp linux-3.1.3/drivers/base/power/wakeup.c linux-3.1.3/drivers/base/power/wakeup.c
+--- linux-3.1.3/drivers/base/power/wakeup.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/base/power/wakeup.c    2011-11-16 18:39:07.000000000 -0500
 @@ -29,14 +29,14 @@ bool events_check_enabled;
   * They need to be modified together atomically, so it's better to use one
   * atomic variable to hold them both.
@@ -23616,9 +24774,9 @@ diff -urNp linux-3.0.4/drivers/base/power/wakeup.c linux-3.0.4/drivers/base/powe
  }
  
  /**
-diff -urNp linux-3.0.4/drivers/block/cciss.c linux-3.0.4/drivers/block/cciss.c
---- linux-3.0.4/drivers/block/cciss.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/block/cciss.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/block/cciss.c linux-3.1.3/drivers/block/cciss.c
+--- linux-3.1.3/drivers/block/cciss.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/block/cciss.c  2011-11-16 18:40:10.000000000 -0500
 @@ -1179,6 +1179,8 @@ static int cciss_ioctl32_passthru(struct
        int err;
        u32 cp;
@@ -23694,7 +24852,7 @@ diff -urNp linux-3.0.4/drivers/block/cciss.c linux-3.0.4/drivers/block/cciss.c
  
        if (cciss_board_disabled(h)) {
                dev_warn(&h->pdev->dev, "controller appears to be disabled\n");
-@@ -5002,7 +5004,7 @@ reinit_after_soft_reset:
+@@ -5009,7 +5011,7 @@ reinit_after_soft_reset:
        }
  
        /* make sure the board interrupts are off */
@@ -23703,7 +24861,7 @@ diff -urNp linux-3.0.4/drivers/block/cciss.c linux-3.0.4/drivers/block/cciss.c
        rc = cciss_request_irq(h, do_cciss_msix_intr, do_cciss_intx);
        if (rc)
                goto clean2;
-@@ -5054,7 +5056,7 @@ reinit_after_soft_reset:
+@@ -5061,7 +5063,7 @@ reinit_after_soft_reset:
                 * fake ones to scoop up any residual completions.
                 */
                spin_lock_irqsave(&h->lock, flags);
@@ -23712,7 +24870,7 @@ diff -urNp linux-3.0.4/drivers/block/cciss.c linux-3.0.4/drivers/block/cciss.c
                spin_unlock_irqrestore(&h->lock, flags);
                free_irq(h->intr[PERF_MODE_INT], h);
                rc = cciss_request_irq(h, cciss_msix_discard_completions,
-@@ -5074,9 +5076,9 @@ reinit_after_soft_reset:
+@@ -5081,9 +5083,9 @@ reinit_after_soft_reset:
                dev_info(&h->pdev->dev, "Board READY.\n");
                dev_info(&h->pdev->dev,
                        "Waiting for stale completions to drain.\n");
@@ -23724,7 +24882,7 @@ diff -urNp linux-3.0.4/drivers/block/cciss.c linux-3.0.4/drivers/block/cciss.c
  
                rc = controller_reset_failed(h->cfgtable);
                if (rc)
-@@ -5099,7 +5101,7 @@ reinit_after_soft_reset:
+@@ -5106,7 +5108,7 @@ reinit_after_soft_reset:
        cciss_scsi_setup(h);
  
        /* Turn the interrupts on so we can service requests */
@@ -23733,7 +24891,7 @@ diff -urNp linux-3.0.4/drivers/block/cciss.c linux-3.0.4/drivers/block/cciss.c
  
        /* Get the firmware version */
        inq_buff = kzalloc(sizeof(InquiryData_struct), GFP_KERNEL);
-@@ -5171,7 +5173,7 @@ static void cciss_shutdown(struct pci_de
+@@ -5178,7 +5180,7 @@ static void cciss_shutdown(struct pci_de
        kfree(flush_buf);
        if (return_code != IO_OK)
                dev_warn(&h->pdev->dev, "Error flushing cache\n");
@@ -23742,9 +24900,9 @@ diff -urNp linux-3.0.4/drivers/block/cciss.c linux-3.0.4/drivers/block/cciss.c
        free_irq(h->intr[PERF_MODE_INT], h);
  }
  
-diff -urNp linux-3.0.4/drivers/block/cciss.h linux-3.0.4/drivers/block/cciss.h
---- linux-3.0.4/drivers/block/cciss.h  2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/block/cciss.h  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/block/cciss.h linux-3.1.3/drivers/block/cciss.h
+--- linux-3.1.3/drivers/block/cciss.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/block/cciss.h  2011-11-16 18:39:07.000000000 -0500
 @@ -100,7 +100,7 @@ struct ctlr_info
        /* information about each logical volume */
        drive_info_struct *drv[CISS_MAX_LUN];
@@ -23754,9 +24912,9 @@ diff -urNp linux-3.0.4/drivers/block/cciss.h linux-3.0.4/drivers/block/cciss.h
  
        /* queue and queue Info */ 
        struct list_head reqQ;
-diff -urNp linux-3.0.4/drivers/block/cpqarray.c linux-3.0.4/drivers/block/cpqarray.c
---- linux-3.0.4/drivers/block/cpqarray.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/block/cpqarray.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/block/cpqarray.c linux-3.1.3/drivers/block/cpqarray.c
+--- linux-3.1.3/drivers/block/cpqarray.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/block/cpqarray.c       2011-11-16 18:40:10.000000000 -0500
 @@ -404,7 +404,7 @@ static int __devinit cpqarray_register_c
        if (register_blkdev(COMPAQ_SMART2_MAJOR+i, hba[i]->devname)) {
                goto Enomem4;
@@ -23882,9 +25040,9 @@ diff -urNp linux-3.0.4/drivers/block/cpqarray.c linux-3.0.4/drivers/block/cpqarr
                if (done == 0) {
                        udelay(10);     /* a short fixed delay */
                } else
-diff -urNp linux-3.0.4/drivers/block/cpqarray.h linux-3.0.4/drivers/block/cpqarray.h
---- linux-3.0.4/drivers/block/cpqarray.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/block/cpqarray.h       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/block/cpqarray.h linux-3.1.3/drivers/block/cpqarray.h
+--- linux-3.1.3/drivers/block/cpqarray.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/block/cpqarray.h       2011-11-16 18:39:07.000000000 -0500
 @@ -99,7 +99,7 @@ struct ctlr_info {
        drv_info_t      drv[NWD];
        struct proc_dir_entry *proc;
@@ -23894,9 +25052,9 @@ diff -urNp linux-3.0.4/drivers/block/cpqarray.h linux-3.0.4/drivers/block/cpqarr
  
        cmdlist_t *reqQ;
        cmdlist_t *cmpQ;
-diff -urNp linux-3.0.4/drivers/block/DAC960.c linux-3.0.4/drivers/block/DAC960.c
---- linux-3.0.4/drivers/block/DAC960.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/block/DAC960.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/block/DAC960.c linux-3.1.3/drivers/block/DAC960.c
+--- linux-3.1.3/drivers/block/DAC960.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/block/DAC960.c 2011-11-16 18:40:10.000000000 -0500
 @@ -1980,6 +1980,8 @@ static bool DAC960_V1_ReadDeviceConfigur
    unsigned long flags;
    int Channel, TargetID;
@@ -23906,9 +25064,9 @@ diff -urNp linux-3.0.4/drivers/block/DAC960.c linux-3.0.4/drivers/block/DAC960.c
    if (!init_dma_loaf(Controller->PCIDevice, &local_dma, 
                DAC960_V1_MaxChannels*(sizeof(DAC960_V1_DCDB_T) +
                        sizeof(DAC960_SCSI_Inquiry_T) +
-diff -urNp linux-3.0.4/drivers/block/drbd/drbd_int.h linux-3.0.4/drivers/block/drbd/drbd_int.h
---- linux-3.0.4/drivers/block/drbd/drbd_int.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/block/drbd/drbd_int.h  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/block/drbd/drbd_int.h linux-3.1.3/drivers/block/drbd/drbd_int.h
+--- linux-3.1.3/drivers/block/drbd/drbd_int.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/block/drbd/drbd_int.h  2011-11-16 18:39:07.000000000 -0500
 @@ -737,7 +737,7 @@ struct drbd_request;
  struct drbd_epoch {
        struct list_head list;
@@ -23927,9 +25085,48 @@ diff -urNp linux-3.0.4/drivers/block/drbd/drbd_int.h linux-3.0.4/drivers/block/d
        unsigned int peer_seq;
        spinlock_t peer_seq_lock;
        unsigned int minor;
-diff -urNp linux-3.0.4/drivers/block/drbd/drbd_main.c linux-3.0.4/drivers/block/drbd/drbd_main.c
---- linux-3.0.4/drivers/block/drbd/drbd_main.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/block/drbd/drbd_main.c 2011-08-23 21:47:55.000000000 -0400
+@@ -1618,30 +1618,30 @@ static inline int drbd_setsockopt(struct
+ static inline void drbd_tcp_cork(struct socket *sock)
+ {
+-      int __user val = 1;
++      int val = 1;
+       (void) drbd_setsockopt(sock, SOL_TCP, TCP_CORK,
+-                      (char __user *)&val, sizeof(val));
++                      (char __force_user *)&val, sizeof(val));
+ }
+ static inline void drbd_tcp_uncork(struct socket *sock)
+ {
+-      int __user val = 0;
++      int val = 0;
+       (void) drbd_setsockopt(sock, SOL_TCP, TCP_CORK,
+-                      (char __user *)&val, sizeof(val));
++                      (char __force_user *)&val, sizeof(val));
+ }
+ static inline void drbd_tcp_nodelay(struct socket *sock)
+ {
+-      int __user val = 1;
++      int val = 1;
+       (void) drbd_setsockopt(sock, SOL_TCP, TCP_NODELAY,
+-                      (char __user *)&val, sizeof(val));
++                      (char __force_user *)&val, sizeof(val));
+ }
+ static inline void drbd_tcp_quickack(struct socket *sock)
+ {
+-      int __user val = 2;
++      int val = 2;
+       (void) drbd_setsockopt(sock, SOL_TCP, TCP_QUICKACK,
+-                      (char __user *)&val, sizeof(val));
++                      (char __force_user *)&val, sizeof(val));
+ }
+ void drbd_bump_write_ordering(struct drbd_conf *mdev, enum write_ordering_e wo);
+diff -urNp linux-3.1.3/drivers/block/drbd/drbd_main.c linux-3.1.3/drivers/block/drbd/drbd_main.c
+--- linux-3.1.3/drivers/block/drbd/drbd_main.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/block/drbd/drbd_main.c 2011-11-16 18:39:07.000000000 -0500
 @@ -2397,7 +2397,7 @@ static int _drbd_send_ack(struct drbd_co
        p.sector   = sector;
        p.block_id = block_id;
@@ -23968,9 +25165,9 @@ diff -urNp linux-3.0.4/drivers/block/drbd/drbd_main.c linux-3.0.4/drivers/block/
        mdev->al_writ_cnt  =
        mdev->bm_writ_cnt  =
        mdev->read_cnt     =
-diff -urNp linux-3.0.4/drivers/block/drbd/drbd_nl.c linux-3.0.4/drivers/block/drbd/drbd_nl.c
---- linux-3.0.4/drivers/block/drbd/drbd_nl.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/block/drbd/drbd_nl.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/block/drbd/drbd_nl.c linux-3.1.3/drivers/block/drbd/drbd_nl.c
+--- linux-3.1.3/drivers/block/drbd/drbd_nl.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/block/drbd/drbd_nl.c   2011-11-16 18:39:07.000000000 -0500
 @@ -2359,7 +2359,7 @@ static void drbd_connector_callback(stru
        module_put(THIS_MODULE);
  }
@@ -24016,9 +25213,9 @@ diff -urNp linux-3.0.4/drivers/block/drbd/drbd_nl.c linux-3.0.4/drivers/block/dr
        cn_reply->ack = 0; /* not used here. */
        cn_reply->len = sizeof(struct drbd_nl_cfg_reply) +
                (int)((char *)tl - (char *)reply->tag_list);
-diff -urNp linux-3.0.4/drivers/block/drbd/drbd_receiver.c linux-3.0.4/drivers/block/drbd/drbd_receiver.c
---- linux-3.0.4/drivers/block/drbd/drbd_receiver.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/block/drbd/drbd_receiver.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/block/drbd/drbd_receiver.c linux-3.1.3/drivers/block/drbd/drbd_receiver.c
+--- linux-3.1.3/drivers/block/drbd/drbd_receiver.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/block/drbd/drbd_receiver.c     2011-11-16 18:39:07.000000000 -0500
 @@ -894,7 +894,7 @@ retry:
        sock->sk->sk_sndtimeo = mdev->net_conf->timeout*HZ/10;
        sock->sk->sk_rcvtimeo = MAX_SCHEDULE_TIMEOUT;
@@ -24104,9 +25301,21 @@ diff -urNp linux-3.0.4/drivers/block/drbd/drbd_receiver.c linux-3.0.4/drivers/bl
        D_ASSERT(list_empty(&mdev->current_epoch->list));
  }
  
-diff -urNp linux-3.0.4/drivers/block/nbd.c linux-3.0.4/drivers/block/nbd.c
---- linux-3.0.4/drivers/block/nbd.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/block/nbd.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/block/loop.c linux-3.1.3/drivers/block/loop.c
+--- linux-3.1.3/drivers/block/loop.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/block/loop.c   2011-11-16 18:39:07.000000000 -0500
+@@ -283,7 +283,7 @@ static int __do_lo_send_write(struct fil
+       mm_segment_t old_fs = get_fs();
+       set_fs(get_ds());
+-      bw = file->f_op->write(file, buf, len, &pos);
++      bw = file->f_op->write(file, (const char __force_user *)buf, len, &pos);
+       set_fs(old_fs);
+       if (likely(bw == len))
+               return 0;
+diff -urNp linux-3.1.3/drivers/block/nbd.c linux-3.1.3/drivers/block/nbd.c
+--- linux-3.1.3/drivers/block/nbd.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/block/nbd.c    2011-11-16 18:40:10.000000000 -0500
 @@ -157,6 +157,8 @@ static int sock_xmit(struct nbd_device *
        struct kvec iov;
        sigset_t blocked, oldset;
@@ -24125,9 +25334,9 @@ diff -urNp linux-3.0.4/drivers/block/nbd.c linux-3.0.4/drivers/block/nbd.c
        switch (cmd) {
        case NBD_DISCONNECT: {
                struct request sreq;
-diff -urNp linux-3.0.4/drivers/char/agp/frontend.c linux-3.0.4/drivers/char/agp/frontend.c
---- linux-3.0.4/drivers/char/agp/frontend.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/char/agp/frontend.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/char/agp/frontend.c linux-3.1.3/drivers/char/agp/frontend.c
+--- linux-3.1.3/drivers/char/agp/frontend.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/char/agp/frontend.c    2011-11-16 18:39:07.000000000 -0500
 @@ -817,7 +817,7 @@ static int agpioc_reserve_wrap(struct ag
        if (copy_from_user(&reserve, arg, sizeof(struct agp_region)))
                return -EFAULT;
@@ -24137,9 +25346,9 @@ diff -urNp linux-3.0.4/drivers/char/agp/frontend.c linux-3.0.4/drivers/char/agp/
                return -EFAULT;
  
        client = agp_find_client_by_pid(reserve.pid);
-diff -urNp linux-3.0.4/drivers/char/briq_panel.c linux-3.0.4/drivers/char/briq_panel.c
---- linux-3.0.4/drivers/char/briq_panel.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/char/briq_panel.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/char/briq_panel.c linux-3.1.3/drivers/char/briq_panel.c
+--- linux-3.1.3/drivers/char/briq_panel.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/char/briq_panel.c      2011-11-16 18:40:10.000000000 -0500
 @@ -9,6 +9,7 @@
  #include <linux/types.h>
  #include <linux/errno.h>
@@ -24181,9 +25390,9 @@ diff -urNp linux-3.0.4/drivers/char/briq_panel.c linux-3.0.4/drivers/char/briq_p
  
        return len;
  }
-diff -urNp linux-3.0.4/drivers/char/genrtc.c linux-3.0.4/drivers/char/genrtc.c
---- linux-3.0.4/drivers/char/genrtc.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/char/genrtc.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/char/genrtc.c linux-3.1.3/drivers/char/genrtc.c
+--- linux-3.1.3/drivers/char/genrtc.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/char/genrtc.c  2011-11-16 18:40:10.000000000 -0500
 @@ -273,6 +273,7 @@ static int gen_rtc_ioctl(struct file *fi
        switch (cmd) {
  
@@ -24192,9 +25401,9 @@ diff -urNp linux-3.0.4/drivers/char/genrtc.c linux-3.0.4/drivers/char/genrtc.c
            if (get_rtc_pll(&pll))
                    return -EINVAL;
            else
-diff -urNp linux-3.0.4/drivers/char/hpet.c linux-3.0.4/drivers/char/hpet.c
---- linux-3.0.4/drivers/char/hpet.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/char/hpet.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/char/hpet.c linux-3.1.3/drivers/char/hpet.c
+--- linux-3.1.3/drivers/char/hpet.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/char/hpet.c    2011-11-16 18:39:07.000000000 -0500
 @@ -572,7 +572,7 @@ static inline unsigned long hpet_time_di
  }
  
@@ -24204,9 +25413,9 @@ diff -urNp linux-3.0.4/drivers/char/hpet.c linux-3.0.4/drivers/char/hpet.c
                  struct hpet_info *info)
  {
        struct hpet_timer __iomem *timer;
-diff -urNp linux-3.0.4/drivers/char/ipmi/ipmi_msghandler.c linux-3.0.4/drivers/char/ipmi/ipmi_msghandler.c
---- linux-3.0.4/drivers/char/ipmi/ipmi_msghandler.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/char/ipmi/ipmi_msghandler.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/char/ipmi/ipmi_msghandler.c linux-3.1.3/drivers/char/ipmi/ipmi_msghandler.c
+--- linux-3.1.3/drivers/char/ipmi/ipmi_msghandler.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/char/ipmi/ipmi_msghandler.c    2011-11-16 18:40:10.000000000 -0500
 @@ -415,7 +415,7 @@ struct ipmi_smi {
        struct proc_dir_entry *proc_dir;
        char                  proc_dir_name[10];
@@ -24246,9 +25455,9 @@ diff -urNp linux-3.0.4/drivers/char/ipmi/ipmi_msghandler.c linux-3.0.4/drivers/c
        si = (struct ipmi_system_interface_addr *) &addr;
        si->addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE;
        si->channel = IPMI_BMC_CHANNEL;
-diff -urNp linux-3.0.4/drivers/char/ipmi/ipmi_si_intf.c linux-3.0.4/drivers/char/ipmi/ipmi_si_intf.c
---- linux-3.0.4/drivers/char/ipmi/ipmi_si_intf.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/char/ipmi/ipmi_si_intf.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/char/ipmi/ipmi_si_intf.c linux-3.1.3/drivers/char/ipmi/ipmi_si_intf.c
+--- linux-3.1.3/drivers/char/ipmi/ipmi_si_intf.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/char/ipmi/ipmi_si_intf.c       2011-11-16 18:39:07.000000000 -0500
 @@ -277,7 +277,7 @@ struct smi_info {
        unsigned char slave_addr;
  
@@ -24279,9 +25488,9 @@ diff -urNp linux-3.0.4/drivers/char/ipmi/ipmi_si_intf.c linux-3.0.4/drivers/char
  
        new_smi->interrupt_disabled = 1;
        atomic_set(&new_smi->stop_operation, 0);
-diff -urNp linux-3.0.4/drivers/char/Kconfig linux-3.0.4/drivers/char/Kconfig
---- linux-3.0.4/drivers/char/Kconfig   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/char/Kconfig   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/char/Kconfig linux-3.1.3/drivers/char/Kconfig
+--- linux-3.1.3/drivers/char/Kconfig   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/char/Kconfig   2011-11-16 18:40:10.000000000 -0500
 @@ -8,7 +8,8 @@ source "drivers/tty/Kconfig"
  
  config DEVKMEM
@@ -24300,9 +25509,21 @@ diff -urNp linux-3.0.4/drivers/char/Kconfig linux-3.0.4/drivers/char/Kconfig
        default y
  
  source "drivers/s390/char/Kconfig"
-diff -urNp linux-3.0.4/drivers/char/mem.c linux-3.0.4/drivers/char/mem.c
---- linux-3.0.4/drivers/char/mem.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/char/mem.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/char/mbcs.c linux-3.1.3/drivers/char/mbcs.c
+--- linux-3.1.3/drivers/char/mbcs.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/char/mbcs.c    2011-11-16 18:39:07.000000000 -0500
+@@ -800,7 +800,7 @@ static int mbcs_remove(struct cx_dev *de
+       return 0;
+ }
+-static const struct cx_device_id __devinitdata mbcs_id_table[] = {
++static const struct cx_device_id __devinitconst mbcs_id_table[] = {
+       {
+        .part_num = MBCS_PART_NUM,
+        .mfg_num = MBCS_MFG_NUM,
+diff -urNp linux-3.1.3/drivers/char/mem.c linux-3.1.3/drivers/char/mem.c
+--- linux-3.1.3/drivers/char/mem.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/char/mem.c     2011-11-17 18:31:56.000000000 -0500
 @@ -18,6 +18,7 @@
  #include <linux/raw.h>
  #include <linux/tty.h>
@@ -24316,7 +25537,7 @@ diff -urNp linux-3.0.4/drivers/char/mem.c linux-3.0.4/drivers/char/mem.c
  #endif
  
 +#if defined(CONFIG_GRKERNSEC) && !defined(CONFIG_GRKERNSEC_NO_RBAC)
-+extern struct file_operations grsec_fops;
++extern const struct file_operations grsec_fops;
 +#endif
 +
  static inline unsigned long size_inside_page(unsigned long start,
@@ -24435,10 +25656,10 @@ diff -urNp linux-3.0.4/drivers/char/mem.c linux-3.0.4/drivers/char/mem.c
  };
  
  static int memory_open(struct inode *inode, struct file *filp)
-diff -urNp linux-3.0.4/drivers/char/nvram.c linux-3.0.4/drivers/char/nvram.c
---- linux-3.0.4/drivers/char/nvram.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/char/nvram.c   2011-08-23 21:47:55.000000000 -0400
-@@ -246,7 +246,7 @@ static ssize_t nvram_read(struct file *f
+diff -urNp linux-3.1.3/drivers/char/nvram.c linux-3.1.3/drivers/char/nvram.c
+--- linux-3.1.3/drivers/char/nvram.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/char/nvram.c   2011-11-16 18:39:07.000000000 -0500
+@@ -248,7 +248,7 @@ static ssize_t nvram_read(struct file *f
  
        spin_unlock_irq(&rtc_lock);
  
@@ -24447,9 +25668,9 @@ diff -urNp linux-3.0.4/drivers/char/nvram.c linux-3.0.4/drivers/char/nvram.c
                return -EFAULT;
  
        *ppos = i;
-diff -urNp linux-3.0.4/drivers/char/random.c linux-3.0.4/drivers/char/random.c
---- linux-3.0.4/drivers/char/random.c  2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/char/random.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/char/random.c linux-3.1.3/drivers/char/random.c
+--- linux-3.1.3/drivers/char/random.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/char/random.c  2011-11-16 18:40:10.000000000 -0500
 @@ -261,8 +261,13 @@
  /*
   * Configuration information
@@ -24500,9 +25721,9 @@ diff -urNp linux-3.0.4/drivers/char/random.c linux-3.0.4/drivers/char/random.c
  static int max_write_thresh = INPUT_POOL_WORDS * 32;
  static char sysctl_bootid[16];
  
-diff -urNp linux-3.0.4/drivers/char/sonypi.c linux-3.0.4/drivers/char/sonypi.c
---- linux-3.0.4/drivers/char/sonypi.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/char/sonypi.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/char/sonypi.c linux-3.1.3/drivers/char/sonypi.c
+--- linux-3.1.3/drivers/char/sonypi.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/char/sonypi.c  2011-11-16 18:39:07.000000000 -0500
 @@ -55,6 +55,7 @@
  #include <asm/uaccess.h>
  #include <asm/io.h>
@@ -24541,9 +25762,9 @@ diff -urNp linux-3.0.4/drivers/char/sonypi.c linux-3.0.4/drivers/char/sonypi.c
        mutex_unlock(&sonypi_device.lock);
  
        return 0;
-diff -urNp linux-3.0.4/drivers/char/tpm/tpm_bios.c linux-3.0.4/drivers/char/tpm/tpm_bios.c
---- linux-3.0.4/drivers/char/tpm/tpm_bios.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/char/tpm/tpm_bios.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/char/tpm/tpm_bios.c linux-3.1.3/drivers/char/tpm/tpm_bios.c
+--- linux-3.1.3/drivers/char/tpm/tpm_bios.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/char/tpm/tpm_bios.c    2011-11-16 18:39:07.000000000 -0500
 @@ -173,7 +173,7 @@ static void *tpm_bios_measurements_start
        event = addr;
  
@@ -24572,7 +25793,7 @@ diff -urNp linux-3.0.4/drivers/char/tpm/tpm_bios.c linux-3.0.4/drivers/char/tpm/
  
        return 0;
  }
-@@ -410,6 +411,11 @@ static int read_log(struct tpm_bios_log 
+@@ -410,8 +411,13 @@ static int read_log(struct tpm_bios_log 
        log->bios_event_log_end = log->bios_event_log + len;
  
        virt = acpi_os_map_memory(start, len);
@@ -24582,12 +25803,15 @@ diff -urNp linux-3.0.4/drivers/char/tpm/tpm_bios.c linux-3.0.4/drivers/char/tpm/
 +              return -EFAULT;
 +      }
  
-       memcpy(log->bios_event_log, virt, len);
+-      memcpy(log->bios_event_log, virt, len);
++      memcpy(log->bios_event_log, (const char __force_kernel *)virt, len);
  
-diff -urNp linux-3.0.4/drivers/char/tpm/tpm.c linux-3.0.4/drivers/char/tpm/tpm.c
---- linux-3.0.4/drivers/char/tpm/tpm.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/char/tpm/tpm.c 2011-08-23 21:48:14.000000000 -0400
-@@ -411,7 +411,7 @@ static ssize_t tpm_transmit(struct tpm_c
+       acpi_os_unmap_memory(virt, len);
+       return 0;
+diff -urNp linux-3.1.3/drivers/char/tpm/tpm.c linux-3.1.3/drivers/char/tpm/tpm.c
+--- linux-3.1.3/drivers/char/tpm/tpm.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/char/tpm/tpm.c 2011-11-16 18:40:10.000000000 -0500
+@@ -414,7 +414,7 @@ static ssize_t tpm_transmit(struct tpm_c
                    chip->vendor.req_complete_val)
                        goto out_recv;
  
@@ -24596,7 +25820,7 @@ diff -urNp linux-3.0.4/drivers/char/tpm/tpm.c linux-3.0.4/drivers/char/tpm/tpm.c
                        dev_err(chip->dev, "Operation Canceled\n");
                        rc = -ECANCELED;
                        goto out;
-@@ -844,6 +844,8 @@ ssize_t tpm_show_pubek(struct device *de
+@@ -862,6 +862,8 @@ ssize_t tpm_show_pubek(struct device *de
  
        struct tpm_chip *chip = dev_get_drvdata(dev);
  
@@ -24605,9 +25829,30 @@ diff -urNp linux-3.0.4/drivers/char/tpm/tpm.c linux-3.0.4/drivers/char/tpm/tpm.c
        tpm_cmd.header.in = tpm_readpubek_header;
        err = transmit_cmd(chip, &tpm_cmd, READ_PUBEK_RESULT_SIZE,
                        "attempting to read the PUBEK");
-diff -urNp linux-3.0.4/drivers/crypto/hifn_795x.c linux-3.0.4/drivers/crypto/hifn_795x.c
---- linux-3.0.4/drivers/crypto/hifn_795x.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/crypto/hifn_795x.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/char/virtio_console.c linux-3.1.3/drivers/char/virtio_console.c
+--- linux-3.1.3/drivers/char/virtio_console.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/char/virtio_console.c  2011-11-16 18:39:07.000000000 -0500
+@@ -555,7 +555,7 @@ static ssize_t fill_readbuf(struct port 
+       if (to_user) {
+               ssize_t ret;
+-              ret = copy_to_user(out_buf, buf->buf + buf->offset, out_count);
++              ret = copy_to_user((char __force_user *)out_buf, buf->buf + buf->offset, out_count);
+               if (ret)
+                       return -EFAULT;
+       } else {
+@@ -654,7 +654,7 @@ static ssize_t port_fops_read(struct fil
+       if (!port_has_data(port) && !port->host_connected)
+               return 0;
+-      return fill_readbuf(port, ubuf, count, true);
++      return fill_readbuf(port, (char __force_kernel *)ubuf, count, true);
+ }
+ static ssize_t port_fops_write(struct file *filp, const char __user *ubuf,
+diff -urNp linux-3.1.3/drivers/crypto/hifn_795x.c linux-3.1.3/drivers/crypto/hifn_795x.c
+--- linux-3.1.3/drivers/crypto/hifn_795x.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/crypto/hifn_795x.c     2011-11-16 18:40:10.000000000 -0500
 @@ -1655,6 +1655,8 @@ static int hifn_test(struct hifn_device 
                0xCA, 0x34, 0x2B, 0x2E};
        struct scatterlist sg;
@@ -24617,9 +25862,9 @@ diff -urNp linux-3.0.4/drivers/crypto/hifn_795x.c linux-3.0.4/drivers/crypto/hif
        memset(src, 0, sizeof(src));
        memset(ctx.key, 0, sizeof(ctx.key));
  
-diff -urNp linux-3.0.4/drivers/crypto/padlock-aes.c linux-3.0.4/drivers/crypto/padlock-aes.c
---- linux-3.0.4/drivers/crypto/padlock-aes.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/crypto/padlock-aes.c   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/crypto/padlock-aes.c linux-3.1.3/drivers/crypto/padlock-aes.c
+--- linux-3.1.3/drivers/crypto/padlock-aes.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/crypto/padlock-aes.c   2011-11-16 18:40:10.000000000 -0500
 @@ -109,6 +109,8 @@ static int aes_set_key(struct crypto_tfm
        struct crypto_aes_ctx gen_aes;
        int cpu;
@@ -24629,9 +25874,57 @@ diff -urNp linux-3.0.4/drivers/crypto/padlock-aes.c linux-3.0.4/drivers/crypto/p
        if (key_len % 8) {
                *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
                return -EINVAL;
-diff -urNp linux-3.0.4/drivers/edac/edac_pci_sysfs.c linux-3.0.4/drivers/edac/edac_pci_sysfs.c
---- linux-3.0.4/drivers/edac/edac_pci_sysfs.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/edac/edac_pci_sysfs.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/edac/amd64_edac.c linux-3.1.3/drivers/edac/amd64_edac.c
+--- linux-3.1.3/drivers/edac/amd64_edac.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/amd64_edac.c      2011-11-16 18:39:07.000000000 -0500
+@@ -2670,7 +2670,7 @@ static void __devexit amd64_remove_one_i
+  * PCI core identifies what devices are on a system during boot, and then
+  * inquiry this table to see if this driver is for a given device found.
+  */
+-static const struct pci_device_id amd64_pci_table[] __devinitdata = {
++static const struct pci_device_id amd64_pci_table[] __devinitconst = {
+       {
+               .vendor         = PCI_VENDOR_ID_AMD,
+               .device         = PCI_DEVICE_ID_AMD_K8_NB_MEMCTL,
+diff -urNp linux-3.1.3/drivers/edac/amd76x_edac.c linux-3.1.3/drivers/edac/amd76x_edac.c
+--- linux-3.1.3/drivers/edac/amd76x_edac.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/amd76x_edac.c     2011-11-16 18:39:07.000000000 -0500
+@@ -321,7 +321,7 @@ static void __devexit amd76x_remove_one(
+       edac_mc_free(mci);
+ }
+-static const struct pci_device_id amd76x_pci_tbl[] __devinitdata = {
++static const struct pci_device_id amd76x_pci_tbl[] __devinitconst = {
+       {
+        PCI_VEND_DEV(AMD, FE_GATE_700C), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+        AMD762},
+diff -urNp linux-3.1.3/drivers/edac/e752x_edac.c linux-3.1.3/drivers/edac/e752x_edac.c
+--- linux-3.1.3/drivers/edac/e752x_edac.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/e752x_edac.c      2011-11-16 18:39:07.000000000 -0500
+@@ -1380,7 +1380,7 @@ static void __devexit e752x_remove_one(s
+       edac_mc_free(mci);
+ }
+-static const struct pci_device_id e752x_pci_tbl[] __devinitdata = {
++static const struct pci_device_id e752x_pci_tbl[] __devinitconst = {
+       {
+        PCI_VEND_DEV(INTEL, 7520_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+        E7520},
+diff -urNp linux-3.1.3/drivers/edac/e7xxx_edac.c linux-3.1.3/drivers/edac/e7xxx_edac.c
+--- linux-3.1.3/drivers/edac/e7xxx_edac.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/e7xxx_edac.c      2011-11-16 18:39:07.000000000 -0500
+@@ -525,7 +525,7 @@ static void __devexit e7xxx_remove_one(s
+       edac_mc_free(mci);
+ }
+-static const struct pci_device_id e7xxx_pci_tbl[] __devinitdata = {
++static const struct pci_device_id e7xxx_pci_tbl[] __devinitconst = {
+       {
+        PCI_VEND_DEV(INTEL, 7205_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+        E7205},
+diff -urNp linux-3.1.3/drivers/edac/edac_pci_sysfs.c linux-3.1.3/drivers/edac/edac_pci_sysfs.c
+--- linux-3.1.3/drivers/edac/edac_pci_sysfs.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/edac_pci_sysfs.c  2011-11-16 18:39:07.000000000 -0500
 @@ -26,8 +26,8 @@ static int edac_pci_log_pe = 1;              /* log 
  static int edac_pci_log_npe = 1;      /* log PCI non-parity error errors */
  static int edac_pci_poll_msec = 1000; /* one second workq period */
@@ -24715,9 +26008,141 @@ diff -urNp linux-3.0.4/drivers/edac/edac_pci_sysfs.c linux-3.0.4/drivers/edac/ed
                        panic("EDAC: PCI Parity Error");
        }
  }
-diff -urNp linux-3.0.4/drivers/edac/mce_amd.h linux-3.0.4/drivers/edac/mce_amd.h
---- linux-3.0.4/drivers/edac/mce_amd.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/edac/mce_amd.h 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/edac/i3000_edac.c linux-3.1.3/drivers/edac/i3000_edac.c
+--- linux-3.1.3/drivers/edac/i3000_edac.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/i3000_edac.c      2011-11-16 18:39:07.000000000 -0500
+@@ -470,7 +470,7 @@ static void __devexit i3000_remove_one(s
+       edac_mc_free(mci);
+ }
+-static const struct pci_device_id i3000_pci_tbl[] __devinitdata = {
++static const struct pci_device_id i3000_pci_tbl[] __devinitconst = {
+       {
+        PCI_VEND_DEV(INTEL, 3000_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+        I3000},
+diff -urNp linux-3.1.3/drivers/edac/i3200_edac.c linux-3.1.3/drivers/edac/i3200_edac.c
+--- linux-3.1.3/drivers/edac/i3200_edac.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/i3200_edac.c      2011-11-16 18:39:07.000000000 -0500
+@@ -456,7 +456,7 @@ static void __devexit i3200_remove_one(s
+       edac_mc_free(mci);
+ }
+-static const struct pci_device_id i3200_pci_tbl[] __devinitdata = {
++static const struct pci_device_id i3200_pci_tbl[] __devinitconst = {
+       {
+               PCI_VEND_DEV(INTEL, 3200_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+               I3200},
+diff -urNp linux-3.1.3/drivers/edac/i5000_edac.c linux-3.1.3/drivers/edac/i5000_edac.c
+--- linux-3.1.3/drivers/edac/i5000_edac.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/i5000_edac.c      2011-11-16 18:39:07.000000000 -0500
+@@ -1516,7 +1516,7 @@ static void __devexit i5000_remove_one(s
+  *
+  *    The "E500P" device is the first device supported.
+  */
+-static const struct pci_device_id i5000_pci_tbl[] __devinitdata = {
++static const struct pci_device_id i5000_pci_tbl[] __devinitconst = {
+       {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I5000_DEV16),
+        .driver_data = I5000P},
+diff -urNp linux-3.1.3/drivers/edac/i5100_edac.c linux-3.1.3/drivers/edac/i5100_edac.c
+--- linux-3.1.3/drivers/edac/i5100_edac.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/i5100_edac.c      2011-11-16 18:39:07.000000000 -0500
+@@ -1051,7 +1051,7 @@ static void __devexit i5100_remove_one(s
+       edac_mc_free(mci);
+ }
+-static const struct pci_device_id i5100_pci_tbl[] __devinitdata = {
++static const struct pci_device_id i5100_pci_tbl[] __devinitconst = {
+       /* Device 16, Function 0, Channel 0 Memory Map, Error Flag/Mask, ... */
+       { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5100_16) },
+       { 0, }
+diff -urNp linux-3.1.3/drivers/edac/i5400_edac.c linux-3.1.3/drivers/edac/i5400_edac.c
+--- linux-3.1.3/drivers/edac/i5400_edac.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/i5400_edac.c      2011-11-16 18:39:07.000000000 -0500
+@@ -1383,7 +1383,7 @@ static void __devexit i5400_remove_one(s
+  *
+  *    The "E500P" device is the first device supported.
+  */
+-static const struct pci_device_id i5400_pci_tbl[] __devinitdata = {
++static const struct pci_device_id i5400_pci_tbl[] __devinitconst = {
+       {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5400_ERR)},
+       {0,}                    /* 0 terminated list. */
+ };
+diff -urNp linux-3.1.3/drivers/edac/i7300_edac.c linux-3.1.3/drivers/edac/i7300_edac.c
+--- linux-3.1.3/drivers/edac/i7300_edac.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/i7300_edac.c      2011-11-16 18:39:07.000000000 -0500
+@@ -1191,7 +1191,7 @@ static void __devexit i7300_remove_one(s
+  *
+  * Has only 8086:360c PCI ID
+  */
+-static const struct pci_device_id i7300_pci_tbl[] __devinitdata = {
++static const struct pci_device_id i7300_pci_tbl[] __devinitconst = {
+       {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_I7300_MCH_ERR)},
+       {0,}                    /* 0 terminated list. */
+ };
+diff -urNp linux-3.1.3/drivers/edac/i7core_edac.c linux-3.1.3/drivers/edac/i7core_edac.c
+--- linux-3.1.3/drivers/edac/i7core_edac.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/i7core_edac.c     2011-11-16 18:39:07.000000000 -0500
+@@ -359,7 +359,7 @@ static const struct pci_id_table pci_dev
+ /*
+  *    pci_device_id   table for which devices we are looking for
+  */
+-static const struct pci_device_id i7core_pci_tbl[] __devinitdata = {
++static const struct pci_device_id i7core_pci_tbl[] __devinitconst = {
+       {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_X58_HUB_MGMT)},
+       {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNNFIELD_QPI_LINK0)},
+       {0,}                    /* 0 terminated list. */
+diff -urNp linux-3.1.3/drivers/edac/i82443bxgx_edac.c linux-3.1.3/drivers/edac/i82443bxgx_edac.c
+--- linux-3.1.3/drivers/edac/i82443bxgx_edac.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/i82443bxgx_edac.c 2011-11-16 18:39:07.000000000 -0500
+@@ -380,7 +380,7 @@ static void __devexit i82443bxgx_edacmc_
+ EXPORT_SYMBOL_GPL(i82443bxgx_edacmc_remove_one);
+-static const struct pci_device_id i82443bxgx_pci_tbl[] __devinitdata = {
++static const struct pci_device_id i82443bxgx_pci_tbl[] __devinitconst = {
+       {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_0)},
+       {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_2)},
+       {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443GX_0)},
+diff -urNp linux-3.1.3/drivers/edac/i82860_edac.c linux-3.1.3/drivers/edac/i82860_edac.c
+--- linux-3.1.3/drivers/edac/i82860_edac.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/i82860_edac.c     2011-11-16 18:39:07.000000000 -0500
+@@ -270,7 +270,7 @@ static void __devexit i82860_remove_one(
+       edac_mc_free(mci);
+ }
+-static const struct pci_device_id i82860_pci_tbl[] __devinitdata = {
++static const struct pci_device_id i82860_pci_tbl[] __devinitconst = {
+       {
+        PCI_VEND_DEV(INTEL, 82860_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+        I82860},
+diff -urNp linux-3.1.3/drivers/edac/i82875p_edac.c linux-3.1.3/drivers/edac/i82875p_edac.c
+--- linux-3.1.3/drivers/edac/i82875p_edac.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/i82875p_edac.c    2011-11-16 18:39:07.000000000 -0500
+@@ -511,7 +511,7 @@ static void __devexit i82875p_remove_one
+       edac_mc_free(mci);
+ }
+-static const struct pci_device_id i82875p_pci_tbl[] __devinitdata = {
++static const struct pci_device_id i82875p_pci_tbl[] __devinitconst = {
+       {
+        PCI_VEND_DEV(INTEL, 82875_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+        I82875P},
+diff -urNp linux-3.1.3/drivers/edac/i82975x_edac.c linux-3.1.3/drivers/edac/i82975x_edac.c
+--- linux-3.1.3/drivers/edac/i82975x_edac.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/i82975x_edac.c    2011-11-16 18:39:07.000000000 -0500
+@@ -604,7 +604,7 @@ static void __devexit i82975x_remove_one
+       edac_mc_free(mci);
+ }
+-static const struct pci_device_id i82975x_pci_tbl[] __devinitdata = {
++static const struct pci_device_id i82975x_pci_tbl[] __devinitconst = {
+       {
+               PCI_VEND_DEV(INTEL, 82975_0), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+               I82975X
+diff -urNp linux-3.1.3/drivers/edac/mce_amd.h linux-3.1.3/drivers/edac/mce_amd.h
+--- linux-3.1.3/drivers/edac/mce_amd.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/mce_amd.h 2011-11-16 18:39:07.000000000 -0500
 @@ -83,7 +83,7 @@ struct amd_decoder_ops {
        bool (*dc_mce)(u16, u8);
        bool (*ic_mce)(u16, u8);
@@ -24727,9 +26152,33 @@ diff -urNp linux-3.0.4/drivers/edac/mce_amd.h linux-3.0.4/drivers/edac/mce_amd.h
  
  void amd_report_gart_errors(bool);
  void amd_register_ecc_decoder(void (*f)(int, struct mce *, u32));
-diff -urNp linux-3.0.4/drivers/firewire/core-card.c linux-3.0.4/drivers/firewire/core-card.c
---- linux-3.0.4/drivers/firewire/core-card.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/firewire/core-card.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/edac/r82600_edac.c linux-3.1.3/drivers/edac/r82600_edac.c
+--- linux-3.1.3/drivers/edac/r82600_edac.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/r82600_edac.c     2011-11-16 18:39:07.000000000 -0500
+@@ -373,7 +373,7 @@ static void __devexit r82600_remove_one(
+       edac_mc_free(mci);
+ }
+-static const struct pci_device_id r82600_pci_tbl[] __devinitdata = {
++static const struct pci_device_id r82600_pci_tbl[] __devinitconst = {
+       {
+        PCI_DEVICE(PCI_VENDOR_ID_RADISYS, R82600_BRIDGE_ID)
+        },
+diff -urNp linux-3.1.3/drivers/edac/x38_edac.c linux-3.1.3/drivers/edac/x38_edac.c
+--- linux-3.1.3/drivers/edac/x38_edac.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/edac/x38_edac.c        2011-11-16 18:39:07.000000000 -0500
+@@ -440,7 +440,7 @@ static void __devexit x38_remove_one(str
+       edac_mc_free(mci);
+ }
+-static const struct pci_device_id x38_pci_tbl[] __devinitdata = {
++static const struct pci_device_id x38_pci_tbl[] __devinitconst = {
+       {
+        PCI_VEND_DEV(INTEL, X38_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+        X38},
+diff -urNp linux-3.1.3/drivers/firewire/core-card.c linux-3.1.3/drivers/firewire/core-card.c
+--- linux-3.1.3/drivers/firewire/core-card.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/firewire/core-card.c   2011-11-16 18:39:07.000000000 -0500
 @@ -657,7 +657,7 @@ void fw_card_release(struct kref *kref)
  
  void fw_core_remove_card(struct fw_card *card)
@@ -24739,10 +26188,10 @@ diff -urNp linux-3.0.4/drivers/firewire/core-card.c linux-3.0.4/drivers/firewire
  
        card->driver->update_phy_reg(card, 4,
                                     PHY_LINK_ACTIVE | PHY_CONTENDER, 0);
-diff -urNp linux-3.0.4/drivers/firewire/core-cdev.c linux-3.0.4/drivers/firewire/core-cdev.c
---- linux-3.0.4/drivers/firewire/core-cdev.c   2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/firewire/core-cdev.c   2011-08-23 21:47:55.000000000 -0400
-@@ -1313,8 +1313,7 @@ static int init_iso_resource(struct clie
+diff -urNp linux-3.1.3/drivers/firewire/core-cdev.c linux-3.1.3/drivers/firewire/core-cdev.c
+--- linux-3.1.3/drivers/firewire/core-cdev.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/firewire/core-cdev.c   2011-11-16 18:39:07.000000000 -0500
+@@ -1331,8 +1331,7 @@ static int init_iso_resource(struct clie
        int ret;
  
        if ((request->channels == 0 && request->bandwidth == 0) ||
@@ -24752,9 +26201,9 @@ diff -urNp linux-3.0.4/drivers/firewire/core-cdev.c linux-3.0.4/drivers/firewire
                return -EINVAL;
  
        r  = kmalloc(sizeof(*r), GFP_KERNEL);
-diff -urNp linux-3.0.4/drivers/firewire/core.h linux-3.0.4/drivers/firewire/core.h
---- linux-3.0.4/drivers/firewire/core.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/firewire/core.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/firewire/core.h linux-3.1.3/drivers/firewire/core.h
+--- linux-3.1.3/drivers/firewire/core.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/firewire/core.h        2011-11-16 18:39:07.000000000 -0500
 @@ -101,6 +101,7 @@ struct fw_card_driver {
  
        int (*stop_iso)(struct fw_iso_context *ctx);
@@ -24763,9 +26212,9 @@ diff -urNp linux-3.0.4/drivers/firewire/core.h linux-3.0.4/drivers/firewire/core
  
  void fw_card_initialize(struct fw_card *card,
                const struct fw_card_driver *driver, struct device *device);
-diff -urNp linux-3.0.4/drivers/firewire/core-transaction.c linux-3.0.4/drivers/firewire/core-transaction.c
---- linux-3.0.4/drivers/firewire/core-transaction.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/firewire/core-transaction.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/firewire/core-transaction.c linux-3.1.3/drivers/firewire/core-transaction.c
+--- linux-3.1.3/drivers/firewire/core-transaction.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/firewire/core-transaction.c    2011-11-16 18:40:10.000000000 -0500
 @@ -37,6 +37,7 @@
  #include <linux/timer.h>
  #include <linux/types.h>
@@ -24783,9 +26232,9 @@ diff -urNp linux-3.0.4/drivers/firewire/core-transaction.c linux-3.0.4/drivers/f
        init_timer_on_stack(&t.split_timeout_timer);
        init_completion(&d.done);
        d.payload = payload;
-diff -urNp linux-3.0.4/drivers/firmware/dmi_scan.c linux-3.0.4/drivers/firmware/dmi_scan.c
---- linux-3.0.4/drivers/firmware/dmi_scan.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/firmware/dmi_scan.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/firmware/dmi_scan.c linux-3.1.3/drivers/firmware/dmi_scan.c
+--- linux-3.1.3/drivers/firmware/dmi_scan.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/firmware/dmi_scan.c    2011-11-16 18:39:07.000000000 -0500
 @@ -449,11 +449,6 @@ void __init dmi_scan_machine(void)
                }
        }
@@ -24798,9 +26247,18 @@ diff -urNp linux-3.0.4/drivers/firmware/dmi_scan.c linux-3.0.4/drivers/firmware/
                p = dmi_ioremap(0xF0000, 0x10000);
                if (p == NULL)
                        goto error;
-diff -urNp linux-3.0.4/drivers/gpio/vr41xx_giu.c linux-3.0.4/drivers/gpio/vr41xx_giu.c
---- linux-3.0.4/drivers/gpio/vr41xx_giu.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpio/vr41xx_giu.c      2011-08-23 21:47:55.000000000 -0400
+@@ -725,7 +720,7 @@ int dmi_walk(void (*decode)(const struct
+       if (buf == NULL)
+               return -1;
+-      dmi_table(buf, dmi_len, dmi_num, decode, private_data);
++      dmi_table((char __force_kernel *)buf, dmi_len, dmi_num, decode, private_data);
+       iounmap(buf);
+       return 0;
+diff -urNp linux-3.1.3/drivers/gpio/gpio-vr41xx.c linux-3.1.3/drivers/gpio/gpio-vr41xx.c
+--- linux-3.1.3/drivers/gpio/gpio-vr41xx.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpio/gpio-vr41xx.c     2011-11-16 18:39:07.000000000 -0500
 @@ -204,7 +204,7 @@ static int giu_get_irq(unsigned int irq)
        printk(KERN_ERR "spurious GIU interrupt: %04x(%04x),%04x(%04x)\n",
               maskl, pendl, maskh, pendh);
@@ -24810,9 +26268,104 @@ diff -urNp linux-3.0.4/drivers/gpio/vr41xx_giu.c linux-3.0.4/drivers/gpio/vr41xx
  
        return -EINVAL;
  }
-diff -urNp linux-3.0.4/drivers/gpu/drm/drm_crtc_helper.c linux-3.0.4/drivers/gpu/drm/drm_crtc_helper.c
---- linux-3.0.4/drivers/gpu/drm/drm_crtc_helper.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/drm_crtc_helper.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/drm_crtc.c linux-3.1.3/drivers/gpu/drm/drm_crtc.c
+--- linux-3.1.3/drivers/gpu/drm/drm_crtc.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/drm_crtc.c     2011-11-16 18:39:07.000000000 -0500
+@@ -1374,7 +1374,7 @@ int drm_mode_getconnector(struct drm_dev
+        */
+       if ((out_resp->count_modes >= mode_count) && mode_count) {
+               copied = 0;
+-              mode_ptr = (struct drm_mode_modeinfo *)(unsigned long)out_resp->modes_ptr;
++              mode_ptr = (struct drm_mode_modeinfo __user *)(unsigned long)out_resp->modes_ptr;
+               list_for_each_entry(mode, &connector->modes, head) {
+                       drm_crtc_convert_to_umode(&u_mode, mode);
+                       if (copy_to_user(mode_ptr + copied,
+@@ -1389,8 +1389,8 @@ int drm_mode_getconnector(struct drm_dev
+       if ((out_resp->count_props >= props_count) && props_count) {
+               copied = 0;
+-              prop_ptr = (uint32_t *)(unsigned long)(out_resp->props_ptr);
+-              prop_values = (uint64_t *)(unsigned long)(out_resp->prop_values_ptr);
++              prop_ptr = (uint32_t __user *)(unsigned long)(out_resp->props_ptr);
++              prop_values = (uint64_t __user *)(unsigned long)(out_resp->prop_values_ptr);
+               for (i = 0; i < DRM_CONNECTOR_MAX_PROPERTY; i++) {
+                       if (connector->property_ids[i] != 0) {
+                               if (put_user(connector->property_ids[i],
+@@ -1412,7 +1412,7 @@ int drm_mode_getconnector(struct drm_dev
+       if ((out_resp->count_encoders >= encoders_count) && encoders_count) {
+               copied = 0;
+-              encoder_ptr = (uint32_t *)(unsigned long)(out_resp->encoders_ptr);
++              encoder_ptr = (uint32_t __user *)(unsigned long)(out_resp->encoders_ptr);
+               for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) {
+                       if (connector->encoder_ids[i] != 0) {
+                               if (put_user(connector->encoder_ids[i],
+@@ -1571,7 +1571,7 @@ int drm_mode_setcrtc(struct drm_device *
+               }
+               for (i = 0; i < crtc_req->count_connectors; i++) {
+-                      set_connectors_ptr = (uint32_t *)(unsigned long)crtc_req->set_connectors_ptr;
++                      set_connectors_ptr = (uint32_t __user *)(unsigned long)crtc_req->set_connectors_ptr;
+                       if (get_user(out_id, &set_connectors_ptr[i])) {
+                               ret = -EFAULT;
+                               goto out;
+@@ -1852,7 +1852,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_de
+       fb = obj_to_fb(obj);
+       num_clips = r->num_clips;
+-      clips_ptr = (struct drm_clip_rect *)(unsigned long)r->clips_ptr;
++      clips_ptr = (struct drm_clip_rect __user *)(unsigned long)r->clips_ptr;
+       if (!num_clips != !clips_ptr) {
+               ret = -EINVAL;
+@@ -2272,7 +2272,7 @@ int drm_mode_getproperty_ioctl(struct dr
+       out_resp->flags = property->flags;
+       if ((out_resp->count_values >= value_count) && value_count) {
+-              values_ptr = (uint64_t *)(unsigned long)out_resp->values_ptr;
++              values_ptr = (uint64_t __user *)(unsigned long)out_resp->values_ptr;
+               for (i = 0; i < value_count; i++) {
+                       if (copy_to_user(values_ptr + i, &property->values[i], sizeof(uint64_t))) {
+                               ret = -EFAULT;
+@@ -2285,7 +2285,7 @@ int drm_mode_getproperty_ioctl(struct dr
+       if (property->flags & DRM_MODE_PROP_ENUM) {
+               if ((out_resp->count_enum_blobs >= enum_count) && enum_count) {
+                       copied = 0;
+-                      enum_ptr = (struct drm_mode_property_enum *)(unsigned long)out_resp->enum_blob_ptr;
++                      enum_ptr = (struct drm_mode_property_enum __user *)(unsigned long)out_resp->enum_blob_ptr;
+                       list_for_each_entry(prop_enum, &property->enum_blob_list, head) {
+                               if (copy_to_user(&enum_ptr[copied].value, &prop_enum->value, sizeof(uint64_t))) {
+@@ -2308,7 +2308,7 @@ int drm_mode_getproperty_ioctl(struct dr
+               if ((out_resp->count_enum_blobs >= blob_count) && blob_count) {
+                       copied = 0;
+                       blob_id_ptr = (uint32_t *)(unsigned long)out_resp->enum_blob_ptr;
+-                      blob_length_ptr = (uint32_t *)(unsigned long)out_resp->values_ptr;
++                      blob_length_ptr = (uint32_t __user *)(unsigned long)out_resp->values_ptr;
+                       list_for_each_entry(prop_blob, &property->enum_blob_list, head) {
+                               if (put_user(prop_blob->base.id, blob_id_ptr + copied)) {
+@@ -2369,7 +2369,7 @@ int drm_mode_getblob_ioctl(struct drm_de
+       struct drm_mode_get_blob *out_resp = data;
+       struct drm_property_blob *blob;
+       int ret = 0;
+-      void *blob_ptr;
++      void __user *blob_ptr;
+       if (!drm_core_check_feature(dev, DRIVER_MODESET))
+               return -EINVAL;
+@@ -2383,7 +2383,7 @@ int drm_mode_getblob_ioctl(struct drm_de
+       blob = obj_to_blob(obj);
+       if (out_resp->length == blob->length) {
+-              blob_ptr = (void *)(unsigned long)out_resp->data;
++              blob_ptr = (void __user *)(unsigned long)out_resp->data;
+               if (copy_to_user(blob_ptr, blob->data, blob->length)){
+                       ret = -EFAULT;
+                       goto done;
+diff -urNp linux-3.1.3/drivers/gpu/drm/drm_crtc_helper.c linux-3.1.3/drivers/gpu/drm/drm_crtc_helper.c
+--- linux-3.1.3/drivers/gpu/drm/drm_crtc_helper.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/drm_crtc_helper.c      2011-11-16 18:40:10.000000000 -0500
 @@ -276,7 +276,7 @@ static bool drm_encoder_crtc_ok(struct d
        struct drm_crtc *tmp;
        int crtc_mask = 1;
@@ -24831,9 +26384,18 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/drm_crtc_helper.c linux-3.0.4/drivers/gpu
        crtc->enabled = drm_helper_crtc_in_use(crtc);
        if (!crtc->enabled)
                return true;
-diff -urNp linux-3.0.4/drivers/gpu/drm/drm_drv.c linux-3.0.4/drivers/gpu/drm/drm_drv.c
---- linux-3.0.4/drivers/gpu/drm/drm_drv.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/drm_drv.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/drm_drv.c linux-3.1.3/drivers/gpu/drm/drm_drv.c
+--- linux-3.1.3/drivers/gpu/drm/drm_drv.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/drm_drv.c      2011-11-16 18:39:07.000000000 -0500
+@@ -307,7 +307,7 @@ module_exit(drm_core_exit);
+ /**
+  * Copy and IOCTL return string to user space
+  */
+-static int drm_copy_field(char *buf, size_t *buf_len, const char *value)
++static int drm_copy_field(char __user *buf, size_t *buf_len, const char *value)
+ {
+       int len;
 @@ -386,7 +386,7 @@ long drm_ioctl(struct file *filp,
  
        dev = file_priv->minor->dev;
@@ -24843,9 +26405,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/drm_drv.c linux-3.0.4/drivers/gpu/drm/drm
        ++file_priv->ioctl_count;
  
        DRM_DEBUG("pid=%d, cmd=0x%02x, nr=0x%02x, dev 0x%lx, auth=%d\n",
-diff -urNp linux-3.0.4/drivers/gpu/drm/drm_fops.c linux-3.0.4/drivers/gpu/drm/drm_fops.c
---- linux-3.0.4/drivers/gpu/drm/drm_fops.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/drm_fops.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/drm_fops.c linux-3.1.3/drivers/gpu/drm/drm_fops.c
+--- linux-3.1.3/drivers/gpu/drm/drm_fops.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/drm_fops.c     2011-11-16 18:39:07.000000000 -0500
 @@ -70,7 +70,7 @@ static int drm_setup(struct drm_device *
        }
  
@@ -24895,9 +26457,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/drm_fops.c linux-3.0.4/drivers/gpu/drm/dr
                if (atomic_read(&dev->ioctl_count)) {
                        DRM_ERROR("Device busy: %d\n",
                                  atomic_read(&dev->ioctl_count));
-diff -urNp linux-3.0.4/drivers/gpu/drm/drm_global.c linux-3.0.4/drivers/gpu/drm/drm_global.c
---- linux-3.0.4/drivers/gpu/drm/drm_global.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/drm_global.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/drm_global.c linux-3.1.3/drivers/gpu/drm/drm_global.c
+--- linux-3.1.3/drivers/gpu/drm/drm_global.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/drm_global.c   2011-11-16 18:39:07.000000000 -0500
 @@ -36,7 +36,7 @@
  struct drm_global_item {
        struct mutex mutex;
@@ -24955,9 +26517,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/drm_global.c linux-3.0.4/drivers/gpu/drm/
                ref->release(ref);
                item->object = NULL;
        }
-diff -urNp linux-3.0.4/drivers/gpu/drm/drm_info.c linux-3.0.4/drivers/gpu/drm/drm_info.c
---- linux-3.0.4/drivers/gpu/drm/drm_info.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/drm_info.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/drm_info.c linux-3.1.3/drivers/gpu/drm/drm_info.c
+--- linux-3.1.3/drivers/gpu/drm/drm_info.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/drm_info.c     2011-11-16 18:40:10.000000000 -0500
 @@ -75,10 +75,14 @@ int drm_vm_info(struct seq_file *m, void
        struct drm_local_map *map;
        struct drm_map_list *r_list;
@@ -24998,9 +26560,30 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/drm_info.c linux-3.0.4/drivers/gpu/drm/dr
  
  #if defined(__i386__)
                pgprot = pgprot_val(vma->vm_page_prot);
-diff -urNp linux-3.0.4/drivers/gpu/drm/drm_ioctl.c linux-3.0.4/drivers/gpu/drm/drm_ioctl.c
---- linux-3.0.4/drivers/gpu/drm/drm_ioctl.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/drm_ioctl.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/drm_ioc32.c linux-3.1.3/drivers/gpu/drm/drm_ioc32.c
+--- linux-3.1.3/drivers/gpu/drm/drm_ioc32.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/drm_ioc32.c    2011-11-16 18:39:07.000000000 -0500
+@@ -455,7 +455,7 @@ static int compat_drm_infobufs(struct fi
+       request = compat_alloc_user_space(nbytes);
+       if (!access_ok(VERIFY_WRITE, request, nbytes))
+               return -EFAULT;
+-      list = (struct drm_buf_desc *) (request + 1);
++      list = (struct drm_buf_desc __user *) (request + 1);
+       if (__put_user(count, &request->count)
+           || __put_user(list, &request->list))
+@@ -516,7 +516,7 @@ static int compat_drm_mapbufs(struct fil
+       request = compat_alloc_user_space(nbytes);
+       if (!access_ok(VERIFY_WRITE, request, nbytes))
+               return -EFAULT;
+-      list = (struct drm_buf_pub *) (request + 1);
++      list = (struct drm_buf_pub __user *) (request + 1);
+       if (__put_user(count, &request->count)
+           || __put_user(list, &request->list))
+diff -urNp linux-3.1.3/drivers/gpu/drm/drm_ioctl.c linux-3.1.3/drivers/gpu/drm/drm_ioctl.c
+--- linux-3.1.3/drivers/gpu/drm/drm_ioctl.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/drm_ioctl.c    2011-11-16 18:39:07.000000000 -0500
 @@ -256,7 +256,7 @@ int drm_getstats(struct drm_device *dev,
                        stats->data[i].value =
                            (file_priv->master->lock.hw_lock ? file_priv->master->lock.hw_lock->lock : 0);
@@ -25010,9 +26593,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/drm_ioctl.c linux-3.0.4/drivers/gpu/drm/d
                stats->data[i].type = dev->types[i];
        }
  
-diff -urNp linux-3.0.4/drivers/gpu/drm/drm_lock.c linux-3.0.4/drivers/gpu/drm/drm_lock.c
---- linux-3.0.4/drivers/gpu/drm/drm_lock.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/drm_lock.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/drm_lock.c linux-3.1.3/drivers/gpu/drm/drm_lock.c
+--- linux-3.1.3/drivers/gpu/drm/drm_lock.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/drm_lock.c     2011-11-16 18:39:07.000000000 -0500
 @@ -89,7 +89,7 @@ int drm_lock(struct drm_device *dev, voi
                if (drm_lock_take(&master->lock, lock->context)) {
                        master->lock.file_priv = file_priv;
@@ -25031,9 +26614,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/drm_lock.c linux-3.0.4/drivers/gpu/drm/dr
  
        if (drm_lock_free(&master->lock, lock->context)) {
                /* FIXME: Should really bail out here. */
-diff -urNp linux-3.0.4/drivers/gpu/drm/i810/i810_dma.c linux-3.0.4/drivers/gpu/drm/i810/i810_dma.c
---- linux-3.0.4/drivers/gpu/drm/i810/i810_dma.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/i810/i810_dma.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/i810/i810_dma.c linux-3.1.3/drivers/gpu/drm/i810/i810_dma.c
+--- linux-3.1.3/drivers/gpu/drm/i810/i810_dma.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/i810/i810_dma.c        2011-11-16 18:39:07.000000000 -0500
 @@ -950,8 +950,8 @@ static int i810_dma_vertex(struct drm_de
                                 dma->buflist[vertex->idx],
                                 vertex->discard, vertex->used);
@@ -25056,9 +26639,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i810/i810_dma.c linux-3.0.4/drivers/gpu/d
        sarea_priv->last_enqueue = dev_priv->counter - 1;
        sarea_priv->last_dispatch = (int)hw_status[5];
  
-diff -urNp linux-3.0.4/drivers/gpu/drm/i810/i810_drv.h linux-3.0.4/drivers/gpu/drm/i810/i810_drv.h
---- linux-3.0.4/drivers/gpu/drm/i810/i810_drv.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/i810/i810_drv.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/i810/i810_drv.h linux-3.1.3/drivers/gpu/drm/i810/i810_drv.h
+--- linux-3.1.3/drivers/gpu/drm/i810/i810_drv.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/i810/i810_drv.h        2011-11-16 18:39:07.000000000 -0500
 @@ -108,8 +108,8 @@ typedef struct drm_i810_private {
        int page_flipping;
  
@@ -25070,9 +26653,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i810/i810_drv.h linux-3.0.4/drivers/gpu/d
  
        int front_offset;
  } drm_i810_private_t;
-diff -urNp linux-3.0.4/drivers/gpu/drm/i915/i915_debugfs.c linux-3.0.4/drivers/gpu/drm/i915/i915_debugfs.c
---- linux-3.0.4/drivers/gpu/drm/i915/i915_debugfs.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/i915/i915_debugfs.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_debugfs.c linux-3.1.3/drivers/gpu/drm/i915/i915_debugfs.c
+--- linux-3.1.3/drivers/gpu/drm/i915/i915_debugfs.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/i915/i915_debugfs.c    2011-11-16 18:39:07.000000000 -0500
 @@ -497,7 +497,7 @@ static int i915_interrupt_info(struct se
                           I915_READ(GTIMR));
        }
@@ -25080,12 +26663,21 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i915/i915_debugfs.c linux-3.0.4/drivers/g
 -                 atomic_read(&dev_priv->irq_received));
 +                 atomic_read_unchecked(&dev_priv->irq_received));
        for (i = 0; i < I915_NUM_RINGS; i++) {
-               if (IS_GEN6(dev)) {
+               if (IS_GEN6(dev) || IS_GEN7(dev)) {
                        seq_printf(m, "Graphics Interrupt mask (%s):    %08x\n",
-diff -urNp linux-3.0.4/drivers/gpu/drm/i915/i915_dma.c linux-3.0.4/drivers/gpu/drm/i915/i915_dma.c
---- linux-3.0.4/drivers/gpu/drm/i915/i915_dma.c        2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/i915/i915_dma.c        2011-08-23 21:47:55.000000000 -0400
-@@ -1169,7 +1169,7 @@ static bool i915_switcheroo_can_switch(s
+@@ -1185,7 +1185,7 @@ static int i915_opregion(struct seq_file
+               return ret;
+       if (opregion->header)
+-              seq_write(m, opregion->header, OPREGION_SIZE);
++              seq_write(m, (const void __force_kernel *)opregion->header, OPREGION_SIZE);
+       mutex_unlock(&dev->struct_mutex);
+diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_dma.c linux-3.1.3/drivers/gpu/drm/i915/i915_dma.c
+--- linux-3.1.3/drivers/gpu/drm/i915/i915_dma.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/i915/i915_dma.c        2011-11-16 18:39:07.000000000 -0500
+@@ -1171,7 +1171,7 @@ static bool i915_switcheroo_can_switch(s
        bool can_switch;
  
        spin_lock(&dev->count_lock);
@@ -25094,10 +26686,10 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i915/i915_dma.c linux-3.0.4/drivers/gpu/d
        spin_unlock(&dev->count_lock);
        return can_switch;
  }
-diff -urNp linux-3.0.4/drivers/gpu/drm/i915/i915_drv.h linux-3.0.4/drivers/gpu/drm/i915/i915_drv.h
---- linux-3.0.4/drivers/gpu/drm/i915/i915_drv.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/i915/i915_drv.h        2011-08-23 21:47:55.000000000 -0400
-@@ -219,7 +219,7 @@ struct drm_i915_display_funcs {
+diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_drv.h linux-3.1.3/drivers/gpu/drm/i915/i915_drv.h
+--- linux-3.1.3/drivers/gpu/drm/i915/i915_drv.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/i915/i915_drv.h        2011-11-16 18:39:07.000000000 -0500
+@@ -222,7 +222,7 @@ struct drm_i915_display_funcs {
        /* render clock increase/decrease */
        /* display clock increase/decrease */
        /* pll clock increase/decrease */
@@ -25106,7 +26698,7 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i915/i915_drv.h linux-3.0.4/drivers/gpu/d
  
  struct intel_device_info {
        u8 gen;
-@@ -300,7 +300,7 @@ typedef struct drm_i915_private {
+@@ -305,7 +305,7 @@ typedef struct drm_i915_private {
        int current_page;
        int page_flipping;
  
@@ -25115,7 +26707,7 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i915/i915_drv.h linux-3.0.4/drivers/gpu/d
  
        /* protects the irq masks */
        spinlock_t irq_lock;
-@@ -874,7 +874,7 @@ struct drm_i915_gem_object {
+@@ -882,7 +882,7 @@ struct drm_i915_gem_object {
         * will be page flipped away on the next vblank.  When it
         * reaches 0, dev_priv->pending_flip_queue will be woken up.
         */
@@ -25124,7 +26716,7 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i915/i915_drv.h linux-3.0.4/drivers/gpu/d
  };
  
  #define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base)
-@@ -1247,7 +1247,7 @@ extern int intel_setup_gmbus(struct drm_
+@@ -1262,7 +1262,7 @@ extern int intel_setup_gmbus(struct drm_
  extern void intel_teardown_gmbus(struct drm_device *dev);
  extern void intel_gmbus_set_speed(struct i2c_adapter *adapter, int speed);
  extern void intel_gmbus_force_bit(struct i2c_adapter *adapter, bool force_bit);
@@ -25133,9 +26725,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i915/i915_drv.h linux-3.0.4/drivers/gpu/d
  {
        return container_of(adapter, struct intel_gmbus, adapter)->force_bit;
  }
-diff -urNp linux-3.0.4/drivers/gpu/drm/i915/i915_gem_execbuffer.c linux-3.0.4/drivers/gpu/drm/i915/i915_gem_execbuffer.c
---- linux-3.0.4/drivers/gpu/drm/i915/i915_gem_execbuffer.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/i915/i915_gem_execbuffer.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_gem_execbuffer.c linux-3.1.3/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+--- linux-3.1.3/drivers/gpu/drm/i915/i915_gem_execbuffer.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/i915/i915_gem_execbuffer.c     2011-11-16 18:39:07.000000000 -0500
 @@ -188,7 +188,7 @@ i915_gem_object_set_to_gpu_domain(struct
                i915_gem_clflush_object(obj);
  
@@ -25145,10 +26737,10 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i915/i915_gem_execbuffer.c linux-3.0.4/dr
  
        /* The actual obj->write_domain will be updated with
         * pending_write_domain after we emit the accumulated flush for all
-diff -urNp linux-3.0.4/drivers/gpu/drm/i915/i915_irq.c linux-3.0.4/drivers/gpu/drm/i915/i915_irq.c
---- linux-3.0.4/drivers/gpu/drm/i915/i915_irq.c        2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/i915/i915_irq.c        2011-08-23 21:47:55.000000000 -0400
-@@ -473,7 +473,7 @@ static irqreturn_t ivybridge_irq_handler
+diff -urNp linux-3.1.3/drivers/gpu/drm/i915/i915_irq.c linux-3.1.3/drivers/gpu/drm/i915/i915_irq.c
+--- linux-3.1.3/drivers/gpu/drm/i915/i915_irq.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/i915/i915_irq.c        2011-11-16 18:39:07.000000000 -0500
+@@ -475,7 +475,7 @@ static irqreturn_t ivybridge_irq_handler
        u32 de_iir, gt_iir, de_ier, pch_iir, pm_iir;
        struct drm_i915_master_private *master_priv;
  
@@ -25157,7 +26749,7 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i915/i915_irq.c linux-3.0.4/drivers/gpu/d
  
        /* disable master interrupt before clearing iir  */
        de_ier = I915_READ(DEIER);
-@@ -563,7 +563,7 @@ static irqreturn_t ironlake_irq_handler(
+@@ -565,7 +565,7 @@ static irqreturn_t ironlake_irq_handler(
        struct drm_i915_master_private *master_priv;
        u32 bsd_usr_interrupt = GT_BSD_USER_INTERRUPT;
  
@@ -25166,7 +26758,7 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i915/i915_irq.c linux-3.0.4/drivers/gpu/d
  
        if (IS_GEN6(dev))
                bsd_usr_interrupt = GT_GEN6_BSD_USER_INTERRUPT;
-@@ -1226,7 +1226,7 @@ static irqreturn_t i915_driver_irq_handl
+@@ -1228,7 +1228,7 @@ static irqreturn_t i915_driver_irq_handl
        int ret = IRQ_NONE, pipe;
        bool blc_event = false;
  
@@ -25175,7 +26767,7 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i915/i915_irq.c linux-3.0.4/drivers/gpu/d
  
        iir = I915_READ(IIR);
  
-@@ -1735,7 +1735,7 @@ static void ironlake_irq_preinstall(stru
+@@ -1740,7 +1740,7 @@ static void ironlake_irq_preinstall(stru
  {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
  
@@ -25184,7 +26776,7 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i915/i915_irq.c linux-3.0.4/drivers/gpu/d
  
        INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func);
        INIT_WORK(&dev_priv->error_work, i915_error_work_func);
-@@ -1899,7 +1899,7 @@ static void i915_driver_irq_preinstall(s
+@@ -1904,7 +1904,7 @@ static void i915_driver_irq_preinstall(s
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        int pipe;
  
@@ -25193,10 +26785,10 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i915/i915_irq.c linux-3.0.4/drivers/gpu/d
  
        INIT_WORK(&dev_priv->hotplug_work, i915_hotplug_work_func);
        INIT_WORK(&dev_priv->error_work, i915_error_work_func);
-diff -urNp linux-3.0.4/drivers/gpu/drm/i915/intel_display.c linux-3.0.4/drivers/gpu/drm/i915/intel_display.c
---- linux-3.0.4/drivers/gpu/drm/i915/intel_display.c   2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/i915/intel_display.c   2011-08-23 21:47:55.000000000 -0400
-@@ -1961,7 +1961,7 @@ intel_pipe_set_base(struct drm_crtc *crt
+diff -urNp linux-3.1.3/drivers/gpu/drm/i915/intel_display.c linux-3.1.3/drivers/gpu/drm/i915/intel_display.c
+--- linux-3.1.3/drivers/gpu/drm/i915/intel_display.c   2011-11-26 19:57:29.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/i915/intel_display.c   2011-11-26 20:00:43.000000000 -0500
+@@ -2205,7 +2205,7 @@ intel_pipe_set_base(struct drm_crtc *crt
  
                wait_event(dev_priv->pending_flip_queue,
                           atomic_read(&dev_priv->mm.wedged) ||
@@ -25205,7 +26797,7 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i915/intel_display.c linux-3.0.4/drivers/
  
                /* Big Hammer, we also need to ensure that any pending
                 * MI_WAIT_FOR_EVENT inside a user batch buffer on the
-@@ -2548,7 +2548,7 @@ static void intel_crtc_wait_for_pending_
+@@ -2826,7 +2826,7 @@ static void intel_crtc_wait_for_pending_
        obj = to_intel_framebuffer(crtc->fb)->obj;
        dev_priv = crtc->dev->dev_private;
        wait_event(dev_priv->pending_flip_queue,
@@ -25214,7 +26806,7 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i915/intel_display.c linux-3.0.4/drivers/
  }
  
  static bool intel_crtc_driving_pch(struct drm_crtc *crtc)
-@@ -6225,7 +6225,7 @@ static void do_intel_finish_page_flip(st
+@@ -6676,7 +6676,7 @@ static void do_intel_finish_page_flip(st
  
        atomic_clear_mask(1 << intel_crtc->plane,
                          &obj->pending_flip.counter);
@@ -25223,7 +26815,7 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i915/intel_display.c linux-3.0.4/drivers/
                wake_up(&dev_priv->pending_flip_queue);
  
        schedule_work(&work->work);
-@@ -6514,7 +6514,7 @@ static int intel_crtc_page_flip(struct d
+@@ -6965,7 +6965,7 @@ static int intel_crtc_page_flip(struct d
        /* Block clients from rendering to the new back buffer until
         * the flip occurs and the object is no longer visible.
         */
@@ -25232,7 +26824,7 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i915/intel_display.c linux-3.0.4/drivers/
  
        ret = dev_priv->display.queue_flip(dev, crtc, fb, obj);
        if (ret)
-@@ -6527,7 +6527,7 @@ static int intel_crtc_page_flip(struct d
+@@ -6979,7 +6979,7 @@ static int intel_crtc_page_flip(struct d
        return 0;
  
  cleanup_pending:
@@ -25241,9 +26833,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/i915/intel_display.c linux-3.0.4/drivers/
  cleanup_objs:
        drm_gem_object_unreference(&work->old_fb_obj->base);
        drm_gem_object_unreference(&obj->base);
-diff -urNp linux-3.0.4/drivers/gpu/drm/mga/mga_drv.h linux-3.0.4/drivers/gpu/drm/mga/mga_drv.h
---- linux-3.0.4/drivers/gpu/drm/mga/mga_drv.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/mga/mga_drv.h  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/mga/mga_drv.h linux-3.1.3/drivers/gpu/drm/mga/mga_drv.h
+--- linux-3.1.3/drivers/gpu/drm/mga/mga_drv.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/mga/mga_drv.h  2011-11-16 18:39:07.000000000 -0500
 @@ -120,9 +120,9 @@ typedef struct drm_mga_private {
        u32 clear_cmd;
        u32 maccess;
@@ -25256,9 +26848,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/mga/mga_drv.h linux-3.0.4/drivers/gpu/drm
        u32 next_fence_to_post;
  
        unsigned int fb_cpp;
-diff -urNp linux-3.0.4/drivers/gpu/drm/mga/mga_irq.c linux-3.0.4/drivers/gpu/drm/mga/mga_irq.c
---- linux-3.0.4/drivers/gpu/drm/mga/mga_irq.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/mga/mga_irq.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/mga/mga_irq.c linux-3.1.3/drivers/gpu/drm/mga/mga_irq.c
+--- linux-3.1.3/drivers/gpu/drm/mga/mga_irq.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/mga/mga_irq.c  2011-11-16 18:39:07.000000000 -0500
 @@ -44,7 +44,7 @@ u32 mga_get_vblank_counter(struct drm_de
        if (crtc != 0)
                return 0;
@@ -25295,10 +26887,10 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/mga/mga_irq.c linux-3.0.4/drivers/gpu/drm
                      - *sequence) <= (1 << 23)));
  
        *sequence = cur_fence;
-diff -urNp linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_bios.c linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_bios.c
---- linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_bios.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_bios.c 2011-08-26 19:49:56.000000000 -0400
-@@ -200,7 +200,7 @@ struct methods {
+diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_bios.c linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_bios.c
+--- linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_bios.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_bios.c 2011-11-16 18:39:07.000000000 -0500
+@@ -201,7 +201,7 @@ struct methods {
        const char desc[8];
        void (*loadbios)(struct drm_device *, uint8_t *);
        const bool rw;
@@ -25307,7 +26899,7 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_bios.c linux-3.0.4/driver
  
  static struct methods shadow_methods[] = {
        { "PRAMIN", load_vbios_pramin, true },
-@@ -5488,7 +5488,7 @@ parse_bit_displayport_tbl_entry(struct d
+@@ -5489,7 +5489,7 @@ parse_bit_displayport_tbl_entry(struct d
  struct bit_table {
        const char id;
        int (* const parse_fn)(struct drm_device *, struct nvbios *, struct bit_entry *);
@@ -25316,19 +26908,19 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_bios.c linux-3.0.4/driver
  
  #define BIT_TABLE(id, funcid) ((struct bit_table){ id, parse_bit_##funcid##_tbl_entry })
  
-diff -urNp linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_drv.h linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_drv.h
---- linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_drv.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_drv.h  2011-08-23 21:47:55.000000000 -0400
-@@ -227,7 +227,7 @@ struct nouveau_channel {
+diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_drv.h
+--- linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_drv.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_drv.h  2011-11-16 18:39:07.000000000 -0500
+@@ -238,7 +238,7 @@ struct nouveau_channel {
                struct list_head pending;
                uint32_t sequence;
                uint32_t sequence_ack;
 -              atomic_t last_sequence_irq;
 +              atomic_unchecked_t last_sequence_irq;
+               struct nouveau_vma vma;
        } fence;
  
-       /* DMA push buffer */
-@@ -304,7 +304,7 @@ struct nouveau_exec_engine {
+@@ -319,7 +319,7 @@ struct nouveau_exec_engine {
                           u32 handle, u16 class);
        void (*set_tile_region)(struct drm_device *dev, int i);
        void (*tlb_flush)(struct drm_device *, int engine);
@@ -25337,7 +26929,7 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_drv.h linux-3.0.4/drivers
  
  struct nouveau_instmem_engine {
        void    *priv;
-@@ -325,13 +325,13 @@ struct nouveau_instmem_engine {
+@@ -341,13 +341,13 @@ struct nouveau_instmem_engine {
  struct nouveau_mc_engine {
        int  (*init)(struct drm_device *dev);
        void (*takedown)(struct drm_device *dev);
@@ -25353,7 +26945,7 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_drv.h linux-3.0.4/drivers
  
  struct nouveau_fb_engine {
        int num_tiles;
-@@ -494,7 +494,7 @@ struct nouveau_vram_engine {
+@@ -513,7 +513,7 @@ struct nouveau_vram_engine {
        void (*put)(struct drm_device *, struct nouveau_mem **);
  
        bool (*flags_valid)(struct drm_device *, u32 tile_flags);
@@ -25362,7 +26954,7 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_drv.h linux-3.0.4/drivers
  
  struct nouveau_engine {
        struct nouveau_instmem_engine instmem;
-@@ -640,7 +640,7 @@ struct drm_nouveau_private {
+@@ -660,7 +660,7 @@ struct drm_nouveau_private {
                struct drm_global_reference mem_global_ref;
                struct ttm_bo_global_ref bo_global_ref;
                struct ttm_bo_device bdev;
@@ -25371,9 +26963,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_drv.h linux-3.0.4/drivers
        } ttm;
  
        struct {
-diff -urNp linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_fence.c linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_fence.c
---- linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_fence.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_fence.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_fence.c linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_fence.c
+--- linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_fence.c        2011-11-26 19:57:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_fence.c        2011-11-26 20:00:06.000000000 -0500
 @@ -85,7 +85,7 @@ nouveau_fence_update(struct nouveau_chan
                if (USE_REFCNT(dev))
                        sequence = nvchan_rd32(chan, 0x48);
@@ -25383,19 +26975,19 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_fence.c linux-3.0.4/drive
  
                if (chan->fence.sequence_ack == sequence)
                        goto out;
-@@ -544,7 +544,7 @@ nouveau_fence_channel_init(struct nouvea
+@@ -539,7 +539,7 @@ nouveau_fence_channel_init(struct nouvea
+                       return ret;
+       }
  
-       INIT_LIST_HEAD(&chan->fence.pending);
-       spin_lock_init(&chan->fence.lock);
 -      atomic_set(&chan->fence.last_sequence_irq, 0);
 +      atomic_set_unchecked(&chan->fence.last_sequence_irq, 0);
        return 0;
  }
  
-diff -urNp linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_gem.c linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_gem.c
---- linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_gem.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_gem.c  2011-08-23 21:47:55.000000000 -0400
-@@ -249,7 +249,7 @@ validate_init(struct nouveau_channel *ch
+diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_gem.c linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_gem.c
+--- linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_gem.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_gem.c  2011-11-16 18:39:07.000000000 -0500
+@@ -314,7 +314,7 @@ validate_init(struct nouveau_channel *ch
        int trycnt = 0;
        int ret, i;
  
@@ -25404,10 +26996,10 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_gem.c linux-3.0.4/drivers
  retry:
        if (++trycnt > 100000) {
                NV_ERROR(dev, "%s failed and gave up.\n", __func__);
-diff -urNp linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_state.c linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_state.c
---- linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_state.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_state.c        2011-08-23 21:47:55.000000000 -0400
-@@ -488,7 +488,7 @@ static bool nouveau_switcheroo_can_switc
+diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_state.c linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_state.c
+--- linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_state.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/nouveau/nouveau_state.c        2011-11-16 18:39:07.000000000 -0500
+@@ -496,7 +496,7 @@ static bool nouveau_switcheroo_can_switc
        bool can_switch;
  
        spin_lock(&dev->count_lock);
@@ -25416,10 +27008,10 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/nouveau/nouveau_state.c linux-3.0.4/drive
        spin_unlock(&dev->count_lock);
        return can_switch;
  }
-diff -urNp linux-3.0.4/drivers/gpu/drm/nouveau/nv04_graph.c linux-3.0.4/drivers/gpu/drm/nouveau/nv04_graph.c
---- linux-3.0.4/drivers/gpu/drm/nouveau/nv04_graph.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/nouveau/nv04_graph.c   2011-08-23 21:47:55.000000000 -0400
-@@ -560,7 +560,7 @@ static int
+diff -urNp linux-3.1.3/drivers/gpu/drm/nouveau/nv04_graph.c linux-3.1.3/drivers/gpu/drm/nouveau/nv04_graph.c
+--- linux-3.1.3/drivers/gpu/drm/nouveau/nv04_graph.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/nouveau/nv04_graph.c   2011-11-16 18:39:07.000000000 -0500
+@@ -554,7 +554,7 @@ static int
  nv04_graph_mthd_set_ref(struct nouveau_channel *chan,
                        u32 class, u32 mthd, u32 data)
  {
@@ -25428,9 +27020,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/nouveau/nv04_graph.c linux-3.0.4/drivers/
        return 0;
  }
  
-diff -urNp linux-3.0.4/drivers/gpu/drm/r128/r128_cce.c linux-3.0.4/drivers/gpu/drm/r128/r128_cce.c
---- linux-3.0.4/drivers/gpu/drm/r128/r128_cce.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/r128/r128_cce.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/r128/r128_cce.c linux-3.1.3/drivers/gpu/drm/r128/r128_cce.c
+--- linux-3.1.3/drivers/gpu/drm/r128/r128_cce.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/r128/r128_cce.c        2011-11-16 18:39:07.000000000 -0500
 @@ -377,7 +377,7 @@ static int r128_do_init_cce(struct drm_d
  
        /* GH: Simple idle check.
@@ -25440,9 +27032,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/r128/r128_cce.c linux-3.0.4/drivers/gpu/d
  
        /* We don't support anything other than bus-mastering ring mode,
         * but the ring can be in either AGP or PCI space for the ring
-diff -urNp linux-3.0.4/drivers/gpu/drm/r128/r128_drv.h linux-3.0.4/drivers/gpu/drm/r128/r128_drv.h
---- linux-3.0.4/drivers/gpu/drm/r128/r128_drv.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/r128/r128_drv.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/r128/r128_drv.h linux-3.1.3/drivers/gpu/drm/r128/r128_drv.h
+--- linux-3.1.3/drivers/gpu/drm/r128/r128_drv.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/r128/r128_drv.h        2011-11-16 18:39:07.000000000 -0500
 @@ -90,14 +90,14 @@ typedef struct drm_r128_private {
        int is_pci;
        unsigned long cce_buffers_offset;
@@ -25460,9 +27052,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/r128/r128_drv.h linux-3.0.4/drivers/gpu/d
  
        u32 color_fmt;
        unsigned int front_offset;
-diff -urNp linux-3.0.4/drivers/gpu/drm/r128/r128_irq.c linux-3.0.4/drivers/gpu/drm/r128/r128_irq.c
---- linux-3.0.4/drivers/gpu/drm/r128/r128_irq.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/r128/r128_irq.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/r128/r128_irq.c linux-3.1.3/drivers/gpu/drm/r128/r128_irq.c
+--- linux-3.1.3/drivers/gpu/drm/r128/r128_irq.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/r128/r128_irq.c        2011-11-16 18:39:07.000000000 -0500
 @@ -42,7 +42,7 @@ u32 r128_get_vblank_counter(struct drm_d
        if (crtc != 0)
                return 0;
@@ -25481,9 +27073,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/r128/r128_irq.c linux-3.0.4/drivers/gpu/d
                drm_handle_vblank(dev, 0);
                return IRQ_HANDLED;
        }
-diff -urNp linux-3.0.4/drivers/gpu/drm/r128/r128_state.c linux-3.0.4/drivers/gpu/drm/r128/r128_state.c
---- linux-3.0.4/drivers/gpu/drm/r128/r128_state.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/r128/r128_state.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/r128/r128_state.c linux-3.1.3/drivers/gpu/drm/r128/r128_state.c
+--- linux-3.1.3/drivers/gpu/drm/r128/r128_state.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/r128/r128_state.c      2011-11-16 18:39:07.000000000 -0500
 @@ -321,10 +321,10 @@ static void r128_clear_box(drm_r128_priv
  
  static void r128_cce_performance_boxes(drm_r128_private_t *dev_priv)
@@ -25497,21 +27089,21 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/r128/r128_state.c linux-3.0.4/drivers/gpu
  }
  
  #endif
-diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/atom.c linux-3.0.4/drivers/gpu/drm/radeon/atom.c
---- linux-3.0.4/drivers/gpu/drm/radeon/atom.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/radeon/atom.c  2011-08-23 21:48:14.000000000 -0400
-@@ -1245,6 +1245,8 @@ struct atom_context *atom_parse(struct c
+diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/atom.c linux-3.1.3/drivers/gpu/drm/radeon/atom.c
+--- linux-3.1.3/drivers/gpu/drm/radeon/atom.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/radeon/atom.c  2011-11-16 19:09:42.000000000 -0500
+@@ -1254,6 +1254,8 @@ struct atom_context *atom_parse(struct c
        char name[512];
        int i;
  
 +      pax_track_stack();
 +
-       ctx->card = card;
-       ctx->bios = bios;
+       if (!ctx)
+               return NULL;
  
-diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/mkregtable.c linux-3.0.4/drivers/gpu/drm/radeon/mkregtable.c
---- linux-3.0.4/drivers/gpu/drm/radeon/mkregtable.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/radeon/mkregtable.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/mkregtable.c linux-3.1.3/drivers/gpu/drm/radeon/mkregtable.c
+--- linux-3.1.3/drivers/gpu/drm/radeon/mkregtable.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/radeon/mkregtable.c    2011-11-16 18:39:07.000000000 -0500
 @@ -637,14 +637,14 @@ static int parser_auth(struct table *t, 
        regex_t mask_rex;
        regmatch_t match[4];
@@ -25529,9 +27121,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/mkregtable.c linux-3.0.4/drivers/g
  
        if (regcomp
            (&mask_rex, "(0x[0-9a-fA-F]*) *([_a-zA-Z0-9]*)", REG_EXTENDED)) {
-diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon_atombios.c linux-3.0.4/drivers/gpu/drm/radeon/radeon_atombios.c
---- linux-3.0.4/drivers/gpu/drm/radeon/radeon_atombios.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/radeon/radeon_atombios.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_atombios.c linux-3.1.3/drivers/gpu/drm/radeon/radeon_atombios.c
+--- linux-3.1.3/drivers/gpu/drm/radeon/radeon_atombios.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/radeon/radeon_atombios.c       2011-11-16 18:40:10.000000000 -0500
 @@ -545,6 +545,8 @@ bool radeon_get_atom_connector_info_from
        struct radeon_gpio_rec gpio;
        struct radeon_hpd hpd;
@@ -25541,10 +27133,10 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon_atombios.c linux-3.0.4/driv
        if (!atom_parse_data_header(ctx, index, &size, &frev, &crev, &data_offset))
                return false;
  
-diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon_device.c linux-3.0.4/drivers/gpu/drm/radeon/radeon_device.c
---- linux-3.0.4/drivers/gpu/drm/radeon/radeon_device.c 2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/radeon/radeon_device.c 2011-08-23 21:47:55.000000000 -0400
-@@ -678,7 +678,7 @@ static bool radeon_switcheroo_can_switch
+diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_device.c linux-3.1.3/drivers/gpu/drm/radeon/radeon_device.c
+--- linux-3.1.3/drivers/gpu/drm/radeon/radeon_device.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/radeon/radeon_device.c 2011-11-16 18:39:07.000000000 -0500
+@@ -684,7 +684,7 @@ static bool radeon_switcheroo_can_switch
        bool can_switch;
  
        spin_lock(&dev->count_lock);
@@ -25553,10 +27145,10 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon_device.c linux-3.0.4/driver
        spin_unlock(&dev->count_lock);
        return can_switch;
  }
-diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon_display.c linux-3.0.4/drivers/gpu/drm/radeon/radeon_display.c
---- linux-3.0.4/drivers/gpu/drm/radeon/radeon_display.c        2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/radeon/radeon_display.c        2011-08-23 21:48:14.000000000 -0400
-@@ -946,6 +946,8 @@ void radeon_compute_pll_legacy(struct ra
+diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_display.c linux-3.1.3/drivers/gpu/drm/radeon/radeon_display.c
+--- linux-3.1.3/drivers/gpu/drm/radeon/radeon_display.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/radeon/radeon_display.c        2011-11-16 18:40:10.000000000 -0500
+@@ -925,6 +925,8 @@ void radeon_compute_pll_legacy(struct ra
        uint32_t post_div;
        u32 pll_out_min, pll_out_max;
  
@@ -25565,9 +27157,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon_display.c linux-3.0.4/drive
        DRM_DEBUG_KMS("PLL freq %llu %u %u\n", freq, pll->min_ref_div, pll->max_ref_div);
        freq = freq * 1000;
  
-diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon_drv.h linux-3.0.4/drivers/gpu/drm/radeon/radeon_drv.h
---- linux-3.0.4/drivers/gpu/drm/radeon/radeon_drv.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/radeon/radeon_drv.h    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_drv.h linux-3.1.3/drivers/gpu/drm/radeon/radeon_drv.h
+--- linux-3.1.3/drivers/gpu/drm/radeon/radeon_drv.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/radeon/radeon_drv.h    2011-11-16 18:39:07.000000000 -0500
 @@ -255,7 +255,7 @@ typedef struct drm_radeon_private {
  
        /* SW interrupt */
@@ -25577,9 +27169,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon_drv.h linux-3.0.4/drivers/g
        int vblank_crtc;
        uint32_t irq_enable_reg;
        uint32_t r500_disp_irq_reg;
-diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon_fence.c linux-3.0.4/drivers/gpu/drm/radeon/radeon_fence.c
---- linux-3.0.4/drivers/gpu/drm/radeon/radeon_fence.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/radeon/radeon_fence.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_fence.c linux-3.1.3/drivers/gpu/drm/radeon/radeon_fence.c
+--- linux-3.1.3/drivers/gpu/drm/radeon/radeon_fence.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/radeon/radeon_fence.c  2011-11-16 18:39:07.000000000 -0500
 @@ -78,7 +78,7 @@ int radeon_fence_emit(struct radeon_devi
                write_unlock_irqrestore(&rdev->fence_drv.lock, irq_flags);
                return 0;
@@ -25598,10 +27190,10 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon_fence.c linux-3.0.4/drivers
        INIT_LIST_HEAD(&rdev->fence_drv.created);
        INIT_LIST_HEAD(&rdev->fence_drv.emited);
        INIT_LIST_HEAD(&rdev->fence_drv.signaled);
-diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon.h linux-3.0.4/drivers/gpu/drm/radeon/radeon.h
---- linux-3.0.4/drivers/gpu/drm/radeon/radeon.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/radeon/radeon.h        2011-08-23 21:47:55.000000000 -0400
-@@ -191,7 +191,7 @@ extern int sumo_get_temp(struct radeon_d
+diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon.h linux-3.1.3/drivers/gpu/drm/radeon/radeon.h
+--- linux-3.1.3/drivers/gpu/drm/radeon/radeon.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/radeon/radeon.h        2011-11-16 18:39:07.000000000 -0500
+@@ -192,7 +192,7 @@ extern int sumo_get_temp(struct radeon_d
   */
  struct radeon_fence_driver {
        uint32_t                        scratch_reg;
@@ -25610,7 +27202,7 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon.h linux-3.0.4/drivers/gpu/d
        uint32_t                        last_seq;
        unsigned long                   last_jiffies;
        unsigned long                   last_timeout;
-@@ -960,7 +960,7 @@ struct radeon_asic {
+@@ -962,7 +962,7 @@ struct radeon_asic {
        void (*pre_page_flip)(struct radeon_device *rdev, int crtc);
        u32 (*page_flip)(struct radeon_device *rdev, int crtc, u64 crtc_base);
        void (*post_page_flip)(struct radeon_device *rdev, int crtc);
@@ -25619,9 +27211,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon.h linux-3.0.4/drivers/gpu/d
  
  /*
   * Asic structures
-diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon_ioc32.c linux-3.0.4/drivers/gpu/drm/radeon/radeon_ioc32.c
---- linux-3.0.4/drivers/gpu/drm/radeon/radeon_ioc32.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/radeon/radeon_ioc32.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_ioc32.c linux-3.1.3/drivers/gpu/drm/radeon/radeon_ioc32.c
+--- linux-3.1.3/drivers/gpu/drm/radeon/radeon_ioc32.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/radeon/radeon_ioc32.c  2011-11-16 18:39:07.000000000 -0500
 @@ -359,7 +359,7 @@ static int compat_radeon_cp_setparam(str
        request = compat_alloc_user_space(sizeof(*request));
        if (!access_ok(VERIFY_WRITE, request, sizeof(*request))
@@ -25631,9 +27223,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon_ioc32.c linux-3.0.4/drivers
                          &request->value))
                return -EFAULT;
  
-diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon_irq.c linux-3.0.4/drivers/gpu/drm/radeon/radeon_irq.c
---- linux-3.0.4/drivers/gpu/drm/radeon/radeon_irq.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/radeon/radeon_irq.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_irq.c linux-3.1.3/drivers/gpu/drm/radeon/radeon_irq.c
+--- linux-3.1.3/drivers/gpu/drm/radeon/radeon_irq.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/radeon/radeon_irq.c    2011-11-16 18:39:07.000000000 -0500
 @@ -225,8 +225,8 @@ static int radeon_emit_irq(struct drm_de
        unsigned int ret;
        RING_LOCALS;
@@ -25654,9 +27246,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon_irq.c linux-3.0.4/drivers/g
        DRM_INIT_WAITQUEUE(&dev_priv->swi_queue);
  
        dev->max_vblank_count = 0x001fffff;
-diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon_state.c linux-3.0.4/drivers/gpu/drm/radeon/radeon_state.c
---- linux-3.0.4/drivers/gpu/drm/radeon/radeon_state.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/radeon/radeon_state.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_state.c linux-3.1.3/drivers/gpu/drm/radeon/radeon_state.c
+--- linux-3.1.3/drivers/gpu/drm/radeon/radeon_state.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/radeon/radeon_state.c  2011-11-16 18:39:07.000000000 -0500
 @@ -2168,7 +2168,7 @@ static int radeon_cp_clear(struct drm_de
        if (sarea_priv->nbox > RADEON_NR_SAREA_CLIPRECTS)
                sarea_priv->nbox = RADEON_NR_SAREA_CLIPRECTS;
@@ -25675,10 +27267,10 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon_state.c linux-3.0.4/drivers
  
        DRM_DEBUG("pid=%d\n", DRM_CURRENTPID);
  
-diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon_ttm.c linux-3.0.4/drivers/gpu/drm/radeon/radeon_ttm.c
---- linux-3.0.4/drivers/gpu/drm/radeon/radeon_ttm.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/radeon/radeon_ttm.c    2011-08-23 21:47:55.000000000 -0400
-@@ -644,8 +644,10 @@ int radeon_mmap(struct file *filp, struc
+diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/radeon_ttm.c linux-3.1.3/drivers/gpu/drm/radeon/radeon_ttm.c
+--- linux-3.1.3/drivers/gpu/drm/radeon/radeon_ttm.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/radeon/radeon_ttm.c    2011-11-16 18:39:07.000000000 -0500
+@@ -672,8 +672,10 @@ int radeon_mmap(struct file *filp, struc
        }
        if (unlikely(ttm_vm_ops == NULL)) {
                ttm_vm_ops = vma->vm_ops;
@@ -25691,9 +27283,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/radeon_ttm.c linux-3.0.4/drivers/g
        }
        vma->vm_ops = &radeon_ttm_vm_ops;
        return 0;
-diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/rs690.c linux-3.0.4/drivers/gpu/drm/radeon/rs690.c
---- linux-3.0.4/drivers/gpu/drm/radeon/rs690.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/radeon/rs690.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/radeon/rs690.c linux-3.1.3/drivers/gpu/drm/radeon/rs690.c
+--- linux-3.1.3/drivers/gpu/drm/radeon/rs690.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/radeon/rs690.c 2011-11-16 18:39:07.000000000 -0500
 @@ -304,9 +304,11 @@ void rs690_crtc_bandwidth_compute(struct
                if (rdev->pm.max_bandwidth.full > rdev->pm.sideport_bandwidth.full &&
                        rdev->pm.sideport_bandwidth.full)
@@ -25707,9 +27299,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/radeon/rs690.c linux-3.0.4/drivers/gpu/dr
        } else {
                if (rdev->pm.max_bandwidth.full > rdev->pm.k8_bandwidth.full &&
                        rdev->pm.k8_bandwidth.full)
-diff -urNp linux-3.0.4/drivers/gpu/drm/ttm/ttm_page_alloc.c linux-3.0.4/drivers/gpu/drm/ttm/ttm_page_alloc.c
---- linux-3.0.4/drivers/gpu/drm/ttm/ttm_page_alloc.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/ttm/ttm_page_alloc.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/ttm/ttm_page_alloc.c linux-3.1.3/drivers/gpu/drm/ttm/ttm_page_alloc.c
+--- linux-3.1.3/drivers/gpu/drm/ttm/ttm_page_alloc.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/ttm/ttm_page_alloc.c   2011-11-16 18:39:07.000000000 -0500
 @@ -398,9 +398,9 @@ static int ttm_pool_get_num_unused_pages
  static int ttm_pool_mm_shrink(struct shrinker *shrink,
                              struct shrink_control *sc)
@@ -25722,9 +27314,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/ttm/ttm_page_alloc.c linux-3.0.4/drivers/
        struct ttm_page_pool *pool;
        int shrink_pages = sc->nr_to_scan;
  
-diff -urNp linux-3.0.4/drivers/gpu/drm/via/via_drv.h linux-3.0.4/drivers/gpu/drm/via/via_drv.h
---- linux-3.0.4/drivers/gpu/drm/via/via_drv.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/via/via_drv.h  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/via/via_drv.h linux-3.1.3/drivers/gpu/drm/via/via_drv.h
+--- linux-3.1.3/drivers/gpu/drm/via/via_drv.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/via/via_drv.h  2011-11-16 18:39:07.000000000 -0500
 @@ -51,7 +51,7 @@ typedef struct drm_via_ring_buffer {
  typedef uint32_t maskarray_t[5];
  
@@ -25743,9 +27335,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/via/via_drv.h linux-3.0.4/drivers/gpu/drm
        drm_via_state_t hc_state;
        char pci_buf[VIA_PCI_BUF_SIZE];
        const uint32_t *fire_offsets[VIA_FIRE_BUF_SIZE];
-diff -urNp linux-3.0.4/drivers/gpu/drm/via/via_irq.c linux-3.0.4/drivers/gpu/drm/via/via_irq.c
---- linux-3.0.4/drivers/gpu/drm/via/via_irq.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/via/via_irq.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/via/via_irq.c linux-3.1.3/drivers/gpu/drm/via/via_irq.c
+--- linux-3.1.3/drivers/gpu/drm/via/via_irq.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/via/via_irq.c  2011-11-16 18:39:07.000000000 -0500
 @@ -102,7 +102,7 @@ u32 via_get_vblank_counter(struct drm_de
        if (crtc != 0)
                return 0;
@@ -25816,9 +27408,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/via/via_irq.c linux-3.0.4/drivers/gpu/drm
                irqwait->request.type &= ~_DRM_VBLANK_RELATIVE;
        case VIA_IRQ_ABSOLUTE:
                break;
-diff -urNp linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
---- linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
+--- linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h    2011-11-16 18:39:07.000000000 -0500
 @@ -240,7 +240,7 @@ struct vmw_private {
         * Fencing and IRQs.
         */
@@ -25828,9 +27420,21 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h linux-3.0.4/drivers/g
        wait_queue_head_t fence_queue;
        wait_queue_head_t fifo_queue;
        atomic_t fence_queue_waiters;
-diff -urNp linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
---- linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
+--- linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c        2011-11-16 18:39:07.000000000 -0500
+@@ -610,7 +610,7 @@ int vmw_execbuf_ioctl(struct drm_device 
+       struct drm_vmw_fence_rep fence_rep;
+       struct drm_vmw_fence_rep __user *user_fence_rep;
+       int ret;
+-      void *user_cmd;
++      void __user *user_cmd;
+       void *cmd;
+       uint32_t sequence;
+       struct vmw_sw_context *sw_context = &dev_priv->ctx;
+diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
+--- linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c  2011-11-16 18:39:07.000000000 -0500
 @@ -151,7 +151,7 @@ int vmw_wait_lag(struct vmw_private *dev
        while (!vmw_lag_lt(queue, us)) {
                spin_lock(&queue->lock);
@@ -25840,9 +27444,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c linux-3.0.4/drivers
                else {
                        fence = list_first_entry(&queue->head,
                                                 struct vmw_fence, head);
-diff -urNp linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
---- linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
+--- linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c   2011-11-16 18:39:07.000000000 -0500
 @@ -137,7 +137,7 @@ int vmw_fifo_init(struct vmw_private *de
                 (unsigned int) min,
                 (unsigned int) fifo->capabilities);
@@ -25852,6 +27456,15 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c linux-3.0.4/drivers/
        iowrite32(dev_priv->last_read_sequence, fifo_mem + SVGA_FIFO_FENCE);
        vmw_fence_queue_init(&fifo->fence_queue);
        return vmw_fifo_send_fence(dev_priv, &dummy);
+@@ -356,7 +356,7 @@ void *vmw_fifo_reserve(struct vmw_privat
+                               if (reserveable)
+                                       iowrite32(bytes, fifo_mem +
+                                                 SVGA_FIFO_RESERVED);
+-                              return fifo_mem + (next_cmd >> 2);
++                              return (__le32 __force_kernel *)fifo_mem + (next_cmd >> 2);
+                       } else {
+                               need_bounce = true;
+                       }
 @@ -476,7 +476,7 @@ int vmw_fifo_send_fence(struct vmw_priva
  
        fm = vmw_fifo_reserve(dev_priv, bytes);
@@ -25870,9 +27483,9 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c linux-3.0.4/drivers/
        } while (*sequence == 0);
  
        if (!(fifo_state->capabilities & SVGA_FIFO_CAP_FENCE)) {
-diff -urNp linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
---- linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
+--- linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c    2011-11-16 18:39:07.000000000 -0500
 @@ -100,7 +100,7 @@ bool vmw_fence_signaled(struct vmw_priva
         * emitted. Then the fence is stale and signaled.
         */
@@ -25891,10 +27504,10 @@ diff -urNp linux-3.0.4/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c linux-3.0.4/drivers/g
        ret = 0;
  
        for (;;) {
-diff -urNp linux-3.0.4/drivers/hid/hid-core.c linux-3.0.4/drivers/hid/hid-core.c
---- linux-3.0.4/drivers/hid/hid-core.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/hid/hid-core.c 2011-08-23 21:47:55.000000000 -0400
-@@ -1923,7 +1923,7 @@ static bool hid_ignore(struct hid_device
+diff -urNp linux-3.1.3/drivers/hid/hid-core.c linux-3.1.3/drivers/hid/hid-core.c
+--- linux-3.1.3/drivers/hid/hid-core.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/hid/hid-core.c 2011-11-16 18:39:07.000000000 -0500
+@@ -1951,7 +1951,7 @@ static bool hid_ignore(struct hid_device
  
  int hid_add_device(struct hid_device *hdev)
  {
@@ -25903,7 +27516,7 @@ diff -urNp linux-3.0.4/drivers/hid/hid-core.c linux-3.0.4/drivers/hid/hid-core.c
        int ret;
  
        if (WARN_ON(hdev->status & HID_STAT_ADDED))
-@@ -1938,7 +1938,7 @@ int hid_add_device(struct hid_device *hd
+@@ -1966,7 +1966,7 @@ int hid_add_device(struct hid_device *hd
        /* XXX hack, any other cleaner solution after the driver core
         * is converted to allow more than 20 bytes as the device name? */
        dev_set_name(&hdev->dev, "%04X:%04X:%04X.%04X", hdev->bus,
@@ -25912,9 +27525,9 @@ diff -urNp linux-3.0.4/drivers/hid/hid-core.c linux-3.0.4/drivers/hid/hid-core.c
  
        hid_debug_register(hdev, dev_name(&hdev->dev));
        ret = device_add(&hdev->dev);
-diff -urNp linux-3.0.4/drivers/hid/usbhid/hiddev.c linux-3.0.4/drivers/hid/usbhid/hiddev.c
---- linux-3.0.4/drivers/hid/usbhid/hiddev.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/hid/usbhid/hiddev.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/hid/usbhid/hiddev.c linux-3.1.3/drivers/hid/usbhid/hiddev.c
+--- linux-3.1.3/drivers/hid/usbhid/hiddev.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/hid/usbhid/hiddev.c    2011-11-16 18:39:07.000000000 -0500
 @@ -624,7 +624,7 @@ static long hiddev_ioctl(struct file *fi
                break;
  
@@ -25924,9 +27537,9 @@ diff -urNp linux-3.0.4/drivers/hid/usbhid/hiddev.c linux-3.0.4/drivers/hid/usbhi
                        break;
  
                for (i = 0; i < hid->maxcollection; i++)
-diff -urNp linux-3.0.4/drivers/hwmon/acpi_power_meter.c linux-3.0.4/drivers/hwmon/acpi_power_meter.c
---- linux-3.0.4/drivers/hwmon/acpi_power_meter.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/hwmon/acpi_power_meter.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/hwmon/acpi_power_meter.c linux-3.1.3/drivers/hwmon/acpi_power_meter.c
+--- linux-3.1.3/drivers/hwmon/acpi_power_meter.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/hwmon/acpi_power_meter.c       2011-11-16 18:39:07.000000000 -0500
 @@ -316,8 +316,6 @@ static ssize_t set_trip(struct device *d
                return res;
  
@@ -25936,9 +27549,9 @@ diff -urNp linux-3.0.4/drivers/hwmon/acpi_power_meter.c linux-3.0.4/drivers/hwmo
  
        mutex_lock(&resource->lock);
        resource->trip[attr->index - 7] = temp;
-diff -urNp linux-3.0.4/drivers/hwmon/sht15.c linux-3.0.4/drivers/hwmon/sht15.c
---- linux-3.0.4/drivers/hwmon/sht15.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/hwmon/sht15.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/hwmon/sht15.c linux-3.1.3/drivers/hwmon/sht15.c
+--- linux-3.1.3/drivers/hwmon/sht15.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/hwmon/sht15.c  2011-11-16 18:39:07.000000000 -0500
 @@ -166,7 +166,7 @@ struct sht15_data {
        int                             supply_uV;
        bool                            supply_uV_valid;
@@ -25987,23 +27600,9 @@ diff -urNp linux-3.0.4/drivers/hwmon/sht15.c linux-3.0.4/drivers/hwmon/sht15.c
                        return;
        }
  
-diff -urNp linux-3.0.4/drivers/hwmon/w83791d.c linux-3.0.4/drivers/hwmon/w83791d.c
---- linux-3.0.4/drivers/hwmon/w83791d.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/hwmon/w83791d.c        2011-08-23 21:47:55.000000000 -0400
-@@ -329,8 +329,8 @@ static int w83791d_detect(struct i2c_cli
-                         struct i2c_board_info *info);
- static int w83791d_remove(struct i2c_client *client);
--static int w83791d_read(struct i2c_client *client, u8 register);
--static int w83791d_write(struct i2c_client *client, u8 register, u8 value);
-+static int w83791d_read(struct i2c_client *client, u8 reg);
-+static int w83791d_write(struct i2c_client *client, u8 reg, u8 value);
- static struct w83791d_data *w83791d_update_device(struct device *dev);
- #ifdef DEBUG
-diff -urNp linux-3.0.4/drivers/i2c/busses/i2c-amd756-s4882.c linux-3.0.4/drivers/i2c/busses/i2c-amd756-s4882.c
---- linux-3.0.4/drivers/i2c/busses/i2c-amd756-s4882.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/i2c/busses/i2c-amd756-s4882.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/i2c/busses/i2c-amd756-s4882.c linux-3.1.3/drivers/i2c/busses/i2c-amd756-s4882.c
+--- linux-3.1.3/drivers/i2c/busses/i2c-amd756-s4882.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/i2c/busses/i2c-amd756-s4882.c  2011-11-16 18:39:07.000000000 -0500
 @@ -43,7 +43,7 @@
  extern struct i2c_adapter amd756_smbus;
  
@@ -26013,9 +27612,9 @@ diff -urNp linux-3.0.4/drivers/i2c/busses/i2c-amd756-s4882.c linux-3.0.4/drivers
  
  /* Wrapper access functions for multiplexed SMBus */
  static DEFINE_MUTEX(amd756_lock);
-diff -urNp linux-3.0.4/drivers/i2c/busses/i2c-nforce2-s4985.c linux-3.0.4/drivers/i2c/busses/i2c-nforce2-s4985.c
---- linux-3.0.4/drivers/i2c/busses/i2c-nforce2-s4985.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/i2c/busses/i2c-nforce2-s4985.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/i2c/busses/i2c-nforce2-s4985.c linux-3.1.3/drivers/i2c/busses/i2c-nforce2-s4985.c
+--- linux-3.1.3/drivers/i2c/busses/i2c-nforce2-s4985.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/i2c/busses/i2c-nforce2-s4985.c 2011-11-16 18:39:07.000000000 -0500
 @@ -41,7 +41,7 @@
  extern struct i2c_adapter *nforce2_smbus;
  
@@ -26025,9 +27624,9 @@ diff -urNp linux-3.0.4/drivers/i2c/busses/i2c-nforce2-s4985.c linux-3.0.4/driver
  
  /* Wrapper access functions for multiplexed SMBus */
  static DEFINE_MUTEX(nforce2_lock);
-diff -urNp linux-3.0.4/drivers/i2c/i2c-mux.c linux-3.0.4/drivers/i2c/i2c-mux.c
---- linux-3.0.4/drivers/i2c/i2c-mux.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/i2c/i2c-mux.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/i2c/i2c-mux.c linux-3.1.3/drivers/i2c/i2c-mux.c
+--- linux-3.1.3/drivers/i2c/i2c-mux.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/i2c/i2c-mux.c  2011-11-16 18:39:07.000000000 -0500
 @@ -28,7 +28,7 @@
  /* multiplexer per channel data */
  struct i2c_mux_priv {
@@ -26037,9 +27636,228 @@ diff -urNp linux-3.0.4/drivers/i2c/i2c-mux.c linux-3.0.4/drivers/i2c/i2c-mux.c
  
        struct i2c_adapter *parent;
        void *mux_dev;  /* the mux chip/device */
-diff -urNp linux-3.0.4/drivers/ide/ide-cd.c linux-3.0.4/drivers/ide/ide-cd.c
---- linux-3.0.4/drivers/ide/ide-cd.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/ide/ide-cd.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/ide/aec62xx.c linux-3.1.3/drivers/ide/aec62xx.c
+--- linux-3.1.3/drivers/ide/aec62xx.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/aec62xx.c  2011-11-16 18:39:07.000000000 -0500
+@@ -181,7 +181,7 @@ static const struct ide_port_ops atp86x_
+       .cable_detect           = atp86x_cable_detect,
+ };
+-static const struct ide_port_info aec62xx_chipsets[] __devinitdata = {
++static const struct ide_port_info aec62xx_chipsets[] __devinitconst = {
+       {       /* 0: AEC6210 */
+               .name           = DRV_NAME,
+               .init_chipset   = init_chipset_aec62xx,
+diff -urNp linux-3.1.3/drivers/ide/alim15x3.c linux-3.1.3/drivers/ide/alim15x3.c
+--- linux-3.1.3/drivers/ide/alim15x3.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/alim15x3.c 2011-11-16 18:39:07.000000000 -0500
+@@ -512,7 +512,7 @@ static const struct ide_dma_ops ali_dma_
+       .dma_sff_read_status    = ide_dma_sff_read_status,
+ };
+-static const struct ide_port_info ali15x3_chipset __devinitdata = {
++static const struct ide_port_info ali15x3_chipset __devinitconst = {
+       .name           = DRV_NAME,
+       .init_chipset   = init_chipset_ali15x3,
+       .init_hwif      = init_hwif_ali15x3,
+diff -urNp linux-3.1.3/drivers/ide/amd74xx.c linux-3.1.3/drivers/ide/amd74xx.c
+--- linux-3.1.3/drivers/ide/amd74xx.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/amd74xx.c  2011-11-16 18:39:07.000000000 -0500
+@@ -223,7 +223,7 @@ static const struct ide_port_ops amd_por
+               .udma_mask      = udma,                                 \
+       }
+-static const struct ide_port_info amd74xx_chipsets[] __devinitdata = {
++static const struct ide_port_info amd74xx_chipsets[] __devinitconst = {
+       /* 0: AMD7401 */        DECLARE_AMD_DEV(0x00, ATA_UDMA2),
+       /* 1: AMD7409 */        DECLARE_AMD_DEV(ATA_SWDMA2, ATA_UDMA4),
+       /* 2: AMD7411/7441 */   DECLARE_AMD_DEV(ATA_SWDMA2, ATA_UDMA5),
+diff -urNp linux-3.1.3/drivers/ide/atiixp.c linux-3.1.3/drivers/ide/atiixp.c
+--- linux-3.1.3/drivers/ide/atiixp.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/atiixp.c   2011-11-16 18:39:07.000000000 -0500
+@@ -139,7 +139,7 @@ static const struct ide_port_ops atiixp_
+       .cable_detect           = atiixp_cable_detect,
+ };
+-static const struct ide_port_info atiixp_pci_info[] __devinitdata = {
++static const struct ide_port_info atiixp_pci_info[] __devinitconst = {
+       {       /* 0: IXP200/300/400/700 */
+               .name           = DRV_NAME,
+               .enablebits     = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
+diff -urNp linux-3.1.3/drivers/ide/cmd64x.c linux-3.1.3/drivers/ide/cmd64x.c
+--- linux-3.1.3/drivers/ide/cmd64x.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/cmd64x.c   2011-11-16 18:39:07.000000000 -0500
+@@ -327,7 +327,7 @@ static const struct ide_dma_ops cmd646_r
+       .dma_sff_read_status    = ide_dma_sff_read_status,
+ };
+-static const struct ide_port_info cmd64x_chipsets[] __devinitdata = {
++static const struct ide_port_info cmd64x_chipsets[] __devinitconst = {
+       {       /* 0: CMD643 */
+               .name           = DRV_NAME,
+               .init_chipset   = init_chipset_cmd64x,
+diff -urNp linux-3.1.3/drivers/ide/cs5520.c linux-3.1.3/drivers/ide/cs5520.c
+--- linux-3.1.3/drivers/ide/cs5520.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/cs5520.c   2011-11-16 18:39:07.000000000 -0500
+@@ -94,7 +94,7 @@ static const struct ide_port_ops cs5520_
+       .set_dma_mode           = cs5520_set_dma_mode,
+ };
+-static const struct ide_port_info cyrix_chipset __devinitdata = {
++static const struct ide_port_info cyrix_chipset __devinitconst = {
+       .name           = DRV_NAME,
+       .enablebits     = { { 0x60, 0x01, 0x01 }, { 0x60, 0x02, 0x02 } },
+       .port_ops       = &cs5520_port_ops,
+diff -urNp linux-3.1.3/drivers/ide/cs5530.c linux-3.1.3/drivers/ide/cs5530.c
+--- linux-3.1.3/drivers/ide/cs5530.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/cs5530.c   2011-11-16 18:39:07.000000000 -0500
+@@ -245,7 +245,7 @@ static const struct ide_port_ops cs5530_
+       .udma_filter            = cs5530_udma_filter,
+ };
+-static const struct ide_port_info cs5530_chipset __devinitdata = {
++static const struct ide_port_info cs5530_chipset __devinitconst = {
+       .name           = DRV_NAME,
+       .init_chipset   = init_chipset_cs5530,
+       .init_hwif      = init_hwif_cs5530,
+diff -urNp linux-3.1.3/drivers/ide/cs5535.c linux-3.1.3/drivers/ide/cs5535.c
+--- linux-3.1.3/drivers/ide/cs5535.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/cs5535.c   2011-11-16 18:39:07.000000000 -0500
+@@ -170,7 +170,7 @@ static const struct ide_port_ops cs5535_
+       .cable_detect           = cs5535_cable_detect,
+ };
+-static const struct ide_port_info cs5535_chipset __devinitdata = {
++static const struct ide_port_info cs5535_chipset __devinitconst = {
+       .name           = DRV_NAME,
+       .port_ops       = &cs5535_port_ops,
+       .host_flags     = IDE_HFLAG_SINGLE | IDE_HFLAG_POST_SET_MODE,
+diff -urNp linux-3.1.3/drivers/ide/cy82c693.c linux-3.1.3/drivers/ide/cy82c693.c
+--- linux-3.1.3/drivers/ide/cy82c693.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/cy82c693.c 2011-11-16 18:39:07.000000000 -0500
+@@ -163,7 +163,7 @@ static const struct ide_port_ops cy82c69
+       .set_dma_mode           = cy82c693_set_dma_mode,
+ };
+-static const struct ide_port_info cy82c693_chipset __devinitdata = {
++static const struct ide_port_info cy82c693_chipset __devinitconst = {
+       .name           = DRV_NAME,
+       .init_iops      = init_iops_cy82c693,
+       .port_ops       = &cy82c693_port_ops,
+diff -urNp linux-3.1.3/drivers/ide/hpt366.c linux-3.1.3/drivers/ide/hpt366.c
+--- linux-3.1.3/drivers/ide/hpt366.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/hpt366.c   2011-11-16 18:39:07.000000000 -0500
+@@ -443,7 +443,7 @@ static struct hpt_timings hpt37x_timings
+       }
+ };
+-static const struct hpt_info hpt36x __devinitdata = {
++static const struct hpt_info hpt36x __devinitconst = {
+       .chip_name      = "HPT36x",
+       .chip_type      = HPT36x,
+       .udma_mask      = HPT366_ALLOW_ATA66_3 ? (HPT366_ALLOW_ATA66_4 ? ATA_UDMA4 : ATA_UDMA3) : ATA_UDMA2,
+@@ -451,7 +451,7 @@ static const struct hpt_info hpt36x __de
+       .timings        = &hpt36x_timings
+ };
+-static const struct hpt_info hpt370 __devinitdata = {
++static const struct hpt_info hpt370 __devinitconst = {
+       .chip_name      = "HPT370",
+       .chip_type      = HPT370,
+       .udma_mask      = HPT370_ALLOW_ATA100_5 ? ATA_UDMA5 : ATA_UDMA4,
+@@ -459,7 +459,7 @@ static const struct hpt_info hpt370 __de
+       .timings        = &hpt37x_timings
+ };
+-static const struct hpt_info hpt370a __devinitdata = {
++static const struct hpt_info hpt370a __devinitconst = {
+       .chip_name      = "HPT370A",
+       .chip_type      = HPT370A,
+       .udma_mask      = HPT370_ALLOW_ATA100_5 ? ATA_UDMA5 : ATA_UDMA4,
+@@ -467,7 +467,7 @@ static const struct hpt_info hpt370a __d
+       .timings        = &hpt37x_timings
+ };
+-static const struct hpt_info hpt374 __devinitdata = {
++static const struct hpt_info hpt374 __devinitconst = {
+       .chip_name      = "HPT374",
+       .chip_type      = HPT374,
+       .udma_mask      = ATA_UDMA5,
+@@ -475,7 +475,7 @@ static const struct hpt_info hpt374 __de
+       .timings        = &hpt37x_timings
+ };
+-static const struct hpt_info hpt372 __devinitdata = {
++static const struct hpt_info hpt372 __devinitconst = {
+       .chip_name      = "HPT372",
+       .chip_type      = HPT372,
+       .udma_mask      = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
+@@ -483,7 +483,7 @@ static const struct hpt_info hpt372 __de
+       .timings        = &hpt37x_timings
+ };
+-static const struct hpt_info hpt372a __devinitdata = {
++static const struct hpt_info hpt372a __devinitconst = {
+       .chip_name      = "HPT372A",
+       .chip_type      = HPT372A,
+       .udma_mask      = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
+@@ -491,7 +491,7 @@ static const struct hpt_info hpt372a __d
+       .timings        = &hpt37x_timings
+ };
+-static const struct hpt_info hpt302 __devinitdata = {
++static const struct hpt_info hpt302 __devinitconst = {
+       .chip_name      = "HPT302",
+       .chip_type      = HPT302,
+       .udma_mask      = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
+@@ -499,7 +499,7 @@ static const struct hpt_info hpt302 __de
+       .timings        = &hpt37x_timings
+ };
+-static const struct hpt_info hpt371 __devinitdata = {
++static const struct hpt_info hpt371 __devinitconst = {
+       .chip_name      = "HPT371",
+       .chip_type      = HPT371,
+       .udma_mask      = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
+@@ -507,7 +507,7 @@ static const struct hpt_info hpt371 __de
+       .timings        = &hpt37x_timings
+ };
+-static const struct hpt_info hpt372n __devinitdata = {
++static const struct hpt_info hpt372n __devinitconst = {
+       .chip_name      = "HPT372N",
+       .chip_type      = HPT372N,
+       .udma_mask      = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
+@@ -515,7 +515,7 @@ static const struct hpt_info hpt372n __d
+       .timings        = &hpt37x_timings
+ };
+-static const struct hpt_info hpt302n __devinitdata = {
++static const struct hpt_info hpt302n __devinitconst = {
+       .chip_name      = "HPT302N",
+       .chip_type      = HPT302N,
+       .udma_mask      = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
+@@ -523,7 +523,7 @@ static const struct hpt_info hpt302n __d
+       .timings        = &hpt37x_timings
+ };
+-static const struct hpt_info hpt371n __devinitdata = {
++static const struct hpt_info hpt371n __devinitconst = {
+       .chip_name      = "HPT371N",
+       .chip_type      = HPT371N,
+       .udma_mask      = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
+@@ -1361,7 +1361,7 @@ static const struct ide_dma_ops hpt36x_d
+       .dma_sff_read_status    = ide_dma_sff_read_status,
+ };
+-static const struct ide_port_info hpt366_chipsets[] __devinitdata = {
++static const struct ide_port_info hpt366_chipsets[] __devinitconst = {
+       {       /* 0: HPT36x */
+               .name           = DRV_NAME,
+               .init_chipset   = init_chipset_hpt366,
+diff -urNp linux-3.1.3/drivers/ide/ide-cd.c linux-3.1.3/drivers/ide/ide-cd.c
+--- linux-3.1.3/drivers/ide/ide-cd.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/ide-cd.c   2011-11-16 18:39:07.000000000 -0500
 @@ -769,7 +769,7 @@ static void cdrom_do_block_pc(ide_drive_
                alignment = queue_dma_alignment(q) | q->dma_pad_mask;
                if ((unsigned long)buf & alignment
@@ -26049,9 +27867,9 @@ diff -urNp linux-3.0.4/drivers/ide/ide-cd.c linux-3.0.4/drivers/ide/ide-cd.c
                        drive->dma = 0;
        }
  }
-diff -urNp linux-3.0.4/drivers/ide/ide-floppy.c linux-3.0.4/drivers/ide/ide-floppy.c
---- linux-3.0.4/drivers/ide/ide-floppy.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/ide/ide-floppy.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/ide/ide-floppy.c linux-3.1.3/drivers/ide/ide-floppy.c
+--- linux-3.1.3/drivers/ide/ide-floppy.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/ide-floppy.c       2011-11-16 18:40:10.000000000 -0500
 @@ -379,6 +379,8 @@ static int ide_floppy_get_capacity(ide_d
        u8 pc_buf[256], header_len, desc_cnt;
        int i, rc = 1, blocks, length;
@@ -26061,9 +27879,177 @@ diff -urNp linux-3.0.4/drivers/ide/ide-floppy.c linux-3.0.4/drivers/ide/ide-flop
        ide_debug_log(IDE_DBG_FUNC, "enter");
  
        drive->bios_cyl = 0;
-diff -urNp linux-3.0.4/drivers/ide/setup-pci.c linux-3.0.4/drivers/ide/setup-pci.c
---- linux-3.0.4/drivers/ide/setup-pci.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/ide/setup-pci.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/ide/ide-pci-generic.c linux-3.1.3/drivers/ide/ide-pci-generic.c
+--- linux-3.1.3/drivers/ide/ide-pci-generic.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/ide-pci-generic.c  2011-11-16 18:39:07.000000000 -0500
+@@ -53,7 +53,7 @@ static const struct ide_port_ops netcell
+               .udma_mask      = ATA_UDMA6, \
+       }
+-static const struct ide_port_info generic_chipsets[] __devinitdata = {
++static const struct ide_port_info generic_chipsets[] __devinitconst = {
+       /*  0: Unknown */
+       DECLARE_GENERIC_PCI_DEV(0),
+diff -urNp linux-3.1.3/drivers/ide/it8172.c linux-3.1.3/drivers/ide/it8172.c
+--- linux-3.1.3/drivers/ide/it8172.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/it8172.c   2011-11-16 18:39:07.000000000 -0500
+@@ -115,7 +115,7 @@ static const struct ide_port_ops it8172_
+       .set_dma_mode   = it8172_set_dma_mode,
+ };
+-static const struct ide_port_info it8172_port_info __devinitdata = {
++static const struct ide_port_info it8172_port_info __devinitconst = {
+       .name           = DRV_NAME,
+       .port_ops       = &it8172_port_ops,
+       .enablebits     = { {0x41, 0x80, 0x80}, {0x00, 0x00, 0x00} },
+diff -urNp linux-3.1.3/drivers/ide/it8213.c linux-3.1.3/drivers/ide/it8213.c
+--- linux-3.1.3/drivers/ide/it8213.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/it8213.c   2011-11-16 18:39:07.000000000 -0500
+@@ -156,7 +156,7 @@ static const struct ide_port_ops it8213_
+       .cable_detect           = it8213_cable_detect,
+ };
+-static const struct ide_port_info it8213_chipset __devinitdata = {
++static const struct ide_port_info it8213_chipset __devinitconst = {
+       .name           = DRV_NAME,
+       .enablebits     = { {0x41, 0x80, 0x80} },
+       .port_ops       = &it8213_port_ops,
+diff -urNp linux-3.1.3/drivers/ide/it821x.c linux-3.1.3/drivers/ide/it821x.c
+--- linux-3.1.3/drivers/ide/it821x.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/it821x.c   2011-11-16 18:39:07.000000000 -0500
+@@ -630,7 +630,7 @@ static const struct ide_port_ops it821x_
+       .cable_detect           = it821x_cable_detect,
+ };
+-static const struct ide_port_info it821x_chipset __devinitdata = {
++static const struct ide_port_info it821x_chipset __devinitconst = {
+       .name           = DRV_NAME,
+       .init_chipset   = init_chipset_it821x,
+       .init_hwif      = init_hwif_it821x,
+diff -urNp linux-3.1.3/drivers/ide/jmicron.c linux-3.1.3/drivers/ide/jmicron.c
+--- linux-3.1.3/drivers/ide/jmicron.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/jmicron.c  2011-11-16 18:39:07.000000000 -0500
+@@ -102,7 +102,7 @@ static const struct ide_port_ops jmicron
+       .cable_detect           = jmicron_cable_detect,
+ };
+-static const struct ide_port_info jmicron_chipset __devinitdata = {
++static const struct ide_port_info jmicron_chipset __devinitconst = {
+       .name           = DRV_NAME,
+       .enablebits     = { { 0x40, 0x01, 0x01 }, { 0x40, 0x10, 0x10 } },
+       .port_ops       = &jmicron_port_ops,
+diff -urNp linux-3.1.3/drivers/ide/ns87415.c linux-3.1.3/drivers/ide/ns87415.c
+--- linux-3.1.3/drivers/ide/ns87415.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/ns87415.c  2011-11-16 18:39:07.000000000 -0500
+@@ -293,7 +293,7 @@ static const struct ide_dma_ops ns87415_
+       .dma_sff_read_status    = superio_dma_sff_read_status,
+ };
+-static const struct ide_port_info ns87415_chipset __devinitdata = {
++static const struct ide_port_info ns87415_chipset __devinitconst = {
+       .name           = DRV_NAME,
+       .init_hwif      = init_hwif_ns87415,
+       .tp_ops         = &ns87415_tp_ops,
+diff -urNp linux-3.1.3/drivers/ide/opti621.c linux-3.1.3/drivers/ide/opti621.c
+--- linux-3.1.3/drivers/ide/opti621.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/opti621.c  2011-11-16 18:39:07.000000000 -0500
+@@ -131,7 +131,7 @@ static const struct ide_port_ops opti621
+       .set_pio_mode           = opti621_set_pio_mode,
+ };
+-static const struct ide_port_info opti621_chipset __devinitdata = {
++static const struct ide_port_info opti621_chipset __devinitconst = {
+       .name           = DRV_NAME,
+       .enablebits     = { {0x45, 0x80, 0x00}, {0x40, 0x08, 0x00} },
+       .port_ops       = &opti621_port_ops,
+diff -urNp linux-3.1.3/drivers/ide/pdc202xx_new.c linux-3.1.3/drivers/ide/pdc202xx_new.c
+--- linux-3.1.3/drivers/ide/pdc202xx_new.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/pdc202xx_new.c     2011-11-16 18:39:07.000000000 -0500
+@@ -465,7 +465,7 @@ static const struct ide_port_ops pdcnew_
+               .udma_mask      = udma, \
+       }
+-static const struct ide_port_info pdcnew_chipsets[] __devinitdata = {
++static const struct ide_port_info pdcnew_chipsets[] __devinitconst = {
+       /* 0: PDC202{68,70} */          DECLARE_PDCNEW_DEV(ATA_UDMA5),
+       /* 1: PDC202{69,71,75,76,77} */ DECLARE_PDCNEW_DEV(ATA_UDMA6),
+ };
+diff -urNp linux-3.1.3/drivers/ide/pdc202xx_old.c linux-3.1.3/drivers/ide/pdc202xx_old.c
+--- linux-3.1.3/drivers/ide/pdc202xx_old.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/pdc202xx_old.c     2011-11-16 18:39:07.000000000 -0500
+@@ -270,7 +270,7 @@ static const struct ide_dma_ops pdc2026x
+               .max_sectors    = sectors, \
+       }
+-static const struct ide_port_info pdc202xx_chipsets[] __devinitdata = {
++static const struct ide_port_info pdc202xx_chipsets[] __devinitconst = {
+       {       /* 0: PDC20246 */
+               .name           = DRV_NAME,
+               .init_chipset   = init_chipset_pdc202xx,
+diff -urNp linux-3.1.3/drivers/ide/piix.c linux-3.1.3/drivers/ide/piix.c
+--- linux-3.1.3/drivers/ide/piix.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/piix.c     2011-11-16 18:39:07.000000000 -0500
+@@ -344,7 +344,7 @@ static const struct ide_port_ops ich_por
+               .udma_mask      = udma, \
+       }
+-static const struct ide_port_info piix_pci_info[] __devinitdata = {
++static const struct ide_port_info piix_pci_info[] __devinitconst = {
+       /* 0: MPIIX */
+       {       /*
+                * MPIIX actually has only a single IDE channel mapped to
+diff -urNp linux-3.1.3/drivers/ide/rz1000.c linux-3.1.3/drivers/ide/rz1000.c
+--- linux-3.1.3/drivers/ide/rz1000.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/rz1000.c   2011-11-16 18:39:07.000000000 -0500
+@@ -38,7 +38,7 @@ static int __devinit rz1000_disable_read
+       }
+ }
+-static const struct ide_port_info rz1000_chipset __devinitdata = {
++static const struct ide_port_info rz1000_chipset __devinitconst = {
+       .name           = DRV_NAME,
+       .host_flags     = IDE_HFLAG_NO_DMA,
+ };
+diff -urNp linux-3.1.3/drivers/ide/sc1200.c linux-3.1.3/drivers/ide/sc1200.c
+--- linux-3.1.3/drivers/ide/sc1200.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/sc1200.c   2011-11-16 18:39:07.000000000 -0500
+@@ -291,7 +291,7 @@ static const struct ide_dma_ops sc1200_d
+       .dma_sff_read_status    = ide_dma_sff_read_status,
+ };
+-static const struct ide_port_info sc1200_chipset __devinitdata = {
++static const struct ide_port_info sc1200_chipset __devinitconst = {
+       .name           = DRV_NAME,
+       .port_ops       = &sc1200_port_ops,
+       .dma_ops        = &sc1200_dma_ops,
+diff -urNp linux-3.1.3/drivers/ide/scc_pata.c linux-3.1.3/drivers/ide/scc_pata.c
+--- linux-3.1.3/drivers/ide/scc_pata.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/scc_pata.c 2011-11-16 18:39:07.000000000 -0500
+@@ -811,7 +811,7 @@ static const struct ide_dma_ops scc_dma_
+       .dma_sff_read_status    = scc_dma_sff_read_status,
+ };
+-static const struct ide_port_info scc_chipset __devinitdata = {
++static const struct ide_port_info scc_chipset __devinitconst = {
+       .name           = "sccIDE",
+       .init_iops      = init_iops_scc,
+       .init_dma       = scc_init_dma,
+diff -urNp linux-3.1.3/drivers/ide/serverworks.c linux-3.1.3/drivers/ide/serverworks.c
+--- linux-3.1.3/drivers/ide/serverworks.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/serverworks.c      2011-11-16 18:39:07.000000000 -0500
+@@ -337,7 +337,7 @@ static const struct ide_port_ops svwks_p
+       .cable_detect           = svwks_cable_detect,
+ };
+-static const struct ide_port_info serverworks_chipsets[] __devinitdata = {
++static const struct ide_port_info serverworks_chipsets[] __devinitconst = {
+       {       /* 0: OSB4 */
+               .name           = DRV_NAME,
+               .init_chipset   = init_chipset_svwks,
+diff -urNp linux-3.1.3/drivers/ide/setup-pci.c linux-3.1.3/drivers/ide/setup-pci.c
+--- linux-3.1.3/drivers/ide/setup-pci.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/setup-pci.c        2011-11-16 18:40:10.000000000 -0500
 @@ -542,6 +542,8 @@ int ide_pci_init_two(struct pci_dev *dev
        int ret, i, n_ports = dev2 ? 4 : 2;
        struct ide_hw hw[4], *hws[] = { NULL, NULL, NULL, NULL };
@@ -26073,9 +28059,105 @@ diff -urNp linux-3.0.4/drivers/ide/setup-pci.c linux-3.0.4/drivers/ide/setup-pci
        for (i = 0; i < n_ports / 2; i++) {
                ret = ide_setup_pci_controller(pdev[i], d, !i);
                if (ret < 0)
-diff -urNp linux-3.0.4/drivers/infiniband/core/cm.c linux-3.0.4/drivers/infiniband/core/cm.c
---- linux-3.0.4/drivers/infiniband/core/cm.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/infiniband/core/cm.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/ide/siimage.c linux-3.1.3/drivers/ide/siimage.c
+--- linux-3.1.3/drivers/ide/siimage.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/siimage.c  2011-11-16 18:39:07.000000000 -0500
+@@ -719,7 +719,7 @@ static const struct ide_dma_ops sil_dma_
+               .udma_mask      = ATA_UDMA6,            \
+       }
+-static const struct ide_port_info siimage_chipsets[] __devinitdata = {
++static const struct ide_port_info siimage_chipsets[] __devinitconst = {
+       /* 0: SiI680 */  DECLARE_SII_DEV(&sil_pata_port_ops),
+       /* 1: SiI3112 */ DECLARE_SII_DEV(&sil_sata_port_ops)
+ };
+diff -urNp linux-3.1.3/drivers/ide/sis5513.c linux-3.1.3/drivers/ide/sis5513.c
+--- linux-3.1.3/drivers/ide/sis5513.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/sis5513.c  2011-11-16 18:39:07.000000000 -0500
+@@ -563,7 +563,7 @@ static const struct ide_port_ops sis_ata
+       .cable_detect           = sis_cable_detect,
+ };
+-static const struct ide_port_info sis5513_chipset __devinitdata = {
++static const struct ide_port_info sis5513_chipset __devinitconst = {
+       .name           = DRV_NAME,
+       .init_chipset   = init_chipset_sis5513,
+       .enablebits     = { {0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04} },
+diff -urNp linux-3.1.3/drivers/ide/sl82c105.c linux-3.1.3/drivers/ide/sl82c105.c
+--- linux-3.1.3/drivers/ide/sl82c105.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/sl82c105.c 2011-11-16 18:39:07.000000000 -0500
+@@ -299,7 +299,7 @@ static const struct ide_dma_ops sl82c105
+       .dma_sff_read_status    = ide_dma_sff_read_status,
+ };
+-static const struct ide_port_info sl82c105_chipset __devinitdata = {
++static const struct ide_port_info sl82c105_chipset __devinitconst = {
+       .name           = DRV_NAME,
+       .init_chipset   = init_chipset_sl82c105,
+       .enablebits     = {{0x40,0x01,0x01}, {0x40,0x10,0x10}},
+diff -urNp linux-3.1.3/drivers/ide/slc90e66.c linux-3.1.3/drivers/ide/slc90e66.c
+--- linux-3.1.3/drivers/ide/slc90e66.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/slc90e66.c 2011-11-16 18:39:07.000000000 -0500
+@@ -132,7 +132,7 @@ static const struct ide_port_ops slc90e6
+       .cable_detect           = slc90e66_cable_detect,
+ };
+-static const struct ide_port_info slc90e66_chipset __devinitdata = {
++static const struct ide_port_info slc90e66_chipset __devinitconst = {
+       .name           = DRV_NAME,
+       .enablebits     = { {0x41, 0x80, 0x80}, {0x43, 0x80, 0x80} },
+       .port_ops       = &slc90e66_port_ops,
+diff -urNp linux-3.1.3/drivers/ide/tc86c001.c linux-3.1.3/drivers/ide/tc86c001.c
+--- linux-3.1.3/drivers/ide/tc86c001.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/tc86c001.c 2011-11-16 18:39:07.000000000 -0500
+@@ -191,7 +191,7 @@ static const struct ide_dma_ops tc86c001
+       .dma_sff_read_status    = ide_dma_sff_read_status,
+ };
+-static const struct ide_port_info tc86c001_chipset __devinitdata = {
++static const struct ide_port_info tc86c001_chipset __devinitconst = {
+       .name           = DRV_NAME,
+       .init_hwif      = init_hwif_tc86c001,
+       .port_ops       = &tc86c001_port_ops,
+diff -urNp linux-3.1.3/drivers/ide/triflex.c linux-3.1.3/drivers/ide/triflex.c
+--- linux-3.1.3/drivers/ide/triflex.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/triflex.c  2011-11-16 18:39:07.000000000 -0500
+@@ -92,7 +92,7 @@ static const struct ide_port_ops triflex
+       .set_dma_mode           = triflex_set_mode,
+ };
+-static const struct ide_port_info triflex_device __devinitdata = {
++static const struct ide_port_info triflex_device __devinitconst = {
+       .name           = DRV_NAME,
+       .enablebits     = {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}},
+       .port_ops       = &triflex_port_ops,
+diff -urNp linux-3.1.3/drivers/ide/trm290.c linux-3.1.3/drivers/ide/trm290.c
+--- linux-3.1.3/drivers/ide/trm290.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/trm290.c   2011-11-16 18:39:07.000000000 -0500
+@@ -324,7 +324,7 @@ static struct ide_dma_ops trm290_dma_ops
+       .dma_check              = trm290_dma_check,
+ };
+-static const struct ide_port_info trm290_chipset __devinitdata = {
++static const struct ide_port_info trm290_chipset __devinitconst = {
+       .name           = DRV_NAME,
+       .init_hwif      = init_hwif_trm290,
+       .tp_ops         = &trm290_tp_ops,
+diff -urNp linux-3.1.3/drivers/ide/via82cxxx.c linux-3.1.3/drivers/ide/via82cxxx.c
+--- linux-3.1.3/drivers/ide/via82cxxx.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/ide/via82cxxx.c        2011-11-16 18:39:07.000000000 -0500
+@@ -403,7 +403,7 @@ static const struct ide_port_ops via_por
+       .cable_detect           = via82cxxx_cable_detect,
+ };
+-static const struct ide_port_info via82cxxx_chipset __devinitdata = {
++static const struct ide_port_info via82cxxx_chipset __devinitconst = {
+       .name           = DRV_NAME,
+       .init_chipset   = init_chipset_via82cxxx,
+       .enablebits     = { { 0x40, 0x02, 0x02 }, { 0x40, 0x01, 0x01 } },
+diff -urNp linux-3.1.3/drivers/infiniband/core/cm.c linux-3.1.3/drivers/infiniband/core/cm.c
+--- linux-3.1.3/drivers/infiniband/core/cm.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/infiniband/core/cm.c   2011-11-16 18:39:07.000000000 -0500
 @@ -113,7 +113,7 @@ static char const counter_group_names[CM
  
  struct cm_counter_group {
@@ -26215,9 +28297,9 @@ diff -urNp linux-3.0.4/drivers/infiniband/core/cm.c linux-3.0.4/drivers/infiniba
  }
  
  static const struct sysfs_ops cm_counter_ops = {
-diff -urNp linux-3.0.4/drivers/infiniband/core/fmr_pool.c linux-3.0.4/drivers/infiniband/core/fmr_pool.c
---- linux-3.0.4/drivers/infiniband/core/fmr_pool.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/infiniband/core/fmr_pool.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/infiniband/core/fmr_pool.c linux-3.1.3/drivers/infiniband/core/fmr_pool.c
+--- linux-3.1.3/drivers/infiniband/core/fmr_pool.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/infiniband/core/fmr_pool.c     2011-11-16 18:39:07.000000000 -0500
 @@ -97,8 +97,8 @@ struct ib_fmr_pool {
  
        struct task_struct       *thread;
@@ -26285,9 +28367,9 @@ diff -urNp linux-3.0.4/drivers/infiniband/core/fmr_pool.c linux-3.0.4/drivers/in
                                wake_up_process(pool->thread);
                        }
                }
-diff -urNp linux-3.0.4/drivers/infiniband/hw/cxgb4/mem.c linux-3.0.4/drivers/infiniband/hw/cxgb4/mem.c
---- linux-3.0.4/drivers/infiniband/hw/cxgb4/mem.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/infiniband/hw/cxgb4/mem.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/infiniband/hw/cxgb4/mem.c linux-3.1.3/drivers/infiniband/hw/cxgb4/mem.c
+--- linux-3.1.3/drivers/infiniband/hw/cxgb4/mem.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/infiniband/hw/cxgb4/mem.c      2011-11-16 18:39:07.000000000 -0500
 @@ -122,7 +122,7 @@ static int write_tpt_entry(struct c4iw_r
        int err;
        struct fw_ri_tpte tpt;
@@ -26306,9 +28388,9 @@ diff -urNp linux-3.0.4/drivers/infiniband/hw/cxgb4/mem.c linux-3.0.4/drivers/inf
        }
        PDBG("%s stag_state 0x%0x type 0x%0x pdid 0x%0x, stag_idx 0x%x\n",
             __func__, stag_state, type, pdid, stag_idx);
-diff -urNp linux-3.0.4/drivers/infiniband/hw/ipath/ipath_fs.c linux-3.0.4/drivers/infiniband/hw/ipath/ipath_fs.c
---- linux-3.0.4/drivers/infiniband/hw/ipath/ipath_fs.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/infiniband/hw/ipath/ipath_fs.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/infiniband/hw/ipath/ipath_fs.c linux-3.1.3/drivers/infiniband/hw/ipath/ipath_fs.c
+--- linux-3.1.3/drivers/infiniband/hw/ipath/ipath_fs.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/infiniband/hw/ipath/ipath_fs.c 2011-11-16 18:40:10.000000000 -0500
 @@ -113,6 +113,8 @@ static ssize_t atomic_counters_read(stru
        struct infinipath_counters counters;
        struct ipath_devdata *dd;
@@ -26318,9 +28400,9 @@ diff -urNp linux-3.0.4/drivers/infiniband/hw/ipath/ipath_fs.c linux-3.0.4/driver
        dd = file->f_path.dentry->d_inode->i_private;
        dd->ipath_f_read_counters(dd, &counters);
  
-diff -urNp linux-3.0.4/drivers/infiniband/hw/ipath/ipath_rc.c linux-3.0.4/drivers/infiniband/hw/ipath/ipath_rc.c
---- linux-3.0.4/drivers/infiniband/hw/ipath/ipath_rc.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/infiniband/hw/ipath/ipath_rc.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/infiniband/hw/ipath/ipath_rc.c linux-3.1.3/drivers/infiniband/hw/ipath/ipath_rc.c
+--- linux-3.1.3/drivers/infiniband/hw/ipath/ipath_rc.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/infiniband/hw/ipath/ipath_rc.c 2011-11-16 18:39:07.000000000 -0500
 @@ -1868,7 +1868,7 @@ void ipath_rc_rcv(struct ipath_ibdev *de
                struct ib_atomic_eth *ateth;
                struct ipath_ack_entry *e;
@@ -26344,9 +28426,9 @@ diff -urNp linux-3.0.4/drivers/infiniband/hw/ipath/ipath_rc.c linux-3.0.4/driver
                        (u64) cmpxchg((u64 *) qp->r_sge.sge.vaddr,
                                      be64_to_cpu(ateth->compare_data),
                                      sdata);
-diff -urNp linux-3.0.4/drivers/infiniband/hw/ipath/ipath_ruc.c linux-3.0.4/drivers/infiniband/hw/ipath/ipath_ruc.c
---- linux-3.0.4/drivers/infiniband/hw/ipath/ipath_ruc.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/infiniband/hw/ipath/ipath_ruc.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/infiniband/hw/ipath/ipath_ruc.c linux-3.1.3/drivers/infiniband/hw/ipath/ipath_ruc.c
+--- linux-3.1.3/drivers/infiniband/hw/ipath/ipath_ruc.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/infiniband/hw/ipath/ipath_ruc.c        2011-11-16 18:39:07.000000000 -0500
 @@ -266,7 +266,7 @@ static void ipath_ruc_loopback(struct ip
        unsigned long flags;
        struct ib_wc wc;
@@ -26370,9 +28452,9 @@ diff -urNp linux-3.0.4/drivers/infiniband/hw/ipath/ipath_ruc.c linux-3.0.4/drive
                        (u64) cmpxchg((u64 *) qp->r_sge.sge.vaddr,
                                      sdata, wqe->wr.wr.atomic.swap);
                goto send_comp;
-diff -urNp linux-3.0.4/drivers/infiniband/hw/nes/nes.c linux-3.0.4/drivers/infiniband/hw/nes/nes.c
---- linux-3.0.4/drivers/infiniband/hw/nes/nes.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/infiniband/hw/nes/nes.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes.c linux-3.1.3/drivers/infiniband/hw/nes/nes.c
+--- linux-3.1.3/drivers/infiniband/hw/nes/nes.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/infiniband/hw/nes/nes.c        2011-11-16 18:39:07.000000000 -0500
 @@ -103,7 +103,7 @@ MODULE_PARM_DESC(limit_maxrdreqsz, "Limi
  LIST_HEAD(nes_adapter_list);
  static LIST_HEAD(nes_dev_list);
@@ -26391,9 +28473,9 @@ diff -urNp linux-3.0.4/drivers/infiniband/hw/nes/nes.c linux-3.0.4/drivers/infin
  
        /* Free the control structures */
  
-diff -urNp linux-3.0.4/drivers/infiniband/hw/nes/nes_cm.c linux-3.0.4/drivers/infiniband/hw/nes/nes_cm.c
---- linux-3.0.4/drivers/infiniband/hw/nes/nes_cm.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/infiniband/hw/nes/nes_cm.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c
+--- linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/infiniband/hw/nes/nes_cm.c     2011-11-16 18:39:07.000000000 -0500
 @@ -68,14 +68,14 @@ u32 cm_packets_dropped;
  u32 cm_packets_retrans;
  u32 cm_packets_created;
@@ -26590,9 +28672,9 @@ diff -urNp linux-3.0.4/drivers/infiniband/hw/nes/nes_cm.c linux-3.0.4/drivers/in
        nes_debug(NES_DBG_CM, "cm_node = %p - cm_id = %p, jiffies = %lu\n",
                        cm_node, cm_id, jiffies);
  
-diff -urNp linux-3.0.4/drivers/infiniband/hw/nes/nes.h linux-3.0.4/drivers/infiniband/hw/nes/nes.h
---- linux-3.0.4/drivers/infiniband/hw/nes/nes.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/infiniband/hw/nes/nes.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes.h linux-3.1.3/drivers/infiniband/hw/nes/nes.h
+--- linux-3.1.3/drivers/infiniband/hw/nes/nes.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/infiniband/hw/nes/nes.h        2011-11-16 18:39:07.000000000 -0500
 @@ -175,17 +175,17 @@ extern unsigned int nes_debug_level;
  extern unsigned int wqm_quanta;
  extern struct list_head nes_adapter_list;
@@ -26644,9 +28726,9 @@ diff -urNp linux-3.0.4/drivers/infiniband/hw/nes/nes.h linux-3.0.4/drivers/infin
  
  extern u32 int_mod_timer_init;
  extern u32 int_mod_cq_depth_256;
-diff -urNp linux-3.0.4/drivers/infiniband/hw/nes/nes_nic.c linux-3.0.4/drivers/infiniband/hw/nes/nes_nic.c
---- linux-3.0.4/drivers/infiniband/hw/nes/nes_nic.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/infiniband/hw/nes/nes_nic.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_nic.c linux-3.1.3/drivers/infiniband/hw/nes/nes_nic.c
+--- linux-3.1.3/drivers/infiniband/hw/nes/nes_nic.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/infiniband/hw/nes/nes_nic.c    2011-11-16 18:39:07.000000000 -0500
 @@ -1274,31 +1274,31 @@ static void nes_netdev_get_ethtool_stats
        target_stat_values[++index] = mh_detected;
        target_stat_values[++index] = mh_pauses_sent;
@@ -26697,9 +28779,9 @@ diff -urNp linux-3.0.4/drivers/infiniband/hw/nes/nes_nic.c linux-3.0.4/drivers/i
        target_stat_values[++index] = nesadapter->free_4kpbl;
        target_stat_values[++index] = nesadapter->free_256pbl;
        target_stat_values[++index] = int_mod_timer_init;
-diff -urNp linux-3.0.4/drivers/infiniband/hw/nes/nes_verbs.c linux-3.0.4/drivers/infiniband/hw/nes/nes_verbs.c
---- linux-3.0.4/drivers/infiniband/hw/nes/nes_verbs.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/infiniband/hw/nes/nes_verbs.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/infiniband/hw/nes/nes_verbs.c linux-3.1.3/drivers/infiniband/hw/nes/nes_verbs.c
+--- linux-3.1.3/drivers/infiniband/hw/nes/nes_verbs.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/infiniband/hw/nes/nes_verbs.c  2011-11-16 18:39:07.000000000 -0500
 @@ -46,9 +46,9 @@
  
  #include <rdma/ib_umem.h>
@@ -26713,7 +28795,7 @@ diff -urNp linux-3.0.4/drivers/infiniband/hw/nes/nes_verbs.c linux-3.0.4/drivers
  
  static void nes_unregister_ofa_device(struct nes_ib_device *nesibdev);
  
-@@ -1141,7 +1141,7 @@ static struct ib_qp *nes_create_qp(struc
+@@ -1131,7 +1131,7 @@ static struct ib_qp *nes_create_qp(struc
        if (init_attr->create_flags)
                return ERR_PTR(-EINVAL);
  
@@ -26722,7 +28804,7 @@ diff -urNp linux-3.0.4/drivers/infiniband/hw/nes/nes_verbs.c linux-3.0.4/drivers
        switch (init_attr->qp_type) {
                case IB_QPT_RC:
                        if (nes_drv_opt & NES_DRV_OPT_NO_INLINE_DATA) {
-@@ -1470,7 +1470,7 @@ static int nes_destroy_qp(struct ib_qp *
+@@ -1460,7 +1460,7 @@ static int nes_destroy_qp(struct ib_qp *
        struct iw_cm_event cm_event;
        int ret;
  
@@ -26731,9 +28813,9 @@ diff -urNp linux-3.0.4/drivers/infiniband/hw/nes/nes_verbs.c linux-3.0.4/drivers
        nesqp->destroyed = 1;
  
        /* Blow away the connection if it exists. */
-diff -urNp linux-3.0.4/drivers/infiniband/hw/qib/qib.h linux-3.0.4/drivers/infiniband/hw/qib/qib.h
---- linux-3.0.4/drivers/infiniband/hw/qib/qib.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/infiniband/hw/qib/qib.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/infiniband/hw/qib/qib.h linux-3.1.3/drivers/infiniband/hw/qib/qib.h
+--- linux-3.1.3/drivers/infiniband/hw/qib/qib.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/infiniband/hw/qib/qib.h        2011-11-16 18:39:07.000000000 -0500
 @@ -51,6 +51,7 @@
  #include <linux/completion.h>
  #include <linux/kref.h>
@@ -26742,9 +28824,9 @@ diff -urNp linux-3.0.4/drivers/infiniband/hw/qib/qib.h linux-3.0.4/drivers/infin
  
  #include "qib_common.h"
  #include "qib_verbs.h"
-diff -urNp linux-3.0.4/drivers/input/gameport/gameport.c linux-3.0.4/drivers/input/gameport/gameport.c
---- linux-3.0.4/drivers/input/gameport/gameport.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/input/gameport/gameport.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/input/gameport/gameport.c linux-3.1.3/drivers/input/gameport/gameport.c
+--- linux-3.1.3/drivers/input/gameport/gameport.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/input/gameport/gameport.c      2011-11-16 18:39:07.000000000 -0500
 @@ -488,14 +488,14 @@ EXPORT_SYMBOL(gameport_set_phys);
   */
  static void gameport_init_port(struct gameport *gameport)
@@ -26762,9 +28844,9 @@ diff -urNp linux-3.0.4/drivers/input/gameport/gameport.c linux-3.0.4/drivers/inp
        gameport->dev.bus = &gameport_bus;
        gameport->dev.release = gameport_release_port;
        if (gameport->parent)
-diff -urNp linux-3.0.4/drivers/input/input.c linux-3.0.4/drivers/input/input.c
---- linux-3.0.4/drivers/input/input.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/input/input.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/input/input.c linux-3.1.3/drivers/input/input.c
+--- linux-3.1.3/drivers/input/input.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/input/input.c  2011-11-16 18:39:07.000000000 -0500
 @@ -1814,7 +1814,7 @@ static void input_cleanse_bitmasks(struc
   */
  int input_register_device(struct input_dev *dev)
@@ -26783,9 +28865,9 @@ diff -urNp linux-3.0.4/drivers/input/input.c linux-3.0.4/drivers/input/input.c
  
        error = device_add(&dev->dev);
        if (error)
-diff -urNp linux-3.0.4/drivers/input/joystick/sidewinder.c linux-3.0.4/drivers/input/joystick/sidewinder.c
---- linux-3.0.4/drivers/input/joystick/sidewinder.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/input/joystick/sidewinder.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/input/joystick/sidewinder.c linux-3.1.3/drivers/input/joystick/sidewinder.c
+--- linux-3.1.3/drivers/input/joystick/sidewinder.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/input/joystick/sidewinder.c    2011-11-16 18:40:10.000000000 -0500
 @@ -30,6 +30,7 @@
  #include <linux/kernel.h>
  #include <linux/module.h>
@@ -26803,10 +28885,10 @@ diff -urNp linux-3.0.4/drivers/input/joystick/sidewinder.c linux-3.0.4/drivers/i
        i = sw_read_packet(sw->gameport, buf, sw->length, 0);
  
        if (sw->type == SW_ID_3DP && sw->length == 66 && i != 66) {             /* Broken packet, try to fix */
-diff -urNp linux-3.0.4/drivers/input/joystick/xpad.c linux-3.0.4/drivers/input/joystick/xpad.c
---- linux-3.0.4/drivers/input/joystick/xpad.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/input/joystick/xpad.c  2011-08-23 21:47:55.000000000 -0400
-@@ -689,7 +689,7 @@ static void xpad_led_set(struct led_clas
+diff -urNp linux-3.1.3/drivers/input/joystick/xpad.c linux-3.1.3/drivers/input/joystick/xpad.c
+--- linux-3.1.3/drivers/input/joystick/xpad.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/input/joystick/xpad.c  2011-11-16 18:39:07.000000000 -0500
+@@ -710,7 +710,7 @@ static void xpad_led_set(struct led_clas
  
  static int xpad_led_probe(struct usb_xpad *xpad)
  {
@@ -26815,7 +28897,7 @@ diff -urNp linux-3.0.4/drivers/input/joystick/xpad.c linux-3.0.4/drivers/input/j
        long led_no;
        struct xpad_led *led;
        struct led_classdev *led_cdev;
-@@ -702,7 +702,7 @@ static int xpad_led_probe(struct usb_xpa
+@@ -723,7 +723,7 @@ static int xpad_led_probe(struct usb_xpa
        if (!led)
                return -ENOMEM;
  
@@ -26824,9 +28906,9 @@ diff -urNp linux-3.0.4/drivers/input/joystick/xpad.c linux-3.0.4/drivers/input/j
  
        snprintf(led->name, sizeof(led->name), "xpad%ld", led_no);
        led->xpad = xpad;
-diff -urNp linux-3.0.4/drivers/input/mousedev.c linux-3.0.4/drivers/input/mousedev.c
---- linux-3.0.4/drivers/input/mousedev.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/input/mousedev.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/input/mousedev.c linux-3.1.3/drivers/input/mousedev.c
+--- linux-3.1.3/drivers/input/mousedev.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/input/mousedev.c       2011-11-16 18:39:07.000000000 -0500
 @@ -763,7 +763,7 @@ static ssize_t mousedev_read(struct file
  
        spin_unlock_irq(&client->packet_lock);
@@ -26836,9 +28918,9 @@ diff -urNp linux-3.0.4/drivers/input/mousedev.c linux-3.0.4/drivers/input/moused
                return -EFAULT;
  
        return count;
-diff -urNp linux-3.0.4/drivers/input/serio/serio.c linux-3.0.4/drivers/input/serio/serio.c
---- linux-3.0.4/drivers/input/serio/serio.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/input/serio/serio.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/input/serio/serio.c linux-3.1.3/drivers/input/serio/serio.c
+--- linux-3.1.3/drivers/input/serio/serio.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/input/serio/serio.c    2011-11-16 18:39:07.000000000 -0500
 @@ -497,7 +497,7 @@ static void serio_release_port(struct de
   */
  static void serio_init_port(struct serio *serio)
@@ -26857,9 +28939,9 @@ diff -urNp linux-3.0.4/drivers/input/serio/serio.c linux-3.0.4/drivers/input/ser
        serio->dev.bus = &serio_bus;
        serio->dev.release = serio_release_port;
        serio->dev.groups = serio_device_attr_groups;
-diff -urNp linux-3.0.4/drivers/isdn/capi/capi.c linux-3.0.4/drivers/isdn/capi/capi.c
---- linux-3.0.4/drivers/isdn/capi/capi.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/isdn/capi/capi.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/isdn/capi/capi.c linux-3.1.3/drivers/isdn/capi/capi.c
+--- linux-3.1.3/drivers/isdn/capi/capi.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/isdn/capi/capi.c       2011-11-16 18:39:07.000000000 -0500
 @@ -83,8 +83,8 @@ struct capiminor {
  
        struct capi20_appl      *ap;
@@ -26897,9 +28979,9 @@ diff -urNp linux-3.0.4/drivers/isdn/capi/capi.c linux-3.0.4/drivers/isdn/capi/ca
                capimsg_setu32(skb->data, 8, mp->ncci); /* NCCI */
                capimsg_setu32(skb->data, 12, (u32)(long)skb->data);/* Data32 */
                capimsg_setu16(skb->data, 16, len);     /* Data length */
-diff -urNp linux-3.0.4/drivers/isdn/gigaset/common.c linux-3.0.4/drivers/isdn/gigaset/common.c
---- linux-3.0.4/drivers/isdn/gigaset/common.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/isdn/gigaset/common.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/isdn/gigaset/common.c linux-3.1.3/drivers/isdn/gigaset/common.c
+--- linux-3.1.3/drivers/isdn/gigaset/common.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/isdn/gigaset/common.c  2011-11-16 18:39:07.000000000 -0500
 @@ -723,7 +723,7 @@ struct cardstate *gigaset_initcs(struct 
        cs->commands_pending = 0;
        cs->cur_at_seq = 0;
@@ -26909,13 +28991,13 @@ diff -urNp linux-3.0.4/drivers/isdn/gigaset/common.c linux-3.0.4/drivers/isdn/gi
        cs->dev = NULL;
        cs->tty = NULL;
        cs->tty_dev = NULL;
-diff -urNp linux-3.0.4/drivers/isdn/gigaset/gigaset.h linux-3.0.4/drivers/isdn/gigaset/gigaset.h
---- linux-3.0.4/drivers/isdn/gigaset/gigaset.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/isdn/gigaset/gigaset.h 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/isdn/gigaset/gigaset.h linux-3.1.3/drivers/isdn/gigaset/gigaset.h
+--- linux-3.1.3/drivers/isdn/gigaset/gigaset.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/isdn/gigaset/gigaset.h 2011-11-16 18:39:07.000000000 -0500
 @@ -35,6 +35,7 @@
  #include <linux/tty_driver.h>
  #include <linux/list.h>
- #include <asm/atomic.h>
+ #include <linux/atomic.h>
 +#include <asm/local.h>
  
  #define GIG_VERSION {0, 5, 0, 0}
@@ -26929,9 +29011,9 @@ diff -urNp linux-3.0.4/drivers/isdn/gigaset/gigaset.h linux-3.0.4/drivers/isdn/g
        struct tty_struct *tty;
        struct tasklet_struct if_wake_tasklet;
        unsigned control_state;
-diff -urNp linux-3.0.4/drivers/isdn/gigaset/interface.c linux-3.0.4/drivers/isdn/gigaset/interface.c
---- linux-3.0.4/drivers/isdn/gigaset/interface.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/isdn/gigaset/interface.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/isdn/gigaset/interface.c linux-3.1.3/drivers/isdn/gigaset/interface.c
+--- linux-3.1.3/drivers/isdn/gigaset/interface.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/isdn/gigaset/interface.c       2011-11-16 18:39:07.000000000 -0500
 @@ -162,9 +162,7 @@ static int if_open(struct tty_struct *tt
        }
        tty->driver_data = cs;
@@ -27019,9 +29101,9 @@ diff -urNp linux-3.0.4/drivers/isdn/gigaset/interface.c linux-3.0.4/drivers/isdn
                dev_warn(cs->dev, "%s: device not opened\n", __func__);
                goto out;
        }
-diff -urNp linux-3.0.4/drivers/isdn/hardware/avm/b1.c linux-3.0.4/drivers/isdn/hardware/avm/b1.c
---- linux-3.0.4/drivers/isdn/hardware/avm/b1.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/isdn/hardware/avm/b1.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/isdn/hardware/avm/b1.c linux-3.1.3/drivers/isdn/hardware/avm/b1.c
+--- linux-3.1.3/drivers/isdn/hardware/avm/b1.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/isdn/hardware/avm/b1.c 2011-11-16 18:39:07.000000000 -0500
 @@ -176,7 +176,7 @@ int b1_load_t4file(avmcard *card, capilo
        }
        if (left) {
@@ -27040,9 +29122,9 @@ diff -urNp linux-3.0.4/drivers/isdn/hardware/avm/b1.c linux-3.0.4/drivers/isdn/h
                                return -EFAULT;
                } else {
                        memcpy(buf, dp, left);
-diff -urNp linux-3.0.4/drivers/isdn/hardware/eicon/capidtmf.c linux-3.0.4/drivers/isdn/hardware/eicon/capidtmf.c
---- linux-3.0.4/drivers/isdn/hardware/eicon/capidtmf.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/isdn/hardware/eicon/capidtmf.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/capidtmf.c linux-3.1.3/drivers/isdn/hardware/eicon/capidtmf.c
+--- linux-3.1.3/drivers/isdn/hardware/eicon/capidtmf.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/isdn/hardware/eicon/capidtmf.c 2011-11-16 18:40:10.000000000 -0500
 @@ -498,6 +498,7 @@ void capidtmf_recv_block (t_capidtmf_sta
    byte goertzel_result_buffer[CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT];
      short windowed_sample_buffer[CAPIDTMF_RECV_WINDOWED_SAMPLES];
@@ -27051,9 +29133,9 @@ diff -urNp linux-3.0.4/drivers/isdn/hardware/eicon/capidtmf.c linux-3.0.4/driver
  
    if (p_state->recv.state & CAPIDTMF_RECV_STATE_DTMF_ACTIVE)
    {
-diff -urNp linux-3.0.4/drivers/isdn/hardware/eicon/capifunc.c linux-3.0.4/drivers/isdn/hardware/eicon/capifunc.c
---- linux-3.0.4/drivers/isdn/hardware/eicon/capifunc.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/isdn/hardware/eicon/capifunc.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/capifunc.c linux-3.1.3/drivers/isdn/hardware/eicon/capifunc.c
+--- linux-3.1.3/drivers/isdn/hardware/eicon/capifunc.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/isdn/hardware/eicon/capifunc.c 2011-11-16 18:40:10.000000000 -0500
 @@ -1055,6 +1055,8 @@ static int divacapi_connect_didd(void)
        IDI_SYNC_REQ req;
        DESCRIPTOR DIDD_Table[MAX_DESCRIPTORS];
@@ -27063,9 +29145,9 @@ diff -urNp linux-3.0.4/drivers/isdn/hardware/eicon/capifunc.c linux-3.0.4/driver
        DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table));
  
        for (x = 0; x < MAX_DESCRIPTORS; x++) {
-diff -urNp linux-3.0.4/drivers/isdn/hardware/eicon/diddfunc.c linux-3.0.4/drivers/isdn/hardware/eicon/diddfunc.c
---- linux-3.0.4/drivers/isdn/hardware/eicon/diddfunc.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/isdn/hardware/eicon/diddfunc.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/diddfunc.c linux-3.1.3/drivers/isdn/hardware/eicon/diddfunc.c
+--- linux-3.1.3/drivers/isdn/hardware/eicon/diddfunc.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/isdn/hardware/eicon/diddfunc.c 2011-11-16 18:40:10.000000000 -0500
 @@ -54,6 +54,8 @@ static int DIVA_INIT_FUNCTION connect_di
        IDI_SYNC_REQ req;
        DESCRIPTOR DIDD_Table[MAX_DESCRIPTORS];
@@ -27075,9 +29157,9 @@ diff -urNp linux-3.0.4/drivers/isdn/hardware/eicon/diddfunc.c linux-3.0.4/driver
        DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table));
  
        for (x = 0; x < MAX_DESCRIPTORS; x++) {
-diff -urNp linux-3.0.4/drivers/isdn/hardware/eicon/divasfunc.c linux-3.0.4/drivers/isdn/hardware/eicon/divasfunc.c
---- linux-3.0.4/drivers/isdn/hardware/eicon/divasfunc.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/isdn/hardware/eicon/divasfunc.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/divasfunc.c linux-3.1.3/drivers/isdn/hardware/eicon/divasfunc.c
+--- linux-3.1.3/drivers/isdn/hardware/eicon/divasfunc.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/isdn/hardware/eicon/divasfunc.c        2011-11-16 18:40:10.000000000 -0500
 @@ -160,6 +160,8 @@ static int DIVA_INIT_FUNCTION connect_di
        IDI_SYNC_REQ req;
        DESCRIPTOR DIDD_Table[MAX_DESCRIPTORS];
@@ -27087,9 +29169,9 @@ diff -urNp linux-3.0.4/drivers/isdn/hardware/eicon/divasfunc.c linux-3.0.4/drive
        DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table));
  
        for (x = 0; x < MAX_DESCRIPTORS; x++) {
-diff -urNp linux-3.0.4/drivers/isdn/hardware/eicon/divasync.h linux-3.0.4/drivers/isdn/hardware/eicon/divasync.h
---- linux-3.0.4/drivers/isdn/hardware/eicon/divasync.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/isdn/hardware/eicon/divasync.h 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/divasync.h linux-3.1.3/drivers/isdn/hardware/eicon/divasync.h
+--- linux-3.1.3/drivers/isdn/hardware/eicon/divasync.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/isdn/hardware/eicon/divasync.h 2011-11-16 18:39:07.000000000 -0500
 @@ -146,7 +146,7 @@ typedef struct _diva_didd_add_adapter {
  } diva_didd_add_adapter_t;
  typedef struct _diva_didd_remove_adapter {
@@ -27099,9 +29181,9 @@ diff -urNp linux-3.0.4/drivers/isdn/hardware/eicon/divasync.h linux-3.0.4/driver
  typedef struct _diva_didd_read_adapter_array {
   void   * buffer;
   dword length;
-diff -urNp linux-3.0.4/drivers/isdn/hardware/eicon/idifunc.c linux-3.0.4/drivers/isdn/hardware/eicon/idifunc.c
---- linux-3.0.4/drivers/isdn/hardware/eicon/idifunc.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/isdn/hardware/eicon/idifunc.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/idifunc.c linux-3.1.3/drivers/isdn/hardware/eicon/idifunc.c
+--- linux-3.1.3/drivers/isdn/hardware/eicon/idifunc.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/isdn/hardware/eicon/idifunc.c  2011-11-16 18:40:10.000000000 -0500
 @@ -188,6 +188,8 @@ static int DIVA_INIT_FUNCTION connect_di
        IDI_SYNC_REQ req;
        DESCRIPTOR DIDD_Table[MAX_DESCRIPTORS];
@@ -27111,9 +29193,9 @@ diff -urNp linux-3.0.4/drivers/isdn/hardware/eicon/idifunc.c linux-3.0.4/drivers
        DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table));
  
        for (x = 0; x < MAX_DESCRIPTORS; x++) {
-diff -urNp linux-3.0.4/drivers/isdn/hardware/eicon/message.c linux-3.0.4/drivers/isdn/hardware/eicon/message.c
---- linux-3.0.4/drivers/isdn/hardware/eicon/message.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/isdn/hardware/eicon/message.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/message.c linux-3.1.3/drivers/isdn/hardware/eicon/message.c
+--- linux-3.1.3/drivers/isdn/hardware/eicon/message.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/isdn/hardware/eicon/message.c  2011-11-16 18:40:10.000000000 -0500
 @@ -4886,6 +4886,8 @@ static void sig_ind(PLCI *plci)
    dword d;
    word w;
@@ -27150,9 +29232,9 @@ diff -urNp linux-3.0.4/drivers/isdn/hardware/eicon/message.c linux-3.0.4/drivers
    set_group_ind_mask (plci); /* all APPLs within this inc. call are allowed to dial in */
  
    if(!a->group_optimization_enabled)
-diff -urNp linux-3.0.4/drivers/isdn/hardware/eicon/mntfunc.c linux-3.0.4/drivers/isdn/hardware/eicon/mntfunc.c
---- linux-3.0.4/drivers/isdn/hardware/eicon/mntfunc.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/isdn/hardware/eicon/mntfunc.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/mntfunc.c linux-3.1.3/drivers/isdn/hardware/eicon/mntfunc.c
+--- linux-3.1.3/drivers/isdn/hardware/eicon/mntfunc.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/isdn/hardware/eicon/mntfunc.c  2011-11-16 18:40:10.000000000 -0500
 @@ -79,6 +79,8 @@ static int DIVA_INIT_FUNCTION connect_di
        IDI_SYNC_REQ req;
        DESCRIPTOR DIDD_Table[MAX_DESCRIPTORS];
@@ -27162,9 +29244,9 @@ diff -urNp linux-3.0.4/drivers/isdn/hardware/eicon/mntfunc.c linux-3.0.4/drivers
        DIVA_DIDD_Read(DIDD_Table, sizeof(DIDD_Table));
  
        for (x = 0; x < MAX_DESCRIPTORS; x++) {
-diff -urNp linux-3.0.4/drivers/isdn/hardware/eicon/xdi_adapter.h linux-3.0.4/drivers/isdn/hardware/eicon/xdi_adapter.h
---- linux-3.0.4/drivers/isdn/hardware/eicon/xdi_adapter.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/isdn/hardware/eicon/xdi_adapter.h      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/isdn/hardware/eicon/xdi_adapter.h linux-3.1.3/drivers/isdn/hardware/eicon/xdi_adapter.h
+--- linux-3.1.3/drivers/isdn/hardware/eicon/xdi_adapter.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/isdn/hardware/eicon/xdi_adapter.h      2011-11-16 18:39:07.000000000 -0500
 @@ -44,7 +44,7 @@ typedef struct _xdi_mbox_t {
  typedef struct _diva_os_idi_adapter_interface {
        diva_init_card_proc_t cleanup_adapter_proc;
@@ -27174,9 +29256,9 @@ diff -urNp linux-3.0.4/drivers/isdn/hardware/eicon/xdi_adapter.h linux-3.0.4/dri
  
  typedef struct _diva_os_xdi_adapter {
        struct list_head link;
-diff -urNp linux-3.0.4/drivers/isdn/i4l/isdn_common.c linux-3.0.4/drivers/isdn/i4l/isdn_common.c
---- linux-3.0.4/drivers/isdn/i4l/isdn_common.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/isdn/i4l/isdn_common.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/isdn/i4l/isdn_common.c linux-3.1.3/drivers/isdn/i4l/isdn_common.c
+--- linux-3.1.3/drivers/isdn/i4l/isdn_common.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/isdn/i4l/isdn_common.c 2011-11-16 18:40:10.000000000 -0500
 @@ -1286,6 +1286,8 @@ isdn_ioctl(struct file *file, uint cmd, 
        } iocpar;
        void __user *argp = (void __user *)arg;
@@ -27186,9 +29268,9 @@ diff -urNp linux-3.0.4/drivers/isdn/i4l/isdn_common.c linux-3.0.4/drivers/isdn/i
  #define name  iocpar.name
  #define bname iocpar.bname
  #define iocts iocpar.iocts
-diff -urNp linux-3.0.4/drivers/isdn/icn/icn.c linux-3.0.4/drivers/isdn/icn/icn.c
---- linux-3.0.4/drivers/isdn/icn/icn.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/isdn/icn/icn.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/isdn/icn/icn.c linux-3.1.3/drivers/isdn/icn/icn.c
+--- linux-3.1.3/drivers/isdn/icn/icn.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/isdn/icn/icn.c 2011-11-16 18:39:07.000000000 -0500
 @@ -1045,7 +1045,7 @@ icn_writecmd(const u_char * buf, int len
                if (count > len)
                        count = len;
@@ -27198,9 +29280,9 @@ diff -urNp linux-3.0.4/drivers/isdn/icn/icn.c linux-3.0.4/drivers/isdn/icn/icn.c
                                return -EFAULT;
                } else
                        memcpy(msg, buf, count);
-diff -urNp linux-3.0.4/drivers/lguest/core.c linux-3.0.4/drivers/lguest/core.c
---- linux-3.0.4/drivers/lguest/core.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/lguest/core.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/lguest/core.c linux-3.1.3/drivers/lguest/core.c
+--- linux-3.1.3/drivers/lguest/core.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/lguest/core.c  2011-11-16 18:39:07.000000000 -0500
 @@ -92,9 +92,17 @@ static __init int map_switcher(void)
         * it's worked so far.  The end address needs +1 because __get_vm_area
         * allocates an extra guard page, so we need space for that.
@@ -27221,16 +29303,16 @@ diff -urNp linux-3.0.4/drivers/lguest/core.c linux-3.0.4/drivers/lguest/core.c
                printk("lguest: could not map switcher pages high\n");
 @@ -119,7 +127,7 @@ static __init int map_switcher(void)
         * Now the Switcher is mapped at the right address, we can't fail!
-        * Copy in the compiled-in Switcher code (from <arch>_switcher.S).
+        * Copy in the compiled-in Switcher code (from x86/switcher_32.S).
         */
 -      memcpy(switcher_vma->addr, start_switcher_text,
 +      memcpy(switcher_vma->addr, ktla_ktva(start_switcher_text),
               end_switcher_text - start_switcher_text);
  
        printk(KERN_INFO "lguest: mapped switcher at %p\n",
-diff -urNp linux-3.0.4/drivers/lguest/x86/core.c linux-3.0.4/drivers/lguest/x86/core.c
---- linux-3.0.4/drivers/lguest/x86/core.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/lguest/x86/core.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/lguest/x86/core.c linux-3.1.3/drivers/lguest/x86/core.c
+--- linux-3.1.3/drivers/lguest/x86/core.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/lguest/x86/core.c      2011-11-16 18:39:07.000000000 -0500
 @@ -59,7 +59,7 @@ static struct {
  /* Offset from where switcher.S was compiled to where we've copied it */
  static unsigned long switcher_offset(void)
@@ -27254,7 +29336,7 @@ diff -urNp linux-3.0.4/drivers/lguest/x86/core.c linux-3.0.4/drivers/lguest/x86/
        /*
         * Set up the Guest's page tables to see this CPU's pages (and no
         * other CPU's pages).
-@@ -547,7 +553,7 @@ void __init lguest_arch_host_init(void)
+@@ -472,7 +478,7 @@ void __init lguest_arch_host_init(void)
         * compiled-in switcher code and the high-mapped copy we just made.
         */
        for (i = 0; i < IDT_ENTRIES; i++)
@@ -27263,7 +29345,7 @@ diff -urNp linux-3.0.4/drivers/lguest/x86/core.c linux-3.0.4/drivers/lguest/x86/
  
        /*
         * Set up the Switcher's per-cpu areas.
-@@ -630,7 +636,7 @@ void __init lguest_arch_host_init(void)
+@@ -555,7 +561,7 @@ void __init lguest_arch_host_init(void)
         * it will be undisturbed when we switch.  To change %cs and jump we
         * need this structure to feed to Intel's "lcall" instruction.
         */
@@ -27272,9 +29354,9 @@ diff -urNp linux-3.0.4/drivers/lguest/x86/core.c linux-3.0.4/drivers/lguest/x86/
        lguest_entry.segment = LGUEST_CS;
  
        /*
-diff -urNp linux-3.0.4/drivers/lguest/x86/switcher_32.S linux-3.0.4/drivers/lguest/x86/switcher_32.S
---- linux-3.0.4/drivers/lguest/x86/switcher_32.S       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/lguest/x86/switcher_32.S       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/lguest/x86/switcher_32.S linux-3.1.3/drivers/lguest/x86/switcher_32.S
+--- linux-3.1.3/drivers/lguest/x86/switcher_32.S       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/lguest/x86/switcher_32.S       2011-11-16 18:39:07.000000000 -0500
 @@ -87,6 +87,7 @@
  #include <asm/page.h>
  #include <asm/segment.h>
@@ -27333,10 +29415,22 @@ diff -urNp linux-3.0.4/drivers/lguest/x86/switcher_32.S linux-3.0.4/drivers/lgue
  
  // Every interrupt can come to us here
  // But we must truly tell each apart.
-diff -urNp linux-3.0.4/drivers/md/dm.c linux-3.0.4/drivers/md/dm.c
---- linux-3.0.4/drivers/md/dm.c        2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/md/dm.c        2011-08-23 21:47:55.000000000 -0400
-@@ -164,9 +164,9 @@ struct mapped_device {
+diff -urNp linux-3.1.3/drivers/macintosh/macio_asic.c linux-3.1.3/drivers/macintosh/macio_asic.c
+--- linux-3.1.3/drivers/macintosh/macio_asic.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/macintosh/macio_asic.c 2011-11-16 18:39:07.000000000 -0500
+@@ -748,7 +748,7 @@ static void __devexit macio_pci_remove(s
+  * MacIO is matched against any Apple ID, it's probe() function
+  * will then decide wether it applies or not
+  */
+-static const struct pci_device_id __devinitdata pci_ids [] = { {
++static const struct pci_device_id __devinitconst pci_ids [] = { {
+       .vendor         = PCI_VENDOR_ID_APPLE,
+       .device         = PCI_ANY_ID,
+       .subvendor      = PCI_ANY_ID,
+diff -urNp linux-3.1.3/drivers/md/dm.c linux-3.1.3/drivers/md/dm.c
+--- linux-3.1.3/drivers/md/dm.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/md/dm.c        2011-11-16 18:39:07.000000000 -0500
+@@ -165,9 +165,9 @@ struct mapped_device {
        /*
         * Event handling.
         */
@@ -27348,7 +29442,7 @@ diff -urNp linux-3.0.4/drivers/md/dm.c linux-3.0.4/drivers/md/dm.c
        struct list_head uevent_list;
        spinlock_t uevent_lock; /* Protect access to uevent_list */
  
-@@ -1842,8 +1842,8 @@ static struct mapped_device *alloc_dev(i
+@@ -1843,8 +1843,8 @@ static struct mapped_device *alloc_dev(i
        rwlock_init(&md->map_lock);
        atomic_set(&md->holders, 1);
        atomic_set(&md->open_count, 0);
@@ -27359,7 +29453,7 @@ diff -urNp linux-3.0.4/drivers/md/dm.c linux-3.0.4/drivers/md/dm.c
        INIT_LIST_HEAD(&md->uevent_list);
        spin_lock_init(&md->uevent_lock);
  
-@@ -1977,7 +1977,7 @@ static void event_callback(void *context
+@@ -1978,7 +1978,7 @@ static void event_callback(void *context
  
        dm_send_uevents(&uevents, &disk_to_dev(md->disk)->kobj);
  
@@ -27368,7 +29462,7 @@ diff -urNp linux-3.0.4/drivers/md/dm.c linux-3.0.4/drivers/md/dm.c
        wake_up(&md->eventq);
  }
  
-@@ -2553,18 +2553,18 @@ int dm_kobject_uevent(struct mapped_devi
+@@ -2614,18 +2614,18 @@ int dm_kobject_uevent(struct mapped_devi
  
  uint32_t dm_next_uevent_seq(struct mapped_device *md)
  {
@@ -27390,10 +29484,10 @@ diff -urNp linux-3.0.4/drivers/md/dm.c linux-3.0.4/drivers/md/dm.c
  }
  
  void dm_uevent_add(struct mapped_device *md, struct list_head *elist)
-diff -urNp linux-3.0.4/drivers/md/dm-ioctl.c linux-3.0.4/drivers/md/dm-ioctl.c
---- linux-3.0.4/drivers/md/dm-ioctl.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/md/dm-ioctl.c  2011-08-23 21:47:55.000000000 -0400
-@@ -1551,7 +1551,7 @@ static int validate_params(uint cmd, str
+diff -urNp linux-3.1.3/drivers/md/dm-ioctl.c linux-3.1.3/drivers/md/dm-ioctl.c
+--- linux-3.1.3/drivers/md/dm-ioctl.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/md/dm-ioctl.c  2011-11-16 18:39:07.000000000 -0500
+@@ -1578,7 +1578,7 @@ static int validate_params(uint cmd, str
            cmd == DM_LIST_VERSIONS_CMD)
                return 0;
  
@@ -27402,9 +29496,9 @@ diff -urNp linux-3.0.4/drivers/md/dm-ioctl.c linux-3.0.4/drivers/md/dm-ioctl.c
                if (!*param->name) {
                        DMWARN("name not supplied when creating device");
                        return -EINVAL;
-diff -urNp linux-3.0.4/drivers/md/dm-raid1.c linux-3.0.4/drivers/md/dm-raid1.c
---- linux-3.0.4/drivers/md/dm-raid1.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/md/dm-raid1.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/md/dm-raid1.c linux-3.1.3/drivers/md/dm-raid1.c
+--- linux-3.1.3/drivers/md/dm-raid1.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/md/dm-raid1.c  2011-11-16 18:39:07.000000000 -0500
 @@ -40,7 +40,7 @@ enum dm_raid1_error {
  
  struct mirror {
@@ -27477,9 +29571,9 @@ diff -urNp linux-3.0.4/drivers/md/dm-raid1.c linux-3.0.4/drivers/md/dm-raid1.c
                return 'A';
  
        return (test_bit(DM_RAID1_FLUSH_ERROR, &(m->error_type))) ? 'F' :
-diff -urNp linux-3.0.4/drivers/md/dm-stripe.c linux-3.0.4/drivers/md/dm-stripe.c
---- linux-3.0.4/drivers/md/dm-stripe.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/md/dm-stripe.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/md/dm-stripe.c linux-3.1.3/drivers/md/dm-stripe.c
+--- linux-3.1.3/drivers/md/dm-stripe.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/md/dm-stripe.c 2011-11-16 18:39:07.000000000 -0500
 @@ -20,7 +20,7 @@ struct stripe {
        struct dm_dev *dev;
        sector_t physical_start;
@@ -27518,10 +29612,10 @@ diff -urNp linux-3.0.4/drivers/md/dm-stripe.c linux-3.0.4/drivers/md/dm-stripe.c
                            DM_IO_ERROR_THRESHOLD)
                                schedule_work(&sc->trigger_event);
                }
-diff -urNp linux-3.0.4/drivers/md/dm-table.c linux-3.0.4/drivers/md/dm-table.c
---- linux-3.0.4/drivers/md/dm-table.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/md/dm-table.c  2011-08-23 21:47:55.000000000 -0400
-@@ -390,7 +390,7 @@ static int device_area_is_invalid(struct
+diff -urNp linux-3.1.3/drivers/md/dm-table.c linux-3.1.3/drivers/md/dm-table.c
+--- linux-3.1.3/drivers/md/dm-table.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/md/dm-table.c  2011-11-16 18:39:07.000000000 -0500
+@@ -389,7 +389,7 @@ static int device_area_is_invalid(struct
        if (!dev_size)
                return 0;
  
@@ -27530,10 +29624,10 @@ diff -urNp linux-3.0.4/drivers/md/dm-table.c linux-3.0.4/drivers/md/dm-table.c
                DMWARN("%s: %s too small for target: "
                       "start=%llu, len=%llu, dev_size=%llu",
                       dm_device_name(ti->table->md), bdevname(bdev, b),
-diff -urNp linux-3.0.4/drivers/md/md.c linux-3.0.4/drivers/md/md.c
---- linux-3.0.4/drivers/md/md.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/md/md.c        2011-08-23 21:47:55.000000000 -0400
-@@ -226,10 +226,10 @@ EXPORT_SYMBOL_GPL(bio_clone_mddev);
+diff -urNp linux-3.1.3/drivers/md/md.c linux-3.1.3/drivers/md/md.c
+--- linux-3.1.3/drivers/md/md.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/md/md.c        2011-11-16 18:39:07.000000000 -0500
+@@ -280,10 +280,10 @@ EXPORT_SYMBOL_GPL(md_trim_bio);
   *  start build, activate spare
   */
  static DECLARE_WAIT_QUEUE_HEAD(md_event_waiters);
@@ -27546,7 +29640,7 @@ diff -urNp linux-3.0.4/drivers/md/md.c linux-3.0.4/drivers/md/md.c
        wake_up(&md_event_waiters);
  }
  EXPORT_SYMBOL_GPL(md_new_event);
-@@ -239,7 +239,7 @@ EXPORT_SYMBOL_GPL(md_new_event);
+@@ -293,7 +293,7 @@ EXPORT_SYMBOL_GPL(md_new_event);
   */
  static void md_new_event_inintr(mddev_t *mddev)
  {
@@ -27555,7 +29649,7 @@ diff -urNp linux-3.0.4/drivers/md/md.c linux-3.0.4/drivers/md/md.c
        wake_up(&md_event_waiters);
  }
  
-@@ -1457,7 +1457,7 @@ static int super_1_load(mdk_rdev_t *rdev
+@@ -1531,7 +1531,7 @@ static int super_1_load(mdk_rdev_t *rdev
  
        rdev->preferred_minor = 0xffff;
        rdev->data_offset = le64_to_cpu(sb->data_offset);
@@ -27564,7 +29658,7 @@ diff -urNp linux-3.0.4/drivers/md/md.c linux-3.0.4/drivers/md/md.c
  
        rdev->sb_size = le32_to_cpu(sb->max_dev) * 2 + 256;
        bmask = queue_logical_block_size(rdev->bdev->bd_disk->queue)-1;
-@@ -1635,7 +1635,7 @@ static void super_1_sync(mddev_t *mddev,
+@@ -1748,7 +1748,7 @@ static void super_1_sync(mddev_t *mddev,
        else
                sb->resync_offset = cpu_to_le64(0);
  
@@ -27573,7 +29667,7 @@ diff -urNp linux-3.0.4/drivers/md/md.c linux-3.0.4/drivers/md/md.c
  
        sb->raid_disks = cpu_to_le32(mddev->raid_disks);
        sb->size = cpu_to_le64(mddev->dev_sectors);
-@@ -2428,7 +2428,7 @@ __ATTR(state, S_IRUGO|S_IWUSR, state_sho
+@@ -2643,7 +2643,7 @@ __ATTR(state, S_IRUGO|S_IWUSR, state_sho
  static ssize_t
  errors_show(mdk_rdev_t *rdev, char *page)
  {
@@ -27582,7 +29676,7 @@ diff -urNp linux-3.0.4/drivers/md/md.c linux-3.0.4/drivers/md/md.c
  }
  
  static ssize_t
-@@ -2437,7 +2437,7 @@ errors_store(mdk_rdev_t *rdev, const cha
+@@ -2652,7 +2652,7 @@ errors_store(mdk_rdev_t *rdev, const cha
        char *e;
        unsigned long n = simple_strtoul(buf, &e, 10);
        if (*buf && (*e == 0 || *e == '\n')) {
@@ -27591,9 +29685,9 @@ diff -urNp linux-3.0.4/drivers/md/md.c linux-3.0.4/drivers/md/md.c
                return len;
        }
        return -EINVAL;
-@@ -2793,8 +2793,8 @@ void md_rdev_init(mdk_rdev_t *rdev)
-       rdev->last_read_error.tv_sec  = 0;
-       rdev->last_read_error.tv_nsec = 0;
+@@ -3042,8 +3042,8 @@ int md_rdev_init(mdk_rdev_t *rdev)
+       rdev->sb_loaded = 0;
+       rdev->bb_page = NULL;
        atomic_set(&rdev->nr_pending, 0);
 -      atomic_set(&rdev->read_errors, 0);
 -      atomic_set(&rdev->corrected_errors, 0);
@@ -27602,16 +29696,16 @@ diff -urNp linux-3.0.4/drivers/md/md.c linux-3.0.4/drivers/md/md.c
  
        INIT_LIST_HEAD(&rdev->same_set);
        init_waitqueue_head(&rdev->blocked_wait);
-@@ -6415,7 +6415,7 @@ static int md_seq_show(struct seq_file *
+@@ -6667,7 +6667,7 @@ static int md_seq_show(struct seq_file *
  
                spin_unlock(&pers_lock);
                seq_printf(seq, "\n");
--              mi->event = atomic_read(&md_event_count);
-+              mi->event = atomic_read_unchecked(&md_event_count);
+-              seq->poll_event = atomic_read(&md_event_count);
++              seq->poll_event = atomic_read_unchecked(&md_event_count);
                return 0;
        }
        if (v == (void*)2) {
-@@ -6504,7 +6504,7 @@ static int md_seq_show(struct seq_file *
+@@ -6756,7 +6756,7 @@ static int md_seq_show(struct seq_file *
                                chunk_kb ? "KB" : "B");
                        if (bitmap->file) {
                                seq_printf(seq, ", file: ");
@@ -27620,25 +29714,25 @@ diff -urNp linux-3.0.4/drivers/md/md.c linux-3.0.4/drivers/md/md.c
                        }
  
                        seq_printf(seq, "\n");
-@@ -6538,7 +6538,7 @@ static int md_seq_open(struct inode *ino
-       else {
-               struct seq_file *p = file->private_data;
-               p->private = mi;
--              mi->event = atomic_read(&md_event_count);
-+              mi->event = atomic_read_unchecked(&md_event_count);
-       }
+@@ -6787,7 +6787,7 @@ static int md_seq_open(struct inode *ino
+               return error;
+       seq = file->private_data;
+-      seq->poll_event = atomic_read(&md_event_count);
++      seq->poll_event = atomic_read_unchecked(&md_event_count);
        return error;
  }
-@@ -6554,7 +6554,7 @@ static unsigned int mdstat_poll(struct f
+@@ -6801,7 +6801,7 @@ static unsigned int mdstat_poll(struct f
        /* always allow read */
        mask = POLLIN | POLLRDNORM;
  
--      if (mi->event != atomic_read(&md_event_count))
-+      if (mi->event != atomic_read_unchecked(&md_event_count))
+-      if (seq->poll_event != atomic_read(&md_event_count))
++      if (seq->poll_event != atomic_read_unchecked(&md_event_count))
                mask |= POLLERR | POLLPRI;
        return mask;
  }
-@@ -6598,7 +6598,7 @@ static int is_mddev_idle(mddev_t *mddev,
+@@ -6845,7 +6845,7 @@ static int is_mddev_idle(mddev_t *mddev,
                struct gendisk *disk = rdev->bdev->bd_contains->bd_disk;
                curr_events = (int)part_stat_read(&disk->part0, sectors[0]) +
                              (int)part_stat_read(&disk->part0, sectors[1]) -
@@ -27647,10 +29741,10 @@ diff -urNp linux-3.0.4/drivers/md/md.c linux-3.0.4/drivers/md/md.c
                /* sync IO will cause sync_io to increase before the disk_stats
                 * as sync_io is counted when a request starts, and
                 * disk_stats is counted when it completes.
-diff -urNp linux-3.0.4/drivers/md/md.h linux-3.0.4/drivers/md/md.h
---- linux-3.0.4/drivers/md/md.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/md/md.h        2011-08-23 21:47:55.000000000 -0400
-@@ -97,13 +97,13 @@ struct mdk_rdev_s
+diff -urNp linux-3.1.3/drivers/md/md.h linux-3.1.3/drivers/md/md.h
+--- linux-3.1.3/drivers/md/md.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/md/md.h        2011-11-16 18:39:07.000000000 -0500
+@@ -124,13 +124,13 @@ struct mdk_rdev_s
                                         * only maintained for arrays that
                                         * support hot removal
                                         */
@@ -27666,7 +29760,7 @@ diff -urNp linux-3.0.4/drivers/md/md.h linux-3.0.4/drivers/md/md.h
                                           * for reporting to userspace and storing
                                           * in superblock.
                                           */
-@@ -344,7 +344,7 @@ static inline void rdev_dec_pending(mdk_
+@@ -415,7 +415,7 @@ static inline void rdev_dec_pending(mdk_
  
  static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sectors)
  {
@@ -27675,19 +29769,19 @@ diff -urNp linux-3.0.4/drivers/md/md.h linux-3.0.4/drivers/md/md.h
  }
  
  struct mdk_personality
-diff -urNp linux-3.0.4/drivers/md/raid10.c linux-3.0.4/drivers/md/raid10.c
---- linux-3.0.4/drivers/md/raid10.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/md/raid10.c    2011-08-23 21:47:55.000000000 -0400
-@@ -1186,7 +1186,7 @@ static void end_sync_read(struct bio *bi
-       if (test_bit(BIO_UPTODATE, &bio->bi_flags))
-               set_bit(R10BIO_Uptodate, &r10_bio->state);
-       else {
+diff -urNp linux-3.1.3/drivers/md/raid10.c linux-3.1.3/drivers/md/raid10.c
+--- linux-3.1.3/drivers/md/raid10.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/md/raid10.c    2011-11-16 18:39:07.000000000 -0500
+@@ -1423,7 +1423,7 @@ static void end_sync_read(struct bio *bi
+               /* The write handler will notice the lack of
+                * R10BIO_Uptodate and record any errors etc
+                */
 -              atomic_add(r10_bio->sectors,
 +              atomic_add_unchecked(r10_bio->sectors,
                           &conf->mirrors[d].rdev->corrected_errors);
-               if (!test_bit(MD_RECOVERY_SYNC, &conf->mddev->recovery))
-                       md_error(r10_bio->mddev,
-@@ -1394,7 +1394,7 @@ static void check_decay_read_errors(mdde
+       /* for reconstruct, we always reschedule after a read.
+@@ -1723,7 +1723,7 @@ static void check_decay_read_errors(mdde
  {
        struct timespec cur_time_mon;
        unsigned long hours_since_last;
@@ -27696,7 +29790,7 @@ diff -urNp linux-3.0.4/drivers/md/raid10.c linux-3.0.4/drivers/md/raid10.c
  
        ktime_get_ts(&cur_time_mon);
  
-@@ -1416,9 +1416,9 @@ static void check_decay_read_errors(mdde
+@@ -1745,9 +1745,9 @@ static void check_decay_read_errors(mdde
         * overflowing the shift of read_errors by hours_since_last.
         */
        if (hours_since_last >= 8 * sizeof(read_errors))
@@ -27707,8 +29801,8 @@ diff -urNp linux-3.0.4/drivers/md/raid10.c linux-3.0.4/drivers/md/raid10.c
 +              atomic_set_unchecked(&rdev->read_errors, read_errors >> hours_since_last);
  }
  
- /*
-@@ -1448,8 +1448,8 @@ static void fix_read_error(conf_t *conf,
+ static int r10_sync_page_io(mdk_rdev_t *rdev, sector_t sector,
+@@ -1797,8 +1797,8 @@ static void fix_read_error(conf_t *conf,
                return;
  
        check_decay_read_errors(mddev, rdev);
@@ -27719,7 +29813,7 @@ diff -urNp linux-3.0.4/drivers/md/raid10.c linux-3.0.4/drivers/md/raid10.c
                char b[BDEVNAME_SIZE];
                bdevname(rdev->bdev, b);
  
-@@ -1457,7 +1457,7 @@ static void fix_read_error(conf_t *conf,
+@@ -1806,7 +1806,7 @@ static void fix_read_error(conf_t *conf,
                       "md/raid10:%s: %s: Raid device exceeded "
                       "read_error threshold [cur %d:max %d]\n",
                       mdname(mddev), b,
@@ -27728,49 +29822,45 @@ diff -urNp linux-3.0.4/drivers/md/raid10.c linux-3.0.4/drivers/md/raid10.c
                printk(KERN_NOTICE
                       "md/raid10:%s: %s: Failing raid device\n",
                       mdname(mddev), b);
-@@ -1520,7 +1520,7 @@ static void fix_read_error(conf_t *conf,
-                           test_bit(In_sync, &rdev->flags)) {
-                               atomic_inc(&rdev->nr_pending);
-                               rcu_read_unlock();
+@@ -1951,7 +1951,7 @@ static void fix_read_error(conf_t *conf,
+                                      (unsigned long long)(
+                                              sect + rdev->data_offset),
+                                      bdevname(rdev->bdev, b));
 -                              atomic_add(s, &rdev->corrected_errors);
 +                              atomic_add_unchecked(s, &rdev->corrected_errors);
-                               if (sync_page_io(rdev,
-                                                r10_bio->devs[sl].addr +
-                                                sect,
-diff -urNp linux-3.0.4/drivers/md/raid1.c linux-3.0.4/drivers/md/raid1.c
---- linux-3.0.4/drivers/md/raid1.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/md/raid1.c     2011-08-23 21:47:55.000000000 -0400
-@@ -1263,7 +1263,7 @@ static int fix_sync_read_error(r1bio_t *
-                               rdev_dec_pending(rdev, mddev);
-                               md_error(mddev, rdev);
-                       } else
+                       }
+                       rdev_dec_pending(rdev, mddev);
+diff -urNp linux-3.1.3/drivers/md/raid1.c linux-3.1.3/drivers/md/raid1.c
+--- linux-3.1.3/drivers/md/raid1.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/md/raid1.c     2011-11-16 18:39:07.000000000 -0500
+@@ -1541,7 +1541,7 @@ static int fix_sync_read_error(r1bio_t *
+                       if (r1_sync_page_io(rdev, sect, s,
+                                           bio->bi_io_vec[idx].bv_page,
+                                           READ) != 0)
 -                              atomic_add(s, &rdev->corrected_errors);
 +                              atomic_add_unchecked(s, &rdev->corrected_errors);
                }
-               d = start;
-               while (d != r1_bio->read_disk) {
-@@ -1492,7 +1492,7 @@ static void fix_read_error(conf_t *conf,
-                                       /* Well, this device is dead */
-                                       md_error(mddev, rdev);
-                               else {
+               sectors -= s;
+               sect += s;
+@@ -1754,7 +1754,7 @@ static void fix_read_error(conf_t *conf,
+                           test_bit(In_sync, &rdev->flags)) {
+                               if (r1_sync_page_io(rdev, sect, s,
+                                                   conf->tmppage, READ)) {
 -                                      atomic_add(s, &rdev->corrected_errors);
 +                                      atomic_add_unchecked(s, &rdev->corrected_errors);
                                        printk(KERN_INFO
                                               "md/raid1:%s: read error corrected "
                                               "(%d sectors at %llu on %s)\n",
-diff -urNp linux-3.0.4/drivers/md/raid5.c linux-3.0.4/drivers/md/raid5.c
---- linux-3.0.4/drivers/md/raid5.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/md/raid5.c     2011-08-23 21:48:14.000000000 -0400
-@@ -550,7 +550,7 @@ static void ops_run_io(struct stripe_hea
-                       bi->bi_next = NULL;
-                       if ((rw & WRITE) &&
-                           test_bit(R5_ReWrite, &sh->dev[i].flags))
--                              atomic_add(STRIPE_SECTORS,
-+                              atomic_add_unchecked(STRIPE_SECTORS,
-                                       &rdev->corrected_errors);
-                       generic_make_request(bi);
-               } else {
-@@ -1596,15 +1596,15 @@ static void raid5_end_read_request(struc
+diff -urNp linux-3.1.3/drivers/md/raid5.c linux-3.1.3/drivers/md/raid5.c
+--- linux-3.1.3/drivers/md/raid5.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/md/raid5.c     2011-11-16 18:40:10.000000000 -0500
+@@ -1616,19 +1616,19 @@ static void raid5_end_read_request(struc
+                               (unsigned long long)(sh->sector
+                                                    + rdev->data_offset),
+                               bdevname(rdev->bdev, b));
+-                      atomic_add(STRIPE_SECTORS, &rdev->corrected_errors);
++                      atomic_add_unchecked(STRIPE_SECTORS, &rdev->corrected_errors);
                        clear_bit(R5_ReadError, &sh->dev[i].flags);
                        clear_bit(R5_ReWrite, &sh->dev[i].flags);
                }
@@ -27787,18 +29877,18 @@ diff -urNp linux-3.0.4/drivers/md/raid5.c linux-3.0.4/drivers/md/raid5.c
 -              atomic_inc(&rdev->read_errors);
 +              atomic_inc_unchecked(&rdev->read_errors);
                if (conf->mddev->degraded >= conf->max_degraded)
-                       printk_rl(KERN_WARNING
-                                 "md/raid:%s: read error not correctable "
-@@ -1622,7 +1622,7 @@ static void raid5_end_read_request(struc
-                                 (unsigned long long)(sh->sector
-                                                      + rdev->data_offset),
-                                 bdn);
+                       printk_ratelimited(
+                               KERN_WARNING
+@@ -1648,7 +1648,7 @@ static void raid5_end_read_request(struc
+                               (unsigned long long)(sh->sector
+                                                    + rdev->data_offset),
+                               bdn);
 -              else if (atomic_read(&rdev->read_errors)
 +              else if (atomic_read_unchecked(&rdev->read_errors)
                         > conf->max_nr_stripes)
                        printk(KERN_WARNING
                               "md/raid:%s: Too many read errors, failing device %s.\n",
-@@ -1945,6 +1945,7 @@ static sector_t compute_blocknr(struct s
+@@ -1978,6 +1978,7 @@ static sector_t compute_blocknr(struct s
        sector_t r_sector;
        struct stripe_head sh2;
  
@@ -27806,9 +29896,9 @@ diff -urNp linux-3.0.4/drivers/md/raid5.c linux-3.0.4/drivers/md/raid5.c
  
        chunk_offset = sector_div(new_sector, sectors_per_chunk);
        stripe = new_sector;
-diff -urNp linux-3.0.4/drivers/media/common/saa7146_hlp.c linux-3.0.4/drivers/media/common/saa7146_hlp.c
---- linux-3.0.4/drivers/media/common/saa7146_hlp.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/common/saa7146_hlp.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/media/common/saa7146_hlp.c linux-3.1.3/drivers/media/common/saa7146_hlp.c
+--- linux-3.1.3/drivers/media/common/saa7146_hlp.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/common/saa7146_hlp.c     2011-11-16 18:40:10.000000000 -0500
 @@ -353,6 +353,8 @@ static void calculate_clipping_registers
  
        int x[32], y[32], w[32], h[32];
@@ -27818,9 +29908,21 @@ diff -urNp linux-3.0.4/drivers/media/common/saa7146_hlp.c linux-3.0.4/drivers/me
        /* clear out memory */
        memset(&line_list[0],  0x00, sizeof(u32)*32);
        memset(&pixel_list[0], 0x00, sizeof(u32)*32);
-diff -urNp linux-3.0.4/drivers/media/dvb/dvb-core/dvb_ca_en50221.c linux-3.0.4/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
---- linux-3.0.4/drivers/media/dvb/dvb-core/dvb_ca_en50221.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/dvb/dvb-core/dvb_ca_en50221.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/media/dvb/ddbridge/ddbridge-core.c linux-3.1.3/drivers/media/dvb/ddbridge/ddbridge-core.c
+--- linux-3.1.3/drivers/media/dvb/ddbridge/ddbridge-core.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/dvb/ddbridge/ddbridge-core.c     2011-11-16 18:39:07.000000000 -0500
+@@ -1675,7 +1675,7 @@ static struct ddb_info ddb_v6 = {
+       .subvendor   = _subvend, .subdevice = _subdev, \
+       .driver_data = (unsigned long)&_driverdata }
+-static const struct pci_device_id ddb_id_tbl[] __devinitdata = {
++static const struct pci_device_id ddb_id_tbl[] __devinitconst = {
+       DDB_ID(DDVID, 0x0002, DDVID, 0x0001, ddb_octopus),
+       DDB_ID(DDVID, 0x0003, DDVID, 0x0001, ddb_octopus),
+       DDB_ID(DDVID, 0x0003, DDVID, 0x0002, ddb_octopus_le),
+diff -urNp linux-3.1.3/drivers/media/dvb/dvb-core/dvb_ca_en50221.c linux-3.1.3/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
+--- linux-3.1.3/drivers/media/dvb/dvb-core/dvb_ca_en50221.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/dvb/dvb-core/dvb_ca_en50221.c    2011-11-16 18:40:10.000000000 -0500
 @@ -590,6 +590,8 @@ static int dvb_ca_en50221_read_data(stru
        u8 buf[HOST_LINK_BUF_SIZE];
        int i;
@@ -27839,16 +29941,10 @@ diff -urNp linux-3.0.4/drivers/media/dvb/dvb-core/dvb_ca_en50221.c linux-3.0.4/d
        dprintk("%s\n", __func__);
  
        /* Incoming packet has a 2 byte header. hdr[0] = slot_id, hdr[1] = connection_id */
-diff -urNp linux-3.0.4/drivers/media/dvb/dvb-core/dvb_demux.h linux-3.0.4/drivers/media/dvb/dvb-core/dvb_demux.h
---- linux-3.0.4/drivers/media/dvb/dvb-core/dvb_demux.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/dvb/dvb-core/dvb_demux.h 2011-08-24 18:24:40.000000000 -0400
-@@ -68,12 +68,12 @@ struct dvb_demux_feed {
-       union {
-               struct dmx_ts_feed ts;
-               struct dmx_section_feed sec;
--      } feed;
-+      } __no_const feed;
+diff -urNp linux-3.1.3/drivers/media/dvb/dvb-core/dvb_demux.h linux-3.1.3/drivers/media/dvb/dvb-core/dvb_demux.h
+--- linux-3.1.3/drivers/media/dvb/dvb-core/dvb_demux.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/dvb/dvb-core/dvb_demux.h 2011-11-17 18:34:32.000000000 -0500
+@@ -73,7 +73,7 @@ struct dvb_demux_feed {
        union {
                dmx_ts_cb ts;
                dmx_section_cb sec;
@@ -27857,9 +29953,9 @@ diff -urNp linux-3.0.4/drivers/media/dvb/dvb-core/dvb_demux.h linux-3.0.4/driver
  
        struct dvb_demux *demux;
        void *priv;
-diff -urNp linux-3.0.4/drivers/media/dvb/dvb-core/dvbdev.c linux-3.0.4/drivers/media/dvb/dvb-core/dvbdev.c
---- linux-3.0.4/drivers/media/dvb/dvb-core/dvbdev.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/dvb/dvb-core/dvbdev.c    2011-08-24 18:24:19.000000000 -0400
+diff -urNp linux-3.1.3/drivers/media/dvb/dvb-core/dvbdev.c linux-3.1.3/drivers/media/dvb/dvb-core/dvbdev.c
+--- linux-3.1.3/drivers/media/dvb/dvb-core/dvbdev.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/dvb/dvb-core/dvbdev.c    2011-11-16 18:39:07.000000000 -0500
 @@ -192,7 +192,7 @@ int dvb_register_device(struct dvb_adapt
                        const struct dvb_device *template, void *priv, int type)
  {
@@ -27869,9 +29965,9 @@ diff -urNp linux-3.0.4/drivers/media/dvb/dvb-core/dvbdev.c linux-3.0.4/drivers/m
        struct device *clsdev;
        int minor;
        int id;
-diff -urNp linux-3.0.4/drivers/media/dvb/dvb-usb/cxusb.c linux-3.0.4/drivers/media/dvb/dvb-usb/cxusb.c
---- linux-3.0.4/drivers/media/dvb/dvb-usb/cxusb.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/dvb/dvb-usb/cxusb.c      2011-08-24 18:26:33.000000000 -0400
+diff -urNp linux-3.1.3/drivers/media/dvb/dvb-usb/cxusb.c linux-3.1.3/drivers/media/dvb/dvb-usb/cxusb.c
+--- linux-3.1.3/drivers/media/dvb/dvb-usb/cxusb.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/dvb/dvb-usb/cxusb.c      2011-11-16 18:39:07.000000000 -0500
 @@ -1059,7 +1059,7 @@ static struct dib0070_config dib7070p_di
  struct dib0700_adapter_state {
        int (*set_param_save) (struct dvb_frontend *,
@@ -27881,10 +29977,10 @@ diff -urNp linux-3.0.4/drivers/media/dvb/dvb-usb/cxusb.c linux-3.0.4/drivers/med
  
  static int dib7070_set_param_override(struct dvb_frontend *fe,
                                      struct dvb_frontend_parameters *fep)
-diff -urNp linux-3.0.4/drivers/media/dvb/dvb-usb/dib0700_core.c linux-3.0.4/drivers/media/dvb/dvb-usb/dib0700_core.c
---- linux-3.0.4/drivers/media/dvb/dvb-usb/dib0700_core.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/dvb/dvb-usb/dib0700_core.c       2011-08-23 21:48:14.000000000 -0400
-@@ -434,6 +434,8 @@ int dib0700_download_firmware(struct usb
+diff -urNp linux-3.1.3/drivers/media/dvb/dvb-usb/dib0700_core.c linux-3.1.3/drivers/media/dvb/dvb-usb/dib0700_core.c
+--- linux-3.1.3/drivers/media/dvb/dvb-usb/dib0700_core.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/dvb/dvb-usb/dib0700_core.c       2011-11-16 18:40:10.000000000 -0500
+@@ -478,6 +478,8 @@ int dib0700_download_firmware(struct usb
        if (!buf)
                return -ENOMEM;
  
@@ -27893,21 +29989,9 @@ diff -urNp linux-3.0.4/drivers/media/dvb/dvb-usb/dib0700_core.c linux-3.0.4/driv
        while ((ret = dvb_usb_get_hexline(fw, &hx, &pos)) > 0) {
                deb_fwdata("writing to address 0x%08x (buffer: 0x%02x %02x)\n",
                                hx.addr, hx.len, hx.chk);
-diff -urNp linux-3.0.4/drivers/media/dvb/dvb-usb/dibusb.h linux-3.0.4/drivers/media/dvb/dvb-usb/dibusb.h
---- linux-3.0.4/drivers/media/dvb/dvb-usb/dibusb.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/dvb/dvb-usb/dibusb.h     2011-08-24 18:27:27.000000000 -0400
-@@ -97,7 +97,7 @@
- #define DIBUSB_IOCTL_CMD_DISABLE_STREAM       0x02
- struct dibusb_state {
--      struct dib_fe_xfer_ops ops;
-+      dib_fe_xfer_ops_no_const ops;
-       int mt2060_present;
-       u8 tuner_addr;
- };
-diff -urNp linux-3.0.4/drivers/media/dvb/dvb-usb/dw2102.c linux-3.0.4/drivers/media/dvb/dvb-usb/dw2102.c
---- linux-3.0.4/drivers/media/dvb/dvb-usb/dw2102.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/dvb/dvb-usb/dw2102.c     2011-08-24 18:27:45.000000000 -0400
+diff -urNp linux-3.1.3/drivers/media/dvb/dvb-usb/dw2102.c linux-3.1.3/drivers/media/dvb/dvb-usb/dw2102.c
+--- linux-3.1.3/drivers/media/dvb/dvb-usb/dw2102.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/dvb/dvb-usb/dw2102.c     2011-11-16 18:39:07.000000000 -0500
 @@ -95,7 +95,7 @@ struct su3000_state {
  
  struct s6x0_state {
@@ -27917,9 +30001,9 @@ diff -urNp linux-3.0.4/drivers/media/dvb/dvb-usb/dw2102.c linux-3.0.4/drivers/me
  
  /* debug */
  static int dvb_usb_dw2102_debug;
-diff -urNp linux-3.0.4/drivers/media/dvb/dvb-usb/lmedm04.c linux-3.0.4/drivers/media/dvb/dvb-usb/lmedm04.c
---- linux-3.0.4/drivers/media/dvb/dvb-usb/lmedm04.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/dvb/dvb-usb/lmedm04.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/media/dvb/dvb-usb/lmedm04.c linux-3.1.3/drivers/media/dvb/dvb-usb/lmedm04.c
+--- linux-3.1.3/drivers/media/dvb/dvb-usb/lmedm04.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/dvb/dvb-usb/lmedm04.c    2011-11-16 18:40:10.000000000 -0500
 @@ -742,6 +742,7 @@ static int lme2510_download_firmware(str
        usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
                        0x06, 0x80, 0x0200, 0x00, data, 0x0109, 1000);
@@ -27937,37 +30021,21 @@ diff -urNp linux-3.0.4/drivers/media/dvb/dvb-usb/lmedm04.c linux-3.0.4/drivers/m
        data[0] = 0x0a;
        len_in = 1;
        info("FRM Firmware Cold Reset");
-diff -urNp linux-3.0.4/drivers/media/dvb/frontends/dib3000.h linux-3.0.4/drivers/media/dvb/frontends/dib3000.h
---- linux-3.0.4/drivers/media/dvb/frontends/dib3000.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/dvb/frontends/dib3000.h  2011-08-24 18:28:18.000000000 -0400
-@@ -40,10 +40,11 @@ struct dib_fe_xfer_ops
+diff -urNp linux-3.1.3/drivers/media/dvb/frontends/dib3000.h linux-3.1.3/drivers/media/dvb/frontends/dib3000.h
+--- linux-3.1.3/drivers/media/dvb/frontends/dib3000.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/dvb/frontends/dib3000.h  2011-11-17 18:38:05.000000000 -0500
+@@ -39,7 +39,7 @@ struct dib_fe_xfer_ops
+       int (*fifo_ctrl)(struct dvb_frontend *fe, int onoff);
        int (*pid_ctrl)(struct dvb_frontend *fe, int index, int pid, int onoff);
        int (*tuner_pass_ctrl)(struct dvb_frontend *fe, int onoff, u8 pll_ctrl);
- };
-+typedef struct dib_fe_xfer_ops __no_const dib_fe_xfer_ops_no_const;
+-};
++} __no_const;
  
  #if defined(CONFIG_DVB_DIB3000MB) || (defined(CONFIG_DVB_DIB3000MB_MODULE) && defined(MODULE))
  extern struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
--                                           struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops);
-+                                           struct i2c_adapter* i2c, dib_fe_xfer_ops_no_const *xfer_ops);
- #else
- static inline struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
-                                            struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops)
-diff -urNp linux-3.0.4/drivers/media/dvb/frontends/dib3000mb.c linux-3.0.4/drivers/media/dvb/frontends/dib3000mb.c
---- linux-3.0.4/drivers/media/dvb/frontends/dib3000mb.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/dvb/frontends/dib3000mb.c        2011-08-24 18:28:42.000000000 -0400
-@@ -756,7 +756,7 @@ static int dib3000mb_tuner_pass_ctrl(str
- static struct dvb_frontend_ops dib3000mb_ops;
- struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
--                                    struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops)
-+                                    struct i2c_adapter* i2c, dib_fe_xfer_ops_no_const *xfer_ops)
- {
-       struct dib3000_state* state = NULL;
-diff -urNp linux-3.0.4/drivers/media/dvb/frontends/mb86a16.c linux-3.0.4/drivers/media/dvb/frontends/mb86a16.c
---- linux-3.0.4/drivers/media/dvb/frontends/mb86a16.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/dvb/frontends/mb86a16.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/media/dvb/frontends/mb86a16.c linux-3.1.3/drivers/media/dvb/frontends/mb86a16.c
+--- linux-3.1.3/drivers/media/dvb/frontends/mb86a16.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/dvb/frontends/mb86a16.c  2011-11-16 18:40:10.000000000 -0500
 @@ -1060,6 +1060,8 @@ static int mb86a16_set_fe(struct mb86a16
        int ret = -1;
        int sync;
@@ -27977,9 +30045,9 @@ diff -urNp linux-3.0.4/drivers/media/dvb/frontends/mb86a16.c linux-3.0.4/drivers
        dprintk(verbose, MB86A16_INFO, 1, "freq=%d Mhz, symbrt=%d Ksps", state->frequency, state->srate);
  
        fcp = 3000;
-diff -urNp linux-3.0.4/drivers/media/dvb/frontends/or51211.c linux-3.0.4/drivers/media/dvb/frontends/or51211.c
---- linux-3.0.4/drivers/media/dvb/frontends/or51211.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/dvb/frontends/or51211.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/media/dvb/frontends/or51211.c linux-3.1.3/drivers/media/dvb/frontends/or51211.c
+--- linux-3.1.3/drivers/media/dvb/frontends/or51211.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/dvb/frontends/or51211.c  2011-11-16 18:40:10.000000000 -0500
 @@ -113,6 +113,8 @@ static int or51211_load_firmware (struct
        u8 tudata[585];
        int i;
@@ -27989,9 +30057,45 @@ diff -urNp linux-3.0.4/drivers/media/dvb/frontends/or51211.c linux-3.0.4/drivers
        dprintk("Firmware is %zd bytes\n",fw->size);
  
        /* Get eprom data */
-diff -urNp linux-3.0.4/drivers/media/video/cx18/cx18-driver.c linux-3.0.4/drivers/media/video/cx18/cx18-driver.c
---- linux-3.0.4/drivers/media/video/cx18/cx18-driver.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/video/cx18/cx18-driver.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/media/dvb/ngene/ngene-cards.c linux-3.1.3/drivers/media/dvb/ngene/ngene-cards.c
+--- linux-3.1.3/drivers/media/dvb/ngene/ngene-cards.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/dvb/ngene/ngene-cards.c  2011-11-16 18:39:07.000000000 -0500
+@@ -477,7 +477,7 @@ static struct ngene_info ngene_info_m780
+ /****************************************************************************/
+-static const struct pci_device_id ngene_id_tbl[] __devinitdata = {
++static const struct pci_device_id ngene_id_tbl[] __devinitconst = {
+       NGENE_ID(0x18c3, 0xabc3, ngene_info_cineS2),
+       NGENE_ID(0x18c3, 0xabc4, ngene_info_cineS2),
+       NGENE_ID(0x18c3, 0xdb01, ngene_info_satixS2),
+diff -urNp linux-3.1.3/drivers/media/radio/radio-cadet.c linux-3.1.3/drivers/media/radio/radio-cadet.c
+--- linux-3.1.3/drivers/media/radio/radio-cadet.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/radio/radio-cadet.c      2011-11-16 18:39:07.000000000 -0500
+@@ -326,6 +326,8 @@ static ssize_t cadet_read(struct file *f
+       unsigned char readbuf[RDS_BUFFER];
+       int i = 0;
++      if (count > RDS_BUFFER)
++              return -EFAULT;
+       mutex_lock(&dev->lock);
+       if (dev->rdsstat == 0) {
+               dev->rdsstat = 1;
+diff -urNp linux-3.1.3/drivers/media/video/au0828/au0828.h linux-3.1.3/drivers/media/video/au0828/au0828.h
+--- linux-3.1.3/drivers/media/video/au0828/au0828.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/video/au0828/au0828.h    2011-11-16 18:39:07.000000000 -0500
+@@ -191,7 +191,7 @@ struct au0828_dev {
+       /* I2C */
+       struct i2c_adapter              i2c_adap;
+-      struct i2c_algorithm            i2c_algo;
++      i2c_algorithm_no_const          i2c_algo;
+       struct i2c_client               i2c_client;
+       u32                             i2c_rc;
+diff -urNp linux-3.1.3/drivers/media/video/cx18/cx18-driver.c linux-3.1.3/drivers/media/video/cx18/cx18-driver.c
+--- linux-3.1.3/drivers/media/video/cx18/cx18-driver.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/video/cx18/cx18-driver.c 2011-11-16 18:40:10.000000000 -0500
 @@ -327,6 +327,8 @@ void cx18_read_eeprom(struct cx18 *cx, s
        struct i2c_client c;
        u8 eedata[256];
@@ -28001,9 +30105,9 @@ diff -urNp linux-3.0.4/drivers/media/video/cx18/cx18-driver.c linux-3.0.4/driver
        memset(&c, 0, sizeof(c));
        strlcpy(c.name, "cx18 tveeprom tmp", sizeof(c.name));
        c.adapter = &cx->i2c_adap[0];
-diff -urNp linux-3.0.4/drivers/media/video/cx23885/cx23885-input.c linux-3.0.4/drivers/media/video/cx23885/cx23885-input.c
---- linux-3.0.4/drivers/media/video/cx23885/cx23885-input.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/video/cx23885/cx23885-input.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/media/video/cx23885/cx23885-input.c linux-3.1.3/drivers/media/video/cx23885/cx23885-input.c
+--- linux-3.1.3/drivers/media/video/cx23885/cx23885-input.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/video/cx23885/cx23885-input.c    2011-11-16 18:40:10.000000000 -0500
 @@ -53,6 +53,8 @@ static void cx23885_input_process_measur
        bool handle = false;
        struct ir_raw_event ir_core_event[64];
@@ -28013,9 +30117,21 @@ diff -urNp linux-3.0.4/drivers/media/video/cx23885/cx23885-input.c linux-3.0.4/d
        do {
                num = 0;
                v4l2_subdev_call(dev->sd_ir, ir, rx_read, (u8 *) ir_core_event,
-diff -urNp linux-3.0.4/drivers/media/video/pvrusb2/pvrusb2-eeprom.c linux-3.0.4/drivers/media/video/pvrusb2/pvrusb2-eeprom.c
---- linux-3.0.4/drivers/media/video/pvrusb2/pvrusb2-eeprom.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/video/pvrusb2/pvrusb2-eeprom.c   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/media/video/cx88/cx88-alsa.c linux-3.1.3/drivers/media/video/cx88/cx88-alsa.c
+--- linux-3.1.3/drivers/media/video/cx88/cx88-alsa.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/video/cx88/cx88-alsa.c   2011-11-16 18:39:07.000000000 -0500
+@@ -766,7 +766,7 @@ static struct snd_kcontrol_new snd_cx88_
+  * Only boards with eeprom and byte 1 at eeprom=1 have it
+  */
+-static const struct pci_device_id const cx88_audio_pci_tbl[] __devinitdata = {
++static const struct pci_device_id const cx88_audio_pci_tbl[] __devinitconst = {
+       {0x14f1,0x8801,PCI_ANY_ID,PCI_ANY_ID,0,0,0},
+       {0x14f1,0x8811,PCI_ANY_ID,PCI_ANY_ID,0,0,0},
+       {0, }
+diff -urNp linux-3.1.3/drivers/media/video/pvrusb2/pvrusb2-eeprom.c linux-3.1.3/drivers/media/video/pvrusb2/pvrusb2-eeprom.c
+--- linux-3.1.3/drivers/media/video/pvrusb2/pvrusb2-eeprom.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/video/pvrusb2/pvrusb2-eeprom.c   2011-11-16 18:40:10.000000000 -0500
 @@ -120,6 +120,8 @@ int pvr2_eeprom_analyze(struct pvr2_hdw 
        u8 *eeprom;
        struct tveeprom tvdata;
@@ -28025,9 +30141,21 @@ diff -urNp linux-3.0.4/drivers/media/video/pvrusb2/pvrusb2-eeprom.c linux-3.0.4/
        memset(&tvdata,0,sizeof(tvdata));
  
        eeprom = pvr2_eeprom_fetch(hdw);
-diff -urNp linux-3.0.4/drivers/media/video/saa7134/saa6752hs.c linux-3.0.4/drivers/media/video/saa7134/saa6752hs.c
---- linux-3.0.4/drivers/media/video/saa7134/saa6752hs.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/video/saa7134/saa6752hs.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h linux-3.1.3/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
+--- linux-3.1.3/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h     2011-11-16 18:39:07.000000000 -0500
+@@ -196,7 +196,7 @@ struct pvr2_hdw {
+       /* I2C stuff */
+       struct i2c_adapter i2c_adap;
+-      struct i2c_algorithm i2c_algo;
++      i2c_algorithm_no_const i2c_algo;
+       pvr2_i2c_func i2c_func[PVR2_I2C_FUNC_CNT];
+       int i2c_cx25840_hack_state;
+       int i2c_linked;
+diff -urNp linux-3.1.3/drivers/media/video/saa7134/saa6752hs.c linux-3.1.3/drivers/media/video/saa7134/saa6752hs.c
+--- linux-3.1.3/drivers/media/video/saa7134/saa6752hs.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/video/saa7134/saa6752hs.c        2011-11-16 18:40:10.000000000 -0500
 @@ -682,6 +682,8 @@ static int saa6752hs_init(struct v4l2_su
        unsigned char localPAT[256];
        unsigned char localPMT[256];
@@ -28037,9 +30165,9 @@ diff -urNp linux-3.0.4/drivers/media/video/saa7134/saa6752hs.c linux-3.0.4/drive
        /* Set video format - must be done first as it resets other settings */
        set_reg8(client, 0x41, h->video_format);
  
-diff -urNp linux-3.0.4/drivers/media/video/saa7164/saa7164-cmd.c linux-3.0.4/drivers/media/video/saa7164/saa7164-cmd.c
---- linux-3.0.4/drivers/media/video/saa7164/saa7164-cmd.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/video/saa7164/saa7164-cmd.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/media/video/saa7164/saa7164-cmd.c linux-3.1.3/drivers/media/video/saa7164/saa7164-cmd.c
+--- linux-3.1.3/drivers/media/video/saa7164/saa7164-cmd.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/video/saa7164/saa7164-cmd.c      2011-11-16 18:40:10.000000000 -0500
 @@ -88,6 +88,8 @@ int saa7164_irq_dequeue(struct saa7164_d
        u8 tmp[512];
        dprintk(DBGLVL_CMD, "%s()\n", __func__);
@@ -28058,10 +30186,10 @@ diff -urNp linux-3.0.4/drivers/media/video/saa7164/saa7164-cmd.c linux-3.0.4/dri
        while (loop) {
  
                struct tmComResInfo tRsp = { 0, 0, 0, 0, 0, 0 };
-diff -urNp linux-3.0.4/drivers/media/video/timblogiw.c linux-3.0.4/drivers/media/video/timblogiw.c
---- linux-3.0.4/drivers/media/video/timblogiw.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/video/timblogiw.c        2011-08-24 18:29:20.000000000 -0400
-@@ -745,7 +745,7 @@ static int timblogiw_mmap(struct file *f
+diff -urNp linux-3.1.3/drivers/media/video/timblogiw.c linux-3.1.3/drivers/media/video/timblogiw.c
+--- linux-3.1.3/drivers/media/video/timblogiw.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/video/timblogiw.c        2011-11-17 18:36:32.000000000 -0500
+@@ -744,7 +744,7 @@ static int timblogiw_mmap(struct file *f
  
  /* Platform device functions */
  
@@ -28070,9 +30198,18 @@ diff -urNp linux-3.0.4/drivers/media/video/timblogiw.c linux-3.0.4/drivers/media
        .vidioc_querycap                = timblogiw_querycap,
        .vidioc_enum_fmt_vid_cap        = timblogiw_enum_fmt,
        .vidioc_g_fmt_vid_cap           = timblogiw_g_fmt,
-diff -urNp linux-3.0.4/drivers/media/video/usbvision/usbvision-core.c linux-3.0.4/drivers/media/video/usbvision/usbvision-core.c
---- linux-3.0.4/drivers/media/video/usbvision/usbvision-core.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/video/usbvision/usbvision-core.c 2011-08-23 21:48:14.000000000 -0400
+@@ -766,7 +766,7 @@ static __devinitconst struct v4l2_ioctl_
+       .vidioc_enum_framesizes         = timblogiw_enum_framesizes,
+ };
+-static __devinitconst struct v4l2_file_operations timblogiw_fops = {
++static __devinitconst v4l2_file_operations_no_const timblogiw_fops = {
+       .owner          = THIS_MODULE,
+       .open           = timblogiw_open,
+       .release        = timblogiw_close,
+diff -urNp linux-3.1.3/drivers/media/video/usbvision/usbvision-core.c linux-3.1.3/drivers/media/video/usbvision/usbvision-core.c
+--- linux-3.1.3/drivers/media/video/usbvision/usbvision-core.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/video/usbvision/usbvision-core.c 2011-11-16 18:40:10.000000000 -0500
 @@ -707,6 +707,8 @@ static enum parse_state usbvision_parse_
        unsigned char rv, gv, bv;
        static unsigned char *Y, *U, *V;
@@ -28082,10 +30219,10 @@ diff -urNp linux-3.0.4/drivers/media/video/usbvision/usbvision-core.c linux-3.0.
        frame = usbvision->cur_frame;
        image_size = frame->frmwidth * frame->frmheight;
        if ((frame->v4l2_format.format == V4L2_PIX_FMT_YUV422P) ||
-diff -urNp linux-3.0.4/drivers/media/video/videobuf-dma-sg.c linux-3.0.4/drivers/media/video/videobuf-dma-sg.c
---- linux-3.0.4/drivers/media/video/videobuf-dma-sg.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/media/video/videobuf-dma-sg.c  2011-08-23 21:48:14.000000000 -0400
-@@ -606,6 +606,8 @@ void *videobuf_sg_alloc(size_t size)
+diff -urNp linux-3.1.3/drivers/media/video/videobuf-dma-sg.c linux-3.1.3/drivers/media/video/videobuf-dma-sg.c
+--- linux-3.1.3/drivers/media/video/videobuf-dma-sg.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/media/video/videobuf-dma-sg.c  2011-11-16 18:40:10.000000000 -0500
+@@ -607,6 +607,8 @@ void *videobuf_sg_alloc(size_t size)
  {
        struct videobuf_queue q;
  
@@ -28094,9 +30231,9 @@ diff -urNp linux-3.0.4/drivers/media/video/videobuf-dma-sg.c linux-3.0.4/drivers
        /* Required to make generic handler to call __videobuf_alloc */
        q.int_ops = &sg_ops;
  
-diff -urNp linux-3.0.4/drivers/message/fusion/mptbase.c linux-3.0.4/drivers/message/fusion/mptbase.c
---- linux-3.0.4/drivers/message/fusion/mptbase.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/message/fusion/mptbase.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/message/fusion/mptbase.c linux-3.1.3/drivers/message/fusion/mptbase.c
+--- linux-3.1.3/drivers/message/fusion/mptbase.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/message/fusion/mptbase.c       2011-11-16 18:40:10.000000000 -0500
 @@ -6681,8 +6681,13 @@ static int mpt_iocinfo_proc_show(struct 
        seq_printf(m, "  MaxChainDepth = 0x%02x frames\n", ioc->facts.MaxChainDepth);
        seq_printf(m, "  MinBlockSize = 0x%02x bytes\n", 4*ioc->facts.BlockSize);
@@ -28111,9 +30248,9 @@ diff -urNp linux-3.0.4/drivers/message/fusion/mptbase.c linux-3.0.4/drivers/mess
        /*
         *  Rounding UP to nearest 4-kB boundary here...
         */
-diff -urNp linux-3.0.4/drivers/message/fusion/mptsas.c linux-3.0.4/drivers/message/fusion/mptsas.c
---- linux-3.0.4/drivers/message/fusion/mptsas.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/message/fusion/mptsas.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/message/fusion/mptsas.c linux-3.1.3/drivers/message/fusion/mptsas.c
+--- linux-3.1.3/drivers/message/fusion/mptsas.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/message/fusion/mptsas.c        2011-11-16 18:39:07.000000000 -0500
 @@ -439,6 +439,23 @@ mptsas_is_end_device(struct mptsas_devin
                return 0;
  }
@@ -28162,9 +30299,9 @@ diff -urNp linux-3.0.4/drivers/message/fusion/mptsas.c linux-3.0.4/drivers/messa
  static inline struct sas_port *
  mptsas_get_port(struct mptsas_phyinfo *phy_info)
  {
-diff -urNp linux-3.0.4/drivers/message/fusion/mptscsih.c linux-3.0.4/drivers/message/fusion/mptscsih.c
---- linux-3.0.4/drivers/message/fusion/mptscsih.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/message/fusion/mptscsih.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/message/fusion/mptscsih.c linux-3.1.3/drivers/message/fusion/mptscsih.c
+--- linux-3.1.3/drivers/message/fusion/mptscsih.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/message/fusion/mptscsih.c      2011-11-16 18:39:07.000000000 -0500
 @@ -1268,15 +1268,16 @@ mptscsih_info(struct Scsi_Host *SChost)
  
        h = shost_priv(SChost);
@@ -28190,9 +30327,9 @@ diff -urNp linux-3.0.4/drivers/message/fusion/mptscsih.c linux-3.0.4/drivers/mes
  
        return h->info_kbuf;
  }
-diff -urNp linux-3.0.4/drivers/message/i2o/i2o_config.c linux-3.0.4/drivers/message/i2o/i2o_config.c
---- linux-3.0.4/drivers/message/i2o/i2o_config.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/message/i2o/i2o_config.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/message/i2o/i2o_config.c linux-3.1.3/drivers/message/i2o/i2o_config.c
+--- linux-3.1.3/drivers/message/i2o/i2o_config.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/message/i2o/i2o_config.c       2011-11-16 18:40:10.000000000 -0500
 @@ -781,6 +781,8 @@ static int i2o_cfg_passthru(unsigned lon
        struct i2o_message *msg;
        unsigned int iop;
@@ -28202,9 +30339,9 @@ diff -urNp linux-3.0.4/drivers/message/i2o/i2o_config.c linux-3.0.4/drivers/mess
        if (get_user(iop, &cmd->iop) || get_user(user_msg, &cmd->msg))
                return -EFAULT;
  
-diff -urNp linux-3.0.4/drivers/message/i2o/i2o_proc.c linux-3.0.4/drivers/message/i2o/i2o_proc.c
---- linux-3.0.4/drivers/message/i2o/i2o_proc.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/message/i2o/i2o_proc.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/message/i2o/i2o_proc.c linux-3.1.3/drivers/message/i2o/i2o_proc.c
+--- linux-3.1.3/drivers/message/i2o/i2o_proc.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/message/i2o/i2o_proc.c 2011-11-16 18:39:07.000000000 -0500
 @@ -255,13 +255,6 @@ static char *scsi_devices[] = {
        "Array Controller Device"
  };
@@ -28291,9 +30428,9 @@ diff -urNp linux-3.0.4/drivers/message/i2o/i2o_proc.c linux-3.0.4/drivers/messag
  
        return 0;
  }
-diff -urNp linux-3.0.4/drivers/message/i2o/iop.c linux-3.0.4/drivers/message/i2o/iop.c
---- linux-3.0.4/drivers/message/i2o/iop.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/message/i2o/iop.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/message/i2o/iop.c linux-3.1.3/drivers/message/i2o/iop.c
+--- linux-3.1.3/drivers/message/i2o/iop.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/message/i2o/iop.c      2011-11-16 18:39:07.000000000 -0500
 @@ -111,10 +111,10 @@ u32 i2o_cntxt_list_add(struct i2o_contro
  
        spin_lock_irqsave(&c->context_list_lock, flags);
@@ -28317,9 +30454,21 @@ diff -urNp linux-3.0.4/drivers/message/i2o/iop.c linux-3.0.4/drivers/message/i2o
        INIT_LIST_HEAD(&c->context_list);
  #endif
  
-diff -urNp linux-3.0.4/drivers/mfd/abx500-core.c linux-3.0.4/drivers/mfd/abx500-core.c
---- linux-3.0.4/drivers/mfd/abx500-core.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/mfd/abx500-core.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/mfd/ab3100-core.c linux-3.1.3/drivers/mfd/ab3100-core.c
+--- linux-3.1.3/drivers/mfd/ab3100-core.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/mfd/ab3100-core.c      2011-11-16 18:39:07.000000000 -0500
+@@ -809,7 +809,7 @@ struct ab_family_id {
+       char    *name;
+ };
+-static const struct ab_family_id ids[] __devinitdata = {
++static const struct ab_family_id ids[] __devinitconst = {
+       /* AB3100 */
+       {
+               .id = 0xc0,
+diff -urNp linux-3.1.3/drivers/mfd/abx500-core.c linux-3.1.3/drivers/mfd/abx500-core.c
+--- linux-3.1.3/drivers/mfd/abx500-core.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/mfd/abx500-core.c      2011-11-16 18:39:07.000000000 -0500
 @@ -14,7 +14,7 @@ static LIST_HEAD(abx500_list);
  
  struct abx500_device_entry {
@@ -28329,9 +30478,9 @@ diff -urNp linux-3.0.4/drivers/mfd/abx500-core.c linux-3.0.4/drivers/mfd/abx500-
        struct device *dev;
  };
  
-diff -urNp linux-3.0.4/drivers/mfd/janz-cmodio.c linux-3.0.4/drivers/mfd/janz-cmodio.c
---- linux-3.0.4/drivers/mfd/janz-cmodio.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/mfd/janz-cmodio.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/mfd/janz-cmodio.c linux-3.1.3/drivers/mfd/janz-cmodio.c
+--- linux-3.1.3/drivers/mfd/janz-cmodio.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/mfd/janz-cmodio.c      2011-11-16 18:39:07.000000000 -0500
 @@ -13,6 +13,7 @@
  
  #include <linux/kernel.h>
@@ -28340,9 +30489,9 @@ diff -urNp linux-3.0.4/drivers/mfd/janz-cmodio.c linux-3.0.4/drivers/mfd/janz-cm
  #include <linux/init.h>
  #include <linux/pci.h>
  #include <linux/interrupt.h>
-diff -urNp linux-3.0.4/drivers/mfd/wm8350-i2c.c linux-3.0.4/drivers/mfd/wm8350-i2c.c
---- linux-3.0.4/drivers/mfd/wm8350-i2c.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/mfd/wm8350-i2c.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/mfd/wm8350-i2c.c linux-3.1.3/drivers/mfd/wm8350-i2c.c
+--- linux-3.1.3/drivers/mfd/wm8350-i2c.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/mfd/wm8350-i2c.c       2011-11-16 18:40:10.000000000 -0500
 @@ -44,6 +44,8 @@ static int wm8350_i2c_write_device(struc
        u8 msg[(WM8350_MAX_REGISTER << 1) + 1];
        int ret;
@@ -28352,10 +30501,10 @@ diff -urNp linux-3.0.4/drivers/mfd/wm8350-i2c.c linux-3.0.4/drivers/mfd/wm8350-i
        if (bytes > ((WM8350_MAX_REGISTER << 1) + 1))
                return -EINVAL;
  
-diff -urNp linux-3.0.4/drivers/misc/lis3lv02d/lis3lv02d.c linux-3.0.4/drivers/misc/lis3lv02d/lis3lv02d.c
---- linux-3.0.4/drivers/misc/lis3lv02d/lis3lv02d.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/misc/lis3lv02d/lis3lv02d.c     2011-08-23 21:47:55.000000000 -0400
-@@ -435,7 +435,7 @@ static irqreturn_t lis302dl_interrupt(in
+diff -urNp linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.c linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.c
+--- linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.c     2011-11-16 18:39:07.000000000 -0500
+@@ -437,7 +437,7 @@ static irqreturn_t lis302dl_interrupt(in
         * the lid is closed. This leads to interrupts as soon as a little move
         * is done.
         */
@@ -28364,7 +30513,7 @@ diff -urNp linux-3.0.4/drivers/misc/lis3lv02d/lis3lv02d.c linux-3.0.4/drivers/mi
  
        wake_up_interruptible(&lis3_dev.misc_wait);
        kill_fasync(&lis3_dev.async_queue, SIGIO, POLL_IN);
-@@ -518,7 +518,7 @@ static int lis3lv02d_misc_open(struct in
+@@ -520,7 +520,7 @@ static int lis3lv02d_misc_open(struct in
        if (lis3_dev.pm_dev)
                pm_runtime_get_sync(lis3_dev.pm_dev);
  
@@ -28373,7 +30522,7 @@ diff -urNp linux-3.0.4/drivers/misc/lis3lv02d/lis3lv02d.c linux-3.0.4/drivers/mi
        return 0;
  }
  
-@@ -545,7 +545,7 @@ static ssize_t lis3lv02d_misc_read(struc
+@@ -547,7 +547,7 @@ static ssize_t lis3lv02d_misc_read(struc
        add_wait_queue(&lis3_dev.misc_wait, &wait);
        while (true) {
                set_current_state(TASK_INTERRUPTIBLE);
@@ -28382,7 +30531,7 @@ diff -urNp linux-3.0.4/drivers/misc/lis3lv02d/lis3lv02d.c linux-3.0.4/drivers/mi
                if (data)
                        break;
  
-@@ -583,7 +583,7 @@ out:
+@@ -585,7 +585,7 @@ out:
  static unsigned int lis3lv02d_misc_poll(struct file *file, poll_table *wait)
  {
        poll_wait(file, &lis3_dev.misc_wait, wait);
@@ -28391,9 +30540,9 @@ diff -urNp linux-3.0.4/drivers/misc/lis3lv02d/lis3lv02d.c linux-3.0.4/drivers/mi
                return POLLIN | POLLRDNORM;
        return 0;
  }
-diff -urNp linux-3.0.4/drivers/misc/lis3lv02d/lis3lv02d.h linux-3.0.4/drivers/misc/lis3lv02d/lis3lv02d.h
---- linux-3.0.4/drivers/misc/lis3lv02d/lis3lv02d.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/misc/lis3lv02d/lis3lv02d.h     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.h linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.h
+--- linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/misc/lis3lv02d/lis3lv02d.h     2011-11-16 18:39:07.000000000 -0500
 @@ -265,7 +265,7 @@ struct lis3lv02d {
        struct input_polled_dev *idev;     /* input device */
        struct platform_device  *pdev;     /* platform device */
@@ -28403,9 +30552,9 @@ diff -urNp linux-3.0.4/drivers/misc/lis3lv02d/lis3lv02d.h linux-3.0.4/drivers/mi
        union axis_conversion   ac;        /* hw -> logical axis */
        int                     mapped_btns[3];
  
-diff -urNp linux-3.0.4/drivers/misc/sgi-gru/gruhandles.c linux-3.0.4/drivers/misc/sgi-gru/gruhandles.c
---- linux-3.0.4/drivers/misc/sgi-gru/gruhandles.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/misc/sgi-gru/gruhandles.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/misc/sgi-gru/gruhandles.c linux-3.1.3/drivers/misc/sgi-gru/gruhandles.c
+--- linux-3.1.3/drivers/misc/sgi-gru/gruhandles.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/misc/sgi-gru/gruhandles.c      2011-11-16 18:39:07.000000000 -0500
 @@ -44,8 +44,8 @@ static void update_mcs_stats(enum mcs_op
        unsigned long nsec;
  
@@ -28417,9 +30566,9 @@ diff -urNp linux-3.0.4/drivers/misc/sgi-gru/gruhandles.c linux-3.0.4/drivers/mis
        if (mcs_op_statistics[op].max < nsec)
                mcs_op_statistics[op].max = nsec;
  }
-diff -urNp linux-3.0.4/drivers/misc/sgi-gru/gruprocfs.c linux-3.0.4/drivers/misc/sgi-gru/gruprocfs.c
---- linux-3.0.4/drivers/misc/sgi-gru/gruprocfs.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/misc/sgi-gru/gruprocfs.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/misc/sgi-gru/gruprocfs.c linux-3.1.3/drivers/misc/sgi-gru/gruprocfs.c
+--- linux-3.1.3/drivers/misc/sgi-gru/gruprocfs.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/misc/sgi-gru/gruprocfs.c       2011-11-16 18:39:07.000000000 -0500
 @@ -32,9 +32,9 @@
  
  #define printstat(s, f)               printstat_val(s, &gru_stats.f, #f)
@@ -28443,9 +30592,9 @@ diff -urNp linux-3.0.4/drivers/misc/sgi-gru/gruprocfs.c linux-3.0.4/drivers/misc
                max = mcs_op_statistics[op].max;
                seq_printf(s, "%-20s%12ld%12ld%12ld\n", id[op], count,
                           count ? total / count : 0, max);
-diff -urNp linux-3.0.4/drivers/misc/sgi-gru/grutables.h linux-3.0.4/drivers/misc/sgi-gru/grutables.h
---- linux-3.0.4/drivers/misc/sgi-gru/grutables.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/misc/sgi-gru/grutables.h       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/misc/sgi-gru/grutables.h linux-3.1.3/drivers/misc/sgi-gru/grutables.h
+--- linux-3.1.3/drivers/misc/sgi-gru/grutables.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/misc/sgi-gru/grutables.h       2011-11-16 18:39:07.000000000 -0500
 @@ -167,82 +167,82 @@ extern unsigned int gru_max_gids;
   * GRU statistics.
   */
@@ -28625,9 +30774,41 @@ diff -urNp linux-3.0.4/drivers/misc/sgi-gru/grutables.h linux-3.0.4/drivers/misc
                        } while (0)
  
  #ifdef CONFIG_SGI_GRU_DEBUG
-diff -urNp linux-3.0.4/drivers/misc/sgi-xp/xp.h linux-3.0.4/drivers/misc/sgi-xp/xp.h
---- linux-3.0.4/drivers/misc/sgi-xp/xp.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/misc/sgi-xp/xp.h       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/misc/sgi-xp/xpc.h linux-3.1.3/drivers/misc/sgi-xp/xpc.h
+--- linux-3.1.3/drivers/misc/sgi-xp/xpc.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/misc/sgi-xp/xpc.h      2011-11-16 18:39:07.000000000 -0500
+@@ -835,6 +835,7 @@ struct xpc_arch_operations {
+       void (*received_payload) (struct xpc_channel *, void *);
+       void (*notify_senders_of_disconnect) (struct xpc_channel *);
+ };
++typedef struct xpc_arch_operations __no_const xpc_arch_operations_no_const;
+ /* struct xpc_partition act_state values (for XPC HB) */
+@@ -876,7 +877,7 @@ extern struct xpc_registration xpc_regis
+ /* found in xpc_main.c */
+ extern struct device *xpc_part;
+ extern struct device *xpc_chan;
+-extern struct xpc_arch_operations xpc_arch_ops;
++extern xpc_arch_operations_no_const xpc_arch_ops;
+ extern int xpc_disengage_timelimit;
+ extern int xpc_disengage_timedout;
+ extern int xpc_activate_IRQ_rcvd;
+diff -urNp linux-3.1.3/drivers/misc/sgi-xp/xpc_main.c linux-3.1.3/drivers/misc/sgi-xp/xpc_main.c
+--- linux-3.1.3/drivers/misc/sgi-xp/xpc_main.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/misc/sgi-xp/xpc_main.c 2011-11-16 18:39:07.000000000 -0500
+@@ -162,7 +162,7 @@ static struct notifier_block xpc_die_not
+       .notifier_call = xpc_system_die,
+ };
+-struct xpc_arch_operations xpc_arch_ops;
++xpc_arch_operations_no_const xpc_arch_ops;
+ /*
+  * Timer function to enforce the timelimit on the partition disengage.
+diff -urNp linux-3.1.3/drivers/misc/sgi-xp/xp.h linux-3.1.3/drivers/misc/sgi-xp/xp.h
+--- linux-3.1.3/drivers/misc/sgi-xp/xp.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/misc/sgi-xp/xp.h       2011-11-16 18:39:07.000000000 -0500
 @@ -289,7 +289,7 @@ struct xpc_interface {
                                        xpc_notify_func, void *);
        void (*received) (short, int, void *);
@@ -28637,9 +30818,21 @@ diff -urNp linux-3.0.4/drivers/misc/sgi-xp/xp.h linux-3.0.4/drivers/misc/sgi-xp/
  
  extern struct xpc_interface xpc_interface;
  
-diff -urNp linux-3.0.4/drivers/mtd/chips/cfi_cmdset_0001.c linux-3.0.4/drivers/mtd/chips/cfi_cmdset_0001.c
---- linux-3.0.4/drivers/mtd/chips/cfi_cmdset_0001.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/mtd/chips/cfi_cmdset_0001.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/mmc/host/sdhci-pci.c linux-3.1.3/drivers/mmc/host/sdhci-pci.c
+--- linux-3.1.3/drivers/mmc/host/sdhci-pci.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/mmc/host/sdhci-pci.c   2011-11-16 18:39:07.000000000 -0500
+@@ -542,7 +542,7 @@ static const struct sdhci_pci_fixes sdhc
+       .probe          = via_probe,
+ };
+-static const struct pci_device_id pci_ids[] __devinitdata = {
++static const struct pci_device_id pci_ids[] __devinitconst = {
+       {
+               .vendor         = PCI_VENDOR_ID_RICOH,
+               .device         = PCI_DEVICE_ID_RICOH_R5C822,
+diff -urNp linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0001.c linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0001.c
+--- linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0001.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0001.c    2011-11-16 18:40:10.000000000 -0500
 @@ -757,6 +757,8 @@ static int chip_ready (struct map_info *
        struct cfi_pri_intelext *cfip = cfi->cmdset_priv;
        unsigned long timeo = jiffies + HZ;
@@ -28667,9 +30860,9 @@ diff -urNp linux-3.0.4/drivers/mtd/chips/cfi_cmdset_0001.c linux-3.0.4/drivers/m
        adr += chip->start;
  
   retry:
-diff -urNp linux-3.0.4/drivers/mtd/chips/cfi_cmdset_0020.c linux-3.0.4/drivers/mtd/chips/cfi_cmdset_0020.c
---- linux-3.0.4/drivers/mtd/chips/cfi_cmdset_0020.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/mtd/chips/cfi_cmdset_0020.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0020.c linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0020.c
+--- linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0020.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/mtd/chips/cfi_cmdset_0020.c    2011-11-16 18:40:10.000000000 -0500
 @@ -255,6 +255,8 @@ static inline int do_read_onechip(struct
        unsigned long cmd_addr;
        struct cfi_private *cfi = map->fldrv_priv;
@@ -28715,9 +30908,9 @@ diff -urNp linux-3.0.4/drivers/mtd/chips/cfi_cmdset_0020.c linux-3.0.4/drivers/m
        adr += chip->start;
  
        /* Let's determine this according to the interleave only once */
-diff -urNp linux-3.0.4/drivers/mtd/devices/doc2000.c linux-3.0.4/drivers/mtd/devices/doc2000.c
---- linux-3.0.4/drivers/mtd/devices/doc2000.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/mtd/devices/doc2000.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/mtd/devices/doc2000.c linux-3.1.3/drivers/mtd/devices/doc2000.c
+--- linux-3.1.3/drivers/mtd/devices/doc2000.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/mtd/devices/doc2000.c  2011-11-16 18:39:07.000000000 -0500
 @@ -776,7 +776,7 @@ static int doc_write(struct mtd_info *mt
  
                /* The ECC will not be calculated correctly if less than 512 is written */
@@ -28727,9 +30920,9 @@ diff -urNp linux-3.0.4/drivers/mtd/devices/doc2000.c linux-3.0.4/drivers/mtd/dev
                        printk(KERN_WARNING
                               "ECC needs a full sector write (adr: %lx size %lx)\n",
                               (long) to, (long) len);
-diff -urNp linux-3.0.4/drivers/mtd/devices/doc2001.c linux-3.0.4/drivers/mtd/devices/doc2001.c
---- linux-3.0.4/drivers/mtd/devices/doc2001.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/mtd/devices/doc2001.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/mtd/devices/doc2001.c linux-3.1.3/drivers/mtd/devices/doc2001.c
+--- linux-3.1.3/drivers/mtd/devices/doc2001.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/mtd/devices/doc2001.c  2011-11-16 18:39:07.000000000 -0500
 @@ -393,7 +393,7 @@ static int doc_read (struct mtd_info *mt
        struct Nand *mychip = &this->chips[from >> (this->chipshift)];
  
@@ -28739,9 +30932,9 @@ diff -urNp linux-3.0.4/drivers/mtd/devices/doc2001.c linux-3.0.4/drivers/mtd/dev
                return -EINVAL;
  
        /* Don't allow a single read to cross a 512-byte block boundary */
-diff -urNp linux-3.0.4/drivers/mtd/ftl.c linux-3.0.4/drivers/mtd/ftl.c
---- linux-3.0.4/drivers/mtd/ftl.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/mtd/ftl.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/mtd/ftl.c linux-3.1.3/drivers/mtd/ftl.c
+--- linux-3.1.3/drivers/mtd/ftl.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/mtd/ftl.c      2011-11-16 18:40:10.000000000 -0500
 @@ -474,6 +474,8 @@ static int copy_erase_unit(partition_t *
      loff_t offset;
      uint16_t srcunitswap = cpu_to_le16(srcunit);
@@ -28751,9 +30944,9 @@ diff -urNp linux-3.0.4/drivers/mtd/ftl.c linux-3.0.4/drivers/mtd/ftl.c
      eun = &part->EUNInfo[srcunit];
      xfer = &part->XferInfo[xferunit];
      DEBUG(2, "ftl_cs: copying block 0x%x to 0x%x\n",
-diff -urNp linux-3.0.4/drivers/mtd/inftlcore.c linux-3.0.4/drivers/mtd/inftlcore.c
---- linux-3.0.4/drivers/mtd/inftlcore.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/mtd/inftlcore.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/mtd/inftlcore.c linux-3.1.3/drivers/mtd/inftlcore.c
+--- linux-3.1.3/drivers/mtd/inftlcore.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/mtd/inftlcore.c        2011-11-16 18:40:10.000000000 -0500
 @@ -259,6 +259,8 @@ static u16 INFTL_foldchain(struct INFTLr
        struct inftl_oob oob;
        size_t retlen;
@@ -28763,9 +30956,9 @@ diff -urNp linux-3.0.4/drivers/mtd/inftlcore.c linux-3.0.4/drivers/mtd/inftlcore
        DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_foldchain(inftl=%p,thisVUC=%d,"
                "pending=%d)\n", inftl, thisVUC, pendingblock);
  
-diff -urNp linux-3.0.4/drivers/mtd/inftlmount.c linux-3.0.4/drivers/mtd/inftlmount.c
---- linux-3.0.4/drivers/mtd/inftlmount.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/mtd/inftlmount.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/mtd/inftlmount.c linux-3.1.3/drivers/mtd/inftlmount.c
+--- linux-3.1.3/drivers/mtd/inftlmount.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/mtd/inftlmount.c       2011-11-16 18:40:10.000000000 -0500
 @@ -53,6 +53,8 @@ static int find_boot_record(struct INFTL
        struct INFTLPartition *ip;
        size_t retlen;
@@ -28775,9 +30968,9 @@ diff -urNp linux-3.0.4/drivers/mtd/inftlmount.c linux-3.0.4/drivers/mtd/inftlmou
        DEBUG(MTD_DEBUG_LEVEL3, "INFTL: find_boot_record(inftl=%p)\n", inftl);
  
          /*
-diff -urNp linux-3.0.4/drivers/mtd/lpddr/qinfo_probe.c linux-3.0.4/drivers/mtd/lpddr/qinfo_probe.c
---- linux-3.0.4/drivers/mtd/lpddr/qinfo_probe.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/mtd/lpddr/qinfo_probe.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/mtd/lpddr/qinfo_probe.c linux-3.1.3/drivers/mtd/lpddr/qinfo_probe.c
+--- linux-3.1.3/drivers/mtd/lpddr/qinfo_probe.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/mtd/lpddr/qinfo_probe.c        2011-11-16 18:40:10.000000000 -0500
 @@ -106,6 +106,8 @@ static int lpddr_pfow_present(struct map
  {
        map_word pfow_val[4];
@@ -28787,10 +30980,10 @@ diff -urNp linux-3.0.4/drivers/mtd/lpddr/qinfo_probe.c linux-3.0.4/drivers/mtd/l
        /* Check identification string */
        pfow_val[0] = map_read(map, map->pfow_base + PFOW_QUERY_STRING_P);
        pfow_val[1] = map_read(map, map->pfow_base + PFOW_QUERY_STRING_F);
-diff -urNp linux-3.0.4/drivers/mtd/mtdchar.c linux-3.0.4/drivers/mtd/mtdchar.c
---- linux-3.0.4/drivers/mtd/mtdchar.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/mtd/mtdchar.c  2011-08-23 21:48:14.000000000 -0400
-@@ -553,6 +553,8 @@ static int mtd_ioctl(struct file *file, 
+diff -urNp linux-3.1.3/drivers/mtd/mtdchar.c linux-3.1.3/drivers/mtd/mtdchar.c
+--- linux-3.1.3/drivers/mtd/mtdchar.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/mtd/mtdchar.c  2011-11-16 18:40:10.000000000 -0500
+@@ -554,6 +554,8 @@ static int mtd_ioctl(struct file *file, 
        u_long size;
        struct mtd_info_user info;
  
@@ -28799,9 +30992,9 @@ diff -urNp linux-3.0.4/drivers/mtd/mtdchar.c linux-3.0.4/drivers/mtd/mtdchar.c
        DEBUG(MTD_DEBUG_LEVEL0, "MTD_ioctl\n");
  
        size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT;
-diff -urNp linux-3.0.4/drivers/mtd/nand/denali.c linux-3.0.4/drivers/mtd/nand/denali.c
---- linux-3.0.4/drivers/mtd/nand/denali.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/mtd/nand/denali.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/mtd/nand/denali.c linux-3.1.3/drivers/mtd/nand/denali.c
+--- linux-3.1.3/drivers/mtd/nand/denali.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/mtd/nand/denali.c      2011-11-16 18:39:07.000000000 -0500
 @@ -26,6 +26,7 @@
  #include <linux/pci.h>
  #include <linux/mtd/mtd.h>
@@ -28810,9 +31003,9 @@ diff -urNp linux-3.0.4/drivers/mtd/nand/denali.c linux-3.0.4/drivers/mtd/nand/de
  
  #include "denali.h"
  
-diff -urNp linux-3.0.4/drivers/mtd/nftlcore.c linux-3.0.4/drivers/mtd/nftlcore.c
---- linux-3.0.4/drivers/mtd/nftlcore.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/mtd/nftlcore.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/mtd/nftlcore.c linux-3.1.3/drivers/mtd/nftlcore.c
+--- linux-3.1.3/drivers/mtd/nftlcore.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/mtd/nftlcore.c 2011-11-16 18:40:10.000000000 -0500
 @@ -264,6 +264,8 @@ static u16 NFTL_foldchain (struct NFTLre
        int inplace = 1;
        size_t retlen;
@@ -28822,9 +31015,9 @@ diff -urNp linux-3.0.4/drivers/mtd/nftlcore.c linux-3.0.4/drivers/mtd/nftlcore.c
        memset(BlockMap, 0xff, sizeof(BlockMap));
        memset(BlockFreeFound, 0, sizeof(BlockFreeFound));
  
-diff -urNp linux-3.0.4/drivers/mtd/nftlmount.c linux-3.0.4/drivers/mtd/nftlmount.c
---- linux-3.0.4/drivers/mtd/nftlmount.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/mtd/nftlmount.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/mtd/nftlmount.c linux-3.1.3/drivers/mtd/nftlmount.c
+--- linux-3.1.3/drivers/mtd/nftlmount.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/mtd/nftlmount.c        2011-11-16 18:40:10.000000000 -0500
 @@ -24,6 +24,7 @@
  #include <asm/errno.h>
  #include <linux/delay.h>
@@ -28842,10 +31035,10 @@ diff -urNp linux-3.0.4/drivers/mtd/nftlmount.c linux-3.0.4/drivers/mtd/nftlmount
          /* Assume logical EraseSize == physical erasesize for starting the scan.
           We'll sort it out later if we find a MediaHeader which says otherwise */
        /* Actually, we won't.  The new DiskOnChip driver has already scanned
-diff -urNp linux-3.0.4/drivers/mtd/ubi/build.c linux-3.0.4/drivers/mtd/ubi/build.c
---- linux-3.0.4/drivers/mtd/ubi/build.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/mtd/ubi/build.c        2011-08-23 21:47:55.000000000 -0400
-@@ -1287,7 +1287,7 @@ module_exit(ubi_exit);
+diff -urNp linux-3.1.3/drivers/mtd/ubi/build.c linux-3.1.3/drivers/mtd/ubi/build.c
+--- linux-3.1.3/drivers/mtd/ubi/build.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/mtd/ubi/build.c        2011-11-16 18:39:07.000000000 -0500
+@@ -1311,7 +1311,7 @@ module_exit(ubi_exit);
  static int __init bytes_str_to_int(const char *str)
  {
        char *endp;
@@ -28854,7 +31047,7 @@ diff -urNp linux-3.0.4/drivers/mtd/ubi/build.c linux-3.0.4/drivers/mtd/ubi/build
  
        result = simple_strtoul(str, &endp, 0);
        if (str == endp || result >= INT_MAX) {
-@@ -1298,11 +1298,11 @@ static int __init bytes_str_to_int(const
+@@ -1322,11 +1322,11 @@ static int __init bytes_str_to_int(const
  
        switch (*endp) {
        case 'G':
@@ -28869,7 +31062,7 @@ diff -urNp linux-3.0.4/drivers/mtd/ubi/build.c linux-3.0.4/drivers/mtd/ubi/build
                if (endp[1] == 'i' && endp[2] == 'B')
                        endp += 2;
        case '\0':
-@@ -1313,7 +1313,13 @@ static int __init bytes_str_to_int(const
+@@ -1337,7 +1337,13 @@ static int __init bytes_str_to_int(const
                return -EINVAL;
        }
  
@@ -28884,9 +31077,21 @@ diff -urNp linux-3.0.4/drivers/mtd/ubi/build.c linux-3.0.4/drivers/mtd/ubi/build
  }
  
  /**
-diff -urNp linux-3.0.4/drivers/net/bna/bfa_ioc_ct.c linux-3.0.4/drivers/net/bna/bfa_ioc_ct.c
---- linux-3.0.4/drivers/net/bna/bfa_ioc_ct.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/bna/bfa_ioc_ct.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/atlx/atl2.c linux-3.1.3/drivers/net/atlx/atl2.c
+--- linux-3.1.3/drivers/net/atlx/atl2.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/atlx/atl2.c        2011-11-16 18:39:07.000000000 -0500
+@@ -2857,7 +2857,7 @@ static void atl2_force_ps(struct atl2_hw
+  */
+ #define ATL2_PARAM(X, desc) \
+-    static const int __devinitdata X[ATL2_MAX_NIC + 1] = ATL2_PARAM_INIT; \
++    static const int __devinitconst X[ATL2_MAX_NIC + 1] = ATL2_PARAM_INIT; \
+     MODULE_PARM(X, "1-" __MODULE_STRING(ATL2_MAX_NIC) "i"); \
+     MODULE_PARM_DESC(X, desc);
+ #else
+diff -urNp linux-3.1.3/drivers/net/bna/bfa_ioc_ct.c linux-3.1.3/drivers/net/bna/bfa_ioc_ct.c
+--- linux-3.1.3/drivers/net/bna/bfa_ioc_ct.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/bna/bfa_ioc_ct.c   2011-11-16 18:39:07.000000000 -0500
 @@ -48,7 +48,21 @@ static void bfa_ioc_ct_sync_ack(struct b
  static bool bfa_ioc_ct_sync_complete(struct bfa_ioc *ioc);
  static enum bfa_status bfa_ioc_ct_pll_init(void __iomem *rb, bool fcmode);
@@ -28931,10 +31136,10 @@ diff -urNp linux-3.0.4/drivers/net/bna/bfa_ioc_ct.c linux-3.0.4/drivers/net/bna/
        ioc->ioc_hwif = &nw_hwif_ct;
  }
  
-diff -urNp linux-3.0.4/drivers/net/bna/bnad.c linux-3.0.4/drivers/net/bna/bnad.c
---- linux-3.0.4/drivers/net/bna/bnad.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/bna/bnad.c 2011-08-23 21:47:55.000000000 -0400
-@@ -1681,7 +1681,14 @@ bnad_setup_tx(struct bnad *bnad, uint tx
+diff -urNp linux-3.1.3/drivers/net/bna/bnad.c linux-3.1.3/drivers/net/bna/bnad.c
+--- linux-3.1.3/drivers/net/bna/bnad.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/bna/bnad.c 2011-11-16 18:39:07.000000000 -0500
+@@ -1673,7 +1673,14 @@ bnad_setup_tx(struct bnad *bnad, uint tx
        struct bna_intr_info *intr_info =
                        &res_info[BNA_TX_RES_INTR_T_TXCMPL].res_u.intr_info;
        struct bna_tx_config *tx_config = &bnad->tx_config[tx_id];
@@ -28950,7 +31155,7 @@ diff -urNp linux-3.0.4/drivers/net/bna/bnad.c linux-3.0.4/drivers/net/bna/bnad.c
        struct bna_tx *tx;
        unsigned long flags;
  
-@@ -1690,13 +1697,6 @@ bnad_setup_tx(struct bnad *bnad, uint tx
+@@ -1682,13 +1689,6 @@ bnad_setup_tx(struct bnad *bnad, uint tx
        tx_config->txq_depth = bnad->txq_depth;
        tx_config->tx_type = BNA_TX_T_REGULAR;
  
@@ -28964,7 +31169,7 @@ diff -urNp linux-3.0.4/drivers/net/bna/bnad.c linux-3.0.4/drivers/net/bna/bnad.c
        /* Get BNA's resource requirement for one tx object */
        spin_lock_irqsave(&bnad->bna_lock, flags);
        bna_tx_res_req(bnad->num_txq_per_tx,
-@@ -1827,21 +1827,21 @@ bnad_setup_rx(struct bnad *bnad, uint rx
+@@ -1819,21 +1819,21 @@ bnad_setup_rx(struct bnad *bnad, uint rx
        struct bna_intr_info *intr_info =
                        &res_info[BNA_RX_RES_T_INTR].res_u.intr_info;
        struct bna_rx_config *rx_config = &bnad->rx_config[rx_id];
@@ -28995,10 +31200,10 @@ diff -urNp linux-3.0.4/drivers/net/bna/bnad.c linux-3.0.4/drivers/net/bna/bnad.c
        /* Get BNA's resource requirement for one Rx object */
        spin_lock_irqsave(&bnad->bna_lock, flags);
        bna_rx_res_req(rx_config, res_info);
-diff -urNp linux-3.0.4/drivers/net/bnx2.c linux-3.0.4/drivers/net/bnx2.c
---- linux-3.0.4/drivers/net/bnx2.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/bnx2.c     2011-08-23 21:48:14.000000000 -0400
-@@ -5828,6 +5828,8 @@ bnx2_test_nvram(struct bnx2 *bp)
+diff -urNp linux-3.1.3/drivers/net/bnx2.c linux-3.1.3/drivers/net/bnx2.c
+--- linux-3.1.3/drivers/net/bnx2.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/bnx2.c     2011-11-16 18:40:11.000000000 -0500
+@@ -5877,6 +5877,8 @@ bnx2_test_nvram(struct bnx2 *bp)
        int rc = 0;
        u32 magic, csum;
  
@@ -29007,10 +31212,10 @@ diff -urNp linux-3.0.4/drivers/net/bnx2.c linux-3.0.4/drivers/net/bnx2.c
        if ((rc = bnx2_nvram_read(bp, 0, data, 4)) != 0)
                goto test_nvram_done;
  
-diff -urNp linux-3.0.4/drivers/net/bnx2x/bnx2x_ethtool.c linux-3.0.4/drivers/net/bnx2x/bnx2x_ethtool.c
---- linux-3.0.4/drivers/net/bnx2x/bnx2x_ethtool.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/bnx2x/bnx2x_ethtool.c      2011-08-23 21:48:14.000000000 -0400
-@@ -1705,6 +1705,8 @@ static int bnx2x_test_nvram(struct bnx2x
+diff -urNp linux-3.1.3/drivers/net/bnx2x/bnx2x_ethtool.c linux-3.1.3/drivers/net/bnx2x/bnx2x_ethtool.c
+--- linux-3.1.3/drivers/net/bnx2x/bnx2x_ethtool.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/bnx2x/bnx2x_ethtool.c      2011-11-16 18:40:11.000000000 -0500
+@@ -1943,6 +1943,8 @@ static int bnx2x_test_nvram(struct bnx2x
        int i, rc;
        u32 magic, crc;
  
@@ -29019,10 +31224,22 @@ diff -urNp linux-3.0.4/drivers/net/bnx2x/bnx2x_ethtool.c linux-3.0.4/drivers/net
        if (BP_NOMCP(bp))
                return 0;
  
-diff -urNp linux-3.0.4/drivers/net/cxgb3/l2t.h linux-3.0.4/drivers/net/cxgb3/l2t.h
---- linux-3.0.4/drivers/net/cxgb3/l2t.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/cxgb3/l2t.h        2011-08-23 21:47:55.000000000 -0400
-@@ -86,7 +86,7 @@ typedef void (*arp_failure_handler_func)
+diff -urNp linux-3.1.3/drivers/net/bnx2x/bnx2x_sp.h linux-3.1.3/drivers/net/bnx2x/bnx2x_sp.h
+--- linux-3.1.3/drivers/net/bnx2x/bnx2x_sp.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/bnx2x/bnx2x_sp.h   2011-11-16 18:39:07.000000000 -0500
+@@ -449,7 +449,7 @@ struct bnx2x_rx_mode_obj {
+       int (*wait_comp)(struct bnx2x *bp,
+                        struct bnx2x_rx_mode_ramrod_params *p);
+-};
++} __no_const;
+ /********************** Set multicast group ***********************************/
+diff -urNp linux-3.1.3/drivers/net/cxgb3/l2t.h linux-3.1.3/drivers/net/cxgb3/l2t.h
+--- linux-3.1.3/drivers/net/cxgb3/l2t.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/cxgb3/l2t.h        2011-11-16 18:39:07.000000000 -0500
+@@ -87,7 +87,7 @@ typedef void (*arp_failure_handler_func)
   */
  struct l2t_skb_cb {
        arp_failure_handler_func arp_failure_handler;
@@ -29031,9 +31248,9 @@ diff -urNp linux-3.0.4/drivers/net/cxgb3/l2t.h linux-3.0.4/drivers/net/cxgb3/l2t
  
  #define L2T_SKB_CB(skb) ((struct l2t_skb_cb *)(skb)->cb)
  
-diff -urNp linux-3.0.4/drivers/net/cxgb4/cxgb4_main.c linux-3.0.4/drivers/net/cxgb4/cxgb4_main.c
---- linux-3.0.4/drivers/net/cxgb4/cxgb4_main.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/cxgb4/cxgb4_main.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/cxgb4/cxgb4_main.c linux-3.1.3/drivers/net/cxgb4/cxgb4_main.c
+--- linux-3.1.3/drivers/net/cxgb4/cxgb4_main.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/cxgb4/cxgb4_main.c 2011-11-16 18:40:22.000000000 -0500
 @@ -3396,6 +3396,8 @@ static int __devinit enable_msix(struct 
        unsigned int nchan = adap->params.nports;
        struct msix_entry entries[MAX_INGQ + 1];
@@ -29043,9 +31260,9 @@ diff -urNp linux-3.0.4/drivers/net/cxgb4/cxgb4_main.c linux-3.0.4/drivers/net/cx
        for (i = 0; i < ARRAY_SIZE(entries); ++i)
                entries[i].entry = i;
  
-diff -urNp linux-3.0.4/drivers/net/cxgb4/t4_hw.c linux-3.0.4/drivers/net/cxgb4/t4_hw.c
---- linux-3.0.4/drivers/net/cxgb4/t4_hw.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/cxgb4/t4_hw.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/cxgb4/t4_hw.c linux-3.1.3/drivers/net/cxgb4/t4_hw.c
+--- linux-3.1.3/drivers/net/cxgb4/t4_hw.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/cxgb4/t4_hw.c      2011-11-16 18:40:22.000000000 -0500
 @@ -362,6 +362,8 @@ static int get_vpd_params(struct adapter
        u8 vpd[VPD_LEN], csum;
        unsigned int vpdr_len, kw_offset, id_len;
@@ -29055,9 +31272,9 @@ diff -urNp linux-3.0.4/drivers/net/cxgb4/t4_hw.c linux-3.0.4/drivers/net/cxgb4/t
        ret = pci_read_vpd(adapter->pdev, VPD_BASE, sizeof(vpd), vpd);
        if (ret < 0)
                return ret;
-diff -urNp linux-3.0.4/drivers/net/e1000e/82571.c linux-3.0.4/drivers/net/e1000e/82571.c
---- linux-3.0.4/drivers/net/e1000e/82571.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/e1000e/82571.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/e1000e/82571.c linux-3.1.3/drivers/net/e1000e/82571.c
+--- linux-3.1.3/drivers/net/e1000e/82571.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/e1000e/82571.c     2011-11-16 18:39:07.000000000 -0500
 @@ -239,7 +239,7 @@ static s32 e1000_init_mac_params_82571(s
  {
        struct e1000_hw *hw = &adapter->hw;
@@ -29067,9 +31284,9 @@ diff -urNp linux-3.0.4/drivers/net/e1000e/82571.c linux-3.0.4/drivers/net/e1000e
        u32 swsm = 0;
        u32 swsm2 = 0;
        bool force_clear_smbi = false;
-diff -urNp linux-3.0.4/drivers/net/e1000e/es2lan.c linux-3.0.4/drivers/net/e1000e/es2lan.c
---- linux-3.0.4/drivers/net/e1000e/es2lan.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/e1000e/es2lan.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/e1000e/es2lan.c linux-3.1.3/drivers/net/e1000e/es2lan.c
+--- linux-3.1.3/drivers/net/e1000e/es2lan.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/e1000e/es2lan.c    2011-11-16 18:39:07.000000000 -0500
 @@ -205,7 +205,7 @@ static s32 e1000_init_mac_params_80003es
  {
        struct e1000_hw *hw = &adapter->hw;
@@ -29079,18 +31296,18 @@ diff -urNp linux-3.0.4/drivers/net/e1000e/es2lan.c linux-3.0.4/drivers/net/e1000
  
        /* Set media type */
        switch (adapter->pdev->device) {
-diff -urNp linux-3.0.4/drivers/net/e1000e/hw.h linux-3.0.4/drivers/net/e1000e/hw.h
---- linux-3.0.4/drivers/net/e1000e/hw.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/e1000e/hw.h        2011-08-23 21:47:55.000000000 -0400
-@@ -776,6 +776,7 @@ struct e1000_mac_operations {
+diff -urNp linux-3.1.3/drivers/net/e1000e/hw.h linux-3.1.3/drivers/net/e1000e/hw.h
+--- linux-3.1.3/drivers/net/e1000e/hw.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/e1000e/hw.h        2011-11-16 18:39:07.000000000 -0500
+@@ -778,6 +778,7 @@ struct e1000_mac_operations {
        void (*write_vfta)(struct e1000_hw *, u32, u32);
        s32  (*read_mac_addr)(struct e1000_hw *);
  };
 +typedef struct e1000_mac_operations __no_const e1000_mac_operations_no_const;
  
- /* Function pointers for the PHY. */
- struct e1000_phy_operations {
-@@ -799,6 +800,7 @@ struct e1000_phy_operations {
+ /*
+  * When to use various PHY register access functions:
+@@ -818,6 +819,7 @@ struct e1000_phy_operations {
        void (*power_up)(struct e1000_hw *);
        void (*power_down)(struct e1000_hw *);
  };
@@ -29098,7 +31315,7 @@ diff -urNp linux-3.0.4/drivers/net/e1000e/hw.h linux-3.0.4/drivers/net/e1000e/hw
  
  /* Function pointers for the NVM. */
  struct e1000_nvm_operations {
-@@ -810,9 +812,10 @@ struct e1000_nvm_operations {
+@@ -829,9 +831,10 @@ struct e1000_nvm_operations {
        s32  (*validate)(struct e1000_hw *);
        s32  (*write)(struct e1000_hw *, u16, u16, u16 *);
  };
@@ -29110,7 +31327,7 @@ diff -urNp linux-3.0.4/drivers/net/e1000e/hw.h linux-3.0.4/drivers/net/e1000e/hw
        u8 addr[ETH_ALEN];
        u8 perm_addr[ETH_ALEN];
  
-@@ -853,7 +856,7 @@ struct e1000_mac_info {
+@@ -872,7 +875,7 @@ struct e1000_mac_info {
  };
  
  struct e1000_phy_info {
@@ -29119,7 +31336,7 @@ diff -urNp linux-3.0.4/drivers/net/e1000e/hw.h linux-3.0.4/drivers/net/e1000e/hw
  
        enum e1000_phy_type type;
  
-@@ -887,7 +890,7 @@ struct e1000_phy_info {
+@@ -906,7 +909,7 @@ struct e1000_phy_info {
  };
  
  struct e1000_nvm_info {
@@ -29128,9 +31345,21 @@ diff -urNp linux-3.0.4/drivers/net/e1000e/hw.h linux-3.0.4/drivers/net/e1000e/hw
  
        enum e1000_nvm_type type;
        enum e1000_nvm_override override;
-diff -urNp linux-3.0.4/drivers/net/hamradio/6pack.c linux-3.0.4/drivers/net/hamradio/6pack.c
---- linux-3.0.4/drivers/net/hamradio/6pack.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/hamradio/6pack.c   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/fealnx.c linux-3.1.3/drivers/net/fealnx.c
+--- linux-3.1.3/drivers/net/fealnx.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/fealnx.c   2011-11-16 18:39:07.000000000 -0500
+@@ -150,7 +150,7 @@ struct chip_info {
+       int flags;
+ };
+-static const struct chip_info skel_netdrv_tbl[] __devinitdata = {
++static const struct chip_info skel_netdrv_tbl[] __devinitconst = {
+       { "100/10M Ethernet PCI Adapter",       HAS_MII_XCVR },
+       { "100/10M Ethernet PCI Adapter",       HAS_CHIP_XCVR },
+       { "1000/100/10M Ethernet PCI Adapter",  HAS_MII_XCVR },
+diff -urNp linux-3.1.3/drivers/net/hamradio/6pack.c linux-3.1.3/drivers/net/hamradio/6pack.c
+--- linux-3.1.3/drivers/net/hamradio/6pack.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/hamradio/6pack.c   2011-11-16 18:40:22.000000000 -0500
 @@ -463,6 +463,8 @@ static void sixpack_receive_buf(struct t
        unsigned char buf[512];
        int count1;
@@ -29140,9 +31369,9 @@ diff -urNp linux-3.0.4/drivers/net/hamradio/6pack.c linux-3.0.4/drivers/net/hamr
        if (!count)
                return;
  
-diff -urNp linux-3.0.4/drivers/net/igb/e1000_hw.h linux-3.0.4/drivers/net/igb/e1000_hw.h
---- linux-3.0.4/drivers/net/igb/e1000_hw.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/igb/e1000_hw.h     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/igb/e1000_hw.h linux-3.1.3/drivers/net/igb/e1000_hw.h
+--- linux-3.1.3/drivers/net/igb/e1000_hw.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/igb/e1000_hw.h     2011-11-16 18:39:07.000000000 -0500
 @@ -314,6 +314,7 @@ struct e1000_mac_operations {
        s32  (*read_mac_addr)(struct e1000_hw *);
        s32  (*get_speed_and_duplex)(struct e1000_hw *, u16 *, u16 *);
@@ -29211,9 +31440,9 @@ diff -urNp linux-3.0.4/drivers/net/igb/e1000_hw.h linux-3.0.4/drivers/net/igb/e1
        struct e1000_mbx_stats stats;
        u32 timeout;
        u32 usec_delay;
-diff -urNp linux-3.0.4/drivers/net/igbvf/vf.h linux-3.0.4/drivers/net/igbvf/vf.h
---- linux-3.0.4/drivers/net/igbvf/vf.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/igbvf/vf.h 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/igbvf/vf.h linux-3.1.3/drivers/net/igbvf/vf.h
+--- linux-3.1.3/drivers/net/igbvf/vf.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/igbvf/vf.h 2011-11-16 18:39:07.000000000 -0500
 @@ -189,9 +189,10 @@ struct e1000_mac_operations {
        s32  (*read_mac_addr)(struct e1000_hw *);
        s32  (*set_vfta)(struct e1000_hw *, u16, bool);
@@ -29243,9 +31472,9 @@ diff -urNp linux-3.0.4/drivers/net/igbvf/vf.h linux-3.0.4/drivers/net/igbvf/vf.h
        struct e1000_mbx_stats stats;
        u32 timeout;
        u32 usec_delay;
-diff -urNp linux-3.0.4/drivers/net/ixgb/ixgb_main.c linux-3.0.4/drivers/net/ixgb/ixgb_main.c
---- linux-3.0.4/drivers/net/ixgb/ixgb_main.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/ixgb/ixgb_main.c   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/ixgb/ixgb_main.c linux-3.1.3/drivers/net/ixgb/ixgb_main.c
+--- linux-3.1.3/drivers/net/ixgb/ixgb_main.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/ixgb/ixgb_main.c   2011-11-16 18:40:22.000000000 -0500
 @@ -1070,6 +1070,8 @@ ixgb_set_multi(struct net_device *netdev
        u32 rctl;
        int i;
@@ -29255,9 +31484,9 @@ diff -urNp linux-3.0.4/drivers/net/ixgb/ixgb_main.c linux-3.0.4/drivers/net/ixgb
        /* Check for Promiscuous and All Multicast modes */
  
        rctl = IXGB_READ_REG(hw, RCTL);
-diff -urNp linux-3.0.4/drivers/net/ixgb/ixgb_param.c linux-3.0.4/drivers/net/ixgb/ixgb_param.c
---- linux-3.0.4/drivers/net/ixgb/ixgb_param.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/ixgb/ixgb_param.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/ixgb/ixgb_param.c linux-3.1.3/drivers/net/ixgb/ixgb_param.c
+--- linux-3.1.3/drivers/net/ixgb/ixgb_param.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/ixgb/ixgb_param.c  2011-11-16 18:40:22.000000000 -0500
 @@ -261,6 +261,9 @@ void __devinit
  ixgb_check_options(struct ixgb_adapter *adapter)
  {
@@ -29268,10 +31497,10 @@ diff -urNp linux-3.0.4/drivers/net/ixgb/ixgb_param.c linux-3.0.4/drivers/net/ixg
        if (bd >= IXGB_MAX_NIC) {
                pr_notice("Warning: no configuration for board #%i\n", bd);
                pr_notice("Using defaults for all values\n");
-diff -urNp linux-3.0.4/drivers/net/ixgbe/ixgbe_type.h linux-3.0.4/drivers/net/ixgbe/ixgbe_type.h
---- linux-3.0.4/drivers/net/ixgbe/ixgbe_type.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/ixgbe/ixgbe_type.h 2011-08-23 21:47:55.000000000 -0400
-@@ -2584,6 +2584,7 @@ struct ixgbe_eeprom_operations {
+diff -urNp linux-3.1.3/drivers/net/ixgbe/ixgbe_type.h linux-3.1.3/drivers/net/ixgbe/ixgbe_type.h
+--- linux-3.1.3/drivers/net/ixgbe/ixgbe_type.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/ixgbe/ixgbe_type.h 2011-11-16 18:39:07.000000000 -0500
+@@ -2642,6 +2642,7 @@ struct ixgbe_eeprom_operations {
        s32 (*update_checksum)(struct ixgbe_hw *);
        u16 (*calc_checksum)(struct ixgbe_hw *);
  };
@@ -29279,15 +31508,15 @@ diff -urNp linux-3.0.4/drivers/net/ixgbe/ixgbe_type.h linux-3.0.4/drivers/net/ix
  
  struct ixgbe_mac_operations {
        s32 (*init_hw)(struct ixgbe_hw *);
-@@ -2639,6 +2640,7 @@ struct ixgbe_mac_operations {
-       /* Flow Control */
-       s32 (*fc_enable)(struct ixgbe_hw *, s32);
+@@ -2703,6 +2704,7 @@ struct ixgbe_mac_operations {
+       /* Manageability interface */
+       s32 (*set_fw_drv_ver)(struct ixgbe_hw *, u8, u8, u8, u8);
  };
 +typedef struct ixgbe_mac_operations __no_const ixgbe_mac_operations_no_const;
  
  struct ixgbe_phy_operations {
        s32 (*identify)(struct ixgbe_hw *);
-@@ -2658,9 +2660,10 @@ struct ixgbe_phy_operations {
+@@ -2722,9 +2724,10 @@ struct ixgbe_phy_operations {
        s32 (*write_i2c_eeprom)(struct ixgbe_hw *, u8, u8);
        s32 (*check_overtemp)(struct ixgbe_hw *);
  };
@@ -29299,7 +31528,7 @@ diff -urNp linux-3.0.4/drivers/net/ixgbe/ixgbe_type.h linux-3.0.4/drivers/net/ix
        enum ixgbe_eeprom_type          type;
        u32                             semaphore_delay;
        u16                             word_size;
-@@ -2670,7 +2673,7 @@ struct ixgbe_eeprom_info {
+@@ -2734,7 +2737,7 @@ struct ixgbe_eeprom_info {
  
  #define IXGBE_FLAGS_DOUBLE_RESET_REQUIRED     0x01
  struct ixgbe_mac_info {
@@ -29308,7 +31537,7 @@ diff -urNp linux-3.0.4/drivers/net/ixgbe/ixgbe_type.h linux-3.0.4/drivers/net/ix
        enum ixgbe_mac_type             type;
        u8                              addr[IXGBE_ETH_LENGTH_OF_ADDRESS];
        u8                              perm_addr[IXGBE_ETH_LENGTH_OF_ADDRESS];
-@@ -2698,7 +2701,7 @@ struct ixgbe_mac_info {
+@@ -2762,7 +2765,7 @@ struct ixgbe_mac_info {
  };
  
  struct ixgbe_phy_info {
@@ -29317,7 +31546,7 @@ diff -urNp linux-3.0.4/drivers/net/ixgbe/ixgbe_type.h linux-3.0.4/drivers/net/ix
        struct mdio_if_info             mdio;
        enum ixgbe_phy_type             type;
        u32                             id;
-@@ -2726,6 +2729,7 @@ struct ixgbe_mbx_operations {
+@@ -2790,6 +2793,7 @@ struct ixgbe_mbx_operations {
        s32 (*check_for_ack)(struct ixgbe_hw *, u16);
        s32 (*check_for_rst)(struct ixgbe_hw *, u16);
  };
@@ -29325,7 +31554,7 @@ diff -urNp linux-3.0.4/drivers/net/ixgbe/ixgbe_type.h linux-3.0.4/drivers/net/ix
  
  struct ixgbe_mbx_stats {
        u32 msgs_tx;
-@@ -2737,7 +2741,7 @@ struct ixgbe_mbx_stats {
+@@ -2801,7 +2805,7 @@ struct ixgbe_mbx_stats {
  };
  
  struct ixgbe_mbx_info {
@@ -29334,9 +31563,9 @@ diff -urNp linux-3.0.4/drivers/net/ixgbe/ixgbe_type.h linux-3.0.4/drivers/net/ix
        struct ixgbe_mbx_stats stats;
        u32 timeout;
        u32 usec_delay;
-diff -urNp linux-3.0.4/drivers/net/ixgbevf/vf.h linux-3.0.4/drivers/net/ixgbevf/vf.h
---- linux-3.0.4/drivers/net/ixgbevf/vf.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/ixgbevf/vf.h       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/ixgbevf/vf.h linux-3.1.3/drivers/net/ixgbevf/vf.h
+--- linux-3.1.3/drivers/net/ixgbevf/vf.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/ixgbevf/vf.h       2011-11-16 18:39:07.000000000 -0500
 @@ -70,6 +70,7 @@ struct ixgbe_mac_operations {
        s32 (*clear_vfta)(struct ixgbe_hw *);
        s32 (*set_vfta)(struct ixgbe_hw *, u32, u32, bool);
@@ -29371,10 +31600,10 @@ diff -urNp linux-3.0.4/drivers/net/ixgbevf/vf.h linux-3.0.4/drivers/net/ixgbevf/
        struct ixgbe_mbx_stats stats;
        u32 timeout;
        u32 udelay;
-diff -urNp linux-3.0.4/drivers/net/ksz884x.c linux-3.0.4/drivers/net/ksz884x.c
---- linux-3.0.4/drivers/net/ksz884x.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/ksz884x.c  2011-08-23 21:48:14.000000000 -0400
-@@ -6534,6 +6534,8 @@ static void netdev_get_ethtool_stats(str
+diff -urNp linux-3.1.3/drivers/net/ksz884x.c linux-3.1.3/drivers/net/ksz884x.c
+--- linux-3.1.3/drivers/net/ksz884x.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/ksz884x.c  2011-11-16 18:40:22.000000000 -0500
+@@ -6533,6 +6533,8 @@ static void netdev_get_ethtool_stats(str
        int rc;
        u64 counter[TOTAL_PORT_COUNTER_NUM];
  
@@ -29383,9 +31612,9 @@ diff -urNp linux-3.0.4/drivers/net/ksz884x.c linux-3.0.4/drivers/net/ksz884x.c
        mutex_lock(&hw_priv->lock);
        n = SWITCH_PORT_NUM;
        for (i = 0, p = port->first_port; i < port->mib_port_cnt; i++, p++) {
-diff -urNp linux-3.0.4/drivers/net/mlx4/main.c linux-3.0.4/drivers/net/mlx4/main.c
---- linux-3.0.4/drivers/net/mlx4/main.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/mlx4/main.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/mlx4/main.c linux-3.1.3/drivers/net/mlx4/main.c
+--- linux-3.1.3/drivers/net/mlx4/main.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/mlx4/main.c        2011-11-16 18:40:22.000000000 -0500
 @@ -40,6 +40,7 @@
  #include <linux/dma-mapping.h>
  #include <linux/slab.h>
@@ -29394,7 +31623,7 @@ diff -urNp linux-3.0.4/drivers/net/mlx4/main.c linux-3.0.4/drivers/net/mlx4/main
  
  #include <linux/mlx4/device.h>
  #include <linux/mlx4/doorbell.h>
-@@ -764,6 +765,8 @@ static int mlx4_init_hca(struct mlx4_dev
+@@ -762,6 +763,8 @@ static int mlx4_init_hca(struct mlx4_dev
        u64 icm_size;
        int err;
  
@@ -29403,10 +31632,10 @@ diff -urNp linux-3.0.4/drivers/net/mlx4/main.c linux-3.0.4/drivers/net/mlx4/main
        err = mlx4_QUERY_FW(dev);
        if (err) {
                if (err == -EACCES)
-diff -urNp linux-3.0.4/drivers/net/niu.c linux-3.0.4/drivers/net/niu.c
---- linux-3.0.4/drivers/net/niu.c      2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/net/niu.c      2011-08-23 21:48:14.000000000 -0400
-@@ -9056,6 +9056,8 @@ static void __devinit niu_try_msix(struc
+diff -urNp linux-3.1.3/drivers/net/niu.c linux-3.1.3/drivers/net/niu.c
+--- linux-3.1.3/drivers/net/niu.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/niu.c      2011-11-16 18:40:22.000000000 -0500
+@@ -9061,6 +9061,8 @@ static void __devinit niu_try_msix(struc
        int i, num_irqs, err;
        u8 first_ldg;
  
@@ -29415,18 +31644,9 @@ diff -urNp linux-3.0.4/drivers/net/niu.c linux-3.0.4/drivers/net/niu.c
        first_ldg = (NIU_NUM_LDG / parent->num_ports) * np->port;
        for (i = 0; i < (NIU_NUM_LDG / parent->num_ports); i++)
                ldg_num_map[i] = first_ldg + i;
-diff -urNp linux-3.0.4/drivers/net/pcnet32.c linux-3.0.4/drivers/net/pcnet32.c
---- linux-3.0.4/drivers/net/pcnet32.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/pcnet32.c  2011-08-23 21:47:55.000000000 -0400
-@@ -82,7 +82,7 @@ static int cards_found;
- /*
-  * VLB I/O addresses
-  */
--static unsigned int pcnet32_portlist[] __initdata =
-+static unsigned int pcnet32_portlist[] __devinitdata =
-     { 0x300, 0x320, 0x340, 0x360, 0 };
- static int pcnet32_debug;
+diff -urNp linux-3.1.3/drivers/net/pcnet32.c linux-3.1.3/drivers/net/pcnet32.c
+--- linux-3.1.3/drivers/net/pcnet32.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/pcnet32.c  2011-11-16 18:39:07.000000000 -0500
 @@ -270,7 +270,7 @@ struct pcnet32_private {
        struct sk_buff          **rx_skbuff;
        dma_addr_t              *tx_dma_addr;
@@ -29934,7 +32154,7 @@ diff -urNp linux-3.0.4/drivers/net/pcnet32.c linux-3.0.4/drivers/net/pcnet32.c
        spin_unlock_irqrestore(&lp->lock, flags);
  
        return &dev->stats;
-@@ -2578,10 +2578,10 @@ static void pcnet32_load_multicast(struc
+@@ -2577,10 +2577,10 @@ static void pcnet32_load_multicast(struc
        if (dev->flags & IFF_ALLMULTI) {
                ib->filter[0] = cpu_to_le32(~0U);
                ib->filter[1] = cpu_to_le32(~0U);
@@ -29949,7 +32169,7 @@ diff -urNp linux-3.0.4/drivers/net/pcnet32.c linux-3.0.4/drivers/net/pcnet32.c
                return;
        }
        /* clear the multicast filter */
-@@ -2601,7 +2601,7 @@ static void pcnet32_load_multicast(struc
+@@ -2594,7 +2594,7 @@ static void pcnet32_load_multicast(struc
                mcast_table[crc >> 4] |= cpu_to_le16(1 << (crc & 0xf));
        }
        for (i = 0; i < 4; i++)
@@ -29958,7 +32178,7 @@ diff -urNp linux-3.0.4/drivers/net/pcnet32.c linux-3.0.4/drivers/net/pcnet32.c
                                le16_to_cpu(mcast_table[i]));
  }
  
-@@ -2616,28 +2616,28 @@ static void pcnet32_set_multicast_list(s
+@@ -2609,28 +2609,28 @@ static void pcnet32_set_multicast_list(s
  
        spin_lock_irqsave(&lp->lock, flags);
        suspended = pcnet32_suspend(dev, &flags, 0);
@@ -29993,7 +32213,7 @@ diff -urNp linux-3.0.4/drivers/net/pcnet32.c linux-3.0.4/drivers/net/pcnet32.c
                pcnet32_restart(dev, CSR0_NORMAL);
                netif_wake_queue(dev);
        }
-@@ -2655,8 +2655,8 @@ static int mdio_read(struct net_device *
+@@ -2648,8 +2648,8 @@ static int mdio_read(struct net_device *
        if (!lp->mii)
                return 0;
  
@@ -30004,7 +32224,7 @@ diff -urNp linux-3.0.4/drivers/net/pcnet32.c linux-3.0.4/drivers/net/pcnet32.c
  
        return val_out;
  }
-@@ -2670,8 +2670,8 @@ static void mdio_write(struct net_device
+@@ -2663,8 +2663,8 @@ static void mdio_write(struct net_device
        if (!lp->mii)
                return;
  
@@ -30015,7 +32235,7 @@ diff -urNp linux-3.0.4/drivers/net/pcnet32.c linux-3.0.4/drivers/net/pcnet32.c
  }
  
  static int pcnet32_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
-@@ -2748,7 +2748,7 @@ static void pcnet32_check_media(struct n
+@@ -2741,7 +2741,7 @@ static void pcnet32_check_media(struct n
                curr_link = mii_link_ok(&lp->mii_if);
        } else {
                ulong ioaddr = dev->base_addr;  /* card base I/O address */
@@ -30024,7 +32244,7 @@ diff -urNp linux-3.0.4/drivers/net/pcnet32.c linux-3.0.4/drivers/net/pcnet32.c
        }
        if (!curr_link) {
                if (prev_link || verbose) {
-@@ -2771,13 +2771,13 @@ static void pcnet32_check_media(struct n
+@@ -2764,13 +2764,13 @@ static void pcnet32_check_media(struct n
                                            (ecmd.duplex == DUPLEX_FULL)
                                            ? "full" : "half");
                        }
@@ -30040,9 +32260,9 @@ diff -urNp linux-3.0.4/drivers/net/pcnet32.c linux-3.0.4/drivers/net/pcnet32.c
                        }
                } else {
                        netif_info(lp, link, dev, "link up\n");
-diff -urNp linux-3.0.4/drivers/net/ppp_generic.c linux-3.0.4/drivers/net/ppp_generic.c
---- linux-3.0.4/drivers/net/ppp_generic.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/ppp_generic.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/ppp_generic.c linux-3.1.3/drivers/net/ppp_generic.c
+--- linux-3.1.3/drivers/net/ppp_generic.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/ppp_generic.c      2011-11-16 18:39:07.000000000 -0500
 @@ -987,7 +987,6 @@ ppp_net_ioctl(struct net_device *dev, st
        void __user *addr = (void __user *) ifr->ifr_ifru.ifru_data;
        struct ppp_stats stats;
@@ -30061,10 +32281,10 @@ diff -urNp linux-3.0.4/drivers/net/ppp_generic.c linux-3.0.4/drivers/net/ppp_gen
                        break;
                err = 0;
                break;
-diff -urNp linux-3.0.4/drivers/net/r8169.c linux-3.0.4/drivers/net/r8169.c
---- linux-3.0.4/drivers/net/r8169.c    2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/net/r8169.c    2011-08-23 21:47:55.000000000 -0400
-@@ -645,12 +645,12 @@ struct rtl8169_private {
+diff -urNp linux-3.1.3/drivers/net/r8169.c linux-3.1.3/drivers/net/r8169.c
+--- linux-3.1.3/drivers/net/r8169.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/r8169.c    2011-11-16 18:39:07.000000000 -0500
+@@ -663,12 +663,12 @@ struct rtl8169_private {
        struct mdio_ops {
                void (*write)(void __iomem *, int, int);
                int (*read)(void __iomem *, int);
@@ -30079,9 +32299,33 @@ diff -urNp linux-3.0.4/drivers/net/r8169.c linux-3.0.4/drivers/net/r8169.c
  
        int (*set_speed)(struct net_device *, u8 aneg, u16 sp, u8 dpx, u32 adv);
        int (*get_settings)(struct net_device *, struct ethtool_cmd *);
-diff -urNp linux-3.0.4/drivers/net/tg3.h linux-3.0.4/drivers/net/tg3.h
---- linux-3.0.4/drivers/net/tg3.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/tg3.h      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/sis190.c linux-3.1.3/drivers/net/sis190.c
+--- linux-3.1.3/drivers/net/sis190.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/sis190.c   2011-11-16 18:39:07.000000000 -0500
+@@ -1624,7 +1624,7 @@ static int __devinit sis190_get_mac_addr
+ static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
+                                                 struct net_device *dev)
+ {
+-      static const u16 __devinitdata ids[] = { 0x0965, 0x0966, 0x0968 };
++      static const u16 __devinitconst ids[] = { 0x0965, 0x0966, 0x0968 };
+       struct sis190_private *tp = netdev_priv(dev);
+       struct pci_dev *isa_bridge;
+       u8 reg, tmp8;
+diff -urNp linux-3.1.3/drivers/net/sundance.c linux-3.1.3/drivers/net/sundance.c
+--- linux-3.1.3/drivers/net/sundance.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/sundance.c 2011-11-16 18:39:07.000000000 -0500
+@@ -218,7 +218,7 @@ enum {
+ struct pci_id_info {
+         const char *name;
+ };
+-static const struct pci_id_info pci_id_tbl[] __devinitdata = {
++static const struct pci_id_info pci_id_tbl[] __devinitconst = {
+       {"D-Link DFE-550TX FAST Ethernet Adapter"},
+       {"D-Link DFE-550FX 100Mbps Fiber-optics Adapter"},
+       {"D-Link DFE-580TX 4 port Server Adapter"},
+diff -urNp linux-3.1.3/drivers/net/tg3.h linux-3.1.3/drivers/net/tg3.h
+--- linux-3.1.3/drivers/net/tg3.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/tg3.h      2011-11-16 18:39:07.000000000 -0500
 @@ -134,6 +134,7 @@
  #define  CHIPREV_ID_5750_A0            0x4000
  #define  CHIPREV_ID_5750_A1            0x4001
@@ -30090,9 +32334,9 @@ diff -urNp linux-3.0.4/drivers/net/tg3.h linux-3.0.4/drivers/net/tg3.h
  #define  CHIPREV_ID_5750_C2            0x4202
  #define  CHIPREV_ID_5752_A0_HW                 0x5000
  #define  CHIPREV_ID_5752_A0            0x6000
-diff -urNp linux-3.0.4/drivers/net/tokenring/abyss.c linux-3.0.4/drivers/net/tokenring/abyss.c
---- linux-3.0.4/drivers/net/tokenring/abyss.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/tokenring/abyss.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/tokenring/abyss.c linux-3.1.3/drivers/net/tokenring/abyss.c
+--- linux-3.1.3/drivers/net/tokenring/abyss.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/tokenring/abyss.c  2011-11-16 18:39:07.000000000 -0500
 @@ -451,10 +451,12 @@ static struct pci_driver abyss_driver = 
  
  static int __init abyss_init (void)
@@ -30109,9 +32353,9 @@ diff -urNp linux-3.0.4/drivers/net/tokenring/abyss.c linux-3.0.4/drivers/net/tok
  
        return pci_register_driver(&abyss_driver);
  }
-diff -urNp linux-3.0.4/drivers/net/tokenring/madgemc.c linux-3.0.4/drivers/net/tokenring/madgemc.c
---- linux-3.0.4/drivers/net/tokenring/madgemc.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/tokenring/madgemc.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/tokenring/madgemc.c linux-3.1.3/drivers/net/tokenring/madgemc.c
+--- linux-3.1.3/drivers/net/tokenring/madgemc.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/tokenring/madgemc.c        2011-11-16 18:39:07.000000000 -0500
 @@ -744,9 +744,11 @@ static struct mca_driver madgemc_driver 
  
  static int __init madgemc_init (void)
@@ -30127,9 +32371,9 @@ diff -urNp linux-3.0.4/drivers/net/tokenring/madgemc.c linux-3.0.4/drivers/net/t
  
        return mca_register_driver (&madgemc_driver);
  }
-diff -urNp linux-3.0.4/drivers/net/tokenring/proteon.c linux-3.0.4/drivers/net/tokenring/proteon.c
---- linux-3.0.4/drivers/net/tokenring/proteon.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/tokenring/proteon.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/tokenring/proteon.c linux-3.1.3/drivers/net/tokenring/proteon.c
+--- linux-3.1.3/drivers/net/tokenring/proteon.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/tokenring/proteon.c        2011-11-16 18:39:07.000000000 -0500
 @@ -353,9 +353,11 @@ static int __init proteon_init(void)
        struct platform_device *pdev;
        int i, num = 0, err = 0;
@@ -30145,9 +32389,9 @@ diff -urNp linux-3.0.4/drivers/net/tokenring/proteon.c linux-3.0.4/drivers/net/t
  
        err = platform_driver_register(&proteon_driver);
        if (err)
-diff -urNp linux-3.0.4/drivers/net/tokenring/skisa.c linux-3.0.4/drivers/net/tokenring/skisa.c
---- linux-3.0.4/drivers/net/tokenring/skisa.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/tokenring/skisa.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/tokenring/skisa.c linux-3.1.3/drivers/net/tokenring/skisa.c
+--- linux-3.1.3/drivers/net/tokenring/skisa.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/tokenring/skisa.c  2011-11-16 18:39:07.000000000 -0500
 @@ -363,9 +363,11 @@ static int __init sk_isa_init(void)
        struct platform_device *pdev;
        int i, num = 0, err = 0;
@@ -30163,10 +32407,10 @@ diff -urNp linux-3.0.4/drivers/net/tokenring/skisa.c linux-3.0.4/drivers/net/tok
  
        err = platform_driver_register(&sk_isa_driver);
        if (err)
-diff -urNp linux-3.0.4/drivers/net/tulip/de2104x.c linux-3.0.4/drivers/net/tulip/de2104x.c
---- linux-3.0.4/drivers/net/tulip/de2104x.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/tulip/de2104x.c    2011-08-23 21:48:14.000000000 -0400
-@@ -1794,6 +1794,8 @@ static void __devinit de21041_get_srom_i
+diff -urNp linux-3.1.3/drivers/net/tulip/de2104x.c linux-3.1.3/drivers/net/tulip/de2104x.c
+--- linux-3.1.3/drivers/net/tulip/de2104x.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/tulip/de2104x.c    2011-11-16 18:40:22.000000000 -0500
+@@ -1795,6 +1795,8 @@ static void __devinit de21041_get_srom_i
        struct de_srom_info_leaf *il;
        void *bufp;
  
@@ -30175,10 +32419,10 @@ diff -urNp linux-3.0.4/drivers/net/tulip/de2104x.c linux-3.0.4/drivers/net/tulip
        /* download entire eeprom */
        for (i = 0; i < DE_EEPROM_WORDS; i++)
                ((__le16 *)ee_data)[i] =
-diff -urNp linux-3.0.4/drivers/net/tulip/de4x5.c linux-3.0.4/drivers/net/tulip/de4x5.c
---- linux-3.0.4/drivers/net/tulip/de4x5.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/tulip/de4x5.c      2011-08-23 21:47:55.000000000 -0400
-@@ -5401,7 +5401,7 @@ de4x5_ioctl(struct net_device *dev, stru
+diff -urNp linux-3.1.3/drivers/net/tulip/de4x5.c linux-3.1.3/drivers/net/tulip/de4x5.c
+--- linux-3.1.3/drivers/net/tulip/de4x5.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/tulip/de4x5.c      2011-11-16 18:39:07.000000000 -0500
+@@ -5397,7 +5397,7 @@ de4x5_ioctl(struct net_device *dev, stru
        for (i=0; i<ETH_ALEN; i++) {
            tmp.addr[i] = dev->dev_addr[i];
        }
@@ -30187,7 +32431,7 @@ diff -urNp linux-3.0.4/drivers/net/tulip/de4x5.c linux-3.0.4/drivers/net/tulip/d
        break;
  
      case DE4X5_SET_HWADDR:           /* Set the hardware address */
-@@ -5441,7 +5441,7 @@ de4x5_ioctl(struct net_device *dev, stru
+@@ -5437,7 +5437,7 @@ de4x5_ioctl(struct net_device *dev, stru
        spin_lock_irqsave(&lp->lock, flags);
        memcpy(&statbuf, &lp->pktStats, ioc->len);
        spin_unlock_irqrestore(&lp->lock, flags);
@@ -30196,9 +32440,33 @@ diff -urNp linux-3.0.4/drivers/net/tulip/de4x5.c linux-3.0.4/drivers/net/tulip/d
                return -EFAULT;
        break;
      }
-diff -urNp linux-3.0.4/drivers/net/usb/hso.c linux-3.0.4/drivers/net/usb/hso.c
---- linux-3.0.4/drivers/net/usb/hso.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/usb/hso.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/tulip/eeprom.c linux-3.1.3/drivers/net/tulip/eeprom.c
+--- linux-3.1.3/drivers/net/tulip/eeprom.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/tulip/eeprom.c     2011-11-16 18:39:07.000000000 -0500
+@@ -81,7 +81,7 @@ static struct eeprom_fixup eeprom_fixups
+   {NULL}};
+-static const char *block_name[] __devinitdata = {
++static const char *block_name[] __devinitconst = {
+       "21140 non-MII",
+       "21140 MII PHY",
+       "21142 Serial PHY",
+diff -urNp linux-3.1.3/drivers/net/tulip/winbond-840.c linux-3.1.3/drivers/net/tulip/winbond-840.c
+--- linux-3.1.3/drivers/net/tulip/winbond-840.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/tulip/winbond-840.c        2011-11-16 18:39:07.000000000 -0500
+@@ -236,7 +236,7 @@ struct pci_id_info {
+         int drv_flags;                /* Driver use, intended as capability flags. */
+ };
+-static const struct pci_id_info pci_id_tbl[] __devinitdata = {
++static const struct pci_id_info pci_id_tbl[] __devinitconst = {
+       {                               /* Sometime a Level-One switch card. */
+         "Winbond W89c840",    CanHaveMII | HasBrokenTx | FDXOnNoMII},
+       { "Winbond W89c840",    CanHaveMII | HasBrokenTx},
+diff -urNp linux-3.1.3/drivers/net/usb/hso.c linux-3.1.3/drivers/net/usb/hso.c
+--- linux-3.1.3/drivers/net/usb/hso.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/usb/hso.c  2011-11-16 18:39:07.000000000 -0500
 @@ -71,7 +71,7 @@
  #include <asm/byteorder.h>
  #include <linux/serial_core.h>
@@ -30295,10 +32563,10 @@ diff -urNp linux-3.0.4/drivers/net/usb/hso.c linux-3.0.4/drivers/net/usb/hso.c
                                result =
                                    hso_start_serial_device(serial_table[i], GFP_NOIO);
                                hso_kick_transmit(dev2ser(serial_table[i]));
-diff -urNp linux-3.0.4/drivers/net/vmxnet3/vmxnet3_ethtool.c linux-3.0.4/drivers/net/vmxnet3/vmxnet3_ethtool.c
---- linux-3.0.4/drivers/net/vmxnet3/vmxnet3_ethtool.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/vmxnet3/vmxnet3_ethtool.c  2011-08-23 21:47:55.000000000 -0400
-@@ -594,8 +594,7 @@ vmxnet3_set_rss_indir(struct net_device 
+diff -urNp linux-3.1.3/drivers/net/vmxnet3/vmxnet3_ethtool.c linux-3.1.3/drivers/net/vmxnet3/vmxnet3_ethtool.c
+--- linux-3.1.3/drivers/net/vmxnet3/vmxnet3_ethtool.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/vmxnet3/vmxnet3_ethtool.c  2011-11-16 18:39:07.000000000 -0500
+@@ -601,8 +601,7 @@ vmxnet3_set_rss_indir(struct net_device 
                 * Return with error code if any of the queue indices
                 * is out of range
                 */
@@ -30308,10 +32576,10 @@ diff -urNp linux-3.0.4/drivers/net/vmxnet3/vmxnet3_ethtool.c linux-3.0.4/drivers
                        return -EINVAL;
        }
  
-diff -urNp linux-3.0.4/drivers/net/vxge/vxge-config.h linux-3.0.4/drivers/net/vxge/vxge-config.h
---- linux-3.0.4/drivers/net/vxge/vxge-config.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/vxge/vxge-config.h 2011-08-23 21:47:55.000000000 -0400
-@@ -512,7 +512,7 @@ struct vxge_hw_uld_cbs {
+diff -urNp linux-3.1.3/drivers/net/vxge/vxge-config.h linux-3.1.3/drivers/net/vxge/vxge-config.h
+--- linux-3.1.3/drivers/net/vxge/vxge-config.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/vxge/vxge-config.h 2011-11-16 18:39:07.000000000 -0500
+@@ -514,7 +514,7 @@ struct vxge_hw_uld_cbs {
        void (*link_down)(struct __vxge_hw_device *devh);
        void (*crit_err)(struct __vxge_hw_device *devh,
                        enum vxge_hw_event type, u64 ext_data);
@@ -30320,10 +32588,10 @@ diff -urNp linux-3.0.4/drivers/net/vxge/vxge-config.h linux-3.0.4/drivers/net/vx
  
  /*
   * struct __vxge_hw_blockpool_entry - Block private data structure
-diff -urNp linux-3.0.4/drivers/net/vxge/vxge-main.c linux-3.0.4/drivers/net/vxge/vxge-main.c
---- linux-3.0.4/drivers/net/vxge/vxge-main.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/vxge/vxge-main.c   2011-08-23 21:48:14.000000000 -0400
-@@ -98,6 +98,8 @@ static inline void VXGE_COMPLETE_VPATH_T
+diff -urNp linux-3.1.3/drivers/net/vxge/vxge-main.c linux-3.1.3/drivers/net/vxge/vxge-main.c
+--- linux-3.1.3/drivers/net/vxge/vxge-main.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/vxge/vxge-main.c   2011-11-16 18:40:22.000000000 -0500
+@@ -100,6 +100,8 @@ static inline void VXGE_COMPLETE_VPATH_T
        struct sk_buff *completed[NR_SKB_COMPLETED];
        int more;
  
@@ -30332,7 +32600,7 @@ diff -urNp linux-3.0.4/drivers/net/vxge/vxge-main.c linux-3.0.4/drivers/net/vxge
        do {
                more = 0;
                skb_ptr = completed;
-@@ -1920,6 +1922,8 @@ static enum vxge_hw_status vxge_rth_conf
+@@ -1915,6 +1917,8 @@ static enum vxge_hw_status vxge_rth_conf
        u8 mtable[256] = {0}; /* CPU to vpath mapping  */
        int index;
  
@@ -30341,9 +32609,9 @@ diff -urNp linux-3.0.4/drivers/net/vxge/vxge-main.c linux-3.0.4/drivers/net/vxge
        /*
         * Filling
         *      - itable with bucket numbers
-diff -urNp linux-3.0.4/drivers/net/vxge/vxge-traffic.h linux-3.0.4/drivers/net/vxge/vxge-traffic.h
---- linux-3.0.4/drivers/net/vxge/vxge-traffic.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/vxge/vxge-traffic.h        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/vxge/vxge-traffic.h linux-3.1.3/drivers/net/vxge/vxge-traffic.h
+--- linux-3.1.3/drivers/net/vxge/vxge-traffic.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/vxge/vxge-traffic.h        2011-11-16 18:39:07.000000000 -0500
 @@ -2088,7 +2088,7 @@ struct vxge_hw_mempool_cbs {
                        struct vxge_hw_mempool_dma      *dma_object,
                        u32                     index,
@@ -30353,22 +32621,10 @@ diff -urNp linux-3.0.4/drivers/net/vxge/vxge-traffic.h linux-3.0.4/drivers/net/v
  
  #define VXGE_HW_VIRTUAL_PATH_HANDLE(vpath)                            \
                ((struct __vxge_hw_vpath_handle *)(vpath)->vpath_handles.next)
-diff -urNp linux-3.0.4/drivers/net/wan/cycx_x25.c linux-3.0.4/drivers/net/wan/cycx_x25.c
---- linux-3.0.4/drivers/net/wan/cycx_x25.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wan/cycx_x25.c     2011-08-23 21:48:14.000000000 -0400
-@@ -1018,6 +1018,8 @@ static void hex_dump(char *msg, unsigned
-       unsigned char hex[1024],
-               * phex = hex;
-+      pax_track_stack();
-+
-       if (len >= (sizeof(hex) / 2))
-               len = (sizeof(hex) / 2) - 1;
-diff -urNp linux-3.0.4/drivers/net/wan/hdlc_x25.c linux-3.0.4/drivers/net/wan/hdlc_x25.c
---- linux-3.0.4/drivers/net/wan/hdlc_x25.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wan/hdlc_x25.c     2011-08-23 21:47:55.000000000 -0400
-@@ -136,16 +136,16 @@ static netdev_tx_t x25_xmit(struct sk_bu
+diff -urNp linux-3.1.3/drivers/net/wan/hdlc_x25.c linux-3.1.3/drivers/net/wan/hdlc_x25.c
+--- linux-3.1.3/drivers/net/wan/hdlc_x25.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wan/hdlc_x25.c     2011-11-16 18:39:07.000000000 -0500
+@@ -134,16 +134,16 @@ static netdev_tx_t x25_xmit(struct sk_bu
  
  static int x25_open(struct net_device *dev)
  {
@@ -30393,9 +32649,9 @@ diff -urNp linux-3.0.4/drivers/net/wan/hdlc_x25.c linux-3.0.4/drivers/net/wan/hd
        result = lapb_register(dev, &cb);
        if (result != LAPB_OK)
                return result;
-diff -urNp linux-3.0.4/drivers/net/wimax/i2400m/usb-fw.c linux-3.0.4/drivers/net/wimax/i2400m/usb-fw.c
---- linux-3.0.4/drivers/net/wimax/i2400m/usb-fw.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wimax/i2400m/usb-fw.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/wimax/i2400m/usb-fw.c linux-3.1.3/drivers/net/wimax/i2400m/usb-fw.c
+--- linux-3.1.3/drivers/net/wimax/i2400m/usb-fw.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wimax/i2400m/usb-fw.c      2011-11-16 18:40:22.000000000 -0500
 @@ -287,6 +287,8 @@ ssize_t i2400mu_bus_bm_wait_for_ack(stru
        int do_autopm = 1;
        DECLARE_COMPLETION_ONSTACK(notif_completion);
@@ -30405,9 +32661,9 @@ diff -urNp linux-3.0.4/drivers/net/wimax/i2400m/usb-fw.c linux-3.0.4/drivers/net
        d_fnstart(8, dev, "(i2400m %p ack %p size %zu)\n",
                  i2400m, ack, ack_size);
        BUG_ON(_ack == i2400m->bm_ack_buf);
-diff -urNp linux-3.0.4/drivers/net/wireless/airo.c linux-3.0.4/drivers/net/wireless/airo.c
---- linux-3.0.4/drivers/net/wireless/airo.c    2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/airo.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/wireless/airo.c linux-3.1.3/drivers/net/wireless/airo.c
+--- linux-3.1.3/drivers/net/wireless/airo.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/airo.c    2011-11-16 18:40:22.000000000 -0500
 @@ -3003,6 +3003,8 @@ static void airo_process_scan_results (s
        BSSListElement * loop_net;
        BSSListElement * tmp_net;
@@ -30462,76 +32718,67 @@ diff -urNp linux-3.0.4/drivers/net/wireless/airo.c linux-3.0.4/drivers/net/wirel
        /* Get stats out of the card */
        clear_bit(JOB_WSTATS, &local->jobs);
        if (local->power.event) {
-diff -urNp linux-3.0.4/drivers/net/wireless/ath/ath5k/debug.c linux-3.0.4/drivers/net/wireless/ath/ath5k/debug.c
---- linux-3.0.4/drivers/net/wireless/ath/ath5k/debug.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/ath/ath5k/debug.c 2011-08-23 21:48:14.000000000 -0400
-@@ -204,6 +204,8 @@ static ssize_t read_file_beacon(struct f
+diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath5k/debug.c linux-3.1.3/drivers/net/wireless/ath/ath5k/debug.c
+--- linux-3.1.3/drivers/net/wireless/ath/ath5k/debug.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/ath/ath5k/debug.c 2011-11-16 19:08:21.000000000 -0500
+@@ -203,6 +203,8 @@ static ssize_t read_file_beacon(struct f
        unsigned int v;
        u64 tsf;
  
 +      pax_track_stack();
 +
-       v = ath5k_hw_reg_read(sc->ah, AR5K_BEACON);
-       len += snprintf(buf+len, sizeof(buf)-len,
+       v = ath5k_hw_reg_read(ah, AR5K_BEACON);
+       len += snprintf(buf + len, sizeof(buf) - len,
                "%-24s0x%08x\tintval: %d\tTIM: 0x%x\n",
-@@ -323,6 +325,8 @@ static ssize_t read_file_debug(struct fi
+@@ -321,6 +323,8 @@ static ssize_t read_file_debug(struct fi
        unsigned int len = 0;
        unsigned int i;
  
 +      pax_track_stack();
 +
-       len += snprintf(buf+len, sizeof(buf)-len,
-               "DEBUG LEVEL: 0x%08x\n\n", sc->debug.level);
-@@ -384,6 +388,8 @@ static ssize_t read_file_antenna(struct 
-       unsigned int i;
-       unsigned int v;
+       len += snprintf(buf + len, sizeof(buf) - len,
+               "DEBUG LEVEL: 0x%08x\n\n", ah->debug.level);
  
-+      pax_track_stack();
-+
-       len += snprintf(buf+len, sizeof(buf)-len, "antenna mode\t%d\n",
-               sc->ah->ah_ant_mode);
-       len += snprintf(buf+len, sizeof(buf)-len, "default antenna\t%d\n",
-@@ -494,6 +500,8 @@ static ssize_t read_file_misc(struct fil
+@@ -492,6 +496,8 @@ static ssize_t read_file_misc(struct fil
        unsigned int len = 0;
-       u32 filt = ath5k_hw_get_rx_filter(sc->ah);
+       u32 filt = ath5k_hw_get_rx_filter(ah);
  
 +      pax_track_stack();
 +
-       len += snprintf(buf+len, sizeof(buf)-len, "bssid-mask: %pM\n",
-                       sc->bssidmask);
-       len += snprintf(buf+len, sizeof(buf)-len, "filter-flags: 0x%x ",
-@@ -550,6 +558,8 @@ static ssize_t read_file_frameerrors(str
+       len += snprintf(buf + len, sizeof(buf) - len, "bssid-mask: %pM\n",
+                       ah->bssidmask);
+       len += snprintf(buf + len, sizeof(buf) - len, "filter-flags: 0x%x ",
+@@ -548,6 +554,8 @@ static ssize_t read_file_frameerrors(str
        unsigned int len = 0;
        int i;
  
 +      pax_track_stack();
 +
-       len += snprintf(buf+len, sizeof(buf)-len,
+       len += snprintf(buf + len, sizeof(buf) - len,
                        "RX\n---------------------\n");
-       len += snprintf(buf+len, sizeof(buf)-len, "CRC\t%u\t(%u%%)\n",
-@@ -667,6 +677,8 @@ static ssize_t read_file_ani(struct file
+       len += snprintf(buf + len, sizeof(buf) - len, "CRC\t%u\t(%u%%)\n",
+@@ -665,6 +673,8 @@ static ssize_t read_file_ani(struct file
        char buf[700];
        unsigned int len = 0;
  
 +      pax_track_stack();
 +
-       len += snprintf(buf+len, sizeof(buf)-len,
+       len += snprintf(buf + len, sizeof(buf) - len,
                        "HW has PHY error counters:\t%s\n",
-                       sc->ah->ah_capabilities.cap_has_phyerr_counters ?
-@@ -827,6 +839,8 @@ static ssize_t read_file_queue(struct fi
+                       ah->ah_capabilities.cap_has_phyerr_counters ?
+@@ -829,6 +839,8 @@ static ssize_t read_file_queue(struct fi
        struct ath5k_buf *bf, *bf0;
        int i, n;
  
 +      pax_track_stack();
 +
-       len += snprintf(buf+len, sizeof(buf)-len,
-                       "available txbuffers: %d\n", sc->txbuf_len);
+       len += snprintf(buf + len, sizeof(buf) - len,
+                       "available txbuffers: %d\n", ah->txbuf_len);
  
-diff -urNp linux-3.0.4/drivers/net/wireless/ath/ath9k/ar9003_calib.c linux-3.0.4/drivers/net/wireless/ath/ath9k/ar9003_calib.c
---- linux-3.0.4/drivers/net/wireless/ath/ath9k/ar9003_calib.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/ath/ath9k/ar9003_calib.c  2011-08-23 21:48:14.000000000 -0400
-@@ -757,6 +757,8 @@ static void ar9003_hw_tx_iq_cal_post_pro
+diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/ar9003_calib.c linux-3.1.3/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+--- linux-3.1.3/drivers/net/wireless/ath/ath9k/ar9003_calib.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/ath/ath9k/ar9003_calib.c  2011-11-16 18:40:22.000000000 -0500
+@@ -758,6 +758,8 @@ static void ar9003_hw_tx_iq_cal_post_pro
        int i, im, j;
        int nmeasurement;
  
@@ -30540,10 +32787,10 @@ diff -urNp linux-3.0.4/drivers/net/wireless/ath/ath9k/ar9003_calib.c linux-3.0.4
        for (i = 0; i < AR9300_MAX_CHAINS; i++) {
                if (ah->txchainmask & (1 << i))
                        num_chains++;
-diff -urNp linux-3.0.4/drivers/net/wireless/ath/ath9k/ar9003_paprd.c linux-3.0.4/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
---- linux-3.0.4/drivers/net/wireless/ath/ath9k/ar9003_paprd.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/ath/ath9k/ar9003_paprd.c  2011-08-23 21:48:14.000000000 -0400
-@@ -356,6 +356,8 @@ static bool create_pa_curve(u32 *data_L,
+diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/ar9003_paprd.c linux-3.1.3/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
+--- linux-3.1.3/drivers/net/wireless/ath/ath9k/ar9003_paprd.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/ath/ath9k/ar9003_paprd.c  2011-11-16 18:40:22.000000000 -0500
+@@ -406,6 +406,8 @@ static bool create_pa_curve(u32 *data_L,
        int theta_low_bin = 0;
        int i;
  
@@ -30552,10 +32799,10 @@ diff -urNp linux-3.0.4/drivers/net/wireless/ath/ath9k/ar9003_paprd.c linux-3.0.4
        /* disregard any bin that contains <= 16 samples */
        thresh_accum_cnt = 16;
        scale_factor = 5;
-diff -urNp linux-3.0.4/drivers/net/wireless/ath/ath9k/debug.c linux-3.0.4/drivers/net/wireless/ath/ath9k/debug.c
---- linux-3.0.4/drivers/net/wireless/ath/ath9k/debug.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/ath/ath9k/debug.c 2011-08-23 21:48:14.000000000 -0400
-@@ -337,6 +337,8 @@ static ssize_t read_file_interrupt(struc
+diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/debug.c linux-3.1.3/drivers/net/wireless/ath/ath9k/debug.c
+--- linux-3.1.3/drivers/net/wireless/ath/ath9k/debug.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/ath/ath9k/debug.c 2011-11-16 18:40:22.000000000 -0500
+@@ -387,6 +387,8 @@ static ssize_t read_file_interrupt(struc
        char buf[512];
        unsigned int len = 0;
  
@@ -30564,7 +32811,7 @@ diff -urNp linux-3.0.4/drivers/net/wireless/ath/ath9k/debug.c linux-3.0.4/driver
        if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) {
                len += snprintf(buf + len, sizeof(buf) - len,
                        "%8s: %10u\n", "RXLP", sc->debug.stats.istats.rxlp);
-@@ -427,6 +429,8 @@ static ssize_t read_file_wiphy(struct fi
+@@ -477,6 +479,8 @@ static ssize_t read_file_wiphy(struct fi
        u8 addr[ETH_ALEN];
        u32 tmp;
  
@@ -30573,9 +32820,9 @@ diff -urNp linux-3.0.4/drivers/net/wireless/ath/ath9k/debug.c linux-3.0.4/driver
        len += snprintf(buf + len, sizeof(buf) - len,
                        "%s (chan=%d  center-freq: %d MHz  channel-type: %d (%s))\n",
                        wiphy_name(sc->hw->wiphy),
-diff -urNp linux-3.0.4/drivers/net/wireless/ath/ath9k/htc_drv_debug.c linux-3.0.4/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
---- linux-3.0.4/drivers/net/wireless/ath/ath9k/htc_drv_debug.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/ath/ath9k/htc_drv_debug.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/htc_drv_debug.c linux-3.1.3/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
+--- linux-3.1.3/drivers/net/wireless/ath/ath9k/htc_drv_debug.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/ath/ath9k/htc_drv_debug.c 2011-11-16 18:40:22.000000000 -0500
 @@ -31,6 +31,8 @@ static ssize_t read_file_tgt_int_stats(s
        unsigned int len = 0;
        int ret = 0;
@@ -30630,10 +32877,10 @@ diff -urNp linux-3.0.4/drivers/net/wireless/ath/ath9k/htc_drv_debug.c linux-3.0.
        len += snprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n",
                        "Mgmt endpoint", skb_queue_len(&priv->tx.mgmt_ep_queue));
  
-diff -urNp linux-3.0.4/drivers/net/wireless/ath/ath9k/hw.h linux-3.0.4/drivers/net/wireless/ath/ath9k/hw.h
---- linux-3.0.4/drivers/net/wireless/ath/ath9k/hw.h    2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/ath/ath9k/hw.h    2011-08-23 21:47:55.000000000 -0400
-@@ -585,7 +585,7 @@ struct ath_hw_private_ops {
+diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath9k/hw.h linux-3.1.3/drivers/net/wireless/ath/ath9k/hw.h
+--- linux-3.1.3/drivers/net/wireless/ath/ath9k/hw.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/ath/ath9k/hw.h    2011-11-16 18:39:07.000000000 -0500
+@@ -588,7 +588,7 @@ struct ath_hw_private_ops {
  
        /* ANI */
        void (*ani_cache_ini_regs)(struct ath_hw *ah);
@@ -30642,7 +32889,7 @@ diff -urNp linux-3.0.4/drivers/net/wireless/ath/ath9k/hw.h linux-3.0.4/drivers/n
  
  /**
   * struct ath_hw_ops - callbacks used by hardware code and driver code
-@@ -637,7 +637,7 @@ struct ath_hw_ops {
+@@ -639,7 +639,7 @@ struct ath_hw_ops {
        void (*antdiv_comb_conf_set)(struct ath_hw *ah,
                        struct ath_hw_antcomb_conf *antconf);
  
@@ -30651,7 +32898,7 @@ diff -urNp linux-3.0.4/drivers/net/wireless/ath/ath9k/hw.h linux-3.0.4/drivers/n
  
  struct ath_nf_limits {
        s16 max;
-@@ -650,7 +650,7 @@ struct ath_nf_limits {
+@@ -652,7 +652,7 @@ struct ath_nf_limits {
  #define AH_UNPLUGGED    0x2 /* The card has been physically removed. */
  
  struct ath_hw {
@@ -30660,9 +32907,9 @@ diff -urNp linux-3.0.4/drivers/net/wireless/ath/ath9k/hw.h linux-3.0.4/drivers/n
  
        struct ieee80211_hw *hw;
        struct ath_common common;
-diff -urNp linux-3.0.4/drivers/net/wireless/ath/ath.h linux-3.0.4/drivers/net/wireless/ath/ath.h
---- linux-3.0.4/drivers/net/wireless/ath/ath.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/ath/ath.h 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/wireless/ath/ath.h linux-3.1.3/drivers/net/wireless/ath/ath.h
+--- linux-3.1.3/drivers/net/wireless/ath/ath.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/ath/ath.h 2011-11-16 18:39:07.000000000 -0500
 @@ -121,6 +121,7 @@ struct ath_ops {
        void (*write_flush) (void *);
        u32 (*rmw)(void *, u32 reg_offset, u32 set, u32 clr);
@@ -30671,10 +32918,10 @@ diff -urNp linux-3.0.4/drivers/net/wireless/ath/ath.h linux-3.0.4/drivers/net/wi
  
  struct ath_common;
  struct ath_bus_ops;
-diff -urNp linux-3.0.4/drivers/net/wireless/ipw2x00/ipw2100.c linux-3.0.4/drivers/net/wireless/ipw2x00/ipw2100.c
---- linux-3.0.4/drivers/net/wireless/ipw2x00/ipw2100.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/ipw2x00/ipw2100.c 2011-08-23 21:48:14.000000000 -0400
-@@ -2100,6 +2100,8 @@ static int ipw2100_set_essid(struct ipw2
+diff -urNp linux-3.1.3/drivers/net/wireless/ipw2x00/ipw2100.c linux-3.1.3/drivers/net/wireless/ipw2x00/ipw2100.c
+--- linux-3.1.3/drivers/net/wireless/ipw2x00/ipw2100.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/ipw2x00/ipw2100.c 2011-11-16 18:40:22.000000000 -0500
+@@ -2102,6 +2102,8 @@ static int ipw2100_set_essid(struct ipw2
        int err;
        DECLARE_SSID_BUF(ssid);
  
@@ -30683,7 +32930,7 @@ diff -urNp linux-3.0.4/drivers/net/wireless/ipw2x00/ipw2100.c linux-3.0.4/driver
        IPW_DEBUG_HC("SSID: '%s'\n", print_ssid(ssid, essid, ssid_len));
  
        if (ssid_len)
-@@ -5449,6 +5451,8 @@ static int ipw2100_set_key(struct ipw210
+@@ -5451,6 +5453,8 @@ static int ipw2100_set_key(struct ipw210
        struct ipw2100_wep_key *wep_key = (void *)cmd.host_command_parameters;
        int err;
  
@@ -30692,9 +32939,9 @@ diff -urNp linux-3.0.4/drivers/net/wireless/ipw2x00/ipw2100.c linux-3.0.4/driver
        IPW_DEBUG_HC("WEP_KEY_INFO: index = %d, len = %d/%d\n",
                     idx, keylen, len);
  
-diff -urNp linux-3.0.4/drivers/net/wireless/ipw2x00/libipw_rx.c linux-3.0.4/drivers/net/wireless/ipw2x00/libipw_rx.c
---- linux-3.0.4/drivers/net/wireless/ipw2x00/libipw_rx.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/ipw2x00/libipw_rx.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/wireless/ipw2x00/libipw_rx.c linux-3.1.3/drivers/net/wireless/ipw2x00/libipw_rx.c
+--- linux-3.1.3/drivers/net/wireless/ipw2x00/libipw_rx.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/ipw2x00/libipw_rx.c       2011-11-16 18:40:22.000000000 -0500
 @@ -1565,6 +1565,8 @@ static void libipw_process_probe_respons
        unsigned long flags;
        DECLARE_SSID_BUF(ssid);
@@ -30704,10 +32951,10 @@ diff -urNp linux-3.0.4/drivers/net/wireless/ipw2x00/libipw_rx.c linux-3.0.4/driv
        LIBIPW_DEBUG_SCAN("'%s' (%pM"
                     "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
                     print_ssid(ssid, info_element->data, info_element->len),
-diff -urNp linux-3.0.4/drivers/net/wireless/iwlegacy/iwl3945-base.c linux-3.0.4/drivers/net/wireless/iwlegacy/iwl3945-base.c
---- linux-3.0.4/drivers/net/wireless/iwlegacy/iwl3945-base.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/iwlegacy/iwl3945-base.c   2011-08-23 21:47:55.000000000 -0400
-@@ -3962,7 +3962,9 @@ static int iwl3945_pci_probe(struct pci_
+diff -urNp linux-3.1.3/drivers/net/wireless/iwlegacy/iwl3945-base.c linux-3.1.3/drivers/net/wireless/iwlegacy/iwl3945-base.c
+--- linux-3.1.3/drivers/net/wireless/iwlegacy/iwl3945-base.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/iwlegacy/iwl3945-base.c   2011-11-16 18:39:07.000000000 -0500
+@@ -3687,7 +3687,9 @@ static int iwl3945_pci_probe(struct pci_
         */
        if (iwl3945_mod_params.disable_hw_scan) {
                IWL_DEBUG_INFO(priv, "Disabling hw_scan\n");
@@ -30718,10 +32965,10 @@ diff -urNp linux-3.0.4/drivers/net/wireless/iwlegacy/iwl3945-base.c linux-3.0.4/
        }
  
        IWL_DEBUG_INFO(priv, "*** LOAD DRIVER ***\n");
-diff -urNp linux-3.0.4/drivers/net/wireless/iwlwifi/iwl-agn-rs.c linux-3.0.4/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
---- linux-3.0.4/drivers/net/wireless/iwlwifi/iwl-agn-rs.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/iwlwifi/iwl-agn-rs.c      2011-08-23 21:48:14.000000000 -0400
-@@ -910,6 +910,8 @@ static void rs_tx_status(void *priv_r, s
+diff -urNp linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-agn-rs.c linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+--- linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-agn-rs.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-agn-rs.c      2011-11-16 18:40:22.000000000 -0500
+@@ -920,6 +920,8 @@ static void rs_tx_status(void *priv_r, s
        struct iwl_station_priv *sta_priv = (void *)sta->drv_priv;
        struct iwl_rxon_context *ctx = sta_priv->common.ctx;
  
@@ -30730,7 +32977,7 @@ diff -urNp linux-3.0.4/drivers/net/wireless/iwlwifi/iwl-agn-rs.c linux-3.0.4/dri
        IWL_DEBUG_RATE_LIMIT(priv, "get frame ack response, update rate scale window\n");
  
        /* Treat uninitialized rate scaling data same as non-existing. */
-@@ -2918,6 +2920,8 @@ static void rs_fill_link_cmd(struct iwl_
+@@ -2931,6 +2933,8 @@ static void rs_fill_link_cmd(struct iwl_
                container_of(lq_sta, struct iwl_station_priv, lq_sta);
        struct iwl_link_quality_cmd *lq_cmd = &lq_sta->lq;
  
@@ -30739,10 +32986,10 @@ diff -urNp linux-3.0.4/drivers/net/wireless/iwlwifi/iwl-agn-rs.c linux-3.0.4/dri
        /* Override starting rate (index 0) if needed for debug purposes */
        rs_dbgfs_set_mcs(lq_sta, &new_rate, index);
  
-diff -urNp linux-3.0.4/drivers/net/wireless/iwlwifi/iwl-debugfs.c linux-3.0.4/drivers/net/wireless/iwlwifi/iwl-debugfs.c
---- linux-3.0.4/drivers/net/wireless/iwlwifi/iwl-debugfs.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/iwlwifi/iwl-debugfs.c     2011-08-23 21:48:14.000000000 -0400
-@@ -548,6 +548,8 @@ static ssize_t iwl_dbgfs_status_read(str
+diff -urNp linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-debugfs.c linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+--- linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-debugfs.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-debugfs.c     2011-11-16 18:40:22.000000000 -0500
+@@ -561,6 +561,8 @@ static ssize_t iwl_dbgfs_status_read(str
        int pos = 0;
        const size_t bufsz = sizeof(buf);
  
@@ -30751,7 +32998,7 @@ diff -urNp linux-3.0.4/drivers/net/wireless/iwlwifi/iwl-debugfs.c linux-3.0.4/dr
        pos += scnprintf(buf + pos, bufsz - pos, "STATUS_HCMD_ACTIVE:\t %d\n",
                test_bit(STATUS_HCMD_ACTIVE, &priv->status));
        pos += scnprintf(buf + pos, bufsz - pos, "STATUS_INT_ENABLED:\t %d\n",
-@@ -680,6 +682,8 @@ static ssize_t iwl_dbgfs_qos_read(struct
+@@ -693,6 +695,8 @@ static ssize_t iwl_dbgfs_qos_read(struct
        char buf[256 * NUM_IWL_RXON_CTX];
        const size_t bufsz = sizeof(buf);
  
@@ -30760,9 +33007,9 @@ diff -urNp linux-3.0.4/drivers/net/wireless/iwlwifi/iwl-debugfs.c linux-3.0.4/dr
        for_each_context(priv, ctx) {
                pos += scnprintf(buf + pos, bufsz - pos, "context %d:\n",
                                 ctx->ctxid);
-diff -urNp linux-3.0.4/drivers/net/wireless/iwlwifi/iwl-debug.h linux-3.0.4/drivers/net/wireless/iwlwifi/iwl-debug.h
---- linux-3.0.4/drivers/net/wireless/iwlwifi/iwl-debug.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/iwlwifi/iwl-debug.h       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-debug.h linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-debug.h
+--- linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-debug.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/iwlwifi/iwl-debug.h       2011-11-16 18:39:07.000000000 -0500
 @@ -68,8 +68,8 @@ do {                                    
  } while (0)
  
@@ -30774,9 +33021,9 @@ diff -urNp linux-3.0.4/drivers/net/wireless/iwlwifi/iwl-debug.h linux-3.0.4/driv
  static inline void iwl_print_hex_dump(struct iwl_priv *priv, int level,
                                      const void *p, u32 len)
  {}
-diff -urNp linux-3.0.4/drivers/net/wireless/iwmc3200wifi/debugfs.c linux-3.0.4/drivers/net/wireless/iwmc3200wifi/debugfs.c
---- linux-3.0.4/drivers/net/wireless/iwmc3200wifi/debugfs.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/iwmc3200wifi/debugfs.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/wireless/iwmc3200wifi/debugfs.c linux-3.1.3/drivers/net/wireless/iwmc3200wifi/debugfs.c
+--- linux-3.1.3/drivers/net/wireless/iwmc3200wifi/debugfs.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/iwmc3200wifi/debugfs.c    2011-11-16 18:40:22.000000000 -0500
 @@ -327,6 +327,8 @@ static ssize_t iwm_debugfs_fw_err_read(s
        int buf_len = 512;
        size_t len = 0;
@@ -30786,10 +33033,10 @@ diff -urNp linux-3.0.4/drivers/net/wireless/iwmc3200wifi/debugfs.c linux-3.0.4/d
        if (*ppos != 0)
                return 0;
        if (count < sizeof(buf))
-diff -urNp linux-3.0.4/drivers/net/wireless/mac80211_hwsim.c linux-3.0.4/drivers/net/wireless/mac80211_hwsim.c
---- linux-3.0.4/drivers/net/wireless/mac80211_hwsim.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/mac80211_hwsim.c  2011-08-23 21:47:55.000000000 -0400
-@@ -1260,9 +1260,11 @@ static int __init init_mac80211_hwsim(vo
+diff -urNp linux-3.1.3/drivers/net/wireless/mac80211_hwsim.c linux-3.1.3/drivers/net/wireless/mac80211_hwsim.c
+--- linux-3.1.3/drivers/net/wireless/mac80211_hwsim.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/mac80211_hwsim.c  2011-11-16 18:39:07.000000000 -0500
+@@ -1670,9 +1670,11 @@ static int __init init_mac80211_hwsim(vo
                return -EINVAL;
  
        if (fake_hw_scan) {
@@ -30804,9 +33051,21 @@ diff -urNp linux-3.0.4/drivers/net/wireless/mac80211_hwsim.c linux-3.0.4/drivers
        }
  
        spin_lock_init(&hwsim_radio_lock);
-diff -urNp linux-3.0.4/drivers/net/wireless/rndis_wlan.c linux-3.0.4/drivers/net/wireless/rndis_wlan.c
---- linux-3.0.4/drivers/net/wireless/rndis_wlan.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/rndis_wlan.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/wireless/mwifiex/main.h linux-3.1.3/drivers/net/wireless/mwifiex/main.h
+--- linux-3.1.3/drivers/net/wireless/mwifiex/main.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/mwifiex/main.h    2011-11-16 18:39:07.000000000 -0500
+@@ -560,7 +560,7 @@ struct mwifiex_if_ops {
+       void (*update_mp_end_port) (struct mwifiex_adapter *, u16);
+       void (*cleanup_mpa_buf) (struct mwifiex_adapter *);
+-};
++} __no_const;
+ struct mwifiex_adapter {
+       struct mwifiex_private *priv[MWIFIEX_MAX_BSS_NUM];
+diff -urNp linux-3.1.3/drivers/net/wireless/rndis_wlan.c linux-3.1.3/drivers/net/wireless/rndis_wlan.c
+--- linux-3.1.3/drivers/net/wireless/rndis_wlan.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/rndis_wlan.c      2011-11-16 18:39:07.000000000 -0500
 @@ -1277,7 +1277,7 @@ static int set_rts_threshold(struct usbn
  
        netdev_dbg(usbdev->net, "%s(): %i\n", __func__, rts_threshold);
@@ -30816,9 +33075,9 @@ diff -urNp linux-3.0.4/drivers/net/wireless/rndis_wlan.c linux-3.0.4/drivers/net
                rts_threshold = 2347;
  
        tmp = cpu_to_le32(rts_threshold);
-diff -urNp linux-3.0.4/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c linux-3.0.4/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
---- linux-3.0.4/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c linux-3.1.3/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
+--- linux-3.1.3/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c     2011-11-16 18:40:22.000000000 -0500
 @@ -837,6 +837,8 @@ bool _rtl92c_phy_sw_chnl_step_by_step(st
        u8 rfpath;
        u8 num_total_rfpath = rtlphy->num_total_rfpath;
@@ -30828,9 +33087,9 @@ diff -urNp linux-3.0.4/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c linux-
        precommoncmdcnt = 0;
        _rtl92c_phy_set_sw_chnl_cmdarray(precommoncmd, precommoncmdcnt++,
                                         MAX_PRECMD_CNT,
-diff -urNp linux-3.0.4/drivers/net/wireless/wl1251/wl1251.h linux-3.0.4/drivers/net/wireless/wl1251/wl1251.h
---- linux-3.0.4/drivers/net/wireless/wl1251/wl1251.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/wl1251/wl1251.h   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/net/wireless/wl1251/wl1251.h linux-3.1.3/drivers/net/wireless/wl1251/wl1251.h
+--- linux-3.1.3/drivers/net/wireless/wl1251/wl1251.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/wl1251/wl1251.h   2011-11-16 18:39:07.000000000 -0500
 @@ -266,7 +266,7 @@ struct wl1251_if_operations {
        void (*reset)(struct wl1251 *wl);
        void (*enable_irq)(struct wl1251 *wl);
@@ -30840,10 +33099,10 @@ diff -urNp linux-3.0.4/drivers/net/wireless/wl1251/wl1251.h linux-3.0.4/drivers/
  
  struct wl1251 {
        struct ieee80211_hw *hw;
-diff -urNp linux-3.0.4/drivers/net/wireless/wl12xx/spi.c linux-3.0.4/drivers/net/wireless/wl12xx/spi.c
---- linux-3.0.4/drivers/net/wireless/wl12xx/spi.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/net/wireless/wl12xx/spi.c      2011-08-23 21:48:14.000000000 -0400
-@@ -280,6 +280,8 @@ static void wl1271_spi_raw_write(struct 
+diff -urNp linux-3.1.3/drivers/net/wireless/wl12xx/spi.c linux-3.1.3/drivers/net/wireless/wl12xx/spi.c
+--- linux-3.1.3/drivers/net/wireless/wl12xx/spi.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/net/wireless/wl12xx/spi.c      2011-11-16 18:40:22.000000000 -0500
+@@ -281,6 +281,8 @@ static void wl1271_spi_raw_write(struct 
        u32 chunk_len;
        int i;
  
@@ -30852,9 +33111,9 @@ diff -urNp linux-3.0.4/drivers/net/wireless/wl12xx/spi.c linux-3.0.4/drivers/net
        WARN_ON(len > WL1271_AGGR_BUFFER_SIZE);
  
        spi_message_init(&m);
-diff -urNp linux-3.0.4/drivers/oprofile/buffer_sync.c linux-3.0.4/drivers/oprofile/buffer_sync.c
---- linux-3.0.4/drivers/oprofile/buffer_sync.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/oprofile/buffer_sync.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/oprofile/buffer_sync.c linux-3.1.3/drivers/oprofile/buffer_sync.c
+--- linux-3.1.3/drivers/oprofile/buffer_sync.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/oprofile/buffer_sync.c 2011-11-16 18:39:07.000000000 -0500
 @@ -343,7 +343,7 @@ static void add_data(struct op_entry *en
                if (cookie == NO_COOKIE)
                        offset = pc;
@@ -30890,9 +33149,9 @@ diff -urNp linux-3.0.4/drivers/oprofile/buffer_sync.c linux-3.0.4/drivers/oprofi
                }
        }
        release_mm(mm);
-diff -urNp linux-3.0.4/drivers/oprofile/event_buffer.c linux-3.0.4/drivers/oprofile/event_buffer.c
---- linux-3.0.4/drivers/oprofile/event_buffer.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/oprofile/event_buffer.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/oprofile/event_buffer.c linux-3.1.3/drivers/oprofile/event_buffer.c
+--- linux-3.1.3/drivers/oprofile/event_buffer.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/oprofile/event_buffer.c        2011-11-16 18:39:07.000000000 -0500
 @@ -53,7 +53,7 @@ void add_event_entry(unsigned long value
        }
  
@@ -30902,9 +33161,9 @@ diff -urNp linux-3.0.4/drivers/oprofile/event_buffer.c linux-3.0.4/drivers/oprof
                return;
        }
  
-diff -urNp linux-3.0.4/drivers/oprofile/oprof.c linux-3.0.4/drivers/oprofile/oprof.c
---- linux-3.0.4/drivers/oprofile/oprof.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/oprofile/oprof.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/oprofile/oprof.c linux-3.1.3/drivers/oprofile/oprof.c
+--- linux-3.1.3/drivers/oprofile/oprof.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/oprofile/oprof.c       2011-11-16 18:39:07.000000000 -0500
 @@ -110,7 +110,7 @@ static void switch_worker(struct work_st
        if (oprofile_ops.switch_events())
                return;
@@ -30914,9 +33173,9 @@ diff -urNp linux-3.0.4/drivers/oprofile/oprof.c linux-3.0.4/drivers/oprofile/opr
        start_switch_worker();
  }
  
-diff -urNp linux-3.0.4/drivers/oprofile/oprofilefs.c linux-3.0.4/drivers/oprofile/oprofilefs.c
---- linux-3.0.4/drivers/oprofile/oprofilefs.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/oprofile/oprofilefs.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/oprofile/oprofilefs.c linux-3.1.3/drivers/oprofile/oprofilefs.c
+--- linux-3.1.3/drivers/oprofile/oprofilefs.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/oprofile/oprofilefs.c  2011-11-16 18:39:07.000000000 -0500
 @@ -186,7 +186,7 @@ static const struct file_operations atom
  
  
@@ -30926,9 +33185,9 @@ diff -urNp linux-3.0.4/drivers/oprofile/oprofilefs.c linux-3.0.4/drivers/oprofil
  {
        return __oprofilefs_create_file(sb, root, name,
                                        &atomic_ro_fops, 0444, val);
-diff -urNp linux-3.0.4/drivers/oprofile/oprofile_stats.c linux-3.0.4/drivers/oprofile/oprofile_stats.c
---- linux-3.0.4/drivers/oprofile/oprofile_stats.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/oprofile/oprofile_stats.c      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/oprofile/oprofile_stats.c linux-3.1.3/drivers/oprofile/oprofile_stats.c
+--- linux-3.1.3/drivers/oprofile/oprofile_stats.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/oprofile/oprofile_stats.c      2011-11-16 18:39:07.000000000 -0500
 @@ -30,11 +30,11 @@ void oprofile_reset_stats(void)
                cpu_buf->sample_invalid_eip = 0;
        }
@@ -30946,11 +33205,11 @@ diff -urNp linux-3.0.4/drivers/oprofile/oprofile_stats.c linux-3.0.4/drivers/opr
  }
  
  
-diff -urNp linux-3.0.4/drivers/oprofile/oprofile_stats.h linux-3.0.4/drivers/oprofile/oprofile_stats.h
---- linux-3.0.4/drivers/oprofile/oprofile_stats.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/oprofile/oprofile_stats.h      2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/oprofile/oprofile_stats.h linux-3.1.3/drivers/oprofile/oprofile_stats.h
+--- linux-3.1.3/drivers/oprofile/oprofile_stats.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/oprofile/oprofile_stats.h      2011-11-16 18:39:07.000000000 -0500
 @@ -13,11 +13,11 @@
- #include <asm/atomic.h>
+ #include <linux/atomic.h>
  
  struct oprofile_stat_struct {
 -      atomic_t sample_lost_no_mm;
@@ -30966,9 +33225,9 @@ diff -urNp linux-3.0.4/drivers/oprofile/oprofile_stats.h linux-3.0.4/drivers/opr
  };
  
  extern struct oprofile_stat_struct oprofile_stats;
-diff -urNp linux-3.0.4/drivers/parport/procfs.c linux-3.0.4/drivers/parport/procfs.c
---- linux-3.0.4/drivers/parport/procfs.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/parport/procfs.c       2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/parport/procfs.c linux-3.1.3/drivers/parport/procfs.c
+--- linux-3.1.3/drivers/parport/procfs.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/parport/procfs.c       2011-11-16 18:39:07.000000000 -0500
 @@ -64,7 +64,7 @@ static int do_active_device(ctl_table *t
  
        *ppos += len;
@@ -30987,9 +33246,9 @@ diff -urNp linux-3.0.4/drivers/parport/procfs.c linux-3.0.4/drivers/parport/proc
  }
  #endif /* IEEE1284.3 support. */
  
-diff -urNp linux-3.0.4/drivers/pci/hotplug/cpci_hotplug.h linux-3.0.4/drivers/pci/hotplug/cpci_hotplug.h
---- linux-3.0.4/drivers/pci/hotplug/cpci_hotplug.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/pci/hotplug/cpci_hotplug.h     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/pci/hotplug/cpci_hotplug.h linux-3.1.3/drivers/pci/hotplug/cpci_hotplug.h
+--- linux-3.1.3/drivers/pci/hotplug/cpci_hotplug.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/pci/hotplug/cpci_hotplug.h     2011-11-16 18:39:07.000000000 -0500
 @@ -59,7 +59,7 @@ struct cpci_hp_controller_ops {
        int (*hardware_test) (struct slot* slot, u32 value);
        u8  (*get_power) (struct slot* slot);
@@ -30999,9 +33258,9 @@ diff -urNp linux-3.0.4/drivers/pci/hotplug/cpci_hotplug.h linux-3.0.4/drivers/pc
  
  struct cpci_hp_controller {
        unsigned int irq;
-diff -urNp linux-3.0.4/drivers/pci/hotplug/cpqphp_nvram.c linux-3.0.4/drivers/pci/hotplug/cpqphp_nvram.c
---- linux-3.0.4/drivers/pci/hotplug/cpqphp_nvram.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/pci/hotplug/cpqphp_nvram.c     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/pci/hotplug/cpqphp_nvram.c linux-3.1.3/drivers/pci/hotplug/cpqphp_nvram.c
+--- linux-3.1.3/drivers/pci/hotplug/cpqphp_nvram.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/pci/hotplug/cpqphp_nvram.c     2011-11-16 18:39:07.000000000 -0500
 @@ -428,9 +428,13 @@ static u32 store_HRT (void __iomem *rom_
  
  void compaq_nvram_init (void __iomem *rom_start)
@@ -31016,9 +33275,9 @@ diff -urNp linux-3.0.4/drivers/pci/hotplug/cpqphp_nvram.c linux-3.0.4/drivers/pc
        dbg("int15 entry  = %p\n", compaq_int15_entry_point);
  
        /* initialize our int15 lock */
-diff -urNp linux-3.0.4/drivers/pci/pcie/aspm.c linux-3.0.4/drivers/pci/pcie/aspm.c
---- linux-3.0.4/drivers/pci/pcie/aspm.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/pci/pcie/aspm.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/pci/pcie/aspm.c linux-3.1.3/drivers/pci/pcie/aspm.c
+--- linux-3.1.3/drivers/pci/pcie/aspm.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/pci/pcie/aspm.c        2011-11-16 18:39:07.000000000 -0500
 @@ -27,9 +27,9 @@
  #define MODULE_PARAM_PREFIX "pcie_aspm."
  
@@ -31032,10 +33291,10 @@ diff -urNp linux-3.0.4/drivers/pci/pcie/aspm.c linux-3.0.4/drivers/pci/pcie/aspm
  #define ASPM_STATE_L0S                (ASPM_STATE_L0S_UP | ASPM_STATE_L0S_DW)
  #define ASPM_STATE_ALL                (ASPM_STATE_L0S | ASPM_STATE_L1)
  
-diff -urNp linux-3.0.4/drivers/pci/probe.c linux-3.0.4/drivers/pci/probe.c
---- linux-3.0.4/drivers/pci/probe.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/pci/probe.c    2011-08-23 21:47:55.000000000 -0400
-@@ -129,7 +129,7 @@ int __pci_read_base(struct pci_dev *dev,
+diff -urNp linux-3.1.3/drivers/pci/probe.c linux-3.1.3/drivers/pci/probe.c
+--- linux-3.1.3/drivers/pci/probe.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/pci/probe.c    2011-11-16 18:39:07.000000000 -0500
+@@ -136,7 +136,7 @@ int __pci_read_base(struct pci_dev *dev,
        u32 l, sz, mask;
        u16 orig_cmd;
  
@@ -31044,9 +33303,9 @@ diff -urNp linux-3.0.4/drivers/pci/probe.c linux-3.0.4/drivers/pci/probe.c
  
        if (!dev->mmio_always_on) {
                pci_read_config_word(dev, PCI_COMMAND, &orig_cmd);
-diff -urNp linux-3.0.4/drivers/pci/proc.c linux-3.0.4/drivers/pci/proc.c
---- linux-3.0.4/drivers/pci/proc.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/pci/proc.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/pci/proc.c linux-3.1.3/drivers/pci/proc.c
+--- linux-3.1.3/drivers/pci/proc.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/pci/proc.c     2011-11-16 18:40:22.000000000 -0500
 @@ -476,7 +476,16 @@ static const struct file_operations proc
  static int __init pci_proc_init(void)
  {
@@ -31064,9 +33323,9 @@ diff -urNp linux-3.0.4/drivers/pci/proc.c linux-3.0.4/drivers/pci/proc.c
        proc_create("devices", 0, proc_bus_pci_dir,
                    &proc_bus_pci_dev_operations);
        proc_initialized = 1;
-diff -urNp linux-3.0.4/drivers/pci/xen-pcifront.c linux-3.0.4/drivers/pci/xen-pcifront.c
---- linux-3.0.4/drivers/pci/xen-pcifront.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/pci/xen-pcifront.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/pci/xen-pcifront.c linux-3.1.3/drivers/pci/xen-pcifront.c
+--- linux-3.1.3/drivers/pci/xen-pcifront.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/pci/xen-pcifront.c     2011-11-16 18:40:22.000000000 -0500
 @@ -187,6 +187,8 @@ static int pcifront_bus_read(struct pci_
        struct pcifront_sd *sd = bus->sysdata;
        struct pcifront_device *pdev = pcifront_get_pdev(sd);
@@ -31112,9 +33371,9 @@ diff -urNp linux-3.0.4/drivers/pci/xen-pcifront.c linux-3.0.4/drivers/pci/xen-pc
        err = do_pci_op(pdev, &op);
        if (likely(!err)) {
                vector[0] = op.value;
-diff -urNp linux-3.0.4/drivers/platform/x86/thinkpad_acpi.c linux-3.0.4/drivers/platform/x86/thinkpad_acpi.c
---- linux-3.0.4/drivers/platform/x86/thinkpad_acpi.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/platform/x86/thinkpad_acpi.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/platform/x86/thinkpad_acpi.c linux-3.1.3/drivers/platform/x86/thinkpad_acpi.c
+--- linux-3.1.3/drivers/platform/x86/thinkpad_acpi.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/platform/x86/thinkpad_acpi.c   2011-11-16 18:39:07.000000000 -0500
 @@ -2094,7 +2094,7 @@ static int hotkey_mask_get(void)
        return 0;
  }
@@ -31124,9 +33383,9 @@ diff -urNp linux-3.0.4/drivers/platform/x86/thinkpad_acpi.c linux-3.0.4/drivers/
  {
        /* log only what the user can fix... */
        const u32 wantedmask = hotkey_driver_mask &
-diff -urNp linux-3.0.4/drivers/pnp/pnpbios/bioscalls.c linux-3.0.4/drivers/pnp/pnpbios/bioscalls.c
---- linux-3.0.4/drivers/pnp/pnpbios/bioscalls.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/pnp/pnpbios/bioscalls.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/pnp/pnpbios/bioscalls.c linux-3.1.3/drivers/pnp/pnpbios/bioscalls.c
+--- linux-3.1.3/drivers/pnp/pnpbios/bioscalls.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/pnp/pnpbios/bioscalls.c        2011-11-16 18:39:07.000000000 -0500
 @@ -59,7 +59,7 @@ do { \
        set_desc_limit(&gdt[(selname) >> 3], (size) - 1); \
  } while(0)
@@ -31183,9 +33442,9 @@ diff -urNp linux-3.0.4/drivers/pnp/pnpbios/bioscalls.c linux-3.0.4/drivers/pnp/p
 +
 +      pax_close_kernel();
  }
-diff -urNp linux-3.0.4/drivers/pnp/resource.c linux-3.0.4/drivers/pnp/resource.c
---- linux-3.0.4/drivers/pnp/resource.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/pnp/resource.c 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/pnp/resource.c linux-3.1.3/drivers/pnp/resource.c
+--- linux-3.1.3/drivers/pnp/resource.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/pnp/resource.c 2011-11-16 18:39:07.000000000 -0500
 @@ -360,7 +360,7 @@ int pnp_check_irq(struct pnp_dev *dev, s
                return 1;
  
@@ -31204,9 +33463,9 @@ diff -urNp linux-3.0.4/drivers/pnp/resource.c linux-3.0.4/drivers/pnp/resource.c
                return 0;
  
        /* check if the resource is reserved */
-diff -urNp linux-3.0.4/drivers/power/bq27x00_battery.c linux-3.0.4/drivers/power/bq27x00_battery.c
---- linux-3.0.4/drivers/power/bq27x00_battery.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/power/bq27x00_battery.c        2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/power/bq27x00_battery.c linux-3.1.3/drivers/power/bq27x00_battery.c
+--- linux-3.1.3/drivers/power/bq27x00_battery.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/power/bq27x00_battery.c        2011-11-16 18:39:07.000000000 -0500
 @@ -67,7 +67,7 @@
  struct bq27x00_device_info;
  struct bq27x00_access_methods {
@@ -31216,9 +33475,9 @@ diff -urNp linux-3.0.4/drivers/power/bq27x00_battery.c linux-3.0.4/drivers/power
  
  enum bq27x00_chip { BQ27000, BQ27500 };
  
-diff -urNp linux-3.0.4/drivers/regulator/max8660.c linux-3.0.4/drivers/regulator/max8660.c
---- linux-3.0.4/drivers/regulator/max8660.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/regulator/max8660.c    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/regulator/max8660.c linux-3.1.3/drivers/regulator/max8660.c
+--- linux-3.1.3/drivers/regulator/max8660.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/regulator/max8660.c    2011-11-16 18:39:07.000000000 -0500
 @@ -383,8 +383,10 @@ static int __devinit max8660_probe(struc
                max8660->shadow_regs[MAX8660_OVER1] = 5;
        } else {
@@ -31232,9 +33491,9 @@ diff -urNp linux-3.0.4/drivers/regulator/max8660.c linux-3.0.4/drivers/regulator
        }
  
        /*
-diff -urNp linux-3.0.4/drivers/regulator/mc13892-regulator.c linux-3.0.4/drivers/regulator/mc13892-regulator.c
---- linux-3.0.4/drivers/regulator/mc13892-regulator.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/regulator/mc13892-regulator.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/regulator/mc13892-regulator.c linux-3.1.3/drivers/regulator/mc13892-regulator.c
+--- linux-3.1.3/drivers/regulator/mc13892-regulator.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/regulator/mc13892-regulator.c  2011-11-16 18:39:07.000000000 -0500
 @@ -564,10 +564,12 @@ static int __devinit mc13892_regulator_p
        }
        mc13xxx_unlock(mc13892);
@@ -31250,9 +33509,9 @@ diff -urNp linux-3.0.4/drivers/regulator/mc13892-regulator.c linux-3.0.4/drivers
        for (i = 0; i < pdata->num_regulators; i++) {
                init_data = &pdata->regulators[i];
                priv->regulators[i] = regulator_register(
-diff -urNp linux-3.0.4/drivers/rtc/rtc-dev.c linux-3.0.4/drivers/rtc/rtc-dev.c
---- linux-3.0.4/drivers/rtc/rtc-dev.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/rtc/rtc-dev.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/rtc/rtc-dev.c linux-3.1.3/drivers/rtc/rtc-dev.c
+--- linux-3.1.3/drivers/rtc/rtc-dev.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/rtc/rtc-dev.c  2011-11-16 18:40:22.000000000 -0500
 @@ -14,6 +14,7 @@
  #include <linux/module.h>
  #include <linux/rtc.h>
@@ -31270,9 +33529,9 @@ diff -urNp linux-3.0.4/drivers/rtc/rtc-dev.c linux-3.0.4/drivers/rtc/rtc-dev.c
                return rtc_set_time(rtc, &tm);
  
        case RTC_PIE_ON:
-diff -urNp linux-3.0.4/drivers/scsi/aacraid/aacraid.h linux-3.0.4/drivers/scsi/aacraid/aacraid.h
---- linux-3.0.4/drivers/scsi/aacraid/aacraid.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/aacraid/aacraid.h 2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/aacraid/aacraid.h linux-3.1.3/drivers/scsi/aacraid/aacraid.h
+--- linux-3.1.3/drivers/scsi/aacraid/aacraid.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/aacraid/aacraid.h 2011-11-16 18:39:07.000000000 -0500
 @@ -492,7 +492,7 @@ struct adapter_ops
        int  (*adapter_scsi)(struct fib * fib, struct scsi_cmnd * cmd);
        /* Administrative operations */
@@ -31282,9 +33541,9 @@ diff -urNp linux-3.0.4/drivers/scsi/aacraid/aacraid.h linux-3.0.4/drivers/scsi/a
  
  /*
   *    Define which interrupt handler needs to be installed
-diff -urNp linux-3.0.4/drivers/scsi/aacraid/commctrl.c linux-3.0.4/drivers/scsi/aacraid/commctrl.c
---- linux-3.0.4/drivers/scsi/aacraid/commctrl.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/aacraid/commctrl.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/aacraid/commctrl.c linux-3.1.3/drivers/scsi/aacraid/commctrl.c
+--- linux-3.1.3/drivers/scsi/aacraid/commctrl.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/aacraid/commctrl.c        2011-11-16 18:40:22.000000000 -0500
 @@ -482,6 +482,7 @@ static int aac_send_raw_srb(struct aac_d
        u32 actual_fibsize64, actual_fibsize = 0;
        int i;
@@ -31293,22 +33552,78 @@ diff -urNp linux-3.0.4/drivers/scsi/aacraid/commctrl.c linux-3.0.4/drivers/scsi/
  
        if (dev->in_reset) {
                dprintk((KERN_DEBUG"aacraid: send raw srb -EBUSY\n"));
-diff -urNp linux-3.0.4/drivers/scsi/bfa/bfad.c linux-3.0.4/drivers/scsi/bfa/bfad.c
---- linux-3.0.4/drivers/scsi/bfa/bfad.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/bfa/bfad.c        2011-08-23 21:48:14.000000000 -0400
-@@ -1032,6 +1032,8 @@ bfad_start_ops(struct bfad_s *bfad) {
+diff -urNp linux-3.1.3/drivers/scsi/aacraid/linit.c linux-3.1.3/drivers/scsi/aacraid/linit.c
+--- linux-3.1.3/drivers/scsi/aacraid/linit.c   2011-11-26 19:57:29.000000000 -0500
++++ linux-3.1.3/drivers/scsi/aacraid/linit.c   2011-11-26 20:00:43.000000000 -0500
+@@ -93,7 +93,7 @@ static DECLARE_PCI_DEVICE_TABLE(aac_pci_
+ #elif defined(__devinitconst)
+ static const struct pci_device_id aac_pci_tbl[] __devinitconst = {
+ #else
+-static const struct pci_device_id aac_pci_tbl[] __devinitdata = {
++static const struct pci_device_id aac_pci_tbl[] __devinitconst = {
+ #endif
+       { 0x1028, 0x0001, 0x1028, 0x0001, 0, 0, 0 }, /* PERC 2/Si (Iguana/PERC2Si) */
+       { 0x1028, 0x0002, 0x1028, 0x0002, 0, 0, 1 }, /* PERC 3/Di (Opal/PERC3Di) */
+diff -urNp linux-3.1.3/drivers/scsi/aic94xx/aic94xx_init.c linux-3.1.3/drivers/scsi/aic94xx/aic94xx_init.c
+--- linux-3.1.3/drivers/scsi/aic94xx/aic94xx_init.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/aic94xx/aic94xx_init.c    2011-11-16 18:39:07.000000000 -0500
+@@ -1012,7 +1012,7 @@ static struct sas_domain_function_templa
+       .lldd_control_phy       = asd_control_phy,
+ };
+-static const struct pci_device_id aic94xx_pci_table[] __devinitdata = {
++static const struct pci_device_id aic94xx_pci_table[] __devinitconst = {
+       {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x410),0, 0, 1},
+       {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x412),0, 0, 1},
+       {PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x416),0, 0, 1},
+diff -urNp linux-3.1.3/drivers/scsi/bfa/bfad.c linux-3.1.3/drivers/scsi/bfa/bfad.c
+--- linux-3.1.3/drivers/scsi/bfa/bfad.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/bfa/bfad.c        2011-11-16 19:01:15.000000000 -0500
+@@ -1019,6 +1019,8 @@ bfad_start_ops(struct bfad_s *bfad) {
        struct bfad_vport_s *vport, *vport_new;
        struct bfa_fcs_driver_info_s driver_info;
  
 +      pax_track_stack();
 +
-       /* Fill the driver_info info to fcs*/
-       memset(&driver_info, 0, sizeof(driver_info));
-       strncpy(driver_info.version, BFAD_DRIVER_VERSION,
-diff -urNp linux-3.0.4/drivers/scsi/bfa/bfa_fcs_lport.c linux-3.0.4/drivers/scsi/bfa/bfa_fcs_lport.c
---- linux-3.0.4/drivers/scsi/bfa/bfa_fcs_lport.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/bfa/bfa_fcs_lport.c       2011-08-23 21:48:14.000000000 -0400
-@@ -1559,6 +1559,8 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struc
+       /* Limit min/max. xfer size to [64k-32MB] */
+       if (max_xfer_size < BFAD_MIN_SECTORS >> 1)
+               max_xfer_size = BFAD_MIN_SECTORS >> 1;
+diff -urNp linux-3.1.3/drivers/scsi/bfa/bfa_fcpim.c linux-3.1.3/drivers/scsi/bfa/bfa_fcpim.c
+--- linux-3.1.3/drivers/scsi/bfa/bfa_fcpim.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/bfa/bfa_fcpim.c   2011-11-16 18:39:07.000000000 -0500
+@@ -4179,7 +4179,7 @@ bfa_itn_create(struct bfa_s *bfa, struct
+               void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m))
+ {
+       struct bfa_fcp_mod_s *fcp = BFA_FCP_MOD(bfa);
+-      struct bfa_itn_s *itn;
++      bfa_itn_s_no_const *itn;
+       itn =  BFA_ITN_FROM_TAG(fcp, rport->rport_tag);
+       itn->isr = isr;
+diff -urNp linux-3.1.3/drivers/scsi/bfa/bfa_fcpim.h linux-3.1.3/drivers/scsi/bfa/bfa_fcpim.h
+--- linux-3.1.3/drivers/scsi/bfa/bfa_fcpim.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/bfa/bfa_fcpim.h   2011-11-16 18:39:07.000000000 -0500
+@@ -37,6 +37,7 @@ struct bfa_iotag_s {
+ struct bfa_itn_s {
+       bfa_isr_func_t isr;
+ };
++typedef struct bfa_itn_s __no_const bfa_itn_s_no_const;
+ void bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport,
+               void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m));
+@@ -149,7 +150,7 @@ struct bfa_fcp_mod_s {
+       struct list_head        iotag_tio_free_q;       /* free IO resources */
+       struct list_head        iotag_unused_q; /* unused IO resources*/
+       struct bfa_iotag_s      *iotag_arr;
+-      struct bfa_itn_s        *itn_arr;
++      bfa_itn_s_no_const      *itn_arr;
+       int                     num_ioim_reqs;
+       int                     num_fwtio_reqs;
+       int                     num_itns;
+diff -urNp linux-3.1.3/drivers/scsi/bfa/bfa_fcs_lport.c linux-3.1.3/drivers/scsi/bfa/bfa_fcs_lport.c
+--- linux-3.1.3/drivers/scsi/bfa/bfa_fcs_lport.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/bfa/bfa_fcs_lport.c       2011-11-16 18:40:22.000000000 -0500
+@@ -1700,6 +1700,8 @@ bfa_fcs_lport_fdmi_build_rhba_pyld(struc
        u16        len, count;
        u16     templen;
  
@@ -31317,7 +33632,7 @@ diff -urNp linux-3.0.4/drivers/scsi/bfa/bfa_fcs_lport.c linux-3.0.4/drivers/scsi
        /*
         * get hba attributes
         */
-@@ -1836,6 +1838,8 @@ bfa_fcs_lport_fdmi_build_portattr_block(
+@@ -1977,6 +1979,8 @@ bfa_fcs_lport_fdmi_build_portattr_block(
        u8      count = 0;
        u16     templen;
  
@@ -31326,10 +33641,10 @@ diff -urNp linux-3.0.4/drivers/scsi/bfa/bfa_fcs_lport.c linux-3.0.4/drivers/scsi
        /*
         * get port attributes
         */
-diff -urNp linux-3.0.4/drivers/scsi/bfa/bfa_fcs_rport.c linux-3.0.4/drivers/scsi/bfa/bfa_fcs_rport.c
---- linux-3.0.4/drivers/scsi/bfa/bfa_fcs_rport.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/bfa/bfa_fcs_rport.c       2011-08-23 21:48:14.000000000 -0400
-@@ -1844,6 +1844,8 @@ bfa_fcs_rport_process_rpsc(struct bfa_fc
+diff -urNp linux-3.1.3/drivers/scsi/bfa/bfa_fcs_rport.c linux-3.1.3/drivers/scsi/bfa/bfa_fcs_rport.c
+--- linux-3.1.3/drivers/scsi/bfa/bfa_fcs_rport.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/bfa/bfa_fcs_rport.c       2011-11-16 18:40:22.000000000 -0500
+@@ -1871,6 +1871,8 @@ bfa_fcs_rport_process_rpsc(struct bfa_fc
        struct fc_rpsc_speed_info_s speeds;
        struct bfa_port_attr_s pport_attr;
  
@@ -31338,22 +33653,22 @@ diff -urNp linux-3.0.4/drivers/scsi/bfa/bfa_fcs_rport.c linux-3.0.4/drivers/scsi
        bfa_trc(port->fcs, rx_fchs->s_id);
        bfa_trc(port->fcs, rx_fchs->d_id);
  
-diff -urNp linux-3.0.4/drivers/scsi/bfa/bfa.h linux-3.0.4/drivers/scsi/bfa/bfa.h
---- linux-3.0.4/drivers/scsi/bfa/bfa.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/bfa/bfa.h 2011-08-23 21:47:55.000000000 -0400
-@@ -238,7 +238,7 @@ struct bfa_hwif_s {
-                               u32 *nvecs, u32 *maxvec);
-       void (*hw_msix_get_rme_range) (struct bfa_s *bfa, u32 *start,
+diff -urNp linux-3.1.3/drivers/scsi/bfa/bfa.h linux-3.1.3/drivers/scsi/bfa/bfa.h
+--- linux-3.1.3/drivers/scsi/bfa/bfa.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/bfa/bfa.h 2011-11-16 18:39:07.000000000 -0500
+@@ -196,7 +196,7 @@ struct bfa_hwif_s {
                                       u32 *end);
+       int     cpe_vec_q0;
+       int     rme_vec_q0;
 -};
 +} __no_const;
  typedef void (*bfa_cb_iocfc_t) (void *cbarg, enum bfa_status status);
  
- struct bfa_iocfc_s {
-diff -urNp linux-3.0.4/drivers/scsi/bfa/bfa_ioc.h linux-3.0.4/drivers/scsi/bfa/bfa_ioc.h
---- linux-3.0.4/drivers/scsi/bfa/bfa_ioc.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/bfa/bfa_ioc.h     2011-08-23 21:47:55.000000000 -0400
-@@ -196,7 +196,7 @@ struct bfa_ioc_cbfn_s {
+ struct bfa_faa_cbfn_s {
+diff -urNp linux-3.1.3/drivers/scsi/bfa/bfa_ioc.h linux-3.1.3/drivers/scsi/bfa/bfa_ioc.h
+--- linux-3.1.3/drivers/scsi/bfa/bfa_ioc.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/bfa/bfa_ioc.h     2011-11-16 18:39:07.000000000 -0500
+@@ -258,7 +258,7 @@ struct bfa_ioc_cbfn_s {
        bfa_ioc_disable_cbfn_t  disable_cbfn;
        bfa_ioc_hbfail_cbfn_t   hbfail_cbfn;
        bfa_ioc_reset_cbfn_t    reset_cbfn;
@@ -31361,19 +33676,19 @@ diff -urNp linux-3.0.4/drivers/scsi/bfa/bfa_ioc.h linux-3.0.4/drivers/scsi/bfa/b
 +} __no_const;
  
  /*
-  * Heartbeat failure notification queue element.
-@@ -268,7 +268,7 @@ struct bfa_ioc_hwif_s {
-       void            (*ioc_sync_leave)       (struct bfa_ioc_s *ioc);
+  * IOC event notification mechanism.
+@@ -346,7 +346,7 @@ struct bfa_ioc_hwif_s {
        void            (*ioc_sync_ack)         (struct bfa_ioc_s *ioc);
        bfa_boolean_t   (*ioc_sync_complete)    (struct bfa_ioc_s *ioc);
+       bfa_boolean_t   (*ioc_lpu_read_stat)    (struct bfa_ioc_s *ioc);
 -};
 +} __no_const;
  
- #define bfa_ioc_pcifn(__ioc)          ((__ioc)->pcidev.pci_func)
- #define bfa_ioc_devid(__ioc)          ((__ioc)->pcidev.device_id)
-diff -urNp linux-3.0.4/drivers/scsi/BusLogic.c linux-3.0.4/drivers/scsi/BusLogic.c
---- linux-3.0.4/drivers/scsi/BusLogic.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/BusLogic.c        2011-08-23 21:48:14.000000000 -0400
+ /*
+  * Queue element to wait for room in request queue. FIFO order is
+diff -urNp linux-3.1.3/drivers/scsi/BusLogic.c linux-3.1.3/drivers/scsi/BusLogic.c
+--- linux-3.1.3/drivers/scsi/BusLogic.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/BusLogic.c        2011-11-16 18:40:22.000000000 -0500
 @@ -962,6 +962,8 @@ static int __init BusLogic_InitializeFla
  static void __init BusLogic_InitializeProbeInfoList(struct BusLogic_HostAdapter
                                                    *PrototypeHostAdapter)
@@ -31383,9 +33698,9 @@ diff -urNp linux-3.0.4/drivers/scsi/BusLogic.c linux-3.0.4/drivers/scsi/BusLogic
        /*
           If a PCI BIOS is present, interrogate it for MultiMaster and FlashPoint
           Host Adapters; otherwise, default to the standard ISA MultiMaster probe.
-diff -urNp linux-3.0.4/drivers/scsi/dpt_i2o.c linux-3.0.4/drivers/scsi/dpt_i2o.c
---- linux-3.0.4/drivers/scsi/dpt_i2o.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/dpt_i2o.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/dpt_i2o.c linux-3.1.3/drivers/scsi/dpt_i2o.c
+--- linux-3.1.3/drivers/scsi/dpt_i2o.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/dpt_i2o.c 2011-11-16 18:40:22.000000000 -0500
 @@ -1811,6 +1811,8 @@ static int adpt_i2o_passthru(adpt_hba* p
        dma_addr_t addr;
        ulong flags = 0;
@@ -31404,9 +33719,9 @@ diff -urNp linux-3.0.4/drivers/scsi/dpt_i2o.c linux-3.0.4/drivers/scsi/dpt_i2o.c
        memset(msg, 0 , sizeof(msg));
        len = scsi_bufflen(cmd);
        direction = 0x00000000; 
-diff -urNp linux-3.0.4/drivers/scsi/eata.c linux-3.0.4/drivers/scsi/eata.c
---- linux-3.0.4/drivers/scsi/eata.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/eata.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/eata.c linux-3.1.3/drivers/scsi/eata.c
+--- linux-3.1.3/drivers/scsi/eata.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/eata.c    2011-11-16 18:40:22.000000000 -0500
 @@ -1087,6 +1087,8 @@ static int port_detect(unsigned long por
        struct hostdata *ha;
        char name[16];
@@ -31416,9 +33731,9 @@ diff -urNp linux-3.0.4/drivers/scsi/eata.c linux-3.0.4/drivers/scsi/eata.c
        sprintf(name, "%s%d", driver_name, j);
  
        if (!request_region(port_base, REGION_SIZE, driver_name)) {
-diff -urNp linux-3.0.4/drivers/scsi/fcoe/fcoe_ctlr.c linux-3.0.4/drivers/scsi/fcoe/fcoe_ctlr.c
---- linux-3.0.4/drivers/scsi/fcoe/fcoe_ctlr.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/fcoe/fcoe_ctlr.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/fcoe/fcoe_ctlr.c linux-3.1.3/drivers/scsi/fcoe/fcoe_ctlr.c
+--- linux-3.1.3/drivers/scsi/fcoe/fcoe_ctlr.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/fcoe/fcoe_ctlr.c  2011-11-16 18:40:22.000000000 -0500
 @@ -2503,6 +2503,8 @@ static int fcoe_ctlr_vn_recv(struct fcoe
        } buf;
        int rc;
@@ -31428,9 +33743,9 @@ diff -urNp linux-3.0.4/drivers/scsi/fcoe/fcoe_ctlr.c linux-3.0.4/drivers/scsi/fc
        fiph = (struct fip_header *)skb->data;
        sub = fiph->fip_subcode;
  
-diff -urNp linux-3.0.4/drivers/scsi/gdth.c linux-3.0.4/drivers/scsi/gdth.c
---- linux-3.0.4/drivers/scsi/gdth.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/gdth.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/gdth.c linux-3.1.3/drivers/scsi/gdth.c
+--- linux-3.1.3/drivers/scsi/gdth.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/gdth.c    2011-11-16 18:40:22.000000000 -0500
 @@ -4107,6 +4107,8 @@ static int ioc_lockdrv(void __user *arg)
      unsigned long flags;
      gdth_ha_str *ha;
@@ -31468,9 +33783,9 @@ diff -urNp linux-3.0.4/drivers/scsi/gdth.c linux-3.0.4/drivers/scsi/gdth.c
      memset(cmnd, 0xff, MAX_COMMAND_SIZE);
  
      TRACE2(("gdth_flush() hanum %d\n", ha->hanum));
-diff -urNp linux-3.0.4/drivers/scsi/gdth_proc.c linux-3.0.4/drivers/scsi/gdth_proc.c
---- linux-3.0.4/drivers/scsi/gdth_proc.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/gdth_proc.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/gdth_proc.c linux-3.1.3/drivers/scsi/gdth_proc.c
+--- linux-3.1.3/drivers/scsi/gdth_proc.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/gdth_proc.c       2011-11-16 18:40:22.000000000 -0500
 @@ -47,6 +47,9 @@ static int gdth_set_asc_info(struct Scsi
      u64         paddr;
  
@@ -31490,9 +33805,9 @@ diff -urNp linux-3.0.4/drivers/scsi/gdth_proc.c linux-3.0.4/drivers/scsi/gdth_pr
      gdtcmd = kmalloc(sizeof(*gdtcmd), GFP_KERNEL);
      estr = kmalloc(sizeof(*estr), GFP_KERNEL);
      if (!gdtcmd || !estr)
-diff -urNp linux-3.0.4/drivers/scsi/hosts.c linux-3.0.4/drivers/scsi/hosts.c
---- linux-3.0.4/drivers/scsi/hosts.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/hosts.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/hosts.c linux-3.1.3/drivers/scsi/hosts.c
+--- linux-3.1.3/drivers/scsi/hosts.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/hosts.c   2011-11-16 18:39:07.000000000 -0500
 @@ -42,7 +42,7 @@
  #include "scsi_logging.h"
  
@@ -31502,7 +33817,7 @@ diff -urNp linux-3.0.4/drivers/scsi/hosts.c linux-3.0.4/drivers/scsi/hosts.c
  
  
  static void scsi_host_cls_release(struct device *dev)
-@@ -354,7 +354,7 @@ struct Scsi_Host *scsi_host_alloc(struct
+@@ -357,7 +357,7 @@ struct Scsi_Host *scsi_host_alloc(struct
         * subtract one because we increment first then return, but we need to
         * know what the next host number was before increment
         */
@@ -31511,10 +33826,10 @@ diff -urNp linux-3.0.4/drivers/scsi/hosts.c linux-3.0.4/drivers/scsi/hosts.c
        shost->dma_channel = 0xff;
  
        /* These three are default values which can be overridden */
-diff -urNp linux-3.0.4/drivers/scsi/hpsa.c linux-3.0.4/drivers/scsi/hpsa.c
---- linux-3.0.4/drivers/scsi/hpsa.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/hpsa.c    2011-08-23 21:47:55.000000000 -0400
-@@ -498,7 +498,7 @@ static inline u32 next_command(struct ct
+diff -urNp linux-3.1.3/drivers/scsi/hpsa.c linux-3.1.3/drivers/scsi/hpsa.c
+--- linux-3.1.3/drivers/scsi/hpsa.c    2011-11-26 19:57:29.000000000 -0500
++++ linux-3.1.3/drivers/scsi/hpsa.c    2011-11-26 20:00:43.000000000 -0500
+@@ -499,7 +499,7 @@ static inline u32 next_command(struct ct
        u32 a;
  
        if (unlikely(!(h->transMethod & CFGTBL_Trans_Performant)))
@@ -31523,7 +33838,7 @@ diff -urNp linux-3.0.4/drivers/scsi/hpsa.c linux-3.0.4/drivers/scsi/hpsa.c
  
        if ((*(h->reply_pool_head) & 1) == (h->reply_pool_wraparound)) {
                a = *(h->reply_pool_head); /* Next cmd in ring buffer */
-@@ -2938,7 +2938,7 @@ static void start_io(struct ctlr_info *h
+@@ -2956,7 +2956,7 @@ static void start_io(struct ctlr_info *h
        while (!list_empty(&h->reqQ)) {
                c = list_entry(h->reqQ.next, struct CommandList, list);
                /* can't do anything if fifo is full */
@@ -31532,7 +33847,7 @@ diff -urNp linux-3.0.4/drivers/scsi/hpsa.c linux-3.0.4/drivers/scsi/hpsa.c
                        dev_warn(&h->pdev->dev, "fifo full\n");
                        break;
                }
-@@ -2948,7 +2948,7 @@ static void start_io(struct ctlr_info *h
+@@ -2966,7 +2966,7 @@ static void start_io(struct ctlr_info *h
                h->Qdepth--;
  
                /* Tell the controller execute command */
@@ -31541,7 +33856,7 @@ diff -urNp linux-3.0.4/drivers/scsi/hpsa.c linux-3.0.4/drivers/scsi/hpsa.c
  
                /* Put job onto the completed Q */
                addQ(&h->cmpQ, c);
-@@ -2957,17 +2957,17 @@ static void start_io(struct ctlr_info *h
+@@ -2975,17 +2975,17 @@ static void start_io(struct ctlr_info *h
  
  static inline unsigned long get_next_completion(struct ctlr_info *h)
  {
@@ -31562,7 +33877,7 @@ diff -urNp linux-3.0.4/drivers/scsi/hpsa.c linux-3.0.4/drivers/scsi/hpsa.c
                (h->interrupts_enabled == 0);
  }
  
-@@ -3857,7 +3857,7 @@ static int __devinit hpsa_pci_init(struc
+@@ -3882,7 +3882,7 @@ static int __devinit hpsa_pci_init(struc
        if (prod_index < 0)
                return -ENODEV;
        h->product_name = products[prod_index].product_name;
@@ -31571,7 +33886,7 @@ diff -urNp linux-3.0.4/drivers/scsi/hpsa.c linux-3.0.4/drivers/scsi/hpsa.c
  
        if (hpsa_board_disabled(h->pdev)) {
                dev_warn(&h->pdev->dev, "controller appears to be disabled\n");
-@@ -4134,7 +4134,7 @@ reinit_after_soft_reset:
+@@ -4163,7 +4163,7 @@ reinit_after_soft_reset:
        }
  
        /* make sure the board interrupts are off */
@@ -31580,7 +33895,7 @@ diff -urNp linux-3.0.4/drivers/scsi/hpsa.c linux-3.0.4/drivers/scsi/hpsa.c
  
        if (hpsa_request_irq(h, do_hpsa_intr_msi, do_hpsa_intr_intx))
                goto clean2;
-@@ -4168,7 +4168,7 @@ reinit_after_soft_reset:
+@@ -4197,7 +4197,7 @@ reinit_after_soft_reset:
                 * fake ones to scoop up any residual completions.
                 */
                spin_lock_irqsave(&h->lock, flags);
@@ -31589,7 +33904,7 @@ diff -urNp linux-3.0.4/drivers/scsi/hpsa.c linux-3.0.4/drivers/scsi/hpsa.c
                spin_unlock_irqrestore(&h->lock, flags);
                free_irq(h->intr[h->intr_mode], h);
                rc = hpsa_request_irq(h, hpsa_msix_discard_completions,
-@@ -4187,9 +4187,9 @@ reinit_after_soft_reset:
+@@ -4216,9 +4216,9 @@ reinit_after_soft_reset:
                dev_info(&h->pdev->dev, "Board READY.\n");
                dev_info(&h->pdev->dev,
                        "Waiting for stale completions to drain.\n");
@@ -31601,7 +33916,7 @@ diff -urNp linux-3.0.4/drivers/scsi/hpsa.c linux-3.0.4/drivers/scsi/hpsa.c
  
                rc = controller_reset_failed(h->cfgtable);
                if (rc)
-@@ -4210,7 +4210,7 @@ reinit_after_soft_reset:
+@@ -4239,7 +4239,7 @@ reinit_after_soft_reset:
        }
  
        /* Turn the interrupts on so we can service requests */
@@ -31610,7 +33925,7 @@ diff -urNp linux-3.0.4/drivers/scsi/hpsa.c linux-3.0.4/drivers/scsi/hpsa.c
  
        hpsa_hba_inquiry(h);
        hpsa_register_scsi(h);  /* hook ourselves into SCSI subsystem */
-@@ -4263,7 +4263,7 @@ static void hpsa_shutdown(struct pci_dev
+@@ -4292,7 +4292,7 @@ static void hpsa_shutdown(struct pci_dev
         * To write all data in the battery backed cache to disks
         */
        hpsa_flush_cache(h);
@@ -31619,7 +33934,7 @@ diff -urNp linux-3.0.4/drivers/scsi/hpsa.c linux-3.0.4/drivers/scsi/hpsa.c
        free_irq(h->intr[h->intr_mode], h);
  #ifdef CONFIG_PCI_MSI
        if (h->msix_vector)
-@@ -4426,7 +4426,7 @@ static __devinit void hpsa_enter_perform
+@@ -4455,7 +4455,7 @@ static __devinit void hpsa_enter_perform
                return;
        }
        /* Change the access methods to the performant access methods */
@@ -31628,9 +33943,9 @@ diff -urNp linux-3.0.4/drivers/scsi/hpsa.c linux-3.0.4/drivers/scsi/hpsa.c
        h->transMethod = CFGTBL_Trans_Performant;
  }
  
-diff -urNp linux-3.0.4/drivers/scsi/hpsa.h linux-3.0.4/drivers/scsi/hpsa.h
---- linux-3.0.4/drivers/scsi/hpsa.h    2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/hpsa.h    2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/hpsa.h linux-3.1.3/drivers/scsi/hpsa.h
+--- linux-3.1.3/drivers/scsi/hpsa.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/hpsa.h    2011-11-16 18:39:07.000000000 -0500
 @@ -73,7 +73,7 @@ struct ctlr_info {
        unsigned int msix_vector;
        unsigned int msi_vector;
@@ -31640,9 +33955,9 @@ diff -urNp linux-3.0.4/drivers/scsi/hpsa.h linux-3.0.4/drivers/scsi/hpsa.h
  
        /* queue and queue Info */
        struct list_head reqQ;
-diff -urNp linux-3.0.4/drivers/scsi/ips.h linux-3.0.4/drivers/scsi/ips.h
---- linux-3.0.4/drivers/scsi/ips.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/ips.h     2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/ips.h linux-3.1.3/drivers/scsi/ips.h
+--- linux-3.1.3/drivers/scsi/ips.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/ips.h     2011-11-16 18:39:07.000000000 -0500
 @@ -1027,7 +1027,7 @@ typedef struct {
     int       (*intr)(struct ips_ha *);
     void      (*enableint)(struct ips_ha *);
@@ -31652,9 +33967,9 @@ diff -urNp linux-3.0.4/drivers/scsi/ips.h linux-3.0.4/drivers/scsi/ips.h
  
  typedef struct ips_ha {
     uint8_t            ha_id[IPS_MAX_CHANNELS+1];
-diff -urNp linux-3.0.4/drivers/scsi/libfc/fc_exch.c linux-3.0.4/drivers/scsi/libfc/fc_exch.c
---- linux-3.0.4/drivers/scsi/libfc/fc_exch.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/libfc/fc_exch.c   2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/libfc/fc_exch.c linux-3.1.3/drivers/scsi/libfc/fc_exch.c
+--- linux-3.1.3/drivers/scsi/libfc/fc_exch.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/libfc/fc_exch.c   2011-11-16 18:39:07.000000000 -0500
 @@ -105,12 +105,12 @@ struct fc_exch_mgr {
         * all together if not used XXX
         */
@@ -31674,7 +33989,7 @@ diff -urNp linux-3.0.4/drivers/scsi/libfc/fc_exch.c linux-3.0.4/drivers/scsi/lib
        } stats;
  };
  
-@@ -700,7 +700,7 @@ static struct fc_exch *fc_exch_em_alloc(
+@@ -718,7 +718,7 @@ static struct fc_exch *fc_exch_em_alloc(
        /* allocate memory for exchange */
        ep = mempool_alloc(mp->ep_pool, GFP_ATOMIC);
        if (!ep) {
@@ -31683,7 +33998,7 @@ diff -urNp linux-3.0.4/drivers/scsi/libfc/fc_exch.c linux-3.0.4/drivers/scsi/lib
                goto out;
        }
        memset(ep, 0, sizeof(*ep));
-@@ -761,7 +761,7 @@ out:
+@@ -779,7 +779,7 @@ out:
        return ep;
  err:
        spin_unlock_bh(&pool->lock);
@@ -31692,7 +34007,7 @@ diff -urNp linux-3.0.4/drivers/scsi/libfc/fc_exch.c linux-3.0.4/drivers/scsi/lib
        mempool_free(ep, mp->ep_pool);
        return NULL;
  }
-@@ -906,7 +906,7 @@ static enum fc_pf_rjt_reason fc_seq_look
+@@ -922,7 +922,7 @@ static enum fc_pf_rjt_reason fc_seq_look
                xid = ntohs(fh->fh_ox_id);      /* we originated exch */
                ep = fc_exch_find(mp, xid);
                if (!ep) {
@@ -31701,7 +34016,7 @@ diff -urNp linux-3.0.4/drivers/scsi/libfc/fc_exch.c linux-3.0.4/drivers/scsi/lib
                        reject = FC_RJT_OX_ID;
                        goto out;
                }
-@@ -936,7 +936,7 @@ static enum fc_pf_rjt_reason fc_seq_look
+@@ -952,7 +952,7 @@ static enum fc_pf_rjt_reason fc_seq_look
                ep = fc_exch_find(mp, xid);
                if ((f_ctl & FC_FC_FIRST_SEQ) && fc_sof_is_init(fr_sof(fp))) {
                        if (ep) {
@@ -31710,7 +34025,7 @@ diff -urNp linux-3.0.4/drivers/scsi/libfc/fc_exch.c linux-3.0.4/drivers/scsi/lib
                                reject = FC_RJT_RX_ID;
                                goto rel;
                        }
-@@ -947,7 +947,7 @@ static enum fc_pf_rjt_reason fc_seq_look
+@@ -963,7 +963,7 @@ static enum fc_pf_rjt_reason fc_seq_look
                        }
                        xid = ep->xid;  /* get our XID */
                } else if (!ep) {
@@ -31719,16 +34034,16 @@ diff -urNp linux-3.0.4/drivers/scsi/libfc/fc_exch.c linux-3.0.4/drivers/scsi/lib
                        reject = FC_RJT_RX_ID;  /* XID not found */
                        goto out;
                }
-@@ -964,7 +964,7 @@ static enum fc_pf_rjt_reason fc_seq_look
+@@ -980,7 +980,7 @@ static enum fc_pf_rjt_reason fc_seq_look
        } else {
                sp = &ep->seq;
                if (sp->id != fh->fh_seq_id) {
 -                      atomic_inc(&mp->stats.seq_not_found);
 +                      atomic_inc_unchecked(&mp->stats.seq_not_found);
-                       reject = FC_RJT_SEQ_ID; /* sequence/exch should exist */
-                       goto rel;
-               }
-@@ -1392,22 +1392,22 @@ static void fc_exch_recv_seq_resp(struct
+                       if (f_ctl & FC_FC_END_SEQ) {
+                               /*
+                                * Update sequence_id based on incoming last
+@@ -1430,22 +1430,22 @@ static void fc_exch_recv_seq_resp(struct
  
        ep = fc_exch_find(mp, ntohs(fh->fh_ox_id));
        if (!ep) {
@@ -31755,7 +34070,7 @@ diff -urNp linux-3.0.4/drivers/scsi/libfc/fc_exch.c linux-3.0.4/drivers/scsi/lib
                goto rel;
        }
        sof = fr_sof(fp);
-@@ -1416,7 +1416,7 @@ static void fc_exch_recv_seq_resp(struct
+@@ -1454,7 +1454,7 @@ static void fc_exch_recv_seq_resp(struct
                sp->ssb_stat |= SSB_ST_RESP;
                sp->id = fh->fh_seq_id;
        } else if (sp->id != fh->fh_seq_id) {
@@ -31764,7 +34079,7 @@ diff -urNp linux-3.0.4/drivers/scsi/libfc/fc_exch.c linux-3.0.4/drivers/scsi/lib
                goto rel;
        }
  
-@@ -1480,9 +1480,9 @@ static void fc_exch_recv_resp(struct fc_
+@@ -1518,9 +1518,9 @@ static void fc_exch_recv_resp(struct fc_
        sp = fc_seq_lookup_orig(mp, fp);        /* doesn't hold sequence */
  
        if (!sp)
@@ -31776,9 +34091,9 @@ diff -urNp linux-3.0.4/drivers/scsi/libfc/fc_exch.c linux-3.0.4/drivers/scsi/lib
  
        fc_frame_free(fp);
  }
-diff -urNp linux-3.0.4/drivers/scsi/libsas/sas_ata.c linux-3.0.4/drivers/scsi/libsas/sas_ata.c
---- linux-3.0.4/drivers/scsi/libsas/sas_ata.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/libsas/sas_ata.c  2011-08-23 21:47:55.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/libsas/sas_ata.c linux-3.1.3/drivers/scsi/libsas/sas_ata.c
+--- linux-3.1.3/drivers/scsi/libsas/sas_ata.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/libsas/sas_ata.c  2011-11-16 18:39:07.000000000 -0500
 @@ -368,7 +368,7 @@ static struct ata_port_operations sas_sa
        .postreset              = ata_std_postreset,
        .error_handler          = ata_std_error_handler,
@@ -31788,10 +34103,10 @@ diff -urNp linux-3.0.4/drivers/scsi/libsas/sas_ata.c linux-3.0.4/drivers/scsi/li
        .qc_prep                = ata_noop_qc_prep,
        .qc_issue               = sas_ata_qc_issue,
        .qc_fill_rtf            = sas_ata_qc_fill_rtf,
-diff -urNp linux-3.0.4/drivers/scsi/lpfc/lpfc_debugfs.c linux-3.0.4/drivers/scsi/lpfc/lpfc_debugfs.c
---- linux-3.0.4/drivers/scsi/lpfc/lpfc_debugfs.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/lpfc/lpfc_debugfs.c       2011-08-23 21:48:14.000000000 -0400
-@@ -104,7 +104,7 @@ MODULE_PARM_DESC(lpfc_debugfs_mask_disc_
+diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_debugfs.c linux-3.1.3/drivers/scsi/lpfc/lpfc_debugfs.c
+--- linux-3.1.3/drivers/scsi/lpfc/lpfc_debugfs.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/lpfc/lpfc_debugfs.c       2011-11-16 18:40:22.000000000 -0500
+@@ -105,7 +105,7 @@ MODULE_PARM_DESC(lpfc_debugfs_mask_disc_
  
  #include <linux/debugfs.h>
  
@@ -31800,7 +34115,7 @@ diff -urNp linux-3.0.4/drivers/scsi/lpfc/lpfc_debugfs.c linux-3.0.4/drivers/scsi
  static unsigned long lpfc_debugfs_start_time = 0L;
  
  /* iDiag */
-@@ -141,7 +141,7 @@ lpfc_debugfs_disc_trc_data(struct lpfc_v
+@@ -146,7 +146,7 @@ lpfc_debugfs_disc_trc_data(struct lpfc_v
        lpfc_debugfs_enable = 0;
  
        len = 0;
@@ -31809,7 +34124,7 @@ diff -urNp linux-3.0.4/drivers/scsi/lpfc/lpfc_debugfs.c linux-3.0.4/drivers/scsi
                (lpfc_debugfs_max_disc_trc - 1);
        for (i = index; i < lpfc_debugfs_max_disc_trc; i++) {
                dtp = vport->disc_trc + i;
-@@ -202,7 +202,7 @@ lpfc_debugfs_slow_ring_trc_data(struct l
+@@ -212,7 +212,7 @@ lpfc_debugfs_slow_ring_trc_data(struct l
        lpfc_debugfs_enable = 0;
  
        len = 0;
@@ -31818,16 +34133,7 @@ diff -urNp linux-3.0.4/drivers/scsi/lpfc/lpfc_debugfs.c linux-3.0.4/drivers/scsi
                (lpfc_debugfs_max_slow_ring_trc - 1);
        for (i = index; i < lpfc_debugfs_max_slow_ring_trc; i++) {
                dtp = phba->slow_ring_trc + i;
-@@ -380,6 +380,8 @@ lpfc_debugfs_dumpHBASlim_data(struct lpf
-       uint32_t *ptr;
-       char buffer[1024];
-+      pax_track_stack();
-+
-       off = 0;
-       spin_lock_irq(&phba->hbalock);
-@@ -617,14 +619,14 @@ lpfc_debugfs_disc_trc(struct lpfc_vport 
+@@ -635,14 +635,14 @@ lpfc_debugfs_disc_trc(struct lpfc_vport 
                !vport || !vport->disc_trc)
                return;
  
@@ -31844,7 +34150,7 @@ diff -urNp linux-3.0.4/drivers/scsi/lpfc/lpfc_debugfs.c linux-3.0.4/drivers/scsi
        dtp->jif = jiffies;
  #endif
        return;
-@@ -655,14 +657,14 @@ lpfc_debugfs_slow_ring_trc(struct lpfc_h
+@@ -673,14 +673,14 @@ lpfc_debugfs_slow_ring_trc(struct lpfc_h
                !phba || !phba->slow_ring_trc)
                return;
  
@@ -31861,7 +34167,7 @@ diff -urNp linux-3.0.4/drivers/scsi/lpfc/lpfc_debugfs.c linux-3.0.4/drivers/scsi
        dtp->jif = jiffies;
  #endif
        return;
-@@ -2606,7 +2608,7 @@ lpfc_debugfs_initialize(struct lpfc_vpor
+@@ -3828,7 +3828,7 @@ lpfc_debugfs_initialize(struct lpfc_vpor
                                                 "slow_ring buffer\n");
                                goto debug_failed;
                        }
@@ -31870,7 +34176,7 @@ diff -urNp linux-3.0.4/drivers/scsi/lpfc/lpfc_debugfs.c linux-3.0.4/drivers/scsi
                        memset(phba->slow_ring_trc, 0,
                                (sizeof(struct lpfc_debugfs_trc) *
                                lpfc_debugfs_max_slow_ring_trc));
-@@ -2652,7 +2654,7 @@ lpfc_debugfs_initialize(struct lpfc_vpor
+@@ -3874,7 +3874,7 @@ lpfc_debugfs_initialize(struct lpfc_vpor
                                 "buffer\n");
                goto debug_failed;
        }
@@ -31879,10 +34185,10 @@ diff -urNp linux-3.0.4/drivers/scsi/lpfc/lpfc_debugfs.c linux-3.0.4/drivers/scsi
  
        snprintf(name, sizeof(name), "discovery_trace");
        vport->debug_disc_trc =
-diff -urNp linux-3.0.4/drivers/scsi/lpfc/lpfc.h linux-3.0.4/drivers/scsi/lpfc/lpfc.h
---- linux-3.0.4/drivers/scsi/lpfc/lpfc.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/lpfc/lpfc.h       2011-08-23 21:47:55.000000000 -0400
-@@ -420,7 +420,7 @@ struct lpfc_vport {
+diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc.h linux-3.1.3/drivers/scsi/lpfc/lpfc.h
+--- linux-3.1.3/drivers/scsi/lpfc/lpfc.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/lpfc/lpfc.h       2011-11-16 18:39:07.000000000 -0500
+@@ -425,7 +425,7 @@ struct lpfc_vport {
        struct dentry *debug_nodelist;
        struct dentry *vport_debugfs_root;
        struct lpfc_debugfs_trc *disc_trc;
@@ -31891,7 +34197,7 @@ diff -urNp linux-3.0.4/drivers/scsi/lpfc/lpfc.h linux-3.0.4/drivers/scsi/lpfc/lp
  #endif
        uint8_t stat_data_enabled;
        uint8_t stat_data_blocked;
-@@ -826,8 +826,8 @@ struct lpfc_hba {
+@@ -835,8 +835,8 @@ struct lpfc_hba {
        struct timer_list fabric_block_timer;
        unsigned long bit_flags;
  #define       FABRIC_COMANDS_BLOCKED  0
@@ -31902,7 +34208,7 @@ diff -urNp linux-3.0.4/drivers/scsi/lpfc/lpfc.h linux-3.0.4/drivers/scsi/lpfc/lp
        unsigned long last_rsrc_error_time;
        unsigned long last_ramp_down_time;
        unsigned long last_ramp_up_time;
-@@ -841,7 +841,7 @@ struct lpfc_hba {
+@@ -850,7 +850,7 @@ struct lpfc_hba {
        struct dentry *debug_dumpDif;    /* BlockGuard BPL*/
        struct dentry *debug_slow_ring_trc;
        struct lpfc_debugfs_trc *slow_ring_trc;
@@ -31911,10 +34217,10 @@ diff -urNp linux-3.0.4/drivers/scsi/lpfc/lpfc.h linux-3.0.4/drivers/scsi/lpfc/lp
        /* iDiag debugfs sub-directory */
        struct dentry *idiag_root;
        struct dentry *idiag_pci_cfg;
-diff -urNp linux-3.0.4/drivers/scsi/lpfc/lpfc_init.c linux-3.0.4/drivers/scsi/lpfc/lpfc_init.c
---- linux-3.0.4/drivers/scsi/lpfc/lpfc_init.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/lpfc/lpfc_init.c  2011-08-23 21:47:56.000000000 -0400
-@@ -9923,8 +9923,10 @@ lpfc_init(void)
+diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_init.c linux-3.1.3/drivers/scsi/lpfc/lpfc_init.c
+--- linux-3.1.3/drivers/scsi/lpfc/lpfc_init.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/lpfc/lpfc_init.c  2011-11-16 18:39:07.000000000 -0500
+@@ -9969,8 +9969,10 @@ lpfc_init(void)
        printk(LPFC_COPYRIGHT "\n");
  
        if (lpfc_enable_npiv) {
@@ -31927,9 +34233,9 @@ diff -urNp linux-3.0.4/drivers/scsi/lpfc/lpfc_init.c linux-3.0.4/drivers/scsi/lp
        }
        lpfc_transport_template =
                                fc_attach_transport(&lpfc_transport_functions);
-diff -urNp linux-3.0.4/drivers/scsi/lpfc/lpfc_scsi.c linux-3.0.4/drivers/scsi/lpfc/lpfc_scsi.c
---- linux-3.0.4/drivers/scsi/lpfc/lpfc_scsi.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/lpfc/lpfc_scsi.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/lpfc/lpfc_scsi.c linux-3.1.3/drivers/scsi/lpfc/lpfc_scsi.c
+--- linux-3.1.3/drivers/scsi/lpfc/lpfc_scsi.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/lpfc/lpfc_scsi.c  2011-11-16 18:39:07.000000000 -0500
 @@ -297,7 +297,7 @@ lpfc_rampdown_queue_depth(struct lpfc_hb
        uint32_t evt_posted;
  
@@ -31981,9 +34287,9 @@ diff -urNp linux-3.0.4/drivers/scsi/lpfc/lpfc_scsi.c linux-3.0.4/drivers/scsi/lp
  }
  
  /**
-diff -urNp linux-3.0.4/drivers/scsi/megaraid/megaraid_mbox.c linux-3.0.4/drivers/scsi/megaraid/megaraid_mbox.c
---- linux-3.0.4/drivers/scsi/megaraid/megaraid_mbox.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/megaraid/megaraid_mbox.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/megaraid/megaraid_mbox.c linux-3.1.3/drivers/scsi/megaraid/megaraid_mbox.c
+--- linux-3.1.3/drivers/scsi/megaraid/megaraid_mbox.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/megaraid/megaraid_mbox.c  2011-11-16 18:40:22.000000000 -0500
 @@ -3503,6 +3503,8 @@ megaraid_cmm_register(adapter_t *adapter
        int             rval;
        int             i;
@@ -31993,9 +34299,9 @@ diff -urNp linux-3.0.4/drivers/scsi/megaraid/megaraid_mbox.c linux-3.0.4/drivers
        // Allocate memory for the base list of scb for management module.
        adapter->uscb_list = kcalloc(MBOX_MAX_USER_CMDS, sizeof(scb_t), GFP_KERNEL);
  
-diff -urNp linux-3.0.4/drivers/scsi/osd/osd_initiator.c linux-3.0.4/drivers/scsi/osd/osd_initiator.c
---- linux-3.0.4/drivers/scsi/osd/osd_initiator.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/osd/osd_initiator.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/osd/osd_initiator.c linux-3.1.3/drivers/scsi/osd/osd_initiator.c
+--- linux-3.1.3/drivers/scsi/osd/osd_initiator.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/osd/osd_initiator.c       2011-11-16 18:40:22.000000000 -0500
 @@ -97,6 +97,8 @@ static int _osd_get_print_system_info(st
        int nelem = ARRAY_SIZE(get_attrs), a = 0;
        int ret;
@@ -32005,9 +34311,9 @@ diff -urNp linux-3.0.4/drivers/scsi/osd/osd_initiator.c linux-3.0.4/drivers/scsi
        or = osd_start_request(od, GFP_KERNEL);
        if (!or)
                return -ENOMEM;
-diff -urNp linux-3.0.4/drivers/scsi/pmcraid.c linux-3.0.4/drivers/scsi/pmcraid.c
---- linux-3.0.4/drivers/scsi/pmcraid.c 2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/pmcraid.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/pmcraid.c linux-3.1.3/drivers/scsi/pmcraid.c
+--- linux-3.1.3/drivers/scsi/pmcraid.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/pmcraid.c 2011-11-16 18:39:07.000000000 -0500
 @@ -201,8 +201,8 @@ static int pmcraid_slave_alloc(struct sc
                res->scsi_dev = scsi_dev;
                scsi_dev->hostdata = res;
@@ -32078,9 +34384,9 @@ diff -urNp linux-3.0.4/drivers/scsi/pmcraid.c linux-3.0.4/drivers/scsi/pmcraid.c
        schedule_work(&pinstance->worker_q);
        return rc;
  
-diff -urNp linux-3.0.4/drivers/scsi/pmcraid.h linux-3.0.4/drivers/scsi/pmcraid.h
---- linux-3.0.4/drivers/scsi/pmcraid.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/pmcraid.h 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/pmcraid.h linux-3.1.3/drivers/scsi/pmcraid.h
+--- linux-3.1.3/drivers/scsi/pmcraid.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/pmcraid.h 2011-11-16 18:39:07.000000000 -0500
 @@ -749,7 +749,7 @@ struct pmcraid_instance {
        struct pmcraid_isr_param hrrq_vector[PMCRAID_NUM_MSIX_VECTORS];
  
@@ -32110,9 +34416,9 @@ diff -urNp linux-3.0.4/drivers/scsi/pmcraid.h linux-3.0.4/drivers/scsi/pmcraid.h
  
        /* To indicate add/delete/modify during CCN */
        u8 change_detected;
-diff -urNp linux-3.0.4/drivers/scsi/qla2xxx/qla_def.h linux-3.0.4/drivers/scsi/qla2xxx/qla_def.h
---- linux-3.0.4/drivers/scsi/qla2xxx/qla_def.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/qla2xxx/qla_def.h 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/qla2xxx/qla_def.h linux-3.1.3/drivers/scsi/qla2xxx/qla_def.h
+--- linux-3.1.3/drivers/scsi/qla2xxx/qla_def.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/qla2xxx/qla_def.h 2011-11-16 18:39:07.000000000 -0500
 @@ -2244,7 +2244,7 @@ struct isp_operations {
        int (*get_flash_version) (struct scsi_qla_host *, void *);
        int (*start_scsi) (srb_t *);
@@ -32122,9 +34428,9 @@ diff -urNp linux-3.0.4/drivers/scsi/qla2xxx/qla_def.h linux-3.0.4/drivers/scsi/q
  
  /* MSI-X Support *************************************************************/
  
-diff -urNp linux-3.0.4/drivers/scsi/qla4xxx/ql4_def.h linux-3.0.4/drivers/scsi/qla4xxx/ql4_def.h
---- linux-3.0.4/drivers/scsi/qla4xxx/ql4_def.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/qla4xxx/ql4_def.h 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/qla4xxx/ql4_def.h linux-3.1.3/drivers/scsi/qla4xxx/ql4_def.h
+--- linux-3.1.3/drivers/scsi/qla4xxx/ql4_def.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/qla4xxx/ql4_def.h 2011-11-16 18:39:07.000000000 -0500
 @@ -256,7 +256,7 @@ struct ddb_entry {
        atomic_t retry_relogin_timer; /* Min Time between relogins
                                       * (4000 only) */
@@ -32134,9 +34440,9 @@ diff -urNp linux-3.0.4/drivers/scsi/qla4xxx/ql4_def.h linux-3.0.4/drivers/scsi/q
                                       * retried */
  
        uint16_t port;
-diff -urNp linux-3.0.4/drivers/scsi/qla4xxx/ql4_init.c linux-3.0.4/drivers/scsi/qla4xxx/ql4_init.c
---- linux-3.0.4/drivers/scsi/qla4xxx/ql4_init.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/qla4xxx/ql4_init.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/qla4xxx/ql4_init.c linux-3.1.3/drivers/scsi/qla4xxx/ql4_init.c
+--- linux-3.1.3/drivers/scsi/qla4xxx/ql4_init.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/qla4xxx/ql4_init.c        2011-11-16 18:39:07.000000000 -0500
 @@ -680,7 +680,7 @@ static struct ddb_entry * qla4xxx_alloc_
        ddb_entry->fw_ddb_index = fw_ddb_index;
        atomic_set(&ddb_entry->retry_relogin_timer, INVALID_ENTRY);
@@ -32155,9 +34461,9 @@ diff -urNp linux-3.0.4/drivers/scsi/qla4xxx/ql4_init.c linux-3.0.4/drivers/scsi/
                atomic_set(&ddb_entry->relogin_timer, 0);
                clear_bit(DF_RELOGIN, &ddb_entry->flags);
                iscsi_unblock_session(ddb_entry->sess);
-diff -urNp linux-3.0.4/drivers/scsi/qla4xxx/ql4_os.c linux-3.0.4/drivers/scsi/qla4xxx/ql4_os.c
---- linux-3.0.4/drivers/scsi/qla4xxx/ql4_os.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/qla4xxx/ql4_os.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/qla4xxx/ql4_os.c linux-3.1.3/drivers/scsi/qla4xxx/ql4_os.c
+--- linux-3.1.3/drivers/scsi/qla4xxx/ql4_os.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/qla4xxx/ql4_os.c  2011-11-16 18:39:07.000000000 -0500
 @@ -811,13 +811,13 @@ static void qla4xxx_timer(struct scsi_ql
                            ddb_entry->fw_ddb_device_state ==
                            DDB_DS_SESSION_FAILED) {
@@ -32174,9 +34480,9 @@ diff -urNp linux-3.0.4/drivers/scsi/qla4xxx/ql4_os.c linux-3.0.4/drivers/scsi/ql
                                                          relogin_retry_count))
                                        );
                                start_dpc++;
-diff -urNp linux-3.0.4/drivers/scsi/scsi.c linux-3.0.4/drivers/scsi/scsi.c
---- linux-3.0.4/drivers/scsi/scsi.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/scsi.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/scsi.c linux-3.1.3/drivers/scsi/scsi.c
+--- linux-3.1.3/drivers/scsi/scsi.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/scsi.c    2011-11-16 18:39:07.000000000 -0500
 @@ -655,7 +655,7 @@ int scsi_dispatch_cmd(struct scsi_cmnd *
        unsigned long timeout;
        int rtn = 0;
@@ -32186,9 +34492,9 @@ diff -urNp linux-3.0.4/drivers/scsi/scsi.c linux-3.0.4/drivers/scsi/scsi.c
  
        /* check if the device is still usable */
        if (unlikely(cmd->device->sdev_state == SDEV_DEL)) {
-diff -urNp linux-3.0.4/drivers/scsi/scsi_debug.c linux-3.0.4/drivers/scsi/scsi_debug.c
---- linux-3.0.4/drivers/scsi/scsi_debug.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/scsi_debug.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/scsi_debug.c linux-3.1.3/drivers/scsi/scsi_debug.c
+--- linux-3.1.3/drivers/scsi/scsi_debug.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/scsi_debug.c      2011-11-16 18:40:22.000000000 -0500
 @@ -1493,6 +1493,8 @@ static int resp_mode_select(struct scsi_
        unsigned char arr[SDEBUG_MAX_MSELECT_SZ];
        unsigned char *cmd = (unsigned char *)scp->cmnd;
@@ -32207,10 +34513,10 @@ diff -urNp linux-3.0.4/drivers/scsi/scsi_debug.c linux-3.0.4/drivers/scsi/scsi_d
        if ((errsts = check_readiness(scp, 1, devip)))
                return errsts;
        memset(arr, 0, sizeof(arr));
-diff -urNp linux-3.0.4/drivers/scsi/scsi_lib.c linux-3.0.4/drivers/scsi/scsi_lib.c
---- linux-3.0.4/drivers/scsi/scsi_lib.c        2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/scsi_lib.c        2011-08-23 21:47:56.000000000 -0400
-@@ -1412,7 +1412,7 @@ static void scsi_kill_request(struct req
+diff -urNp linux-3.1.3/drivers/scsi/scsi_lib.c linux-3.1.3/drivers/scsi/scsi_lib.c
+--- linux-3.1.3/drivers/scsi/scsi_lib.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/scsi_lib.c        2011-11-16 18:39:07.000000000 -0500
+@@ -1413,7 +1413,7 @@ static void scsi_kill_request(struct req
        shost = sdev->host;
        scsi_init_cmd_errh(cmd);
        cmd->result = DID_NO_CONNECT << 16;
@@ -32219,7 +34525,7 @@ diff -urNp linux-3.0.4/drivers/scsi/scsi_lib.c linux-3.0.4/drivers/scsi/scsi_lib
  
        /*
         * SCSI request completion path will do scsi_device_unbusy(),
-@@ -1438,9 +1438,9 @@ static void scsi_softirq_done(struct req
+@@ -1439,9 +1439,9 @@ static void scsi_softirq_done(struct req
  
        INIT_LIST_HEAD(&cmd->eh_entry);
  
@@ -32231,9 +34537,9 @@ diff -urNp linux-3.0.4/drivers/scsi/scsi_lib.c linux-3.0.4/drivers/scsi/scsi_lib
  
        disposition = scsi_decide_disposition(cmd);
        if (disposition != SUCCESS &&
-diff -urNp linux-3.0.4/drivers/scsi/scsi_sysfs.c linux-3.0.4/drivers/scsi/scsi_sysfs.c
---- linux-3.0.4/drivers/scsi/scsi_sysfs.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/scsi_sysfs.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/scsi_sysfs.c linux-3.1.3/drivers/scsi/scsi_sysfs.c
+--- linux-3.1.3/drivers/scsi/scsi_sysfs.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/scsi_sysfs.c      2011-11-16 18:39:07.000000000 -0500
 @@ -622,7 +622,7 @@ show_iostat_##field(struct device *dev, 
                    char *buf)                                          \
  {                                                                     \
@@ -32243,9 +34549,21 @@ diff -urNp linux-3.0.4/drivers/scsi/scsi_sysfs.c linux-3.0.4/drivers/scsi/scsi_s
        return snprintf(buf, 20, "0x%llx\n", count);                    \
  }                                                                     \
  static DEVICE_ATTR(field, S_IRUGO, show_iostat_##field, NULL)
-diff -urNp linux-3.0.4/drivers/scsi/scsi_transport_fc.c linux-3.0.4/drivers/scsi/scsi_transport_fc.c
---- linux-3.0.4/drivers/scsi/scsi_transport_fc.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/scsi_transport_fc.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/scsi_tgt_lib.c linux-3.1.3/drivers/scsi/scsi_tgt_lib.c
+--- linux-3.1.3/drivers/scsi/scsi_tgt_lib.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/scsi_tgt_lib.c    2011-11-16 18:39:07.000000000 -0500
+@@ -362,7 +362,7 @@ static int scsi_map_user_pages(struct sc
+       int err;
+       dprintk("%lx %u\n", uaddr, len);
+-      err = blk_rq_map_user(q, rq, NULL, (void *)uaddr, len, GFP_KERNEL);
++      err = blk_rq_map_user(q, rq, NULL, (void __user *)uaddr, len, GFP_KERNEL);
+       if (err) {
+               /*
+                * TODO: need to fixup sg_tablesize, max_segment_size,
+diff -urNp linux-3.1.3/drivers/scsi/scsi_transport_fc.c linux-3.1.3/drivers/scsi/scsi_transport_fc.c
+--- linux-3.1.3/drivers/scsi/scsi_transport_fc.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/scsi_transport_fc.c       2011-11-16 18:39:07.000000000 -0500
 @@ -484,7 +484,7 @@ static DECLARE_TRANSPORT_CLASS(fc_vport_
   * Netlink Infrastructure
   */
@@ -32282,9 +34600,9 @@ diff -urNp linux-3.0.4/drivers/scsi/scsi_transport_fc.c linux-3.0.4/drivers/scsi
                return -EINVAL;
        /*
         * Check for overflow; dev_loss_tmo is u32
-diff -urNp linux-3.0.4/drivers/scsi/scsi_transport_iscsi.c linux-3.0.4/drivers/scsi/scsi_transport_iscsi.c
---- linux-3.0.4/drivers/scsi/scsi_transport_iscsi.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/scsi_transport_iscsi.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/scsi_transport_iscsi.c linux-3.1.3/drivers/scsi/scsi_transport_iscsi.c
+--- linux-3.1.3/drivers/scsi/scsi_transport_iscsi.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/scsi_transport_iscsi.c    2011-11-16 18:39:07.000000000 -0500
 @@ -83,7 +83,7 @@ struct iscsi_internal {
        struct device_attribute *session_attrs[ISCSI_SESSION_ATTRS + 1];
  };
@@ -32312,9 +34630,9 @@ diff -urNp linux-3.0.4/drivers/scsi/scsi_transport_iscsi.c linux-3.0.4/drivers/s
  
        err = class_register(&iscsi_transport_class);
        if (err)
-diff -urNp linux-3.0.4/drivers/scsi/scsi_transport_srp.c linux-3.0.4/drivers/scsi/scsi_transport_srp.c
---- linux-3.0.4/drivers/scsi/scsi_transport_srp.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/scsi_transport_srp.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/scsi_transport_srp.c linux-3.1.3/drivers/scsi/scsi_transport_srp.c
+--- linux-3.1.3/drivers/scsi/scsi_transport_srp.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/scsi_transport_srp.c      2011-11-16 18:39:07.000000000 -0500
 @@ -33,7 +33,7 @@
  #include "scsi_transport_srp_internal.h"
  
@@ -32342,9 +34660,18 @@ diff -urNp linux-3.0.4/drivers/scsi/scsi_transport_srp.c linux-3.0.4/drivers/scs
        dev_set_name(&rport->dev, "port-%d:%d", shost->host_no, id);
  
        transport_setup_device(&rport->dev);
-diff -urNp linux-3.0.4/drivers/scsi/sg.c linux-3.0.4/drivers/scsi/sg.c
---- linux-3.0.4/drivers/scsi/sg.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/sg.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/sg.c linux-3.1.3/drivers/scsi/sg.c
+--- linux-3.1.3/drivers/scsi/sg.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/sg.c      2011-11-16 18:39:07.000000000 -0500
+@@ -1075,7 +1075,7 @@ sg_ioctl(struct file *filp, unsigned int
+                                      sdp->disk->disk_name,
+                                      MKDEV(SCSI_GENERIC_MAJOR, sdp->index),
+                                      NULL,
+-                                     (char *)arg);
++                                     (char __user *)arg);
+       case BLKTRACESTART:
+               return blk_trace_startstop(sdp->device->request_queue, 1);
+       case BLKTRACESTOP:
 @@ -2310,7 +2310,7 @@ struct sg_proc_leaf {
        const struct file_operations * fops;
  };
@@ -32363,9 +34690,9 @@ diff -urNp linux-3.0.4/drivers/scsi/sg.c linux-3.0.4/drivers/scsi/sg.c
  
        sg_proc_sgp = proc_mkdir(sg_proc_sg_dirname, NULL);
        if (!sg_proc_sgp)
-diff -urNp linux-3.0.4/drivers/scsi/sym53c8xx_2/sym_glue.c linux-3.0.4/drivers/scsi/sym53c8xx_2/sym_glue.c
---- linux-3.0.4/drivers/scsi/sym53c8xx_2/sym_glue.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/sym53c8xx_2/sym_glue.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/sym53c8xx_2/sym_glue.c linux-3.1.3/drivers/scsi/sym53c8xx_2/sym_glue.c
+--- linux-3.1.3/drivers/scsi/sym53c8xx_2/sym_glue.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/sym53c8xx_2/sym_glue.c    2011-11-16 18:40:22.000000000 -0500
 @@ -1756,6 +1756,8 @@ static int __devinit sym2_probe(struct p
        int do_iounmap = 0;
        int do_disable_device = 1;
@@ -32375,9 +34702,9 @@ diff -urNp linux-3.0.4/drivers/scsi/sym53c8xx_2/sym_glue.c linux-3.0.4/drivers/s
        memset(&sym_dev, 0, sizeof(sym_dev));
        memset(&nvram, 0, sizeof(nvram));
        sym_dev.pdev = pdev;
-diff -urNp linux-3.0.4/drivers/scsi/vmw_pvscsi.c linux-3.0.4/drivers/scsi/vmw_pvscsi.c
---- linux-3.0.4/drivers/scsi/vmw_pvscsi.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/scsi/vmw_pvscsi.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/scsi/vmw_pvscsi.c linux-3.1.3/drivers/scsi/vmw_pvscsi.c
+--- linux-3.1.3/drivers/scsi/vmw_pvscsi.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/scsi/vmw_pvscsi.c      2011-11-16 18:40:22.000000000 -0500
 @@ -447,6 +447,8 @@ static void pvscsi_setup_all_rings(const
        dma_addr_t base;
        unsigned i;
@@ -32387,9 +34714,9 @@ diff -urNp linux-3.0.4/drivers/scsi/vmw_pvscsi.c linux-3.0.4/drivers/scsi/vmw_pv
        cmd.ringsStatePPN   = adapter->ringStatePA >> PAGE_SHIFT;
        cmd.reqRingNumPages = adapter->req_pages;
        cmd.cmpRingNumPages = adapter->cmp_pages;
-diff -urNp linux-3.0.4/drivers/spi/spi.c linux-3.0.4/drivers/spi/spi.c
---- linux-3.0.4/drivers/spi/spi.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/spi/spi.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/spi/spi.c linux-3.1.3/drivers/spi/spi.c
+--- linux-3.1.3/drivers/spi/spi.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/spi/spi.c      2011-11-16 18:39:07.000000000 -0500
 @@ -1023,7 +1023,7 @@ int spi_bus_unlock(struct spi_master *ma
  EXPORT_SYMBOL_GPL(spi_bus_unlock);
  
@@ -32399,9 +34726,21 @@ diff -urNp linux-3.0.4/drivers/spi/spi.c linux-3.0.4/drivers/spi/spi.c
  
  static u8     *buf;
  
-diff -urNp linux-3.0.4/drivers/staging/ath6kl/os/linux/ar6000_drv.c linux-3.0.4/drivers/staging/ath6kl/os/linux/ar6000_drv.c
---- linux-3.0.4/drivers/staging/ath6kl/os/linux/ar6000_drv.c   2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/staging/ath6kl/os/linux/ar6000_drv.c   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/spi/spi-dw-pci.c linux-3.1.3/drivers/spi/spi-dw-pci.c
+--- linux-3.1.3/drivers/spi/spi-dw-pci.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/spi/spi-dw-pci.c       2011-11-16 18:39:07.000000000 -0500
+@@ -148,7 +148,7 @@ static int spi_resume(struct pci_dev *pd
+ #define spi_resume    NULL
+ #endif
+-static const struct pci_device_id pci_ids[] __devinitdata = {
++static const struct pci_device_id pci_ids[] __devinitconst = {
+       /* Intel MID platform SPI controller 0 */
+       { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0800) },
+       {},
+diff -urNp linux-3.1.3/drivers/staging/ath6kl/os/linux/ar6000_drv.c linux-3.1.3/drivers/staging/ath6kl/os/linux/ar6000_drv.c
+--- linux-3.1.3/drivers/staging/ath6kl/os/linux/ar6000_drv.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/ath6kl/os/linux/ar6000_drv.c   2011-11-16 18:39:07.000000000 -0500
 @@ -362,7 +362,7 @@ static struct ar_cookie s_ar_cookie_mem[
          (((ar)->arTargetType == TARGET_TYPE_AR6003) ? AR6003_HOST_INTEREST_ITEM_ADDRESS(item) : 0))
  
@@ -32411,9 +34750,9 @@ diff -urNp linux-3.0.4/drivers/staging/ath6kl/os/linux/ar6000_drv.c linux-3.0.4/
      .ndo_init               = NULL,
      .ndo_open               = ar6000_open,
      .ndo_stop               = ar6000_close,
-diff -urNp linux-3.0.4/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h linux-3.0.4/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h
---- linux-3.0.4/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h linux-3.1.3/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h
+--- linux-3.1.3/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h     2011-11-16 18:39:07.000000000 -0500
 @@ -30,7 +30,7 @@ typedef bool (*ar6k_pal_recv_pkt_t)(void
  typedef struct ar6k_pal_config_s
  {
@@ -32423,99 +34762,99 @@ diff -urNp linux-3.0.4/drivers/staging/ath6kl/os/linux/include/ar6k_pal.h linux-
  
  void register_pal_cb(ar6k_pal_config_t *palConfig_p);
  #endif /* _AR6K_PAL_H_ */
-diff -urNp linux-3.0.4/drivers/staging/brcm80211/brcmfmac/dhd_linux.c linux-3.0.4/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
---- linux-3.0.4/drivers/staging/brcm80211/brcmfmac/dhd_linux.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/brcm80211/brcmfmac/dhd_linux.c 2011-08-23 21:47:56.000000000 -0400
-@@ -853,14 +853,14 @@ static void dhd_op_if(dhd_if_t *ifp)
+diff -urNp linux-3.1.3/drivers/staging/brcm80211/brcmfmac/dhd_linux.c linux-3.1.3/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+--- linux-3.1.3/drivers/staging/brcm80211/brcmfmac/dhd_linux.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/brcm80211/brcmfmac/dhd_linux.c 2011-11-16 18:39:07.000000000 -0500
+@@ -451,14 +451,14 @@ static void brcmf_op_if(struct brcmf_if 
                        free_netdev(ifp->net);
                }
                /* Allocate etherdev, including space for private structure */
--              ifp->net = alloc_etherdev(sizeof(dhd));
-+              ifp->net = alloc_etherdev(sizeof(*dhd));
+-              ifp->net = alloc_etherdev(sizeof(drvr_priv));
++              ifp->net = alloc_etherdev(sizeof(*drvr_priv));
                if (!ifp->net) {
-                       DHD_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
+                       BRCMF_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
                        ret = -ENOMEM;
                }
                if (ret == 0) {
                        strcpy(ifp->net->name, ifp->name);
--                      memcpy(netdev_priv(ifp->net), &dhd, sizeof(dhd));
-+                      memcpy(netdev_priv(ifp->net), dhd, sizeof(*dhd));
-                       err = dhd_net_attach(&dhd->pub, ifp->idx);
+-                      memcpy(netdev_priv(ifp->net), &drvr_priv, sizeof(drvr_priv));
++                      memcpy(netdev_priv(ifp->net), &drvr_priv, sizeof(*drvr_priv));
+                       err = brcmf_net_attach(&drvr_priv->pub, ifp->idx);
                        if (err != 0) {
-                               DHD_ERROR(("%s: dhd_net_attach failed, "
-@@ -1872,7 +1872,7 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bu
-               strcpy(nv_path, nvram_path);
+                               BRCMF_ERROR(("%s: brcmf_net_attach failed, "
+@@ -1279,7 +1279,7 @@ struct brcmf_pub *brcmf_attach(struct br
+       BRCMF_TRACE(("%s: Enter\n", __func__));
  
        /* Allocate etherdev, including space for private structure */
--      net = alloc_etherdev(sizeof(dhd));
-+      net = alloc_etherdev(sizeof(*dhd));
+-      net = alloc_etherdev(sizeof(drvr_priv));
++      net = alloc_etherdev(sizeof(*drvr_priv));
        if (!net) {
-               DHD_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
+               BRCMF_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
                goto fail;
-@@ -1888,7 +1888,7 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bu
+@@ -1295,7 +1295,7 @@ struct brcmf_pub *brcmf_attach(struct br
        /*
-        * Save the dhd_info into the priv
+        * Save the brcmf_info into the priv
         */
--      memcpy(netdev_priv(net), &dhd, sizeof(dhd));
-+      memcpy(netdev_priv(net), dhd, sizeof(*dhd));
+-      memcpy(netdev_priv(net), &drvr_priv, sizeof(drvr_priv));
++      memcpy(netdev_priv(net), &drvr_priv, sizeof(*drvr_priv));
  
        /* Set network interface name if it was provided as module parameter */
        if (iface_name[0]) {
-@@ -2004,7 +2004,7 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bu
+@@ -1352,7 +1352,7 @@ struct brcmf_pub *brcmf_attach(struct br
        /*
-        * Save the dhd_info into the priv
+        * Save the brcmf_info into the priv
         */
--      memcpy(netdev_priv(net), &dhd, sizeof(dhd));
-+      memcpy(netdev_priv(net), dhd, sizeof(*dhd));
- #if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
-       g_bus = bus;
-diff -urNp linux-3.0.4/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_int.h linux-3.0.4/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_int.h
---- linux-3.0.4/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_int.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_int.h   2011-08-23 21:47:56.000000000 -0400
-@@ -593,7 +593,7 @@ struct phy_func_ptr {
+-      memcpy(netdev_priv(net), &drvr_priv, sizeof(drvr_priv));
++      memcpy(netdev_priv(net), &drvr_priv, sizeof(*drvr_priv));
+ #if defined(CONFIG_PM_SLEEP)
+       atomic_set(&brcmf_mmc_suspend, false);
+diff -urNp linux-3.1.3/drivers/staging/brcm80211/brcmfmac/sdio_host.h linux-3.1.3/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+--- linux-3.1.3/drivers/staging/brcm80211/brcmfmac/sdio_host.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/brcm80211/brcmfmac/sdio_host.h 2011-11-16 18:39:07.000000000 -0500
+@@ -263,7 +263,7 @@ struct brcmf_sdioh_driver {
+                        u16 func, uint bustype, u32 regsva, void *param);
+       /* detach from device */
+       void (*detach) (void *ch);
+-};
++} __no_const;
+ struct sdioh_info;
+diff -urNp linux-3.1.3/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h linux-3.1.3/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
+--- linux-3.1.3/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h       2011-11-16 18:39:07.000000000 -0500
+@@ -591,7 +591,7 @@ struct phy_func_ptr {
        initfn_t carrsuppr;
        rxsigpwrfn_t rxsigpwr;
        detachfn_t detach;
 -};
 +} __no_const;
- typedef struct phy_func_ptr phy_func_ptr_t;
- struct phy_info {
-diff -urNp linux-3.0.4/drivers/staging/brcm80211/include/bcmsdh.h linux-3.0.4/drivers/staging/brcm80211/include/bcmsdh.h
---- linux-3.0.4/drivers/staging/brcm80211/include/bcmsdh.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/brcm80211/include/bcmsdh.h     2011-08-23 21:47:56.000000000 -0400
-@@ -185,7 +185,7 @@ typedef struct {
-                        u16 func, uint bustype, void *regsva, void *param);
-       /* detach from device */
-       void (*detach) (void *ch);
--} bcmsdh_driver_t;
-+} __no_const bcmsdh_driver_t;
- /* platform specific/high level functions */
- extern int bcmsdh_register(bcmsdh_driver_t *driver);
-diff -urNp linux-3.0.4/drivers/staging/et131x/et1310_tx.c linux-3.0.4/drivers/staging/et131x/et1310_tx.c
---- linux-3.0.4/drivers/staging/et131x/et1310_tx.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/et131x/et1310_tx.c     2011-08-23 21:47:56.000000000 -0400
+ struct brcms_phy {
+       struct brcms_phy_pub pubpi_ro;
+diff -urNp linux-3.1.3/drivers/staging/et131x/et1310_tx.c linux-3.1.3/drivers/staging/et131x/et1310_tx.c
+--- linux-3.1.3/drivers/staging/et131x/et1310_tx.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/et131x/et1310_tx.c     2011-11-16 18:39:07.000000000 -0500
 @@ -635,11 +635,11 @@ inline void et131x_free_send_packet(stru
        struct net_device_stats *stats = &etdev->net_stats;
  
        if (tcb->flags & fMP_DEST_BROAD)
--              atomic_inc(&etdev->Stats.brdcstxmt);
-+              atomic_inc_unchecked(&etdev->Stats.brdcstxmt);
+-              atomic_inc(&etdev->stats.brdcstxmt);
++              atomic_inc_unchecked(&etdev->stats.brdcstxmt);
        else if (tcb->flags & fMP_DEST_MULTI)
--              atomic_inc(&etdev->Stats.multixmt);
-+              atomic_inc_unchecked(&etdev->Stats.multixmt);
+-              atomic_inc(&etdev->stats.multixmt);
++              atomic_inc_unchecked(&etdev->stats.multixmt);
        else
--              atomic_inc(&etdev->Stats.unixmt);
-+              atomic_inc_unchecked(&etdev->Stats.unixmt);
+-              atomic_inc(&etdev->stats.unixmt);
++              atomic_inc_unchecked(&etdev->stats.unixmt);
  
        if (tcb->skb) {
                stats->tx_bytes += tcb->skb->len;
-diff -urNp linux-3.0.4/drivers/staging/et131x/et131x_adapter.h linux-3.0.4/drivers/staging/et131x/et131x_adapter.h
---- linux-3.0.4/drivers/staging/et131x/et131x_adapter.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/et131x/et131x_adapter.h        2011-08-23 21:47:56.000000000 -0400
-@@ -110,11 +110,11 @@ typedef struct _ce_stats_t {
+diff -urNp linux-3.1.3/drivers/staging/et131x/et131x_adapter.h linux-3.1.3/drivers/staging/et131x/et131x_adapter.h
+--- linux-3.1.3/drivers/staging/et131x/et131x_adapter.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/et131x/et131x_adapter.h        2011-11-16 18:39:07.000000000 -0500
+@@ -106,11 +106,11 @@ struct ce_stats {
         * operations
         */
        u32 unircv;     /* # multicast packets received */
@@ -32530,10 +34869,10 @@ diff -urNp linux-3.0.4/drivers/staging/et131x/et131x_adapter.h linux-3.0.4/drive
        u32 norcvbuf;   /* # Rx packets discarded */
        u32 noxmtbuf;   /* # Tx packets discarded */
  
-diff -urNp linux-3.0.4/drivers/staging/hv/channel.c linux-3.0.4/drivers/staging/hv/channel.c
---- linux-3.0.4/drivers/staging/hv/channel.c   2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/staging/hv/channel.c   2011-08-23 21:47:56.000000000 -0400
-@@ -433,8 +433,8 @@ int vmbus_establish_gpadl(struct vmbus_c
+diff -urNp linux-3.1.3/drivers/staging/hv/channel.c linux-3.1.3/drivers/staging/hv/channel.c
+--- linux-3.1.3/drivers/staging/hv/channel.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/hv/channel.c   2011-11-16 18:39:07.000000000 -0500
+@@ -447,8 +447,8 @@ int vmbus_establish_gpadl(struct vmbus_c
        int ret = 0;
        int t;
  
@@ -32544,9 +34883,9 @@ diff -urNp linux-3.0.4/drivers/staging/hv/channel.c linux-3.0.4/drivers/staging/
  
        ret = create_gpadl_header(kbuffer, size, &msginfo, &msgcount);
        if (ret)
-diff -urNp linux-3.0.4/drivers/staging/hv/hv.c linux-3.0.4/drivers/staging/hv/hv.c
---- linux-3.0.4/drivers/staging/hv/hv.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/hv/hv.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/staging/hv/hv.c linux-3.1.3/drivers/staging/hv/hv.c
+--- linux-3.1.3/drivers/staging/hv/hv.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/hv/hv.c        2011-11-16 18:39:07.000000000 -0500
 @@ -132,7 +132,7 @@ static u64 do_hypercall(u64 control, voi
        u64 output_address = (output) ? virt_to_phys(output) : 0;
        u32 output_address_hi = output_address >> 32;
@@ -32556,10 +34895,10 @@ diff -urNp linux-3.0.4/drivers/staging/hv/hv.c linux-3.0.4/drivers/staging/hv/hv
  
        __asm__ __volatile__ ("call *%8" : "=d"(hv_status_hi),
                              "=a"(hv_status_lo) : "d" (control_hi),
-diff -urNp linux-3.0.4/drivers/staging/hv/hv_mouse.c linux-3.0.4/drivers/staging/hv/hv_mouse.c
---- linux-3.0.4/drivers/staging/hv/hv_mouse.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/hv/hv_mouse.c  2011-08-23 21:47:56.000000000 -0400
-@@ -879,8 +879,10 @@ static void reportdesc_callback(struct h
+diff -urNp linux-3.1.3/drivers/staging/hv/hv_mouse.c linux-3.1.3/drivers/staging/hv/hv_mouse.c
+--- linux-3.1.3/drivers/staging/hv/hv_mouse.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/hv/hv_mouse.c  2011-11-16 18:39:07.000000000 -0500
+@@ -878,8 +878,10 @@ static void reportdesc_callback(struct h
        if (hid_dev) {
                DPRINT_INFO(INPUTVSC_DRV, "hid_device created");
  
@@ -32572,9 +34911,9 @@ diff -urNp linux-3.0.4/drivers/staging/hv/hv_mouse.c linux-3.0.4/drivers/staging
  
                hid_dev->bus = BUS_VIRTUAL;
                hid_dev->vendor = input_device_ctx->device_info.vendor;
-diff -urNp linux-3.0.4/drivers/staging/hv/hyperv_vmbus.h linux-3.0.4/drivers/staging/hv/hyperv_vmbus.h
---- linux-3.0.4/drivers/staging/hv/hyperv_vmbus.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/hv/hyperv_vmbus.h      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/staging/hv/hyperv_vmbus.h linux-3.1.3/drivers/staging/hv/hyperv_vmbus.h
+--- linux-3.1.3/drivers/staging/hv/hyperv_vmbus.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/hv/hyperv_vmbus.h      2011-11-16 18:39:07.000000000 -0500
 @@ -559,7 +559,7 @@ enum vmbus_connect_state {
  struct vmbus_connection {
        enum vmbus_connect_state conn_state;
@@ -32584,9 +34923,9 @@ diff -urNp linux-3.0.4/drivers/staging/hv/hyperv_vmbus.h linux-3.0.4/drivers/sta
  
        /*
         * Represents channel interrupts. Each bit position represents a
-diff -urNp linux-3.0.4/drivers/staging/hv/rndis_filter.c linux-3.0.4/drivers/staging/hv/rndis_filter.c
---- linux-3.0.4/drivers/staging/hv/rndis_filter.c      2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/staging/hv/rndis_filter.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/staging/hv/rndis_filter.c linux-3.1.3/drivers/staging/hv/rndis_filter.c
+--- linux-3.1.3/drivers/staging/hv/rndis_filter.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/hv/rndis_filter.c      2011-11-16 18:39:07.000000000 -0500
 @@ -43,7 +43,7 @@ struct rndis_device {
  
        enum rndis_device_state state;
@@ -32605,7 +34944,7 @@ diff -urNp linux-3.0.4/drivers/staging/hv/rndis_filter.c linux-3.0.4/drivers/sta
  
        /* Add to the request list */
        spin_lock_irqsave(&dev->request_lock, flags);
-@@ -637,7 +637,7 @@ static void rndis_filter_halt_device(str
+@@ -622,7 +622,7 @@ static void rndis_filter_halt_device(str
  
        /* Setup the rndis set */
        halt = &request->request_msg.msg.halt_req;
@@ -32614,10 +34953,10 @@ diff -urNp linux-3.0.4/drivers/staging/hv/rndis_filter.c linux-3.0.4/drivers/sta
  
        /* Ignore return since this msg is optional. */
        rndis_filter_send_request(dev, request);
-diff -urNp linux-3.0.4/drivers/staging/hv/vmbus_drv.c linux-3.0.4/drivers/staging/hv/vmbus_drv.c
---- linux-3.0.4/drivers/staging/hv/vmbus_drv.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/hv/vmbus_drv.c 2011-08-23 21:47:56.000000000 -0400
-@@ -668,11 +668,11 @@ int vmbus_child_device_register(struct h
+diff -urNp linux-3.1.3/drivers/staging/hv/vmbus_drv.c linux-3.1.3/drivers/staging/hv/vmbus_drv.c
+--- linux-3.1.3/drivers/staging/hv/vmbus_drv.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/hv/vmbus_drv.c 2011-11-16 18:39:07.000000000 -0500
+@@ -660,11 +660,11 @@ int vmbus_child_device_register(struct h
  {
        int ret = 0;
  
@@ -32631,9 +34970,9 @@ diff -urNp linux-3.0.4/drivers/staging/hv/vmbus_drv.c linux-3.0.4/drivers/stagin
  
        /* The new device belongs to this bus */
        child_device_obj->device.bus = &hv_bus; /* device->dev.bus; */
-diff -urNp linux-3.0.4/drivers/staging/iio/ring_generic.h linux-3.0.4/drivers/staging/iio/ring_generic.h
---- linux-3.0.4/drivers/staging/iio/ring_generic.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/iio/ring_generic.h     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/staging/iio/ring_generic.h linux-3.1.3/drivers/staging/iio/ring_generic.h
+--- linux-3.1.3/drivers/staging/iio/ring_generic.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/iio/ring_generic.h     2011-11-16 18:39:07.000000000 -0500
 @@ -62,7 +62,7 @@ struct iio_ring_access_funcs {
  
        int (*is_enabled)(struct iio_ring_buffer *ring);
@@ -32643,9 +34982,30 @@ diff -urNp linux-3.0.4/drivers/staging/iio/ring_generic.h linux-3.0.4/drivers/st
  
  struct iio_ring_setup_ops {
        int                             (*preenable)(struct iio_dev *);
-diff -urNp linux-3.0.4/drivers/staging/octeon/ethernet.c linux-3.0.4/drivers/staging/octeon/ethernet.c
---- linux-3.0.4/drivers/staging/octeon/ethernet.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/octeon/ethernet.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/staging/mei/interface.c linux-3.1.3/drivers/staging/mei/interface.c
+--- linux-3.1.3/drivers/staging/mei/interface.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/mei/interface.c        2011-11-17 18:39:18.000000000 -0500
+@@ -332,7 +332,7 @@ int mei_send_flow_control(struct mei_dev
+       mei_hdr->reserved = 0;
+       mei_flow_control = (struct hbm_flow_control *) &dev->wr_msg_buf[1];
+-      memset(mei_flow_control, 0, sizeof(mei_flow_control));
++      memset(mei_flow_control, 0, sizeof(*mei_flow_control));
+       mei_flow_control->host_addr = cl->host_client_id;
+       mei_flow_control->me_addr = cl->me_client_id;
+       mei_flow_control->cmd.cmd = MEI_FLOW_CONTROL_CMD;
+@@ -396,7 +396,7 @@ int mei_disconnect(struct mei_device *de
+       mei_cli_disconnect =
+           (struct hbm_client_disconnect_request *) &dev->wr_msg_buf[1];
+-      memset(mei_cli_disconnect, 0, sizeof(mei_cli_disconnect));
++      memset(mei_cli_disconnect, 0, sizeof(*mei_cli_disconnect));
+       mei_cli_disconnect->host_addr = cl->host_client_id;
+       mei_cli_disconnect->me_addr = cl->me_client_id;
+       mei_cli_disconnect->cmd.cmd = CLIENT_DISCONNECT_REQ_CMD;
+diff -urNp linux-3.1.3/drivers/staging/octeon/ethernet.c linux-3.1.3/drivers/staging/octeon/ethernet.c
+--- linux-3.1.3/drivers/staging/octeon/ethernet.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/octeon/ethernet.c      2011-11-16 18:39:07.000000000 -0500
 @@ -258,11 +258,11 @@ static struct net_device_stats *cvm_oct_
                 * since the RX tasklet also increments it.
                 */
@@ -32662,10 +35022,10 @@ diff -urNp linux-3.0.4/drivers/staging/octeon/ethernet.c linux-3.0.4/drivers/sta
  #endif
        }
  
-diff -urNp linux-3.0.4/drivers/staging/octeon/ethernet-rx.c linux-3.0.4/drivers/staging/octeon/ethernet-rx.c
---- linux-3.0.4/drivers/staging/octeon/ethernet-rx.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/octeon/ethernet-rx.c   2011-08-23 21:47:56.000000000 -0400
-@@ -417,11 +417,11 @@ static int cvm_oct_napi_poll(struct napi
+diff -urNp linux-3.1.3/drivers/staging/octeon/ethernet-rx.c linux-3.1.3/drivers/staging/octeon/ethernet-rx.c
+--- linux-3.1.3/drivers/staging/octeon/ethernet-rx.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/octeon/ethernet-rx.c   2011-11-16 18:39:07.000000000 -0500
+@@ -420,11 +420,11 @@ static int cvm_oct_napi_poll(struct napi
                                /* Increment RX stats for virtual ports */
                                if (work->ipprt >= CVMX_PIP_NUM_INPUT_PORTS) {
  #ifdef CONFIG_64BIT
@@ -32681,7 +35041,7 @@ diff -urNp linux-3.0.4/drivers/staging/octeon/ethernet-rx.c linux-3.0.4/drivers/
  #endif
                                }
                                netif_receive_skb(skb);
-@@ -433,9 +433,9 @@ static int cvm_oct_napi_poll(struct napi
+@@ -436,9 +436,9 @@ static int cvm_oct_napi_poll(struct napi
                                           dev->name);
                                */
  #ifdef CONFIG_64BIT
@@ -32693,10 +35053,10 @@ diff -urNp linux-3.0.4/drivers/staging/octeon/ethernet-rx.c linux-3.0.4/drivers/
  #endif
                                dev_kfree_skb_irq(skb);
                        }
-diff -urNp linux-3.0.4/drivers/staging/pohmelfs/inode.c linux-3.0.4/drivers/staging/pohmelfs/inode.c
---- linux-3.0.4/drivers/staging/pohmelfs/inode.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/pohmelfs/inode.c       2011-08-23 21:47:56.000000000 -0400
-@@ -1856,7 +1856,7 @@ static int pohmelfs_fill_super(struct su
+diff -urNp linux-3.1.3/drivers/staging/pohmelfs/inode.c linux-3.1.3/drivers/staging/pohmelfs/inode.c
+--- linux-3.1.3/drivers/staging/pohmelfs/inode.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/pohmelfs/inode.c       2011-11-16 18:39:07.000000000 -0500
+@@ -1861,7 +1861,7 @@ static int pohmelfs_fill_super(struct su
        mutex_init(&psb->mcache_lock);
        psb->mcache_root = RB_ROOT;
        psb->mcache_timeout = msecs_to_jiffies(5000);
@@ -32705,7 +35065,7 @@ diff -urNp linux-3.0.4/drivers/staging/pohmelfs/inode.c linux-3.0.4/drivers/stag
  
        psb->trans_max_pages = 100;
  
-@@ -1871,7 +1871,7 @@ static int pohmelfs_fill_super(struct su
+@@ -1876,7 +1876,7 @@ static int pohmelfs_fill_super(struct su
        INIT_LIST_HEAD(&psb->crypto_ready_list);
        INIT_LIST_HEAD(&psb->crypto_active_list);
  
@@ -32714,9 +35074,9 @@ diff -urNp linux-3.0.4/drivers/staging/pohmelfs/inode.c linux-3.0.4/drivers/stag
        atomic_long_set(&psb->total_inodes, 0);
  
        mutex_init(&psb->state_lock);
-diff -urNp linux-3.0.4/drivers/staging/pohmelfs/mcache.c linux-3.0.4/drivers/staging/pohmelfs/mcache.c
---- linux-3.0.4/drivers/staging/pohmelfs/mcache.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/pohmelfs/mcache.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/staging/pohmelfs/mcache.c linux-3.1.3/drivers/staging/pohmelfs/mcache.c
+--- linux-3.1.3/drivers/staging/pohmelfs/mcache.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/pohmelfs/mcache.c      2011-11-16 18:39:07.000000000 -0500
 @@ -121,7 +121,7 @@ struct pohmelfs_mcache *pohmelfs_mcache_
        m->data = data;
        m->start = start;
@@ -32726,9 +35086,9 @@ diff -urNp linux-3.0.4/drivers/staging/pohmelfs/mcache.c linux-3.0.4/drivers/sta
  
        mutex_lock(&psb->mcache_lock);
        err = pohmelfs_mcache_insert(psb, m);
-diff -urNp linux-3.0.4/drivers/staging/pohmelfs/netfs.h linux-3.0.4/drivers/staging/pohmelfs/netfs.h
---- linux-3.0.4/drivers/staging/pohmelfs/netfs.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/pohmelfs/netfs.h       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/staging/pohmelfs/netfs.h linux-3.1.3/drivers/staging/pohmelfs/netfs.h
+--- linux-3.1.3/drivers/staging/pohmelfs/netfs.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/pohmelfs/netfs.h       2011-11-16 18:39:07.000000000 -0500
 @@ -571,14 +571,14 @@ struct pohmelfs_config;
  struct pohmelfs_sb {
        struct rb_root          mcache_root;
@@ -32746,9 +35106,9 @@ diff -urNp linux-3.0.4/drivers/staging/pohmelfs/netfs.h linux-3.0.4/drivers/stag
  
        unsigned int            crypto_attached_size;
        unsigned int            crypto_align_size;
-diff -urNp linux-3.0.4/drivers/staging/pohmelfs/trans.c linux-3.0.4/drivers/staging/pohmelfs/trans.c
---- linux-3.0.4/drivers/staging/pohmelfs/trans.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/pohmelfs/trans.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/staging/pohmelfs/trans.c linux-3.1.3/drivers/staging/pohmelfs/trans.c
+--- linux-3.1.3/drivers/staging/pohmelfs/trans.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/pohmelfs/trans.c       2011-11-16 18:39:07.000000000 -0500
 @@ -492,7 +492,7 @@ int netfs_trans_finish(struct netfs_tran
        int err;
        struct netfs_cmd *cmd = t->iovec.iov_base;
@@ -32758,9 +35118,9 @@ diff -urNp linux-3.0.4/drivers/staging/pohmelfs/trans.c linux-3.0.4/drivers/stag
  
        cmd->size = t->iovec.iov_len - sizeof(struct netfs_cmd) +
                t->attached_size + t->attached_pages * sizeof(struct netfs_cmd);
-diff -urNp linux-3.0.4/drivers/staging/rtl8712/rtl871x_io.h linux-3.0.4/drivers/staging/rtl8712/rtl871x_io.h
---- linux-3.0.4/drivers/staging/rtl8712/rtl871x_io.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/rtl8712/rtl871x_io.h   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/staging/rtl8712/rtl871x_io.h linux-3.1.3/drivers/staging/rtl8712/rtl871x_io.h
+--- linux-3.1.3/drivers/staging/rtl8712/rtl871x_io.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/rtl8712/rtl871x_io.h   2011-11-16 18:39:07.000000000 -0500
 @@ -83,7 +83,7 @@ struct       _io_ops {
                          u8 *pmem);
        u32 (*_write_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt,
@@ -32770,9 +35130,9 @@ diff -urNp linux-3.0.4/drivers/staging/rtl8712/rtl871x_io.h linux-3.0.4/drivers/
  
  struct io_req {
        struct list_head list;
-diff -urNp linux-3.0.4/drivers/staging/sbe-2t3e3/netdev.c linux-3.0.4/drivers/staging/sbe-2t3e3/netdev.c
---- linux-3.0.4/drivers/staging/sbe-2t3e3/netdev.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/sbe-2t3e3/netdev.c     2011-08-24 18:21:41.000000000 -0400
+diff -urNp linux-3.1.3/drivers/staging/sbe-2t3e3/netdev.c linux-3.1.3/drivers/staging/sbe-2t3e3/netdev.c
+--- linux-3.1.3/drivers/staging/sbe-2t3e3/netdev.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/sbe-2t3e3/netdev.c     2011-11-16 18:39:08.000000000 -0500
 @@ -51,7 +51,7 @@ int t3e3_ioctl(struct net_device *dev, s
        t3e3_if_config(sc, cmd_2t3e3, (char *)&param, &resp, &rlen);
  
@@ -32782,22 +35142,10 @@ diff -urNp linux-3.0.4/drivers/staging/sbe-2t3e3/netdev.c linux-3.0.4/drivers/st
                        return -EFAULT;
  
        return 0;
-diff -urNp linux-3.0.4/drivers/staging/tty/stallion.c linux-3.0.4/drivers/staging/tty/stallion.c
---- linux-3.0.4/drivers/staging/tty/stallion.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/tty/stallion.c 2011-08-23 21:48:14.000000000 -0400
-@@ -2406,6 +2406,8 @@ static int stl_getportstruct(struct stlp
-       struct stlport  stl_dummyport;
-       struct stlport  *portp;
-+      pax_track_stack();
-+
-       if (copy_from_user(&stl_dummyport, arg, sizeof(struct stlport)))
-               return -EFAULT;
-       portp = stl_getport(stl_dummyport.brdnr, stl_dummyport.panelnr,
-diff -urNp linux-3.0.4/drivers/staging/usbip/usbip_common.h linux-3.0.4/drivers/staging/usbip/usbip_common.h
---- linux-3.0.4/drivers/staging/usbip/usbip_common.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/usbip/usbip_common.h   2011-08-23 21:47:56.000000000 -0400
-@@ -315,7 +315,7 @@ struct usbip_device {
+diff -urNp linux-3.1.3/drivers/staging/usbip/usbip_common.h linux-3.1.3/drivers/staging/usbip/usbip_common.h
+--- linux-3.1.3/drivers/staging/usbip/usbip_common.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/usbip/usbip_common.h   2011-11-16 18:39:08.000000000 -0500
+@@ -289,7 +289,7 @@ struct usbip_device {
                void (*shutdown)(struct usbip_device *);
                void (*reset)(struct usbip_device *);
                void (*unusable)(struct usbip_device *);
@@ -32805,11 +35153,11 @@ diff -urNp linux-3.0.4/drivers/staging/usbip/usbip_common.h linux-3.0.4/drivers/
 +      } __no_const eh_ops;
  };
  
- void usbip_pack_pdu(struct usbip_header *pdu, struct urb *urb, int cmd,
-diff -urNp linux-3.0.4/drivers/staging/usbip/vhci.h linux-3.0.4/drivers/staging/usbip/vhci.h
---- linux-3.0.4/drivers/staging/usbip/vhci.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/usbip/vhci.h   2011-08-23 21:47:56.000000000 -0400
-@@ -94,7 +94,7 @@ struct vhci_hcd {
+ #if 0
+diff -urNp linux-3.1.3/drivers/staging/usbip/vhci.h linux-3.1.3/drivers/staging/usbip/vhci.h
+--- linux-3.1.3/drivers/staging/usbip/vhci.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/usbip/vhci.h   2011-11-16 18:39:08.000000000 -0500
+@@ -85,7 +85,7 @@ struct vhci_hcd {
        unsigned resuming:1;
        unsigned long re_timeout;
  
@@ -32818,10 +35166,10 @@ diff -urNp linux-3.0.4/drivers/staging/usbip/vhci.h linux-3.0.4/drivers/staging/
  
        /*
         * NOTE:
-diff -urNp linux-3.0.4/drivers/staging/usbip/vhci_hcd.c linux-3.0.4/drivers/staging/usbip/vhci_hcd.c
---- linux-3.0.4/drivers/staging/usbip/vhci_hcd.c       2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/staging/usbip/vhci_hcd.c       2011-08-23 21:47:56.000000000 -0400
-@@ -511,7 +511,7 @@ static void vhci_tx_urb(struct urb *urb)
+diff -urNp linux-3.1.3/drivers/staging/usbip/vhci_hcd.c linux-3.1.3/drivers/staging/usbip/vhci_hcd.c
+--- linux-3.1.3/drivers/staging/usbip/vhci_hcd.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/usbip/vhci_hcd.c       2011-11-16 18:39:08.000000000 -0500
+@@ -527,7 +527,7 @@ static void vhci_tx_urb(struct urb *urb)
                return;
        }
  
@@ -32830,7 +35178,7 @@ diff -urNp linux-3.0.4/drivers/staging/usbip/vhci_hcd.c linux-3.0.4/drivers/stag
        if (priv->seqnum == 0xffff)
                dev_info(&urb->dev->dev, "seqnum max\n");
  
-@@ -765,7 +765,7 @@ static int vhci_urb_dequeue(struct usb_h
+@@ -779,7 +779,7 @@ static int vhci_urb_dequeue(struct usb_h
                        return -ENOMEM;
                }
  
@@ -32839,7 +35187,7 @@ diff -urNp linux-3.0.4/drivers/staging/usbip/vhci_hcd.c linux-3.0.4/drivers/stag
                if (unlink->seqnum == 0xffff)
                        pr_info("seqnum max\n");
  
-@@ -955,7 +955,7 @@ static int vhci_start(struct usb_hcd *hc
+@@ -969,7 +969,7 @@ static int vhci_start(struct usb_hcd *hc
                vdev->rhport = rhport;
        }
  
@@ -32848,9 +35196,9 @@ diff -urNp linux-3.0.4/drivers/staging/usbip/vhci_hcd.c linux-3.0.4/drivers/stag
        spin_lock_init(&vhci->lock);
  
        hcd->power_budget = 0; /* no limit */
-diff -urNp linux-3.0.4/drivers/staging/usbip/vhci_rx.c linux-3.0.4/drivers/staging/usbip/vhci_rx.c
---- linux-3.0.4/drivers/staging/usbip/vhci_rx.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/usbip/vhci_rx.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/staging/usbip/vhci_rx.c linux-3.1.3/drivers/staging/usbip/vhci_rx.c
+--- linux-3.1.3/drivers/staging/usbip/vhci_rx.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/usbip/vhci_rx.c        2011-11-16 18:39:08.000000000 -0500
 @@ -76,7 +76,7 @@ static void vhci_recv_ret_submit(struct 
        if (!urb) {
                pr_err("cannot find a urb of seqnum %u\n", pdu->base.seqnum);
@@ -32860,9 +35208,9 @@ diff -urNp linux-3.0.4/drivers/staging/usbip/vhci_rx.c linux-3.0.4/drivers/stagi
                usbip_event_add(ud, VDEV_EVENT_ERROR_TCP);
                return;
        }
-diff -urNp linux-3.0.4/drivers/staging/vt6655/hostap.c linux-3.0.4/drivers/staging/vt6655/hostap.c
---- linux-3.0.4/drivers/staging/vt6655/hostap.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/vt6655/hostap.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/staging/vt6655/hostap.c linux-3.1.3/drivers/staging/vt6655/hostap.c
+--- linux-3.1.3/drivers/staging/vt6655/hostap.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/vt6655/hostap.c        2011-11-16 18:39:08.000000000 -0500
 @@ -79,14 +79,13 @@ static int          msglevel            
   *
   */
@@ -32889,9 +35237,9 @@ diff -urNp linux-3.0.4/drivers/staging/vt6655/hostap.c linux-3.0.4/drivers/stagi
        pDevice->apdev->netdev_ops = &apdev_netdev_ops;
  
        pDevice->apdev->type = ARPHRD_IEEE80211;
-diff -urNp linux-3.0.4/drivers/staging/vt6656/hostap.c linux-3.0.4/drivers/staging/vt6656/hostap.c
---- linux-3.0.4/drivers/staging/vt6656/hostap.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/vt6656/hostap.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/staging/vt6656/hostap.c linux-3.1.3/drivers/staging/vt6656/hostap.c
+--- linux-3.1.3/drivers/staging/vt6656/hostap.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/vt6656/hostap.c        2011-11-16 18:39:08.000000000 -0500
 @@ -80,14 +80,13 @@ static int          msglevel            
   *
   */
@@ -32918,9 +35266,9 @@ diff -urNp linux-3.0.4/drivers/staging/vt6656/hostap.c linux-3.0.4/drivers/stagi
        pDevice->apdev->netdev_ops = &apdev_netdev_ops;
  
        pDevice->apdev->type = ARPHRD_IEEE80211;
-diff -urNp linux-3.0.4/drivers/staging/wlan-ng/hfa384x_usb.c linux-3.0.4/drivers/staging/wlan-ng/hfa384x_usb.c
---- linux-3.0.4/drivers/staging/wlan-ng/hfa384x_usb.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/wlan-ng/hfa384x_usb.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/staging/wlan-ng/hfa384x_usb.c linux-3.1.3/drivers/staging/wlan-ng/hfa384x_usb.c
+--- linux-3.1.3/drivers/staging/wlan-ng/hfa384x_usb.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/wlan-ng/hfa384x_usb.c  2011-11-16 18:39:08.000000000 -0500
 @@ -204,7 +204,7 @@ static void unlocked_usbctlx_complete(hf
  
  struct usbctlx_completor {
@@ -32930,9 +35278,9 @@ diff -urNp linux-3.0.4/drivers/staging/wlan-ng/hfa384x_usb.c linux-3.0.4/drivers
  
  static int
  hfa384x_usbctlx_complete_sync(hfa384x_t *hw,
-diff -urNp linux-3.0.4/drivers/staging/zcache/tmem.c linux-3.0.4/drivers/staging/zcache/tmem.c
---- linux-3.0.4/drivers/staging/zcache/tmem.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/zcache/tmem.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/staging/zcache/tmem.c linux-3.1.3/drivers/staging/zcache/tmem.c
+--- linux-3.1.3/drivers/staging/zcache/tmem.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/zcache/tmem.c  2011-11-16 18:39:08.000000000 -0500
 @@ -39,7 +39,7 @@
   * A tmem host implementation must use this function to register callbacks
   * for memory allocation.
@@ -32951,18 +35299,18 @@ diff -urNp linux-3.0.4/drivers/staging/zcache/tmem.c linux-3.0.4/drivers/staging
  
  void tmem_register_pamops(struct tmem_pamops *m)
  {
-diff -urNp linux-3.0.4/drivers/staging/zcache/tmem.h linux-3.0.4/drivers/staging/zcache/tmem.h
---- linux-3.0.4/drivers/staging/zcache/tmem.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/staging/zcache/tmem.h  2011-08-23 21:47:56.000000000 -0400
-@@ -171,6 +171,7 @@ struct tmem_pamops {
-       int (*get_data)(struct page *, void *, struct tmem_pool *);
-       void (*free)(void *, struct tmem_pool *);
+diff -urNp linux-3.1.3/drivers/staging/zcache/tmem.h linux-3.1.3/drivers/staging/zcache/tmem.h
+--- linux-3.1.3/drivers/staging/zcache/tmem.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/staging/zcache/tmem.h  2011-11-16 18:39:08.000000000 -0500
+@@ -180,6 +180,7 @@ struct tmem_pamops {
+       void (*new_obj)(struct tmem_obj *);
+       int (*replace_in_obj)(void *, struct tmem_obj *);
  };
 +typedef struct tmem_pamops __no_const tmem_pamops_no_const;
  extern void tmem_register_pamops(struct tmem_pamops *m);
  
  /* memory allocation methods provided by the host implementation */
-@@ -180,6 +181,7 @@ struct tmem_hostops {
+@@ -189,6 +190,7 @@ struct tmem_hostops {
        struct tmem_objnode *(*objnode_alloc)(struct tmem_pool *);
        void (*objnode_free)(struct tmem_objnode *, struct tmem_pool *);
  };
@@ -32970,10 +35318,22 @@ diff -urNp linux-3.0.4/drivers/staging/zcache/tmem.h linux-3.0.4/drivers/staging
  extern void tmem_register_hostops(struct tmem_hostops *m);
  
  /* core tmem accessor functions */
-diff -urNp linux-3.0.4/drivers/target/target_core_alua.c linux-3.0.4/drivers/target/target_core_alua.c
---- linux-3.0.4/drivers/target/target_core_alua.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/target/target_core_alua.c      2011-08-23 21:48:14.000000000 -0400
-@@ -675,6 +675,8 @@ static int core_alua_update_tpg_primary_
+diff -urNp linux-3.1.3/drivers/target/iscsi/iscsi_target.c linux-3.1.3/drivers/target/iscsi/iscsi_target.c
+--- linux-3.1.3/drivers/target/iscsi/iscsi_target.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/target/iscsi/iscsi_target.c    2011-11-16 18:39:08.000000000 -0500
+@@ -1368,7 +1368,7 @@ static int iscsit_handle_data_out(struct
+                * outstanding_r2ts reaches zero, go ahead and send the delayed
+                * TASK_ABORTED status.
+                */
+-              if (atomic_read(&se_cmd->t_transport_aborted) != 0) {
++              if (atomic_read_unchecked(&se_cmd->t_transport_aborted) != 0) {
+                       if (hdr->flags & ISCSI_FLAG_CMD_FINAL)
+                               if (--cmd->outstanding_r2ts < 1) {
+                                       iscsit_stop_dataout_timer(cmd);
+diff -urNp linux-3.1.3/drivers/target/target_core_alua.c linux-3.1.3/drivers/target/target_core_alua.c
+--- linux-3.1.3/drivers/target/target_core_alua.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/target/target_core_alua.c      2011-11-16 18:40:29.000000000 -0500
+@@ -723,6 +723,8 @@ static int core_alua_update_tpg_primary_
        char path[ALUA_METADATA_PATH_LEN];
        int len;
  
@@ -32982,7 +35342,7 @@ diff -urNp linux-3.0.4/drivers/target/target_core_alua.c linux-3.0.4/drivers/tar
        memset(path, 0, ALUA_METADATA_PATH_LEN);
  
        len = snprintf(md_buf, tg_pt_gp->tg_pt_gp_md_buf_len,
-@@ -938,6 +940,8 @@ static int core_alua_update_tpg_secondar
+@@ -986,6 +988,8 @@ static int core_alua_update_tpg_secondar
        char path[ALUA_METADATA_PATH_LEN], wwn[ALUA_SECONDARY_METADATA_WWN_LEN];
        int len;
  
@@ -32991,10 +35351,10 @@ diff -urNp linux-3.0.4/drivers/target/target_core_alua.c linux-3.0.4/drivers/tar
        memset(path, 0, ALUA_METADATA_PATH_LEN);
        memset(wwn, 0, ALUA_SECONDARY_METADATA_WWN_LEN);
  
-diff -urNp linux-3.0.4/drivers/target/target_core_cdb.c linux-3.0.4/drivers/target/target_core_cdb.c
---- linux-3.0.4/drivers/target/target_core_cdb.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/target/target_core_cdb.c       2011-08-23 21:48:14.000000000 -0400
-@@ -838,6 +838,8 @@ target_emulate_modesense(struct se_cmd *
+diff -urNp linux-3.1.3/drivers/target/target_core_cdb.c linux-3.1.3/drivers/target/target_core_cdb.c
+--- linux-3.1.3/drivers/target/target_core_cdb.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/target/target_core_cdb.c       2011-11-16 18:40:29.000000000 -0500
+@@ -933,6 +933,8 @@ target_emulate_modesense(struct se_cmd *
        int length = 0;
        unsigned char buf[SE_MODE_PAGE_BUF];
  
@@ -33003,21 +35363,21 @@ diff -urNp linux-3.0.4/drivers/target/target_core_cdb.c linux-3.0.4/drivers/targ
        memset(buf, 0, SE_MODE_PAGE_BUF);
  
        switch (cdb[2] & 0x3f) {
-diff -urNp linux-3.0.4/drivers/target/target_core_configfs.c linux-3.0.4/drivers/target/target_core_configfs.c
---- linux-3.0.4/drivers/target/target_core_configfs.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/target/target_core_configfs.c  2011-08-23 21:48:14.000000000 -0400
-@@ -1276,6 +1276,8 @@ static ssize_t target_core_dev_pr_show_a
+diff -urNp linux-3.1.3/drivers/target/target_core_configfs.c linux-3.1.3/drivers/target/target_core_configfs.c
+--- linux-3.1.3/drivers/target/target_core_configfs.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/target/target_core_configfs.c  2011-11-16 19:04:37.000000000 -0500
+@@ -1267,6 +1267,8 @@ static ssize_t target_core_dev_pr_show_a
        ssize_t len = 0;
        int reg_count = 0, prf_isid;
  
 +      pax_track_stack();
 +
-       if (!(su_dev->se_dev_ptr))
+       if (!su_dev->se_dev_ptr)
                return -ENODEV;
  
-diff -urNp linux-3.0.4/drivers/target/target_core_pr.c linux-3.0.4/drivers/target/target_core_pr.c
---- linux-3.0.4/drivers/target/target_core_pr.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/target/target_core_pr.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/target/target_core_pr.c linux-3.1.3/drivers/target/target_core_pr.c
+--- linux-3.1.3/drivers/target/target_core_pr.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/target/target_core_pr.c        2011-11-16 18:40:29.000000000 -0500
 @@ -918,6 +918,8 @@ static int __core_scsi3_check_aptpl_regi
        unsigned char t_port[PR_APTPL_MAX_TPORT_LEN];
        u16 tpgt;
@@ -33027,7 +35387,7 @@ diff -urNp linux-3.0.4/drivers/target/target_core_pr.c linux-3.0.4/drivers/targe
        memset(i_port, 0, PR_APTPL_MAX_IPORT_LEN);
        memset(t_port, 0, PR_APTPL_MAX_TPORT_LEN);
        /*
-@@ -1861,6 +1863,8 @@ static int __core_scsi3_update_aptpl_buf
+@@ -1867,6 +1869,8 @@ static int __core_scsi3_update_aptpl_buf
        ssize_t len = 0;
        int reg_count = 0;
  
@@ -33036,7 +35396,7 @@ diff -urNp linux-3.0.4/drivers/target/target_core_pr.c linux-3.0.4/drivers/targe
        memset(buf, 0, pr_aptpl_buf_len);
        /*
         * Called to clear metadata once APTPL has been deactivated.
-@@ -1983,6 +1987,8 @@ static int __core_scsi3_write_aptpl_to_f
+@@ -1989,6 +1993,8 @@ static int __core_scsi3_write_aptpl_to_f
        char path[512];
        int ret;
  
@@ -33045,40 +35405,40 @@ diff -urNp linux-3.0.4/drivers/target/target_core_pr.c linux-3.0.4/drivers/targe
        memset(iov, 0, sizeof(struct iovec));
        memset(path, 0, 512);
  
-diff -urNp linux-3.0.4/drivers/target/target_core_tmr.c linux-3.0.4/drivers/target/target_core_tmr.c
---- linux-3.0.4/drivers/target/target_core_tmr.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/target/target_core_tmr.c       2011-08-23 21:47:56.000000000 -0400
-@@ -269,7 +269,7 @@ int core_tmr_lun_reset(
-                       CMD_TFO(cmd)->get_task_tag(cmd), cmd->pr_res_key,
-                       T_TASK(cmd)->t_task_cdbs,
-                       atomic_read(&T_TASK(cmd)->t_task_cdbs_left),
--                      atomic_read(&T_TASK(cmd)->t_task_cdbs_sent),
-+                      atomic_read_unchecked(&T_TASK(cmd)->t_task_cdbs_sent),
-                       atomic_read(&T_TASK(cmd)->t_transport_active),
-                       atomic_read(&T_TASK(cmd)->t_transport_stop),
-                       atomic_read(&T_TASK(cmd)->t_transport_sent));
-@@ -311,7 +311,7 @@ int core_tmr_lun_reset(
-                       DEBUG_LR("LUN_RESET: got t_transport_active = 1 for"
+diff -urNp linux-3.1.3/drivers/target/target_core_tmr.c linux-3.1.3/drivers/target/target_core_tmr.c
+--- linux-3.1.3/drivers/target/target_core_tmr.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/target/target_core_tmr.c       2011-11-16 18:39:08.000000000 -0500
+@@ -255,7 +255,7 @@ static void core_tmr_drain_task_list(
+                       cmd->se_tfo->get_task_tag(cmd), cmd->pr_res_key,
+                       cmd->t_task_list_num,
+                       atomic_read(&cmd->t_task_cdbs_left),
+-                      atomic_read(&cmd->t_task_cdbs_sent),
++                      atomic_read_unchecked(&cmd->t_task_cdbs_sent),
+                       atomic_read(&cmd->t_transport_active),
+                       atomic_read(&cmd->t_transport_stop),
+                       atomic_read(&cmd->t_transport_sent));
+@@ -291,7 +291,7 @@ static void core_tmr_drain_task_list(
+                       pr_debug("LUN_RESET: got t_transport_active = 1 for"
                                " task: %p, t_fe_count: %d dev: %p\n", task,
                                fe_count, dev);
--                      atomic_set(&T_TASK(cmd)->t_transport_aborted, 1);
-+                      atomic_set_unchecked(&T_TASK(cmd)->t_transport_aborted, 1);
-                       spin_unlock_irqrestore(&T_TASK(cmd)->t_state_lock,
-                                               flags);
+-                      atomic_set(&cmd->t_transport_aborted, 1);
++                      atomic_set_unchecked(&cmd->t_transport_aborted, 1);
+                       spin_unlock_irqrestore(&cmd->t_state_lock, flags);
                        core_tmr_handle_tas_abort(tmr_nacl, cmd, tas, fe_count);
-@@ -321,7 +321,7 @@ int core_tmr_lun_reset(
+@@ -299,7 +299,7 @@ static void core_tmr_drain_task_list(
                }
-               DEBUG_LR("LUN_RESET: Got t_transport_active = 0 for task: %p,"
+               pr_debug("LUN_RESET: Got t_transport_active = 0 for task: %p,"
                        " t_fe_count: %d dev: %p\n", task, fe_count, dev);
--              atomic_set(&T_TASK(cmd)->t_transport_aborted, 1);
-+              atomic_set_unchecked(&T_TASK(cmd)->t_transport_aborted, 1);
-               spin_unlock_irqrestore(&T_TASK(cmd)->t_state_lock, flags);
-               core_tmr_handle_tas_abort(tmr_nacl, cmd, tas, fe_count);
+-              atomic_set(&cmd->t_transport_aborted, 1);
++              atomic_set_unchecked(&cmd->t_transport_aborted, 1);
+               spin_unlock_irqrestore(&cmd->t_state_lock, flags);
  
-diff -urNp linux-3.0.4/drivers/target/target_core_transport.c linux-3.0.4/drivers/target/target_core_transport.c
---- linux-3.0.4/drivers/target/target_core_transport.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/target/target_core_transport.c 2011-08-23 21:47:56.000000000 -0400
-@@ -1681,7 +1681,7 @@ struct se_device *transport_add_device_t
+               core_tmr_handle_tas_abort(tmr_nacl, cmd, tas, fe_count);
+diff -urNp linux-3.1.3/drivers/target/target_core_transport.c linux-3.1.3/drivers/target/target_core_transport.c
+--- linux-3.1.3/drivers/target/target_core_transport.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/target/target_core_transport.c 2011-11-16 18:39:08.000000000 -0500
+@@ -1445,7 +1445,7 @@ struct se_device *transport_add_device_t
  
        dev->queue_depth        = dev_limits->queue_depth;
        atomic_set(&dev->depth_left, dev->queue_depth);
@@ -33087,75 +35447,75 @@ diff -urNp linux-3.0.4/drivers/target/target_core_transport.c linux-3.0.4/driver
  
        se_dev_set_default_attribs(dev, dev_limits);
  
-@@ -1882,7 +1882,7 @@ static int transport_check_alloc_task_at
+@@ -1633,7 +1633,7 @@ static int transport_check_alloc_task_at
         * Used to determine when ORDERED commands should go from
         * Dormant to Active status.
         */
--      cmd->se_ordered_id = atomic_inc_return(&SE_DEV(cmd)->dev_ordered_id);
-+      cmd->se_ordered_id = atomic_inc_return_unchecked(&SE_DEV(cmd)->dev_ordered_id);
+-      cmd->se_ordered_id = atomic_inc_return(&cmd->se_dev->dev_ordered_id);
++      cmd->se_ordered_id = atomic_inc_return_unchecked(&cmd->se_dev->dev_ordered_id);
        smp_mb__after_atomic_inc();
-       DEBUG_STA("Allocated se_ordered_id: %u for Task Attr: 0x%02x on %s\n",
+       pr_debug("Allocated se_ordered_id: %u for Task Attr: 0x%02x on %s\n",
                        cmd->se_ordered_id, cmd->sam_task_attr,
-@@ -2169,7 +2169,7 @@ static void transport_generic_request_fa
+@@ -1960,7 +1960,7 @@ static void transport_generic_request_fa
                " t_transport_active: %d t_transport_stop: %d"
-               " t_transport_sent: %d\n", T_TASK(cmd)->t_task_cdbs,
-               atomic_read(&T_TASK(cmd)->t_task_cdbs_left),
--              atomic_read(&T_TASK(cmd)->t_task_cdbs_sent),
-+              atomic_read_unchecked(&T_TASK(cmd)->t_task_cdbs_sent),
-               atomic_read(&T_TASK(cmd)->t_task_cdbs_ex_left),
-               atomic_read(&T_TASK(cmd)->t_transport_active),
-               atomic_read(&T_TASK(cmd)->t_transport_stop),
-@@ -2673,9 +2673,9 @@ check_depth:
-       spin_lock_irqsave(&T_TASK(cmd)->t_state_lock, flags);
+               " t_transport_sent: %d\n", cmd->t_task_list_num,
+               atomic_read(&cmd->t_task_cdbs_left),
+-              atomic_read(&cmd->t_task_cdbs_sent),
++              atomic_read_unchecked(&cmd->t_task_cdbs_sent),
+               atomic_read(&cmd->t_task_cdbs_ex_left),
+               atomic_read(&cmd->t_transport_active),
+               atomic_read(&cmd->t_transport_stop),
+@@ -2460,9 +2460,9 @@ check_depth:
+       spin_lock_irqsave(&cmd->t_state_lock, flags);
        atomic_set(&task->task_active, 1);
        atomic_set(&task->task_sent, 1);
--      atomic_inc(&T_TASK(cmd)->t_task_cdbs_sent);
-+      atomic_inc_unchecked(&T_TASK(cmd)->t_task_cdbs_sent);
+-      atomic_inc(&cmd->t_task_cdbs_sent);
++      atomic_inc_unchecked(&cmd->t_task_cdbs_sent);
  
--      if (atomic_read(&T_TASK(cmd)->t_task_cdbs_sent) ==
-+      if (atomic_read_unchecked(&T_TASK(cmd)->t_task_cdbs_sent) ==
-           T_TASK(cmd)->t_task_cdbs)
+-      if (atomic_read(&cmd->t_task_cdbs_sent) ==
++      if (atomic_read_unchecked(&cmd->t_task_cdbs_sent) ==
+           cmd->t_task_list_num)
                atomic_set(&cmd->transport_sent, 1);
  
-@@ -5568,7 +5568,7 @@ static void transport_generic_wait_for_t
-               atomic_set(&T_TASK(cmd)->transport_lun_stop, 0);
+@@ -4665,7 +4665,7 @@ static void transport_generic_wait_for_t
+               atomic_set(&cmd->transport_lun_stop, 0);
        }
-       if (!atomic_read(&T_TASK(cmd)->t_transport_active) ||
--           atomic_read(&T_TASK(cmd)->t_transport_aborted))
-+           atomic_read_unchecked(&T_TASK(cmd)->t_transport_aborted))
+       if (!atomic_read(&cmd->t_transport_active) ||
+-           atomic_read(&cmd->t_transport_aborted))
++           atomic_read_unchecked(&cmd->t_transport_aborted))
                goto remove;
  
-       atomic_set(&T_TASK(cmd)->t_transport_stop, 1);
-@@ -5797,7 +5797,7 @@ int transport_check_aborted_status(struc
+       atomic_set(&cmd->t_transport_stop, 1);
+@@ -4900,7 +4900,7 @@ int transport_check_aborted_status(struc
  {
        int ret = 0;
  
--      if (atomic_read(&T_TASK(cmd)->t_transport_aborted) != 0) {
-+      if (atomic_read_unchecked(&T_TASK(cmd)->t_transport_aborted) != 0) {
-               if (!(send_status) ||
+-      if (atomic_read(&cmd->t_transport_aborted) != 0) {
++      if (atomic_read_unchecked(&cmd->t_transport_aborted) != 0) {
+               if (!send_status ||
                     (cmd->se_cmd_flags & SCF_SENT_DELAYED_TAS))
                        return 1;
-@@ -5825,7 +5825,7 @@ void transport_send_task_abort(struct se
+@@ -4937,7 +4937,7 @@ void transport_send_task_abort(struct se
         */
        if (cmd->data_direction == DMA_TO_DEVICE) {
-               if (CMD_TFO(cmd)->write_pending_status(cmd) != 0) {
--                      atomic_inc(&T_TASK(cmd)->t_transport_aborted);
-+                      atomic_inc_unchecked(&T_TASK(cmd)->t_transport_aborted);
+               if (cmd->se_tfo->write_pending_status(cmd) != 0) {
+-                      atomic_inc(&cmd->t_transport_aborted);
++                      atomic_inc_unchecked(&cmd->t_transport_aborted);
                        smp_mb__after_atomic_inc();
                        cmd->scsi_status = SAM_STAT_TASK_ABORTED;
                        transport_new_cmd_failure(cmd);
-@@ -5949,7 +5949,7 @@ static void transport_processing_shutdow
-                       CMD_TFO(cmd)->get_task_tag(cmd),
-                       T_TASK(cmd)->t_task_cdbs,
-                       atomic_read(&T_TASK(cmd)->t_task_cdbs_left),
--                      atomic_read(&T_TASK(cmd)->t_task_cdbs_sent),
-+                      atomic_read_unchecked(&T_TASK(cmd)->t_task_cdbs_sent),
-                       atomic_read(&T_TASK(cmd)->t_transport_active),
-                       atomic_read(&T_TASK(cmd)->t_transport_stop),
-                       atomic_read(&T_TASK(cmd)->t_transport_sent));
-diff -urNp linux-3.0.4/drivers/telephony/ixj.c linux-3.0.4/drivers/telephony/ixj.c
---- linux-3.0.4/drivers/telephony/ixj.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/telephony/ixj.c        2011-08-23 21:48:14.000000000 -0400
+@@ -5051,7 +5051,7 @@ static void transport_processing_shutdow
+                       cmd->se_tfo->get_task_tag(cmd),
+                       cmd->t_task_list_num,
+                       atomic_read(&cmd->t_task_cdbs_left),
+-                      atomic_read(&cmd->t_task_cdbs_sent),
++                      atomic_read_unchecked(&cmd->t_task_cdbs_sent),
+                       atomic_read(&cmd->t_transport_active),
+                       atomic_read(&cmd->t_transport_stop),
+                       atomic_read(&cmd->t_transport_sent));
+diff -urNp linux-3.1.3/drivers/telephony/ixj.c linux-3.1.3/drivers/telephony/ixj.c
+--- linux-3.1.3/drivers/telephony/ixj.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/telephony/ixj.c        2011-11-16 18:40:29.000000000 -0500
 @@ -4976,6 +4976,8 @@ static int ixj_daa_cid_read(IXJ *j)
        bool mContinue;
        char *pIn, *pOut;
@@ -33165,9 +35525,9 @@ diff -urNp linux-3.0.4/drivers/telephony/ixj.c linux-3.0.4/drivers/telephony/ixj
        if (!SCI_Prepare(j))
                return 0;
  
-diff -urNp linux-3.0.4/drivers/tty/hvc/hvcs.c linux-3.0.4/drivers/tty/hvc/hvcs.c
---- linux-3.0.4/drivers/tty/hvc/hvcs.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/tty/hvc/hvcs.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/tty/hvc/hvcs.c linux-3.1.3/drivers/tty/hvc/hvcs.c
+--- linux-3.1.3/drivers/tty/hvc/hvcs.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/tty/hvc/hvcs.c 2011-11-16 18:39:08.000000000 -0500
 @@ -83,6 +83,7 @@
  #include <asm/hvcserver.h>
  #include <asm/uaccess.h>
@@ -33270,9 +35630,9 @@ diff -urNp linux-3.0.4/drivers/tty/hvc/hvcs.c linux-3.0.4/drivers/tty/hvc/hvcs.c
                return 0;
  
        return HVCS_BUFF_LEN - hvcsd->chars_in_buffer;
-diff -urNp linux-3.0.4/drivers/tty/ipwireless/tty.c linux-3.0.4/drivers/tty/ipwireless/tty.c
---- linux-3.0.4/drivers/tty/ipwireless/tty.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/tty/ipwireless/tty.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/tty/ipwireless/tty.c linux-3.1.3/drivers/tty/ipwireless/tty.c
+--- linux-3.1.3/drivers/tty/ipwireless/tty.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/tty/ipwireless/tty.c   2011-11-16 18:39:08.000000000 -0500
 @@ -29,6 +29,7 @@
  #include <linux/tty_driver.h>
  #include <linux/tty_flip.h>
@@ -33395,21 +35755,21 @@ diff -urNp linux-3.0.4/drivers/tty/ipwireless/tty.c linux-3.0.4/drivers/tty/ipwi
                                do_ipw_close(ttyj);
                        ipwireless_disassociate_network_ttys(network,
                                                             ttyj->channel_idx);
-diff -urNp linux-3.0.4/drivers/tty/n_gsm.c linux-3.0.4/drivers/tty/n_gsm.c
---- linux-3.0.4/drivers/tty/n_gsm.c    2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/drivers/tty/n_gsm.c    2011-08-23 21:47:56.000000000 -0400
-@@ -1589,7 +1589,7 @@ static struct gsm_dlci *gsm_dlci_alloc(s
-               return NULL;
-       spin_lock_init(&dlci->lock);
+diff -urNp linux-3.1.3/drivers/tty/n_gsm.c linux-3.1.3/drivers/tty/n_gsm.c
+--- linux-3.1.3/drivers/tty/n_gsm.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/tty/n_gsm.c    2011-11-16 18:39:08.000000000 -0500
+@@ -1625,7 +1625,7 @@ static struct gsm_dlci *gsm_dlci_alloc(s
+       kref_init(&dlci->ref);
+       mutex_init(&dlci->mutex);
        dlci->fifo = &dlci->_fifo;
 -      if (kfifo_alloc(&dlci->_fifo, 4096, GFP_KERNEL) < 0) {
 +      if (kfifo_alloc(&dlci->_fifo, 4096, GFP_KERNEL)) {
                kfree(dlci);
                return NULL;
        }
-diff -urNp linux-3.0.4/drivers/tty/n_tty.c linux-3.0.4/drivers/tty/n_tty.c
---- linux-3.0.4/drivers/tty/n_tty.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/tty/n_tty.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/tty/n_tty.c linux-3.1.3/drivers/tty/n_tty.c
+--- linux-3.1.3/drivers/tty/n_tty.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/tty/n_tty.c    2011-11-16 18:39:08.000000000 -0500
 @@ -2123,6 +2123,7 @@ void n_tty_inherit_ops(struct tty_ldisc_
  {
        *ops = tty_ldisc_N_TTY;
@@ -33419,10 +35779,10 @@ diff -urNp linux-3.0.4/drivers/tty/n_tty.c linux-3.0.4/drivers/tty/n_tty.c
 +      ops->flags = 0;
  }
  EXPORT_SYMBOL_GPL(n_tty_inherit_ops);
-diff -urNp linux-3.0.4/drivers/tty/pty.c linux-3.0.4/drivers/tty/pty.c
---- linux-3.0.4/drivers/tty/pty.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/tty/pty.c      2011-08-23 21:47:56.000000000 -0400
-@@ -754,8 +754,10 @@ static void __init unix98_pty_init(void)
+diff -urNp linux-3.1.3/drivers/tty/pty.c linux-3.1.3/drivers/tty/pty.c
+--- linux-3.1.3/drivers/tty/pty.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/tty/pty.c      2011-11-16 18:39:08.000000000 -0500
+@@ -773,8 +773,10 @@ static void __init unix98_pty_init(void)
        register_sysctl_table(pty_root_table);
  
        /* Now create the /dev/ptmx special device */
@@ -33434,9 +35794,9 @@ diff -urNp linux-3.0.4/drivers/tty/pty.c linux-3.0.4/drivers/tty/pty.c
  
        cdev_init(&ptmx_cdev, &ptmx_fops);
        if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) ||
-diff -urNp linux-3.0.4/drivers/tty/rocket.c linux-3.0.4/drivers/tty/rocket.c
---- linux-3.0.4/drivers/tty/rocket.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/tty/rocket.c   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/tty/rocket.c linux-3.1.3/drivers/tty/rocket.c
+--- linux-3.1.3/drivers/tty/rocket.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/tty/rocket.c   2011-11-16 18:40:29.000000000 -0500
 @@ -1277,6 +1277,8 @@ static int get_ports(struct r_port *info
        struct rocket_ports tmp;
        int board;
@@ -33446,9 +35806,9 @@ diff -urNp linux-3.0.4/drivers/tty/rocket.c linux-3.0.4/drivers/tty/rocket.c
        if (!retports)
                return -EFAULT;
        memset(&tmp, 0, sizeof (tmp));
-diff -urNp linux-3.0.4/drivers/tty/serial/kgdboc.c linux-3.0.4/drivers/tty/serial/kgdboc.c
---- linux-3.0.4/drivers/tty/serial/kgdboc.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/tty/serial/kgdboc.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/tty/serial/kgdboc.c linux-3.1.3/drivers/tty/serial/kgdboc.c
+--- linux-3.1.3/drivers/tty/serial/kgdboc.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/tty/serial/kgdboc.c    2011-11-16 18:39:08.000000000 -0500
 @@ -23,8 +23,9 @@
  #define MAX_CONFIG_LEN                40
  
@@ -33547,9 +35907,21 @@ diff -urNp linux-3.0.4/drivers/tty/serial/kgdboc.c linux-3.0.4/drivers/tty/seria
  #ifdef CONFIG_KGDB_SERIAL_CONSOLE
  /* This is only available if kgdboc is a built in for early debugging */
  static int __init kgdboc_early_init(char *opt)
-diff -urNp linux-3.0.4/drivers/tty/serial/mrst_max3110.c linux-3.0.4/drivers/tty/serial/mrst_max3110.c
---- linux-3.0.4/drivers/tty/serial/mrst_max3110.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/tty/serial/mrst_max3110.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/tty/serial/mfd.c linux-3.1.3/drivers/tty/serial/mfd.c
+--- linux-3.1.3/drivers/tty/serial/mfd.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/tty/serial/mfd.c       2011-11-16 18:39:08.000000000 -0500
+@@ -1423,7 +1423,7 @@ static void serial_hsu_remove(struct pci
+ }
+ /* First 3 are UART ports, and the 4th is the DMA */
+-static const struct pci_device_id pci_ids[] __devinitdata = {
++static const struct pci_device_id pci_ids[] __devinitconst = {
+       { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x081B) },
+       { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x081C) },
+       { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x081D) },
+diff -urNp linux-3.1.3/drivers/tty/serial/mrst_max3110.c linux-3.1.3/drivers/tty/serial/mrst_max3110.c
+--- linux-3.1.3/drivers/tty/serial/mrst_max3110.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/tty/serial/mrst_max3110.c      2011-11-16 18:40:29.000000000 -0500
 @@ -393,6 +393,8 @@ static void max3110_con_receive(struct u
        int loop = 1, num, total = 0;
        u8 recv_buf[512], *pbuf;
@@ -33559,10 +35931,10 @@ diff -urNp linux-3.0.4/drivers/tty/serial/mrst_max3110.c linux-3.0.4/drivers/tty
        pbuf = recv_buf;
        do {
                num = max3110_read_multi(max, pbuf);
-diff -urNp linux-3.0.4/drivers/tty/tty_io.c linux-3.0.4/drivers/tty/tty_io.c
---- linux-3.0.4/drivers/tty/tty_io.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/tty/tty_io.c   2011-08-23 21:47:56.000000000 -0400
-@@ -3215,7 +3215,7 @@ EXPORT_SYMBOL_GPL(get_current_tty);
+diff -urNp linux-3.1.3/drivers/tty/tty_io.c linux-3.1.3/drivers/tty/tty_io.c
+--- linux-3.1.3/drivers/tty/tty_io.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/tty/tty_io.c   2011-11-16 18:39:08.000000000 -0500
+@@ -3238,7 +3238,7 @@ EXPORT_SYMBOL_GPL(get_current_tty);
  
  void tty_default_fops(struct file_operations *fops)
  {
@@ -33571,10 +35943,10 @@ diff -urNp linux-3.0.4/drivers/tty/tty_io.c linux-3.0.4/drivers/tty/tty_io.c
  }
  
  /*
-diff -urNp linux-3.0.4/drivers/tty/tty_ldisc.c linux-3.0.4/drivers/tty/tty_ldisc.c
---- linux-3.0.4/drivers/tty/tty_ldisc.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/tty/tty_ldisc.c        2011-08-23 21:47:56.000000000 -0400
-@@ -74,7 +74,7 @@ static void put_ldisc(struct tty_ldisc *
+diff -urNp linux-3.1.3/drivers/tty/tty_ldisc.c linux-3.1.3/drivers/tty/tty_ldisc.c
+--- linux-3.1.3/drivers/tty/tty_ldisc.c        2011-11-26 19:57:29.000000000 -0500
++++ linux-3.1.3/drivers/tty/tty_ldisc.c        2011-11-26 20:00:43.000000000 -0500
+@@ -75,7 +75,7 @@ static void put_ldisc(struct tty_ldisc *
        if (atomic_dec_and_lock(&ld->users, &tty_ldisc_lock)) {
                struct tty_ldisc_ops *ldo = ld->ops;
  
@@ -33583,7 +35955,7 @@ diff -urNp linux-3.0.4/drivers/tty/tty_ldisc.c linux-3.0.4/drivers/tty/tty_ldisc
                module_put(ldo->owner);
                spin_unlock_irqrestore(&tty_ldisc_lock, flags);
  
-@@ -109,7 +109,7 @@ int tty_register_ldisc(int disc, struct 
+@@ -110,7 +110,7 @@ int tty_register_ldisc(int disc, struct 
        spin_lock_irqsave(&tty_ldisc_lock, flags);
        tty_ldiscs[disc] = new_ldisc;
        new_ldisc->num = disc;
@@ -33592,7 +35964,7 @@ diff -urNp linux-3.0.4/drivers/tty/tty_ldisc.c linux-3.0.4/drivers/tty/tty_ldisc
        spin_unlock_irqrestore(&tty_ldisc_lock, flags);
  
        return ret;
-@@ -137,7 +137,7 @@ int tty_unregister_ldisc(int disc)
+@@ -138,7 +138,7 @@ int tty_unregister_ldisc(int disc)
                return -EINVAL;
  
        spin_lock_irqsave(&tty_ldisc_lock, flags);
@@ -33601,7 +35973,7 @@ diff -urNp linux-3.0.4/drivers/tty/tty_ldisc.c linux-3.0.4/drivers/tty/tty_ldisc
                ret = -EBUSY;
        else
                tty_ldiscs[disc] = NULL;
-@@ -158,7 +158,7 @@ static struct tty_ldisc_ops *get_ldops(i
+@@ -159,7 +159,7 @@ static struct tty_ldisc_ops *get_ldops(i
        if (ldops) {
                ret = ERR_PTR(-EAGAIN);
                if (try_module_get(ldops->owner)) {
@@ -33610,7 +35982,7 @@ diff -urNp linux-3.0.4/drivers/tty/tty_ldisc.c linux-3.0.4/drivers/tty/tty_ldisc
                        ret = ldops;
                }
        }
-@@ -171,7 +171,7 @@ static void put_ldops(struct tty_ldisc_o
+@@ -172,7 +172,7 @@ static void put_ldops(struct tty_ldisc_o
        unsigned long flags;
  
        spin_lock_irqsave(&tty_ldisc_lock, flags);
@@ -33619,9 +35991,9 @@ diff -urNp linux-3.0.4/drivers/tty/tty_ldisc.c linux-3.0.4/drivers/tty/tty_ldisc
        module_put(ldops->owner);
        spin_unlock_irqrestore(&tty_ldisc_lock, flags);
  }
-diff -urNp linux-3.0.4/drivers/tty/vt/keyboard.c linux-3.0.4/drivers/tty/vt/keyboard.c
---- linux-3.0.4/drivers/tty/vt/keyboard.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/tty/vt/keyboard.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/tty/vt/keyboard.c linux-3.1.3/drivers/tty/vt/keyboard.c
+--- linux-3.1.3/drivers/tty/vt/keyboard.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/tty/vt/keyboard.c      2011-11-16 18:40:29.000000000 -0500
 @@ -656,6 +656,16 @@ static void k_spec(struct vc_data *vc, u
             kbd->kbdmode == VC_OFF) &&
             value != KVAL(K_SAK))
@@ -33639,9 +36011,9 @@ diff -urNp linux-3.0.4/drivers/tty/vt/keyboard.c linux-3.0.4/drivers/tty/vt/keyb
        fn_handler[value](vc);
  }
  
-diff -urNp linux-3.0.4/drivers/tty/vt/vt.c linux-3.0.4/drivers/tty/vt/vt.c
---- linux-3.0.4/drivers/tty/vt/vt.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/tty/vt/vt.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/tty/vt/vt.c linux-3.1.3/drivers/tty/vt/vt.c
+--- linux-3.1.3/drivers/tty/vt/vt.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/tty/vt/vt.c    2011-11-16 18:39:08.000000000 -0500
 @@ -259,7 +259,7 @@ EXPORT_SYMBOL_GPL(unregister_vt_notifier
  
  static void notify_write(struct vc_data *vc, unsigned int unicode)
@@ -33651,9 +36023,9 @@ diff -urNp linux-3.0.4/drivers/tty/vt/vt.c linux-3.0.4/drivers/tty/vt/vt.c
        atomic_notifier_call_chain(&vt_notifier_list, VT_WRITE, &param);
  }
  
-diff -urNp linux-3.0.4/drivers/tty/vt/vt_ioctl.c linux-3.0.4/drivers/tty/vt/vt_ioctl.c
---- linux-3.0.4/drivers/tty/vt/vt_ioctl.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/tty/vt/vt_ioctl.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/tty/vt/vt_ioctl.c linux-3.1.3/drivers/tty/vt/vt_ioctl.c
+--- linux-3.1.3/drivers/tty/vt/vt_ioctl.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/tty/vt/vt_ioctl.c      2011-11-16 18:40:29.000000000 -0500
 @@ -207,9 +207,6 @@ do_kdsk_ioctl(int cmd, struct kbentry __
        if (copy_from_user(&tmp, user_kbe, sizeof(struct kbentry)))
                return -EFAULT;
@@ -33694,9 +36066,9 @@ diff -urNp linux-3.0.4/drivers/tty/vt/vt_ioctl.c linux-3.0.4/drivers/tty/vt/vt_i
                if (!perm) {
                        ret = -EPERM;
                        goto reterr;
-diff -urNp linux-3.0.4/drivers/uio/uio.c linux-3.0.4/drivers/uio/uio.c
---- linux-3.0.4/drivers/uio/uio.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/uio/uio.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/uio/uio.c linux-3.1.3/drivers/uio/uio.c
+--- linux-3.1.3/drivers/uio/uio.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/uio/uio.c      2011-11-16 18:39:08.000000000 -0500
 @@ -25,6 +25,7 @@
  #include <linux/kobject.h>
  #include <linux/cdev.h>
@@ -33788,9 +36160,9 @@ diff -urNp linux-3.0.4/drivers/uio/uio.c linux-3.0.4/drivers/uio/uio.c
  
        ret = uio_get_minor(idev);
        if (ret)
-diff -urNp linux-3.0.4/drivers/usb/atm/cxacru.c linux-3.0.4/drivers/usb/atm/cxacru.c
---- linux-3.0.4/drivers/usb/atm/cxacru.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/usb/atm/cxacru.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/usb/atm/cxacru.c linux-3.1.3/drivers/usb/atm/cxacru.c
+--- linux-3.1.3/drivers/usb/atm/cxacru.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/usb/atm/cxacru.c       2011-11-16 18:39:08.000000000 -0500
 @@ -473,7 +473,7 @@ static ssize_t cxacru_sysfs_store_adsl_c
                ret = sscanf(buf + pos, "%x=%x%n", &index, &value, &tmp);
                if (ret < 2)
@@ -33800,10 +36172,10 @@ diff -urNp linux-3.0.4/drivers/usb/atm/cxacru.c linux-3.0.4/drivers/usb/atm/cxac
                        return -EINVAL;
                pos += tmp;
  
-diff -urNp linux-3.0.4/drivers/usb/atm/usbatm.c linux-3.0.4/drivers/usb/atm/usbatm.c
---- linux-3.0.4/drivers/usb/atm/usbatm.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/usb/atm/usbatm.c       2011-08-23 21:47:56.000000000 -0400
-@@ -332,7 +332,7 @@ static void usbatm_extract_one_cell(stru
+diff -urNp linux-3.1.3/drivers/usb/atm/usbatm.c linux-3.1.3/drivers/usb/atm/usbatm.c
+--- linux-3.1.3/drivers/usb/atm/usbatm.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/usb/atm/usbatm.c       2011-11-16 18:39:08.000000000 -0500
+@@ -333,7 +333,7 @@ static void usbatm_extract_one_cell(stru
                if (printk_ratelimit())
                        atm_warn(instance, "%s: OAM not supported (vpi %d, vci %d)!\n",
                                __func__, vpi, vci);
@@ -33812,7 +36184,7 @@ diff -urNp linux-3.0.4/drivers/usb/atm/usbatm.c linux-3.0.4/drivers/usb/atm/usba
                return;
        }
  
-@@ -360,7 +360,7 @@ static void usbatm_extract_one_cell(stru
+@@ -361,7 +361,7 @@ static void usbatm_extract_one_cell(stru
                if (length > ATM_MAX_AAL5_PDU) {
                        atm_rldbg(instance, "%s: bogus length %u (vcc: 0x%p)!\n",
                                  __func__, length, vcc);
@@ -33821,7 +36193,7 @@ diff -urNp linux-3.0.4/drivers/usb/atm/usbatm.c linux-3.0.4/drivers/usb/atm/usba
                        goto out;
                }
  
-@@ -369,14 +369,14 @@ static void usbatm_extract_one_cell(stru
+@@ -370,14 +370,14 @@ static void usbatm_extract_one_cell(stru
                if (sarb->len < pdu_length) {
                        atm_rldbg(instance, "%s: bogus pdu_length %u (sarb->len: %u, vcc: 0x%p)!\n",
                                  __func__, pdu_length, sarb->len, vcc);
@@ -33838,7 +36210,7 @@ diff -urNp linux-3.0.4/drivers/usb/atm/usbatm.c linux-3.0.4/drivers/usb/atm/usba
                        goto out;
                }
  
-@@ -386,7 +386,7 @@ static void usbatm_extract_one_cell(stru
+@@ -387,7 +387,7 @@ static void usbatm_extract_one_cell(stru
                        if (printk_ratelimit())
                                atm_err(instance, "%s: no memory for skb (length: %u)!\n",
                                        __func__, length);
@@ -33847,7 +36219,7 @@ diff -urNp linux-3.0.4/drivers/usb/atm/usbatm.c linux-3.0.4/drivers/usb/atm/usba
                        goto out;
                }
  
-@@ -411,7 +411,7 @@ static void usbatm_extract_one_cell(stru
+@@ -412,7 +412,7 @@ static void usbatm_extract_one_cell(stru
  
                vcc->push(vcc, skb);
  
@@ -33856,7 +36228,7 @@ diff -urNp linux-3.0.4/drivers/usb/atm/usbatm.c linux-3.0.4/drivers/usb/atm/usba
        out:
                skb_trim(sarb, 0);
        }
-@@ -614,7 +614,7 @@ static void usbatm_tx_process(unsigned l
+@@ -615,7 +615,7 @@ static void usbatm_tx_process(unsigned l
                        struct atm_vcc *vcc = UDSL_SKB(skb)->atm.vcc;
  
                        usbatm_pop(vcc, skb);
@@ -33882,9 +36254,9 @@ diff -urNp linux-3.0.4/drivers/usb/atm/usbatm.c linux-3.0.4/drivers/usb/atm/usba
  
        if (!left--) {
                if (instance->disconnected)
-diff -urNp linux-3.0.4/drivers/usb/core/devices.c linux-3.0.4/drivers/usb/core/devices.c
---- linux-3.0.4/drivers/usb/core/devices.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/usb/core/devices.c     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/usb/core/devices.c linux-3.1.3/drivers/usb/core/devices.c
+--- linux-3.1.3/drivers/usb/core/devices.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/usb/core/devices.c     2011-11-16 18:39:08.000000000 -0500
 @@ -126,7 +126,7 @@ static const char format_endpt[] =
   * time it gets called.
   */
@@ -33912,9 +36284,9 @@ diff -urNp linux-3.0.4/drivers/usb/core/devices.c linux-3.0.4/drivers/usb/core/d
        if (file->f_version != event_count) {
                file->f_version = event_count;
                return POLLIN | POLLRDNORM;
-diff -urNp linux-3.0.4/drivers/usb/core/message.c linux-3.0.4/drivers/usb/core/message.c
---- linux-3.0.4/drivers/usb/core/message.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/usb/core/message.c     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/usb/core/message.c linux-3.1.3/drivers/usb/core/message.c
+--- linux-3.1.3/drivers/usb/core/message.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/usb/core/message.c     2011-11-16 18:39:08.000000000 -0500
 @@ -869,8 +869,8 @@ char *usb_cache_string(struct usb_device
        buf = kmalloc(MAX_USB_STRING_SIZE, GFP_NOIO);
        if (buf) {
@@ -33926,9 +36298,9 @@ diff -urNp linux-3.0.4/drivers/usb/core/message.c linux-3.0.4/drivers/usb/core/m
                        if (!smallbuf)
                                return buf;
                        memcpy(smallbuf, buf, len);
-diff -urNp linux-3.0.4/drivers/usb/early/ehci-dbgp.c linux-3.0.4/drivers/usb/early/ehci-dbgp.c
---- linux-3.0.4/drivers/usb/early/ehci-dbgp.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/usb/early/ehci-dbgp.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/usb/early/ehci-dbgp.c linux-3.1.3/drivers/usb/early/ehci-dbgp.c
+--- linux-3.1.3/drivers/usb/early/ehci-dbgp.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/usb/early/ehci-dbgp.c  2011-11-16 18:39:08.000000000 -0500
 @@ -97,7 +97,8 @@ static inline u32 dbgp_len_update(u32 x,
  
  #ifdef CONFIG_KGDB
@@ -33966,9 +36338,9 @@ diff -urNp linux-3.0.4/drivers/usb/early/ehci-dbgp.c linux-3.0.4/drivers/usb/ear
  
        return 0;
  }
-diff -urNp linux-3.0.4/drivers/usb/host/xhci-mem.c linux-3.0.4/drivers/usb/host/xhci-mem.c
---- linux-3.0.4/drivers/usb/host/xhci-mem.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/usb/host/xhci-mem.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/usb/host/xhci-mem.c linux-3.1.3/drivers/usb/host/xhci-mem.c
+--- linux-3.1.3/drivers/usb/host/xhci-mem.c    2011-11-26 19:57:29.000000000 -0500
++++ linux-3.1.3/drivers/usb/host/xhci-mem.c    2011-11-26 20:00:43.000000000 -0500
 @@ -1685,6 +1685,8 @@ static int xhci_check_trb_in_td_math(str
        unsigned int num_tests;
        int i, ret;
@@ -33978,9 +36350,9 @@ diff -urNp linux-3.0.4/drivers/usb/host/xhci-mem.c linux-3.0.4/drivers/usb/host/
        num_tests = ARRAY_SIZE(simple_test_vector);
        for (i = 0; i < num_tests; i++) {
                ret = xhci_test_trb_in_td(xhci,
-diff -urNp linux-3.0.4/drivers/usb/wusbcore/wa-hc.h linux-3.0.4/drivers/usb/wusbcore/wa-hc.h
---- linux-3.0.4/drivers/usb/wusbcore/wa-hc.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/usb/wusbcore/wa-hc.h   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/usb/wusbcore/wa-hc.h linux-3.1.3/drivers/usb/wusbcore/wa-hc.h
+--- linux-3.1.3/drivers/usb/wusbcore/wa-hc.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/usb/wusbcore/wa-hc.h   2011-11-16 18:39:08.000000000 -0500
 @@ -192,7 +192,7 @@ struct wahc {
        struct list_head xfer_delayed_list;
        spinlock_t xfer_list_lock;
@@ -33999,10 +36371,10 @@ diff -urNp linux-3.0.4/drivers/usb/wusbcore/wa-hc.h linux-3.0.4/drivers/usb/wusb
  }
  
  /**
-diff -urNp linux-3.0.4/drivers/usb/wusbcore/wa-xfer.c linux-3.0.4/drivers/usb/wusbcore/wa-xfer.c
---- linux-3.0.4/drivers/usb/wusbcore/wa-xfer.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/usb/wusbcore/wa-xfer.c 2011-08-23 21:47:56.000000000 -0400
-@@ -294,7 +294,7 @@ out:
+diff -urNp linux-3.1.3/drivers/usb/wusbcore/wa-xfer.c linux-3.1.3/drivers/usb/wusbcore/wa-xfer.c
+--- linux-3.1.3/drivers/usb/wusbcore/wa-xfer.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/usb/wusbcore/wa-xfer.c 2011-11-16 18:39:08.000000000 -0500
+@@ -295,7 +295,7 @@ out:
   */
  static void wa_xfer_id_init(struct wa_xfer *xfer)
  {
@@ -34011,11 +36383,11 @@ diff -urNp linux-3.0.4/drivers/usb/wusbcore/wa-xfer.c linux-3.0.4/drivers/usb/wu
  }
  
  /*
-diff -urNp linux-3.0.4/drivers/vhost/vhost.c linux-3.0.4/drivers/vhost/vhost.c
---- linux-3.0.4/drivers/vhost/vhost.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/vhost/vhost.c  2011-08-23 21:47:56.000000000 -0400
-@@ -589,7 +589,7 @@ static int init_used(struct vhost_virtqu
-       return get_user(vq->last_used_idx, &used->idx);
+diff -urNp linux-3.1.3/drivers/vhost/vhost.c linux-3.1.3/drivers/vhost/vhost.c
+--- linux-3.1.3/drivers/vhost/vhost.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/vhost/vhost.c  2011-11-16 18:39:08.000000000 -0500
+@@ -629,7 +629,7 @@ static long vhost_set_memory(struct vhos
+       return 0;
  }
  
 -static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
@@ -34023,9 +36395,21 @@ diff -urNp linux-3.0.4/drivers/vhost/vhost.c linux-3.0.4/drivers/vhost/vhost.c
  {
        struct file *eventfp, *filep = NULL,
                    *pollstart = NULL, *pollstop = NULL;
-diff -urNp linux-3.0.4/drivers/video/fbcmap.c linux-3.0.4/drivers/video/fbcmap.c
---- linux-3.0.4/drivers/video/fbcmap.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/video/fbcmap.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/video/aty/aty128fb.c linux-3.1.3/drivers/video/aty/aty128fb.c
+--- linux-3.1.3/drivers/video/aty/aty128fb.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/video/aty/aty128fb.c   2011-11-16 18:39:08.000000000 -0500
+@@ -148,7 +148,7 @@ enum {
+ };
+ /* Must match above enum */
+-static const char *r128_family[] __devinitdata = {
++static const char *r128_family[] __devinitconst = {
+       "AGP",
+       "PCI",
+       "PRO AGP",
+diff -urNp linux-3.1.3/drivers/video/fbcmap.c linux-3.1.3/drivers/video/fbcmap.c
+--- linux-3.1.3/drivers/video/fbcmap.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/video/fbcmap.c 2011-11-16 18:39:08.000000000 -0500
 @@ -285,8 +285,7 @@ int fb_set_user_cmap(struct fb_cmap_user
                rc = -ENODEV;
                goto out;
@@ -34036,9 +36420,9 @@ diff -urNp linux-3.0.4/drivers/video/fbcmap.c linux-3.0.4/drivers/video/fbcmap.c
                rc = -EINVAL;
                goto out1;
        }
-diff -urNp linux-3.0.4/drivers/video/fbmem.c linux-3.0.4/drivers/video/fbmem.c
---- linux-3.0.4/drivers/video/fbmem.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/video/fbmem.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/video/fbmem.c linux-3.1.3/drivers/video/fbmem.c
+--- linux-3.1.3/drivers/video/fbmem.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/video/fbmem.c  2011-11-16 18:40:29.000000000 -0500
 @@ -428,7 +428,7 @@ static void fb_do_show_logo(struct fb_in
                        image->dx += image->width + 8;
                }
@@ -34084,9 +36468,42 @@ diff -urNp linux-3.0.4/drivers/video/fbmem.c linux-3.0.4/drivers/video/fbmem.c
                        return -EINVAL;
                if (!registered_fb[con2fb.framebuffer])
                        request_module("fb%d", con2fb.framebuffer);
-diff -urNp linux-3.0.4/drivers/video/i810/i810_accel.c linux-3.0.4/drivers/video/i810/i810_accel.c
---- linux-3.0.4/drivers/video/i810/i810_accel.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/video/i810/i810_accel.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/video/geode/gx1fb_core.c linux-3.1.3/drivers/video/geode/gx1fb_core.c
+--- linux-3.1.3/drivers/video/geode/gx1fb_core.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/video/geode/gx1fb_core.c       2011-11-16 18:39:08.000000000 -0500
+@@ -29,7 +29,7 @@ static int  crt_option = 1;
+ static char panel_option[32] = "";
+ /* Modes relevant to the GX1 (taken from modedb.c) */
+-static const struct fb_videomode __devinitdata gx1_modedb[] = {
++static const struct fb_videomode __devinitconst gx1_modedb[] = {
+       /* 640x480-60 VESA */
+       { NULL, 60, 640, 480, 39682,  48, 16, 33, 10, 96, 2,
+         0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
+diff -urNp linux-3.1.3/drivers/video/gxt4500.c linux-3.1.3/drivers/video/gxt4500.c
+--- linux-3.1.3/drivers/video/gxt4500.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/video/gxt4500.c        2011-11-16 18:39:08.000000000 -0500
+@@ -156,7 +156,7 @@ struct gxt4500_par {
+ static char *mode_option;
+ /* default mode: 1280x1024 @ 60 Hz, 8 bpp */
+-static const struct fb_videomode defaultmode __devinitdata = {
++static const struct fb_videomode defaultmode __devinitconst = {
+       .refresh = 60,
+       .xres = 1280,
+       .yres = 1024,
+@@ -581,7 +581,7 @@ static int gxt4500_blank(int blank, stru
+       return 0;
+ }
+-static const struct fb_fix_screeninfo gxt4500_fix __devinitdata = {
++static const struct fb_fix_screeninfo gxt4500_fix __devinitconst = {
+       .id = "IBM GXT4500P",
+       .type = FB_TYPE_PACKED_PIXELS,
+       .visual = FB_VISUAL_PSEUDOCOLOR,
+diff -urNp linux-3.1.3/drivers/video/i810/i810_accel.c linux-3.1.3/drivers/video/i810/i810_accel.c
+--- linux-3.1.3/drivers/video/i810/i810_accel.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/video/i810/i810_accel.c        2011-11-16 18:39:08.000000000 -0500
 @@ -73,6 +73,7 @@ static inline int wait_for_space(struct 
                }
        }
@@ -34095,9 +36512,33 @@ diff -urNp linux-3.0.4/drivers/video/i810/i810_accel.c linux-3.0.4/drivers/video
        i810_report_error(mmio); 
        par->dev_flags |= LOCKUP;
        info->pixmap.scan_align = 1;
-diff -urNp linux-3.0.4/drivers/video/logo/logo_linux_clut224.ppm linux-3.0.4/drivers/video/logo/logo_linux_clut224.ppm
---- linux-3.0.4/drivers/video/logo/logo_linux_clut224.ppm      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/video/logo/logo_linux_clut224.ppm      2011-08-29 23:49:40.000000000 -0400
+diff -urNp linux-3.1.3/drivers/video/i810/i810_main.c linux-3.1.3/drivers/video/i810/i810_main.c
+--- linux-3.1.3/drivers/video/i810/i810_main.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/video/i810/i810_main.c 2011-11-16 18:39:08.000000000 -0500
+@@ -97,7 +97,7 @@ static int i810fb_blank      (int blank_
+ static void i810fb_release_resource       (struct fb_info *info, struct i810fb_par *par);
+ /* PCI */
+-static const char *i810_pci_list[] __devinitdata = {
++static const char *i810_pci_list[] __devinitconst = {
+       "Intel(R) 810 Framebuffer Device"                                 ,
+       "Intel(R) 810-DC100 Framebuffer Device"                           ,
+       "Intel(R) 810E Framebuffer Device"                                ,
+diff -urNp linux-3.1.3/drivers/video/jz4740_fb.c linux-3.1.3/drivers/video/jz4740_fb.c
+--- linux-3.1.3/drivers/video/jz4740_fb.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/video/jz4740_fb.c      2011-11-16 18:39:08.000000000 -0500
+@@ -136,7 +136,7 @@ struct jzfb {
+       uint32_t pseudo_palette[16];
+ };
+-static const struct fb_fix_screeninfo jzfb_fix __devinitdata = {
++static const struct fb_fix_screeninfo jzfb_fix __devinitconst = {
+       .id             = "JZ4740 FB",
+       .type           = FB_TYPE_PACKED_PIXELS,
+       .visual         = FB_VISUAL_TRUECOLOR,
+diff -urNp linux-3.1.3/drivers/video/logo/logo_linux_clut224.ppm linux-3.1.3/drivers/video/logo/logo_linux_clut224.ppm
+--- linux-3.1.3/drivers/video/logo/logo_linux_clut224.ppm      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/video/logo/logo_linux_clut224.ppm      2011-11-16 18:40:29.000000000 -0500
 @@ -1,1604 +1,1123 @@
  P3
 -# Standard 224-color Linux logo
@@ -36823,10 +39264,10 @@ diff -urNp linux-3.0.4/drivers/video/logo/logo_linux_clut224.ppm linux-3.0.4/dri
 +4 4 4  4 4 4  4 4 4  4 4 4  4 4 4  4 4 4
 +4 4 4  4 4 4  4 4 4  4 4 4  4 4 4  4 4 4
 +4 4 4  4 4 4
-diff -urNp linux-3.0.4/drivers/video/udlfb.c linux-3.0.4/drivers/video/udlfb.c
---- linux-3.0.4/drivers/video/udlfb.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/video/udlfb.c  2011-08-23 21:47:56.000000000 -0400
-@@ -586,11 +586,11 @@ int dlfb_handle_damage(struct dlfb_data 
+diff -urNp linux-3.1.3/drivers/video/udlfb.c linux-3.1.3/drivers/video/udlfb.c
+--- linux-3.1.3/drivers/video/udlfb.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/video/udlfb.c  2011-11-16 18:39:08.000000000 -0500
+@@ -585,11 +585,11 @@ int dlfb_handle_damage(struct dlfb_data 
                dlfb_urb_completion(urb);
  
  error:
@@ -36842,7 +39283,7 @@ diff -urNp linux-3.0.4/drivers/video/udlfb.c linux-3.0.4/drivers/video/udlfb.c
                    >> 10)), /* Kcycles */
                   &dev->cpu_kcycles_used);
  
-@@ -711,11 +711,11 @@ static void dlfb_dpy_deferred_io(struct 
+@@ -710,11 +710,11 @@ static void dlfb_dpy_deferred_io(struct 
                dlfb_urb_completion(urb);
  
  error:
@@ -36858,7 +39299,7 @@ diff -urNp linux-3.0.4/drivers/video/udlfb.c linux-3.0.4/drivers/video/udlfb.c
                    >> 10)), /* Kcycles */
                   &dev->cpu_kcycles_used);
  }
-@@ -1307,7 +1307,7 @@ static ssize_t metrics_bytes_rendered_sh
+@@ -1306,7 +1306,7 @@ static ssize_t metrics_bytes_rendered_sh
        struct fb_info *fb_info = dev_get_drvdata(fbdev);
        struct dlfb_data *dev = fb_info->par;
        return snprintf(buf, PAGE_SIZE, "%u\n",
@@ -36867,7 +39308,7 @@ diff -urNp linux-3.0.4/drivers/video/udlfb.c linux-3.0.4/drivers/video/udlfb.c
  }
  
  static ssize_t metrics_bytes_identical_show(struct device *fbdev,
-@@ -1315,7 +1315,7 @@ static ssize_t metrics_bytes_identical_s
+@@ -1314,7 +1314,7 @@ static ssize_t metrics_bytes_identical_s
        struct fb_info *fb_info = dev_get_drvdata(fbdev);
        struct dlfb_data *dev = fb_info->par;
        return snprintf(buf, PAGE_SIZE, "%u\n",
@@ -36876,7 +39317,7 @@ diff -urNp linux-3.0.4/drivers/video/udlfb.c linux-3.0.4/drivers/video/udlfb.c
  }
  
  static ssize_t metrics_bytes_sent_show(struct device *fbdev,
-@@ -1323,7 +1323,7 @@ static ssize_t metrics_bytes_sent_show(s
+@@ -1322,7 +1322,7 @@ static ssize_t metrics_bytes_sent_show(s
        struct fb_info *fb_info = dev_get_drvdata(fbdev);
        struct dlfb_data *dev = fb_info->par;
        return snprintf(buf, PAGE_SIZE, "%u\n",
@@ -36885,7 +39326,7 @@ diff -urNp linux-3.0.4/drivers/video/udlfb.c linux-3.0.4/drivers/video/udlfb.c
  }
  
  static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev,
-@@ -1331,7 +1331,7 @@ static ssize_t metrics_cpu_kcycles_used_
+@@ -1330,7 +1330,7 @@ static ssize_t metrics_cpu_kcycles_used_
        struct fb_info *fb_info = dev_get_drvdata(fbdev);
        struct dlfb_data *dev = fb_info->par;
        return snprintf(buf, PAGE_SIZE, "%u\n",
@@ -36894,7 +39335,7 @@ diff -urNp linux-3.0.4/drivers/video/udlfb.c linux-3.0.4/drivers/video/udlfb.c
  }
  
  static ssize_t edid_show(
-@@ -1388,10 +1388,10 @@ static ssize_t metrics_reset_store(struc
+@@ -1387,10 +1387,10 @@ static ssize_t metrics_reset_store(struc
        struct fb_info *fb_info = dev_get_drvdata(fbdev);
        struct dlfb_data *dev = fb_info->par;
  
@@ -36909,9 +39350,9 @@ diff -urNp linux-3.0.4/drivers/video/udlfb.c linux-3.0.4/drivers/video/udlfb.c
  
        return count;
  }
-diff -urNp linux-3.0.4/drivers/video/uvesafb.c linux-3.0.4/drivers/video/uvesafb.c
---- linux-3.0.4/drivers/video/uvesafb.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/video/uvesafb.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/video/uvesafb.c linux-3.1.3/drivers/video/uvesafb.c
+--- linux-3.1.3/drivers/video/uvesafb.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/video/uvesafb.c        2011-11-16 18:39:08.000000000 -0500
 @@ -19,6 +19,7 @@
  #include <linux/io.h>
  #include <linux/mutex.h>
@@ -36987,9 +39428,9 @@ diff -urNp linux-3.0.4/drivers/video/uvesafb.c linux-3.0.4/drivers/video/uvesafb
                }
  
                framebuffer_release(info);
-diff -urNp linux-3.0.4/drivers/video/vesafb.c linux-3.0.4/drivers/video/vesafb.c
---- linux-3.0.4/drivers/video/vesafb.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/video/vesafb.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/video/vesafb.c linux-3.1.3/drivers/video/vesafb.c
+--- linux-3.1.3/drivers/video/vesafb.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/video/vesafb.c 2011-11-16 18:39:08.000000000 -0500
 @@ -9,6 +9,7 @@
   */
  
@@ -37092,9 +39533,9 @@ diff -urNp linux-3.0.4/drivers/video/vesafb.c linux-3.0.4/drivers/video/vesafb.c
        if (info->screen_base)
                iounmap(info->screen_base);
        framebuffer_release(info);
-diff -urNp linux-3.0.4/drivers/video/via/via_clock.h linux-3.0.4/drivers/video/via/via_clock.h
---- linux-3.0.4/drivers/video/via/via_clock.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/video/via/via_clock.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/drivers/video/via/via_clock.h linux-3.1.3/drivers/video/via/via_clock.h
+--- linux-3.1.3/drivers/video/via/via_clock.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/video/via/via_clock.h  2011-11-16 18:39:08.000000000 -0500
 @@ -56,7 +56,7 @@ struct via_clock {
  
        void (*set_engine_pll_state)(u8 state);
@@ -37104,9 +39545,9 @@ diff -urNp linux-3.0.4/drivers/video/via/via_clock.h linux-3.0.4/drivers/video/v
  
  
  static inline u32 get_pll_internal_frequency(u32 ref_freq,
-diff -urNp linux-3.0.4/drivers/virtio/virtio_balloon.c linux-3.0.4/drivers/virtio/virtio_balloon.c
---- linux-3.0.4/drivers/virtio/virtio_balloon.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/drivers/virtio/virtio_balloon.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/drivers/virtio/virtio_balloon.c linux-3.1.3/drivers/virtio/virtio_balloon.c
+--- linux-3.1.3/drivers/virtio/virtio_balloon.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/virtio/virtio_balloon.c        2011-11-16 18:40:29.000000000 -0500
 @@ -174,6 +174,8 @@ static void update_balloon_stats(struct 
        struct sysinfo i;
        int idx = 0;
@@ -37116,10 +39557,32 @@ diff -urNp linux-3.0.4/drivers/virtio/virtio_balloon.c linux-3.0.4/drivers/virti
        all_vm_events(events);
        si_meminfo(&i);
  
-diff -urNp linux-3.0.4/fs/9p/vfs_inode.c linux-3.0.4/fs/9p/vfs_inode.c
---- linux-3.0.4/fs/9p/vfs_inode.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/9p/vfs_inode.c      2011-08-23 21:47:56.000000000 -0400
-@@ -1210,7 +1210,7 @@ static void *v9fs_vfs_follow_link(struct
+diff -urNp linux-3.1.3/drivers/xen/xen-pciback/conf_space.h linux-3.1.3/drivers/xen/xen-pciback/conf_space.h
+--- linux-3.1.3/drivers/xen/xen-pciback/conf_space.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/drivers/xen/xen-pciback/conf_space.h   2011-11-16 18:39:08.000000000 -0500
+@@ -44,15 +44,15 @@ struct config_field {
+               struct {
+                       conf_dword_write write;
+                       conf_dword_read read;
+-              } dw;
++              } __no_const dw;
+               struct {
+                       conf_word_write write;
+                       conf_word_read read;
+-              } w;
++              } __no_const w;
+               struct {
+                       conf_byte_write write;
+                       conf_byte_read read;
+-              } b;
++              } __no_const b;
+       } u;
+       struct list_head list;
+ };
+diff -urNp linux-3.1.3/fs/9p/vfs_inode.c linux-3.1.3/fs/9p/vfs_inode.c
+--- linux-3.1.3/fs/9p/vfs_inode.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/9p/vfs_inode.c      2011-11-16 18:39:08.000000000 -0500
+@@ -1288,7 +1288,7 @@ static void *v9fs_vfs_follow_link(struct
  void
  v9fs_vfs_put_link(struct dentry *dentry, struct nameidata *nd, void *p)
  {
@@ -37128,9 +39591,9 @@ diff -urNp linux-3.0.4/fs/9p/vfs_inode.c linux-3.0.4/fs/9p/vfs_inode.c
  
        P9_DPRINTK(P9_DEBUG_VFS, " %s %s\n", dentry->d_name.name,
                IS_ERR(s) ? "<error>" : s);
-diff -urNp linux-3.0.4/fs/aio.c linux-3.0.4/fs/aio.c
---- linux-3.0.4/fs/aio.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/aio.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/aio.c linux-3.1.3/fs/aio.c
+--- linux-3.1.3/fs/aio.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/aio.c       2011-11-16 18:40:29.000000000 -0500
 @@ -119,7 +119,7 @@ static int aio_setup_ring(struct kioctx 
        size += sizeof(struct io_event) * nr_events;
        nr_pages = (size + PAGE_SIZE-1) >> PAGE_SHIFT;
@@ -37179,9 +39642,9 @@ diff -urNp linux-3.0.4/fs/aio.c linux-3.0.4/fs/aio.c
        kiocb->ki_nr_segs = kiocb->ki_nbytes;
        kiocb->ki_cur_seg = 0;
        /* ki_nbytes/left now reflect bytes instead of segs */
-diff -urNp linux-3.0.4/fs/attr.c linux-3.0.4/fs/attr.c
---- linux-3.0.4/fs/attr.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/attr.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/attr.c linux-3.1.3/fs/attr.c
+--- linux-3.1.3/fs/attr.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/attr.c      2011-11-16 18:40:29.000000000 -0500
 @@ -98,6 +98,7 @@ int inode_newsize_ok(const struct inode 
                unsigned long limit;
  
@@ -37190,9 +39653,21 @@ diff -urNp linux-3.0.4/fs/attr.c linux-3.0.4/fs/attr.c
                if (limit != RLIM_INFINITY && offset > limit)
                        goto out_sig;
                if (offset > inode->i_sb->s_maxbytes)
-diff -urNp linux-3.0.4/fs/befs/linuxvfs.c linux-3.0.4/fs/befs/linuxvfs.c
---- linux-3.0.4/fs/befs/linuxvfs.c     2011-09-02 18:11:26.000000000 -0400
-+++ linux-3.0.4/fs/befs/linuxvfs.c     2011-08-29 23:26:27.000000000 -0400
+diff -urNp linux-3.1.3/fs/autofs4/waitq.c linux-3.1.3/fs/autofs4/waitq.c
+--- linux-3.1.3/fs/autofs4/waitq.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/autofs4/waitq.c     2011-11-16 18:39:08.000000000 -0500
+@@ -60,7 +60,7 @@ static int autofs4_write(struct file *fi
+ {
+       unsigned long sigpipe, flags;
+       mm_segment_t fs;
+-      const char *data = (const char *)addr;
++      const char __user *data = (const char __force_user *)addr;
+       ssize_t wr = 0;
+       /** WARNING: this is not safe for writing more than PIPE_BUF bytes! **/
+diff -urNp linux-3.1.3/fs/befs/linuxvfs.c linux-3.1.3/fs/befs/linuxvfs.c
+--- linux-3.1.3/fs/befs/linuxvfs.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/befs/linuxvfs.c     2011-11-16 18:39:08.000000000 -0500
 @@ -503,7 +503,7 @@ static void befs_put_link(struct dentry 
  {
        befs_inode_info *befs_ino = BEFS_I(dentry->d_inode);
@@ -37202,9 +39677,9 @@ diff -urNp linux-3.0.4/fs/befs/linuxvfs.c linux-3.0.4/fs/befs/linuxvfs.c
                if (!IS_ERR(link))
                        kfree(link);
        }
-diff -urNp linux-3.0.4/fs/binfmt_aout.c linux-3.0.4/fs/binfmt_aout.c
---- linux-3.0.4/fs/binfmt_aout.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/binfmt_aout.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/binfmt_aout.c linux-3.1.3/fs/binfmt_aout.c
+--- linux-3.1.3/fs/binfmt_aout.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/binfmt_aout.c       2011-11-16 18:40:29.000000000 -0500
 @@ -16,6 +16,7 @@
  #include <linux/string.h>
  #include <linux/fs.h>
@@ -37281,9 +39756,9 @@ diff -urNp linux-3.0.4/fs/binfmt_aout.c linux-3.0.4/fs/binfmt_aout.c
                                MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE,
                                fd_offset + ex.a_text);
                up_write(&current->mm->mmap_sem);
-diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
---- linux-3.0.4/fs/binfmt_elf.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/binfmt_elf.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/binfmt_elf.c linux-3.1.3/fs/binfmt_elf.c
+--- linux-3.1.3/fs/binfmt_elf.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/binfmt_elf.c        2011-11-16 18:40:29.000000000 -0500
 @@ -51,6 +51,10 @@ static int elf_core_dump(struct coredump
  #define elf_core_dump NULL
  #endif
@@ -37634,7 +40109,7 @@ diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
  
        loc = kmalloc(sizeof(*loc), GFP_KERNEL);
        if (!loc) {
-@@ -714,11 +931,81 @@ static int load_elf_binary(struct linux_
+@@ -713,11 +930,81 @@ static int load_elf_binary(struct linux_
  
        /* OK, This is the point of no return */
        current->flags &= ~PF_FORKNOEXEC;
@@ -37717,7 +40192,7 @@ diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
        if (elf_read_implies_exec(loc->elf_ex, executable_stack))
                current->personality |= READ_IMPLIES_EXEC;
  
-@@ -800,6 +1087,20 @@ static int load_elf_binary(struct linux_
+@@ -808,6 +1095,20 @@ static int load_elf_binary(struct linux_
  #else
                        load_bias = ELF_PAGESTART(ELF_ET_DYN_BASE - vaddr);
  #endif
@@ -37738,7 +40213,7 @@ diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
                }
  
                error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt,
-@@ -832,9 +1133,9 @@ static int load_elf_binary(struct linux_
+@@ -840,9 +1141,9 @@ static int load_elf_binary(struct linux_
                 * allowed task size. Note that p_filesz must always be
                 * <= p_memsz so it is only necessary to check p_memsz.
                 */
@@ -37751,7 +40226,7 @@ diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
                        /* set_brk can never work. Avoid overflows. */
                        send_sig(SIGKILL, current, 0);
                        retval = -EINVAL;
-@@ -862,6 +1163,11 @@ static int load_elf_binary(struct linux_
+@@ -870,6 +1171,11 @@ static int load_elf_binary(struct linux_
        start_data += load_bias;
        end_data += load_bias;
  
@@ -37763,7 +40238,7 @@ diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
        /* Calling set_brk effectively mmaps the pages that we need
         * for the bss and break sections.  We must do this before
         * mapping in the interpreter, to make sure it doesn't wind
-@@ -873,9 +1179,11 @@ static int load_elf_binary(struct linux_
+@@ -881,9 +1187,11 @@ static int load_elf_binary(struct linux_
                goto out_free_dentry;
        }
        if (likely(elf_bss != elf_brk) && unlikely(padzero(elf_bss))) {
@@ -37778,7 +40253,7 @@ diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
        }
  
        if (elf_interpreter) {
-@@ -1090,7 +1398,7 @@ out:
+@@ -1098,7 +1406,7 @@ out:
   * Decide what to dump of a segment, part, all or none.
   */
  static unsigned long vma_dump_size(struct vm_area_struct *vma,
@@ -37787,7 +40262,7 @@ diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
  {
  #define FILTER(type)  (mm_flags & (1UL << MMF_DUMP_##type))
  
-@@ -1124,7 +1432,7 @@ static unsigned long vma_dump_size(struc
+@@ -1132,7 +1440,7 @@ static unsigned long vma_dump_size(struc
        if (vma->vm_file == NULL)
                return 0;
  
@@ -37796,7 +40271,7 @@ diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
                goto whole;
  
        /*
-@@ -1346,9 +1654,9 @@ static void fill_auxv_note(struct memelf
+@@ -1354,9 +1662,9 @@ static void fill_auxv_note(struct memelf
  {
        elf_addr_t *auxv = (elf_addr_t *) mm->saved_auxv;
        int i = 0;
@@ -37808,7 +40283,7 @@ diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
        fill_note(note, "CORE", NT_AUXV, i * sizeof(elf_addr_t), auxv);
  }
  
-@@ -1854,14 +2162,14 @@ static void fill_extnum_info(struct elfh
+@@ -1862,14 +2170,14 @@ static void fill_extnum_info(struct elfh
  }
  
  static size_t elf_core_vma_data_size(struct vm_area_struct *gate_vma,
@@ -37825,7 +40300,7 @@ diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
        return size;
  }
  
-@@ -1955,7 +2263,7 @@ static int elf_core_dump(struct coredump
+@@ -1963,7 +2271,7 @@ static int elf_core_dump(struct coredump
  
        dataoff = offset = roundup(offset, ELF_EXEC_PAGESIZE);
  
@@ -37834,7 +40309,7 @@ diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
        offset += elf_core_extra_data_size();
        e_shoff = offset;
  
-@@ -1969,10 +2277,12 @@ static int elf_core_dump(struct coredump
+@@ -1977,10 +2285,12 @@ static int elf_core_dump(struct coredump
        offset = dataoff;
  
        size += sizeof(*elf);
@@ -37847,7 +40322,7 @@ diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
        if (size > cprm->limit
            || !dump_write(cprm->file, phdr4note, sizeof(*phdr4note)))
                goto end_coredump;
-@@ -1986,7 +2296,7 @@ static int elf_core_dump(struct coredump
+@@ -1994,7 +2304,7 @@ static int elf_core_dump(struct coredump
                phdr.p_offset = offset;
                phdr.p_vaddr = vma->vm_start;
                phdr.p_paddr = 0;
@@ -37856,7 +40331,7 @@ diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
                phdr.p_memsz = vma->vm_end - vma->vm_start;
                offset += phdr.p_filesz;
                phdr.p_flags = vma->vm_flags & VM_READ ? PF_R : 0;
-@@ -1997,6 +2307,7 @@ static int elf_core_dump(struct coredump
+@@ -2005,6 +2315,7 @@ static int elf_core_dump(struct coredump
                phdr.p_align = ELF_EXEC_PAGESIZE;
  
                size += sizeof(phdr);
@@ -37864,7 +40339,7 @@ diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
                if (size > cprm->limit
                    || !dump_write(cprm->file, &phdr, sizeof(phdr)))
                        goto end_coredump;
-@@ -2021,7 +2332,7 @@ static int elf_core_dump(struct coredump
+@@ -2029,7 +2340,7 @@ static int elf_core_dump(struct coredump
                unsigned long addr;
                unsigned long end;
  
@@ -37873,7 +40348,7 @@ diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
  
                for (addr = vma->vm_start; addr < end; addr += PAGE_SIZE) {
                        struct page *page;
-@@ -2030,6 +2341,7 @@ static int elf_core_dump(struct coredump
+@@ -2038,6 +2349,7 @@ static int elf_core_dump(struct coredump
                        page = get_dump_page(addr);
                        if (page) {
                                void *kaddr = kmap(page);
@@ -37881,7 +40356,7 @@ diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
                                stop = ((size += PAGE_SIZE) > cprm->limit) ||
                                        !dump_write(cprm->file, kaddr,
                                                    PAGE_SIZE);
-@@ -2047,6 +2359,7 @@ static int elf_core_dump(struct coredump
+@@ -2055,6 +2367,7 @@ static int elf_core_dump(struct coredump
  
        if (e_phnum == PN_XNUM) {
                size += sizeof(*shdr4extnum);
@@ -37889,7 +40364,7 @@ diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
                if (size > cprm->limit
                    || !dump_write(cprm->file, shdr4extnum,
                                   sizeof(*shdr4extnum)))
-@@ -2067,6 +2380,97 @@ out:
+@@ -2075,6 +2388,97 @@ out:
  
  #endif                /* CONFIG_ELF_CORE */
  
@@ -37987,9 +40462,9 @@ diff -urNp linux-3.0.4/fs/binfmt_elf.c linux-3.0.4/fs/binfmt_elf.c
  static int __init init_elf_binfmt(void)
  {
        return register_binfmt(&elf_format);
-diff -urNp linux-3.0.4/fs/binfmt_flat.c linux-3.0.4/fs/binfmt_flat.c
---- linux-3.0.4/fs/binfmt_flat.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/binfmt_flat.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/binfmt_flat.c linux-3.1.3/fs/binfmt_flat.c
+--- linux-3.1.3/fs/binfmt_flat.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/binfmt_flat.c       2011-11-16 18:39:08.000000000 -0500
 @@ -567,7 +567,9 @@ static int load_flat_file(struct linux_b
                                realdatastart = (unsigned long) -ENOMEM;
                        printk("Unable to allocate RAM for process data, errno %d\n",
@@ -38022,22 +40497,22 @@ diff -urNp linux-3.0.4/fs/binfmt_flat.c linux-3.0.4/fs/binfmt_flat.c
                        ret = result;
                        goto err;
                }
-diff -urNp linux-3.0.4/fs/bio.c linux-3.0.4/fs/bio.c
---- linux-3.0.4/fs/bio.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/bio.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/bio.c linux-3.1.3/fs/bio.c
+--- linux-3.1.3/fs/bio.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/bio.c       2011-11-16 18:39:08.000000000 -0500
 @@ -1233,7 +1233,7 @@ static void bio_copy_kern_endio(struct b
        const int read = bio_data_dir(bio) == READ;
        struct bio_map_data *bmd = bio->bi_private;
        int i;
 -      char *p = bmd->sgvecs[0].iov_base;
-+      char *p = (__force char *)bmd->sgvecs[0].iov_base;
++      char *p = (char __force_kernel *)bmd->sgvecs[0].iov_base;
  
        __bio_for_each_segment(bvec, bio, i, 0) {
                char *addr = page_address(bvec->bv_page);
-diff -urNp linux-3.0.4/fs/block_dev.c linux-3.0.4/fs/block_dev.c
---- linux-3.0.4/fs/block_dev.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/block_dev.c 2011-08-23 21:47:56.000000000 -0400
-@@ -671,7 +671,7 @@ static bool bd_may_claim(struct block_de
+diff -urNp linux-3.1.3/fs/block_dev.c linux-3.1.3/fs/block_dev.c
+--- linux-3.1.3/fs/block_dev.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/block_dev.c 2011-11-16 18:39:08.000000000 -0500
+@@ -681,7 +681,7 @@ static bool bd_may_claim(struct block_de
        else if (bdev->bd_contains == bdev)
                return true;     /* is a whole device which isn't held */
  
@@ -38046,10 +40521,10 @@ diff -urNp linux-3.0.4/fs/block_dev.c linux-3.0.4/fs/block_dev.c
                return true;     /* is a partition of a device that is being partitioned */
        else if (whole->bd_holder != NULL)
                return false;    /* is a partition of a held device */
-diff -urNp linux-3.0.4/fs/btrfs/ctree.c linux-3.0.4/fs/btrfs/ctree.c
---- linux-3.0.4/fs/btrfs/ctree.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/btrfs/ctree.c       2011-08-23 21:47:56.000000000 -0400
-@@ -454,9 +454,12 @@ static noinline int __btrfs_cow_block(st
+diff -urNp linux-3.1.3/fs/btrfs/ctree.c linux-3.1.3/fs/btrfs/ctree.c
+--- linux-3.1.3/fs/btrfs/ctree.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/btrfs/ctree.c       2011-11-16 18:39:08.000000000 -0500
+@@ -488,9 +488,12 @@ static noinline int __btrfs_cow_block(st
                free_extent_buffer(buf);
                add_root_to_dirty_list(root);
        } else {
@@ -38065,10 +40540,10 @@ diff -urNp linux-3.0.4/fs/btrfs/ctree.c linux-3.0.4/fs/btrfs/ctree.c
                        parent_start = 0;
  
                WARN_ON(trans->transid != btrfs_header_generation(parent));
-diff -urNp linux-3.0.4/fs/btrfs/inode.c linux-3.0.4/fs/btrfs/inode.c
---- linux-3.0.4/fs/btrfs/inode.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/btrfs/inode.c       2011-08-23 21:48:14.000000000 -0400
-@@ -6895,7 +6895,7 @@ fail:
+diff -urNp linux-3.1.3/fs/btrfs/inode.c linux-3.1.3/fs/btrfs/inode.c
+--- linux-3.1.3/fs/btrfs/inode.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/btrfs/inode.c       2011-11-17 18:12:11.000000000 -0500
+@@ -6922,7 +6922,7 @@ fail:
        return -ENOMEM;
  }
  
@@ -38077,7 +40552,7 @@ diff -urNp linux-3.0.4/fs/btrfs/inode.c linux-3.0.4/fs/btrfs/inode.c
                         struct dentry *dentry, struct kstat *stat)
  {
        struct inode *inode = dentry->d_inode;
-@@ -6907,6 +6907,14 @@ static int btrfs_getattr(struct vfsmount
+@@ -6934,6 +6934,14 @@ static int btrfs_getattr(struct vfsmount
        return 0;
  }
  
@@ -38085,17 +40560,17 @@ diff -urNp linux-3.0.4/fs/btrfs/inode.c linux-3.0.4/fs/btrfs/inode.c
 +
 +dev_t get_btrfs_dev_from_inode(struct inode *inode)
 +{
-+      return BTRFS_I(inode)->root->anon_super.s_dev;
++      return BTRFS_I(inode)->root->anon_dev;
 +}
 +EXPORT_SYMBOL(get_btrfs_dev_from_inode);
 +
  /*
   * If a file is moved, it will inherit the cow and compression flags of the new
   * directory.
-diff -urNp linux-3.0.4/fs/btrfs/ioctl.c linux-3.0.4/fs/btrfs/ioctl.c
---- linux-3.0.4/fs/btrfs/ioctl.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/btrfs/ioctl.c       2011-08-23 21:48:14.000000000 -0400
-@@ -2676,9 +2676,12 @@ long btrfs_ioctl_space_info(struct btrfs
+diff -urNp linux-3.1.3/fs/btrfs/ioctl.c linux-3.1.3/fs/btrfs/ioctl.c
+--- linux-3.1.3/fs/btrfs/ioctl.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/btrfs/ioctl.c       2011-11-16 18:40:29.000000000 -0500
+@@ -2704,9 +2704,12 @@ long btrfs_ioctl_space_info(struct btrfs
        for (i = 0; i < num_types; i++) {
                struct btrfs_space_info *tmp;
  
@@ -38108,7 +40583,7 @@ diff -urNp linux-3.0.4/fs/btrfs/ioctl.c linux-3.0.4/fs/btrfs/ioctl.c
                info = NULL;
                rcu_read_lock();
                list_for_each_entry_rcu(tmp, &root->fs_info->space_info,
-@@ -2700,10 +2703,7 @@ long btrfs_ioctl_space_info(struct btrfs
+@@ -2728,15 +2731,12 @@ long btrfs_ioctl_space_info(struct btrfs
                                memcpy(dest, &space, sizeof(space));
                                dest++;
                                space_args.total_spaces++;
@@ -38119,9 +40594,15 @@ diff -urNp linux-3.0.4/fs/btrfs/ioctl.c linux-3.0.4/fs/btrfs/ioctl.c
                }
                up_read(&info->groups_sem);
        }
-diff -urNp linux-3.0.4/fs/btrfs/relocation.c linux-3.0.4/fs/btrfs/relocation.c
---- linux-3.0.4/fs/btrfs/relocation.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/btrfs/relocation.c  2011-08-23 21:47:56.000000000 -0400
+-      user_dest = (struct btrfs_ioctl_space_info *)
++      user_dest = (struct btrfs_ioctl_space_info __user *)
+               (arg + sizeof(struct btrfs_ioctl_space_args));
+       if (copy_to_user(user_dest, dest_orig, alloc_size))
+diff -urNp linux-3.1.3/fs/btrfs/relocation.c linux-3.1.3/fs/btrfs/relocation.c
+--- linux-3.1.3/fs/btrfs/relocation.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/btrfs/relocation.c  2011-11-16 18:39:08.000000000 -0500
 @@ -1242,7 +1242,7 @@ static int __update_reloc_root(struct bt
        }
        spin_unlock(&rc->reloc_root_tree.lock);
@@ -38131,9 +40612,9 @@ diff -urNp linux-3.0.4/fs/btrfs/relocation.c linux-3.0.4/fs/btrfs/relocation.c
  
        if (!del) {
                spin_lock(&rc->reloc_root_tree.lock);
-diff -urNp linux-3.0.4/fs/cachefiles/bind.c linux-3.0.4/fs/cachefiles/bind.c
---- linux-3.0.4/fs/cachefiles/bind.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/cachefiles/bind.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/cachefiles/bind.c linux-3.1.3/fs/cachefiles/bind.c
+--- linux-3.1.3/fs/cachefiles/bind.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/cachefiles/bind.c   2011-11-16 18:39:08.000000000 -0500
 @@ -39,13 +39,11 @@ int cachefiles_daemon_bind(struct cachef
               args);
  
@@ -38150,9 +40631,9 @@ diff -urNp linux-3.0.4/fs/cachefiles/bind.c linux-3.0.4/fs/cachefiles/bind.c
               cache->bcull_percent < cache->brun_percent &&
               cache->brun_percent  < 100);
  
-diff -urNp linux-3.0.4/fs/cachefiles/daemon.c linux-3.0.4/fs/cachefiles/daemon.c
---- linux-3.0.4/fs/cachefiles/daemon.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/cachefiles/daemon.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/cachefiles/daemon.c linux-3.1.3/fs/cachefiles/daemon.c
+--- linux-3.1.3/fs/cachefiles/daemon.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/cachefiles/daemon.c 2011-11-16 18:39:08.000000000 -0500
 @@ -196,7 +196,7 @@ static ssize_t cachefiles_daemon_read(st
        if (n > buflen)
                return -EMSGSIZE;
@@ -38189,9 +40670,9 @@ diff -urNp linux-3.0.4/fs/cachefiles/daemon.c linux-3.0.4/fs/cachefiles/daemon.c
                return cachefiles_daemon_range_error(cache, args);
  
        cache->bstop_percent = bstop;
-diff -urNp linux-3.0.4/fs/cachefiles/internal.h linux-3.0.4/fs/cachefiles/internal.h
---- linux-3.0.4/fs/cachefiles/internal.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/cachefiles/internal.h       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/cachefiles/internal.h linux-3.1.3/fs/cachefiles/internal.h
+--- linux-3.1.3/fs/cachefiles/internal.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/cachefiles/internal.h       2011-11-16 18:39:08.000000000 -0500
 @@ -57,7 +57,7 @@ struct cachefiles_cache {
        wait_queue_head_t               daemon_pollwq;  /* poll waitqueue for daemon */
        struct rb_root                  active_nodes;   /* active nodes (can't be culled) */
@@ -38226,9 +40707,9 @@ diff -urNp linux-3.0.4/fs/cachefiles/internal.h linux-3.0.4/fs/cachefiles/intern
  }
  
  #else
-diff -urNp linux-3.0.4/fs/cachefiles/namei.c linux-3.0.4/fs/cachefiles/namei.c
---- linux-3.0.4/fs/cachefiles/namei.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/cachefiles/namei.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/cachefiles/namei.c linux-3.1.3/fs/cachefiles/namei.c
+--- linux-3.1.3/fs/cachefiles/namei.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/cachefiles/namei.c  2011-11-16 18:39:08.000000000 -0500
 @@ -318,7 +318,7 @@ try_again:
        /* first step is to make up a grave dentry in the graveyard */
        sprintf(nbuffer, "%08x%08x",
@@ -38238,9 +40719,9 @@ diff -urNp linux-3.0.4/fs/cachefiles/namei.c linux-3.0.4/fs/cachefiles/namei.c
  
        /* do the multiway lock magic */
        trap = lock_rename(cache->graveyard, dir);
-diff -urNp linux-3.0.4/fs/cachefiles/proc.c linux-3.0.4/fs/cachefiles/proc.c
---- linux-3.0.4/fs/cachefiles/proc.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/cachefiles/proc.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/cachefiles/proc.c linux-3.1.3/fs/cachefiles/proc.c
+--- linux-3.1.3/fs/cachefiles/proc.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/cachefiles/proc.c   2011-11-16 18:39:08.000000000 -0500
 @@ -14,9 +14,9 @@
  #include <linux/seq_file.h>
  #include "internal.h"
@@ -38267,22 +40748,22 @@ diff -urNp linux-3.0.4/fs/cachefiles/proc.c linux-3.0.4/fs/cachefiles/proc.c
                if (x == 0 && y == 0 && z == 0)
                        return 0;
  
-diff -urNp linux-3.0.4/fs/cachefiles/rdwr.c linux-3.0.4/fs/cachefiles/rdwr.c
---- linux-3.0.4/fs/cachefiles/rdwr.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/cachefiles/rdwr.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/cachefiles/rdwr.c linux-3.1.3/fs/cachefiles/rdwr.c
+--- linux-3.1.3/fs/cachefiles/rdwr.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/cachefiles/rdwr.c   2011-11-16 18:39:08.000000000 -0500
 @@ -945,7 +945,7 @@ int cachefiles_write_page(struct fscache
                        old_fs = get_fs();
                        set_fs(KERNEL_DS);
                        ret = file->f_op->write(
 -                              file, (const void __user *) data, len, &pos);
-+                              file, (__force const void __user *) data, len, &pos);
++                              file, (const void __force_user *) data, len, &pos);
                        set_fs(old_fs);
                        kunmap(page);
                        if (ret != len)
-diff -urNp linux-3.0.4/fs/ceph/dir.c linux-3.0.4/fs/ceph/dir.c
---- linux-3.0.4/fs/ceph/dir.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/ceph/dir.c  2011-08-23 21:47:56.000000000 -0400
-@@ -226,7 +226,7 @@ static int ceph_readdir(struct file *fil
+diff -urNp linux-3.1.3/fs/ceph/dir.c linux-3.1.3/fs/ceph/dir.c
+--- linux-3.1.3/fs/ceph/dir.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ceph/dir.c  2011-11-16 18:39:08.000000000 -0500
+@@ -244,7 +244,7 @@ static int ceph_readdir(struct file *fil
        struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
        struct ceph_mds_client *mdsc = fsc->mdsc;
        unsigned frag = fpos_frag(filp->f_pos);
@@ -38291,9 +40772,9 @@ diff -urNp linux-3.0.4/fs/ceph/dir.c linux-3.0.4/fs/ceph/dir.c
        int err;
        u32 ftype;
        struct ceph_mds_reply_info_parsed *rinfo;
-diff -urNp linux-3.0.4/fs/cifs/cifs_debug.c linux-3.0.4/fs/cifs/cifs_debug.c
---- linux-3.0.4/fs/cifs/cifs_debug.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/cifs/cifs_debug.c   2011-08-25 17:18:05.000000000 -0400
+diff -urNp linux-3.1.3/fs/cifs/cifs_debug.c linux-3.1.3/fs/cifs/cifs_debug.c
+--- linux-3.1.3/fs/cifs/cifs_debug.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/cifs/cifs_debug.c   2011-11-16 18:39:08.000000000 -0500
 @@ -265,8 +265,8 @@ static ssize_t cifs_stats_proc_write(str
  
        if (c == '1' || c == 'y' || c == 'Y' || c == '0') {
@@ -38423,10 +40904,10 @@ diff -urNp linux-3.0.4/fs/cifs/cifs_debug.c linux-3.0.4/fs/cifs/cifs_debug.c
                        }
                }
        }
-diff -urNp linux-3.0.4/fs/cifs/cifsfs.c linux-3.0.4/fs/cifs/cifsfs.c
---- linux-3.0.4/fs/cifs/cifsfs.c       2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/fs/cifs/cifsfs.c       2011-08-25 17:18:05.000000000 -0400
-@@ -994,7 +994,7 @@ cifs_init_request_bufs(void)
+diff -urNp linux-3.1.3/fs/cifs/cifsfs.c linux-3.1.3/fs/cifs/cifsfs.c
+--- linux-3.1.3/fs/cifs/cifsfs.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/cifs/cifsfs.c       2011-11-16 18:39:08.000000000 -0500
+@@ -981,7 +981,7 @@ cifs_init_request_bufs(void)
        cifs_req_cachep = kmem_cache_create("cifs_request",
                                            CIFSMaxBufSize +
                                            MAX_CIFS_HDR_SIZE, 0,
@@ -38435,7 +40916,7 @@ diff -urNp linux-3.0.4/fs/cifs/cifsfs.c linux-3.0.4/fs/cifs/cifsfs.c
        if (cifs_req_cachep == NULL)
                return -ENOMEM;
  
-@@ -1021,7 +1021,7 @@ cifs_init_request_bufs(void)
+@@ -1008,7 +1008,7 @@ cifs_init_request_bufs(void)
        efficient to alloc 1 per page off the slab compared to 17K (5page)
        alloc of large cifs buffers even when page debugging is on */
        cifs_sm_req_cachep = kmem_cache_create("cifs_small_rq",
@@ -38444,7 +40925,7 @@ diff -urNp linux-3.0.4/fs/cifs/cifsfs.c linux-3.0.4/fs/cifs/cifsfs.c
                        NULL);
        if (cifs_sm_req_cachep == NULL) {
                mempool_destroy(cifs_req_poolp);
-@@ -1106,8 +1106,8 @@ init_cifs(void)
+@@ -1093,8 +1093,8 @@ init_cifs(void)
        atomic_set(&bufAllocCount, 0);
        atomic_set(&smBufAllocCount, 0);
  #ifdef CONFIG_CIFS_STATS2
@@ -38455,9 +40936,9 @@ diff -urNp linux-3.0.4/fs/cifs/cifsfs.c linux-3.0.4/fs/cifs/cifsfs.c
  #endif /* CONFIG_CIFS_STATS2 */
  
        atomic_set(&midCount, 0);
-diff -urNp linux-3.0.4/fs/cifs/cifsglob.h linux-3.0.4/fs/cifs/cifsglob.h
---- linux-3.0.4/fs/cifs/cifsglob.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/cifs/cifsglob.h     2011-08-25 17:18:05.000000000 -0400
+diff -urNp linux-3.1.3/fs/cifs/cifsglob.h linux-3.1.3/fs/cifs/cifsglob.h
+--- linux-3.1.3/fs/cifs/cifsglob.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/cifs/cifsglob.h     2011-11-16 18:39:08.000000000 -0500
 @@ -381,28 +381,28 @@ struct cifs_tcon {
        __u16 Flags;            /* optional support bits */
        enum statusEnum tidStatus;
@@ -38518,7 +40999,7 @@ diff -urNp linux-3.0.4/fs/cifs/cifsglob.h linux-3.0.4/fs/cifs/cifsglob.h
  
  static inline void cifs_stats_bytes_written(struct cifs_tcon *tcon,
                                            unsigned int bytes)
-@@ -911,8 +911,8 @@ GLOBAL_EXTERN atomic_t tconInfoReconnect
+@@ -953,8 +953,8 @@ GLOBAL_EXTERN atomic_t tconInfoReconnect
  /* Various Debug counters */
  GLOBAL_EXTERN atomic_t bufAllocCount;    /* current number allocated  */
  #ifdef CONFIG_CIFS_STATS2
@@ -38529,10 +41010,10 @@ diff -urNp linux-3.0.4/fs/cifs/cifsglob.h linux-3.0.4/fs/cifs/cifsglob.h
  #endif
  GLOBAL_EXTERN atomic_t smBufAllocCount;
  GLOBAL_EXTERN atomic_t midCount;
-diff -urNp linux-3.0.4/fs/cifs/link.c linux-3.0.4/fs/cifs/link.c
---- linux-3.0.4/fs/cifs/link.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/cifs/link.c 2011-08-23 21:47:56.000000000 -0400
-@@ -587,7 +587,7 @@ symlink_exit:
+diff -urNp linux-3.1.3/fs/cifs/link.c linux-3.1.3/fs/cifs/link.c
+--- linux-3.1.3/fs/cifs/link.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/cifs/link.c 2011-11-16 18:39:08.000000000 -0500
+@@ -593,7 +593,7 @@ symlink_exit:
  
  void cifs_put_link(struct dentry *direntry, struct nameidata *nd, void *cookie)
  {
@@ -38541,9 +41022,9 @@ diff -urNp linux-3.0.4/fs/cifs/link.c linux-3.0.4/fs/cifs/link.c
        if (!IS_ERR(p))
                kfree(p);
  }
-diff -urNp linux-3.0.4/fs/cifs/misc.c linux-3.0.4/fs/cifs/misc.c
---- linux-3.0.4/fs/cifs/misc.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/cifs/misc.c 2011-08-25 17:18:05.000000000 -0400
+diff -urNp linux-3.1.3/fs/cifs/misc.c linux-3.1.3/fs/cifs/misc.c
+--- linux-3.1.3/fs/cifs/misc.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/cifs/misc.c 2011-11-16 18:39:08.000000000 -0500
 @@ -156,7 +156,7 @@ cifs_buf_get(void)
                memset(ret_buf, 0, sizeof(struct smb_hdr) + 3);
                atomic_inc(&bufAllocCount);
@@ -38562,9 +41043,9 @@ diff -urNp linux-3.0.4/fs/cifs/misc.c linux-3.0.4/fs/cifs/misc.c
  #endif /* CONFIG_CIFS_STATS2 */
  
        }
-diff -urNp linux-3.0.4/fs/coda/cache.c linux-3.0.4/fs/coda/cache.c
---- linux-3.0.4/fs/coda/cache.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/coda/cache.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/coda/cache.c linux-3.1.3/fs/coda/cache.c
+--- linux-3.1.3/fs/coda/cache.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/coda/cache.c        2011-11-16 18:39:08.000000000 -0500
 @@ -24,7 +24,7 @@
  #include "coda_linux.h"
  #include "coda_cache.h"
@@ -38609,9 +41090,9 @@ diff -urNp linux-3.0.4/fs/coda/cache.c linux-3.0.4/fs/coda/cache.c
        spin_unlock(&cii->c_lock);
  
        return hit;
-diff -urNp linux-3.0.4/fs/compat_binfmt_elf.c linux-3.0.4/fs/compat_binfmt_elf.c
---- linux-3.0.4/fs/compat_binfmt_elf.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/compat_binfmt_elf.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/compat_binfmt_elf.c linux-3.1.3/fs/compat_binfmt_elf.c
+--- linux-3.1.3/fs/compat_binfmt_elf.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/compat_binfmt_elf.c 2011-11-16 18:39:08.000000000 -0500
 @@ -30,11 +30,13 @@
  #undef        elf_phdr
  #undef        elf_shdr
@@ -38626,9 +41107,29 @@ diff -urNp linux-3.0.4/fs/compat_binfmt_elf.c linux-3.0.4/fs/compat_binfmt_elf.c
  #define elf_addr_t    Elf32_Addr
  
  /*
-diff -urNp linux-3.0.4/fs/compat.c linux-3.0.4/fs/compat.c
---- linux-3.0.4/fs/compat.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/compat.c    2011-08-23 22:49:33.000000000 -0400
+diff -urNp linux-3.1.3/fs/compat.c linux-3.1.3/fs/compat.c
+--- linux-3.1.3/fs/compat.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/compat.c    2011-11-16 18:40:29.000000000 -0500
+@@ -133,8 +133,8 @@ asmlinkage long compat_sys_utimes(const 
+ static int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf)
+ {
+       compat_ino_t ino = stat->ino;
+-      typeof(ubuf->st_uid) uid = 0;
+-      typeof(ubuf->st_gid) gid = 0;
++      typeof(((struct compat_stat *)0)->st_uid) uid = 0;
++      typeof(((struct compat_stat *)0)->st_gid) gid = 0;
+       int err;
+       SET_UID(uid, stat->uid);
+@@ -508,7 +508,7 @@ compat_sys_io_setup(unsigned nr_reqs, u3
+       set_fs(KERNEL_DS);
+       /* The __user pointer cast is valid because of the set_fs() */
+-      ret = sys_io_setup(nr_reqs, (aio_context_t __user *) &ctx64);
++      ret = sys_io_setup(nr_reqs, (aio_context_t __force_user *) &ctx64);
+       set_fs(oldfs);
+       /* truncating is ok because it's a user address */
+       if (!ret)
 @@ -566,7 +566,7 @@ ssize_t compat_rw_copy_check_uvector(int
                goto out;
  
@@ -38711,7 +41212,7 @@ diff -urNp linux-3.0.4/fs/compat.c linux-3.0.4/fs/compat.c
        dirent = buf->previous;
  
        if (dirent) {
-@@ -1073,6 +1090,7 @@ asmlinkage long compat_sys_getdents64(un
+@@ -1073,13 +1090,14 @@ asmlinkage long compat_sys_getdents64(un
        buf.previous = NULL;
        buf.count = count;
        buf.error = 0;
@@ -38719,6 +41220,14 @@ diff -urNp linux-3.0.4/fs/compat.c linux-3.0.4/fs/compat.c
  
        error = vfs_readdir(file, compat_filldir64, &buf);
        if (error >= 0)
+               error = buf.error;
+       lastdirent = buf.previous;
+       if (lastdirent) {
+-              typeof(lastdirent->d_off) d_off = file->f_pos;
++              typeof(((struct linux_dirent64 *)0)->d_off) d_off = file->f_pos;
+               if (__put_user_unaligned(d_off, &lastdirent->d_off))
+                       error = -EFAULT;
+               else
 @@ -1446,6 +1464,8 @@ int compat_core_sys_select(int n, compat
        struct fdtable *fdt;
        long stack_fds[SELECT_STACK_ALLOC/sizeof(long)];
@@ -38728,10 +41237,10 @@ diff -urNp linux-3.0.4/fs/compat.c linux-3.0.4/fs/compat.c
        if (n < 0)
                goto out_nofds;
  
-diff -urNp linux-3.0.4/fs/compat_ioctl.c linux-3.0.4/fs/compat_ioctl.c
---- linux-3.0.4/fs/compat_ioctl.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/compat_ioctl.c      2011-08-23 21:47:56.000000000 -0400
-@@ -208,6 +208,8 @@ static int do_video_set_spu_palette(unsi
+diff -urNp linux-3.1.3/fs/compat_ioctl.c linux-3.1.3/fs/compat_ioctl.c
+--- linux-3.1.3/fs/compat_ioctl.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/compat_ioctl.c      2011-11-16 18:39:08.000000000 -0500
+@@ -210,6 +210,8 @@ static int do_video_set_spu_palette(unsi
  
        err  = get_user(palp, &up->palette);
        err |= get_user(length, &up->length);
@@ -38740,7 +41249,25 @@ diff -urNp linux-3.0.4/fs/compat_ioctl.c linux-3.0.4/fs/compat_ioctl.c
  
        up_native = compat_alloc_user_space(sizeof(struct video_spu_palette));
        err  = put_user(compat_ptr(palp), &up_native->palette);
-@@ -1638,8 +1640,8 @@ asmlinkage long compat_sys_ioctl(unsigne
+@@ -621,7 +623,7 @@ static int serial_struct_ioctl(unsigned 
+                       return -EFAULT;
+                 if (__get_user(udata, &ss32->iomem_base))
+                       return -EFAULT;
+-                ss.iomem_base = compat_ptr(udata);
++                ss.iomem_base = (unsigned char __force_kernel *)compat_ptr(udata);
+                 if (__get_user(ss.iomem_reg_shift, &ss32->iomem_reg_shift) ||
+                   __get_user(ss.port_high, &ss32->port_high))
+                       return -EFAULT;
+@@ -796,7 +798,7 @@ static int compat_ioctl_preallocate(stru
+           copy_in_user(&p->l_len,     &p32->l_len,    sizeof(s64)) ||
+           copy_in_user(&p->l_sysid,   &p32->l_sysid,  sizeof(s32)) ||
+           copy_in_user(&p->l_pid,     &p32->l_pid,    sizeof(u32)) ||
+-          copy_in_user(&p->l_pad,     &p32->l_pad,    4*sizeof(u32)))
++          copy_in_user(p->l_pad,      &p32->l_pad,    4*sizeof(u32)))
+               return -EFAULT;
+       return ioctl_preallocate(file, p);
+@@ -1644,8 +1646,8 @@ asmlinkage long compat_sys_ioctl(unsigne
  static int __init init_sys32_ioctl_cmp(const void *p, const void *q)
  {
        unsigned int a, b;
@@ -38751,9 +41278,9 @@ diff -urNp linux-3.0.4/fs/compat_ioctl.c linux-3.0.4/fs/compat_ioctl.c
        if (a > b)
                return 1;
        if (a < b)
-diff -urNp linux-3.0.4/fs/configfs/dir.c linux-3.0.4/fs/configfs/dir.c
---- linux-3.0.4/fs/configfs/dir.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/configfs/dir.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/configfs/dir.c linux-3.1.3/fs/configfs/dir.c
+--- linux-3.1.3/fs/configfs/dir.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/configfs/dir.c      2011-11-16 18:39:08.000000000 -0500
 @@ -1575,7 +1575,8 @@ static int configfs_readdir(struct file 
                        }
                        for (p=q->next; p!= &parent_sd->s_children; p=p->next) {
@@ -38778,10 +41305,10 @@ diff -urNp linux-3.0.4/fs/configfs/dir.c linux-3.0.4/fs/configfs/dir.c
  
                                /*
                                 * We'll have a dentry and an inode for
-diff -urNp linux-3.0.4/fs/dcache.c linux-3.0.4/fs/dcache.c
---- linux-3.0.4/fs/dcache.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/dcache.c    2011-08-23 21:47:56.000000000 -0400
-@@ -3089,7 +3089,7 @@ void __init vfs_caches_init(unsigned lon
+diff -urNp linux-3.1.3/fs/dcache.c linux-3.1.3/fs/dcache.c
+--- linux-3.1.3/fs/dcache.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/dcache.c    2011-11-16 18:39:08.000000000 -0500
+@@ -2998,7 +2998,7 @@ void __init vfs_caches_init(unsigned lon
        mempages -= reserve;
  
        names_cachep = kmem_cache_create("names_cache", PATH_MAX, 0,
@@ -38790,28 +41317,28 @@ diff -urNp linux-3.0.4/fs/dcache.c linux-3.0.4/fs/dcache.c
  
        dcache_init();
        inode_init();
-diff -urNp linux-3.0.4/fs/ecryptfs/inode.c linux-3.0.4/fs/ecryptfs/inode.c
---- linux-3.0.4/fs/ecryptfs/inode.c    2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/fs/ecryptfs/inode.c    2011-08-23 21:47:56.000000000 -0400
-@@ -704,7 +704,7 @@ static int ecryptfs_readlink_lower(struc
+diff -urNp linux-3.1.3/fs/ecryptfs/inode.c linux-3.1.3/fs/ecryptfs/inode.c
+--- linux-3.1.3/fs/ecryptfs/inode.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ecryptfs/inode.c    2011-11-16 18:39:08.000000000 -0500
+@@ -681,7 +681,7 @@ static int ecryptfs_readlink_lower(struc
        old_fs = get_fs();
        set_fs(get_ds());
        rc = lower_dentry->d_inode->i_op->readlink(lower_dentry,
 -                                                 (char __user *)lower_buf,
-+                                                 (__force char __user *)lower_buf,
++                                                 (char __force_user *)lower_buf,
                                                   lower_bufsiz);
        set_fs(old_fs);
        if (rc < 0)
-@@ -750,7 +750,7 @@ static void *ecryptfs_follow_link(struct
+@@ -727,7 +727,7 @@ static void *ecryptfs_follow_link(struct
        }
        old_fs = get_fs();
        set_fs(get_ds());
 -      rc = dentry->d_inode->i_op->readlink(dentry, (char __user *)buf, len);
-+      rc = dentry->d_inode->i_op->readlink(dentry, (__force char __user *)buf, len);
++      rc = dentry->d_inode->i_op->readlink(dentry, (char __force_user *)buf, len);
        set_fs(old_fs);
        if (rc < 0) {
                kfree(buf);
-@@ -765,7 +765,7 @@ out:
+@@ -742,7 +742,7 @@ out:
  static void
  ecryptfs_put_link(struct dentry *dentry, struct nameidata *nd, void *ptr)
  {
@@ -38820,9 +41347,9 @@ diff -urNp linux-3.0.4/fs/ecryptfs/inode.c linux-3.0.4/fs/ecryptfs/inode.c
        if (!IS_ERR(buf)) {
                /* Free the char* */
                kfree(buf);
-diff -urNp linux-3.0.4/fs/ecryptfs/miscdev.c linux-3.0.4/fs/ecryptfs/miscdev.c
---- linux-3.0.4/fs/ecryptfs/miscdev.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/ecryptfs/miscdev.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/ecryptfs/miscdev.c linux-3.1.3/fs/ecryptfs/miscdev.c
+--- linux-3.1.3/fs/ecryptfs/miscdev.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ecryptfs/miscdev.c  2011-11-16 18:39:08.000000000 -0500
 @@ -328,7 +328,7 @@ check_list:
                goto out_unlock_msg_ctx;
        i = 5;
@@ -38832,9 +41359,30 @@ diff -urNp linux-3.0.4/fs/ecryptfs/miscdev.c linux-3.0.4/fs/ecryptfs/miscdev.c
                        goto out_unlock_msg_ctx;
                i += packet_length_size;
                if (copy_to_user(&buf[i], msg_ctx->msg, msg_ctx->msg_size))
-diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
---- linux-3.0.4/fs/exec.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/exec.c      2011-08-25 17:26:58.000000000 -0400
+diff -urNp linux-3.1.3/fs/ecryptfs/read_write.c linux-3.1.3/fs/ecryptfs/read_write.c
+--- linux-3.1.3/fs/ecryptfs/read_write.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ecryptfs/read_write.c       2011-11-16 18:39:08.000000000 -0500
+@@ -48,7 +48,7 @@ int ecryptfs_write_lower(struct inode *e
+               return -EIO;
+       fs_save = get_fs();
+       set_fs(get_ds());
+-      rc = vfs_write(lower_file, data, size, &offset);
++      rc = vfs_write(lower_file, (const char __force_user *)data, size, &offset);
+       set_fs(fs_save);
+       mark_inode_dirty_sync(ecryptfs_inode);
+       return rc;
+@@ -235,7 +235,7 @@ int ecryptfs_read_lower(char *data, loff
+               return -EIO;
+       fs_save = get_fs();
+       set_fs(get_ds());
+-      rc = vfs_read(lower_file, data, size, &offset);
++      rc = vfs_read(lower_file, (char __force_user *)data, size, &offset);
+       set_fs(fs_save);
+       return rc;
+ }
+diff -urNp linux-3.1.3/fs/exec.c linux-3.1.3/fs/exec.c
+--- linux-3.1.3/fs/exec.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/exec.c      2011-11-17 18:40:47.000000000 -0500
 @@ -55,12 +55,24 @@
  #include <linux/pipe_fs_i.h>
  #include <linux/oom.h>
@@ -38869,16 +41417,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
  
  /* The maximal length of core_pattern is also specified in sysctl.c */
  
-@@ -116,7 +128,7 @@ SYSCALL_DEFINE1(uselib, const char __use
-       char *tmp = getname(library);
-       int error = PTR_ERR(tmp);
-       static const struct open_flags uselib_flags = {
--              .open_flag = O_LARGEFILE | O_RDONLY | __FMODE_EXEC,
-+              .open_flag = O_LARGEFILE | O_RDONLY | __FMODE_EXEC | FMODE_GREXEC,
-               .acc_mode = MAY_READ | MAY_EXEC | MAY_OPEN,
-               .intent = LOOKUP_OPEN
-       };
-@@ -195,18 +207,10 @@ static struct page *get_arg_page(struct 
+@@ -188,18 +200,10 @@ static struct page *get_arg_page(struct 
                int write)
  {
        struct page *page;
@@ -38900,7 +41439,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
                return NULL;
  
        if (write) {
-@@ -281,6 +285,11 @@ static int __bprm_mm_init(struct linux_b
+@@ -274,6 +278,11 @@ static int __bprm_mm_init(struct linux_b
        vma->vm_end = STACK_TOP_MAX;
        vma->vm_start = vma->vm_end - PAGE_SIZE;
        vma->vm_flags = VM_STACK_FLAGS | VM_STACK_INCOMPLETE_SETUP;
@@ -38912,7 +41451,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
        vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
        INIT_LIST_HEAD(&vma->anon_vma_chain);
  
-@@ -295,6 +304,12 @@ static int __bprm_mm_init(struct linux_b
+@@ -288,6 +297,12 @@ static int __bprm_mm_init(struct linux_b
        mm->stack_vm = mm->total_vm = 1;
        up_write(&mm->mmap_sem);
        bprm->p = vma->vm_end - sizeof(void *);
@@ -38925,7 +41464,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
        return 0;
  err:
        up_write(&mm->mmap_sem);
-@@ -403,19 +418,7 @@ err:
+@@ -396,19 +411,7 @@ err:
        return err;
  }
  
@@ -38946,16 +41485,51 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
  {
        const char __user *native;
  
-@@ -566,7 +569,7 @@ int copy_strings_kernel(int argc, const 
+@@ -417,14 +420,14 @@ static const char __user *get_user_arg_p
+               compat_uptr_t compat;
+               if (get_user(compat, argv.ptr.compat + nr))
+-                      return ERR_PTR(-EFAULT);
++                      return (const char __force_user *)ERR_PTR(-EFAULT);
+               return compat_ptr(compat);
+       }
+ #endif
+       if (get_user(native, argv.ptr.native + nr))
+-              return ERR_PTR(-EFAULT);
++              return (const char __force_user *)ERR_PTR(-EFAULT);
+       return native;
+ }
+@@ -443,7 +446,7 @@ static int count(struct user_arg_ptr arg
+                       if (!p)
+                               break;
+-                      if (IS_ERR(p))
++                      if (IS_ERR((const char __force_kernel *)p))
+                               return -EFAULT;
+                       if (i++ >= max)
+@@ -477,7 +480,7 @@ static int copy_strings(int argc, struct
+               ret = -EFAULT;
+               str = get_user_arg_ptr(argv, argc);
+-              if (IS_ERR(str))
++              if (IS_ERR((const char __force_kernel *)str))
+                       goto out;
+               len = strnlen_user(str, MAX_ARG_STRLEN);
+@@ -559,7 +562,7 @@ int copy_strings_kernel(int argc, const 
        int r;
        mm_segment_t oldfs = get_fs();
        struct user_arg_ptr argv = {
 -              .ptr.native = (const char __user *const  __user *)__argv,
-+              .ptr.native = (__force const char __user *const  __user *)__argv,
++              .ptr.native = (const char __force_user *const  __force_user *)__argv,
        };
  
        set_fs(KERNEL_DS);
-@@ -601,7 +604,8 @@ static int shift_arg_pages(struct vm_are
+@@ -594,7 +597,8 @@ static int shift_arg_pages(struct vm_are
        unsigned long new_end = old_end - shift;
        struct mmu_gather tlb;
  
@@ -38965,7 +41539,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
  
        /*
         * ensure there are no vmas between where we want to go
-@@ -610,6 +614,10 @@ static int shift_arg_pages(struct vm_are
+@@ -603,6 +607,10 @@ static int shift_arg_pages(struct vm_are
        if (vma != find_vma(mm, new_start))
                return -EFAULT;
  
@@ -38976,7 +41550,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
        /*
         * cover the whole range: [new_start, old_end)
         */
-@@ -690,10 +698,6 @@ int setup_arg_pages(struct linux_binprm 
+@@ -683,10 +691,6 @@ int setup_arg_pages(struct linux_binprm 
        stack_top = arch_align_stack(stack_top);
        stack_top = PAGE_ALIGN(stack_top);
  
@@ -38987,7 +41561,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
        stack_shift = vma->vm_end - stack_top;
  
        bprm->p -= stack_shift;
-@@ -705,8 +709,28 @@ int setup_arg_pages(struct linux_binprm 
+@@ -698,8 +702,28 @@ int setup_arg_pages(struct linux_binprm 
        bprm->exec -= stack_shift;
  
        down_write(&mm->mmap_sem);
@@ -39016,7 +41590,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
        /*
         * Adjust stack execute permissions; explicitly enable for
         * EXSTACK_ENABLE_X, disable for EXSTACK_DISABLE_X and leave alone
-@@ -725,13 +749,6 @@ int setup_arg_pages(struct linux_binprm 
+@@ -718,13 +742,6 @@ int setup_arg_pages(struct linux_binprm 
                goto out_unlock;
        BUG_ON(prev != vma);
  
@@ -39030,25 +41604,16 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
        /* mprotect_fixup is overkill to remove the temporary stack flags */
        vma->vm_flags &= ~VM_STACK_INCOMPLETE_SETUP;
  
-@@ -771,7 +788,7 @@ struct file *open_exec(const char *name)
-       struct file *file;
-       int err;
-       static const struct open_flags open_exec_flags = {
--              .open_flag = O_LARGEFILE | O_RDONLY | __FMODE_EXEC,
-+              .open_flag = O_LARGEFILE | O_RDONLY | __FMODE_EXEC | FMODE_GREXEC,
-               .acc_mode = MAY_EXEC | MAY_OPEN,
-               .intent = LOOKUP_OPEN
-       };
-@@ -812,7 +829,7 @@ int kernel_read(struct file *file, loff_
+@@ -805,7 +822,7 @@ int kernel_read(struct file *file, loff_
        old_fs = get_fs();
        set_fs(get_ds());
        /* The cast to a user pointer is valid due to the set_fs() */
 -      result = vfs_read(file, (void __user *)addr, count, &pos);
-+      result = vfs_read(file, (__force void __user *)addr, count, &pos);
++      result = vfs_read(file, (void __force_user *)addr, count, &pos);
        set_fs(old_fs);
        return result;
  }
-@@ -1236,7 +1253,7 @@ int check_unsafe_exec(struct linux_binpr
+@@ -1251,7 +1268,7 @@ int check_unsafe_exec(struct linux_binpr
        }
        rcu_read_unlock();
  
@@ -39057,7 +41622,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
                bprm->unsafe |= LSM_UNSAFE_SHARE;
        } else {
                res = -EAGAIN;
-@@ -1428,11 +1445,35 @@ static int do_execve_common(const char *
+@@ -1454,6 +1471,11 @@ static int do_execve_common(const char *
                                struct user_arg_ptr envp,
                                struct pt_regs *regs)
  {
@@ -39069,31 +41634,16 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
        struct linux_binprm *bprm;
        struct file *file;
        struct files_struct *displaced;
-       bool clear_in_exec;
+@@ -1461,6 +1483,8 @@ static int do_execve_common(const char *
        int retval;
-+      const struct cred *cred = current_cred();
-+
+       const struct cred *cred = current_cred();
 +      gr_learn_resource(current, RLIMIT_NPROC, atomic_read(&current->cred->user->processes), 1);
 +
-+      /*
-+       * We move the actual failure in case of RLIMIT_NPROC excess from
-+       * set*uid() to execve() because too many poorly written programs
-+       * don't check setuid() return code.  Here we additionally recheck
-+       * whether NPROC limit is still exceeded.
-+       */
-+      if ((current->flags & PF_NPROC_EXCEEDED) &&
-+          atomic_read(&cred->user->processes) > rlimit(RLIMIT_NPROC)) {
-+              retval = -EAGAIN;
-+              goto out_ret;
-+      }
-+
-+      /* We're below the limit (still or again), so we don't want to make
-+       * further execve() calls fail. */
-+      current->flags &= ~PF_NPROC_EXCEEDED;
-       retval = unshare_files(&displaced);
-       if (retval)
-@@ -1464,6 +1505,16 @@ static int do_execve_common(const char *
+       /*
+        * We move the actual failure in case of RLIMIT_NPROC excess from
+        * set*uid() to execve() because too many poorly written programs
+@@ -1507,6 +1531,16 @@ static int do_execve_common(const char *
        bprm->filename = filename;
        bprm->interp = filename;
  
@@ -39110,7 +41660,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
        retval = bprm_mm_init(bprm);
        if (retval)
                goto out_file;
-@@ -1493,9 +1544,40 @@ static int do_execve_common(const char *
+@@ -1536,9 +1570,40 @@ static int do_execve_common(const char *
        if (retval < 0)
                goto out;
  
@@ -39152,7 +41702,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
  
        /* execve succeeded */
        current->fs->in_exec = 0;
-@@ -1506,6 +1588,14 @@ static int do_execve_common(const char *
+@@ -1549,6 +1614,14 @@ static int do_execve_common(const char *
                put_files_struct(displaced);
        return retval;
  
@@ -39167,7 +41717,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
  out:
        if (bprm->mm) {
                acct_arg_size(bprm, 0);
-@@ -1579,7 +1669,7 @@ static int expand_corename(struct core_n
+@@ -1622,7 +1695,7 @@ static int expand_corename(struct core_n
  {
        char *old_corename = cn->corename;
  
@@ -39176,7 +41726,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
        cn->corename = krealloc(old_corename, cn->size, GFP_KERNEL);
  
        if (!cn->corename) {
-@@ -1667,7 +1757,7 @@ static int format_corename(struct core_n
+@@ -1719,7 +1792,7 @@ static int format_corename(struct core_n
        int pid_in_pattern = 0;
        int err = 0;
  
@@ -39185,7 +41735,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
        cn->corename = kmalloc(cn->size, GFP_KERNEL);
        cn->used = 0;
  
-@@ -1758,6 +1848,219 @@ out:
+@@ -1816,6 +1889,218 @@ out:
        return ispipe;
  }
  
@@ -39308,7 +41858,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
 +                      task_uid(tsk), task_euid(tsk), pc, sp);
 +      free_page((unsigned long)buffer_exec);
 +      free_page((unsigned long)buffer_fault);
-+      pax_report_insns(pc, sp);
++      pax_report_insns(regs, pc, sp);
 +      do_coredump(SIGKILL, SIGKILL, regs);
 +}
 +#endif
@@ -39376,7 +41926,6 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
 +#endif
 +}
 +
-+
 +NORET_TYPE void pax_report_usercopy(const void *ptr, unsigned long len, bool to, const char *type)
 +{
 +      if (current->signal->curr_ip)
@@ -39405,7 +41954,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
  static int zap_process(struct task_struct *start, int exit_code)
  {
        struct task_struct *t;
-@@ -1969,17 +2272,17 @@ static void wait_for_dump_helpers(struct
+@@ -2027,17 +2312,17 @@ static void wait_for_dump_helpers(struct
        pipe = file->f_path.dentry->d_inode->i_pipe;
  
        pipe_lock(pipe);
@@ -39428,7 +41977,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
        pipe_unlock(pipe);
  
  }
-@@ -2040,7 +2343,7 @@ void do_coredump(long signr, int exit_co
+@@ -2098,7 +2383,7 @@ void do_coredump(long signr, int exit_co
        int retval = 0;
        int flag = 0;
        int ispipe;
@@ -39437,7 +41986,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
        struct coredump_params cprm = {
                .signr = signr,
                .regs = regs,
-@@ -2055,6 +2358,9 @@ void do_coredump(long signr, int exit_co
+@@ -2113,6 +2398,9 @@ void do_coredump(long signr, int exit_co
  
        audit_core_dumps(signr);
  
@@ -39447,16 +41996,7 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
        binfmt = mm->binfmt;
        if (!binfmt || !binfmt->core_dump)
                goto fail;
-@@ -2095,6 +2401,8 @@ void do_coredump(long signr, int exit_co
-               goto fail_corename;
-       }
-+      gr_learn_resource(current, RLIMIT_CORE, binfmt->min_coredump, 1);
-+
-       if (ispipe) {
-               int dump_count;
-               char **helper_argv;
-@@ -2122,7 +2430,7 @@ void do_coredump(long signr, int exit_co
+@@ -2180,7 +2468,7 @@ void do_coredump(long signr, int exit_co
                }
                cprm.limit = RLIM_INFINITY;
  
@@ -39465,7 +42005,16 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
                if (core_pipe_limit && (core_pipe_limit < dump_count)) {
                        printk(KERN_WARNING "Pid %d(%s) over core_pipe_limit\n",
                               task_tgid_vnr(current), current->comm);
-@@ -2192,7 +2500,7 @@ close_fail:
+@@ -2207,6 +2495,8 @@ void do_coredump(long signr, int exit_co
+       } else {
+               struct inode *inode;
++              gr_learn_resource(current, RLIMIT_CORE, binfmt->min_coredump, 1);
++
+               if (cprm.limit < binfmt->min_coredump)
+                       goto fail_unlock;
+@@ -2250,7 +2540,7 @@ close_fail:
                filp_close(cprm.file, NULL);
  fail_dropcount:
        if (ispipe)
@@ -39474,9 +42023,18 @@ diff -urNp linux-3.0.4/fs/exec.c linux-3.0.4/fs/exec.c
  fail_unlock:
        kfree(cn.corename);
  fail_corename:
-diff -urNp linux-3.0.4/fs/ext2/balloc.c linux-3.0.4/fs/ext2/balloc.c
---- linux-3.0.4/fs/ext2/balloc.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/ext2/balloc.c       2011-08-23 21:48:14.000000000 -0400
+@@ -2269,7 +2559,7 @@ fail:
+  */
+ int dump_write(struct file *file, const void *addr, int nr)
+ {
+-      return access_ok(VERIFY_READ, addr, nr) && file->f_op->write(file, addr, nr, &file->f_pos) == nr;
++      return access_ok(VERIFY_READ, addr, nr) && file->f_op->write(file, (const char __force_user *)addr, nr, &file->f_pos) == nr;
+ }
+ EXPORT_SYMBOL(dump_write);
+diff -urNp linux-3.1.3/fs/ext2/balloc.c linux-3.1.3/fs/ext2/balloc.c
+--- linux-3.1.3/fs/ext2/balloc.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ext2/balloc.c       2011-11-16 18:40:29.000000000 -0500
 @@ -1192,7 +1192,7 @@ static int ext2_has_free_blocks(struct e
  
        free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter);
@@ -39486,10 +42044,10 @@ diff -urNp linux-3.0.4/fs/ext2/balloc.c linux-3.0.4/fs/ext2/balloc.c
                sbi->s_resuid != current_fsuid() &&
                (sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) {
                return 0;
-diff -urNp linux-3.0.4/fs/ext3/balloc.c linux-3.0.4/fs/ext3/balloc.c
---- linux-3.0.4/fs/ext3/balloc.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/ext3/balloc.c       2011-08-23 21:48:14.000000000 -0400
-@@ -1441,7 +1441,7 @@ static int ext3_has_free_blocks(struct e
+diff -urNp linux-3.1.3/fs/ext3/balloc.c linux-3.1.3/fs/ext3/balloc.c
+--- linux-3.1.3/fs/ext3/balloc.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ext3/balloc.c       2011-11-16 18:40:29.000000000 -0500
+@@ -1446,7 +1446,7 @@ static int ext3_has_free_blocks(struct e
  
        free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter);
        root_blocks = le32_to_cpu(sbi->s_es->s_r_blocks_count);
@@ -39498,9 +42056,9 @@ diff -urNp linux-3.0.4/fs/ext3/balloc.c linux-3.0.4/fs/ext3/balloc.c
                sbi->s_resuid != current_fsuid() &&
                (sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) {
                return 0;
-diff -urNp linux-3.0.4/fs/ext4/balloc.c linux-3.0.4/fs/ext4/balloc.c
---- linux-3.0.4/fs/ext4/balloc.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/ext4/balloc.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/ext4/balloc.c linux-3.1.3/fs/ext4/balloc.c
+--- linux-3.1.3/fs/ext4/balloc.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ext4/balloc.c       2011-11-16 18:40:29.000000000 -0500
 @@ -394,8 +394,8 @@ static int ext4_has_free_blocks(struct e
        /* Hm, nope.  Are (enough) root reserved blocks available? */
        if (sbi->s_resuid == current_fsuid() ||
@@ -39512,10 +42070,10 @@ diff -urNp linux-3.0.4/fs/ext4/balloc.c linux-3.0.4/fs/ext4/balloc.c
  
                if (free_blocks >= (nblocks + dirty_blocks))
                        return 1;
-diff -urNp linux-3.0.4/fs/ext4/ext4.h linux-3.0.4/fs/ext4/ext4.h
---- linux-3.0.4/fs/ext4/ext4.h 2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/fs/ext4/ext4.h 2011-08-23 21:47:56.000000000 -0400
-@@ -1177,19 +1177,19 @@ struct ext4_sb_info {
+diff -urNp linux-3.1.3/fs/ext4/ext4.h linux-3.1.3/fs/ext4/ext4.h
+--- linux-3.1.3/fs/ext4/ext4.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ext4/ext4.h 2011-11-16 18:39:08.000000000 -0500
+@@ -1180,19 +1180,19 @@ struct ext4_sb_info {
        unsigned long s_mb_last_start;
  
        /* stats for buddy allocator */
@@ -39545,10 +42103,45 @@ diff -urNp linux-3.0.4/fs/ext4/ext4.h linux-3.0.4/fs/ext4/ext4.h
        atomic_t s_lock_busy;
  
        /* locality groups */
-diff -urNp linux-3.0.4/fs/ext4/mballoc.c linux-3.0.4/fs/ext4/mballoc.c
---- linux-3.0.4/fs/ext4/mballoc.c      2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/fs/ext4/mballoc.c      2011-08-23 21:48:14.000000000 -0400
-@@ -1793,7 +1793,7 @@ void ext4_mb_simple_scan_group(struct ex
+diff -urNp linux-3.1.3/fs/ext4/file.c linux-3.1.3/fs/ext4/file.c
+--- linux-3.1.3/fs/ext4/file.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ext4/file.c 2011-11-16 18:40:29.000000000 -0500
+@@ -181,8 +181,8 @@ static int ext4_file_open(struct inode *
+               path.dentry = mnt->mnt_root;
+               cp = d_path(&path, buf, sizeof(buf));
+               if (!IS_ERR(cp)) {
+-                      memcpy(sbi->s_es->s_last_mounted, cp,
+-                             sizeof(sbi->s_es->s_last_mounted));
++                      strlcpy(sbi->s_es->s_last_mounted, cp,
++                              sizeof(sbi->s_es->s_last_mounted));
+                       ext4_mark_super_dirty(sb);
+               }
+       }
+diff -urNp linux-3.1.3/fs/ext4/ioctl.c linux-3.1.3/fs/ext4/ioctl.c
+--- linux-3.1.3/fs/ext4/ioctl.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ext4/ioctl.c        2011-11-16 18:39:08.000000000 -0500
+@@ -348,7 +348,7 @@ mext_out:
+               if (!blk_queue_discard(q))
+                       return -EOPNOTSUPP;
+-              if (copy_from_user(&range, (struct fstrim_range *)arg,
++              if (copy_from_user(&range, (struct fstrim_range __user *)arg,
+                   sizeof(range)))
+                       return -EFAULT;
+@@ -358,7 +358,7 @@ mext_out:
+               if (ret < 0)
+                       return ret;
+-              if (copy_to_user((struct fstrim_range *)arg, &range,
++              if (copy_to_user((struct fstrim_range __user *)arg, &range,
+                   sizeof(range)))
+                       return -EFAULT;
+diff -urNp linux-3.1.3/fs/ext4/mballoc.c linux-3.1.3/fs/ext4/mballoc.c
+--- linux-3.1.3/fs/ext4/mballoc.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ext4/mballoc.c      2011-11-16 18:40:29.000000000 -0500
+@@ -1795,7 +1795,7 @@ void ext4_mb_simple_scan_group(struct ex
                BUG_ON(ac->ac_b_ex.fe_len != ac->ac_g_ex.fe_len);
  
                if (EXT4_SB(sb)->s_mb_stats)
@@ -39557,7 +42150,7 @@ diff -urNp linux-3.0.4/fs/ext4/mballoc.c linux-3.0.4/fs/ext4/mballoc.c
  
                break;
        }
-@@ -2087,7 +2087,7 @@ repeat:
+@@ -2089,7 +2089,7 @@ repeat:
                        ac->ac_status = AC_STATUS_CONTINUE;
                        ac->ac_flags |= EXT4_MB_HINT_FIRST;
                        cr = 3;
@@ -39566,7 +42159,7 @@ diff -urNp linux-3.0.4/fs/ext4/mballoc.c linux-3.0.4/fs/ext4/mballoc.c
                        goto repeat;
                }
        }
-@@ -2130,6 +2130,8 @@ static int ext4_mb_seq_groups_show(struc
+@@ -2132,6 +2132,8 @@ static int ext4_mb_seq_groups_show(struc
                ext4_grpblk_t counters[16];
        } sg;
  
@@ -39575,19 +42168,19 @@ diff -urNp linux-3.0.4/fs/ext4/mballoc.c linux-3.0.4/fs/ext4/mballoc.c
        group--;
        if (group == 0)
                seq_printf(seq, "#%-5s: %-5s %-5s %-5s "
-@@ -2553,25 +2555,25 @@ int ext4_mb_release(struct super_block *
+@@ -2573,25 +2575,25 @@ int ext4_mb_release(struct super_block *
        if (sbi->s_mb_stats) {
-               printk(KERN_INFO
-                      "EXT4-fs: mballoc: %u blocks %u reqs (%u success)\n",
+               ext4_msg(sb, KERN_INFO,
+                      "mballoc: %u blocks %u reqs (%u success)",
 -                              atomic_read(&sbi->s_bal_allocated),
 -                              atomic_read(&sbi->s_bal_reqs),
 -                              atomic_read(&sbi->s_bal_success));
 +                              atomic_read_unchecked(&sbi->s_bal_allocated),
 +                              atomic_read_unchecked(&sbi->s_bal_reqs),
 +                              atomic_read_unchecked(&sbi->s_bal_success));
-               printk(KERN_INFO
-                     "EXT4-fs: mballoc: %u extents scanned, %u goal hits, "
-                               "%u 2^N hits, %u breaks, %u lost\n",
+               ext4_msg(sb, KERN_INFO,
+                     "mballoc: %u extents scanned, %u goal hits, "
+                               "%u 2^N hits, %u breaks, %u lost",
 -                              atomic_read(&sbi->s_bal_ex_scanned),
 -                              atomic_read(&sbi->s_bal_goals),
 -                              atomic_read(&sbi->s_bal_2orders),
@@ -39598,12 +42191,12 @@ diff -urNp linux-3.0.4/fs/ext4/mballoc.c linux-3.0.4/fs/ext4/mballoc.c
 +                              atomic_read_unchecked(&sbi->s_bal_2orders),
 +                              atomic_read_unchecked(&sbi->s_bal_breaks),
 +                              atomic_read_unchecked(&sbi->s_mb_lost_chunks));
-               printk(KERN_INFO
-                      "EXT4-fs: mballoc: %lu generated and it took %Lu\n",
-                               sbi->s_mb_buddies_generated++,
+               ext4_msg(sb, KERN_INFO,
+                      "mballoc: %lu generated and it took %Lu",
+                               sbi->s_mb_buddies_generated,
                                sbi->s_mb_generation_time);
-               printk(KERN_INFO
-                      "EXT4-fs: mballoc: %u preallocated, %u discarded\n",
+               ext4_msg(sb, KERN_INFO,
+                      "mballoc: %u preallocated, %u discarded",
 -                              atomic_read(&sbi->s_mb_preallocated),
 -                              atomic_read(&sbi->s_mb_discarded));
 +                              atomic_read_unchecked(&sbi->s_mb_preallocated),
@@ -39611,7 +42204,7 @@ diff -urNp linux-3.0.4/fs/ext4/mballoc.c linux-3.0.4/fs/ext4/mballoc.c
        }
  
        free_percpu(sbi->s_locality_groups);
-@@ -3041,16 +3043,16 @@ static void ext4_mb_collect_stats(struct
+@@ -3070,16 +3072,16 @@ static void ext4_mb_collect_stats(struct
        struct ext4_sb_info *sbi = EXT4_SB(ac->ac_sb);
  
        if (sbi->s_mb_stats && ac->ac_g_ex.fe_len > 1) {
@@ -39634,7 +42227,7 @@ diff -urNp linux-3.0.4/fs/ext4/mballoc.c linux-3.0.4/fs/ext4/mballoc.c
        }
  
        if (ac->ac_op == EXT4_MB_HISTORY_ALLOC)
-@@ -3448,7 +3450,7 @@ ext4_mb_new_inode_pa(struct ext4_allocat
+@@ -3477,7 +3479,7 @@ ext4_mb_new_inode_pa(struct ext4_allocat
        trace_ext4_mb_new_inode_pa(ac, pa);
  
        ext4_mb_use_inode_pa(ac, pa);
@@ -39643,7 +42236,7 @@ diff -urNp linux-3.0.4/fs/ext4/mballoc.c linux-3.0.4/fs/ext4/mballoc.c
  
        ei = EXT4_I(ac->ac_inode);
        grp = ext4_get_group_info(sb, ac->ac_b_ex.fe_group);
-@@ -3508,7 +3510,7 @@ ext4_mb_new_group_pa(struct ext4_allocat
+@@ -3537,7 +3539,7 @@ ext4_mb_new_group_pa(struct ext4_allocat
        trace_ext4_mb_new_group_pa(ac, pa);
  
        ext4_mb_use_group_pa(ac, pa);
@@ -39652,7 +42245,7 @@ diff -urNp linux-3.0.4/fs/ext4/mballoc.c linux-3.0.4/fs/ext4/mballoc.c
  
        grp = ext4_get_group_info(sb, ac->ac_b_ex.fe_group);
        lg = ac->ac_lg;
-@@ -3595,7 +3597,7 @@ ext4_mb_release_inode_pa(struct ext4_bud
+@@ -3625,7 +3627,7 @@ ext4_mb_release_inode_pa(struct ext4_bud
                 * from the bitmap and continue.
                 */
        }
@@ -39661,7 +42254,7 @@ diff -urNp linux-3.0.4/fs/ext4/mballoc.c linux-3.0.4/fs/ext4/mballoc.c
  
        return err;
  }
-@@ -3613,7 +3615,7 @@ ext4_mb_release_group_pa(struct ext4_bud
+@@ -3643,7 +3645,7 @@ ext4_mb_release_group_pa(struct ext4_bud
        ext4_get_group_no_and_offset(sb, pa->pa_pstart, &group, &bit);
        BUG_ON(group != e4b->bd_group && pa->pa_len != 0);
        mb_free_blocks(pa->pa_inode, e4b, bit, pa->pa_len);
@@ -39670,9 +42263,9 @@ diff -urNp linux-3.0.4/fs/ext4/mballoc.c linux-3.0.4/fs/ext4/mballoc.c
        trace_ext4_mballoc_discard(sb, NULL, group, bit, pa->pa_len);
  
        return 0;
-diff -urNp linux-3.0.4/fs/fcntl.c linux-3.0.4/fs/fcntl.c
---- linux-3.0.4/fs/fcntl.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/fcntl.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/fcntl.c linux-3.1.3/fs/fcntl.c
+--- linux-3.1.3/fs/fcntl.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/fcntl.c     2011-11-16 23:40:25.000000000 -0500
 @@ -224,6 +224,11 @@ int __f_setown(struct file *filp, struct
        if (err)
                return err;
@@ -39685,6 +42278,24 @@ diff -urNp linux-3.0.4/fs/fcntl.c linux-3.0.4/fs/fcntl.c
        f_modown(filp, pid, type, force);
        return 0;
  }
+@@ -266,7 +271,7 @@ pid_t f_getown(struct file *filp)
+ static int f_setown_ex(struct file *filp, unsigned long arg)
+ {
+-      struct f_owner_ex * __user owner_p = (void * __user)arg;
++      struct f_owner_ex __user *owner_p = (void __user *)arg;
+       struct f_owner_ex owner;
+       struct pid *pid;
+       int type;
+@@ -306,7 +311,7 @@ static int f_setown_ex(struct file *filp
+ static int f_getown_ex(struct file *filp, unsigned long arg)
+ {
+-      struct f_owner_ex * __user owner_p = (void * __user)arg;
++      struct f_owner_ex __user *owner_p = (void __user *)arg;
+       struct f_owner_ex owner;
+       int ret = 0;
 @@ -348,6 +353,7 @@ static long do_fcntl(int fd, unsigned in
        switch (cmd) {
        case F_DUPFD:
@@ -39693,26 +42304,9 @@ diff -urNp linux-3.0.4/fs/fcntl.c linux-3.0.4/fs/fcntl.c
                if (arg >= rlimit(RLIMIT_NOFILE))
                        break;
                err = alloc_fd(arg, cmd == F_DUPFD_CLOEXEC ? O_CLOEXEC : 0);
-@@ -835,14 +841,14 @@ static int __init fcntl_init(void)
-        * Exceptions: O_NONBLOCK is a two bit define on parisc; O_NDELAY
-        * is defined as O_NONBLOCK on some platforms and not on others.
-        */
--      BUILD_BUG_ON(19 - 1 /* for O_RDONLY being 0 */ != HWEIGHT32(
-+      BUILD_BUG_ON(20 - 1 /* for O_RDONLY being 0 */ != HWEIGHT32(
-               O_RDONLY        | O_WRONLY      | O_RDWR        |
-               O_CREAT         | O_EXCL        | O_NOCTTY      |
-               O_TRUNC         | O_APPEND      | /* O_NONBLOCK | */
-               __O_SYNC        | O_DSYNC       | FASYNC        |
-               O_DIRECT        | O_LARGEFILE   | O_DIRECTORY   |
-               O_NOFOLLOW      | O_NOATIME     | O_CLOEXEC     |
--              __FMODE_EXEC    | O_PATH
-+              __FMODE_EXEC    | O_PATH        | FMODE_GREXEC
-               ));
-       fasync_cache = kmem_cache_create("fasync_cache",
-diff -urNp linux-3.0.4/fs/fifo.c linux-3.0.4/fs/fifo.c
---- linux-3.0.4/fs/fifo.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/fifo.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/fifo.c linux-3.1.3/fs/fifo.c
+--- linux-3.1.3/fs/fifo.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/fifo.c      2011-11-16 18:39:08.000000000 -0500
 @@ -58,10 +58,10 @@ static int fifo_open(struct inode *inode
         */
                filp->f_op = &read_pipefifo_fops;
@@ -39783,9 +42377,9 @@ diff -urNp linux-3.0.4/fs/fifo.c linux-3.0.4/fs/fifo.c
                free_pipe_info(inode);
  
  err_nocleanup:
-diff -urNp linux-3.0.4/fs/file.c linux-3.0.4/fs/file.c
---- linux-3.0.4/fs/file.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/file.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/file.c linux-3.1.3/fs/file.c
+--- linux-3.1.3/fs/file.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/file.c      2011-11-16 18:40:29.000000000 -0500
 @@ -15,6 +15,7 @@
  #include <linux/slab.h>
  #include <linux/vmalloc.h>
@@ -39802,9 +42396,9 @@ diff -urNp linux-3.0.4/fs/file.c linux-3.0.4/fs/file.c
        if (nr >= rlimit(RLIMIT_NOFILE))
                return -EMFILE;
  
-diff -urNp linux-3.0.4/fs/filesystems.c linux-3.0.4/fs/filesystems.c
---- linux-3.0.4/fs/filesystems.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/filesystems.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/filesystems.c linux-3.1.3/fs/filesystems.c
+--- linux-3.1.3/fs/filesystems.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/filesystems.c       2011-11-16 18:40:29.000000000 -0500
 @@ -274,7 +274,12 @@ struct file_system_type *get_fs_type(con
        int len = dot ? dot - name : strlen(name);
  
@@ -39818,9 +42412,9 @@ diff -urNp linux-3.0.4/fs/filesystems.c linux-3.0.4/fs/filesystems.c
                fs = __get_fs_type(name, len);
  
        if (dot && fs && !(fs->fs_flags & FS_HAS_SUBTYPE)) {
-diff -urNp linux-3.0.4/fs/fscache/cookie.c linux-3.0.4/fs/fscache/cookie.c
---- linux-3.0.4/fs/fscache/cookie.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/fscache/cookie.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/fscache/cookie.c linux-3.1.3/fs/fscache/cookie.c
+--- linux-3.1.3/fs/fscache/cookie.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/fscache/cookie.c    2011-11-16 18:39:08.000000000 -0500
 @@ -68,11 +68,11 @@ struct fscache_cookie *__fscache_acquire
               parent ? (char *) parent->def->name : "<no-parent>",
               def->name, netfs_data);
@@ -39939,9 +42533,9 @@ diff -urNp linux-3.0.4/fs/fscache/cookie.c linux-3.0.4/fs/fscache/cookie.c
                wait_on_bit(&cookie->flags, FSCACHE_COOKIE_CREATING,
                            fscache_wait_bit, TASK_UNINTERRUPTIBLE);
        }
-diff -urNp linux-3.0.4/fs/fscache/internal.h linux-3.0.4/fs/fscache/internal.h
---- linux-3.0.4/fs/fscache/internal.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/fscache/internal.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/fscache/internal.h linux-3.1.3/fs/fscache/internal.h
+--- linux-3.1.3/fs/fscache/internal.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/fscache/internal.h  2011-11-16 18:39:08.000000000 -0500
 @@ -144,94 +144,94 @@ extern void fscache_proc_cleanup(void);
  extern atomic_t fscache_n_ops_processed[FSCACHE_MAX_THREADS];
  extern atomic_t fscache_n_objs_processed[FSCACHE_MAX_THREADS];
@@ -40145,9 +42739,9 @@ diff -urNp linux-3.0.4/fs/fscache/internal.h linux-3.0.4/fs/fscache/internal.h
  #define fscache_stat_d(stat) do {} while (0)
  #endif
  
-diff -urNp linux-3.0.4/fs/fscache/object.c linux-3.0.4/fs/fscache/object.c
---- linux-3.0.4/fs/fscache/object.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/fscache/object.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/fscache/object.c linux-3.1.3/fs/fscache/object.c
+--- linux-3.1.3/fs/fscache/object.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/fscache/object.c    2011-11-16 18:39:08.000000000 -0500
 @@ -128,7 +128,7 @@ static void fscache_object_state_machine
                /* update the object metadata on disk */
        case FSCACHE_OBJECT_UPDATING:
@@ -40259,9 +42853,9 @@ diff -urNp linux-3.0.4/fs/fscache/object.c linux-3.0.4/fs/fscache/object.c
                break;
  
        default:
-diff -urNp linux-3.0.4/fs/fscache/operation.c linux-3.0.4/fs/fscache/operation.c
---- linux-3.0.4/fs/fscache/operation.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/fscache/operation.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/fscache/operation.c linux-3.1.3/fs/fscache/operation.c
+--- linux-3.1.3/fs/fscache/operation.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/fscache/operation.c 2011-11-16 18:39:08.000000000 -0500
 @@ -17,7 +17,7 @@
  #include <linux/slab.h>
  #include "internal.h"
@@ -40377,9 +42971,9 @@ diff -urNp linux-3.0.4/fs/fscache/operation.c linux-3.0.4/fs/fscache/operation.c
  
                ASSERTCMP(atomic_read(&op->usage), ==, 0);
  
-diff -urNp linux-3.0.4/fs/fscache/page.c linux-3.0.4/fs/fscache/page.c
---- linux-3.0.4/fs/fscache/page.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/fscache/page.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/fscache/page.c linux-3.1.3/fs/fscache/page.c
+--- linux-3.1.3/fs/fscache/page.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/fscache/page.c      2011-11-16 18:39:08.000000000 -0500
 @@ -60,7 +60,7 @@ bool __fscache_maybe_release_page(struct
        val = radix_tree_lookup(&cookie->stores, page->index);
        if (!val) {
@@ -40763,9 +43357,9 @@ diff -urNp linux-3.0.4/fs/fscache/page.c linux-3.0.4/fs/fscache/page.c
  #endif
  
        for (loop = 0; loop < pagevec->nr; loop++) {
-diff -urNp linux-3.0.4/fs/fscache/stats.c linux-3.0.4/fs/fscache/stats.c
---- linux-3.0.4/fs/fscache/stats.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/fscache/stats.c     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/fscache/stats.c linux-3.1.3/fs/fscache/stats.c
+--- linux-3.1.3/fs/fscache/stats.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/fscache/stats.c     2011-11-16 18:39:08.000000000 -0500
 @@ -18,95 +18,95 @@
  /*
   * operation counters
@@ -41141,9 +43735,9 @@ diff -urNp linux-3.0.4/fs/fscache/stats.c linux-3.0.4/fs/fscache/stats.c
  
        seq_printf(m, "CacheOp: alo=%d luo=%d luc=%d gro=%d\n",
                   atomic_read(&fscache_n_cop_alloc_object),
-diff -urNp linux-3.0.4/fs/fs_struct.c linux-3.0.4/fs/fs_struct.c
---- linux-3.0.4/fs/fs_struct.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/fs_struct.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/fs_struct.c linux-3.1.3/fs/fs_struct.c
+--- linux-3.1.3/fs/fs_struct.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/fs_struct.c 2011-11-16 18:40:29.000000000 -0500
 @@ -4,6 +4,7 @@
  #include <linux/path.h>
  #include <linux/slab.h>
@@ -41233,9 +43827,9 @@ diff -urNp linux-3.0.4/fs/fs_struct.c linux-3.0.4/fs/fs_struct.c
                spin_unlock(&fs->lock);
  
                task_unlock(current);
-diff -urNp linux-3.0.4/fs/fuse/cuse.c linux-3.0.4/fs/fuse/cuse.c
---- linux-3.0.4/fs/fuse/cuse.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/fuse/cuse.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/fuse/cuse.c linux-3.1.3/fs/fuse/cuse.c
+--- linux-3.1.3/fs/fuse/cuse.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/fuse/cuse.c 2011-11-16 18:39:08.000000000 -0500
 @@ -586,10 +586,12 @@ static int __init cuse_init(void)
                INIT_LIST_HEAD(&cuse_conntbl[i]);
  
@@ -41253,10 +43847,10 @@ diff -urNp linux-3.0.4/fs/fuse/cuse.c linux-3.0.4/fs/fuse/cuse.c
  
        cuse_class = class_create(THIS_MODULE, "cuse");
        if (IS_ERR(cuse_class))
-diff -urNp linux-3.0.4/fs/fuse/dev.c linux-3.0.4/fs/fuse/dev.c
---- linux-3.0.4/fs/fuse/dev.c  2011-09-02 18:11:26.000000000 -0400
-+++ linux-3.0.4/fs/fuse/dev.c  2011-08-29 23:26:27.000000000 -0400
-@@ -1238,7 +1238,7 @@ static ssize_t fuse_dev_splice_read(stru
+diff -urNp linux-3.1.3/fs/fuse/dev.c linux-3.1.3/fs/fuse/dev.c
+--- linux-3.1.3/fs/fuse/dev.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/fuse/dev.c  2011-11-16 18:39:08.000000000 -0500
+@@ -1242,7 +1242,7 @@ static ssize_t fuse_dev_splice_read(stru
        ret = 0;
        pipe_lock(pipe);
  
@@ -41265,10 +43859,10 @@ diff -urNp linux-3.0.4/fs/fuse/dev.c linux-3.0.4/fs/fuse/dev.c
                send_sig(SIGPIPE, current, 0);
                if (!ret)
                        ret = -EPIPE;
-diff -urNp linux-3.0.4/fs/fuse/dir.c linux-3.0.4/fs/fuse/dir.c
---- linux-3.0.4/fs/fuse/dir.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/fuse/dir.c  2011-08-23 21:47:56.000000000 -0400
-@@ -1148,7 +1148,7 @@ static char *read_link(struct dentry *de
+diff -urNp linux-3.1.3/fs/fuse/dir.c linux-3.1.3/fs/fuse/dir.c
+--- linux-3.1.3/fs/fuse/dir.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/fuse/dir.c  2011-11-16 18:39:08.000000000 -0500
+@@ -1147,7 +1147,7 @@ static char *read_link(struct dentry *de
        return link;
  }
  
@@ -41277,10 +43871,10 @@ diff -urNp linux-3.0.4/fs/fuse/dir.c linux-3.0.4/fs/fuse/dir.c
  {
        if (!IS_ERR(link))
                free_page((unsigned long) link);
-diff -urNp linux-3.0.4/fs/gfs2/inode.c linux-3.0.4/fs/gfs2/inode.c
---- linux-3.0.4/fs/gfs2/inode.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/gfs2/inode.c        2011-08-23 21:47:56.000000000 -0400
-@@ -1525,7 +1525,7 @@ out:
+diff -urNp linux-3.1.3/fs/gfs2/inode.c linux-3.1.3/fs/gfs2/inode.c
+--- linux-3.1.3/fs/gfs2/inode.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/gfs2/inode.c        2011-11-16 18:39:08.000000000 -0500
+@@ -1517,7 +1517,7 @@ out:
  
  static void gfs2_put_link(struct dentry *dentry, struct nameidata *nd, void *p)
  {
@@ -41289,9 +43883,52 @@ diff -urNp linux-3.0.4/fs/gfs2/inode.c linux-3.0.4/fs/gfs2/inode.c
        if (!IS_ERR(s))
                kfree(s);
  }
-diff -urNp linux-3.0.4/fs/hfsplus/catalog.c linux-3.0.4/fs/hfsplus/catalog.c
---- linux-3.0.4/fs/hfsplus/catalog.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/hfsplus/catalog.c   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/hfs/btree.c linux-3.1.3/fs/hfs/btree.c
+--- linux-3.1.3/fs/hfs/btree.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/hfs/btree.c 2011-11-18 18:48:11.000000000 -0500
+@@ -46,11 +46,27 @@ struct hfs_btree *hfs_btree_open(struct 
+       case HFS_EXT_CNID:
+               hfs_inode_read_fork(tree->inode, mdb->drXTExtRec, mdb->drXTFlSize,
+                                   mdb->drXTFlSize, be32_to_cpu(mdb->drXTClpSiz));
++
++              if (HFS_I(tree->inode)->alloc_blocks >
++                                      HFS_I(tree->inode)->first_blocks) {
++                      printk(KERN_ERR "hfs: invalid btree extent records\n");
++                      unlock_new_inode(tree->inode);
++                      goto free_inode;
++              }
++
+               tree->inode->i_mapping->a_ops = &hfs_btree_aops;
+               break;
+       case HFS_CAT_CNID:
+               hfs_inode_read_fork(tree->inode, mdb->drCTExtRec, mdb->drCTFlSize,
+                                   mdb->drCTFlSize, be32_to_cpu(mdb->drCTClpSiz));
++
++              if (!HFS_I(tree->inode)->first_blocks) {
++                      printk(KERN_ERR "hfs: invalid btree extent records "
++                                                              "(0 size).\n");
++                      unlock_new_inode(tree->inode);
++                      goto free_inode;
++              }
++
+               tree->inode->i_mapping->a_ops = &hfs_btree_aops;
+               break;
+       default:
+@@ -59,11 +75,6 @@ struct hfs_btree *hfs_btree_open(struct 
+       }
+       unlock_new_inode(tree->inode);
+-      if (!HFS_I(tree->inode)->first_blocks) {
+-              printk(KERN_ERR "hfs: invalid btree extent records (0 size).\n");
+-              goto free_inode;
+-      }
+-
+       mapping = tree->inode->i_mapping;
+       page = read_mapping_page(mapping, 0, NULL);
+       if (IS_ERR(page))
+diff -urNp linux-3.1.3/fs/hfsplus/catalog.c linux-3.1.3/fs/hfsplus/catalog.c
+--- linux-3.1.3/fs/hfsplus/catalog.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/hfsplus/catalog.c   2011-11-16 19:23:09.000000000 -0500
 @@ -179,6 +179,8 @@ int hfsplus_find_cat(struct super_block 
        int err;
        u16 type;
@@ -41309,20 +43946,20 @@ diff -urNp linux-3.0.4/fs/hfsplus/catalog.c linux-3.0.4/fs/hfsplus/catalog.c
 +
        dprint(DBG_CAT_MOD, "create_cat: %s,%u(%d)\n",
                str->name, cnid, inode->i_nlink);
-       hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd);
-@@ -349,6 +353,8 @@ int hfsplus_rename_cat(u32 cnid,
+       err = hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &fd);
+@@ -353,6 +357,8 @@ int hfsplus_rename_cat(u32 cnid,
        int entry_size, type;
-       int err = 0;
+       int err;
  
 +      pax_track_stack();
 +
        dprint(DBG_CAT_MOD, "rename_cat: %u - %lu,%s - %lu,%s\n",
                cnid, src_dir->i_ino, src_name->name,
                dst_dir->i_ino, dst_name->name);
-diff -urNp linux-3.0.4/fs/hfsplus/dir.c linux-3.0.4/fs/hfsplus/dir.c
---- linux-3.0.4/fs/hfsplus/dir.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/hfsplus/dir.c       2011-08-23 21:48:14.000000000 -0400
-@@ -129,6 +129,8 @@ static int hfsplus_readdir(struct file *
+diff -urNp linux-3.1.3/fs/hfsplus/dir.c linux-3.1.3/fs/hfsplus/dir.c
+--- linux-3.1.3/fs/hfsplus/dir.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/hfsplus/dir.c       2011-11-16 18:40:29.000000000 -0500
+@@ -131,6 +131,8 @@ static int hfsplus_readdir(struct file *
        struct hfsplus_readdir_data *rd;
        u16 type;
  
@@ -41331,10 +43968,10 @@ diff -urNp linux-3.0.4/fs/hfsplus/dir.c linux-3.0.4/fs/hfsplus/dir.c
        if (filp->f_pos >= inode->i_size)
                return 0;
  
-diff -urNp linux-3.0.4/fs/hfsplus/inode.c linux-3.0.4/fs/hfsplus/inode.c
---- linux-3.0.4/fs/hfsplus/inode.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/hfsplus/inode.c     2011-08-23 21:48:14.000000000 -0400
-@@ -489,6 +489,8 @@ int hfsplus_cat_read_inode(struct inode 
+diff -urNp linux-3.1.3/fs/hfsplus/inode.c linux-3.1.3/fs/hfsplus/inode.c
+--- linux-3.1.3/fs/hfsplus/inode.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/hfsplus/inode.c     2011-11-16 18:40:29.000000000 -0500
+@@ -501,6 +501,8 @@ int hfsplus_cat_read_inode(struct inode 
        int res = 0;
        u16 type;
  
@@ -41343,7 +43980,7 @@ diff -urNp linux-3.0.4/fs/hfsplus/inode.c linux-3.0.4/fs/hfsplus/inode.c
        type = hfs_bnode_read_u16(fd->bnode, fd->entryoffset);
  
        HFSPLUS_I(inode)->linkid = 0;
-@@ -552,6 +554,8 @@ int hfsplus_cat_write_inode(struct inode
+@@ -564,6 +566,8 @@ int hfsplus_cat_write_inode(struct inode
        struct hfs_find_data fd;
        hfsplus_cat_entry entry;
  
@@ -41352,9 +43989,9 @@ diff -urNp linux-3.0.4/fs/hfsplus/inode.c linux-3.0.4/fs/hfsplus/inode.c
        if (HFSPLUS_IS_RSRC(inode))
                main_inode = HFSPLUS_I(inode)->rsrc_inode;
  
-diff -urNp linux-3.0.4/fs/hfsplus/ioctl.c linux-3.0.4/fs/hfsplus/ioctl.c
---- linux-3.0.4/fs/hfsplus/ioctl.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/hfsplus/ioctl.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/hfsplus/ioctl.c linux-3.1.3/fs/hfsplus/ioctl.c
+--- linux-3.1.3/fs/hfsplus/ioctl.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/hfsplus/ioctl.c     2011-11-16 18:40:29.000000000 -0500
 @@ -122,6 +122,8 @@ int hfsplus_setxattr(struct dentry *dent
        struct hfsplus_cat_file *file;
        int res;
@@ -41373,11 +44010,11 @@ diff -urNp linux-3.0.4/fs/hfsplus/ioctl.c linux-3.0.4/fs/hfsplus/ioctl.c
        if (!S_ISREG(inode->i_mode) || HFSPLUS_IS_RSRC(inode))
                return -EOPNOTSUPP;
  
-diff -urNp linux-3.0.4/fs/hfsplus/super.c linux-3.0.4/fs/hfsplus/super.c
---- linux-3.0.4/fs/hfsplus/super.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/hfsplus/super.c     2011-08-23 21:48:14.000000000 -0400
-@@ -340,6 +340,8 @@ static int hfsplus_fill_super(struct sup
-       struct nls_table *nls = NULL;
+diff -urNp linux-3.1.3/fs/hfsplus/super.c linux-3.1.3/fs/hfsplus/super.c
+--- linux-3.1.3/fs/hfsplus/super.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/hfsplus/super.c     2011-11-16 19:23:30.000000000 -0500
+@@ -347,6 +347,8 @@ static int hfsplus_fill_super(struct sup
+       u64 last_fs_block, last_fs_page;
        int err;
  
 +      pax_track_stack();
@@ -41385,10 +44022,10 @@ diff -urNp linux-3.0.4/fs/hfsplus/super.c linux-3.0.4/fs/hfsplus/super.c
        err = -EINVAL;
        sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
        if (!sbi)
-diff -urNp linux-3.0.4/fs/hugetlbfs/inode.c linux-3.0.4/fs/hugetlbfs/inode.c
---- linux-3.0.4/fs/hugetlbfs/inode.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/hugetlbfs/inode.c   2011-08-23 21:48:14.000000000 -0400
-@@ -914,7 +914,7 @@ static struct file_system_type hugetlbfs
+diff -urNp linux-3.1.3/fs/hugetlbfs/inode.c linux-3.1.3/fs/hugetlbfs/inode.c
+--- linux-3.1.3/fs/hugetlbfs/inode.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/hugetlbfs/inode.c   2011-11-16 18:40:29.000000000 -0500
+@@ -915,7 +915,7 @@ static struct file_system_type hugetlbfs
        .kill_sb        = kill_litter_super,
  };
  
@@ -41397,10 +44034,10 @@ diff -urNp linux-3.0.4/fs/hugetlbfs/inode.c linux-3.0.4/fs/hugetlbfs/inode.c
  
  static int can_do_hugetlb_shm(void)
  {
-diff -urNp linux-3.0.4/fs/inode.c linux-3.0.4/fs/inode.c
---- linux-3.0.4/fs/inode.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/inode.c     2011-08-23 21:47:56.000000000 -0400
-@@ -829,8 +829,8 @@ unsigned int get_next_ino(void)
+diff -urNp linux-3.1.3/fs/inode.c linux-3.1.3/fs/inode.c
+--- linux-3.1.3/fs/inode.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/inode.c     2011-11-16 18:39:08.000000000 -0500
+@@ -787,8 +787,8 @@ unsigned int get_next_ino(void)
  
  #ifdef CONFIG_SMP
        if (unlikely((res & (LAST_INO_BATCH-1)) == 0)) {
@@ -41411,10 +44048,10 @@ diff -urNp linux-3.0.4/fs/inode.c linux-3.0.4/fs/inode.c
  
                res = next - LAST_INO_BATCH;
        }
-diff -urNp linux-3.0.4/fs/jbd/checkpoint.c linux-3.0.4/fs/jbd/checkpoint.c
---- linux-3.0.4/fs/jbd/checkpoint.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/jbd/checkpoint.c    2011-08-23 21:48:14.000000000 -0400
-@@ -350,6 +350,8 @@ int log_do_checkpoint(journal_t *journal
+diff -urNp linux-3.1.3/fs/jbd/checkpoint.c linux-3.1.3/fs/jbd/checkpoint.c
+--- linux-3.1.3/fs/jbd/checkpoint.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/jbd/checkpoint.c    2011-11-16 18:40:29.000000000 -0500
+@@ -358,6 +358,8 @@ int log_do_checkpoint(journal_t *journal
        tid_t this_tid;
        int result;
  
@@ -41423,9 +44060,9 @@ diff -urNp linux-3.0.4/fs/jbd/checkpoint.c linux-3.0.4/fs/jbd/checkpoint.c
        jbd_debug(1, "Start checkpoint\n");
  
        /*
-diff -urNp linux-3.0.4/fs/jffs2/compr_rtime.c linux-3.0.4/fs/jffs2/compr_rtime.c
---- linux-3.0.4/fs/jffs2/compr_rtime.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/jffs2/compr_rtime.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/jffs2/compr_rtime.c linux-3.1.3/fs/jffs2/compr_rtime.c
+--- linux-3.1.3/fs/jffs2/compr_rtime.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/jffs2/compr_rtime.c 2011-11-16 18:40:29.000000000 -0500
 @@ -37,6 +37,8 @@ static int jffs2_rtime_compress(unsigned
        int outpos = 0;
        int pos=0;
@@ -41444,9 +44081,9 @@ diff -urNp linux-3.0.4/fs/jffs2/compr_rtime.c linux-3.0.4/fs/jffs2/compr_rtime.c
        memset(positions,0,sizeof(positions));
  
        while (outpos<destlen) {
-diff -urNp linux-3.0.4/fs/jffs2/compr_rubin.c linux-3.0.4/fs/jffs2/compr_rubin.c
---- linux-3.0.4/fs/jffs2/compr_rubin.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/jffs2/compr_rubin.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/jffs2/compr_rubin.c linux-3.1.3/fs/jffs2/compr_rubin.c
+--- linux-3.1.3/fs/jffs2/compr_rubin.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/jffs2/compr_rubin.c 2011-11-16 18:40:29.000000000 -0500
 @@ -314,6 +314,8 @@ static int jffs2_dynrubin_compress(unsig
        int ret;
        uint32_t mysrclen, mydstlen;
@@ -41456,9 +44093,9 @@ diff -urNp linux-3.0.4/fs/jffs2/compr_rubin.c linux-3.0.4/fs/jffs2/compr_rubin.c
        mysrclen = *sourcelen;
        mydstlen = *dstlen - 8;
  
-diff -urNp linux-3.0.4/fs/jffs2/erase.c linux-3.0.4/fs/jffs2/erase.c
---- linux-3.0.4/fs/jffs2/erase.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/jffs2/erase.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/jffs2/erase.c linux-3.1.3/fs/jffs2/erase.c
+--- linux-3.1.3/fs/jffs2/erase.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/jffs2/erase.c       2011-11-16 18:39:08.000000000 -0500
 @@ -439,7 +439,8 @@ static void jffs2_mark_erased_block(stru
                struct jffs2_unknown_node marker = {
                        .magic =        cpu_to_je16(JFFS2_MAGIC_BITMASK),
@@ -41469,9 +44106,9 @@ diff -urNp linux-3.0.4/fs/jffs2/erase.c linux-3.0.4/fs/jffs2/erase.c
                };
  
                jffs2_prealloc_raw_node_refs(c, jeb, 1);
-diff -urNp linux-3.0.4/fs/jffs2/wbuf.c linux-3.0.4/fs/jffs2/wbuf.c
---- linux-3.0.4/fs/jffs2/wbuf.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/jffs2/wbuf.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/jffs2/wbuf.c linux-3.1.3/fs/jffs2/wbuf.c
+--- linux-3.1.3/fs/jffs2/wbuf.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/jffs2/wbuf.c        2011-11-16 18:39:08.000000000 -0500
 @@ -1012,7 +1012,8 @@ static const struct jffs2_unknown_node o
  {
        .magic = constant_cpu_to_je16(JFFS2_MAGIC_BITMASK),
@@ -41482,9 +44119,9 @@ diff -urNp linux-3.0.4/fs/jffs2/wbuf.c linux-3.0.4/fs/jffs2/wbuf.c
  };
  
  /*
-diff -urNp linux-3.0.4/fs/jffs2/xattr.c linux-3.0.4/fs/jffs2/xattr.c
---- linux-3.0.4/fs/jffs2/xattr.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/jffs2/xattr.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/jffs2/xattr.c linux-3.1.3/fs/jffs2/xattr.c
+--- linux-3.1.3/fs/jffs2/xattr.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/jffs2/xattr.c       2011-11-16 18:40:29.000000000 -0500
 @@ -773,6 +773,8 @@ void jffs2_build_xattr_subsystem(struct 
  
        BUG_ON(!(c->flags & JFFS2_SB_FLAG_BUILDING));
@@ -41494,9 +44131,9 @@ diff -urNp linux-3.0.4/fs/jffs2/xattr.c linux-3.0.4/fs/jffs2/xattr.c
        /* Phase.1 : Merge same xref */
        for (i=0; i < XREF_TMPHASH_SIZE; i++)
                xref_tmphash[i] = NULL;
-diff -urNp linux-3.0.4/fs/jfs/super.c linux-3.0.4/fs/jfs/super.c
---- linux-3.0.4/fs/jfs/super.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/jfs/super.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/jfs/super.c linux-3.1.3/fs/jfs/super.c
+--- linux-3.1.3/fs/jfs/super.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/jfs/super.c 2011-11-16 18:39:08.000000000 -0500
 @@ -803,7 +803,7 @@ static int __init init_jfs_fs(void)
  
        jfs_inode_cachep =
@@ -41506,9 +44143,9 @@ diff -urNp linux-3.0.4/fs/jfs/super.c linux-3.0.4/fs/jfs/super.c
                            init_once);
        if (jfs_inode_cachep == NULL)
                return -ENOMEM;
-diff -urNp linux-3.0.4/fs/Kconfig.binfmt linux-3.0.4/fs/Kconfig.binfmt
---- linux-3.0.4/fs/Kconfig.binfmt      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/Kconfig.binfmt      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/Kconfig.binfmt linux-3.1.3/fs/Kconfig.binfmt
+--- linux-3.1.3/fs/Kconfig.binfmt      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/Kconfig.binfmt      2011-11-16 18:39:08.000000000 -0500
 @@ -86,7 +86,7 @@ config HAVE_AOUT
  
  config BINFMT_AOUT
@@ -41518,10 +44155,10 @@ diff -urNp linux-3.0.4/fs/Kconfig.binfmt linux-3.0.4/fs/Kconfig.binfmt
        ---help---
          A.out (Assembler.OUTput) is a set of formats for libraries and
          executables used in the earliest versions of UNIX.  Linux used
-diff -urNp linux-3.0.4/fs/libfs.c linux-3.0.4/fs/libfs.c
---- linux-3.0.4/fs/libfs.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/libfs.c     2011-08-23 21:47:56.000000000 -0400
-@@ -163,6 +163,9 @@ int dcache_readdir(struct file * filp, v
+diff -urNp linux-3.1.3/fs/libfs.c linux-3.1.3/fs/libfs.c
+--- linux-3.1.3/fs/libfs.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/libfs.c     2011-11-16 18:39:08.000000000 -0500
+@@ -165,6 +165,9 @@ int dcache_readdir(struct file * filp, v
  
                        for (p=q->next; p != &dentry->d_subdirs; p=p->next) {
                                struct dentry *next;
@@ -41531,7 +44168,7 @@ diff -urNp linux-3.0.4/fs/libfs.c linux-3.0.4/fs/libfs.c
                                next = list_entry(p, struct dentry, d_u.d_child);
                                spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED);
                                if (!simple_positive(next)) {
-@@ -172,7 +175,12 @@ int dcache_readdir(struct file * filp, v
+@@ -174,7 +177,12 @@ int dcache_readdir(struct file * filp, v
  
                                spin_unlock(&next->d_lock);
                                spin_unlock(&dentry->d_lock);
@@ -41545,9 +44182,9 @@ diff -urNp linux-3.0.4/fs/libfs.c linux-3.0.4/fs/libfs.c
                                            next->d_name.len, filp->f_pos, 
                                            next->d_inode->i_ino, 
                                            dt_type(next->d_inode)) < 0)
-diff -urNp linux-3.0.4/fs/lockd/clntproc.c linux-3.0.4/fs/lockd/clntproc.c
---- linux-3.0.4/fs/lockd/clntproc.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/lockd/clntproc.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/lockd/clntproc.c linux-3.1.3/fs/lockd/clntproc.c
+--- linux-3.1.3/fs/lockd/clntproc.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/lockd/clntproc.c    2011-11-16 18:40:29.000000000 -0500
 @@ -36,11 +36,11 @@ static const struct rpc_call_ops nlmclnt
  /*
   * Cookie counter for NLM requests
@@ -41562,7 +44199,7 @@ diff -urNp linux-3.0.4/fs/lockd/clntproc.c linux-3.0.4/fs/lockd/clntproc.c
  
        memcpy(c->data, &cookie, 4);
        c->len=4;
-@@ -620,6 +620,8 @@ nlmclnt_reclaim(struct nlm_host *host, s
+@@ -621,6 +621,8 @@ nlmclnt_reclaim(struct nlm_host *host, s
        struct nlm_rqst reqst, *req;
        int             status;
  
@@ -41571,10 +44208,10 @@ diff -urNp linux-3.0.4/fs/lockd/clntproc.c linux-3.0.4/fs/lockd/clntproc.c
        req = &reqst;
        memset(req, 0, sizeof(*req));
        locks_init_lock(&req->a_args.lock.fl);
-diff -urNp linux-3.0.4/fs/locks.c linux-3.0.4/fs/locks.c
---- linux-3.0.4/fs/locks.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/locks.c     2011-08-23 21:47:56.000000000 -0400
-@@ -2043,16 +2043,16 @@ void locks_remove_flock(struct file *fil
+diff -urNp linux-3.1.3/fs/locks.c linux-3.1.3/fs/locks.c
+--- linux-3.1.3/fs/locks.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/locks.c     2011-11-16 18:39:08.000000000 -0500
+@@ -2022,16 +2022,16 @@ void locks_remove_flock(struct file *fil
                return;
  
        if (filp->f_op && filp->f_op->flock) {
@@ -41595,9 +44232,9 @@ diff -urNp linux-3.0.4/fs/locks.c linux-3.0.4/fs/locks.c
        }
  
        lock_flocks();
-diff -urNp linux-3.0.4/fs/logfs/super.c linux-3.0.4/fs/logfs/super.c
---- linux-3.0.4/fs/logfs/super.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/logfs/super.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/logfs/super.c linux-3.1.3/fs/logfs/super.c
+--- linux-3.1.3/fs/logfs/super.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/logfs/super.c       2011-11-16 18:40:29.000000000 -0500
 @@ -266,6 +266,8 @@ static int logfs_recover_sb(struct super
        struct logfs_disk_super _ds1, *ds1 = &_ds1;
        int err, valid0, valid1;
@@ -41607,80 +44244,50 @@ diff -urNp linux-3.0.4/fs/logfs/super.c linux-3.0.4/fs/logfs/super.c
        /* read first superblock */
        err = wbuf_read(sb, super->s_sb_ofs[0], sizeof(*ds0), ds0);
        if (err)
-diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
---- linux-3.0.4/fs/namei.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/namei.c     2011-08-23 21:48:14.000000000 -0400
-@@ -237,21 +237,31 @@ int generic_permission(struct inode *ino
-               return ret;
+diff -urNp linux-3.1.3/fs/namei.c linux-3.1.3/fs/namei.c
+--- linux-3.1.3/fs/namei.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/namei.c     2011-11-17 00:36:54.000000000 -0500
+@@ -283,14 +283,22 @@ int generic_permission(struct inode *ino
  
+       if (S_ISDIR(inode->i_mode)) {
+               /* DACs are overridable for directories */
+-              if (ns_capable(inode_userns(inode), CAP_DAC_OVERRIDE))
+-                      return 0;
+               if (!(mask & MAY_WRITE))
+                       if (ns_capable(inode_userns(inode), CAP_DAC_READ_SEARCH))
+                               return 0;
++              if (ns_capable(inode_userns(inode), CAP_DAC_OVERRIDE))
++                      return 0;
+               return -EACCES;
+       }
        /*
--       * Read/write DACs are always overridable.
--       * Executable DACs are overridable for all directories and
--       * for non-directories that have least one exec bit set.
 +       * Searching includes executable on directories, else just read.
-        */
--      if (!(mask & MAY_EXEC) || execute_ok(inode))
--              if (ns_capable(inode_userns(inode), CAP_DAC_OVERRIDE))
++       */
 +      mask &= MAY_READ | MAY_WRITE | MAY_EXEC;
-+      if (mask == MAY_READ || (S_ISDIR(inode->i_mode) && !(mask & MAY_WRITE))) {
-+#ifdef CONFIG_GRKERNSEC
-+              if (flags & IPERM_FLAG_RCU)
-+                      return -ECHILD;
-+#endif
++      if (mask == MAY_READ)
 +              if (ns_capable(inode_userns(inode), CAP_DAC_READ_SEARCH))
++                      return 0;
++
++      /*
+        * Read/write DACs are always overridable.
+        * Executable DACs are overridable when there is
+        * at least one exec bit set.
+@@ -299,14 +307,6 @@ int generic_permission(struct inode *ino
+               if (ns_capable(inode_userns(inode), CAP_DAC_OVERRIDE))
                        return 0;
-+      }
  
-       /*
+-      /*
 -       * Searching includes executable on directories, else just read.
-+       * Read/write DACs are always overridable.
-+       * Executable DACs are overridable for all directories and
-+       * for non-directories that have least one exec bit set.
-        */
+-       */
 -      mask &= MAY_READ | MAY_WRITE | MAY_EXEC;
--      if (mask == MAY_READ || (S_ISDIR(inode->i_mode) && !(mask & MAY_WRITE)))
+-      if (mask == MAY_READ)
 -              if (ns_capable(inode_userns(inode), CAP_DAC_READ_SEARCH))
-+      if (!(mask & MAY_EXEC) || execute_ok(inode)) {
-+#ifdef CONFIG_GRKERNSEC
-+              if (flags & IPERM_FLAG_RCU)
-+                      return -ECHILD;
-+#endif
-+              if (ns_capable(inode_userns(inode), CAP_DAC_OVERRIDE))
-                       return 0;
-+      }
+-                      return 0;
+-
        return -EACCES;
  }
-@@ -547,6 +557,9 @@ static int complete_walk(struct nameidat
-               br_read_unlock(vfsmount_lock);
-       }
  
-+      if (!(nd->flags & LOOKUP_PARENT) && !gr_acl_handle_hidden_file(nd->path.dentry, nd->path.mnt))
-+              return -ENOENT;
-+
-       if (likely(!(nd->flags & LOOKUP_JUMPED)))
-               return 0;
-@@ -593,9 +606,16 @@ static inline int exec_permission(struct
-       if (ret == -ECHILD)
-               return ret;
--      if (ns_capable(ns, CAP_DAC_OVERRIDE) ||
--                      ns_capable(ns, CAP_DAC_READ_SEARCH))
-+      if (ns_capable_nolog(ns, CAP_DAC_OVERRIDE))
-               goto ok;
-+      else {
-+#ifdef CONFIG_GRKERNSEC
-+              if (flags & IPERM_FLAG_RCU)
-+                      return -ECHILD;
-+#endif
-+              if (ns_capable(ns, CAP_DAC_READ_SEARCH) || ns_capable(ns, CAP_DAC_OVERRIDE))
-+                      goto ok;
-+      }
-       return ret;
- ok:
-@@ -703,11 +723,19 @@ follow_link(struct path *link, struct na
+@@ -653,11 +653,19 @@ follow_link(struct path *link, struct na
                return error;
        }
  
@@ -41701,7 +44308,20 @@ diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
                error = 0;
                if (s)
                        error = __vfs_follow_link(nd, s);
-@@ -1625,6 +1653,9 @@ static int do_path_lookup(int dfd, const
+@@ -1622,6 +1630,12 @@ static int path_lookupat(int dfd, const 
+       if (!err)
+               err = complete_walk(nd);
++      if (!(nd->flags & LOOKUP_PARENT) && !gr_acl_handle_hidden_file(nd->path.dentry, nd->path.mnt)) {
++              if (!err)
++                      path_put(&nd->path);
++              err = -ENOENT;
++      }
++
+       if (!err && nd->flags & LOOKUP_DIRECTORY) {
+               if (!nd->inode->i_op->lookup) {
+                       path_put(&nd->path);
+@@ -1649,6 +1663,9 @@ static int do_path_lookup(int dfd, const
                retval = path_lookupat(dfd, name, flags | LOOKUP_REVAL, nd);
  
        if (likely(!retval)) {
@@ -41711,38 +44331,7 @@ diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
                if (unlikely(!audit_dummy_context())) {
                        if (nd->path.dentry && nd->inode)
                                audit_inode(name, nd->path.dentry);
-@@ -1935,6 +1966,30 @@ int vfs_create(struct inode *dir, struct
-       return error;
- }
-+/*
-+ * Note that while the flag value (low two bits) for sys_open means:
-+ *    00 - read-only
-+ *    01 - write-only
-+ *    10 - read-write
-+ *    11 - special
-+ * it is changed into
-+ *    00 - no permissions needed
-+ *    01 - read-permission
-+ *    10 - write-permission
-+ *    11 - read-write
-+ * for the internal routines (ie open_namei()/follow_link() etc)
-+ * This is more logical, and also allows the 00 "no perm needed"
-+ * to be used for symlinks (where the permissions are checked
-+ * later).
-+ *
-+*/
-+static inline int open_to_namei_flags(int flag)
-+{
-+      if ((flag+1) & O_ACCMODE)
-+              flag++;
-+      return flag;
-+}
-+
- static int may_open(struct path *path, int acc_mode, int flag)
- {
-       struct dentry *dentry = path->dentry;
-@@ -1987,7 +2042,27 @@ static int may_open(struct path *path, i
+@@ -2049,7 +2066,27 @@ static int may_open(struct path *path, i
        /*
         * Ensure there are no outstanding leases on the file.
         */
@@ -41762,7 +44351,7 @@ diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
 +              goto exit;
 +      }
 +
-+      if (!gr_acl_handle_open(dentry, path->mnt, open_to_namei_flags(flag))) {
++      if (!gr_acl_handle_open(dentry, path->mnt, acc_mode)) {
 +              error = -EACCES;
 +              goto exit;
 +      }
@@ -41771,51 +44360,46 @@ diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
  }
  
  static int handle_truncate(struct file *filp)
-@@ -2013,30 +2088,6 @@ static int handle_truncate(struct file *
- }
+@@ -2110,6 +2147,10 @@ static struct file *do_last(struct namei
+               error = complete_walk(nd);
+               if (error)
+                       return ERR_PTR(error);
++              if (!gr_acl_handle_hidden_file(nd->path.dentry, nd->path.mnt)) {
++                      error = -ENOENT;
++                      goto exit;
++              }
+               audit_inode(pathname, nd->path.dentry);
+               if (open_flag & O_CREAT) {
+                       error = -EISDIR;
+@@ -2120,6 +2161,10 @@ static struct file *do_last(struct namei
+               error = complete_walk(nd);
+               if (error)
+                       return ERR_PTR(error);
++              if (!gr_acl_handle_hidden_file(dir, nd->path.mnt)) {
++                      error = -ENOENT;
++                      goto exit;
++              }
+               audit_inode(pathname, dir);
+               goto ok;
+       }
+@@ -2142,6 +2187,11 @@ static struct file *do_last(struct namei
+               if (error)
+                       return ERR_PTR(-ECHILD);
  
- /*
-- * Note that while the flag value (low two bits) for sys_open means:
-- *    00 - read-only
-- *    01 - write-only
-- *    10 - read-write
-- *    11 - special
-- * it is changed into
-- *    00 - no permissions needed
-- *    01 - read-permission
-- *    10 - write-permission
-- *    11 - read-write
-- * for the internal routines (ie open_namei()/follow_link() etc)
-- * This is more logical, and also allows the 00 "no perm needed"
-- * to be used for symlinks (where the permissions are checked
-- * later).
-- *
--*/
--static inline int open_to_namei_flags(int flag)
--{
--      if ((flag+1) & O_ACCMODE)
--              flag++;
--      return flag;
--}
--
--/*
-  * Handle the last step of open()
-  */
- static struct file *do_last(struct nameidata *nd, struct path *path,
-@@ -2045,6 +2096,7 @@ static struct file *do_last(struct namei
-       struct dentry *dir = nd->path.dentry;
-       struct dentry *dentry;
-       int open_flag = op->open_flag;
-+      int flag = open_to_namei_flags(open_flag);
-       int will_truncate = open_flag & O_TRUNC;
-       int want_write = 0;
-       int acc_mode = op->acc_mode;
-@@ -2132,6 +2184,12 @@ static struct file *do_last(struct namei
++              if (!gr_acl_handle_hidden_file(nd->path.dentry, nd->path.mnt)) {
++                      error = -ENOENT;
++                      goto exit;
++              }
++
+               error = -ENOTDIR;
+               if (nd->flags & LOOKUP_DIRECTORY) {
+                       if (!nd->inode->i_op->lookup)
+@@ -2181,6 +2231,12 @@ static struct file *do_last(struct namei
        /* Negative dentry, just create the file */
        if (!dentry->d_inode) {
                int mode = op->mode;
 +
-+              if (!gr_acl_handle_creat(path->dentry, nd->path.dentry, path->mnt, flag, mode)) {
++              if (!gr_acl_handle_creat(path->dentry, nd->path.dentry, path->mnt, open_flag, acc_mode, mode)) {
 +                      error = -EACCES;
 +                      goto exit_mutex_unlock;
 +              }
@@ -41823,7 +44407,7 @@ diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
                if (!IS_POSIXACL(dir->d_inode))
                        mode &= ~current_umask();
                /*
-@@ -2155,6 +2213,8 @@ static struct file *do_last(struct namei
+@@ -2204,6 +2260,8 @@ static struct file *do_last(struct namei
                error = vfs_create(dir->d_inode, dentry, mode, nd);
                if (error)
                        goto exit_mutex_unlock;
@@ -41832,14 +44416,19 @@ diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
                mutex_unlock(&dir->d_inode->i_mutex);
                dput(nd->path.dentry);
                nd->path.dentry = dentry;
-@@ -2164,6 +2224,14 @@ static struct file *do_last(struct namei
+@@ -2213,6 +2271,19 @@ static struct file *do_last(struct namei
        /*
         * It already exists.
         */
 +
++      if (!gr_acl_handle_hidden_file(dentry, nd->path.mnt)) {
++              error = -ENOENT;
++              goto exit_mutex_unlock;
++      }
++
 +      /* only check if O_CREAT is specified, all other checks need to go
 +         into may_open */
-+      if (gr_handle_fifo(path->dentry, path->mnt, dir, flag, acc_mode)) {
++      if (gr_handle_fifo(path->dentry, path->mnt, dir, open_flag, acc_mode)) {
 +              error = -EACCES;
 +              goto exit_mutex_unlock;
 +      }
@@ -41847,58 +44436,90 @@ diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
        mutex_unlock(&dir->d_inode->i_mutex);
        audit_inode(pathname, path->dentry);
  
-@@ -2450,6 +2518,17 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const
-       error = may_mknod(mode);
+@@ -2425,6 +2496,11 @@ struct dentry *kern_path_create(int dfd,
+       *path = nd.path;
+       return dentry;
+ eexist:
++      if (!gr_acl_handle_hidden_file(dentry, nd.path.mnt)) {
++              dput(dentry);
++              dentry = ERR_PTR(-ENOENT);
++              goto fail;
++      }
+       dput(dentry);
+       dentry = ERR_PTR(-EEXIST);
+ fail:
+@@ -2447,6 +2523,20 @@ struct dentry *user_path_create(int dfd,
+ }
+ EXPORT_SYMBOL(user_path_create);
++static struct dentry *user_path_create_with_name(int dfd, const char __user *pathname, struct path *path, char **to, int is_dir)
++{
++      char *tmp = getname(pathname);
++      struct dentry *res;
++      if (IS_ERR(tmp))
++              return ERR_CAST(tmp);
++      res = kern_path_create(dfd, tmp, path, is_dir);
++      if (IS_ERR(res))
++              putname(tmp);
++      else
++              *to = tmp;
++      return res;
++}
++
+ int vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
+ {
+       int error = may_create(dir, dentry);
+@@ -2514,6 +2604,17 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const
+       error = mnt_want_write(path.mnt);
        if (error)
                goto out_dput;
 +
-+      if (gr_handle_chroot_mknod(dentry, nd.path.mnt, mode)) {
++      if (gr_handle_chroot_mknod(dentry, path.mnt, mode)) {
 +              error = -EPERM;
-+              goto out_dput;
++              goto out_drop_write;
 +      }
 +
-+      if (!gr_acl_handle_mknod(dentry, nd.path.dentry, nd.path.mnt, mode)) {
++      if (!gr_acl_handle_mknod(dentry, path.dentry, path.mnt, mode)) {
 +              error = -EACCES;
-+              goto out_dput;
++              goto out_drop_write;
 +      }
 +
-       error = mnt_want_write(nd.path.mnt);
+       error = security_path_mknod(&path, dentry, mode, dev);
        if (error)
-               goto out_dput;
-@@ -2470,6 +2549,9 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const
+               goto out_drop_write;
+@@ -2531,6 +2632,9 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const
        }
  out_drop_write:
-       mnt_drop_write(nd.path.mnt);
+       mnt_drop_write(path.mnt);
 +
 +      if (!error)
-+              gr_handle_create(dentry, nd.path.mnt);
++              gr_handle_create(dentry, path.mnt);
  out_dput:
        dput(dentry);
- out_unlock:
-@@ -2522,6 +2604,11 @@ SYSCALL_DEFINE3(mkdirat, int, dfd, const
-       if (IS_ERR(dentry))
-               goto out_unlock;
-+      if (!gr_acl_handle_mkdir(dentry, nd.path.dentry, nd.path.mnt)) {
+       mutex_unlock(&path.dentry->d_inode->i_mutex);
+@@ -2580,12 +2684,21 @@ SYSCALL_DEFINE3(mkdirat, int, dfd, const
+       error = mnt_want_write(path.mnt);
+       if (error)
+               goto out_dput;
++
++      if (!gr_acl_handle_mkdir(dentry, path.dentry, path.mnt)) {
 +              error = -EACCES;
-+              goto out_dput;
++              goto out_drop_write;
 +      }
 +
-       if (!IS_POSIXACL(nd.path.dentry->d_inode))
-               mode &= ~current_umask();
-       error = mnt_want_write(nd.path.mnt);
-@@ -2533,6 +2620,10 @@ SYSCALL_DEFINE3(mkdirat, int, dfd, const
-       error = vfs_mkdir(nd.path.dentry->d_inode, dentry, mode);
+       error = security_path_mkdir(&path, dentry, mode);
+       if (error)
+               goto out_drop_write;
+       error = vfs_mkdir(path.dentry->d_inode, dentry, mode);
  out_drop_write:
-       mnt_drop_write(nd.path.mnt);
+       mnt_drop_write(path.mnt);
 +
 +      if (!error)
-+              gr_handle_create(dentry, nd.path.mnt);
-+
++              gr_handle_create(dentry, path.mnt);
  out_dput:
        dput(dentry);
- out_unlock:
-@@ -2613,6 +2704,8 @@ static long do_rmdir(int dfd, const char
+       mutex_unlock(&path.dentry->d_inode->i_mutex);
+@@ -2665,6 +2778,8 @@ static long do_rmdir(int dfd, const char
        char * name;
        struct dentry *dentry;
        struct nameidata nd;
@@ -41907,15 +44528,13 @@ diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
  
        error = user_path_parent(dfd, pathname, &nd, &name);
        if (error)
-@@ -2641,6 +2734,17 @@ static long do_rmdir(int dfd, const char
+@@ -2693,6 +2808,15 @@ static long do_rmdir(int dfd, const char
                error = -ENOENT;
                goto exit3;
        }
 +
-+      if (dentry->d_inode->i_nlink <= 1) {
-+              saved_ino = dentry->d_inode->i_ino;
-+              saved_dev = gr_get_dev_from_dentry(dentry);
-+      }
++      saved_ino = dentry->d_inode->i_ino;
++      saved_dev = gr_get_dev_from_dentry(dentry);
 +
 +      if (!gr_acl_handle_rmdir(dentry, nd.path.mnt)) {
 +              error = -EACCES;
@@ -41925,7 +44544,7 @@ diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
        error = mnt_want_write(nd.path.mnt);
        if (error)
                goto exit3;
-@@ -2648,6 +2752,8 @@ static long do_rmdir(int dfd, const char
+@@ -2700,6 +2824,8 @@ static long do_rmdir(int dfd, const char
        if (error)
                goto exit4;
        error = vfs_rmdir(nd.path.dentry->d_inode, dentry);
@@ -41934,7 +44553,7 @@ diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
  exit4:
        mnt_drop_write(nd.path.mnt);
  exit3:
-@@ -2710,6 +2816,8 @@ static long do_unlinkat(int dfd, const c
+@@ -2762,6 +2888,8 @@ static long do_unlinkat(int dfd, const c
        struct dentry *dentry;
        struct nameidata nd;
        struct inode *inode = NULL;
@@ -41943,7 +44562,7 @@ diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
  
        error = user_path_parent(dfd, pathname, &nd, &name);
        if (error)
-@@ -2732,6 +2840,16 @@ static long do_unlinkat(int dfd, const c
+@@ -2784,6 +2912,16 @@ static long do_unlinkat(int dfd, const c
                if (!inode)
                        goto slashes;
                ihold(inode);
@@ -41960,7 +44579,7 @@ diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
                error = mnt_want_write(nd.path.mnt);
                if (error)
                        goto exit2;
-@@ -2739,6 +2857,8 @@ static long do_unlinkat(int dfd, const c
+@@ -2791,6 +2929,8 @@ static long do_unlinkat(int dfd, const c
                if (error)
                        goto exit3;
                error = vfs_unlink(nd.path.dentry->d_inode, dentry);
@@ -41969,58 +44588,74 @@ diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
  exit3:
                mnt_drop_write(nd.path.mnt);
        exit2:
-@@ -2816,6 +2936,11 @@ SYSCALL_DEFINE3(symlinkat, const char __
-       if (IS_ERR(dentry))
-               goto out_unlock;
-+      if (!gr_acl_handle_symlink(dentry, nd.path.dentry, nd.path.mnt, from)) {
+@@ -2866,10 +3006,18 @@ SYSCALL_DEFINE3(symlinkat, const char __
+       error = mnt_want_write(path.mnt);
+       if (error)
+               goto out_dput;
++
++      if (!gr_acl_handle_symlink(dentry, path.dentry, path.mnt, from)) {
 +              error = -EACCES;
-+              goto out_dput;
++              goto out_drop_write;
 +      }
 +
-       error = mnt_want_write(nd.path.mnt);
-       if (error)
-               goto out_dput;
-@@ -2823,6 +2948,8 @@ SYSCALL_DEFINE3(symlinkat, const char __
+       error = security_path_symlink(&path, dentry, from);
        if (error)
                goto out_drop_write;
-       error = vfs_symlink(nd.path.dentry->d_inode, dentry, from);
+       error = vfs_symlink(path.dentry->d_inode, dentry, from);
 +      if (!error)
-+              gr_handle_create(dentry, nd.path.mnt);
++              gr_handle_create(dentry, path.mnt);
  out_drop_write:
-       mnt_drop_write(nd.path.mnt);
+       mnt_drop_write(path.mnt);
  out_dput:
-@@ -2931,6 +3058,20 @@ SYSCALL_DEFINE5(linkat, int, olddfd, con
+@@ -2941,6 +3089,7 @@ SYSCALL_DEFINE5(linkat, int, olddfd, con
+ {
+       struct dentry *new_dentry;
+       struct path old_path, new_path;
++      char *to;
+       int how = 0;
+       int error;
+@@ -2964,7 +3113,7 @@ SYSCALL_DEFINE5(linkat, int, olddfd, con
+       if (error)
+               return error;
+-      new_dentry = user_path_create(newdfd, newname, &new_path, 0);
++      new_dentry = user_path_create_with_name(newdfd, newname, &new_path, &to, 0);
        error = PTR_ERR(new_dentry);
        if (IS_ERR(new_dentry))
-               goto out_unlock;
+               goto out;
+@@ -2975,13 +3124,30 @@ SYSCALL_DEFINE5(linkat, int, olddfd, con
+       error = mnt_want_write(new_path.mnt);
+       if (error)
+               goto out_dput;
 +
 +      if (gr_handle_hardlink(old_path.dentry, old_path.mnt,
 +                             old_path.dentry->d_inode,
 +                             old_path.dentry->d_inode->i_mode, to)) {
 +              error = -EACCES;
-+              goto out_dput;
++              goto out_drop_write;
 +      }
 +
-+      if (!gr_acl_handle_link(new_dentry, nd.path.dentry, nd.path.mnt,
++      if (!gr_acl_handle_link(new_dentry, new_path.dentry, new_path.mnt,
 +                              old_path.dentry, old_path.mnt, to)) {
 +              error = -EACCES;
-+              goto out_dput;
++              goto out_drop_write;
 +      }
 +
-       error = mnt_want_write(nd.path.mnt);
-       if (error)
-               goto out_dput;
-@@ -2938,6 +3079,8 @@ SYSCALL_DEFINE5(linkat, int, olddfd, con
+       error = security_path_link(old_path.dentry, &new_path, new_dentry);
        if (error)
                goto out_drop_write;
-       error = vfs_link(old_path.dentry, nd.path.dentry->d_inode, new_dentry);
+       error = vfs_link(old_path.dentry, new_path.dentry->d_inode, new_dentry);
 +      if (!error)
-+              gr_handle_create(new_dentry, nd.path.mnt);
++              gr_handle_create(new_dentry, new_path.mnt);
  out_drop_write:
-       mnt_drop_write(nd.path.mnt);
+       mnt_drop_write(new_path.mnt);
  out_dput:
-@@ -3113,6 +3256,8 @@ SYSCALL_DEFINE4(renameat, int, olddfd, c
++      putname(to);
+       dput(new_dentry);
+       mutex_unlock(&new_path.dentry->d_inode->i_mutex);
+       path_put(&new_path);
+@@ -3153,6 +3319,8 @@ SYSCALL_DEFINE4(renameat, int, olddfd, c
        char *to;
        int error;
  
@@ -42029,7 +44664,7 @@ diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
        error = user_path_parent(olddfd, oldname, &oldnd, &from);
        if (error)
                goto exit;
-@@ -3169,6 +3314,12 @@ SYSCALL_DEFINE4(renameat, int, olddfd, c
+@@ -3209,6 +3377,12 @@ SYSCALL_DEFINE4(renameat, int, olddfd, c
        if (new_dentry == trap)
                goto exit5;
  
@@ -42042,7 +44677,7 @@ diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
        error = mnt_want_write(oldnd.path.mnt);
        if (error)
                goto exit5;
-@@ -3178,6 +3329,9 @@ SYSCALL_DEFINE4(renameat, int, olddfd, c
+@@ -3218,6 +3392,9 @@ SYSCALL_DEFINE4(renameat, int, olddfd, c
                goto exit6;
        error = vfs_rename(old_dir->d_inode, old_dentry,
                                   new_dir->d_inode, new_dentry);
@@ -42052,7 +44687,7 @@ diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
  exit6:
        mnt_drop_write(oldnd.path.mnt);
  exit5:
-@@ -3203,6 +3357,8 @@ SYSCALL_DEFINE2(rename, const char __use
+@@ -3243,6 +3420,8 @@ SYSCALL_DEFINE2(rename, const char __use
  
  int vfs_readlink(struct dentry *dentry, char __user *buffer, int buflen, const char *link)
  {
@@ -42061,7 +44696,7 @@ diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
        int len;
  
        len = PTR_ERR(link);
-@@ -3212,7 +3368,14 @@ int vfs_readlink(struct dentry *dentry, 
+@@ -3252,7 +3431,14 @@ int vfs_readlink(struct dentry *dentry, 
        len = strlen(link);
        if (len > (unsigned) buflen)
                len = buflen;
@@ -42077,10 +44712,10 @@ diff -urNp linux-3.0.4/fs/namei.c linux-3.0.4/fs/namei.c
                len = -EFAULT;
  out:
        return len;
-diff -urNp linux-3.0.4/fs/namespace.c linux-3.0.4/fs/namespace.c
---- linux-3.0.4/fs/namespace.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/namespace.c 2011-08-23 21:48:14.000000000 -0400
-@@ -1328,6 +1328,9 @@ static int do_umount(struct vfsmount *mn
+diff -urNp linux-3.1.3/fs/namespace.c linux-3.1.3/fs/namespace.c
+--- linux-3.1.3/fs/namespace.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/namespace.c 2011-11-16 18:40:29.000000000 -0500
+@@ -1329,6 +1329,9 @@ static int do_umount(struct vfsmount *mn
                if (!(sb->s_flags & MS_RDONLY))
                        retval = do_remount_sb(sb, MS_RDONLY, NULL, 0);
                up_write(&sb->s_umount);
@@ -42090,7 +44725,7 @@ diff -urNp linux-3.0.4/fs/namespace.c linux-3.0.4/fs/namespace.c
                return retval;
        }
  
-@@ -1347,6 +1350,9 @@ static int do_umount(struct vfsmount *mn
+@@ -1348,6 +1351,9 @@ static int do_umount(struct vfsmount *mn
        br_write_unlock(vfsmount_lock);
        up_write(&namespace_sem);
        release_mounts(&umount_list);
@@ -42100,7 +44735,7 @@ diff -urNp linux-3.0.4/fs/namespace.c linux-3.0.4/fs/namespace.c
        return retval;
  }
  
-@@ -2338,6 +2344,16 @@ long do_mount(char *dev_name, char *dir_
+@@ -2339,6 +2345,16 @@ long do_mount(char *dev_name, char *dir_
                   MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT |
                   MS_STRICTATIME);
  
@@ -42117,7 +44752,7 @@ diff -urNp linux-3.0.4/fs/namespace.c linux-3.0.4/fs/namespace.c
        if (flags & MS_REMOUNT)
                retval = do_remount(&path, flags & ~MS_REMOUNT, mnt_flags,
                                    data_page);
-@@ -2352,6 +2368,9 @@ long do_mount(char *dev_name, char *dir_
+@@ -2353,6 +2369,9 @@ long do_mount(char *dev_name, char *dir_
                                      dev_name, data_page);
  dput_out:
        path_put(&path);
@@ -42127,7 +44762,7 @@ diff -urNp linux-3.0.4/fs/namespace.c linux-3.0.4/fs/namespace.c
        return retval;
  }
  
-@@ -2575,6 +2594,11 @@ SYSCALL_DEFINE2(pivot_root, const char _
+@@ -2576,6 +2595,11 @@ SYSCALL_DEFINE2(pivot_root, const char _
        if (error)
                goto out2;
  
@@ -42139,9 +44774,9 @@ diff -urNp linux-3.0.4/fs/namespace.c linux-3.0.4/fs/namespace.c
        get_fs_root(current->fs, &root);
        error = lock_mount(&old);
        if (error)
-diff -urNp linux-3.0.4/fs/ncpfs/dir.c linux-3.0.4/fs/ncpfs/dir.c
---- linux-3.0.4/fs/ncpfs/dir.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/ncpfs/dir.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/ncpfs/dir.c linux-3.1.3/fs/ncpfs/dir.c
+--- linux-3.1.3/fs/ncpfs/dir.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ncpfs/dir.c 2011-11-16 18:40:29.000000000 -0500
 @@ -299,6 +299,8 @@ ncp_lookup_validate(struct dentry *dentr
        int res, val = 0, len;
        __u8 __name[NCP_MAXPATHLEN + 1];
@@ -42187,9 +44822,9 @@ diff -urNp linux-3.0.4/fs/ncpfs/dir.c linux-3.0.4/fs/ncpfs/dir.c
        DPRINTK("ncp_rename: %s/%s to %s/%s\n",
                old_dentry->d_parent->d_name.name, old_dentry->d_name.name,
                new_dentry->d_parent->d_name.name, new_dentry->d_name.name);
-diff -urNp linux-3.0.4/fs/ncpfs/inode.c linux-3.0.4/fs/ncpfs/inode.c
---- linux-3.0.4/fs/ncpfs/inode.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/ncpfs/inode.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/ncpfs/inode.c linux-3.1.3/fs/ncpfs/inode.c
+--- linux-3.1.3/fs/ncpfs/inode.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ncpfs/inode.c       2011-11-16 18:40:29.000000000 -0500
 @@ -461,6 +461,8 @@ static int ncp_fill_super(struct super_b
  #endif
        struct ncp_entry_info finfo;
@@ -42199,9 +44834,21 @@ diff -urNp linux-3.0.4/fs/ncpfs/inode.c linux-3.0.4/fs/ncpfs/inode.c
        memset(&data, 0, sizeof(data));
        server = kzalloc(sizeof(struct ncp_server), GFP_KERNEL);
        if (!server)
-diff -urNp linux-3.0.4/fs/nfs/inode.c linux-3.0.4/fs/nfs/inode.c
---- linux-3.0.4/fs/nfs/inode.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/nfs/inode.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/nfs/blocklayout/blocklayout.c linux-3.1.3/fs/nfs/blocklayout/blocklayout.c
+--- linux-3.1.3/fs/nfs/blocklayout/blocklayout.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/nfs/blocklayout/blocklayout.c       2011-11-16 18:39:08.000000000 -0500
+@@ -90,7 +90,7 @@ static int is_writable(struct pnfs_block
+  */
+ struct parallel_io {
+       struct kref refcnt;
+-      struct rpc_call_ops call_ops;
++      rpc_call_ops_no_const call_ops;
+       void (*pnfs_callback) (void *data);
+       void *data;
+ };
+diff -urNp linux-3.1.3/fs/nfs/inode.c linux-3.1.3/fs/nfs/inode.c
+--- linux-3.1.3/fs/nfs/inode.c 2011-11-26 19:57:29.000000000 -0500
++++ linux-3.1.3/fs/nfs/inode.c 2011-11-26 20:00:43.000000000 -0500
 @@ -150,7 +150,7 @@ static void nfs_zap_caches_locked(struct
        nfsi->attrtimeo = NFS_MINATTRTIMEO(inode);
        nfsi->attrtimeo_timestamp = jiffies;
@@ -42211,7 +44858,7 @@ diff -urNp linux-3.0.4/fs/nfs/inode.c linux-3.0.4/fs/nfs/inode.c
        if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode))
                nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE;
        else
-@@ -1000,16 +1000,16 @@ static int nfs_size_need_update(const st
+@@ -1002,16 +1002,16 @@ static int nfs_size_need_update(const st
        return nfs_size_to_loff_t(fattr->size) > i_size_read(inode);
  }
  
@@ -42231,10 +44878,10 @@ diff -urNp linux-3.0.4/fs/nfs/inode.c linux-3.0.4/fs/nfs/inode.c
  }
  
  void nfs_fattr_init(struct nfs_fattr *fattr)
-diff -urNp linux-3.0.4/fs/nfsd/nfs4state.c linux-3.0.4/fs/nfsd/nfs4state.c
---- linux-3.0.4/fs/nfsd/nfs4state.c    2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/fs/nfsd/nfs4state.c    2011-08-23 21:48:14.000000000 -0400
-@@ -3794,6 +3794,8 @@ nfsd4_lock(struct svc_rqst *rqstp, struc
+diff -urNp linux-3.1.3/fs/nfsd/nfs4state.c linux-3.1.3/fs/nfsd/nfs4state.c
+--- linux-3.1.3/fs/nfsd/nfs4state.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/nfsd/nfs4state.c    2011-11-16 18:40:29.000000000 -0500
+@@ -3999,6 +3999,8 @@ nfsd4_lock(struct svc_rqst *rqstp, struc
        unsigned int strhashval;
        int err;
  
@@ -42243,10 +44890,10 @@ diff -urNp linux-3.0.4/fs/nfsd/nfs4state.c linux-3.0.4/fs/nfsd/nfs4state.c
        dprintk("NFSD: nfsd4_lock: start=%Ld length=%Ld\n",
                (long long) lock->lk_offset,
                (long long) lock->lk_length);
-diff -urNp linux-3.0.4/fs/nfsd/nfs4xdr.c linux-3.0.4/fs/nfsd/nfs4xdr.c
---- linux-3.0.4/fs/nfsd/nfs4xdr.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/nfsd/nfs4xdr.c      2011-08-23 21:48:14.000000000 -0400
-@@ -1788,6 +1788,8 @@ nfsd4_encode_fattr(struct svc_fh *fhp, s
+diff -urNp linux-3.1.3/fs/nfsd/nfs4xdr.c linux-3.1.3/fs/nfsd/nfs4xdr.c
+--- linux-3.1.3/fs/nfsd/nfs4xdr.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/nfsd/nfs4xdr.c      2011-11-16 18:40:29.000000000 -0500
+@@ -1875,6 +1875,8 @@ nfsd4_encode_fattr(struct svc_fh *fhp, s
                .dentry = dentry,
        };
  
@@ -42255,15 +44902,15 @@ diff -urNp linux-3.0.4/fs/nfsd/nfs4xdr.c linux-3.0.4/fs/nfsd/nfs4xdr.c
        BUG_ON(bmval1 & NFSD_WRITEONLY_ATTRS_WORD1);
        BUG_ON(bmval0 & ~nfsd_suppattrs0(minorversion));
        BUG_ON(bmval1 & ~nfsd_suppattrs1(minorversion));
-diff -urNp linux-3.0.4/fs/nfsd/vfs.c linux-3.0.4/fs/nfsd/vfs.c
---- linux-3.0.4/fs/nfsd/vfs.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/nfsd/vfs.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/nfsd/vfs.c linux-3.1.3/fs/nfsd/vfs.c
+--- linux-3.1.3/fs/nfsd/vfs.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/nfsd/vfs.c  2011-11-16 18:39:08.000000000 -0500
 @@ -896,7 +896,7 @@ nfsd_vfs_read(struct svc_rqst *rqstp, st
        } else {
                oldfs = get_fs();
                set_fs(KERNEL_DS);
 -              host_err = vfs_readv(file, (struct iovec __user *)vec, vlen, &offset);
-+              host_err = vfs_readv(file, (__force struct iovec __user *)vec, vlen, &offset);
++              host_err = vfs_readv(file, (struct iovec __force_user *)vec, vlen, &offset);
                set_fs(oldfs);
        }
  
@@ -42272,7 +44919,7 @@ diff -urNp linux-3.0.4/fs/nfsd/vfs.c linux-3.0.4/fs/nfsd/vfs.c
        /* Write the data. */
        oldfs = get_fs(); set_fs(KERNEL_DS);
 -      host_err = vfs_writev(file, (struct iovec __user *)vec, vlen, &offset);
-+      host_err = vfs_writev(file, (__force struct iovec __user *)vec, vlen, &offset);
++      host_err = vfs_writev(file, (struct iovec __force_user *)vec, vlen, &offset);
        set_fs(oldfs);
        if (host_err < 0)
                goto out_nfserr;
@@ -42281,13 +44928,13 @@ diff -urNp linux-3.0.4/fs/nfsd/vfs.c linux-3.0.4/fs/nfsd/vfs.c
  
        oldfs = get_fs(); set_fs(KERNEL_DS);
 -      host_err = inode->i_op->readlink(dentry, buf, *lenp);
-+      host_err = inode->i_op->readlink(dentry, (__force char __user *)buf, *lenp);
++      host_err = inode->i_op->readlink(dentry, (char __force_user *)buf, *lenp);
        set_fs(oldfs);
  
        if (host_err < 0)
-diff -urNp linux-3.0.4/fs/notify/fanotify/fanotify_user.c linux-3.0.4/fs/notify/fanotify/fanotify_user.c
---- linux-3.0.4/fs/notify/fanotify/fanotify_user.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/notify/fanotify/fanotify_user.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/notify/fanotify/fanotify_user.c linux-3.1.3/fs/notify/fanotify/fanotify_user.c
+--- linux-3.1.3/fs/notify/fanotify/fanotify_user.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/notify/fanotify/fanotify_user.c     2011-11-16 18:39:08.000000000 -0500
 @@ -276,7 +276,8 @@ static ssize_t copy_event_to_user(struct
                goto out_close_fd;
  
@@ -42298,9 +44945,9 @@ diff -urNp linux-3.0.4/fs/notify/fanotify/fanotify_user.c linux-3.0.4/fs/notify/
                         fanotify_event_metadata.event_len))
                goto out_kill_access_response;
  
-diff -urNp linux-3.0.4/fs/notify/notification.c linux-3.0.4/fs/notify/notification.c
---- linux-3.0.4/fs/notify/notification.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/notify/notification.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/notify/notification.c linux-3.1.3/fs/notify/notification.c
+--- linux-3.1.3/fs/notify/notification.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/notify/notification.c       2011-11-16 18:39:08.000000000 -0500
 @@ -57,7 +57,7 @@ static struct kmem_cache *fsnotify_event
   * get set to 0 so it will never get 'freed'
   */
@@ -42319,9 +44966,9 @@ diff -urNp linux-3.0.4/fs/notify/notification.c linux-3.0.4/fs/notify/notificati
  }
  EXPORT_SYMBOL_GPL(fsnotify_get_cookie);
  
-diff -urNp linux-3.0.4/fs/ntfs/dir.c linux-3.0.4/fs/ntfs/dir.c
---- linux-3.0.4/fs/ntfs/dir.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/ntfs/dir.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/ntfs/dir.c linux-3.1.3/fs/ntfs/dir.c
+--- linux-3.1.3/fs/ntfs/dir.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ntfs/dir.c  2011-11-16 18:39:08.000000000 -0500
 @@ -1329,7 +1329,7 @@ find_next_index_buffer:
        ia = (INDEX_ALLOCATION*)(kaddr + (ia_pos & ~PAGE_CACHE_MASK &
                        ~(s64)(ndir->itype.index.block_size - 1)));
@@ -42331,10 +44978,10 @@ diff -urNp linux-3.0.4/fs/ntfs/dir.c linux-3.0.4/fs/ntfs/dir.c
                ntfs_error(sb, "Out of bounds check failed. Corrupt directory "
                                "inode 0x%lx or driver bug.", vdir->i_ino);
                goto err_out;
-diff -urNp linux-3.0.4/fs/ntfs/file.c linux-3.0.4/fs/ntfs/file.c
---- linux-3.0.4/fs/ntfs/file.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/ntfs/file.c 2011-08-23 21:47:56.000000000 -0400
-@@ -2222,6 +2222,6 @@ const struct inode_operations ntfs_file_
+diff -urNp linux-3.1.3/fs/ntfs/file.c linux-3.1.3/fs/ntfs/file.c
+--- linux-3.1.3/fs/ntfs/file.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ntfs/file.c 2011-11-16 18:39:08.000000000 -0500
+@@ -2229,6 +2229,6 @@ const struct inode_operations ntfs_file_
  #endif /* NTFS_RW */
  };
  
@@ -42343,9 +44990,9 @@ diff -urNp linux-3.0.4/fs/ntfs/file.c linux-3.0.4/fs/ntfs/file.c
  
 -const struct inode_operations ntfs_empty_inode_ops = {};
 +const struct inode_operations ntfs_empty_inode_ops __read_only;
-diff -urNp linux-3.0.4/fs/ocfs2/localalloc.c linux-3.0.4/fs/ocfs2/localalloc.c
---- linux-3.0.4/fs/ocfs2/localalloc.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/ocfs2/localalloc.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/ocfs2/localalloc.c linux-3.1.3/fs/ocfs2/localalloc.c
+--- linux-3.1.3/fs/ocfs2/localalloc.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ocfs2/localalloc.c  2011-11-16 18:39:08.000000000 -0500
 @@ -1283,7 +1283,7 @@ static int ocfs2_local_alloc_slide_windo
                goto bail;
        }
@@ -42355,9 +45002,9 @@ diff -urNp linux-3.0.4/fs/ocfs2/localalloc.c linux-3.0.4/fs/ocfs2/localalloc.c
  
  bail:
        if (handle)
-diff -urNp linux-3.0.4/fs/ocfs2/namei.c linux-3.0.4/fs/ocfs2/namei.c
---- linux-3.0.4/fs/ocfs2/namei.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/ocfs2/namei.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/ocfs2/namei.c linux-3.1.3/fs/ocfs2/namei.c
+--- linux-3.1.3/fs/ocfs2/namei.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ocfs2/namei.c       2011-11-16 18:40:29.000000000 -0500
 @@ -1063,6 +1063,8 @@ static int ocfs2_rename(struct inode *ol
        struct ocfs2_dir_lookup_result orphan_insert = { NULL, };
        struct ocfs2_dir_lookup_result target_insert = { NULL, };
@@ -42367,9 +45014,9 @@ diff -urNp linux-3.0.4/fs/ocfs2/namei.c linux-3.0.4/fs/ocfs2/namei.c
        /* At some point it might be nice to break this function up a
         * bit. */
  
-diff -urNp linux-3.0.4/fs/ocfs2/ocfs2.h linux-3.0.4/fs/ocfs2/ocfs2.h
---- linux-3.0.4/fs/ocfs2/ocfs2.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/ocfs2/ocfs2.h       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/ocfs2/ocfs2.h linux-3.1.3/fs/ocfs2/ocfs2.h
+--- linux-3.1.3/fs/ocfs2/ocfs2.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ocfs2/ocfs2.h       2011-11-16 18:39:08.000000000 -0500
 @@ -235,11 +235,11 @@ enum ocfs2_vol_state
  
  struct ocfs2_alloc_stats
@@ -42387,9 +45034,9 @@ diff -urNp linux-3.0.4/fs/ocfs2/ocfs2.h linux-3.0.4/fs/ocfs2/ocfs2.h
  };
  
  enum ocfs2_local_alloc_state
-diff -urNp linux-3.0.4/fs/ocfs2/suballoc.c linux-3.0.4/fs/ocfs2/suballoc.c
---- linux-3.0.4/fs/ocfs2/suballoc.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/ocfs2/suballoc.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/ocfs2/suballoc.c linux-3.1.3/fs/ocfs2/suballoc.c
+--- linux-3.1.3/fs/ocfs2/suballoc.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ocfs2/suballoc.c    2011-11-16 18:39:08.000000000 -0500
 @@ -872,7 +872,7 @@ static int ocfs2_reserve_suballoc_bits(s
                                mlog_errno(status);
                        goto bail;
@@ -42444,9 +45091,9 @@ diff -urNp linux-3.0.4/fs/ocfs2/suballoc.c linux-3.0.4/fs/ocfs2/suballoc.c
                        *num_clusters = res.sr_bits;
                }
        }
-diff -urNp linux-3.0.4/fs/ocfs2/super.c linux-3.0.4/fs/ocfs2/super.c
---- linux-3.0.4/fs/ocfs2/super.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/ocfs2/super.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/ocfs2/super.c linux-3.1.3/fs/ocfs2/super.c
+--- linux-3.1.3/fs/ocfs2/super.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ocfs2/super.c       2011-11-16 18:39:08.000000000 -0500
 @@ -300,11 +300,11 @@ static int ocfs2_osb_dump(struct ocfs2_s
                        "%10s => GlobalAllocs: %d  LocalAllocs: %d  "
                        "SubAllocs: %d  LAWinMoves: %d  SAExtends: %d\n",
@@ -42481,9 +45128,9 @@ diff -urNp linux-3.0.4/fs/ocfs2/super.c linux-3.0.4/fs/ocfs2/super.c
  
        /* Copy the blockcheck stats from the superblock probe */
        osb->osb_ecc_stats = *stats;
-diff -urNp linux-3.0.4/fs/ocfs2/symlink.c linux-3.0.4/fs/ocfs2/symlink.c
---- linux-3.0.4/fs/ocfs2/symlink.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/ocfs2/symlink.c     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/ocfs2/symlink.c linux-3.1.3/fs/ocfs2/symlink.c
+--- linux-3.1.3/fs/ocfs2/symlink.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/ocfs2/symlink.c     2011-11-16 18:39:08.000000000 -0500
 @@ -142,7 +142,7 @@ bail:
  
  static void ocfs2_fast_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)
@@ -42493,9 +45140,9 @@ diff -urNp linux-3.0.4/fs/ocfs2/symlink.c linux-3.0.4/fs/ocfs2/symlink.c
        if (!IS_ERR(link))
                kfree(link);
  }
-diff -urNp linux-3.0.4/fs/open.c linux-3.0.4/fs/open.c
---- linux-3.0.4/fs/open.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/open.c      2011-09-14 09:16:46.000000000 -0400
+diff -urNp linux-3.1.3/fs/open.c linux-3.1.3/fs/open.c
+--- linux-3.1.3/fs/open.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/open.c      2011-11-17 19:07:55.000000000 -0500
 @@ -112,6 +112,10 @@ static long do_sys_truncate(const char _
        error = locks_verify_truncate(inode, NULL, length);
        if (!error)
@@ -42554,59 +45201,24 @@ diff -urNp linux-3.0.4/fs/open.c linux-3.0.4/fs/open.c
        error = 0;
  dput_and_out:
        path_put(&path);
-@@ -466,12 +488,25 @@ SYSCALL_DEFINE2(fchmod, unsigned int, fd
-       err = mnt_want_write_file(file);
-       if (err)
-               goto out_putf;
-+
-       mutex_lock(&inode->i_mutex);
-+
-+      if (!gr_acl_handle_fchmod(dentry, file->f_vfsmnt, mode)) {
-+              err = -EACCES;
-+              goto out_unlock;
-+      }
-+
-       err = security_path_chmod(dentry, file->f_vfsmnt, mode);
-       if (err)
-               goto out_unlock;
-       if (mode == (mode_t) -1)
-               mode = inode->i_mode;
-+
-+      if (gr_handle_chroot_chmod(dentry, file->f_vfsmnt, mode)) {
-+              err = -EACCES;
-+              goto out_unlock;
-+      }
-+
-       newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
-       newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
-       err = notify_change(dentry, &newattrs);
-@@ -499,12 +534,25 @@ SYSCALL_DEFINE3(fchmodat, int, dfd, cons
-       error = mnt_want_write(path.mnt);
+@@ -456,6 +478,16 @@ static int chmod_common(struct path *pat
        if (error)
-               goto dput_and_out;
-+
+               return error;
        mutex_lock(&inode->i_mutex);
 +
-+      if (!gr_acl_handle_chmod(path.dentry, path.mnt, mode)) {
++      if (!gr_acl_handle_fchmod(path->dentry, path->mnt, mode)) {
 +              error = -EACCES;
 +              goto out_unlock;
 +      }
-+
-       error = security_path_chmod(path.dentry, path.mnt, mode);
-       if (error)
-               goto out_unlock;
-       if (mode == (mode_t) -1)
-               mode = inode->i_mode;
-+
-+      if (gr_handle_chroot_chmod(path.dentry, path.mnt, mode)) {
++      if (gr_handle_chroot_chmod(path->dentry, path->mnt, mode)) {
 +              error = -EACCES;
 +              goto out_unlock;
 +      }
 +
-       newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
-       newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
-       error = notify_change(path.dentry, &newattrs);
-@@ -528,6 +576,9 @@ static int chown_common(struct path *pat
+       error = security_path_chmod(path->dentry, path->mnt, mode);
+       if (error)
+               goto out_unlock;
+@@ -506,6 +538,9 @@ static int chown_common(struct path *pat
        int error;
        struct iattr newattrs;
  
@@ -42616,30 +45228,10 @@ diff -urNp linux-3.0.4/fs/open.c linux-3.0.4/fs/open.c
        newattrs.ia_valid =  ATTR_CTIME;
        if (user != (uid_t) -1) {
                newattrs.ia_valid |= ATTR_UID;
-@@ -998,7 +1049,10 @@ long do_sys_open(int dfd, const char __u
-       if (!IS_ERR(tmp)) {
-               fd = get_unused_fd_flags(flags);
-               if (fd >= 0) {
--                      struct file *f = do_filp_open(dfd, tmp, &op, lookup);
-+                      struct file *f;
-+                      /* don't allow to be set by userland */
-+                      flags &= ~FMODE_GREXEC;
-+                      f = do_filp_open(dfd, tmp, &op, lookup);
-                       if (IS_ERR(f)) {
-                               put_unused_fd(fd);
-                               fd = PTR_ERR(f);
-diff -urNp linux-3.0.4/fs/partitions/ldm.c linux-3.0.4/fs/partitions/ldm.c
---- linux-3.0.4/fs/partitions/ldm.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/partitions/ldm.c    2011-08-23 21:48:14.000000000 -0400
-@@ -1311,6 +1311,7 @@ static bool ldm_frag_add (const u8 *data
-               ldm_error ("A VBLK claims to have %d parts.", num);
-               return false;
-       }
-+
-       if (rec >= num) {
-               ldm_error("REC value (%d) exceeds NUM value (%d)", rec, num);
-               return false;
-@@ -1322,7 +1323,7 @@ static bool ldm_frag_add (const u8 *data
+diff -urNp linux-3.1.3/fs/partitions/ldm.c linux-3.1.3/fs/partitions/ldm.c
+--- linux-3.1.3/fs/partitions/ldm.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/partitions/ldm.c    2011-11-17 19:08:15.000000000 -0500
+@@ -1322,7 +1322,7 @@ static bool ldm_frag_add (const u8 *data
                        goto found;
        }
  
@@ -42648,9 +45240,9 @@ diff -urNp linux-3.0.4/fs/partitions/ldm.c linux-3.0.4/fs/partitions/ldm.c
        if (!f) {
                ldm_crit ("Out of memory.");
                return false;
-diff -urNp linux-3.0.4/fs/pipe.c linux-3.0.4/fs/pipe.c
---- linux-3.0.4/fs/pipe.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/pipe.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/pipe.c linux-3.1.3/fs/pipe.c
+--- linux-3.1.3/fs/pipe.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/pipe.c      2011-11-16 18:40:29.000000000 -0500
 @@ -420,9 +420,9 @@ redo:
                }
                if (bufs)       /* More to do? */
@@ -42774,9 +45366,9 @@ diff -urNp linux-3.0.4/fs/pipe.c linux-3.0.4/fs/pipe.c
        inode->i_fop = &rdwr_pipefifo_fops;
  
        /*
-diff -urNp linux-3.0.4/fs/proc/array.c linux-3.0.4/fs/proc/array.c
---- linux-3.0.4/fs/proc/array.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/proc/array.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/proc/array.c linux-3.1.3/fs/proc/array.c
+--- linux-3.1.3/fs/proc/array.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/proc/array.c        2011-11-17 18:42:02.000000000 -0500
 @@ -60,6 +60,7 @@
  #include <linux/tty.h>
  #include <linux/string.h>
@@ -42832,12 +45424,8 @@ diff -urNp linux-3.0.4/fs/proc/array.c linux-3.0.4/fs/proc/array.c
  static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
                        struct pid *pid, struct task_struct *task, int whole)
  {
-@@ -375,9 +406,11 @@ static int do_task_stat(struct seq_file 
-       cputime_t cutime, cstime, utime, stime;
-       cputime_t cgtime, gtime;
-       unsigned long rsslim = 0;
--      char tcomm[sizeof(task->comm)];
-+      char tcomm[sizeof(task->comm)] = { 0 };
+@@ -378,6 +409,8 @@ static int do_task_stat(struct seq_file 
+       char tcomm[sizeof(task->comm)];
        unsigned long flags;
  
 +      pax_track_stack();
@@ -42900,9 +45488,9 @@ diff -urNp linux-3.0.4/fs/proc/array.c linux-3.0.4/fs/proc/array.c
 +      return sprintf(buffer, "%pI4\n", &curr_ip);
 +}
 +#endif
-diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
---- linux-3.0.4/fs/proc/base.c 2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/fs/proc/base.c 2011-09-13 14:50:28.000000000 -0400
+diff -urNp linux-3.1.3/fs/proc/base.c linux-3.1.3/fs/proc/base.c
+--- linux-3.1.3/fs/proc/base.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/proc/base.c 2011-11-17 18:43:19.000000000 -0500
 @@ -107,6 +107,22 @@ struct pid_entry {
        union proc_op op;
  };
@@ -43033,7 +45621,7 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
        ret = -ENOMEM;
        page = (char *)__get_free_page(GFP_TEMPORARY);
        if (!page)
-@@ -1614,7 +1658,7 @@ static void *proc_pid_follow_link(struct
+@@ -1613,7 +1657,7 @@ static void *proc_pid_follow_link(struct
        path_put(&nd->path);
  
        /* Are we allowed to snoop on the tasks file descriptors? */
@@ -43042,7 +45630,7 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
                goto out;
  
        error = PROC_I(inode)->op.proc_get_link(inode, &nd->path);
-@@ -1653,8 +1697,18 @@ static int proc_pid_readlink(struct dent
+@@ -1652,8 +1696,18 @@ static int proc_pid_readlink(struct dent
        struct path path;
  
        /* Are we allowed to snoop on the tasks file descriptors? */
@@ -43063,7 +45651,7 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
  
        error = PROC_I(inode)->op.proc_get_link(inode, &path);
        if (error)
-@@ -1719,7 +1773,11 @@ struct inode *proc_pid_make_inode(struct
+@@ -1718,7 +1772,11 @@ struct inode *proc_pid_make_inode(struct
                rcu_read_lock();
                cred = __task_cred(task);
                inode->i_uid = cred->euid;
@@ -43075,7 +45663,7 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
                rcu_read_unlock();
        }
        security_task_to_inode(task, inode);
-@@ -1737,6 +1795,9 @@ int pid_getattr(struct vfsmount *mnt, st
+@@ -1736,6 +1794,9 @@ int pid_getattr(struct vfsmount *mnt, st
        struct inode *inode = dentry->d_inode;
        struct task_struct *task;
        const struct cred *cred;
@@ -43085,7 +45673,7 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
  
        generic_fillattr(inode, stat);
  
-@@ -1744,13 +1805,41 @@ int pid_getattr(struct vfsmount *mnt, st
+@@ -1743,13 +1804,41 @@ int pid_getattr(struct vfsmount *mnt, st
        stat->uid = 0;
        stat->gid = 0;
        task = pid_task(proc_pid(inode), PIDTYPE_PID);
@@ -43128,7 +45716,7 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
        }
        rcu_read_unlock();
        return 0;
-@@ -1787,11 +1876,20 @@ int pid_revalidate(struct dentry *dentry
+@@ -1786,11 +1875,20 @@ int pid_revalidate(struct dentry *dentry
  
        if (task) {
                if ((inode->i_mode == (S_IFDIR|S_IRUGO|S_IXUGO)) ||
@@ -43149,7 +45737,7 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
                        rcu_read_unlock();
                } else {
                        inode->i_uid = 0;
-@@ -1909,7 +2007,8 @@ static int proc_fd_info(struct inode *in
+@@ -1908,7 +2006,8 @@ static int proc_fd_info(struct inode *in
        int fd = proc_fd(inode);
  
        if (task) {
@@ -43159,12 +45747,12 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
                put_task_struct(task);
        }
        if (files) {
-@@ -2169,11 +2268,21 @@ static const struct file_operations proc
+@@ -2176,11 +2275,21 @@ static const struct file_operations proc
   */
- static int proc_fd_permission(struct inode *inode, int mask, unsigned int flags)
+ static int proc_fd_permission(struct inode *inode, int mask)
  {
 +      struct task_struct *task;
-       int rv = generic_permission(inode, mask, flags, NULL);
+       int rv = generic_permission(inode, mask);
 -      if (rv == 0)
 -              return 0;
 +
@@ -43183,7 +45771,7 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
        return rv;
  }
  
-@@ -2283,6 +2392,9 @@ static struct dentry *proc_pident_lookup
+@@ -2290,6 +2399,9 @@ static struct dentry *proc_pident_lookup
        if (!task)
                goto out_no_task;
  
@@ -43193,7 +45781,7 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
        /*
         * Yes, it does not scale. And it should not. Don't add
         * new entries into /proc/<tgid>/ without very good reasons.
-@@ -2327,6 +2439,9 @@ static int proc_pident_readdir(struct fi
+@@ -2334,6 +2446,9 @@ static int proc_pident_readdir(struct fi
        if (!task)
                goto out_no_task;
  
@@ -43203,7 +45791,7 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
        ret = 0;
        i = filp->f_pos;
        switch (i) {
-@@ -2597,7 +2712,7 @@ static void *proc_self_follow_link(struc
+@@ -2604,7 +2719,7 @@ static void *proc_self_follow_link(struc
  static void proc_self_put_link(struct dentry *dentry, struct nameidata *nd,
                                void *cookie)
  {
@@ -43212,7 +45800,7 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
        if (!IS_ERR(s))
                __putname(s);
  }
-@@ -2795,7 +2910,7 @@ static const struct pid_entry tgid_base_
+@@ -2802,7 +2917,7 @@ static const struct pid_entry tgid_base_
        REG("autogroup",  S_IRUGO|S_IWUSR, proc_pid_sched_autogroup_operations),
  #endif
        REG("comm",      S_IRUGO|S_IWUSR, proc_pid_set_comm_operations),
@@ -43221,7 +45809,7 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
        INF("syscall",    S_IRUGO, proc_pid_syscall),
  #endif
        INF("cmdline",    S_IRUGO, proc_pid_cmdline),
-@@ -2820,10 +2935,10 @@ static const struct pid_entry tgid_base_
+@@ -2827,10 +2942,10 @@ static const struct pid_entry tgid_base_
  #ifdef CONFIG_SECURITY
        DIR("attr",       S_IRUGO|S_IXUGO, proc_attr_dir_inode_operations, proc_attr_dir_operations),
  #endif
@@ -43234,7 +45822,7 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
        ONE("stack",      S_IRUGO, proc_pid_stack),
  #endif
  #ifdef CONFIG_SCHEDSTATS
-@@ -2857,6 +2972,9 @@ static const struct pid_entry tgid_base_
+@@ -2864,6 +2979,9 @@ static const struct pid_entry tgid_base_
  #ifdef CONFIG_HARDWALL
        INF("hardwall",   S_IRUGO, proc_pid_hardwall),
  #endif
@@ -43244,7 +45832,7 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
  };
  
  static int proc_tgid_base_readdir(struct file * filp,
-@@ -2982,7 +3100,14 @@ static struct dentry *proc_pid_instantia
+@@ -2989,7 +3107,14 @@ static struct dentry *proc_pid_instantia
        if (!inode)
                goto out;
  
@@ -43259,10 +45847,13 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
        inode->i_op = &proc_tgid_base_inode_operations;
        inode->i_fop = &proc_tgid_base_operations;
        inode->i_flags|=S_IMMUTABLE;
-@@ -3024,7 +3149,11 @@ struct dentry *proc_pid_lookup(struct in
+@@ -3031,7 +3156,14 @@ struct dentry *proc_pid_lookup(struct in
        if (!task)
                goto out;
  
++      if (!has_group_leader_pid(task))
++              goto out_put_task;
++
 +      if (gr_pid_is_chrooted(task) || gr_check_hidden_task(task))
 +              goto out_put_task;
 +
@@ -43271,7 +45862,7 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
        put_task_struct(task);
  out:
        return result;
-@@ -3089,6 +3218,11 @@ int proc_pid_readdir(struct file * filp,
+@@ -3096,6 +3228,11 @@ int proc_pid_readdir(struct file * filp,
  {
        unsigned int nr;
        struct task_struct *reaper;
@@ -43283,7 +45874,7 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
        struct tgid_iter iter;
        struct pid_namespace *ns;
  
-@@ -3112,8 +3246,27 @@ int proc_pid_readdir(struct file * filp,
+@@ -3119,8 +3256,27 @@ int proc_pid_readdir(struct file * filp,
        for (iter = next_tgid(ns, iter);
             iter.task;
             iter.tgid += 1, iter = next_tgid(ns, iter)) {
@@ -43312,7 +45903,7 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
                        put_task_struct(iter.task);
                        goto out;
                }
-@@ -3141,7 +3294,7 @@ static const struct pid_entry tid_base_s
+@@ -3148,7 +3304,7 @@ static const struct pid_entry tid_base_s
        REG("sched",     S_IRUGO|S_IWUSR, proc_pid_sched_operations),
  #endif
        REG("comm",      S_IRUGO|S_IWUSR, proc_pid_set_comm_operations),
@@ -43321,7 +45912,7 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
        INF("syscall",   S_IRUGO, proc_pid_syscall),
  #endif
        INF("cmdline",   S_IRUGO, proc_pid_cmdline),
-@@ -3165,10 +3318,10 @@ static const struct pid_entry tid_base_s
+@@ -3172,10 +3328,10 @@ static const struct pid_entry tid_base_s
  #ifdef CONFIG_SECURITY
        DIR("attr",      S_IRUGO|S_IXUGO, proc_attr_dir_inode_operations, proc_attr_dir_operations),
  #endif
@@ -43334,9 +45925,9 @@ diff -urNp linux-3.0.4/fs/proc/base.c linux-3.0.4/fs/proc/base.c
        ONE("stack",      S_IRUGO, proc_pid_stack),
  #endif
  #ifdef CONFIG_SCHEDSTATS
-diff -urNp linux-3.0.4/fs/proc/cmdline.c linux-3.0.4/fs/proc/cmdline.c
---- linux-3.0.4/fs/proc/cmdline.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/proc/cmdline.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/proc/cmdline.c linux-3.1.3/fs/proc/cmdline.c
+--- linux-3.1.3/fs/proc/cmdline.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/proc/cmdline.c      2011-11-16 18:40:29.000000000 -0500
 @@ -23,7 +23,11 @@ static const struct file_operations cmdl
  
  static int __init proc_cmdline_init(void)
@@ -43349,9 +45940,9 @@ diff -urNp linux-3.0.4/fs/proc/cmdline.c linux-3.0.4/fs/proc/cmdline.c
        return 0;
  }
  module_init(proc_cmdline_init);
-diff -urNp linux-3.0.4/fs/proc/devices.c linux-3.0.4/fs/proc/devices.c
---- linux-3.0.4/fs/proc/devices.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/proc/devices.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/proc/devices.c linux-3.1.3/fs/proc/devices.c
+--- linux-3.1.3/fs/proc/devices.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/proc/devices.c      2011-11-16 18:40:29.000000000 -0500
 @@ -64,7 +64,11 @@ static const struct file_operations proc
  
  static int __init proc_devices_init(void)
@@ -43364,10 +45955,43 @@ diff -urNp linux-3.0.4/fs/proc/devices.c linux-3.0.4/fs/proc/devices.c
        return 0;
  }
  module_init(proc_devices_init);
-diff -urNp linux-3.0.4/fs/proc/inode.c linux-3.0.4/fs/proc/inode.c
---- linux-3.0.4/fs/proc/inode.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/proc/inode.c        2011-08-23 21:48:14.000000000 -0400
-@@ -440,7 +440,11 @@ struct inode *proc_get_inode(struct supe
+diff -urNp linux-3.1.3/fs/proc/inode.c linux-3.1.3/fs/proc/inode.c
+--- linux-3.1.3/fs/proc/inode.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/proc/inode.c        2011-11-16 18:40:29.000000000 -0500
+@@ -18,12 +18,18 @@
+ #include <linux/module.h>
+ #include <linux/sysctl.h>
+ #include <linux/slab.h>
++#include <linux/grsecurity.h>
+ #include <asm/system.h>
+ #include <asm/uaccess.h>
+ #include "internal.h"
++#ifdef CONFIG_PROC_SYSCTL
++extern const struct inode_operations proc_sys_inode_operations;
++extern const struct inode_operations proc_sys_dir_operations;
++#endif
++
+ static void proc_evict_inode(struct inode *inode)
+ {
+       struct proc_dir_entry *de;
+@@ -49,6 +55,13 @@ static void proc_evict_inode(struct inod
+       ns_ops = PROC_I(inode)->ns_ops;
+       if (ns_ops && ns_ops->put)
+               ns_ops->put(PROC_I(inode)->ns);
++
++#ifdef CONFIG_PROC_SYSCTL
++      if (inode->i_op == &proc_sys_inode_operations ||
++          inode->i_op == &proc_sys_dir_operations)
++              gr_handle_delete(inode->i_ino, inode->i_sb->s_dev);
++#endif
++
+ }
+ static struct kmem_cache * proc_inode_cachep;
+@@ -440,7 +453,11 @@ struct inode *proc_get_inode(struct supe
                if (de->mode) {
                        inode->i_mode = de->mode;
                        inode->i_uid = de->uid;
@@ -43379,9 +46003,9 @@ diff -urNp linux-3.0.4/fs/proc/inode.c linux-3.0.4/fs/proc/inode.c
                }
                if (de->size)
                        inode->i_size = de->size;
-diff -urNp linux-3.0.4/fs/proc/internal.h linux-3.0.4/fs/proc/internal.h
---- linux-3.0.4/fs/proc/internal.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/proc/internal.h     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/proc/internal.h linux-3.1.3/fs/proc/internal.h
+--- linux-3.1.3/fs/proc/internal.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/proc/internal.h     2011-11-16 18:40:29.000000000 -0500
 @@ -51,6 +51,9 @@ extern int proc_pid_status(struct seq_fi
                                struct pid *pid, struct task_struct *task);
  extern int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns,
@@ -43392,9 +46016,9 @@ diff -urNp linux-3.0.4/fs/proc/internal.h linux-3.0.4/fs/proc/internal.h
  extern loff_t mem_lseek(struct file *file, loff_t offset, int orig);
  
  extern const struct file_operations proc_maps_operations;
-diff -urNp linux-3.0.4/fs/proc/Kconfig linux-3.0.4/fs/proc/Kconfig
---- linux-3.0.4/fs/proc/Kconfig        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/proc/Kconfig        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/proc/Kconfig linux-3.1.3/fs/proc/Kconfig
+--- linux-3.1.3/fs/proc/Kconfig        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/proc/Kconfig        2011-11-16 18:40:29.000000000 -0500
 @@ -30,12 +30,12 @@ config PROC_FS
  
  config PROC_KCORE
@@ -43422,9 +46046,9 @@ diff -urNp linux-3.0.4/fs/proc/Kconfig linux-3.0.4/fs/proc/Kconfig
        bool "Enable /proc page monitoring" if EXPERT
        help
          Various /proc files exist to monitor process memory utilization:
-diff -urNp linux-3.0.4/fs/proc/kcore.c linux-3.0.4/fs/proc/kcore.c
---- linux-3.0.4/fs/proc/kcore.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/proc/kcore.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/proc/kcore.c linux-3.1.3/fs/proc/kcore.c
+--- linux-3.1.3/fs/proc/kcore.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/proc/kcore.c        2011-11-16 18:40:29.000000000 -0500
 @@ -321,6 +321,8 @@ static void elf_kcore_store_hdr(char *bu
        off_t offset = 0;
        struct kcore_list *m;
@@ -43492,9 +46116,9 @@ diff -urNp linux-3.0.4/fs/proc/kcore.c linux-3.0.4/fs/proc/kcore.c
        if (!capable(CAP_SYS_RAWIO))
                return -EPERM;
        if (kcore_need_update)
-diff -urNp linux-3.0.4/fs/proc/meminfo.c linux-3.0.4/fs/proc/meminfo.c
---- linux-3.0.4/fs/proc/meminfo.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/proc/meminfo.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/proc/meminfo.c linux-3.1.3/fs/proc/meminfo.c
+--- linux-3.1.3/fs/proc/meminfo.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/proc/meminfo.c      2011-11-16 18:40:29.000000000 -0500
 @@ -29,6 +29,8 @@ static int meminfo_proc_show(struct seq_
        unsigned long pages[NR_LRU_LISTS];
        int lru;
@@ -43513,9 +46137,9 @@ diff -urNp linux-3.0.4/fs/proc/meminfo.c linux-3.0.4/fs/proc/meminfo.c
  #endif
  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
                ,K(global_page_state(NR_ANON_TRANSPARENT_HUGEPAGES) *
-diff -urNp linux-3.0.4/fs/proc/nommu.c linux-3.0.4/fs/proc/nommu.c
---- linux-3.0.4/fs/proc/nommu.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/proc/nommu.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/proc/nommu.c linux-3.1.3/fs/proc/nommu.c
+--- linux-3.1.3/fs/proc/nommu.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/proc/nommu.c        2011-11-16 18:39:08.000000000 -0500
 @@ -66,7 +66,7 @@ static int nommu_region_show(struct seq_
                if (len < 1)
                        len = 1;
@@ -43525,9 +46149,9 @@ diff -urNp linux-3.0.4/fs/proc/nommu.c linux-3.0.4/fs/proc/nommu.c
        }
  
        seq_putc(m, '\n');
-diff -urNp linux-3.0.4/fs/proc/proc_net.c linux-3.0.4/fs/proc/proc_net.c
---- linux-3.0.4/fs/proc/proc_net.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/proc/proc_net.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/proc/proc_net.c linux-3.1.3/fs/proc/proc_net.c
+--- linux-3.1.3/fs/proc/proc_net.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/proc/proc_net.c     2011-11-16 18:40:29.000000000 -0500
 @@ -105,6 +105,17 @@ static struct net *get_proc_task_net(str
        struct task_struct *task;
        struct nsproxy *ns;
@@ -43546,10 +46170,10 @@ diff -urNp linux-3.0.4/fs/proc/proc_net.c linux-3.0.4/fs/proc/proc_net.c
  
        rcu_read_lock();
        task = pid_task(proc_pid(dir), PIDTYPE_PID);
-diff -urNp linux-3.0.4/fs/proc/proc_sysctl.c linux-3.0.4/fs/proc/proc_sysctl.c
---- linux-3.0.4/fs/proc/proc_sysctl.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/proc/proc_sysctl.c  2011-08-23 21:48:14.000000000 -0400
-@@ -8,6 +8,8 @@
+diff -urNp linux-3.1.3/fs/proc/proc_sysctl.c linux-3.1.3/fs/proc/proc_sysctl.c
+--- linux-3.1.3/fs/proc/proc_sysctl.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/proc/proc_sysctl.c  2011-11-18 18:45:33.000000000 -0500
+@@ -8,11 +8,13 @@
  #include <linux/namei.h>
  #include "internal.h"
  
@@ -43557,18 +46181,40 @@ diff -urNp linux-3.0.4/fs/proc/proc_sysctl.c linux-3.0.4/fs/proc/proc_sysctl.c
 +
  static const struct dentry_operations proc_sys_dentry_operations;
  static const struct file_operations proc_sys_file_operations;
- static const struct inode_operations proc_sys_inode_operations;
-@@ -111,6 +113,9 @@ static struct dentry *proc_sys_lookup(st
-       if (!p)
-               goto out;
+-static const struct inode_operations proc_sys_inode_operations;
++const struct inode_operations proc_sys_inode_operations;
+ static const struct file_operations proc_sys_dir_file_operations;
+-static const struct inode_operations proc_sys_dir_operations;
++const struct inode_operations proc_sys_dir_operations;
+ static struct inode *proc_sys_make_inode(struct super_block *sb,
+               struct ctl_table_header *head, struct ctl_table *table)
+@@ -121,8 +123,14 @@ static struct dentry *proc_sys_lookup(st
+       err = NULL;
+       d_set_d_op(dentry, &proc_sys_dentry_operations);
++
++      gr_handle_proc_create(dentry, inode);
++
+       d_add(dentry, inode);
  
 +      if (gr_handle_sysctl(p, MAY_EXEC))
-+              goto out;
++              err = ERR_PTR(-ENOENT);
 +
-       err = ERR_PTR(-ENOMEM);
-       inode = proc_sys_make_inode(dir->i_sb, h ? h : head, p);
-       if (h)
-@@ -230,6 +235,9 @@ static int scan(struct ctl_table_header 
+ out:
+       sysctl_head_finish(head);
+       return err;
+@@ -202,6 +210,9 @@ static int proc_sys_fill_cache(struct fi
+                               return -ENOMEM;
+                       } else {
+                               d_set_d_op(child, &proc_sys_dentry_operations);
++
++                              gr_handle_proc_create(child, inode);
++
+                               d_add(child, inode);
+                       }
+               } else {
+@@ -230,6 +241,9 @@ static int scan(struct ctl_table_header 
                if (*pos < file->f_pos)
                        continue;
  
@@ -43578,7 +46224,7 @@ diff -urNp linux-3.0.4/fs/proc/proc_sysctl.c linux-3.0.4/fs/proc/proc_sysctl.c
                res = proc_sys_fill_cache(file, dirent, filldir, head, table);
                if (res)
                        return res;
-@@ -355,6 +363,9 @@ static int proc_sys_getattr(struct vfsmo
+@@ -355,6 +369,9 @@ static int proc_sys_getattr(struct vfsmo
        if (IS_ERR(head))
                return PTR_ERR(head);
  
@@ -43588,9 +46234,30 @@ diff -urNp linux-3.0.4/fs/proc/proc_sysctl.c linux-3.0.4/fs/proc/proc_sysctl.c
        generic_fillattr(inode, stat);
        if (table)
                stat->mode = (stat->mode & S_IFMT) | table->mode;
-diff -urNp linux-3.0.4/fs/proc/root.c linux-3.0.4/fs/proc/root.c
---- linux-3.0.4/fs/proc/root.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/proc/root.c 2011-08-23 21:48:14.000000000 -0400
+@@ -370,17 +387,18 @@ static const struct file_operations proc
+ };
+ static const struct file_operations proc_sys_dir_file_operations = {
++      .read           = generic_read_dir,
+       .readdir        = proc_sys_readdir,
+       .llseek         = generic_file_llseek,
+ };
+-static const struct inode_operations proc_sys_inode_operations = {
++const struct inode_operations proc_sys_inode_operations = {
+       .permission     = proc_sys_permission,
+       .setattr        = proc_sys_setattr,
+       .getattr        = proc_sys_getattr,
+ };
+-static const struct inode_operations proc_sys_dir_operations = {
++const struct inode_operations proc_sys_dir_operations = {
+       .lookup         = proc_sys_lookup,
+       .permission     = proc_sys_permission,
+       .setattr        = proc_sys_setattr,
+diff -urNp linux-3.1.3/fs/proc/root.c linux-3.1.3/fs/proc/root.c
+--- linux-3.1.3/fs/proc/root.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/proc/root.c 2011-11-16 18:40:29.000000000 -0500
 @@ -123,7 +123,15 @@ void __init proc_root_init(void)
  #ifdef CONFIG_PROC_DEVICETREE
        proc_device_tree_init();
@@ -43607,9 +46274,9 @@ diff -urNp linux-3.0.4/fs/proc/root.c linux-3.0.4/fs/proc/root.c
        proc_sys_init();
  }
  
-diff -urNp linux-3.0.4/fs/proc/task_mmu.c linux-3.0.4/fs/proc/task_mmu.c
---- linux-3.0.4/fs/proc/task_mmu.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/proc/task_mmu.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/proc/task_mmu.c linux-3.1.3/fs/proc/task_mmu.c
+--- linux-3.1.3/fs/proc/task_mmu.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/proc/task_mmu.c     2011-11-16 18:40:29.000000000 -0500
 @@ -51,8 +51,13 @@ void task_mem(struct seq_file *m, struct
                "VmExe:\t%8lu kB\n"
                "VmLib:\t%8lu kB\n"
@@ -43740,7 +46407,7 @@ diff -urNp linux-3.0.4/fs/proc/task_mmu.c linux-3.0.4/fs/proc/task_mmu.c
                   mss.resident >> 10,
                   (unsigned long)(mss.pss >> (10 + PSS_SHIFT)),
                   mss.shared_clean  >> 10,
-@@ -1001,7 +1032,7 @@ static int show_numa_map(struct seq_file
+@@ -1031,7 +1062,7 @@ static int show_numa_map(struct seq_file
  
        if (file) {
                seq_printf(m, " file=");
@@ -43749,9 +46416,9 @@ diff -urNp linux-3.0.4/fs/proc/task_mmu.c linux-3.0.4/fs/proc/task_mmu.c
        } else if (vma->vm_start <= mm->brk && vma->vm_end >= mm->start_brk) {
                seq_printf(m, " heap");
        } else if (vma->vm_start <= mm->start_stack &&
-diff -urNp linux-3.0.4/fs/proc/task_nommu.c linux-3.0.4/fs/proc/task_nommu.c
---- linux-3.0.4/fs/proc/task_nommu.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/proc/task_nommu.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/proc/task_nommu.c linux-3.1.3/fs/proc/task_nommu.c
+--- linux-3.1.3/fs/proc/task_nommu.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/proc/task_nommu.c   2011-11-16 18:39:08.000000000 -0500
 @@ -51,7 +51,7 @@ void task_mem(struct seq_file *m, struct
        else
                bytes += kobjsize(mm);
@@ -43770,9 +46437,9 @@ diff -urNp linux-3.0.4/fs/proc/task_nommu.c linux-3.0.4/fs/proc/task_nommu.c
        } else if (mm) {
                if (vma->vm_start <= mm->start_stack &&
                        vma->vm_end >= mm->start_stack) {
-diff -urNp linux-3.0.4/fs/quota/netlink.c linux-3.0.4/fs/quota/netlink.c
---- linux-3.0.4/fs/quota/netlink.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/quota/netlink.c     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/quota/netlink.c linux-3.1.3/fs/quota/netlink.c
+--- linux-3.1.3/fs/quota/netlink.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/quota/netlink.c     2011-11-16 18:39:08.000000000 -0500
 @@ -33,7 +33,7 @@ static struct genl_family quota_genl_fam
  void quota_send_warning(short type, unsigned int id, dev_t dev,
                        const char warntype)
@@ -43791,9 +46458,9 @@ diff -urNp linux-3.0.4/fs/quota/netlink.c linux-3.0.4/fs/quota/netlink.c
                        &quota_genl_family, 0, QUOTA_NL_C_WARNING);
        if (!msg_head) {
                printk(KERN_ERR
-diff -urNp linux-3.0.4/fs/readdir.c linux-3.0.4/fs/readdir.c
---- linux-3.0.4/fs/readdir.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/readdir.c   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/readdir.c linux-3.1.3/fs/readdir.c
+--- linux-3.1.3/fs/readdir.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/readdir.c   2011-11-16 18:40:29.000000000 -0500
 @@ -17,6 +17,7 @@
  #include <linux/security.h>
  #include <linux/syscalls.h>
@@ -43883,10 +46550,19 @@ diff -urNp linux-3.0.4/fs/readdir.c linux-3.0.4/fs/readdir.c
        buf.count = count;
        buf.error = 0;
  
-diff -urNp linux-3.0.4/fs/reiserfs/dir.c linux-3.0.4/fs/reiserfs/dir.c
---- linux-3.0.4/fs/reiserfs/dir.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/reiserfs/dir.c      2011-08-23 21:48:14.000000000 -0400
-@@ -66,6 +66,8 @@ int reiserfs_readdir_dentry(struct dentr
+@@ -299,7 +318,7 @@ SYSCALL_DEFINE3(getdents64, unsigned int
+               error = buf.error;
+       lastdirent = buf.previous;
+       if (lastdirent) {
+-              typeof(lastdirent->d_off) d_off = file->f_pos;
++              typeof(((struct linux_dirent64 *)0)->d_off) d_off = file->f_pos;
+               if (__put_user(d_off, &lastdirent->d_off))
+                       error = -EFAULT;
+               else
+diff -urNp linux-3.1.3/fs/reiserfs/dir.c linux-3.1.3/fs/reiserfs/dir.c
+--- linux-3.1.3/fs/reiserfs/dir.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/reiserfs/dir.c      2011-11-16 18:40:29.000000000 -0500
+@@ -75,6 +75,8 @@ int reiserfs_readdir_dentry(struct dentr
        struct reiserfs_dir_entry de;
        int ret = 0;
  
@@ -43895,9 +46571,9 @@ diff -urNp linux-3.0.4/fs/reiserfs/dir.c linux-3.0.4/fs/reiserfs/dir.c
        reiserfs_write_lock(inode->i_sb);
  
        reiserfs_check_lock_depth(inode->i_sb, "readdir");
-diff -urNp linux-3.0.4/fs/reiserfs/do_balan.c linux-3.0.4/fs/reiserfs/do_balan.c
---- linux-3.0.4/fs/reiserfs/do_balan.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/reiserfs/do_balan.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/reiserfs/do_balan.c linux-3.1.3/fs/reiserfs/do_balan.c
+--- linux-3.1.3/fs/reiserfs/do_balan.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/reiserfs/do_balan.c 2011-11-16 18:39:08.000000000 -0500
 @@ -2051,7 +2051,7 @@ void do_balance(struct tree_balance *tb,
                return;
        }
@@ -43907,10 +46583,10 @@ diff -urNp linux-3.0.4/fs/reiserfs/do_balan.c linux-3.0.4/fs/reiserfs/do_balan.c
        do_balance_starts(tb);
  
        /* balance leaf returns 0 except if combining L R and S into
-diff -urNp linux-3.0.4/fs/reiserfs/journal.c linux-3.0.4/fs/reiserfs/journal.c
---- linux-3.0.4/fs/reiserfs/journal.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/reiserfs/journal.c  2011-08-23 21:48:14.000000000 -0400
-@@ -2299,6 +2299,8 @@ static struct buffer_head *reiserfs_brea
+diff -urNp linux-3.1.3/fs/reiserfs/journal.c linux-3.1.3/fs/reiserfs/journal.c
+--- linux-3.1.3/fs/reiserfs/journal.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/reiserfs/journal.c  2011-11-16 18:40:29.000000000 -0500
+@@ -2289,6 +2289,8 @@ static struct buffer_head *reiserfs_brea
        struct buffer_head *bh;
        int i, j;
  
@@ -43919,9 +46595,9 @@ diff -urNp linux-3.0.4/fs/reiserfs/journal.c linux-3.0.4/fs/reiserfs/journal.c
        bh = __getblk(dev, block, bufsize);
        if (buffer_uptodate(bh))
                return (bh);
-diff -urNp linux-3.0.4/fs/reiserfs/namei.c linux-3.0.4/fs/reiserfs/namei.c
---- linux-3.0.4/fs/reiserfs/namei.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/reiserfs/namei.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/reiserfs/namei.c linux-3.1.3/fs/reiserfs/namei.c
+--- linux-3.1.3/fs/reiserfs/namei.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/reiserfs/namei.c    2011-11-16 18:40:29.000000000 -0500
 @@ -1225,6 +1225,8 @@ static int reiserfs_rename(struct inode 
        unsigned long savelink = 1;
        struct timespec ctime;
@@ -43931,9 +46607,9 @@ diff -urNp linux-3.0.4/fs/reiserfs/namei.c linux-3.0.4/fs/reiserfs/namei.c
        /* three balancings: (1) old name removal, (2) new name insertion
           and (3) maybe "save" link insertion
           stat data updates: (1) old directory,
-diff -urNp linux-3.0.4/fs/reiserfs/procfs.c linux-3.0.4/fs/reiserfs/procfs.c
---- linux-3.0.4/fs/reiserfs/procfs.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/reiserfs/procfs.c   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/reiserfs/procfs.c linux-3.1.3/fs/reiserfs/procfs.c
+--- linux-3.1.3/fs/reiserfs/procfs.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/reiserfs/procfs.c   2011-11-16 18:40:29.000000000 -0500
 @@ -113,7 +113,7 @@ static int show_super(struct seq_file *m
                   "SMALL_TAILS " : "NO_TAILS ",
                   replay_only(sb) ? "REPLAY_ONLY " : "",
@@ -43952,9 +46628,9 @@ diff -urNp linux-3.0.4/fs/reiserfs/procfs.c linux-3.0.4/fs/reiserfs/procfs.c
        seq_printf(m,           /* on-disk fields */
                   "jp_journal_1st_block: \t%i\n"
                   "jp_journal_dev: \t%s[%x]\n"
-diff -urNp linux-3.0.4/fs/reiserfs/stree.c linux-3.0.4/fs/reiserfs/stree.c
---- linux-3.0.4/fs/reiserfs/stree.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/reiserfs/stree.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/reiserfs/stree.c linux-3.1.3/fs/reiserfs/stree.c
+--- linux-3.1.3/fs/reiserfs/stree.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/reiserfs/stree.c    2011-11-16 18:40:29.000000000 -0500
 @@ -1196,6 +1196,8 @@ int reiserfs_delete_item(struct reiserfs
        int iter = 0;
  #endif
@@ -44000,9 +46676,9 @@ diff -urNp linux-3.0.4/fs/reiserfs/stree.c linux-3.0.4/fs/reiserfs/stree.c
        BUG_ON(!th->t_trans_id);
  
        if (inode) {            /* Do we count quotas for item? */
-diff -urNp linux-3.0.4/fs/reiserfs/super.c linux-3.0.4/fs/reiserfs/super.c
---- linux-3.0.4/fs/reiserfs/super.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/reiserfs/super.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/reiserfs/super.c linux-3.1.3/fs/reiserfs/super.c
+--- linux-3.1.3/fs/reiserfs/super.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/reiserfs/super.c    2011-11-16 18:40:29.000000000 -0500
 @@ -927,6 +927,8 @@ static int reiserfs_parse_options(struct
                {.option_name = NULL}
        };
@@ -44012,9 +46688,9 @@ diff -urNp linux-3.0.4/fs/reiserfs/super.c linux-3.0.4/fs/reiserfs/super.c
        *blocks = 0;
        if (!options || !*options)
                /* use default configuration: create tails, journaling on, no
-diff -urNp linux-3.0.4/fs/select.c linux-3.0.4/fs/select.c
---- linux-3.0.4/fs/select.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/select.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/select.c linux-3.1.3/fs/select.c
+--- linux-3.1.3/fs/select.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/select.c    2011-11-16 18:40:29.000000000 -0500
 @@ -20,6 +20,7 @@
  #include <linux/module.h>
  #include <linux/slab.h>
@@ -44051,9 +46727,9 @@ diff -urNp linux-3.0.4/fs/select.c linux-3.0.4/fs/select.c
        if (nfds > rlimit(RLIMIT_NOFILE))
                return -EINVAL;
  
-diff -urNp linux-3.0.4/fs/seq_file.c linux-3.0.4/fs/seq_file.c
---- linux-3.0.4/fs/seq_file.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/seq_file.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/seq_file.c linux-3.1.3/fs/seq_file.c
+--- linux-3.1.3/fs/seq_file.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/seq_file.c  2011-11-16 18:39:08.000000000 -0500
 @@ -76,7 +76,8 @@ static int traverse(struct seq_file *m, 
                return 0;
        }
@@ -44103,9 +46779,9 @@ diff -urNp linux-3.0.4/fs/seq_file.c linux-3.0.4/fs/seq_file.c
        int res = -ENOMEM;
  
        if (op) {
-diff -urNp linux-3.0.4/fs/splice.c linux-3.0.4/fs/splice.c
---- linux-3.0.4/fs/splice.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/splice.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/splice.c linux-3.1.3/fs/splice.c
+--- linux-3.1.3/fs/splice.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/splice.c    2011-11-16 18:40:29.000000000 -0500
 @@ -194,7 +194,7 @@ ssize_t splice_to_pipe(struct pipe_inode
        pipe_lock(pipe);
  
@@ -44141,7 +46817,7 @@ diff -urNp linux-3.0.4/fs/splice.c linux-3.0.4/fs/splice.c
        set_fs(get_ds());
        /* The cast to a user pointer is valid due to the set_fs() */
 -      res = vfs_readv(file, (const struct iovec __user *)vec, vlen, &pos);
-+      res = vfs_readv(file, (__force const struct iovec __user *)vec, vlen, &pos);
++      res = vfs_readv(file, (const struct iovec __force_user *)vec, vlen, &pos);
        set_fs(old_fs);
  
        return res;
@@ -44150,7 +46826,7 @@ diff -urNp linux-3.0.4/fs/splice.c linux-3.0.4/fs/splice.c
        set_fs(get_ds());
        /* The cast to a user pointer is valid due to the set_fs() */
 -      res = vfs_write(file, (const char __user *)buf, count, &pos);
-+      res = vfs_write(file, (__force const char __user *)buf, count, &pos);
++      res = vfs_write(file, (const char __force_user *)buf, count, &pos);
        set_fs(old_fs);
  
        return res;
@@ -44168,7 +46844,7 @@ diff -urNp linux-3.0.4/fs/splice.c linux-3.0.4/fs/splice.c
  
                this_len = min_t(size_t, len, PAGE_CACHE_SIZE - offset);
 -              vec[i].iov_base = (void __user *) page_address(page);
-+              vec[i].iov_base = (__force void __user *) page_address(page);
++              vec[i].iov_base = (void __force_user *) page_address(page);
                vec[i].iov_len = this_len;
                spd.pages[i] = page;
                spd.nr_pages++;
@@ -44271,9 +46947,9 @@ diff -urNp linux-3.0.4/fs/splice.c linux-3.0.4/fs/splice.c
                ret = -EAGAIN;
  
        pipe_unlock(ipipe);
-diff -urNp linux-3.0.4/fs/sysfs/file.c linux-3.0.4/fs/sysfs/file.c
---- linux-3.0.4/fs/sysfs/file.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/sysfs/file.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/sysfs/file.c linux-3.1.3/fs/sysfs/file.c
+--- linux-3.1.3/fs/sysfs/file.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/sysfs/file.c        2011-11-16 18:39:08.000000000 -0500
 @@ -37,7 +37,7 @@ static DEFINE_SPINLOCK(sysfs_open_dirent
  
  struct sysfs_open_dirent {
@@ -44319,9 +46995,9 @@ diff -urNp linux-3.0.4/fs/sysfs/file.c linux-3.0.4/fs/sysfs/file.c
                wake_up_interruptible(&od->poll);
        }
  
-diff -urNp linux-3.0.4/fs/sysfs/mount.c linux-3.0.4/fs/sysfs/mount.c
---- linux-3.0.4/fs/sysfs/mount.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/sysfs/mount.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/sysfs/mount.c linux-3.1.3/fs/sysfs/mount.c
+--- linux-3.1.3/fs/sysfs/mount.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/sysfs/mount.c       2011-11-16 18:40:29.000000000 -0500
 @@ -36,7 +36,11 @@ struct sysfs_dirent sysfs_root = {
        .s_name         = "",
        .s_count        = ATOMIC_INIT(1),
@@ -44334,9 +47010,9 @@ diff -urNp linux-3.0.4/fs/sysfs/mount.c linux-3.0.4/fs/sysfs/mount.c
        .s_ino          = 1,
  };
  
-diff -urNp linux-3.0.4/fs/sysfs/symlink.c linux-3.0.4/fs/sysfs/symlink.c
---- linux-3.0.4/fs/sysfs/symlink.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/sysfs/symlink.c     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/sysfs/symlink.c linux-3.1.3/fs/sysfs/symlink.c
+--- linux-3.1.3/fs/sysfs/symlink.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/sysfs/symlink.c     2011-11-16 18:39:08.000000000 -0500
 @@ -286,7 +286,7 @@ static void *sysfs_follow_link(struct de
  
  static void sysfs_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)
@@ -44346,9 +47022,9 @@ diff -urNp linux-3.0.4/fs/sysfs/symlink.c linux-3.0.4/fs/sysfs/symlink.c
        if (!IS_ERR(page))
                free_page((unsigned long)page);
  }
-diff -urNp linux-3.0.4/fs/udf/inode.c linux-3.0.4/fs/udf/inode.c
---- linux-3.0.4/fs/udf/inode.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/udf/inode.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/udf/inode.c linux-3.1.3/fs/udf/inode.c
+--- linux-3.1.3/fs/udf/inode.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/udf/inode.c 2011-11-16 18:40:29.000000000 -0500
 @@ -560,6 +560,8 @@ static struct buffer_head *inode_getblk(
        int goal = 0, pgoal = iinfo->i_location.logicalBlockNum;
        int lastblock = 0;
@@ -44358,9 +47034,9 @@ diff -urNp linux-3.0.4/fs/udf/inode.c linux-3.0.4/fs/udf/inode.c
        prev_epos.offset = udf_file_entry_alloc_offset(inode);
        prev_epos.block = iinfo->i_location;
        prev_epos.bh = NULL;
-diff -urNp linux-3.0.4/fs/udf/misc.c linux-3.0.4/fs/udf/misc.c
---- linux-3.0.4/fs/udf/misc.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/udf/misc.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/udf/misc.c linux-3.1.3/fs/udf/misc.c
+--- linux-3.1.3/fs/udf/misc.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/udf/misc.c  2011-11-16 18:39:08.000000000 -0500
 @@ -286,7 +286,7 @@ void udf_new_tag(char *data, uint16_t id
  
  u8 udf_tag_checksum(const struct tag *t)
@@ -44370,9 +47046,9 @@ diff -urNp linux-3.0.4/fs/udf/misc.c linux-3.0.4/fs/udf/misc.c
        u8 checksum = 0;
        int i;
        for (i = 0; i < sizeof(struct tag); ++i)
-diff -urNp linux-3.0.4/fs/utimes.c linux-3.0.4/fs/utimes.c
---- linux-3.0.4/fs/utimes.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/utimes.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/utimes.c linux-3.1.3/fs/utimes.c
+--- linux-3.1.3/fs/utimes.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/utimes.c    2011-11-16 18:40:29.000000000 -0500
 @@ -1,6 +1,7 @@
  #include <linux/compiler.h>
  #include <linux/file.h>
@@ -44394,9 +47070,9 @@ diff -urNp linux-3.0.4/fs/utimes.c linux-3.0.4/fs/utimes.c
        mutex_lock(&inode->i_mutex);
        error = notify_change(path->dentry, &newattrs);
        mutex_unlock(&inode->i_mutex);
-diff -urNp linux-3.0.4/fs/xattr_acl.c linux-3.0.4/fs/xattr_acl.c
---- linux-3.0.4/fs/xattr_acl.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/xattr_acl.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/fs/xattr_acl.c linux-3.1.3/fs/xattr_acl.c
+--- linux-3.1.3/fs/xattr_acl.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/xattr_acl.c 2011-11-16 18:39:08.000000000 -0500
 @@ -17,8 +17,8 @@
  struct posix_acl *
  posix_acl_from_xattr(const void *value, size_t size)
@@ -44408,9 +47084,9 @@ diff -urNp linux-3.0.4/fs/xattr_acl.c linux-3.0.4/fs/xattr_acl.c
        int count;
        struct posix_acl *acl;
        struct posix_acl_entry *acl_e;
-diff -urNp linux-3.0.4/fs/xattr.c linux-3.0.4/fs/xattr.c
---- linux-3.0.4/fs/xattr.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/xattr.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/xattr.c linux-3.1.3/fs/xattr.c
+--- linux-3.1.3/fs/xattr.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/xattr.c     2011-11-16 18:40:29.000000000 -0500
 @@ -254,7 +254,7 @@ EXPORT_SYMBOL_GPL(vfs_removexattr);
   * Extended attribute SET operations
   */
@@ -44473,45 +47149,10 @@ diff -urNp linux-3.0.4/fs/xattr.c linux-3.0.4/fs/xattr.c
                mnt_drop_write(f->f_path.mnt);
        }
        fput(f);
-diff -urNp linux-3.0.4/fs/xfs/linux-2.6/xfs_ioctl32.c linux-3.0.4/fs/xfs/linux-2.6/xfs_ioctl32.c
---- linux-3.0.4/fs/xfs/linux-2.6/xfs_ioctl32.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/xfs/linux-2.6/xfs_ioctl32.c 2011-08-23 21:48:14.000000000 -0400
-@@ -73,6 +73,7 @@ xfs_compat_ioc_fsgeometry_v1(
-       xfs_fsop_geom_t           fsgeo;
-       int                       error;
-+      memset(&fsgeo, 0, sizeof(fsgeo));
-       error = xfs_fs_geometry(mp, &fsgeo, 3);
-       if (error)
-               return -error;
-diff -urNp linux-3.0.4/fs/xfs/linux-2.6/xfs_ioctl.c linux-3.0.4/fs/xfs/linux-2.6/xfs_ioctl.c
---- linux-3.0.4/fs/xfs/linux-2.6/xfs_ioctl.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/xfs/linux-2.6/xfs_ioctl.c   2011-08-23 21:47:56.000000000 -0400
-@@ -128,7 +128,7 @@ xfs_find_handle(
-       }
-       error = -EFAULT;
--      if (copy_to_user(hreq->ohandle, &handle, hsize) ||
-+      if (hsize > sizeof handle || copy_to_user(hreq->ohandle, &handle, hsize) ||
-           copy_to_user(hreq->ohandlen, &hsize, sizeof(__s32)))
-               goto out_put;
-diff -urNp linux-3.0.4/fs/xfs/linux-2.6/xfs_iops.c linux-3.0.4/fs/xfs/linux-2.6/xfs_iops.c
---- linux-3.0.4/fs/xfs/linux-2.6/xfs_iops.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/xfs/linux-2.6/xfs_iops.c    2011-08-23 21:47:56.000000000 -0400
-@@ -437,7 +437,7 @@ xfs_vn_put_link(
-       struct nameidata *nd,
-       void            *p)
- {
--      char            *s = nd_get_link(nd);
-+      const char      *s = nd_get_link(nd);
-       if (!IS_ERR(s))
-               kfree(s);
-diff -urNp linux-3.0.4/fs/xfs/xfs_bmap.c linux-3.0.4/fs/xfs/xfs_bmap.c
---- linux-3.0.4/fs/xfs/xfs_bmap.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/xfs/xfs_bmap.c      2011-08-23 21:47:56.000000000 -0400
-@@ -253,7 +253,7 @@ xfs_bmap_validate_ret(
+diff -urNp linux-3.1.3/fs/xfs/xfs_bmap.c linux-3.1.3/fs/xfs/xfs_bmap.c
+--- linux-3.1.3/fs/xfs/xfs_bmap.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/xfs/xfs_bmap.c      2011-11-16 18:39:08.000000000 -0500
+@@ -250,7 +250,7 @@ xfs_bmap_validate_ret(
        int                     nmap,
        int                     ret_nmap);
  #else
@@ -44520,13 +47161,13 @@ diff -urNp linux-3.0.4/fs/xfs/xfs_bmap.c linux-3.0.4/fs/xfs/xfs_bmap.c
  #endif /* DEBUG */
  
  STATIC int
-diff -urNp linux-3.0.4/fs/xfs/xfs_dir2_sf.c linux-3.0.4/fs/xfs/xfs_dir2_sf.c
---- linux-3.0.4/fs/xfs/xfs_dir2_sf.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/fs/xfs/xfs_dir2_sf.c   2011-08-23 21:47:56.000000000 -0400
-@@ -780,7 +780,15 @@ xfs_dir2_sf_getdents(
+diff -urNp linux-3.1.3/fs/xfs/xfs_dir2_sf.c linux-3.1.3/fs/xfs/xfs_dir2_sf.c
+--- linux-3.1.3/fs/xfs/xfs_dir2_sf.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/xfs/xfs_dir2_sf.c   2011-11-16 18:39:08.000000000 -0500
+@@ -852,7 +852,15 @@ xfs_dir2_sf_getdents(
                }
  
-               ino = xfs_dir2_sf_get_inumber(sfp, xfs_dir2_sf_inumberp(sfep));
+               ino = xfs_dir2_sfe_get_ino(sfp, sfep);
 -              if (filldir(dirent, (char *)sfep->name, sfep->namelen,
 +              if (dp->i_df.if_u1.if_data == dp->i_df.if_u2.if_inline_data) {
 +                      char name[sfep->namelen];
@@ -44540,9 +47181,57 @@ diff -urNp linux-3.0.4/fs/xfs/xfs_dir2_sf.c linux-3.0.4/fs/xfs/xfs_dir2_sf.c
                            off & 0x7fffffff, ino, DT_UNKNOWN)) {
                        *offset = off & 0x7fffffff;
                        return 0;
-diff -urNp linux-3.0.4/grsecurity/gracl_alloc.c linux-3.0.4/grsecurity/gracl_alloc.c
---- linux-3.0.4/grsecurity/gracl_alloc.c       1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/gracl_alloc.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/fs/xfs/xfs_ioctl.c linux-3.1.3/fs/xfs/xfs_ioctl.c
+--- linux-3.1.3/fs/xfs/xfs_ioctl.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/xfs/xfs_ioctl.c     2011-11-16 18:39:08.000000000 -0500
+@@ -128,7 +128,7 @@ xfs_find_handle(
+       }
+       error = -EFAULT;
+-      if (copy_to_user(hreq->ohandle, &handle, hsize) ||
++      if (hsize > sizeof handle || copy_to_user(hreq->ohandle, &handle, hsize) ||
+           copy_to_user(hreq->ohandlen, &hsize, sizeof(__s32)))
+               goto out_put;
+diff -urNp linux-3.1.3/fs/xfs/xfs_iops.c linux-3.1.3/fs/xfs/xfs_iops.c
+--- linux-3.1.3/fs/xfs/xfs_iops.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/xfs/xfs_iops.c      2011-11-16 18:39:08.000000000 -0500
+@@ -446,7 +446,7 @@ xfs_vn_put_link(
+       struct nameidata *nd,
+       void            *p)
+ {
+-      char            *s = nd_get_link(nd);
++      const char      *s = nd_get_link(nd);
+       if (!IS_ERR(s))
+               kfree(s);
+diff -urNp linux-3.1.3/fs/xfs/xfs_vnodeops.c linux-3.1.3/fs/xfs/xfs_vnodeops.c
+--- linux-3.1.3/fs/xfs/xfs_vnodeops.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/fs/xfs/xfs_vnodeops.c  2011-11-18 18:54:56.000000000 -0500
+@@ -123,13 +123,17 @@ xfs_readlink(
+       xfs_ilock(ip, XFS_ILOCK_SHARED);
+-      ASSERT(S_ISLNK(ip->i_d.di_mode));
+-      ASSERT(ip->i_d.di_size <= MAXPATHLEN);
+-
+       pathlen = ip->i_d.di_size;
+       if (!pathlen)
+               goto out;
++      if (pathlen > MAXPATHLEN) {
++              xfs_alert(mp, "%s: inode (%llu) symlink length (%d) too long",
++                       __func__, (unsigned long long)ip->i_ino, pathlen);
++              ASSERT(0);
++              return XFS_ERROR(EFSCORRUPTED);
++      }
++
+       if (ip->i_df.if_flags & XFS_IFINLINE) {
+               memcpy(link, ip->i_df.if_u1.if_data, pathlen);
+               link[pathlen] = '\0';
+diff -urNp linux-3.1.3/grsecurity/gracl_alloc.c linux-3.1.3/grsecurity/gracl_alloc.c
+--- linux-3.1.3/grsecurity/gracl_alloc.c       1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/gracl_alloc.c       2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,105 @@
 +#include <linux/kernel.h>
 +#include <linux/mm.h>
@@ -44649,10 +47338,10 @@ diff -urNp linux-3.0.4/grsecurity/gracl_alloc.c linux-3.0.4/grsecurity/gracl_all
 +      else
 +              return 1;
 +}
-diff -urNp linux-3.0.4/grsecurity/gracl.c linux-3.0.4/grsecurity/gracl.c
---- linux-3.0.4/grsecurity/gracl.c     1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/gracl.c     2011-08-23 21:48:14.000000000 -0400
-@@ -0,0 +1,4106 @@
+diff -urNp linux-3.1.3/grsecurity/gracl.c linux-3.1.3/grsecurity/gracl.c
+--- linux-3.1.3/grsecurity/gracl.c     1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/gracl.c     2011-11-16 19:31:00.000000000 -0500
+@@ -0,0 +1,4156 @@
 +#include <linux/kernel.h>
 +#include <linux/module.h>
 +#include <linux/sched.h>
@@ -44969,6 +47658,27 @@ diff -urNp linux-3.0.4/grsecurity/gracl.c linux-3.0.4/grsecurity/gracl.c
 +      return ret;
 +}
 +
++static char *
++gr_to_proc_filename_rbac(const struct dentry *dentry, const struct vfsmount *mnt)
++{
++      char *ret;
++      char *buf;
++      int buflen;
++
++      write_seqlock(&rename_lock);
++      br_read_lock(vfsmount_lock);
++      buf = per_cpu_ptr(gr_shared_page[0], smp_processor_id());
++      ret = __d_real_path(dentry, mnt, buf, PAGE_SIZE - 6);
++      buflen = (int)(ret - buf);
++      if (buflen >= 5)
++              prepend(&ret, &buflen, "/proc", 5);
++      else
++              ret = strcpy(buf, "<path too long>");
++      br_read_unlock(vfsmount_lock);
++      write_sequnlock(&rename_lock);
++      return ret;
++}
++
 +char *
 +gr_to_filename_nolock(const struct dentry *dentry, const struct vfsmount *mnt)
 +{
@@ -46680,63 +49390,6 @@ diff -urNp linux-3.0.4/grsecurity/gracl.c linux-3.0.4/grsecurity/gracl.c
 +}
 +
 +__u32
-+gr_check_link(const struct dentry * new_dentry,
-+            const struct dentry * parent_dentry,
-+            const struct vfsmount * parent_mnt,
-+            const struct dentry * old_dentry, const struct vfsmount * old_mnt)
-+{
-+      struct acl_object_label *obj;
-+      __u32 oldmode, newmode;
-+      __u32 needmode;
-+
-+      if (unlikely(!(gr_status & GR_READY)))
-+              return (GR_CREATE | GR_LINK);
-+
-+      obj = chk_obj_label(old_dentry, old_mnt, current->acl);
-+      oldmode = obj->mode;
-+
-+      if (current->acl->mode & (GR_LEARN | GR_INHERITLEARN))
-+              oldmode |= (GR_CREATE | GR_LINK);
-+
-+      needmode = GR_CREATE | GR_AUDIT_CREATE | GR_SUPPRESS;
-+      if (old_dentry->d_inode->i_mode & (S_ISUID | S_ISGID))
-+              needmode |= GR_SETID | GR_AUDIT_SETID;
-+
-+      newmode =
-+          gr_check_create(new_dentry, parent_dentry, parent_mnt,
-+                          oldmode | needmode);
-+
-+      needmode = newmode & (GR_FIND | GR_APPEND | GR_WRITE | GR_EXEC |
-+                            GR_SETID | GR_READ | GR_FIND | GR_DELETE |
-+                            GR_INHERIT | GR_AUDIT_INHERIT);
-+
-+      if (old_dentry->d_inode->i_mode & (S_ISUID | S_ISGID) && !(newmode & GR_SETID))
-+              goto bad;
-+
-+      if ((oldmode & needmode) != needmode)
-+              goto bad;
-+
-+      needmode = oldmode & (GR_NOPTRACE | GR_PTRACERD | GR_INHERIT | GR_AUDITS);
-+      if ((newmode & needmode) != needmode)
-+              goto bad;
-+
-+      if ((newmode & (GR_CREATE | GR_LINK)) == (GR_CREATE | GR_LINK))
-+              return newmode;
-+bad:
-+      needmode = oldmode;
-+      if (old_dentry->d_inode->i_mode & (S_ISUID | S_ISGID))
-+              needmode |= GR_SETID;
-+      
-+      if (current->acl->mode & (GR_LEARN | GR_INHERITLEARN)) {
-+              gr_log_learn(old_dentry, old_mnt, needmode);
-+              return (GR_CREATE | GR_LINK);
-+      } else if (newmode & GR_SUPPRESS)
-+              return GR_SUPPRESS;
-+      else
-+              return 0;
-+}
-+
-+__u32
 +gr_search_file(const struct dentry * dentry, const __u32 mode,
 +             const struct vfsmount * mnt)
 +{
@@ -46791,70 +49444,124 @@ diff -urNp linux-3.0.4/grsecurity/gracl.c linux-3.0.4/grsecurity/gracl.c
 +      return retval;
 +}
 +
-+__u32
-+gr_check_create(const struct dentry * new_dentry, const struct dentry * parent,
-+              const struct vfsmount * mnt, const __u32 mode)
++struct acl_object_label *gr_get_create_object(const struct dentry *new_dentry,
++                                            const struct dentry *parent,
++                                            const struct vfsmount *mnt)
 +{
 +      struct name_entry *match;
 +      struct acl_object_label *matchpo;
 +      struct acl_subject_label *curracl;
 +      char *path;
-+      __u32 retval;
 +
 +      if (unlikely(!(gr_status & GR_READY)))
-+              return (mode & ~GR_AUDITS);
++              return NULL;
 +
 +      preempt_disable();
 +      path = gr_to_filename_rbac(new_dentry, mnt);
 +      match = lookup_name_entry_create(path);
 +
-+      if (!match)
-+              goto check_parent;
-+
 +      curracl = current->acl;
 +
-+      read_lock(&gr_inode_lock);
-+      matchpo = lookup_acl_obj_label_create(match->inode, match->device, curracl);
-+      read_unlock(&gr_inode_lock);
-+
-+      if (matchpo) {
-+              if ((matchpo->mode & mode) !=
-+                  (mode & ~(GR_AUDITS | GR_SUPPRESS))
-+                  && curracl->mode & (GR_LEARN | GR_INHERITLEARN)) {
-+                      __u32 new_mode = mode;
-+
-+                      new_mode &= ~(GR_AUDITS | GR_SUPPRESS);
-+
-+                      gr_log_learn(new_dentry, mnt, new_mode);
++      if (match) {
++              read_lock(&gr_inode_lock);
++              matchpo = lookup_acl_obj_label_create(match->inode, match->device, curracl);
++              read_unlock(&gr_inode_lock);
 +
++              if (matchpo) {
 +                      preempt_enable();
-+                      return new_mode;
++                      return matchpo;
 +              }
-+              preempt_enable();
-+              return (matchpo->mode & mode);
 +      }
 +
-+      check_parent:
-+      curracl = current->acl;
++      // lookup parent
 +
 +      matchpo = chk_obj_create_label(parent, mnt, curracl, path);
++
++      preempt_enable();
++      return matchpo;
++}
++
++__u32
++gr_check_create(const struct dentry * new_dentry, const struct dentry * parent,
++              const struct vfsmount * mnt, const __u32 mode)
++{
++      struct acl_object_label *matchpo;
++      __u32 retval;
++
++      if (unlikely(!(gr_status & GR_READY)))
++              return (mode & ~GR_AUDITS);
++
++      matchpo = gr_get_create_object(new_dentry, parent, mnt);
++
 +      retval = matchpo->mode & mode;
 +
 +      if ((retval != (mode & ~(GR_AUDITS | GR_SUPPRESS)))
-+          && (curracl->mode & (GR_LEARN | GR_INHERITLEARN))) {
++          && (current->acl->mode & (GR_LEARN | GR_INHERITLEARN))) {
 +              __u32 new_mode = mode;
 +
 +              new_mode &= ~(GR_AUDITS | GR_SUPPRESS);
 +
 +              gr_log_learn(new_dentry, mnt, new_mode);
-+              preempt_enable();
 +              return new_mode;
 +      }
 +
-+      preempt_enable();
 +      return retval;
 +}
 +
++__u32
++gr_check_link(const struct dentry * new_dentry,
++            const struct dentry * parent_dentry,
++            const struct vfsmount * parent_mnt,
++            const struct dentry * old_dentry, const struct vfsmount * old_mnt)
++{
++      struct acl_object_label *obj;
++      __u32 oldmode, newmode;
++      __u32 needmode;
++      __u32 checkmodes = GR_FIND | GR_APPEND | GR_WRITE | GR_EXEC | GR_SETID | GR_READ |
++                         GR_DELETE | GR_INHERIT;
++
++      if (unlikely(!(gr_status & GR_READY)))
++              return (GR_CREATE | GR_LINK);
++
++      obj = chk_obj_label(old_dentry, old_mnt, current->acl);
++      oldmode = obj->mode;
++
++      obj = gr_get_create_object(new_dentry, parent_dentry, parent_mnt);
++      newmode = obj->mode;
++
++      needmode = newmode & checkmodes;
++
++      // old name for hardlink must have at least the permissions of the new name
++      if ((oldmode & needmode) != needmode)
++              goto bad;
++
++      // if old name had restrictions/auditing, make sure the new name does as well
++      needmode = oldmode & (GR_NOPTRACE | GR_PTRACERD | GR_INHERIT | GR_AUDITS);
++
++      // don't allow hardlinking of suid/sgid files without permission
++      if (old_dentry->d_inode->i_mode & (S_ISUID | S_ISGID))
++              needmode |= GR_SETID;
++
++      if ((newmode & needmode) != needmode)
++              goto bad;
++
++      // enforce minimum permissions
++      if ((newmode & (GR_CREATE | GR_LINK)) == (GR_CREATE | GR_LINK))
++              return newmode;
++bad:
++      needmode = oldmode;
++      if (old_dentry->d_inode->i_mode & (S_ISUID | S_ISGID))
++              needmode |= GR_SETID;
++      
++      if (current->acl->mode & (GR_LEARN | GR_INHERITLEARN)) {
++              gr_log_learn(old_dentry, old_mnt, needmode | GR_CREATE | GR_LINK);
++              return (GR_CREATE | GR_LINK);
++      } else if (newmode & GR_SUPPRESS)
++              return GR_SUPPRESS;
++      else
++              return 0;
++}
++
 +int
 +gr_check_hidden_task(const struct task_struct *task)
 +{
@@ -47382,15 +50089,12 @@ diff -urNp linux-3.0.4/grsecurity/gracl.c linux-3.0.4/grsecurity/gracl.c
 +}
 +
 +static void
-+do_handle_create(const struct name_entry *matchn, const struct dentry *dentry,
-+               const struct vfsmount *mnt)
++__do_handle_create(const struct name_entry *matchn, ino_t ino, dev_t dev)
 +{
 +      struct acl_subject_label *subj;
 +      struct acl_role_label *role;
 +      unsigned int x;
-+      ino_t ino = dentry->d_inode->i_ino;
-+      dev_t dev = __get_dev(dentry);
-+      
++
 +      FOR_EACH_ROLE_START(role)
 +              update_acl_subj_label(matchn->inode, matchn->device, ino, dev, role);
 +
@@ -47411,6 +50115,18 @@ diff -urNp linux-3.0.4/grsecurity/gracl.c linux-3.0.4/grsecurity/gracl.c
 +      return;
 +}
 +
++static void
++do_handle_create(const struct name_entry *matchn, const struct dentry *dentry,
++               const struct vfsmount *mnt)
++{
++      ino_t ino = dentry->d_inode->i_ino;
++      dev_t dev = __get_dev(dentry);
++
++      __do_handle_create(matchn, ino, dev);   
++
++      return;
++}
++
 +void
 +gr_handle_create(const struct dentry *dentry, const struct vfsmount *mnt)
 +{
@@ -47433,6 +50149,27 @@ diff -urNp linux-3.0.4/grsecurity/gracl.c linux-3.0.4/grsecurity/gracl.c
 +}
 +
 +void
++gr_handle_proc_create(const struct dentry *dentry, const struct inode *inode)
++{
++      struct name_entry *matchn;
++
++      if (unlikely(!(gr_status & GR_READY)))
++              return;
++
++      preempt_disable();
++      matchn = lookup_name_entry(gr_to_proc_filename_rbac(dentry, init_pid_ns.proc_mnt));
++
++      if (unlikely((unsigned long)matchn)) {
++              write_lock(&gr_inode_lock);
++              __do_handle_create(matchn, inode->i_ino, inode->i_sb->s_dev);
++              write_unlock(&gr_inode_lock);
++      }
++      preempt_enable();
++
++      return;
++}
++
++void
 +gr_handle_rename(struct inode *old_dir, struct inode *new_dir,
 +               struct dentry *old_dentry,
 +               struct dentry *new_dentry,
@@ -47440,6 +50177,7 @@ diff -urNp linux-3.0.4/grsecurity/gracl.c linux-3.0.4/grsecurity/gracl.c
 +{
 +      struct name_entry *matchn;
 +      struct inodev_entry *inodev;
++      struct inode *inode = new_dentry->d_inode;
 +      ino_t old_ino = old_dentry->d_inode->i_ino;
 +      dev_t old_dev = __get_dev(old_dentry);
 +
@@ -47462,17 +50200,17 @@ diff -urNp linux-3.0.4/grsecurity/gracl.c linux-3.0.4/grsecurity/gracl.c
 +       */
 +
 +      write_lock(&gr_inode_lock);
-+      if (unlikely(replace && new_dentry->d_inode)) {
-+              ino_t new_ino = new_dentry->d_inode->i_ino;
++      if (unlikely(replace && inode)) {
++              ino_t new_ino = inode->i_ino;
 +              dev_t new_dev = __get_dev(new_dentry);
 +
 +              inodev = lookup_inodev_entry(new_ino, new_dev);
-+              if (inodev != NULL && (new_dentry->d_inode->i_nlink <= 1))
++              if (inodev != NULL && ((inode->i_nlink <= 1) || S_ISDIR(inode->i_mode)))
 +                      do_handle_delete(inodev, new_ino, new_dev);
 +      }
 +
 +      inodev = lookup_inodev_entry(old_ino, old_dev);
-+      if (inodev != NULL && (old_dentry->d_inode->i_nlink <= 1))
++      if (inodev != NULL && ((old_dentry->d_inode->i_nlink <= 1) || S_ISDIR(old_dentry->d_inode->i_mode)))
 +              do_handle_delete(inodev, old_ino, old_dev);
 +
 +      if (unlikely((unsigned long)matchn))
@@ -48462,6 +51200,7 @@ diff -urNp linux-3.0.4/grsecurity/gracl.c linux-3.0.4/grsecurity/gracl.c
 +              
 +      if (retmode & GR_PTRACERD) {
 +              switch (request) {
++              case PTRACE_SEIZE:
 +              case PTRACE_POKETEXT:
 +              case PTRACE_POKEDATA:
 +              case PTRACE_POKEUSR:
@@ -48759,9 +51498,9 @@ diff -urNp linux-3.0.4/grsecurity/gracl.c linux-3.0.4/grsecurity/gracl.c
 +EXPORT_SYMBOL(gr_check_group_change);
 +#endif
 +
-diff -urNp linux-3.0.4/grsecurity/gracl_cap.c linux-3.0.4/grsecurity/gracl_cap.c
---- linux-3.0.4/grsecurity/gracl_cap.c 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/gracl_cap.c 2011-09-14 09:21:24.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/gracl_cap.c linux-3.1.3/grsecurity/gracl_cap.c
+--- linux-3.1.3/grsecurity/gracl_cap.c 1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/gracl_cap.c 2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,101 @@
 +#include <linux/kernel.h>
 +#include <linux/module.h>
@@ -48864,10 +51603,10 @@ diff -urNp linux-3.0.4/grsecurity/gracl_cap.c linux-3.0.4/grsecurity/gracl_cap.c
 +      return 0;
 +}
 +
-diff -urNp linux-3.0.4/grsecurity/gracl_fs.c linux-3.0.4/grsecurity/gracl_fs.c
---- linux-3.0.4/grsecurity/gracl_fs.c  1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/gracl_fs.c  2011-08-23 21:48:14.000000000 -0400
-@@ -0,0 +1,431 @@
+diff -urNp linux-3.1.3/grsecurity/gracl_fs.c linux-3.1.3/grsecurity/gracl_fs.c
+--- linux-3.1.3/grsecurity/gracl_fs.c  1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/gracl_fs.c  2011-11-17 00:25:32.000000000 -0500
+@@ -0,0 +1,433 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
 +#include <linux/types.h>
@@ -48904,7 +51643,7 @@ diff -urNp linux-3.0.4/grsecurity/gracl_fs.c linux-3.0.4/grsecurity/gracl_fs.c
 +
 +__u32
 +gr_acl_handle_open(const struct dentry * dentry, const struct vfsmount * mnt,
-+                 const int fmode)
++                 int acc_mode)
 +{
 +      __u32 reqmode = GR_FIND;
 +      __u32 mode;
@@ -48912,14 +51651,13 @@ diff -urNp linux-3.0.4/grsecurity/gracl_fs.c linux-3.0.4/grsecurity/gracl_fs.c
 +      if (unlikely(!dentry->d_inode))
 +              return reqmode;
 +
-+      if (unlikely(fmode & O_APPEND))
++      if (acc_mode & MAY_APPEND)
 +              reqmode |= GR_APPEND;
-+      else if (unlikely(fmode & FMODE_WRITE))
++      else if (acc_mode & MAY_WRITE)
 +              reqmode |= GR_WRITE;
-+      if (likely((fmode & FMODE_READ) && !(fmode & O_DIRECTORY)))
++      if ((acc_mode & MAY_READ) && !S_ISDIR(dentry->d_inode->i_mode))
 +              reqmode |= GR_READ;
-+      if ((fmode & FMODE_GREXEC) && (fmode & __FMODE_EXEC))
-+              reqmode &= ~GR_READ;
++
 +      mode =
 +          gr_search_file(dentry, reqmode | to_gr_audit(reqmode) | GR_SUPPRESS,
 +                         mnt);
@@ -48947,17 +51685,20 @@ diff -urNp linux-3.0.4/grsecurity/gracl_fs.c linux-3.0.4/grsecurity/gracl_fs.c
 +__u32
 +gr_acl_handle_creat(const struct dentry * dentry,
 +                  const struct dentry * p_dentry,
-+                  const struct vfsmount * p_mnt, const int fmode,
++                  const struct vfsmount * p_mnt, int open_flags, int acc_mode,
 +                  const int imode)
 +{
 +      __u32 reqmode = GR_WRITE | GR_CREATE;
 +      __u32 mode;
 +
-+      if (unlikely(fmode & O_APPEND))
++      if (acc_mode & MAY_APPEND)
 +              reqmode |= GR_APPEND;
-+      if (unlikely((fmode & FMODE_READ) && !(fmode & O_DIRECTORY)))
++      // if a directory was required or the directory already exists, then
++      // don't count this open as a read
++      if ((acc_mode & MAY_READ) &&
++          !((open_flags & O_DIRECTORY) || (dentry->d_inode && S_ISDIR(dentry->d_inode->i_mode))))
 +              reqmode |= GR_READ;
-+      if (unlikely((fmode & O_CREAT) && (imode & (S_ISUID | S_ISGID))))
++      if ((open_flags & O_CREAT) && (imode & (S_ISUID | S_ISGID)))
 +              reqmode |= GR_SETID;
 +
 +      mode =
@@ -49115,7 +51856,7 @@ diff -urNp linux-3.0.4/grsecurity/gracl_fs.c linux-3.0.4/grsecurity/gracl_fs.c
 +                         GR_UNIXCONNECT_ACL_MSG);
 +}
 +
-+/* hardlinks require at minimum create permission,
++/* hardlinks require at minimum create and link permission,
 +   any additional privilege required is based on the
 +   privilege of the file being linked to
 +*/
@@ -49299,9 +52040,9 @@ diff -urNp linux-3.0.4/grsecurity/gracl_fs.c linux-3.0.4/grsecurity/gracl_fs.c
 +
 +      return 0;
 +}
-diff -urNp linux-3.0.4/grsecurity/gracl_ip.c linux-3.0.4/grsecurity/gracl_ip.c
---- linux-3.0.4/grsecurity/gracl_ip.c  1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/gracl_ip.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/gracl_ip.c linux-3.1.3/grsecurity/gracl_ip.c
+--- linux-3.1.3/grsecurity/gracl_ip.c  1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/gracl_ip.c  2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,381 @@
 +#include <linux/kernel.h>
 +#include <asm/uaccess.h>
@@ -49684,9 +52425,9 @@ diff -urNp linux-3.0.4/grsecurity/gracl_ip.c linux-3.0.4/grsecurity/gracl_ip.c
 +
 +      return gr_search_connectbind(GR_CONNECT | GR_CONNECTOVERRIDE, sk, &sin, SOCK_DGRAM);
 +}
-diff -urNp linux-3.0.4/grsecurity/gracl_learn.c linux-3.0.4/grsecurity/gracl_learn.c
---- linux-3.0.4/grsecurity/gracl_learn.c       1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/gracl_learn.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/gracl_learn.c linux-3.1.3/grsecurity/gracl_learn.c
+--- linux-3.1.3/grsecurity/gracl_learn.c       1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/gracl_learn.c       2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,207 @@
 +#include <linux/kernel.h>
 +#include <linux/mm.h>
@@ -49895,9 +52636,9 @@ diff -urNp linux-3.0.4/grsecurity/gracl_learn.c linux-3.0.4/grsecurity/gracl_lea
 +      .release        = close_learn,
 +      .poll           = poll_learn,
 +};
-diff -urNp linux-3.0.4/grsecurity/gracl_res.c linux-3.0.4/grsecurity/gracl_res.c
---- linux-3.0.4/grsecurity/gracl_res.c 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/gracl_res.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/gracl_res.c linux-3.1.3/grsecurity/gracl_res.c
+--- linux-3.1.3/grsecurity/gracl_res.c 1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/gracl_res.c 2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,68 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -49967,9 +52708,9 @@ diff -urNp linux-3.0.4/grsecurity/gracl_res.c linux-3.0.4/grsecurity/gracl_res.c
 +      rcu_read_unlock();
 +      return;
 +}
-diff -urNp linux-3.0.4/grsecurity/gracl_segv.c linux-3.0.4/grsecurity/gracl_segv.c
---- linux-3.0.4/grsecurity/gracl_segv.c        1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/gracl_segv.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/gracl_segv.c linux-3.1.3/grsecurity/gracl_segv.c
+--- linux-3.1.3/grsecurity/gracl_segv.c        1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/gracl_segv.c        2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,299 @@
 +#include <linux/kernel.h>
 +#include <linux/mm.h>
@@ -50152,7 +52893,6 @@ diff -urNp linux-3.0.4/grsecurity/gracl_segv.c linux-3.0.4/grsecurity/gracl_segv
 +gr_handle_crash(struct task_struct *task, const int sig)
 +{
 +      struct acl_subject_label *curr;
-+      struct acl_subject_label *curr2;
 +      struct task_struct *tsk, *tsk2;
 +      const struct cred *cred;
 +      const struct cred *cred2;
@@ -50199,15 +52939,16 @@ diff -urNp linux-3.0.4/grsecurity/gracl_segv.c linux-3.0.4/grsecurity/gracl_segv
 +              } else {
 +                      gr_log_crash2(GR_DONT_AUDIT, GR_SEGVNOSUID_ACL_MSG, task, curr->res[GR_CRASH_RES].rlim_max);
 +                      read_lock(&tasklist_lock);
++                      read_lock(&grsec_exec_file_lock);
 +                      do_each_thread(tsk2, tsk) {
 +                              if (likely(tsk != task)) {
-+                                      curr2 = tsk->acl;
-+
-+                                      if (curr2->device == curr->device &&
-+                                          curr2->inode == curr->inode)
++                                      // if this thread has the same subject as the one that triggered
++                                      // RES_CRASH and it's the same binary, kill it
++                                      if (tsk->acl == task->acl && tsk->exec_file == task->exec_file)
 +                                              gr_fake_force_sig(SIGKILL, tsk);
 +                              }
 +                      } while_each_thread(tsk2, tsk);
++                      read_unlock(&grsec_exec_file_lock);
 +                      read_unlock(&tasklist_lock);
 +              }
 +              rcu_read_unlock();
@@ -50270,9 +53011,9 @@ diff -urNp linux-3.0.4/grsecurity/gracl_segv.c linux-3.0.4/grsecurity/gracl_segv
 +
 +      return;
 +}
-diff -urNp linux-3.0.4/grsecurity/gracl_shm.c linux-3.0.4/grsecurity/gracl_shm.c
---- linux-3.0.4/grsecurity/gracl_shm.c 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/gracl_shm.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/gracl_shm.c linux-3.1.3/grsecurity/gracl_shm.c
+--- linux-3.1.3/grsecurity/gracl_shm.c 1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/gracl_shm.c 2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,40 @@
 +#include <linux/kernel.h>
 +#include <linux/mm.h>
@@ -50314,9 +53055,9 @@ diff -urNp linux-3.0.4/grsecurity/gracl_shm.c linux-3.0.4/grsecurity/gracl_shm.c
 +
 +      return 1;
 +}
-diff -urNp linux-3.0.4/grsecurity/grsec_chdir.c linux-3.0.4/grsecurity/grsec_chdir.c
---- linux-3.0.4/grsecurity/grsec_chdir.c       1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsec_chdir.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/grsec_chdir.c linux-3.1.3/grsecurity/grsec_chdir.c
+--- linux-3.1.3/grsecurity/grsec_chdir.c       1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsec_chdir.c       2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,19 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -50337,9 +53078,9 @@ diff -urNp linux-3.0.4/grsecurity/grsec_chdir.c linux-3.0.4/grsecurity/grsec_chd
 +#endif
 +      return;
 +}
-diff -urNp linux-3.0.4/grsecurity/grsec_chroot.c linux-3.0.4/grsecurity/grsec_chroot.c
---- linux-3.0.4/grsecurity/grsec_chroot.c      1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsec_chroot.c      2011-09-15 06:47:48.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/grsec_chroot.c linux-3.1.3/grsecurity/grsec_chroot.c
+--- linux-3.1.3/grsecurity/grsec_chroot.c      1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsec_chroot.c      2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,351 @@
 +#include <linux/kernel.h>
 +#include <linux/module.h>
@@ -50692,10 +53433,10 @@ diff -urNp linux-3.0.4/grsecurity/grsec_chroot.c linux-3.0.4/grsecurity/grsec_ch
 +#endif
 +      return 0;
 +}
-diff -urNp linux-3.0.4/grsecurity/grsec_disabled.c linux-3.0.4/grsecurity/grsec_disabled.c
---- linux-3.0.4/grsecurity/grsec_disabled.c    1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsec_disabled.c    2011-09-24 08:13:01.000000000 -0400
-@@ -0,0 +1,433 @@
+diff -urNp linux-3.1.3/grsecurity/grsec_disabled.c linux-3.1.3/grsecurity/grsec_disabled.c
+--- linux-3.1.3/grsecurity/grsec_disabled.c    1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsec_disabled.c    2011-11-17 00:16:25.000000000 -0500
+@@ -0,0 +1,439 @@
 +#include <linux/kernel.h>
 +#include <linux/module.h>
 +#include <linux/sched.h>
@@ -50737,6 +53478,12 @@ diff -urNp linux-3.0.4/grsecurity/grsec_disabled.c linux-3.0.4/grsecurity/grsec_
 +      return 0;
 +}
 +
++void
++gr_handle_proc_create(const struct dentry *dentry, const struct inode *inode) 
++{
++      return;
++}
++
 +int
 +gr_handle_rawio(const struct inode *inode)
 +{
@@ -50884,7 +53631,7 @@ diff -urNp linux-3.0.4/grsecurity/grsec_disabled.c linux-3.0.4/grsecurity/grsec_
 +
 +__u32
 +gr_acl_handle_open(const struct dentry * dentry, const struct vfsmount * mnt,
-+                 const int fmode)
++                 int acc_mode)
 +{
 +      return 1;
 +}
@@ -51053,7 +53800,7 @@ diff -urNp linux-3.0.4/grsecurity/grsec_disabled.c linux-3.0.4/grsecurity/grsec_
 +__u32
 +gr_acl_handle_creat(const struct dentry * dentry,
 +                  const struct dentry * p_dentry,
-+                  const struct vfsmount * p_mnt, const int fmode,
++                  const struct vfsmount * p_mnt, int open_flags, int acc_mode,
 +                  const int imode)
 +{
 +      return 1;
@@ -51129,10 +53876,10 @@ diff -urNp linux-3.0.4/grsecurity/grsec_disabled.c linux-3.0.4/grsecurity/grsec_
 +EXPORT_SYMBOL(gr_check_user_change);
 +EXPORT_SYMBOL(gr_check_group_change);
 +#endif
-diff -urNp linux-3.0.4/grsecurity/grsec_exec.c linux-3.0.4/grsecurity/grsec_exec.c
---- linux-3.0.4/grsecurity/grsec_exec.c        1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsec_exec.c        2011-09-14 09:20:28.000000000 -0400
-@@ -0,0 +1,145 @@
+diff -urNp linux-3.1.3/grsecurity/grsec_exec.c linux-3.1.3/grsecurity/grsec_exec.c
+--- linux-3.1.3/grsecurity/grsec_exec.c        1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsec_exec.c        2011-11-16 18:40:31.000000000 -0500
+@@ -0,0 +1,146 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
 +#include <linux/file.h>
@@ -51249,7 +53996,8 @@ diff -urNp linux-3.0.4/grsecurity/grsec_exec.c linux-3.0.4/grsecurity/grsec_exec
 +      "CAP_SETFCAP",
 +      "CAP_MAC_OVERRIDE",
 +      "CAP_MAC_ADMIN",
-+      "CAP_SYSLOG"
++      "CAP_SYSLOG",
++      "CAP_WAKE_ALARM"
 +};
 +
 +int captab_log_entries = sizeof(captab_log)/sizeof(captab_log[0]);
@@ -51278,9 +54026,9 @@ diff -urNp linux-3.0.4/grsecurity/grsec_exec.c linux-3.0.4/grsecurity/grsec_exec
 +
 +EXPORT_SYMBOL(gr_is_capable);
 +EXPORT_SYMBOL(gr_is_capable_nolog);
-diff -urNp linux-3.0.4/grsecurity/grsec_fifo.c linux-3.0.4/grsecurity/grsec_fifo.c
---- linux-3.0.4/grsecurity/grsec_fifo.c        1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsec_fifo.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/grsec_fifo.c linux-3.1.3/grsecurity/grsec_fifo.c
+--- linux-3.1.3/grsecurity/grsec_fifo.c        1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsec_fifo.c        2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,24 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -51306,9 +54054,9 @@ diff -urNp linux-3.0.4/grsecurity/grsec_fifo.c linux-3.0.4/grsecurity/grsec_fifo
 +#endif
 +      return 0;
 +}
-diff -urNp linux-3.0.4/grsecurity/grsec_fork.c linux-3.0.4/grsecurity/grsec_fork.c
---- linux-3.0.4/grsecurity/grsec_fork.c        1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsec_fork.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/grsec_fork.c linux-3.1.3/grsecurity/grsec_fork.c
+--- linux-3.1.3/grsecurity/grsec_fork.c        1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsec_fork.c        2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,23 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -51333,9 +54081,9 @@ diff -urNp linux-3.0.4/grsecurity/grsec_fork.c linux-3.0.4/grsecurity/grsec_fork
 +#endif
 +      return;
 +}
-diff -urNp linux-3.0.4/grsecurity/grsec_init.c linux-3.0.4/grsecurity/grsec_init.c
---- linux-3.0.4/grsecurity/grsec_init.c        1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsec_init.c        2011-08-25 17:25:12.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/grsec_init.c linux-3.1.3/grsecurity/grsec_init.c
+--- linux-3.1.3/grsecurity/grsec_init.c        1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsec_init.c        2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,269 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -51606,9 +54354,9 @@ diff -urNp linux-3.0.4/grsecurity/grsec_init.c linux-3.0.4/grsecurity/grsec_init
 +
 +      return;
 +}
-diff -urNp linux-3.0.4/grsecurity/grsec_link.c linux-3.0.4/grsecurity/grsec_link.c
---- linux-3.0.4/grsecurity/grsec_link.c        1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsec_link.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/grsec_link.c linux-3.1.3/grsecurity/grsec_link.c
+--- linux-3.1.3/grsecurity/grsec_link.c        1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsec_link.c        2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,43 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -51653,10 +54401,10 @@ diff -urNp linux-3.0.4/grsecurity/grsec_link.c linux-3.0.4/grsecurity/grsec_link
 +#endif
 +      return 0;
 +}
-diff -urNp linux-3.0.4/grsecurity/grsec_log.c linux-3.0.4/grsecurity/grsec_log.c
---- linux-3.0.4/grsecurity/grsec_log.c 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsec_log.c 2011-09-26 10:46:21.000000000 -0400
-@@ -0,0 +1,315 @@
+diff -urNp linux-3.1.3/grsecurity/grsec_log.c linux-3.1.3/grsecurity/grsec_log.c
+--- linux-3.1.3/grsecurity/grsec_log.c 1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsec_log.c 2011-11-16 18:40:31.000000000 -0500
+@@ -0,0 +1,322 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
 +#include <linux/file.h>
@@ -51778,12 +54526,15 @@ diff -urNp linux-3.0.4/grsecurity/grsec_log.c linux-3.0.4/grsecurity/grsec_log.c
 +      return;
 +}
 +
-+static void gr_log_end(int audit)
++static void gr_log_end(int audit, int append_default)
 +{
 +      char *buf = (audit == GR_DO_AUDIT) ? gr_audit_log_buf : gr_alert_log_buf;
-+      unsigned int len = strlen(buf);
 +
-+      snprintf(buf + len, PAGE_SIZE - len - 1, DEFAULTSECMSG, DEFAULTSECARGS(current, current_cred(), __task_cred(current->real_parent)));
++      if (append_default) {
++              unsigned int len = strlen(buf);
++              snprintf(buf + len, PAGE_SIZE - len - 1, DEFAULTSECMSG, DEFAULTSECARGS(current, current_cred(), __task_cred(current->real_parent)));
++      }
++
 +      printk("%s\n", buf);
 +
 +      return;
@@ -51969,12 +54720,16 @@ diff -urNp linux-3.0.4/grsecurity/grsec_log.c linux-3.0.4/grsecurity/grsec_log.c
 +              gr_log_middle(audit, msg, ap);
 +      }
 +      va_end(ap);
-+      gr_log_end(audit);
++      // these don't need DEFAULTSECARGS printed on the end
++      if (argtypes == GR_CRASH1 || argtypes == GR_CRASH2)
++              gr_log_end(audit, 0);
++      else
++              gr_log_end(audit, 1);
 +      END_LOCKS(audit);
 +}
-diff -urNp linux-3.0.4/grsecurity/grsec_mem.c linux-3.0.4/grsecurity/grsec_mem.c
---- linux-3.0.4/grsecurity/grsec_mem.c 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsec_mem.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/grsec_mem.c linux-3.1.3/grsecurity/grsec_mem.c
+--- linux-3.1.3/grsecurity/grsec_mem.c 1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsec_mem.c 2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,33 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -52009,9 +54764,9 @@ diff -urNp linux-3.0.4/grsecurity/grsec_mem.c linux-3.0.4/grsecurity/grsec_mem.c
 +      gr_log_noargs(GR_DONT_AUDIT, GR_VM86_MSG);
 +      return;
 +}
-diff -urNp linux-3.0.4/grsecurity/grsec_mount.c linux-3.0.4/grsecurity/grsec_mount.c
---- linux-3.0.4/grsecurity/grsec_mount.c       1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsec_mount.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/grsec_mount.c linux-3.1.3/grsecurity/grsec_mount.c
+--- linux-3.1.3/grsecurity/grsec_mount.c       1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsec_mount.c       2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,62 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -52075,9 +54830,9 @@ diff -urNp linux-3.0.4/grsecurity/grsec_mount.c linux-3.0.4/grsecurity/grsec_mou
 +#endif
 +      return 0;
 +}
-diff -urNp linux-3.0.4/grsecurity/grsec_pax.c linux-3.0.4/grsecurity/grsec_pax.c
---- linux-3.0.4/grsecurity/grsec_pax.c 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsec_pax.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/grsec_pax.c linux-3.1.3/grsecurity/grsec_pax.c
+--- linux-3.1.3/grsecurity/grsec_pax.c 1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsec_pax.c 2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,36 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -52115,9 +54870,9 @@ diff -urNp linux-3.0.4/grsecurity/grsec_pax.c linux-3.0.4/grsecurity/grsec_pax.c
 +#endif
 +      return;
 +}
-diff -urNp linux-3.0.4/grsecurity/grsec_ptrace.c linux-3.0.4/grsecurity/grsec_ptrace.c
---- linux-3.0.4/grsecurity/grsec_ptrace.c      1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsec_ptrace.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/grsec_ptrace.c linux-3.1.3/grsecurity/grsec_ptrace.c
+--- linux-3.1.3/grsecurity/grsec_ptrace.c      1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsec_ptrace.c      2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,14 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -52133,9 +54888,9 @@ diff -urNp linux-3.0.4/grsecurity/grsec_ptrace.c linux-3.0.4/grsecurity/grsec_pt
 +#endif
 +      return;
 +}
-diff -urNp linux-3.0.4/grsecurity/grsec_sig.c linux-3.0.4/grsecurity/grsec_sig.c
---- linux-3.0.4/grsecurity/grsec_sig.c 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsec_sig.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/grsec_sig.c linux-3.1.3/grsecurity/grsec_sig.c
+--- linux-3.1.3/grsecurity/grsec_sig.c 1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsec_sig.c 2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,206 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -52343,9 +55098,9 @@ diff -urNp linux-3.0.4/grsecurity/grsec_sig.c linux-3.0.4/grsecurity/grsec_sig.c
 +#endif
 +      return 0;
 +}
-diff -urNp linux-3.0.4/grsecurity/grsec_sock.c linux-3.0.4/grsecurity/grsec_sock.c
---- linux-3.0.4/grsecurity/grsec_sock.c        1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsec_sock.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/grsec_sock.c linux-3.1.3/grsecurity/grsec_sock.c
+--- linux-3.1.3/grsecurity/grsec_sock.c        1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsec_sock.c        2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,244 @@
 +#include <linux/kernel.h>
 +#include <linux/module.h>
@@ -52591,9 +55346,9 @@ diff -urNp linux-3.0.4/grsecurity/grsec_sock.c linux-3.0.4/grsecurity/grsec_sock
 +#endif
 +      return 0;
 +}
-diff -urNp linux-3.0.4/grsecurity/grsec_sysctl.c linux-3.0.4/grsecurity/grsec_sysctl.c
---- linux-3.0.4/grsecurity/grsec_sysctl.c      1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsec_sysctl.c      2011-08-25 17:26:15.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/grsec_sysctl.c linux-3.1.3/grsecurity/grsec_sysctl.c
+--- linux-3.1.3/grsecurity/grsec_sysctl.c      1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsec_sysctl.c      2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,433 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -53028,9 +55783,9 @@ diff -urNp linux-3.0.4/grsecurity/grsec_sysctl.c linux-3.0.4/grsecurity/grsec_sy
 +      { }
 +};
 +#endif
-diff -urNp linux-3.0.4/grsecurity/grsec_time.c linux-3.0.4/grsecurity/grsec_time.c
---- linux-3.0.4/grsecurity/grsec_time.c        1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsec_time.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/grsec_time.c linux-3.1.3/grsecurity/grsec_time.c
+--- linux-3.1.3/grsecurity/grsec_time.c        1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsec_time.c        2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,16 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -53048,9 +55803,9 @@ diff -urNp linux-3.0.4/grsecurity/grsec_time.c linux-3.0.4/grsecurity/grsec_time
 +}
 +
 +EXPORT_SYMBOL(gr_log_timechange);
-diff -urNp linux-3.0.4/grsecurity/grsec_tpe.c linux-3.0.4/grsecurity/grsec_tpe.c
---- linux-3.0.4/grsecurity/grsec_tpe.c 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsec_tpe.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/grsec_tpe.c linux-3.1.3/grsecurity/grsec_tpe.c
+--- linux-3.1.3/grsecurity/grsec_tpe.c 1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsec_tpe.c 2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,39 @@
 +#include <linux/kernel.h>
 +#include <linux/sched.h>
@@ -53091,9 +55846,9 @@ diff -urNp linux-3.0.4/grsecurity/grsec_tpe.c linux-3.0.4/grsecurity/grsec_tpe.c
 +#endif
 +      return 1;
 +}
-diff -urNp linux-3.0.4/grsecurity/grsum.c linux-3.0.4/grsecurity/grsum.c
---- linux-3.0.4/grsecurity/grsum.c     1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/grsum.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/grsecurity/grsum.c linux-3.1.3/grsecurity/grsum.c
+--- linux-3.1.3/grsecurity/grsum.c     1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/grsum.c     2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,61 @@
 +#include <linux/err.h>
 +#include <linux/kernel.h>
@@ -53156,10 +55911,10 @@ diff -urNp linux-3.0.4/grsecurity/grsum.c linux-3.0.4/grsecurity/grsum.c
 +
 +      return retval;
 +}
-diff -urNp linux-3.0.4/grsecurity/Kconfig linux-3.0.4/grsecurity/Kconfig
---- linux-3.0.4/grsecurity/Kconfig     1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/Kconfig     2011-09-15 00:00:57.000000000 -0400
-@@ -0,0 +1,1038 @@
+diff -urNp linux-3.1.3/grsecurity/Kconfig linux-3.1.3/grsecurity/Kconfig
+--- linux-3.1.3/grsecurity/Kconfig     1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/Kconfig     2011-11-16 18:40:31.000000000 -0500
+@@ -0,0 +1,1037 @@
 +#
 +# grecurity configuration
 +#
@@ -53256,7 +56011,7 @@ diff -urNp linux-3.0.4/grsecurity/Kconfig linux-3.0.4/grsecurity/Kconfig
 +        - Deny mknod in chroot
 +        - Deny access to abstract AF_UNIX sockets out of chroot
 +        - Deny pivot_root in chroot
-+        - Denied writes of /dev/kmem, /dev/mem, and /dev/port
++        - Denied reads/writes of /dev/kmem, /dev/mem, and /dev/port
 +        - /proc restrictions with special GID set to 10 (usually wheel)
 +        - Address Space Layout Randomization (ASLR)
 +        - Prevent exploitation of most refcount overflows
@@ -53346,7 +56101,6 @@ diff -urNp linux-3.0.4/grsecurity/Kconfig linux-3.0.4/grsecurity/Kconfig
 +        - Kernel stack randomization
 +        - Mount/unmount/remount logging
 +        - Kernel symbol hiding
-+        - Prevention of memory exhaustion-based exploits
 +        - Hardening of module auto-loading
 +        - Ptrace restrictions
 +        - Restricted vm86 mode
@@ -53369,12 +56123,12 @@ diff -urNp linux-3.0.4/grsecurity/Kconfig linux-3.0.4/grsecurity/Kconfig
 +depends on GRKERNSEC
 +
 +config GRKERNSEC_KMEM
-+      bool "Deny writing to /dev/kmem, /dev/mem, and /dev/port"
++      bool "Deny reading/writing to /dev/kmem, /dev/mem, and /dev/port"
 +      select STRICT_DEVMEM if (X86 || ARM || TILE || S390)
 +      help
 +        If you say Y here, /dev/kmem and /dev/mem won't be allowed to
-+        be written to via mmap or otherwise to modify the running kernel.
-+        /dev/port will also not be allowed to be opened. If you have module
++        be written to or read from to modify or leak the contents of the running
++        kernel.  /dev/port will also not be allowed to be opened. If you have module
 +        support disabled, enabling this will close up four ways that are
 +        currently used  to insert malicious code into the running kernel.
 +        Even with all these features enabled, we still highly recommend that
@@ -54198,10 +56952,10 @@ diff -urNp linux-3.0.4/grsecurity/Kconfig linux-3.0.4/grsecurity/Kconfig
 +endmenu
 +
 +endmenu
-diff -urNp linux-3.0.4/grsecurity/Makefile linux-3.0.4/grsecurity/Makefile
---- linux-3.0.4/grsecurity/Makefile    1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/grsecurity/Makefile    2011-09-14 23:29:56.000000000 -0400
-@@ -0,0 +1,35 @@
+diff -urNp linux-3.1.3/grsecurity/Makefile linux-3.1.3/grsecurity/Makefile
+--- linux-3.1.3/grsecurity/Makefile    1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/grsecurity/Makefile    2011-11-16 18:40:31.000000000 -0500
+@@ -0,0 +1,36 @@
 +# grsecurity's ACL system was originally written in 2001 by Michael Dalton
 +# during 2001-2009 it has been completely redesigned by Brad Spengler
 +# into an RBAC system
@@ -54234,12 +56988,13 @@ diff -urNp linux-3.0.4/grsecurity/Makefile linux-3.0.4/grsecurity/Makefile
 +      @-chmod -f 500 /boot
 +      @-chmod -f 500 /lib/modules
 +      @-chmod -f 500 /lib64/modules
++      @-chmod -f 500 /lib32/modules
 +      @-chmod -f 700 .
 +      @echo '  grsec: protected kernel image paths'
 +endif
-diff -urNp linux-3.0.4/include/acpi/acpi_bus.h linux-3.0.4/include/acpi/acpi_bus.h
---- linux-3.0.4/include/acpi/acpi_bus.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/acpi/acpi_bus.h        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/acpi/acpi_bus.h linux-3.1.3/include/acpi/acpi_bus.h
+--- linux-3.1.3/include/acpi/acpi_bus.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/acpi/acpi_bus.h        2011-11-16 18:39:08.000000000 -0500
 @@ -107,7 +107,7 @@ struct acpi_device_ops {
        acpi_op_bind bind;
        acpi_op_unbind unbind;
@@ -54249,9 +57004,9 @@ diff -urNp linux-3.0.4/include/acpi/acpi_bus.h linux-3.0.4/include/acpi/acpi_bus
  
  #define ACPI_DRIVER_ALL_NOTIFY_EVENTS 0x1     /* system AND device events */
  
-diff -urNp linux-3.0.4/include/asm-generic/atomic-long.h linux-3.0.4/include/asm-generic/atomic-long.h
---- linux-3.0.4/include/asm-generic/atomic-long.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/asm-generic/atomic-long.h      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/asm-generic/atomic-long.h linux-3.1.3/include/asm-generic/atomic-long.h
+--- linux-3.1.3/include/asm-generic/atomic-long.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/asm-generic/atomic-long.h      2011-11-16 18:39:08.000000000 -0500
 @@ -22,6 +22,12 @@
  
  typedef atomic64_t atomic_long_t;
@@ -54552,9 +57307,9 @@ diff -urNp linux-3.0.4/include/asm-generic/atomic-long.h linux-3.0.4/include/asm
 +#endif
 +
  #endif  /*  _ASM_GENERIC_ATOMIC_LONG_H  */
-diff -urNp linux-3.0.4/include/asm-generic/cache.h linux-3.0.4/include/asm-generic/cache.h
---- linux-3.0.4/include/asm-generic/cache.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/asm-generic/cache.h    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/asm-generic/cache.h linux-3.1.3/include/asm-generic/cache.h
+--- linux-3.1.3/include/asm-generic/cache.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/asm-generic/cache.h    2011-11-16 18:39:08.000000000 -0500
 @@ -6,7 +6,7 @@
   * cache lines need to provide their own cache.h.
   */
@@ -54565,9 +57320,9 @@ diff -urNp linux-3.0.4/include/asm-generic/cache.h linux-3.0.4/include/asm-gener
 +#define L1_CACHE_BYTES                (1UL << L1_CACHE_SHIFT)
  
  #endif /* __ASM_GENERIC_CACHE_H */
-diff -urNp linux-3.0.4/include/asm-generic/int-l64.h linux-3.0.4/include/asm-generic/int-l64.h
---- linux-3.0.4/include/asm-generic/int-l64.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/asm-generic/int-l64.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/asm-generic/int-l64.h linux-3.1.3/include/asm-generic/int-l64.h
+--- linux-3.1.3/include/asm-generic/int-l64.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/asm-generic/int-l64.h  2011-11-16 18:39:08.000000000 -0500
 @@ -46,6 +46,8 @@ typedef unsigned int u32;
  typedef signed long s64;
  typedef unsigned long u64;
@@ -54577,9 +57332,9 @@ diff -urNp linux-3.0.4/include/asm-generic/int-l64.h linux-3.0.4/include/asm-gen
  #define S8_C(x)  x
  #define U8_C(x)  x ## U
  #define S16_C(x) x
-diff -urNp linux-3.0.4/include/asm-generic/int-ll64.h linux-3.0.4/include/asm-generic/int-ll64.h
---- linux-3.0.4/include/asm-generic/int-ll64.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/asm-generic/int-ll64.h 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/asm-generic/int-ll64.h linux-3.1.3/include/asm-generic/int-ll64.h
+--- linux-3.1.3/include/asm-generic/int-ll64.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/asm-generic/int-ll64.h 2011-11-16 18:39:08.000000000 -0500
 @@ -51,6 +51,8 @@ typedef unsigned int u32;
  typedef signed long long s64;
  typedef unsigned long long u64;
@@ -54589,9 +57344,9 @@ diff -urNp linux-3.0.4/include/asm-generic/int-ll64.h linux-3.0.4/include/asm-ge
  #define S8_C(x)  x
  #define U8_C(x)  x ## U
  #define S16_C(x) x
-diff -urNp linux-3.0.4/include/asm-generic/kmap_types.h linux-3.0.4/include/asm-generic/kmap_types.h
---- linux-3.0.4/include/asm-generic/kmap_types.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/asm-generic/kmap_types.h       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/asm-generic/kmap_types.h linux-3.1.3/include/asm-generic/kmap_types.h
+--- linux-3.1.3/include/asm-generic/kmap_types.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/asm-generic/kmap_types.h       2011-11-16 18:39:08.000000000 -0500
 @@ -29,10 +29,11 @@ KMAP_D(16) KM_IRQ_PTE,
  KMAP_D(17)    KM_NMI,
  KMAP_D(18)    KM_NMI_PTE,
@@ -54605,9 +57360,9 @@ diff -urNp linux-3.0.4/include/asm-generic/kmap_types.h linux-3.0.4/include/asm-
  };
  
  #undef KMAP_D
-diff -urNp linux-3.0.4/include/asm-generic/pgtable.h linux-3.0.4/include/asm-generic/pgtable.h
---- linux-3.0.4/include/asm-generic/pgtable.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/asm-generic/pgtable.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/asm-generic/pgtable.h linux-3.1.3/include/asm-generic/pgtable.h
+--- linux-3.1.3/include/asm-generic/pgtable.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/asm-generic/pgtable.h  2011-11-16 18:39:08.000000000 -0500
 @@ -443,6 +443,14 @@ static inline int pmd_write(pmd_t pmd)
  #endif /* __HAVE_ARCH_PMD_WRITE */
  #endif
@@ -54623,9 +57378,9 @@ diff -urNp linux-3.0.4/include/asm-generic/pgtable.h linux-3.0.4/include/asm-gen
  #endif /* !__ASSEMBLY__ */
  
  #endif /* _ASM_GENERIC_PGTABLE_H */
-diff -urNp linux-3.0.4/include/asm-generic/pgtable-nopmd.h linux-3.0.4/include/asm-generic/pgtable-nopmd.h
---- linux-3.0.4/include/asm-generic/pgtable-nopmd.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/asm-generic/pgtable-nopmd.h    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/asm-generic/pgtable-nopmd.h linux-3.1.3/include/asm-generic/pgtable-nopmd.h
+--- linux-3.1.3/include/asm-generic/pgtable-nopmd.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/asm-generic/pgtable-nopmd.h    2011-11-16 18:39:08.000000000 -0500
 @@ -1,14 +1,19 @@
  #ifndef _PGTABLE_NOPMD_H
  #define _PGTABLE_NOPMD_H
@@ -54662,9 +57417,9 @@ diff -urNp linux-3.0.4/include/asm-generic/pgtable-nopmd.h linux-3.0.4/include/a
  /*
   * The "pud_xxx()" functions here are trivial for a folded two-level
   * setup: the pmd is never bad, and a pmd always exists (as it's folded
-diff -urNp linux-3.0.4/include/asm-generic/pgtable-nopud.h linux-3.0.4/include/asm-generic/pgtable-nopud.h
---- linux-3.0.4/include/asm-generic/pgtable-nopud.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/asm-generic/pgtable-nopud.h    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/asm-generic/pgtable-nopud.h linux-3.1.3/include/asm-generic/pgtable-nopud.h
+--- linux-3.1.3/include/asm-generic/pgtable-nopud.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/asm-generic/pgtable-nopud.h    2011-11-16 18:39:08.000000000 -0500
 @@ -1,10 +1,15 @@
  #ifndef _PGTABLE_NOPUD_H
  #define _PGTABLE_NOPUD_H
@@ -54695,9 +57450,9 @@ diff -urNp linux-3.0.4/include/asm-generic/pgtable-nopud.h linux-3.0.4/include/a
  /*
   * The "pgd_xxx()" functions here are trivial for a folded two-level
   * setup: the pud is never bad, and a pud always exists (as it's folded
-diff -urNp linux-3.0.4/include/asm-generic/vmlinux.lds.h linux-3.0.4/include/asm-generic/vmlinux.lds.h
---- linux-3.0.4/include/asm-generic/vmlinux.lds.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/asm-generic/vmlinux.lds.h      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/asm-generic/vmlinux.lds.h linux-3.1.3/include/asm-generic/vmlinux.lds.h
+--- linux-3.1.3/include/asm-generic/vmlinux.lds.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/asm-generic/vmlinux.lds.h      2011-11-16 18:39:08.000000000 -0500
 @@ -217,6 +217,7 @@
        .rodata           : AT(ADDR(.rodata) - LOAD_OFFSET) {           \
                VMLINUX_SYMBOL(__start_rodata) = .;                     \
@@ -54729,9 +57484,9 @@ diff -urNp linux-3.0.4/include/asm-generic/vmlinux.lds.h linux-3.0.4/include/asm
  
  /**
   * PERCPU_SECTION - define output section for percpu area, simple version
-diff -urNp linux-3.0.4/include/drm/drm_crtc_helper.h linux-3.0.4/include/drm/drm_crtc_helper.h
---- linux-3.0.4/include/drm/drm_crtc_helper.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/drm/drm_crtc_helper.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/drm/drm_crtc_helper.h linux-3.1.3/include/drm/drm_crtc_helper.h
+--- linux-3.1.3/include/drm/drm_crtc_helper.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/drm/drm_crtc_helper.h  2011-11-16 18:39:08.000000000 -0500
 @@ -74,7 +74,7 @@ struct drm_crtc_helper_funcs {
  
        /* disable crtc when not in use - more explicit than dpms off */
@@ -54750,9 +57505,9 @@ diff -urNp linux-3.0.4/include/drm/drm_crtc_helper.h linux-3.0.4/include/drm/drm
  
  struct drm_connector_helper_funcs {
        int (*get_modes)(struct drm_connector *connector);
-diff -urNp linux-3.0.4/include/drm/drmP.h linux-3.0.4/include/drm/drmP.h
---- linux-3.0.4/include/drm/drmP.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/drm/drmP.h     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/drm/drmP.h linux-3.1.3/include/drm/drmP.h
+--- linux-3.1.3/include/drm/drmP.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/drm/drmP.h     2011-11-16 18:39:08.000000000 -0500
 @@ -73,6 +73,7 @@
  #include <linux/workqueue.h>
  #include <linux/poll.h>
@@ -54761,7 +57516,7 @@ diff -urNp linux-3.0.4/include/drm/drmP.h linux-3.0.4/include/drm/drmP.h
  #include "drm.h"
  
  #include <linux/idr.h>
-@@ -1033,7 +1034,7 @@ struct drm_device {
+@@ -1035,7 +1036,7 @@ struct drm_device {
  
        /** \name Usage Counters */
        /*@{ */
@@ -54770,7 +57525,7 @@ diff -urNp linux-3.0.4/include/drm/drmP.h linux-3.0.4/include/drm/drmP.h
        atomic_t ioctl_count;           /**< Outstanding IOCTLs pending */
        atomic_t vma_count;             /**< Outstanding vma areas open */
        int buf_use;                    /**< Buffers in use -- cannot alloc */
-@@ -1044,7 +1045,7 @@ struct drm_device {
+@@ -1046,7 +1047,7 @@ struct drm_device {
        /*@{ */
        unsigned long counters;
        enum drm_stat_type types[15];
@@ -54779,9 +57534,9 @@ diff -urNp linux-3.0.4/include/drm/drmP.h linux-3.0.4/include/drm/drmP.h
        /*@} */
  
        struct list_head filelist;
-diff -urNp linux-3.0.4/include/drm/ttm/ttm_memory.h linux-3.0.4/include/drm/ttm/ttm_memory.h
---- linux-3.0.4/include/drm/ttm/ttm_memory.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/drm/ttm/ttm_memory.h   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/drm/ttm/ttm_memory.h linux-3.1.3/include/drm/ttm/ttm_memory.h
+--- linux-3.1.3/include/drm/ttm/ttm_memory.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/drm/ttm/ttm_memory.h   2011-11-16 18:39:08.000000000 -0500
 @@ -47,7 +47,7 @@
  
  struct ttm_mem_shrink {
@@ -54791,9 +57546,9 @@ diff -urNp linux-3.0.4/include/drm/ttm/ttm_memory.h linux-3.0.4/include/drm/ttm/
  
  /**
   * struct ttm_mem_global - Global memory accounting structure.
-diff -urNp linux-3.0.4/include/linux/a.out.h linux-3.0.4/include/linux/a.out.h
---- linux-3.0.4/include/linux/a.out.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/a.out.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/a.out.h linux-3.1.3/include/linux/a.out.h
+--- linux-3.1.3/include/linux/a.out.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/a.out.h  2011-11-16 18:39:08.000000000 -0500
 @@ -39,6 +39,14 @@ enum machine_type {
    M_MIPS2 = 152               /* MIPS R6000/R4000 binary */
  };
@@ -54809,9 +57564,9 @@ diff -urNp linux-3.0.4/include/linux/a.out.h linux-3.0.4/include/linux/a.out.h
  #if !defined (N_MAGIC)
  #define N_MAGIC(exec) ((exec).a_info & 0xffff)
  #endif
-diff -urNp linux-3.0.4/include/linux/atmdev.h linux-3.0.4/include/linux/atmdev.h
---- linux-3.0.4/include/linux/atmdev.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/atmdev.h 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/atmdev.h linux-3.1.3/include/linux/atmdev.h
+--- linux-3.1.3/include/linux/atmdev.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/atmdev.h 2011-11-16 18:39:08.000000000 -0500
 @@ -237,7 +237,7 @@ struct compat_atm_iobuf {
  #endif
  
@@ -54821,9 +57576,9 @@ diff -urNp linux-3.0.4/include/linux/atmdev.h linux-3.0.4/include/linux/atmdev.h
        __AAL_STAT_ITEMS
  #undef __HANDLE_ITEM
  };
-diff -urNp linux-3.0.4/include/linux/binfmts.h linux-3.0.4/include/linux/binfmts.h
---- linux-3.0.4/include/linux/binfmts.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/binfmts.h        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/binfmts.h linux-3.1.3/include/linux/binfmts.h
+--- linux-3.1.3/include/linux/binfmts.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/binfmts.h        2011-11-16 18:39:08.000000000 -0500
 @@ -88,6 +88,7 @@ struct linux_binfmt {
        int (*load_binary)(struct linux_binprm *, struct  pt_regs * regs);
        int (*load_shlib)(struct file *);
@@ -54832,10 +57587,10 @@ diff -urNp linux-3.0.4/include/linux/binfmts.h linux-3.0.4/include/linux/binfmts
        unsigned long min_coredump;     /* minimal dump size */
  };
  
-diff -urNp linux-3.0.4/include/linux/blkdev.h linux-3.0.4/include/linux/blkdev.h
---- linux-3.0.4/include/linux/blkdev.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/blkdev.h 2011-08-26 19:49:56.000000000 -0400
-@@ -1308,7 +1308,7 @@ struct block_device_operations {
+diff -urNp linux-3.1.3/include/linux/blkdev.h linux-3.1.3/include/linux/blkdev.h
+--- linux-3.1.3/include/linux/blkdev.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/blkdev.h 2011-11-16 18:39:08.000000000 -0500
+@@ -1321,7 +1321,7 @@ struct block_device_operations {
        /* this callback is with swap_lock and sometimes page table lock held */
        void (*swap_slot_free_notify) (struct block_device *, unsigned long);
        struct module *owner;
@@ -54844,10 +57599,10 @@ diff -urNp linux-3.0.4/include/linux/blkdev.h linux-3.0.4/include/linux/blkdev.h
  
  extern int __blkdev_driver_ioctl(struct block_device *, fmode_t, unsigned int,
                                 unsigned long);
-diff -urNp linux-3.0.4/include/linux/blktrace_api.h linux-3.0.4/include/linux/blktrace_api.h
---- linux-3.0.4/include/linux/blktrace_api.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/blktrace_api.h   2011-08-23 21:47:56.000000000 -0400
-@@ -161,7 +161,7 @@ struct blk_trace {
+diff -urNp linux-3.1.3/include/linux/blktrace_api.h linux-3.1.3/include/linux/blktrace_api.h
+--- linux-3.1.3/include/linux/blktrace_api.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/blktrace_api.h   2011-11-16 18:39:08.000000000 -0500
+@@ -162,7 +162,7 @@ struct blk_trace {
        struct dentry *dir;
        struct dentry *dropped_file;
        struct dentry *msg_file;
@@ -54856,9 +57611,9 @@ diff -urNp linux-3.0.4/include/linux/blktrace_api.h linux-3.0.4/include/linux/bl
  };
  
  extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *);
-diff -urNp linux-3.0.4/include/linux/byteorder/little_endian.h linux-3.0.4/include/linux/byteorder/little_endian.h
---- linux-3.0.4/include/linux/byteorder/little_endian.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/byteorder/little_endian.h        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/byteorder/little_endian.h linux-3.1.3/include/linux/byteorder/little_endian.h
+--- linux-3.1.3/include/linux/byteorder/little_endian.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/byteorder/little_endian.h        2011-11-16 18:39:08.000000000 -0500
 @@ -42,51 +42,51 @@
  
  static inline __le64 __cpu_to_le64p(const __u64 *p)
@@ -54923,9 +57678,9 @@ diff -urNp linux-3.0.4/include/linux/byteorder/little_endian.h linux-3.0.4/inclu
  }
  #define __cpu_to_le64s(x) do { (void)(x); } while (0)
  #define __le64_to_cpus(x) do { (void)(x); } while (0)
-diff -urNp linux-3.0.4/include/linux/cache.h linux-3.0.4/include/linux/cache.h
---- linux-3.0.4/include/linux/cache.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/cache.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/cache.h linux-3.1.3/include/linux/cache.h
+--- linux-3.1.3/include/linux/cache.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/cache.h  2011-11-16 18:39:08.000000000 -0500
 @@ -16,6 +16,10 @@
  #define __read_mostly
  #endif
@@ -54937,9 +57692,9 @@ diff -urNp linux-3.0.4/include/linux/cache.h linux-3.0.4/include/linux/cache.h
  #ifndef ____cacheline_aligned
  #define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
  #endif
-diff -urNp linux-3.0.4/include/linux/capability.h linux-3.0.4/include/linux/capability.h
---- linux-3.0.4/include/linux/capability.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/capability.h     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/capability.h linux-3.1.3/include/linux/capability.h
+--- linux-3.1.3/include/linux/capability.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/capability.h     2011-11-16 18:40:31.000000000 -0500
 @@ -547,6 +547,9 @@ extern bool capable(int cap);
  extern bool ns_capable(struct user_namespace *ns, int cap);
  extern bool task_ns_capable(struct task_struct *t, int cap);
@@ -54950,9 +57705,9 @@ diff -urNp linux-3.0.4/include/linux/capability.h linux-3.0.4/include/linux/capa
  
  /* audit system wants to get cap info from files as well */
  extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps);
-diff -urNp linux-3.0.4/include/linux/cleancache.h linux-3.0.4/include/linux/cleancache.h
---- linux-3.0.4/include/linux/cleancache.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/cleancache.h     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/cleancache.h linux-3.1.3/include/linux/cleancache.h
+--- linux-3.1.3/include/linux/cleancache.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/cleancache.h     2011-11-16 18:39:08.000000000 -0500
 @@ -31,7 +31,7 @@ struct cleancache_ops {
        void (*flush_page)(int, struct cleancache_filekey, pgoff_t);
        void (*flush_inode)(int, struct cleancache_filekey);
@@ -54962,9 +57717,9 @@ diff -urNp linux-3.0.4/include/linux/cleancache.h linux-3.0.4/include/linux/clea
  
  extern struct cleancache_ops
        cleancache_register_ops(struct cleancache_ops *ops);
-diff -urNp linux-3.0.4/include/linux/compiler-gcc4.h linux-3.0.4/include/linux/compiler-gcc4.h
---- linux-3.0.4/include/linux/compiler-gcc4.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/compiler-gcc4.h  2011-08-26 19:49:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/compiler-gcc4.h linux-3.1.3/include/linux/compiler-gcc4.h
+--- linux-3.1.3/include/linux/compiler-gcc4.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/compiler-gcc4.h  2011-11-16 18:39:08.000000000 -0500
 @@ -31,6 +31,12 @@
  
  
@@ -54990,10 +57745,83 @@ diff -urNp linux-3.0.4/include/linux/compiler-gcc4.h linux-3.0.4/include/linux/c
  #endif
  
  #if __GNUC_MINOR__ > 0
-diff -urNp linux-3.0.4/include/linux/compiler.h linux-3.0.4/include/linux/compiler.h
---- linux-3.0.4/include/linux/compiler.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/compiler.h       2011-08-26 19:49:56.000000000 -0400
-@@ -264,6 +264,14 @@ void ftrace_likely_update(struct ftrace_
+diff -urNp linux-3.1.3/include/linux/compiler.h linux-3.1.3/include/linux/compiler.h
+--- linux-3.1.3/include/linux/compiler.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/compiler.h       2011-11-16 18:39:08.000000000 -0500
+@@ -5,31 +5,62 @@
+ #ifdef __CHECKER__
+ # define __user               __attribute__((noderef, address_space(1)))
++# define __force_user __force __user
+ # define __kernel     __attribute__((address_space(0)))
++# define __force_kernel       __force __kernel
+ # define __safe               __attribute__((safe))
+ # define __force      __attribute__((force))
+ # define __nocast     __attribute__((nocast))
+ # define __iomem      __attribute__((noderef, address_space(2)))
++# define __force_iomem        __force __iomem
+ # define __acquires(x)        __attribute__((context(x,0,1)))
+ # define __releases(x)        __attribute__((context(x,1,0)))
+ # define __acquire(x) __context__(x,1)
+ # define __release(x) __context__(x,-1)
+ # define __cond_lock(x,c)     ((c) ? ({ __acquire(x); 1; }) : 0)
+ # define __percpu     __attribute__((noderef, address_space(3)))
++# define __force_percpu       __force __percpu
+ #ifdef CONFIG_SPARSE_RCU_POINTER
+ # define __rcu                __attribute__((noderef, address_space(4)))
++# define __force_rcu  __force __rcu
+ #else
+ # define __rcu
++# define __force_rcu
+ #endif
+ extern void __chk_user_ptr(const volatile void __user *);
+ extern void __chk_io_ptr(const volatile void __iomem *);
++#elif defined(CHECKER_PLUGIN)
++//# define __user
++//# define __force_user
++//# define __kernel
++//# define __force_kernel
++# define __safe
++# define __force
++# define __nocast
++# define __iomem
++# define __force_iomem
++# define __chk_user_ptr(x) (void)0
++# define __chk_io_ptr(x) (void)0
++# define __builtin_warning(x, y...) (1)
++# define __acquires(x)
++# define __releases(x)
++# define __acquire(x) (void)0
++# define __release(x) (void)0
++# define __cond_lock(x,c) (c)
++# define __percpu
++# define __force_percpu
++# define __rcu
++# define __force_rcu
+ #else
+ # define __user
++# define __force_user
+ # define __kernel
++# define __force_kernel
+ # define __safe
+ # define __force
+ # define __nocast
+ # define __iomem
++# define __force_iomem
+ # define __chk_user_ptr(x) (void)0
+ # define __chk_io_ptr(x) (void)0
+ # define __builtin_warning(x, y...) (1)
+@@ -39,7 +70,9 @@ extern void __chk_io_ptr(const volatile 
+ # define __release(x) (void)0
+ # define __cond_lock(x,c) (c)
+ # define __percpu
++# define __force_percpu
+ # define __rcu
++# define __force_rcu
+ #endif
+ #ifdef __KERNEL__
+@@ -264,6 +297,14 @@ void ftrace_likely_update(struct ftrace_
  # define __attribute_const__  /* unimplemented */
  #endif
  
@@ -55008,7 +57836,7 @@ diff -urNp linux-3.0.4/include/linux/compiler.h linux-3.0.4/include/linux/compil
  /*
   * Tell gcc if a function is cold. The compiler will assume any path
   * directly leading to the call is unlikely.
-@@ -273,6 +281,22 @@ void ftrace_likely_update(struct ftrace_
+@@ -273,6 +314,22 @@ void ftrace_likely_update(struct ftrace_
  #define __cold
  #endif
  
@@ -55031,7 +57859,7 @@ diff -urNp linux-3.0.4/include/linux/compiler.h linux-3.0.4/include/linux/compil
  /* Simple shorthand for a section definition */
  #ifndef __section
  # define __section(S) __attribute__ ((__section__(#S)))
-@@ -306,6 +330,7 @@ void ftrace_likely_update(struct ftrace_
+@@ -306,6 +363,7 @@ void ftrace_likely_update(struct ftrace_
   * use is to mediate communication between process-level code and irq/NMI
   * handlers, all running on the same CPU.
   */
@@ -55040,9 +57868,9 @@ diff -urNp linux-3.0.4/include/linux/compiler.h linux-3.0.4/include/linux/compil
 +#define ACCESS_ONCE_RW(x) (*(volatile typeof(x) *)&(x))
  
  #endif /* __LINUX_COMPILER_H */
-diff -urNp linux-3.0.4/include/linux/cpuset.h linux-3.0.4/include/linux/cpuset.h
---- linux-3.0.4/include/linux/cpuset.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/cpuset.h 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/cpuset.h linux-3.1.3/include/linux/cpuset.h
+--- linux-3.1.3/include/linux/cpuset.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/cpuset.h 2011-11-16 18:39:08.000000000 -0500
 @@ -118,7 +118,7 @@ static inline void put_mems_allowed(void
         * nodemask.
         */
@@ -55052,9 +57880,9 @@ diff -urNp linux-3.0.4/include/linux/cpuset.h linux-3.0.4/include/linux/cpuset.h
  }
  
  static inline void set_mems_allowed(nodemask_t nodemask)
-diff -urNp linux-3.0.4/include/linux/crypto.h linux-3.0.4/include/linux/crypto.h
---- linux-3.0.4/include/linux/crypto.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/crypto.h 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/crypto.h linux-3.1.3/include/linux/crypto.h
+--- linux-3.1.3/include/linux/crypto.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/crypto.h 2011-11-16 18:39:08.000000000 -0500
 @@ -361,7 +361,7 @@ struct cipher_tfm {
                          const u8 *key, unsigned int keylen);
        void (*cit_encrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
@@ -55080,9 +57908,9 @@ diff -urNp linux-3.0.4/include/linux/crypto.h linux-3.0.4/include/linux/crypto.h
  
  #define crt_ablkcipher        crt_u.ablkcipher
  #define crt_aead      crt_u.aead
-diff -urNp linux-3.0.4/include/linux/decompress/mm.h linux-3.0.4/include/linux/decompress/mm.h
---- linux-3.0.4/include/linux/decompress/mm.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/decompress/mm.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/decompress/mm.h linux-3.1.3/include/linux/decompress/mm.h
+--- linux-3.1.3/include/linux/decompress/mm.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/decompress/mm.h  2011-11-16 18:39:08.000000000 -0500
 @@ -77,7 +77,7 @@ static void free(void *where)
   * warnings when not needed (indeed large_malloc / large_free are not
   * needed by inflate */
@@ -55092,10 +57920,10 @@ diff -urNp linux-3.0.4/include/linux/decompress/mm.h linux-3.0.4/include/linux/d
  #define free(a) kfree(a)
  
  #define large_malloc(a) vmalloc(a)
-diff -urNp linux-3.0.4/include/linux/dma-mapping.h linux-3.0.4/include/linux/dma-mapping.h
---- linux-3.0.4/include/linux/dma-mapping.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/dma-mapping.h    2011-08-26 19:49:56.000000000 -0400
-@@ -50,7 +50,7 @@ struct dma_map_ops {
+diff -urNp linux-3.1.3/include/linux/dma-mapping.h linux-3.1.3/include/linux/dma-mapping.h
+--- linux-3.1.3/include/linux/dma-mapping.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/dma-mapping.h    2011-11-16 18:39:08.000000000 -0500
+@@ -42,7 +42,7 @@ struct dma_map_ops {
        int (*dma_supported)(struct device *dev, u64 mask);
        int (*set_dma_mask)(struct device *dev, u64 mask);
        int is_phys;
@@ -55104,10 +57932,10 @@ diff -urNp linux-3.0.4/include/linux/dma-mapping.h linux-3.0.4/include/linux/dma
  
  #define DMA_BIT_MASK(n)       (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
  
-diff -urNp linux-3.0.4/include/linux/efi.h linux-3.0.4/include/linux/efi.h
---- linux-3.0.4/include/linux/efi.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/efi.h    2011-08-23 21:47:56.000000000 -0400
-@@ -410,7 +410,7 @@ struct efivar_operations {
+diff -urNp linux-3.1.3/include/linux/efi.h linux-3.1.3/include/linux/efi.h
+--- linux-3.1.3/include/linux/efi.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/efi.h    2011-11-16 18:39:08.000000000 -0500
+@@ -446,7 +446,7 @@ struct efivar_operations {
        efi_get_variable_t *get_variable;
        efi_get_next_variable_t *get_next_variable;
        efi_set_variable_t *set_variable;
@@ -55116,9 +57944,9 @@ diff -urNp linux-3.0.4/include/linux/efi.h linux-3.0.4/include/linux/efi.h
  
  struct efivars {
        /*
-diff -urNp linux-3.0.4/include/linux/elf.h linux-3.0.4/include/linux/elf.h
---- linux-3.0.4/include/linux/elf.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/elf.h    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/elf.h linux-3.1.3/include/linux/elf.h
+--- linux-3.1.3/include/linux/elf.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/elf.h    2011-11-16 18:39:08.000000000 -0500
 @@ -49,6 +49,17 @@ typedef __s64       Elf64_Sxword;
  #define PT_GNU_EH_FRAME               0x6474e550
  
@@ -55191,9 +58019,30 @@ diff -urNp linux-3.0.4/include/linux/elf.h linux-3.0.4/include/linux/elf.h
  
  #endif
  
-diff -urNp linux-3.0.4/include/linux/firewire.h linux-3.0.4/include/linux/firewire.h
---- linux-3.0.4/include/linux/firewire.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/firewire.h       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/filter.h linux-3.1.3/include/linux/filter.h
+--- linux-3.1.3/include/linux/filter.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/filter.h 2011-11-20 19:21:53.000000000 -0500
+@@ -134,6 +134,7 @@ struct sock_fprog {        /* Required for SO_A
+ struct sk_buff;
+ struct sock;
++struct bpf_jit_work;
+ struct sk_filter
+ {
+@@ -141,6 +142,9 @@ struct sk_filter
+       unsigned int            len;    /* Number of filter blocks */
+       unsigned int            (*bpf_func)(const struct sk_buff *skb,
+                                           const struct sock_filter *filter);
++#ifdef CONFIG_BPF_JIT
++      struct bpf_jit_work     *work;
++#endif
+       struct rcu_head         rcu;
+       struct sock_filter      insns[0];
+ };
+diff -urNp linux-3.1.3/include/linux/firewire.h linux-3.1.3/include/linux/firewire.h
+--- linux-3.1.3/include/linux/firewire.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/firewire.h       2011-11-16 18:39:08.000000000 -0500
 @@ -428,7 +428,7 @@ struct fw_iso_context {
        union {
                fw_iso_callback_t sc;
@@ -55203,9 +58052,9 @@ diff -urNp linux-3.0.4/include/linux/firewire.h linux-3.0.4/include/linux/firewi
        void *callback_data;
  };
  
-diff -urNp linux-3.0.4/include/linux/fscache-cache.h linux-3.0.4/include/linux/fscache-cache.h
---- linux-3.0.4/include/linux/fscache-cache.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/fscache-cache.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/fscache-cache.h linux-3.1.3/include/linux/fscache-cache.h
+--- linux-3.1.3/include/linux/fscache-cache.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/fscache-cache.h  2011-11-16 18:39:08.000000000 -0500
 @@ -102,7 +102,7 @@ struct fscache_operation {
        fscache_operation_release_t release;
  };
@@ -55224,22 +58073,10 @@ diff -urNp linux-3.0.4/include/linux/fscache-cache.h linux-3.0.4/include/linux/f
        op->processor = processor;
        op->release = release;
        INIT_LIST_HEAD(&op->pend_link);
-diff -urNp linux-3.0.4/include/linux/fs.h linux-3.0.4/include/linux/fs.h
---- linux-3.0.4/include/linux/fs.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/fs.h     2011-08-26 19:49:56.000000000 -0400
-@@ -109,6 +109,11 @@ struct inodes_stat_t {
- /* File was opened by fanotify and shouldn't generate fanotify events */
- #define FMODE_NONOTIFY                ((__force fmode_t)0x1000000)
-+/* Hack for grsec so as not to require read permission simply to execute
-+ * a binary
-+ */
-+#define FMODE_GREXEC          ((__force fmode_t)0x2000000)
-+
- /*
-  * The below are the various read and write types that we support. Some of
-  * them include behavioral modifiers that send information down to the
-@@ -1571,7 +1576,8 @@ struct file_operations {
+diff -urNp linux-3.1.3/include/linux/fs.h linux-3.1.3/include/linux/fs.h
+--- linux-3.1.3/include/linux/fs.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/fs.h     2011-11-16 23:39:39.000000000 -0500
+@@ -1588,7 +1588,8 @@ struct file_operations {
        int (*setlease)(struct file *, long, struct file_lock **);
        long (*fallocate)(struct file *file, int mode, loff_t offset,
                          loff_t len);
@@ -55247,11 +58084,11 @@ diff -urNp linux-3.0.4/include/linux/fs.h linux-3.0.4/include/linux/fs.h
 +} __do_const;
 +typedef struct file_operations __no_const file_operations_no_const;
  
- #define IPERM_FLAG_RCU        0x0001
-diff -urNp linux-3.0.4/include/linux/fsnotify.h linux-3.0.4/include/linux/fsnotify.h
---- linux-3.0.4/include/linux/fsnotify.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/fsnotify.h       2011-08-24 18:10:29.000000000 -0400
+ struct inode_operations {
+       struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
+diff -urNp linux-3.1.3/include/linux/fsnotify.h linux-3.1.3/include/linux/fsnotify.h
+--- linux-3.1.3/include/linux/fsnotify.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/fsnotify.h       2011-11-16 18:39:08.000000000 -0500
 @@ -314,7 +314,7 @@ static inline void fsnotify_change(struc
   */
  static inline const unsigned char *fsnotify_oldname_init(const unsigned char *name)
@@ -55261,9 +58098,9 @@ diff -urNp linux-3.0.4/include/linux/fsnotify.h linux-3.0.4/include/linux/fsnoti
  }
  
  /*
-diff -urNp linux-3.0.4/include/linux/fs_struct.h linux-3.0.4/include/linux/fs_struct.h
---- linux-3.0.4/include/linux/fs_struct.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/fs_struct.h      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/fs_struct.h linux-3.1.3/include/linux/fs_struct.h
+--- linux-3.1.3/include/linux/fs_struct.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/fs_struct.h      2011-11-16 18:39:08.000000000 -0500
 @@ -6,7 +6,7 @@
  #include <linux/seqlock.h>
  
@@ -55273,10 +58110,10 @@ diff -urNp linux-3.0.4/include/linux/fs_struct.h linux-3.0.4/include/linux/fs_st
        spinlock_t lock;
        seqcount_t seq;
        int umask;
-diff -urNp linux-3.0.4/include/linux/ftrace_event.h linux-3.0.4/include/linux/ftrace_event.h
---- linux-3.0.4/include/linux/ftrace_event.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/ftrace_event.h   2011-08-23 21:47:56.000000000 -0400
-@@ -96,7 +96,7 @@ struct trace_event_functions {
+diff -urNp linux-3.1.3/include/linux/ftrace_event.h linux-3.1.3/include/linux/ftrace_event.h
+--- linux-3.1.3/include/linux/ftrace_event.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/ftrace_event.h   2011-11-16 18:39:08.000000000 -0500
+@@ -97,7 +97,7 @@ struct trace_event_functions {
        trace_print_func        raw;
        trace_print_func        hex;
        trace_print_func        binary;
@@ -55285,7 +58122,7 @@ diff -urNp linux-3.0.4/include/linux/ftrace_event.h linux-3.0.4/include/linux/ft
  
  struct trace_event {
        struct hlist_node               node;
-@@ -247,7 +247,7 @@ extern int trace_define_field(struct ftr
+@@ -252,7 +252,7 @@ extern int trace_define_field(struct ftr
  extern int trace_add_event_call(struct ftrace_event_call *call);
  extern void trace_remove_event_call(struct ftrace_event_call *call);
  
@@ -55294,9 +58131,9 @@ diff -urNp linux-3.0.4/include/linux/ftrace_event.h linux-3.0.4/include/linux/ft
  
  int trace_set_clr_event(const char *system, const char *event, int set);
  
-diff -urNp linux-3.0.4/include/linux/genhd.h linux-3.0.4/include/linux/genhd.h
---- linux-3.0.4/include/linux/genhd.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/genhd.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/genhd.h linux-3.1.3/include/linux/genhd.h
+--- linux-3.1.3/include/linux/genhd.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/genhd.h  2011-11-16 18:39:08.000000000 -0500
 @@ -184,7 +184,7 @@ struct gendisk {
        struct kobject *slave_dir;
  
@@ -55306,9 +58143,9 @@ diff -urNp linux-3.0.4/include/linux/genhd.h linux-3.0.4/include/linux/genhd.h
        struct disk_events *ev;
  #ifdef  CONFIG_BLK_DEV_INTEGRITY
        struct blk_integrity *integrity;
-diff -urNp linux-3.0.4/include/linux/gracl.h linux-3.0.4/include/linux/gracl.h
---- linux-3.0.4/include/linux/gracl.h  1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/include/linux/gracl.h  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/gracl.h linux-3.1.3/include/linux/gracl.h
+--- linux-3.1.3/include/linux/gracl.h  1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/include/linux/gracl.h  2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,317 @@
 +#ifndef GR_ACL_H
 +#define GR_ACL_H
@@ -55627,9 +58464,9 @@ diff -urNp linux-3.0.4/include/linux/gracl.h linux-3.0.4/include/linux/gracl.h
 +
 +#endif
 +
-diff -urNp linux-3.0.4/include/linux/gralloc.h linux-3.0.4/include/linux/gralloc.h
---- linux-3.0.4/include/linux/gralloc.h        1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/include/linux/gralloc.h        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/gralloc.h linux-3.1.3/include/linux/gralloc.h
+--- linux-3.1.3/include/linux/gralloc.h        1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/include/linux/gralloc.h        2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,9 @@
 +#ifndef __GRALLOC_H
 +#define __GRALLOC_H
@@ -55640,9 +58477,9 @@ diff -urNp linux-3.0.4/include/linux/gralloc.h linux-3.0.4/include/linux/gralloc
 +void *acl_alloc_num(unsigned long num, unsigned long len);
 +
 +#endif
-diff -urNp linux-3.0.4/include/linux/grdefs.h linux-3.0.4/include/linux/grdefs.h
---- linux-3.0.4/include/linux/grdefs.h 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/include/linux/grdefs.h 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/grdefs.h linux-3.1.3/include/linux/grdefs.h
+--- linux-3.1.3/include/linux/grdefs.h 1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/include/linux/grdefs.h 2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,140 @@
 +#ifndef GRDEFS_H
 +#define GRDEFS_H
@@ -55784,10 +58621,10 @@ diff -urNp linux-3.0.4/include/linux/grdefs.h linux-3.0.4/include/linux/grdefs.h
 +};
 +
 +#endif
-diff -urNp linux-3.0.4/include/linux/grinternal.h linux-3.0.4/include/linux/grinternal.h
---- linux-3.0.4/include/linux/grinternal.h     1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/include/linux/grinternal.h     2011-09-24 08:43:45.000000000 -0400
-@@ -0,0 +1,219 @@
+diff -urNp linux-3.1.3/include/linux/grinternal.h linux-3.1.3/include/linux/grinternal.h
+--- linux-3.1.3/include/linux/grinternal.h     1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/include/linux/grinternal.h     2011-11-16 18:40:31.000000000 -0500
+@@ -0,0 +1,220 @@
 +#ifndef __GRINTERNAL_H
 +#define __GRINTERNAL_H
 +
@@ -55912,7 +58749,8 @@ diff -urNp linux-3.0.4/include/linux/grinternal.h linux-3.0.4/include/linux/grin
 +      CAP_TO_MASK(CAP_SYS_PACCT) | CAP_TO_MASK(CAP_SYS_ADMIN) | \
 +      CAP_TO_MASK(CAP_SYS_BOOT) | CAP_TO_MASK(CAP_SYS_TIME) | \
 +      CAP_TO_MASK(CAP_NET_RAW) | CAP_TO_MASK(CAP_SYS_TTY_CONFIG) | \
-+      CAP_TO_MASK(CAP_IPC_OWNER) , CAP_TO_MASK(CAP_SYSLOG) }}
++      CAP_TO_MASK(CAP_IPC_OWNER) | CAP_TO_MASK(CAP_SETFCAP), \
++      CAP_TO_MASK(CAP_SYSLOG) | CAP_TO_MASK(CAP_MAC_ADMIN) }}
 +
 +#define security_learn(normal_msg,args...) \
 +({ \
@@ -56007,9 +58845,9 @@ diff -urNp linux-3.0.4/include/linux/grinternal.h linux-3.0.4/include/linux/grin
 +#endif
 +
 +#endif
-diff -urNp linux-3.0.4/include/linux/grmsg.h linux-3.0.4/include/linux/grmsg.h
---- linux-3.0.4/include/linux/grmsg.h  1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/include/linux/grmsg.h  2011-09-14 09:16:54.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/grmsg.h linux-3.1.3/include/linux/grmsg.h
+--- linux-3.1.3/include/linux/grmsg.h  1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/include/linux/grmsg.h  2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,108 @@
 +#define DEFAULTSECMSG "%.256s[%.16s:%d] uid/euid:%u/%u gid/egid:%u/%u, parent %.256s[%.16s:%d] uid/euid:%u/%u gid/egid:%u/%u"
 +#define GR_ACL_PROCACCT_MSG "%.256s[%.16s:%d] IP:%pI4 TTY:%.64s uid/euid:%u/%u gid/egid:%u/%u run time:[%ud %uh %um %us] cpu time:[%ud %uh %um %us] %s with exit code %ld, parent %.256s[%.16s:%d] IP:%pI4 TTY:%.64s uid/euid:%u/%u gid/egid:%u/%u"
@@ -56119,10 +58957,10 @@ diff -urNp linux-3.0.4/include/linux/grmsg.h linux-3.0.4/include/linux/grmsg.h
 +#define GR_VM86_MSG "denied use of vm86 by "
 +#define GR_PTRACE_AUDIT_MSG "process %.950s(%.16s:%d) attached to via ptrace by "
 +#define GR_INIT_TRANSFER_MSG "persistent special role transferred privilege to init by "
-diff -urNp linux-3.0.4/include/linux/grsecurity.h linux-3.0.4/include/linux/grsecurity.h
---- linux-3.0.4/include/linux/grsecurity.h     1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/include/linux/grsecurity.h     2011-09-14 09:16:54.000000000 -0400
-@@ -0,0 +1,226 @@
+diff -urNp linux-3.1.3/include/linux/grsecurity.h linux-3.1.3/include/linux/grsecurity.h
+--- linux-3.1.3/include/linux/grsecurity.h     1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/include/linux/grsecurity.h     2011-11-17 00:16:10.000000000 -0500
+@@ -0,0 +1,228 @@
 +#ifndef GR_SECURITY_H
 +#define GR_SECURITY_H
 +#include <linux/fs.h>
@@ -56280,13 +59118,15 @@ diff -urNp linux-3.0.4/include/linux/grsecurity.h linux-3.0.4/include/linux/grse
 +__u32 gr_acl_handle_hidden_file(const struct dentry *dentry,
 +                              const struct vfsmount *mnt);
 +__u32 gr_acl_handle_open(const struct dentry *dentry,
-+                              const struct vfsmount *mnt, const int fmode);
++                              const struct vfsmount *mnt, int acc_mode);
 +__u32 gr_acl_handle_creat(const struct dentry *dentry,
 +                               const struct dentry *p_dentry,
-+                               const struct vfsmount *p_mnt, const int fmode,
-+                               const int imode);
++                               const struct vfsmount *p_mnt,
++                               int open_flags, int acc_mode, const int imode);
 +void gr_handle_create(const struct dentry *dentry,
 +                           const struct vfsmount *mnt);
++void gr_handle_proc_create(const struct dentry *dentry,
++                         const struct inode *inode);
 +__u32 gr_acl_handle_mknod(const struct dentry *new_dentry,
 +                               const struct dentry *parent_dentry,
 +                               const struct vfsmount *parent_mnt,
@@ -56349,9 +59189,9 @@ diff -urNp linux-3.0.4/include/linux/grsecurity.h linux-3.0.4/include/linux/grse
 +#endif
 +
 +#endif
-diff -urNp linux-3.0.4/include/linux/grsock.h linux-3.0.4/include/linux/grsock.h
---- linux-3.0.4/include/linux/grsock.h 1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/include/linux/grsock.h 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/grsock.h linux-3.1.3/include/linux/grsock.h
+--- linux-3.1.3/include/linux/grsock.h 1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/include/linux/grsock.h 2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,19 @@
 +#ifndef __GRSOCK_H
 +#define __GRSOCK_H
@@ -56372,10 +59212,10 @@ diff -urNp linux-3.0.4/include/linux/grsock.h linux-3.0.4/include/linux/grsock.h
 +                          const int protocol);
 +
 +#endif
-diff -urNp linux-3.0.4/include/linux/hid.h linux-3.0.4/include/linux/hid.h
---- linux-3.0.4/include/linux/hid.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/hid.h    2011-08-23 21:47:56.000000000 -0400
-@@ -675,7 +675,7 @@ struct hid_ll_driver {
+diff -urNp linux-3.1.3/include/linux/hid.h linux-3.1.3/include/linux/hid.h
+--- linux-3.1.3/include/linux/hid.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/hid.h    2011-11-16 18:39:08.000000000 -0500
+@@ -676,7 +676,7 @@ struct hid_ll_driver {
                        unsigned int code, int value);
  
        int (*parse)(struct hid_device *hdev);
@@ -56384,9 +59224,9 @@ diff -urNp linux-3.0.4/include/linux/hid.h linux-3.0.4/include/linux/hid.h
  
  #define       PM_HINT_FULLON  1<<5
  #define PM_HINT_NORMAL        1<<1
-diff -urNp linux-3.0.4/include/linux/highmem.h linux-3.0.4/include/linux/highmem.h
---- linux-3.0.4/include/linux/highmem.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/highmem.h        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/highmem.h linux-3.1.3/include/linux/highmem.h
+--- linux-3.1.3/include/linux/highmem.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/highmem.h        2011-11-16 18:39:08.000000000 -0500
 @@ -185,6 +185,18 @@ static inline void clear_highpage(struct
        kunmap_atomic(kaddr, KM_USER0);
  }
@@ -56406,9 +59246,9 @@ diff -urNp linux-3.0.4/include/linux/highmem.h linux-3.0.4/include/linux/highmem
  static inline void zero_user_segments(struct page *page,
        unsigned start1, unsigned end1,
        unsigned start2, unsigned end2)
-diff -urNp linux-3.0.4/include/linux/i2c.h linux-3.0.4/include/linux/i2c.h
---- linux-3.0.4/include/linux/i2c.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/i2c.h    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/i2c.h linux-3.1.3/include/linux/i2c.h
+--- linux-3.1.3/include/linux/i2c.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/i2c.h    2011-11-16 18:39:08.000000000 -0500
 @@ -346,6 +346,7 @@ struct i2c_algorithm {
        /* To determine what the adapter supports */
        u32 (*functionality) (struct i2c_adapter *);
@@ -56417,9 +59257,9 @@ diff -urNp linux-3.0.4/include/linux/i2c.h linux-3.0.4/include/linux/i2c.h
  
  /*
   * i2c_adapter is the structure used to identify a physical i2c bus along
-diff -urNp linux-3.0.4/include/linux/i2o.h linux-3.0.4/include/linux/i2o.h
---- linux-3.0.4/include/linux/i2o.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/i2o.h    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/i2o.h linux-3.1.3/include/linux/i2o.h
+--- linux-3.1.3/include/linux/i2o.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/i2o.h    2011-11-16 18:39:08.000000000 -0500
 @@ -564,7 +564,7 @@ struct i2o_controller {
        struct i2o_device *exec;        /* Executive */
  #if BITS_PER_LONG == 64
@@ -56429,9 +59269,9 @@ diff -urNp linux-3.0.4/include/linux/i2o.h linux-3.0.4/include/linux/i2o.h
        struct list_head context_list;  /* list of context id's
                                           and pointers */
  #endif
-diff -urNp linux-3.0.4/include/linux/init.h linux-3.0.4/include/linux/init.h
---- linux-3.0.4/include/linux/init.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/init.h   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/init.h linux-3.1.3/include/linux/init.h
+--- linux-3.1.3/include/linux/init.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/init.h   2011-11-16 18:39:08.000000000 -0500
 @@ -293,13 +293,13 @@ void __init parse_early_options(char *cm
  
  /* Each module must use one module_init(). */
@@ -56448,9 +59288,9 @@ diff -urNp linux-3.0.4/include/linux/init.h linux-3.0.4/include/linux/init.h
        { return exitfn; }                                      \
        void cleanup_module(void) __attribute__((alias(#exitfn)));
  
-diff -urNp linux-3.0.4/include/linux/init_task.h linux-3.0.4/include/linux/init_task.h
---- linux-3.0.4/include/linux/init_task.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/init_task.h      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/init_task.h linux-3.1.3/include/linux/init_task.h
+--- linux-3.1.3/include/linux/init_task.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/init_task.h      2011-11-16 18:39:08.000000000 -0500
 @@ -126,6 +126,12 @@ extern struct cred init_cred;
  # define INIT_PERF_EVENTS(tsk)
  #endif
@@ -56472,9 +59312,9 @@ diff -urNp linux-3.0.4/include/linux/init_task.h linux-3.0.4/include/linux/init_
        .fs             = &init_fs,                                     \
        .files          = &init_files,                                  \
        .signal         = &init_signals,                                \
-diff -urNp linux-3.0.4/include/linux/intel-iommu.h linux-3.0.4/include/linux/intel-iommu.h
---- linux-3.0.4/include/linux/intel-iommu.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/intel-iommu.h    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/intel-iommu.h linux-3.1.3/include/linux/intel-iommu.h
+--- linux-3.1.3/include/linux/intel-iommu.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/intel-iommu.h    2011-11-16 18:39:08.000000000 -0500
 @@ -296,7 +296,7 @@ struct iommu_flush {
                              u8 fm, u64 type);
        void (*flush_iotlb)(struct intel_iommu *iommu, u16 did, u64 addr,
@@ -56484,10 +59324,10 @@ diff -urNp linux-3.0.4/include/linux/intel-iommu.h linux-3.0.4/include/linux/int
  
  enum {
        SR_DMAR_FECTL_REG,
-diff -urNp linux-3.0.4/include/linux/interrupt.h linux-3.0.4/include/linux/interrupt.h
---- linux-3.0.4/include/linux/interrupt.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/interrupt.h      2011-08-23 21:47:56.000000000 -0400
-@@ -422,7 +422,7 @@ enum
+diff -urNp linux-3.1.3/include/linux/interrupt.h linux-3.1.3/include/linux/interrupt.h
+--- linux-3.1.3/include/linux/interrupt.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/interrupt.h      2011-11-16 18:39:08.000000000 -0500
+@@ -425,7 +425,7 @@ enum
  /* map softirq index to softirq name. update 'softirq_to_name' in
   * kernel/softirq.c when adding a new softirq.
   */
@@ -56496,7 +59336,7 @@ diff -urNp linux-3.0.4/include/linux/interrupt.h linux-3.0.4/include/linux/inter
  
  /* softirq mask and active fields moved to irq_cpustat_t in
   * asm/hardirq.h to get better cache usage.  KAO
-@@ -430,12 +430,12 @@ extern char *softirq_to_name[NR_SOFTIRQS
+@@ -433,12 +433,12 @@ extern char *softirq_to_name[NR_SOFTIRQS
  
  struct softirq_action
  {
@@ -56511,9 +59351,9 @@ diff -urNp linux-3.0.4/include/linux/interrupt.h linux-3.0.4/include/linux/inter
  extern void softirq_init(void);
  static inline void __raise_softirq_irqoff(unsigned int nr)
  {
-diff -urNp linux-3.0.4/include/linux/kallsyms.h linux-3.0.4/include/linux/kallsyms.h
---- linux-3.0.4/include/linux/kallsyms.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/kallsyms.h       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/kallsyms.h linux-3.1.3/include/linux/kallsyms.h
+--- linux-3.1.3/include/linux/kallsyms.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/kallsyms.h       2011-11-16 18:40:31.000000000 -0500
 @@ -15,7 +15,8 @@
  
  struct module;
@@ -56541,9 +59381,9 @@ diff -urNp linux-3.0.4/include/linux/kallsyms.h linux-3.0.4/include/linux/kallsy
  
  /* This macro allows us to keep printk typechecking */
  static void __check_printsym_format(const char *fmt, ...)
-diff -urNp linux-3.0.4/include/linux/kgdb.h linux-3.0.4/include/linux/kgdb.h
---- linux-3.0.4/include/linux/kgdb.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/kgdb.h   2011-08-26 19:49:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/kgdb.h linux-3.1.3/include/linux/kgdb.h
+--- linux-3.1.3/include/linux/kgdb.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/kgdb.h   2011-11-16 18:39:08.000000000 -0500
 @@ -53,7 +53,7 @@ extern int kgdb_connected;
  extern int kgdb_io_module_registered;
  
@@ -56571,9 +59411,9 @@ diff -urNp linux-3.0.4/include/linux/kgdb.h linux-3.0.4/include/linux/kgdb.h
  
  extern struct kgdb_arch               arch_kgdb_ops;
  
-diff -urNp linux-3.0.4/include/linux/kmod.h linux-3.0.4/include/linux/kmod.h
---- linux-3.0.4/include/linux/kmod.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/kmod.h   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/kmod.h linux-3.1.3/include/linux/kmod.h
+--- linux-3.1.3/include/linux/kmod.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/kmod.h   2011-11-16 18:40:31.000000000 -0500
 @@ -34,6 +34,8 @@ extern char modprobe_path[]; /* for sysc
   * usually useless though. */
  extern int __request_module(bool wait, const char *name, ...) \
@@ -56583,10 +59423,10 @@ diff -urNp linux-3.0.4/include/linux/kmod.h linux-3.0.4/include/linux/kmod.h
  #define request_module(mod...) __request_module(true, mod)
  #define request_module_nowait(mod...) __request_module(false, mod)
  #define try_then_request_module(x, mod...) \
-diff -urNp linux-3.0.4/include/linux/kvm_host.h linux-3.0.4/include/linux/kvm_host.h
---- linux-3.0.4/include/linux/kvm_host.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/kvm_host.h       2011-08-23 21:47:56.000000000 -0400
-@@ -307,7 +307,7 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vc
+diff -urNp linux-3.1.3/include/linux/kvm_host.h linux-3.1.3/include/linux/kvm_host.h
+--- linux-3.1.3/include/linux/kvm_host.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/kvm_host.h       2011-11-16 18:39:08.000000000 -0500
+@@ -308,7 +308,7 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vc
  void vcpu_load(struct kvm_vcpu *vcpu);
  void vcpu_put(struct kvm_vcpu *vcpu);
  
@@ -56595,7 +59435,7 @@ diff -urNp linux-3.0.4/include/linux/kvm_host.h linux-3.0.4/include/linux/kvm_ho
                  struct module *module);
  void kvm_exit(void);
  
-@@ -446,7 +446,7 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(
+@@ -454,7 +454,7 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(
                                        struct kvm_guest_debug *dbg);
  int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run);
  
@@ -56604,10 +59444,10 @@ diff -urNp linux-3.0.4/include/linux/kvm_host.h linux-3.0.4/include/linux/kvm_ho
  void kvm_arch_exit(void);
  
  int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu);
-diff -urNp linux-3.0.4/include/linux/libata.h linux-3.0.4/include/linux/libata.h
---- linux-3.0.4/include/linux/libata.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/libata.h 2011-08-26 19:49:56.000000000 -0400
-@@ -899,7 +899,7 @@ struct ata_port_operations {
+diff -urNp linux-3.1.3/include/linux/libata.h linux-3.1.3/include/linux/libata.h
+--- linux-3.1.3/include/linux/libata.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/libata.h 2011-11-16 18:39:08.000000000 -0500
+@@ -909,7 +909,7 @@ struct ata_port_operations {
         * fields must be pointers.
         */
        const struct ata_port_operations        *inherits;
@@ -56616,9 +59456,9 @@ diff -urNp linux-3.0.4/include/linux/libata.h linux-3.0.4/include/linux/libata.h
  
  struct ata_port_info {
        unsigned long           flags;
-diff -urNp linux-3.0.4/include/linux/mca.h linux-3.0.4/include/linux/mca.h
---- linux-3.0.4/include/linux/mca.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/mca.h    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/mca.h linux-3.1.3/include/linux/mca.h
+--- linux-3.1.3/include/linux/mca.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/mca.h    2011-11-16 18:39:08.000000000 -0500
 @@ -80,7 +80,7 @@ struct mca_bus_accessor_functions {
                                                  int region);
        void *          (*mca_transform_memory)(struct mca_device *,
@@ -56628,9 +59468,9 @@ diff -urNp linux-3.0.4/include/linux/mca.h linux-3.0.4/include/linux/mca.h
  
  struct mca_bus {
        u64                     default_dma_mask;
-diff -urNp linux-3.0.4/include/linux/memory.h linux-3.0.4/include/linux/memory.h
---- linux-3.0.4/include/linux/memory.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/memory.h 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/memory.h linux-3.1.3/include/linux/memory.h
+--- linux-3.1.3/include/linux/memory.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/memory.h 2011-11-16 18:39:08.000000000 -0500
 @@ -144,7 +144,7 @@ struct memory_accessor {
                        size_t count);
        ssize_t (*write)(struct memory_accessor *, const char *buf,
@@ -56640,9 +59480,9 @@ diff -urNp linux-3.0.4/include/linux/memory.h linux-3.0.4/include/linux/memory.h
  
  /*
   * Kernel text modification mutex, used for code patching. Users of this lock
-diff -urNp linux-3.0.4/include/linux/mfd/abx500.h linux-3.0.4/include/linux/mfd/abx500.h
---- linux-3.0.4/include/linux/mfd/abx500.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/mfd/abx500.h     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/mfd/abx500.h linux-3.1.3/include/linux/mfd/abx500.h
+--- linux-3.1.3/include/linux/mfd/abx500.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/mfd/abx500.h     2011-11-16 18:39:08.000000000 -0500
 @@ -234,6 +234,7 @@ struct abx500_ops {
        int (*event_registers_startup_state_get) (struct device *, u8 *);
        int (*startup_irq_enabled) (struct device *, unsigned int);
@@ -56651,10 +59491,10 @@ diff -urNp linux-3.0.4/include/linux/mfd/abx500.h linux-3.0.4/include/linux/mfd/
  
  int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops);
  void abx500_remove_ops(struct device *dev);
-diff -urNp linux-3.0.4/include/linux/mm.h linux-3.0.4/include/linux/mm.h
---- linux-3.0.4/include/linux/mm.h     2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/include/linux/mm.h     2011-08-23 21:47:56.000000000 -0400
-@@ -113,7 +113,14 @@ extern unsigned int kobjsize(const void 
+diff -urNp linux-3.1.3/include/linux/mm.h linux-3.1.3/include/linux/mm.h
+--- linux-3.1.3/include/linux/mm.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/mm.h     2011-11-16 18:39:08.000000000 -0500
+@@ -114,7 +114,14 @@ extern unsigned int kobjsize(const void 
  
  #define VM_CAN_NONLINEAR 0x08000000   /* Has ->fault & does nonlinear pages */
  #define VM_MIXEDMAP   0x10000000      /* Can contain "struct page" and pure PFN pages */
@@ -56669,7 +59509,7 @@ diff -urNp linux-3.0.4/include/linux/mm.h linux-3.0.4/include/linux/mm.h
  #define VM_PFN_AT_MMAP        0x40000000      /* PFNMAP vma that is fully mapped at mmap time */
  #define VM_MERGEABLE  0x80000000      /* KSM may merge identical pages */
  
-@@ -1009,34 +1016,6 @@ int set_page_dirty(struct page *page);
+@@ -1011,34 +1018,6 @@ int set_page_dirty(struct page *page);
  int set_page_dirty_lock(struct page *page);
  int clear_page_dirty_for_io(struct page *page);
  
@@ -56704,9 +59544,9 @@ diff -urNp linux-3.0.4/include/linux/mm.h linux-3.0.4/include/linux/mm.h
  extern unsigned long move_page_tables(struct vm_area_struct *vma,
                unsigned long old_addr, struct vm_area_struct *new_vma,
                unsigned long new_addr, unsigned long len);
-@@ -1169,6 +1148,15 @@ struct shrinker {
- extern void register_shrinker(struct shrinker *);
- extern void unregister_shrinker(struct shrinker *);
+@@ -1133,6 +1112,15 @@ static inline void sync_mm_rss(struct ta
+ }
+ #endif
  
 +#ifdef CONFIG_MMU
 +pgprot_t vm_get_page_prot(vm_flags_t vm_flags);
@@ -56720,7 +59560,7 @@ diff -urNp linux-3.0.4/include/linux/mm.h linux-3.0.4/include/linux/mm.h
  int vma_wants_writenotify(struct vm_area_struct *vma);
  
  extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr,
-@@ -1452,6 +1440,7 @@ out:
+@@ -1417,6 +1405,7 @@ out:
  }
  
  extern int do_munmap(struct mm_struct *, unsigned long, size_t);
@@ -56728,7 +59568,7 @@ diff -urNp linux-3.0.4/include/linux/mm.h linux-3.0.4/include/linux/mm.h
  
  extern unsigned long do_brk(unsigned long, unsigned long);
  
-@@ -1510,6 +1499,10 @@ extern struct vm_area_struct * find_vma(
+@@ -1474,6 +1463,10 @@ extern struct vm_area_struct * find_vma(
  extern struct vm_area_struct * find_vma_prev(struct mm_struct * mm, unsigned long addr,
                                             struct vm_area_struct **pprev);
  
@@ -56739,7 +59579,7 @@ diff -urNp linux-3.0.4/include/linux/mm.h linux-3.0.4/include/linux/mm.h
  /* Look up the first VMA which intersects the interval start_addr..end_addr-1,
     NULL if none.  Assume start_addr < end_addr. */
  static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * mm, unsigned long start_addr, unsigned long end_addr)
-@@ -1526,15 +1519,6 @@ static inline unsigned long vma_pages(st
+@@ -1490,15 +1483,6 @@ static inline unsigned long vma_pages(st
        return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
  }
  
@@ -56755,7 +59595,7 @@ diff -urNp linux-3.0.4/include/linux/mm.h linux-3.0.4/include/linux/mm.h
  struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr);
  int remap_pfn_range(struct vm_area_struct *, unsigned long addr,
                        unsigned long pfn, unsigned long size, pgprot_t);
-@@ -1647,7 +1631,7 @@ extern int unpoison_memory(unsigned long
+@@ -1612,7 +1596,7 @@ extern int unpoison_memory(unsigned long
  extern int sysctl_memory_failure_early_kill;
  extern int sysctl_memory_failure_recovery;
  extern void shake_page(struct page *p, int access);
@@ -56764,7 +59604,7 @@ diff -urNp linux-3.0.4/include/linux/mm.h linux-3.0.4/include/linux/mm.h
  extern int soft_offline_page(struct page *page, int flags);
  
  extern void dump_page(struct page *page);
-@@ -1661,5 +1645,11 @@ extern void copy_user_huge_page(struct p
+@@ -1626,5 +1610,11 @@ extern void copy_user_huge_page(struct p
                                unsigned int pages_per_huge_page);
  #endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLBFS */
  
@@ -56776,10 +59616,10 @@ diff -urNp linux-3.0.4/include/linux/mm.h linux-3.0.4/include/linux/mm.h
 +
  #endif /* __KERNEL__ */
  #endif /* _LINUX_MM_H */
-diff -urNp linux-3.0.4/include/linux/mm_types.h linux-3.0.4/include/linux/mm_types.h
---- linux-3.0.4/include/linux/mm_types.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/mm_types.h       2011-08-23 21:47:56.000000000 -0400
-@@ -184,6 +184,8 @@ struct vm_area_struct {
+diff -urNp linux-3.1.3/include/linux/mm_types.h linux-3.1.3/include/linux/mm_types.h
+--- linux-3.1.3/include/linux/mm_types.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/mm_types.h       2011-11-16 18:39:08.000000000 -0500
+@@ -230,6 +230,8 @@ struct vm_area_struct {
  #ifdef CONFIG_NUMA
        struct mempolicy *vm_policy;    /* NUMA policy for the VMA */
  #endif
@@ -56788,7 +59628,7 @@ diff -urNp linux-3.0.4/include/linux/mm_types.h linux-3.0.4/include/linux/mm_typ
  };
  
  struct core_thread {
-@@ -316,6 +318,24 @@ struct mm_struct {
+@@ -362,6 +364,24 @@ struct mm_struct {
  #ifdef CONFIG_CPUMASK_OFFSTACK
        struct cpumask cpumask_allocation;
  #endif
@@ -56813,9 +59653,9 @@ diff -urNp linux-3.0.4/include/linux/mm_types.h linux-3.0.4/include/linux/mm_typ
  };
  
  static inline void mm_init_cpumask(struct mm_struct *mm)
-diff -urNp linux-3.0.4/include/linux/mmu_notifier.h linux-3.0.4/include/linux/mmu_notifier.h
---- linux-3.0.4/include/linux/mmu_notifier.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/mmu_notifier.h   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/mmu_notifier.h linux-3.1.3/include/linux/mmu_notifier.h
+--- linux-3.1.3/include/linux/mmu_notifier.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/mmu_notifier.h   2011-11-16 18:39:08.000000000 -0500
 @@ -255,12 +255,12 @@ static inline void mmu_notifier_mm_destr
   */
  #define ptep_clear_flush_notify(__vma, __address, __ptep)             \
@@ -56832,10 +59672,10 @@ diff -urNp linux-3.0.4/include/linux/mmu_notifier.h linux-3.0.4/include/linux/mm
  })
  
  #define pmdp_clear_flush_notify(__vma, __address, __pmdp)             \
-diff -urNp linux-3.0.4/include/linux/mmzone.h linux-3.0.4/include/linux/mmzone.h
---- linux-3.0.4/include/linux/mmzone.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/mmzone.h 2011-08-23 21:47:56.000000000 -0400
-@@ -350,7 +350,7 @@ struct zone {
+diff -urNp linux-3.1.3/include/linux/mmzone.h linux-3.1.3/include/linux/mmzone.h
+--- linux-3.1.3/include/linux/mmzone.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/mmzone.h 2011-11-16 18:39:08.000000000 -0500
+@@ -356,7 +356,7 @@ struct zone {
        unsigned long           flags;             /* zone flags, see below */
  
        /* Zone statistics */
@@ -56844,9 +59684,9 @@ diff -urNp linux-3.0.4/include/linux/mmzone.h linux-3.0.4/include/linux/mmzone.h
  
        /*
         * The target ratio of ACTIVE_ANON to INACTIVE_ANON pages on
-diff -urNp linux-3.0.4/include/linux/mod_devicetable.h linux-3.0.4/include/linux/mod_devicetable.h
---- linux-3.0.4/include/linux/mod_devicetable.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/mod_devicetable.h        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/mod_devicetable.h linux-3.1.3/include/linux/mod_devicetable.h
+--- linux-3.1.3/include/linux/mod_devicetable.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/mod_devicetable.h        2011-11-16 18:39:08.000000000 -0500
 @@ -12,7 +12,7 @@
  typedef unsigned long kernel_ulong_t;
  #endif
@@ -56865,9 +59705,9 @@ diff -urNp linux-3.0.4/include/linux/mod_devicetable.h linux-3.0.4/include/linux
  
  struct hid_device_id {
        __u16 bus;
-diff -urNp linux-3.0.4/include/linux/module.h linux-3.0.4/include/linux/module.h
---- linux-3.0.4/include/linux/module.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/module.h 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/module.h linux-3.1.3/include/linux/module.h
+--- linux-3.1.3/include/linux/module.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/module.h 2011-11-16 18:39:08.000000000 -0500
 @@ -16,6 +16,7 @@
  #include <linux/kobject.h>
  #include <linux/moduleparam.h>
@@ -56876,7 +59716,7 @@ diff -urNp linux-3.0.4/include/linux/module.h linux-3.0.4/include/linux/module.h
  
  #include <linux/percpu.h>
  #include <asm/module.h>
-@@ -325,19 +326,16 @@ struct module
+@@ -327,19 +328,16 @@ struct module
        int (*init)(void);
  
        /* If this is non-NULL, vfree after init() returns */
@@ -56900,7 +59740,7 @@ diff -urNp linux-3.0.4/include/linux/module.h linux-3.0.4/include/linux/module.h
  
        /* Arch-specific module values */
        struct mod_arch_specific arch;
-@@ -393,6 +391,10 @@ struct module
+@@ -395,6 +393,10 @@ struct module
  #ifdef CONFIG_EVENT_TRACING
        struct ftrace_event_call **trace_events;
        unsigned int num_trace_events;
@@ -56911,7 +59751,7 @@ diff -urNp linux-3.0.4/include/linux/module.h linux-3.0.4/include/linux/module.h
  #endif
  #ifdef CONFIG_FTRACE_MCOUNT_RECORD
        unsigned int num_ftrace_callsites;
-@@ -443,16 +445,46 @@ bool is_module_address(unsigned long add
+@@ -445,16 +447,46 @@ bool is_module_address(unsigned long add
  bool is_module_percpu_address(unsigned long addr);
  bool is_module_text_address(unsigned long addr);
  
@@ -56962,10 +59802,10 @@ diff -urNp linux-3.0.4/include/linux/module.h linux-3.0.4/include/linux/module.h
  }
  
  /* Search for module by name: must hold module_mutex. */
-diff -urNp linux-3.0.4/include/linux/moduleloader.h linux-3.0.4/include/linux/moduleloader.h
---- linux-3.0.4/include/linux/moduleloader.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/moduleloader.h   2011-08-23 21:47:56.000000000 -0400
-@@ -20,9 +20,21 @@ unsigned int arch_mod_section_prepend(st
+diff -urNp linux-3.1.3/include/linux/moduleloader.h linux-3.1.3/include/linux/moduleloader.h
+--- linux-3.1.3/include/linux/moduleloader.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/moduleloader.h   2011-11-16 18:39:08.000000000 -0500
+@@ -25,9 +25,21 @@ unsigned int arch_mod_section_prepend(st
     sections.  Returns NULL on failure. */
  void *module_alloc(unsigned long size);
  
@@ -56987,9 +59827,9 @@ diff -urNp linux-3.0.4/include/linux/moduleloader.h linux-3.0.4/include/linux/mo
  /* Apply the given relocation to the (simplified) ELF.  Return -error
     or 0. */
  int apply_relocate(Elf_Shdr *sechdrs,
-diff -urNp linux-3.0.4/include/linux/moduleparam.h linux-3.0.4/include/linux/moduleparam.h
---- linux-3.0.4/include/linux/moduleparam.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/moduleparam.h    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/moduleparam.h linux-3.1.3/include/linux/moduleparam.h
+--- linux-3.1.3/include/linux/moduleparam.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/moduleparam.h    2011-11-16 18:39:08.000000000 -0500
 @@ -255,7 +255,7 @@ static inline void __kernel_param_unlock
   * @len is usually just sizeof(string).
   */
@@ -57008,9 +59848,9 @@ diff -urNp linux-3.0.4/include/linux/moduleparam.h linux-3.0.4/include/linux/mod
        = { .max = ARRAY_SIZE(array), .num = nump,                      \
            .ops = &param_ops_##type,                                   \
            .elemsize = sizeof(array[0]), .elem = array };              \
-diff -urNp linux-3.0.4/include/linux/namei.h linux-3.0.4/include/linux/namei.h
---- linux-3.0.4/include/linux/namei.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/namei.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/namei.h linux-3.1.3/include/linux/namei.h
+--- linux-3.1.3/include/linux/namei.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/namei.h  2011-11-16 18:39:08.000000000 -0500
 @@ -24,7 +24,7 @@ struct nameidata {
        unsigned        seq;
        int             last_type;
@@ -57020,7 +59860,7 @@ diff -urNp linux-3.0.4/include/linux/namei.h linux-3.0.4/include/linux/namei.h
  
        /* Intent data */
        union {
-@@ -91,12 +91,12 @@ extern int follow_up(struct path *);
+@@ -94,12 +94,12 @@ extern int follow_up(struct path *);
  extern struct dentry *lock_rename(struct dentry *, struct dentry *);
  extern void unlock_rename(struct dentry *, struct dentry *);
  
@@ -57035,10 +59875,10 @@ diff -urNp linux-3.0.4/include/linux/namei.h linux-3.0.4/include/linux/namei.h
  {
        return nd->saved_names[nd->depth];
  }
-diff -urNp linux-3.0.4/include/linux/netdevice.h linux-3.0.4/include/linux/netdevice.h
---- linux-3.0.4/include/linux/netdevice.h      2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/include/linux/netdevice.h      2011-08-23 21:47:56.000000000 -0400
-@@ -979,6 +979,7 @@ struct net_device_ops {
+diff -urNp linux-3.1.3/include/linux/netdevice.h linux-3.1.3/include/linux/netdevice.h
+--- linux-3.1.3/include/linux/netdevice.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/netdevice.h      2011-11-16 18:39:08.000000000 -0500
+@@ -944,6 +944,7 @@ struct net_device_ops {
        int                     (*ndo_set_features)(struct net_device *dev,
                                                    u32 features);
  };
@@ -57046,9 +59886,9 @@ diff -urNp linux-3.0.4/include/linux/netdevice.h linux-3.0.4/include/linux/netde
  
  /*
   *    The DEVICE structure.
-diff -urNp linux-3.0.4/include/linux/netfilter/xt_gradm.h linux-3.0.4/include/linux/netfilter/xt_gradm.h
---- linux-3.0.4/include/linux/netfilter/xt_gradm.h     1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/include/linux/netfilter/xt_gradm.h     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/netfilter/xt_gradm.h linux-3.1.3/include/linux/netfilter/xt_gradm.h
+--- linux-3.1.3/include/linux/netfilter/xt_gradm.h     1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/include/linux/netfilter/xt_gradm.h     2011-11-16 18:40:31.000000000 -0500
 @@ -0,0 +1,9 @@
 +#ifndef _LINUX_NETFILTER_XT_GRADM_H
 +#define _LINUX_NETFILTER_XT_GRADM_H 1
@@ -57059,9 +59899,9 @@ diff -urNp linux-3.0.4/include/linux/netfilter/xt_gradm.h linux-3.0.4/include/li
 +};
 +
 +#endif
-diff -urNp linux-3.0.4/include/linux/of_pdt.h linux-3.0.4/include/linux/of_pdt.h
---- linux-3.0.4/include/linux/of_pdt.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/of_pdt.h 2011-08-30 06:20:11.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/of_pdt.h linux-3.1.3/include/linux/of_pdt.h
+--- linux-3.1.3/include/linux/of_pdt.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/of_pdt.h 2011-11-16 18:39:08.000000000 -0500
 @@ -32,7 +32,7 @@ struct of_pdt_ops {
  
        /* return 0 on success; fill in 'len' with number of bytes in path */
@@ -57071,9 +59911,9 @@ diff -urNp linux-3.0.4/include/linux/of_pdt.h linux-3.0.4/include/linux/of_pdt.h
  
  extern void *prom_early_alloc(unsigned long size);
  
-diff -urNp linux-3.0.4/include/linux/oprofile.h linux-3.0.4/include/linux/oprofile.h
---- linux-3.0.4/include/linux/oprofile.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/oprofile.h       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/oprofile.h linux-3.1.3/include/linux/oprofile.h
+--- linux-3.1.3/include/linux/oprofile.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/oprofile.h       2011-11-16 18:39:08.000000000 -0500
 @@ -139,9 +139,9 @@ int oprofilefs_create_ulong(struct super
  int oprofilefs_create_ro_ulong(struct super_block * sb, struct dentry * root,
        char const * name, ulong * val);
@@ -57086,9 +59926,9 @@ diff -urNp linux-3.0.4/include/linux/oprofile.h linux-3.0.4/include/linux/oprofi
   
  /** create a directory */
  struct dentry * oprofilefs_mkdir(struct super_block * sb, struct dentry * root,
-diff -urNp linux-3.0.4/include/linux/padata.h linux-3.0.4/include/linux/padata.h
---- linux-3.0.4/include/linux/padata.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/padata.h 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/padata.h linux-3.1.3/include/linux/padata.h
+--- linux-3.1.3/include/linux/padata.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/padata.h 2011-11-16 18:39:08.000000000 -0500
 @@ -129,7 +129,7 @@ struct parallel_data {
        struct padata_instance          *pinst;
        struct padata_parallel_queue    __percpu *pqueue;
@@ -57098,10 +59938,10 @@ diff -urNp linux-3.0.4/include/linux/padata.h linux-3.0.4/include/linux/padata.h
        atomic_t                        reorder_objects;
        atomic_t                        refcnt;
        unsigned int                    max_seq_nr;
-diff -urNp linux-3.0.4/include/linux/perf_event.h linux-3.0.4/include/linux/perf_event.h
---- linux-3.0.4/include/linux/perf_event.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/perf_event.h     2011-08-23 21:47:56.000000000 -0400
-@@ -761,8 +761,8 @@ struct perf_event {
+diff -urNp linux-3.1.3/include/linux/perf_event.h linux-3.1.3/include/linux/perf_event.h
+--- linux-3.1.3/include/linux/perf_event.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/perf_event.h     2011-11-16 18:39:08.000000000 -0500
+@@ -745,8 +745,8 @@ struct perf_event {
  
        enum perf_event_active_state    state;
        unsigned int                    attach_state;
@@ -57112,7 +59952,7 @@ diff -urNp linux-3.0.4/include/linux/perf_event.h linux-3.0.4/include/linux/perf
  
        /*
         * These are the total time in nanoseconds that the event
-@@ -813,8 +813,8 @@ struct perf_event {
+@@ -797,8 +797,8 @@ struct perf_event {
         * These accumulate total time (in nanoseconds) that children
         * events have been enabled and running, respectively.
         */
@@ -57123,9 +59963,9 @@ diff -urNp linux-3.0.4/include/linux/perf_event.h linux-3.0.4/include/linux/perf
  
        /*
         * Protect attach/detach and child_list:
-diff -urNp linux-3.0.4/include/linux/pipe_fs_i.h linux-3.0.4/include/linux/pipe_fs_i.h
---- linux-3.0.4/include/linux/pipe_fs_i.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/pipe_fs_i.h      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/pipe_fs_i.h linux-3.1.3/include/linux/pipe_fs_i.h
+--- linux-3.1.3/include/linux/pipe_fs_i.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/pipe_fs_i.h      2011-11-16 18:39:08.000000000 -0500
 @@ -46,9 +46,9 @@ struct pipe_buffer {
  struct pipe_inode_info {
        wait_queue_head_t wait;
@@ -57139,10 +59979,10 @@ diff -urNp linux-3.0.4/include/linux/pipe_fs_i.h linux-3.0.4/include/linux/pipe_
        unsigned int r_counter;
        unsigned int w_counter;
        struct page *tmp_page;
-diff -urNp linux-3.0.4/include/linux/pm_runtime.h linux-3.0.4/include/linux/pm_runtime.h
---- linux-3.0.4/include/linux/pm_runtime.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/pm_runtime.h     2011-08-23 21:47:56.000000000 -0400
-@@ -94,7 +94,7 @@ static inline bool pm_runtime_callbacks_
+diff -urNp linux-3.1.3/include/linux/pm_runtime.h linux-3.1.3/include/linux/pm_runtime.h
+--- linux-3.1.3/include/linux/pm_runtime.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/pm_runtime.h     2011-11-16 18:39:08.000000000 -0500
+@@ -99,7 +99,7 @@ static inline bool pm_runtime_callbacks_
  
  static inline void pm_runtime_mark_last_busy(struct device *dev)
  {
@@ -57151,9 +59991,9 @@ diff -urNp linux-3.0.4/include/linux/pm_runtime.h linux-3.0.4/include/linux/pm_r
  }
  
  #else /* !CONFIG_PM_RUNTIME */
-diff -urNp linux-3.0.4/include/linux/poison.h linux-3.0.4/include/linux/poison.h
---- linux-3.0.4/include/linux/poison.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/poison.h 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/poison.h linux-3.1.3/include/linux/poison.h
+--- linux-3.1.3/include/linux/poison.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/poison.h 2011-11-16 18:39:08.000000000 -0500
 @@ -19,8 +19,8 @@
   * under normal circumstances, used to verify that nobody uses
   * non-initialized list entries.
@@ -57165,10 +60005,10 @@ diff -urNp linux-3.0.4/include/linux/poison.h linux-3.0.4/include/linux/poison.h
  
  /********** include/linux/timer.h **********/
  /*
-diff -urNp linux-3.0.4/include/linux/preempt.h linux-3.0.4/include/linux/preempt.h
---- linux-3.0.4/include/linux/preempt.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/preempt.h        2011-08-23 21:47:56.000000000 -0400
-@@ -115,7 +115,7 @@ struct preempt_ops {
+diff -urNp linux-3.1.3/include/linux/preempt.h linux-3.1.3/include/linux/preempt.h
+--- linux-3.1.3/include/linux/preempt.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/preempt.h        2011-11-16 18:39:08.000000000 -0500
+@@ -123,7 +123,7 @@ struct preempt_ops {
        void (*sched_in)(struct preempt_notifier *notifier, int cpu);
        void (*sched_out)(struct preempt_notifier *notifier,
                          struct task_struct *next);
@@ -57177,9 +60017,9 @@ diff -urNp linux-3.0.4/include/linux/preempt.h linux-3.0.4/include/linux/preempt
  
  /**
   * preempt_notifier - key for installing preemption notifiers
-diff -urNp linux-3.0.4/include/linux/proc_fs.h linux-3.0.4/include/linux/proc_fs.h
---- linux-3.0.4/include/linux/proc_fs.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/proc_fs.h        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/proc_fs.h linux-3.1.3/include/linux/proc_fs.h
+--- linux-3.1.3/include/linux/proc_fs.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/proc_fs.h        2011-11-16 18:40:31.000000000 -0500
 @@ -155,6 +155,19 @@ static inline struct proc_dir_entry *pro
        return proc_create_data(name, mode, parent, proc_fops, NULL);
  }
@@ -57209,10 +60049,10 @@ diff -urNp linux-3.0.4/include/linux/proc_fs.h linux-3.0.4/include/linux/proc_fs
  
  struct ctl_table_header;
  struct ctl_table;
-diff -urNp linux-3.0.4/include/linux/ptrace.h linux-3.0.4/include/linux/ptrace.h
---- linux-3.0.4/include/linux/ptrace.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/ptrace.h 2011-08-23 21:48:14.000000000 -0400
-@@ -115,10 +115,10 @@ extern void __ptrace_unlink(struct task_
+diff -urNp linux-3.1.3/include/linux/ptrace.h linux-3.1.3/include/linux/ptrace.h
+--- linux-3.1.3/include/linux/ptrace.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/ptrace.h 2011-11-16 18:40:31.000000000 -0500
+@@ -129,10 +129,10 @@ extern void __ptrace_unlink(struct task_
  extern void exit_ptrace(struct task_struct *tracer);
  #define PTRACE_MODE_READ   1
  #define PTRACE_MODE_ATTACH 2
@@ -57225,9 +60065,9 @@ diff -urNp linux-3.0.4/include/linux/ptrace.h linux-3.0.4/include/linux/ptrace.h
  
  static inline int ptrace_reparented(struct task_struct *child)
  {
-diff -urNp linux-3.0.4/include/linux/random.h linux-3.0.4/include/linux/random.h
---- linux-3.0.4/include/linux/random.h 2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/include/linux/random.h 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/random.h linux-3.1.3/include/linux/random.h
+--- linux-3.1.3/include/linux/random.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/random.h 2011-11-16 18:39:08.000000000 -0500
 @@ -69,12 +69,17 @@ void srandom32(u32 seed);
  
  u32 prandom32(struct rnd_state *);
@@ -57247,10 +60087,10 @@ diff -urNp linux-3.0.4/include/linux/random.h linux-3.0.4/include/linux/random.h
  }
  
  /**
-diff -urNp linux-3.0.4/include/linux/reboot.h linux-3.0.4/include/linux/reboot.h
---- linux-3.0.4/include/linux/reboot.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/reboot.h 2011-08-23 21:47:56.000000000 -0400
-@@ -47,9 +47,9 @@ extern int unregister_reboot_notifier(st
+diff -urNp linux-3.1.3/include/linux/reboot.h linux-3.1.3/include/linux/reboot.h
+--- linux-3.1.3/include/linux/reboot.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/reboot.h 2011-11-16 18:39:08.000000000 -0500
+@@ -52,9 +52,9 @@ extern int unregister_reboot_notifier(st
   * Architecture-specific implementations of sys_reboot commands.
   */
  
@@ -57263,7 +60103,7 @@ diff -urNp linux-3.0.4/include/linux/reboot.h linux-3.0.4/include/linux/reboot.h
  
  extern void machine_shutdown(void);
  struct pt_regs;
-@@ -60,9 +60,9 @@ extern void machine_crash_shutdown(struc
+@@ -65,9 +65,9 @@ extern void machine_crash_shutdown(struc
   */
  
  extern void kernel_restart_prepare(char *cmd);
@@ -57276,7 +60116,7 @@ diff -urNp linux-3.0.4/include/linux/reboot.h linux-3.0.4/include/linux/reboot.h
  
  extern int C_A_D; /* for sysctl */
  void ctrl_alt_del(void);
-@@ -76,7 +76,7 @@ extern int orderly_poweroff(bool force);
+@@ -81,7 +81,7 @@ extern int orderly_poweroff(bool force);
   * Emergency restart, callable from an interrupt handler.
   */
  
@@ -57285,9 +60125,9 @@ diff -urNp linux-3.0.4/include/linux/reboot.h linux-3.0.4/include/linux/reboot.h
  #include <asm/emergency-restart.h>
  
  #endif
-diff -urNp linux-3.0.4/include/linux/reiserfs_fs.h linux-3.0.4/include/linux/reiserfs_fs.h
---- linux-3.0.4/include/linux/reiserfs_fs.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/reiserfs_fs.h    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/reiserfs_fs.h linux-3.1.3/include/linux/reiserfs_fs.h
+--- linux-3.1.3/include/linux/reiserfs_fs.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/reiserfs_fs.h    2011-11-16 18:39:08.000000000 -0500
 @@ -1406,7 +1406,7 @@ static inline loff_t max_reiserfs_offset
  #define REISERFS_USER_MEM             1       /* reiserfs user memory mode            */
  
@@ -57297,9 +60137,9 @@ diff -urNp linux-3.0.4/include/linux/reiserfs_fs.h linux-3.0.4/include/linux/rei
  #define FILESYSTEM_CHANGED_TB(tb)  (get_generation((tb)->tb_sb) != (tb)->fs_gen)
  #define __fs_changed(gen,s) (gen != get_generation (s))
  #define fs_changed(gen,s)             \
-diff -urNp linux-3.0.4/include/linux/reiserfs_fs_sb.h linux-3.0.4/include/linux/reiserfs_fs_sb.h
---- linux-3.0.4/include/linux/reiserfs_fs_sb.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/reiserfs_fs_sb.h 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/reiserfs_fs_sb.h linux-3.1.3/include/linux/reiserfs_fs_sb.h
+--- linux-3.1.3/include/linux/reiserfs_fs_sb.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/reiserfs_fs_sb.h 2011-11-16 18:39:08.000000000 -0500
 @@ -386,7 +386,7 @@ struct reiserfs_sb_info {
        /* Comment? -Hans */
        wait_queue_head_t s_wait;
@@ -57309,9 +60149,9 @@ diff -urNp linux-3.0.4/include/linux/reiserfs_fs_sb.h linux-3.0.4/include/linux/
        // tree gets re-balanced
        unsigned long s_properties;     /* File system properties. Currently holds
                                           on-disk FS format */
-diff -urNp linux-3.0.4/include/linux/relay.h linux-3.0.4/include/linux/relay.h
---- linux-3.0.4/include/linux/relay.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/relay.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/relay.h linux-3.1.3/include/linux/relay.h
+--- linux-3.1.3/include/linux/relay.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/relay.h  2011-11-16 18:39:08.000000000 -0500
 @@ -159,7 +159,7 @@ struct rchan_callbacks
         * The callback should return 0 if successful, negative if not.
         */
@@ -57321,9 +60161,9 @@ diff -urNp linux-3.0.4/include/linux/relay.h linux-3.0.4/include/linux/relay.h
  
  /*
   * CONFIG_RELAY kernel API, kernel/relay.c
-diff -urNp linux-3.0.4/include/linux/rfkill.h linux-3.0.4/include/linux/rfkill.h
---- linux-3.0.4/include/linux/rfkill.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/rfkill.h 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/rfkill.h linux-3.1.3/include/linux/rfkill.h
+--- linux-3.1.3/include/linux/rfkill.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/rfkill.h 2011-11-16 18:39:08.000000000 -0500
 @@ -147,6 +147,7 @@ struct rfkill_ops {
        void    (*query)(struct rfkill *rfkill, void *data);
        int     (*set_block)(void *data, bool blocked);
@@ -57332,9 +60172,9 @@ diff -urNp linux-3.0.4/include/linux/rfkill.h linux-3.0.4/include/linux/rfkill.h
  
  #if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE)
  /**
-diff -urNp linux-3.0.4/include/linux/rmap.h linux-3.0.4/include/linux/rmap.h
---- linux-3.0.4/include/linux/rmap.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/rmap.h   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/rmap.h linux-3.1.3/include/linux/rmap.h
+--- linux-3.1.3/include/linux/rmap.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/rmap.h   2011-11-16 18:39:08.000000000 -0500
 @@ -119,8 +119,8 @@ static inline void anon_vma_unlock(struc
  void anon_vma_init(void);     /* create anon_vma_cachep */
  int  anon_vma_prepare(struct vm_area_struct *);
@@ -57346,9 +60186,9 @@ diff -urNp linux-3.0.4/include/linux/rmap.h linux-3.0.4/include/linux/rmap.h
  void __anon_vma_link(struct vm_area_struct *);
  
  static inline void anon_vma_merge(struct vm_area_struct *vma,
-diff -urNp linux-3.0.4/include/linux/sched.h linux-3.0.4/include/linux/sched.h
---- linux-3.0.4/include/linux/sched.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/sched.h  2011-08-25 17:22:27.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/sched.h linux-3.1.3/include/linux/sched.h
+--- linux-3.1.3/include/linux/sched.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/sched.h  2011-11-16 18:40:31.000000000 -0500
 @@ -100,6 +100,7 @@ struct bio_list;
  struct fs_struct;
  struct perf_event_context;
@@ -57455,7 +60295,7 @@ diff -urNp linux-3.0.4/include/linux/sched.h linux-3.0.4/include/linux/sched.h
  #ifdef CONFIG_DEBUG_MUTEXES
        /* mutex deadlock detection */
        struct mutex_waiter *blocked_on;
-@@ -1538,6 +1564,21 @@ struct task_struct {
+@@ -1537,6 +1563,21 @@ struct task_struct {
        unsigned long default_timer_slack_ns;
  
        struct list_head        *scm_work_list;
@@ -57477,7 +60317,7 @@ diff -urNp linux-3.0.4/include/linux/sched.h linux-3.0.4/include/linux/sched.h
  #ifdef CONFIG_FUNCTION_GRAPH_TRACER
        /* Index of current stored address in ret_stack */
        int curr_ret_stack;
-@@ -1572,6 +1613,57 @@ struct task_struct {
+@@ -1571,6 +1612,57 @@ struct task_struct {
  #endif
  };
  
@@ -57522,7 +60362,7 @@ diff -urNp linux-3.0.4/include/linux/sched.h linux-3.0.4/include/linux/sched.h
 +#endif
 +
 +extern void pax_report_fault(struct pt_regs *regs, void *pc, void *sp);
-+extern void pax_report_insns(void *pc, void *sp);
++extern void pax_report_insns(struct pt_regs *regs, void *pc, void *sp);
 +extern void pax_report_refcount_overflow(struct pt_regs *regs);
 +extern NORET_TYPE void pax_report_usercopy(const void *ptr, unsigned long len, bool to, const char *type) ATTRIB_NORET;
 +
@@ -57535,15 +60375,7 @@ diff -urNp linux-3.0.4/include/linux/sched.h linux-3.0.4/include/linux/sched.h
  /* Future-safe accessor for struct task_struct's cpus_allowed. */
  #define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed)
  
-@@ -1768,6 +1860,7 @@ extern void thread_group_times(struct ta
- #define PF_DUMPCORE   0x00000200      /* dumped core */
- #define PF_SIGNALED   0x00000400      /* killed by a signal */
- #define PF_MEMALLOC   0x00000800      /* Allocating memory */
-+#define PF_NPROC_EXCEEDED 0x00001000  /* set_user noticed that RLIMIT_NPROC was exceeded */
- #define PF_USED_MATH  0x00002000      /* if unset the fpu must be initialized before use */
- #define PF_FREEZING   0x00004000      /* freeze in progress. do not account to load */
- #define PF_NOFREEZE   0x00008000      /* this thread should not be frozen */
-@@ -2056,7 +2149,9 @@ void yield(void);
+@@ -2074,7 +2166,9 @@ void yield(void);
  extern struct exec_domain     default_exec_domain;
  
  union thread_union {
@@ -57553,7 +60385,7 @@ diff -urNp linux-3.0.4/include/linux/sched.h linux-3.0.4/include/linux/sched.h
        unsigned long stack[THREAD_SIZE/sizeof(long)];
  };
  
-@@ -2089,6 +2184,7 @@ extern struct pid_namespace init_pid_ns;
+@@ -2107,6 +2201,7 @@ extern struct pid_namespace init_pid_ns;
   */
  
  extern struct task_struct *find_task_by_vpid(pid_t nr);
@@ -57561,7 +60393,7 @@ diff -urNp linux-3.0.4/include/linux/sched.h linux-3.0.4/include/linux/sched.h
  extern struct task_struct *find_task_by_pid_ns(pid_t nr,
                struct pid_namespace *ns);
  
-@@ -2225,7 +2321,7 @@ extern void __cleanup_sighand(struct sig
+@@ -2243,7 +2338,7 @@ extern void __cleanup_sighand(struct sig
  extern void exit_itimers(struct signal_struct *);
  extern void flush_itimer_signals(void);
  
@@ -57570,7 +60402,7 @@ diff -urNp linux-3.0.4/include/linux/sched.h linux-3.0.4/include/linux/sched.h
  
  extern void daemonize(const char *, ...);
  extern int allow_signal(int);
-@@ -2393,13 +2489,17 @@ static inline unsigned long *end_of_stac
+@@ -2408,13 +2503,17 @@ static inline unsigned long *end_of_stac
  
  #endif
  
@@ -57590,9 +60422,9 @@ diff -urNp linux-3.0.4/include/linux/sched.h linux-3.0.4/include/linux/sched.h
  extern void thread_info_cache_init(void);
  
  #ifdef CONFIG_DEBUG_STACK_USAGE
-diff -urNp linux-3.0.4/include/linux/screen_info.h linux-3.0.4/include/linux/screen_info.h
---- linux-3.0.4/include/linux/screen_info.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/screen_info.h    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/screen_info.h linux-3.1.3/include/linux/screen_info.h
+--- linux-3.1.3/include/linux/screen_info.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/screen_info.h    2011-11-16 18:39:08.000000000 -0500
 @@ -43,7 +43,8 @@ struct screen_info {
        __u16 pages;            /* 0x32 */
        __u16 vesa_attributes;  /* 0x34 */
@@ -57603,9 +60435,9 @@ diff -urNp linux-3.0.4/include/linux/screen_info.h linux-3.0.4/include/linux/scr
  } __attribute__((packed));
  
  #define VIDEO_TYPE_MDA                0x10    /* Monochrome Text Display      */
-diff -urNp linux-3.0.4/include/linux/security.h linux-3.0.4/include/linux/security.h
---- linux-3.0.4/include/linux/security.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/security.h       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/security.h linux-3.1.3/include/linux/security.h
+--- linux-3.1.3/include/linux/security.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/security.h       2011-11-16 18:40:31.000000000 -0500
 @@ -36,6 +36,7 @@
  #include <linux/key.h>
  #include <linux/xfrm.h>
@@ -57614,10 +60446,10 @@ diff -urNp linux-3.0.4/include/linux/security.h linux-3.0.4/include/linux/securi
  #include <net/flow.h>
  
  /* Maximum number of letters for an LSM name string */
-diff -urNp linux-3.0.4/include/linux/seq_file.h linux-3.0.4/include/linux/seq_file.h
---- linux-3.0.4/include/linux/seq_file.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/seq_file.h       2011-08-23 21:47:56.000000000 -0400
-@@ -32,6 +32,7 @@ struct seq_operations {
+diff -urNp linux-3.1.3/include/linux/seq_file.h linux-3.1.3/include/linux/seq_file.h
+--- linux-3.1.3/include/linux/seq_file.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/seq_file.h       2011-11-16 18:39:08.000000000 -0500
+@@ -33,6 +33,7 @@ struct seq_operations {
        void * (*next) (struct seq_file *m, void *v, loff_t *pos);
        int (*show) (struct seq_file *m, void *v);
  };
@@ -57625,25 +60457,13 @@ diff -urNp linux-3.0.4/include/linux/seq_file.h linux-3.0.4/include/linux/seq_fi
  
  #define SEQ_SKIP 1
  
-diff -urNp linux-3.0.4/include/linux/shmem_fs.h linux-3.0.4/include/linux/shmem_fs.h
---- linux-3.0.4/include/linux/shmem_fs.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/shmem_fs.h       2011-08-23 21:47:56.000000000 -0400
-@@ -10,7 +10,7 @@
- #define SHMEM_NR_DIRECT 16
--#define SHMEM_SYMLINK_INLINE_LEN (SHMEM_NR_DIRECT * sizeof(swp_entry_t))
-+#define SHMEM_SYMLINK_INLINE_LEN 64
+diff -urNp linux-3.1.3/include/linux/shm.h linux-3.1.3/include/linux/shm.h
+--- linux-3.1.3/include/linux/shm.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/shm.h    2011-11-16 18:59:58.000000000 -0500
+@@ -98,6 +98,10 @@ struct shmid_kernel /* private to the ke
  
- struct shmem_inode_info {
-       spinlock_t              lock;
-diff -urNp linux-3.0.4/include/linux/shm.h linux-3.0.4/include/linux/shm.h
---- linux-3.0.4/include/linux/shm.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/shm.h    2011-08-23 21:48:14.000000000 -0400
-@@ -95,6 +95,10 @@ struct shmid_kernel /* private to the ke
-       pid_t                   shm_cprid;
-       pid_t                   shm_lprid;
-       struct user_struct      *mlock_user;
+       /* The task created the shm object.  NULL if the task is dead. */
+       struct task_struct      *shm_creator;
 +#ifdef CONFIG_GRKERNSEC
 +      time_t                  shm_createtime;
 +      pid_t                   shm_lapid;
@@ -57651,10 +60471,10 @@ diff -urNp linux-3.0.4/include/linux/shm.h linux-3.0.4/include/linux/shm.h
  };
  
  /* shm_mode upper byte flags */
-diff -urNp linux-3.0.4/include/linux/skbuff.h linux-3.0.4/include/linux/skbuff.h
---- linux-3.0.4/include/linux/skbuff.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/skbuff.h 2011-08-23 21:47:56.000000000 -0400
-@@ -592,7 +592,7 @@ static inline struct skb_shared_hwtstamp
+diff -urNp linux-3.1.3/include/linux/skbuff.h linux-3.1.3/include/linux/skbuff.h
+--- linux-3.1.3/include/linux/skbuff.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/skbuff.h 2011-11-16 18:39:08.000000000 -0500
+@@ -610,7 +610,7 @@ static inline struct skb_shared_hwtstamp
   */
  static inline int skb_queue_empty(const struct sk_buff_head *list)
  {
@@ -57663,7 +60483,7 @@ diff -urNp linux-3.0.4/include/linux/skbuff.h linux-3.0.4/include/linux/skbuff.h
  }
  
  /**
-@@ -605,7 +605,7 @@ static inline int skb_queue_empty(const 
+@@ -623,7 +623,7 @@ static inline int skb_queue_empty(const 
  static inline bool skb_queue_is_last(const struct sk_buff_head *list,
                                     const struct sk_buff *skb)
  {
@@ -57672,7 +60492,7 @@ diff -urNp linux-3.0.4/include/linux/skbuff.h linux-3.0.4/include/linux/skbuff.h
  }
  
  /**
-@@ -618,7 +618,7 @@ static inline bool skb_queue_is_last(con
+@@ -636,7 +636,7 @@ static inline bool skb_queue_is_last(con
  static inline bool skb_queue_is_first(const struct sk_buff_head *list,
                                      const struct sk_buff *skb)
  {
@@ -57681,7 +60501,7 @@ diff -urNp linux-3.0.4/include/linux/skbuff.h linux-3.0.4/include/linux/skbuff.h
  }
  
  /**
-@@ -1440,7 +1440,7 @@ static inline int pskb_network_may_pull(
+@@ -1458,7 +1458,7 @@ static inline int pskb_network_may_pull(
   * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8)
   */
  #ifndef NET_SKB_PAD
@@ -57690,10 +60510,10 @@ diff -urNp linux-3.0.4/include/linux/skbuff.h linux-3.0.4/include/linux/skbuff.h
  #endif
  
  extern int ___pskb_trim(struct sk_buff *skb, unsigned int len);
-diff -urNp linux-3.0.4/include/linux/slab_def.h linux-3.0.4/include/linux/slab_def.h
---- linux-3.0.4/include/linux/slab_def.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/slab_def.h       2011-08-23 21:47:56.000000000 -0400
-@@ -96,10 +96,10 @@ struct kmem_cache {
+diff -urNp linux-3.1.3/include/linux/slab_def.h linux-3.1.3/include/linux/slab_def.h
+--- linux-3.1.3/include/linux/slab_def.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/slab_def.h       2011-11-16 18:39:08.000000000 -0500
+@@ -68,10 +68,10 @@ struct kmem_cache {
        unsigned long node_allocs;
        unsigned long node_frees;
        unsigned long node_overflow;
@@ -57708,9 +60528,9 @@ diff -urNp linux-3.0.4/include/linux/slab_def.h linux-3.0.4/include/linux/slab_d
  
        /*
         * If debugging is enabled, then the allocator can add additional
-diff -urNp linux-3.0.4/include/linux/slab.h linux-3.0.4/include/linux/slab.h
---- linux-3.0.4/include/linux/slab.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/slab.h   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/slab.h linux-3.1.3/include/linux/slab.h
+--- linux-3.1.3/include/linux/slab.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/slab.h   2011-11-16 18:39:08.000000000 -0500
 @@ -11,12 +11,20 @@
  
  #include <linux/gfp.h>
@@ -57749,7 +60569,7 @@ diff -urNp linux-3.0.4/include/linux/slab.h linux-3.0.4/include/linux/slab.h
  
  /*
   * struct kmem_cache related prototypes
-@@ -141,6 +152,7 @@ void * __must_check krealloc(const void 
+@@ -161,6 +172,7 @@ void * __must_check krealloc(const void 
  void kfree(const void *);
  void kzfree(const void *);
  size_t ksize(const void *);
@@ -57757,7 +60577,7 @@ diff -urNp linux-3.0.4/include/linux/slab.h linux-3.0.4/include/linux/slab.h
  
  /*
   * Allocator specific definitions. These are mainly used to establish optimized
-@@ -333,4 +345,59 @@ static inline void *kzalloc_node(size_t 
+@@ -353,4 +365,59 @@ static inline void *kzalloc_node(size_t 
  
  void __init kmem_cache_init_late(void);
  
@@ -57817,10 +60637,10 @@ diff -urNp linux-3.0.4/include/linux/slab.h linux-3.0.4/include/linux/slab.h
 +})
 +
  #endif        /* _LINUX_SLAB_H */
-diff -urNp linux-3.0.4/include/linux/slub_def.h linux-3.0.4/include/linux/slub_def.h
---- linux-3.0.4/include/linux/slub_def.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/slub_def.h       2011-08-23 21:47:56.000000000 -0400
-@@ -82,7 +82,7 @@ struct kmem_cache {
+diff -urNp linux-3.1.3/include/linux/slub_def.h linux-3.1.3/include/linux/slub_def.h
+--- linux-3.1.3/include/linux/slub_def.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/slub_def.h       2011-11-16 18:39:08.000000000 -0500
+@@ -85,7 +85,7 @@ struct kmem_cache {
        struct kmem_cache_order_objects max;
        struct kmem_cache_order_objects min;
        gfp_t allocflags;       /* gfp flags to use on each alloc */
@@ -57829,7 +60649,7 @@ diff -urNp linux-3.0.4/include/linux/slub_def.h linux-3.0.4/include/linux/slub_d
        void (*ctor)(void *);
        int inuse;              /* Offset to metadata */
        int align;              /* Alignment */
-@@ -218,7 +218,7 @@ static __always_inline struct kmem_cache
+@@ -211,7 +211,7 @@ static __always_inline struct kmem_cache
  }
  
  void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
@@ -57838,11 +60658,11 @@ diff -urNp linux-3.0.4/include/linux/slub_def.h linux-3.0.4/include/linux/slub_d
  
  static __always_inline void *
  kmalloc_order(size_t size, gfp_t flags, unsigned int order)
-diff -urNp linux-3.0.4/include/linux/sonet.h linux-3.0.4/include/linux/sonet.h
---- linux-3.0.4/include/linux/sonet.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/sonet.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/sonet.h linux-3.1.3/include/linux/sonet.h
+--- linux-3.1.3/include/linux/sonet.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/sonet.h  2011-11-16 18:39:08.000000000 -0500
 @@ -61,7 +61,7 @@ struct sonet_stats {
- #include <asm/atomic.h>
+ #include <linux/atomic.h>
  
  struct k_sonet_stats {
 -#define __HANDLE_ITEM(i) atomic_t i
@@ -57850,9 +60670,9 @@ diff -urNp linux-3.0.4/include/linux/sonet.h linux-3.0.4/include/linux/sonet.h
        __SONET_ITEMS
  #undef __HANDLE_ITEM
  };
-diff -urNp linux-3.0.4/include/linux/sunrpc/clnt.h linux-3.0.4/include/linux/sunrpc/clnt.h
---- linux-3.0.4/include/linux/sunrpc/clnt.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/sunrpc/clnt.h    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/sunrpc/clnt.h linux-3.1.3/include/linux/sunrpc/clnt.h
+--- linux-3.1.3/include/linux/sunrpc/clnt.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/sunrpc/clnt.h    2011-11-16 18:39:08.000000000 -0500
 @@ -169,9 +169,9 @@ static inline unsigned short rpc_get_por
  {
        switch (sap->sa_family) {
@@ -57883,9 +60703,20 @@ diff -urNp linux-3.0.4/include/linux/sunrpc/clnt.h linux-3.0.4/include/linux/sun
  }
  
  #endif /* __KERNEL__ */
-diff -urNp linux-3.0.4/include/linux/sunrpc/svc_rdma.h linux-3.0.4/include/linux/sunrpc/svc_rdma.h
---- linux-3.0.4/include/linux/sunrpc/svc_rdma.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/sunrpc/svc_rdma.h        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/sunrpc/sched.h linux-3.1.3/include/linux/sunrpc/sched.h
+--- linux-3.1.3/include/linux/sunrpc/sched.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/sunrpc/sched.h   2011-11-16 18:39:08.000000000 -0500
+@@ -105,6 +105,7 @@ struct rpc_call_ops {
+       void (*rpc_call_done)(struct rpc_task *, void *);
+       void (*rpc_release)(void *);
+ };
++typedef struct rpc_call_ops __no_const rpc_call_ops_no_const;
+ struct rpc_task_setup {
+       struct rpc_task *task;
+diff -urNp linux-3.1.3/include/linux/sunrpc/svc_rdma.h linux-3.1.3/include/linux/sunrpc/svc_rdma.h
+--- linux-3.1.3/include/linux/sunrpc/svc_rdma.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/sunrpc/svc_rdma.h        2011-11-16 18:39:08.000000000 -0500
 @@ -53,15 +53,15 @@ extern unsigned int svcrdma_ord;
  extern unsigned int svcrdma_max_requests;
  extern unsigned int svcrdma_max_req_size;
@@ -57911,9 +60742,9 @@ diff -urNp linux-3.0.4/include/linux/sunrpc/svc_rdma.h linux-3.0.4/include/linux
  
  #define RPCRDMA_VERSION 1
  
-diff -urNp linux-3.0.4/include/linux/sysctl.h linux-3.0.4/include/linux/sysctl.h
---- linux-3.0.4/include/linux/sysctl.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/sysctl.h 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/sysctl.h linux-3.1.3/include/linux/sysctl.h
+--- linux-3.1.3/include/linux/sysctl.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/sysctl.h 2011-11-16 18:40:31.000000000 -0500
 @@ -155,7 +155,11 @@ enum
        KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */
  };
@@ -57936,9 +60767,9 @@ diff -urNp linux-3.0.4/include/linux/sysctl.h linux-3.0.4/include/linux/sysctl.h
  extern int proc_dointvec(struct ctl_table *, int,
                         void __user *, size_t *, loff_t *);
  extern int proc_dointvec_minmax(struct ctl_table *, int,
-diff -urNp linux-3.0.4/include/linux/tty_ldisc.h linux-3.0.4/include/linux/tty_ldisc.h
---- linux-3.0.4/include/linux/tty_ldisc.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/tty_ldisc.h      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/tty_ldisc.h linux-3.1.3/include/linux/tty_ldisc.h
+--- linux-3.1.3/include/linux/tty_ldisc.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/tty_ldisc.h      2011-11-16 18:39:08.000000000 -0500
 @@ -148,7 +148,7 @@ struct tty_ldisc_ops {
  
        struct  module *owner;
@@ -57948,9 +60779,9 @@ diff -urNp linux-3.0.4/include/linux/tty_ldisc.h linux-3.0.4/include/linux/tty_l
  };
  
  struct tty_ldisc {
-diff -urNp linux-3.0.4/include/linux/types.h linux-3.0.4/include/linux/types.h
---- linux-3.0.4/include/linux/types.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/types.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/types.h linux-3.1.3/include/linux/types.h
+--- linux-3.1.3/include/linux/types.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/types.h  2011-11-16 18:39:08.000000000 -0500
 @@ -213,10 +213,26 @@ typedef struct {
        int counter;
  } atomic_t;
@@ -57978,26 +60809,27 @@ diff -urNp linux-3.0.4/include/linux/types.h linux-3.0.4/include/linux/types.h
  #endif
  
  struct list_head {
-diff -urNp linux-3.0.4/include/linux/uaccess.h linux-3.0.4/include/linux/uaccess.h
---- linux-3.0.4/include/linux/uaccess.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/uaccess.h        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/uaccess.h linux-3.1.3/include/linux/uaccess.h
+--- linux-3.1.3/include/linux/uaccess.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/uaccess.h        2011-11-16 18:39:08.000000000 -0500
 @@ -76,11 +76,11 @@ static inline unsigned long __copy_from_
                long ret;                               \
                mm_segment_t old_fs = get_fs();         \
                                                        \
 -              set_fs(KERNEL_DS);                      \
                pagefault_disable();                    \
-+              set_fs(KERNEL_DS);                      \
-               ret = __copy_from_user_inatomic(&(retval), (__force typeof(retval) __user *)(addr), sizeof(retval));            \
+-              ret = __copy_from_user_inatomic(&(retval), (__force typeof(retval) __user *)(addr), sizeof(retval));            \
 -              pagefault_enable();                     \
++              set_fs(KERNEL_DS);                      \
++              ret = __copy_from_user_inatomic(&(retval), (typeof(retval) __force_user *)(addr), sizeof(retval));              \
                set_fs(old_fs);                         \
 +              pagefault_enable();                     \
                ret;                                    \
        })
  
-diff -urNp linux-3.0.4/include/linux/unaligned/access_ok.h linux-3.0.4/include/linux/unaligned/access_ok.h
---- linux-3.0.4/include/linux/unaligned/access_ok.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/unaligned/access_ok.h    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/unaligned/access_ok.h linux-3.1.3/include/linux/unaligned/access_ok.h
+--- linux-3.1.3/include/linux/unaligned/access_ok.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/unaligned/access_ok.h    2011-11-16 18:39:08.000000000 -0500
 @@ -6,32 +6,32 @@
  
  static inline u16 get_unaligned_le16(const void *p)
@@ -58037,22 +60869,62 @@ diff -urNp linux-3.0.4/include/linux/unaligned/access_ok.h linux-3.0.4/include/l
  }
  
  static inline void put_unaligned_le16(u16 val, void *p)
-diff -urNp linux-3.0.4/include/linux/vmalloc.h linux-3.0.4/include/linux/vmalloc.h
---- linux-3.0.4/include/linux/vmalloc.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/vmalloc.h        2011-08-23 21:47:56.000000000 -0400
-@@ -13,6 +13,11 @@ struct vm_area_struct;              /* vma defining 
- #define VM_MAP                0x00000004      /* vmap()ed pages */
+diff -urNp linux-3.1.3/include/linux/vermagic.h linux-3.1.3/include/linux/vermagic.h
+--- linux-3.1.3/include/linux/vermagic.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/vermagic.h       2011-11-16 18:54:54.000000000 -0500
+@@ -26,9 +26,35 @@
+ #define MODULE_ARCH_VERMAGIC ""
+ #endif
++#ifdef CONFIG_PAX_REFCOUNT
++#define MODULE_PAX_REFCOUNT "REFCOUNT "
++#else
++#define MODULE_PAX_REFCOUNT ""
++#endif
++
++#ifdef CONSTIFY_PLUGIN
++#define MODULE_CONSTIFY_PLUGIN "CONSTIFY_PLUGIN "
++#else
++#define MODULE_CONSTIFY_PLUGIN ""
++#endif
++
++#ifdef STACKLEAK_PLUGIN
++#define MODULE_STACKLEAK_PLUGIN "STACKLEAK_PLUGIN "
++#else
++#define MODULE_STACKLEAK_PLUGIN ""
++#endif
++
++#ifdef CONFIG_GRKERNSEC
++#define MODULE_GRSEC "GRSEC "
++#else
++#define MODULE_GRSEC ""
++#endif
++
+ #define VERMAGIC_STRING                                               \
+       UTS_RELEASE " "                                                 \
+       MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT                     \
+       MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS       \
+-      MODULE_ARCH_VERMAGIC
++      MODULE_ARCH_VERMAGIC                                            \
++      MODULE_PAX_REFCOUNT MODULE_CONSTIFY_PLUGIN MODULE_STACKLEAK_PLUGIN \
++      MODULE_GRSEC
+diff -urNp linux-3.1.3/include/linux/vmalloc.h linux-3.1.3/include/linux/vmalloc.h
+--- linux-3.1.3/include/linux/vmalloc.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/vmalloc.h        2011-11-16 18:39:08.000000000 -0500
+@@ -14,6 +14,11 @@ struct vm_area_struct;              /* vma defining 
  #define VM_USERMAP    0x00000008      /* suitable for remap_vmalloc_range */
  #define VM_VPAGES     0x00000010      /* buffer for pages was vmalloc'ed */
+ #define VM_UNLIST     0x00000020      /* vm_struct is not listed in vmlist */
 +
 +#if defined(CONFIG_MODULES) && defined(CONFIG_X86) && defined(CONFIG_PAX_KERNEXEC)
-+#define VM_KERNEXEC   0x00000020      /* allocate from executable kernel memory range */
++#define VM_KERNEXEC   0x00000040      /* allocate from executable kernel memory range */
 +#endif
 +
  /* bits [20..32] reserved for arch specific ioremap internals */
  
  /*
-@@ -155,4 +160,103 @@ pcpu_free_vm_areas(struct vm_struct **vm
+@@ -156,4 +161,103 @@ pcpu_free_vm_areas(struct vm_struct **vm
  # endif
  #endif
  
@@ -58156,9 +61028,9 @@ diff -urNp linux-3.0.4/include/linux/vmalloc.h linux-3.0.4/include/linux/vmalloc
 +})
 +
  #endif /* _LINUX_VMALLOC_H */
-diff -urNp linux-3.0.4/include/linux/vmstat.h linux-3.0.4/include/linux/vmstat.h
---- linux-3.0.4/include/linux/vmstat.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/linux/vmstat.h 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/linux/vmstat.h linux-3.1.3/include/linux/vmstat.h
+--- linux-3.1.3/include/linux/vmstat.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/linux/vmstat.h 2011-11-16 18:39:08.000000000 -0500
 @@ -87,18 +87,18 @@ static inline void vm_events_fold_cpu(in
  /*
   * Zone based page accounting with per cpu differentials.
@@ -58222,9 +61094,9 @@ diff -urNp linux-3.0.4/include/linux/vmstat.h linux-3.0.4/include/linux/vmstat.h
  }
  
  static inline void __dec_zone_page_state(struct page *page,
-diff -urNp linux-3.0.4/include/media/saa7146_vv.h linux-3.0.4/include/media/saa7146_vv.h
---- linux-3.0.4/include/media/saa7146_vv.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/media/saa7146_vv.h     2011-08-24 18:26:09.000000000 -0400
+diff -urNp linux-3.1.3/include/media/saa7146_vv.h linux-3.1.3/include/media/saa7146_vv.h
+--- linux-3.1.3/include/media/saa7146_vv.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/media/saa7146_vv.h     2011-11-16 18:39:08.000000000 -0500
 @@ -163,7 +163,7 @@ struct saa7146_ext_vv
        int (*std_callback)(struct saa7146_dev*, struct saa7146_standard *);
  
@@ -58234,20 +61106,53 @@ diff -urNp linux-3.0.4/include/media/saa7146_vv.h linux-3.0.4/include/media/saa7
        /* pointer to the saa7146 core ops */
        const struct v4l2_ioctl_ops *core_ops;
  
-diff -urNp linux-3.0.4/include/media/v4l2-ioctl.h linux-3.0.4/include/media/v4l2-ioctl.h
---- linux-3.0.4/include/media/v4l2-ioctl.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/media/v4l2-ioctl.h     2011-08-24 18:25:45.000000000 -0400
-@@ -272,6 +272,7 @@ struct v4l2_ioctl_ops {
+diff -urNp linux-3.1.3/include/media/v4l2-dev.h linux-3.1.3/include/media/v4l2-dev.h
+--- linux-3.1.3/include/media/v4l2-dev.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/media/v4l2-dev.h       2011-11-16 18:39:08.000000000 -0500
+@@ -56,7 +56,7 @@ int v4l2_prio_check(struct v4l2_prio_sta
+ struct v4l2_file_operations {
+-      struct module *owner;
++      struct module * const owner;
+       ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
+       ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
+       unsigned int (*poll) (struct file *, struct poll_table_struct *);
+@@ -68,6 +68,7 @@ struct v4l2_file_operations {
+       int (*open) (struct file *);
+       int (*release) (struct file *);
+ };
++typedef struct v4l2_file_operations __no_const v4l2_file_operations_no_const;
+ /*
+  * Newer version of video_device, handled by videodev2.c
+diff -urNp linux-3.1.3/include/media/v4l2-ioctl.h linux-3.1.3/include/media/v4l2-ioctl.h
+--- linux-3.1.3/include/media/v4l2-ioctl.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/media/v4l2-ioctl.h     2011-11-17 18:44:20.000000000 -0500
+@@ -272,7 +272,7 @@ struct v4l2_ioctl_ops {
        long (*vidioc_default)         (struct file *file, void *fh,
                                        bool valid_prio, int cmd, void *arg);
  };
+-
 +typedef struct v4l2_ioctl_ops __no_const v4l2_ioctl_ops_no_const;
  
  /* v4l debugging and diagnostics */
-diff -urNp linux-3.0.4/include/net/caif/cfctrl.h linux-3.0.4/include/net/caif/cfctrl.h
---- linux-3.0.4/include/net/caif/cfctrl.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/net/caif/cfctrl.h      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/net/caif/caif_hsi.h linux-3.1.3/include/net/caif/caif_hsi.h
+--- linux-3.1.3/include/net/caif/caif_hsi.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/net/caif/caif_hsi.h    2011-11-16 18:39:08.000000000 -0500
+@@ -94,7 +94,7 @@ struct cfhsi_drv {
+       void (*rx_done_cb) (struct cfhsi_drv *drv);
+       void (*wake_up_cb) (struct cfhsi_drv *drv);
+       void (*wake_down_cb) (struct cfhsi_drv *drv);
+-};
++} __no_const;
+ /* Structure implemented by HSI device. */
+ struct cfhsi_dev {
+diff -urNp linux-3.1.3/include/net/caif/cfctrl.h linux-3.1.3/include/net/caif/cfctrl.h
+--- linux-3.1.3/include/net/caif/cfctrl.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/net/caif/cfctrl.h      2011-11-16 18:39:08.000000000 -0500
 @@ -52,7 +52,7 @@ struct cfctrl_rsp {
        void (*radioset_rsp)(void);
        void (*reject_rsp)(struct cflayer *layer, u8 linkid,
@@ -58268,10 +61173,10 @@ diff -urNp linux-3.0.4/include/net/caif/cfctrl.h linux-3.0.4/include/net/caif/cf
        struct list_head list;
        /* Protects from simultaneous access to first_req list */
        spinlock_t info_list_lock;
-diff -urNp linux-3.0.4/include/net/flow.h linux-3.0.4/include/net/flow.h
---- linux-3.0.4/include/net/flow.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/net/flow.h     2011-08-23 21:47:56.000000000 -0400
-@@ -188,6 +188,6 @@ extern struct flow_cache_object *flow_ca
+diff -urNp linux-3.1.3/include/net/flow.h linux-3.1.3/include/net/flow.h
+--- linux-3.1.3/include/net/flow.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/net/flow.h     2011-11-16 18:39:08.000000000 -0500
+@@ -207,6 +207,6 @@ extern struct flow_cache_object *flow_ca
                u8 dir, flow_resolve_t resolver, void *ctx);
  
  extern void flow_cache_flush(void);
@@ -58279,10 +61184,10 @@ diff -urNp linux-3.0.4/include/net/flow.h linux-3.0.4/include/net/flow.h
 +extern atomic_unchecked_t flow_cache_genid;
  
  #endif
-diff -urNp linux-3.0.4/include/net/inetpeer.h linux-3.0.4/include/net/inetpeer.h
---- linux-3.0.4/include/net/inetpeer.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/net/inetpeer.h 2011-08-23 21:47:56.000000000 -0400
-@@ -43,8 +43,8 @@ struct inet_peer {
+diff -urNp linux-3.1.3/include/net/inetpeer.h linux-3.1.3/include/net/inetpeer.h
+--- linux-3.1.3/include/net/inetpeer.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/net/inetpeer.h 2011-11-16 18:39:08.000000000 -0500
+@@ -47,8 +47,8 @@ struct inet_peer {
         */
        union {
                struct {
@@ -58292,19 +61197,24 @@ diff -urNp linux-3.0.4/include/net/inetpeer.h linux-3.0.4/include/net/inetpeer.h
 +                      atomic_unchecked_t              ip_id_count;    /* IP ID for the next packet */
                        __u32                           tcp_ts;
                        __u32                           tcp_ts_stamp;
-                       u32                             metrics[RTAX_MAX];
-@@ -108,7 +108,7 @@ static inline __u16        inet_getid(struct in
- {
+               };
+@@ -112,11 +112,11 @@ static inline int inet_getid(struct inet
        more++;
        inet_peer_refcheck(p);
--      return atomic_add_return(more, &p->ip_id_count) - more;
-+      return atomic_add_return_unchecked(more, &p->ip_id_count) - more;
- }
- #endif /* _NET_INETPEER_H */
-diff -urNp linux-3.0.4/include/net/ip_fib.h linux-3.0.4/include/net/ip_fib.h
---- linux-3.0.4/include/net/ip_fib.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/net/ip_fib.h   2011-08-23 21:47:56.000000000 -0400
+       do {
+-              old = atomic_read(&p->ip_id_count);
++              old = atomic_read_unchecked(&p->ip_id_count);
+               new = old + more;
+               if (!new)
+                       new = 1;
+-      } while (atomic_cmpxchg(&p->ip_id_count, old, new) != old);
++      } while (atomic_cmpxchg_unchecked(&p->ip_id_count, old, new) != old);
+       return new;
+ }
+diff -urNp linux-3.1.3/include/net/ip_fib.h linux-3.1.3/include/net/ip_fib.h
+--- linux-3.1.3/include/net/ip_fib.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/net/ip_fib.h   2011-11-16 18:39:08.000000000 -0500
 @@ -146,7 +146,7 @@ extern __be32 fib_info_update_nh_saddr(s
  
  #define FIB_RES_SADDR(net, res)                               \
@@ -58314,9 +61224,9 @@ diff -urNp linux-3.0.4/include/net/ip_fib.h linux-3.0.4/include/net/ip_fib.h
         FIB_RES_NH(res).nh_saddr :                     \
         fib_info_update_nh_saddr((net), &FIB_RES_NH(res)))
  #define FIB_RES_GW(res)                       (FIB_RES_NH(res).nh_gw)
-diff -urNp linux-3.0.4/include/net/ip_vs.h linux-3.0.4/include/net/ip_vs.h
---- linux-3.0.4/include/net/ip_vs.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/net/ip_vs.h    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/net/ip_vs.h linux-3.1.3/include/net/ip_vs.h
+--- linux-3.1.3/include/net/ip_vs.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/net/ip_vs.h    2011-11-16 18:39:08.000000000 -0500
 @@ -509,7 +509,7 @@ struct ip_vs_conn {
        struct ip_vs_conn       *control;       /* Master control connection */
        atomic_t                n_control;      /* Number of controlled ones */
@@ -58335,9 +61245,9 @@ diff -urNp linux-3.0.4/include/net/ip_vs.h linux-3.0.4/include/net/ip_vs.h
        atomic_t                weight;         /* server weight */
  
        atomic_t                refcnt;         /* reference counter */
-diff -urNp linux-3.0.4/include/net/irda/ircomm_core.h linux-3.0.4/include/net/irda/ircomm_core.h
---- linux-3.0.4/include/net/irda/ircomm_core.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/net/irda/ircomm_core.h 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/net/irda/ircomm_core.h linux-3.1.3/include/net/irda/ircomm_core.h
+--- linux-3.1.3/include/net/irda/ircomm_core.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/net/irda/ircomm_core.h 2011-11-16 18:39:08.000000000 -0500
 @@ -51,7 +51,7 @@ typedef struct {
        int (*connect_response)(struct ircomm_cb *, struct sk_buff *);
        int (*disconnect_request)(struct ircomm_cb *, struct sk_buff *, 
@@ -58347,9 +61257,9 @@ diff -urNp linux-3.0.4/include/net/irda/ircomm_core.h linux-3.0.4/include/net/ir
  
  struct ircomm_cb {
        irda_queue_t queue;
-diff -urNp linux-3.0.4/include/net/irda/ircomm_tty.h linux-3.0.4/include/net/irda/ircomm_tty.h
---- linux-3.0.4/include/net/irda/ircomm_tty.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/net/irda/ircomm_tty.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/net/irda/ircomm_tty.h linux-3.1.3/include/net/irda/ircomm_tty.h
+--- linux-3.1.3/include/net/irda/ircomm_tty.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/net/irda/ircomm_tty.h  2011-11-16 18:39:08.000000000 -0500
 @@ -35,6 +35,7 @@
  #include <linux/termios.h>
  #include <linux/timer.h>
@@ -58369,9 +61279,9 @@ diff -urNp linux-3.0.4/include/net/irda/ircomm_tty.h linux-3.0.4/include/net/ird
  
        /* Protect concurent access to :
         *      o self->open_count
-diff -urNp linux-3.0.4/include/net/iucv/af_iucv.h linux-3.0.4/include/net/iucv/af_iucv.h
---- linux-3.0.4/include/net/iucv/af_iucv.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/net/iucv/af_iucv.h     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/net/iucv/af_iucv.h linux-3.1.3/include/net/iucv/af_iucv.h
+--- linux-3.1.3/include/net/iucv/af_iucv.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/net/iucv/af_iucv.h     2011-11-16 18:39:08.000000000 -0500
 @@ -87,7 +87,7 @@ struct iucv_sock {
  struct iucv_sock_list {
        struct hlist_head head;
@@ -58381,9 +61291,9 @@ diff -urNp linux-3.0.4/include/net/iucv/af_iucv.h linux-3.0.4/include/net/iucv/a
  };
  
  unsigned int iucv_sock_poll(struct file *file, struct socket *sock,
-diff -urNp linux-3.0.4/include/net/lapb.h linux-3.0.4/include/net/lapb.h
---- linux-3.0.4/include/net/lapb.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/net/lapb.h     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/net/lapb.h linux-3.1.3/include/net/lapb.h
+--- linux-3.1.3/include/net/lapb.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/net/lapb.h     2011-11-16 18:39:08.000000000 -0500
 @@ -95,7 +95,7 @@ struct lapb_cb {
        struct sk_buff_head     write_queue;
        struct sk_buff_head     ack_queue;
@@ -58393,21 +61303,21 @@ diff -urNp linux-3.0.4/include/net/lapb.h linux-3.0.4/include/net/lapb.h
  
        /* FRMR control information */
        struct lapb_frame       frmr_data;
-diff -urNp linux-3.0.4/include/net/neighbour.h linux-3.0.4/include/net/neighbour.h
---- linux-3.0.4/include/net/neighbour.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/net/neighbour.h        2011-08-31 18:39:25.000000000 -0400
-@@ -124,7 +124,7 @@ struct neigh_ops {
-       int                     (*connected_output)(struct sk_buff*);
-       int                     (*hh_output)(struct sk_buff*);
-       int                     (*queue_xmit)(struct sk_buff*);
+diff -urNp linux-3.1.3/include/net/neighbour.h linux-3.1.3/include/net/neighbour.h
+--- linux-3.1.3/include/net/neighbour.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/net/neighbour.h        2011-11-16 18:39:08.000000000 -0500
+@@ -122,7 +122,7 @@ struct neigh_ops {
+       void                    (*error_report)(struct neighbour *, struct sk_buff *);
+       int                     (*output)(struct neighbour *, struct sk_buff *);
+       int                     (*connected_output)(struct neighbour *, struct sk_buff *);
 -};
 +} __do_const;
  
  struct pneigh_entry {
        struct pneigh_entry     *next;
-diff -urNp linux-3.0.4/include/net/netlink.h linux-3.0.4/include/net/netlink.h
---- linux-3.0.4/include/net/netlink.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/net/netlink.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/net/netlink.h linux-3.1.3/include/net/netlink.h
+--- linux-3.1.3/include/net/netlink.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/net/netlink.h  2011-11-16 18:39:08.000000000 -0500
 @@ -562,7 +562,7 @@ static inline void *nlmsg_get_pos(struct
  static inline void nlmsg_trim(struct sk_buff *skb, const void *mark)
  {
@@ -58417,9 +61327,9 @@ diff -urNp linux-3.0.4/include/net/netlink.h linux-3.0.4/include/net/netlink.h
  }
  
  /**
-diff -urNp linux-3.0.4/include/net/netns/ipv4.h linux-3.0.4/include/net/netns/ipv4.h
---- linux-3.0.4/include/net/netns/ipv4.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/net/netns/ipv4.h       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/net/netns/ipv4.h linux-3.1.3/include/net/netns/ipv4.h
+--- linux-3.1.3/include/net/netns/ipv4.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/net/netns/ipv4.h       2011-11-16 18:39:08.000000000 -0500
 @@ -56,8 +56,8 @@ struct netns_ipv4 {
  
        unsigned int sysctl_ping_group_range[2];
@@ -58431,10 +61341,10 @@ diff -urNp linux-3.0.4/include/net/netns/ipv4.h linux-3.0.4/include/net/netns/ip
  
  #ifdef CONFIG_IP_MROUTE
  #ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES
-diff -urNp linux-3.0.4/include/net/sctp/sctp.h linux-3.0.4/include/net/sctp/sctp.h
---- linux-3.0.4/include/net/sctp/sctp.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/net/sctp/sctp.h        2011-08-23 21:47:56.000000000 -0400
-@@ -315,9 +315,9 @@ do {                                                                       \
+diff -urNp linux-3.1.3/include/net/sctp/sctp.h linux-3.1.3/include/net/sctp/sctp.h
+--- linux-3.1.3/include/net/sctp/sctp.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/net/sctp/sctp.h        2011-11-16 18:39:08.000000000 -0500
+@@ -318,9 +318,9 @@ do {                                                                       \
  
  #else /* SCTP_DEBUG */
  
@@ -58447,10 +61357,10 @@ diff -urNp linux-3.0.4/include/net/sctp/sctp.h linux-3.0.4/include/net/sctp/sctp
  #define SCTP_ENABLE_DEBUG
  #define SCTP_DISABLE_DEBUG
  #define SCTP_ASSERT(expr, str, func)
-diff -urNp linux-3.0.4/include/net/sock.h linux-3.0.4/include/net/sock.h
---- linux-3.0.4/include/net/sock.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/net/sock.h     2011-08-23 21:47:56.000000000 -0400
-@@ -277,7 +277,7 @@ struct sock {
+diff -urNp linux-3.1.3/include/net/sock.h linux-3.1.3/include/net/sock.h
+--- linux-3.1.3/include/net/sock.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/net/sock.h     2011-11-16 18:39:08.000000000 -0500
+@@ -278,7 +278,7 @@ struct sock {
  #ifdef CONFIG_RPS
        __u32                   sk_rxhash;
  #endif
@@ -58459,7 +61369,7 @@ diff -urNp linux-3.0.4/include/net/sock.h linux-3.0.4/include/net/sock.h
        int                     sk_rcvbuf;
  
        struct sk_filter __rcu  *sk_filter;
-@@ -1390,7 +1390,7 @@ static inline void sk_nocaps_add(struct 
+@@ -1391,7 +1391,7 @@ static inline void sk_nocaps_add(struct 
  }
  
  static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb,
@@ -58468,10 +61378,10 @@ diff -urNp linux-3.0.4/include/net/sock.h linux-3.0.4/include/net/sock.h
                                           int copy, int offset)
  {
        if (skb->ip_summed == CHECKSUM_NONE) {
-diff -urNp linux-3.0.4/include/net/tcp.h linux-3.0.4/include/net/tcp.h
---- linux-3.0.4/include/net/tcp.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/net/tcp.h      2011-08-23 21:47:56.000000000 -0400
-@@ -1374,8 +1374,8 @@ enum tcp_seq_states {
+diff -urNp linux-3.1.3/include/net/tcp.h linux-3.1.3/include/net/tcp.h
+--- linux-3.1.3/include/net/tcp.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/net/tcp.h      2011-11-16 18:39:08.000000000 -0500
+@@ -1401,8 +1401,8 @@ enum tcp_seq_states {
  struct tcp_seq_afinfo {
        char                    *name;
        sa_family_t             family;
@@ -58482,9 +61392,9 @@ diff -urNp linux-3.0.4/include/net/tcp.h linux-3.0.4/include/net/tcp.h
  };
  
  struct tcp_iter_state {
-diff -urNp linux-3.0.4/include/net/udp.h linux-3.0.4/include/net/udp.h
---- linux-3.0.4/include/net/udp.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/net/udp.h      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/net/udp.h linux-3.1.3/include/net/udp.h
+--- linux-3.1.3/include/net/udp.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/net/udp.h      2011-11-16 18:39:08.000000000 -0500
 @@ -234,8 +234,8 @@ struct udp_seq_afinfo {
        char                    *name;
        sa_family_t             family;
@@ -58496,9 +61406,9 @@ diff -urNp linux-3.0.4/include/net/udp.h linux-3.0.4/include/net/udp.h
  };
  
  struct udp_iter_state {
-diff -urNp linux-3.0.4/include/net/xfrm.h linux-3.0.4/include/net/xfrm.h
---- linux-3.0.4/include/net/xfrm.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/net/xfrm.h     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/net/xfrm.h linux-3.1.3/include/net/xfrm.h
+--- linux-3.1.3/include/net/xfrm.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/net/xfrm.h     2011-11-16 18:39:08.000000000 -0500
 @@ -505,7 +505,7 @@ struct xfrm_policy {
        struct timer_list       timer;
  
@@ -58508,9 +61418,9 @@ diff -urNp linux-3.0.4/include/net/xfrm.h linux-3.0.4/include/net/xfrm.h
        u32                     priority;
        u32                     index;
        struct xfrm_mark        mark;
-diff -urNp linux-3.0.4/include/rdma/iw_cm.h linux-3.0.4/include/rdma/iw_cm.h
---- linux-3.0.4/include/rdma/iw_cm.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/rdma/iw_cm.h   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/rdma/iw_cm.h linux-3.1.3/include/rdma/iw_cm.h
+--- linux-3.1.3/include/rdma/iw_cm.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/rdma/iw_cm.h   2011-11-16 18:39:08.000000000 -0500
 @@ -120,7 +120,7 @@ struct iw_cm_verbs {
                                         int backlog);
  
@@ -58520,10 +61430,10 @@ diff -urNp linux-3.0.4/include/rdma/iw_cm.h linux-3.0.4/include/rdma/iw_cm.h
  
  /**
   * iw_create_cm_id - Create an IW CM identifier.
-diff -urNp linux-3.0.4/include/scsi/libfc.h linux-3.0.4/include/scsi/libfc.h
---- linux-3.0.4/include/scsi/libfc.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/scsi/libfc.h   2011-08-23 21:47:56.000000000 -0400
-@@ -750,6 +750,7 @@ struct libfc_function_template {
+diff -urNp linux-3.1.3/include/scsi/libfc.h linux-3.1.3/include/scsi/libfc.h
+--- linux-3.1.3/include/scsi/libfc.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/scsi/libfc.h   2011-11-16 18:39:08.000000000 -0500
+@@ -758,6 +758,7 @@ struct libfc_function_template {
         */
        void (*disc_stop_final) (struct fc_lport *);
  };
@@ -58531,7 +61441,7 @@ diff -urNp linux-3.0.4/include/scsi/libfc.h linux-3.0.4/include/scsi/libfc.h
  
  /**
   * struct fc_disc - Discovery context
-@@ -853,7 +854,7 @@ struct fc_lport {
+@@ -861,7 +862,7 @@ struct fc_lport {
        struct fc_vport                *vport;
  
        /* Operational Information */
@@ -58540,9 +61450,9 @@ diff -urNp linux-3.0.4/include/scsi/libfc.h linux-3.0.4/include/scsi/libfc.h
        u8                             link_up;
        u8                             qfull;
        enum fc_lport_state            state;
-diff -urNp linux-3.0.4/include/scsi/scsi_device.h linux-3.0.4/include/scsi/scsi_device.h
---- linux-3.0.4/include/scsi/scsi_device.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/scsi/scsi_device.h     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/scsi/scsi_device.h linux-3.1.3/include/scsi/scsi_device.h
+--- linux-3.1.3/include/scsi/scsi_device.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/scsi/scsi_device.h     2011-11-16 18:39:08.000000000 -0500
 @@ -161,9 +161,9 @@ struct scsi_device {
        unsigned int max_device_blocked; /* what device_blocked counts down from  */
  #define SCSI_DEFAULT_DEVICE_BLOCKED   3
@@ -58556,9 +61466,9 @@ diff -urNp linux-3.0.4/include/scsi/scsi_device.h linux-3.0.4/include/scsi/scsi_
  
        struct device           sdev_gendev,
                                sdev_dev;
-diff -urNp linux-3.0.4/include/scsi/scsi_transport_fc.h linux-3.0.4/include/scsi/scsi_transport_fc.h
---- linux-3.0.4/include/scsi/scsi_transport_fc.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/scsi/scsi_transport_fc.h       2011-08-26 19:49:56.000000000 -0400
+diff -urNp linux-3.1.3/include/scsi/scsi_transport_fc.h linux-3.1.3/include/scsi/scsi_transport_fc.h
+--- linux-3.1.3/include/scsi/scsi_transport_fc.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/scsi/scsi_transport_fc.h       2011-11-16 18:39:08.000000000 -0500
 @@ -711,7 +711,7 @@ struct fc_function_template {
        unsigned long   show_host_system_hostname:1;
  
@@ -58568,9 +61478,9 @@ diff -urNp linux-3.0.4/include/scsi/scsi_transport_fc.h linux-3.0.4/include/scsi
  
  
  /**
-diff -urNp linux-3.0.4/include/sound/ak4xxx-adda.h linux-3.0.4/include/sound/ak4xxx-adda.h
---- linux-3.0.4/include/sound/ak4xxx-adda.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/sound/ak4xxx-adda.h    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/sound/ak4xxx-adda.h linux-3.1.3/include/sound/ak4xxx-adda.h
+--- linux-3.1.3/include/sound/ak4xxx-adda.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/sound/ak4xxx-adda.h    2011-11-16 18:39:08.000000000 -0500
 @@ -35,7 +35,7 @@ struct snd_ak4xxx_ops {
        void (*write)(struct snd_akm4xxx *ak, int chip, unsigned char reg,
                      unsigned char val);
@@ -58580,9 +61490,9 @@ diff -urNp linux-3.0.4/include/sound/ak4xxx-adda.h linux-3.0.4/include/sound/ak4
  
  #define AK4XXX_IMAGE_SIZE     (AK4XXX_MAX_CHIPS * 16) /* 64 bytes */
  
-diff -urNp linux-3.0.4/include/sound/hwdep.h linux-3.0.4/include/sound/hwdep.h
---- linux-3.0.4/include/sound/hwdep.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/sound/hwdep.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/sound/hwdep.h linux-3.1.3/include/sound/hwdep.h
+--- linux-3.1.3/include/sound/hwdep.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/sound/hwdep.h  2011-11-16 18:39:08.000000000 -0500
 @@ -49,7 +49,7 @@ struct snd_hwdep_ops {
                          struct snd_hwdep_dsp_status *status);
        int (*dsp_load)(struct snd_hwdep *hw,
@@ -58592,9 +61502,9 @@ diff -urNp linux-3.0.4/include/sound/hwdep.h linux-3.0.4/include/sound/hwdep.h
  
  struct snd_hwdep {
        struct snd_card *card;
-diff -urNp linux-3.0.4/include/sound/info.h linux-3.0.4/include/sound/info.h
---- linux-3.0.4/include/sound/info.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/sound/info.h   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/sound/info.h linux-3.1.3/include/sound/info.h
+--- linux-3.1.3/include/sound/info.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/sound/info.h   2011-11-16 18:39:08.000000000 -0500
 @@ -44,7 +44,7 @@ struct snd_info_entry_text {
                     struct snd_info_buffer *buffer);
        void (*write)(struct snd_info_entry *entry,
@@ -58604,9 +61514,9 @@ diff -urNp linux-3.0.4/include/sound/info.h linux-3.0.4/include/sound/info.h
  
  struct snd_info_entry_ops {
        int (*open)(struct snd_info_entry *entry,
-diff -urNp linux-3.0.4/include/sound/pcm.h linux-3.0.4/include/sound/pcm.h
---- linux-3.0.4/include/sound/pcm.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/sound/pcm.h    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/sound/pcm.h linux-3.1.3/include/sound/pcm.h
+--- linux-3.1.3/include/sound/pcm.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/sound/pcm.h    2011-11-16 18:39:08.000000000 -0500
 @@ -81,6 +81,7 @@ struct snd_pcm_ops {
        int (*mmap)(struct snd_pcm_substream *substream, struct vm_area_struct *vma);
        int (*ack)(struct snd_pcm_substream *substream);
@@ -58615,9 +61525,9 @@ diff -urNp linux-3.0.4/include/sound/pcm.h linux-3.0.4/include/sound/pcm.h
  
  /*
   *
-diff -urNp linux-3.0.4/include/sound/sb16_csp.h linux-3.0.4/include/sound/sb16_csp.h
---- linux-3.0.4/include/sound/sb16_csp.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/sound/sb16_csp.h       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/sound/sb16_csp.h linux-3.1.3/include/sound/sb16_csp.h
+--- linux-3.1.3/include/sound/sb16_csp.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/sound/sb16_csp.h       2011-11-16 18:39:08.000000000 -0500
 @@ -146,7 +146,7 @@ struct snd_sb_csp_ops {
        int (*csp_start) (struct snd_sb_csp * p, int sample_width, int channels);
        int (*csp_stop) (struct snd_sb_csp * p);
@@ -58627,21 +61537,21 @@ diff -urNp linux-3.0.4/include/sound/sb16_csp.h linux-3.0.4/include/sound/sb16_c
  
  /*
   * CSP private data
-diff -urNp linux-3.0.4/include/sound/soc.h linux-3.0.4/include/sound/soc.h
---- linux-3.0.4/include/sound/soc.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/sound/soc.h    2011-08-26 19:49:56.000000000 -0400
-@@ -636,7 +636,7 @@ struct snd_soc_platform_driver {
-       /* platform stream ops */
-       struct snd_pcm_ops *ops;
+diff -urNp linux-3.1.3/include/sound/soc.h linux-3.1.3/include/sound/soc.h
+--- linux-3.1.3/include/sound/soc.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/sound/soc.h    2011-11-16 18:39:08.000000000 -0500
+@@ -676,7 +676,7 @@ struct snd_soc_platform_driver {
+       /* platform IO - used for platform DAPM */
+       unsigned int (*read)(struct snd_soc_platform *, unsigned int);
+       int (*write)(struct snd_soc_platform *, unsigned int, unsigned int);
 -};
 +} __do_const;
  
  struct snd_soc_platform {
        const char *name;
-diff -urNp linux-3.0.4/include/sound/ymfpci.h linux-3.0.4/include/sound/ymfpci.h
---- linux-3.0.4/include/sound/ymfpci.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/sound/ymfpci.h 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/sound/ymfpci.h linux-3.1.3/include/sound/ymfpci.h
+--- linux-3.1.3/include/sound/ymfpci.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/sound/ymfpci.h 2011-11-16 18:39:08.000000000 -0500
 @@ -358,7 +358,7 @@ struct snd_ymfpci {
        spinlock_t reg_lock;
        spinlock_t voice_lock;
@@ -58651,19 +61561,19 @@ diff -urNp linux-3.0.4/include/sound/ymfpci.h linux-3.0.4/include/sound/ymfpci.h
        struct snd_info_entry *proc_entry;
        const struct firmware *dsp_microcode;
        const struct firmware *controller_microcode;
-diff -urNp linux-3.0.4/include/target/target_core_base.h linux-3.0.4/include/target/target_core_base.h
---- linux-3.0.4/include/target/target_core_base.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/target/target_core_base.h      2011-08-23 21:47:56.000000000 -0400
-@@ -364,7 +364,7 @@ struct t10_reservation_ops {
+diff -urNp linux-3.1.3/include/target/target_core_base.h linux-3.1.3/include/target/target_core_base.h
+--- linux-3.1.3/include/target/target_core_base.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/target/target_core_base.h      2011-11-16 18:39:08.000000000 -0500
+@@ -356,7 +356,7 @@ struct t10_reservation_ops {
        int (*t10_seq_non_holder)(struct se_cmd *, unsigned char *, u32);
        int (*t10_pr_register)(struct se_cmd *);
        int (*t10_pr_clear)(struct se_cmd *);
 -};
 +} __no_const;
  
- struct t10_reservation_template {
+ struct t10_reservation {
        /* Reservation effects all target ports */
-@@ -432,8 +432,8 @@ struct se_transport_task {
+@@ -496,8 +496,8 @@ struct se_cmd {
        atomic_t                t_task_cdbs_left;
        atomic_t                t_task_cdbs_ex_left;
        atomic_t                t_task_cdbs_timeout_left;
@@ -58674,7 +61584,7 @@ diff -urNp linux-3.0.4/include/target/target_core_base.h linux-3.0.4/include/tar
        atomic_t                t_transport_active;
        atomic_t                t_transport_complete;
        atomic_t                t_transport_queue_active;
-@@ -774,7 +774,7 @@ struct se_device {
+@@ -744,7 +744,7 @@ struct se_device {
        atomic_t                active_cmds;
        atomic_t                simple_cmds;
        atomic_t                depth_left;
@@ -58683,9 +61593,9 @@ diff -urNp linux-3.0.4/include/target/target_core_base.h linux-3.0.4/include/tar
        atomic_t                dev_tur_active;
        atomic_t                execute_tasks;
        atomic_t                dev_status_thr_count;
-diff -urNp linux-3.0.4/include/trace/events/irq.h linux-3.0.4/include/trace/events/irq.h
---- linux-3.0.4/include/trace/events/irq.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/trace/events/irq.h     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/trace/events/irq.h linux-3.1.3/include/trace/events/irq.h
+--- linux-3.1.3/include/trace/events/irq.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/trace/events/irq.h     2011-11-16 18:39:08.000000000 -0500
 @@ -36,7 +36,7 @@ struct softirq_action;
   */
  TRACE_EVENT(irq_handler_entry,
@@ -58704,9 +61614,9 @@ diff -urNp linux-3.0.4/include/trace/events/irq.h linux-3.0.4/include/trace/even
  
        TP_ARGS(irq, action, ret),
  
-diff -urNp linux-3.0.4/include/video/udlfb.h linux-3.0.4/include/video/udlfb.h
---- linux-3.0.4/include/video/udlfb.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/video/udlfb.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/video/udlfb.h linux-3.1.3/include/video/udlfb.h
+--- linux-3.1.3/include/video/udlfb.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/video/udlfb.h  2011-11-16 18:39:08.000000000 -0500
 @@ -51,10 +51,10 @@ struct dlfb_data {
        int base8;
        u32 pseudo_palette[256];
@@ -58722,9 +61632,9 @@ diff -urNp linux-3.0.4/include/video/udlfb.h linux-3.0.4/include/video/udlfb.h
  };
  
  #define NR_USB_REQUEST_I2C_SUB_IO 0x02
-diff -urNp linux-3.0.4/include/video/uvesafb.h linux-3.0.4/include/video/uvesafb.h
---- linux-3.0.4/include/video/uvesafb.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/include/video/uvesafb.h        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/include/video/uvesafb.h linux-3.1.3/include/video/uvesafb.h
+--- linux-3.1.3/include/video/uvesafb.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/include/video/uvesafb.h        2011-11-16 18:39:08.000000000 -0500
 @@ -177,6 +177,7 @@ struct uvesafb_par {
        u8 ypan;                        /* 0 - nothing, 1 - ypan, 2 - ywrap */
        u8 pmi_setpal;                  /* PMI for palette changes */
@@ -58733,18 +61643,23 @@ diff -urNp linux-3.0.4/include/video/uvesafb.h linux-3.0.4/include/video/uvesafb
        void *pmi_start;
        void *pmi_pal;
        u8 *vbe_state_orig;             /*
-diff -urNp linux-3.0.4/init/do_mounts.c linux-3.0.4/init/do_mounts.c
---- linux-3.0.4/init/do_mounts.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/init/do_mounts.c       2011-08-23 21:47:56.000000000 -0400
-@@ -287,7 +287,7 @@ static void __init get_fs_names(char *pa
+diff -urNp linux-3.1.3/init/do_mounts.c linux-3.1.3/init/do_mounts.c
+--- linux-3.1.3/init/do_mounts.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/init/do_mounts.c       2011-11-16 18:39:08.000000000 -0500
+@@ -287,11 +287,11 @@ static void __init get_fs_names(char *pa
  
  static int __init do_mount_root(char *name, char *fs, int flags, void *data)
  {
 -      int err = sys_mount(name, "/root", fs, flags, data);
-+      int err = sys_mount((__force char __user *)name, (__force char __user *)"/root", (__force char __user *)fs, flags, (__force void __user *)data);
++      int err = sys_mount((char __force_user *)name, (char __force_user *)"/root", (char __force_user *)fs, flags, (void __force_user *)data);
        if (err)
                return err;
  
+-      sys_chdir((const char __user __force *)"/root");
++      sys_chdir((const char __force_user*)"/root");
+       ROOT_DEV = current->fs->pwd.mnt->mnt_sb->s_dev;
+       printk(KERN_INFO
+              "VFS: Mounted root (%s filesystem)%s on device %u:%u.\n",
 @@ -383,18 +383,18 @@ void __init change_floppy(char *fmt, ...
        va_start(args, fmt);
        vsprintf(buf, fmt, args);
@@ -58772,20 +61687,21 @@ diff -urNp linux-3.0.4/init/do_mounts.c linux-3.0.4/init/do_mounts.c
  out:
        devtmpfs_mount("dev");
 -      sys_mount(".", "/", NULL, MS_MOVE, NULL);
-+      sys_mount((__force char __user *)".", (__force char __user *)"/", NULL, MS_MOVE, NULL);
-       sys_chroot((const char __user __force *)".");
+-      sys_chroot((const char __user __force *)".");
++      sys_mount((char __force_user *)".", (char __force_user *)"/", NULL, MS_MOVE, NULL);
++      sys_chroot((const char __force_user *)".");
  }
-diff -urNp linux-3.0.4/init/do_mounts.h linux-3.0.4/init/do_mounts.h
---- linux-3.0.4/init/do_mounts.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/init/do_mounts.h       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/init/do_mounts.h linux-3.1.3/init/do_mounts.h
+--- linux-3.1.3/init/do_mounts.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/init/do_mounts.h       2011-11-16 18:39:08.000000000 -0500
 @@ -15,15 +15,15 @@ extern int root_mountflags;
  
  static inline int create_dev(char *name, dev_t dev)
  {
 -      sys_unlink(name);
 -      return sys_mknod(name, S_IFBLK|0600, new_encode_dev(dev));
-+      sys_unlink((__force char __user *)name);
-+      return sys_mknod((__force char __user *)name, S_IFBLK|0600, new_encode_dev(dev));
++      sys_unlink((char __force_user *)name);
++      return sys_mknod((char __force_user *)name, S_IFBLK|0600, new_encode_dev(dev));
  }
  
  #if BITS_PER_LONG == 32
@@ -58793,13 +61709,22 @@ diff -urNp linux-3.0.4/init/do_mounts.h linux-3.0.4/init/do_mounts.h
  {
        struct stat64 stat;
 -      if (sys_stat64(name, &stat) != 0)
-+      if (sys_stat64((__force char __user *)name, (__force struct stat64 __user *)&stat) != 0)
++      if (sys_stat64((char __force_user *)name, (struct stat64 __force_user *)&stat) != 0)
+               return 0;
+       if (!S_ISBLK(stat.st_mode))
+               return 0;
+@@ -35,7 +35,7 @@ static inline u32 bstat(char *name)
+ static inline u32 bstat(char *name)
+ {
+       struct stat stat;
+-      if (sys_newstat(name, &stat) != 0)
++      if (sys_newstat((const char __force_user *)name, (struct stat __force_user *)&stat) != 0)
                return 0;
        if (!S_ISBLK(stat.st_mode))
                return 0;
-diff -urNp linux-3.0.4/init/do_mounts_initrd.c linux-3.0.4/init/do_mounts_initrd.c
---- linux-3.0.4/init/do_mounts_initrd.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/init/do_mounts_initrd.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/init/do_mounts_initrd.c linux-3.1.3/init/do_mounts_initrd.c
+--- linux-3.1.3/init/do_mounts_initrd.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/init/do_mounts_initrd.c        2011-11-16 18:39:08.000000000 -0500
 @@ -44,13 +44,13 @@ static void __init handle_initrd(void)
        create_dev("/dev/root.old", Root_RAM0);
        /* mount initrd on rootfs' /root */
@@ -58807,16 +61732,16 @@ diff -urNp linux-3.0.4/init/do_mounts_initrd.c linux-3.0.4/init/do_mounts_initrd
 -      sys_mkdir("/old", 0700);
 -      root_fd = sys_open("/", 0, 0);
 -      old_fd = sys_open("/old", 0, 0);
-+      sys_mkdir((__force const char __user *)"/old", 0700);
-+      root_fd = sys_open((__force const char __user *)"/", 0, 0);
-+      old_fd = sys_open((__force const char __user *)"/old", 0, 0);
++      sys_mkdir((const char __force_user *)"/old", 0700);
++      root_fd = sys_open((const char __force_user *)"/", 0, 0);
++      old_fd = sys_open((const char __force_user *)"/old", 0, 0);
        /* move initrd over / and chdir/chroot in initrd root */
 -      sys_chdir("/root");
 -      sys_mount(".", "/", NULL, MS_MOVE, NULL);
 -      sys_chroot(".");
-+      sys_chdir((__force const char __user *)"/root");
-+      sys_mount((__force char __user *)".", (__force char __user *)"/", NULL, MS_MOVE, NULL);
-+      sys_chroot((__force const char __user *)".");
++      sys_chdir((const char __force_user *)"/root");
++      sys_mount((char __force_user *)".", (char __force_user *)"/", NULL, MS_MOVE, NULL);
++      sys_chroot((const char __force_user *)".");
  
        /*
         * In case that a resume from disk is carried out by linuxrc or one of
@@ -58825,17 +61750,17 @@ diff -urNp linux-3.0.4/init/do_mounts_initrd.c linux-3.0.4/init/do_mounts_initrd
        /* move initrd to rootfs' /old */
        sys_fchdir(old_fd);
 -      sys_mount("/", ".", NULL, MS_MOVE, NULL);
-+      sys_mount((__force char __user *)"/", (__force char __user *)".", NULL, MS_MOVE, NULL);
++      sys_mount((char __force_user *)"/", (char __force_user *)".", NULL, MS_MOVE, NULL);
        /* switch root and cwd back to / of rootfs */
        sys_fchdir(root_fd);
 -      sys_chroot(".");
-+      sys_chroot((__force const char __user *)".");
++      sys_chroot((const char __force_user *)".");
        sys_close(old_fd);
        sys_close(root_fd);
  
        if (new_decode_dev(real_root_dev) == Root_RAM0) {
 -              sys_chdir("/old");
-+              sys_chdir((__force const char __user *)"/old");
++              sys_chdir((const char __force_user *)"/old");
                return;
        }
  
@@ -58844,19 +61769,19 @@ diff -urNp linux-3.0.4/init/do_mounts_initrd.c linux-3.0.4/init/do_mounts_initrd
  
        printk(KERN_NOTICE "Trying to move old root to /initrd ... ");
 -      error = sys_mount("/old", "/root/initrd", NULL, MS_MOVE, NULL);
-+      error = sys_mount((__force char __user *)"/old", (__force char __user *)"/root/initrd", NULL, MS_MOVE, NULL);
++      error = sys_mount((char __force_user *)"/old", (char __force_user *)"/root/initrd", NULL, MS_MOVE, NULL);
        if (!error)
                printk("okay\n");
        else {
 -              int fd = sys_open("/dev/root.old", O_RDWR, 0);
-+              int fd = sys_open((__force const char __user *)"/dev/root.old", O_RDWR, 0);
++              int fd = sys_open((const char __force_user *)"/dev/root.old", O_RDWR, 0);
                if (error == -ENOENT)
                        printk("/initrd does not exist. Ignored.\n");
                else
                        printk("failed\n");
                printk(KERN_NOTICE "Unmounting old root\n");
 -              sys_umount("/old", MNT_DETACH);
-+              sys_umount((__force char __user *)"/old", MNT_DETACH);
++              sys_umount((char __force_user *)"/old", MNT_DETACH);
                printk(KERN_NOTICE "Trying to free ramdisk memory ... ");
                if (fd < 0) {
                        error = fd;
@@ -58865,24 +61790,24 @@ diff -urNp linux-3.0.4/init/do_mounts_initrd.c linux-3.0.4/init/do_mounts_initrd
                 */
                if (rd_load_image("/initrd.image") && ROOT_DEV != Root_RAM0) {
 -                      sys_unlink("/initrd.image");
-+                      sys_unlink((__force const char __user *)"/initrd.image");
++                      sys_unlink((const char __force_user *)"/initrd.image");
                        handle_initrd();
                        return 1;
                }
        }
 -      sys_unlink("/initrd.image");
-+      sys_unlink((__force const char __user *)"/initrd.image");
++      sys_unlink((const char __force_user *)"/initrd.image");
        return 0;
  }
-diff -urNp linux-3.0.4/init/do_mounts_md.c linux-3.0.4/init/do_mounts_md.c
---- linux-3.0.4/init/do_mounts_md.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/init/do_mounts_md.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/init/do_mounts_md.c linux-3.1.3/init/do_mounts_md.c
+--- linux-3.1.3/init/do_mounts_md.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/init/do_mounts_md.c    2011-11-16 18:39:08.000000000 -0500
 @@ -170,7 +170,7 @@ static void __init md_setup_drive(void)
                        partitioned ? "_d" : "", minor,
                        md_setup_args[ent].device_names);
  
 -              fd = sys_open(name, 0, 0);
-+              fd = sys_open((__force char __user *)name, 0, 0);
++              fd = sys_open((char __force_user *)name, 0, 0);
                if (fd < 0) {
                        printk(KERN_ERR "md: open failed - cannot start "
                                        "array %s\n", name);
@@ -58891,13 +61816,22 @@ diff -urNp linux-3.0.4/init/do_mounts_md.c linux-3.0.4/init/do_mounts_md.c
                         */
                        sys_close(fd);
 -                      fd = sys_open(name, 0, 0);
-+                      fd = sys_open((__force char __user *)name, 0, 0);
++                      fd = sys_open((char __force_user *)name, 0, 0);
                        sys_ioctl(fd, BLKRRPART, 0);
                }
                sys_close(fd);
-diff -urNp linux-3.0.4/init/initramfs.c linux-3.0.4/init/initramfs.c
---- linux-3.0.4/init/initramfs.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/init/initramfs.c       2011-08-23 21:47:56.000000000 -0400
+@@ -283,7 +283,7 @@ static void __init autodetect_raid(void)
+       wait_for_device_probe();
+-      fd = sys_open((const char __user __force *) "/dev/md0", 0, 0);
++      fd = sys_open((const char __force_user *) "/dev/md0", 0, 0);
+       if (fd >= 0) {
+               sys_ioctl(fd, RAID_AUTORUN, raid_autopart);
+               sys_close(fd);
+diff -urNp linux-3.1.3/init/initramfs.c linux-3.1.3/init/initramfs.c
+--- linux-3.1.3/init/initramfs.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/init/initramfs.c       2011-11-16 18:39:08.000000000 -0500
 @@ -74,7 +74,7 @@ static void __init free_hash(void)
        }
  }
@@ -58912,7 +61846,7 @@ diff -urNp linux-3.0.4/init/initramfs.c linux-3.0.4/init/initramfs.c
        list_for_each_entry_safe(de, tmp, &dir_list, list) {
                list_del(&de->list);
 -              do_utime(de->name, de->mtime);
-+              do_utime((__force char __user *)de->name, de->mtime);
++              do_utime((char __force_user *)de->name, de->mtime);
                kfree(de->name);
                kfree(de);
        }
@@ -58921,7 +61855,7 @@ diff -urNp linux-3.0.4/init/initramfs.c linux-3.0.4/init/initramfs.c
                char *old = find_link(major, minor, ino, mode, collected);
                if (old)
 -                      return (sys_link(old, collected) < 0) ? -1 : 1;
-+                      return (sys_link((__force char __user *)old, (__force char __user *)collected) < 0) ? -1 : 1;
++                      return (sys_link((char __force_user *)old, (char __force_user *)collected) < 0) ? -1 : 1;
        }
        return 0;
  }
@@ -58930,13 +61864,13 @@ diff -urNp linux-3.0.4/init/initramfs.c linux-3.0.4/init/initramfs.c
        struct stat st;
  
 -      if (!sys_newlstat(path, &st) && (st.st_mode^mode) & S_IFMT) {
-+      if (!sys_newlstat((__force char __user *)path, (__force struct stat __user *)&st) && (st.st_mode^mode) & S_IFMT) {
++      if (!sys_newlstat((char __force_user *)path, (struct stat __force_user *)&st) && (st.st_mode^mode) & S_IFMT) {
                if (S_ISDIR(st.st_mode))
 -                      sys_rmdir(path);
-+                      sys_rmdir((__force char __user *)path);
++                      sys_rmdir((char __force_user *)path);
                else
 -                      sys_unlink(path);
-+                      sys_unlink((__force char __user *)path);
++                      sys_unlink((char __force_user *)path);
        }
  }
  
@@ -58945,7 +61879,7 @@ diff -urNp linux-3.0.4/init/initramfs.c linux-3.0.4/init/initramfs.c
                        if (ml != 1)
                                openflags |= O_TRUNC;
 -                      wfd = sys_open(collected, openflags, mode);
-+                      wfd = sys_open((__force char __user *)collected, openflags, mode);
++                      wfd = sys_open((char __force_user *)collected, openflags, mode);
  
                        if (wfd >= 0) {
                                sys_fchown(wfd, uid, gid);
@@ -58956,9 +61890,9 @@ diff -urNp linux-3.0.4/init/initramfs.c linux-3.0.4/init/initramfs.c
 -              sys_mkdir(collected, mode);
 -              sys_chown(collected, uid, gid);
 -              sys_chmod(collected, mode);
-+              sys_mkdir((__force char __user *)collected, mode);
-+              sys_chown((__force char __user *)collected, uid, gid);
-+              sys_chmod((__force char __user *)collected, mode);
++              sys_mkdir((char __force_user *)collected, mode);
++              sys_chown((char __force_user *)collected, uid, gid);
++              sys_chmod((char __force_user *)collected, mode);
                dir_add(collected, mtime);
        } else if (S_ISBLK(mode) || S_ISCHR(mode) ||
                   S_ISFIFO(mode) || S_ISSOCK(mode)) {
@@ -58967,10 +61901,10 @@ diff -urNp linux-3.0.4/init/initramfs.c linux-3.0.4/init/initramfs.c
 -                      sys_chown(collected, uid, gid);
 -                      sys_chmod(collected, mode);
 -                      do_utime(collected, mtime);
-+                      sys_mknod((__force char __user *)collected, mode, rdev);
-+                      sys_chown((__force char __user *)collected, uid, gid);
-+                      sys_chmod((__force char __user *)collected, mode);
-+                      do_utime((__force char __user *)collected, mtime);
++                      sys_mknod((char __force_user *)collected, mode, rdev);
++                      sys_chown((char __force_user *)collected, uid, gid);
++                      sys_chmod((char __force_user *)collected, mode);
++                      do_utime((char __force_user *)collected, mtime);
                }
        }
        return 0;
@@ -58979,17 +61913,17 @@ diff -urNp linux-3.0.4/init/initramfs.c linux-3.0.4/init/initramfs.c
  {
        if (count >= body_len) {
 -              sys_write(wfd, victim, body_len);
-+              sys_write(wfd, (__force char __user *)victim, body_len);
++              sys_write(wfd, (char __force_user *)victim, body_len);
                sys_close(wfd);
 -              do_utime(vcollected, mtime);
-+              do_utime((__force char __user *)vcollected, mtime);
++              do_utime((char __force_user *)vcollected, mtime);
                kfree(vcollected);
                eat(body_len);
                state = SkipIt;
                return 0;
        } else {
 -              sys_write(wfd, victim, count);
-+              sys_write(wfd, (__force char __user *)victim, count);
++              sys_write(wfd, (char __force_user *)victim, count);
                body_len -= count;
                eat(count);
                return 1;
@@ -59000,16 +61934,16 @@ diff -urNp linux-3.0.4/init/initramfs.c linux-3.0.4/init/initramfs.c
 -      sys_symlink(collected + N_ALIGN(name_len), collected);
 -      sys_lchown(collected, uid, gid);
 -      do_utime(collected, mtime);
-+      sys_symlink((__force char __user *)collected + N_ALIGN(name_len), (__force char __user *)collected);
-+      sys_lchown((__force char __user *)collected, uid, gid);
-+      do_utime((__force char __user *)collected, mtime);
++      sys_symlink((char __force_user *)collected + N_ALIGN(name_len), (char __force_user *)collected);
++      sys_lchown((char __force_user *)collected, uid, gid);
++      do_utime((char __force_user *)collected, mtime);
        state = SkipIt;
        next_state = Reset;
        return 0;
-diff -urNp linux-3.0.4/init/Kconfig linux-3.0.4/init/Kconfig
---- linux-3.0.4/init/Kconfig   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/init/Kconfig   2011-08-23 21:47:56.000000000 -0400
-@@ -1195,7 +1195,7 @@ config SLUB_DEBUG
+diff -urNp linux-3.1.3/init/Kconfig linux-3.1.3/init/Kconfig
+--- linux-3.1.3/init/Kconfig   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/init/Kconfig   2011-11-16 18:39:08.000000000 -0500
+@@ -1202,7 +1202,7 @@ config SLUB_DEBUG
  
  config COMPAT_BRK
        bool "Disable heap randomization"
@@ -59018,9 +61952,9 @@ diff -urNp linux-3.0.4/init/Kconfig linux-3.0.4/init/Kconfig
        help
          Randomizing heap placement makes heap exploits harder, but it
          also breaks ancient binaries (including anything libc5 based).
-diff -urNp linux-3.0.4/init/main.c linux-3.0.4/init/main.c
---- linux-3.0.4/init/main.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/init/main.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/init/main.c linux-3.1.3/init/main.c
+--- linux-3.1.3/init/main.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/init/main.c    2011-11-16 18:40:44.000000000 -0500
 @@ -96,6 +96,8 @@ static inline void mark_rodata_ro(void) 
  extern void tc_init(void);
  #endif
@@ -59080,7 +62014,7 @@ diff -urNp linux-3.0.4/init/main.c linux-3.0.4/init/main.c
  static const char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, };
  const char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, };
  static const char *panic_later, *panic_param;
-@@ -667,6 +712,7 @@ int __init_or_module do_one_initcall(ini
+@@ -678,6 +723,7 @@ int __init_or_module do_one_initcall(ini
  {
        int count = preempt_count();
        int ret;
@@ -59088,7 +62022,7 @@ diff -urNp linux-3.0.4/init/main.c linux-3.0.4/init/main.c
  
        if (initcall_debug)
                ret = do_one_initcall_debug(fn);
-@@ -679,15 +725,15 @@ int __init_or_module do_one_initcall(ini
+@@ -690,15 +736,15 @@ int __init_or_module do_one_initcall(ini
                sprintf(msgbuf, "error code %d ", ret);
  
        if (preempt_count() != count) {
@@ -59108,21 +62042,21 @@ diff -urNp linux-3.0.4/init/main.c linux-3.0.4/init/main.c
        }
  
        return ret;
-@@ -805,7 +851,7 @@ static int __init kernel_init(void * unu
+@@ -817,7 +863,7 @@ static int __init kernel_init(void * unu
        do_basic_setup();
  
        /* Open the /dev/console on the rootfs, this should never fail */
 -      if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
-+      if (sys_open((__force const char __user *) "/dev/console", O_RDWR, 0) < 0)
++      if (sys_open((const char __force_user *) "/dev/console", O_RDWR, 0) < 0)
                printk(KERN_WARNING "Warning: unable to open an initial console.\n");
  
        (void) sys_dup(0);
-@@ -818,11 +864,13 @@ static int __init kernel_init(void * unu
+@@ -830,11 +876,13 @@ static int __init kernel_init(void * unu
        if (!ramdisk_execute_command)
                ramdisk_execute_command = "/init";
  
 -      if (sys_access((const char __user *) ramdisk_execute_command, 0) != 0) {
-+      if (sys_access((__force const char __user *) ramdisk_execute_command, 0) != 0) {
++      if (sys_access((const char __force_user *) ramdisk_execute_command, 0) != 0) {
                ramdisk_execute_command = NULL;
                prepare_namespace();
        }
@@ -59132,20 +62066,20 @@ diff -urNp linux-3.0.4/init/main.c linux-3.0.4/init/main.c
        /*
         * Ok, we have completed the initial bootup, and
         * we're essentially up and running. Get rid of the
-diff -urNp linux-3.0.4/ipc/mqueue.c linux-3.0.4/ipc/mqueue.c
---- linux-3.0.4/ipc/mqueue.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/ipc/mqueue.c   2011-08-23 21:48:14.000000000 -0400
-@@ -154,6 +154,7 @@ static struct inode *mqueue_get_inode(st
-                       mq_bytes = (mq_msg_tblsz +
-                               (info->attr.mq_maxmsg * info->attr.mq_msgsize));
-+                      gr_learn_resource(current, RLIMIT_MSGQUEUE, u->mq_bytes + mq_bytes, 1);
-                       spin_lock(&mq_lock);
-                       if (u->mq_bytes + mq_bytes < u->mq_bytes ||
-                           u->mq_bytes + mq_bytes >
-diff -urNp linux-3.0.4/ipc/msg.c linux-3.0.4/ipc/msg.c
---- linux-3.0.4/ipc/msg.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/ipc/msg.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/ipc/mqueue.c linux-3.1.3/ipc/mqueue.c
+--- linux-3.1.3/ipc/mqueue.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/ipc/mqueue.c   2011-11-16 18:40:44.000000000 -0500
+@@ -156,6 +156,7 @@ static struct inode *mqueue_get_inode(st
+               mq_bytes = (mq_msg_tblsz +
+                       (info->attr.mq_maxmsg * info->attr.mq_msgsize));
++              gr_learn_resource(current, RLIMIT_MSGQUEUE, u->mq_bytes + mq_bytes, 1);
+               spin_lock(&mq_lock);
+               if (u->mq_bytes + mq_bytes < u->mq_bytes ||
+                   u->mq_bytes + mq_bytes > task_rlimit(p, RLIMIT_MSGQUEUE)) {
+diff -urNp linux-3.1.3/ipc/msg.c linux-3.1.3/ipc/msg.c
+--- linux-3.1.3/ipc/msg.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/ipc/msg.c      2011-11-16 18:39:08.000000000 -0500
 @@ -309,18 +309,19 @@ static inline int msg_security(struct ke
        return security_msg_queue_associate(msq, msgflg);
  }
@@ -59171,9 +62105,9 @@ diff -urNp linux-3.0.4/ipc/msg.c linux-3.0.4/ipc/msg.c
        msg_params.key = key;
        msg_params.flg = msgflg;
  
-diff -urNp linux-3.0.4/ipc/sem.c linux-3.0.4/ipc/sem.c
---- linux-3.0.4/ipc/sem.c      2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/ipc/sem.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/ipc/sem.c linux-3.1.3/ipc/sem.c
+--- linux-3.1.3/ipc/sem.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/ipc/sem.c      2011-11-16 18:40:44.000000000 -0500
 @@ -318,10 +318,15 @@ static inline int sem_more_checks(struct
        return 0;
  }
@@ -59202,7 +62136,7 @@ diff -urNp linux-3.0.4/ipc/sem.c linux-3.0.4/ipc/sem.c
        sem_params.key = key;
        sem_params.flg = semflg;
        sem_params.u.nsems = nsems;
-@@ -854,6 +855,8 @@ static int semctl_main(struct ipc_namesp
+@@ -848,6 +849,8 @@ static int semctl_main(struct ipc_namesp
        int nsems;
        struct list_head tasks;
  
@@ -59211,7 +62145,7 @@ diff -urNp linux-3.0.4/ipc/sem.c linux-3.0.4/ipc/sem.c
        sma = sem_lock_check(ns, semid);
        if (IS_ERR(sma))
                return PTR_ERR(sma);
-@@ -1301,6 +1304,8 @@ SYSCALL_DEFINE4(semtimedop, int, semid, 
+@@ -1295,6 +1298,8 @@ SYSCALL_DEFINE4(semtimedop, int, semid, 
        struct ipc_namespace *ns;
        struct list_head tasks;
  
@@ -59220,9 +62154,9 @@ diff -urNp linux-3.0.4/ipc/sem.c linux-3.0.4/ipc/sem.c
        ns = current->nsproxy->ipc_ns;
  
        if (nsops < 1 || semid < 0)
-diff -urNp linux-3.0.4/ipc/shm.c linux-3.0.4/ipc/shm.c
---- linux-3.0.4/ipc/shm.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/ipc/shm.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/ipc/shm.c linux-3.1.3/ipc/shm.c
+--- linux-3.1.3/ipc/shm.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/ipc/shm.c      2011-11-16 18:40:44.000000000 -0500
 @@ -69,6 +69,14 @@ static void shm_destroy (struct ipc_name
  static int sysvipc_shm_proc_show(struct seq_file *s, void *it);
  #endif
@@ -59238,7 +62172,7 @@ diff -urNp linux-3.0.4/ipc/shm.c linux-3.0.4/ipc/shm.c
  void shm_init_ns(struct ipc_namespace *ns)
  {
        ns->shm_ctlmax = SHMMAX;
-@@ -401,6 +409,14 @@ static int newseg(struct ipc_namespace *
+@@ -508,6 +516,14 @@ static int newseg(struct ipc_namespace *
        shp->shm_lprid = 0;
        shp->shm_atim = shp->shm_dtim = 0;
        shp->shm_ctim = get_seconds();
@@ -59253,7 +62187,7 @@ diff -urNp linux-3.0.4/ipc/shm.c linux-3.0.4/ipc/shm.c
        shp->shm_segsz = size;
        shp->shm_nattch = 0;
        shp->shm_file = file;
-@@ -451,18 +467,19 @@ static inline int shm_more_checks(struct
+@@ -559,18 +575,19 @@ static inline int shm_more_checks(struct
        return 0;
  }
  
@@ -59278,7 +62212,7 @@ diff -urNp linux-3.0.4/ipc/shm.c linux-3.0.4/ipc/shm.c
        shm_params.key = key;
        shm_params.flg = shmflg;
        shm_params.u.size = size;
-@@ -762,8 +779,6 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int,
+@@ -870,8 +887,6 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int,
        case SHM_LOCK:
        case SHM_UNLOCK:
        {
@@ -59287,7 +62221,7 @@ diff -urNp linux-3.0.4/ipc/shm.c linux-3.0.4/ipc/shm.c
                lru_add_drain_all();  /* drain pagevecs to lru lists */
  
                shp = shm_lock_check(ns, shmid);
-@@ -896,9 +911,21 @@ long do_shmat(int shmid, char __user *sh
+@@ -1004,9 +1019,21 @@ long do_shmat(int shmid, char __user *sh
        if (err)
                goto out_unlock;
  
@@ -59309,22 +62243,22 @@ diff -urNp linux-3.0.4/ipc/shm.c linux-3.0.4/ipc/shm.c
        size = i_size_read(path.dentry->d_inode);
        shm_unlock(shp);
  
-diff -urNp linux-3.0.4/kernel/acct.c linux-3.0.4/kernel/acct.c
---- linux-3.0.4/kernel/acct.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/acct.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/acct.c linux-3.1.3/kernel/acct.c
+--- linux-3.1.3/kernel/acct.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/acct.c  2011-11-16 18:39:08.000000000 -0500
 @@ -570,7 +570,7 @@ static void do_acct_process(struct bsd_a
         */
        flim = current->signal->rlim[RLIMIT_FSIZE].rlim_cur;
        current->signal->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
 -      file->f_op->write(file, (char *)&ac,
-+      file->f_op->write(file, (__force char __user *)&ac,
++      file->f_op->write(file, (char __force_user *)&ac,
                               sizeof(acct_t), &file->f_pos);
        current->signal->rlim[RLIMIT_FSIZE].rlim_cur = flim;
        set_fs(fs);
-diff -urNp linux-3.0.4/kernel/audit.c linux-3.0.4/kernel/audit.c
---- linux-3.0.4/kernel/audit.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/audit.c 2011-08-23 21:47:56.000000000 -0400
-@@ -112,7 +112,7 @@ u32                audit_sig_sid = 0;
+diff -urNp linux-3.1.3/kernel/audit.c linux-3.1.3/kernel/audit.c
+--- linux-3.1.3/kernel/audit.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/audit.c 2011-11-16 18:39:08.000000000 -0500
+@@ -115,7 +115,7 @@ u32                audit_sig_sid = 0;
     3) suppressed due to audit_rate_limit
     4) suppressed due to audit_backlog_limit
  */
@@ -59333,7 +62267,7 @@ diff -urNp linux-3.0.4/kernel/audit.c linux-3.0.4/kernel/audit.c
  
  /* The netlink socket. */
  static struct sock *audit_sock;
-@@ -234,7 +234,7 @@ void audit_log_lost(const char *message)
+@@ -237,7 +237,7 @@ void audit_log_lost(const char *message)
        unsigned long           now;
        int                     print;
  
@@ -59342,7 +62276,7 @@ diff -urNp linux-3.0.4/kernel/audit.c linux-3.0.4/kernel/audit.c
  
        print = (audit_failure == AUDIT_FAIL_PANIC || !audit_rate_limit);
  
-@@ -253,7 +253,7 @@ void audit_log_lost(const char *message)
+@@ -256,7 +256,7 @@ void audit_log_lost(const char *message)
                        printk(KERN_WARNING
                                "audit: audit_lost=%d audit_rate_limit=%d "
                                "audit_backlog_limit=%d\n",
@@ -59351,7 +62285,7 @@ diff -urNp linux-3.0.4/kernel/audit.c linux-3.0.4/kernel/audit.c
                                audit_rate_limit,
                                audit_backlog_limit);
                audit_panic(message);
-@@ -686,7 +686,7 @@ static int audit_receive_msg(struct sk_b
+@@ -689,7 +689,7 @@ static int audit_receive_msg(struct sk_b
                status_set.pid           = audit_pid;
                status_set.rate_limit    = audit_rate_limit;
                status_set.backlog_limit = audit_backlog_limit;
@@ -59360,9 +62294,9 @@ diff -urNp linux-3.0.4/kernel/audit.c linux-3.0.4/kernel/audit.c
                status_set.backlog       = skb_queue_len(&audit_skb_queue);
                audit_send_reply(NETLINK_CB(skb).pid, seq, AUDIT_GET, 0, 0,
                                 &status_set, sizeof(status_set));
-diff -urNp linux-3.0.4/kernel/auditsc.c linux-3.0.4/kernel/auditsc.c
---- linux-3.0.4/kernel/auditsc.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/auditsc.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/auditsc.c linux-3.1.3/kernel/auditsc.c
+--- linux-3.1.3/kernel/auditsc.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/auditsc.c       2011-11-16 18:39:08.000000000 -0500
 @@ -2118,7 +2118,7 @@ int auditsc_get_stamp(struct audit_conte
  }
  
@@ -59381,9 +62315,9 @@ diff -urNp linux-3.0.4/kernel/auditsc.c linux-3.0.4/kernel/auditsc.c
        struct audit_context *context = task->audit_context;
  
        if (context && context->in_syscall) {
-diff -urNp linux-3.0.4/kernel/capability.c linux-3.0.4/kernel/capability.c
---- linux-3.0.4/kernel/capability.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/capability.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/capability.c linux-3.1.3/kernel/capability.c
+--- linux-3.1.3/kernel/capability.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/capability.c    2011-11-16 18:40:44.000000000 -0500
 @@ -202,6 +202,9 @@ SYSCALL_DEFINE2(capget, cap_user_header_
                 * before modification is attempted and the application
                 * fails.
@@ -59444,10 +62378,10 @@ diff -urNp linux-3.0.4/kernel/capability.c linux-3.0.4/kernel/capability.c
  /**
   * nsown_capable - Check superior capability to one's own user_ns
   * @cap: The capability in question
-diff -urNp linux-3.0.4/kernel/cgroup.c linux-3.0.4/kernel/cgroup.c
---- linux-3.0.4/kernel/cgroup.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/cgroup.c        2011-08-23 21:48:14.000000000 -0400
-@@ -593,6 +593,8 @@ static struct css_set *find_css_set(
+diff -urNp linux-3.1.3/kernel/cgroup.c linux-3.1.3/kernel/cgroup.c
+--- linux-3.1.3/kernel/cgroup.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/cgroup.c        2011-11-16 18:40:44.000000000 -0500
+@@ -595,6 +595,8 @@ static struct css_set *find_css_set(
        struct hlist_head *hhead;
        struct cg_cgroup_link *link;
  
@@ -59456,9 +62390,9 @@ diff -urNp linux-3.0.4/kernel/cgroup.c linux-3.0.4/kernel/cgroup.c
        /* First see if we already have a cgroup group that matches
         * the desired set */
        read_lock(&css_set_lock);
-diff -urNp linux-3.0.4/kernel/compat.c linux-3.0.4/kernel/compat.c
---- linux-3.0.4/kernel/compat.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/compat.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/compat.c linux-3.1.3/kernel/compat.c
+--- linux-3.1.3/kernel/compat.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/compat.c        2011-11-16 18:40:44.000000000 -0500
 @@ -13,6 +13,7 @@
  
  #include <linux/linkage.h>
@@ -59467,9 +62401,166 @@ diff -urNp linux-3.0.4/kernel/compat.c linux-3.0.4/kernel/compat.c
  #include <linux/errno.h>
  #include <linux/time.h>
  #include <linux/signal.h>
-diff -urNp linux-3.0.4/kernel/configs.c linux-3.0.4/kernel/configs.c
---- linux-3.0.4/kernel/configs.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/configs.c       2011-08-23 21:48:14.000000000 -0400
+@@ -167,7 +168,7 @@ static long compat_nanosleep_restart(str
+       mm_segment_t oldfs;
+       long ret;
+-      restart->nanosleep.rmtp = (struct timespec __user *) &rmt;
++      restart->nanosleep.rmtp = (struct timespec __force_user *) &rmt;
+       oldfs = get_fs();
+       set_fs(KERNEL_DS);
+       ret = hrtimer_nanosleep_restart(restart);
+@@ -199,7 +200,7 @@ asmlinkage long compat_sys_nanosleep(str
+       oldfs = get_fs();
+       set_fs(KERNEL_DS);
+       ret = hrtimer_nanosleep(&tu,
+-                              rmtp ? (struct timespec __user *)&rmt : NULL,
++                              rmtp ? (struct timespec __force_user *)&rmt : NULL,
+                               HRTIMER_MODE_REL, CLOCK_MONOTONIC);
+       set_fs(oldfs);
+@@ -308,7 +309,7 @@ asmlinkage long compat_sys_sigpending(co
+       mm_segment_t old_fs = get_fs();
+       set_fs(KERNEL_DS);
+-      ret = sys_sigpending((old_sigset_t __user *) &s);
++      ret = sys_sigpending((old_sigset_t __force_user *) &s);
+       set_fs(old_fs);
+       if (ret == 0)
+               ret = put_user(s, set);
+@@ -331,8 +332,8 @@ asmlinkage long compat_sys_sigprocmask(i
+       old_fs = get_fs();
+       set_fs(KERNEL_DS);
+       ret = sys_sigprocmask(how,
+-                            set ? (old_sigset_t __user *) &s : NULL,
+-                            oset ? (old_sigset_t __user *) &s : NULL);
++                            set ? (old_sigset_t __force_user *) &s : NULL,
++                            oset ? (old_sigset_t __force_user *) &s : NULL);
+       set_fs(old_fs);
+       if (ret == 0)
+               if (oset)
+@@ -369,7 +370,7 @@ asmlinkage long compat_sys_old_getrlimit
+       mm_segment_t old_fs = get_fs();
+       set_fs(KERNEL_DS);
+-      ret = sys_old_getrlimit(resource, &r);
++      ret = sys_old_getrlimit(resource, (struct rlimit __force_user *)&r);
+       set_fs(old_fs);
+       if (!ret) {
+@@ -441,7 +442,7 @@ asmlinkage long compat_sys_getrusage(int
+       mm_segment_t old_fs = get_fs();
+       set_fs(KERNEL_DS);
+-      ret = sys_getrusage(who, (struct rusage __user *) &r);
++      ret = sys_getrusage(who, (struct rusage __force_user *) &r);
+       set_fs(old_fs);
+       if (ret)
+@@ -468,8 +469,8 @@ compat_sys_wait4(compat_pid_t pid, compa
+               set_fs (KERNEL_DS);
+               ret = sys_wait4(pid,
+                               (stat_addr ?
+-                               (unsigned int __user *) &status : NULL),
+-                              options, (struct rusage __user *) &r);
++                               (unsigned int __force_user *) &status : NULL),
++                              options, (struct rusage __force_user *) &r);
+               set_fs (old_fs);
+               if (ret > 0) {
+@@ -494,8 +495,8 @@ asmlinkage long compat_sys_waitid(int wh
+       memset(&info, 0, sizeof(info));
+       set_fs(KERNEL_DS);
+-      ret = sys_waitid(which, pid, (siginfo_t __user *)&info, options,
+-                       uru ? (struct rusage __user *)&ru : NULL);
++      ret = sys_waitid(which, pid, (siginfo_t __force_user *)&info, options,
++                       uru ? (struct rusage __force_user *)&ru : NULL);
+       set_fs(old_fs);
+       if ((ret < 0) || (info.si_signo == 0))
+@@ -625,8 +626,8 @@ long compat_sys_timer_settime(timer_t ti
+       oldfs = get_fs();
+       set_fs(KERNEL_DS);
+       err = sys_timer_settime(timer_id, flags,
+-                              (struct itimerspec __user *) &newts,
+-                              (struct itimerspec __user *) &oldts);
++                              (struct itimerspec __force_user *) &newts,
++                              (struct itimerspec __force_user *) &oldts);
+       set_fs(oldfs);
+       if (!err && old && put_compat_itimerspec(old, &oldts))
+               return -EFAULT;
+@@ -643,7 +644,7 @@ long compat_sys_timer_gettime(timer_t ti
+       oldfs = get_fs();
+       set_fs(KERNEL_DS);
+       err = sys_timer_gettime(timer_id,
+-                              (struct itimerspec __user *) &ts);
++                              (struct itimerspec __force_user *) &ts);
+       set_fs(oldfs);
+       if (!err && put_compat_itimerspec(setting, &ts))
+               return -EFAULT;
+@@ -662,7 +663,7 @@ long compat_sys_clock_settime(clockid_t 
+       oldfs = get_fs();
+       set_fs(KERNEL_DS);
+       err = sys_clock_settime(which_clock,
+-                              (struct timespec __user *) &ts);
++                              (struct timespec __force_user *) &ts);
+       set_fs(oldfs);
+       return err;
+ }
+@@ -677,7 +678,7 @@ long compat_sys_clock_gettime(clockid_t 
+       oldfs = get_fs();
+       set_fs(KERNEL_DS);
+       err = sys_clock_gettime(which_clock,
+-                              (struct timespec __user *) &ts);
++                              (struct timespec __force_user *) &ts);
+       set_fs(oldfs);
+       if (!err && put_compat_timespec(&ts, tp))
+               return -EFAULT;
+@@ -697,7 +698,7 @@ long compat_sys_clock_adjtime(clockid_t 
+       oldfs = get_fs();
+       set_fs(KERNEL_DS);
+-      ret = sys_clock_adjtime(which_clock, (struct timex __user *) &txc);
++      ret = sys_clock_adjtime(which_clock, (struct timex __force_user *) &txc);
+       set_fs(oldfs);
+       err = compat_put_timex(utp, &txc);
+@@ -717,7 +718,7 @@ long compat_sys_clock_getres(clockid_t w
+       oldfs = get_fs();
+       set_fs(KERNEL_DS);
+       err = sys_clock_getres(which_clock,
+-                             (struct timespec __user *) &ts);
++                             (struct timespec __force_user *) &ts);
+       set_fs(oldfs);
+       if (!err && tp && put_compat_timespec(&ts, tp))
+               return -EFAULT;
+@@ -729,9 +730,9 @@ static long compat_clock_nanosleep_resta
+       long err;
+       mm_segment_t oldfs;
+       struct timespec tu;
+-      struct compat_timespec *rmtp = restart->nanosleep.compat_rmtp;
++      struct compat_timespec __user *rmtp = restart->nanosleep.compat_rmtp;
+-      restart->nanosleep.rmtp = (struct timespec __user *) &tu;
++      restart->nanosleep.rmtp = (struct timespec __force_user *) &tu;
+       oldfs = get_fs();
+       set_fs(KERNEL_DS);
+       err = clock_nanosleep_restart(restart);
+@@ -763,8 +764,8 @@ long compat_sys_clock_nanosleep(clockid_
+       oldfs = get_fs();
+       set_fs(KERNEL_DS);
+       err = sys_clock_nanosleep(which_clock, flags,
+-                                (struct timespec __user *) &in,
+-                                (struct timespec __user *) &out);
++                                (struct timespec __force_user *) &in,
++                                (struct timespec __force_user *) &out);
+       set_fs(oldfs);
+       if ((err == -ERESTART_RESTARTBLOCK) && rmtp &&
+diff -urNp linux-3.1.3/kernel/configs.c linux-3.1.3/kernel/configs.c
+--- linux-3.1.3/kernel/configs.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/configs.c       2011-11-16 18:40:44.000000000 -0500
 @@ -74,8 +74,19 @@ static int __init ikconfig_init(void)
        struct proc_dir_entry *entry;
  
@@ -59490,9 +62581,9 @@ diff -urNp linux-3.0.4/kernel/configs.c linux-3.0.4/kernel/configs.c
        if (!entry)
                return -ENOMEM;
  
-diff -urNp linux-3.0.4/kernel/cred.c linux-3.0.4/kernel/cred.c
---- linux-3.0.4/kernel/cred.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/cred.c  2011-08-25 17:23:03.000000000 -0400
+diff -urNp linux-3.1.3/kernel/cred.c linux-3.1.3/kernel/cred.c
+--- linux-3.1.3/kernel/cred.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/cred.c  2011-11-16 18:40:44.000000000 -0500
 @@ -158,6 +158,8 @@ static void put_cred_rcu(struct rcu_head
   */
  void __put_cred(struct cred *cred)
@@ -59574,20 +62665,7 @@ diff -urNp linux-3.0.4/kernel/cred.c linux-3.0.4/kernel/cred.c
        /* dumpability changes */
        if (old->euid != new->euid ||
            old->egid != new->egid ||
-@@ -508,10 +526,8 @@ int commit_creds(struct cred *new)
-               key_fsgid_changed(task);
-       /* do it
--       * - What if a process setreuid()'s and this brings the
--       *   new uid over his NPROC rlimit?  We can check this now
--       *   cheaply with the new uid cache, so if it matters
--       *   we should be checking for it.  -DaveM
-+       * RLIMIT_NPROC limits on user->processes have already been checked
-+       * in set_user().
-        */
-       alter_cred_subscribers(new, 2);
-       if (new->user != old->user)
-@@ -551,6 +567,8 @@ EXPORT_SYMBOL(commit_creds);
+@@ -549,6 +567,8 @@ EXPORT_SYMBOL(commit_creds);
   */
  void abort_creds(struct cred *new)
  {
@@ -59596,7 +62674,7 @@ diff -urNp linux-3.0.4/kernel/cred.c linux-3.0.4/kernel/cred.c
        kdebug("abort_creds(%p{%d,%d})", new,
               atomic_read(&new->usage),
               read_cred_subscribers(new));
-@@ -574,6 +592,8 @@ const struct cred *override_creds(const 
+@@ -572,6 +592,8 @@ const struct cred *override_creds(const 
  {
        const struct cred *old = current->cred;
  
@@ -59605,7 +62683,7 @@ diff -urNp linux-3.0.4/kernel/cred.c linux-3.0.4/kernel/cred.c
        kdebug("override_creds(%p{%d,%d})", new,
               atomic_read(&new->usage),
               read_cred_subscribers(new));
-@@ -603,6 +623,8 @@ void revert_creds(const struct cred *old
+@@ -601,6 +623,8 @@ void revert_creds(const struct cred *old
  {
        const struct cred *override = current->cred;
  
@@ -59614,7 +62692,7 @@ diff -urNp linux-3.0.4/kernel/cred.c linux-3.0.4/kernel/cred.c
        kdebug("revert_creds(%p{%d,%d})", old,
               atomic_read(&old->usage),
               read_cred_subscribers(old));
-@@ -649,6 +671,8 @@ struct cred *prepare_kernel_cred(struct 
+@@ -647,6 +671,8 @@ struct cred *prepare_kernel_cred(struct 
        const struct cred *old;
        struct cred *new;
  
@@ -59623,7 +62701,7 @@ diff -urNp linux-3.0.4/kernel/cred.c linux-3.0.4/kernel/cred.c
        new = kmem_cache_alloc(cred_jar, GFP_KERNEL);
        if (!new)
                return NULL;
-@@ -703,6 +727,8 @@ EXPORT_SYMBOL(prepare_kernel_cred);
+@@ -701,6 +727,8 @@ EXPORT_SYMBOL(prepare_kernel_cred);
   */
  int set_security_override(struct cred *new, u32 secid)
  {
@@ -59632,7 +62710,7 @@ diff -urNp linux-3.0.4/kernel/cred.c linux-3.0.4/kernel/cred.c
        return security_kernel_act_as(new, secid);
  }
  EXPORT_SYMBOL(set_security_override);
-@@ -722,6 +748,8 @@ int set_security_override_from_ctx(struc
+@@ -720,6 +748,8 @@ int set_security_override_from_ctx(struc
        u32 secid;
        int ret;
  
@@ -59641,9 +62719,9 @@ diff -urNp linux-3.0.4/kernel/cred.c linux-3.0.4/kernel/cred.c
        ret = security_secctx_to_secid(secctx, strlen(secctx), &secid);
        if (ret < 0)
                return ret;
-diff -urNp linux-3.0.4/kernel/debug/debug_core.c linux-3.0.4/kernel/debug/debug_core.c
---- linux-3.0.4/kernel/debug/debug_core.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/debug/debug_core.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/debug/debug_core.c linux-3.1.3/kernel/debug/debug_core.c
+--- linux-3.1.3/kernel/debug/debug_core.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/debug/debug_core.c      2011-11-16 18:39:08.000000000 -0500
 @@ -119,7 +119,7 @@ static DEFINE_RAW_SPINLOCK(dbg_slave_loc
   */
  static atomic_t                       masters_in_kgdb;
@@ -59704,9 +62782,9 @@ diff -urNp linux-3.0.4/kernel/debug/debug_core.c linux-3.0.4/kernel/debug/debug_
        tasklet_schedule(&kgdb_tasklet_breakpoint);
  }
  EXPORT_SYMBOL_GPL(kgdb_schedule_breakpoint);
-diff -urNp linux-3.0.4/kernel/debug/kdb/kdb_main.c linux-3.0.4/kernel/debug/kdb/kdb_main.c
---- linux-3.0.4/kernel/debug/kdb/kdb_main.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/debug/kdb/kdb_main.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/debug/kdb/kdb_main.c linux-3.1.3/kernel/debug/kdb/kdb_main.c
+--- linux-3.1.3/kernel/debug/kdb/kdb_main.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/debug/kdb/kdb_main.c    2011-11-16 18:39:08.000000000 -0500
 @@ -1980,7 +1980,7 @@ static int kdb_lsmod(int argc, const cha
        list_for_each_entry(mod, kdb_modules, list) {
  
@@ -59725,10 +62803,10 @@ diff -urNp linux-3.0.4/kernel/debug/kdb/kdb_main.c linux-3.0.4/kernel/debug/kdb/
  
  #ifdef CONFIG_MODULE_UNLOAD
                {
-diff -urNp linux-3.0.4/kernel/events/core.c linux-3.0.4/kernel/events/core.c
---- linux-3.0.4/kernel/events/core.c   2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/kernel/events/core.c   2011-09-14 09:08:05.000000000 -0400
-@@ -170,7 +170,7 @@ int perf_proc_update_handler(struct ctl_
+diff -urNp linux-3.1.3/kernel/events/core.c linux-3.1.3/kernel/events/core.c
+--- linux-3.1.3/kernel/events/core.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/events/core.c   2011-11-16 18:39:08.000000000 -0500
+@@ -172,7 +172,7 @@ int perf_proc_update_handler(struct ctl_
        return 0;
  }
  
@@ -59737,7 +62815,7 @@ diff -urNp linux-3.0.4/kernel/events/core.c linux-3.0.4/kernel/events/core.c
  
  static void cpu_ctx_sched_out(struct perf_cpu_context *cpuctx,
                              enum event_type_t event_type);
-@@ -2488,7 +2488,7 @@ static void __perf_event_read(void *info
+@@ -2535,7 +2535,7 @@ static void __perf_event_read(void *info
  
  static inline u64 perf_event_count(struct perf_event *event)
  {
@@ -59746,7 +62824,7 @@ diff -urNp linux-3.0.4/kernel/events/core.c linux-3.0.4/kernel/events/core.c
  }
  
  static u64 perf_event_read(struct perf_event *event)
-@@ -3023,9 +3023,9 @@ u64 perf_event_read_value(struct perf_ev
+@@ -3060,9 +3060,9 @@ u64 perf_event_read_value(struct perf_ev
        mutex_lock(&event->child_mutex);
        total += perf_event_read(event);
        *enabled += event->total_time_enabled +
@@ -59758,20 +62836,20 @@ diff -urNp linux-3.0.4/kernel/events/core.c linux-3.0.4/kernel/events/core.c
  
        list_for_each_entry(child, &event->child_list, child_list) {
                total += perf_event_read(child);
-@@ -3388,10 +3388,10 @@ void perf_event_update_userpage(struct p
+@@ -3448,10 +3448,10 @@ void perf_event_update_userpage(struct p
                userpg->offset -= local64_read(&event->hw.prev_count);
  
-       userpg->time_enabled = event->total_time_enabled +
+       userpg->time_enabled = enabled +
 -                      atomic64_read(&event->child_total_time_enabled);
 +                      atomic64_read_unchecked(&event->child_total_time_enabled);
  
-       userpg->time_running = event->total_time_running +
+       userpg->time_running = running +
 -                      atomic64_read(&event->child_total_time_running);
 +                      atomic64_read_unchecked(&event->child_total_time_running);
  
        barrier();
        ++userpg->lock;
-@@ -4188,11 +4188,11 @@ static void perf_output_read_one(struct 
+@@ -3822,11 +3822,11 @@ static void perf_output_read_one(struct 
        values[n++] = perf_event_count(event);
        if (read_format & PERF_FORMAT_TOTAL_TIME_ENABLED) {
                values[n++] = enabled +
@@ -59785,7 +62863,7 @@ diff -urNp linux-3.0.4/kernel/events/core.c linux-3.0.4/kernel/events/core.c
        }
        if (read_format & PERF_FORMAT_ID)
                values[n++] = primary_event_id(event);
-@@ -4833,12 +4833,12 @@ static void perf_event_mmap_event(struct
+@@ -4477,12 +4477,12 @@ static void perf_event_mmap_event(struct
                 * need to add enough zero bytes after the string to handle
                 * the 64bit alignment we do later.
                 */
@@ -59800,7 +62878,7 @@ diff -urNp linux-3.0.4/kernel/events/core.c linux-3.0.4/kernel/events/core.c
                if (IS_ERR(name)) {
                        name = strncpy(tmp, "//toolong", sizeof(tmp));
                        goto got_name;
-@@ -6190,7 +6190,7 @@ perf_event_alloc(struct perf_event_attr 
+@@ -5833,7 +5833,7 @@ perf_event_alloc(struct perf_event_attr 
        event->parent           = parent_event;
  
        event->ns               = get_pid_ns(current->nsproxy->pid_ns);
@@ -59809,7 +62887,7 @@ diff -urNp linux-3.0.4/kernel/events/core.c linux-3.0.4/kernel/events/core.c
  
        event->state            = PERF_EVENT_STATE_INACTIVE;
  
-@@ -6713,10 +6713,10 @@ static void sync_child_event(struct perf
+@@ -6355,10 +6355,10 @@ static void sync_child_event(struct perf
        /*
         * Add back the child's count to the parent's count:
         */
@@ -59823,9 +62901,9 @@ diff -urNp linux-3.0.4/kernel/events/core.c linux-3.0.4/kernel/events/core.c
                     &parent_event->child_total_time_running);
  
        /*
-diff -urNp linux-3.0.4/kernel/exit.c linux-3.0.4/kernel/exit.c
---- linux-3.0.4/kernel/exit.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/exit.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/exit.c linux-3.1.3/kernel/exit.c
+--- linux-3.1.3/kernel/exit.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/exit.c  2011-11-16 19:33:48.000000000 -0500
 @@ -57,6 +57,10 @@
  #include <asm/pgtable.h>
  #include <asm/mmu_context.h>
@@ -59837,7 +62915,7 @@ diff -urNp linux-3.0.4/kernel/exit.c linux-3.0.4/kernel/exit.c
  static void exit_mm(struct task_struct * tsk);
  
  static void __unhash_process(struct task_struct *p, bool group_dead)
-@@ -169,6 +173,10 @@ void release_task(struct task_struct * p
+@@ -168,6 +172,10 @@ void release_task(struct task_struct * p
        struct task_struct *leader;
        int zap_leader;
  repeat:
@@ -59845,10 +62923,10 @@ diff -urNp linux-3.0.4/kernel/exit.c linux-3.0.4/kernel/exit.c
 +      gr_del_task_from_ip_table(p);
 +#endif
 +
-       tracehook_prepare_release_task(p);
        /* don't need to get the RCU readlock here - the process is dead and
         * can't be modifying its own credentials. But shut RCU-lockdep up */
-@@ -338,11 +346,22 @@ static void reparent_to_kthreadd(void)
+       rcu_read_lock();
+@@ -324,11 +332,22 @@ static void reparent_to_kthreadd(void)
  {
        write_lock_irq(&tasklist_lock);
  
@@ -59871,7 +62949,7 @@ diff -urNp linux-3.0.4/kernel/exit.c linux-3.0.4/kernel/exit.c
        /* Set the exit signal to SIGCHLD so we signal init on exit */
        current->exit_signal = SIGCHLD;
  
-@@ -394,7 +413,7 @@ int allow_signal(int sig)
+@@ -380,7 +399,7 @@ int allow_signal(int sig)
         * know it'll be handled, so that they don't get converted to
         * SIGKILL or just silently dropped.
         */
@@ -59880,7 +62958,7 @@ diff -urNp linux-3.0.4/kernel/exit.c linux-3.0.4/kernel/exit.c
        recalc_sigpending();
        spin_unlock_irq(&current->sighand->siglock);
        return 0;
-@@ -430,6 +449,17 @@ void daemonize(const char *name, ...)
+@@ -416,6 +435,17 @@ void daemonize(const char *name, ...)
        vsnprintf(current->comm, sizeof(current->comm), name, args);
        va_end(args);
  
@@ -59898,38 +62976,24 @@ diff -urNp linux-3.0.4/kernel/exit.c linux-3.0.4/kernel/exit.c
        /*
         * If we were started as result of loading a module, close all of the
         * user space pages.  We don't need them, and if we didn't close them
-@@ -904,15 +934,8 @@ NORET_TYPE void do_exit(long code)
+@@ -895,6 +925,8 @@ NORET_TYPE void do_exit(long code)
        struct task_struct *tsk = current;
        int group_dead;
  
--      profile_task_exit(tsk);
--
--      WARN_ON(atomic_read(&tsk->fs_excl));
--      WARN_ON(blk_needs_flush_plug(tsk));
--
-       if (unlikely(in_interrupt()))
-               panic("Aiee, killing interrupt handler!");
--      if (unlikely(!tsk->pid))
--              panic("Attempted to kill the idle task!");
++      set_fs(USER_DS);
++
+       profile_task_exit(tsk);
  
-       /*
-        * If do_exit is called because this processes oopsed, it's possible
-@@ -923,6 +946,14 @@ NORET_TYPE void do_exit(long code)
+       WARN_ON(blk_needs_flush_plug(tsk));
+@@ -911,7 +943,6 @@ NORET_TYPE void do_exit(long code)
+        * mm_release()->clear_child_tid() from writing to a user-controlled
+        * kernel address.
         */
-       set_fs(USER_DS);
+-      set_fs(USER_DS);
  
-+      profile_task_exit(tsk);
-+
-+      WARN_ON(atomic_read(&tsk->fs_excl));
-+      WARN_ON(blk_needs_flush_plug(tsk));
-+
-+      if (unlikely(!tsk->pid))
-+              panic("Attempted to kill the idle task!");
-+
-       tracehook_report_exit(&code);
+       ptrace_event(PTRACE_EVENT_EXIT, code);
  
-       validate_creds_for_do_exit(tsk);
-@@ -983,6 +1014,9 @@ NORET_TYPE void do_exit(long code)
+@@ -973,6 +1004,9 @@ NORET_TYPE void do_exit(long code)
        tsk->exit_code = code;
        taskstats_exit(tsk, group_dead);
  
@@ -59939,10 +63003,10 @@ diff -urNp linux-3.0.4/kernel/exit.c linux-3.0.4/kernel/exit.c
        exit_mm(tsk);
  
        if (group_dead)
-diff -urNp linux-3.0.4/kernel/fork.c linux-3.0.4/kernel/fork.c
---- linux-3.0.4/kernel/fork.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/fork.c  2011-08-25 17:23:36.000000000 -0400
-@@ -286,7 +286,7 @@ static struct task_struct *dup_task_stru
+diff -urNp linux-3.1.3/kernel/fork.c linux-3.1.3/kernel/fork.c
+--- linux-3.1.3/kernel/fork.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/fork.c  2011-11-16 19:36:31.000000000 -0500
+@@ -285,7 +285,7 @@ static struct task_struct *dup_task_stru
        *stackend = STACK_END_MAGIC;    /* for overflow detection */
  
  #ifdef CONFIG_CC_STACKPROTECTOR
@@ -59950,8 +63014,8 @@ diff -urNp linux-3.0.4/kernel/fork.c linux-3.0.4/kernel/fork.c
 +      tsk->stack_canary = pax_get_random_long();
  #endif
  
-       /* One for us, one for whoever does the "release_task()" (usually parent) */
-@@ -308,13 +308,77 @@ out:
+       /*
+@@ -309,13 +309,77 @@ out:
  }
  
  #ifdef CONFIG_MMU
@@ -60031,7 +63095,7 @@ diff -urNp linux-3.0.4/kernel/fork.c linux-3.0.4/kernel/fork.c
  
        down_write(&oldmm->mmap_sem);
        flush_cache_dup_mm(oldmm);
-@@ -326,8 +390,8 @@ static int dup_mmap(struct mm_struct *mm
+@@ -327,8 +391,8 @@ static int dup_mmap(struct mm_struct *mm
        mm->locked_vm = 0;
        mm->mmap = NULL;
        mm->mmap_cache = NULL;
@@ -60042,7 +63106,7 @@ diff -urNp linux-3.0.4/kernel/fork.c linux-3.0.4/kernel/fork.c
        mm->map_count = 0;
        cpumask_clear(mm_cpumask(mm));
        mm->mm_rb = RB_ROOT;
-@@ -343,8 +407,6 @@ static int dup_mmap(struct mm_struct *mm
+@@ -344,8 +408,6 @@ static int dup_mmap(struct mm_struct *mm
  
        prev = NULL;
        for (mpnt = oldmm->mmap; mpnt; mpnt = mpnt->vm_next) {
@@ -60051,7 +63115,7 @@ diff -urNp linux-3.0.4/kernel/fork.c linux-3.0.4/kernel/fork.c
                if (mpnt->vm_flags & VM_DONTCOPY) {
                        long pages = vma_pages(mpnt);
                        mm->total_vm -= pages;
-@@ -352,55 +414,13 @@ static int dup_mmap(struct mm_struct *mm
+@@ -353,55 +415,13 @@ static int dup_mmap(struct mm_struct *mm
                                                                -pages);
                        continue;
                }
@@ -60111,7 +63175,7 @@ diff -urNp linux-3.0.4/kernel/fork.c linux-3.0.4/kernel/fork.c
                 * Link in the new vma and copy the page table entries.
                 */
                *pprev = tmp;
-@@ -421,6 +441,31 @@ static int dup_mmap(struct mm_struct *mm
+@@ -422,6 +442,31 @@ static int dup_mmap(struct mm_struct *mm
                if (retval)
                        goto out;
        }
@@ -60143,7 +63207,7 @@ diff -urNp linux-3.0.4/kernel/fork.c linux-3.0.4/kernel/fork.c
        /* a new mm has just been created */
        arch_dup_mmap(oldmm, mm);
        retval = 0;
-@@ -429,14 +474,6 @@ out:
+@@ -430,14 +475,6 @@ out:
        flush_tlb_mm(oldmm);
        up_write(&oldmm->mmap_sem);
        return retval;
@@ -60157,8 +63221,8 @@ diff -urNp linux-3.0.4/kernel/fork.c linux-3.0.4/kernel/fork.c
 -      goto out;
  }
  
- static inline int mm_alloc_pgd(struct mm_struct * mm)
-@@ -836,13 +873,14 @@ static int copy_fs(unsigned long clone_f
+ static inline int mm_alloc_pgd(struct mm_struct *mm)
+@@ -837,13 +874,14 @@ static int copy_fs(unsigned long clone_f
                        spin_unlock(&fs->lock);
                        return -EAGAIN;
                }
@@ -60174,7 +63238,7 @@ diff -urNp linux-3.0.4/kernel/fork.c linux-3.0.4/kernel/fork.c
        return 0;
  }
  
-@@ -1104,12 +1142,16 @@ static struct task_struct *copy_process(
+@@ -1105,6 +1143,9 @@ static struct task_struct *copy_process(
        DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled);
  #endif
        retval = -EAGAIN;
@@ -60183,17 +63247,8 @@ diff -urNp linux-3.0.4/kernel/fork.c linux-3.0.4/kernel/fork.c
 +
        if (atomic_read(&p->real_cred->user->processes) >=
                        task_rlimit(p, RLIMIT_NPROC)) {
--              if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE) &&
--                  p->real_cred->user != INIT_USER)
-+              if (p->real_cred->user != INIT_USER &&
-+                  !capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE))
-                       goto bad_fork_free;
-       }
-+      current->flags &= ~PF_NPROC_EXCEEDED;
-       retval = copy_creds(p, clone_flags);
-       if (retval < 0)
-@@ -1250,6 +1292,8 @@ static struct task_struct *copy_process(
+               if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE) &&
+@@ -1264,6 +1305,8 @@ static struct task_struct *copy_process(
        if (clone_flags & CLONE_THREAD)
                p->tgid = current->tgid;
  
@@ -60202,7 +63257,7 @@ diff -urNp linux-3.0.4/kernel/fork.c linux-3.0.4/kernel/fork.c
        p->set_child_tid = (clone_flags & CLONE_CHILD_SETTID) ? child_tidptr : NULL;
        /*
         * Clear TID on mm_release()?
-@@ -1414,6 +1458,8 @@ bad_fork_cleanup_count:
+@@ -1428,6 +1471,8 @@ bad_fork_cleanup_count:
  bad_fork_free:
        free_task(p);
  fork_out:
@@ -60211,7 +63266,7 @@ diff -urNp linux-3.0.4/kernel/fork.c linux-3.0.4/kernel/fork.c
        return ERR_PTR(retval);
  }
  
-@@ -1502,6 +1548,8 @@ long do_fork(unsigned long clone_flags,
+@@ -1528,6 +1573,8 @@ long do_fork(unsigned long clone_flags,
                if (clone_flags & CLONE_PARENT_SETTID)
                        put_user(nr, parent_tidptr);
  
@@ -60220,7 +63275,7 @@ diff -urNp linux-3.0.4/kernel/fork.c linux-3.0.4/kernel/fork.c
                if (clone_flags & CLONE_VFORK) {
                        p->vfork_done = &vfork;
                        init_completion(&vfork);
-@@ -1610,7 +1658,7 @@ static int unshare_fs(unsigned long unsh
+@@ -1637,7 +1684,7 @@ static int unshare_fs(unsigned long unsh
                return 0;
  
        /* don't need lock here; in the worst case we'll do useless copy */
@@ -60229,7 +63284,7 @@ diff -urNp linux-3.0.4/kernel/fork.c linux-3.0.4/kernel/fork.c
                return 0;
  
        *new_fsp = copy_fs_struct(fs);
-@@ -1697,7 +1745,8 @@ SYSCALL_DEFINE1(unshare, unsigned long, 
+@@ -1726,7 +1773,8 @@ SYSCALL_DEFINE1(unshare, unsigned long, 
                        fs = current->fs;
                        spin_lock(&fs->lock);
                        current->fs = new_fs;
@@ -60239,9 +63294,9 @@ diff -urNp linux-3.0.4/kernel/fork.c linux-3.0.4/kernel/fork.c
                                new_fs = NULL;
                        else
                                new_fs = fs;
-diff -urNp linux-3.0.4/kernel/futex.c linux-3.0.4/kernel/futex.c
---- linux-3.0.4/kernel/futex.c 2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/kernel/futex.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/futex.c linux-3.1.3/kernel/futex.c
+--- linux-3.1.3/kernel/futex.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/futex.c 2011-11-16 18:40:44.000000000 -0500
 @@ -54,6 +54,7 @@
  #include <linux/mount.h>
  #include <linux/pagemap.h>
@@ -60328,10 +63383,10 @@ diff -urNp linux-3.0.4/kernel/futex.c linux-3.0.4/kernel/futex.c
 +      set_fs(oldfs);
  
        for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
-               plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock);
-diff -urNp linux-3.0.4/kernel/futex_compat.c linux-3.0.4/kernel/futex_compat.c
---- linux-3.0.4/kernel/futex_compat.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/futex_compat.c  2011-08-23 21:48:14.000000000 -0400
+               plist_head_init(&futex_queues[i].chain);
+diff -urNp linux-3.1.3/kernel/futex_compat.c linux-3.1.3/kernel/futex_compat.c
+--- linux-3.1.3/kernel/futex_compat.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/futex_compat.c  2011-11-16 18:40:44.000000000 -0500
 @@ -10,6 +10,7 @@
  #include <linux/compat.h>
  #include <linux/nsproxy.h>
@@ -60371,9 +63426,9 @@ diff -urNp linux-3.0.4/kernel/futex_compat.c linux-3.0.4/kernel/futex_compat.c
                head = p->compat_robust_list;
                rcu_read_unlock();
        }
-diff -urNp linux-3.0.4/kernel/gcov/base.c linux-3.0.4/kernel/gcov/base.c
---- linux-3.0.4/kernel/gcov/base.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/gcov/base.c     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/gcov/base.c linux-3.1.3/kernel/gcov/base.c
+--- linux-3.1.3/kernel/gcov/base.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/gcov/base.c     2011-11-16 18:39:08.000000000 -0500
 @@ -102,11 +102,6 @@ void gcov_enable_events(void)
  }
  
@@ -60395,9 +63450,9 @@ diff -urNp linux-3.0.4/kernel/gcov/base.c linux-3.0.4/kernel/gcov/base.c
                        if (prev)
                                prev->next = info->next;
                        else
-diff -urNp linux-3.0.4/kernel/hrtimer.c linux-3.0.4/kernel/hrtimer.c
---- linux-3.0.4/kernel/hrtimer.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/hrtimer.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/hrtimer.c linux-3.1.3/kernel/hrtimer.c
+--- linux-3.1.3/kernel/hrtimer.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/hrtimer.c       2011-11-16 18:39:08.000000000 -0500
 @@ -1391,7 +1391,7 @@ void hrtimer_peek_ahead_timers(void)
        local_irq_restore(flags);
  }
@@ -60407,9 +63462,9 @@ diff -urNp linux-3.0.4/kernel/hrtimer.c linux-3.0.4/kernel/hrtimer.c
  {
        hrtimer_peek_ahead_timers();
  }
-diff -urNp linux-3.0.4/kernel/jump_label.c linux-3.0.4/kernel/jump_label.c
---- linux-3.0.4/kernel/jump_label.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/jump_label.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/jump_label.c linux-3.1.3/kernel/jump_label.c
+--- linux-3.1.3/kernel/jump_label.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/jump_label.c    2011-11-16 18:39:08.000000000 -0500
 @@ -55,7 +55,9 @@ jump_label_sort_entries(struct jump_entr
  
        size = (((unsigned long)stop - (unsigned long)start)
@@ -60433,9 +63488,9 @@ diff -urNp linux-3.0.4/kernel/jump_label.c linux-3.0.4/kernel/jump_label.c
  }
  
  static int
-diff -urNp linux-3.0.4/kernel/kallsyms.c linux-3.0.4/kernel/kallsyms.c
---- linux-3.0.4/kernel/kallsyms.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/kallsyms.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/kallsyms.c linux-3.1.3/kernel/kallsyms.c
+--- linux-3.1.3/kernel/kallsyms.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/kallsyms.c      2011-11-16 18:40:44.000000000 -0500
 @@ -11,6 +11,9 @@
   *      Changed the compression method from stem compression to "table lookup"
   *      compression (see scripts/kallsyms.c for a more complete description)
@@ -60538,9 +63593,22 @@ diff -urNp linux-3.0.4/kernel/kallsyms.c linux-3.0.4/kernel/kallsyms.c
        if (!iter)
                return -ENOMEM;
        reset_iter(iter, 0);
-diff -urNp linux-3.0.4/kernel/kmod.c linux-3.0.4/kernel/kmod.c
---- linux-3.0.4/kernel/kmod.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/kmod.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/kexec.c linux-3.1.3/kernel/kexec.c
+--- linux-3.1.3/kernel/kexec.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/kexec.c 2011-11-16 18:39:08.000000000 -0500
+@@ -1033,7 +1033,8 @@ asmlinkage long compat_sys_kexec_load(un
+                               unsigned long flags)
+ {
+       struct compat_kexec_segment in;
+-      struct kexec_segment out, __user *ksegments;
++      struct kexec_segment out;
++      struct kexec_segment __user *ksegments;
+       unsigned long i, result;
+       /* Don't allow clients that don't understand the native
+diff -urNp linux-3.1.3/kernel/kmod.c linux-3.1.3/kernel/kmod.c
+--- linux-3.1.3/kernel/kmod.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/kmod.c  2011-11-16 18:40:44.000000000 -0500
 @@ -73,13 +73,12 @@ char modprobe_path[KMOD_PATH_LEN] = "/sb
   * If module auto-loading support is disabled then this function
   * becomes a no-operation.
@@ -60589,7 +63657,7 @@ diff -urNp linux-3.0.4/kernel/kmod.c linux-3.0.4/kernel/kmod.c
        /* If modprobe needs a service that is in a module, we get a recursive
         * loop.  Limit the number of running kmod threads to max_threads/2 or
         * MAX_KMOD_CONCURRENT, whichever is the smaller.  A cleaner method
-@@ -131,6 +142,47 @@ int __request_module(bool wait, const ch
+@@ -133,6 +144,47 @@ int __request_module(bool wait, const ch
        atomic_dec(&kmod_concurrent);
        return ret;
  }
@@ -60637,9 +63705,18 @@ diff -urNp linux-3.0.4/kernel/kmod.c linux-3.0.4/kernel/kmod.c
  EXPORT_SYMBOL(__request_module);
  #endif /* CONFIG_MODULES */
  
-diff -urNp linux-3.0.4/kernel/kprobes.c linux-3.0.4/kernel/kprobes.c
---- linux-3.0.4/kernel/kprobes.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/kprobes.c       2011-08-23 21:47:56.000000000 -0400
+@@ -222,7 +274,7 @@ static int wait_for_helper(void *data)
+                *
+                * Thus the __user pointer cast is valid here.
+                */
+-              sys_wait4(pid, (int __user *)&ret, 0, NULL);
++              sys_wait4(pid, (int __force_user *)&ret, 0, NULL);
+               /*
+                * If ret is 0, either ____call_usermodehelper failed and the
+diff -urNp linux-3.1.3/kernel/kprobes.c linux-3.1.3/kernel/kprobes.c
+--- linux-3.1.3/kernel/kprobes.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/kprobes.c       2011-11-16 18:39:08.000000000 -0500
 @@ -185,7 +185,7 @@ static kprobe_opcode_t __kprobes *__get_
         * kernel image and loaded module images reside. This is required
         * so x86_64 can correctly handle the %rip-relative fixups.
@@ -60658,7 +63735,7 @@ diff -urNp linux-3.0.4/kernel/kprobes.c linux-3.0.4/kernel/kprobes.c
                        kfree(kip);
                }
                return 1;
-@@ -1936,7 +1936,7 @@ static int __init init_kprobes(void)
+@@ -1949,7 +1949,7 @@ static int __init init_kprobes(void)
  {
        int i, err = 0;
        unsigned long offset = 0, size = 0;
@@ -60667,7 +63744,7 @@ diff -urNp linux-3.0.4/kernel/kprobes.c linux-3.0.4/kernel/kprobes.c
        const char *symbol_name;
        void *addr;
        struct kprobe_blackpoint *kb;
-@@ -2062,7 +2062,7 @@ static int __kprobes show_kprobe_addr(st
+@@ -2075,7 +2075,7 @@ static int __kprobes show_kprobe_addr(st
        const char *sym = NULL;
        unsigned int i = *(loff_t *) v;
        unsigned long offset = 0;
@@ -60676,9 +63753,9 @@ diff -urNp linux-3.0.4/kernel/kprobes.c linux-3.0.4/kernel/kprobes.c
  
        head = &kprobe_table[i];
        preempt_disable();
-diff -urNp linux-3.0.4/kernel/lockdep.c linux-3.0.4/kernel/lockdep.c
---- linux-3.0.4/kernel/lockdep.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/lockdep.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/lockdep.c linux-3.1.3/kernel/lockdep.c
+--- linux-3.1.3/kernel/lockdep.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/lockdep.c       2011-11-16 18:39:08.000000000 -0500
 @@ -583,6 +583,10 @@ static int static_obj(void *obj)
                      end   = (unsigned long) &_end,
                      addr  = (unsigned long) obj;
@@ -60698,7 +63775,7 @@ diff -urNp linux-3.0.4/kernel/lockdep.c linux-3.0.4/kernel/lockdep.c
                printk("the code is fine but needs lockdep annotation.\n");
                printk("turning off the locking correctness validator.\n");
                dump_stack();
-@@ -2936,7 +2941,7 @@ static int __lock_acquire(struct lockdep
+@@ -2948,7 +2953,7 @@ static int __lock_acquire(struct lockdep
                if (!class)
                        return 0;
        }
@@ -60707,9 +63784,9 @@ diff -urNp linux-3.0.4/kernel/lockdep.c linux-3.0.4/kernel/lockdep.c
        if (very_verbose(class)) {
                printk("\nacquire class [%p] %s", class->key, class->name);
                if (class->name_version > 1)
-diff -urNp linux-3.0.4/kernel/lockdep_proc.c linux-3.0.4/kernel/lockdep_proc.c
---- linux-3.0.4/kernel/lockdep_proc.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/lockdep_proc.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/lockdep_proc.c linux-3.1.3/kernel/lockdep_proc.c
+--- linux-3.1.3/kernel/lockdep_proc.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/lockdep_proc.c  2011-11-16 18:39:08.000000000 -0500
 @@ -39,7 +39,7 @@ static void l_stop(struct seq_file *m, v
  
  static void print_name(struct seq_file *m, struct lock_class *class)
@@ -60719,9 +63796,9 @@ diff -urNp linux-3.0.4/kernel/lockdep_proc.c linux-3.0.4/kernel/lockdep_proc.c
        const char *name = class->name;
  
        if (!name) {
-diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
---- linux-3.0.4/kernel/module.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/module.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/module.c linux-3.1.3/kernel/module.c
+--- linux-3.1.3/kernel/module.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/module.c        2011-11-16 18:40:44.000000000 -0500
 @@ -58,6 +58,7 @@
  #include <linux/jump_label.h>
  #include <linux/pfn.h>
@@ -60767,7 +63844,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
                printk(KERN_WARNING "%s: per-cpu alignment %li > %li\n",
                       mod->name, align, PAGE_SIZE);
                align = PAGE_SIZE;
-@@ -1166,7 +1168,7 @@ resolve_symbol_wait(struct module *mod,
+@@ -1183,7 +1185,7 @@ resolve_symbol_wait(struct module *mod,
   */
  #ifdef CONFIG_SYSFS
  
@@ -60776,7 +63853,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
  static inline bool sect_empty(const Elf_Shdr *sect)
  {
        return !(sect->sh_flags & SHF_ALLOC) || sect->sh_size == 0;
-@@ -1632,21 +1634,21 @@ static void set_section_ro_nx(void *base
+@@ -1649,21 +1651,21 @@ static void set_section_ro_nx(void *base
  
  static void unset_module_core_ro_nx(struct module *mod)
  {
@@ -60806,7 +63883,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
                set_memory_rw);
  }
  
-@@ -1657,14 +1659,14 @@ void set_all_modules_text_rw(void)
+@@ -1674,14 +1676,14 @@ void set_all_modules_text_rw(void)
  
        mutex_lock(&module_mutex);
        list_for_each_entry_rcu(mod, &modules, list) {
@@ -60827,7 +63904,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
                                                set_memory_rw);
                }
        }
-@@ -1678,14 +1680,14 @@ void set_all_modules_text_ro(void)
+@@ -1695,14 +1697,14 @@ void set_all_modules_text_ro(void)
  
        mutex_lock(&module_mutex);
        list_for_each_entry_rcu(mod, &modules, list) {
@@ -60848,7 +63925,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
                                                set_memory_ro);
                }
        }
-@@ -1722,16 +1724,19 @@ static void free_module(struct module *m
+@@ -1748,16 +1750,19 @@ static void free_module(struct module *m
  
        /* This may be NULL, but that's OK */
        unset_module_init_ro_nx(mod);
@@ -60871,7 +63948,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
  
  #ifdef CONFIG_MPU
        update_protections(current->mm);
-@@ -1800,10 +1805,31 @@ static int simplify_symbols(struct modul
+@@ -1826,10 +1831,31 @@ static int simplify_symbols(struct modul
        unsigned int i;
        int ret = 0;
        const struct kernel_symbol *ksym;
@@ -60903,7 +63980,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
                switch (sym[i].st_shndx) {
                case SHN_COMMON:
                        /* We compiled with -fno-common.  These are not
-@@ -1824,7 +1850,9 @@ static int simplify_symbols(struct modul
+@@ -1850,7 +1876,9 @@ static int simplify_symbols(struct modul
                        ksym = resolve_symbol_wait(mod, info, name);
                        /* Ok if resolved.  */
                        if (ksym && !IS_ERR(ksym)) {
@@ -60913,7 +63990,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
                                break;
                        }
  
-@@ -1843,11 +1871,20 @@ static int simplify_symbols(struct modul
+@@ -1869,11 +1897,20 @@ static int simplify_symbols(struct modul
                                secbase = (unsigned long)mod_percpu(mod);
                        else
                                secbase = info->sechdrs[sym[i].st_shndx].sh_addr;
@@ -60934,7 +64011,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
        return ret;
  }
  
-@@ -1931,22 +1968,12 @@ static void layout_sections(struct modul
+@@ -1977,22 +2014,12 @@ static void layout_sections(struct modul
                            || s->sh_entsize != ~0UL
                            || strstarts(sname, ".init"))
                                continue;
@@ -60961,7 +64038,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
        }
  
        DEBUGP("Init section allocation order:\n");
-@@ -1960,23 +1987,13 @@ static void layout_sections(struct modul
+@@ -2006,23 +2033,13 @@ static void layout_sections(struct modul
                            || s->sh_entsize != ~0UL
                            || !strstarts(sname, ".init"))
                                continue;
@@ -60990,7 +64067,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
        }
  }
  
-@@ -2141,7 +2158,7 @@ static void layout_symtab(struct module 
+@@ -2187,7 +2204,7 @@ static void layout_symtab(struct module 
  
        /* Put symbol section at end of init part of module. */
        symsect->sh_flags |= SHF_ALLOC;
@@ -60999,7 +64076,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
                                         info->index.sym) | INIT_OFFSET_MASK;
        DEBUGP("\t%s\n", info->secstrings + symsect->sh_name);
  
-@@ -2158,19 +2175,19 @@ static void layout_symtab(struct module 
+@@ -2204,19 +2221,19 @@ static void layout_symtab(struct module 
                }
  
        /* Append room for core symbols at end of core part. */
@@ -61024,7 +64101,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
  }
  
  static void add_kallsyms(struct module *mod, const struct load_info *info)
-@@ -2186,11 +2203,13 @@ static void add_kallsyms(struct module *
+@@ -2232,11 +2249,13 @@ static void add_kallsyms(struct module *
        /* Make sure we get permanent strtab: don't use info->strtab. */
        mod->strtab = (void *)info->sechdrs[info->index.str].sh_addr;
  
@@ -61039,7 +64116,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
        src = mod->symtab;
        *dst = *src;
        for (ndst = i = 1; i < mod->num_symtab; ++i, ++src) {
-@@ -2203,10 +2222,12 @@ static void add_kallsyms(struct module *
+@@ -2249,10 +2268,12 @@ static void add_kallsyms(struct module *
        }
        mod->core_num_syms = ndst;
  
@@ -61053,8 +64130,8 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
  }
  #else
  static inline void layout_symtab(struct module *mod, struct load_info *info)
-@@ -2235,17 +2256,33 @@ static void dynamic_debug_remove(struct 
-               ddebug_remove_module(debug->modname);
+@@ -2286,17 +2307,33 @@ void * __weak module_alloc(unsigned long
+       return size == 0 ? NULL : vmalloc_exec(size);
  }
  
 -static void *module_alloc_update_bounds(unsigned long size)
@@ -61092,7 +64169,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
                mutex_unlock(&module_mutex);
        }
        return ret;
-@@ -2538,7 +2575,7 @@ static int move_module(struct module *mo
+@@ -2589,7 +2626,7 @@ static int move_module(struct module *mo
        void *ptr;
  
        /* Do the allocs. */
@@ -61101,7 +64178,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
        /*
         * The pointer to this block is stored in the module structure
         * which is inside the block. Just mark it as not being a
-@@ -2548,23 +2585,50 @@ static int move_module(struct module *mo
+@@ -2599,23 +2636,50 @@ static int move_module(struct module *mo
        if (!ptr)
                return -ENOMEM;
  
@@ -61160,7 +64237,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
  
        /* Transfer each section which specifies SHF_ALLOC */
        DEBUGP("final section addresses:\n");
-@@ -2575,16 +2639,45 @@ static int move_module(struct module *mo
+@@ -2626,16 +2690,45 @@ static int move_module(struct module *mo
                if (!(shdr->sh_flags & SHF_ALLOC))
                        continue;
  
@@ -61213,7 +64290,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
                DEBUGP("\t0x%lx %s\n",
                       shdr->sh_addr, info->secstrings + shdr->sh_name);
        }
-@@ -2635,12 +2728,12 @@ static void flush_module_icache(const st
+@@ -2686,12 +2779,12 @@ static void flush_module_icache(const st
         * Do it before processing of module parameters, so the module
         * can provide parameter accessor functions of its own.
         */
@@ -61232,7 +64309,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
  
        set_fs(old_fs);
  }
-@@ -2712,8 +2805,10 @@ static void module_deallocate(struct mod
+@@ -2771,8 +2864,10 @@ static void module_deallocate(struct mod
  {
        kfree(info->strmap);
        percpu_modfree(mod);
@@ -61244,8 +64321,8 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
 +      module_free(mod, mod->module_core_rw);
  }
  
- static int post_relocation(struct module *mod, const struct load_info *info)
-@@ -2770,9 +2865,38 @@ static struct module *load_module(void _
+ int __weak module_finalize(const Elf_Ehdr *hdr,
+@@ -2836,9 +2931,38 @@ static struct module *load_module(void _
        if (err)
                goto free_unload;
  
@@ -61284,7 +64361,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
        /* Fix up syms, so that st_value is a pointer to location. */
        err = simplify_symbols(mod, &info);
        if (err < 0)
-@@ -2788,13 +2912,6 @@ static struct module *load_module(void _
+@@ -2854,13 +2978,6 @@ static struct module *load_module(void _
  
        flush_module_icache(mod);
  
@@ -61298,7 +64375,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
        /* Mark state as coming so strong_try_module_get() ignores us. */
        mod->state = MODULE_STATE_COMING;
  
-@@ -2854,11 +2971,10 @@ static struct module *load_module(void _
+@@ -2920,11 +3037,10 @@ static struct module *load_module(void _
   unlock:
        mutex_unlock(&module_mutex);
        synchronize_sched();
@@ -61311,7 +64388,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
   free_unload:
        module_unload_free(mod);
   free_module:
-@@ -2899,16 +3015,16 @@ SYSCALL_DEFINE3(init_module, void __user
+@@ -2965,16 +3081,16 @@ SYSCALL_DEFINE3(init_module, void __user
                        MODULE_STATE_COMING, mod);
  
        /* Set RO and NX regions for core */
@@ -61336,7 +64413,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
  
        do_mod_ctors(mod);
        /* Start the module */
-@@ -2954,11 +3070,12 @@ SYSCALL_DEFINE3(init_module, void __user
+@@ -3020,11 +3136,12 @@ SYSCALL_DEFINE3(init_module, void __user
        mod->strtab = mod->core_strtab;
  #endif
        unset_module_init_ro_nx(mod);
@@ -61354,7 +64431,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
        mutex_unlock(&module_mutex);
  
        return 0;
-@@ -2989,10 +3106,16 @@ static const char *get_ksymbol(struct mo
+@@ -3055,10 +3172,16 @@ static const char *get_ksymbol(struct mo
        unsigned long nextval;
  
        /* At worse, next value is at end of module */
@@ -61374,7 +64451,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
  
        /* Scan for closest preceding symbol, and next symbol. (ELF
           starts real symbols at 1). */
-@@ -3238,7 +3361,7 @@ static int m_show(struct seq_file *m, vo
+@@ -3304,7 +3427,7 @@ static int m_show(struct seq_file *m, vo
        char buf[8];
  
        seq_printf(m, "%s %u",
@@ -61383,7 +64460,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
        print_unload_info(m, mod);
  
        /* Informative for users. */
-@@ -3247,7 +3370,7 @@ static int m_show(struct seq_file *m, vo
+@@ -3313,7 +3436,7 @@ static int m_show(struct seq_file *m, vo
                   mod->state == MODULE_STATE_COMING ? "Loading":
                   "Live");
        /* Used by oprofile and other similar tools. */
@@ -61392,7 +64469,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
  
        /* Taints info */
        if (mod->taints)
-@@ -3283,7 +3406,17 @@ static const struct file_operations proc
+@@ -3349,7 +3472,17 @@ static const struct file_operations proc
  
  static int __init proc_modules_init(void)
  {
@@ -61410,7 +64487,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
        return 0;
  }
  module_init(proc_modules_init);
-@@ -3342,12 +3475,12 @@ struct module *__module_address(unsigned
+@@ -3408,12 +3541,12 @@ struct module *__module_address(unsigned
  {
        struct module *mod;
  
@@ -61426,7 +64503,7 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
                        return mod;
        return NULL;
  }
-@@ -3381,11 +3514,20 @@ bool is_module_text_address(unsigned lon
+@@ -3447,11 +3580,20 @@ bool is_module_text_address(unsigned lon
   */
  struct module *__module_text_address(unsigned long addr)
  {
@@ -61450,9 +64527,9 @@ diff -urNp linux-3.0.4/kernel/module.c linux-3.0.4/kernel/module.c
                        mod = NULL;
        }
        return mod;
-diff -urNp linux-3.0.4/kernel/mutex.c linux-3.0.4/kernel/mutex.c
---- linux-3.0.4/kernel/mutex.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/mutex.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/mutex.c linux-3.1.3/kernel/mutex.c
+--- linux-3.1.3/kernel/mutex.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/mutex.c 2011-11-16 18:39:08.000000000 -0500
 @@ -198,7 +198,7 @@ __mutex_lock_common(struct mutex *lock, 
        spin_lock_mutex(&lock->wait_lock, flags);
  
@@ -61481,9 +64558,9 @@ diff -urNp linux-3.0.4/kernel/mutex.c linux-3.0.4/kernel/mutex.c
        mutex_set_owner(lock);
  
        /* set it to 0 if there are no waiters left: */
-diff -urNp linux-3.0.4/kernel/mutex-debug.c linux-3.0.4/kernel/mutex-debug.c
---- linux-3.0.4/kernel/mutex-debug.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/mutex-debug.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/mutex-debug.c linux-3.1.3/kernel/mutex-debug.c
+--- linux-3.1.3/kernel/mutex-debug.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/mutex-debug.c   2011-11-16 18:39:08.000000000 -0500
 @@ -49,21 +49,21 @@ void debug_mutex_free_waiter(struct mute
  }
  
@@ -61512,9 +64589,9 @@ diff -urNp linux-3.0.4/kernel/mutex-debug.c linux-3.0.4/kernel/mutex-debug.c
  
        list_del_init(&waiter->list);
        waiter->task = NULL;
-diff -urNp linux-3.0.4/kernel/mutex-debug.h linux-3.0.4/kernel/mutex-debug.h
---- linux-3.0.4/kernel/mutex-debug.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/mutex-debug.h   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/mutex-debug.h linux-3.1.3/kernel/mutex-debug.h
+--- linux-3.1.3/kernel/mutex-debug.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/mutex-debug.h   2011-11-16 18:39:08.000000000 -0500
 @@ -20,9 +20,9 @@ extern void debug_mutex_wake_waiter(stru
  extern void debug_mutex_free_waiter(struct mutex_waiter *waiter);
  extern void debug_mutex_add_waiter(struct mutex *lock,
@@ -61527,9 +64604,9 @@ diff -urNp linux-3.0.4/kernel/mutex-debug.h linux-3.0.4/kernel/mutex-debug.h
  extern void debug_mutex_unlock(struct mutex *lock);
  extern void debug_mutex_init(struct mutex *lock, const char *name,
                             struct lock_class_key *key);
-diff -urNp linux-3.0.4/kernel/padata.c linux-3.0.4/kernel/padata.c
---- linux-3.0.4/kernel/padata.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/padata.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/padata.c linux-3.1.3/kernel/padata.c
+--- linux-3.1.3/kernel/padata.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/padata.c        2011-11-16 18:39:08.000000000 -0500
 @@ -132,10 +132,10 @@ int padata_do_parallel(struct padata_ins
        padata->pd = pd;
        padata->cb_cpu = cb_cpu;
@@ -61553,10 +64630,10 @@ diff -urNp linux-3.0.4/kernel/padata.c linux-3.0.4/kernel/padata.c
        atomic_set(&pd->reorder_objects, 0);
        atomic_set(&pd->refcnt, 0);
        pd->pinst = pinst;
-diff -urNp linux-3.0.4/kernel/panic.c linux-3.0.4/kernel/panic.c
---- linux-3.0.4/kernel/panic.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/panic.c 2011-08-23 21:48:14.000000000 -0400
-@@ -369,7 +369,7 @@ static void warn_slowpath_common(const c
+diff -urNp linux-3.1.3/kernel/panic.c linux-3.1.3/kernel/panic.c
+--- linux-3.1.3/kernel/panic.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/panic.c 2011-11-16 18:40:44.000000000 -0500
+@@ -371,7 +371,7 @@ static void warn_slowpath_common(const c
        const char *board;
  
        printk(KERN_WARNING "------------[ cut here ]------------\n");
@@ -61565,7 +64642,7 @@ diff -urNp linux-3.0.4/kernel/panic.c linux-3.0.4/kernel/panic.c
        board = dmi_get_system_info(DMI_PRODUCT_NAME);
        if (board)
                printk(KERN_WARNING "Hardware name: %s\n", board);
-@@ -424,7 +424,8 @@ EXPORT_SYMBOL(warn_slowpath_null);
+@@ -426,7 +426,8 @@ EXPORT_SYMBOL(warn_slowpath_null);
   */
  void __stack_chk_fail(void)
  {
@@ -61575,9 +64652,9 @@ diff -urNp linux-3.0.4/kernel/panic.c linux-3.0.4/kernel/panic.c
                __builtin_return_address(0));
  }
  EXPORT_SYMBOL(__stack_chk_fail);
-diff -urNp linux-3.0.4/kernel/pid.c linux-3.0.4/kernel/pid.c
---- linux-3.0.4/kernel/pid.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/pid.c   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/pid.c linux-3.1.3/kernel/pid.c
+--- linux-3.1.3/kernel/pid.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/pid.c   2011-11-16 18:40:44.000000000 -0500
 @@ -33,6 +33,7 @@
  #include <linux/rculist.h>
  #include <linux/bootmem.h>
@@ -61595,7 +64672,7 @@ diff -urNp linux-3.0.4/kernel/pid.c linux-3.0.4/kernel/pid.c
  
  int pid_max_min = RESERVED_PIDS + 1;
  int pid_max_max = PID_MAX_LIMIT;
-@@ -419,8 +420,15 @@ EXPORT_SYMBOL(pid_task);
+@@ -418,8 +419,15 @@ EXPORT_SYMBOL(pid_task);
   */
  struct task_struct *find_task_by_pid_ns(pid_t nr, struct pid_namespace *ns)
  {
@@ -61612,7 +64689,7 @@ diff -urNp linux-3.0.4/kernel/pid.c linux-3.0.4/kernel/pid.c
  }
  
  struct task_struct *find_task_by_vpid(pid_t vnr)
-@@ -428,6 +436,12 @@ struct task_struct *find_task_by_vpid(pi
+@@ -427,6 +435,12 @@ struct task_struct *find_task_by_vpid(pi
        return find_task_by_pid_ns(vnr, current->nsproxy->pid_ns);
  }
  
@@ -61625,9 +64702,9 @@ diff -urNp linux-3.0.4/kernel/pid.c linux-3.0.4/kernel/pid.c
  struct pid *get_task_pid(struct task_struct *task, enum pid_type type)
  {
        struct pid *pid;
-diff -urNp linux-3.0.4/kernel/posix-cpu-timers.c linux-3.0.4/kernel/posix-cpu-timers.c
---- linux-3.0.4/kernel/posix-cpu-timers.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/posix-cpu-timers.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/posix-cpu-timers.c linux-3.1.3/kernel/posix-cpu-timers.c
+--- linux-3.1.3/kernel/posix-cpu-timers.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/posix-cpu-timers.c      2011-11-16 18:40:44.000000000 -0500
 @@ -6,6 +6,7 @@
  #include <linux/posix-timers.h>
  #include <linux/errno.h>
@@ -61636,7 +64713,7 @@ diff -urNp linux-3.0.4/kernel/posix-cpu-timers.c linux-3.0.4/kernel/posix-cpu-ti
  #include <asm/uaccess.h>
  #include <linux/kernel_stat.h>
  #include <trace/events/timer.h>
-@@ -1604,14 +1605,14 @@ struct k_clock clock_posix_cpu = {
+@@ -1606,14 +1607,14 @@ struct k_clock clock_posix_cpu = {
  
  static __init int init_posix_cpu_timers(void)
  {
@@ -61653,9 +64730,9 @@ diff -urNp linux-3.0.4/kernel/posix-cpu-timers.c linux-3.0.4/kernel/posix-cpu-ti
                .clock_getres   = thread_cpu_clock_getres,
                .clock_get      = thread_cpu_clock_get,
                .timer_create   = thread_cpu_timer_create,
-diff -urNp linux-3.0.4/kernel/posix-timers.c linux-3.0.4/kernel/posix-timers.c
---- linux-3.0.4/kernel/posix-timers.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/posix-timers.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/posix-timers.c linux-3.1.3/kernel/posix-timers.c
+--- linux-3.1.3/kernel/posix-timers.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/posix-timers.c  2011-11-16 18:40:44.000000000 -0500
 @@ -43,6 +43,7 @@
  #include <linux/idr.h>
  #include <linux/posix-clock.h>
@@ -61759,9 +64836,9 @@ diff -urNp linux-3.0.4/kernel/posix-timers.c linux-3.0.4/kernel/posix-timers.c
        return kc->clock_set(which_clock, &new_tp);
  }
  
-diff -urNp linux-3.0.4/kernel/power/poweroff.c linux-3.0.4/kernel/power/poweroff.c
---- linux-3.0.4/kernel/power/poweroff.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/power/poweroff.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/power/poweroff.c linux-3.1.3/kernel/power/poweroff.c
+--- linux-3.1.3/kernel/power/poweroff.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/power/poweroff.c        2011-11-16 18:39:08.000000000 -0500
 @@ -37,7 +37,7 @@ static struct sysrq_key_op   sysrq_powerof
        .enable_mask    = SYSRQ_ENABLE_BOOT,
  };
@@ -61771,9 +64848,9 @@ diff -urNp linux-3.0.4/kernel/power/poweroff.c linux-3.0.4/kernel/power/poweroff
  {
        register_sysrq_key('o', &sysrq_poweroff_op);
        return 0;
-diff -urNp linux-3.0.4/kernel/power/process.c linux-3.0.4/kernel/power/process.c
---- linux-3.0.4/kernel/power/process.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/power/process.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/power/process.c linux-3.1.3/kernel/power/process.c
+--- linux-3.1.3/kernel/power/process.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/power/process.c 2011-11-16 18:39:08.000000000 -0500
 @@ -41,6 +41,7 @@ static int try_to_freeze_tasks(bool sig_
        u64 elapsed_csecs64;
        unsigned int elapsed_csecs;
@@ -61816,10 +64893,10 @@ diff -urNp linux-3.0.4/kernel/power/process.c linux-3.0.4/kernel/power/process.c
                        break;
  
                if (pm_wakeup_pending()) {
-diff -urNp linux-3.0.4/kernel/printk.c linux-3.0.4/kernel/printk.c
---- linux-3.0.4/kernel/printk.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/printk.c        2011-08-23 21:48:14.000000000 -0400
-@@ -313,12 +313,17 @@ static int check_syslog_permissions(int 
+diff -urNp linux-3.1.3/kernel/printk.c linux-3.1.3/kernel/printk.c
+--- linux-3.1.3/kernel/printk.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/printk.c        2011-11-16 19:38:11.000000000 -0500
+@@ -313,6 +313,11 @@ static int check_syslog_permissions(int 
        if (from_file && type != SYSLOG_ACTION_OPEN)
                return 0;
  
@@ -61831,16 +64908,9 @@ diff -urNp linux-3.0.4/kernel/printk.c linux-3.0.4/kernel/printk.c
        if (syslog_action_restricted(type)) {
                if (capable(CAP_SYSLOG))
                        return 0;
-               /* For historical reasons, accept CAP_SYS_ADMIN too, with a warning */
-               if (capable(CAP_SYS_ADMIN)) {
--                      WARN_ONCE(1, "Attempt to access syslog with CAP_SYS_ADMIN "
-+                      printk_once(KERN_WARNING "Attempt to access syslog with CAP_SYS_ADMIN "
-                                "but no CAP_SYSLOG (deprecated).\n");
-                       return 0;
-               }
-diff -urNp linux-3.0.4/kernel/profile.c linux-3.0.4/kernel/profile.c
---- linux-3.0.4/kernel/profile.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/profile.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/profile.c linux-3.1.3/kernel/profile.c
+--- linux-3.1.3/kernel/profile.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/profile.c       2011-11-16 18:39:08.000000000 -0500
 @@ -39,7 +39,7 @@ struct profile_hit {
  /* Oprofile timer tick hook */
  static int (*timer_hook)(struct pt_regs *) __read_mostly;
@@ -61898,10 +64968,10 @@ diff -urNp linux-3.0.4/kernel/profile.c linux-3.0.4/kernel/profile.c
        return count;
  }
  
-diff -urNp linux-3.0.4/kernel/ptrace.c linux-3.0.4/kernel/ptrace.c
---- linux-3.0.4/kernel/ptrace.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/ptrace.c        2011-08-23 21:48:14.000000000 -0400
-@@ -132,7 +132,8 @@ int ptrace_check_attach(struct task_stru
+diff -urNp linux-3.1.3/kernel/ptrace.c linux-3.1.3/kernel/ptrace.c
+--- linux-3.1.3/kernel/ptrace.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/ptrace.c        2011-11-16 19:50:22.000000000 -0500
+@@ -161,7 +161,8 @@ int ptrace_check_attach(struct task_stru
        return ret;
  }
  
@@ -61911,7 +64981,7 @@ diff -urNp linux-3.0.4/kernel/ptrace.c linux-3.0.4/kernel/ptrace.c
  {
        const struct cred *cred = current_cred(), *tcred;
  
-@@ -158,7 +159,8 @@ int __ptrace_may_access(struct task_stru
+@@ -187,7 +188,8 @@ int __ptrace_may_access(struct task_stru
             cred->gid == tcred->sgid &&
             cred->gid == tcred->gid))
                goto ok;
@@ -61921,7 +64991,7 @@ diff -urNp linux-3.0.4/kernel/ptrace.c linux-3.0.4/kernel/ptrace.c
                goto ok;
        rcu_read_unlock();
        return -EPERM;
-@@ -167,7 +169,9 @@ ok:
+@@ -196,7 +198,9 @@ ok:
        smp_rmb();
        if (task->mm)
                dumpable = get_dumpable(task->mm);
@@ -61932,7 +65002,7 @@ diff -urNp linux-3.0.4/kernel/ptrace.c linux-3.0.4/kernel/ptrace.c
                return -EPERM;
  
        return security_ptrace_access_check(task, mode);
-@@ -177,7 +181,16 @@ bool ptrace_may_access(struct task_struc
+@@ -206,7 +210,16 @@ bool ptrace_may_access(struct task_struc
  {
        int err;
        task_lock(task);
@@ -61950,7 +65020,7 @@ diff -urNp linux-3.0.4/kernel/ptrace.c linux-3.0.4/kernel/ptrace.c
        task_unlock(task);
        return !err;
  }
-@@ -205,7 +218,7 @@ static int ptrace_attach(struct task_str
+@@ -251,7 +264,7 @@ static int ptrace_attach(struct task_str
                goto out;
  
        task_lock(task);
@@ -61959,16 +65029,16 @@ diff -urNp linux-3.0.4/kernel/ptrace.c linux-3.0.4/kernel/ptrace.c
        task_unlock(task);
        if (retval)
                goto unlock_creds;
-@@ -218,7 +231,7 @@ static int ptrace_attach(struct task_str
-               goto unlock_tasklist;
+@@ -266,7 +279,7 @@ static int ptrace_attach(struct task_str
        task->ptrace = PT_PTRACED;
+       if (seize)
+               task->ptrace |= PT_SEIZED;
 -      if (task_ns_capable(task, CAP_SYS_PTRACE))
 +      if (task_ns_capable_nolog(task, CAP_SYS_PTRACE))
                task->ptrace |= PT_PTRACE_CAP;
  
        __ptrace_link(task, current);
-@@ -406,6 +419,8 @@ int ptrace_readdata(struct task_struct *
+@@ -461,6 +474,8 @@ int ptrace_readdata(struct task_struct *
  {
        int copied = 0;
  
@@ -61977,7 +65047,7 @@ diff -urNp linux-3.0.4/kernel/ptrace.c linux-3.0.4/kernel/ptrace.c
        while (len > 0) {
                char buf[128];
                int this_len, retval;
-@@ -417,7 +432,7 @@ int ptrace_readdata(struct task_struct *
+@@ -472,7 +487,7 @@ int ptrace_readdata(struct task_struct *
                                break;
                        return -EIO;
                }
@@ -61986,7 +65056,7 @@ diff -urNp linux-3.0.4/kernel/ptrace.c linux-3.0.4/kernel/ptrace.c
                        return -EFAULT;
                copied += retval;
                src += retval;
-@@ -431,6 +446,8 @@ int ptrace_writedata(struct task_struct 
+@@ -486,6 +501,8 @@ int ptrace_writedata(struct task_struct 
  {
        int copied = 0;
  
@@ -61995,20 +65065,21 @@ diff -urNp linux-3.0.4/kernel/ptrace.c linux-3.0.4/kernel/ptrace.c
        while (len > 0) {
                char buf[128];
                int this_len, retval;
-@@ -613,9 +630,11 @@ int ptrace_request(struct task_struct *c
- {
+@@ -669,10 +686,12 @@ int ptrace_request(struct task_struct *c
+       bool seized = child->ptrace & PT_SEIZED;
        int ret = -EIO;
-       siginfo_t siginfo;
+       siginfo_t siginfo, *si;
 -      void __user *datavp = (void __user *) data;
 +      void __user *datavp = (__force void __user *) data;
        unsigned long __user *datalp = datavp;
+       unsigned long flags;
  
 +      pax_track_stack();
 +
        switch (request) {
        case PTRACE_PEEKTEXT:
        case PTRACE_PEEKDATA:
-@@ -761,14 +780,21 @@ SYSCALL_DEFINE4(ptrace, long, request, l
+@@ -871,14 +890,21 @@ SYSCALL_DEFINE4(ptrace, long, request, l
                goto out;
        }
  
@@ -62017,8 +65088,8 @@ diff -urNp linux-3.0.4/kernel/ptrace.c linux-3.0.4/kernel/ptrace.c
 +              goto out_put_task_struct;
 +      }
 +
-       if (request == PTRACE_ATTACH) {
-               ret = ptrace_attach(child);
+       if (request == PTRACE_ATTACH || request == PTRACE_SEIZE) {
+               ret = ptrace_attach(child, request, data);
                /*
                 * Some architectures need to do book-keeping after
                 * a ptrace attach.
@@ -62031,7 +65102,7 @@ diff -urNp linux-3.0.4/kernel/ptrace.c linux-3.0.4/kernel/ptrace.c
                goto out_put_task_struct;
        }
  
-@@ -793,7 +819,7 @@ int generic_ptrace_peekdata(struct task_
+@@ -904,7 +930,7 @@ int generic_ptrace_peekdata(struct task_
        copied = access_process_vm(tsk, addr, &tmp, sizeof(tmp), 0);
        if (copied != sizeof(tmp))
                return -EIO;
@@ -62040,7 +65111,7 @@ diff -urNp linux-3.0.4/kernel/ptrace.c linux-3.0.4/kernel/ptrace.c
  }
  
  int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr,
-@@ -816,6 +842,8 @@ int compat_ptrace_request(struct task_st
+@@ -927,6 +953,8 @@ int compat_ptrace_request(struct task_st
        siginfo_t siginfo;
        int ret;
  
@@ -62049,7 +65120,7 @@ diff -urNp linux-3.0.4/kernel/ptrace.c linux-3.0.4/kernel/ptrace.c
        switch (request) {
        case PTRACE_PEEKTEXT:
        case PTRACE_PEEKDATA:
-@@ -903,14 +931,21 @@ asmlinkage long compat_sys_ptrace(compat
+@@ -1014,14 +1042,21 @@ asmlinkage long compat_sys_ptrace(compat
                goto out;
        }
  
@@ -62058,8 +65129,8 @@ diff -urNp linux-3.0.4/kernel/ptrace.c linux-3.0.4/kernel/ptrace.c
 +              goto out_put_task_struct;
 +      }
 +
-       if (request == PTRACE_ATTACH) {
-               ret = ptrace_attach(child);
+       if (request == PTRACE_ATTACH || request == PTRACE_SEIZE) {
+               ret = ptrace_attach(child, request, data);
                /*
                 * Some architectures need to do book-keeping after
                 * a ptrace attach.
@@ -62072,9 +65143,9 @@ diff -urNp linux-3.0.4/kernel/ptrace.c linux-3.0.4/kernel/ptrace.c
                goto out_put_task_struct;
        }
  
-diff -urNp linux-3.0.4/kernel/rcutorture.c linux-3.0.4/kernel/rcutorture.c
---- linux-3.0.4/kernel/rcutorture.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/rcutorture.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/rcutorture.c linux-3.1.3/kernel/rcutorture.c
+--- linux-3.1.3/kernel/rcutorture.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/rcutorture.c    2011-11-16 18:39:08.000000000 -0500
 @@ -138,12 +138,12 @@ static DEFINE_PER_CPU(long [RCU_TORTURE_
        { 0 };
  static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_batch) =
@@ -62144,7 +65215,7 @@ diff -urNp linux-3.0.4/kernel/rcutorture.c linux-3.0.4/kernel/rcutorture.c
                        old_rp->rtort_pipe_count++;
                        cur_ops->deferred_free(old_rp);
                }
-@@ -951,7 +951,7 @@ static void rcu_torture_timer(unsigned l
+@@ -950,7 +950,7 @@ static void rcu_torture_timer(unsigned l
                return;
        }
        if (p->rtort_mbtest == 0)
@@ -62153,7 +65224,7 @@ diff -urNp linux-3.0.4/kernel/rcutorture.c linux-3.0.4/kernel/rcutorture.c
        spin_lock(&rand_lock);
        cur_ops->read_delay(&rand);
        n_rcu_torture_timers++;
-@@ -1013,7 +1013,7 @@ rcu_torture_reader(void *arg)
+@@ -1011,7 +1011,7 @@ rcu_torture_reader(void *arg)
                        continue;
                }
                if (p->rtort_mbtest == 0)
@@ -62162,7 +65233,7 @@ diff -urNp linux-3.0.4/kernel/rcutorture.c linux-3.0.4/kernel/rcutorture.c
                cur_ops->read_delay(&rand);
                preempt_disable();
                pipe_count = p->rtort_pipe_count;
-@@ -1072,16 +1072,16 @@ rcu_torture_printk(char *page)
+@@ -1070,16 +1070,16 @@ rcu_torture_printk(char *page)
                       rcu_torture_current,
                       rcu_torture_current_version,
                       list_empty(&rcu_torture_freelist),
@@ -62184,7 +65255,7 @@ diff -urNp linux-3.0.4/kernel/rcutorture.c linux-3.0.4/kernel/rcutorture.c
            n_rcu_torture_boost_ktrerror != 0 ||
            n_rcu_torture_boost_rterror != 0 ||
            n_rcu_torture_boost_failure != 0)
-@@ -1089,7 +1089,7 @@ rcu_torture_printk(char *page)
+@@ -1087,7 +1087,7 @@ rcu_torture_printk(char *page)
        cnt += sprintf(&page[cnt], "\n%s%s ", torture_type, TORTURE_FLAG);
        if (i > 1) {
                cnt += sprintf(&page[cnt], "!!! ");
@@ -62193,7 +65264,7 @@ diff -urNp linux-3.0.4/kernel/rcutorture.c linux-3.0.4/kernel/rcutorture.c
                WARN_ON_ONCE(1);
        }
        cnt += sprintf(&page[cnt], "Reader Pipe: ");
-@@ -1103,7 +1103,7 @@ rcu_torture_printk(char *page)
+@@ -1101,7 +1101,7 @@ rcu_torture_printk(char *page)
        cnt += sprintf(&page[cnt], "Free-Block Circulation: ");
        for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) {
                cnt += sprintf(&page[cnt], " %d",
@@ -62202,7 +65273,7 @@ diff -urNp linux-3.0.4/kernel/rcutorture.c linux-3.0.4/kernel/rcutorture.c
        }
        cnt += sprintf(&page[cnt], "\n");
        if (cur_ops->stats)
-@@ -1412,7 +1412,7 @@ rcu_torture_cleanup(void)
+@@ -1410,7 +1410,7 @@ rcu_torture_cleanup(void)
  
        if (cur_ops->cleanup)
                cur_ops->cleanup();
@@ -62211,7 +65282,7 @@ diff -urNp linux-3.0.4/kernel/rcutorture.c linux-3.0.4/kernel/rcutorture.c
                rcu_torture_print_module_parms(cur_ops, "End of test: FAILURE");
        else
                rcu_torture_print_module_parms(cur_ops, "End of test: SUCCESS");
-@@ -1476,17 +1476,17 @@ rcu_torture_init(void)
+@@ -1474,17 +1474,17 @@ rcu_torture_init(void)
  
        rcu_torture_current = NULL;
        rcu_torture_current_version = 0;
@@ -62235,9 +65306,9 @@ diff -urNp linux-3.0.4/kernel/rcutorture.c linux-3.0.4/kernel/rcutorture.c
        for_each_possible_cpu(cpu) {
                for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) {
                        per_cpu(rcu_torture_count, cpu)[i] = 0;
-diff -urNp linux-3.0.4/kernel/rcutree.c linux-3.0.4/kernel/rcutree.c
---- linux-3.0.4/kernel/rcutree.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/rcutree.c       2011-09-14 09:08:05.000000000 -0400
+diff -urNp linux-3.1.3/kernel/rcutree.c linux-3.1.3/kernel/rcutree.c
+--- linux-3.1.3/kernel/rcutree.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/rcutree.c       2011-11-16 18:39:08.000000000 -0500
 @@ -356,9 +356,9 @@ void rcu_enter_nohz(void)
        }
        /* CPUs seeing atomic_inc() must see prior RCU read-side crit sects */
@@ -62320,9 +65391,9 @@ diff -urNp linux-3.0.4/kernel/rcutree.c linux-3.0.4/kernel/rcutree.c
  {
        __rcu_process_callbacks(&rcu_sched_state,
                                &__get_cpu_var(rcu_sched_data));
-diff -urNp linux-3.0.4/kernel/rcutree.h linux-3.0.4/kernel/rcutree.h
---- linux-3.0.4/kernel/rcutree.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/rcutree.h       2011-09-14 09:08:05.000000000 -0400
+diff -urNp linux-3.1.3/kernel/rcutree.h linux-3.1.3/kernel/rcutree.h
+--- linux-3.1.3/kernel/rcutree.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/rcutree.h       2011-11-16 18:39:08.000000000 -0500
 @@ -86,7 +86,7 @@
  struct rcu_dynticks {
        int dynticks_nesting;   /* Track irq/process nesting level. */
@@ -62332,9 +65403,9 @@ diff -urNp linux-3.0.4/kernel/rcutree.h linux-3.0.4/kernel/rcutree.h
  };
  
  /* RCU's kthread states for tracing. */
-diff -urNp linux-3.0.4/kernel/rcutree_plugin.h linux-3.0.4/kernel/rcutree_plugin.h
---- linux-3.0.4/kernel/rcutree_plugin.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/rcutree_plugin.h        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/rcutree_plugin.h linux-3.1.3/kernel/rcutree_plugin.h
+--- linux-3.1.3/kernel/rcutree_plugin.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/rcutree_plugin.h        2011-11-16 18:39:08.000000000 -0500
 @@ -822,7 +822,7 @@ void synchronize_rcu_expedited(void)
  
        /* Clean up and exit. */
@@ -62397,9 +65468,9 @@ diff -urNp linux-3.0.4/kernel/rcutree_plugin.h linux-3.0.4/kernel/rcutree_plugin
  
        put_online_cpus();
  }
-diff -urNp linux-3.0.4/kernel/relay.c linux-3.0.4/kernel/relay.c
---- linux-3.0.4/kernel/relay.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/relay.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/relay.c linux-3.1.3/kernel/relay.c
+--- linux-3.1.3/kernel/relay.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/relay.c 2011-11-16 18:40:44.000000000 -0500
 @@ -1236,6 +1236,8 @@ static ssize_t subbuf_splice_actor(struc
        };
        ssize_t ret;
@@ -62409,9 +65480,9 @@ diff -urNp linux-3.0.4/kernel/relay.c linux-3.0.4/kernel/relay.c
        if (rbuf->subbufs_produced == rbuf->subbufs_consumed)
                return 0;
        if (splice_grow_spd(pipe, &spd))
-diff -urNp linux-3.0.4/kernel/resource.c linux-3.0.4/kernel/resource.c
---- linux-3.0.4/kernel/resource.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/resource.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/resource.c linux-3.1.3/kernel/resource.c
+--- linux-3.1.3/kernel/resource.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/resource.c      2011-11-16 18:40:44.000000000 -0500
 @@ -141,8 +141,18 @@ static const struct file_operations proc
  
  static int __init ioresources_init(void)
@@ -62431,9 +65502,9 @@ diff -urNp linux-3.0.4/kernel/resource.c linux-3.0.4/kernel/resource.c
        return 0;
  }
  __initcall(ioresources_init);
-diff -urNp linux-3.0.4/kernel/rtmutex-tester.c linux-3.0.4/kernel/rtmutex-tester.c
---- linux-3.0.4/kernel/rtmutex-tester.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/rtmutex-tester.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/rtmutex-tester.c linux-3.1.3/kernel/rtmutex-tester.c
+--- linux-3.1.3/kernel/rtmutex-tester.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/rtmutex-tester.c        2011-11-16 18:39:08.000000000 -0500
 @@ -20,7 +20,7 @@
  #define MAX_RT_TEST_MUTEXES   8
  
@@ -62524,9 +65595,9 @@ diff -urNp linux-3.0.4/kernel/rtmutex-tester.c linux-3.0.4/kernel/rtmutex-tester
                return;
  
        default:
-diff -urNp linux-3.0.4/kernel/sched_autogroup.c linux-3.0.4/kernel/sched_autogroup.c
---- linux-3.0.4/kernel/sched_autogroup.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/sched_autogroup.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/sched_autogroup.c linux-3.1.3/kernel/sched_autogroup.c
+--- linux-3.1.3/kernel/sched_autogroup.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/sched_autogroup.c       2011-11-16 18:39:08.000000000 -0500
 @@ -7,7 +7,7 @@
  
  unsigned int __read_mostly sysctl_sched_autogroup_enabled = 1;
@@ -62545,10 +65616,10 @@ diff -urNp linux-3.0.4/kernel/sched_autogroup.c linux-3.0.4/kernel/sched_autogro
        ag->tg = tg;
  #ifdef CONFIG_RT_GROUP_SCHED
        /*
-diff -urNp linux-3.0.4/kernel/sched.c linux-3.0.4/kernel/sched.c
---- linux-3.0.4/kernel/sched.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/sched.c 2011-08-23 21:48:14.000000000 -0400
-@@ -4251,6 +4251,8 @@ asmlinkage void __sched schedule(void)
+diff -urNp linux-3.1.3/kernel/sched.c linux-3.1.3/kernel/sched.c
+--- linux-3.1.3/kernel/sched.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/sched.c 2011-11-16 18:40:44.000000000 -0500
+@@ -4264,6 +4264,8 @@ static void __sched __schedule(void)
        struct rq *rq;
        int cpu;
  
@@ -62557,7 +65628,7 @@ diff -urNp linux-3.0.4/kernel/sched.c linux-3.0.4/kernel/sched.c
  need_resched:
        preempt_disable();
        cpu = smp_processor_id();
-@@ -4934,6 +4936,8 @@ int can_nice(const struct task_struct *p
+@@ -4950,6 +4952,8 @@ int can_nice(const struct task_struct *p
        /* convert nice value [19,-20] to rlimit style value [1,40] */
        int nice_rlim = 20 - nice;
  
@@ -62566,7 +65637,7 @@ diff -urNp linux-3.0.4/kernel/sched.c linux-3.0.4/kernel/sched.c
        return (nice_rlim <= task_rlimit(p, RLIMIT_NICE) ||
                capable(CAP_SYS_NICE));
  }
-@@ -4967,7 +4971,8 @@ SYSCALL_DEFINE1(nice, int, increment)
+@@ -4983,7 +4987,8 @@ SYSCALL_DEFINE1(nice, int, increment)
        if (nice > 19)
                nice = 19;
  
@@ -62576,7 +65647,7 @@ diff -urNp linux-3.0.4/kernel/sched.c linux-3.0.4/kernel/sched.c
                return -EPERM;
  
        retval = security_task_setnice(current, nice);
-@@ -5111,6 +5116,7 @@ recheck:
+@@ -5127,6 +5132,7 @@ recheck:
                        unsigned long rlim_rtprio =
                                        task_rlimit(p, RLIMIT_RTPRIO);
  
@@ -62584,10 +65655,10 @@ diff -urNp linux-3.0.4/kernel/sched.c linux-3.0.4/kernel/sched.c
                        /* can't set/change the rt policy */
                        if (policy != p->policy && !rlim_rtprio)
                                return -EPERM;
-diff -urNp linux-3.0.4/kernel/sched_fair.c linux-3.0.4/kernel/sched_fair.c
---- linux-3.0.4/kernel/sched_fair.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/sched_fair.c    2011-08-23 21:47:56.000000000 -0400
-@@ -4050,7 +4050,7 @@ static void nohz_idle_balance(int this_c
+diff -urNp linux-3.1.3/kernel/sched_fair.c linux-3.1.3/kernel/sched_fair.c
+--- linux-3.1.3/kernel/sched_fair.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/sched_fair.c    2011-11-16 18:39:08.000000000 -0500
+@@ -4062,7 +4062,7 @@ static void nohz_idle_balance(int this_c
   * run_rebalance_domains is triggered when needed from the scheduler tick.
   * Also triggered for nohz idle balancing (with nohz_balancing_kick set).
   */
@@ -62596,9 +65667,9 @@ diff -urNp linux-3.0.4/kernel/sched_fair.c linux-3.0.4/kernel/sched_fair.c
  {
        int this_cpu = smp_processor_id();
        struct rq *this_rq = cpu_rq(this_cpu);
-diff -urNp linux-3.0.4/kernel/signal.c linux-3.0.4/kernel/signal.c
---- linux-3.0.4/kernel/signal.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/signal.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/signal.c linux-3.1.3/kernel/signal.c
+--- linux-3.1.3/kernel/signal.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/signal.c        2011-11-16 19:30:04.000000000 -0500
 @@ -45,12 +45,12 @@ static struct kmem_cache *sigqueue_cache
  
  int print_fatal_signals __read_mostly;
@@ -62623,7 +65694,7 @@ diff -urNp linux-3.0.4/kernel/signal.c linux-3.0.4/kernel/signal.c
  
        handler = sig_handler(t, sig);
  
-@@ -320,6 +320,9 @@ __sigqueue_alloc(int sig, struct task_st
+@@ -364,6 +364,9 @@ __sigqueue_alloc(int sig, struct task_st
        atomic_inc(&user->sigpending);
        rcu_read_unlock();
  
@@ -62633,7 +65704,7 @@ diff -urNp linux-3.0.4/kernel/signal.c linux-3.0.4/kernel/signal.c
        if (override_rlimit ||
            atomic_read(&user->sigpending) <=
                        task_rlimit(t, RLIMIT_SIGPENDING)) {
-@@ -444,7 +447,7 @@ flush_signal_handlers(struct task_struct
+@@ -488,7 +491,7 @@ flush_signal_handlers(struct task_struct
  
  int unhandled_signal(struct task_struct *tsk, int sig)
  {
@@ -62642,7 +65713,7 @@ diff -urNp linux-3.0.4/kernel/signal.c linux-3.0.4/kernel/signal.c
        if (is_global_init(tsk))
                return 1;
        if (handler != SIG_IGN && handler != SIG_DFL)
-@@ -770,6 +773,13 @@ static int check_kill_permission(int sig
+@@ -815,6 +818,13 @@ static int check_kill_permission(int sig
                }
        }
  
@@ -62656,7 +65727,7 @@ diff -urNp linux-3.0.4/kernel/signal.c linux-3.0.4/kernel/signal.c
        return security_task_kill(t, info, sig, 0);
  }
  
-@@ -1092,7 +1102,7 @@ __group_send_sig_info(int sig, struct si
+@@ -1165,7 +1175,7 @@ __group_send_sig_info(int sig, struct si
        return send_signal(sig, info, p, 1);
  }
  
@@ -62665,7 +65736,7 @@ diff -urNp linux-3.0.4/kernel/signal.c linux-3.0.4/kernel/signal.c
  specific_send_sig_info(int sig, struct siginfo *info, struct task_struct *t)
  {
        return send_signal(sig, info, t, 0);
-@@ -1129,6 +1139,7 @@ force_sig_info(int sig, struct siginfo *
+@@ -1202,6 +1212,7 @@ force_sig_info(int sig, struct siginfo *
        unsigned long int flags;
        int ret, blocked, ignored;
        struct k_sigaction *action;
@@ -62673,7 +65744,7 @@ diff -urNp linux-3.0.4/kernel/signal.c linux-3.0.4/kernel/signal.c
  
        spin_lock_irqsave(&t->sighand->siglock, flags);
        action = &t->sighand->action[sig-1];
-@@ -1143,9 +1154,18 @@ force_sig_info(int sig, struct siginfo *
+@@ -1216,9 +1227,18 @@ force_sig_info(int sig, struct siginfo *
        }
        if (action->sa.sa_handler == SIG_DFL)
                t->signal->flags &= ~SIGNAL_UNKILLABLE;
@@ -62692,7 +65763,7 @@ diff -urNp linux-3.0.4/kernel/signal.c linux-3.0.4/kernel/signal.c
        return ret;
  }
  
-@@ -1212,8 +1232,11 @@ int group_send_sig_info(int sig, struct 
+@@ -1285,8 +1305,11 @@ int group_send_sig_info(int sig, struct 
        ret = check_kill_permission(sig, info, p);
        rcu_read_unlock();
  
@@ -62705,16 +65776,16 @@ diff -urNp linux-3.0.4/kernel/signal.c linux-3.0.4/kernel/signal.c
  
        return ret;
  }
-@@ -1839,6 +1862,8 @@ void ptrace_notify(int exit_code)
+@@ -1909,6 +1932,8 @@ static void ptrace_do_notify(int signr, 
  {
        siginfo_t info;
  
 +      pax_track_stack();
 +
-       BUG_ON((exit_code & (0x7f | ~0xffff)) != SIGTRAP);
        memset(&info, 0, sizeof info);
-@@ -2639,7 +2664,15 @@ do_send_specific(pid_t tgid, pid_t pid, 
+       info.si_signo = signr;
+       info.si_code = exit_code;
+@@ -2748,7 +2773,15 @@ do_send_specific(pid_t tgid, pid_t pid, 
        int error = -ESRCH;
  
        rcu_read_lock();
@@ -62731,9 +65802,9 @@ diff -urNp linux-3.0.4/kernel/signal.c linux-3.0.4/kernel/signal.c
        if (p && (tgid <= 0 || task_tgid_vnr(p) == tgid)) {
                error = check_kill_permission(sig, info, p);
                /*
-diff -urNp linux-3.0.4/kernel/smp.c linux-3.0.4/kernel/smp.c
---- linux-3.0.4/kernel/smp.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/smp.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/smp.c linux-3.1.3/kernel/smp.c
+--- linux-3.1.3/kernel/smp.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/smp.c   2011-11-16 18:39:08.000000000 -0500
 @@ -580,22 +580,22 @@ int smp_call_function(smp_call_func_t fu
  }
  EXPORT_SYMBOL(smp_call_function);
@@ -62761,9 +65832,9 @@ diff -urNp linux-3.0.4/kernel/smp.c linux-3.0.4/kernel/smp.c
  {
        raw_spin_unlock_irq(&call_function.lock);
  }
-diff -urNp linux-3.0.4/kernel/softirq.c linux-3.0.4/kernel/softirq.c
---- linux-3.0.4/kernel/softirq.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/softirq.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/softirq.c linux-3.1.3/kernel/softirq.c
+--- linux-3.1.3/kernel/softirq.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/softirq.c       2011-11-16 18:39:08.000000000 -0500
 @@ -56,7 +56,7 @@ static struct softirq_action softirq_vec
  
  DEFINE_PER_CPU(struct task_struct *, ksoftirqd);
@@ -62814,10 +65885,10 @@ diff -urNp linux-3.0.4/kernel/softirq.c linux-3.0.4/kernel/softirq.c
  {
        struct tasklet_struct *list;
  
-diff -urNp linux-3.0.4/kernel/sys.c linux-3.0.4/kernel/sys.c
---- linux-3.0.4/kernel/sys.c   2011-09-02 18:11:26.000000000 -0400
-+++ linux-3.0.4/kernel/sys.c   2011-08-29 23:26:27.000000000 -0400
-@@ -158,6 +158,12 @@ static int set_one_prio(struct task_stru
+diff -urNp linux-3.1.3/kernel/sys.c linux-3.1.3/kernel/sys.c
+--- linux-3.1.3/kernel/sys.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/sys.c   2011-11-16 18:40:44.000000000 -0500
+@@ -157,6 +157,12 @@ static int set_one_prio(struct task_stru
                error = -EACCES;
                goto out;
        }
@@ -62830,7 +65901,7 @@ diff -urNp linux-3.0.4/kernel/sys.c linux-3.0.4/kernel/sys.c
        no_nice = security_task_setnice(p, niceval);
        if (no_nice) {
                error = no_nice;
-@@ -541,6 +547,9 @@ SYSCALL_DEFINE2(setregid, gid_t, rgid, g
+@@ -571,6 +577,9 @@ SYSCALL_DEFINE2(setregid, gid_t, rgid, g
                        goto error;
        }
  
@@ -62840,7 +65911,7 @@ diff -urNp linux-3.0.4/kernel/sys.c linux-3.0.4/kernel/sys.c
        if (rgid != (gid_t) -1 ||
            (egid != (gid_t) -1 && egid != old->gid))
                new->sgid = new->egid;
-@@ -570,6 +579,10 @@ SYSCALL_DEFINE1(setgid, gid_t, gid)
+@@ -600,6 +609,10 @@ SYSCALL_DEFINE1(setgid, gid_t, gid)
        old = current_cred();
  
        retval = -EPERM;
@@ -62851,30 +65922,7 @@ diff -urNp linux-3.0.4/kernel/sys.c linux-3.0.4/kernel/sys.c
        if (nsown_capable(CAP_SETGID))
                new->gid = new->egid = new->sgid = new->fsgid = gid;
        else if (gid == old->gid || gid == old->sgid)
-@@ -595,11 +608,18 @@ static int set_user(struct cred *new)
-       if (!new_user)
-               return -EAGAIN;
-+      /*
-+       * We don't fail in case of NPROC limit excess here because too many
-+       * poorly written programs don't check set*uid() return code, assuming
-+       * it never fails if called by root.  We may still enforce NPROC limit
-+       * for programs doing set*uid()+execve() by harmlessly deferring the
-+       * failure to the execve() stage.
-+       */
-       if (atomic_read(&new_user->processes) >= rlimit(RLIMIT_NPROC) &&
--                      new_user != INIT_USER) {
--              free_uid(new_user);
--              return -EAGAIN;
--      }
-+                      new_user != INIT_USER)
-+              current->flags |= PF_NPROC_EXCEEDED;
-+      else
-+              current->flags &= ~PF_NPROC_EXCEEDED;
-       free_uid(new->user);
-       new->user = new_user;
-@@ -650,6 +670,9 @@ SYSCALL_DEFINE2(setreuid, uid_t, ruid, u
+@@ -687,6 +700,9 @@ SYSCALL_DEFINE2(setreuid, uid_t, ruid, u
                        goto error;
        }
  
@@ -62884,7 +65932,7 @@ diff -urNp linux-3.0.4/kernel/sys.c linux-3.0.4/kernel/sys.c
        if (new->uid != old->uid) {
                retval = set_user(new);
                if (retval < 0)
-@@ -694,6 +717,12 @@ SYSCALL_DEFINE1(setuid, uid_t, uid)
+@@ -731,6 +747,12 @@ SYSCALL_DEFINE1(setuid, uid_t, uid)
        old = current_cred();
  
        retval = -EPERM;
@@ -62897,7 +65945,7 @@ diff -urNp linux-3.0.4/kernel/sys.c linux-3.0.4/kernel/sys.c
        if (nsown_capable(CAP_SETUID)) {
                new->suid = new->uid = uid;
                if (uid != old->uid) {
-@@ -748,6 +777,9 @@ SYSCALL_DEFINE3(setresuid, uid_t, ruid, 
+@@ -785,6 +807,9 @@ SYSCALL_DEFINE3(setresuid, uid_t, ruid, 
                        goto error;
        }
  
@@ -62907,7 +65955,7 @@ diff -urNp linux-3.0.4/kernel/sys.c linux-3.0.4/kernel/sys.c
        if (ruid != (uid_t) -1) {
                new->uid = ruid;
                if (ruid != old->uid) {
-@@ -812,6 +844,9 @@ SYSCALL_DEFINE3(setresgid, gid_t, rgid, 
+@@ -849,6 +874,9 @@ SYSCALL_DEFINE3(setresgid, gid_t, rgid, 
                        goto error;
        }
  
@@ -62917,7 +65965,7 @@ diff -urNp linux-3.0.4/kernel/sys.c linux-3.0.4/kernel/sys.c
        if (rgid != (gid_t) -1)
                new->gid = rgid;
        if (egid != (gid_t) -1)
-@@ -858,6 +893,9 @@ SYSCALL_DEFINE1(setfsuid, uid_t, uid)
+@@ -895,6 +923,9 @@ SYSCALL_DEFINE1(setfsuid, uid_t, uid)
        old = current_cred();
        old_fsuid = old->fsuid;
  
@@ -62927,7 +65975,7 @@ diff -urNp linux-3.0.4/kernel/sys.c linux-3.0.4/kernel/sys.c
        if (uid == old->uid  || uid == old->euid  ||
            uid == old->suid || uid == old->fsuid ||
            nsown_capable(CAP_SETUID)) {
-@@ -868,6 +906,7 @@ SYSCALL_DEFINE1(setfsuid, uid_t, uid)
+@@ -905,6 +936,7 @@ SYSCALL_DEFINE1(setfsuid, uid_t, uid)
                }
        }
  
@@ -62935,7 +65983,7 @@ diff -urNp linux-3.0.4/kernel/sys.c linux-3.0.4/kernel/sys.c
        abort_creds(new);
        return old_fsuid;
  
-@@ -894,12 +933,16 @@ SYSCALL_DEFINE1(setfsgid, gid_t, gid)
+@@ -931,12 +963,16 @@ SYSCALL_DEFINE1(setfsgid, gid_t, gid)
        if (gid == old->gid  || gid == old->egid  ||
            gid == old->sgid || gid == old->fsgid ||
            nsown_capable(CAP_SETGID)) {
@@ -62952,7 +66000,32 @@ diff -urNp linux-3.0.4/kernel/sys.c linux-3.0.4/kernel/sys.c
        abort_creds(new);
        return old_fsgid;
  
-@@ -1680,7 +1723,7 @@ SYSCALL_DEFINE5(prctl, int, option, unsi
+@@ -1242,19 +1278,19 @@ SYSCALL_DEFINE1(olduname, struct oldold_
+               return -EFAULT;
+       down_read(&uts_sem);
+-      error = __copy_to_user(&name->sysname, &utsname()->sysname,
++      error = __copy_to_user(name->sysname, &utsname()->sysname,
+                              __OLD_UTS_LEN);
+       error |= __put_user(0, name->sysname + __OLD_UTS_LEN);
+-      error |= __copy_to_user(&name->nodename, &utsname()->nodename,
++      error |= __copy_to_user(name->nodename, &utsname()->nodename,
+                               __OLD_UTS_LEN);
+       error |= __put_user(0, name->nodename + __OLD_UTS_LEN);
+-      error |= __copy_to_user(&name->release, &utsname()->release,
++      error |= __copy_to_user(name->release, &utsname()->release,
+                               __OLD_UTS_LEN);
+       error |= __put_user(0, name->release + __OLD_UTS_LEN);
+-      error |= __copy_to_user(&name->version, &utsname()->version,
++      error |= __copy_to_user(name->version, &utsname()->version,
+                               __OLD_UTS_LEN);
+       error |= __put_user(0, name->version + __OLD_UTS_LEN);
+-      error |= __copy_to_user(&name->machine, &utsname()->machine,
++      error |= __copy_to_user(name->machine, &utsname()->machine,
+                               __OLD_UTS_LEN);
+       error |= __put_user(0, name->machine + __OLD_UTS_LEN);
+       up_read(&uts_sem);
+@@ -1717,7 +1753,7 @@ SYSCALL_DEFINE5(prctl, int, option, unsi
                        error = get_dumpable(me->mm);
                        break;
                case PR_SET_DUMPABLE:
@@ -62961,9 +66034,75 @@ diff -urNp linux-3.0.4/kernel/sys.c linux-3.0.4/kernel/sys.c
                                error = -EINVAL;
                                break;
                        }
-diff -urNp linux-3.0.4/kernel/sysctl.c linux-3.0.4/kernel/sysctl.c
---- linux-3.0.4/kernel/sysctl.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/sysctl.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/sysctl_binary.c linux-3.1.3/kernel/sysctl_binary.c
+--- linux-3.1.3/kernel/sysctl_binary.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/sysctl_binary.c 2011-11-16 18:39:08.000000000 -0500
+@@ -989,7 +989,7 @@ static ssize_t bin_intvec(struct file *f
+               int i;
+               set_fs(KERNEL_DS);
+-              result = vfs_read(file, buffer, BUFSZ - 1, &pos);
++              result = vfs_read(file, (char __force_user *)buffer, BUFSZ - 1, &pos);
+               set_fs(old_fs);
+               if (result < 0)
+                       goto out_kfree;
+@@ -1034,7 +1034,7 @@ static ssize_t bin_intvec(struct file *f
+               }
+               set_fs(KERNEL_DS);
+-              result = vfs_write(file, buffer, str - buffer, &pos);
++              result = vfs_write(file, (const char __force_user *)buffer, str - buffer, &pos);
+               set_fs(old_fs);
+               if (result < 0)
+                       goto out_kfree;
+@@ -1067,7 +1067,7 @@ static ssize_t bin_ulongvec(struct file 
+               int i;
+               set_fs(KERNEL_DS);
+-              result = vfs_read(file, buffer, BUFSZ - 1, &pos);
++              result = vfs_read(file, (char __force_user *)buffer, BUFSZ - 1, &pos);
+               set_fs(old_fs);
+               if (result < 0)
+                       goto out_kfree;
+@@ -1112,7 +1112,7 @@ static ssize_t bin_ulongvec(struct file 
+               }
+               set_fs(KERNEL_DS);
+-              result = vfs_write(file, buffer, str - buffer, &pos);
++              result = vfs_write(file, (const char __force_user *)buffer, str - buffer, &pos);
+               set_fs(old_fs);
+               if (result < 0)
+                       goto out_kfree;
+@@ -1138,7 +1138,7 @@ static ssize_t bin_uuid(struct file *fil
+               int i;
+               set_fs(KERNEL_DS);
+-              result = vfs_read(file, buf, sizeof(buf) - 1, &pos);
++              result = vfs_read(file, (char __force_user *)buf, sizeof(buf) - 1, &pos);
+               set_fs(old_fs);
+               if (result < 0)
+                       goto out;
+@@ -1185,7 +1185,7 @@ static ssize_t bin_dn_node_address(struc
+               __le16 dnaddr;
+               set_fs(KERNEL_DS);
+-              result = vfs_read(file, buf, sizeof(buf) - 1, &pos);
++              result = vfs_read(file, (char __force_user *)buf, sizeof(buf) - 1, &pos);
+               set_fs(old_fs);
+               if (result < 0)
+                       goto out;
+@@ -1233,7 +1233,7 @@ static ssize_t bin_dn_node_address(struc
+                               le16_to_cpu(dnaddr) & 0x3ff);
+               set_fs(KERNEL_DS);
+-              result = vfs_write(file, buf, len, &pos);
++              result = vfs_write(file, (const char __force_user *)buf, len, &pos);
+               set_fs(old_fs);
+               if (result < 0)
+                       goto out;
+diff -urNp linux-3.1.3/kernel/sysctl.c linux-3.1.3/kernel/sysctl.c
+--- linux-3.1.3/kernel/sysctl.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/sysctl.c        2011-11-16 18:40:44.000000000 -0500
 @@ -85,6 +85,13 @@
  
  
@@ -63075,7 +66214,7 @@ diff -urNp linux-3.0.4/kernel/sysctl.c linux-3.0.4/kernel/sysctl.c
  #else
        {
                .procname       = "nr_trim_pages",
-@@ -1714,6 +1763,17 @@ static int test_perm(int mode, int op)
+@@ -1709,6 +1758,17 @@ static int test_perm(int mode, int op)
  int sysctl_perm(struct ctl_table_root *root, struct ctl_table *table, int op)
  {
        int mode;
@@ -63093,7 +66232,7 @@ diff -urNp linux-3.0.4/kernel/sysctl.c linux-3.0.4/kernel/sysctl.c
  
        if (root->permissions)
                mode = root->permissions(root, current->nsproxy, table);
-@@ -2118,6 +2178,16 @@ int proc_dostring(struct ctl_table *tabl
+@@ -2113,6 +2173,16 @@ int proc_dostring(struct ctl_table *tabl
                               buffer, lenp, ppos);
  }
  
@@ -63110,7 +66249,7 @@ diff -urNp linux-3.0.4/kernel/sysctl.c linux-3.0.4/kernel/sysctl.c
  static size_t proc_skip_spaces(char **buf)
  {
        size_t ret;
-@@ -2223,6 +2293,8 @@ static int proc_put_long(void __user **b
+@@ -2218,6 +2288,8 @@ static int proc_put_long(void __user **b
        len = strlen(tmp);
        if (len > *size)
                len = *size;
@@ -63119,7 +66258,7 @@ diff -urNp linux-3.0.4/kernel/sysctl.c linux-3.0.4/kernel/sysctl.c
        if (copy_to_user(*buf, tmp, len))
                return -EFAULT;
        *size -= len;
-@@ -2539,8 +2611,11 @@ static int __do_proc_doulongvec_minmax(v
+@@ -2534,8 +2606,11 @@ static int __do_proc_doulongvec_minmax(v
                        *i = val;
                } else {
                        val = convdiv * (*i) / convmul;
@@ -63132,7 +66271,7 @@ diff -urNp linux-3.0.4/kernel/sysctl.c linux-3.0.4/kernel/sysctl.c
                        err = proc_put_long(&buffer, &left, val, false);
                        if (err)
                                break;
-@@ -2935,6 +3010,12 @@ int proc_dostring(struct ctl_table *tabl
+@@ -2930,6 +3005,12 @@ int proc_dostring(struct ctl_table *tabl
        return -ENOSYS;
  }
  
@@ -63145,7 +66284,7 @@ diff -urNp linux-3.0.4/kernel/sysctl.c linux-3.0.4/kernel/sysctl.c
  int proc_dointvec(struct ctl_table *table, int write,
                  void __user *buffer, size_t *lenp, loff_t *ppos)
  {
-@@ -2991,6 +3072,7 @@ EXPORT_SYMBOL(proc_dointvec_minmax);
+@@ -2986,6 +3067,7 @@ EXPORT_SYMBOL(proc_dointvec_minmax);
  EXPORT_SYMBOL(proc_dointvec_userhz_jiffies);
  EXPORT_SYMBOL(proc_dointvec_ms_jiffies);
  EXPORT_SYMBOL(proc_dostring);
@@ -63153,9 +66292,9 @@ diff -urNp linux-3.0.4/kernel/sysctl.c linux-3.0.4/kernel/sysctl.c
  EXPORT_SYMBOL(proc_doulongvec_minmax);
  EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax);
  EXPORT_SYMBOL(register_sysctl_table);
-diff -urNp linux-3.0.4/kernel/sysctl_check.c linux-3.0.4/kernel/sysctl_check.c
---- linux-3.0.4/kernel/sysctl_check.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/sysctl_check.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/sysctl_check.c linux-3.1.3/kernel/sysctl_check.c
+--- linux-3.1.3/kernel/sysctl_check.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/sysctl_check.c  2011-11-16 18:40:44.000000000 -0500
 @@ -129,6 +129,7 @@ int sysctl_check_table(struct nsproxy *n
                                set_fail(&fail, table, "Directory with extra2");
                } else {
@@ -63164,23 +66303,23 @@ diff -urNp linux-3.0.4/kernel/sysctl_check.c linux-3.0.4/kernel/sysctl_check.c
                            (table->proc_handler == proc_dointvec) ||
                            (table->proc_handler == proc_dointvec_minmax) ||
                            (table->proc_handler == proc_dointvec_jiffies) ||
-diff -urNp linux-3.0.4/kernel/taskstats.c linux-3.0.4/kernel/taskstats.c
---- linux-3.0.4/kernel/taskstats.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/taskstats.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/taskstats.c linux-3.1.3/kernel/taskstats.c
+--- linux-3.1.3/kernel/taskstats.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/taskstats.c     2011-11-16 19:35:09.000000000 -0500
 @@ -27,9 +27,12 @@
  #include <linux/cgroup.h>
  #include <linux/fs.h>
  #include <linux/file.h>
 +#include <linux/grsecurity.h>
  #include <net/genetlink.h>
- #include <asm/atomic.h>
+ #include <linux/atomic.h>
  
 +extern int gr_is_taskstats_denied(int pid);
 +
  /*
   * Maximum length of a cpumask that can be specified in
   * the TASKSTATS_CMD_ATTR_REGISTER/DEREGISTER_CPUMASK attribute
-@@ -558,6 +561,9 @@ err:
+@@ -556,6 +559,9 @@ err:
  
  static int taskstats_user_cmd(struct sk_buff *skb, struct genl_info *info)
  {
@@ -63190,10 +66329,10 @@ diff -urNp linux-3.0.4/kernel/taskstats.c linux-3.0.4/kernel/taskstats.c
        if (info->attrs[TASKSTATS_CMD_ATTR_REGISTER_CPUMASK])
                return cmd_attr_register_cpumask(info);
        else if (info->attrs[TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK])
-diff -urNp linux-3.0.4/kernel/time/alarmtimer.c linux-3.0.4/kernel/time/alarmtimer.c
---- linux-3.0.4/kernel/time/alarmtimer.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/time/alarmtimer.c       2011-08-23 21:47:56.000000000 -0400
-@@ -685,7 +685,7 @@ static int __init alarmtimer_init(void)
+diff -urNp linux-3.1.3/kernel/time/alarmtimer.c linux-3.1.3/kernel/time/alarmtimer.c
+--- linux-3.1.3/kernel/time/alarmtimer.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/time/alarmtimer.c       2011-11-16 18:39:08.000000000 -0500
+@@ -693,7 +693,7 @@ static int __init alarmtimer_init(void)
  {
        int error = 0;
        int i;
@@ -63202,9 +66341,9 @@ diff -urNp linux-3.0.4/kernel/time/alarmtimer.c linux-3.0.4/kernel/time/alarmtim
                .clock_getres   = alarm_clock_getres,
                .clock_get      = alarm_clock_get,
                .timer_create   = alarm_timer_create,
-diff -urNp linux-3.0.4/kernel/time/tick-broadcast.c linux-3.0.4/kernel/time/tick-broadcast.c
---- linux-3.0.4/kernel/time/tick-broadcast.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/time/tick-broadcast.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/time/tick-broadcast.c linux-3.1.3/kernel/time/tick-broadcast.c
+--- linux-3.1.3/kernel/time/tick-broadcast.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/time/tick-broadcast.c   2011-11-16 18:39:08.000000000 -0500
 @@ -115,7 +115,7 @@ int tick_device_uses_broadcast(struct cl
                 * then clear the broadcast bit.
                 */
@@ -63214,9 +66353,9 @@ diff -urNp linux-3.0.4/kernel/time/tick-broadcast.c linux-3.0.4/kernel/time/tick
  
                        cpumask_clear_cpu(cpu, tick_get_broadcast_mask());
                        tick_broadcast_clear_oneshot(cpu);
-diff -urNp linux-3.0.4/kernel/time/timekeeping.c linux-3.0.4/kernel/time/timekeeping.c
---- linux-3.0.4/kernel/time/timekeeping.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/time/timekeeping.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/time/timekeeping.c linux-3.1.3/kernel/time/timekeeping.c
+--- linux-3.1.3/kernel/time/timekeeping.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/time/timekeeping.c      2011-11-16 18:40:44.000000000 -0500
 @@ -14,6 +14,7 @@
  #include <linux/init.h>
  #include <linux/mm.h>
@@ -63234,9 +66373,9 @@ diff -urNp linux-3.0.4/kernel/time/timekeeping.c linux-3.0.4/kernel/time/timekee
        write_seqlock_irqsave(&xtime_lock, flags);
  
        timekeeping_forward_now();
-diff -urNp linux-3.0.4/kernel/time/timer_list.c linux-3.0.4/kernel/time/timer_list.c
---- linux-3.0.4/kernel/time/timer_list.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/time/timer_list.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/time/timer_list.c linux-3.1.3/kernel/time/timer_list.c
+--- linux-3.1.3/kernel/time/timer_list.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/time/timer_list.c       2011-11-16 18:40:44.000000000 -0500
 @@ -38,12 +38,16 @@ DECLARE_PER_CPU(struct hrtimer_cpu_base,
  
  static void print_name_offset(struct seq_file *m, void *sym)
@@ -63278,9 +66417,9 @@ diff -urNp linux-3.0.4/kernel/time/timer_list.c linux-3.0.4/kernel/time/timer_li
        if (!pe)
                return -ENOMEM;
        return 0;
-diff -urNp linux-3.0.4/kernel/time/timer_stats.c linux-3.0.4/kernel/time/timer_stats.c
---- linux-3.0.4/kernel/time/timer_stats.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/time/timer_stats.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/time/timer_stats.c linux-3.1.3/kernel/time/timer_stats.c
+--- linux-3.1.3/kernel/time/timer_stats.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/time/timer_stats.c      2011-11-16 18:40:44.000000000 -0500
 @@ -116,7 +116,7 @@ static ktime_t time_start, time_stop;
  static unsigned long nr_entries;
  static struct entry entries[MAX_ENTRIES];
@@ -63349,9 +66488,9 @@ diff -urNp linux-3.0.4/kernel/time/timer_stats.c linux-3.0.4/kernel/time/timer_s
        if (!pe)
                return -ENOMEM;
        return 0;
-diff -urNp linux-3.0.4/kernel/time.c linux-3.0.4/kernel/time.c
---- linux-3.0.4/kernel/time.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/time.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/kernel/time.c linux-3.1.3/kernel/time.c
+--- linux-3.1.3/kernel/time.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/time.c  2011-11-16 18:40:44.000000000 -0500
 @@ -163,6 +163,11 @@ int do_sys_settimeofday(const struct tim
                return error;
  
@@ -63364,9 +66503,9 @@ diff -urNp linux-3.0.4/kernel/time.c linux-3.0.4/kernel/time.c
                /* SMP safe, global irq locking makes it work. */
                sys_tz = *tz;
                update_vsyscall_tz();
-diff -urNp linux-3.0.4/kernel/timer.c linux-3.0.4/kernel/timer.c
---- linux-3.0.4/kernel/timer.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/timer.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/timer.c linux-3.1.3/kernel/timer.c
+--- linux-3.1.3/kernel/timer.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/timer.c 2011-11-16 18:39:08.000000000 -0500
 @@ -1304,7 +1304,7 @@ void update_process_times(int user_tick)
  /*
   * This function runs timers and the timer-tq in bottom half context.
@@ -63376,10 +66515,10 @@ diff -urNp linux-3.0.4/kernel/timer.c linux-3.0.4/kernel/timer.c
  {
        struct tvec_base *base = __this_cpu_read(tvec_bases);
  
-diff -urNp linux-3.0.4/kernel/trace/blktrace.c linux-3.0.4/kernel/trace/blktrace.c
---- linux-3.0.4/kernel/trace/blktrace.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/trace/blktrace.c        2011-08-23 21:47:56.000000000 -0400
-@@ -321,7 +321,7 @@ static ssize_t blk_dropped_read(struct f
+diff -urNp linux-3.1.3/kernel/trace/blktrace.c linux-3.1.3/kernel/trace/blktrace.c
+--- linux-3.1.3/kernel/trace/blktrace.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/trace/blktrace.c        2011-11-16 18:39:08.000000000 -0500
+@@ -323,7 +323,7 @@ static ssize_t blk_dropped_read(struct f
        struct blk_trace *bt = filp->private_data;
        char buf[16];
  
@@ -63388,7 +66527,7 @@ diff -urNp linux-3.0.4/kernel/trace/blktrace.c linux-3.0.4/kernel/trace/blktrace
  
        return simple_read_from_buffer(buffer, count, ppos, buf, strlen(buf));
  }
-@@ -386,7 +386,7 @@ static int blk_subbuf_start_callback(str
+@@ -388,7 +388,7 @@ static int blk_subbuf_start_callback(str
                return 1;
  
        bt = buf->chan->private_data;
@@ -63397,7 +66536,7 @@ diff -urNp linux-3.0.4/kernel/trace/blktrace.c linux-3.0.4/kernel/trace/blktrace
        return 0;
  }
  
-@@ -487,7 +487,7 @@ int do_blk_trace_setup(struct request_qu
+@@ -489,7 +489,7 @@ int do_blk_trace_setup(struct request_qu
  
        bt->dir = dir;
        bt->dev = dev;
@@ -63406,10 +66545,10 @@ diff -urNp linux-3.0.4/kernel/trace/blktrace.c linux-3.0.4/kernel/trace/blktrace
  
        ret = -EIO;
        bt->dropped_file = debugfs_create_file("dropped", 0444, dir, bt,
-diff -urNp linux-3.0.4/kernel/trace/ftrace.c linux-3.0.4/kernel/trace/ftrace.c
---- linux-3.0.4/kernel/trace/ftrace.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/trace/ftrace.c  2011-08-23 21:47:56.000000000 -0400
-@@ -1566,12 +1566,17 @@ ftrace_code_disable(struct module *mod, 
+diff -urNp linux-3.1.3/kernel/trace/ftrace.c linux-3.1.3/kernel/trace/ftrace.c
+--- linux-3.1.3/kernel/trace/ftrace.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/trace/ftrace.c  2011-11-16 18:39:08.000000000 -0500
+@@ -1585,12 +1585,17 @@ ftrace_code_disable(struct module *mod, 
        if (unlikely(ftrace_disabled))
                return 0;
  
@@ -63429,7 +66568,7 @@ diff -urNp linux-3.0.4/kernel/trace/ftrace.c linux-3.0.4/kernel/trace/ftrace.c
  }
  
  /*
-@@ -2550,7 +2555,7 @@ static void ftrace_free_entry_rcu(struct
+@@ -2607,7 +2612,7 @@ static void ftrace_free_entry_rcu(struct
  
  int
  register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
@@ -63438,10 +66577,10 @@ diff -urNp linux-3.0.4/kernel/trace/ftrace.c linux-3.0.4/kernel/trace/ftrace.c
  {
        struct ftrace_func_probe *entry;
        struct ftrace_page *pg;
-diff -urNp linux-3.0.4/kernel/trace/trace.c linux-3.0.4/kernel/trace/trace.c
---- linux-3.0.4/kernel/trace/trace.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/trace/trace.c   2011-08-23 21:48:14.000000000 -0400
-@@ -3339,6 +3339,8 @@ static ssize_t tracing_splice_read_pipe(
+diff -urNp linux-3.1.3/kernel/trace/trace.c linux-3.1.3/kernel/trace/trace.c
+--- linux-3.1.3/kernel/trace/trace.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/trace/trace.c   2011-11-16 18:40:44.000000000 -0500
+@@ -3451,6 +3451,8 @@ static ssize_t tracing_splice_read_pipe(
        size_t rem;
        unsigned int i;
  
@@ -63450,7 +66589,7 @@ diff -urNp linux-3.0.4/kernel/trace/trace.c linux-3.0.4/kernel/trace/trace.c
        if (splice_grow_spd(pipe, &spd))
                return -ENOMEM;
  
-@@ -3822,6 +3824,8 @@ tracing_buffers_splice_read(struct file 
+@@ -3926,6 +3928,8 @@ tracing_buffers_splice_read(struct file 
        int entries, size, i;
        size_t ret;
  
@@ -63459,7 +66598,7 @@ diff -urNp linux-3.0.4/kernel/trace/trace.c linux-3.0.4/kernel/trace/trace.c
        if (splice_grow_spd(pipe, &spd))
                return -ENOMEM;
  
-@@ -3990,10 +3994,9 @@ static const struct file_operations trac
+@@ -4093,10 +4097,9 @@ static const struct file_operations trac
  };
  #endif
  
@@ -63471,7 +66610,7 @@ diff -urNp linux-3.0.4/kernel/trace/trace.c linux-3.0.4/kernel/trace/trace.c
        static int once;
  
        if (d_tracer)
-@@ -4013,10 +4016,9 @@ struct dentry *tracing_init_dentry(void)
+@@ -4116,10 +4119,9 @@ struct dentry *tracing_init_dentry(void)
        return d_tracer;
  }
  
@@ -63483,10 +66622,10 @@ diff -urNp linux-3.0.4/kernel/trace/trace.c linux-3.0.4/kernel/trace/trace.c
        static int once;
        struct dentry *d_tracer;
  
-diff -urNp linux-3.0.4/kernel/trace/trace_events.c linux-3.0.4/kernel/trace/trace_events.c
---- linux-3.0.4/kernel/trace/trace_events.c    2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/kernel/trace/trace_events.c    2011-08-23 21:47:56.000000000 -0400
-@@ -1318,10 +1318,6 @@ static LIST_HEAD(ftrace_module_file_list
+diff -urNp linux-3.1.3/kernel/trace/trace_events.c linux-3.1.3/kernel/trace/trace_events.c
+--- linux-3.1.3/kernel/trace/trace_events.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/trace/trace_events.c    2011-11-16 18:39:08.000000000 -0500
+@@ -1300,10 +1300,6 @@ static LIST_HEAD(ftrace_module_file_list
  struct ftrace_module_file_ops {
        struct list_head                list;
        struct module                   *mod;
@@ -63497,7 +66636,7 @@ diff -urNp linux-3.0.4/kernel/trace/trace_events.c linux-3.0.4/kernel/trace/trac
  };
  
  static struct ftrace_module_file_ops *
-@@ -1342,17 +1338,12 @@ trace_create_file_ops(struct module *mod
+@@ -1324,17 +1320,12 @@ trace_create_file_ops(struct module *mod
  
        file_ops->mod = mod;
  
@@ -63521,7 +66660,7 @@ diff -urNp linux-3.0.4/kernel/trace/trace_events.c linux-3.0.4/kernel/trace/trac
  
        list_add(&file_ops->list, &ftrace_module_file_list);
  
-@@ -1376,8 +1367,8 @@ static void trace_module_add_events(stru
+@@ -1358,8 +1349,8 @@ static void trace_module_add_events(stru
  
        for_each_event(call, start, end) {
                __trace_add_event_call(*call, mod,
@@ -63532,9 +66671,48 @@ diff -urNp linux-3.0.4/kernel/trace/trace_events.c linux-3.0.4/kernel/trace/trac
        }
  }
  
-diff -urNp linux-3.0.4/kernel/trace/trace_mmiotrace.c linux-3.0.4/kernel/trace/trace_mmiotrace.c
---- linux-3.0.4/kernel/trace/trace_mmiotrace.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/trace/trace_mmiotrace.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/trace/trace_kprobe.c linux-3.1.3/kernel/trace/trace_kprobe.c
+--- linux-3.1.3/kernel/trace/trace_kprobe.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/trace/trace_kprobe.c    2011-11-16 18:39:08.000000000 -0500
+@@ -217,7 +217,7 @@ static __kprobes void FETCH_FUNC_NAME(me
+       long ret;
+       int maxlen = get_rloc_len(*(u32 *)dest);
+       u8 *dst = get_rloc_data(dest);
+-      u8 *src = addr;
++      const u8 __user *src = (const u8 __force_user *)addr;
+       mm_segment_t old_fs = get_fs();
+       if (!maxlen)
+               return;
+@@ -229,7 +229,7 @@ static __kprobes void FETCH_FUNC_NAME(me
+       pagefault_disable();
+       do
+               ret = __copy_from_user_inatomic(dst++, src++, 1);
+-      while (dst[-1] && ret == 0 && src - (u8 *)addr < maxlen);
++      while (dst[-1] && ret == 0 && src - (const u8 __force_user *)addr < maxlen);
+       dst[-1] = '\0';
+       pagefault_enable();
+       set_fs(old_fs);
+@@ -238,7 +238,7 @@ static __kprobes void FETCH_FUNC_NAME(me
+               ((u8 *)get_rloc_data(dest))[0] = '\0';
+               *(u32 *)dest = make_data_rloc(0, get_rloc_offs(*(u32 *)dest));
+       } else
+-              *(u32 *)dest = make_data_rloc(src - (u8 *)addr,
++              *(u32 *)dest = make_data_rloc(src - (const u8 __force_user *)addr,
+                                             get_rloc_offs(*(u32 *)dest));
+ }
+ /* Return the length of string -- including null terminal byte */
+@@ -252,7 +252,7 @@ static __kprobes void FETCH_FUNC_NAME(me
+       set_fs(KERNEL_DS);
+       pagefault_disable();
+       do {
+-              ret = __copy_from_user_inatomic(&c, (u8 *)addr + len, 1);
++              ret = __copy_from_user_inatomic(&c, (const u8 __force_user *)addr + len, 1);
+               len++;
+       } while (c && ret == 0 && len < MAX_STRING_SIZE);
+       pagefault_enable();
+diff -urNp linux-3.1.3/kernel/trace/trace_mmiotrace.c linux-3.1.3/kernel/trace/trace_mmiotrace.c
+--- linux-3.1.3/kernel/trace/trace_mmiotrace.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/trace/trace_mmiotrace.c 2011-11-16 18:39:08.000000000 -0500
 @@ -24,7 +24,7 @@ struct header_iter {
  static struct trace_array *mmio_trace_array;
  static bool overrun_detected;
@@ -63571,9 +66749,9 @@ diff -urNp linux-3.0.4/kernel/trace/trace_mmiotrace.c linux-3.0.4/kernel/trace/t
                return;
        }
        entry   = ring_buffer_event_data(event);
-diff -urNp linux-3.0.4/kernel/trace/trace_output.c linux-3.0.4/kernel/trace/trace_output.c
---- linux-3.0.4/kernel/trace/trace_output.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/trace/trace_output.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/trace/trace_output.c linux-3.1.3/kernel/trace/trace_output.c
+--- linux-3.1.3/kernel/trace/trace_output.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/trace/trace_output.c    2011-11-16 18:39:08.000000000 -0500
 @@ -278,7 +278,7 @@ int trace_seq_path(struct trace_seq *s, 
  
        p = d_path(path, s->buffer + s->len, PAGE_SIZE - s->len);
@@ -63583,9 +66761,9 @@ diff -urNp linux-3.0.4/kernel/trace/trace_output.c linux-3.0.4/kernel/trace/trac
                if (p) {
                        s->len = p - s->buffer;
                        return 1;
-diff -urNp linux-3.0.4/kernel/trace/trace_stack.c linux-3.0.4/kernel/trace/trace_stack.c
---- linux-3.0.4/kernel/trace/trace_stack.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/trace/trace_stack.c     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/trace/trace_stack.c linux-3.1.3/kernel/trace/trace_stack.c
+--- linux-3.1.3/kernel/trace/trace_stack.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/trace/trace_stack.c     2011-11-16 18:39:08.000000000 -0500
 @@ -50,7 +50,7 @@ static inline void check_stack(void)
                return;
  
@@ -63595,9 +66773,9 @@ diff -urNp linux-3.0.4/kernel/trace/trace_stack.c linux-3.0.4/kernel/trace/trace
                return;
  
        local_irq_save(flags);
-diff -urNp linux-3.0.4/kernel/trace/trace_workqueue.c linux-3.0.4/kernel/trace/trace_workqueue.c
---- linux-3.0.4/kernel/trace/trace_workqueue.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/kernel/trace/trace_workqueue.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/kernel/trace/trace_workqueue.c linux-3.1.3/kernel/trace/trace_workqueue.c
+--- linux-3.1.3/kernel/trace/trace_workqueue.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/kernel/trace/trace_workqueue.c 2011-11-16 18:39:08.000000000 -0500
 @@ -22,7 +22,7 @@ struct cpu_workqueue_stats {
        int                         cpu;
        pid_t                       pid;
@@ -63625,9 +66803,48 @@ diff -urNp linux-3.0.4/kernel/trace/trace_workqueue.c linux-3.0.4/kernel/trace/t
                                   tsk->comm);
                        put_task_struct(tsk);
                }
-diff -urNp linux-3.0.4/lib/bug.c linux-3.0.4/lib/bug.c
---- linux-3.0.4/lib/bug.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/lib/bug.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/lib/bitmap.c linux-3.1.3/lib/bitmap.c
+--- linux-3.1.3/lib/bitmap.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/lib/bitmap.c   2011-11-16 18:39:08.000000000 -0500
+@@ -419,7 +419,7 @@ int __bitmap_parse(const char *buf, unsi
+ {
+       int c, old_c, totaldigits, ndigits, nchunks, nbits;
+       u32 chunk;
+-      const char __user *ubuf = buf;
++      const char __user *ubuf = (const char __force_user *)buf;
+       bitmap_zero(maskp, nmaskbits);
+@@ -504,7 +504,7 @@ int bitmap_parse_user(const char __user 
+ {
+       if (!access_ok(VERIFY_READ, ubuf, ulen))
+               return -EFAULT;
+-      return __bitmap_parse((const char *)ubuf, ulen, 1, maskp, nmaskbits);
++      return __bitmap_parse((const char __force_kernel *)ubuf, ulen, 1, maskp, nmaskbits);
+ }
+ EXPORT_SYMBOL(bitmap_parse_user);
+@@ -594,7 +594,7 @@ static int __bitmap_parselist(const char
+ {
+       unsigned a, b;
+       int c, old_c, totaldigits;
+-      const char __user *ubuf = buf;
++      const char __user *ubuf = (const char __force_user *)buf;
+       int exp_digit, in_range;
+       totaldigits = c = 0;
+@@ -694,7 +694,7 @@ int bitmap_parselist_user(const char __u
+ {
+       if (!access_ok(VERIFY_READ, ubuf, ulen))
+               return -EFAULT;
+-      return __bitmap_parselist((const char *)ubuf,
++      return __bitmap_parselist((const char __force_kernel *)ubuf,
+                                       ulen, 1, maskp, nmaskbits);
+ }
+ EXPORT_SYMBOL(bitmap_parselist_user);
+diff -urNp linux-3.1.3/lib/bug.c linux-3.1.3/lib/bug.c
+--- linux-3.1.3/lib/bug.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/lib/bug.c      2011-11-16 18:39:08.000000000 -0500
 @@ -133,6 +133,8 @@ enum bug_trap_type report_bug(unsigned l
                return BUG_TRAP_TYPE_NONE;
  
@@ -63637,9 +66854,9 @@ diff -urNp linux-3.0.4/lib/bug.c linux-3.0.4/lib/bug.c
  
        file = NULL;
        line = 0;
-diff -urNp linux-3.0.4/lib/debugobjects.c linux-3.0.4/lib/debugobjects.c
---- linux-3.0.4/lib/debugobjects.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/lib/debugobjects.c     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/lib/debugobjects.c linux-3.1.3/lib/debugobjects.c
+--- linux-3.1.3/lib/debugobjects.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/lib/debugobjects.c     2011-11-16 18:39:08.000000000 -0500
 @@ -284,7 +284,7 @@ static void debug_object_is_on_stack(voi
        if (limit > 4)
                return;
@@ -63649,9 +66866,30 @@ diff -urNp linux-3.0.4/lib/debugobjects.c linux-3.0.4/lib/debugobjects.c
        if (is_on_stack == onstack)
                return;
  
-diff -urNp linux-3.0.4/lib/dma-debug.c linux-3.0.4/lib/dma-debug.c
---- linux-3.0.4/lib/dma-debug.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/lib/dma-debug.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/lib/devres.c linux-3.1.3/lib/devres.c
+--- linux-3.1.3/lib/devres.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/lib/devres.c   2011-11-16 18:39:08.000000000 -0500
+@@ -80,7 +80,7 @@ EXPORT_SYMBOL(devm_ioremap_nocache);
+ void devm_iounmap(struct device *dev, void __iomem *addr)
+ {
+       WARN_ON(devres_destroy(dev, devm_ioremap_release, devm_ioremap_match,
+-                             (void *)addr));
++                             (void __force *)addr));
+       iounmap(addr);
+ }
+ EXPORT_SYMBOL(devm_iounmap);
+@@ -141,7 +141,7 @@ void devm_ioport_unmap(struct device *de
+ {
+       ioport_unmap(addr);
+       WARN_ON(devres_destroy(dev, devm_ioport_map_release,
+-                             devm_ioport_map_match, (void *)addr));
++                             devm_ioport_map_match, (void __force *)addr));
+ }
+ EXPORT_SYMBOL(devm_ioport_unmap);
+diff -urNp linux-3.1.3/lib/dma-debug.c linux-3.1.3/lib/dma-debug.c
+--- linux-3.1.3/lib/dma-debug.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/lib/dma-debug.c        2011-11-16 18:39:08.000000000 -0500
 @@ -870,7 +870,7 @@ out:
  
  static void check_for_stack(struct device *dev, void *addr)
@@ -63661,9 +66899,9 @@ diff -urNp linux-3.0.4/lib/dma-debug.c linux-3.0.4/lib/dma-debug.c
                err_printk(dev, NULL, "DMA-API: device driver maps memory from"
                                "stack [addr=%p]\n", addr);
  }
-diff -urNp linux-3.0.4/lib/extable.c linux-3.0.4/lib/extable.c
---- linux-3.0.4/lib/extable.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/lib/extable.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/lib/extable.c linux-3.1.3/lib/extable.c
+--- linux-3.1.3/lib/extable.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/lib/extable.c  2011-11-16 18:39:08.000000000 -0500
 @@ -13,6 +13,7 @@
  #include <linux/init.h>
  #include <linux/sort.h>
@@ -63683,9 +66921,9 @@ diff -urNp linux-3.0.4/lib/extable.c linux-3.0.4/lib/extable.c
  }
  
  #ifdef CONFIG_MODULES
-diff -urNp linux-3.0.4/lib/inflate.c linux-3.0.4/lib/inflate.c
---- linux-3.0.4/lib/inflate.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/lib/inflate.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/lib/inflate.c linux-3.1.3/lib/inflate.c
+--- linux-3.1.3/lib/inflate.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/lib/inflate.c  2011-11-16 18:39:08.000000000 -0500
 @@ -269,7 +269,7 @@ static void free(void *where)
                malloc_ptr = free_mem_ptr;
  }
@@ -63695,10 +66933,10 @@ diff -urNp linux-3.0.4/lib/inflate.c linux-3.0.4/lib/inflate.c
  #define free(a) kfree(a)
  #endif
  
-diff -urNp linux-3.0.4/lib/Kconfig.debug linux-3.0.4/lib/Kconfig.debug
---- linux-3.0.4/lib/Kconfig.debug      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/lib/Kconfig.debug      2011-08-23 21:48:14.000000000 -0400
-@@ -1088,6 +1088,7 @@ config LATENCYTOP
+diff -urNp linux-3.1.3/lib/Kconfig.debug linux-3.1.3/lib/Kconfig.debug
+--- linux-3.1.3/lib/Kconfig.debug      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/lib/Kconfig.debug      2011-11-16 18:40:44.000000000 -0500
+@@ -1091,6 +1091,7 @@ config LATENCYTOP
        depends on DEBUG_KERNEL
        depends on STACKTRACE_SUPPORT
        depends on PROC_FS
@@ -63706,9 +66944,9 @@ diff -urNp linux-3.0.4/lib/Kconfig.debug linux-3.0.4/lib/Kconfig.debug
        select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE
        select KALLSYMS
        select KALLSYMS_ALL
-diff -urNp linux-3.0.4/lib/kref.c linux-3.0.4/lib/kref.c
---- linux-3.0.4/lib/kref.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/lib/kref.c     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/lib/kref.c linux-3.1.3/lib/kref.c
+--- linux-3.1.3/lib/kref.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/lib/kref.c     2011-11-16 18:39:08.000000000 -0500
 @@ -52,7 +52,7 @@ void kref_get(struct kref *kref)
   */
  int kref_put(struct kref *kref, void (*release)(struct kref *kref))
@@ -63718,9 +66956,9 @@ diff -urNp linux-3.0.4/lib/kref.c linux-3.0.4/lib/kref.c
        WARN_ON(release == (void (*)(struct kref *))kfree);
  
        if (atomic_dec_and_test(&kref->refcount)) {
-diff -urNp linux-3.0.4/lib/radix-tree.c linux-3.0.4/lib/radix-tree.c
---- linux-3.0.4/lib/radix-tree.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/lib/radix-tree.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/lib/radix-tree.c linux-3.1.3/lib/radix-tree.c
+--- linux-3.1.3/lib/radix-tree.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/lib/radix-tree.c       2011-11-16 18:39:08.000000000 -0500
 @@ -80,7 +80,7 @@ struct radix_tree_preload {
        int nr;
        struct radix_tree_node *nodes[RADIX_TREE_MAX_PATH];
@@ -63730,9 +66968,9 @@ diff -urNp linux-3.0.4/lib/radix-tree.c linux-3.0.4/lib/radix-tree.c
  
  static inline void *ptr_to_indirect(void *ptr)
  {
-diff -urNp linux-3.0.4/lib/vsprintf.c linux-3.0.4/lib/vsprintf.c
---- linux-3.0.4/lib/vsprintf.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/lib/vsprintf.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/lib/vsprintf.c linux-3.1.3/lib/vsprintf.c
+--- linux-3.1.3/lib/vsprintf.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/lib/vsprintf.c 2011-11-16 18:40:44.000000000 -0500
 @@ -16,6 +16,9 @@
   * - scnprintf and vscnprintf
   */
@@ -63743,7 +66981,7 @@ diff -urNp linux-3.0.4/lib/vsprintf.c linux-3.0.4/lib/vsprintf.c
  #include <stdarg.h>
  #include <linux/module.h>
  #include <linux/types.h>
-@@ -435,7 +438,7 @@ char *symbol_string(char *buf, char *end
+@@ -432,7 +435,7 @@ char *symbol_string(char *buf, char *end
        char sym[KSYM_SYMBOL_LEN];
        if (ext == 'B')
                sprint_backtrace(sym, value);
@@ -63752,7 +66990,7 @@ diff -urNp linux-3.0.4/lib/vsprintf.c linux-3.0.4/lib/vsprintf.c
                sprint_symbol(sym, value);
        else
                kallsyms_lookup(value, NULL, NULL, NULL, sym);
-@@ -799,7 +802,11 @@ char *uuid_string(char *buf, char *end, 
+@@ -796,7 +799,11 @@ char *uuid_string(char *buf, char *end, 
        return string(buf, end, uuid, spec);
  }
  
@@ -63764,7 +67002,7 @@ diff -urNp linux-3.0.4/lib/vsprintf.c linux-3.0.4/lib/vsprintf.c
  
  /*
   * Show a '%p' thing.  A kernel extension is that the '%p' is followed
-@@ -813,6 +820,8 @@ int kptr_restrict __read_mostly;
+@@ -810,6 +817,8 @@ int kptr_restrict __read_mostly;
   * - 'S' For symbolic direct pointers with offset
   * - 's' For symbolic direct pointers without offset
   * - 'B' For backtraced symbolic direct pointers with offset
@@ -63773,7 +67011,7 @@ diff -urNp linux-3.0.4/lib/vsprintf.c linux-3.0.4/lib/vsprintf.c
   * - 'R' For decoded struct resource, e.g., [mem 0x0-0x1f 64bit pref]
   * - 'r' For raw struct resource, e.g., [mem 0x0-0x1f flags 0x201]
   * - 'M' For a 6-byte MAC address, it prints the address in the
-@@ -857,12 +866,12 @@ char *pointer(const char *fmt, char *buf
+@@ -854,12 +863,12 @@ char *pointer(const char *fmt, char *buf
  {
        if (!ptr && *fmt != 'K') {
                /*
@@ -63788,7 +67026,7 @@ diff -urNp linux-3.0.4/lib/vsprintf.c linux-3.0.4/lib/vsprintf.c
        }
  
        switch (*fmt) {
-@@ -872,6 +881,13 @@ char *pointer(const char *fmt, char *buf
+@@ -869,6 +878,13 @@ char *pointer(const char *fmt, char *buf
                /* Fallthrough */
        case 'S':
        case 's':
@@ -63802,7 +67040,7 @@ diff -urNp linux-3.0.4/lib/vsprintf.c linux-3.0.4/lib/vsprintf.c
        case 'B':
                return symbol_string(buf, end, ptr, spec, *fmt);
        case 'R':
-@@ -1631,11 +1647,11 @@ int bstr_printf(char *buf, size_t size, 
+@@ -1627,11 +1643,11 @@ int bstr_printf(char *buf, size_t size, 
        typeof(type) value;                                             \
        if (sizeof(type) == 8) {                                        \
                args = PTR_ALIGN(args, sizeof(u32));                    \
@@ -63817,7 +67055,7 @@ diff -urNp linux-3.0.4/lib/vsprintf.c linux-3.0.4/lib/vsprintf.c
        }                                                               \
        args += sizeof(type);                                           \
        value;                                                          \
-@@ -1698,7 +1714,7 @@ int bstr_printf(char *buf, size_t size, 
+@@ -1694,7 +1710,7 @@ int bstr_printf(char *buf, size_t size, 
                case FORMAT_TYPE_STR: {
                        const char *str_arg = args;
                        args += strlen(str_arg) + 1;
@@ -63826,14 +67064,14 @@ diff -urNp linux-3.0.4/lib/vsprintf.c linux-3.0.4/lib/vsprintf.c
                        break;
                }
  
-diff -urNp linux-3.0.4/localversion-grsec linux-3.0.4/localversion-grsec
---- linux-3.0.4/localversion-grsec     1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/localversion-grsec     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/localversion-grsec linux-3.1.3/localversion-grsec
+--- linux-3.1.3/localversion-grsec     1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/localversion-grsec     2011-11-16 18:40:44.000000000 -0500
 @@ -0,0 +1 @@
 +-grsec
-diff -urNp linux-3.0.4/Makefile linux-3.0.4/Makefile
---- linux-3.0.4/Makefile       2011-09-02 18:11:26.000000000 -0400
-+++ linux-3.0.4/Makefile       2011-09-17 00:56:07.000000000 -0400
+diff -urNp linux-3.1.3/Makefile linux-3.1.3/Makefile
+--- linux-3.1.3/Makefile       2011-11-26 19:57:29.000000000 -0500
++++ linux-3.1.3/Makefile       2011-11-26 20:00:43.000000000 -0500
 @@ -245,8 +245,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH"
  
  HOSTCC       = gcc
@@ -63841,25 +67079,12 @@ diff -urNp linux-3.0.4/Makefile linux-3.0.4/Makefile
 -HOSTCFLAGS   = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
 -HOSTCXXFLAGS = -O2
 +HOSTCFLAGS   = -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wno-unused-parameter -Wno-missing-field-initializers -O2 -fomit-frame-pointer -fno-delete-null-pointer-checks
-+HOSTCFLAGS  += $(call cc-option, -Wno-empty-body)
-+HOSTCXXFLAGS = -O2 -fno-delete-null-pointer-checks
++HOSTCLFAGS  += $(call cc-option, -Wno-empty-body)
++HOSTCXXFLAGS = -O2 -Wall -W -fno-delete-null-pointer-checks
  
  # Decide whether to build built-in, modular, or both.
  # Normally, just do built-in.
-@@ -365,10 +366,12 @@ LINUXINCLUDE    := -I$(srctree)/arch/$(h
- KBUILD_CPPFLAGS := -D__KERNEL__
- KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-+                 -W -Wno-unused-parameter -Wno-missing-field-initializers \
-                  -fno-strict-aliasing -fno-common \
-                  -Werror-implicit-function-declaration \
-                  -Wno-format-security \
-                  -fno-delete-null-pointer-checks
-+KBUILD_CFLAGS   += $(call cc-option, -Wno-empty-body)
- KBUILD_AFLAGS_KERNEL :=
- KBUILD_CFLAGS_KERNEL :=
- KBUILD_AFLAGS   := -D__ASSEMBLY__
-@@ -407,8 +410,8 @@ export RCS_TAR_IGNORE := --exclude SCCS 
+@@ -407,8 +408,8 @@ export RCS_TAR_IGNORE := --exclude SCCS 
  # Rules shared between *config targets and build targets
  
  # Basic helpers built in scripts/
@@ -63870,39 +67095,49 @@ diff -urNp linux-3.0.4/Makefile linux-3.0.4/Makefile
        $(Q)$(MAKE) $(build)=scripts/basic
        $(Q)rm -f .tmp_quiet_recordmcount
  
-@@ -564,6 +567,31 @@ else
+@@ -564,6 +565,41 @@ else
  KBUILD_CFLAGS += -O2
  endif
  
++ifndef DISABLE_PAX_PLUGINS
 +ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-plugin.sh "$(HOSTCC)" "$(CC)"), y)
++ifndef DISABLE_PAX_CONSTIFY_PLUGIN
 +CONSTIFY_PLUGIN := -fplugin=$(objtree)/tools/gcc/constify_plugin.so -DCONSTIFY_PLUGIN
-+ifdef CONFIG_PAX_KERNEXEC_PLUGIN
-+KERNEXEC_PLUGIN := -fplugin=$(objtree)/tools/gcc/kernexec_plugin.so
++endif
++ifdef CONFIG_PAX_MEMORY_STACKLEAK
++STACKLEAK_PLUGIN := -fplugin=$(objtree)/tools/gcc/stackleak_plugin.so -DSTACKLEAK_PLUGIN
++STACKLEAK_PLUGIN += -fplugin-arg-stackleak_plugin-track-lowest-sp=100
 +endif
 +ifdef CONFIG_KALLOCSTAT_PLUGIN
 +KALLOCSTAT_PLUGIN := -fplugin=$(objtree)/tools/gcc/kallocstat_plugin.so
 +endif
-+ifdef CONFIG_PAX_MEMORY_STACKLEAK
-+STACKLEAK_PLUGIN := -fplugin=$(objtree)/tools/gcc/stackleak_plugin.so -fplugin-arg-stackleak_plugin-track-lowest-sp=100
++ifdef CONFIG_PAX_KERNEXEC_PLUGIN
++KERNEXEC_PLUGIN := -fplugin=$(objtree)/tools/gcc/kernexec_plugin.so
++endif
++ifdef CONFIG_CHECKER_PLUGIN
++ifeq ($(call cc-ifversion, -ge, 0406, y), y)
++CHECKER_PLUGIN := -fplugin=$(objtree)/tools/gcc/checker_plugin.so -DCHECKER_PLUGIN
 +endif
-+GCC_PLUGINS := $(CONSTIFY_PLUGIN) $(STACKLEAK_PLUGIN) $(KALLOCSTAT_PLUGIN) $(KERNEXEC_PLUGIN)
-+export CONSTIFY_PLUGIN STACKLEAK_PLUGIN KERNEXEC_PLUGIN
++endif
++GCC_PLUGINS := $(CONSTIFY_PLUGIN) $(STACKLEAK_PLUGIN) $(KALLOCSTAT_PLUGIN) $(KERNEXEC_PLUGIN) $(CHECKER_PLUGIN)
++export CONSTIFY_PLUGIN STACKLEAK_PLUGIN KERNEXEC_PLUGIN CHECKER_PLUGIN
 +gcc-plugins:
 +      $(Q)$(MAKE) $(build)=tools/gcc
 +else
 +gcc-plugins:
 +ifeq ($(call cc-ifversion, -ge, 0405, y), y)
-+      $(error Your gcc installation does not support plugins.  If the necessary headers for plugin support are missing, they should be installed.  On Debian, apt-get install gcc-<ver>-plugin-dev.))
++      $(error Your gcc installation does not support plugins.  If the necessary headers for plugin support are missing, they should be installed.  On Debian, apt-get install gcc-<ver>-plugin-dev.  If you choose to ignore this error and lessen the improvements provided by this patch, re-run make with the DISABLE_PAX_PLUGINS=y argument.))
 +else
 +      $(Q)echo "warning, your gcc version does not support plugins, you should upgrade it to gcc 4.5 at least"
 +endif
-+      $(Q)echo "PAX_MEMORY_STACKLEAK and constification will be less secure"
++      $(Q)echo "PAX_MEMORY_STACKLEAK and other features will be less secure"
++endif
 +endif
 +
  include $(srctree)/arch/$(SRCARCH)/Makefile
  
  ifneq ($(CONFIG_FRAME_WARN),0)
-@@ -708,7 +736,7 @@ export mod_strip_cmd
+@@ -708,7 +744,7 @@ export mod_strip_cmd
  
  
  ifeq ($(KBUILD_EXTMOD),)
@@ -63911,26 +67146,24 @@ diff -urNp linux-3.0.4/Makefile linux-3.0.4/Makefile
  
  vmlinux-dirs  := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
                     $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
-@@ -907,6 +935,8 @@ define rule_vmlinux-modpost
- endef
+@@ -932,6 +968,7 @@ vmlinux.o: $(modpost-init) $(vmlinux-mai
  
- # vmlinux image - including updated kernel symbols
-+$(vmlinux-all): KBUILD_CFLAGS += $(GCC_PLUGINS)
-+$(vmlinux-all): gcc-plugins
- vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) vmlinux.o $(kallsyms.o) FORCE
- ifdef CONFIG_HEADERS_CHECK
-       $(Q)$(MAKE) -f $(srctree)/Makefile headers_check
-@@ -941,7 +971,8 @@ $(sort $(vmlinux-init) $(vmlinux-main)) 
+ # The actual objects are generated when descending, 
+ # make sure no implicit rule kicks in
++$(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): KBUILD_CFLAGS += $(GCC_PLUGINS)
+ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
+ # Handle descending into subdirectories listed in $(vmlinux-dirs)
+@@ -941,7 +978,7 @@ $(sort $(vmlinux-init) $(vmlinux-main)) 
  # Error messages still appears in the original language
  
  PHONY += $(vmlinux-dirs)
 -$(vmlinux-dirs): prepare scripts
-+$(vmlinux-dirs): KBUILD_CFLAGS += $(GCC_PLUGINS)
 +$(vmlinux-dirs): gcc-plugins prepare scripts
        $(Q)$(MAKE) $(build)=$@
  
  # Store (new) KERNELRELASE string in include/config/kernel.release
-@@ -986,6 +1017,7 @@ prepare0: archprepare FORCE
+@@ -986,6 +1023,7 @@ prepare0: archprepare FORCE
        $(Q)$(MAKE) $(build)=. missing-syscalls
  
  # All the preparing..
@@ -63938,7 +67171,15 @@ diff -urNp linux-3.0.4/Makefile linux-3.0.4/Makefile
  prepare: prepare0
  
  # Generate some files
-@@ -1102,7 +1134,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modu
+@@ -1087,6 +1125,7 @@ all: modules
+ #     using awk while concatenating to the final file.
+ PHONY += modules
++modules: KBUILD_CFLAGS += $(GCC_PLUGINS)
+ modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
+       $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
+       @$(kecho) '  Building modules, stage 2.';
+@@ -1102,7 +1141,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modu
  
  # Target to prepare building external modules
  PHONY += modules_prepare
@@ -63947,7 +67188,7 @@ diff -urNp linux-3.0.4/Makefile linux-3.0.4/Makefile
  
  # Target to install modules
  PHONY += modules_install
-@@ -1198,7 +1230,7 @@ distclean: mrproper
+@@ -1198,7 +1237,7 @@ distclean: mrproper
        @find $(srctree) $(RCS_FIND_IGNORE) \
                \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
                -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
@@ -63956,7 +67197,7 @@ diff -urNp linux-3.0.4/Makefile linux-3.0.4/Makefile
                -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
                -type f -print | xargs rm -f
  
-@@ -1359,6 +1391,7 @@ PHONY += $(module-dirs) modules
+@@ -1360,6 +1399,7 @@ PHONY += $(module-dirs) modules
  $(module-dirs): crmodverdir $(objtree)/Module.symvers
        $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
  
@@ -63964,7 +67205,7 @@ diff -urNp linux-3.0.4/Makefile linux-3.0.4/Makefile
  modules: $(module-dirs)
        @$(kecho) '  Building modules, stage 2.';
        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
-@@ -1485,17 +1518,19 @@ else
+@@ -1486,17 +1526,19 @@ else
          target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
  endif
  
@@ -63988,7 +67229,7 @@ diff -urNp linux-3.0.4/Makefile linux-3.0.4/Makefile
        $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
  %.symtypes: %.c prepare scripts FORCE
        $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
-@@ -1505,11 +1540,13 @@ endif
+@@ -1506,11 +1548,13 @@ endif
        $(cmd_crmodverdir)
        $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
        $(build)=$(build-dir)
@@ -64004,10 +67245,10 @@ diff -urNp linux-3.0.4/Makefile linux-3.0.4/Makefile
        $(cmd_crmodverdir)
        $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1)   \
        $(build)=$(build-dir) $(@:.ko=.o)
-diff -urNp linux-3.0.4/mm/filemap.c linux-3.0.4/mm/filemap.c
---- linux-3.0.4/mm/filemap.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/filemap.c   2011-08-23 21:48:14.000000000 -0400
-@@ -1763,7 +1763,7 @@ int generic_file_mmap(struct file * file
+diff -urNp linux-3.1.3/mm/filemap.c linux-3.1.3/mm/filemap.c
+--- linux-3.1.3/mm/filemap.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/filemap.c   2011-11-16 18:40:44.000000000 -0500
+@@ -1784,7 +1784,7 @@ int generic_file_mmap(struct file * file
        struct address_space *mapping = file->f_mapping;
  
        if (!mapping->a_ops->readpage)
@@ -64016,7 +67257,7 @@ diff -urNp linux-3.0.4/mm/filemap.c linux-3.0.4/mm/filemap.c
        file_accessed(file);
        vma->vm_ops = &generic_file_vm_ops;
        vma->vm_flags |= VM_CAN_NONLINEAR;
-@@ -2169,6 +2169,7 @@ inline int generic_write_checks(struct f
+@@ -2190,6 +2190,7 @@ inline int generic_write_checks(struct f
                          *pos = i_size_read(inode);
  
                if (limit != RLIM_INFINITY) {
@@ -64024,9 +67265,9 @@ diff -urNp linux-3.0.4/mm/filemap.c linux-3.0.4/mm/filemap.c
                        if (*pos >= limit) {
                                send_sig(SIGXFSZ, current, 0);
                                return -EFBIG;
-diff -urNp linux-3.0.4/mm/fremap.c linux-3.0.4/mm/fremap.c
---- linux-3.0.4/mm/fremap.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/fremap.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/mm/fremap.c linux-3.1.3/mm/fremap.c
+--- linux-3.1.3/mm/fremap.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/fremap.c    2011-11-16 18:39:08.000000000 -0500
 @@ -156,6 +156,11 @@ SYSCALL_DEFINE5(remap_file_pages, unsign
   retry:
        vma = find_vma(mm, start);
@@ -64039,9 +67280,9 @@ diff -urNp linux-3.0.4/mm/fremap.c linux-3.0.4/mm/fremap.c
        /*
         * Make sure the vma is shared, that it supports prefaulting,
         * and that the remapped range is valid and fully within
-diff -urNp linux-3.0.4/mm/highmem.c linux-3.0.4/mm/highmem.c
---- linux-3.0.4/mm/highmem.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/highmem.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/mm/highmem.c linux-3.1.3/mm/highmem.c
+--- linux-3.1.3/mm/highmem.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/highmem.c   2011-11-16 18:39:08.000000000 -0500
 @@ -125,9 +125,10 @@ static void flush_all_zero_pkmaps(void)
                 * So no dangers, even with speculative execution.
                 */
@@ -64067,9 +67308,9 @@ diff -urNp linux-3.0.4/mm/highmem.c linux-3.0.4/mm/highmem.c
        pkmap_count[last_pkmap_nr] = 1;
        set_page_address(page, (void *)vaddr);
  
-diff -urNp linux-3.0.4/mm/huge_memory.c linux-3.0.4/mm/huge_memory.c
---- linux-3.0.4/mm/huge_memory.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/huge_memory.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/mm/huge_memory.c linux-3.1.3/mm/huge_memory.c
+--- linux-3.1.3/mm/huge_memory.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/huge_memory.c       2011-11-16 18:39:08.000000000 -0500
 @@ -702,7 +702,7 @@ out:
         * run pte_offset_map on the pmd, if an huge pmd could
         * materialize from under us from a different thread.
@@ -64079,10 +67320,10 @@ diff -urNp linux-3.0.4/mm/huge_memory.c linux-3.0.4/mm/huge_memory.c
                return VM_FAULT_OOM;
        /* if an huge pmd materialized from under us just retry later */
        if (unlikely(pmd_trans_huge(*pmd)))
-diff -urNp linux-3.0.4/mm/hugetlb.c linux-3.0.4/mm/hugetlb.c
---- linux-3.0.4/mm/hugetlb.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/hugetlb.c   2011-08-23 21:47:56.000000000 -0400
-@@ -2339,6 +2339,27 @@ static int unmap_ref_private(struct mm_s
+diff -urNp linux-3.1.3/mm/hugetlb.c linux-3.1.3/mm/hugetlb.c
+--- linux-3.1.3/mm/hugetlb.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/hugetlb.c   2011-11-16 18:39:08.000000000 -0500
+@@ -2346,6 +2346,27 @@ static int unmap_ref_private(struct mm_s
        return 1;
  }
  
@@ -64110,7 +67351,7 @@ diff -urNp linux-3.0.4/mm/hugetlb.c linux-3.0.4/mm/hugetlb.c
  /*
   * Hugetlb_cow() should be called with page lock of the original hugepage held.
   */
-@@ -2440,6 +2461,11 @@ retry_avoidcopy:
+@@ -2447,6 +2468,11 @@ retry_avoidcopy:
                                make_huge_pte(vma, new_page, 1));
                page_remove_rmap(old_page);
                hugepage_add_new_anon_rmap(new_page, vma, address);
@@ -64122,7 +67363,7 @@ diff -urNp linux-3.0.4/mm/hugetlb.c linux-3.0.4/mm/hugetlb.c
                /* Make the old page be freed below */
                new_page = old_page;
                mmu_notifier_invalidate_range_end(mm,
-@@ -2591,6 +2617,10 @@ retry:
+@@ -2598,6 +2624,10 @@ retry:
                                && (vma->vm_flags & VM_SHARED)));
        set_huge_pte_at(mm, address, ptep, new_pte);
  
@@ -64133,7 +67374,7 @@ diff -urNp linux-3.0.4/mm/hugetlb.c linux-3.0.4/mm/hugetlb.c
        if ((flags & FAULT_FLAG_WRITE) && !(vma->vm_flags & VM_SHARED)) {
                /* Optimization, do the COW without a second fault */
                ret = hugetlb_cow(mm, vma, address, ptep, new_pte, page);
-@@ -2620,6 +2650,10 @@ int hugetlb_fault(struct mm_struct *mm, 
+@@ -2627,6 +2657,10 @@ int hugetlb_fault(struct mm_struct *mm, 
        static DEFINE_MUTEX(hugetlb_instantiation_mutex);
        struct hstate *h = hstate_vma(vma);
  
@@ -64144,7 +67385,7 @@ diff -urNp linux-3.0.4/mm/hugetlb.c linux-3.0.4/mm/hugetlb.c
        ptep = huge_pte_offset(mm, address);
        if (ptep) {
                entry = huge_ptep_get(ptep);
-@@ -2631,6 +2665,26 @@ int hugetlb_fault(struct mm_struct *mm, 
+@@ -2638,6 +2672,26 @@ int hugetlb_fault(struct mm_struct *mm, 
                               VM_FAULT_SET_HINDEX(h - hstates);
        }
  
@@ -64171,10 +67412,10 @@ diff -urNp linux-3.0.4/mm/hugetlb.c linux-3.0.4/mm/hugetlb.c
        ptep = huge_pte_alloc(mm, address, huge_page_size(h));
        if (!ptep)
                return VM_FAULT_OOM;
-diff -urNp linux-3.0.4/mm/internal.h linux-3.0.4/mm/internal.h
---- linux-3.0.4/mm/internal.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/internal.h  2011-08-23 21:47:56.000000000 -0400
-@@ -49,6 +49,7 @@ extern void putback_lru_page(struct page
+diff -urNp linux-3.1.3/mm/internal.h linux-3.1.3/mm/internal.h
+--- linux-3.1.3/mm/internal.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/internal.h  2011-11-16 18:39:08.000000000 -0500
+@@ -95,6 +95,7 @@ extern void putback_lru_page(struct page
   * in mm/page_alloc.c
   */
  extern void __free_pages_bootmem(struct page *page, unsigned int order);
@@ -64182,21 +67423,26 @@ diff -urNp linux-3.0.4/mm/internal.h linux-3.0.4/mm/internal.h
  extern void prep_compound_page(struct page *page, unsigned long order);
  #ifdef CONFIG_MEMORY_FAILURE
  extern bool is_free_buddy_page(struct page *page);
-diff -urNp linux-3.0.4/mm/Kconfig linux-3.0.4/mm/Kconfig
---- linux-3.0.4/mm/Kconfig     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/Kconfig     2011-08-23 21:48:14.000000000 -0400
-@@ -240,7 +240,7 @@ config KSM
+diff -urNp linux-3.1.3/mm/Kconfig linux-3.1.3/mm/Kconfig
+--- linux-3.1.3/mm/Kconfig     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/Kconfig     2011-11-17 18:57:00.000000000 -0500
+@@ -238,10 +238,10 @@ config KSM
+         root has set /sys/kernel/mm/ksm/run to 1 (if CONFIG_SYSFS is set).
  config DEFAULT_MMAP_MIN_ADDR
-         int "Low address space to protect from user allocation"
+-        int "Low address space to protect from user allocation"
++      int "Low address space to protect from user allocation"
        depends on MMU
 -        default 4096
-+        default 65536
-         help
+-        help
++      default 65536
++      help
          This is the portion of low virtual memory which should be protected
          from userspace allocation.  Keeping a user from writing to low pages
-diff -urNp linux-3.0.4/mm/kmemleak.c linux-3.0.4/mm/kmemleak.c
---- linux-3.0.4/mm/kmemleak.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/kmemleak.c  2011-08-23 21:48:14.000000000 -0400
+         can help reduce the impact of kernel NULL pointer bugs.
+diff -urNp linux-3.1.3/mm/kmemleak.c linux-3.1.3/mm/kmemleak.c
+--- linux-3.1.3/mm/kmemleak.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/kmemleak.c  2011-11-16 18:40:44.000000000 -0500
 @@ -357,7 +357,7 @@ static void print_unreferenced(struct se
  
        for (i = 0; i < object->trace_len; i++) {
@@ -64206,9 +67452,30 @@ diff -urNp linux-3.0.4/mm/kmemleak.c linux-3.0.4/mm/kmemleak.c
        }
  }
  
-diff -urNp linux-3.0.4/mm/madvise.c linux-3.0.4/mm/madvise.c
---- linux-3.0.4/mm/madvise.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/madvise.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/mm/maccess.c linux-3.1.3/mm/maccess.c
+--- linux-3.1.3/mm/maccess.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/maccess.c   2011-11-16 18:39:08.000000000 -0500
+@@ -26,7 +26,7 @@ long __probe_kernel_read(void *dst, cons
+       set_fs(KERNEL_DS);
+       pagefault_disable();
+       ret = __copy_from_user_inatomic(dst,
+-                      (__force const void __user *)src, size);
++                      (const void __force_user *)src, size);
+       pagefault_enable();
+       set_fs(old_fs);
+@@ -53,7 +53,7 @@ long __probe_kernel_write(void *dst, con
+       set_fs(KERNEL_DS);
+       pagefault_disable();
+-      ret = __copy_to_user_inatomic((__force void __user *)dst, src, size);
++      ret = __copy_to_user_inatomic((void __force_user *)dst, src, size);
+       pagefault_enable();
+       set_fs(old_fs);
+diff -urNp linux-3.1.3/mm/madvise.c linux-3.1.3/mm/madvise.c
+--- linux-3.1.3/mm/madvise.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/madvise.c   2011-11-16 18:39:08.000000000 -0500
 @@ -45,6 +45,10 @@ static long madvise_behavior(struct vm_a
        pgoff_t pgoff;
        unsigned long new_flags = vma->vm_flags;
@@ -64285,9 +67552,9 @@ diff -urNp linux-3.0.4/mm/madvise.c linux-3.0.4/mm/madvise.c
        error = 0;
        if (end == start)
                goto out;
-diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
---- linux-3.0.4/mm/memory.c    2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/mm/memory.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/mm/memory.c linux-3.1.3/mm/memory.c
+--- linux-3.1.3/mm/memory.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/memory.c    2011-11-16 18:39:08.000000000 -0500
 @@ -457,8 +457,12 @@ static inline void free_pmd_range(struct
                return;
  
@@ -64314,7 +67581,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
  }
  
  /*
-@@ -1577,12 +1584,6 @@ no_page_table:
+@@ -1566,12 +1573,6 @@ no_page_table:
        return page;
  }
  
@@ -64327,7 +67594,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
  /**
   * __get_user_pages() - pin user pages in memory
   * @tsk:      task_struct of target task
-@@ -1655,10 +1656,10 @@ int __get_user_pages(struct task_struct 
+@@ -1644,10 +1645,10 @@ int __get_user_pages(struct task_struct 
                        (VM_MAYREAD | VM_MAYWRITE) : (VM_READ | VM_WRITE);
        i = 0;
  
@@ -64340,7 +67607,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
                if (!vma && in_gate_area(mm, start)) {
                        unsigned long pg = start & PAGE_MASK;
                        pgd_t *pgd;
-@@ -1706,7 +1707,7 @@ int __get_user_pages(struct task_struct 
+@@ -1695,7 +1696,7 @@ int __get_user_pages(struct task_struct 
                        goto next_page;
                }
  
@@ -64349,7 +67616,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
                    (vma->vm_flags & (VM_IO | VM_PFNMAP)) ||
                    !(vm_flags & vma->vm_flags))
                        return i ? : -EFAULT;
-@@ -1733,11 +1734,6 @@ int __get_user_pages(struct task_struct 
+@@ -1722,11 +1723,6 @@ int __get_user_pages(struct task_struct 
                                int ret;
                                unsigned int fault_flags = 0;
  
@@ -64361,7 +67628,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
                                if (foll_flags & FOLL_WRITE)
                                        fault_flags |= FAULT_FLAG_WRITE;
                                if (nonblocking)
-@@ -1811,7 +1807,7 @@ next_page:
+@@ -1800,7 +1796,7 @@ next_page:
                        start += PAGE_SIZE;
                        nr_pages--;
                } while (nr_pages && start < vma->vm_end);
@@ -64370,7 +67637,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
        return i;
  }
  EXPORT_SYMBOL(__get_user_pages);
-@@ -2018,6 +2014,10 @@ static int insert_page(struct vm_area_st
+@@ -2007,6 +2003,10 @@ static int insert_page(struct vm_area_st
        page_add_file_rmap(page);
        set_pte_at(mm, addr, pte, mk_pte(page, prot));
  
@@ -64381,7 +67648,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
        retval = 0;
        pte_unmap_unlock(pte, ptl);
        return retval;
-@@ -2052,10 +2052,22 @@ out:
+@@ -2041,10 +2041,22 @@ out:
  int vm_insert_page(struct vm_area_struct *vma, unsigned long addr,
                        struct page *page)
  {
@@ -64404,7 +67671,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
        vma->vm_flags |= VM_INSERTPAGE;
        return insert_page(vma, addr, page, vma->vm_page_prot);
  }
-@@ -2141,6 +2153,7 @@ int vm_insert_mixed(struct vm_area_struc
+@@ -2130,6 +2142,7 @@ int vm_insert_mixed(struct vm_area_struc
                        unsigned long pfn)
  {
        BUG_ON(!(vma->vm_flags & VM_MIXEDMAP));
@@ -64412,7 +67679,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
  
        if (addr < vma->vm_start || addr >= vma->vm_end)
                return -EFAULT;
-@@ -2456,6 +2469,186 @@ static inline void cow_user_page(struct 
+@@ -2445,6 +2458,186 @@ static inline void cow_user_page(struct 
                copy_user_highpage(dst, src, va, vma);
  }
  
@@ -64599,7 +67866,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
  /*
   * This routine handles present pages, when users try to write
   * to a shared page. It is done by copying the page to a new address
-@@ -2667,6 +2860,12 @@ gotten:
+@@ -2656,6 +2849,12 @@ gotten:
         */
        page_table = pte_offset_map_lock(mm, pmd, address, &ptl);
        if (likely(pte_same(*page_table, orig_pte))) {
@@ -64612,7 +67879,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
                if (old_page) {
                        if (!PageAnon(old_page)) {
                                dec_mm_counter_fast(mm, MM_FILEPAGES);
-@@ -2718,6 +2917,10 @@ gotten:
+@@ -2707,6 +2906,10 @@ gotten:
                        page_remove_rmap(old_page);
                }
  
@@ -64623,7 +67890,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
                /* Free the old page.. */
                new_page = old_page;
                ret |= VM_FAULT_WRITE;
-@@ -2997,6 +3200,11 @@ static int do_swap_page(struct mm_struct
+@@ -2986,6 +3189,11 @@ static int do_swap_page(struct mm_struct
        swap_free(entry);
        if (vm_swap_full() || (vma->vm_flags & VM_LOCKED) || PageMlocked(page))
                try_to_free_swap(page);
@@ -64635,7 +67902,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
        unlock_page(page);
        if (swapcache) {
                /*
-@@ -3020,6 +3228,11 @@ static int do_swap_page(struct mm_struct
+@@ -3009,6 +3217,11 @@ static int do_swap_page(struct mm_struct
  
        /* No need to invalidate - it was non-present before */
        update_mmu_cache(vma, address, page_table);
@@ -64647,7 +67914,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
  unlock:
        pte_unmap_unlock(page_table, ptl);
  out:
-@@ -3039,40 +3252,6 @@ out_release:
+@@ -3028,40 +3241,6 @@ out_release:
  }
  
  /*
@@ -64688,7 +67955,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
   * We enter with non-exclusive mmap_sem (to exclude vma changes,
   * but allow concurrent faults), and pte mapped but not yet locked.
   * We return with mmap_sem still held, but pte unmapped and unlocked.
-@@ -3081,27 +3260,23 @@ static int do_anonymous_page(struct mm_s
+@@ -3070,27 +3249,23 @@ static int do_anonymous_page(struct mm_s
                unsigned long address, pte_t *page_table, pmd_t *pmd,
                unsigned int flags)
  {
@@ -64721,7 +67988,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
        if (unlikely(anon_vma_prepare(vma)))
                goto oom;
        page = alloc_zeroed_user_highpage_movable(vma, address);
-@@ -3120,6 +3295,11 @@ static int do_anonymous_page(struct mm_s
+@@ -3109,6 +3284,11 @@ static int do_anonymous_page(struct mm_s
        if (!pte_none(*page_table))
                goto release;
  
@@ -64733,7 +68000,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
        inc_mm_counter_fast(mm, MM_ANONPAGES);
        page_add_new_anon_rmap(page, vma, address);
  setpte:
-@@ -3127,6 +3307,12 @@ setpte:
+@@ -3116,6 +3296,12 @@ setpte:
  
        /* No need to invalidate - it was non-present before */
        update_mmu_cache(vma, address, page_table);
@@ -64746,7 +68013,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
  unlock:
        pte_unmap_unlock(page_table, ptl);
        return 0;
-@@ -3264,6 +3450,12 @@ static int __do_fault(struct mm_struct *
+@@ -3259,6 +3445,12 @@ static int __do_fault(struct mm_struct *
         */
        /* Only go through if we didn't race with anybody else... */
        if (likely(pte_same(*page_table, orig_pte))) {
@@ -64759,7 +68026,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
                flush_icache_page(vma, page);
                entry = mk_pte(page, vma->vm_page_prot);
                if (flags & FAULT_FLAG_WRITE)
-@@ -3283,6 +3475,14 @@ static int __do_fault(struct mm_struct *
+@@ -3278,6 +3470,14 @@ static int __do_fault(struct mm_struct *
  
                /* no need to invalidate: a not-present page won't be cached */
                update_mmu_cache(vma, address, page_table);
@@ -64772,9 +68039,9 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
 +#endif
 +
        } else {
-               if (charged)
-                       mem_cgroup_uncharge_page(page);
-@@ -3430,6 +3630,12 @@ int handle_pte_fault(struct mm_struct *m
+               if (cow_page)
+                       mem_cgroup_uncharge_page(cow_page);
+@@ -3431,6 +3631,12 @@ int handle_pte_fault(struct mm_struct *m
                if (flags & FAULT_FLAG_WRITE)
                        flush_tlb_fix_spurious_fault(vma, address);
        }
@@ -64787,7 +68054,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
  unlock:
        pte_unmap_unlock(pte, ptl);
        return 0;
-@@ -3446,6 +3652,10 @@ int handle_mm_fault(struct mm_struct *mm
+@@ -3447,6 +3653,10 @@ int handle_mm_fault(struct mm_struct *mm
        pmd_t *pmd;
        pte_t *pte;
  
@@ -64798,7 +68065,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
        __set_current_state(TASK_RUNNING);
  
        count_vm_event(PGFAULT);
-@@ -3457,6 +3667,34 @@ int handle_mm_fault(struct mm_struct *mm
+@@ -3458,6 +3668,34 @@ int handle_mm_fault(struct mm_struct *mm
        if (unlikely(is_vm_hugetlb_page(vma)))
                return hugetlb_fault(mm, vma, address, flags);
  
@@ -64833,7 +68100,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
        pgd = pgd_offset(mm, address);
        pud = pud_alloc(mm, pgd, address);
        if (!pud)
-@@ -3486,7 +3724,7 @@ int handle_mm_fault(struct mm_struct *mm
+@@ -3487,7 +3725,7 @@ int handle_mm_fault(struct mm_struct *mm
         * run pte_offset_map on the pmd, if an huge pmd could
         * materialize from under us from a different thread.
         */
@@ -64842,7 +68109,7 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
                return VM_FAULT_OOM;
        /* if an huge pmd materialized from under us just retry later */
        if (unlikely(pmd_trans_huge(*pmd)))
-@@ -3590,7 +3828,7 @@ static int __init gate_vma_init(void)
+@@ -3591,7 +3829,7 @@ static int __init gate_vma_init(void)
        gate_vma.vm_start = FIXADDR_USER_START;
        gate_vma.vm_end = FIXADDR_USER_END;
        gate_vma.vm_flags = VM_READ | VM_MAYREAD | VM_EXEC | VM_MAYEXEC;
@@ -64851,10 +68118,10 @@ diff -urNp linux-3.0.4/mm/memory.c linux-3.0.4/mm/memory.c
        /*
         * Make sure the vDSO gets into every core dump.
         * Dumping its contents makes post-mortem fully interpretable later
-diff -urNp linux-3.0.4/mm/memory-failure.c linux-3.0.4/mm/memory-failure.c
---- linux-3.0.4/mm/memory-failure.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/memory-failure.c    2011-08-23 21:47:56.000000000 -0400
-@@ -59,7 +59,7 @@ int sysctl_memory_failure_early_kill __r
+diff -urNp linux-3.1.3/mm/memory-failure.c linux-3.1.3/mm/memory-failure.c
+--- linux-3.1.3/mm/memory-failure.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/memory-failure.c    2011-11-16 18:39:08.000000000 -0500
+@@ -60,7 +60,7 @@ int sysctl_memory_failure_early_kill __r
  
  int sysctl_memory_failure_recovery __read_mostly = 1;
  
@@ -64863,7 +68130,16 @@ diff -urNp linux-3.0.4/mm/memory-failure.c linux-3.0.4/mm/memory-failure.c
  
  #if defined(CONFIG_HWPOISON_INJECT) || defined(CONFIG_HWPOISON_INJECT_MODULE)
  
-@@ -1008,7 +1008,7 @@ int __memory_failure(unsigned long pfn, 
+@@ -201,7 +201,7 @@ static int kill_proc_ao(struct task_stru
+       si.si_signo = SIGBUS;
+       si.si_errno = 0;
+       si.si_code = BUS_MCEERR_AO;
+-      si.si_addr = (void *)addr;
++      si.si_addr = (void __user *)addr;
+ #ifdef __ARCH_SI_TRAPNO
+       si.si_trapno = trapno;
+ #endif
+@@ -1009,7 +1009,7 @@ int __memory_failure(unsigned long pfn, 
        }
  
        nr_pages = 1 << compound_trans_order(hpage);
@@ -64872,7 +68148,7 @@ diff -urNp linux-3.0.4/mm/memory-failure.c linux-3.0.4/mm/memory-failure.c
  
        /*
         * We need/can do nothing about count=0 pages.
-@@ -1038,7 +1038,7 @@ int __memory_failure(unsigned long pfn, 
+@@ -1039,7 +1039,7 @@ int __memory_failure(unsigned long pfn, 
                        if (!PageHWPoison(hpage)
                            || (hwpoison_filter(p) && TestClearPageHWPoison(p))
                            || (p != hpage && TestSetPageHWPoison(hpage))) {
@@ -64881,7 +68157,7 @@ diff -urNp linux-3.0.4/mm/memory-failure.c linux-3.0.4/mm/memory-failure.c
                                return 0;
                        }
                        set_page_hwpoison_huge_page(hpage);
-@@ -1096,7 +1096,7 @@ int __memory_failure(unsigned long pfn, 
+@@ -1097,7 +1097,7 @@ int __memory_failure(unsigned long pfn, 
        }
        if (hwpoison_filter(p)) {
                if (TestClearPageHWPoison(p))
@@ -64890,7 +68166,7 @@ diff -urNp linux-3.0.4/mm/memory-failure.c linux-3.0.4/mm/memory-failure.c
                unlock_page(hpage);
                put_page(hpage);
                return 0;
-@@ -1222,7 +1222,7 @@ int unpoison_memory(unsigned long pfn)
+@@ -1314,7 +1314,7 @@ int unpoison_memory(unsigned long pfn)
                        return 0;
                }
                if (TestClearPageHWPoison(p))
@@ -64899,7 +68175,7 @@ diff -urNp linux-3.0.4/mm/memory-failure.c linux-3.0.4/mm/memory-failure.c
                pr_info("MCE: Software-unpoisoned free page %#lx\n", pfn);
                return 0;
        }
-@@ -1236,7 +1236,7 @@ int unpoison_memory(unsigned long pfn)
+@@ -1328,7 +1328,7 @@ int unpoison_memory(unsigned long pfn)
         */
        if (TestClearPageHWPoison(page)) {
                pr_info("MCE: Software-unpoisoned page %#lx\n", pfn);
@@ -64908,7 +68184,7 @@ diff -urNp linux-3.0.4/mm/memory-failure.c linux-3.0.4/mm/memory-failure.c
                freeit = 1;
                if (PageHuge(page))
                        clear_page_hwpoison_huge_page(page);
-@@ -1349,7 +1349,7 @@ static int soft_offline_huge_page(struct
+@@ -1441,7 +1441,7 @@ static int soft_offline_huge_page(struct
        }
  done:
        if (!PageHWPoison(hpage))
@@ -64917,7 +68193,7 @@ diff -urNp linux-3.0.4/mm/memory-failure.c linux-3.0.4/mm/memory-failure.c
        set_page_hwpoison_huge_page(hpage);
        dequeue_hwpoisoned_huge_page(hpage);
        /* keep elevated page count for bad page */
-@@ -1480,7 +1480,7 @@ int soft_offline_page(struct page *page,
+@@ -1572,7 +1572,7 @@ int soft_offline_page(struct page *page,
                return ret;
  
  done:
@@ -64926,9 +68202,9 @@ diff -urNp linux-3.0.4/mm/memory-failure.c linux-3.0.4/mm/memory-failure.c
        SetPageHWPoison(page);
        /* keep elevated page count for bad page */
        return ret;
-diff -urNp linux-3.0.4/mm/mempolicy.c linux-3.0.4/mm/mempolicy.c
---- linux-3.0.4/mm/mempolicy.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/mempolicy.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/mm/mempolicy.c linux-3.1.3/mm/mempolicy.c
+--- linux-3.1.3/mm/mempolicy.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/mempolicy.c 2011-11-16 18:40:44.000000000 -0500
 @@ -639,6 +639,10 @@ static int mbind_range(struct mm_struct 
        unsigned long vmstart;
        unsigned long vmend;
@@ -65000,9 +68276,9 @@ diff -urNp linux-3.0.4/mm/mempolicy.c linux-3.0.4/mm/mempolicy.c
                rcu_read_unlock();
                err = -EPERM;
                goto out;
-diff -urNp linux-3.0.4/mm/migrate.c linux-3.0.4/mm/migrate.c
---- linux-3.0.4/mm/migrate.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/migrate.c   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/mm/migrate.c linux-3.1.3/mm/migrate.c
+--- linux-3.1.3/mm/migrate.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/migrate.c   2011-11-16 18:40:44.000000000 -0500
 @@ -1124,6 +1124,8 @@ static int do_pages_move(struct mm_struc
        unsigned long chunk_start;
        int err;
@@ -65037,9 +68313,9 @@ diff -urNp linux-3.0.4/mm/migrate.c linux-3.0.4/mm/migrate.c
                rcu_read_unlock();
                err = -EPERM;
                goto out;
-diff -urNp linux-3.0.4/mm/mlock.c linux-3.0.4/mm/mlock.c
---- linux-3.0.4/mm/mlock.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/mlock.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/mm/mlock.c linux-3.1.3/mm/mlock.c
+--- linux-3.1.3/mm/mlock.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/mlock.c     2011-11-16 18:40:44.000000000 -0500
 @@ -13,6 +13,7 @@
  #include <linux/pagemap.h>
  #include <linux/mempolicy.h>
@@ -65113,9 +68389,9 @@ diff -urNp linux-3.0.4/mm/mlock.c linux-3.0.4/mm/mlock.c
        if (!(flags & MCL_CURRENT) || (current->mm->total_vm <= lock_limit) ||
            capable(CAP_IPC_LOCK))
                ret = do_mlockall(flags);
-diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
---- linux-3.0.4/mm/mmap.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/mmap.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/mm/mmap.c linux-3.1.3/mm/mmap.c
+--- linux-3.1.3/mm/mmap.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/mmap.c      2011-11-16 18:40:44.000000000 -0500
 @@ -46,6 +46,16 @@
  #define arch_rebalance_pgtables(addr, len)            (addr)
  #endif
@@ -65169,7 +68445,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
  /*
   * Make sure vm_committed_as in one cacheline and not cacheline shared with
   * other variables. It can be updated by several CPUs frequently.
-@@ -236,6 +256,7 @@ static struct vm_area_struct *remove_vma
+@@ -228,6 +248,7 @@ static struct vm_area_struct *remove_vma
        struct vm_area_struct *next = vma->vm_next;
  
        might_sleep();
@@ -65177,7 +68453,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        if (vma->vm_ops && vma->vm_ops->close)
                vma->vm_ops->close(vma);
        if (vma->vm_file) {
-@@ -280,6 +301,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
+@@ -272,6 +293,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
         * not page aligned -Ram Gupta
         */
        rlim = rlimit(RLIMIT_DATA);
@@ -65185,7 +68461,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        if (rlim < RLIM_INFINITY && (brk - mm->start_brk) +
                        (mm->end_data - mm->start_data) > rlim)
                goto out;
-@@ -697,6 +719,12 @@ static int
+@@ -689,6 +711,12 @@ static int
  can_vma_merge_before(struct vm_area_struct *vma, unsigned long vm_flags,
        struct anon_vma *anon_vma, struct file *file, pgoff_t vm_pgoff)
  {
@@ -65198,7 +68474,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        if (is_mergeable_vma(vma, file, vm_flags) &&
            is_mergeable_anon_vma(anon_vma, vma->anon_vma, vma)) {
                if (vma->vm_pgoff == vm_pgoff)
-@@ -716,6 +744,12 @@ static int
+@@ -708,6 +736,12 @@ static int
  can_vma_merge_after(struct vm_area_struct *vma, unsigned long vm_flags,
        struct anon_vma *anon_vma, struct file *file, pgoff_t vm_pgoff)
  {
@@ -65211,7 +68487,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        if (is_mergeable_vma(vma, file, vm_flags) &&
            is_mergeable_anon_vma(anon_vma, vma->anon_vma, vma)) {
                pgoff_t vm_pglen;
-@@ -758,13 +792,20 @@ can_vma_merge_after(struct vm_area_struc
+@@ -750,13 +784,20 @@ can_vma_merge_after(struct vm_area_struc
  struct vm_area_struct *vma_merge(struct mm_struct *mm,
                        struct vm_area_struct *prev, unsigned long addr,
                        unsigned long end, unsigned long vm_flags,
@@ -65233,7 +68509,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        /*
         * We later require that vma->vm_flags == vm_flags,
         * so this tests vma->vm_flags & VM_SPECIAL, too.
-@@ -780,6 +821,15 @@ struct vm_area_struct *vma_merge(struct 
+@@ -772,6 +813,15 @@ struct vm_area_struct *vma_merge(struct 
        if (next && next->vm_end == end)                /* cases 6, 7, 8 */
                next = next->vm_next;
  
@@ -65249,7 +68525,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        /*
         * Can it merge with the predecessor?
         */
-@@ -799,9 +849,24 @@ struct vm_area_struct *vma_merge(struct 
+@@ -791,9 +841,24 @@ struct vm_area_struct *vma_merge(struct 
                                                        /* cases 1, 6 */
                        err = vma_adjust(prev, prev->vm_start,
                                next->vm_end, prev->vm_pgoff, NULL);
@@ -65275,7 +68551,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
                if (err)
                        return NULL;
                khugepaged_enter_vma_merge(prev);
-@@ -815,12 +880,27 @@ struct vm_area_struct *vma_merge(struct 
+@@ -807,12 +872,27 @@ struct vm_area_struct *vma_merge(struct 
                        mpol_equal(policy, vma_policy(next)) &&
                        can_vma_merge_before(next, vm_flags,
                                        anon_vma, file, pgoff+pglen)) {
@@ -65305,7 +68581,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
                if (err)
                        return NULL;
                khugepaged_enter_vma_merge(area);
-@@ -929,14 +1009,11 @@ none:
+@@ -921,14 +1001,11 @@ none:
  void vm_stat_account(struct mm_struct *mm, unsigned long flags,
                                                struct file *file, long pages)
  {
@@ -65321,7 +68597,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
                mm->stack_vm += pages;
        if (flags & (VM_RESERVED|VM_IO))
                mm->reserved_vm += pages;
-@@ -963,7 +1040,7 @@ unsigned long do_mmap_pgoff(struct file 
+@@ -955,7 +1032,7 @@ unsigned long do_mmap_pgoff(struct file 
         * (the exception is when the underlying filesystem is noexec
         *  mounted, in which case we dont add PROT_EXEC.)
         */
@@ -65330,7 +68606,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
                if (!(file && (file->f_path.mnt->mnt_flags & MNT_NOEXEC)))
                        prot |= PROT_EXEC;
  
-@@ -989,7 +1066,7 @@ unsigned long do_mmap_pgoff(struct file 
+@@ -981,7 +1058,7 @@ unsigned long do_mmap_pgoff(struct file 
        /* Obtain the address to map to. we verify (or select) it and ensure
         * that it represents a valid section of the address space.
         */
@@ -65339,7 +68615,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        if (addr & ~PAGE_MASK)
                return addr;
  
-@@ -1000,6 +1077,36 @@ unsigned long do_mmap_pgoff(struct file 
+@@ -992,6 +1069,36 @@ unsigned long do_mmap_pgoff(struct file 
        vm_flags = calc_vm_prot_bits(prot) | calc_vm_flag_bits(flags) |
                        mm->def_flags | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC;
  
@@ -65376,7 +68652,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        if (flags & MAP_LOCKED)
                if (!can_do_mlock())
                        return -EPERM;
-@@ -1011,6 +1118,7 @@ unsigned long do_mmap_pgoff(struct file 
+@@ -1003,6 +1110,7 @@ unsigned long do_mmap_pgoff(struct file 
                locked += mm->locked_vm;
                lock_limit = rlimit(RLIMIT_MEMLOCK);
                lock_limit >>= PAGE_SHIFT;
@@ -65384,7 +68660,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
                if (locked > lock_limit && !capable(CAP_IPC_LOCK))
                        return -EAGAIN;
        }
-@@ -1081,6 +1189,9 @@ unsigned long do_mmap_pgoff(struct file 
+@@ -1073,6 +1181,9 @@ unsigned long do_mmap_pgoff(struct file 
        if (error)
                return error;
  
@@ -65394,7 +68670,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        return mmap_region(file, addr, len, flags, vm_flags, pgoff);
  }
  EXPORT_SYMBOL(do_mmap_pgoff);
-@@ -1161,7 +1272,7 @@ int vma_wants_writenotify(struct vm_area
+@@ -1153,7 +1264,7 @@ int vma_wants_writenotify(struct vm_area
        vm_flags_t vm_flags = vma->vm_flags;
  
        /* If it was private or non-writable, the write bit is already clear */
@@ -65403,7 +68679,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
                return 0;
  
        /* The backer wishes to know when pages are first written to? */
-@@ -1210,14 +1321,24 @@ unsigned long mmap_region(struct file *f
+@@ -1202,14 +1313,24 @@ unsigned long mmap_region(struct file *f
        unsigned long charged = 0;
        struct inode *inode =  file ? file->f_path.dentry->d_inode : NULL;
  
@@ -65430,7 +68706,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        }
  
        /* Check against address space limit. */
-@@ -1266,6 +1387,16 @@ munmap_back:
+@@ -1258,6 +1379,16 @@ munmap_back:
                goto unacct_error;
        }
  
@@ -65447,7 +68723,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        vma->vm_mm = mm;
        vma->vm_start = addr;
        vma->vm_end = addr + len;
-@@ -1289,6 +1420,19 @@ munmap_back:
+@@ -1281,6 +1412,19 @@ munmap_back:
                error = file->f_op->mmap(file, vma);
                if (error)
                        goto unmap_and_free_vma;
@@ -65467,7 +68743,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
                if (vm_flags & VM_EXECUTABLE)
                        added_exe_file_vma(mm);
  
-@@ -1324,6 +1468,11 @@ munmap_back:
+@@ -1316,6 +1460,11 @@ munmap_back:
        vma_link(mm, vma, prev, rb_link, rb_parent);
        file = vma->vm_file;
  
@@ -65479,7 +68755,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        /* Once vma denies write, undo our temporary denial count */
        if (correct_wcount)
                atomic_inc(&inode->i_writecount);
-@@ -1332,6 +1481,7 @@ out:
+@@ -1324,6 +1473,7 @@ out:
  
        mm->total_vm += len >> PAGE_SHIFT;
        vm_stat_account(mm, vm_flags, file, len >> PAGE_SHIFT);
@@ -65487,7 +68763,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        if (vm_flags & VM_LOCKED) {
                if (!mlock_vma_pages_range(vma, addr, addr + len))
                        mm->locked_vm += (len >> PAGE_SHIFT);
-@@ -1349,6 +1499,12 @@ unmap_and_free_vma:
+@@ -1341,6 +1491,12 @@ unmap_and_free_vma:
        unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end);
        charged = 0;
  free_vma:
@@ -65500,7 +68776,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        kmem_cache_free(vm_area_cachep, vma);
  unacct_error:
        if (charged)
-@@ -1356,6 +1512,44 @@ unacct_error:
+@@ -1348,6 +1504,44 @@ unacct_error:
        return error;
  }
  
@@ -65545,7 +68821,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
  /* Get an address range which is currently unmapped.
   * For shmat() with addr=0.
   *
-@@ -1382,18 +1576,23 @@ arch_get_unmapped_area(struct file *filp
+@@ -1374,18 +1568,23 @@ arch_get_unmapped_area(struct file *filp
        if (flags & MAP_FIXED)
                return addr;
  
@@ -65576,7 +68852,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        }
  
  full_search:
-@@ -1404,34 +1603,40 @@ full_search:
+@@ -1396,34 +1595,40 @@ full_search:
                         * Start a new search - just in case we missed
                         * some holes.
                         */
@@ -65628,7 +68904,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
                mm->free_area_cache = addr;
                mm->cached_hole_size = ~0UL;
        }
-@@ -1449,7 +1654,7 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -1441,7 +1646,7 @@ arch_get_unmapped_area_topdown(struct fi
  {
        struct vm_area_struct *vma;
        struct mm_struct *mm = current->mm;
@@ -65637,7 +68913,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
  
        /* requested length too big for entire address space */
        if (len > TASK_SIZE)
-@@ -1458,13 +1663,18 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -1450,13 +1655,18 @@ arch_get_unmapped_area_topdown(struct fi
        if (flags & MAP_FIXED)
                return addr;
  
@@ -65660,7 +68936,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        }
  
        /* check if free_area_cache is useful for us */
-@@ -1479,7 +1689,7 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -1471,7 +1681,7 @@ arch_get_unmapped_area_topdown(struct fi
        /* make sure it can fit in the remaining address space */
        if (addr > len) {
                vma = find_vma(mm, addr-len);
@@ -65669,7 +68945,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
                        /* remember the address as a hint for next time */
                        return (mm->free_area_cache = addr-len);
        }
-@@ -1496,7 +1706,7 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -1488,7 +1698,7 @@ arch_get_unmapped_area_topdown(struct fi
                 * return with success:
                 */
                vma = find_vma(mm, addr);
@@ -65678,7 +68954,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
                        /* remember the address as a hint for next time */
                        return (mm->free_area_cache = addr);
  
-@@ -1505,8 +1715,8 @@ arch_get_unmapped_area_topdown(struct fi
+@@ -1497,8 +1707,8 @@ arch_get_unmapped_area_topdown(struct fi
                        mm->cached_hole_size = vma->vm_start - addr;
  
                /* try just below the current vma->vm_start */
@@ -65689,7 +68965,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
  
  bottomup:
        /*
-@@ -1515,13 +1725,21 @@ bottomup:
+@@ -1507,13 +1717,21 @@ bottomup:
         * can happen with large stack limits and large mmap()
         * allocations.
         */
@@ -65713,7 +68989,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        mm->cached_hole_size = ~0UL;
  
        return addr;
-@@ -1530,6 +1748,12 @@ bottomup:
+@@ -1522,6 +1740,12 @@ bottomup:
  
  void arch_unmap_area_topdown(struct mm_struct *mm, unsigned long addr)
  {
@@ -65726,7 +69002,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        /*
         * Is this a new hole at the highest possible address?
         */
-@@ -1537,8 +1761,10 @@ void arch_unmap_area_topdown(struct mm_s
+@@ -1529,8 +1753,10 @@ void arch_unmap_area_topdown(struct mm_s
                mm->free_area_cache = addr;
  
        /* dont allow allocations above current base */
@@ -65738,7 +69014,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
  }
  
  unsigned long
-@@ -1646,6 +1872,28 @@ out:
+@@ -1638,6 +1864,28 @@ out:
        return prev ? prev->vm_next : vma;
  }
  
@@ -65767,7 +69043,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
  /*
   * Verify that the stack growth is acceptable and
   * update accounting. This is shared with both the
-@@ -1662,6 +1910,7 @@ static int acct_stack_growth(struct vm_a
+@@ -1654,6 +1902,7 @@ static int acct_stack_growth(struct vm_a
                return -ENOMEM;
  
        /* Stack limit test */
@@ -65775,7 +69051,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        if (size > ACCESS_ONCE(rlim[RLIMIT_STACK].rlim_cur))
                return -ENOMEM;
  
-@@ -1672,6 +1921,7 @@ static int acct_stack_growth(struct vm_a
+@@ -1664,6 +1913,7 @@ static int acct_stack_growth(struct vm_a
                locked = mm->locked_vm + grow;
                limit = ACCESS_ONCE(rlim[RLIMIT_MEMLOCK].rlim_cur);
                limit >>= PAGE_SHIFT;
@@ -65783,7 +69059,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
                if (locked > limit && !capable(CAP_IPC_LOCK))
                        return -ENOMEM;
        }
-@@ -1702,37 +1952,48 @@ static int acct_stack_growth(struct vm_a
+@@ -1694,37 +1944,48 @@ static int acct_stack_growth(struct vm_a
   * PA-RISC uses this for its stack; IA64 for its Register Backing Store.
   * vma is the last one with address > vma->vm_end.  Have to extend vma.
   */
@@ -65841,7 +69117,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
                unsigned long size, grow;
  
                size = address - vma->vm_start;
-@@ -1747,6 +2008,8 @@ int expand_upwards(struct vm_area_struct
+@@ -1739,6 +2000,8 @@ int expand_upwards(struct vm_area_struct
                        }
                }
        }
@@ -65850,7 +69126,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        vma_unlock_anon_vma(vma);
        khugepaged_enter_vma_merge(vma);
        return error;
-@@ -1760,6 +2023,8 @@ int expand_downwards(struct vm_area_stru
+@@ -1752,6 +2015,8 @@ int expand_downwards(struct vm_area_stru
                                   unsigned long address)
  {
        int error;
@@ -65859,7 +69135,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
  
        /*
         * We must make sure the anon_vma is allocated
-@@ -1773,6 +2038,15 @@ int expand_downwards(struct vm_area_stru
+@@ -1765,6 +2030,15 @@ int expand_downwards(struct vm_area_stru
        if (error)
                return error;
  
@@ -65875,7 +69151,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        vma_lock_anon_vma(vma);
  
        /*
-@@ -1782,9 +2056,17 @@ int expand_downwards(struct vm_area_stru
+@@ -1774,9 +2048,17 @@ int expand_downwards(struct vm_area_stru
         */
  
        /* Somebody else might have raced and expanded it already */
@@ -65894,7 +69170,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
                size = vma->vm_end - address;
                grow = (vma->vm_start - address) >> PAGE_SHIFT;
  
-@@ -1794,11 +2076,22 @@ int expand_downwards(struct vm_area_stru
+@@ -1786,11 +2068,22 @@ int expand_downwards(struct vm_area_stru
                        if (!error) {
                                vma->vm_start = address;
                                vma->vm_pgoff -= grow;
@@ -65917,7 +69193,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        khugepaged_enter_vma_merge(vma);
        return error;
  }
-@@ -1868,6 +2161,13 @@ static void remove_vma_list(struct mm_st
+@@ -1860,6 +2153,13 @@ static void remove_vma_list(struct mm_st
        do {
                long nrpages = vma_pages(vma);
  
@@ -65931,7 +69207,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
                mm->total_vm -= nrpages;
                vm_stat_account(mm, vma->vm_flags, vma->vm_file, -nrpages);
                vma = remove_vma(vma);
-@@ -1913,6 +2213,16 @@ detach_vmas_to_be_unmapped(struct mm_str
+@@ -1905,6 +2205,16 @@ detach_vmas_to_be_unmapped(struct mm_str
        insertion_point = (prev ? &prev->vm_next : &mm->mmap);
        vma->vm_prev = NULL;
        do {
@@ -65948,7 +69224,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
                rb_erase(&vma->vm_rb, &mm->mm_rb);
                mm->map_count--;
                tail_vma = vma;
-@@ -1941,14 +2251,33 @@ static int __split_vma(struct mm_struct 
+@@ -1933,14 +2243,33 @@ static int __split_vma(struct mm_struct 
        struct vm_area_struct *new;
        int err = -ENOMEM;
  
@@ -65982,7 +69258,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        /* most fields are the same, copy all, and then fixup */
        *new = *vma;
  
-@@ -1961,6 +2290,22 @@ static int __split_vma(struct mm_struct 
+@@ -1953,6 +2282,22 @@ static int __split_vma(struct mm_struct 
                new->vm_pgoff += ((addr - vma->vm_start) >> PAGE_SHIFT);
        }
  
@@ -66005,7 +69281,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        pol = mpol_dup(vma_policy(vma));
        if (IS_ERR(pol)) {
                err = PTR_ERR(pol);
-@@ -1986,6 +2331,42 @@ static int __split_vma(struct mm_struct 
+@@ -1978,6 +2323,42 @@ static int __split_vma(struct mm_struct 
        else
                err = vma_adjust(vma, vma->vm_start, addr, vma->vm_pgoff, new);
  
@@ -66048,7 +69324,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        /* Success. */
        if (!err)
                return 0;
-@@ -1998,10 +2379,18 @@ static int __split_vma(struct mm_struct 
+@@ -1990,10 +2371,18 @@ static int __split_vma(struct mm_struct 
                        removed_exe_file_vma(mm);
                fput(new->vm_file);
        }
@@ -66068,7 +69344,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        kmem_cache_free(vm_area_cachep, new);
   out_err:
        return err;
-@@ -2014,6 +2403,15 @@ static int __split_vma(struct mm_struct 
+@@ -2006,6 +2395,15 @@ static int __split_vma(struct mm_struct 
  int split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
              unsigned long addr, int new_below)
  {
@@ -66084,7 +69360,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        if (mm->map_count >= sysctl_max_map_count)
                return -ENOMEM;
  
-@@ -2025,11 +2423,30 @@ int split_vma(struct mm_struct *mm, stru
+@@ -2017,11 +2415,30 @@ int split_vma(struct mm_struct *mm, stru
   * work.  This now handles partial unmappings.
   * Jeremy Fitzhardinge <jeremy@goop.org>
   */
@@ -66115,7 +69391,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        if ((start & ~PAGE_MASK) || start > TASK_SIZE || len > TASK_SIZE-start)
                return -EINVAL;
  
-@@ -2104,6 +2521,8 @@ int do_munmap(struct mm_struct *mm, unsi
+@@ -2096,6 +2513,8 @@ int do_munmap(struct mm_struct *mm, unsi
        /* Fix up all other VM information */
        remove_vma_list(mm, vma);
  
@@ -66124,7 +69400,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        return 0;
  }
  
-@@ -2116,22 +2535,18 @@ SYSCALL_DEFINE2(munmap, unsigned long, a
+@@ -2108,22 +2527,18 @@ SYSCALL_DEFINE2(munmap, unsigned long, a
  
        profile_munmap(addr);
  
@@ -66153,7 +69429,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
  /*
   *  this is really a simplified "do_mmap".  it only handles
   *  anonymous maps.  eventually we may be able to do some
-@@ -2145,6 +2560,7 @@ unsigned long do_brk(unsigned long addr,
+@@ -2137,6 +2552,7 @@ unsigned long do_brk(unsigned long addr,
        struct rb_node ** rb_link, * rb_parent;
        pgoff_t pgoff = addr >> PAGE_SHIFT;
        int error;
@@ -66161,7 +69437,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
  
        len = PAGE_ALIGN(len);
        if (!len)
-@@ -2156,16 +2572,30 @@ unsigned long do_brk(unsigned long addr,
+@@ -2148,16 +2564,30 @@ unsigned long do_brk(unsigned long addr,
  
        flags = VM_DATA_DEFAULT_FLAGS | VM_ACCOUNT | mm->def_flags;
  
@@ -66193,7 +69469,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
                locked += mm->locked_vm;
                lock_limit = rlimit(RLIMIT_MEMLOCK);
                lock_limit >>= PAGE_SHIFT;
-@@ -2182,22 +2612,22 @@ unsigned long do_brk(unsigned long addr,
+@@ -2174,22 +2604,22 @@ unsigned long do_brk(unsigned long addr,
        /*
         * Clear old maps.  this also does some error checking for us
         */
@@ -66220,7 +69496,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
                return -ENOMEM;
  
        /* Can we just expand an old private anonymous mapping? */
-@@ -2211,7 +2641,7 @@ unsigned long do_brk(unsigned long addr,
+@@ -2203,7 +2633,7 @@ unsigned long do_brk(unsigned long addr,
         */
        vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
        if (!vma) {
@@ -66229,7 +69505,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
                return -ENOMEM;
        }
  
-@@ -2225,11 +2655,12 @@ unsigned long do_brk(unsigned long addr,
+@@ -2217,11 +2647,12 @@ unsigned long do_brk(unsigned long addr,
        vma_link(mm, vma, prev, rb_link, rb_parent);
  out:
        perf_event_mmap(vma);
@@ -66244,7 +69520,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        return addr;
  }
  
-@@ -2276,8 +2707,10 @@ void exit_mmap(struct mm_struct *mm)
+@@ -2268,8 +2699,10 @@ void exit_mmap(struct mm_struct *mm)
         * Walk the list again, actually closing and freeing it,
         * with preemption enabled, without holding any MM locks.
         */
@@ -66256,7 +69532,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
  
        BUG_ON(mm->nr_ptes > (FIRST_USER_ADDRESS+PMD_SIZE-1)>>PMD_SHIFT);
  }
-@@ -2291,6 +2724,13 @@ int insert_vm_struct(struct mm_struct * 
+@@ -2283,6 +2716,13 @@ int insert_vm_struct(struct mm_struct * 
        struct vm_area_struct * __vma, * prev;
        struct rb_node ** rb_link, * rb_parent;
  
@@ -66270,7 +69546,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        /*
         * The vm_pgoff of a purely anonymous vma should be irrelevant
         * until its first write fault, when page's anon_vma and index
-@@ -2313,7 +2753,22 @@ int insert_vm_struct(struct mm_struct * 
+@@ -2305,7 +2745,22 @@ int insert_vm_struct(struct mm_struct * 
        if ((vma->vm_flags & VM_ACCOUNT) &&
             security_vm_enough_memory_mm(mm, vma_pages(vma)))
                return -ENOMEM;
@@ -66293,7 +69569,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        return 0;
  }
  
-@@ -2331,6 +2786,8 @@ struct vm_area_struct *copy_vma(struct v
+@@ -2323,6 +2778,8 @@ struct vm_area_struct *copy_vma(struct v
        struct rb_node **rb_link, *rb_parent;
        struct mempolicy *pol;
  
@@ -66302,7 +69578,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        /*
         * If anonymous vma has not yet been faulted, update new pgoff
         * to match new location, to increase its chance of merging.
-@@ -2381,6 +2838,39 @@ struct vm_area_struct *copy_vma(struct v
+@@ -2373,6 +2830,39 @@ struct vm_area_struct *copy_vma(struct v
        return NULL;
  }
  
@@ -66342,7 +69618,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
  /*
   * Return true if the calling process may expand its vm space by the passed
   * number of pages
-@@ -2391,7 +2881,7 @@ int may_expand_vm(struct mm_struct *mm, 
+@@ -2383,7 +2873,7 @@ int may_expand_vm(struct mm_struct *mm, 
        unsigned long lim;
  
        lim = rlimit(RLIMIT_AS) >> PAGE_SHIFT;
@@ -66351,7 +69627,7 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        if (cur + npages > lim)
                return 0;
        return 1;
-@@ -2462,6 +2952,22 @@ int install_special_mapping(struct mm_st
+@@ -2454,6 +2944,22 @@ int install_special_mapping(struct mm_st
        vma->vm_start = addr;
        vma->vm_end = addr + len;
  
@@ -66374,9 +69650,9 @@ diff -urNp linux-3.0.4/mm/mmap.c linux-3.0.4/mm/mmap.c
        vma->vm_flags = vm_flags | mm->def_flags | VM_DONTEXPAND;
        vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
  
-diff -urNp linux-3.0.4/mm/mprotect.c linux-3.0.4/mm/mprotect.c
---- linux-3.0.4/mm/mprotect.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/mprotect.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/mm/mprotect.c linux-3.1.3/mm/mprotect.c
+--- linux-3.1.3/mm/mprotect.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/mprotect.c  2011-11-16 18:40:44.000000000 -0500
 @@ -23,10 +23,16 @@
  #include <linux/mmu_notifier.h>
  #include <linux/migrate.h>
@@ -66603,9 +69879,9 @@ diff -urNp linux-3.0.4/mm/mprotect.c linux-3.0.4/mm/mprotect.c
                nstart = tmp;
  
                if (nstart < prev->vm_end)
-diff -urNp linux-3.0.4/mm/mremap.c linux-3.0.4/mm/mremap.c
---- linux-3.0.4/mm/mremap.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/mremap.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/mm/mremap.c linux-3.1.3/mm/mremap.c
+--- linux-3.1.3/mm/mremap.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/mremap.c    2011-11-16 18:39:08.000000000 -0500
 @@ -113,6 +113,12 @@ static void move_ptes(struct vm_area_str
                        continue;
                pte = ptep_clear_flush(vma, old_addr, old_pte);
@@ -66710,9 +69986,9 @@ diff -urNp linux-3.0.4/mm/mremap.c linux-3.0.4/mm/mremap.c
        }
  out:
        if (ret & ~PAGE_MASK)
-diff -urNp linux-3.0.4/mm/nobootmem.c linux-3.0.4/mm/nobootmem.c
---- linux-3.0.4/mm/nobootmem.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/nobootmem.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/mm/nobootmem.c linux-3.1.3/mm/nobootmem.c
+--- linux-3.1.3/mm/nobootmem.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/nobootmem.c 2011-11-16 18:39:08.000000000 -0500
 @@ -110,19 +110,30 @@ static void __init __free_pages_memory(u
  unsigned long __init free_all_memory_core_early(int nodeid)
  {
@@ -66746,10 +70022,10 @@ diff -urNp linux-3.0.4/mm/nobootmem.c linux-3.0.4/mm/nobootmem.c
  
        return count;
  }
-diff -urNp linux-3.0.4/mm/nommu.c linux-3.0.4/mm/nommu.c
---- linux-3.0.4/mm/nommu.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/nommu.c     2011-08-23 21:47:56.000000000 -0400
-@@ -63,7 +63,6 @@ int sysctl_overcommit_memory = OVERCOMMI
+diff -urNp linux-3.1.3/mm/nommu.c linux-3.1.3/mm/nommu.c
+--- linux-3.1.3/mm/nommu.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/nommu.c     2011-11-16 18:39:08.000000000 -0500
+@@ -62,7 +62,6 @@ int sysctl_overcommit_memory = OVERCOMMI
  int sysctl_overcommit_ratio = 50; /* default is 50% */
  int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT;
  int sysctl_nr_trim_pages = CONFIG_NOMMU_INITIAL_TRIM_EXCESS;
@@ -66757,7 +70033,7 @@ diff -urNp linux-3.0.4/mm/nommu.c linux-3.0.4/mm/nommu.c
  
  atomic_long_t mmap_pages_allocated;
  
-@@ -826,15 +825,6 @@ struct vm_area_struct *find_vma(struct m
+@@ -825,15 +824,6 @@ struct vm_area_struct *find_vma(struct m
  EXPORT_SYMBOL(find_vma);
  
  /*
@@ -66773,7 +70049,7 @@ diff -urNp linux-3.0.4/mm/nommu.c linux-3.0.4/mm/nommu.c
   * expand a stack to a given address
   * - not supported under NOMMU conditions
   */
-@@ -1554,6 +1544,7 @@ int split_vma(struct mm_struct *mm, stru
+@@ -1553,6 +1543,7 @@ int split_vma(struct mm_struct *mm, stru
  
        /* most fields are the same, copy all, and then fixup */
        *new = *vma;
@@ -66781,9 +70057,21 @@ diff -urNp linux-3.0.4/mm/nommu.c linux-3.0.4/mm/nommu.c
        *region = *vma->vm_region;
        new->vm_region = region;
  
-diff -urNp linux-3.0.4/mm/page_alloc.c linux-3.0.4/mm/page_alloc.c
---- linux-3.0.4/mm/page_alloc.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/page_alloc.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/mm/oom_kill.c linux-3.1.3/mm/oom_kill.c
+--- linux-3.1.3/mm/oom_kill.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/oom_kill.c  2011-11-18 18:44:21.000000000 -0500
+@@ -162,7 +162,7 @@ static bool oom_unkillable_task(struct t
+ unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem,
+                     const nodemask_t *nodemask, unsigned long totalpages)
+ {
+-      int points;
++      long points;
+       if (oom_unkillable_task(p, mem, nodemask))
+               return 0;
+diff -urNp linux-3.1.3/mm/page_alloc.c linux-3.1.3/mm/page_alloc.c
+--- linux-3.1.3/mm/page_alloc.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/page_alloc.c        2011-11-16 18:40:44.000000000 -0500
 @@ -340,7 +340,7 @@ out:
   * This usage means that zero-order pages may not be compound.
   */
@@ -66828,7 +70116,7 @@ diff -urNp linux-3.0.4/mm/page_alloc.c linux-3.0.4/mm/page_alloc.c
  
        if (order && (gfp_flags & __GFP_COMP))
                prep_compound_page(page, order);
-@@ -2525,6 +2537,8 @@ void show_free_areas(unsigned int filter
+@@ -2539,6 +2551,8 @@ void show_free_areas(unsigned int filter
        int cpu;
        struct zone *zone;
  
@@ -66837,9 +70125,23 @@ diff -urNp linux-3.0.4/mm/page_alloc.c linux-3.0.4/mm/page_alloc.c
        for_each_populated_zone(zone) {
                if (skip_free_areas_node(filter, zone_to_nid(zone)))
                        continue;
-diff -urNp linux-3.0.4/mm/percpu.c linux-3.0.4/mm/percpu.c
---- linux-3.0.4/mm/percpu.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/percpu.c    2011-08-23 21:47:56.000000000 -0400
+@@ -3350,7 +3364,13 @@ static int pageblock_is_reserved(unsigne
+       unsigned long pfn;
+       for (pfn = start_pfn; pfn < end_pfn; pfn++) {
++#ifdef CONFIG_X86_32
++              /* boot failures in VMware 8 on 32bit vanilla since
++                 this change */
++              if (!pfn_valid(pfn) || PageReserved(pfn_to_page(pfn)))
++#else
+               if (!pfn_valid_within(pfn) || PageReserved(pfn_to_page(pfn)))
++#endif
+                       return 1;
+       }
+       return 0;
+diff -urNp linux-3.1.3/mm/percpu.c linux-3.1.3/mm/percpu.c
+--- linux-3.1.3/mm/percpu.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/percpu.c    2011-11-16 18:39:08.000000000 -0500
 @@ -121,7 +121,7 @@ static unsigned int pcpu_first_unit_cpu 
  static unsigned int pcpu_last_unit_cpu __read_mostly;
  
@@ -66849,10 +70151,10 @@ diff -urNp linux-3.0.4/mm/percpu.c linux-3.0.4/mm/percpu.c
  EXPORT_SYMBOL_GPL(pcpu_base_addr);
  
  static const int *pcpu_unit_map __read_mostly;                /* cpu -> unit */
-diff -urNp linux-3.0.4/mm/rmap.c linux-3.0.4/mm/rmap.c
---- linux-3.0.4/mm/rmap.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/rmap.c      2011-08-23 21:47:56.000000000 -0400
-@@ -153,6 +153,10 @@ int anon_vma_prepare(struct vm_area_stru
+diff -urNp linux-3.1.3/mm/rmap.c linux-3.1.3/mm/rmap.c
+--- linux-3.1.3/mm/rmap.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/rmap.c      2011-11-16 18:39:08.000000000 -0500
+@@ -152,6 +152,10 @@ int anon_vma_prepare(struct vm_area_stru
        struct anon_vma *anon_vma = vma->anon_vma;
        struct anon_vma_chain *avc;
  
@@ -66863,7 +70165,7 @@ diff -urNp linux-3.0.4/mm/rmap.c linux-3.0.4/mm/rmap.c
        might_sleep();
        if (unlikely(!anon_vma)) {
                struct mm_struct *mm = vma->vm_mm;
-@@ -162,6 +166,12 @@ int anon_vma_prepare(struct vm_area_stru
+@@ -161,6 +165,12 @@ int anon_vma_prepare(struct vm_area_stru
                if (!avc)
                        goto out_enomem;
  
@@ -66876,7 +70178,7 @@ diff -urNp linux-3.0.4/mm/rmap.c linux-3.0.4/mm/rmap.c
                anon_vma = find_mergeable_anon_vma(vma);
                allocated = NULL;
                if (!anon_vma) {
-@@ -175,6 +185,21 @@ int anon_vma_prepare(struct vm_area_stru
+@@ -174,6 +184,21 @@ int anon_vma_prepare(struct vm_area_stru
                /* page_table_lock to protect against threads */
                spin_lock(&mm->page_table_lock);
                if (likely(!vma->anon_vma)) {
@@ -66898,7 +70200,7 @@ diff -urNp linux-3.0.4/mm/rmap.c linux-3.0.4/mm/rmap.c
                        vma->anon_vma = anon_vma;
                        avc->anon_vma = anon_vma;
                        avc->vma = vma;
-@@ -188,12 +213,24 @@ int anon_vma_prepare(struct vm_area_stru
+@@ -187,12 +212,24 @@ int anon_vma_prepare(struct vm_area_stru
  
                if (unlikely(allocated))
                        put_anon_vma(allocated);
@@ -66923,7 +70225,7 @@ diff -urNp linux-3.0.4/mm/rmap.c linux-3.0.4/mm/rmap.c
        anon_vma_chain_free(avc);
   out_enomem:
        return -ENOMEM;
-@@ -244,7 +281,7 @@ static void anon_vma_chain_link(struct v
+@@ -243,7 +280,7 @@ static void anon_vma_chain_link(struct v
   * Attach the anon_vmas from src to dst.
   * Returns 0 on success, -ENOMEM on failure.
   */
@@ -66932,7 +70234,7 @@ diff -urNp linux-3.0.4/mm/rmap.c linux-3.0.4/mm/rmap.c
  {
        struct anon_vma_chain *avc, *pavc;
        struct anon_vma *root = NULL;
-@@ -277,7 +314,7 @@ int anon_vma_clone(struct vm_area_struct
+@@ -276,7 +313,7 @@ int anon_vma_clone(struct vm_area_struct
   * the corresponding VMA in the parent process is attached to.
   * Returns 0 on success, non-zero on failure.
   */
@@ -66941,11 +70243,11 @@ diff -urNp linux-3.0.4/mm/rmap.c linux-3.0.4/mm/rmap.c
  {
        struct anon_vma_chain *avc;
        struct anon_vma *anon_vma;
-diff -urNp linux-3.0.4/mm/shmem.c linux-3.0.4/mm/shmem.c
---- linux-3.0.4/mm/shmem.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/shmem.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/mm/shmem.c linux-3.1.3/mm/shmem.c
+--- linux-3.1.3/mm/shmem.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/shmem.c     2011-11-16 19:28:28.000000000 -0500
 @@ -31,7 +31,7 @@
- #include <linux/percpu_counter.h>
+ #include <linux/module.h>
  #include <linux/swap.h>
  
 -static struct vfsmount *shm_mnt;
@@ -66953,25 +70255,25 @@ diff -urNp linux-3.0.4/mm/shmem.c linux-3.0.4/mm/shmem.c
  
  #ifdef CONFIG_SHMEM
  /*
-@@ -1101,6 +1101,8 @@ static int shmem_writepage(struct page *
-               goto unlock;
-       }
-       entry = shmem_swp_entry(info, index, NULL);
-+      if (!entry)
-+              goto unlock;
-       if (entry->val) {
-               /*
-                * The more uptodate page coming down from a stacked
-@@ -1172,6 +1174,8 @@ static struct page *shmem_swapin(swp_ent
+@@ -74,7 +74,7 @@ static struct vfsmount *shm_mnt;
+ #define BOGO_DIRENT_SIZE 20
+ /* Symlink up to this size is kmalloc'ed instead of using a swappable page */
+-#define SHORT_SYMLINK_LEN 128
++#define SHORT_SYMLINK_LEN 64
+ struct shmem_xattr {
+       struct list_head list;  /* anchored by shmem_inode_info->xattr_list */
+@@ -769,6 +769,8 @@ static struct page *shmem_swapin(swp_ent
+       struct mempolicy mpol, *spol;
        struct vm_area_struct pvma;
-       struct page *page;
  
 +      pax_track_stack();
 +
        spol = mpol_cond_copy(&mpol,
-                               mpol_shared_policy_lookup(&info->policy, idx));
+                       mpol_shared_policy_lookup(&info->policy, index));
  
-@@ -2568,8 +2572,7 @@ int shmem_fill_super(struct super_block 
+@@ -2149,8 +2151,7 @@ int shmem_fill_super(struct super_block 
        int err = -ENOMEM;
  
        /* Round up to L1_CACHE_BYTES to resist false sharing */
@@ -66981,9 +70283,9 @@ diff -urNp linux-3.0.4/mm/shmem.c linux-3.0.4/mm/shmem.c
        if (!sbinfo)
                return -ENOMEM;
  
-diff -urNp linux-3.0.4/mm/slab.c linux-3.0.4/mm/slab.c
---- linux-3.0.4/mm/slab.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/slab.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/mm/slab.c linux-3.1.3/mm/slab.c
+--- linux-3.1.3/mm/slab.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/slab.c      2011-11-16 18:40:44.000000000 -0500
 @@ -151,7 +151,7 @@
  
  /* Legal flag mask for kmem_cache_create(). */
@@ -67044,7 +70346,7 @@ diff -urNp linux-3.0.4/mm/slab.c linux-3.0.4/mm/slab.c
  #undef CACHE
  };
  
-@@ -1530,7 +1530,7 @@ void __init kmem_cache_init(void)
+@@ -1571,7 +1571,7 @@ void __init kmem_cache_init(void)
        sizes[INDEX_AC].cs_cachep = kmem_cache_create(names[INDEX_AC].name,
                                        sizes[INDEX_AC].cs_size,
                                        ARCH_KMALLOC_MINALIGN,
@@ -67053,7 +70355,7 @@ diff -urNp linux-3.0.4/mm/slab.c linux-3.0.4/mm/slab.c
                                        NULL);
  
        if (INDEX_AC != INDEX_L3) {
-@@ -1538,7 +1538,7 @@ void __init kmem_cache_init(void)
+@@ -1579,7 +1579,7 @@ void __init kmem_cache_init(void)
                        kmem_cache_create(names[INDEX_L3].name,
                                sizes[INDEX_L3].cs_size,
                                ARCH_KMALLOC_MINALIGN,
@@ -67062,7 +70364,7 @@ diff -urNp linux-3.0.4/mm/slab.c linux-3.0.4/mm/slab.c
                                NULL);
        }
  
-@@ -1556,7 +1556,7 @@ void __init kmem_cache_init(void)
+@@ -1597,7 +1597,7 @@ void __init kmem_cache_init(void)
                        sizes->cs_cachep = kmem_cache_create(names->name,
                                        sizes->cs_size,
                                        ARCH_KMALLOC_MINALIGN,
@@ -67071,7 +70373,7 @@ diff -urNp linux-3.0.4/mm/slab.c linux-3.0.4/mm/slab.c
                                        NULL);
                }
  #ifdef CONFIG_ZONE_DMA
-@@ -4272,10 +4272,10 @@ static int s_show(struct seq_file *m, vo
+@@ -4324,10 +4324,10 @@ static int s_show(struct seq_file *m, vo
        }
        /* cpu stats */
        {
@@ -67086,7 +70388,7 @@ diff -urNp linux-3.0.4/mm/slab.c linux-3.0.4/mm/slab.c
  
                seq_printf(m, " : cpustat %6lu %6lu %6lu %6lu",
                           allochit, allocmiss, freehit, freemiss);
-@@ -4532,15 +4532,66 @@ static const struct file_operations proc
+@@ -4584,15 +4584,70 @@ static const struct file_operations proc
  
  static int __init slab_proc_init(void)
  {
@@ -67116,10 +70418,12 @@ diff -urNp linux-3.0.4/mm/slab.c linux-3.0.4/mm/slab.c
 +      struct slab *slabp;
 +      unsigned int objnr;
 +      unsigned long offset;
++      const char *type;
 +
 +      if (!n)
 +              return;
 +
++      type = "<null>";
 +      if (ZERO_OR_NULL_PTR(ptr))
 +              goto report;
 +
@@ -67128,6 +70432,7 @@ diff -urNp linux-3.0.4/mm/slab.c linux-3.0.4/mm/slab.c
 +
 +      page = virt_to_head_page(ptr);
 +
++      type = "<process stack>";
 +      if (!PageSlab(page)) {
 +              if (object_is_on_stack(ptr, n) == -1)
 +                      goto report;
@@ -67135,6 +70440,7 @@ diff -urNp linux-3.0.4/mm/slab.c linux-3.0.4/mm/slab.c
 +      }
 +
 +      cachep = page_get_cache(page);
++      type = cachep->name;
 +      if (!(cachep->flags & SLAB_USERCOPY))
 +              goto report;
 +
@@ -67146,7 +70452,7 @@ diff -urNp linux-3.0.4/mm/slab.c linux-3.0.4/mm/slab.c
 +              return;
 +
 +report:
-+      pax_report_usercopy(ptr, n, to, cachep ? cachep->name : NULL);
++      pax_report_usercopy(ptr, n, to, type);
 +#endif
 +
 +}
@@ -67155,9 +70461,9 @@ diff -urNp linux-3.0.4/mm/slab.c linux-3.0.4/mm/slab.c
  /**
   * ksize - get the actual amount of memory allocated for a given object
   * @objp: Pointer to the object
-diff -urNp linux-3.0.4/mm/slob.c linux-3.0.4/mm/slob.c
---- linux-3.0.4/mm/slob.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/slob.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/mm/slob.c linux-3.1.3/mm/slob.c
+--- linux-3.1.3/mm/slob.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/slob.c      2011-11-16 18:39:08.000000000 -0500
 @@ -29,7 +29,7 @@
   * If kmalloc is asked for objects of PAGE_SIZE or larger, it calls
   * alloc_pages() directly, allocating compound pages so the page order
@@ -67263,8 +70569,8 @@ diff -urNp linux-3.0.4/mm/slob.c linux-3.0.4/mm/slob.c
 +      slob_t *m;
        void *ret;
  
-       lockdep_trace_alloc(gfp);
-@@ -492,7 +494,10 @@ void *__kmalloc_node(size_t size, gfp_t 
+       gfp &= gfp_allowed_mask;
+@@ -494,7 +496,10 @@ void *__kmalloc_node(size_t size, gfp_t 
  
                if (!m)
                        return NULL;
@@ -67276,7 +70582,7 @@ diff -urNp linux-3.0.4/mm/slob.c linux-3.0.4/mm/slob.c
                ret = (void *)m + align;
  
                trace_kmalloc_node(_RET_IP_, ret,
-@@ -504,16 +509,25 @@ void *__kmalloc_node(size_t size, gfp_t 
+@@ -506,16 +511,25 @@ void *__kmalloc_node(size_t size, gfp_t 
                        gfp |= __GFP_COMP;
                ret = slob_new_pages(gfp, order, node);
                if (ret) {
@@ -67306,7 +70612,7 @@ diff -urNp linux-3.0.4/mm/slob.c linux-3.0.4/mm/slob.c
        return ret;
  }
  EXPORT_SYMBOL(__kmalloc_node);
-@@ -531,13 +545,88 @@ void kfree(const void *block)
+@@ -533,13 +547,92 @@ void kfree(const void *block)
        sp = slob_page(block);
        if (is_slob_page(sp)) {
                int align = max(ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN);
@@ -67332,16 +70638,19 @@ diff -urNp linux-3.0.4/mm/slob.c linux-3.0.4/mm/slob.c
 +      const slob_t *free;
 +      const void *base;
 +      unsigned long flags;
++      const char *type;
 +
 +      if (!n)
 +              return;
 +
++      type = "<null>";
 +      if (ZERO_OR_NULL_PTR(ptr))
 +              goto report;
 +
 +      if (!virt_addr_valid(ptr))
 +              return;
 +
++      type = "<process stack>";
 +      sp = slob_page(ptr);
 +      if (!PageSlab((struct page*)sp)) {
 +              if (object_is_on_stack(ptr, n) == -1)
@@ -67349,6 +70658,7 @@ diff -urNp linux-3.0.4/mm/slob.c linux-3.0.4/mm/slob.c
 +              return;
 +      }
 +
++      type = "<slob>";
 +      if (sp->size) {
 +              base = page_address(&sp->page);
 +              if (base <= ptr && n <= sp->size - (ptr - base))
@@ -67389,7 +70699,7 @@ diff -urNp linux-3.0.4/mm/slob.c linux-3.0.4/mm/slob.c
 +
 +      spin_unlock_irqrestore(&slob_lock, flags);
 +report:
-+      pax_report_usercopy(ptr, n, to, NULL);
++      pax_report_usercopy(ptr, n, to, type);
 +#endif
 +
 +}
@@ -67398,7 +70708,7 @@ diff -urNp linux-3.0.4/mm/slob.c linux-3.0.4/mm/slob.c
  /* can't use ksize for kmem_cache_alloc memory, only kmalloc */
  size_t ksize(const void *block)
  {
-@@ -550,10 +639,10 @@ size_t ksize(const void *block)
+@@ -552,10 +645,10 @@ size_t ksize(const void *block)
        sp = slob_page(block);
        if (is_slob_page(sp)) {
                int align = max(ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN);
@@ -67412,7 +70722,7 @@ diff -urNp linux-3.0.4/mm/slob.c linux-3.0.4/mm/slob.c
  }
  EXPORT_SYMBOL(ksize);
  
-@@ -569,8 +658,13 @@ struct kmem_cache *kmem_cache_create(con
+@@ -571,8 +664,13 @@ struct kmem_cache *kmem_cache_create(con
  {
        struct kmem_cache *c;
  
@@ -67426,9 +70736,9 @@ diff -urNp linux-3.0.4/mm/slob.c linux-3.0.4/mm/slob.c
  
        if (c) {
                c->name = name;
-@@ -608,17 +702,25 @@ void *kmem_cache_alloc_node(struct kmem_
- {
-       void *b;
+@@ -614,17 +712,25 @@ void *kmem_cache_alloc_node(struct kmem_
+       lockdep_trace_alloc(flags);
  
 +#ifdef CONFIG_PAX_USERCOPY
 +      b = __kmalloc_node_align(c->size, flags, node, c->align);
@@ -67452,7 +70762,7 @@ diff -urNp linux-3.0.4/mm/slob.c linux-3.0.4/mm/slob.c
  
        if (c->ctor)
                c->ctor(b);
-@@ -630,10 +732,16 @@ EXPORT_SYMBOL(kmem_cache_alloc_node);
+@@ -636,10 +742,16 @@ EXPORT_SYMBOL(kmem_cache_alloc_node);
  
  static void __kmem_cache_free(void *b, int size)
  {
@@ -67471,7 +70781,7 @@ diff -urNp linux-3.0.4/mm/slob.c linux-3.0.4/mm/slob.c
  }
  
  static void kmem_rcu_free(struct rcu_head *head)
-@@ -646,17 +754,31 @@ static void kmem_rcu_free(struct rcu_hea
+@@ -652,17 +764,31 @@ static void kmem_rcu_free(struct rcu_hea
  
  void kmem_cache_free(struct kmem_cache *c, void *b)
  {
@@ -67506,10 +70816,10 @@ diff -urNp linux-3.0.4/mm/slob.c linux-3.0.4/mm/slob.c
  }
  EXPORT_SYMBOL(kmem_cache_free);
  
-diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
---- linux-3.0.4/mm/slub.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/slub.c      2011-09-25 22:15:40.000000000 -0400
-@@ -200,7 +200,7 @@ struct track {
+diff -urNp linux-3.1.3/mm/slub.c linux-3.1.3/mm/slub.c
+--- linux-3.1.3/mm/slub.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/slub.c      2011-11-16 19:27:25.000000000 -0500
+@@ -208,7 +208,7 @@ struct track {
  
  enum track_item { TRACK_ALLOC, TRACK_FREE };
  
@@ -67518,16 +70828,16 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
  static int sysfs_slab_add(struct kmem_cache *);
  static int sysfs_slab_alias(struct kmem_cache *, const char *);
  static void sysfs_slab_remove(struct kmem_cache *);
-@@ -442,7 +442,7 @@ static void print_track(const char *s, s
+@@ -556,7 +556,7 @@ static void print_track(const char *s, s
        if (!t->addr)
                return;
  
 -      printk(KERN_ERR "INFO: %s in %pS age=%lu cpu=%u pid=%d\n",
 +      printk(KERN_ERR "INFO: %s in %pA age=%lu cpu=%u pid=%d\n",
                s, (void *)t->addr, jiffies - t->when, t->cpu, t->pid);
- }
-@@ -2137,6 +2137,8 @@ void kmem_cache_free(struct kmem_cache *
+ #ifdef CONFIG_STACKTRACE
+       {
+@@ -2456,6 +2456,8 @@ void kmem_cache_free(struct kmem_cache *
  
        page = virt_to_head_page(x);
  
@@ -67536,7 +70846,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
        slab_free(s, page, x, _RET_IP_);
  
        trace_kmem_cache_free(_RET_IP_, x);
-@@ -2170,7 +2172,7 @@ static int slub_min_objects;
+@@ -2489,7 +2491,7 @@ static int slub_min_objects;
   * Merge control. If this is set then no merging of slab caches will occur.
   * (Could be removed. This was introduced to pacify the merge skeptics.)
   */
@@ -67545,7 +70855,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
  
  /*
   * Calculate the order of allocation given an slab object size.
-@@ -2594,7 +2596,7 @@ static int kmem_cache_open(struct kmem_c
+@@ -2912,7 +2914,7 @@ static int kmem_cache_open(struct kmem_c
         * list to avoid pounding the page allocator excessively.
         */
        set_min_partial(s, ilog2(s->size));
@@ -67554,7 +70864,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
  #ifdef CONFIG_NUMA
        s->remote_node_defrag_ratio = 1000;
  #endif
-@@ -2699,8 +2701,7 @@ static inline int kmem_cache_close(struc
+@@ -3017,8 +3019,7 @@ static inline int kmem_cache_close(struc
  void kmem_cache_destroy(struct kmem_cache *s)
  {
        down_write(&slub_lock);
@@ -67564,7 +70874,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
                list_del(&s->list);
                if (kmem_cache_close(s)) {
                        printk(KERN_ERR "SLUB %s: %s called for cache that "
-@@ -2910,6 +2911,46 @@ void *__kmalloc_node(size_t size, gfp_t 
+@@ -3228,6 +3229,50 @@ void *__kmalloc_node(size_t size, gfp_t 
  EXPORT_SYMBOL(__kmalloc_node);
  #endif
  
@@ -67575,10 +70885,12 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
 +      struct page *page;
 +      struct kmem_cache *s = NULL;
 +      unsigned long offset;
++      const char *type;
 +
 +      if (!n)
 +              return;
 +
++      type = "<null>";
 +      if (ZERO_OR_NULL_PTR(ptr))
 +              goto report;
 +
@@ -67587,6 +70899,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
 +
 +      page = virt_to_head_page(ptr);
 +
++      type = "<process stack>";
 +      if (!PageSlab(page)) {
 +              if (object_is_on_stack(ptr, n) == -1)
 +                      goto report;
@@ -67594,6 +70907,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
 +      }
 +
 +      s = page->slab;
++      type = s->name;
 +      if (!(s->flags & SLAB_USERCOPY))
 +              goto report;
 +
@@ -67602,7 +70916,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
 +              return;
 +
 +report:
-+      pax_report_usercopy(ptr, n, to, s ? s->name : NULL);
++      pax_report_usercopy(ptr, n, to, type);
 +#endif
 +
 +}
@@ -67611,7 +70925,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
  size_t ksize(const void *object)
  {
        struct page *page;
-@@ -3154,7 +3195,7 @@ static void __init kmem_cache_bootstrap_
+@@ -3502,7 +3547,7 @@ static void __init kmem_cache_bootstrap_
        int node;
  
        list_add(&s->list, &slab_caches);
@@ -67620,7 +70934,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
  
        for_each_node_state(node, N_NORMAL_MEMORY) {
                struct kmem_cache_node *n = get_node(s, node);
-@@ -3271,17 +3312,17 @@ void __init kmem_cache_init(void)
+@@ -3619,17 +3664,17 @@ void __init kmem_cache_init(void)
  
        /* Caches that are not of the two-to-the-power-of size */
        if (KMALLOC_MIN_SIZE <= 32) {
@@ -67641,7 +70955,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
                caches++;
        }
  
-@@ -3349,7 +3390,7 @@ static int slab_unmergeable(struct kmem_
+@@ -3697,7 +3742,7 @@ static int slab_unmergeable(struct kmem_
        /*
         * We may have set a slab to be unmergeable during bootstrap.
         */
@@ -67650,7 +70964,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
                return 1;
  
        return 0;
-@@ -3408,7 +3449,7 @@ struct kmem_cache *kmem_cache_create(con
+@@ -3756,7 +3801,7 @@ struct kmem_cache *kmem_cache_create(con
        down_write(&slub_lock);
        s = find_mergeable(size, align, flags, name, ctor);
        if (s) {
@@ -67659,7 +70973,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
                /*
                 * Adjust the object sizes so that we clear
                 * the complete object on kzalloc.
-@@ -3417,7 +3458,7 @@ struct kmem_cache *kmem_cache_create(con
+@@ -3765,7 +3810,7 @@ struct kmem_cache *kmem_cache_create(con
                s->inuse = max_t(int, s->inuse, ALIGN(size, sizeof(void *)));
  
                if (sysfs_slab_alias(s, name)) {
@@ -67668,7 +70982,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
                        goto err;
                }
                up_write(&slub_lock);
-@@ -3545,7 +3586,7 @@ void *__kmalloc_node_track_caller(size_t
+@@ -3893,7 +3938,7 @@ void *__kmalloc_node_track_caller(size_t
  }
  #endif
  
@@ -67677,7 +70991,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
  static int count_inuse(struct page *page)
  {
        return page->inuse;
-@@ -3935,12 +3976,12 @@ static void resiliency_test(void)
+@@ -4280,12 +4325,12 @@ static void resiliency_test(void)
        validate_slab_cache(kmalloc_caches[9]);
  }
  #else
@@ -67692,7 +71006,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
  enum slab_stat_type {
        SL_ALL,                 /* All slabs */
        SL_PARTIAL,             /* Only partially allocated slabs */
-@@ -4150,7 +4191,7 @@ SLAB_ATTR_RO(ctor);
+@@ -4495,7 +4540,7 @@ SLAB_ATTR_RO(ctor);
  
  static ssize_t aliases_show(struct kmem_cache *s, char *buf)
  {
@@ -67701,7 +71015,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
  }
  SLAB_ATTR_RO(aliases);
  
-@@ -4662,6 +4703,7 @@ static char *create_unique_id(struct kme
+@@ -5025,6 +5070,7 @@ static char *create_unique_id(struct kme
        return name;
  }
  
@@ -67709,7 +71023,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
  static int sysfs_slab_add(struct kmem_cache *s)
  {
        int err;
-@@ -4724,6 +4766,7 @@ static void sysfs_slab_remove(struct kme
+@@ -5087,6 +5133,7 @@ static void sysfs_slab_remove(struct kme
        kobject_del(&s->kobj);
        kobject_put(&s->kobj);
  }
@@ -67717,7 +71031,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
  
  /*
   * Need to buffer aliases during bootup until sysfs becomes
-@@ -4737,6 +4780,7 @@ struct saved_alias {
+@@ -5100,6 +5147,7 @@ struct saved_alias {
  
  static struct saved_alias *alias_list;
  
@@ -67725,7 +71039,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
  static int sysfs_slab_alias(struct kmem_cache *s, const char *name)
  {
        struct saved_alias *al;
-@@ -4759,6 +4803,7 @@ static int sysfs_slab_alias(struct kmem_
+@@ -5122,6 +5170,7 @@ static int sysfs_slab_alias(struct kmem_
        alias_list = al;
        return 0;
  }
@@ -67733,7 +71047,7 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
  
  static int __init slab_sysfs_init(void)
  {
-@@ -4894,7 +4939,13 @@ static const struct file_operations proc
+@@ -5257,7 +5306,13 @@ static const struct file_operations proc
  
  static int __init slab_proc_init(void)
  {
@@ -67748,9 +71062,9 @@ diff -urNp linux-3.0.4/mm/slub.c linux-3.0.4/mm/slub.c
        return 0;
  }
  module_init(slab_proc_init);
-diff -urNp linux-3.0.4/mm/swap.c linux-3.0.4/mm/swap.c
---- linux-3.0.4/mm/swap.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/swap.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/mm/swap.c linux-3.1.3/mm/swap.c
+--- linux-3.1.3/mm/swap.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/swap.c      2011-11-16 18:39:08.000000000 -0500
 @@ -31,6 +31,7 @@
  #include <linux/backing-dev.h>
  #include <linux/memcontrol.h>
@@ -67768,9 +71082,9 @@ diff -urNp linux-3.0.4/mm/swap.c linux-3.0.4/mm/swap.c
        (*dtor)(page);
  }
  
-diff -urNp linux-3.0.4/mm/swapfile.c linux-3.0.4/mm/swapfile.c
---- linux-3.0.4/mm/swapfile.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/swapfile.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/mm/swapfile.c linux-3.1.3/mm/swapfile.c
+--- linux-3.1.3/mm/swapfile.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/swapfile.c  2011-11-16 18:39:08.000000000 -0500
 @@ -62,7 +62,7 @@ static DEFINE_MUTEX(swapon_mutex);
  
  static DECLARE_WAIT_QUEUE_HEAD(proc_poll_wait);
@@ -67789,27 +71103,27 @@ diff -urNp linux-3.0.4/mm/swapfile.c linux-3.0.4/mm/swapfile.c
        wake_up_interruptible(&proc_poll_wait);
  
  out_dput:
-@@ -1692,8 +1692,8 @@ static unsigned swaps_poll(struct file *
+@@ -1687,8 +1687,8 @@ static unsigned swaps_poll(struct file *
  
        poll_wait(file, &proc_poll_wait, wait);
  
--      if (s->event != atomic_read(&proc_poll_event)) {
--              s->event = atomic_read(&proc_poll_event);
-+      if (s->event != atomic_read_unchecked(&proc_poll_event)) {
-+              s->event = atomic_read_unchecked(&proc_poll_event);
+-      if (seq->poll_event != atomic_read(&proc_poll_event)) {
+-              seq->poll_event = atomic_read(&proc_poll_event);
++      if (seq->poll_event != atomic_read_unchecked(&proc_poll_event)) {
++              seq->poll_event = atomic_read_unchecked(&proc_poll_event);
                return POLLIN | POLLRDNORM | POLLERR | POLLPRI;
        }
  
-@@ -1799,7 +1799,7 @@ static int swaps_open(struct inode *inod
-       }
+@@ -1786,7 +1786,7 @@ static int swaps_open(struct inode *inod
+               return ret;
  
-       s->seq.private = s;
--      s->event = atomic_read(&proc_poll_event);
-+      s->event = atomic_read_unchecked(&proc_poll_event);
-       return ret;
+       seq = file->private_data;
+-      seq->poll_event = atomic_read(&proc_poll_event);
++      seq->poll_event = atomic_read_unchecked(&proc_poll_event);
+       return 0;
  }
  
-@@ -2133,7 +2133,7 @@ SYSCALL_DEFINE2(swapon, const char __use
+@@ -2124,7 +2124,7 @@ SYSCALL_DEFINE2(swapon, const char __use
                (p->flags & SWP_DISCARDABLE) ? "D" : "");
  
        mutex_unlock(&swapon_mutex);
@@ -67818,9 +71132,9 @@ diff -urNp linux-3.0.4/mm/swapfile.c linux-3.0.4/mm/swapfile.c
        wake_up_interruptible(&proc_poll_wait);
  
        if (S_ISREG(inode->i_mode))
-diff -urNp linux-3.0.4/mm/util.c linux-3.0.4/mm/util.c
---- linux-3.0.4/mm/util.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/util.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/mm/util.c linux-3.1.3/mm/util.c
+--- linux-3.1.3/mm/util.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/util.c      2011-11-16 18:39:08.000000000 -0500
 @@ -114,6 +114,7 @@ EXPORT_SYMBOL(memdup_user);
   * allocated buffer. Use this if you don't want to free the buffer immediately
   * like, for example, with RCU.
@@ -67850,9 +71164,9 @@ diff -urNp linux-3.0.4/mm/util.c linux-3.0.4/mm/util.c
        mm->get_unmapped_area = arch_get_unmapped_area;
        mm->unmap_area = arch_unmap_area;
  }
-diff -urNp linux-3.0.4/mm/vmalloc.c linux-3.0.4/mm/vmalloc.c
---- linux-3.0.4/mm/vmalloc.c   2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/mm/vmalloc.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/mm/vmalloc.c linux-3.1.3/mm/vmalloc.c
+--- linux-3.1.3/mm/vmalloc.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/vmalloc.c   2011-11-16 18:40:44.000000000 -0500
 @@ -39,8 +39,19 @@ static void vunmap_pte_range(pmd_t *pmd,
  
        pte = pte_offset_kernel(pmd, addr);
@@ -67956,7 +71270,7 @@ diff -urNp linux-3.0.4/mm/vmalloc.c linux-3.0.4/mm/vmalloc.c
                        if (!pmd_none(*pmd)) {
                                pte_t *ptep, pte;
  
-@@ -1297,6 +1337,16 @@ static struct vm_struct *__get_vm_area_n
+@@ -1294,6 +1334,16 @@ static struct vm_struct *__get_vm_area_n
        struct vm_struct *area;
  
        BUG_ON(in_interrupt());
@@ -67973,7 +71287,7 @@ diff -urNp linux-3.0.4/mm/vmalloc.c linux-3.0.4/mm/vmalloc.c
        if (flags & VM_IOREMAP) {
                int bit = fls(size);
  
-@@ -1515,6 +1565,11 @@ void *vmap(struct page **pages, unsigned
+@@ -1526,6 +1576,11 @@ void *vmap(struct page **pages, unsigned
        if (count > totalram_pages)
                return NULL;
  
@@ -67985,21 +71299,21 @@ diff -urNp linux-3.0.4/mm/vmalloc.c linux-3.0.4/mm/vmalloc.c
        area = get_vm_area_caller((count << PAGE_SHIFT), flags,
                                        __builtin_return_address(0));
        if (!area)
-@@ -1616,6 +1671,13 @@ void *__vmalloc_node_range(unsigned long
+@@ -1627,6 +1682,13 @@ void *__vmalloc_node_range(unsigned long
        if (!size || (size >> PAGE_SHIFT) > totalram_pages)
                return NULL;
  
 +#if defined(CONFIG_MODULES) && defined(CONFIG_X86) && defined(CONFIG_PAX_KERNEXEC)
 +      if (!(pgprot_val(prot) & _PAGE_NX))
-+              area = __get_vm_area_node(size, align, VM_ALLOC | VM_KERNEXEC, VMALLOC_START, VMALLOC_END,
-+                                              node, gfp_mask, caller);
++              area = __get_vm_area_node(size, align, VM_ALLOC | VM_UNLIST | VM_KERNEXEC,
++                                        VMALLOC_START, VMALLOC_END, node, gfp_mask, caller);
 +      else
 +#endif
 +
-       area = __get_vm_area_node(size, align, VM_ALLOC, start, end, node,
-                                 gfp_mask, caller);
+       area = __get_vm_area_node(size, align, VM_ALLOC | VM_UNLIST,
+                                 start, end, node, gfp_mask, caller);
  
-@@ -1655,6 +1717,7 @@ static void *__vmalloc_node(unsigned lon
+@@ -1672,6 +1734,7 @@ static void *__vmalloc_node(unsigned lon
                                gfp_mask, prot, node, caller);
  }
  
@@ -68007,7 +71321,7 @@ diff -urNp linux-3.0.4/mm/vmalloc.c linux-3.0.4/mm/vmalloc.c
  void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot)
  {
        return __vmalloc_node(size, 1, gfp_mask, prot, -1,
-@@ -1678,6 +1741,7 @@ static inline void *__vmalloc_node_flags
+@@ -1695,6 +1758,7 @@ static inline void *__vmalloc_node_flags
   *    For tight control over page level allocator and protection flags
   *    use __vmalloc() instead.
   */
@@ -68015,7 +71329,7 @@ diff -urNp linux-3.0.4/mm/vmalloc.c linux-3.0.4/mm/vmalloc.c
  void *vmalloc(unsigned long size)
  {
        return __vmalloc_node_flags(size, -1, GFP_KERNEL | __GFP_HIGHMEM);
-@@ -1694,6 +1758,7 @@ EXPORT_SYMBOL(vmalloc);
+@@ -1711,6 +1775,7 @@ EXPORT_SYMBOL(vmalloc);
   *    For tight control over page level allocator and protection flags
   *    use __vmalloc() instead.
   */
@@ -68023,7 +71337,7 @@ diff -urNp linux-3.0.4/mm/vmalloc.c linux-3.0.4/mm/vmalloc.c
  void *vzalloc(unsigned long size)
  {
        return __vmalloc_node_flags(size, -1,
-@@ -1708,6 +1773,7 @@ EXPORT_SYMBOL(vzalloc);
+@@ -1725,6 +1790,7 @@ EXPORT_SYMBOL(vzalloc);
   * The resulting memory area is zeroed so it can be mapped to userspace
   * without leaking data.
   */
@@ -68031,7 +71345,7 @@ diff -urNp linux-3.0.4/mm/vmalloc.c linux-3.0.4/mm/vmalloc.c
  void *vmalloc_user(unsigned long size)
  {
        struct vm_struct *area;
-@@ -1735,6 +1801,7 @@ EXPORT_SYMBOL(vmalloc_user);
+@@ -1752,6 +1818,7 @@ EXPORT_SYMBOL(vmalloc_user);
   *    For tight control over page level allocator and protection flags
   *    use __vmalloc() instead.
   */
@@ -68039,7 +71353,7 @@ diff -urNp linux-3.0.4/mm/vmalloc.c linux-3.0.4/mm/vmalloc.c
  void *vmalloc_node(unsigned long size, int node)
  {
        return __vmalloc_node(size, 1, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL,
-@@ -1754,6 +1821,7 @@ EXPORT_SYMBOL(vmalloc_node);
+@@ -1771,6 +1838,7 @@ EXPORT_SYMBOL(vmalloc_node);
   * For tight control over page level allocator and protection flags
   * use __vmalloc_node() instead.
   */
@@ -68047,7 +71361,7 @@ diff -urNp linux-3.0.4/mm/vmalloc.c linux-3.0.4/mm/vmalloc.c
  void *vzalloc_node(unsigned long size, int node)
  {
        return __vmalloc_node_flags(size, node,
-@@ -1776,10 +1844,10 @@ EXPORT_SYMBOL(vzalloc_node);
+@@ -1793,10 +1861,10 @@ EXPORT_SYMBOL(vzalloc_node);
   *    For tight control over page level allocator and protection flags
   *    use __vmalloc() instead.
   */
@@ -68060,7 +71374,7 @@ diff -urNp linux-3.0.4/mm/vmalloc.c linux-3.0.4/mm/vmalloc.c
                              -1, __builtin_return_address(0));
  }
  
-@@ -1798,6 +1866,7 @@ void *vmalloc_exec(unsigned long size)
+@@ -1815,6 +1883,7 @@ void *vmalloc_exec(unsigned long size)
   *    Allocate enough 32bit PA addressable pages to cover @size from the
   *    page level allocator and map them into contiguous kernel virtual space.
   */
@@ -68068,7 +71382,7 @@ diff -urNp linux-3.0.4/mm/vmalloc.c linux-3.0.4/mm/vmalloc.c
  void *vmalloc_32(unsigned long size)
  {
        return __vmalloc_node(size, 1, GFP_VMALLOC32, PAGE_KERNEL,
-@@ -1812,6 +1881,7 @@ EXPORT_SYMBOL(vmalloc_32);
+@@ -1829,6 +1898,7 @@ EXPORT_SYMBOL(vmalloc_32);
   * The resulting memory area is 32bit addressable and zeroed so it can be
   * mapped to userspace without leaking data.
   */
@@ -68076,7 +71390,7 @@ diff -urNp linux-3.0.4/mm/vmalloc.c linux-3.0.4/mm/vmalloc.c
  void *vmalloc_32_user(unsigned long size)
  {
        struct vm_struct *area;
-@@ -2074,6 +2144,8 @@ int remap_vmalloc_range(struct vm_area_s
+@@ -2091,6 +2161,8 @@ int remap_vmalloc_range(struct vm_area_s
        unsigned long uaddr = vma->vm_start;
        unsigned long usize = vma->vm_end - vma->vm_start;
  
@@ -68085,9 +71399,9 @@ diff -urNp linux-3.0.4/mm/vmalloc.c linux-3.0.4/mm/vmalloc.c
        if ((PAGE_SIZE-1) & (unsigned long)addr)
                return -EINVAL;
  
-diff -urNp linux-3.0.4/mm/vmstat.c linux-3.0.4/mm/vmstat.c
---- linux-3.0.4/mm/vmstat.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/mm/vmstat.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/mm/vmstat.c linux-3.1.3/mm/vmstat.c
+--- linux-3.1.3/mm/vmstat.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/mm/vmstat.c    2011-11-16 18:40:44.000000000 -0500
 @@ -78,7 +78,7 @@ void vm_events_fold_cpu(int cpu)
   *
   * vm_stat contains the global counters
@@ -68140,10 +71454,10 @@ diff -urNp linux-3.0.4/mm/vmstat.c linux-3.0.4/mm/vmstat.c
  #endif
        return 0;
  }
-diff -urNp linux-3.0.4/net/8021q/vlan.c linux-3.0.4/net/8021q/vlan.c
---- linux-3.0.4/net/8021q/vlan.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/8021q/vlan.c       2011-08-23 21:47:56.000000000 -0400
-@@ -591,8 +591,7 @@ static int vlan_ioctl_handler(struct net
+diff -urNp linux-3.1.3/net/8021q/vlan.c linux-3.1.3/net/8021q/vlan.c
+--- linux-3.1.3/net/8021q/vlan.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/8021q/vlan.c       2011-11-16 18:39:08.000000000 -0500
+@@ -588,8 +588,7 @@ static int vlan_ioctl_handler(struct net
                err = -EPERM;
                if (!capable(CAP_NET_ADMIN))
                        break;
@@ -68153,9 +71467,42 @@ diff -urNp linux-3.0.4/net/8021q/vlan.c linux-3.0.4/net/8021q/vlan.c
                        struct vlan_net *vn;
  
                        vn = net_generic(net, vlan_net_id);
-diff -urNp linux-3.0.4/net/atm/atm_misc.c linux-3.0.4/net/atm/atm_misc.c
---- linux-3.0.4/net/atm/atm_misc.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/atm/atm_misc.c     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/9p/trans_fd.c linux-3.1.3/net/9p/trans_fd.c
+--- linux-3.1.3/net/9p/trans_fd.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/9p/trans_fd.c      2011-11-16 18:39:08.000000000 -0500
+@@ -423,7 +423,7 @@ static int p9_fd_write(struct p9_client 
+       oldfs = get_fs();
+       set_fs(get_ds());
+       /* The cast to a user pointer is valid due to the set_fs() */
+-      ret = vfs_write(ts->wr, (__force void __user *)v, len, &ts->wr->f_pos);
++      ret = vfs_write(ts->wr, (void __force_user *)v, len, &ts->wr->f_pos);
+       set_fs(oldfs);
+       if (ret <= 0 && ret != -ERESTARTSYS && ret != -EAGAIN)
+diff -urNp linux-3.1.3/net/9p/trans_virtio.c linux-3.1.3/net/9p/trans_virtio.c
+--- linux-3.1.3/net/9p/trans_virtio.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/9p/trans_virtio.c  2011-11-16 18:39:08.000000000 -0500
+@@ -327,7 +327,7 @@ req_retry_pinned:
+               } else {
+                       char *pbuf;
+                       if (req->tc->pubuf)
+-                              pbuf = (__force char *) req->tc->pubuf;
++                              pbuf = (char __force_kernel *) req->tc->pubuf;
+                       else
+                               pbuf = req->tc->pkbuf;
+                       outp = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, pbuf,
+@@ -357,7 +357,7 @@ req_retry_pinned:
+               } else {
+                       char *pbuf;
+                       if (req->tc->pubuf)
+-                              pbuf = (__force char *) req->tc->pubuf;
++                              pbuf = (char __force_kernel *) req->tc->pubuf;
+                       else
+                               pbuf = req->tc->pkbuf;
+diff -urNp linux-3.1.3/net/atm/atm_misc.c linux-3.1.3/net/atm/atm_misc.c
+--- linux-3.1.3/net/atm/atm_misc.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/atm/atm_misc.c     2011-11-16 18:39:08.000000000 -0500
 @@ -17,7 +17,7 @@ int atm_charge(struct atm_vcc *vcc, int 
        if (atomic_read(&sk_atm(vcc)->sk_rmem_alloc) <= sk_atm(vcc)->sk_rcvbuf)
                return 1;
@@ -68192,9 +71539,9 @@ diff -urNp linux-3.0.4/net/atm/atm_misc.c linux-3.0.4/net/atm/atm_misc.c
        __SONET_ITEMS
  #undef __HANDLE_ITEM
  }
-diff -urNp linux-3.0.4/net/atm/lec.h linux-3.0.4/net/atm/lec.h
---- linux-3.0.4/net/atm/lec.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/atm/lec.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/atm/lec.h linux-3.1.3/net/atm/lec.h
+--- linux-3.1.3/net/atm/lec.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/atm/lec.h  2011-11-16 18:39:08.000000000 -0500
 @@ -48,7 +48,7 @@ struct lane2_ops {
                              const u8 *tlvs, u32 sizeoftlvs);
        void (*associate_indicator) (struct net_device *dev, const u8 *mac_addr,
@@ -68204,9 +71551,9 @@ diff -urNp linux-3.0.4/net/atm/lec.h linux-3.0.4/net/atm/lec.h
  
  /*
   * ATM LAN Emulation supports both LLC & Dix Ethernet EtherType
-diff -urNp linux-3.0.4/net/atm/mpc.h linux-3.0.4/net/atm/mpc.h
---- linux-3.0.4/net/atm/mpc.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/atm/mpc.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/atm/mpc.h linux-3.1.3/net/atm/mpc.h
+--- linux-3.1.3/net/atm/mpc.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/atm/mpc.h  2011-11-16 18:39:08.000000000 -0500
 @@ -33,7 +33,7 @@ struct mpoa_client {
        struct mpc_parameters parameters;  /* parameters for this client    */
  
@@ -68216,9 +71563,9 @@ diff -urNp linux-3.0.4/net/atm/mpc.h linux-3.0.4/net/atm/mpc.h
  };
  
  
-diff -urNp linux-3.0.4/net/atm/mpoa_caches.c linux-3.0.4/net/atm/mpoa_caches.c
---- linux-3.0.4/net/atm/mpoa_caches.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/atm/mpoa_caches.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/atm/mpoa_caches.c linux-3.1.3/net/atm/mpoa_caches.c
+--- linux-3.1.3/net/atm/mpoa_caches.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/atm/mpoa_caches.c  2011-11-16 18:40:44.000000000 -0500
 @@ -255,6 +255,8 @@ static void check_resolving_entries(stru
        struct timeval now;
        struct k_message msg;
@@ -68228,9 +71575,9 @@ diff -urNp linux-3.0.4/net/atm/mpoa_caches.c linux-3.0.4/net/atm/mpoa_caches.c
        do_gettimeofday(&now);
  
        read_lock_bh(&client->ingress_lock);
-diff -urNp linux-3.0.4/net/atm/proc.c linux-3.0.4/net/atm/proc.c
---- linux-3.0.4/net/atm/proc.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/atm/proc.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/atm/proc.c linux-3.1.3/net/atm/proc.c
+--- linux-3.1.3/net/atm/proc.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/atm/proc.c 2011-11-16 18:39:08.000000000 -0500
 @@ -45,9 +45,9 @@ static void add_stats(struct seq_file *s
    const struct k_atm_aal_stats *stats)
  {
@@ -68244,9 +71591,9 @@ diff -urNp linux-3.0.4/net/atm/proc.c linux-3.0.4/net/atm/proc.c
  }
  
  static void atm_dev_info(struct seq_file *seq, const struct atm_dev *dev)
-diff -urNp linux-3.0.4/net/atm/resources.c linux-3.0.4/net/atm/resources.c
---- linux-3.0.4/net/atm/resources.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/atm/resources.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/atm/resources.c linux-3.1.3/net/atm/resources.c
+--- linux-3.1.3/net/atm/resources.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/atm/resources.c    2011-11-16 18:39:08.000000000 -0500
 @@ -160,7 +160,7 @@ EXPORT_SYMBOL(atm_dev_deregister);
  static void copy_aal_stats(struct k_atm_aal_stats *from,
      struct atm_aal_stats *to)
@@ -68265,10 +71612,10 @@ diff -urNp linux-3.0.4/net/atm/resources.c linux-3.0.4/net/atm/resources.c
        __AAL_STAT_ITEMS
  #undef __HANDLE_ITEM
  }
-diff -urNp linux-3.0.4/net/batman-adv/hard-interface.c linux-3.0.4/net/batman-adv/hard-interface.c
---- linux-3.0.4/net/batman-adv/hard-interface.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/batman-adv/hard-interface.c        2011-08-23 21:47:56.000000000 -0400
-@@ -351,8 +351,8 @@ int hardif_enable_interface(struct hard_
+diff -urNp linux-3.1.3/net/batman-adv/hard-interface.c linux-3.1.3/net/batman-adv/hard-interface.c
+--- linux-3.1.3/net/batman-adv/hard-interface.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/batman-adv/hard-interface.c        2011-11-16 18:39:08.000000000 -0500
+@@ -347,8 +347,8 @@ int hardif_enable_interface(struct hard_
        hard_iface->batman_adv_ptype.dev = hard_iface->net_dev;
        dev_add_pack(&hard_iface->batman_adv_ptype);
  
@@ -68279,10 +71626,10 @@ diff -urNp linux-3.0.4/net/batman-adv/hard-interface.c linux-3.0.4/net/batman-ad
        bat_info(hard_iface->soft_iface, "Adding interface: %s\n",
                 hard_iface->net_dev->name);
  
-diff -urNp linux-3.0.4/net/batman-adv/routing.c linux-3.0.4/net/batman-adv/routing.c
---- linux-3.0.4/net/batman-adv/routing.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/batman-adv/routing.c       2011-08-23 21:47:56.000000000 -0400
-@@ -627,7 +627,7 @@ void receive_bat_packet(struct ethhdr *e
+diff -urNp linux-3.1.3/net/batman-adv/routing.c linux-3.1.3/net/batman-adv/routing.c
+--- linux-3.1.3/net/batman-adv/routing.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/batman-adv/routing.c       2011-11-16 18:39:08.000000000 -0500
+@@ -656,7 +656,7 @@ void receive_bat_packet(const struct eth
                return;
  
        /* could be changed by schedule_own_packet() */
@@ -68291,51 +71638,51 @@ diff -urNp linux-3.0.4/net/batman-adv/routing.c linux-3.0.4/net/batman-adv/routi
  
        has_directlink_flag = (batman_packet->flags & DIRECTLINK ? 1 : 0);
  
-diff -urNp linux-3.0.4/net/batman-adv/send.c linux-3.0.4/net/batman-adv/send.c
---- linux-3.0.4/net/batman-adv/send.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/batman-adv/send.c  2011-08-23 21:47:56.000000000 -0400
-@@ -279,7 +279,7 @@ void schedule_own_packet(struct hard_ifa
+diff -urNp linux-3.1.3/net/batman-adv/send.c linux-3.1.3/net/batman-adv/send.c
+--- linux-3.1.3/net/batman-adv/send.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/batman-adv/send.c  2011-11-16 18:39:08.000000000 -0500
+@@ -326,7 +326,7 @@ void schedule_own_packet(struct hard_ifa
  
        /* change sequence number to network order */
        batman_packet->seqno =
 -              htonl((uint32_t)atomic_read(&hard_iface->seqno));
 +              htonl((uint32_t)atomic_read_unchecked(&hard_iface->seqno));
  
-       if (vis_server == VIS_TYPE_SERVER_SYNC)
-               batman_packet->flags |= VIS_SERVER;
-@@ -293,7 +293,7 @@ void schedule_own_packet(struct hard_ifa
+       batman_packet->ttvn = atomic_read(&bat_priv->ttvn);
+       batman_packet->tt_crc = htons((uint16_t)atomic_read(&bat_priv->tt_crc));
+@@ -343,7 +343,7 @@ void schedule_own_packet(struct hard_ifa
        else
-               batman_packet->gw_flags = 0;
+               batman_packet->gw_flags = NO_FLAGS;
  
 -      atomic_inc(&hard_iface->seqno);
 +      atomic_inc_unchecked(&hard_iface->seqno);
  
        slide_own_bcast_window(hard_iface);
        send_time = own_send_time(bat_priv);
-diff -urNp linux-3.0.4/net/batman-adv/soft-interface.c linux-3.0.4/net/batman-adv/soft-interface.c
---- linux-3.0.4/net/batman-adv/soft-interface.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/batman-adv/soft-interface.c        2011-08-23 21:47:56.000000000 -0400
-@@ -628,7 +628,7 @@ int interface_tx(struct sk_buff *skb, st
+diff -urNp linux-3.1.3/net/batman-adv/soft-interface.c linux-3.1.3/net/batman-adv/soft-interface.c
+--- linux-3.1.3/net/batman-adv/soft-interface.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/batman-adv/soft-interface.c        2011-11-16 18:39:08.000000000 -0500
+@@ -632,7 +632,7 @@ static int interface_tx(struct sk_buff *
  
                /* set broadcast sequence number */
                bcast_packet->seqno =
 -                      htonl(atomic_inc_return(&bat_priv->bcast_seqno));
 +                      htonl(atomic_inc_return_unchecked(&bat_priv->bcast_seqno));
  
-               add_bcast_packet_to_list(bat_priv, skb);
+               add_bcast_packet_to_list(bat_priv, skb, 1);
  
-@@ -830,7 +830,7 @@ struct net_device *softif_create(char *n
+@@ -824,7 +824,7 @@ struct net_device *softif_create(const c
        atomic_set(&bat_priv->batman_queue_left, BATMAN_QUEUE_LEN);
  
        atomic_set(&bat_priv->mesh_state, MESH_INACTIVE);
 -      atomic_set(&bat_priv->bcast_seqno, 1);
 +      atomic_set_unchecked(&bat_priv->bcast_seqno, 1);
-       atomic_set(&bat_priv->tt_local_changed, 0);
-       bat_priv->primary_if = NULL;
-diff -urNp linux-3.0.4/net/batman-adv/types.h linux-3.0.4/net/batman-adv/types.h
---- linux-3.0.4/net/batman-adv/types.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/batman-adv/types.h 2011-08-23 21:47:56.000000000 -0400
+       atomic_set(&bat_priv->ttvn, 0);
+       atomic_set(&bat_priv->tt_local_changes, 0);
+       atomic_set(&bat_priv->tt_ogm_append_cnt, 0);
+diff -urNp linux-3.1.3/net/batman-adv/types.h linux-3.1.3/net/batman-adv/types.h
+--- linux-3.1.3/net/batman-adv/types.h 2011-11-26 19:57:29.000000000 -0500
++++ linux-3.1.3/net/batman-adv/types.h 2011-11-26 20:00:43.000000000 -0500
 @@ -38,8 +38,8 @@ struct hard_iface {
        int16_t if_num;
        char if_status;
@@ -68347,7 +71694,7 @@ diff -urNp linux-3.0.4/net/batman-adv/types.h linux-3.0.4/net/batman-adv/types.h
        unsigned char *packet_buff;
        int packet_len;
        struct kobject *hardif_obj;
-@@ -142,7 +142,7 @@ struct bat_priv {
+@@ -153,7 +153,7 @@ struct bat_priv {
        atomic_t orig_interval;         /* uint */
        atomic_t hop_penalty;           /* uint */
        atomic_t log_level;             /* uint */
@@ -68355,11 +71702,11 @@ diff -urNp linux-3.0.4/net/batman-adv/types.h linux-3.0.4/net/batman-adv/types.h
 +      atomic_unchecked_t bcast_seqno;
        atomic_t bcast_queue_left;
        atomic_t batman_queue_left;
-       char num_ifaces;
-diff -urNp linux-3.0.4/net/batman-adv/unicast.c linux-3.0.4/net/batman-adv/unicast.c
---- linux-3.0.4/net/batman-adv/unicast.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/batman-adv/unicast.c       2011-08-23 21:47:56.000000000 -0400
-@@ -265,7 +265,7 @@ int frag_send_skb(struct sk_buff *skb, s
+       atomic_t ttvn; /* tranlation table version number */
+diff -urNp linux-3.1.3/net/batman-adv/unicast.c linux-3.1.3/net/batman-adv/unicast.c
+--- linux-3.1.3/net/batman-adv/unicast.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/batman-adv/unicast.c       2011-11-16 18:39:08.000000000 -0500
+@@ -264,7 +264,7 @@ int frag_send_skb(struct sk_buff *skb, s
        frag1->flags = UNI_FRAG_HEAD | large_tail;
        frag2->flags = large_tail;
  
@@ -68368,9 +71715,30 @@ diff -urNp linux-3.0.4/net/batman-adv/unicast.c linux-3.0.4/net/batman-adv/unica
        frag1->seqno = htons(seqno - 1);
        frag2->seqno = htons(seqno);
  
-diff -urNp linux-3.0.4/net/bridge/br_multicast.c linux-3.0.4/net/bridge/br_multicast.c
---- linux-3.0.4/net/bridge/br_multicast.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/bridge/br_multicast.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/bluetooth/hci_conn.c linux-3.1.3/net/bluetooth/hci_conn.c
+--- linux-3.1.3/net/bluetooth/hci_conn.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/bluetooth/hci_conn.c       2011-11-16 18:39:08.000000000 -0500
+@@ -218,7 +218,7 @@ void hci_le_start_enc(struct hci_conn *c
+       cp.handle = cpu_to_le16(conn->handle);
+       memcpy(cp.ltk, ltk, sizeof(cp.ltk));
+       cp.ediv = ediv;
+-      memcpy(cp.rand, rand, sizeof(rand));
++      memcpy(cp.rand, rand, sizeof(cp.rand));
+       hci_send_cmd(hdev, HCI_OP_LE_START_ENC, sizeof(cp), &cp);
+ }
+@@ -234,7 +234,7 @@ void hci_le_ltk_reply(struct hci_conn *c
+       memset(&cp, 0, sizeof(cp));
+       cp.handle = cpu_to_le16(conn->handle);
+-      memcpy(cp.ltk, ltk, sizeof(ltk));
++      memcpy(cp.ltk, ltk, sizeof(cp.ltk));
+       hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp);
+ }
+diff -urNp linux-3.1.3/net/bridge/br_multicast.c linux-3.1.3/net/bridge/br_multicast.c
+--- linux-3.1.3/net/bridge/br_multicast.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/bridge/br_multicast.c      2011-11-16 18:39:08.000000000 -0500
 @@ -1485,7 +1485,7 @@ static int br_multicast_ipv6_rcv(struct 
        nexthdr = ip6h->nexthdr;
        offset = ipv6_skip_exthdr(skb, sizeof(*ip6h), &nexthdr);
@@ -68380,10 +71748,10 @@ diff -urNp linux-3.0.4/net/bridge/br_multicast.c linux-3.0.4/net/bridge/br_multi
                return 0;
  
        /* Okay, we found ICMPv6 header */
-diff -urNp linux-3.0.4/net/bridge/netfilter/ebtables.c linux-3.0.4/net/bridge/netfilter/ebtables.c
---- linux-3.0.4/net/bridge/netfilter/ebtables.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/bridge/netfilter/ebtables.c        2011-08-23 21:48:14.000000000 -0400
-@@ -1512,7 +1512,7 @@ static int do_ebt_get_ctl(struct sock *s
+diff -urNp linux-3.1.3/net/bridge/netfilter/ebtables.c linux-3.1.3/net/bridge/netfilter/ebtables.c
+--- linux-3.1.3/net/bridge/netfilter/ebtables.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/bridge/netfilter/ebtables.c        2011-11-16 18:40:44.000000000 -0500
+@@ -1513,7 +1513,7 @@ static int do_ebt_get_ctl(struct sock *s
                        tmp.valid_hooks = t->table->valid_hooks;
                }
                mutex_unlock(&ebt_mutex);
@@ -68392,7 +71760,7 @@ diff -urNp linux-3.0.4/net/bridge/netfilter/ebtables.c linux-3.0.4/net/bridge/ne
                        BUGPRINT("c2u Didn't work\n");
                        ret = -EFAULT;
                        break;
-@@ -1780,6 +1780,8 @@ static int compat_copy_everything_to_use
+@@ -1781,6 +1781,8 @@ static int compat_copy_everything_to_use
        int ret;
        void __user *pos;
  
@@ -68401,9 +71769,9 @@ diff -urNp linux-3.0.4/net/bridge/netfilter/ebtables.c linux-3.0.4/net/bridge/ne
        memset(&tinfo, 0, sizeof(tinfo));
  
        if (cmd == EBT_SO_GET_ENTRIES) {
-diff -urNp linux-3.0.4/net/caif/caif_socket.c linux-3.0.4/net/caif/caif_socket.c
---- linux-3.0.4/net/caif/caif_socket.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/caif/caif_socket.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/caif/caif_socket.c linux-3.1.3/net/caif/caif_socket.c
+--- linux-3.1.3/net/caif/caif_socket.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/caif/caif_socket.c 2011-11-16 18:39:08.000000000 -0500
 @@ -48,19 +48,20 @@ static struct dentry *debugfsdir;
  #ifdef CONFIG_DEBUG_FS
  struct debug_fs_counter {
@@ -68533,9 +71901,9 @@ diff -urNp linux-3.0.4/net/caif/caif_socket.c linux-3.0.4/net/caif/caif_socket.c
  #ifdef CONFIG_DEBUG_FS
        if (!IS_ERR(debugfsdir)) {
  
-diff -urNp linux-3.0.4/net/caif/cfctrl.c linux-3.0.4/net/caif/cfctrl.c
---- linux-3.0.4/net/caif/cfctrl.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/caif/cfctrl.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/caif/cfctrl.c linux-3.1.3/net/caif/cfctrl.c
+--- linux-3.1.3/net/caif/cfctrl.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/caif/cfctrl.c      2011-11-16 18:40:44.000000000 -0500
 @@ -9,6 +9,7 @@
  #include <linux/stddef.h>
  #include <linux/spinlock.h>
@@ -68583,9 +71951,139 @@ diff -urNp linux-3.0.4/net/caif/cfctrl.c linux-3.0.4/net/caif/cfctrl.c
  
        cfpkt_extr_head(pkt, &cmdrsp, 1);
        cmd = cmdrsp & CFCTRL_CMD_MASK;
-diff -urNp linux-3.0.4/net/core/datagram.c linux-3.0.4/net/core/datagram.c
---- linux-3.0.4/net/core/datagram.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/core/datagram.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/compat.c linux-3.1.3/net/compat.c
+--- linux-3.1.3/net/compat.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/compat.c   2011-11-16 18:39:08.000000000 -0500
+@@ -70,9 +70,9 @@ int get_compat_msghdr(struct msghdr *kms
+           __get_user(kmsg->msg_controllen, &umsg->msg_controllen) ||
+           __get_user(kmsg->msg_flags, &umsg->msg_flags))
+               return -EFAULT;
+-      kmsg->msg_name = compat_ptr(tmp1);
+-      kmsg->msg_iov = compat_ptr(tmp2);
+-      kmsg->msg_control = compat_ptr(tmp3);
++      kmsg->msg_name = (void __force_kernel *)compat_ptr(tmp1);
++      kmsg->msg_iov = (void __force_kernel *)compat_ptr(tmp2);
++      kmsg->msg_control = (void __force_kernel *)compat_ptr(tmp3);
+       return 0;
+ }
+@@ -84,7 +84,7 @@ int verify_compat_iovec(struct msghdr *k
+       if (kern_msg->msg_namelen) {
+               if (mode == VERIFY_READ) {
+-                      int err = move_addr_to_kernel(kern_msg->msg_name,
++                      int err = move_addr_to_kernel((void __force_user *)kern_msg->msg_name,
+                                                     kern_msg->msg_namelen,
+                                                     kern_address);
+                       if (err < 0)
+@@ -95,7 +95,7 @@ int verify_compat_iovec(struct msghdr *k
+               kern_msg->msg_name = NULL;
+       tot_len = iov_from_user_compat_to_kern(kern_iov,
+-                                        (struct compat_iovec __user *)kern_msg->msg_iov,
++                                        (struct compat_iovec __force_user *)kern_msg->msg_iov,
+                                         kern_msg->msg_iovlen);
+       if (tot_len >= 0)
+               kern_msg->msg_iov = kern_iov;
+@@ -115,20 +115,20 @@ int verify_compat_iovec(struct msghdr *k
+ #define CMSG_COMPAT_FIRSTHDR(msg)                     \
+       (((msg)->msg_controllen) >= sizeof(struct compat_cmsghdr) ?     \
+-       (struct compat_cmsghdr __user *)((msg)->msg_control) :         \
++       (struct compat_cmsghdr __force_user *)((msg)->msg_control) :           \
+        (struct compat_cmsghdr __user *)NULL)
+ #define CMSG_COMPAT_OK(ucmlen, ucmsg, mhdr) \
+       ((ucmlen) >= sizeof(struct compat_cmsghdr) && \
+        (ucmlen) <= (unsigned long) \
+        ((mhdr)->msg_controllen - \
+-        ((char *)(ucmsg) - (char *)(mhdr)->msg_control)))
++        ((char __force_kernel *)(ucmsg) - (char *)(mhdr)->msg_control)))
+ static inline struct compat_cmsghdr __user *cmsg_compat_nxthdr(struct msghdr *msg,
+               struct compat_cmsghdr __user *cmsg, int cmsg_len)
+ {
+       char __user *ptr = (char __user *)cmsg + CMSG_COMPAT_ALIGN(cmsg_len);
+-      if ((unsigned long)(ptr + 1 - (char __user *)msg->msg_control) >
++      if ((unsigned long)(ptr + 1 - (char __force_user *)msg->msg_control) >
+                       msg->msg_controllen)
+               return NULL;
+       return (struct compat_cmsghdr __user *)ptr;
+@@ -220,7 +220,7 @@ int put_cmsg_compat(struct msghdr *kmsg,
+ {
+       struct compat_timeval ctv;
+       struct compat_timespec cts[3];
+-      struct compat_cmsghdr __user *cm = (struct compat_cmsghdr __user *) kmsg->msg_control;
++      struct compat_cmsghdr __user *cm = (struct compat_cmsghdr __force_user *) kmsg->msg_control;
+       struct compat_cmsghdr cmhdr;
+       int cmlen;
+@@ -272,7 +272,7 @@ int put_cmsg_compat(struct msghdr *kmsg,
+ void scm_detach_fds_compat(struct msghdr *kmsg, struct scm_cookie *scm)
+ {
+-      struct compat_cmsghdr __user *cm = (struct compat_cmsghdr __user *) kmsg->msg_control;
++      struct compat_cmsghdr __user *cm = (struct compat_cmsghdr __force_user *) kmsg->msg_control;
+       int fdmax = (kmsg->msg_controllen - sizeof(struct compat_cmsghdr)) / sizeof(int);
+       int fdnum = scm->fp->count;
+       struct file **fp = scm->fp->fp;
+@@ -369,7 +369,7 @@ static int do_set_sock_timeout(struct so
+               return -EFAULT;
+       old_fs = get_fs();
+       set_fs(KERNEL_DS);
+-      err = sock_setsockopt(sock, level, optname, (char *)&ktime, sizeof(ktime));
++      err = sock_setsockopt(sock, level, optname, (char __force_user *)&ktime, sizeof(ktime));
+       set_fs(old_fs);
+       return err;
+@@ -430,7 +430,7 @@ static int do_get_sock_timeout(struct so
+       len = sizeof(ktime);
+       old_fs = get_fs();
+       set_fs(KERNEL_DS);
+-      err = sock_getsockopt(sock, level, optname, (char *) &ktime, &len);
++      err = sock_getsockopt(sock, level, optname, (char __force_user *) &ktime, (int __force_user *)&len);
+       set_fs(old_fs);
+       if (!err) {
+@@ -565,7 +565,7 @@ int compat_mc_setsockopt(struct sock *so
+       case MCAST_JOIN_GROUP:
+       case MCAST_LEAVE_GROUP:
+       {
+-              struct compat_group_req __user *gr32 = (void *)optval;
++              struct compat_group_req __user *gr32 = (void __user *)optval;
+               struct group_req __user *kgr =
+                       compat_alloc_user_space(sizeof(struct group_req));
+               u32 interface;
+@@ -586,7 +586,7 @@ int compat_mc_setsockopt(struct sock *so
+       case MCAST_BLOCK_SOURCE:
+       case MCAST_UNBLOCK_SOURCE:
+       {
+-              struct compat_group_source_req __user *gsr32 = (void *)optval;
++              struct compat_group_source_req __user *gsr32 = (void __user *)optval;
+               struct group_source_req __user *kgsr = compat_alloc_user_space(
+                       sizeof(struct group_source_req));
+               u32 interface;
+@@ -607,7 +607,7 @@ int compat_mc_setsockopt(struct sock *so
+       }
+       case MCAST_MSFILTER:
+       {
+-              struct compat_group_filter __user *gf32 = (void *)optval;
++              struct compat_group_filter __user *gf32 = (void __user *)optval;
+               struct group_filter __user *kgf;
+               u32 interface, fmode, numsrc;
+@@ -645,7 +645,7 @@ int compat_mc_getsockopt(struct sock *so
+       char __user *optval, int __user *optlen,
+       int (*getsockopt)(struct sock *, int, int, char __user *, int __user *))
+ {
+-      struct compat_group_filter __user *gf32 = (void *)optval;
++      struct compat_group_filter __user *gf32 = (void __user *)optval;
+       struct group_filter __user *kgf;
+       int __user      *koptlen;
+       u32 interface, fmode, numsrc;
+diff -urNp linux-3.1.3/net/core/datagram.c linux-3.1.3/net/core/datagram.c
+--- linux-3.1.3/net/core/datagram.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/core/datagram.c    2011-11-16 18:39:08.000000000 -0500
 @@ -285,7 +285,7 @@ int skb_kill_datagram(struct sock *sk, s
        }
  
@@ -68595,10 +72093,10 @@ diff -urNp linux-3.0.4/net/core/datagram.c linux-3.0.4/net/core/datagram.c
        sk_mem_reclaim_partial(sk);
  
        return err;
-diff -urNp linux-3.0.4/net/core/dev.c linux-3.0.4/net/core/dev.c
---- linux-3.0.4/net/core/dev.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/core/dev.c 2011-08-23 21:48:14.000000000 -0400
-@@ -1125,10 +1125,14 @@ void dev_load(struct net *net, const cha
+diff -urNp linux-3.1.3/net/core/dev.c linux-3.1.3/net/core/dev.c
+--- linux-3.1.3/net/core/dev.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/core/dev.c 2011-11-16 18:40:44.000000000 -0500
+@@ -1135,10 +1135,14 @@ void dev_load(struct net *net, const cha
        if (no_module && capable(CAP_NET_ADMIN))
                no_module = request_module("netdev-%s", name);
        if (no_module && capable(CAP_SYS_MODULE)) {
@@ -68613,7 +72111,7 @@ diff -urNp linux-3.0.4/net/core/dev.c linux-3.0.4/net/core/dev.c
        }
  }
  EXPORT_SYMBOL(dev_load);
-@@ -1959,7 +1963,7 @@ static int illegal_highdma(struct net_de
+@@ -1977,7 +1981,7 @@ static int illegal_highdma(struct net_de
  
  struct dev_gso_cb {
        void (*destructor)(struct sk_buff *skb);
@@ -68622,7 +72120,7 @@ diff -urNp linux-3.0.4/net/core/dev.c linux-3.0.4/net/core/dev.c
  
  #define DEV_GSO_CB(skb) ((struct dev_gso_cb *)(skb)->cb)
  
-@@ -2912,7 +2916,7 @@ int netif_rx_ni(struct sk_buff *skb)
+@@ -2930,7 +2934,7 @@ int netif_rx_ni(struct sk_buff *skb)
  }
  EXPORT_SYMBOL(netif_rx_ni);
  
@@ -68631,7 +72129,7 @@ diff -urNp linux-3.0.4/net/core/dev.c linux-3.0.4/net/core/dev.c
  {
        struct softnet_data *sd = &__get_cpu_var(softnet_data);
  
-@@ -3761,7 +3765,7 @@ void netif_napi_del(struct napi_struct *
+@@ -3779,7 +3783,7 @@ void netif_napi_del(struct napi_struct *
  }
  EXPORT_SYMBOL(netif_napi_del);
  
@@ -68640,10 +72138,10 @@ diff -urNp linux-3.0.4/net/core/dev.c linux-3.0.4/net/core/dev.c
  {
        struct softnet_data *sd = &__get_cpu_var(softnet_data);
        unsigned long time_limit = jiffies + 2;
-diff -urNp linux-3.0.4/net/core/flow.c linux-3.0.4/net/core/flow.c
---- linux-3.0.4/net/core/flow.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/core/flow.c        2011-08-23 21:47:56.000000000 -0400
-@@ -60,7 +60,7 @@ struct flow_cache {
+diff -urNp linux-3.1.3/net/core/flow.c linux-3.1.3/net/core/flow.c
+--- linux-3.1.3/net/core/flow.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/core/flow.c        2011-11-16 18:39:08.000000000 -0500
+@@ -61,7 +61,7 @@ struct flow_cache {
        struct timer_list               rnd_timer;
  };
  
@@ -68652,7 +72150,7 @@ diff -urNp linux-3.0.4/net/core/flow.c linux-3.0.4/net/core/flow.c
  EXPORT_SYMBOL(flow_cache_genid);
  static struct flow_cache flow_cache_global;
  static struct kmem_cache *flow_cachep __read_mostly;
-@@ -85,7 +85,7 @@ static void flow_cache_new_hashrnd(unsig
+@@ -86,7 +86,7 @@ static void flow_cache_new_hashrnd(unsig
  
  static int flow_entry_valid(struct flow_cache_entry *fle)
  {
@@ -68661,7 +72159,7 @@ diff -urNp linux-3.0.4/net/core/flow.c linux-3.0.4/net/core/flow.c
                return 0;
        if (fle->object && !fle->object->ops->check(fle->object))
                return 0;
-@@ -253,7 +253,7 @@ flow_cache_lookup(struct net *net, const
+@@ -259,7 +259,7 @@ flow_cache_lookup(struct net *net, const
                        hlist_add_head(&fle->u.hlist, &fcp->hash_table[hash]);
                        fcp->hash_count++;
                }
@@ -68670,7 +72168,7 @@ diff -urNp linux-3.0.4/net/core/flow.c linux-3.0.4/net/core/flow.c
                flo = fle->object;
                if (!flo)
                        goto ret_object;
-@@ -274,7 +274,7 @@ nocache:
+@@ -280,7 +280,7 @@ nocache:
        }
        flo = resolver(net, key, family, dir, flo, ctx);
        if (fle) {
@@ -68679,22 +72177,82 @@ diff -urNp linux-3.0.4/net/core/flow.c linux-3.0.4/net/core/flow.c
                if (!IS_ERR(flo))
                        fle->object = flo;
                else
-diff -urNp linux-3.0.4/net/core/rtnetlink.c linux-3.0.4/net/core/rtnetlink.c
---- linux-3.0.4/net/core/rtnetlink.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/core/rtnetlink.c   2011-08-23 21:47:56.000000000 -0400
-@@ -56,7 +56,7 @@
- struct rtnl_link {
+diff -urNp linux-3.1.3/net/core/iovec.c linux-3.1.3/net/core/iovec.c
+--- linux-3.1.3/net/core/iovec.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/core/iovec.c       2011-11-16 18:39:08.000000000 -0500
+@@ -42,7 +42,7 @@ int verify_iovec(struct msghdr *m, struc
+       if (m->msg_namelen) {
+               if (mode == VERIFY_READ) {
+                       void __user *namep;
+-                      namep = (void __user __force *) m->msg_name;
++                      namep = (void __force_user *) m->msg_name;
+                       err = move_addr_to_kernel(namep, m->msg_namelen,
+                                                 address);
+                       if (err < 0)
+@@ -54,7 +54,7 @@ int verify_iovec(struct msghdr *m, struc
+       }
+       size = m->msg_iovlen * sizeof(struct iovec);
+-      if (copy_from_user(iov, (void __user __force *) m->msg_iov, size))
++      if (copy_from_user(iov, (void __force_user *) m->msg_iov, size))
+               return -EFAULT;
+       m->msg_iov = iov;
+diff -urNp linux-3.1.3/net/core/rtnetlink.c linux-3.1.3/net/core/rtnetlink.c
+--- linux-3.1.3/net/core/rtnetlink.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/core/rtnetlink.c   2011-11-16 18:39:08.000000000 -0500
+@@ -57,7 +57,7 @@ struct rtnl_link {
        rtnl_doit_func          doit;
        rtnl_dumpit_func        dumpit;
+       rtnl_calcit_func        calcit;
 -};
 +} __no_const;
  
  static DEFINE_MUTEX(rtnl_mutex);
-diff -urNp linux-3.0.4/net/core/skbuff.c linux-3.0.4/net/core/skbuff.c
---- linux-3.0.4/net/core/skbuff.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/core/skbuff.c      2011-08-23 21:48:14.000000000 -0400
-@@ -1543,6 +1543,8 @@ int skb_splice_bits(struct sk_buff *skb,
+ static u16 min_ifinfo_dump_size;
+diff -urNp linux-3.1.3/net/core/scm.c linux-3.1.3/net/core/scm.c
+--- linux-3.1.3/net/core/scm.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/core/scm.c 2011-11-16 18:39:08.000000000 -0500
+@@ -218,7 +218,7 @@ EXPORT_SYMBOL(__scm_send);
+ int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data)
+ {
+       struct cmsghdr __user *cm
+-              = (__force struct cmsghdr __user *)msg->msg_control;
++              = (struct cmsghdr __force_user *)msg->msg_control;
+       struct cmsghdr cmhdr;
+       int cmlen = CMSG_LEN(len);
+       int err;
+@@ -241,7 +241,7 @@ int put_cmsg(struct msghdr * msg, int le
+       err = -EFAULT;
+       if (copy_to_user(cm, &cmhdr, sizeof cmhdr))
+               goto out;
+-      if (copy_to_user(CMSG_DATA(cm), data, cmlen - sizeof(struct cmsghdr)))
++      if (copy_to_user((void __force_user *)CMSG_DATA((void __force_kernel *)cm), data, cmlen - sizeof(struct cmsghdr)))
+               goto out;
+       cmlen = CMSG_SPACE(len);
+       if (msg->msg_controllen < cmlen)
+@@ -257,7 +257,7 @@ EXPORT_SYMBOL(put_cmsg);
+ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
+ {
+       struct cmsghdr __user *cm
+-              = (__force struct cmsghdr __user*)msg->msg_control;
++              = (struct cmsghdr __force_user *)msg->msg_control;
+       int fdmax = 0;
+       int fdnum = scm->fp->count;
+@@ -277,7 +277,7 @@ void scm_detach_fds(struct msghdr *msg, 
+       if (fdnum < fdmax)
+               fdmax = fdnum;
+-      for (i=0, cmfptr=(__force int __user *)CMSG_DATA(cm); i<fdmax;
++      for (i=0, cmfptr=(int __force_user *)CMSG_DATA((void __force_kernel *)cm); i<fdmax;
+            i++, cmfptr++)
+       {
+               int new_fd;
+diff -urNp linux-3.1.3/net/core/skbuff.c linux-3.1.3/net/core/skbuff.c
+--- linux-3.1.3/net/core/skbuff.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/core/skbuff.c      2011-11-16 18:40:44.000000000 -0500
+@@ -1650,6 +1650,8 @@ int skb_splice_bits(struct sk_buff *skb,
        struct sock *sk = skb->sk;
        int ret = 0;
  
@@ -68703,19 +72261,19 @@ diff -urNp linux-3.0.4/net/core/skbuff.c linux-3.0.4/net/core/skbuff.c
        if (splice_grow_spd(pipe, &spd))
                return -ENOMEM;
  
-diff -urNp linux-3.0.4/net/core/sock.c linux-3.0.4/net/core/sock.c
---- linux-3.0.4/net/core/sock.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/core/sock.c        2011-08-23 21:48:14.000000000 -0400
-@@ -291,7 +291,7 @@ int sock_queue_rcv_skb(struct sock *sk, 
+diff -urNp linux-3.1.3/net/core/sock.c linux-3.1.3/net/core/sock.c
+--- linux-3.1.3/net/core/sock.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/core/sock.c        2011-11-16 18:40:44.000000000 -0500
+@@ -293,7 +293,7 @@ int sock_queue_rcv_skb(struct sock *sk, 
         */
        if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
            (unsigned)sk->sk_rcvbuf) {
 -              atomic_inc(&sk->sk_drops);
 +              atomic_inc_unchecked(&sk->sk_drops);
+               trace_sock_rcvqueue_full(sk, skb);
                return -ENOMEM;
        }
-@@ -300,7 +300,7 @@ int sock_queue_rcv_skb(struct sock *sk, 
+@@ -303,7 +303,7 @@ int sock_queue_rcv_skb(struct sock *sk, 
                return err;
  
        if (!sk_rmem_schedule(sk, skb->truesize)) {
@@ -68724,7 +72282,7 @@ diff -urNp linux-3.0.4/net/core/sock.c linux-3.0.4/net/core/sock.c
                return -ENOBUFS;
        }
  
-@@ -320,7 +320,7 @@ int sock_queue_rcv_skb(struct sock *sk, 
+@@ -323,7 +323,7 @@ int sock_queue_rcv_skb(struct sock *sk, 
        skb_dst_force(skb);
  
        spin_lock_irqsave(&list->lock, flags);
@@ -68733,7 +72291,7 @@ diff -urNp linux-3.0.4/net/core/sock.c linux-3.0.4/net/core/sock.c
        __skb_queue_tail(list, skb);
        spin_unlock_irqrestore(&list->lock, flags);
  
-@@ -340,7 +340,7 @@ int sk_receive_skb(struct sock *sk, stru
+@@ -343,7 +343,7 @@ int sk_receive_skb(struct sock *sk, stru
        skb->dev = NULL;
  
        if (sk_rcvqueues_full(sk, skb)) {
@@ -68742,7 +72300,7 @@ diff -urNp linux-3.0.4/net/core/sock.c linux-3.0.4/net/core/sock.c
                goto discard_and_relse;
        }
        if (nested)
-@@ -358,7 +358,7 @@ int sk_receive_skb(struct sock *sk, stru
+@@ -361,7 +361,7 @@ int sk_receive_skb(struct sock *sk, stru
                mutex_release(&sk->sk_lock.dep_map, 1, _RET_IP_);
        } else if (sk_add_backlog(sk, skb)) {
                bh_unlock_sock(sk);
@@ -68751,7 +72309,7 @@ diff -urNp linux-3.0.4/net/core/sock.c linux-3.0.4/net/core/sock.c
                goto discard_and_relse;
        }
  
-@@ -921,7 +921,7 @@ int sock_getsockopt(struct socket *sock,
+@@ -924,7 +924,7 @@ int sock_getsockopt(struct socket *sock,
                if (len > sizeof(peercred))
                        len = sizeof(peercred);
                cred_to_ucred(sk->sk_peer_pid, sk->sk_peer_cred, &peercred);
@@ -68760,7 +72318,7 @@ diff -urNp linux-3.0.4/net/core/sock.c linux-3.0.4/net/core/sock.c
                        return -EFAULT;
                goto lenout;
        }
-@@ -934,7 +934,7 @@ int sock_getsockopt(struct socket *sock,
+@@ -937,7 +937,7 @@ int sock_getsockopt(struct socket *sock,
                        return -ENOTCONN;
                if (lv < len)
                        return -EINVAL;
@@ -68769,7 +72327,7 @@ diff -urNp linux-3.0.4/net/core/sock.c linux-3.0.4/net/core/sock.c
                        return -EFAULT;
                goto lenout;
        }
-@@ -967,7 +967,7 @@ int sock_getsockopt(struct socket *sock,
+@@ -970,7 +970,7 @@ int sock_getsockopt(struct socket *sock,
  
        if (len > lv)
                len = lv;
@@ -68778,7 +72336,7 @@ diff -urNp linux-3.0.4/net/core/sock.c linux-3.0.4/net/core/sock.c
                return -EFAULT;
  lenout:
        if (put_user(len, optlen))
-@@ -2023,7 +2023,7 @@ void sock_init_data(struct socket *sock,
+@@ -2029,7 +2029,7 @@ void sock_init_data(struct socket *sock,
         */
        smp_wmb();
        atomic_set(&sk->sk_refcnt, 1);
@@ -68787,10 +72345,10 @@ diff -urNp linux-3.0.4/net/core/sock.c linux-3.0.4/net/core/sock.c
  }
  EXPORT_SYMBOL(sock_init_data);
  
-diff -urNp linux-3.0.4/net/decnet/sysctl_net_decnet.c linux-3.0.4/net/decnet/sysctl_net_decnet.c
---- linux-3.0.4/net/decnet/sysctl_net_decnet.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/decnet/sysctl_net_decnet.c 2011-08-23 21:47:56.000000000 -0400
-@@ -173,7 +173,7 @@ static int dn_node_address_handler(ctl_t
+diff -urNp linux-3.1.3/net/decnet/sysctl_net_decnet.c linux-3.1.3/net/decnet/sysctl_net_decnet.c
+--- linux-3.1.3/net/decnet/sysctl_net_decnet.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/decnet/sysctl_net_decnet.c 2011-11-16 18:39:08.000000000 -0500
+@@ -174,7 +174,7 @@ static int dn_node_address_handler(ctl_t
  
        if (len > *lenp) len = *lenp;
  
@@ -68799,7 +72357,7 @@ diff -urNp linux-3.0.4/net/decnet/sysctl_net_decnet.c linux-3.0.4/net/decnet/sys
                return -EFAULT;
  
        *lenp = len;
-@@ -236,7 +236,7 @@ static int dn_def_dev_handler(ctl_table 
+@@ -237,7 +237,7 @@ static int dn_def_dev_handler(ctl_table 
  
        if (len > *lenp) len = *lenp;
  
@@ -68808,9 +72366,9 @@ diff -urNp linux-3.0.4/net/decnet/sysctl_net_decnet.c linux-3.0.4/net/decnet/sys
                return -EFAULT;
  
        *lenp = len;
-diff -urNp linux-3.0.4/net/econet/Kconfig linux-3.0.4/net/econet/Kconfig
---- linux-3.0.4/net/econet/Kconfig     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/econet/Kconfig     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/econet/Kconfig linux-3.1.3/net/econet/Kconfig
+--- linux-3.1.3/net/econet/Kconfig     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/econet/Kconfig     2011-11-16 18:40:44.000000000 -0500
 @@ -4,7 +4,7 @@
  
  config ECONET
@@ -68820,9 +72378,9 @@ diff -urNp linux-3.0.4/net/econet/Kconfig linux-3.0.4/net/econet/Kconfig
        ---help---
          Econet is a fairly old and slow networking protocol mainly used by
          Acorn computers to access file and print servers. It uses native
-diff -urNp linux-3.0.4/net/ipv4/fib_frontend.c linux-3.0.4/net/ipv4/fib_frontend.c
---- linux-3.0.4/net/ipv4/fib_frontend.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/ipv4/fib_frontend.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/ipv4/fib_frontend.c linux-3.1.3/net/ipv4/fib_frontend.c
+--- linux-3.1.3/net/ipv4/fib_frontend.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/fib_frontend.c        2011-11-16 18:39:08.000000000 -0500
 @@ -970,12 +970,12 @@ static int fib_inetaddr_event(struct not
  #ifdef CONFIG_IP_ROUTE_MULTIPATH
                fib_sync_up(dev);
@@ -68847,10 +72405,10 @@ diff -urNp linux-3.0.4/net/ipv4/fib_frontend.c linux-3.0.4/net/ipv4/fib_frontend
                rt_cache_flush(dev_net(dev), -1);
                break;
        case NETDEV_DOWN:
-diff -urNp linux-3.0.4/net/ipv4/fib_semantics.c linux-3.0.4/net/ipv4/fib_semantics.c
---- linux-3.0.4/net/ipv4/fib_semantics.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/ipv4/fib_semantics.c       2011-08-23 21:47:56.000000000 -0400
-@@ -691,7 +691,7 @@ __be32 fib_info_update_nh_saddr(struct n
+diff -urNp linux-3.1.3/net/ipv4/fib_semantics.c linux-3.1.3/net/ipv4/fib_semantics.c
+--- linux-3.1.3/net/ipv4/fib_semantics.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/fib_semantics.c       2011-11-16 18:39:08.000000000 -0500
+@@ -699,7 +699,7 @@ __be32 fib_info_update_nh_saddr(struct n
        nh->nh_saddr = inet_select_addr(nh->nh_dev,
                                        nh->nh_gw,
                                        nh->nh_parent->fib_scope);
@@ -68859,9 +72417,9 @@ diff -urNp linux-3.0.4/net/ipv4/fib_semantics.c linux-3.0.4/net/ipv4/fib_semanti
  
        return nh->nh_saddr;
  }
-diff -urNp linux-3.0.4/net/ipv4/inet_diag.c linux-3.0.4/net/ipv4/inet_diag.c
---- linux-3.0.4/net/ipv4/inet_diag.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/ipv4/inet_diag.c   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/ipv4/inet_diag.c linux-3.1.3/net/ipv4/inet_diag.c
+--- linux-3.1.3/net/ipv4/inet_diag.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/inet_diag.c   2011-11-16 18:40:44.000000000 -0500
 @@ -114,8 +114,14 @@ static int inet_csk_diag_fill(struct soc
        r->idiag_retrans = 0;
  
@@ -68923,9 +72481,9 @@ diff -urNp linux-3.0.4/net/ipv4/inet_diag.c linux-3.0.4/net/ipv4/inet_diag.c
  
        tmo = req->expires - jiffies;
        if (tmo < 0)
-diff -urNp linux-3.0.4/net/ipv4/inet_hashtables.c linux-3.0.4/net/ipv4/inet_hashtables.c
---- linux-3.0.4/net/ipv4/inet_hashtables.c     2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/net/ipv4/inet_hashtables.c     2011-08-23 21:55:24.000000000 -0400
+diff -urNp linux-3.1.3/net/ipv4/inet_hashtables.c linux-3.1.3/net/ipv4/inet_hashtables.c
+--- linux-3.1.3/net/ipv4/inet_hashtables.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/inet_hashtables.c     2011-11-16 18:40:44.000000000 -0500
 @@ -18,12 +18,15 @@
  #include <linux/sched.h>
  #include <linux/slab.h>
@@ -68951,33 +72509,63 @@ diff -urNp linux-3.0.4/net/ipv4/inet_hashtables.c linux-3.0.4/net/ipv4/inet_hash
                if (tw) {
                        inet_twsk_deschedule(tw, death_row);
                        while (twrefcnt) {
-diff -urNp linux-3.0.4/net/ipv4/inetpeer.c linux-3.0.4/net/ipv4/inetpeer.c
---- linux-3.0.4/net/ipv4/inetpeer.c    2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/net/ipv4/inetpeer.c    2011-08-23 21:48:14.000000000 -0400
-@@ -481,6 +481,8 @@ struct inet_peer *inet_getpeer(struct in
+diff -urNp linux-3.1.3/net/ipv4/inetpeer.c linux-3.1.3/net/ipv4/inetpeer.c
+--- linux-3.1.3/net/ipv4/inetpeer.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/inetpeer.c    2011-11-16 19:18:22.000000000 -0500
+@@ -400,6 +400,8 @@ struct inet_peer *inet_getpeer(const str
        unsigned int sequence;
-       int invalidated, newrefcnt = 0;
+       int invalidated, gccnt = 0;
  
 +      pax_track_stack();
 +
-       /* Look up for the address quickly, lockless.
+       /* Attempt a lockless lookup first.
         * Because of a concurrent writer, we might not find an existing entry.
         */
-@@ -517,8 +519,8 @@ found:             /* The existing node has been fo
+@@ -436,8 +438,8 @@ relookup:
        if (p) {
                p->daddr = *daddr;
                atomic_set(&p->refcnt, 1);
 -              atomic_set(&p->rid, 0);
--              atomic_set(&p->ip_id_count, secure_ip_id(daddr->addr.a4));
+-              atomic_set(&p->ip_id_count,
 +              atomic_set_unchecked(&p->rid, 0);
-+              atomic_set_unchecked(&p->ip_id_count, secure_ip_id(daddr->addr.a4));
-               p->tcp_ts_stamp = 0;
-               p->metrics[RTAX_LOCK-1] = INETPEER_METRICS_NEW;
-               p->rate_tokens = 0;
-diff -urNp linux-3.0.4/net/ipv4/ip_fragment.c linux-3.0.4/net/ipv4/ip_fragment.c
---- linux-3.0.4/net/ipv4/ip_fragment.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/ipv4/ip_fragment.c 2011-08-23 21:47:56.000000000 -0400
-@@ -315,7 +315,7 @@ static inline int ip_frag_too_far(struct
++              atomic_set_unchecked(&p->ip_id_count,
+                               (daddr->family == AF_INET) ?
+                                       secure_ip_id(daddr->addr.a4) :
+                                       secure_ipv6_id(daddr->addr.a6));
+diff -urNp linux-3.1.3/net/ipv4/ipconfig.c linux-3.1.3/net/ipv4/ipconfig.c
+--- linux-3.1.3/net/ipv4/ipconfig.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/ipconfig.c    2011-11-16 18:39:08.000000000 -0500
+@@ -313,7 +313,7 @@ static int __init ic_devinet_ioctl(unsig
+       mm_segment_t oldfs = get_fs();
+       set_fs(get_ds());
+-      res = devinet_ioctl(&init_net, cmd, (struct ifreq __user *) arg);
++      res = devinet_ioctl(&init_net, cmd, (struct ifreq __force_user *) arg);
+       set_fs(oldfs);
+       return res;
+ }
+@@ -324,7 +324,7 @@ static int __init ic_dev_ioctl(unsigned 
+       mm_segment_t oldfs = get_fs();
+       set_fs(get_ds());
+-      res = dev_ioctl(&init_net, cmd, (struct ifreq __user *) arg);
++      res = dev_ioctl(&init_net, cmd, (struct ifreq __force_user *) arg);
+       set_fs(oldfs);
+       return res;
+ }
+@@ -335,7 +335,7 @@ static int __init ic_route_ioctl(unsigne
+       mm_segment_t oldfs = get_fs();
+       set_fs(get_ds());
+-      res = ip_rt_ioctl(&init_net, cmd, (void __user *) arg);
++      res = ip_rt_ioctl(&init_net, cmd, (void __force_user *) arg);
+       set_fs(oldfs);
+       return res;
+ }
+diff -urNp linux-3.1.3/net/ipv4/ip_fragment.c linux-3.1.3/net/ipv4/ip_fragment.c
+--- linux-3.1.3/net/ipv4/ip_fragment.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/ip_fragment.c 2011-11-16 18:39:08.000000000 -0500
+@@ -316,7 +316,7 @@ static inline int ip_frag_too_far(struct
                return 0;
  
        start = qp->rid;
@@ -68986,9 +72574,9 @@ diff -urNp linux-3.0.4/net/ipv4/ip_fragment.c linux-3.0.4/net/ipv4/ip_fragment.c
        qp->rid = end;
  
        rc = qp->q.fragments && (end - start) > max;
-diff -urNp linux-3.0.4/net/ipv4/ip_sockglue.c linux-3.0.4/net/ipv4/ip_sockglue.c
---- linux-3.0.4/net/ipv4/ip_sockglue.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/ipv4/ip_sockglue.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/ipv4/ip_sockglue.c linux-3.1.3/net/ipv4/ip_sockglue.c
+--- linux-3.1.3/net/ipv4/ip_sockglue.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/ip_sockglue.c 2011-11-16 18:40:44.000000000 -0500
 @@ -1073,6 +1073,8 @@ static int do_ip_getsockopt(struct sock 
        int val;
        int len;
@@ -69008,9 +72596,18 @@ diff -urNp linux-3.0.4/net/ipv4/ip_sockglue.c linux-3.0.4/net/ipv4/ip_sockglue.c
                        return -EFAULT;
                return 0;
        }
-diff -urNp linux-3.0.4/net/ipv4/netfilter/nf_nat_snmp_basic.c linux-3.0.4/net/ipv4/netfilter/nf_nat_snmp_basic.c
---- linux-3.0.4/net/ipv4/netfilter/nf_nat_snmp_basic.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/ipv4/netfilter/nf_nat_snmp_basic.c 2011-08-23 21:47:56.000000000 -0400
+@@ -1238,7 +1241,7 @@ static int do_ip_getsockopt(struct sock 
+               if (sk->sk_type != SOCK_STREAM)
+                       return -ENOPROTOOPT;
+-              msg.msg_control = optval;
++              msg.msg_control = (void __force_kernel *)optval;
+               msg.msg_controllen = len;
+               msg.msg_flags = flags;
+diff -urNp linux-3.1.3/net/ipv4/netfilter/nf_nat_snmp_basic.c linux-3.1.3/net/ipv4/netfilter/nf_nat_snmp_basic.c
+--- linux-3.1.3/net/ipv4/netfilter/nf_nat_snmp_basic.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/netfilter/nf_nat_snmp_basic.c 2011-11-16 18:39:08.000000000 -0500
 @@ -399,7 +399,7 @@ static unsigned char asn1_octets_decode(
  
        *len = 0;
@@ -69020,9 +72617,9 @@ diff -urNp linux-3.0.4/net/ipv4/netfilter/nf_nat_snmp_basic.c linux-3.0.4/net/ip
        if (*octets == NULL) {
                if (net_ratelimit())
                        pr_notice("OOM in bsalg (%d)\n", __LINE__);
-diff -urNp linux-3.0.4/net/ipv4/ping.c linux-3.0.4/net/ipv4/ping.c
---- linux-3.0.4/net/ipv4/ping.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/ipv4/ping.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/ipv4/ping.c linux-3.1.3/net/ipv4/ping.c
+--- linux-3.1.3/net/ipv4/ping.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/ping.c        2011-11-16 18:39:08.000000000 -0500
 @@ -837,7 +837,7 @@ static void ping_format_sock(struct sock
                sk_rmem_alloc_get(sp),
                0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp),
@@ -69032,9 +72629,9 @@ diff -urNp linux-3.0.4/net/ipv4/ping.c linux-3.0.4/net/ipv4/ping.c
  }
  
  static int ping_seq_show(struct seq_file *seq, void *v)
-diff -urNp linux-3.0.4/net/ipv4/raw.c linux-3.0.4/net/ipv4/raw.c
---- linux-3.0.4/net/ipv4/raw.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/ipv4/raw.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/ipv4/raw.c linux-3.1.3/net/ipv4/raw.c
+--- linux-3.1.3/net/ipv4/raw.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/raw.c 2011-11-17 18:58:40.000000000 -0500
 @@ -302,7 +302,7 @@ static int raw_rcv_skb(struct sock * sk,
  int raw_rcv(struct sock *sk, struct sk_buff *skb)
  {
@@ -69044,7 +72641,7 @@ diff -urNp linux-3.0.4/net/ipv4/raw.c linux-3.0.4/net/ipv4/raw.c
                kfree_skb(skb);
                return NET_RX_DROP;
        }
-@@ -736,16 +736,20 @@ static int raw_init(struct sock *sk)
+@@ -737,16 +737,20 @@ static int raw_init(struct sock *sk)
  
  static int raw_seticmpfilter(struct sock *sk, char __user *optval, int optlen)
  {
@@ -69066,19 +72663,18 @@ diff -urNp linux-3.0.4/net/ipv4/raw.c linux-3.0.4/net/ipv4/raw.c
  
        if (get_user(len, optlen))
                goto out;
-@@ -755,8 +759,9 @@ static int raw_geticmpfilter(struct sock
+@@ -756,8 +760,8 @@ static int raw_geticmpfilter(struct sock
        if (len > sizeof(struct icmp_filter))
                len = sizeof(struct icmp_filter);
        ret = -EFAULT;
 -      if (put_user(len, optlen) ||
 -          copy_to_user(optval, &raw_sk(sk)->filter, len))
 +      filter = raw_sk(sk)->filter;
-+      if (put_user(len, optlen) || len > sizeof filter ||
-+          copy_to_user(optval, &filter, len))
++      if (put_user(len, optlen) || len > sizeof filter || copy_to_user(optval, &filter, len))
                goto out;
        ret = 0;
  out:  return ret;
-@@ -984,7 +989,13 @@ static void raw_sock_seq_show(struct seq
+@@ -985,7 +989,13 @@ static void raw_sock_seq_show(struct seq
                sk_wmem_alloc_get(sp),
                sk_rmem_alloc_get(sp),
                0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp),
@@ -69093,10 +72689,10 @@ diff -urNp linux-3.0.4/net/ipv4/raw.c linux-3.0.4/net/ipv4/raw.c
  }
  
  static int raw_seq_show(struct seq_file *seq, void *v)
-diff -urNp linux-3.0.4/net/ipv4/route.c linux-3.0.4/net/ipv4/route.c
---- linux-3.0.4/net/ipv4/route.c       2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/net/ipv4/route.c       2011-08-23 21:47:56.000000000 -0400
-@@ -304,7 +304,7 @@ static inline unsigned int rt_hash(__be3
+diff -urNp linux-3.1.3/net/ipv4/route.c linux-3.1.3/net/ipv4/route.c
+--- linux-3.1.3/net/ipv4/route.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/route.c       2011-11-16 18:39:08.000000000 -0500
+@@ -308,7 +308,7 @@ static inline unsigned int rt_hash(__be3
  
  static inline int rt_genid(struct net *net)
  {
@@ -69105,7 +72701,7 @@ diff -urNp linux-3.0.4/net/ipv4/route.c linux-3.0.4/net/ipv4/route.c
  }
  
  #ifdef CONFIG_PROC_FS
-@@ -833,7 +833,7 @@ static void rt_cache_invalidate(struct n
+@@ -837,7 +837,7 @@ static void rt_cache_invalidate(struct n
        unsigned char shuffle;
  
        get_random_bytes(&shuffle, sizeof(shuffle));
@@ -69114,7 +72710,7 @@ diff -urNp linux-3.0.4/net/ipv4/route.c linux-3.0.4/net/ipv4/route.c
  }
  
  /*
-@@ -2834,7 +2834,7 @@ static int rt_fill_info(struct net *net,
+@@ -2872,7 +2872,7 @@ static int rt_fill_info(struct net *net,
        error = rt->dst.error;
        if (peer) {
                inet_peer_refcheck(rt->peer);
@@ -69123,9 +72719,9 @@ diff -urNp linux-3.0.4/net/ipv4/route.c linux-3.0.4/net/ipv4/route.c
                if (peer->tcp_ts_stamp) {
                        ts = peer->tcp_ts;
                        tsage = get_seconds() - peer->tcp_ts_stamp;
-diff -urNp linux-3.0.4/net/ipv4/tcp.c linux-3.0.4/net/ipv4/tcp.c
---- linux-3.0.4/net/ipv4/tcp.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/ipv4/tcp.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/ipv4/tcp.c linux-3.1.3/net/ipv4/tcp.c
+--- linux-3.1.3/net/ipv4/tcp.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/tcp.c 2011-11-16 18:40:44.000000000 -0500
 @@ -2122,6 +2122,8 @@ static int do_tcp_setsockopt(struct sock
        int val;
        int err = 0;
@@ -69144,9 +72740,9 @@ diff -urNp linux-3.0.4/net/ipv4/tcp.c linux-3.0.4/net/ipv4/tcp.c
        if (get_user(len, optlen))
                return -EFAULT;
  
-diff -urNp linux-3.0.4/net/ipv4/tcp_ipv4.c linux-3.0.4/net/ipv4/tcp_ipv4.c
---- linux-3.0.4/net/ipv4/tcp_ipv4.c    2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/net/ipv4/tcp_ipv4.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/ipv4/tcp_ipv4.c linux-3.1.3/net/ipv4/tcp_ipv4.c
+--- linux-3.1.3/net/ipv4/tcp_ipv4.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/tcp_ipv4.c    2011-11-16 18:40:44.000000000 -0500
 @@ -87,6 +87,9 @@ int sysctl_tcp_tw_reuse __read_mostly;
  int sysctl_tcp_low_latency __read_mostly;
  EXPORT_SYMBOL(sysctl_tcp_low_latency);
@@ -69157,7 +72753,7 @@ diff -urNp linux-3.0.4/net/ipv4/tcp_ipv4.c linux-3.0.4/net/ipv4/tcp_ipv4.c
  
  #ifdef CONFIG_TCP_MD5SIG
  static struct tcp_md5sig_key *tcp_v4_md5_do_lookup(struct sock *sk,
-@@ -1607,6 +1610,9 @@ int tcp_v4_do_rcv(struct sock *sk, struc
+@@ -1622,6 +1625,9 @@ int tcp_v4_do_rcv(struct sock *sk, struc
        return 0;
  
  reset:
@@ -69167,7 +72763,7 @@ diff -urNp linux-3.0.4/net/ipv4/tcp_ipv4.c linux-3.0.4/net/ipv4/tcp_ipv4.c
        tcp_v4_send_reset(rsk, skb);
  discard:
        kfree_skb(skb);
-@@ -1669,12 +1675,19 @@ int tcp_v4_rcv(struct sk_buff *skb)
+@@ -1684,12 +1690,19 @@ int tcp_v4_rcv(struct sk_buff *skb)
        TCP_SKB_CB(skb)->sacked  = 0;
  
        sk = __inet_lookup_skb(&tcp_hashinfo, skb, th->source, th->dest);
@@ -69190,7 +72786,7 @@ diff -urNp linux-3.0.4/net/ipv4/tcp_ipv4.c linux-3.0.4/net/ipv4/tcp_ipv4.c
  
        if (unlikely(iph->ttl < inet_sk(sk)->min_ttl)) {
                NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP);
-@@ -1724,6 +1737,10 @@ no_tcp_socket:
+@@ -1739,6 +1752,10 @@ no_tcp_socket:
  bad_packet:
                TCP_INC_STATS_BH(net, TCP_MIB_INERRS);
        } else {
@@ -69201,7 +72797,7 @@ diff -urNp linux-3.0.4/net/ipv4/tcp_ipv4.c linux-3.0.4/net/ipv4/tcp_ipv4.c
                tcp_v4_send_reset(NULL, skb);
        }
  
-@@ -2388,7 +2405,11 @@ static void get_openreq4(struct sock *sk
+@@ -2403,7 +2420,11 @@ static void get_openreq4(struct sock *sk
                0,  /* non standard timer */
                0, /* open_requests have no inode */
                atomic_read(&sk->sk_refcnt),
@@ -69213,7 +72809,7 @@ diff -urNp linux-3.0.4/net/ipv4/tcp_ipv4.c linux-3.0.4/net/ipv4/tcp_ipv4.c
                len);
  }
  
-@@ -2438,7 +2459,12 @@ static void get_tcp4_sock(struct sock *s
+@@ -2453,7 +2474,12 @@ static void get_tcp4_sock(struct sock *s
                sock_i_uid(sk),
                icsk->icsk_probes_out,
                sock_i_ino(sk),
@@ -69227,7 +72823,7 @@ diff -urNp linux-3.0.4/net/ipv4/tcp_ipv4.c linux-3.0.4/net/ipv4/tcp_ipv4.c
                jiffies_to_clock_t(icsk->icsk_rto),
                jiffies_to_clock_t(icsk->icsk_ack.ato),
                (icsk->icsk_ack.quick << 1) | icsk->icsk_ack.pingpong,
-@@ -2466,7 +2492,13 @@ static void get_timewait4_sock(struct in
+@@ -2481,7 +2507,13 @@ static void get_timewait4_sock(struct in
                " %02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %pK%n",
                i, src, srcp, dest, destp, tw->tw_substate, 0, 0,
                3, jiffies_to_clock_t(ttd), 0, 0, 0, 0,
@@ -69242,9 +72838,9 @@ diff -urNp linux-3.0.4/net/ipv4/tcp_ipv4.c linux-3.0.4/net/ipv4/tcp_ipv4.c
  }
  
  #define TMPSZ 150
-diff -urNp linux-3.0.4/net/ipv4/tcp_minisocks.c linux-3.0.4/net/ipv4/tcp_minisocks.c
---- linux-3.0.4/net/ipv4/tcp_minisocks.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/ipv4/tcp_minisocks.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/ipv4/tcp_minisocks.c linux-3.1.3/net/ipv4/tcp_minisocks.c
+--- linux-3.1.3/net/ipv4/tcp_minisocks.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/tcp_minisocks.c       2011-11-16 18:40:44.000000000 -0500
 @@ -27,6 +27,10 @@
  #include <net/inet_common.h>
  #include <net/xfrm.h>
@@ -69256,7 +72852,7 @@ diff -urNp linux-3.0.4/net/ipv4/tcp_minisocks.c linux-3.0.4/net/ipv4/tcp_minisoc
  int sysctl_tcp_syncookies __read_mostly = 1;
  EXPORT_SYMBOL(sysctl_tcp_syncookies);
  
-@@ -745,6 +749,10 @@ listen_overflow:
+@@ -750,6 +754,10 @@ listen_overflow:
  
  embryonic_reset:
        NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_EMBRYONICRSTS);
@@ -69267,9 +72863,9 @@ diff -urNp linux-3.0.4/net/ipv4/tcp_minisocks.c linux-3.0.4/net/ipv4/tcp_minisoc
        if (!(flg & TCP_FLAG_RST))
                req->rsk_ops->send_reset(sk, skb);
  
-diff -urNp linux-3.0.4/net/ipv4/tcp_output.c linux-3.0.4/net/ipv4/tcp_output.c
---- linux-3.0.4/net/ipv4/tcp_output.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/ipv4/tcp_output.c  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/ipv4/tcp_output.c linux-3.1.3/net/ipv4/tcp_output.c
+--- linux-3.1.3/net/ipv4/tcp_output.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/tcp_output.c  2011-11-16 18:40:44.000000000 -0500
 @@ -2421,6 +2421,8 @@ struct sk_buff *tcp_make_synack(struct s
        int mss;
        int s_data_desired = 0;
@@ -69279,9 +72875,9 @@ diff -urNp linux-3.0.4/net/ipv4/tcp_output.c linux-3.0.4/net/ipv4/tcp_output.c
        if (cvp != NULL && cvp->s_data_constant && cvp->s_data_desired)
                s_data_desired = cvp->s_data_desired;
        skb = sock_wmalloc(sk, MAX_TCP_HEADER + 15 + s_data_desired, 1, GFP_ATOMIC);
-diff -urNp linux-3.0.4/net/ipv4/tcp_probe.c linux-3.0.4/net/ipv4/tcp_probe.c
---- linux-3.0.4/net/ipv4/tcp_probe.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/ipv4/tcp_probe.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/ipv4/tcp_probe.c linux-3.1.3/net/ipv4/tcp_probe.c
+--- linux-3.1.3/net/ipv4/tcp_probe.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/tcp_probe.c   2011-11-16 18:39:08.000000000 -0500
 @@ -202,7 +202,7 @@ static ssize_t tcpprobe_read(struct file
                if (cnt + width >= len)
                        break;
@@ -69291,9 +72887,9 @@ diff -urNp linux-3.0.4/net/ipv4/tcp_probe.c linux-3.0.4/net/ipv4/tcp_probe.c
                        return -EFAULT;
                cnt += width;
        }
-diff -urNp linux-3.0.4/net/ipv4/tcp_timer.c linux-3.0.4/net/ipv4/tcp_timer.c
---- linux-3.0.4/net/ipv4/tcp_timer.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/ipv4/tcp_timer.c   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/ipv4/tcp_timer.c linux-3.1.3/net/ipv4/tcp_timer.c
+--- linux-3.1.3/net/ipv4/tcp_timer.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/tcp_timer.c   2011-11-16 18:40:44.000000000 -0500
 @@ -22,6 +22,10 @@
  #include <linux/gfp.h>
  #include <net/tcp.h>
@@ -69319,9 +72915,9 @@ diff -urNp linux-3.0.4/net/ipv4/tcp_timer.c linux-3.0.4/net/ipv4/tcp_timer.c
        if (retransmits_timed_out(sk, retry_until,
                                  syn_set ? 0 : icsk->icsk_user_timeout, syn_set)) {
                /* Has it gone just too far? */
-diff -urNp linux-3.0.4/net/ipv4/udp.c linux-3.0.4/net/ipv4/udp.c
---- linux-3.0.4/net/ipv4/udp.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/ipv4/udp.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/ipv4/udp.c linux-3.1.3/net/ipv4/udp.c
+--- linux-3.1.3/net/ipv4/udp.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv4/udp.c 2011-11-16 19:17:54.000000000 -0500
 @@ -86,6 +86,7 @@
  #include <linux/types.h>
  #include <linux/fcntl.h>
@@ -69330,8 +72926,8 @@ diff -urNp linux-3.0.4/net/ipv4/udp.c linux-3.0.4/net/ipv4/udp.c
  #include <linux/socket.h>
  #include <linux/sockios.h>
  #include <linux/igmp.h>
-@@ -107,6 +108,10 @@
- #include <net/xfrm.h>
+@@ -108,6 +109,10 @@
+ #include <trace/events/udp.h>
  #include "udp_impl.h"
  
 +#ifdef CONFIG_GRKERNSEC_BLACKHOLE
@@ -69341,7 +72937,7 @@ diff -urNp linux-3.0.4/net/ipv4/udp.c linux-3.0.4/net/ipv4/udp.c
  struct udp_table udp_table __read_mostly;
  EXPORT_SYMBOL(udp_table);
  
-@@ -564,6 +569,9 @@ found:
+@@ -565,6 +570,9 @@ found:
        return s;
  }
  
@@ -69351,7 +72947,7 @@ diff -urNp linux-3.0.4/net/ipv4/udp.c linux-3.0.4/net/ipv4/udp.c
  /*
   * This routine is called by the ICMP module when it gets some
   * sort of error condition.  If err < 0 then the socket should
-@@ -855,9 +863,18 @@ int udp_sendmsg(struct kiocb *iocb, stru
+@@ -856,9 +864,18 @@ int udp_sendmsg(struct kiocb *iocb, stru
                dport = usin->sin_port;
                if (dport == 0)
                        return -EINVAL;
@@ -69370,7 +72966,7 @@ diff -urNp linux-3.0.4/net/ipv4/udp.c linux-3.0.4/net/ipv4/udp.c
                daddr = inet->inet_daddr;
                dport = inet->inet_dport;
                /* Open fast path for connected socket.
-@@ -1098,7 +1115,7 @@ static unsigned int first_packet_length(
+@@ -1099,7 +1116,7 @@ static unsigned int first_packet_length(
                udp_lib_checksum_complete(skb)) {
                UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS,
                                 IS_UDPLITE(sk));
@@ -69379,7 +72975,7 @@ diff -urNp linux-3.0.4/net/ipv4/udp.c linux-3.0.4/net/ipv4/udp.c
                __skb_unlink(skb, rcvq);
                __skb_queue_tail(&list_kill, skb);
        }
-@@ -1184,6 +1201,10 @@ try_again:
+@@ -1185,6 +1202,10 @@ try_again:
        if (!skb)
                goto out;
  
@@ -69390,7 +72986,7 @@ diff -urNp linux-3.0.4/net/ipv4/udp.c linux-3.0.4/net/ipv4/udp.c
        ulen = skb->len - sizeof(struct udphdr);
        if (len > ulen)
                len = ulen;
-@@ -1483,7 +1504,7 @@ int udp_queue_rcv_skb(struct sock *sk, s
+@@ -1485,7 +1506,7 @@ int udp_queue_rcv_skb(struct sock *sk, s
  
  drop:
        UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite);
@@ -69399,7 +72995,7 @@ diff -urNp linux-3.0.4/net/ipv4/udp.c linux-3.0.4/net/ipv4/udp.c
        kfree_skb(skb);
        return -1;
  }
-@@ -1502,7 +1523,7 @@ static void flush_stack(struct sock **st
+@@ -1504,7 +1525,7 @@ static void flush_stack(struct sock **st
                        skb1 = (i == final) ? skb : skb_clone(skb, GFP_ATOMIC);
  
                if (!skb1) {
@@ -69408,7 +73004,7 @@ diff -urNp linux-3.0.4/net/ipv4/udp.c linux-3.0.4/net/ipv4/udp.c
                        UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS,
                                         IS_UDPLITE(sk));
                        UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS,
-@@ -1671,6 +1692,9 @@ int __udp4_lib_rcv(struct sk_buff *skb, 
+@@ -1673,6 +1694,9 @@ int __udp4_lib_rcv(struct sk_buff *skb, 
                goto csum_error;
  
        UDP_INC_STATS_BH(net, UDP_MIB_NOPORTS, proto == IPPROTO_UDPLITE);
@@ -69418,7 +73014,7 @@ diff -urNp linux-3.0.4/net/ipv4/udp.c linux-3.0.4/net/ipv4/udp.c
        icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
  
        /*
-@@ -2098,8 +2122,13 @@ static void udp4_format_sock(struct sock
+@@ -2100,8 +2124,13 @@ static void udp4_format_sock(struct sock
                sk_wmem_alloc_get(sp),
                sk_rmem_alloc_get(sp),
                0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp),
@@ -69434,9 +73030,21 @@ diff -urNp linux-3.0.4/net/ipv4/udp.c linux-3.0.4/net/ipv4/udp.c
  }
  
  int udp4_seq_show(struct seq_file *seq, void *v)
-diff -urNp linux-3.0.4/net/ipv6/inet6_connection_sock.c linux-3.0.4/net/ipv6/inet6_connection_sock.c
---- linux-3.0.4/net/ipv6/inet6_connection_sock.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/ipv6/inet6_connection_sock.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/ipv6/addrconf.c linux-3.1.3/net/ipv6/addrconf.c
+--- linux-3.1.3/net/ipv6/addrconf.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv6/addrconf.c    2011-11-16 18:39:08.000000000 -0500
+@@ -2083,7 +2083,7 @@ int addrconf_set_dstaddr(struct net *net
+               p.iph.ihl = 5;
+               p.iph.protocol = IPPROTO_IPV6;
+               p.iph.ttl = 64;
+-              ifr.ifr_ifru.ifru_data = (__force void __user *)&p;
++              ifr.ifr_ifru.ifru_data = (void __force_user *)&p;
+               if (ops->ndo_do_ioctl) {
+                       mm_segment_t oldfs = get_fs();
+diff -urNp linux-3.1.3/net/ipv6/inet6_connection_sock.c linux-3.1.3/net/ipv6/inet6_connection_sock.c
+--- linux-3.1.3/net/ipv6/inet6_connection_sock.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv6/inet6_connection_sock.c       2011-11-16 18:39:08.000000000 -0500
 @@ -178,7 +178,7 @@ void __inet6_csk_dst_store(struct sock *
  #ifdef CONFIG_XFRM
        {
@@ -69455,9 +73063,9 @@ diff -urNp linux-3.0.4/net/ipv6/inet6_connection_sock.c linux-3.0.4/net/ipv6/ine
                        __sk_dst_reset(sk);
                        dst = NULL;
                }
-diff -urNp linux-3.0.4/net/ipv6/ipv6_sockglue.c linux-3.0.4/net/ipv6/ipv6_sockglue.c
---- linux-3.0.4/net/ipv6/ipv6_sockglue.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/ipv6/ipv6_sockglue.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/ipv6/ipv6_sockglue.c linux-3.1.3/net/ipv6/ipv6_sockglue.c
+--- linux-3.1.3/net/ipv6/ipv6_sockglue.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv6/ipv6_sockglue.c       2011-11-16 18:40:44.000000000 -0500
 @@ -129,6 +129,8 @@ static int do_ipv6_setsockopt(struct soc
        int val, valbool;
        int retv = -ENOPROTOOPT;
@@ -69476,9 +73084,18 @@ diff -urNp linux-3.0.4/net/ipv6/ipv6_sockglue.c linux-3.0.4/net/ipv6/ipv6_sockgl
        if (ip6_mroute_opt(optname))
                return ip6_mroute_getsockopt(sk, optname, optval, optlen);
  
-diff -urNp linux-3.0.4/net/ipv6/raw.c linux-3.0.4/net/ipv6/raw.c
---- linux-3.0.4/net/ipv6/raw.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/ipv6/raw.c 2011-08-23 21:48:14.000000000 -0400
+@@ -960,7 +964,7 @@ static int do_ipv6_getsockopt(struct soc
+               if (sk->sk_type != SOCK_STREAM)
+                       return -ENOPROTOOPT;
+-              msg.msg_control = optval;
++              msg.msg_control = (void __force_kernel *)optval;
+               msg.msg_controllen = len;
+               msg.msg_flags = flags;
+diff -urNp linux-3.1.3/net/ipv6/raw.c linux-3.1.3/net/ipv6/raw.c
+--- linux-3.1.3/net/ipv6/raw.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv6/raw.c 2011-11-16 18:40:44.000000000 -0500
 @@ -376,7 +376,7 @@ static inline int rawv6_rcv_skb(struct s
  {
        if ((raw6_sk(sk)->checksum || rcu_dereference_raw(sk->sk_filter)) &&
@@ -69559,7 +73176,7 @@ diff -urNp linux-3.0.4/net/ipv6/raw.c linux-3.0.4/net/ipv6/raw.c
                        return -EFAULT;
                return 0;
        default:
-@@ -1252,7 +1259,13 @@ static void raw6_sock_seq_show(struct se
+@@ -1245,7 +1252,13 @@ static void raw6_sock_seq_show(struct se
                   0, 0L, 0,
                   sock_i_uid(sp), 0,
                   sock_i_ino(sp),
@@ -69574,9 +73191,9 @@ diff -urNp linux-3.0.4/net/ipv6/raw.c linux-3.0.4/net/ipv6/raw.c
  }
  
  static int raw6_seq_show(struct seq_file *seq, void *v)
-diff -urNp linux-3.0.4/net/ipv6/tcp_ipv6.c linux-3.0.4/net/ipv6/tcp_ipv6.c
---- linux-3.0.4/net/ipv6/tcp_ipv6.c    2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/net/ipv6/tcp_ipv6.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/ipv6/tcp_ipv6.c linux-3.1.3/net/ipv6/tcp_ipv6.c
+--- linux-3.1.3/net/ipv6/tcp_ipv6.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv6/tcp_ipv6.c    2011-11-16 18:40:44.000000000 -0500
 @@ -93,6 +93,10 @@ static struct tcp_md5sig_key *tcp_v6_md5
  }
  #endif
@@ -69588,7 +73205,7 @@ diff -urNp linux-3.0.4/net/ipv6/tcp_ipv6.c linux-3.0.4/net/ipv6/tcp_ipv6.c
  static void tcp_v6_hash(struct sock *sk)
  {
        if (sk->sk_state != TCP_CLOSE) {
-@@ -1662,6 +1666,9 @@ static int tcp_v6_do_rcv(struct sock *sk
+@@ -1647,6 +1651,9 @@ static int tcp_v6_do_rcv(struct sock *sk
        return 0;
  
  reset:
@@ -69598,7 +73215,7 @@ diff -urNp linux-3.0.4/net/ipv6/tcp_ipv6.c linux-3.0.4/net/ipv6/tcp_ipv6.c
        tcp_v6_send_reset(sk, skb);
  discard:
        if (opt_skb)
-@@ -1741,12 +1748,20 @@ static int tcp_v6_rcv(struct sk_buff *sk
+@@ -1726,12 +1733,20 @@ static int tcp_v6_rcv(struct sk_buff *sk
        TCP_SKB_CB(skb)->sacked = 0;
  
        sk = __inet6_lookup_skb(&tcp_hashinfo, skb, th->source, th->dest);
@@ -69621,7 +73238,7 @@ diff -urNp linux-3.0.4/net/ipv6/tcp_ipv6.c linux-3.0.4/net/ipv6/tcp_ipv6.c
  
        if (hdr->hop_limit < inet6_sk(sk)->min_hopcount) {
                NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP);
-@@ -1794,6 +1809,10 @@ no_tcp_socket:
+@@ -1779,6 +1794,10 @@ no_tcp_socket:
  bad_packet:
                TCP_INC_STATS_BH(net, TCP_MIB_INERRS);
        } else {
@@ -69632,7 +73249,7 @@ diff -urNp linux-3.0.4/net/ipv6/tcp_ipv6.c linux-3.0.4/net/ipv6/tcp_ipv6.c
                tcp_v6_send_reset(NULL, skb);
        }
  
-@@ -2054,7 +2073,13 @@ static void get_openreq6(struct seq_file
+@@ -2039,7 +2058,13 @@ static void get_openreq6(struct seq_file
                   uid,
                   0,  /* non standard timer */
                   0, /* open_requests have no inode */
@@ -69647,7 +73264,7 @@ diff -urNp linux-3.0.4/net/ipv6/tcp_ipv6.c linux-3.0.4/net/ipv6/tcp_ipv6.c
  }
  
  static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i)
-@@ -2104,7 +2129,12 @@ static void get_tcp6_sock(struct seq_fil
+@@ -2089,7 +2114,12 @@ static void get_tcp6_sock(struct seq_fil
                   sock_i_uid(sp),
                   icsk->icsk_probes_out,
                   sock_i_ino(sp),
@@ -69661,7 +73278,7 @@ diff -urNp linux-3.0.4/net/ipv6/tcp_ipv6.c linux-3.0.4/net/ipv6/tcp_ipv6.c
                   jiffies_to_clock_t(icsk->icsk_rto),
                   jiffies_to_clock_t(icsk->icsk_ack.ato),
                   (icsk->icsk_ack.quick << 1 ) | icsk->icsk_ack.pingpong,
-@@ -2139,7 +2169,13 @@ static void get_timewait6_sock(struct se
+@@ -2124,7 +2154,13 @@ static void get_timewait6_sock(struct se
                   dest->s6_addr32[2], dest->s6_addr32[3], destp,
                   tw->tw_substate, 0, 0,
                   3, jiffies_to_clock_t(ttd), 0, 0, 0, 0,
@@ -69676,9 +73293,9 @@ diff -urNp linux-3.0.4/net/ipv6/tcp_ipv6.c linux-3.0.4/net/ipv6/tcp_ipv6.c
  }
  
  static int tcp6_seq_show(struct seq_file *seq, void *v)
-diff -urNp linux-3.0.4/net/ipv6/udp.c linux-3.0.4/net/ipv6/udp.c
---- linux-3.0.4/net/ipv6/udp.c 2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/net/ipv6/udp.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/ipv6/udp.c linux-3.1.3/net/ipv6/udp.c
+--- linux-3.1.3/net/ipv6/udp.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/ipv6/udp.c 2011-11-16 18:40:44.000000000 -0500
 @@ -50,6 +50,10 @@
  #include <linux/seq_file.h>
  #include "udp_impl.h"
@@ -69743,9 +73360,9 @@ diff -urNp linux-3.0.4/net/ipv6/udp.c linux-3.0.4/net/ipv6/udp.c
  }
  
  int udp6_seq_show(struct seq_file *seq, void *v)
-diff -urNp linux-3.0.4/net/irda/ircomm/ircomm_tty.c linux-3.0.4/net/irda/ircomm/ircomm_tty.c
---- linux-3.0.4/net/irda/ircomm/ircomm_tty.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/irda/ircomm/ircomm_tty.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/irda/ircomm/ircomm_tty.c linux-3.1.3/net/irda/ircomm/ircomm_tty.c
+--- linux-3.1.3/net/irda/ircomm/ircomm_tty.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/irda/ircomm/ircomm_tty.c   2011-11-16 18:39:08.000000000 -0500
 @@ -282,16 +282,16 @@ static int ircomm_tty_block_til_ready(st
        add_wait_queue(&self->open_wait, &wait);
  
@@ -69868,9 +73485,9 @@ diff -urNp linux-3.0.4/net/irda/ircomm/ircomm_tty.c linux-3.0.4/net/irda/ircomm/
        seq_printf(m, "Max data size: %d\n", self->max_data_size);
        seq_printf(m, "Max header size: %d\n", self->max_header_size);
  
-diff -urNp linux-3.0.4/net/iucv/af_iucv.c linux-3.0.4/net/iucv/af_iucv.c
---- linux-3.0.4/net/iucv/af_iucv.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/iucv/af_iucv.c     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/iucv/af_iucv.c linux-3.1.3/net/iucv/af_iucv.c
+--- linux-3.1.3/net/iucv/af_iucv.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/iucv/af_iucv.c     2011-11-16 18:39:08.000000000 -0500
 @@ -648,10 +648,10 @@ static int iucv_sock_autobind(struct soc
  
        write_lock_bh(&iucv_sk_list.lock);
@@ -69884,9 +73501,9 @@ diff -urNp linux-3.0.4/net/iucv/af_iucv.c linux-3.0.4/net/iucv/af_iucv.c
        }
  
        write_unlock_bh(&iucv_sk_list.lock);
-diff -urNp linux-3.0.4/net/key/af_key.c linux-3.0.4/net/key/af_key.c
---- linux-3.0.4/net/key/af_key.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/key/af_key.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/key/af_key.c linux-3.1.3/net/key/af_key.c
+--- linux-3.1.3/net/key/af_key.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/key/af_key.c       2011-11-16 18:40:44.000000000 -0500
 @@ -2481,6 +2481,8 @@ static int pfkey_migrate(struct sock *sk
        struct xfrm_migrate m[XFRM_MAX_DEPTH];
        struct xfrm_kmaddress k;
@@ -69909,9 +73526,9 @@ diff -urNp linux-3.0.4/net/key/af_key.c linux-3.0.4/net/key/af_key.c
        } while (!res);
        return res;
  }
-diff -urNp linux-3.0.4/net/lapb/lapb_iface.c linux-3.0.4/net/lapb/lapb_iface.c
---- linux-3.0.4/net/lapb/lapb_iface.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/lapb/lapb_iface.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/lapb/lapb_iface.c linux-3.1.3/net/lapb/lapb_iface.c
+--- linux-3.1.3/net/lapb/lapb_iface.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/lapb/lapb_iface.c  2011-11-16 18:39:08.000000000 -0500
 @@ -158,7 +158,7 @@ int lapb_register(struct net_device *dev
                goto out;
  
@@ -69975,9 +73592,9 @@ diff -urNp linux-3.0.4/net/lapb/lapb_iface.c linux-3.0.4/net/lapb/lapb_iface.c
                used = 1;
        }
  
-diff -urNp linux-3.0.4/net/mac80211/debugfs_sta.c linux-3.0.4/net/mac80211/debugfs_sta.c
---- linux-3.0.4/net/mac80211/debugfs_sta.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/mac80211/debugfs_sta.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/mac80211/debugfs_sta.c linux-3.1.3/net/mac80211/debugfs_sta.c
+--- linux-3.1.3/net/mac80211/debugfs_sta.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/mac80211/debugfs_sta.c     2011-11-16 18:40:44.000000000 -0500
 @@ -140,6 +140,8 @@ static ssize_t sta_agg_status_read(struc
        struct tid_ampdu_rx *tid_rx;
        struct tid_ampdu_tx *tid_tx;
@@ -69996,9 +73613,9 @@ diff -urNp linux-3.0.4/net/mac80211/debugfs_sta.c linux-3.0.4/net/mac80211/debug
        p += scnprintf(p, sizeof(buf) + buf - p, "ht %ssupported\n",
                        htc->ht_supported ? "" : "not ");
        if (htc->ht_supported) {
-diff -urNp linux-3.0.4/net/mac80211/ieee80211_i.h linux-3.0.4/net/mac80211/ieee80211_i.h
---- linux-3.0.4/net/mac80211/ieee80211_i.h     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/mac80211/ieee80211_i.h     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/mac80211/ieee80211_i.h linux-3.1.3/net/mac80211/ieee80211_i.h
+--- linux-3.1.3/net/mac80211/ieee80211_i.h     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/mac80211/ieee80211_i.h     2011-11-16 18:39:08.000000000 -0500
 @@ -27,6 +27,7 @@
  #include <net/ieee80211_radiotap.h>
  #include <net/cfg80211.h>
@@ -70007,7 +73624,7 @@ diff -urNp linux-3.0.4/net/mac80211/ieee80211_i.h linux-3.0.4/net/mac80211/ieee8
  #include "key.h"
  #include "sta_info.h"
  
-@@ -721,7 +722,7 @@ struct ieee80211_local {
+@@ -754,7 +755,7 @@ struct ieee80211_local {
        /* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */
        spinlock_t queue_stop_reason_lock;
  
@@ -70016,9 +73633,9 @@ diff -urNp linux-3.0.4/net/mac80211/ieee80211_i.h linux-3.0.4/net/mac80211/ieee8
        int monitors, cooked_mntrs;
        /* number of interfaces with corresponding FIF_ flags */
        int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll,
-diff -urNp linux-3.0.4/net/mac80211/iface.c linux-3.0.4/net/mac80211/iface.c
---- linux-3.0.4/net/mac80211/iface.c   2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/net/mac80211/iface.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/mac80211/iface.c linux-3.1.3/net/mac80211/iface.c
+--- linux-3.1.3/net/mac80211/iface.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/mac80211/iface.c   2011-11-16 18:39:08.000000000 -0500
 @@ -211,7 +211,7 @@ static int ieee80211_do_open(struct net_
                break;
        }
@@ -70055,7 +73672,7 @@ diff -urNp linux-3.0.4/net/mac80211/iface.c linux-3.0.4/net/mac80211/iface.c
                drv_stop(local);
   err_del_bss:
        sdata->bss = NULL;
-@@ -475,7 +475,7 @@ static void ieee80211_do_stop(struct iee
+@@ -474,7 +474,7 @@ static void ieee80211_do_stop(struct iee
        }
  
        if (going_down)
@@ -70064,7 +73681,7 @@ diff -urNp linux-3.0.4/net/mac80211/iface.c linux-3.0.4/net/mac80211/iface.c
  
        switch (sdata->vif.type) {
        case NL80211_IFTYPE_AP_VLAN:
-@@ -534,7 +534,7 @@ static void ieee80211_do_stop(struct iee
+@@ -533,7 +533,7 @@ static void ieee80211_do_stop(struct iee
  
        ieee80211_recalc_ps(local, -1);
  
@@ -70073,9 +73690,9 @@ diff -urNp linux-3.0.4/net/mac80211/iface.c linux-3.0.4/net/mac80211/iface.c
                if (local->ops->napi_poll)
                        napi_disable(&local->napi);
                ieee80211_clear_tx_pending(local);
-diff -urNp linux-3.0.4/net/mac80211/main.c linux-3.0.4/net/mac80211/main.c
---- linux-3.0.4/net/mac80211/main.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/mac80211/main.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/mac80211/main.c linux-3.1.3/net/mac80211/main.c
+--- linux-3.1.3/net/mac80211/main.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/mac80211/main.c    2011-11-16 18:39:08.000000000 -0500
 @@ -209,7 +209,7 @@ int ieee80211_hw_config(struct ieee80211
                local->hw.conf.power_level = power;
        }
@@ -70085,10 +73702,10 @@ diff -urNp linux-3.0.4/net/mac80211/main.c linux-3.0.4/net/mac80211/main.c
                ret = drv_config(local, changed);
                /*
                 * Goal:
-diff -urNp linux-3.0.4/net/mac80211/mlme.c linux-3.0.4/net/mac80211/mlme.c
---- linux-3.0.4/net/mac80211/mlme.c    2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/net/mac80211/mlme.c    2011-08-23 21:48:14.000000000 -0400
-@@ -1444,6 +1444,8 @@ static bool ieee80211_assoc_success(stru
+diff -urNp linux-3.1.3/net/mac80211/mlme.c linux-3.1.3/net/mac80211/mlme.c
+--- linux-3.1.3/net/mac80211/mlme.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/mac80211/mlme.c    2011-11-16 18:40:44.000000000 -0500
+@@ -1464,6 +1464,8 @@ static bool ieee80211_assoc_success(stru
        bool have_higher_than_11mbit = false;
        u16 ap_ht_cap_flags;
  
@@ -70097,10 +73714,19 @@ diff -urNp linux-3.0.4/net/mac80211/mlme.c linux-3.0.4/net/mac80211/mlme.c
        /* AssocResp and ReassocResp have identical structure */
  
        aid = le16_to_cpu(mgmt->u.assoc_resp.aid);
-diff -urNp linux-3.0.4/net/mac80211/pm.c linux-3.0.4/net/mac80211/pm.c
---- linux-3.0.4/net/mac80211/pm.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/mac80211/pm.c      2011-08-23 21:47:56.000000000 -0400
-@@ -47,7 +47,7 @@ int __ieee80211_suspend(struct ieee80211
+diff -urNp linux-3.1.3/net/mac80211/pm.c linux-3.1.3/net/mac80211/pm.c
+--- linux-3.1.3/net/mac80211/pm.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/mac80211/pm.c      2011-11-16 18:39:08.000000000 -0500
+@@ -34,7 +34,7 @@ int __ieee80211_suspend(struct ieee80211
+       struct ieee80211_sub_if_data *sdata;
+       struct sta_info *sta;
+-      if (!local->open_count)
++      if (!local_read(&local->open_count))
+               goto suspend;
+       ieee80211_scan_cancel(local);
+@@ -72,7 +72,7 @@ int __ieee80211_suspend(struct ieee80211
        cancel_work_sync(&local->dynamic_ps_enable_work);
        del_timer_sync(&local->dynamic_ps_timer);
  
@@ -70108,8 +73734,8 @@ diff -urNp linux-3.0.4/net/mac80211/pm.c linux-3.0.4/net/mac80211/pm.c
 +      local->wowlan = wowlan && local_read(&local->open_count);
        if (local->wowlan) {
                int err = drv_suspend(local, wowlan);
-               if (err) {
-@@ -111,7 +111,7 @@ int __ieee80211_suspend(struct ieee80211
+               if (err < 0) {
+@@ -129,7 +129,7 @@ int __ieee80211_suspend(struct ieee80211
        }
  
        /* stop hardware - this must stop RX */
@@ -70118,9 +73744,9 @@ diff -urNp linux-3.0.4/net/mac80211/pm.c linux-3.0.4/net/mac80211/pm.c
                ieee80211_stop_device(local);
  
   suspend:
-diff -urNp linux-3.0.4/net/mac80211/rate.c linux-3.0.4/net/mac80211/rate.c
---- linux-3.0.4/net/mac80211/rate.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/mac80211/rate.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/mac80211/rate.c linux-3.1.3/net/mac80211/rate.c
+--- linux-3.1.3/net/mac80211/rate.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/mac80211/rate.c    2011-11-16 18:39:08.000000000 -0500
 @@ -371,7 +371,7 @@ int ieee80211_init_rate_ctrl_alg(struct 
  
        ASSERT_RTNL();
@@ -70130,9 +73756,9 @@ diff -urNp linux-3.0.4/net/mac80211/rate.c linux-3.0.4/net/mac80211/rate.c
                return -EBUSY;
  
        if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) {
-diff -urNp linux-3.0.4/net/mac80211/rc80211_pid_debugfs.c linux-3.0.4/net/mac80211/rc80211_pid_debugfs.c
---- linux-3.0.4/net/mac80211/rc80211_pid_debugfs.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/mac80211/rc80211_pid_debugfs.c     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/mac80211/rc80211_pid_debugfs.c linux-3.1.3/net/mac80211/rc80211_pid_debugfs.c
+--- linux-3.1.3/net/mac80211/rc80211_pid_debugfs.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/mac80211/rc80211_pid_debugfs.c     2011-11-16 18:39:08.000000000 -0500
 @@ -192,7 +192,7 @@ static ssize_t rate_control_pid_events_r
  
        spin_unlock_irqrestore(&events->lock, status);
@@ -70142,21 +73768,21 @@ diff -urNp linux-3.0.4/net/mac80211/rc80211_pid_debugfs.c linux-3.0.4/net/mac802
                return -EFAULT;
  
        return p;
-diff -urNp linux-3.0.4/net/mac80211/util.c linux-3.0.4/net/mac80211/util.c
---- linux-3.0.4/net/mac80211/util.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/mac80211/util.c    2011-08-23 21:47:56.000000000 -0400
-@@ -1147,7 +1147,7 @@ int ieee80211_reconfig(struct ieee80211_
- #endif
+diff -urNp linux-3.1.3/net/mac80211/util.c linux-3.1.3/net/mac80211/util.c
+--- linux-3.1.3/net/mac80211/util.c    2011-11-26 19:57:29.000000000 -0500
++++ linux-3.1.3/net/mac80211/util.c    2011-11-26 20:00:43.000000000 -0500
+@@ -1170,7 +1170,7 @@ int ieee80211_reconfig(struct ieee80211_
+       drv_set_coverage_class(local, hw->wiphy->coverage_class);
  
-       /* restart hardware */
--      if (local->open_count) {
-+      if (local_read(&local->open_count)) {
-               /*
-                * Upon resume hardware can sometimes be goofy due to
-                * various platform / driver / bus issues, so restarting
-diff -urNp linux-3.0.4/net/netfilter/ipvs/ip_vs_conn.c linux-3.0.4/net/netfilter/ipvs/ip_vs_conn.c
---- linux-3.0.4/net/netfilter/ipvs/ip_vs_conn.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/netfilter/ipvs/ip_vs_conn.c        2011-08-23 21:47:56.000000000 -0400
+       /* everything else happens only if HW was up & running */
+-      if (!local->open_count)
++      if (!local_read(&local->open_count))
+               goto wake_up;
+       /*
+diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_conn.c linux-3.1.3/net/netfilter/ipvs/ip_vs_conn.c
+--- linux-3.1.3/net/netfilter/ipvs/ip_vs_conn.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/netfilter/ipvs/ip_vs_conn.c        2011-11-16 18:39:08.000000000 -0500
 @@ -556,7 +556,7 @@ ip_vs_bind_dest(struct ip_vs_conn *cp, s
        /* Increase the refcnt counter of the dest */
        atomic_inc(&dest->refcnt);
@@ -70184,9 +73810,9 @@ diff -urNp linux-3.0.4/net/netfilter/ipvs/ip_vs_conn.c linux-3.0.4/net/netfilter
        if (i > 8 || i < 0) return 0;
  
        if (!todrop_rate[i]) return 0;
-diff -urNp linux-3.0.4/net/netfilter/ipvs/ip_vs_core.c linux-3.0.4/net/netfilter/ipvs/ip_vs_core.c
---- linux-3.0.4/net/netfilter/ipvs/ip_vs_core.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/netfilter/ipvs/ip_vs_core.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_core.c linux-3.1.3/net/netfilter/ipvs/ip_vs_core.c
+--- linux-3.1.3/net/netfilter/ipvs/ip_vs_core.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/netfilter/ipvs/ip_vs_core.c        2011-11-16 18:39:08.000000000 -0500
 @@ -563,7 +563,7 @@ int ip_vs_leave(struct ip_vs_service *sv
                ret = cp->packet_xmit(skb, cp, pd->pp);
                /* do not touch skb anymore */
@@ -70196,7 +73822,7 @@ diff -urNp linux-3.0.4/net/netfilter/ipvs/ip_vs_core.c linux-3.0.4/net/netfilter
                ip_vs_conn_put(cp);
                return ret;
        }
-@@ -1613,7 +1613,7 @@ ip_vs_in(unsigned int hooknum, struct sk
+@@ -1612,7 +1612,7 @@ ip_vs_in(unsigned int hooknum, struct sk
        if (cp->flags & IP_VS_CONN_F_ONE_PACKET)
                pkts = sysctl_sync_threshold(ipvs);
        else
@@ -70205,9 +73831,9 @@ diff -urNp linux-3.0.4/net/netfilter/ipvs/ip_vs_core.c linux-3.0.4/net/netfilter
  
        if ((ipvs->sync_state & IP_VS_STATE_MASTER) &&
            cp->protocol == IPPROTO_SCTP) {
-diff -urNp linux-3.0.4/net/netfilter/ipvs/ip_vs_ctl.c linux-3.0.4/net/netfilter/ipvs/ip_vs_ctl.c
---- linux-3.0.4/net/netfilter/ipvs/ip_vs_ctl.c 2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/net/netfilter/ipvs/ip_vs_ctl.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_ctl.c linux-3.1.3/net/netfilter/ipvs/ip_vs_ctl.c
+--- linux-3.1.3/net/netfilter/ipvs/ip_vs_ctl.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/netfilter/ipvs/ip_vs_ctl.c 2011-11-16 19:13:12.000000000 -0500
 @@ -782,7 +782,7 @@ __ip_vs_update_dest(struct ip_vs_service
                ip_vs_rs_hash(ipvs, dest);
                write_unlock_bh(&ipvs->rs_lock);
@@ -70235,16 +73861,16 @@ diff -urNp linux-3.0.4/net/netfilter/ipvs/ip_vs_ctl.c linux-3.0.4/net/netfilter/
                                           atomic_read(&dest->weight),
                                           atomic_read(&dest->activeconns),
                                           atomic_read(&dest->inactconns));
-@@ -2284,6 +2284,8 @@ do_ip_vs_set_ctl(struct sock *sk, int cm
-       struct ip_vs_dest_user *udest_compat;
+@@ -2285,6 +2285,8 @@ do_ip_vs_set_ctl(struct sock *sk, int cm
        struct ip_vs_dest_user_kern udest;
+       struct netns_ipvs *ipvs = net_ipvs(net);
  
 +      pax_track_stack();
 +
        if (!capable(CAP_NET_ADMIN))
                return -EPERM;
  
-@@ -2498,7 +2500,7 @@ __ip_vs_get_dest_entries(struct net *net
+@@ -2508,7 +2510,7 @@ __ip_vs_get_dest_entries(struct net *net
  
                        entry.addr = dest->addr.ip;
                        entry.port = dest->port;
@@ -70253,7 +73879,7 @@ diff -urNp linux-3.0.4/net/netfilter/ipvs/ip_vs_ctl.c linux-3.0.4/net/netfilter/
                        entry.weight = atomic_read(&dest->weight);
                        entry.u_threshold = dest->u_threshold;
                        entry.l_threshold = dest->l_threshold;
-@@ -3026,7 +3028,7 @@ static int ip_vs_genl_fill_dest(struct s
+@@ -3041,7 +3043,7 @@ static int ip_vs_genl_fill_dest(struct s
        NLA_PUT_U16(skb, IPVS_DEST_ATTR_PORT, dest->port);
  
        NLA_PUT_U32(skb, IPVS_DEST_ATTR_FWD_METHOD,
@@ -70262,10 +73888,10 @@ diff -urNp linux-3.0.4/net/netfilter/ipvs/ip_vs_ctl.c linux-3.0.4/net/netfilter/
        NLA_PUT_U32(skb, IPVS_DEST_ATTR_WEIGHT, atomic_read(&dest->weight));
        NLA_PUT_U32(skb, IPVS_DEST_ATTR_U_THRESH, dest->u_threshold);
        NLA_PUT_U32(skb, IPVS_DEST_ATTR_L_THRESH, dest->l_threshold);
-diff -urNp linux-3.0.4/net/netfilter/ipvs/ip_vs_sync.c linux-3.0.4/net/netfilter/ipvs/ip_vs_sync.c
---- linux-3.0.4/net/netfilter/ipvs/ip_vs_sync.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/netfilter/ipvs/ip_vs_sync.c        2011-08-23 21:47:56.000000000 -0400
-@@ -648,7 +648,7 @@ control:
+diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_sync.c linux-3.1.3/net/netfilter/ipvs/ip_vs_sync.c
+--- linux-3.1.3/net/netfilter/ipvs/ip_vs_sync.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/netfilter/ipvs/ip_vs_sync.c        2011-11-16 18:39:08.000000000 -0500
+@@ -649,7 +649,7 @@ control:
         * i.e only increment in_pkts for Templates.
         */
        if (cp->flags & IP_VS_CONN_F_TEMPLATE) {
@@ -70274,7 +73900,7 @@ diff -urNp linux-3.0.4/net/netfilter/ipvs/ip_vs_sync.c linux-3.0.4/net/netfilter
  
                if (pkts % sysctl_sync_period(ipvs) != 1)
                        return;
-@@ -794,7 +794,7 @@ static void ip_vs_proc_conn(struct net *
+@@ -795,7 +795,7 @@ static void ip_vs_proc_conn(struct net *
  
        if (opt)
                memcpy(&cp->in_seq, opt, sizeof(*opt));
@@ -70283,9 +73909,9 @@ diff -urNp linux-3.0.4/net/netfilter/ipvs/ip_vs_sync.c linux-3.0.4/net/netfilter
        cp->state = state;
        cp->old_state = cp->state;
        /*
-diff -urNp linux-3.0.4/net/netfilter/ipvs/ip_vs_xmit.c linux-3.0.4/net/netfilter/ipvs/ip_vs_xmit.c
---- linux-3.0.4/net/netfilter/ipvs/ip_vs_xmit.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/netfilter/ipvs/ip_vs_xmit.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/netfilter/ipvs/ip_vs_xmit.c linux-3.1.3/net/netfilter/ipvs/ip_vs_xmit.c
+--- linux-3.1.3/net/netfilter/ipvs/ip_vs_xmit.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/netfilter/ipvs/ip_vs_xmit.c        2011-11-16 18:39:08.000000000 -0500
 @@ -1151,7 +1151,7 @@ ip_vs_icmp_xmit(struct sk_buff *skb, str
                else
                        rc = NF_ACCEPT;
@@ -70304,9 +73930,9 @@ diff -urNp linux-3.0.4/net/netfilter/ipvs/ip_vs_xmit.c linux-3.0.4/net/netfilter
                goto out;
        }
  
-diff -urNp linux-3.0.4/net/netfilter/Kconfig linux-3.0.4/net/netfilter/Kconfig
---- linux-3.0.4/net/netfilter/Kconfig  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/netfilter/Kconfig  2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/netfilter/Kconfig linux-3.1.3/net/netfilter/Kconfig
+--- linux-3.1.3/net/netfilter/Kconfig  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/netfilter/Kconfig  2011-11-16 18:40:44.000000000 -0500
 @@ -781,6 +781,16 @@ config NETFILTER_XT_MATCH_ESP
  
          To compile it as a module, choose M here.  If unsure, say N.
@@ -70324,9 +73950,9 @@ diff -urNp linux-3.0.4/net/netfilter/Kconfig linux-3.0.4/net/netfilter/Kconfig
  config NETFILTER_XT_MATCH_HASHLIMIT
        tristate '"hashlimit" match support'
        depends on (IP6_NF_IPTABLES || IP6_NF_IPTABLES=n)
-diff -urNp linux-3.0.4/net/netfilter/Makefile linux-3.0.4/net/netfilter/Makefile
---- linux-3.0.4/net/netfilter/Makefile 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/netfilter/Makefile 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/netfilter/Makefile linux-3.1.3/net/netfilter/Makefile
+--- linux-3.1.3/net/netfilter/Makefile 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/netfilter/Makefile 2011-11-16 18:40:44.000000000 -0500
 @@ -81,6 +81,7 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_DCCP) +=
  obj-$(CONFIG_NETFILTER_XT_MATCH_DEVGROUP) += xt_devgroup.o
  obj-$(CONFIG_NETFILTER_XT_MATCH_DSCP) += xt_dscp.o
@@ -70335,9 +73961,9 @@ diff -urNp linux-3.0.4/net/netfilter/Makefile linux-3.0.4/net/netfilter/Makefile
  obj-$(CONFIG_NETFILTER_XT_MATCH_HASHLIMIT) += xt_hashlimit.o
  obj-$(CONFIG_NETFILTER_XT_MATCH_HELPER) += xt_helper.o
  obj-$(CONFIG_NETFILTER_XT_MATCH_HL) += xt_hl.o
-diff -urNp linux-3.0.4/net/netfilter/nfnetlink_log.c linux-3.0.4/net/netfilter/nfnetlink_log.c
---- linux-3.0.4/net/netfilter/nfnetlink_log.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/netfilter/nfnetlink_log.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/netfilter/nfnetlink_log.c linux-3.1.3/net/netfilter/nfnetlink_log.c
+--- linux-3.1.3/net/netfilter/nfnetlink_log.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/netfilter/nfnetlink_log.c  2011-11-16 18:39:08.000000000 -0500
 @@ -70,7 +70,7 @@ struct nfulnl_instance {
  };
  
@@ -70356,39 +73982,9 @@ diff -urNp linux-3.0.4/net/netfilter/nfnetlink_log.c linux-3.0.4/net/netfilter/n
  
        if (data_len) {
                struct nlattr *nla;
-diff -urNp linux-3.0.4/net/netfilter/nfnetlink_queue.c linux-3.0.4/net/netfilter/nfnetlink_queue.c
---- linux-3.0.4/net/netfilter/nfnetlink_queue.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/netfilter/nfnetlink_queue.c        2011-08-23 21:47:56.000000000 -0400
-@@ -58,7 +58,7 @@ struct nfqnl_instance {
-  */
-       spinlock_t      lock;
-       unsigned int    queue_total;
--      atomic_t        id_sequence;            /* 'sequence' of pkt ids */
-+      atomic_unchecked_t      id_sequence;    /* 'sequence' of pkt ids */
-       struct list_head queue_list;            /* packets in queue */
- };
-@@ -272,7 +272,7 @@ nfqnl_build_packet_message(struct nfqnl_
-       nfmsg->version = NFNETLINK_V0;
-       nfmsg->res_id = htons(queue->queue_num);
--      entry->id = atomic_inc_return(&queue->id_sequence);
-+      entry->id = atomic_inc_return_unchecked(&queue->id_sequence);
-       pmsg.packet_id          = htonl(entry->id);
-       pmsg.hw_protocol        = entskb->protocol;
-       pmsg.hook               = entry->hook;
-@@ -870,7 +870,7 @@ static int seq_show(struct seq_file *s, 
-                         inst->peer_pid, inst->queue_total,
-                         inst->copy_mode, inst->copy_range,
-                         inst->queue_dropped, inst->queue_user_dropped,
--                        atomic_read(&inst->id_sequence), 1);
-+                        atomic_read_unchecked(&inst->id_sequence), 1);
- }
- static const struct seq_operations nfqnl_seq_ops = {
-diff -urNp linux-3.0.4/net/netfilter/xt_gradm.c linux-3.0.4/net/netfilter/xt_gradm.c
---- linux-3.0.4/net/netfilter/xt_gradm.c       1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/net/netfilter/xt_gradm.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/netfilter/xt_gradm.c linux-3.1.3/net/netfilter/xt_gradm.c
+--- linux-3.1.3/net/netfilter/xt_gradm.c       1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/net/netfilter/xt_gradm.c       2011-11-16 18:40:44.000000000 -0500
 @@ -0,0 +1,51 @@
 +/*
 + *    gradm match for netfilter
@@ -70441,9 +74037,9 @@ diff -urNp linux-3.0.4/net/netfilter/xt_gradm.c linux-3.0.4/net/netfilter/xt_gra
 +MODULE_LICENSE("GPL");
 +MODULE_ALIAS("ipt_gradm");
 +MODULE_ALIAS("ip6t_gradm");
-diff -urNp linux-3.0.4/net/netfilter/xt_statistic.c linux-3.0.4/net/netfilter/xt_statistic.c
---- linux-3.0.4/net/netfilter/xt_statistic.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/netfilter/xt_statistic.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/netfilter/xt_statistic.c linux-3.1.3/net/netfilter/xt_statistic.c
+--- linux-3.1.3/net/netfilter/xt_statistic.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/netfilter/xt_statistic.c   2011-11-16 18:39:08.000000000 -0500
 @@ -18,7 +18,7 @@
  #include <linux/netfilter/x_tables.h>
  
@@ -70474,9 +74070,9 @@ diff -urNp linux-3.0.4/net/netfilter/xt_statistic.c linux-3.0.4/net/netfilter/xt
  
        return 0;
  }
-diff -urNp linux-3.0.4/net/netlink/af_netlink.c linux-3.0.4/net/netlink/af_netlink.c
---- linux-3.0.4/net/netlink/af_netlink.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/netlink/af_netlink.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/netlink/af_netlink.c linux-3.1.3/net/netlink/af_netlink.c
+--- linux-3.1.3/net/netlink/af_netlink.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/netlink/af_netlink.c       2011-11-16 18:39:08.000000000 -0500
 @@ -742,7 +742,7 @@ static void netlink_overrun(struct sock 
                        sk->sk_error_report(sk);
                }
@@ -70486,7 +74082,7 @@ diff -urNp linux-3.0.4/net/netlink/af_netlink.c linux-3.0.4/net/netlink/af_netli
  }
  
  static struct sock *netlink_getsockbypid(struct sock *ssk, u32 pid)
-@@ -1994,7 +1994,7 @@ static int netlink_seq_show(struct seq_f
+@@ -2000,7 +2000,7 @@ static int netlink_seq_show(struct seq_f
                           sk_wmem_alloc_get(s),
                           nlk->cb,
                           atomic_read(&s->sk_refcnt),
@@ -70495,9 +74091,9 @@ diff -urNp linux-3.0.4/net/netlink/af_netlink.c linux-3.0.4/net/netlink/af_netli
                           sock_i_ino(s)
                        );
  
-diff -urNp linux-3.0.4/net/netrom/af_netrom.c linux-3.0.4/net/netrom/af_netrom.c
---- linux-3.0.4/net/netrom/af_netrom.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/netrom/af_netrom.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/netrom/af_netrom.c linux-3.1.3/net/netrom/af_netrom.c
+--- linux-3.1.3/net/netrom/af_netrom.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/netrom/af_netrom.c 2011-11-16 18:40:44.000000000 -0500
 @@ -839,6 +839,7 @@ static int nr_getname(struct socket *soc
        struct sock *sk = sock->sk;
        struct nr_sock *nr = nr_sk(sk);
@@ -70514,10 +74110,10 @@ diff -urNp linux-3.0.4/net/netrom/af_netrom.c linux-3.0.4/net/netrom/af_netrom.c
                sax->fsa_ax25.sax25_call   = nr->source_addr;
                *uaddr_len = sizeof(struct sockaddr_ax25);
        }
-diff -urNp linux-3.0.4/net/packet/af_packet.c linux-3.0.4/net/packet/af_packet.c
---- linux-3.0.4/net/packet/af_packet.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/packet/af_packet.c 2011-08-23 21:47:56.000000000 -0400
-@@ -647,14 +647,14 @@ static int packet_rcv(struct sk_buff *sk
+diff -urNp linux-3.1.3/net/packet/af_packet.c linux-3.1.3/net/packet/af_packet.c
+--- linux-3.1.3/net/packet/af_packet.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/packet/af_packet.c 2011-11-16 18:39:08.000000000 -0500
+@@ -954,7 +954,7 @@ static int packet_rcv(struct sk_buff *sk
  
        spin_lock(&sk->sk_receive_queue.lock);
        po->stats.tp_packets++;
@@ -70526,15 +74122,16 @@ diff -urNp linux-3.0.4/net/packet/af_packet.c linux-3.0.4/net/packet/af_packet.c
        __skb_queue_tail(&sk->sk_receive_queue, skb);
        spin_unlock(&sk->sk_receive_queue.lock);
        sk->sk_data_ready(sk, skb->len);
-       return 0;
+@@ -963,7 +963,7 @@ static int packet_rcv(struct sk_buff *sk
  drop_n_acct:
--      po->stats.tp_drops = atomic_inc_return(&sk->sk_drops);
-+      po->stats.tp_drops = atomic_inc_return_unchecked(&sk->sk_drops);
+       spin_lock(&sk->sk_receive_queue.lock);
+       po->stats.tp_drops++;
+-      atomic_inc(&sk->sk_drops);
++      atomic_inc_unchecked(&sk->sk_drops);
+       spin_unlock(&sk->sk_receive_queue.lock);
  
  drop_n_restore:
-       if (skb_head != skb->data && skb_shared(skb)) {
-@@ -2168,7 +2168,7 @@ static int packet_getsockopt(struct sock
+@@ -2479,7 +2479,7 @@ static int packet_getsockopt(struct sock
        case PACKET_HDRLEN:
                if (len > sizeof(int))
                        len = sizeof(int);
@@ -70543,7 +74140,7 @@ diff -urNp linux-3.0.4/net/packet/af_packet.c linux-3.0.4/net/packet/af_packet.c
                        return -EFAULT;
                switch (val) {
                case TPACKET_V1:
-@@ -2206,7 +2206,7 @@ static int packet_getsockopt(struct sock
+@@ -2526,7 +2526,7 @@ static int packet_getsockopt(struct sock
  
        if (put_user(len, optlen))
                return -EFAULT;
@@ -70552,9 +74149,9 @@ diff -urNp linux-3.0.4/net/packet/af_packet.c linux-3.0.4/net/packet/af_packet.c
                return -EFAULT;
        return 0;
  }
-diff -urNp linux-3.0.4/net/phonet/af_phonet.c linux-3.0.4/net/phonet/af_phonet.c
---- linux-3.0.4/net/phonet/af_phonet.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/phonet/af_phonet.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/phonet/af_phonet.c linux-3.1.3/net/phonet/af_phonet.c
+--- linux-3.1.3/net/phonet/af_phonet.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/phonet/af_phonet.c 2011-11-16 18:40:44.000000000 -0500
 @@ -41,7 +41,7 @@ static struct phonet_protocol *phonet_pr
  {
        struct phonet_protocol *pp;
@@ -70573,9 +74170,9 @@ diff -urNp linux-3.0.4/net/phonet/af_phonet.c linux-3.0.4/net/phonet/af_phonet.c
                return -EINVAL;
  
        err = proto_register(pp->prot, 1);
-diff -urNp linux-3.0.4/net/phonet/pep.c linux-3.0.4/net/phonet/pep.c
---- linux-3.0.4/net/phonet/pep.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/phonet/pep.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/phonet/pep.c linux-3.1.3/net/phonet/pep.c
+--- linux-3.1.3/net/phonet/pep.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/phonet/pep.c       2011-11-16 18:39:08.000000000 -0500
 @@ -387,7 +387,7 @@ static int pipe_do_rcv(struct sock *sk, 
  
        case PNS_PEP_CTRL_REQ:
@@ -70603,9 +74200,9 @@ diff -urNp linux-3.0.4/net/phonet/pep.c linux-3.0.4/net/phonet/pep.c
                        err = NET_RX_DROP;
                        break;
                }
-diff -urNp linux-3.0.4/net/phonet/socket.c linux-3.0.4/net/phonet/socket.c
---- linux-3.0.4/net/phonet/socket.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/phonet/socket.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/phonet/socket.c linux-3.1.3/net/phonet/socket.c
+--- linux-3.1.3/net/phonet/socket.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/phonet/socket.c    2011-11-16 18:40:44.000000000 -0500
 @@ -612,8 +612,13 @@ static int pn_sock_seq_show(struct seq_f
                        pn->resource, sk->sk_state,
                        sk_wmem_alloc_get(sk), sk_rmem_alloc_get(sk),
@@ -70622,9 +74219,9 @@ diff -urNp linux-3.0.4/net/phonet/socket.c linux-3.0.4/net/phonet/socket.c
        }
        seq_printf(seq, "%*s\n", 127 - len, "");
        return 0;
-diff -urNp linux-3.0.4/net/rds/cong.c linux-3.0.4/net/rds/cong.c
---- linux-3.0.4/net/rds/cong.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rds/cong.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/rds/cong.c linux-3.1.3/net/rds/cong.c
+--- linux-3.1.3/net/rds/cong.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rds/cong.c 2011-11-16 18:39:08.000000000 -0500
 @@ -77,7 +77,7 @@
   * finds that the saved generation number is smaller than the global generation
   * number, it wakes up the process.
@@ -70652,9 +74249,9 @@ diff -urNp linux-3.0.4/net/rds/cong.c linux-3.0.4/net/rds/cong.c
  
        if (likely(*recent == gen))
                return 0;
-diff -urNp linux-3.0.4/net/rds/ib_cm.c linux-3.0.4/net/rds/ib_cm.c
---- linux-3.0.4/net/rds/ib_cm.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rds/ib_cm.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/rds/ib_cm.c linux-3.1.3/net/rds/ib_cm.c
+--- linux-3.1.3/net/rds/ib_cm.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rds/ib_cm.c        2011-11-16 18:39:08.000000000 -0500
 @@ -720,7 +720,7 @@ void rds_ib_conn_shutdown(struct rds_con
        /* Clear the ACK state */
        clear_bit(IB_ACK_IN_FLIGHT, &ic->i_ack_flags);
@@ -70664,10 +74261,10 @@ diff -urNp linux-3.0.4/net/rds/ib_cm.c linux-3.0.4/net/rds/ib_cm.c
  #else
        ic->i_ack_next = 0;
  #endif
-diff -urNp linux-3.0.4/net/rds/ib.h linux-3.0.4/net/rds/ib.h
---- linux-3.0.4/net/rds/ib.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rds/ib.h   2011-08-23 21:47:56.000000000 -0400
-@@ -127,7 +127,7 @@ struct rds_ib_connection {
+diff -urNp linux-3.1.3/net/rds/ib.h linux-3.1.3/net/rds/ib.h
+--- linux-3.1.3/net/rds/ib.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rds/ib.h   2011-11-16 18:39:08.000000000 -0500
+@@ -128,7 +128,7 @@ struct rds_ib_connection {
        /* sending acks */
        unsigned long           i_ack_flags;
  #ifdef KERNEL_HAS_ATOMIC64
@@ -70676,9 +74273,9 @@ diff -urNp linux-3.0.4/net/rds/ib.h linux-3.0.4/net/rds/ib.h
  #else
        spinlock_t              i_ack_lock;     /* protect i_ack_next */
        u64                     i_ack_next;     /* next ACK to send */
-diff -urNp linux-3.0.4/net/rds/ib_recv.c linux-3.0.4/net/rds/ib_recv.c
---- linux-3.0.4/net/rds/ib_recv.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rds/ib_recv.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/rds/ib_recv.c linux-3.1.3/net/rds/ib_recv.c
+--- linux-3.1.3/net/rds/ib_recv.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rds/ib_recv.c      2011-11-16 18:39:08.000000000 -0500
 @@ -592,7 +592,7 @@ static u64 rds_ib_get_ack(struct rds_ib_
  static void rds_ib_set_ack(struct rds_ib_connection *ic, u64 seq,
                                int ack_required)
@@ -70697,10 +74294,10 @@ diff -urNp linux-3.0.4/net/rds/ib_recv.c linux-3.0.4/net/rds/ib_recv.c
  }
  #endif
  
-diff -urNp linux-3.0.4/net/rds/iw_cm.c linux-3.0.4/net/rds/iw_cm.c
---- linux-3.0.4/net/rds/iw_cm.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rds/iw_cm.c        2011-08-23 21:47:56.000000000 -0400
-@@ -664,7 +664,7 @@ void rds_iw_conn_shutdown(struct rds_con
+diff -urNp linux-3.1.3/net/rds/iw_cm.c linux-3.1.3/net/rds/iw_cm.c
+--- linux-3.1.3/net/rds/iw_cm.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rds/iw_cm.c        2011-11-16 18:39:08.000000000 -0500
+@@ -663,7 +663,7 @@ void rds_iw_conn_shutdown(struct rds_con
        /* Clear the ACK state */
        clear_bit(IB_ACK_IN_FLIGHT, &ic->i_ack_flags);
  #ifdef KERNEL_HAS_ATOMIC64
@@ -70709,10 +74306,10 @@ diff -urNp linux-3.0.4/net/rds/iw_cm.c linux-3.0.4/net/rds/iw_cm.c
  #else
        ic->i_ack_next = 0;
  #endif
-diff -urNp linux-3.0.4/net/rds/iw.h linux-3.0.4/net/rds/iw.h
---- linux-3.0.4/net/rds/iw.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rds/iw.h   2011-08-23 21:47:56.000000000 -0400
-@@ -133,7 +133,7 @@ struct rds_iw_connection {
+diff -urNp linux-3.1.3/net/rds/iw.h linux-3.1.3/net/rds/iw.h
+--- linux-3.1.3/net/rds/iw.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rds/iw.h   2011-11-16 18:39:08.000000000 -0500
+@@ -134,7 +134,7 @@ struct rds_iw_connection {
        /* sending acks */
        unsigned long           i_ack_flags;
  #ifdef KERNEL_HAS_ATOMIC64
@@ -70721,10 +74318,10 @@ diff -urNp linux-3.0.4/net/rds/iw.h linux-3.0.4/net/rds/iw.h
  #else
        spinlock_t              i_ack_lock;     /* protect i_ack_next */
        u64                     i_ack_next;     /* next ACK to send */
-diff -urNp linux-3.0.4/net/rds/iw_rdma.c linux-3.0.4/net/rds/iw_rdma.c
---- linux-3.0.4/net/rds/iw_rdma.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rds/iw_rdma.c      2011-08-23 21:48:14.000000000 -0400
-@@ -182,6 +182,8 @@ int rds_iw_update_cm_id(struct rds_iw_de
+diff -urNp linux-3.1.3/net/rds/iw_rdma.c linux-3.1.3/net/rds/iw_rdma.c
+--- linux-3.1.3/net/rds/iw_rdma.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rds/iw_rdma.c      2011-11-16 18:40:44.000000000 -0500
+@@ -184,6 +184,8 @@ int rds_iw_update_cm_id(struct rds_iw_de
        struct rdma_cm_id *pcm_id;
        int rc;
  
@@ -70733,9 +74330,9 @@ diff -urNp linux-3.0.4/net/rds/iw_rdma.c linux-3.0.4/net/rds/iw_rdma.c
        src_addr = (struct sockaddr_in *)&cm_id->route.addr.src_addr;
        dst_addr = (struct sockaddr_in *)&cm_id->route.addr.dst_addr;
  
-diff -urNp linux-3.0.4/net/rds/iw_recv.c linux-3.0.4/net/rds/iw_recv.c
---- linux-3.0.4/net/rds/iw_recv.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rds/iw_recv.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/rds/iw_recv.c linux-3.1.3/net/rds/iw_recv.c
+--- linux-3.1.3/net/rds/iw_recv.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rds/iw_recv.c      2011-11-16 18:39:08.000000000 -0500
 @@ -427,7 +427,7 @@ static u64 rds_iw_get_ack(struct rds_iw_
  static void rds_iw_set_ack(struct rds_iw_connection *ic, u64 seq,
                                int ack_required)
@@ -70754,9 +74351,33 @@ diff -urNp linux-3.0.4/net/rds/iw_recv.c linux-3.0.4/net/rds/iw_recv.c
  }
  #endif
  
-diff -urNp linux-3.0.4/net/rxrpc/af_rxrpc.c linux-3.0.4/net/rxrpc/af_rxrpc.c
---- linux-3.0.4/net/rxrpc/af_rxrpc.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rxrpc/af_rxrpc.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/rds/tcp.c linux-3.1.3/net/rds/tcp.c
+--- linux-3.1.3/net/rds/tcp.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rds/tcp.c  2011-11-16 18:39:08.000000000 -0500
+@@ -58,7 +58,7 @@ void rds_tcp_nonagle(struct socket *sock
+       int val = 1;
+       set_fs(KERNEL_DS);
+-      sock->ops->setsockopt(sock, SOL_TCP, TCP_NODELAY, (char __user *)&val,
++      sock->ops->setsockopt(sock, SOL_TCP, TCP_NODELAY, (char __force_user *)&val,
+                             sizeof(val));
+       set_fs(oldfs);
+ }
+diff -urNp linux-3.1.3/net/rds/tcp_send.c linux-3.1.3/net/rds/tcp_send.c
+--- linux-3.1.3/net/rds/tcp_send.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rds/tcp_send.c     2011-11-16 18:39:08.000000000 -0500
+@@ -43,7 +43,7 @@ static void rds_tcp_cork(struct socket *
+       oldfs = get_fs();
+       set_fs(KERNEL_DS);
+-      sock->ops->setsockopt(sock, SOL_TCP, TCP_CORK, (char __user *)&val,
++      sock->ops->setsockopt(sock, SOL_TCP, TCP_CORK, (char __force_user *)&val,
+                             sizeof(val));
+       set_fs(oldfs);
+ }
+diff -urNp linux-3.1.3/net/rxrpc/af_rxrpc.c linux-3.1.3/net/rxrpc/af_rxrpc.c
+--- linux-3.1.3/net/rxrpc/af_rxrpc.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rxrpc/af_rxrpc.c   2011-11-16 18:39:08.000000000 -0500
 @@ -39,7 +39,7 @@ static const struct proto_ops rxrpc_rpc_
  __be32 rxrpc_epoch;
  
@@ -70766,9 +74387,9 @@ diff -urNp linux-3.0.4/net/rxrpc/af_rxrpc.c linux-3.0.4/net/rxrpc/af_rxrpc.c
  
  /* count of skbs currently in use */
  atomic_t rxrpc_n_skbs;
-diff -urNp linux-3.0.4/net/rxrpc/ar-ack.c linux-3.0.4/net/rxrpc/ar-ack.c
---- linux-3.0.4/net/rxrpc/ar-ack.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rxrpc/ar-ack.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/rxrpc/ar-ack.c linux-3.1.3/net/rxrpc/ar-ack.c
+--- linux-3.1.3/net/rxrpc/ar-ack.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rxrpc/ar-ack.c     2011-11-16 18:40:44.000000000 -0500
 @@ -175,7 +175,7 @@ static void rxrpc_resend(struct rxrpc_ca
  
        _enter("{%d,%d,%d,%d},",
@@ -70841,9 +74462,9 @@ diff -urNp linux-3.0.4/net/rxrpc/ar-ack.c linux-3.0.4/net/rxrpc/ar-ack.c
        _proto("Tx %s %%%u", rxrpc_pkts[hdr.type], ntohl(hdr.serial));
  send_message_2:
  
-diff -urNp linux-3.0.4/net/rxrpc/ar-call.c linux-3.0.4/net/rxrpc/ar-call.c
---- linux-3.0.4/net/rxrpc/ar-call.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rxrpc/ar-call.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/rxrpc/ar-call.c linux-3.1.3/net/rxrpc/ar-call.c
+--- linux-3.1.3/net/rxrpc/ar-call.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rxrpc/ar-call.c    2011-11-16 18:39:08.000000000 -0500
 @@ -83,7 +83,7 @@ static struct rxrpc_call *rxrpc_alloc_ca
        spin_lock_init(&call->lock);
        rwlock_init(&call->state_lock);
@@ -70853,9 +74474,9 @@ diff -urNp linux-3.0.4/net/rxrpc/ar-call.c linux-3.0.4/net/rxrpc/ar-call.c
        call->state = RXRPC_CALL_CLIENT_SEND_REQUEST;
  
        memset(&call->sock_node, 0xed, sizeof(call->sock_node));
-diff -urNp linux-3.0.4/net/rxrpc/ar-connection.c linux-3.0.4/net/rxrpc/ar-connection.c
---- linux-3.0.4/net/rxrpc/ar-connection.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rxrpc/ar-connection.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/rxrpc/ar-connection.c linux-3.1.3/net/rxrpc/ar-connection.c
+--- linux-3.1.3/net/rxrpc/ar-connection.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rxrpc/ar-connection.c      2011-11-16 18:39:08.000000000 -0500
 @@ -206,7 +206,7 @@ static struct rxrpc_connection *rxrpc_al
                rwlock_init(&conn->lock);
                spin_lock_init(&conn->state_lock);
@@ -70865,9 +74486,9 @@ diff -urNp linux-3.0.4/net/rxrpc/ar-connection.c linux-3.0.4/net/rxrpc/ar-connec
                conn->avail_calls = RXRPC_MAXCALLS;
                conn->size_align = 4;
                conn->header_size = sizeof(struct rxrpc_header);
-diff -urNp linux-3.0.4/net/rxrpc/ar-connevent.c linux-3.0.4/net/rxrpc/ar-connevent.c
---- linux-3.0.4/net/rxrpc/ar-connevent.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rxrpc/ar-connevent.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/rxrpc/ar-connevent.c linux-3.1.3/net/rxrpc/ar-connevent.c
+--- linux-3.1.3/net/rxrpc/ar-connevent.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rxrpc/ar-connevent.c       2011-11-16 18:39:08.000000000 -0500
 @@ -109,7 +109,7 @@ static int rxrpc_abort_connection(struct
  
        len = iov[0].iov_len + iov[1].iov_len;
@@ -70877,9 +74498,9 @@ diff -urNp linux-3.0.4/net/rxrpc/ar-connevent.c linux-3.0.4/net/rxrpc/ar-conneve
        _proto("Tx CONN ABORT %%%u { %d }", ntohl(hdr.serial), abort_code);
  
        ret = kernel_sendmsg(conn->trans->local->socket, &msg, iov, 2, len);
-diff -urNp linux-3.0.4/net/rxrpc/ar-input.c linux-3.0.4/net/rxrpc/ar-input.c
---- linux-3.0.4/net/rxrpc/ar-input.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rxrpc/ar-input.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/rxrpc/ar-input.c linux-3.1.3/net/rxrpc/ar-input.c
+--- linux-3.1.3/net/rxrpc/ar-input.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rxrpc/ar-input.c   2011-11-16 18:39:08.000000000 -0500
 @@ -340,9 +340,9 @@ void rxrpc_fast_process_packet(struct rx
        /* track the latest serial number on this connection for ACK packet
         * information */
@@ -70892,9 +74513,9 @@ diff -urNp linux-3.0.4/net/rxrpc/ar-input.c linux-3.0.4/net/rxrpc/ar-input.c
                                           serial);
  
        /* request ACK generation for any ACK or DATA packet that requests
-diff -urNp linux-3.0.4/net/rxrpc/ar-internal.h linux-3.0.4/net/rxrpc/ar-internal.h
---- linux-3.0.4/net/rxrpc/ar-internal.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rxrpc/ar-internal.h        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/rxrpc/ar-internal.h linux-3.1.3/net/rxrpc/ar-internal.h
+--- linux-3.1.3/net/rxrpc/ar-internal.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rxrpc/ar-internal.h        2011-11-16 18:39:08.000000000 -0500
 @@ -272,8 +272,8 @@ struct rxrpc_connection {
        int                     error;          /* error code for local abort */
        int                     debug_id;       /* debug ID for printks */
@@ -70924,9 +74545,9 @@ diff -urNp linux-3.0.4/net/rxrpc/ar-internal.h linux-3.0.4/net/rxrpc/ar-internal
  extern struct workqueue_struct *rxrpc_workqueue;
  
  /*
-diff -urNp linux-3.0.4/net/rxrpc/ar-local.c linux-3.0.4/net/rxrpc/ar-local.c
---- linux-3.0.4/net/rxrpc/ar-local.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rxrpc/ar-local.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/rxrpc/ar-local.c linux-3.1.3/net/rxrpc/ar-local.c
+--- linux-3.1.3/net/rxrpc/ar-local.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rxrpc/ar-local.c   2011-11-16 18:39:08.000000000 -0500
 @@ -45,7 +45,7 @@ struct rxrpc_local *rxrpc_alloc_local(st
                spin_lock_init(&local->lock);
                rwlock_init(&local->services_lock);
@@ -70936,9 +74557,9 @@ diff -urNp linux-3.0.4/net/rxrpc/ar-local.c linux-3.0.4/net/rxrpc/ar-local.c
                memcpy(&local->srx, srx, sizeof(*srx));
        }
  
-diff -urNp linux-3.0.4/net/rxrpc/ar-output.c linux-3.0.4/net/rxrpc/ar-output.c
---- linux-3.0.4/net/rxrpc/ar-output.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rxrpc/ar-output.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/rxrpc/ar-output.c linux-3.1.3/net/rxrpc/ar-output.c
+--- linux-3.1.3/net/rxrpc/ar-output.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rxrpc/ar-output.c  2011-11-16 18:39:08.000000000 -0500
 @@ -681,9 +681,9 @@ static int rxrpc_send_data(struct kiocb 
                        sp->hdr.cid = call->cid;
                        sp->hdr.callNumber = call->call_id;
@@ -70951,9 +74572,9 @@ diff -urNp linux-3.0.4/net/rxrpc/ar-output.c linux-3.0.4/net/rxrpc/ar-output.c
                        sp->hdr.type = RXRPC_PACKET_TYPE_DATA;
                        sp->hdr.userStatus = 0;
                        sp->hdr.securityIndex = conn->security_ix;
-diff -urNp linux-3.0.4/net/rxrpc/ar-peer.c linux-3.0.4/net/rxrpc/ar-peer.c
---- linux-3.0.4/net/rxrpc/ar-peer.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rxrpc/ar-peer.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/rxrpc/ar-peer.c linux-3.1.3/net/rxrpc/ar-peer.c
+--- linux-3.1.3/net/rxrpc/ar-peer.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rxrpc/ar-peer.c    2011-11-16 18:39:08.000000000 -0500
 @@ -72,7 +72,7 @@ static struct rxrpc_peer *rxrpc_alloc_pe
                INIT_LIST_HEAD(&peer->error_targets);
                spin_lock_init(&peer->lock);
@@ -70963,9 +74584,9 @@ diff -urNp linux-3.0.4/net/rxrpc/ar-peer.c linux-3.0.4/net/rxrpc/ar-peer.c
                memcpy(&peer->srx, srx, sizeof(*srx));
  
                rxrpc_assess_MTU_size(peer);
-diff -urNp linux-3.0.4/net/rxrpc/ar-proc.c linux-3.0.4/net/rxrpc/ar-proc.c
---- linux-3.0.4/net/rxrpc/ar-proc.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rxrpc/ar-proc.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/rxrpc/ar-proc.c linux-3.1.3/net/rxrpc/ar-proc.c
+--- linux-3.1.3/net/rxrpc/ar-proc.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rxrpc/ar-proc.c    2011-11-16 18:39:08.000000000 -0500
 @@ -164,8 +164,8 @@ static int rxrpc_connection_seq_show(str
                   atomic_read(&conn->usage),
                   rxrpc_conn_states[conn->state],
@@ -70977,9 +74598,9 @@ diff -urNp linux-3.0.4/net/rxrpc/ar-proc.c linux-3.0.4/net/rxrpc/ar-proc.c
  
        return 0;
  }
-diff -urNp linux-3.0.4/net/rxrpc/ar-transport.c linux-3.0.4/net/rxrpc/ar-transport.c
---- linux-3.0.4/net/rxrpc/ar-transport.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rxrpc/ar-transport.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/rxrpc/ar-transport.c linux-3.1.3/net/rxrpc/ar-transport.c
+--- linux-3.1.3/net/rxrpc/ar-transport.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rxrpc/ar-transport.c       2011-11-16 18:39:08.000000000 -0500
 @@ -47,7 +47,7 @@ static struct rxrpc_transport *rxrpc_all
                spin_lock_init(&trans->client_lock);
                rwlock_init(&trans->conn_lock);
@@ -70989,9 +74610,9 @@ diff -urNp linux-3.0.4/net/rxrpc/ar-transport.c linux-3.0.4/net/rxrpc/ar-transpo
  
                if (peer->srx.transport.family == AF_INET) {
                        switch (peer->srx.transport_type) {
-diff -urNp linux-3.0.4/net/rxrpc/rxkad.c linux-3.0.4/net/rxrpc/rxkad.c
---- linux-3.0.4/net/rxrpc/rxkad.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/rxrpc/rxkad.c      2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/rxrpc/rxkad.c linux-3.1.3/net/rxrpc/rxkad.c
+--- linux-3.1.3/net/rxrpc/rxkad.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/rxrpc/rxkad.c      2011-11-16 18:40:44.000000000 -0500
 @@ -211,6 +211,8 @@ static int rxkad_secure_packet_encrypt(c
        u16 check;
        int nsg;
@@ -71028,9 +74649,9 @@ diff -urNp linux-3.0.4/net/rxrpc/rxkad.c linux-3.0.4/net/rxrpc/rxkad.c
        _proto("Tx RESPONSE %%%u", ntohl(hdr->serial));
  
        ret = kernel_sendmsg(conn->trans->local->socket, &msg, iov, 3, len);
-diff -urNp linux-3.0.4/net/sctp/proc.c linux-3.0.4/net/sctp/proc.c
---- linux-3.0.4/net/sctp/proc.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/sctp/proc.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/sctp/proc.c linux-3.1.3/net/sctp/proc.c
+--- linux-3.1.3/net/sctp/proc.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/sctp/proc.c        2011-11-16 18:40:44.000000000 -0500
 @@ -318,7 +318,8 @@ static int sctp_assocs_seq_show(struct s
                seq_printf(seq,
                           "%8pK %8pK %-3d %-3d %-2d %-4d "
@@ -71041,10 +74662,10 @@ diff -urNp linux-3.0.4/net/sctp/proc.c linux-3.0.4/net/sctp/proc.c
                           assoc->state, hash,
                           assoc->assoc_id,
                           assoc->sndbuf_used,
-diff -urNp linux-3.0.4/net/sctp/socket.c linux-3.0.4/net/sctp/socket.c
---- linux-3.0.4/net/sctp/socket.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/sctp/socket.c      2011-08-23 21:47:56.000000000 -0400
-@@ -4452,7 +4452,7 @@ static int sctp_getsockopt_peer_addrs(st
+diff -urNp linux-3.1.3/net/sctp/socket.c linux-3.1.3/net/sctp/socket.c
+--- linux-3.1.3/net/sctp/socket.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/sctp/socket.c      2011-11-16 18:39:08.000000000 -0500
+@@ -4575,7 +4575,7 @@ static int sctp_getsockopt_peer_addrs(st
                addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len;
                if (space_left < addrlen)
                        return -ENOMEM;
@@ -71053,9 +74674,9 @@ diff -urNp linux-3.0.4/net/sctp/socket.c linux-3.0.4/net/sctp/socket.c
                        return -EFAULT;
                to += addrlen;
                cnt++;
-diff -urNp linux-3.0.4/net/socket.c linux-3.0.4/net/socket.c
---- linux-3.0.4/net/socket.c   2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/net/socket.c   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/socket.c linux-3.1.3/net/socket.c
+--- linux-3.1.3/net/socket.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/socket.c   2011-11-16 18:40:44.000000000 -0500
 @@ -88,6 +88,7 @@
  #include <linux/nsproxy.h>
  #include <linux/magic.h>
@@ -71215,10 +74836,118 @@ diff -urNp linux-3.0.4/net/socket.c linux-3.0.4/net/socket.c
        err = -EFAULT;
        if (MSG_CMSG_COMPAT & flags) {
                if (get_compat_msghdr(msg_sys, msg_compat))
-diff -urNp linux-3.0.4/net/sunrpc/sched.c linux-3.0.4/net/sunrpc/sched.c
---- linux-3.0.4/net/sunrpc/sched.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/sunrpc/sched.c     2011-08-23 21:47:56.000000000 -0400
-@@ -234,9 +234,9 @@ static int rpc_wait_bit_killable(void *w
+@@ -1950,7 +2012,7 @@ static int __sys_sendmsg(struct socket *
+                * checking falls down on this.
+                */
+               if (copy_from_user(ctl_buf,
+-                                 (void __user __force *)msg_sys->msg_control,
++                                 (void __force_user *)msg_sys->msg_control,
+                                  ctl_len))
+                       goto out_freectl;
+               msg_sys->msg_control = ctl_buf;
+@@ -2120,7 +2182,7 @@ static int __sys_recvmsg(struct socket *
+        *      kernel msghdr to use the kernel address space)
+        */
+-      uaddr = (__force void __user *)msg_sys->msg_name;
++      uaddr = (void __force_user *)msg_sys->msg_name;
+       uaddr_len = COMPAT_NAMELEN(msg);
+       if (MSG_CMSG_COMPAT & flags) {
+               err = verify_compat_iovec(msg_sys, iov,
+@@ -2748,7 +2810,7 @@ static int ethtool_ioctl(struct net *net
+       }
+       ifr = compat_alloc_user_space(buf_size);
+-      rxnfc = (void *)ifr + ALIGN(sizeof(struct ifreq), 8);
++      rxnfc = (void __user *)ifr + ALIGN(sizeof(struct ifreq), 8);
+       if (copy_in_user(&ifr->ifr_name, &ifr32->ifr_name, IFNAMSIZ))
+               return -EFAULT;
+@@ -2772,12 +2834,12 @@ static int ethtool_ioctl(struct net *net
+                       offsetof(struct ethtool_rxnfc, fs.ring_cookie));
+               if (copy_in_user(rxnfc, compat_rxnfc,
+-                               (void *)(&rxnfc->fs.m_ext + 1) -
+-                               (void *)rxnfc) ||
++                               (void __user *)(&rxnfc->fs.m_ext + 1) -
++                               (void __user *)rxnfc) ||
+                   copy_in_user(&rxnfc->fs.ring_cookie,
+                                &compat_rxnfc->fs.ring_cookie,
+-                               (void *)(&rxnfc->fs.location + 1) -
+-                               (void *)&rxnfc->fs.ring_cookie) ||
++                               (void __user *)(&rxnfc->fs.location + 1) -
++                               (void __user *)&rxnfc->fs.ring_cookie) ||
+                   copy_in_user(&rxnfc->rule_cnt, &compat_rxnfc->rule_cnt,
+                                sizeof(rxnfc->rule_cnt)))
+                       return -EFAULT;
+@@ -2789,12 +2851,12 @@ static int ethtool_ioctl(struct net *net
+       if (convert_out) {
+               if (copy_in_user(compat_rxnfc, rxnfc,
+-                               (const void *)(&rxnfc->fs.m_ext + 1) -
+-                               (const void *)rxnfc) ||
++                               (const void __user *)(&rxnfc->fs.m_ext + 1) -
++                               (const void __user *)rxnfc) ||
+                   copy_in_user(&compat_rxnfc->fs.ring_cookie,
+                                &rxnfc->fs.ring_cookie,
+-                               (const void *)(&rxnfc->fs.location + 1) -
+-                               (const void *)&rxnfc->fs.ring_cookie) ||
++                               (const void __user *)(&rxnfc->fs.location + 1) -
++                               (const void __user *)&rxnfc->fs.ring_cookie) ||
+                   copy_in_user(&compat_rxnfc->rule_cnt, &rxnfc->rule_cnt,
+                                sizeof(rxnfc->rule_cnt)))
+                       return -EFAULT;
+@@ -2864,7 +2926,7 @@ static int bond_ioctl(struct net *net, u
+               old_fs = get_fs();
+               set_fs(KERNEL_DS);
+               err = dev_ioctl(net, cmd,
+-                              (struct ifreq __user __force *) &kifr);
++                              (struct ifreq __force_user *) &kifr);
+               set_fs(old_fs);
+               return err;
+@@ -2973,7 +3035,7 @@ static int compat_sioc_ifmap(struct net 
+       old_fs = get_fs();
+       set_fs(KERNEL_DS);
+-      err = dev_ioctl(net, cmd, (void  __user __force *)&ifr);
++      err = dev_ioctl(net, cmd, (void  __force_user *)&ifr);
+       set_fs(old_fs);
+       if (cmd == SIOCGIFMAP && !err) {
+@@ -3078,7 +3140,7 @@ static int routing_ioctl(struct net *net
+               ret |= __get_user(rtdev, &(ur4->rt_dev));
+               if (rtdev) {
+                       ret |= copy_from_user(devname, compat_ptr(rtdev), 15);
+-                      r4.rt_dev = (char __user __force *)devname;
++                      r4.rt_dev = (char __force_user *)devname;
+                       devname[15] = 0;
+               } else
+                       r4.rt_dev = NULL;
+@@ -3318,8 +3380,8 @@ int kernel_getsockopt(struct socket *soc
+       int __user *uoptlen;
+       int err;
+-      uoptval = (char __user __force *) optval;
+-      uoptlen = (int __user __force *) optlen;
++      uoptval = (char __force_user *) optval;
++      uoptlen = (int __force_user *) optlen;
+       set_fs(KERNEL_DS);
+       if (level == SOL_SOCKET)
+@@ -3339,7 +3401,7 @@ int kernel_setsockopt(struct socket *soc
+       char __user *uoptval;
+       int err;
+-      uoptval = (char __user __force *) optval;
++      uoptval = (char __force_user *) optval;
+       set_fs(KERNEL_DS);
+       if (level == SOL_SOCKET)
+diff -urNp linux-3.1.3/net/sunrpc/sched.c linux-3.1.3/net/sunrpc/sched.c
+--- linux-3.1.3/net/sunrpc/sched.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/sunrpc/sched.c     2011-11-16 18:39:08.000000000 -0500
+@@ -238,9 +238,9 @@ static int rpc_wait_bit_killable(void *w
  #ifdef RPC_DEBUG
  static void rpc_task_set_debuginfo(struct rpc_task *task)
  {
@@ -71230,9 +74959,21 @@ diff -urNp linux-3.0.4/net/sunrpc/sched.c linux-3.0.4/net/sunrpc/sched.c
  }
  #else
  static inline void rpc_task_set_debuginfo(struct rpc_task *task)
-diff -urNp linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma.c linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma.c
---- linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/sunrpc/svcsock.c linux-3.1.3/net/sunrpc/svcsock.c
+--- linux-3.1.3/net/sunrpc/svcsock.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/sunrpc/svcsock.c   2011-11-16 18:39:08.000000000 -0500
+@@ -394,7 +394,7 @@ static int svc_partial_recvfrom(struct s
+                               int buflen, unsigned int base)
+ {
+       size_t save_iovlen;
+-      void __user *save_iovbase;
++      void *save_iovbase;
+       unsigned int i;
+       int ret;
+diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma.c linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma.c
+--- linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma.c 2011-11-16 18:39:08.000000000 -0500
 @@ -61,15 +61,15 @@ unsigned int svcrdma_max_req_size = RPCR
  static unsigned int min_max_inline = 4096;
  static unsigned int max_max_inline = 65536;
@@ -71340,9 +75081,9 @@ diff -urNp linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma.c linux-3.0.4/net/sunrpc/xpr
                .mode           = 0644,
                .proc_handler   = read_reset_stat,
        },
-diff -urNp linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
---- linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
+--- linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c        2011-11-16 18:39:08.000000000 -0500
 @@ -499,7 +499,7 @@ next_sge:
                        svc_rdma_put_context(ctxt, 0);
                        goto out;
@@ -71370,9 +75111,9 @@ diff -urNp linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c linux-3.0.4/net/s
  
        /* Build up the XDR from the receive buffers. */
        rdma_build_arg_xdr(rqstp, ctxt, ctxt->byte_len);
-diff -urNp linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_sendto.c linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_sendto.c
---- linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_sendto.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_sendto.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_sendto.c linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+--- linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_sendto.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_sendto.c  2011-11-16 18:39:08.000000000 -0500
 @@ -362,7 +362,7 @@ static int send_write(struct svcxprt_rdm
        write_wr.wr.rdma.remote_addr = to;
  
@@ -71382,10 +75123,10 @@ diff -urNp linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_sendto.c linux-3.0.4/net/sun
        if (svc_rdma_send(xprt, &write_wr))
                goto err;
        return 0;
-diff -urNp linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_transport.c linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_transport.c
---- linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_transport.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_transport.c       2011-08-23 21:47:56.000000000 -0400
-@@ -298,7 +298,7 @@ static void rq_cq_reap(struct svcxprt_rd
+diff -urNp linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_transport.c linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_transport.c
+--- linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_transport.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/sunrpc/xprtrdma/svc_rdma_transport.c       2011-11-16 18:39:08.000000000 -0500
+@@ -299,7 +299,7 @@ static void rq_cq_reap(struct svcxprt_rd
                return;
  
        ib_req_notify_cq(xprt->sc_rq_cq, IB_CQ_NEXT_COMP);
@@ -71394,7 +75135,7 @@ diff -urNp linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_transport.c linux-3.0.4/net/
  
        while ((ret = ib_poll_cq(xprt->sc_rq_cq, 1, &wc)) > 0) {
                ctxt = (struct svc_rdma_op_ctxt *)(unsigned long)wc.wr_id;
-@@ -320,7 +320,7 @@ static void rq_cq_reap(struct svcxprt_rd
+@@ -321,7 +321,7 @@ static void rq_cq_reap(struct svcxprt_rd
        }
  
        if (ctxt)
@@ -71403,7 +75144,7 @@ diff -urNp linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_transport.c linux-3.0.4/net/
  
        set_bit(XPT_DATA, &xprt->sc_xprt.xpt_flags);
        /*
-@@ -392,7 +392,7 @@ static void sq_cq_reap(struct svcxprt_rd
+@@ -393,7 +393,7 @@ static void sq_cq_reap(struct svcxprt_rd
                return;
  
        ib_req_notify_cq(xprt->sc_sq_cq, IB_CQ_NEXT_COMP);
@@ -71412,7 +75153,7 @@ diff -urNp linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_transport.c linux-3.0.4/net/
        while ((ret = ib_poll_cq(cq, 1, &wc)) > 0) {
                if (wc.status != IB_WC_SUCCESS)
                        /* Close the transport */
-@@ -410,7 +410,7 @@ static void sq_cq_reap(struct svcxprt_rd
+@@ -411,7 +411,7 @@ static void sq_cq_reap(struct svcxprt_rd
        }
  
        if (ctxt)
@@ -71421,7 +75162,7 @@ diff -urNp linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_transport.c linux-3.0.4/net/
  }
  
  static void sq_comp_handler(struct ib_cq *cq, void *cq_context)
-@@ -1272,7 +1272,7 @@ int svc_rdma_send(struct svcxprt_rdma *x
+@@ -1273,7 +1273,7 @@ int svc_rdma_send(struct svcxprt_rdma *x
                spin_lock_bh(&xprt->sc_lock);
                if (xprt->sc_sq_depth < atomic_read(&xprt->sc_sq_count) + wr_count) {
                        spin_unlock_bh(&xprt->sc_lock);
@@ -71430,9 +75171,9 @@ diff -urNp linux-3.0.4/net/sunrpc/xprtrdma/svc_rdma_transport.c linux-3.0.4/net/
  
                        /* See if we can opportunistically reap SQ WR to make room */
                        sq_cq_reap(xprt);
-diff -urNp linux-3.0.4/net/sysctl_net.c linux-3.0.4/net/sysctl_net.c
---- linux-3.0.4/net/sysctl_net.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/sysctl_net.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/sysctl_net.c linux-3.1.3/net/sysctl_net.c
+--- linux-3.1.3/net/sysctl_net.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/sysctl_net.c       2011-11-16 18:40:44.000000000 -0500
 @@ -46,7 +46,7 @@ static int net_ctl_permissions(struct ct
                               struct ctl_table *table)
  {
@@ -71442,9 +75183,63 @@ diff -urNp linux-3.0.4/net/sysctl_net.c linux-3.0.4/net/sysctl_net.c
                int mode = (table->mode >> 6) & 7;
                return (mode << 6) | (mode << 3) | mode;
        }
-diff -urNp linux-3.0.4/net/unix/af_unix.c linux-3.0.4/net/unix/af_unix.c
---- linux-3.0.4/net/unix/af_unix.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/unix/af_unix.c     2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/tipc/link.c linux-3.1.3/net/tipc/link.c
+--- linux-3.1.3/net/tipc/link.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/tipc/link.c        2011-11-16 18:39:08.000000000 -0500
+@@ -1170,7 +1170,7 @@ static int link_send_sections_long(struc
+       struct tipc_msg fragm_hdr;
+       struct sk_buff *buf, *buf_chain, *prev;
+       u32 fragm_crs, fragm_rest, hsz, sect_rest;
+-      const unchar *sect_crs;
++      const unchar __user *sect_crs;
+       int curr_sect;
+       u32 fragm_no;
+@@ -1214,7 +1214,7 @@ again:
+               if (!sect_rest) {
+                       sect_rest = msg_sect[++curr_sect].iov_len;
+-                      sect_crs = (const unchar *)msg_sect[curr_sect].iov_base;
++                      sect_crs = (const unchar __user *)msg_sect[curr_sect].iov_base;
+               }
+               if (sect_rest < fragm_rest)
+@@ -1233,7 +1233,7 @@ error:
+                       }
+               } else
+                       skb_copy_to_linear_data_offset(buf, fragm_crs,
+-                                                     sect_crs, sz);
++                                                     (const void __force_kernel *)sect_crs, sz);
+               sect_crs += sz;
+               sect_rest -= sz;
+               fragm_crs += sz;
+diff -urNp linux-3.1.3/net/tipc/msg.c linux-3.1.3/net/tipc/msg.c
+--- linux-3.1.3/net/tipc/msg.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/tipc/msg.c 2011-11-16 18:39:08.000000000 -0500
+@@ -99,7 +99,7 @@ int tipc_msg_build(struct tipc_msg *hdr,
+                                             msg_sect[cnt].iov_len);
+               else
+                       skb_copy_to_linear_data_offset(*buf, pos,
+-                                                     msg_sect[cnt].iov_base,
++                                                     (const void __force_kernel *)msg_sect[cnt].iov_base,
+                                                      msg_sect[cnt].iov_len);
+               pos += msg_sect[cnt].iov_len;
+       }
+diff -urNp linux-3.1.3/net/tipc/subscr.c linux-3.1.3/net/tipc/subscr.c
+--- linux-3.1.3/net/tipc/subscr.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/tipc/subscr.c      2011-11-16 18:39:08.000000000 -0500
+@@ -101,7 +101,7 @@ static void subscr_send_event(struct sub
+ {
+       struct iovec msg_sect;
+-      msg_sect.iov_base = (void *)&sub->evt;
++      msg_sect.iov_base = (void __force_user *)&sub->evt;
+       msg_sect.iov_len = sizeof(struct tipc_event);
+       sub->evt.event = htohl(event, sub->swap);
+diff -urNp linux-3.1.3/net/unix/af_unix.c linux-3.1.3/net/unix/af_unix.c
+--- linux-3.1.3/net/unix/af_unix.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/unix/af_unix.c     2011-11-16 19:17:17.000000000 -0500
 @@ -767,6 +767,12 @@ static struct sock *unix_find_other(stru
                err = -ECONNREFUSED;
                if (!S_ISSOCK(inode->i_mode))
@@ -71472,28 +75267,28 @@ diff -urNp linux-3.0.4/net/unix/af_unix.c linux-3.0.4/net/unix/af_unix.c
                        if (dentry)
                                touch_atime(unix_sk(u)->mnt, dentry);
                } else
-@@ -872,11 +885,18 @@ static int unix_bind(struct socket *sock
-               err = security_path_mknod(&nd.path, dentry, mode, 0);
+@@ -869,11 +882,18 @@ static int unix_bind(struct socket *sock
+               err = security_path_mknod(&path, dentry, mode, 0);
                if (err)
                        goto out_mknod_drop_write;
-+              if (!gr_acl_handle_mknod(dentry, nd.path.dentry, nd.path.mnt, mode)) {
++              if (!gr_acl_handle_mknod(dentry, path.dentry, path.mnt, mode)) {
 +                      err = -EACCES;
 +                      goto out_mknod_drop_write;
 +              }
-               err = vfs_mknod(nd.path.dentry->d_inode, dentry, mode, 0);
+               err = vfs_mknod(path.dentry->d_inode, dentry, mode, 0);
  out_mknod_drop_write:
-               mnt_drop_write(nd.path.mnt);
+               mnt_drop_write(path.mnt);
                if (err)
                        goto out_mknod_dput;
 +
-+              gr_handle_create(dentry, nd.path.mnt);
++              gr_handle_create(dentry, path.mnt);
 +
-               mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
-               dput(nd.path.dentry);
-               nd.path.dentry = dentry;
-diff -urNp linux-3.0.4/net/wireless/core.h linux-3.0.4/net/wireless/core.h
---- linux-3.0.4/net/wireless/core.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/wireless/core.h    2011-08-23 21:47:56.000000000 -0400
+               mutex_unlock(&path.dentry->d_inode->i_mutex);
+               dput(path.dentry);
+               path.dentry = dentry;
+diff -urNp linux-3.1.3/net/wireless/core.h linux-3.1.3/net/wireless/core.h
+--- linux-3.1.3/net/wireless/core.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/wireless/core.h    2011-11-16 18:39:08.000000000 -0500
 @@ -27,7 +27,7 @@ struct cfg80211_registered_device {
        struct mutex mtx;
  
@@ -71503,9 +75298,9 @@ diff -urNp linux-3.0.4/net/wireless/core.h linux-3.0.4/net/wireless/core.h
        struct rfkill *rfkill;
        struct work_struct rfkill_sync;
  
-diff -urNp linux-3.0.4/net/wireless/wext-core.c linux-3.0.4/net/wireless/wext-core.c
---- linux-3.0.4/net/wireless/wext-core.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/wireless/wext-core.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/wireless/wext-core.c linux-3.1.3/net/wireless/wext-core.c
+--- linux-3.1.3/net/wireless/wext-core.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/wireless/wext-core.c       2011-11-16 18:39:08.000000000 -0500
 @@ -746,8 +746,7 @@ static int ioctl_standard_iw_point(struc
                 */
  
@@ -71539,9 +75334,9 @@ diff -urNp linux-3.0.4/net/wireless/wext-core.c linux-3.0.4/net/wireless/wext-co
        err = handler(dev, info, (union iwreq_data *) iwp, extra);
  
        iwp->length += essid_compat;
-diff -urNp linux-3.0.4/net/xfrm/xfrm_policy.c linux-3.0.4/net/xfrm/xfrm_policy.c
---- linux-3.0.4/net/xfrm/xfrm_policy.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/xfrm/xfrm_policy.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/net/xfrm/xfrm_policy.c linux-3.1.3/net/xfrm/xfrm_policy.c
+--- linux-3.1.3/net/xfrm/xfrm_policy.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/xfrm/xfrm_policy.c 2011-11-16 18:39:08.000000000 -0500
 @@ -299,7 +299,7 @@ static void xfrm_policy_kill(struct xfrm
  {
        policy->walk.dead = 1;
@@ -71560,7 +75355,7 @@ diff -urNp linux-3.0.4/net/xfrm/xfrm_policy.c linux-3.0.4/net/xfrm/xfrm_policy.c
        if (delpol)
                __xfrm_policy_unlink(delpol, dir);
        policy->index = delpol ? delpol->index : xfrm_gen_index(net, dir);
-@@ -1528,7 +1528,7 @@ free_dst:
+@@ -1530,7 +1530,7 @@ free_dst:
        goto out;
  }
  
@@ -71569,7 +75364,7 @@ diff -urNp linux-3.0.4/net/xfrm/xfrm_policy.c linux-3.0.4/net/xfrm/xfrm_policy.c
  xfrm_dst_alloc_copy(void **target, const void *src, int size)
  {
        if (!*target) {
-@@ -1540,7 +1540,7 @@ xfrm_dst_alloc_copy(void **target, const
+@@ -1542,7 +1542,7 @@ xfrm_dst_alloc_copy(void **target, const
        return 0;
  }
  
@@ -71578,7 +75373,7 @@ diff -urNp linux-3.0.4/net/xfrm/xfrm_policy.c linux-3.0.4/net/xfrm/xfrm_policy.c
  xfrm_dst_update_parent(struct dst_entry *dst, const struct xfrm_selector *sel)
  {
  #ifdef CONFIG_XFRM_SUB_POLICY
-@@ -1552,7 +1552,7 @@ xfrm_dst_update_parent(struct dst_entry 
+@@ -1554,7 +1554,7 @@ xfrm_dst_update_parent(struct dst_entry 
  #endif
  }
  
@@ -71587,7 +75382,7 @@ diff -urNp linux-3.0.4/net/xfrm/xfrm_policy.c linux-3.0.4/net/xfrm/xfrm_policy.c
  xfrm_dst_update_origin(struct dst_entry *dst, const struct flowi *fl)
  {
  #ifdef CONFIG_XFRM_SUB_POLICY
-@@ -1646,7 +1646,7 @@ xfrm_resolve_and_create_bundle(struct xf
+@@ -1648,7 +1648,7 @@ xfrm_resolve_and_create_bundle(struct xf
  
        xdst->num_pols = num_pols;
        memcpy(xdst->pols, pols, sizeof(struct xfrm_policy*) * num_pols);
@@ -71596,7 +75391,7 @@ diff -urNp linux-3.0.4/net/xfrm/xfrm_policy.c linux-3.0.4/net/xfrm/xfrm_policy.c
  
        return xdst;
  }
-@@ -2333,7 +2333,7 @@ static int xfrm_bundle_ok(struct xfrm_ds
+@@ -2335,7 +2335,7 @@ static int xfrm_bundle_ok(struct xfrm_ds
                if (xdst->xfrm_genid != dst->xfrm->genid)
                        return 0;
                if (xdst->num_pols > 0 &&
@@ -71605,7 +75400,7 @@ diff -urNp linux-3.0.4/net/xfrm/xfrm_policy.c linux-3.0.4/net/xfrm/xfrm_policy.c
                        return 0;
  
                mtu = dst_mtu(dst->child);
-@@ -2861,7 +2861,7 @@ static int xfrm_policy_migrate(struct xf
+@@ -2870,7 +2870,7 @@ static int xfrm_policy_migrate(struct xf
                               sizeof(pol->xfrm_vec[i].saddr));
                        pol->xfrm_vec[i].encap_family = mp->new_family;
                        /* flush bundles */
@@ -71614,9 +75409,9 @@ diff -urNp linux-3.0.4/net/xfrm/xfrm_policy.c linux-3.0.4/net/xfrm/xfrm_policy.c
                }
        }
  
-diff -urNp linux-3.0.4/net/xfrm/xfrm_user.c linux-3.0.4/net/xfrm/xfrm_user.c
---- linux-3.0.4/net/xfrm/xfrm_user.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/net/xfrm/xfrm_user.c   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/net/xfrm/xfrm_user.c linux-3.1.3/net/xfrm/xfrm_user.c
+--- linux-3.1.3/net/xfrm/xfrm_user.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/net/xfrm/xfrm_user.c   2011-11-16 18:40:44.000000000 -0500
 @@ -1394,6 +1394,8 @@ static int copy_to_user_tmpl(struct xfrm
        struct xfrm_user_tmpl vec[XFRM_MAX_DEPTH];
        int i;
@@ -71635,9 +75430,31 @@ diff -urNp linux-3.0.4/net/xfrm/xfrm_user.c linux-3.0.4/net/xfrm/xfrm_user.c
        if (attrs[XFRMA_MIGRATE] == NULL)
                return -EINVAL;
  
-diff -urNp linux-3.0.4/scripts/basic/fixdep.c linux-3.0.4/scripts/basic/fixdep.c
---- linux-3.0.4/scripts/basic/fixdep.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/scripts/basic/fixdep.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/scripts/basic/fixdep.c linux-3.1.3/scripts/basic/fixdep.c
+--- linux-3.1.3/scripts/basic/fixdep.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/scripts/basic/fixdep.c 2011-11-16 18:39:08.000000000 -0500
+@@ -161,7 +161,7 @@ static unsigned int strhash(const char *
+ /*
+  * Lookup a value in the configuration string.
+  */
+-static int is_defined_config(const char *name, int len, unsigned int hash)
++static int is_defined_config(const char *name, unsigned int len, unsigned int hash)
+ {
+       struct item *aux;
+@@ -211,10 +211,10 @@ static void clear_config(void)
+ /*
+  * Record the use of a CONFIG_* word.
+  */
+-static void use_config(const char *m, int slen)
++static void use_config(const char *m, unsigned int slen)
+ {
+       unsigned int hash = strhash(m, slen);
+-      int c, i;
++      unsigned int c, i;
+       if (is_defined_config(m, slen, hash))
+           return;
 @@ -235,9 +235,9 @@ static void use_config(const char *m, in
  
  static void parse_config_file(const char *map, size_t len)
@@ -71659,15 +75476,15 @@ diff -urNp linux-3.0.4/scripts/basic/fixdep.c linux-3.0.4/scripts/basic/fixdep.c
  
        if (*p != INT_CONF) {
                fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n",
-diff -urNp linux-3.0.4/scripts/gcc-plugin.sh linux-3.0.4/scripts/gcc-plugin.sh
---- linux-3.0.4/scripts/gcc-plugin.sh  1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/scripts/gcc-plugin.sh  2011-09-14 09:08:05.000000000 -0400
+diff -urNp linux-3.1.3/scripts/gcc-plugin.sh linux-3.1.3/scripts/gcc-plugin.sh
+--- linux-3.1.3/scripts/gcc-plugin.sh  1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/scripts/gcc-plugin.sh  2011-11-20 19:21:53.000000000 -0500
 @@ -0,0 +1,2 @@
 +#!/bin/sh
-+echo "#include \"gcc-plugin.h\"\n#include \"rtl.h\"" | $1 -x c -shared - -o /dev/null -I`$2 -print-file-name=plugin`/include >/dev/null 2>&1 && echo "y"
-diff -urNp linux-3.0.4/scripts/Makefile.build linux-3.0.4/scripts/Makefile.build
---- linux-3.0.4/scripts/Makefile.build 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/scripts/Makefile.build 2011-08-23 21:47:56.000000000 -0400
++echo -e "#include \"gcc-plugin.h\"\n#include \"tree.h\"\n#include \"tm.h\"\n#include \"rtl.h\"" | $1 -x c -shared - -o /dev/null -I`$2 -print-file-name=plugin`/include >/dev/null 2>&1 && echo "y"
+diff -urNp linux-3.1.3/scripts/Makefile.build linux-3.1.3/scripts/Makefile.build
+--- linux-3.1.3/scripts/Makefile.build 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/scripts/Makefile.build 2011-11-16 18:40:44.000000000 -0500
 @@ -109,7 +109,7 @@ endif
  endif
  
@@ -71677,9 +75494,9 @@ diff -urNp linux-3.0.4/scripts/Makefile.build linux-3.0.4/scripts/Makefile.build
  include scripts/Makefile.host
  endif
  
-diff -urNp linux-3.0.4/scripts/Makefile.clean linux-3.0.4/scripts/Makefile.clean
---- linux-3.0.4/scripts/Makefile.clean 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/scripts/Makefile.clean 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/scripts/Makefile.clean linux-3.1.3/scripts/Makefile.clean
+--- linux-3.1.3/scripts/Makefile.clean 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/scripts/Makefile.clean 2011-11-16 18:39:08.000000000 -0500
 @@ -43,7 +43,8 @@ subdir-ymn   := $(addprefix $(obj)/,$(subd
  __clean-files := $(extra-y) $(always)                  \
                   $(targets) $(clean-files)             \
@@ -71690,9 +75507,9 @@ diff -urNp linux-3.0.4/scripts/Makefile.clean linux-3.0.4/scripts/Makefile.clean
  
  __clean-files   := $(filter-out $(no-clean-files), $(__clean-files))
  
-diff -urNp linux-3.0.4/scripts/Makefile.host linux-3.0.4/scripts/Makefile.host
---- linux-3.0.4/scripts/Makefile.host  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/scripts/Makefile.host  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/scripts/Makefile.host linux-3.1.3/scripts/Makefile.host
+--- linux-3.1.3/scripts/Makefile.host  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/scripts/Makefile.host  2011-11-16 18:39:08.000000000 -0500
 @@ -31,6 +31,7 @@
  # Note: Shared libraries consisting of C++ files are not supported
  
@@ -71709,9 +75526,9 @@ diff -urNp linux-3.0.4/scripts/Makefile.host linux-3.0.4/scripts/Makefile.host
  # Remove .so files from "xxx-objs"
  host-cobjs    := $(filter-out %.so,$(host-cobjs))
  
-diff -urNp linux-3.0.4/scripts/mod/file2alias.c linux-3.0.4/scripts/mod/file2alias.c
---- linux-3.0.4/scripts/mod/file2alias.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/scripts/mod/file2alias.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/scripts/mod/file2alias.c linux-3.1.3/scripts/mod/file2alias.c
+--- linux-3.1.3/scripts/mod/file2alias.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/scripts/mod/file2alias.c       2011-11-16 18:39:08.000000000 -0500
 @@ -72,7 +72,7 @@ static void device_id_check(const char *
                            unsigned long size, unsigned long id_size,
                            void *symval)
@@ -71730,6 +75547,15 @@ diff -urNp linux-3.0.4/scripts/mod/file2alias.c linux-3.0.4/scripts/mod/file2ali
                         unsigned char range_lo, unsigned char range_hi,
                         unsigned char max, struct module *mod)
  {
+@@ -203,7 +203,7 @@ static void do_usb_entry_multi(struct us
+ {
+       unsigned int devlo, devhi;
+       unsigned char chi, clo, max;
+-      int ndigits;
++      unsigned int ndigits;
+       id->match_flags = TO_NATIVE(id->match_flags);
+       id->idVendor = TO_NATIVE(id->idVendor);
 @@ -437,7 +437,7 @@ static void do_pnp_device_entry(void *sy
        for (i = 0; i < count; i++) {
                const char *id = (char *)devs[i].id;
@@ -71766,10 +75592,10 @@ diff -urNp linux-3.0.4/scripts/mod/file2alias.c linux-3.0.4/scripts/mod/file2ali
  
        sprintf(alias, "dmi*");
  
-diff -urNp linux-3.0.4/scripts/mod/modpost.c linux-3.0.4/scripts/mod/modpost.c
---- linux-3.0.4/scripts/mod/modpost.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/scripts/mod/modpost.c  2011-08-23 21:47:56.000000000 -0400
-@@ -892,6 +892,7 @@ enum mismatch {
+diff -urNp linux-3.1.3/scripts/mod/modpost.c linux-3.1.3/scripts/mod/modpost.c
+--- linux-3.1.3/scripts/mod/modpost.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/scripts/mod/modpost.c  2011-11-16 18:39:08.000000000 -0500
+@@ -919,6 +919,7 @@ enum mismatch {
        ANY_INIT_TO_ANY_EXIT,
        ANY_EXIT_TO_ANY_INIT,
        EXPORT_TO_INIT_EXIT,
@@ -71777,7 +75603,7 @@ diff -urNp linux-3.0.4/scripts/mod/modpost.c linux-3.0.4/scripts/mod/modpost.c
  };
  
  struct sectioncheck {
-@@ -1000,6 +1001,12 @@ const struct sectioncheck sectioncheck[]
+@@ -1027,6 +1028,12 @@ const struct sectioncheck sectioncheck[]
        .tosec   = { INIT_SECTIONS, EXIT_SECTIONS, NULL },
        .mismatch = EXPORT_TO_INIT_EXIT,
        .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
@@ -71790,7 +75616,7 @@ diff -urNp linux-3.0.4/scripts/mod/modpost.c linux-3.0.4/scripts/mod/modpost.c
  }
  };
  
-@@ -1122,10 +1129,10 @@ static Elf_Sym *find_elf_symbol(struct e
+@@ -1149,10 +1156,10 @@ static Elf_Sym *find_elf_symbol(struct e
                        continue;
                if (ELF_ST_TYPE(sym->st_info) == STT_SECTION)
                        continue;
@@ -71803,7 +75629,7 @@ diff -urNp linux-3.0.4/scripts/mod/modpost.c linux-3.0.4/scripts/mod/modpost.c
                if (d < 0)
                        d = addr - sym->st_value;
                if (d < distance) {
-@@ -1404,6 +1411,14 @@ static void report_sec_mismatch(const ch
+@@ -1431,6 +1438,14 @@ static void report_sec_mismatch(const ch
                tosym, prl_to, prl_to, tosym);
                free(prl_to);
                break;
@@ -71818,7 +75644,7 @@ diff -urNp linux-3.0.4/scripts/mod/modpost.c linux-3.0.4/scripts/mod/modpost.c
        }
        fprintf(stderr, "\n");
  }
-@@ -1629,7 +1644,7 @@ static void section_rel(const char *modn
+@@ -1656,7 +1671,7 @@ static void section_rel(const char *modn
  static void check_sec_ref(struct module *mod, const char *modname,
                            struct elf_info *elf)
  {
@@ -71827,7 +75653,7 @@ diff -urNp linux-3.0.4/scripts/mod/modpost.c linux-3.0.4/scripts/mod/modpost.c
        Elf_Shdr *sechdrs = elf->sechdrs;
  
        /* Walk through all sections */
-@@ -1727,7 +1742,7 @@ void __attribute__((format(printf, 2, 3)
+@@ -1754,7 +1769,7 @@ void __attribute__((format(printf, 2, 3)
        va_end(ap);
  }
  
@@ -71836,7 +75662,7 @@ diff -urNp linux-3.0.4/scripts/mod/modpost.c linux-3.0.4/scripts/mod/modpost.c
  {
        if (buf->size - buf->pos < len) {
                buf->size += len + SZ;
-@@ -1939,7 +1954,7 @@ static void write_if_changed(struct buff
+@@ -1966,7 +1981,7 @@ static void write_if_changed(struct buff
        if (fstat(fileno(file), &st) < 0)
                goto close_write;
  
@@ -71845,9 +75671,9 @@ diff -urNp linux-3.0.4/scripts/mod/modpost.c linux-3.0.4/scripts/mod/modpost.c
                goto close_write;
  
        tmp = NOFAIL(malloc(b->pos));
-diff -urNp linux-3.0.4/scripts/mod/modpost.h linux-3.0.4/scripts/mod/modpost.h
---- linux-3.0.4/scripts/mod/modpost.h  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/scripts/mod/modpost.h  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/scripts/mod/modpost.h linux-3.1.3/scripts/mod/modpost.h
+--- linux-3.1.3/scripts/mod/modpost.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/scripts/mod/modpost.h  2011-11-16 18:39:08.000000000 -0500
 @@ -92,15 +92,15 @@ void *do_nofail(void *ptr, const char *e
  
  struct buffer {
@@ -71867,9 +75693,9 @@ diff -urNp linux-3.0.4/scripts/mod/modpost.h linux-3.0.4/scripts/mod/modpost.h
  
  struct module {
        struct module *next;
-diff -urNp linux-3.0.4/scripts/mod/sumversion.c linux-3.0.4/scripts/mod/sumversion.c
---- linux-3.0.4/scripts/mod/sumversion.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/scripts/mod/sumversion.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/scripts/mod/sumversion.c linux-3.1.3/scripts/mod/sumversion.c
+--- linux-3.1.3/scripts/mod/sumversion.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/scripts/mod/sumversion.c       2011-11-16 18:39:08.000000000 -0500
 @@ -470,7 +470,7 @@ static void write_version(const char *fi
                goto out;
        }
@@ -71879,9 +75705,9 @@ diff -urNp linux-3.0.4/scripts/mod/sumversion.c linux-3.0.4/scripts/mod/sumversi
                warn("writing sum in %s failed: %s\n",
                        filename, strerror(errno));
                goto out;
-diff -urNp linux-3.0.4/scripts/pnmtologo.c linux-3.0.4/scripts/pnmtologo.c
---- linux-3.0.4/scripts/pnmtologo.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/scripts/pnmtologo.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/scripts/pnmtologo.c linux-3.1.3/scripts/pnmtologo.c
+--- linux-3.1.3/scripts/pnmtologo.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/scripts/pnmtologo.c    2011-11-16 18:39:08.000000000 -0500
 @@ -237,14 +237,14 @@ static void write_header(void)
      fprintf(out, " *  Linux logo %s\n", logoname);
      fputs(" */\n\n", out);
@@ -71908,9 +75734,9 @@ diff -urNp linux-3.0.4/scripts/pnmtologo.c linux-3.0.4/scripts/pnmtologo.c
            logoname);
      write_hex_cnt = 0;
      for (i = 0; i < logo_clutsize; i++) {
-diff -urNp linux-3.0.4/security/apparmor/lsm.c linux-3.0.4/security/apparmor/lsm.c
---- linux-3.0.4/security/apparmor/lsm.c        2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/security/apparmor/lsm.c        2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/security/apparmor/lsm.c linux-3.1.3/security/apparmor/lsm.c
+--- linux-3.1.3/security/apparmor/lsm.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/security/apparmor/lsm.c        2011-11-16 18:40:44.000000000 -0500
 @@ -621,7 +621,7 @@ static int apparmor_task_setrlimit(struc
        return error;
  }
@@ -71920,9 +75746,9 @@ diff -urNp linux-3.0.4/security/apparmor/lsm.c linux-3.0.4/security/apparmor/lsm
        .name =                         "apparmor",
  
        .ptrace_access_check =          apparmor_ptrace_access_check,
-diff -urNp linux-3.0.4/security/commoncap.c linux-3.0.4/security/commoncap.c
---- linux-3.0.4/security/commoncap.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/security/commoncap.c   2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/security/commoncap.c linux-3.1.3/security/commoncap.c
+--- linux-3.1.3/security/commoncap.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/security/commoncap.c   2011-11-16 18:40:44.000000000 -0500
 @@ -28,6 +28,7 @@
  #include <linux/prctl.h>
  #include <linux/securebits.h>
@@ -71950,9 +75776,9 @@ diff -urNp linux-3.0.4/security/commoncap.c linux-3.0.4/security/commoncap.c
        if (cred->uid != 0) {
                if (bprm->cap_effective)
                        return 1;
-diff -urNp linux-3.0.4/security/integrity/ima/ima_api.c linux-3.0.4/security/integrity/ima/ima_api.c
---- linux-3.0.4/security/integrity/ima/ima_api.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/security/integrity/ima/ima_api.c       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/security/integrity/ima/ima_api.c linux-3.1.3/security/integrity/ima/ima_api.c
+--- linux-3.1.3/security/integrity/ima/ima_api.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/security/integrity/ima/ima_api.c       2011-11-16 18:39:08.000000000 -0500
 @@ -75,7 +75,7 @@ void ima_add_violation(struct inode *ino
        int result;
  
@@ -71962,9 +75788,9 @@ diff -urNp linux-3.0.4/security/integrity/ima/ima_api.c linux-3.0.4/security/int
  
        entry = kmalloc(sizeof(*entry), GFP_KERNEL);
        if (!entry) {
-diff -urNp linux-3.0.4/security/integrity/ima/ima_fs.c linux-3.0.4/security/integrity/ima/ima_fs.c
---- linux-3.0.4/security/integrity/ima/ima_fs.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/security/integrity/ima/ima_fs.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/security/integrity/ima/ima_fs.c linux-3.1.3/security/integrity/ima/ima_fs.c
+--- linux-3.1.3/security/integrity/ima/ima_fs.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/security/integrity/ima/ima_fs.c        2011-11-16 18:39:08.000000000 -0500
 @@ -28,12 +28,12 @@
  static int valid_policy = 1;
  #define TMPBUFLEN 12
@@ -71980,9 +75806,9 @@ diff -urNp linux-3.0.4/security/integrity/ima/ima_fs.c linux-3.0.4/security/inte
        return simple_read_from_buffer(buf, count, ppos, tmpbuf, len);
  }
  
-diff -urNp linux-3.0.4/security/integrity/ima/ima.h linux-3.0.4/security/integrity/ima/ima.h
---- linux-3.0.4/security/integrity/ima/ima.h   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/security/integrity/ima/ima.h   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/security/integrity/ima/ima.h linux-3.1.3/security/integrity/ima/ima.h
+--- linux-3.1.3/security/integrity/ima/ima.h   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/security/integrity/ima/ima.h   2011-11-16 18:39:08.000000000 -0500
 @@ -85,8 +85,8 @@ void ima_add_violation(struct inode *ino
  extern spinlock_t ima_queue_lock;
  
@@ -71994,9 +75820,9 @@ diff -urNp linux-3.0.4/security/integrity/ima/ima.h linux-3.0.4/security/integri
        struct hlist_head queue[IMA_MEASURE_HTABLE_SIZE];
  };
  extern struct ima_h_table ima_htable;
-diff -urNp linux-3.0.4/security/integrity/ima/ima_queue.c linux-3.0.4/security/integrity/ima/ima_queue.c
---- linux-3.0.4/security/integrity/ima/ima_queue.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/security/integrity/ima/ima_queue.c     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/security/integrity/ima/ima_queue.c linux-3.1.3/security/integrity/ima/ima_queue.c
+--- linux-3.1.3/security/integrity/ima/ima_queue.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/security/integrity/ima/ima_queue.c     2011-11-16 18:39:08.000000000 -0500
 @@ -79,7 +79,7 @@ static int ima_add_digest_entry(struct i
        INIT_LIST_HEAD(&qe->later);
        list_add_tail_rcu(&qe->later, &ima_measurements);
@@ -72006,9 +75832,9 @@ diff -urNp linux-3.0.4/security/integrity/ima/ima_queue.c linux-3.0.4/security/i
        key = ima_hash_key(entry->digest);
        hlist_add_head_rcu(&qe->hnext, &ima_htable.queue[key]);
        return 0;
-diff -urNp linux-3.0.4/security/Kconfig linux-3.0.4/security/Kconfig
---- linux-3.0.4/security/Kconfig       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/security/Kconfig       2011-09-17 00:58:04.000000000 -0400
+diff -urNp linux-3.1.3/security/Kconfig linux-3.1.3/security/Kconfig
+--- linux-3.1.3/security/Kconfig       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/security/Kconfig       2011-11-16 18:40:44.000000000 -0500
 @@ -4,6 +4,558 @@
  
  menu "Security options"
@@ -72331,7 +76157,7 @@ diff -urNp linux-3.0.4/security/Kconfig linux-3.0.4/security/Kconfig
 +
 +config PAX_KERNEXEC
 +      bool "Enforce non-executable kernel pages"
-+      depends on PAX_NOEXEC && (PPC || X86) && (!X86_32 || X86_WP_WORKS_OK) && !XEN
++      depends on (PPC || X86) && (!X86_32 || X86_WP_WORKS_OK) && !XEN
 +      select PAX_PER_CPU_PGD if X86_64 || (X86_32 && X86_PAE)
 +      select PAX_KERNEXEC_PLUGIN if X86_64
 +      help
@@ -72399,7 +76225,7 @@ diff -urNp linux-3.0.4/security/Kconfig linux-3.0.4/security/Kconfig
 +
 +config PAX_RANDKSTACK
 +      bool "Randomize kernel stack base"
-+      depends on PAX_ASLR && X86_TSC && X86
++      depends on X86_TSC && X86
 +      help
 +        By saying Y here the kernel will randomize every task's kernel
 +        stack on every system call.  This will not only force an attacker
@@ -72577,10 +76403,61 @@ diff -urNp linux-3.0.4/security/Kconfig linux-3.0.4/security/Kconfig
        default 65536
        help
          This is the portion of low virtual memory which should be protected
-diff -urNp linux-3.0.4/security/keys/keyring.c linux-3.0.4/security/keys/keyring.c
---- linux-3.0.4/security/keys/keyring.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/security/keys/keyring.c        2011-08-23 21:47:56.000000000 -0400
-@@ -215,15 +215,15 @@ static long keyring_read(const struct ke
+diff -urNp linux-3.1.3/security/keys/compat.c linux-3.1.3/security/keys/compat.c
+--- linux-3.1.3/security/keys/compat.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/security/keys/compat.c 2011-11-16 18:39:08.000000000 -0500
+@@ -44,7 +44,7 @@ long compat_keyctl_instantiate_key_iov(
+       if (ret == 0)
+               goto no_payload_free;
+-      ret = keyctl_instantiate_key_common(id, iov, ioc, ret, ringid);
++      ret = keyctl_instantiate_key_common(id, (const struct iovec __force_user *)iov, ioc, ret, ringid);
+       if (iov != iovstack)
+               kfree(iov);
+diff -urNp linux-3.1.3/security/keys/keyctl.c linux-3.1.3/security/keys/keyctl.c
+--- linux-3.1.3/security/keys/keyctl.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/security/keys/keyctl.c 2011-11-16 18:39:08.000000000 -0500
+@@ -921,7 +921,7 @@ static int keyctl_change_reqkey_auth(str
+ /*
+  * Copy the iovec data from userspace
+  */
+-static long copy_from_user_iovec(void *buffer, const struct iovec *iov,
++static long copy_from_user_iovec(void *buffer, const struct iovec __user *iov,
+                                unsigned ioc)
+ {
+       for (; ioc > 0; ioc--) {
+@@ -943,7 +943,7 @@ static long copy_from_user_iovec(void *b
+  * If successful, 0 will be returned.
+  */
+ long keyctl_instantiate_key_common(key_serial_t id,
+-                                 const struct iovec *payload_iov,
++                                 const struct iovec __user *payload_iov,
+                                  unsigned ioc,
+                                  size_t plen,
+                                  key_serial_t ringid)
+@@ -1038,7 +1038,7 @@ long keyctl_instantiate_key(key_serial_t
+                       [0].iov_len  = plen
+               };
+-              return keyctl_instantiate_key_common(id, iov, 1, plen, ringid);
++              return keyctl_instantiate_key_common(id, (const struct iovec __force_user *)iov, 1, plen, ringid);
+       }
+       return keyctl_instantiate_key_common(id, NULL, 0, 0, ringid);
+@@ -1071,7 +1071,7 @@ long keyctl_instantiate_key_iov(key_seri
+       if (ret == 0)
+               goto no_payload_free;
+-      ret = keyctl_instantiate_key_common(id, iov, ioc, ret, ringid);
++      ret = keyctl_instantiate_key_common(id, (const struct iovec __force_user *)iov, ioc, ret, ringid);
+       if (iov != iovstack)
+               kfree(iov);
+diff -urNp linux-3.1.3/security/keys/keyring.c linux-3.1.3/security/keys/keyring.c
+--- linux-3.1.3/security/keys/keyring.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/security/keys/keyring.c        2011-11-16 18:39:08.000000000 -0500
+@@ -214,15 +214,15 @@ static long keyring_read(const struct ke
                        ret = -EFAULT;
  
                        for (loop = 0; loop < klist->nkeys; loop++) {
@@ -72599,9 +76476,9 @@ diff -urNp linux-3.0.4/security/keys/keyring.c linux-3.0.4/security/keys/keyring
                                        goto error;
  
                                buflen -= tmp;
-diff -urNp linux-3.0.4/security/min_addr.c linux-3.0.4/security/min_addr.c
---- linux-3.0.4/security/min_addr.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/security/min_addr.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/security/min_addr.c linux-3.1.3/security/min_addr.c
+--- linux-3.1.3/security/min_addr.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/security/min_addr.c    2011-11-16 18:40:44.000000000 -0500
 @@ -14,6 +14,7 @@ unsigned long dac_mmap_min_addr = CONFIG
   */
  static void update_mmap_min_addr(void)
@@ -72618,9 +76495,9 @@ diff -urNp linux-3.0.4/security/min_addr.c linux-3.0.4/security/min_addr.c
  }
  
  /*
-diff -urNp linux-3.0.4/security/security.c linux-3.0.4/security/security.c
---- linux-3.0.4/security/security.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/security/security.c    2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/security/security.c linux-3.1.3/security/security.c
+--- linux-3.1.3/security/security.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/security/security.c    2011-11-16 18:40:44.000000000 -0500
 @@ -25,8 +25,8 @@ static __initdata char chosen_lsm[SECURI
  /* things that live in capability.c */
  extern void __init security_fixup_ops(struct security_operations *ops);
@@ -72642,9 +76519,9 @@ diff -urNp linux-3.0.4/security/security.c linux-3.0.4/security/security.c
  }
  
  /* Save user chosen LSM */
-diff -urNp linux-3.0.4/security/selinux/hooks.c linux-3.0.4/security/selinux/hooks.c
---- linux-3.0.4/security/selinux/hooks.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/security/selinux/hooks.c       2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/security/selinux/hooks.c linux-3.1.3/security/selinux/hooks.c
+--- linux-3.1.3/security/selinux/hooks.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/security/selinux/hooks.c       2011-11-16 18:40:44.000000000 -0500
 @@ -93,7 +93,6 @@
  #define NUM_SEL_MNT_OPTS 5
  
@@ -72653,7 +76530,7 @@ diff -urNp linux-3.0.4/security/selinux/hooks.c linux-3.0.4/security/selinux/hoo
  
  /* SECMARK reference count */
  atomic_t selinux_secmark_refcount = ATOMIC_INIT(0);
-@@ -5454,7 +5453,7 @@ static int selinux_key_getsecurity(struc
+@@ -5455,7 +5454,7 @@ static int selinux_key_getsecurity(struc
  
  #endif
  
@@ -72662,9 +76539,9 @@ diff -urNp linux-3.0.4/security/selinux/hooks.c linux-3.0.4/security/selinux/hoo
        .name =                         "selinux",
  
        .ptrace_access_check =          selinux_ptrace_access_check,
-diff -urNp linux-3.0.4/security/selinux/include/xfrm.h linux-3.0.4/security/selinux/include/xfrm.h
---- linux-3.0.4/security/selinux/include/xfrm.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/security/selinux/include/xfrm.h        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/security/selinux/include/xfrm.h linux-3.1.3/security/selinux/include/xfrm.h
+--- linux-3.1.3/security/selinux/include/xfrm.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/security/selinux/include/xfrm.h        2011-11-16 18:39:08.000000000 -0500
 @@ -48,7 +48,7 @@ int selinux_xfrm_decode_session(struct s
  
  static inline void selinux_xfrm_notify_policyload(void)
@@ -72674,9 +76551,9 @@ diff -urNp linux-3.0.4/security/selinux/include/xfrm.h linux-3.0.4/security/seli
  }
  #else
  static inline int selinux_xfrm_enabled(void)
-diff -urNp linux-3.0.4/security/selinux/ss/services.c linux-3.0.4/security/selinux/ss/services.c
---- linux-3.0.4/security/selinux/ss/services.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/security/selinux/ss/services.c 2011-08-23 21:48:14.000000000 -0400
+diff -urNp linux-3.1.3/security/selinux/ss/services.c linux-3.1.3/security/selinux/ss/services.c
+--- linux-3.1.3/security/selinux/ss/services.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/security/selinux/ss/services.c 2011-11-16 18:40:44.000000000 -0500
 @@ -1814,6 +1814,8 @@ int security_load_policy(void *data, siz
        int rc = 0;
        struct policy_file file = { data, len }, *fp = &file;
@@ -72686,10 +76563,10 @@ diff -urNp linux-3.0.4/security/selinux/ss/services.c linux-3.0.4/security/selin
        if (!ss_initialized) {
                avtab_cache_init();
                rc = policydb_read(&policydb, fp);
-diff -urNp linux-3.0.4/security/smack/smack_lsm.c linux-3.0.4/security/smack/smack_lsm.c
---- linux-3.0.4/security/smack/smack_lsm.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/security/smack/smack_lsm.c     2011-08-23 21:47:56.000000000 -0400
-@@ -3392,7 +3392,7 @@ static int smack_inode_getsecctx(struct 
+diff -urNp linux-3.1.3/security/smack/smack_lsm.c linux-3.1.3/security/smack/smack_lsm.c
+--- linux-3.1.3/security/smack/smack_lsm.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/security/smack/smack_lsm.c     2011-11-16 18:39:08.000000000 -0500
+@@ -3393,7 +3393,7 @@ static int smack_inode_getsecctx(struct 
        return 0;
  }
  
@@ -72698,10 +76575,10 @@ diff -urNp linux-3.0.4/security/smack/smack_lsm.c linux-3.0.4/security/smack/sma
        .name =                         "smack",
  
        .ptrace_access_check =          smack_ptrace_access_check,
-diff -urNp linux-3.0.4/security/tomoyo/tomoyo.c linux-3.0.4/security/tomoyo/tomoyo.c
---- linux-3.0.4/security/tomoyo/tomoyo.c       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/security/tomoyo/tomoyo.c       2011-08-23 21:47:56.000000000 -0400
-@@ -240,7 +240,7 @@ static int tomoyo_sb_pivotroot(struct pa
+diff -urNp linux-3.1.3/security/tomoyo/tomoyo.c linux-3.1.3/security/tomoyo/tomoyo.c
+--- linux-3.1.3/security/tomoyo/tomoyo.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/security/tomoyo/tomoyo.c       2011-11-16 18:39:08.000000000 -0500
+@@ -446,7 +446,7 @@ static int tomoyo_sb_pivotroot(struct pa
   * tomoyo_security_ops is a "struct security_operations" which is used for
   * registering TOMOYO.
   */
@@ -72710,9 +76587,9 @@ diff -urNp linux-3.0.4/security/tomoyo/tomoyo.c linux-3.0.4/security/tomoyo/tomo
        .name                = "tomoyo",
        .cred_alloc_blank    = tomoyo_cred_alloc_blank,
        .cred_prepare        = tomoyo_cred_prepare,
-diff -urNp linux-3.0.4/sound/aoa/codecs/onyx.c linux-3.0.4/sound/aoa/codecs/onyx.c
---- linux-3.0.4/sound/aoa/codecs/onyx.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/sound/aoa/codecs/onyx.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/sound/aoa/codecs/onyx.c linux-3.1.3/sound/aoa/codecs/onyx.c
+--- linux-3.1.3/sound/aoa/codecs/onyx.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/aoa/codecs/onyx.c        2011-11-16 18:39:08.000000000 -0500
 @@ -54,7 +54,7 @@ struct onyx {
                                spdif_locked:1,
                                analog_locked:1,
@@ -72741,9 +76618,9 @@ diff -urNp linux-3.0.4/sound/aoa/codecs/onyx.c linux-3.0.4/sound/aoa/codecs/onyx
                onyx->spdif_locked = onyx->analog_locked = 0;
        mutex_unlock(&onyx->mutex);
  
-diff -urNp linux-3.0.4/sound/aoa/codecs/onyx.h linux-3.0.4/sound/aoa/codecs/onyx.h
---- linux-3.0.4/sound/aoa/codecs/onyx.h        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/sound/aoa/codecs/onyx.h        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/sound/aoa/codecs/onyx.h linux-3.1.3/sound/aoa/codecs/onyx.h
+--- linux-3.1.3/sound/aoa/codecs/onyx.h        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/aoa/codecs/onyx.h        2011-11-16 18:39:08.000000000 -0500
 @@ -11,6 +11,7 @@
  #include <linux/i2c.h>
  #include <asm/pmac_low_i2c.h>
@@ -72752,9 +76629,112 @@ diff -urNp linux-3.0.4/sound/aoa/codecs/onyx.h linux-3.0.4/sound/aoa/codecs/onyx
  
  /* PCM3052 register definitions */
  
-diff -urNp linux-3.0.4/sound/core/seq/seq_device.c linux-3.0.4/sound/core/seq/seq_device.c
---- linux-3.0.4/sound/core/seq/seq_device.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/sound/core/seq/seq_device.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/sound/core/oss/pcm_oss.c linux-3.1.3/sound/core/oss/pcm_oss.c
+--- linux-3.1.3/sound/core/oss/pcm_oss.c       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/core/oss/pcm_oss.c       2011-11-16 18:39:08.000000000 -0500
+@@ -1189,10 +1189,10 @@ snd_pcm_sframes_t snd_pcm_oss_write3(str
+               if (in_kernel) {
+                       mm_segment_t fs;
+                       fs = snd_enter_user();
+-                      ret = snd_pcm_lib_write(substream, (void __force __user *)ptr, frames);
++                      ret = snd_pcm_lib_write(substream, (void __force_user *)ptr, frames);
+                       snd_leave_user(fs);
+               } else {
+-                      ret = snd_pcm_lib_write(substream, (void __force __user *)ptr, frames);
++                      ret = snd_pcm_lib_write(substream, (void __force_user *)ptr, frames);
+               }
+               if (ret != -EPIPE && ret != -ESTRPIPE)
+                       break;
+@@ -1234,10 +1234,10 @@ snd_pcm_sframes_t snd_pcm_oss_read3(stru
+               if (in_kernel) {
+                       mm_segment_t fs;
+                       fs = snd_enter_user();
+-                      ret = snd_pcm_lib_read(substream, (void __force __user *)ptr, frames);
++                      ret = snd_pcm_lib_read(substream, (void __force_user *)ptr, frames);
+                       snd_leave_user(fs);
+               } else {
+-                      ret = snd_pcm_lib_read(substream, (void __force __user *)ptr, frames);
++                      ret = snd_pcm_lib_read(substream, (void __force_user *)ptr, frames);
+               }
+               if (ret == -EPIPE) {
+                       if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) {
+@@ -1337,7 +1337,7 @@ static ssize_t snd_pcm_oss_write2(struct
+               struct snd_pcm_plugin_channel *channels;
+               size_t oss_frame_bytes = (runtime->oss.plugin_first->src_width * runtime->oss.plugin_first->src_format.channels) / 8;
+               if (!in_kernel) {
+-                      if (copy_from_user(runtime->oss.buffer, (const char __force __user *)buf, bytes))
++                      if (copy_from_user(runtime->oss.buffer, (const char __force_user *)buf, bytes))
+                               return -EFAULT;
+                       buf = runtime->oss.buffer;
+               }
+@@ -1407,7 +1407,7 @@ static ssize_t snd_pcm_oss_write1(struct
+                       }
+               } else {
+                       tmp = snd_pcm_oss_write2(substream,
+-                                               (const char __force *)buf,
++                                               (const char __force_kernel *)buf,
+                                                runtime->oss.period_bytes, 0);
+                       if (tmp <= 0)
+                               goto err;
+@@ -1433,7 +1433,7 @@ static ssize_t snd_pcm_oss_read2(struct 
+       struct snd_pcm_runtime *runtime = substream->runtime;
+       snd_pcm_sframes_t frames, frames1;
+ #ifdef CONFIG_SND_PCM_OSS_PLUGINS
+-      char __user *final_dst = (char __force __user *)buf;
++      char __user *final_dst = (char __force_user *)buf;
+       if (runtime->oss.plugin_first) {
+               struct snd_pcm_plugin_channel *channels;
+               size_t oss_frame_bytes = (runtime->oss.plugin_last->dst_width * runtime->oss.plugin_last->dst_format.channels) / 8;
+@@ -1495,7 +1495,7 @@ static ssize_t snd_pcm_oss_read1(struct 
+                       xfer += tmp;
+                       runtime->oss.buffer_used -= tmp;
+               } else {
+-                      tmp = snd_pcm_oss_read2(substream, (char __force *)buf,
++                      tmp = snd_pcm_oss_read2(substream, (char __force_kernel *)buf,
+                                               runtime->oss.period_bytes, 0);
+                       if (tmp <= 0)
+                               goto err;
+@@ -1663,7 +1663,7 @@ static int snd_pcm_oss_sync(struct snd_p
+                                                                  size1);
+                                       size1 /= runtime->channels; /* frames */
+                                       fs = snd_enter_user();
+-                                      snd_pcm_lib_write(substream, (void __force __user *)runtime->oss.buffer, size1);
++                                      snd_pcm_lib_write(substream, (void __force_user *)runtime->oss.buffer, size1);
+                                       snd_leave_user(fs);
+                               }
+                       } else if (runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) {
+diff -urNp linux-3.1.3/sound/core/pcm_compat.c linux-3.1.3/sound/core/pcm_compat.c
+--- linux-3.1.3/sound/core/pcm_compat.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/core/pcm_compat.c        2011-11-16 18:39:08.000000000 -0500
+@@ -31,7 +31,7 @@ static int snd_pcm_ioctl_delay_compat(st
+       int err;
+       fs = snd_enter_user();
+-      err = snd_pcm_delay(substream, &delay);
++      err = snd_pcm_delay(substream, (snd_pcm_sframes_t __force_user *)&delay);
+       snd_leave_user(fs);
+       if (err < 0)
+               return err;
+diff -urNp linux-3.1.3/sound/core/pcm_native.c linux-3.1.3/sound/core/pcm_native.c
+--- linux-3.1.3/sound/core/pcm_native.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/core/pcm_native.c        2011-11-16 18:39:08.000000000 -0500
+@@ -2770,11 +2770,11 @@ int snd_pcm_kernel_ioctl(struct snd_pcm_
+       switch (substream->stream) {
+       case SNDRV_PCM_STREAM_PLAYBACK:
+               result = snd_pcm_playback_ioctl1(NULL, substream, cmd,
+-                                               (void __user *)arg);
++                                               (void __force_user *)arg);
+               break;
+       case SNDRV_PCM_STREAM_CAPTURE:
+               result = snd_pcm_capture_ioctl1(NULL, substream, cmd,
+-                                              (void __user *)arg);
++                                              (void __force_user *)arg);
+               break;
+       default:
+               result = -EINVAL;
+diff -urNp linux-3.1.3/sound/core/seq/seq_device.c linux-3.1.3/sound/core/seq/seq_device.c
+--- linux-3.1.3/sound/core/seq/seq_device.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/core/seq/seq_device.c    2011-11-16 18:39:08.000000000 -0500
 @@ -63,7 +63,7 @@ struct ops_list {
        int argsize;            /* argument size */
  
@@ -72791,9 +76771,9 @@ diff -urNp linux-3.0.4/sound/core/seq/seq_device.c linux-3.0.4/sound/core/seq/se
                dev->status = SNDRV_SEQ_DEVICE_FREE;
                dev->driver_data = NULL;
                ops->num_init_devices--;
-diff -urNp linux-3.0.4/sound/drivers/mts64.c linux-3.0.4/sound/drivers/mts64.c
---- linux-3.0.4/sound/drivers/mts64.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/sound/drivers/mts64.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/sound/drivers/mts64.c linux-3.1.3/sound/drivers/mts64.c
+--- linux-3.1.3/sound/drivers/mts64.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/drivers/mts64.c  2011-11-16 18:39:08.000000000 -0500
 @@ -28,6 +28,7 @@
  #include <sound/initval.h>
  #include <sound/rawmidi.h>
@@ -72850,9 +76830,9 @@ diff -urNp linux-3.0.4/sound/drivers/mts64.c linux-3.0.4/sound/drivers/mts64.c
  
        return 0;
  }
-diff -urNp linux-3.0.4/sound/drivers/opl4/opl4_lib.c linux-3.0.4/sound/drivers/opl4/opl4_lib.c
---- linux-3.0.4/sound/drivers/opl4/opl4_lib.c  2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/sound/drivers/opl4/opl4_lib.c  2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/sound/drivers/opl4/opl4_lib.c linux-3.1.3/sound/drivers/opl4/opl4_lib.c
+--- linux-3.1.3/sound/drivers/opl4/opl4_lib.c  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/drivers/opl4/opl4_lib.c  2011-11-16 18:39:08.000000000 -0500
 @@ -28,7 +28,7 @@ MODULE_AUTHOR("Clemens Ladisch <clemens@
  MODULE_DESCRIPTION("OPL4 driver");
  MODULE_LICENSE("GPL");
@@ -72862,9 +76842,9 @@ diff -urNp linux-3.0.4/sound/drivers/opl4/opl4_lib.c linux-3.0.4/sound/drivers/o
  {
        int timeout = 10;
        while ((inb(opl4->fm_port) & OPL4_STATUS_BUSY) && --timeout > 0)
-diff -urNp linux-3.0.4/sound/drivers/portman2x4.c linux-3.0.4/sound/drivers/portman2x4.c
---- linux-3.0.4/sound/drivers/portman2x4.c     2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/sound/drivers/portman2x4.c     2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/sound/drivers/portman2x4.c linux-3.1.3/sound/drivers/portman2x4.c
+--- linux-3.1.3/sound/drivers/portman2x4.c     2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/drivers/portman2x4.c     2011-11-16 18:39:08.000000000 -0500
 @@ -47,6 +47,7 @@
  #include <sound/initval.h>
  #include <sound/rawmidi.h>
@@ -72882,9 +76862,9 @@ diff -urNp linux-3.0.4/sound/drivers/portman2x4.c linux-3.0.4/sound/drivers/port
        int mode[PORTMAN_NUM_INPUT_PORTS];
        struct snd_rawmidi_substream *midi_input[PORTMAN_NUM_INPUT_PORTS];
  };
-diff -urNp linux-3.0.4/sound/firewire/amdtp.c linux-3.0.4/sound/firewire/amdtp.c
---- linux-3.0.4/sound/firewire/amdtp.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/sound/firewire/amdtp.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/sound/firewire/amdtp.c linux-3.1.3/sound/firewire/amdtp.c
+--- linux-3.1.3/sound/firewire/amdtp.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/firewire/amdtp.c 2011-11-16 18:39:08.000000000 -0500
 @@ -371,7 +371,7 @@ static void queue_out_packet(struct amdt
                ptr = s->pcm_buffer_pointer + data_blocks;
                if (ptr >= pcm->runtime->buffer_size)
@@ -72903,9 +76883,9 @@ diff -urNp linux-3.0.4/sound/firewire/amdtp.c linux-3.0.4/sound/firewire/amdtp.c
                (fw_parent_device(s->unit)->card->node_id & 0x3f) << 24;
  }
  EXPORT_SYMBOL(amdtp_out_stream_update);
-diff -urNp linux-3.0.4/sound/firewire/amdtp.h linux-3.0.4/sound/firewire/amdtp.h
---- linux-3.0.4/sound/firewire/amdtp.h 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/sound/firewire/amdtp.h 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/sound/firewire/amdtp.h linux-3.1.3/sound/firewire/amdtp.h
+--- linux-3.1.3/sound/firewire/amdtp.h 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/firewire/amdtp.h 2011-11-16 18:39:08.000000000 -0500
 @@ -146,7 +146,7 @@ static inline void amdtp_out_stream_pcm_
  static inline void amdtp_out_stream_pcm_trigger(struct amdtp_out_stream *s,
                                                struct snd_pcm_substream *pcm)
@@ -72915,9 +76895,9 @@ diff -urNp linux-3.0.4/sound/firewire/amdtp.h linux-3.0.4/sound/firewire/amdtp.h
  }
  
  /**
-diff -urNp linux-3.0.4/sound/firewire/isight.c linux-3.0.4/sound/firewire/isight.c
---- linux-3.0.4/sound/firewire/isight.c        2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/sound/firewire/isight.c        2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/sound/firewire/isight.c linux-3.1.3/sound/firewire/isight.c
+--- linux-3.1.3/sound/firewire/isight.c        2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/firewire/isight.c        2011-11-16 18:39:08.000000000 -0500
 @@ -97,7 +97,7 @@ static void isight_update_pointers(struc
        ptr += count;
        if (ptr >= runtime->buffer_size)
@@ -72958,9 +76938,9 @@ diff -urNp linux-3.0.4/sound/firewire/isight.c linux-3.0.4/sound/firewire/isight
                break;
        default:
                return -EINVAL;
-diff -urNp linux-3.0.4/sound/isa/cmi8330.c linux-3.0.4/sound/isa/cmi8330.c
---- linux-3.0.4/sound/isa/cmi8330.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/sound/isa/cmi8330.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/sound/isa/cmi8330.c linux-3.1.3/sound/isa/cmi8330.c
+--- linux-3.1.3/sound/isa/cmi8330.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/isa/cmi8330.c    2011-11-16 18:39:08.000000000 -0500
 @@ -172,7 +172,7 @@ struct snd_cmi8330 {
  
        struct snd_pcm *pcm;
@@ -72970,9 +76950,9 @@ diff -urNp linux-3.0.4/sound/isa/cmi8330.c linux-3.0.4/sound/isa/cmi8330.c
                snd_pcm_open_callback_t open;
                void *private_data; /* sb or wss */
        } streams[2];
-diff -urNp linux-3.0.4/sound/oss/sb_audio.c linux-3.0.4/sound/oss/sb_audio.c
---- linux-3.0.4/sound/oss/sb_audio.c   2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/sound/oss/sb_audio.c   2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/sound/oss/sb_audio.c linux-3.1.3/sound/oss/sb_audio.c
+--- linux-3.1.3/sound/oss/sb_audio.c   2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/oss/sb_audio.c   2011-11-16 18:39:08.000000000 -0500
 @@ -901,7 +901,7 @@ sb16_copy_from_user(int dev,
                buf16 = (signed short *)(localbuf + localoffs);
                while (c)
@@ -72982,9 +76962,9 @@ diff -urNp linux-3.0.4/sound/oss/sb_audio.c linux-3.0.4/sound/oss/sb_audio.c
                        if (copy_from_user(lbuf8,
                                           userbuf+useroffs + p,
                                           locallen))
-diff -urNp linux-3.0.4/sound/oss/swarm_cs4297a.c linux-3.0.4/sound/oss/swarm_cs4297a.c
---- linux-3.0.4/sound/oss/swarm_cs4297a.c      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/sound/oss/swarm_cs4297a.c      2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/sound/oss/swarm_cs4297a.c linux-3.1.3/sound/oss/swarm_cs4297a.c
+--- linux-3.1.3/sound/oss/swarm_cs4297a.c      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/oss/swarm_cs4297a.c      2011-11-16 18:39:08.000000000 -0500
 @@ -2606,7 +2606,6 @@ static int __init cs4297a_init(void)
  {
        struct cs4297a_state *s;
@@ -73019,10 +76999,10 @@ diff -urNp linux-3.0.4/sound/oss/swarm_cs4297a.c linux-3.0.4/sound/oss/swarm_cs4
  
                  list_add(&s->list, &cs4297a_devs);
  
-diff -urNp linux-3.0.4/sound/pci/hda/hda_codec.h linux-3.0.4/sound/pci/hda/hda_codec.h
---- linux-3.0.4/sound/pci/hda/hda_codec.h      2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/sound/pci/hda/hda_codec.h      2011-08-23 21:47:56.000000000 -0400
-@@ -615,7 +615,7 @@ struct hda_bus_ops {
+diff -urNp linux-3.1.3/sound/pci/hda/hda_codec.h linux-3.1.3/sound/pci/hda/hda_codec.h
+--- linux-3.1.3/sound/pci/hda/hda_codec.h      2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/pci/hda/hda_codec.h      2011-11-16 18:39:08.000000000 -0500
+@@ -611,7 +611,7 @@ struct hda_bus_ops {
        /* notify power-up/down from codec to controller */
        void (*pm_notify)(struct hda_bus *bus);
  #endif
@@ -73057,9 +77037,9 @@ diff -urNp linux-3.0.4/sound/pci/hda/hda_codec.h linux-3.0.4/sound/pci/hda/hda_c
  
        /* PCM to create, set by patch_ops.build_pcms callback */
        unsigned int num_pcms;
-diff -urNp linux-3.0.4/sound/pci/ice1712/ice1712.h linux-3.0.4/sound/pci/ice1712/ice1712.h
---- linux-3.0.4/sound/pci/ice1712/ice1712.h    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/sound/pci/ice1712/ice1712.h    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/sound/pci/ice1712/ice1712.h linux-3.1.3/sound/pci/ice1712/ice1712.h
+--- linux-3.1.3/sound/pci/ice1712/ice1712.h    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/pci/ice1712/ice1712.h    2011-11-16 18:39:08.000000000 -0500
 @@ -269,7 +269,7 @@ struct snd_ak4xxx_private {
        unsigned int mask_flags;        /* total mask bits */
        struct snd_akm4xxx_ops {
@@ -73078,9 +77058,9 @@ diff -urNp linux-3.0.4/sound/pci/ice1712/ice1712.h linux-3.0.4/sound/pci/ice1712
  };
  
  
-diff -urNp linux-3.0.4/sound/pci/ymfpci/ymfpci_main.c linux-3.0.4/sound/pci/ymfpci/ymfpci_main.c
---- linux-3.0.4/sound/pci/ymfpci/ymfpci_main.c 2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/sound/pci/ymfpci/ymfpci_main.c 2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/sound/pci/ymfpci/ymfpci_main.c linux-3.1.3/sound/pci/ymfpci/ymfpci_main.c
+--- linux-3.1.3/sound/pci/ymfpci/ymfpci_main.c 2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/pci/ymfpci/ymfpci_main.c 2011-11-16 18:39:08.000000000 -0500
 @@ -202,8 +202,8 @@ static void snd_ymfpci_hw_stop(struct sn
                if ((snd_ymfpci_readl(chip, YDSXGR_STATUS) & 2) == 0)
                        break;
@@ -73121,29 +77101,21 @@ diff -urNp linux-3.0.4/sound/pci/ymfpci/ymfpci_main.c linux-3.0.4/sound/pci/ymfp
        chip->card = card;
        chip->pci = pci;
        chip->irq = -1;
-diff -urNp linux-3.0.4/sound/soc/soc-core.c linux-3.0.4/sound/soc/soc-core.c
---- linux-3.0.4/sound/soc/soc-core.c   2011-09-02 18:11:21.000000000 -0400
-+++ linux-3.0.4/sound/soc/soc-core.c   2011-08-23 21:47:56.000000000 -0400
-@@ -1021,7 +1021,7 @@ static snd_pcm_uframes_t soc_pcm_pointer
+diff -urNp linux-3.1.3/sound/soc/soc-pcm.c linux-3.1.3/sound/soc/soc-pcm.c
+--- linux-3.1.3/sound/soc/soc-pcm.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/soc/soc-pcm.c    2011-11-16 18:39:08.000000000 -0500
+@@ -568,7 +568,7 @@ static snd_pcm_uframes_t soc_pcm_pointer
  }
  
  /* ASoC PCM operations */
 -static struct snd_pcm_ops soc_pcm_ops = {
 +static snd_pcm_ops_no_const soc_pcm_ops = {
        .open           = soc_pcm_open,
-       .close          = soc_codec_close,
+       .close          = soc_pcm_close,
        .hw_params      = soc_pcm_hw_params,
-@@ -2128,6 +2128,7 @@ static int soc_new_pcm(struct snd_soc_pc
-       rtd->pcm = pcm;
-       pcm->private_data = rtd;
-       if (platform->driver->ops) {
-+              /* this whole logic is broken... */
-               soc_pcm_ops.mmap = platform->driver->ops->mmap;
-               soc_pcm_ops.pointer = platform->driver->ops->pointer;
-               soc_pcm_ops.ioctl = platform->driver->ops->ioctl;
-diff -urNp linux-3.0.4/sound/usb/card.h linux-3.0.4/sound/usb/card.h
---- linux-3.0.4/sound/usb/card.h       2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/sound/usb/card.h       2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/sound/usb/card.h linux-3.1.3/sound/usb/card.h
+--- linux-3.1.3/sound/usb/card.h       2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/sound/usb/card.h       2011-11-16 18:39:08.000000000 -0500
 @@ -44,6 +44,7 @@ struct snd_urb_ops {
        int (*prepare_sync)(struct snd_usb_substream *subs, struct snd_pcm_runtime *runtime, struct urb *u);
        int (*retire_sync)(struct snd_usb_substream *subs, struct snd_pcm_runtime *runtime, struct urb *u);
@@ -73161,10 +77133,185 @@ diff -urNp linux-3.0.4/sound/usb/card.h linux-3.0.4/sound/usb/card.h
  };
  
  struct snd_usb_stream {
-diff -urNp linux-3.0.4/tools/gcc/constify_plugin.c linux-3.0.4/tools/gcc/constify_plugin.c
---- linux-3.0.4/tools/gcc/constify_plugin.c    1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/tools/gcc/constify_plugin.c    2011-08-30 18:23:52.000000000 -0400
-@@ -0,0 +1,293 @@
+diff -urNp linux-3.1.3/tools/gcc/checker_plugin.c linux-3.1.3/tools/gcc/checker_plugin.c
+--- linux-3.1.3/tools/gcc/checker_plugin.c     1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/tools/gcc/checker_plugin.c     2011-11-16 18:39:08.000000000 -0500
+@@ -0,0 +1,171 @@
++/*
++ * Copyright 2011 by the PaX Team <pageexec@freemail.hu>
++ * Licensed under the GPL v2
++ *
++ * Note: the choice of the license means that the compilation process is
++ *       NOT 'eligible' as defined by gcc's library exception to the GPL v3,
++ *       but for the kernel it doesn't matter since it doesn't link against
++ *       any of the gcc libraries
++ *
++ * gcc plugin to implement various sparse (source code checker) features
++ *
++ * TODO:
++ * - define separate __iomem, __percpu and __rcu address spaces (lots of code to patch)
++ *
++ * BUGS:
++ * - none known
++ */
++#include "gcc-plugin.h"
++#include "config.h"
++#include "system.h"
++#include "coretypes.h"
++#include "tree.h"
++#include "tree-pass.h"
++#include "flags.h"
++#include "intl.h"
++#include "toplev.h"
++#include "plugin.h"
++//#include "expr.h" where are you...
++#include "diagnostic.h"
++#include "plugin-version.h"
++#include "tm.h"
++#include "function.h"
++#include "basic-block.h"
++#include "gimple.h"
++#include "rtl.h"
++#include "emit-rtl.h"
++#include "tree-flow.h"
++#include "target.h"
++
++extern void c_register_addr_space (const char *str, addr_space_t as);
++extern enum machine_mode default_addr_space_pointer_mode (addr_space_t);
++extern enum machine_mode default_addr_space_address_mode (addr_space_t);
++extern bool default_addr_space_valid_pointer_mode(enum machine_mode mode, addr_space_t as);
++extern bool default_addr_space_legitimate_address_p(enum machine_mode mode, rtx mem, bool strict, addr_space_t as);
++extern rtx default_addr_space_legitimize_address(rtx x, rtx oldx, enum machine_mode mode, addr_space_t as);
++
++extern void print_gimple_stmt(FILE *, gimple, int, int);
++extern rtx emit_move_insn(rtx x, rtx y);
++
++int plugin_is_GPL_compatible;
++
++static struct plugin_info checker_plugin_info = {
++      .version        = "201111150100",
++};
++
++#define ADDR_SPACE_KERNEL             0
++#define ADDR_SPACE_FORCE_KERNEL               1
++#define ADDR_SPACE_USER                       2
++#define ADDR_SPACE_FORCE_USER         3
++#define ADDR_SPACE_IOMEM              0
++#define ADDR_SPACE_FORCE_IOMEM                0
++#define ADDR_SPACE_PERCPU             0
++#define ADDR_SPACE_FORCE_PERCPU               0
++#define ADDR_SPACE_RCU                        0
++#define ADDR_SPACE_FORCE_RCU          0
++
++static enum machine_mode checker_addr_space_pointer_mode(addr_space_t addrspace)
++{
++      return default_addr_space_pointer_mode(ADDR_SPACE_GENERIC);
++}
++
++static enum machine_mode checker_addr_space_address_mode(addr_space_t addrspace)
++{
++      return default_addr_space_address_mode(ADDR_SPACE_GENERIC);
++}
++
++static bool checker_addr_space_valid_pointer_mode(enum machine_mode mode, addr_space_t as)
++{
++      return default_addr_space_valid_pointer_mode(mode, as);
++}
++
++static bool checker_addr_space_legitimate_address_p(enum machine_mode mode, rtx mem, bool strict, addr_space_t as)
++{
++      return default_addr_space_legitimate_address_p(mode, mem, strict, ADDR_SPACE_GENERIC);
++}
++
++static rtx checker_addr_space_legitimize_address(rtx x, rtx oldx, enum machine_mode mode, addr_space_t as)
++{
++      return default_addr_space_legitimize_address(x, oldx, mode, as);
++}
++
++static bool checker_addr_space_subset_p(addr_space_t subset, addr_space_t superset)
++{
++      if (subset == ADDR_SPACE_FORCE_KERNEL && superset == ADDR_SPACE_KERNEL)
++              return true;
++
++      if (subset == ADDR_SPACE_FORCE_USER && superset == ADDR_SPACE_USER)
++              return true;
++
++      if (subset == ADDR_SPACE_FORCE_IOMEM && superset == ADDR_SPACE_IOMEM)
++              return true;
++
++      if (subset == ADDR_SPACE_KERNEL && superset == ADDR_SPACE_FORCE_USER)
++              return true;
++
++      if (subset == ADDR_SPACE_KERNEL && superset == ADDR_SPACE_FORCE_IOMEM)
++              return true;
++
++      if (subset == ADDR_SPACE_USER && superset == ADDR_SPACE_FORCE_KERNEL)
++              return true;
++
++      if (subset == ADDR_SPACE_IOMEM && superset == ADDR_SPACE_FORCE_KERNEL)
++              return true;
++
++      return subset == superset;
++}
++
++static rtx checker_addr_space_convert(rtx op, tree from_type, tree to_type)
++{
++//    addr_space_t from_as = TYPE_ADDR_SPACE(TREE_TYPE(from_type));
++//    addr_space_t to_as = TYPE_ADDR_SPACE(TREE_TYPE(to_type));
++
++      return op;
++}
++
++static void register_checker_address_spaces(void *event_data, void *data)
++{
++      c_register_addr_space("__kernel", ADDR_SPACE_KERNEL);
++      c_register_addr_space("__force_kernel", ADDR_SPACE_FORCE_KERNEL);
++      c_register_addr_space("__user", ADDR_SPACE_USER);
++      c_register_addr_space("__force_user", ADDR_SPACE_FORCE_USER);
++//    c_register_addr_space("__iomem", ADDR_SPACE_IOMEM);
++//    c_register_addr_space("__force_iomem", ADDR_SPACE_FORCE_IOMEM);
++//    c_register_addr_space("__percpu", ADDR_SPACE_PERCPU);
++//    c_register_addr_space("__force_percpu", ADDR_SPACE_FORCE_PERCPU);
++//    c_register_addr_space("__rcu", ADDR_SPACE_RCU);
++//    c_register_addr_space("__force_rcu", ADDR_SPACE_FORCE_RCU);
++
++      targetm.addr_space.pointer_mode         = checker_addr_space_pointer_mode;
++      targetm.addr_space.address_mode         = checker_addr_space_address_mode;
++      targetm.addr_space.valid_pointer_mode   = checker_addr_space_valid_pointer_mode;
++      targetm.addr_space.legitimate_address_p = checker_addr_space_legitimate_address_p;
++//    targetm.addr_space.legitimize_address   = checker_addr_space_legitimize_address;
++      targetm.addr_space.subset_p             = checker_addr_space_subset_p;
++      targetm.addr_space.convert              = checker_addr_space_convert;
++}
++
++int plugin_init(struct plugin_name_args *plugin_info, struct plugin_gcc_version *version)
++{
++      const char * const plugin_name = plugin_info->base_name;
++      const int argc = plugin_info->argc;
++      const struct plugin_argument * const argv = plugin_info->argv;
++      int i;
++
++      if (!plugin_default_version_check(version, &gcc_version)) {
++              error(G_("incompatible gcc/plugin versions"));
++              return 1;
++      }
++
++      register_callback(plugin_name, PLUGIN_INFO, NULL, &checker_plugin_info);
++
++      for (i = 0; i < argc; ++i)
++              error(G_("unkown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key);
++
++      if (TARGET_64BIT == 0)
++              return 0;
++
++      register_callback (plugin_name, PLUGIN_PRAGMAS, register_checker_address_spaces, NULL);
++
++      return 0;
++}
+diff -urNp linux-3.1.3/tools/gcc/constify_plugin.c linux-3.1.3/tools/gcc/constify_plugin.c
+--- linux-3.1.3/tools/gcc/constify_plugin.c    1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/tools/gcc/constify_plugin.c    2011-11-16 18:39:08.000000000 -0500
+@@ -0,0 +1,303 @@
 +/*
 + * Copyright 2011 by Emese Revfy <re.emese@gmail.com>
 + * Copyright 2011 by PaX Team <pageexec@freemail.hu>
@@ -73186,22 +77333,26 @@ diff -urNp linux-3.0.4/tools/gcc/constify_plugin.c linux-3.0.4/tools/gcc/constif
 +#include "coretypes.h"
 +#include "tree.h"
 +#include "tree-pass.h"
++#include "flags.h"
 +#include "intl.h"
++#include "toplev.h"
++#include "plugin.h"
++#include "diagnostic.h"
 +#include "plugin-version.h"
 +#include "tm.h"
-+#include "toplev.h"
 +#include "function.h"
++#include "basic-block.h"
++#include "gimple.h"
++#include "rtl.h"
++#include "emit-rtl.h"
 +#include "tree-flow.h"
-+#include "plugin.h"
-+#include "diagnostic.h"
-+//#include "c-tree.h"
 +
 +#define C_TYPE_FIELDS_READONLY(TYPE) TREE_LANG_FLAG_1(TYPE)
 +
 +int plugin_is_GPL_compatible;
 +
 +static struct plugin_info const_plugin_info = {
-+      .version        = "20110826",
++      .version        = "201111150100",
 +      .help           = "no-constify\tturn off constification\n",
 +};
 +
@@ -73295,7 +77446,10 @@ diff -urNp linux-3.0.4/tools/gcc/constify_plugin.c linux-3.0.4/tools/gcc/constif
 +      .decl_required          = false,
 +      .type_required          = false,
 +      .function_type_required = false,
-+      .handler                = handle_no_const_attribute
++      .handler                = handle_no_const_attribute,
++#if __GNUC__ > 4 || __GNUC_MINOR__ >= 7
++      .affects_type_identity  = true
++#endif
 +};
 +
 +static struct attribute_spec do_const_attr = {
@@ -73305,7 +77459,10 @@ diff -urNp linux-3.0.4/tools/gcc/constify_plugin.c linux-3.0.4/tools/gcc/constif
 +      .decl_required          = false,
 +      .type_required          = false,
 +      .function_type_required = false,
-+      .handler                = handle_do_const_attribute
++      .handler                = handle_do_const_attribute,
++#if __GNUC__ > 4 || __GNUC_MINOR__ >= 7
++      .affects_type_identity  = true
++#endif
 +};
 +
 +static void register_attributes(void *event_data, void *data)
@@ -73458,10 +77615,10 @@ diff -urNp linux-3.0.4/tools/gcc/constify_plugin.c linux-3.0.4/tools/gcc/constif
 +
 +      return 0;
 +}
-diff -urNp linux-3.0.4/tools/gcc/kallocstat_plugin.c linux-3.0.4/tools/gcc/kallocstat_plugin.c
---- linux-3.0.4/tools/gcc/kallocstat_plugin.c  1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/tools/gcc/kallocstat_plugin.c  2011-09-17 00:53:44.000000000 -0400
-@@ -0,0 +1,165 @@
+diff -urNp linux-3.1.3/tools/gcc/kallocstat_plugin.c linux-3.1.3/tools/gcc/kallocstat_plugin.c
+--- linux-3.1.3/tools/gcc/kallocstat_plugin.c  1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/tools/gcc/kallocstat_plugin.c  2011-11-16 18:39:08.000000000 -0500
+@@ -0,0 +1,167 @@
 +/*
 + * Copyright 2011 by the PaX Team <pageexec@freemail.hu>
 + * Licensed under the GPL v2
@@ -73484,17 +77641,19 @@ diff -urNp linux-3.0.4/tools/gcc/kallocstat_plugin.c linux-3.0.4/tools/gcc/kallo
 +#include "coretypes.h"
 +#include "tree.h"
 +#include "tree-pass.h"
++#include "flags.h"
 +#include "intl.h"
++#include "toplev.h"
++#include "plugin.h"
++//#include "expr.h" where are you...
++#include "diagnostic.h"
 +#include "plugin-version.h"
 +#include "tm.h"
-+#include "toplev.h"
++#include "function.h"
 +#include "basic-block.h"
 +#include "gimple.h"
-+//#include "expr.h" where are you...
-+#include "diagnostic.h"
 +#include "rtl.h"
 +#include "emit-rtl.h"
-+#include "function.h"
 +
 +extern void print_gimple_stmt(FILE *, gimple, int, int);
 +
@@ -73513,7 +77672,7 @@ diff -urNp linux-3.0.4/tools/gcc/kallocstat_plugin.c linux-3.0.4/tools/gcc/kallo
 +};
 +
 +static struct plugin_info kallocstat_plugin_info = {
-+      .version        = "201109121100",
++      .version        = "201111150100",
 +};
 +
 +static unsigned int execute_kallocstat(void);
@@ -73549,10 +77708,10 @@ diff -urNp linux-3.0.4/tools/gcc/kallocstat_plugin.c linux-3.0.4/tools/gcc/kallo
 +static unsigned int execute_kallocstat(void)
 +{
 +      basic_block bb;
-+      gimple_stmt_iterator gsi;
 +
 +      // 1. loop through BBs and GIMPLE statements
 +      FOR_EACH_BB(bb) {
++              gimple_stmt_iterator gsi;
 +              for (gsi = gsi_start_bb(bb); !gsi_end_p(gsi); gsi_next(&gsi)) {
 +                      // gimple match: 
 +                      tree fndecl, size;
@@ -73627,10 +77786,10 @@ diff -urNp linux-3.0.4/tools/gcc/kallocstat_plugin.c linux-3.0.4/tools/gcc/kallo
 +
 +      return 0;
 +}
-diff -urNp linux-3.0.4/tools/gcc/kernexec_plugin.c linux-3.0.4/tools/gcc/kernexec_plugin.c
---- linux-3.0.4/tools/gcc/kernexec_plugin.c    1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/tools/gcc/kernexec_plugin.c    2011-09-19 09:16:58.000000000 -0400
-@@ -0,0 +1,265 @@
+diff -urNp linux-3.1.3/tools/gcc/kernexec_plugin.c linux-3.1.3/tools/gcc/kernexec_plugin.c
+--- linux-3.1.3/tools/gcc/kernexec_plugin.c    1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/tools/gcc/kernexec_plugin.c    2011-11-18 17:57:07.000000000 -0500
+@@ -0,0 +1,275 @@
 +/*
 + * Copyright 2011 by the PaX Team <pageexec@freemail.hu>
 + * Licensed under the GPL v2
@@ -73653,35 +77812,39 @@ diff -urNp linux-3.0.4/tools/gcc/kernexec_plugin.c linux-3.0.4/tools/gcc/kernexe
 +#include "coretypes.h"
 +#include "tree.h"
 +#include "tree-pass.h"
++#include "flags.h"
 +#include "intl.h"
++#include "toplev.h"
++#include "plugin.h"
++//#include "expr.h" where are you...
++#include "diagnostic.h"
 +#include "plugin-version.h"
 +#include "tm.h"
-+#include "toplev.h"
++#include "function.h"
 +#include "basic-block.h"
 +#include "gimple.h"
-+//#include "expr.h" where are you...
-+#include "diagnostic.h"
 +#include "rtl.h"
 +#include "emit-rtl.h"
-+#include "function.h"
 +#include "tree-flow.h"
 +
 +extern void print_gimple_stmt(FILE *, gimple, int, int);
++extern rtx emit_move_insn(rtx x, rtx y);
 +
 +int plugin_is_GPL_compatible;
 +
 +static struct plugin_info kernexec_plugin_info = {
-+      .version        = "201109191200",
++      .version        = "201111150100",
 +};
 +
 +static unsigned int execute_kernexec_fptr(void);
 +static unsigned int execute_kernexec_retaddr(void);
++static bool kernexec_cmodel_check(void);
 +
 +static struct gimple_opt_pass kernexec_fptr_pass = {
 +      .pass = {
 +              .type                   = GIMPLE_PASS,
 +              .name                   = "kernexec_fptr",
-+              .gate                   = NULL,
++              .gate                   = kernexec_cmodel_check,
 +              .execute                = execute_kernexec_fptr,
 +              .sub                    = NULL,
 +              .next                   = NULL,
@@ -73699,7 +77862,7 @@ diff -urNp linux-3.0.4/tools/gcc/kernexec_plugin.c linux-3.0.4/tools/gcc/kernexe
 +      .pass = {
 +              .type                   = RTL_PASS,
 +              .name                   = "kernexec_retaddr",
-+              .gate                   = NULL,
++              .gate                   = kernexec_cmodel_check,
 +              .execute                = execute_kernexec_retaddr,
 +              .sub                    = NULL,
 +              .next                   = NULL,
@@ -73709,10 +77872,28 @@ diff -urNp linux-3.0.4/tools/gcc/kernexec_plugin.c linux-3.0.4/tools/gcc/kernexe
 +              .properties_provided    = 0,
 +              .properties_destroyed   = 0,
 +              .todo_flags_start       = 0,
-+              .todo_flags_finish      = TODO_dump_func
++              .todo_flags_finish      = TODO_dump_func | TODO_ggc_collect
 +      }
 +};
 +
++static bool kernexec_cmodel_check(void)
++{
++      tree section;
++
++      if (ix86_cmodel != CM_KERNEL)
++              return false;
++
++      section = lookup_attribute("section", DECL_ATTRIBUTES(current_function_decl));
++      if (!section || !TREE_VALUE(section))
++              return true;
++
++      section = TREE_VALUE(TREE_VALUE(section));
++      if (strncmp(TREE_STRING_POINTER(section), ".vsyscall_", 10))
++              return true;
++
++      return false;
++}
++
 +/*
 + * add special KERNEXEC instrumentation: force MSB of fptr to 1, which will produce
 + * a non-canonical address from a userland ptr and will just trigger a GPF on dereference
@@ -73731,18 +77912,14 @@ diff -urNp linux-3.0.4/tools/gcc/kernexec_plugin.c linux-3.0.4/tools/gcc/kernexe
 +      mark_sym_for_renaming(intptr);
 +      assign_intptr = gimple_build_assign(intptr, fold_convert(long_unsigned_type_node, old_fptr));
 +      update_stmt(assign_intptr);
-+      gsi_insert_before(&gsi, assign_intptr, GSI_NEW_STMT);
-+
-+      gsi_next(&gsi);
++      gsi_insert_before(&gsi, assign_intptr, GSI_SAME_STMT);
 +
 +      // apply logical or to temporary unsigned long and bitmask
 +      kernexec_mask = build_int_cstu(long_long_unsigned_type_node, 0x8000000000000000LL);
 +//    kernexec_mask = build_int_cstu(long_long_unsigned_type_node, 0xffffffff80000000LL);
 +      assign_intptr = gimple_build_assign(intptr, fold_build2(BIT_IOR_EXPR, long_long_unsigned_type_node, intptr, kernexec_mask));
 +      update_stmt(assign_intptr);
-+      gsi_insert_before(&gsi, assign_intptr, GSI_NEW_STMT);
-+
-+      gsi_next(&gsi);
++      gsi_insert_before(&gsi, assign_intptr, GSI_SAME_STMT);
 +
 +      // cast temporary unsigned long back to a temporary fptr variable
 +      new_fptr = create_tmp_var(TREE_TYPE(old_fptr), NULL);
@@ -73750,9 +77927,7 @@ diff -urNp linux-3.0.4/tools/gcc/kernexec_plugin.c linux-3.0.4/tools/gcc/kernexe
 +      mark_sym_for_renaming(new_fptr);
 +      assign_new_fptr = gimple_build_assign(new_fptr, fold_convert(TREE_TYPE(old_fptr), intptr));
 +      update_stmt(assign_new_fptr);
-+      gsi_insert_before(&gsi, assign_new_fptr, GSI_NEW_STMT);
-+
-+      gsi_next(&gsi);
++      gsi_insert_before(&gsi, assign_new_fptr, GSI_SAME_STMT);
 +
 +      // replace call stmt fn with the new fptr
 +      gimple_call_set_fn(call_stmt, new_fptr);
@@ -73805,28 +77980,22 @@ diff -urNp linux-3.0.4/tools/gcc/kernexec_plugin.c linux-3.0.4/tools/gcc/kernexe
 +      return 0;
 +}
 +
-+// add special KERNEXEC instrumentation: orb $0x80,7(%rsp) just before retn
++// add special KERNEXEC instrumentation: btsq $63,(%rsp) just before retn
 +static void kernexec_instrument_retaddr(rtx insn)
 +{
-+      rtx ret_addr, clob, or;
-+
-+      start_sequence();
-+
-+      // compute 7(%rsp)
-+      ret_addr = gen_rtx_MEM(QImode, gen_rtx_PLUS(Pmode, stack_pointer_rtx, GEN_INT(7)));
-+      MEM_VOLATILE_P(ret_addr) = 1;
-+
-+      // create orb $0x80,7(%rsp)
-+      or = gen_rtx_SET(VOIDmode, ret_addr, gen_rtx_IOR(QImode, ret_addr, GEN_INT(0xffffffffffffff80)));
-+      clob = gen_rtx_CLOBBER(VOIDmode, gen_rtx_REG(CCmode, FLAGS_REG));
-+
-+      // put everything together
-+      or = emit_insn(gen_rtx_PARALLEL(VOIDmode, gen_rtvec(2, or, clob)));
-+      RTX_FRAME_RELATED_P(or) = 1;
++      rtx btsq;
++      rtvec argvec, constraintvec, labelvec;
++      int line;
 +
-+      end_sequence();
-+
-+      emit_insn_before(or, insn);
++      // create asm volatile("btsq $63,(%%rsp)":::)
++      argvec = rtvec_alloc(0);
++      constraintvec = rtvec_alloc(0);
++      labelvec = rtvec_alloc(0);
++      line = expand_location(RTL_LOCATION(insn)).line;
++      btsq = gen_rtx_ASM_OPERANDS(VOIDmode, "btsq $63,(%%rsp)", empty_string, 0, argvec, constraintvec, labelvec, line);
++      MEM_VOLATILE_P(btsq) = 1;
++//    RTX_FRAME_RELATED_P(btsq) = 1; // not for ASM_OPERANDS
++      emit_insn_before(btsq, insn);
 +}
 +
 +/*
@@ -73888,7 +78057,7 @@ diff -urNp linux-3.0.4/tools/gcc/kernexec_plugin.c linux-3.0.4/tools/gcc/kernexe
 +      for (i = 0; i < argc; ++i)
 +              error(G_("unkown option '-fplugin-arg-%s-%s'"), plugin_name, argv[i].key);
 +
-+      if (TARGET_64BIT == 0 || ix86_cmodel != CM_KERNEL)
++      if (TARGET_64BIT == 0)
 +              return 0;
 +
 +      register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &kernexec_fptr_pass_info);
@@ -73896,28 +78065,35 @@ diff -urNp linux-3.0.4/tools/gcc/kernexec_plugin.c linux-3.0.4/tools/gcc/kernexe
 +
 +      return 0;
 +}
-diff -urNp linux-3.0.4/tools/gcc/Makefile linux-3.0.4/tools/gcc/Makefile
---- linux-3.0.4/tools/gcc/Makefile     1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/tools/gcc/Makefile     2011-09-17 00:53:44.000000000 -0400
-@@ -0,0 +1,14 @@
+diff -urNp linux-3.1.3/tools/gcc/Makefile linux-3.1.3/tools/gcc/Makefile
+--- linux-3.1.3/tools/gcc/Makefile     1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/tools/gcc/Makefile     2011-11-16 20:37:08.000000000 -0500
+@@ -0,0 +1,21 @@
 +#CC := gcc
 +#PLUGIN_SOURCE_FILES := pax_plugin.c
 +#PLUGIN_OBJECT_FILES := $(patsubst %.c,%.o,$(PLUGIN_SOURCE_FILES))
-+GCCPLUGINS_DIR := $(shell $(HOSTCC) -print-file-name=plugin)
++GCCPLUGINS_DIR := $(shell $(CC) -print-file-name=plugin)
 +#CFLAGS += -I$(GCCPLUGINS_DIR)/include -fPIC -O2 -Wall -W
 +
 +HOST_EXTRACFLAGS += -I$(GCCPLUGINS_DIR)/include
 +
-+hostlibs-y := stackleak_plugin.so constify_plugin.so kallocstat_plugin.so kernexec_plugin.so
++hostlibs-y := constify_plugin.so
++hostlibs-$(CONFIG_PAX_MEMORY_STACKLEAK) += stackleak_plugin.so
++hostlibs-$(CONFIG_KALLOCSTAT_PLUGIN) += kallocstat_plugin.so
++hostlibs-$(CONFIG_PAX_KERNEXEC_PLUGIN) += kernexec_plugin.so
++hostlibs-$(CONFIG_CHECKER_PLUGIN) += checker_plugin.so
++
 +always := $(hostlibs-y)
-+stackleak_plugin-objs := stackleak_plugin.o
++
 +constify_plugin-objs := constify_plugin.o
++stackleak_plugin-objs := stackleak_plugin.o
 +kallocstat_plugin-objs := kallocstat_plugin.o
 +kernexec_plugin-objs := kernexec_plugin.o
-diff -urNp linux-3.0.4/tools/gcc/stackleak_plugin.c linux-3.0.4/tools/gcc/stackleak_plugin.c
---- linux-3.0.4/tools/gcc/stackleak_plugin.c   1969-12-31 19:00:00.000000000 -0500
-+++ linux-3.0.4/tools/gcc/stackleak_plugin.c   2011-09-17 00:53:44.000000000 -0400
-@@ -0,0 +1,251 @@
++checker_plugin-objs := checker_plugin.o
+diff -urNp linux-3.1.3/tools/gcc/stackleak_plugin.c linux-3.1.3/tools/gcc/stackleak_plugin.c
+--- linux-3.1.3/tools/gcc/stackleak_plugin.c   1969-12-31 19:00:00.000000000 -0500
++++ linux-3.1.3/tools/gcc/stackleak_plugin.c   2011-11-16 18:39:08.000000000 -0500
+@@ -0,0 +1,291 @@
 +/*
 + * Copyright 2011 by the PaX Team <pageexec@freemail.hu>
 + * Licensed under the GPL v2
@@ -73943,26 +78119,31 @@ diff -urNp linux-3.0.4/tools/gcc/stackleak_plugin.c linux-3.0.4/tools/gcc/stackl
 +#include "coretypes.h"
 +#include "tree.h"
 +#include "tree-pass.h"
++#include "flags.h"
 +#include "intl.h"
++#include "toplev.h"
++#include "plugin.h"
++//#include "expr.h" where are you...
++#include "diagnostic.h"
 +#include "plugin-version.h"
 +#include "tm.h"
-+#include "toplev.h"
++#include "function.h"
 +#include "basic-block.h"
 +#include "gimple.h"
-+//#include "expr.h" where are you...
-+#include "diagnostic.h"
 +#include "rtl.h"
 +#include "emit-rtl.h"
-+#include "function.h"
++
++extern void print_gimple_stmt(FILE *, gimple, int, int);
 +
 +int plugin_is_GPL_compatible;
 +
 +static int track_frame_size = -1;
 +static const char track_function[] = "pax_track_stack";
++static const char check_function[] = "pax_check_alloca";
 +static bool init_locals;
 +
 +static struct plugin_info stackleak_plugin_info = {
-+      .version        = "201109112100",
++      .version        = "201111150100",
 +      .help           = "track-lowest-sp=nn\ttrack sp in functions whose frame size is at least nn bytes\n"
 +//                      "initialize-locals\t\tforcibly initialize all stack frames\n"
 +};
@@ -73985,7 +78166,7 @@ diff -urNp linux-3.0.4/tools/gcc/stackleak_plugin.c linux-3.0.4/tools/gcc/stackl
 +              .properties_provided    = 0,
 +              .properties_destroyed   = 0,
 +              .todo_flags_start       = 0, //TODO_verify_ssa | TODO_verify_flow | TODO_verify_stmts,
-+              .todo_flags_finish      = TODO_verify_stmts | TODO_dump_func
++              .todo_flags_finish      = TODO_verify_ssa | TODO_verify_stmts | TODO_dump_func | TODO_update_ssa
 +      }
 +};
 +
@@ -74012,63 +78193,94 @@ diff -urNp linux-3.0.4/tools/gcc/stackleak_plugin.c linux-3.0.4/tools/gcc/stackl
 +      return track_frame_size >= 0;
 +}
 +
-+static void stackleak_add_instrumentation(gimple_stmt_iterator *gsi, bool before)
++static void stackleak_check_alloca(gimple_stmt_iterator gsi)
++{
++      gimple check_alloca;
++      tree fndecl, fntype, alloca_size;
++
++      // insert call to void pax_check_alloca(unsigned long size)
++      fntype = build_function_type_list(void_type_node, long_unsigned_type_node, NULL_TREE);
++      fndecl = build_fn_decl(check_function, fntype);
++      DECL_ASSEMBLER_NAME(fndecl); // for LTO
++      alloca_size = gimple_call_arg(gsi_stmt(gsi), 0);
++      check_alloca = gimple_build_call(fndecl, 1, alloca_size);
++      gsi_insert_before(&gsi, check_alloca, GSI_CONTINUE_LINKING);
++}
++
++static void stackleak_add_instrumentation(gimple_stmt_iterator gsi)
 +{
-+      gimple call;
-+      tree fndecl, type;
++      gimple track_stack;
++      tree fndecl, fntype;
 +
 +      // insert call to void pax_track_stack(void)
-+      type = build_function_type_list(void_type_node, NULL_TREE);
-+      fndecl = build_fn_decl(track_function, type);
++      fntype = build_function_type_list(void_type_node, NULL_TREE);
++      fndecl = build_fn_decl(track_function, fntype);
 +      DECL_ASSEMBLER_NAME(fndecl); // for LTO
-+      call = gimple_build_call(fndecl, 0);
-+      if (before)
-+              gsi_insert_before(gsi, call, GSI_CONTINUE_LINKING);
-+      else
-+              gsi_insert_after(gsi, call, GSI_CONTINUE_LINKING);
++      track_stack = gimple_build_call(fndecl, 0);
++      gsi_insert_after(&gsi, track_stack, GSI_CONTINUE_LINKING);
++}
++
++#if __GNUC__ == 4 && __GNUC_MINOR__ == 5
++static bool gimple_call_builtin_p(gimple stmt, enum built_in_function code)
++{
++      tree fndecl;
++
++      if (!is_gimple_call(stmt))
++              return false;
++      fndecl = gimple_call_fndecl(stmt);
++      if (!fndecl)
++              return false;
++      if (DECL_BUILT_IN_CLASS(fndecl) != BUILT_IN_NORMAL)
++              return false;
++//    print_node(stderr, "pax", fndecl, 4);
++      return DECL_FUNCTION_CODE(fndecl) == code;
++}
++#endif
++
++static bool is_alloca(gimple stmt)
++{
++      if (gimple_call_builtin_p(stmt, BUILT_IN_ALLOCA))
++              return true;
++
++#if __GNUC__ > 4 || __GNUC_MINOR__ >= 7
++      if (gimple_call_builtin_p(stmt, BUILT_IN_ALLOCA_WITH_ALIGN))
++              return true;
++#endif
++
++      return false;
 +}
 +
 +static unsigned int execute_stackleak_tree_instrument(void)
 +{
 +      basic_block bb, entry_bb;
-+      gimple_stmt_iterator gsi;
 +      bool prologue_instrumented = false;
 +
 +      entry_bb = ENTRY_BLOCK_PTR_FOR_FUNCTION(cfun)->next_bb;
 +
 +      // 1. loop through BBs and GIMPLE statements
 +      FOR_EACH_BB(bb) {
++              gimple_stmt_iterator gsi;
 +              for (gsi = gsi_start_bb(bb); !gsi_end_p(gsi); gsi_next(&gsi)) {
 +                      // gimple match: align 8 built-in BUILT_IN_NORMAL:BUILT_IN_ALLOCA attributes <tree_list 0xb7576450>
-+                      tree fndecl;
-+                      gimple stmt = gsi_stmt(gsi);
-+
-+                      if (!is_gimple_call(stmt))
-+                              continue;
-+                      fndecl = gimple_call_fndecl(stmt);
-+                      if (!fndecl)
-+                              continue;
-+                      if (TREE_CODE(fndecl) != FUNCTION_DECL)
-+                              continue;
-+                      if (!DECL_BUILT_IN(fndecl))
-+                              continue;
-+                      if (DECL_BUILT_IN_CLASS(fndecl) != BUILT_IN_NORMAL)
-+                              continue;
-+                      if (DECL_FUNCTION_CODE(fndecl) != BUILT_IN_ALLOCA)
++                      if (!is_alloca(gsi_stmt(gsi)))
 +                              continue;
 +
-+                      // 2. insert track call after each __builtin_alloca call
-+                      stackleak_add_instrumentation(&gsi, false);
++                      // 2. insert stack overflow check before each __builtin_alloca call
++                      stackleak_check_alloca(gsi);
++
++                      // 3. insert track call after each __builtin_alloca call
++                      stackleak_add_instrumentation(gsi);
 +                      if (bb == entry_bb)
 +                              prologue_instrumented = true;
-+//                    print_node(stderr, "pax", fndecl, 4);
 +              }
 +      }
 +
-+      // 3. insert track call at the beginning
++      // 4. insert track call at the beginning
 +      if (!prologue_instrumented) {
-+              gsi = gsi_start_bb(entry_bb);
-+              stackleak_add_instrumentation(&gsi, true);
++              bb = split_block_after_labels(ENTRY_BLOCK_PTR)->dest;
++              if (dom_info_available_p(CDI_DOMINATORS))
++                      set_immediate_dominator(CDI_DOMINATORS, bb, ENTRY_BLOCK_PTR);
++              stackleak_add_instrumentation(gsi_start_bb(bb));
 +      }
 +
 +      return 0;
@@ -74105,7 +78317,11 @@ diff -urNp linux-3.0.4/tools/gcc/stackleak_plugin.c linux-3.0.4/tools/gcc/stackl
 +                      continue;
 +//            warning(0, "track_frame_size: %d %ld %d", cfun->calls_alloca, get_frame_size(), track_frame_size);
 +              // 2. delete call
-+              delete_insn_and_edges(insn);
++              insn = delete_insn_and_edges(insn);
++#if __GNUC__ > 4 || __GNUC_MINOR__ >= 7
++              if (GET_CODE(insn) == NOTE && NOTE_KIND(insn) == NOTE_INSN_CALL_ARG_LOCATION)
++                      insn = delete_insn_and_edges(insn);
++#endif
 +      }
 +
 +//    print_simple_rtl(stderr, get_insns());
@@ -74169,9 +78385,20 @@ diff -urNp linux-3.0.4/tools/gcc/stackleak_plugin.c linux-3.0.4/tools/gcc/stackl
 +
 +      return 0;
 +}
-diff -urNp linux-3.0.4/usr/gen_init_cpio.c linux-3.0.4/usr/gen_init_cpio.c
---- linux-3.0.4/usr/gen_init_cpio.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/usr/gen_init_cpio.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/tools/perf/util/include/asm/alternative-asm.h linux-3.1.3/tools/perf/util/include/asm/alternative-asm.h
+--- linux-3.1.3/tools/perf/util/include/asm/alternative-asm.h  2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/tools/perf/util/include/asm/alternative-asm.h  2011-11-16 18:39:08.000000000 -0500
+@@ -5,4 +5,7 @@
+ #define altinstruction_entry #
++      .macro pax_force_retaddr rip=0
++      .endm
++
+ #endif
+diff -urNp linux-3.1.3/usr/gen_init_cpio.c linux-3.1.3/usr/gen_init_cpio.c
+--- linux-3.1.3/usr/gen_init_cpio.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/usr/gen_init_cpio.c    2011-11-16 18:39:08.000000000 -0500
 @@ -303,7 +303,7 @@ static int cpio_mkfile(const char *name,
        int retval;
        int rc = -1;
@@ -74194,9 +78421,9 @@ diff -urNp linux-3.0.4/usr/gen_init_cpio.c linux-3.0.4/usr/gen_init_cpio.c
                 } else
                         break;
         }
-diff -urNp linux-3.0.4/virt/kvm/kvm_main.c linux-3.0.4/virt/kvm/kvm_main.c
---- linux-3.0.4/virt/kvm/kvm_main.c    2011-07-21 22:17:23.000000000 -0400
-+++ linux-3.0.4/virt/kvm/kvm_main.c    2011-08-23 21:47:56.000000000 -0400
+diff -urNp linux-3.1.3/virt/kvm/kvm_main.c linux-3.1.3/virt/kvm/kvm_main.c
+--- linux-3.1.3/virt/kvm/kvm_main.c    2011-11-11 15:19:27.000000000 -0500
++++ linux-3.1.3/virt/kvm/kvm_main.c    2011-11-16 18:39:08.000000000 -0500
 @@ -73,7 +73,7 @@ LIST_HEAD(vm_list);
  
  static cpumask_var_t cpus_hardware_enabled;
@@ -74206,7 +78433,7 @@ diff -urNp linux-3.0.4/virt/kvm/kvm_main.c linux-3.0.4/virt/kvm/kvm_main.c
  
  struct kmem_cache *kvm_vcpu_cache;
  EXPORT_SYMBOL_GPL(kvm_vcpu_cache);
-@@ -2176,7 +2176,7 @@ static void hardware_enable_nolock(void 
+@@ -2266,7 +2266,7 @@ static void hardware_enable_nolock(void 
  
        if (r) {
                cpumask_clear_cpu(cpu, cpus_hardware_enabled);
@@ -74215,7 +78442,7 @@ diff -urNp linux-3.0.4/virt/kvm/kvm_main.c linux-3.0.4/virt/kvm/kvm_main.c
                printk(KERN_INFO "kvm: enabling virtualization on "
                                 "CPU%d failed\n", cpu);
        }
-@@ -2230,10 +2230,10 @@ static int hardware_enable_all(void)
+@@ -2320,10 +2320,10 @@ static int hardware_enable_all(void)
  
        kvm_usage_count++;
        if (kvm_usage_count == 1) {
@@ -74228,7 +78455,7 @@ diff -urNp linux-3.0.4/virt/kvm/kvm_main.c linux-3.0.4/virt/kvm/kvm_main.c
                        hardware_disable_all_nolock();
                        r = -EBUSY;
                }
-@@ -2498,7 +2498,7 @@ static void kvm_sched_out(struct preempt
+@@ -2588,7 +2588,7 @@ static void kvm_sched_out(struct preempt
        kvm_arch_vcpu_put(vcpu);
  }
  
@@ -74237,7 +78464,7 @@ diff -urNp linux-3.0.4/virt/kvm/kvm_main.c linux-3.0.4/virt/kvm/kvm_main.c
                  struct module *module)
  {
        int r;
-@@ -2561,7 +2561,7 @@ int kvm_init(void *opaque, unsigned vcpu
+@@ -2651,7 +2651,7 @@ int kvm_init(void *opaque, unsigned vcpu
        if (!vcpu_align)
                vcpu_align = __alignof__(struct kvm_vcpu);
        kvm_vcpu_cache = kmem_cache_create("kvm_vcpu", vcpu_size, vcpu_align,
@@ -74246,7 +78473,7 @@ diff -urNp linux-3.0.4/virt/kvm/kvm_main.c linux-3.0.4/virt/kvm/kvm_main.c
        if (!kvm_vcpu_cache) {
                r = -ENOMEM;
                goto out_free_3;
-@@ -2571,9 +2571,11 @@ int kvm_init(void *opaque, unsigned vcpu
+@@ -2661,9 +2661,11 @@ int kvm_init(void *opaque, unsigned vcpu
        if (r)
                goto out_free;
  
diff --git a/kernel/patches/linux-2.6-defaults-acpi-video.patch b/kernel/patches/linux-2.6-defaults-acpi-video.patch
new file mode 100644 (file)
index 0000000..af883b0
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
+index d8d7596..a1b7117 100644
+--- a/drivers/acpi/video.c
++++ b/drivers/acpi/video.c
+@@ -71,7 +71,7 @@ MODULE_AUTHOR("Bruno Ducrot");
+ MODULE_DESCRIPTION("ACPI Video Driver");
+ MODULE_LICENSE("GPL");
+-static int brightness_switch_enabled = 1;
++static int brightness_switch_enabled = 0;
+ module_param(brightness_switch_enabled, bool, 0644);
+ static int acpi_video_bus_add(struct acpi_device *device);
diff --git a/kernel/patches/linux-2.6-defaults-aspm.patch b/kernel/patches/linux-2.6-defaults-aspm.patch
new file mode 100644 (file)
index 0000000..49b832d
--- /dev/null
@@ -0,0 +1,12 @@
+diff -up linux-2.6.30.noarch/drivers/pci/pcie/aspm.c.mjg linux-2.6.30.noarch/drivers/pci/pcie/aspm.c
+--- linux-2.6.30.noarch/drivers/pci/pcie/aspm.c.mjg    2009-07-16 22:01:11.000000000 +0100
++++ linux-2.6.30.noarch/drivers/pci/pcie/aspm.c        2009-07-16 22:01:30.000000000 +0100
+@@ -65,7 +65,7 @@ static LIST_HEAD(link_list);
+ #define POLICY_DEFAULT 0      /* BIOS default setting */
+ #define POLICY_PERFORMANCE 1  /* high performance */
+ #define POLICY_POWERSAVE 2    /* high power saving */
+-static int aspm_policy;
++static int aspm_policy = POLICY_POWERSAVE;
+ static const char *policy_str[] = {
+       [POLICY_DEFAULT] = "default",
+       [POLICY_PERFORMANCE] = "performance",
diff --git a/kernel/patches/linux-2.6-input-kill-stupid-messages.patch b/kernel/patches/linux-2.6-input-kill-stupid-messages.patch
new file mode 100644 (file)
index 0000000..cc1dd74
--- /dev/null
@@ -0,0 +1,32 @@
+From b2c6d55b2351152696aafb8c9bf3ec8968acf77c Mon Sep 17 00:00:00 2001
+From: Kyle McMartin <kyle@phobos.i.jkkm.org>
+Date: Mon, 29 Mar 2010 23:59:58 -0400
+Subject: linux-2.6-input-kill-stupid-messages
+
+---
+ drivers/input/keyboard/atkbd.c |    5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
+index d358ef8..38db098 100644
+--- a/drivers/input/keyboard/atkbd.c
++++ b/drivers/input/keyboard/atkbd.c
+@@ -425,11 +426,15 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
+               goto out;
+       case ATKBD_RET_ACK:
+       case ATKBD_RET_NAK:
++#if 0
++              /* Quite a few key switchers and other tools trigger this
++               * and it confuses people who can do nothing about it */
+               if (printk_ratelimit())
+                       dev_warn(&serio->dev,
+                                "Spurious %s on %s. "
+                                "Some program might be trying access hardware directly.\n",
+                                data == ATKBD_RET_ACK ? "ACK" : "NAK", serio->phys);
++#endif
+               goto out;
+       case ATKBD_RET_ERR:
+               atkbd->err_count++;
+-- 
+1.7.0.1
+
diff --git a/kernel/patches/linux-2.6-silence-acpi-blacklist.patch b/kernel/patches/linux-2.6-silence-acpi-blacklist.patch
new file mode 100644 (file)
index 0000000..c5997bb
--- /dev/null
@@ -0,0 +1,25 @@
+diff -up linux-2.6.26.noarch/drivers/acpi/blacklist.c.jx linux-2.6.26.noarch/drivers/acpi/blacklist.c
+--- linux-2.6.26.noarch/drivers/acpi/blacklist.c.jx    2008-07-13 17:51:29.000000000 -0400
++++ linux-2.6.26.noarch/drivers/acpi/blacklist.c       2008-08-12 14:21:39.000000000 -0400
+@@ -81,18 +81,18 @@ static int __init blacklist_by_year(void
+       /* Doesn't exist? Likely an old system */
+       if (!dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL)) {
+-              printk(KERN_ERR PREFIX "no DMI BIOS year, "
++              printk(KERN_INFO PREFIX "no DMI BIOS year, "
+                       "acpi=force is required to enable ACPI\n" );
+               return 1;
+       }
+       /* 0? Likely a buggy new BIOS */
+       if (year == 0) {
+-              printk(KERN_ERR PREFIX "DMI BIOS year==0, "
++              printk(KERN_INFO PREFIX "DMI BIOS year==0, "
+                       "assuming ACPI-capable machine\n" );
+               return 0;
+       }
+       if (year < CONFIG_ACPI_BLACKLIST_YEAR) {
+-              printk(KERN_ERR PREFIX "BIOS age (%d) fails cutoff (%d), "
++              printk(KERN_INFO PREFIX "BIOS age (%d) fails cutoff (%d), "
+                      "acpi=force is required to enable ACPI\n",
+                      year, CONFIG_ACPI_BLACKLIST_YEAR);
+               return 1;
diff --git a/kernel/patches/linux-2.6-silence-fbcon-logo.patch b/kernel/patches/linux-2.6-silence-fbcon-logo.patch
new file mode 100644 (file)
index 0000000..45ab733
--- /dev/null
@@ -0,0 +1,42 @@
+diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
+index 1657b96..4c5c2be 100644
+--- a/drivers/video/console/fbcon.c
++++ b/drivers/video/console/fbcon.c
+@@ -631,13 +631,15 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
+               kfree(save);
+       }
+-      if (logo_lines > vc->vc_bottom) {
+-              logo_shown = FBCON_LOGO_CANSHOW;
+-              printk(KERN_INFO
+-                     "fbcon_init: disable boot-logo (boot-logo bigger than screen).\n");
+-      } else if (logo_shown != FBCON_LOGO_DONTSHOW) {
+-              logo_shown = FBCON_LOGO_DRAW;
+-              vc->vc_top = logo_lines;
++      if (logo_shown != FBCON_LOGO_DONTSHOW) {
++              if (logo_lines > vc->vc_bottom) {
++                      logo_shown = FBCON_LOGO_CANSHOW;
++                      printk(KERN_INFO
++                             "fbcon_init: disable boot-logo (boot-logo bigger than screen).\n");
++              } else {
++                      logo_shown = FBCON_LOGO_DRAW;
++                      vc->vc_top = logo_lines;
++              }
+       }
+ }
+ #endif /* MODULE */
+@@ -3489,6 +3491,14 @@ static int __init fb_console_init(void)
+       return 0;
+ }
++static int __init quiet_logo(char *str)
++{
++      logo_shown = FBCON_LOGO_DONTSHOW;
++      return 0;
++}
++
++early_param("quiet", quiet_logo);
++
+ module_init(fb_console_init);
+ #ifdef MODULE
diff --git a/kernel/patches/linux-2.6.30-no-pcspkr-modalias.patch b/kernel/patches/linux-2.6.30-no-pcspkr-modalias.patch
new file mode 100644 (file)
index 0000000..439269c
--- /dev/null
@@ -0,0 +1,12 @@
+diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c
+index 34f4d2e..3e40c70 100644
+--- a/drivers/input/misc/pcspkr.c
++++ b/drivers/input/misc/pcspkr.c
+@@ -24,7 +24,6 @@
+ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
+ MODULE_DESCRIPTION("PC Speaker beeper driver");
+ MODULE_LICENSE("GPL");
+-MODULE_ALIAS("platform:pcspkr");
+ static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
+ {
diff --git a/kernel/systemd/cpupower.service b/kernel/systemd/cpupower.service
new file mode 100644 (file)
index 0000000..73d1038
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=Configure CPU power related settings
+After=syslog.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/cpupower frequency-set -g performance
+ExecStop=/usr/bin/cpupower frequency-set -g ondemand
+
+[Install]
+WantedBy=multi-user.target
index 5be216acf41f36e3c1a028e43de2d948dd028827..31e8e99c9531e19907de7b2239f5b8939d7cdbc9 100644 (file)
@@ -6,6 +6,7 @@
 name       = l7-protocols
 version    = 2007-11-22
 release    = 1
+arch       = noarch
 
 groups     = Networking/Firewall
 url        = http://l7-filter.sourceforge.net/
@@ -34,5 +35,4 @@ end
 
 packages
        package %{name}
-       end
 end
index 75d397c32bb3f4d98a2e64ce28c78f567827f893..63c5d9e273917ca8e808799a764d003e83b8ba75 100644 (file)
@@ -46,4 +46,8 @@ packages
        package %{name}
                requires = vim
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 2e95742b76e8b63837c7b25890a29c46faf7f0ba..a6ffab10f56422526263b9f98d90e4a99c2eeb55 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = less
 version    = 444
-release    = 1
+release    = 2
 
-groups     = Base Applications/Text
+groups     = Applications/Text
 url        = http://www.greenwoodsoftware.com/less/
 license    = GPLv3+
 summary    = A text file browser similar to more, but better.
@@ -45,5 +45,10 @@ end
 
 packages
        package %{name}
+               groups += Base
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 8ec2d82369010164b6717aa2d903c18d9cbd59f7..6b2c67ed5c96620069950b11490dd42a721fcf94 100644 (file)
@@ -34,8 +34,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 7c6cc8c3e570fe3e451019b80709a4cee81afa9e..2aae4d1f43d64e931826ae51ccba33e74a8350c1 100644 (file)
@@ -35,8 +35,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index db77f0cbd9cc9b651b56a8586b91784270d85025..e4dfc152a55b2e04e9dc2da86f8fd389eb1e3a1e 100644 (file)
@@ -36,8 +36,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index f705a4841608bb64b3c8c9b544ae029fae851eb7..12ceb7cb235973777461078779ca7054d0c64da9 100644 (file)
@@ -32,8 +32,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index d35344b12dfce78c18df04c6de428c08b8aeafdf..920f8824dcc3af10c6f9deed75d00b04c9bad9e6 100644 (file)
@@ -41,8 +41,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 084330a1159f78b87db61bc9455547dc80118f03..0fb6d2500a634a2394e0f68b782b67b074798f99 100644 (file)
@@ -40,8 +40,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index f8c2af7f71288a0aca501001cc337b89154e14bf..b1f54cc3293f33693d2a0653daf02cb3f605efa5 100644 (file)
@@ -35,8 +35,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index b5a5212c9b1b1b0f95ad0683a0255fec5a6a9488..352a36e3eca9f4ccd59da13fd30b757fb3ef0f9e 100644 (file)
@@ -33,8 +33,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 5c65c16b0ec1923eccc60d0a209305c8f306af9d..daa5ddc3196ff87ef106a8913cf7a61bd397e65e 100644 (file)
@@ -36,8 +36,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 8ceb642fc80c5d1bf8281de1063b807dbd19470c..561b92852432156e064c4faf0119891048741bc2 100644 (file)
@@ -36,8 +36,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 42236acf5446ddf427dcaf6aa0054683ef6d9d26..27ef21611332df25c346aac01fb1b732961685ac 100644 (file)
@@ -37,8 +37,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 171ca074c8a6b9821b88ce0e6dceaa48cdb94cf1..e1bea3b2a7e3f001bff1705f523a9c473432f1f9 100644 (file)
@@ -36,8 +36,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 97dba7556ce320e23bbed048efb743b2971af0ab..45337e41507bbc16043fdbe8b4398c63a7a6247f 100644 (file)
@@ -36,8 +36,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 80328acbf62eb15ca4d03725cbe9e0b032cbca65..2c0b86c94843e5cd7fbac264c03b981792fe7986 100644 (file)
@@ -39,8 +39,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index ce78a7e2430c83db38b69ebdd351d8d539e1c2f3..406d342b1e4237855c4d5af65b9a0123bfdd64c5 100644 (file)
@@ -40,8 +40,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index d4d9fdd24f9993e83b4aad6fae68949ef7f76c1a..4076515616fd26f6c68a5a04f4065655880295e6 100644 (file)
@@ -36,8 +36,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index b622d9a52b5c12017ec828bbc9ff1439019e85b3..c9ee5b430fa6468cb3cebb1df5be58915066c0ab 100644 (file)
@@ -34,8 +34,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index d03e476a9cea346545a247f5257aaf5c5d6c3a3b..d732b51db5c97e876726db36582c8bb520bd6aa3 100644 (file)
@@ -38,8 +38,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 7bc1eae33dcfb5af7b061bb6b8dc9077b0ebbe56..69bb3c936b7756c86bbe26d0de637ccf38215732 100644 (file)
@@ -38,8 +38,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 68b4c1090b9c28475c9a070c3ec11195bdd13603..d44de715df77215e149b7d96ad47f6c74eafd1c8 100644 (file)
@@ -36,8 +36,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 50fb007f05bd408d7f55d2bf72c4b828f3fd5053..8583fb284ee915b01fa6776bf5a722d98dc61773 100644 (file)
@@ -36,8 +36,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index d552db0f929810747bfa6a60f059fd7e9d0b6d91..7fbd0be662cbb143dfd7ddde513532569d87307f 100644 (file)
@@ -36,8 +36,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index b850e10e790cc36284ed63252b72f843dab9d082..5e7ad7e66f60141ffdd7f845b006b550f77edda5 100644 (file)
@@ -35,8 +35,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index e549015292e2de61327bed24ead001865fffc873..2287807878517308985d88aad8aac54b5496f671 100644 (file)
@@ -38,8 +38,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 9ea613770aeabeb27a48c55584cb789a5f274dac..30208d81bc169d241dd66f0864923350c6336296 100644 (file)
@@ -44,8 +44,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 1bd86320fcdcde03a301e6b55a74cf2cb80f44d1..ea3061568b7b2189ab6664aaec5bb7611c25eb7e 100644 (file)
@@ -47,8 +47,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index ced0ca9dcf3db856ab8ba59e425a5a783a4b1033..ec47dfdb929c6f312d8cb62e4bed4de1ab1bd4fe 100644 (file)
@@ -23,8 +23,12 @@ sources    = %{thisapp}.tar.bz2
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index d120ce01c80b2456af1d8968d9c5b06f56fbe97b..7bce1b344e13d6f3f70217e39af50968b2f67504 100644 (file)
@@ -41,8 +41,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 6bbf1157e369a8382919337ce269900fb6391a65..78c510ee9928fd70cbb5313b26a2cce8b96be8d4 100644 (file)
@@ -41,8 +41,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 057bae622336a78e57f9f60b2653163fca9b3ed1..fae925bb5f6c8c715d720f4e71ded91a327a28a9 100644 (file)
@@ -43,8 +43,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 5b5f1ed5bae03492bb6b901c7aa2671aa084d8e8..a094f1e067f499a28ad0b453d3129bb8c06e8e1e 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = libcap
-version    = 2.19
+version    = 2.22
 release    = 1
 
 groups     = System/Libraries
@@ -13,7 +13,7 @@ license    = LGPL2+
 summary    = Library for getting and setting POSIX.1e capabilities.
 
 description
-       libcap is a library for getting and setting POSIX.1e (formerly POSIX 6) \
+       libcap is a library for getting and setting POSIX.1e (formerly POSIX 6)
        draft 15 capabilities.
 end
 
@@ -45,9 +45,12 @@ end
 
 packages
        package %{name}
-       end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/libcap/patches/libcap-2.16-build-system-fixes.patch b/libcap/patches/libcap-2.16-build-system-fixes.patch
deleted file mode 100644 (file)
index e82975b..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-From 7ee197885e113878aedab58bdda80302e42aff4c Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Sun, 16 Nov 2008 09:10:31 -0500
-Subject: [PATCH] build system fixes
-
-This touches up the homebrewed build system to work much better "out of the
-box" for people.  Specifically:
-       - allow toolchain vars to be set via environment
-               - CC / BUILD_CC / AR / RANLIB
-               - CFLAGS / CPPFLAGS / LDFLAGS
-       - split CPPFLAGS out of CFLAGS
-       - break -fPIC out of global CFLAGS and only use where needed
-       - use LDLIBS for libraries, not LDFLAGS
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
----
- Make.Rules       |   28 ++++++++++++++--------------
- libcap/Makefile  |   11 ++++++-----
- pam_cap/Makefile |    6 +++---
- progs/Makefile   |    2 +-
- 4 files changed, 24 insertions(+), 23 deletions(-)
-
-diff --git a/Make.Rules b/Make.Rules
-index 6e63a5b..32cb5ea 100644
---- a/Make.Rules
-+++ b/Make.Rules
-@@ -42,27 +42,27 @@ MINOR=16
- # Compilation specifics
--KERNEL_HEADERS := $(topdir)/libcap/include
--IPATH += -I$(topdir)/libcap/include -I$(KERNEL_HEADERS)
--
--CC := gcc
--CFLAGS := -O2
--BUILD_CC := $(CC)
--BUILD_CFLAGS := $(CFLAGS) $(IPATH)
--AR := ar
--RANLIB := ranlib
--DEBUG = -g #-DDEBUG
--WARNINGS=-fPIC -Wall -Wwrite-strings \
-+CC ?= gcc
-+BUILD_CC ?= $(CC)
-+AR ?= ar
-+RANLIB ?= ranlib
-+CFLAGS ?= -O2
-+BUILD_CFLAGS ?= -O2 -pipe
-+WARNINGS=-Wall -Wwrite-strings \
-         -Wpointer-arith -Wcast-qual -Wcast-align \
-         -Wstrict-prototypes -Wmissing-prototypes \
-         -Wnested-externs -Winline -Wshadow
- LD=$(CC) -Wl,-x -shared
--LDFLAGS := #-g
-+LDFLAGS ?= #-g
--SYSTEM_HEADERS = /usr/include
-+KERNEL_HEADERS = $(topdir)/libcap/include
-+LIBCAP_CPPFLAGS = -I$(topdir)/libcap/include -I$(KERNEL_HEADERS)
-+CPPFLAGS += $(LIBCAP_CPPFLAGS)
-+BUILD_CPPFLAGS += $(LIBCAP_CPPFLAGS)
- INCS=$(topdir)/libcap/include/sys/capability.h
- LDFLAGS += -L$(topdir)/libcap
--CFLAGS += -Dlinux $(WARNINGS) $(DEBUG) $(IPATH)
-+CPPFLAGS += -Dlinux
-+CFLAGS += $(WARNINGS)
- PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
- INDENT := $(shell if [ -n "$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
- DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
-diff --git a/libcap/Makefile b/libcap/Makefile
-index 8a61752..cf99523 100644
---- a/libcap/Makefile
-+++ b/libcap/Makefile
-@@ -16,7 +16,7 @@ FILES=cap_alloc cap_proc cap_extint cap_flag cap_text
- # no support).
- ifeq ($(LIBATTR),yes)
- FILES += cap_file
--LDFLAGS += -lattr
-+LDLIBS += -lattr
- endif
- INCLS=libcap.h cap_names.h $(INCS)
-@@ -24,6 +24,7 @@ OBJS=$(addsuffix .o, $(FILES))
- MAJLIBNAME=$(LIBNAME).$(VERSION)
- MINLIBNAME=$(MAJLIBNAME).$(MINOR)
- GPERF_OUTPUT = _caps_output.gperf
-+CFLAGS += -fPIC
- all: $(MINLIBNAME) $(STALIBNAME)
-@@ -33,7 +34,7 @@ INCLUDE_GPERF_OUTPUT = -include $(GPERF_OUTPUT)
- endif
- _makenames: _makenames.c cap_names.list.h
--      $(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
-+      $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
- cap_names.h: _makenames
-       ./_makenames > cap_names.h
-@@ -50,15 +51,15 @@ $(STALIBNAME): $(OBJS)
-       $(RANLIB) $@
- $(MINLIBNAME): $(OBJS)
--      $(LD) $(CFLAGS) $(LDFLAGS) -Wl,-soname,$(MAJLIBNAME) -o $@ $^
-+      $(LD) $(CFLAGS) $(LDFLAGS) -Wl,-soname,$(MAJLIBNAME) -o $@ $^ $(LDLIBS)
-       ln -sf $(MINLIBNAME) $(MAJLIBNAME)
-       ln -sf $(MAJLIBNAME) $(LIBNAME)
- %.o: %.c $(INCLS)
--      $(CC) $(CFLAGS) -c $< -o $@
-+      $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
--      $(CC) $(CFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
-+      $(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
- install: all
-       mkdir -p -m 0755 $(INCDIR)/sys
-diff --git a/pam_cap/Makefile b/pam_cap/Makefile
-index eae88ed..bef59d2 100644
---- a/pam_cap/Makefile
-+++ b/pam_cap/Makefile
-@@ -14,13 +14,13 @@ install: all
-       install -m 0755 pam_cap.so $(LIBDIR)/security
- pam_cap.so: pam_cap.o
--      $(LD) $(LDFLAGS) -o pam_cap.so $< $(LDLIBS)
-+      $(LD) $(CFLAGS) $(LDFLAGS) -o pam_cap.so $< $(LDLIBS) -lpam
- pam_cap.o: pam_cap.c
--      $(CC) $(CFLAGS) -c $< -o $@
-+      $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- testcompile: test.c pam_cap.o
--      $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ -lpam -ldl $(LDLIBS)
-+      $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $+ -lpam -ldl $(LDLIBS)
- clean:
-       rm -f *.o *.so testcompile *~
-diff --git a/progs/Makefile b/progs/Makefile
-index a1542dc..612cf86 100644
---- a/progs/Makefile
-+++ b/progs/Makefile
-@@ -22,7 +22,7 @@ $(BUILD): %: %.o
-       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS)
- %.o: %.c $(INCS)
--      $(CC) $(CFLAGS) -c $< -o $@
-+      $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- install: all
-       mkdir -p -m 0755 $(SBINDIR)
--- 
-1.6.0.4
-
diff --git a/libcap/patches/libcap-2.16-headerfix.patch b/libcap/patches/libcap-2.16-headerfix.patch
deleted file mode 100644 (file)
index ae6eb28..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up libcap-2.16/libcap/include/sys/capability.h.incfix libcap-2.16/libcap/include/sys/capability.h
---- libcap-2.16/libcap/include/sys/capability.h.incfix 2009-03-22 17:54:02.000000000 +0100
-+++ libcap-2.16/libcap/include/sys/capability.h        2009-03-22 17:54:09.000000000 +0100
-@@ -19,7 +19,7 @@ extern "C" {
-  * information for the user library.
-  */
--#include <sys/types.h>
-+#include <linux/types.h>
- #include <stdint.h>
- /*
index 893b5551e38d3963853aac8f546ea9441ff93c88..33a01f3d9150ef27d5ce74885f5d5b49be603bd2 100644 (file)
@@ -50,8 +50,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/libcroco/libcroco.nm b/libcroco/libcroco.nm
new file mode 100644 (file)
index 0000000..8b5cb5d
--- /dev/null
@@ -0,0 +1,45 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = libcroco
+version    = 0.6.2
+major_ver  = 0.6
+release    = 1
+
+groups     = System/Libraries
+url        =
+license    = LGPLv2+
+summary    = A CSS2 parsing library.
+
+description
+       libcroco is a CSS2 parsing and manipulation library.
+end
+
+source_dl  = http://download.gnome.org/sources/%{name}/%{major_ver}/
+
+build
+       requires
+               glib2-devel
+               libxml2-devel
+       end
+
+       configure_options += \
+               --disable-static
+       test
+               make check
+       end
+end
+
+packages
+       package %{name}
+
+       package %{name}-devel
+               template DEVEL
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
index 6a15149640a93d6c468d31170b46255f0c6cdc65..84ebf82e56b7abc0d25899bd505b9c32e14fb917 100644 (file)
@@ -27,8 +27,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index e77066990c9a92ba32a660fc400d5aeb1c0a2980..65036b3933e09cdd65bbdf556eb30e48ae7e5105 100644 (file)
@@ -37,8 +37,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 40efa2a1717029f5b97715b29eda20bf286f33ce..007090ad525c0ab347a6626ea0ab445c289fdbad 100644 (file)
@@ -51,8 +51,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 4cd530548bac567954d20fab5f8c2ddf5adff967..a481edec5b7df7263cda860a99485a0984d9c9c9 100644 (file)
@@ -40,10 +40,14 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
-       
+
                requires = ncurses-devel
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index b0d4f12cd0095e8d5345fb3a08e8253aa117a20d..4add6aac90c587ed23c1c46f50773aeaac57ce44 100644 (file)
@@ -35,8 +35,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index ea4cafd3e08fe326be55ebde29e8c339627382e6..284af95b64feb8d4dd7c616f5a7881c3a2f148f1 100644 (file)
@@ -23,10 +23,14 @@ source_dl  =
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
-       
+
                files += /usr/lib*/libffi-%{version}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 679bb90fe48068bc5c06f9a622ebe7f7cfa4acec..5009601d25b944cebcdb294fd7e551fa263113b7 100644 (file)
@@ -33,8 +33,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 708cfd16b880ed877aa604640ee6e5be006bd43d..9fd1159572ca8e710746164a18cdfa705bc21b72 100644 (file)
@@ -41,10 +41,14 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
-       
+
                requires = libgpg-error-devel
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 637b9c279a463b95e4998d361425184d4729ab4a..9e5925206b029314205b5a2ea2101240d8adff28 100644 (file)
@@ -39,8 +39,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 24ce555c3f920d02e3e463dde011208f45c54cbc..90a197acb342777f1380d71275dcd5893352cda4 100644 (file)
@@ -23,8 +23,12 @@ source_dl  =
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 35109f7ec63958bdd2afccba3549a5d62b2bd061..7de885f7c7c8d86306bcca534c08099bc31ae104 100644 (file)
@@ -44,8 +44,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index ff129c4beea793cfbb90ea036bb071ad22d59718..b9d9903b8ea0839a2138e871b02113dbcc1bc96d 100644 (file)
@@ -51,8 +51,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 63ecf9305e810cad5b2ebe7b08937ef165726c45..d5ce0716a720103eb1aa04c649a72653a0deebc0 100644 (file)
@@ -29,8 +29,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index e4819aa69113cae0b36b77d59c8638a8b08b3019..5b0ba8e8d4351479e7f2b1a3e7b50708719a1d25 100644 (file)
@@ -44,8 +44,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index d490d1849592581f12293521e44693773df69984..9f519696d7d883f1b1f3b39876817e66587efdd9 100644 (file)
@@ -20,7 +20,7 @@ description
        It is built upon and follows the same principles as Mpfr.
 end
 
-source_dl  =
+source_dl  = http://www.multiprecision.org/mpc/download/
 
 build
        requires
@@ -38,9 +38,12 @@ end
 
 packages
        package %{name}
-       end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index fa368c4a13d2292394dbf5eda22db7bd9a40ba68..01c84dce11403b77e0b0915b5d1e371f57ade615 100644 (file)
@@ -26,8 +26,12 @@ source_dl  =
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 40a8b9bffea4d6c97cecc6368dbc79964fb83223..b2e3ee20ee8578610e24b0db5c107807e9909587 100644 (file)
@@ -31,8 +31,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index ad6bd9218aca8b84354b677bb475571da5c274eb..988f4504907158283c25c05611c9ad096ff946d2 100644 (file)
@@ -32,8 +32,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index ee20f9b6c83bb26da28dd15b11a8eb342e9f166a..50e6097415762dc8c769025730898be52ea87347 100644 (file)
@@ -32,8 +32,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 70756bc5402be6bb414962ad32e953feae32b51a..411a22ddbf0521d28e98b1cfa1b5f5f04e7f81d0 100644 (file)
@@ -26,8 +26,12 @@ sources    = %{thisapp}.tar.bz2
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index eb7894d464a90e13311519cb9a67889b05e0fde8..f4ee0e184e88d65084d1cbef658a600367c2a1c5 100644 (file)
@@ -48,8 +48,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index a8d3cae4f389db77a2c600abdad261fbc5ab62e2..6e642e4d1ddaba17cb72b9fd915c6813814d976a 100644 (file)
@@ -35,8 +35,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 372b1ed00334180f504baad681c82fe59ef5c3ee..fbb8d259be4ffa0b79d739a6d20d0821d639747b 100644 (file)
@@ -40,8 +40,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 4a4b1ca3ed66c5c74cb5d6d8c84ed733c8a807af..1caed55bcb5a096e808ae69a2ffdd5482ee9558e 100644 (file)
@@ -29,8 +29,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 3213e68730b05508067df92a49736c3278f1cfe1..c5364526186a1c0b80046e219ea7f857dc151f0f 100644 (file)
@@ -22,8 +22,12 @@ source_dl  =
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 3b1ded281b981a8d643ef5939a182d51a782c553..3841816e5b300142d2ab3f5c9c021a5d642cd662 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = libpng
-version    = 1.5.4
+version    = 1.5.6
 release    = 1
 
 groups     = System/Libraries
@@ -20,7 +20,7 @@ description
        data compression algorithm.
 end
 
-source_dl  =
+source_dl  = http://downloads.sourceforge.net/project/libpng/libpng15/%{version}/
 sources    = %{thisapp}.tar.xz
 
 build
@@ -32,11 +32,14 @@ end
 
 packages
        package %{name}
-       end
-       
+
        package %{name}-devel
                template DEVEL
-       
+
                requires = zlib-devel
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 5c2d073cc4cffb7a22c759ac84c222c53ee44fc4..6d6283ac065345f2ddb5ac5fa25297ea32f3bd84 100644 (file)
@@ -29,8 +29,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/librsvg2/librsvg2.nm b/librsvg2/librsvg2.nm
new file mode 100644 (file)
index 0000000..42d4129
--- /dev/null
@@ -0,0 +1,50 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = librsvg2
+version    = 2.34.1
+major_ver  = 2.34
+release    = 1
+
+groups     = System/Libraries
+url        =
+license    = LGPLv2+
+summary    = A SVG library based on cairo.
+
+description
+       librsvg is a SVG library based on cairo.
+end
+
+thisapp    = librsvg-%{version}
+
+source_dl  = http://download.gnome.org/sources/librsvg/%{major_ver}/
+sources    = %{thisapp}.tar.xz
+
+build
+       requires
+               cairo-devel
+               gdk-pixbuf2-devel
+               glib2-devel
+               libcroco-devel
+               libxml2-devel
+               pango-devel
+       end
+
+       configure_options += \
+               --disable-static \
+               --disable-gtk-theme
+end
+
+packages
+       package %{name}
+
+       package %{name}-devel
+               template DEVEL
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
index ebffd37b21e06607cc1539b98102e2c3b46bd0d3..6e4811421317dc0747e4004edff935af1036f058 100644 (file)
@@ -64,11 +64,11 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
-       
+
        package %{name}-utils
                summary = SELinux libselinux utitlities.
                description
@@ -80,7 +80,7 @@ packages
                        /usr/share/man/man{5,8}/*
                end
        end
-       
+
        #package python-selinux
        #       summary =  SELinux python bindings.
        #       description = SELinux python bindings for libselinux.
@@ -89,6 +89,10 @@ packages
        #               /usr/lib/python*
        #       end
        #end
-       
-       
+
+
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index f5435954fccb0067e92b7fa9d6dd04c29158d926..348f335140240ec02404269dd352a0807c7d2b99 100644 (file)
@@ -50,17 +50,21 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
-       
+
        package python-selinux-manage
                summary =  SELinux manage python bindings.
                description = SELinux python bindings for libsemanage.
-       
+
                files
                        /usr/lib/python*
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index dbecc79f443f08d383305618191adcc7dd0b5d6c..ee6efd13c72b487ed687195e64c4c6b02c82f162 100644 (file)
@@ -38,8 +38,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index e672087e82e1da625b155d44f84a412a71f90e61..eab0251ce7569c8e1af5f96cf4844cd3124c98ed 100644 (file)
@@ -32,8 +32,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index f11aae880f7effcc60987f8d20e286c77fcc5e29..aade3f94b04ad77433c5a2c4032d511858c5ae07 100644 (file)
@@ -6,7 +6,7 @@
 name       = libsolv
 version    = 0.0.0
 git_ver    = 0db9d7f
-release    = 1
+release    = 2.git%{git_ver}
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
 groups     = System/Libraries
@@ -67,8 +67,12 @@ end
 
 packages
        package %{name}
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index f91b31d30907b1e4830e0e9e68141579d9937d15..868ced3c9bd1f649f7deb9277363b8e0e5780a76 100644 (file)
@@ -38,10 +38,14 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
-       
+
                requires = libxml2-devel
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 351fcd5f186c390a28cff8db9475e58c13d9ee61..16312fc5fcd9bb8ed424f6d7d35231ff4ee6eda1 100644 (file)
@@ -39,8 +39,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 8ffb47b68affa3caa14a4f2c64b4754e1952bea6..b130a599ca3cc855874086f1243f9ad60de4ee28 100644 (file)
@@ -28,8 +28,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 876d121e1f71a16659b6a185bf217d40b3f95855..3aa99314e027875234a8aef24fd0292914300f0d 100644 (file)
@@ -38,8 +38,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 3012a96e0fe0125b457d188d1f81384c1922c53f..1c8fdd21d5be073f9dc04207f723b7a10eeb4a58 100644 (file)
@@ -4,10 +4,10 @@
 ###############################################################################
 
 name       = libtool
-version    = 2.4
-release    = 1
+version    = 2.4.2
+release    = 2
 
-groups     = Build System/Libraries
+groups     = System/Libraries
 url        = http://www.gnu.org/software/libtool/
 license    = GPLv2+ and LGPLv2+ and GFDL
 summary    = Runtime libraries for GNU Libtool Dynamic Module Loader.
@@ -19,25 +19,25 @@ description
        interface which simplifies the process of using shared libraries.
 end
 
-source_dl  =
+source_dl  = http://ftp.gnu.org/gnu/libtool/
 
 packages
        package %{name}
-       
+               groups += Build
+       end
+
+       package %{name}-libs
+               template LIBS
+       end
+
        package %{name}-devel
                template DEVEL
 
-               requires = libtool=%{thisver}   
-
-               # Overwrite filelist that /usr/share/aclocal will be in main package
-               files
-                       /usr/include
-                       /usr/lib*/lib*.so
-                       /usr/share/libtool/libltdl
-               end
+               # /usr/share/aclocal must be in main package.
+               files += !/usr/share/aclocal
        end
-       
-       package %{name}-libs
-               template LIBS
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index b989dabdb1c27c9b2daa77063856e891fe22ffea..9cbeb8c15b9860f39f9aaa794b906227b16093b2 100644 (file)
@@ -30,8 +30,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 909c6d7fcb883515e714ac5517ab796c8fb3c8ad..bd36891d2ad72478d9f49f7e373db862b3088505 100644 (file)
@@ -44,8 +44,12 @@ end
 packages
        package %{name}-compat
        end
-       
+
        package %{name}-compat-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 6bbf64b117b771d4e538f8c4dbba0e752b63fd15..5be775879e3c5b9561a74da3348db96d0ca4e215 100644 (file)
@@ -27,8 +27,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 12db984252ffeb98d3600f85f02001be2531eacf..cc2e961ed6b60ad79a723d593e0390e715ef1d60 100644 (file)
@@ -47,8 +47,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 90d50a645929f05b5f3d933b21331f4ef7b57a3f..a094388203e0a54a3a5d644ddda90563d01ddbb2 100644 (file)
@@ -76,8 +76,12 @@ packages
                        /bin/umount
                end
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index a96db904f1b55ed096bd48157e0cb58a0340d756..c5713b0cd8b69c7522ff71c4bde4277ef3e9e142 100644 (file)
@@ -46,10 +46,14 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
-       
+
                requires = libXau-devel
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 6fa7cf41bda7448b343449ef02bd547a882b59c8..6084282b1a55d36a053a258980f5ef0ebc3516ea 100644 (file)
@@ -38,8 +38,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 322e60b52fd326c251e1bd5bd01af8fbfdff5abc..3d6bb8ecfdf93df21c6834ef6cfbed935b69aa6c 100644 (file)
@@ -36,8 +36,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 8a12e806a93d77deedf5f5cff606426366dc1702..5566cfed3de183d53c153602fbe53bc2ff94eaa8 100644 (file)
@@ -33,8 +33,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 420920d64c7504e3e0db82d2887c71e77919f9d3..f945f238859eeec849907c63151bf7199e816a88 100644 (file)
@@ -32,8 +32,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 9d4ce5c272be283d7abef6af66a07a0d2ab599b2..ade0c47171365f93db9cdb222427cf0bd608f86d 100644 (file)
@@ -5,7 +5,8 @@
 
 name       = lighttpd
 version    = 1.4.29
-release    = 1
+ver_major  = 1.4
+release    = 2
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
 groups     = Networking/Webservers
@@ -14,15 +15,15 @@ license    = BSD
 summary    = Lightning fast webserver with light system requirements.
 
 description
-       Secure, fast, compliant and very flexible web-server which has been optimized \
-       for high-performance environments. It has a very low memory footprint compared \
-       to other webservers and takes care of cpu-load. Its advanced feature-set \
-       (FastCGI, CGI, Auth, Output-Compression, URL-Rewriting and many more) make \
-       it the perfect webserver-software for every server that is suffering load \
+       Secure, fast, compliant and very flexible web-server which has been optimized
+       for high-performance environments. It has a very low memory footprint compared
+       to other webservers and takes care of cpu-load. Its advanced feature-set
+       (FastCGI, CGI, Auth, Output-Compression, URL-Rewriting and many more) make
+       it the perfect webserver-software for every server that is suffering load
        problems.
 end
 
-source_dl  =
+source_dl  = http://download.lighttpd.net/lighttpd/releases-%{ver_major}.x/
 
 build
        requires
@@ -32,6 +33,7 @@ build
                openssl-devel
                pcre-devel
                pkg-config
+               shadow-utils
                zlib-devel
        end
 
@@ -40,19 +42,59 @@ build
                --with-ldap \
                --with-openssl
 
+       prepare_cmds
+               %{create_user}
+       end
+
        install_cmds
                mkdir -pv %{BUILDROOT}/etc
                cp -vf %{DIR_SOURCE}/%{name}.conf %{BUILDROOT}/etc/%{name}.conf
 
                mkdir -pv %{BUILDROOT}/var/log/%{name}
                touch %{BUILDROOT}/var/log/%{name}/{access,error}.log
-               chown nobody.nobody -R %{BUILDROOT}/var/log/%{name}
+               chown lighttpd.lighttpd -R %{BUILDROOT}/var/log/%{name}
                mkdir -pv %{BUILDROOT}/var/cache/lighttpd/compress
-               chown nobody.nobody -Rv %{BUILDROOT}/var/cache/lighttpd/
+               chown lighttpd.lighttpd -Rv %{BUILDROOT}/var/cache/lighttpd/
+
+               mkdir -pv %{BUILDROOT}/run/lighttpd
+               chown lighttpd.lighttpd -Rv %{BUILDROOT}/run/lighttpd/
        end
 end
 
+create_user
+       getent group lighttpd >/dev/null || /usr/sbin/groupadd -r lighttpd
+       getent passwd lighttpd >/dev/null || /usr/sbin/useradd -r -g lighttpd \
+               -d /var/www/lighttpd -s /sbin/nologin lighttpd
+end
+
 packages
        package %{name}
+               configfiles
+                       /etc/lighttpd.conf
+               end
+
+               prerequires = shadow-utils systemd-units
+
+               script prein
+                       %{create_user}
+               end
+
+               script postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       /bin/systemctl --no-reload disable lighttpd.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop lighttpd.service >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl try-restart lighttpd.service >/dev/null 2>&1 || :
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index b1fdefdda393a6b0c52cbc1aace7dfe242746435..4ba7262b63742f87b8b9825dadd39b4c54784329 100644 (file)
@@ -1 +1 @@
-d /var/run/lighttpd 0750 lighttpd lighttpd -
+d /run/lighttpd 0750 lighttpd lighttpd -
index 9970c2953ee42dfd922c9a8311bc34dea5052f44..428e21fca8f55ec3d11d366348ded1f093b2f4d5 100644 (file)
@@ -44,8 +44,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index f83462e87c0349e8fed74de69bc299b4e30aecdf..d1ac240be1e5f53f2b4e42b15b4a96f785363df6 100644 (file)
@@ -36,4 +36,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 271e9ad5fa19b550357a4e42e8f6e22ae7ca7246..7cce8779e6ae45bfa03623fbac6cb162df6981a7 100644 (file)
@@ -4,8 +4,8 @@
 ###############################################################################
 
 name       = lldpd
-version    = 0.5.2
-release    = 5
+version    = 0.5.4
+release    = 1
 
 groups     = Networking/Tools
 url        = https://trac.luffy.cx/lldpd/
@@ -13,7 +13,7 @@ license    = GPL
 summary    = Utilities for the Link Layer Discovery Protocol.
 
 description
-       The LLDPD project aims to provide a comprehensive implementation of \
+       The LLDPD project aims to provide a comprehensive implementation of
        the IEEE standard 802.1AB Link Layer Discovery Protocol.
 end
 
@@ -23,6 +23,7 @@ build
        requires
                libxml2-devel
                pkg-config
+               shadow-utils
                zlib-devel
        end
 
@@ -30,9 +31,52 @@ build
                --with-xml \
                --with-privsep-user=lldpd \
                --with-privsep-group=lldpd
+
+       prepare_cmds
+               %{create_user}
+       end
+
+       install_cmds
+               # Create tmp directory.
+               mkdir -pv -m 700 %{BUILDROOT}/run/lldpd
+               chown -v lldpd.lldpd %{BUILDROOT}/run/lldpd
+       end
+end
+
+create_user
+       getent group lldpd >/dev/null || groupadd -r lldpd
+       getent passwd lldpd >/dev/null || \
+               useradd -r -g lldpd -d / -s /sbin/nologin lldpd
 end
 
 packages
        package %{name}
+               prerequires = shadow-utils systemd-units
+
+               script prein
+                       %{create_user}
+               end
+
+               script postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       /bin/systemctl --no-reload disable lldpd.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop lldpd.service >/dev/null 2>&1 || :
+               end
+
+               script postun
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl try-restart lldpd.service >/dev/null 2>&1 || :
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 0e95b5a11273bca7e3ed3aabdf168a3be89c4ee9..5e3af548a5811f01c4d15134255a92e19cae61cb 100644 (file)
@@ -1 +1 @@
-d /var/run/lldpd 0700 lldpd lldpd -
+d /run/lldpd 0700 lldpd lldpd -
diff --git a/lldpd/patches/lldpd-0.52.x-os-release.patch b/lldpd/patches/lldpd-0.52.x-os-release.patch
deleted file mode 100644 (file)
index 3d45fee..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-commit ae87586a12eaf4e8329b88f6e0c629e7b14f27bc
-Author: Michael Tremer <michael.tremer@ipfire.org>
-Date:   Sat May 28 14:29:33 2011 +0200
-
-    Add support to read /etc/os-release for system information.
-    
-    /etc/os-release is introduced with systemd which will be in all the
-    major distributions, soon. For backwards-compatibility, the lsb_release
-    method is still there and will be used if no /etc/os-release is available.
-
-diff --git a/src/lldpd.c b/src/lldpd.c
-index b19af11..1641f13 100644
---- a/src/lldpd.c
-+++ b/src/lldpd.c
-@@ -89,6 +89,7 @@ static void           lldpd_decode(struct lldpd *, char *, int,
- static void            lldpd_update_chassis(struct lldpd_chassis *,
-                           const struct lldpd_chassis *);
- static char           *lldpd_get_lsb_release(void);
-+static char           *lldpd_get_os_release(void);
- #ifdef ENABLE_LLDPMED
- static void            lldpd_med(struct lldpd_chassis *);
- #endif
-@@ -553,6 +554,46 @@ lldpd_get_lsb_release() {
-       return NULL;
- }
-+/* Same like lldpd_get_lsb_release but reads /etc/os-release for PRETTY_NAME=. */
-+static char *
-+lldpd_get_os_release() {
-+      static char release[1024];
-+
-+      FILE *fp = fopen("/etc/os-release", "r");
-+      if (!fp) {
-+              LLOG_WARN("Could not open /etc/os-release to read system information");
-+              return NULL;
-+      }
-+
-+      char line[1024];
-+      char *key, *val;
-+
-+      while ((fgets(line, 1024, fp) != NULL)) {
-+              key = strtok(line, "=");
-+              val = strtok(NULL, "=");
-+
-+              if (strncmp(key, "PRETTY_NAME", 1024) == 0) {
-+                      strncpy(release, val, 1024);
-+                      break;
-+              }
-+      }
-+      fclose(fp);
-+
-+      /* Remove trailing newline and all " in the string. */
-+      char *ptr1 = release;
-+      char *ptr2 = release;
-+      while (*ptr1 != 0) {
-+              if ((*ptr1 == '"') || (*ptr1 == '\n')) {
-+                      ++ptr1;
-+              } else {
-+                      *ptr2++ = *ptr1++;
-+              }
-+      }
-+      *ptr2 = 0;
-+
-+      return release;
-+}
-+
- int
- lldpd_callback_add(struct lldpd *cfg, int fd, void(*fn)(CALLBACK_SIG), void *data)
- {
-@@ -889,7 +930,7 @@ lldpd_update_localchassis(struct lldpd *cfg)
-                       fatal("failed to set full system description");
-         } else {
-               if (cfg->g_advertise_version) {
--                      if (asprintf(&LOCAL_CHASSIS(cfg)->c_descr, "%s%s %s %s",
-+                      if (asprintf(&LOCAL_CHASSIS(cfg)->c_descr, "%s %s %s %s",
-                               cfg->g_lsb_release?cfg->g_lsb_release:"",
-                               un.sysname, un.release, un.machine)
-                                 == -1)
-@@ -1189,7 +1230,12 @@ lldpd_main(int argc, char *argv[])
-               close(pid);
-       }
--      lsb_release = lldpd_get_lsb_release();
-+      /* Try to read system information from /etc/os-release if possible.
-+         Fall back to lsb_release for compatibility. */
-+      lsb_release = lldpd_get_os_release();
-+      if (!lsb_release) {
-+              lsb_release = lldpd_get_lsb_release();
-+      }
-       priv_init(PRIVSEP_CHROOT);
index 49b454b9c9f8d959ee5279525f38029fb8c6b498..fed63a575b80f55b90c5c27cb39eaff73fedd393 100644 (file)
@@ -5,7 +5,8 @@ After=network.target
 [Service]
 RemainAfterExit=yes
 ExecStartPre=/sbin/modprobe 8021q
-ExecStart=/usr/sbin/lldpd -c
+ExecStart=/usr/sbin/lldpd -d -c
+Restart=on-failure
 
 [Install]
 WantedBy=multi-user.target
index f686653841d484ae214a4cdacd19a675dd419f1e..20114cab35266aa506b7e18eaf51017f26fa56a2 100644 (file)
@@ -42,4 +42,8 @@ packages
        package %{name}
                requires = perl rrdtool
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 9b083c9aeef708e5896919ccce701fd6a85b0d12..21d8677cd737d557c529d7435abf806119c80d52 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = logrotate
 version    = 3.7.7
-release    = 2
+release    = 3
 
-groups     = Base System/Base
+groups     = System/Base
 url        = https://fedorahosted.org/releases/l/o/logrotate/
 license    = GPL+
 summary    = Rotates, compresses, removes and mails system log files.
@@ -53,5 +53,10 @@ end
 
 packages
        package %{name}
+               groups += Base
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 527e45aa47b60846f3a760bff3033f11e0f8f9fb..bff08ab68a2e33afddc60b856c2bad2f030b8768 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = lsof
 version    = 4.82
-release    = 1
+release    = 2
 
-groups     = Base Development/Debuggers
+groups     = Development/Debuggers
 url        = ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof
 license    = zlib
 summary    = A utility which lists open files on a Linux/UNIX system.
@@ -45,5 +45,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index a3231db09c0ec7b00afb366c9d0f116bd746812e..a08ea6357e1840a07c73c92a13025fa598bcffd6 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = lua
 version    = 5.1.4
-release    = 2
+release    = 3
 
 groups     = Development/Languages
 url        = http://www.lua.org/
@@ -27,6 +27,7 @@ source_dl  =
 
 build
        requires
+               perl-Carp
                autoconf
                automake
                libtool
@@ -57,14 +58,18 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
-       
+
        package %{name}-libs
                template LIBS
-       
-               files += /usr/lib/*/liblua-5.1.so
+
+               files += /usr/lib*/liblua-5.1.so
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 0612e02321ce9e6ed90abea2b3943591be4a0ed2..5c033c0f36a471ea1ea5ba35eb104f58028cf43a 100644 (file)
@@ -52,12 +52,16 @@ end
 packages
        package %{name}
        end
-       
+
        package libdevmapper
                template LIBS
        end
-       
+
        package libdevmapper-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 0aac74875546f572a15b935427276d10bfc6bf6f..71696afd7bd8ef97b07eea955319a5f8ce174648 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = lzo
-version    = 2.05
+version    = 2.06
 release    = 1
 
 groups     = Applications/Compression
@@ -20,7 +20,7 @@ description
        while still decompressing at this very high speed.
 end
 
-source_dl  =
+source_dl  = http://www.oberhumer.com/opensource/lzo/download/
 
 build
        requires
@@ -34,9 +34,12 @@ end
 
 packages
        package %{name}
-       end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 837951afce03d8c1254da59f51dc6c3af489d2ef..d49cb96b0b767ed4a078c583ce0a7e2bb8eb340e 100644 (file)
--- a/m4/m4.nm
+++ b/m4/m4.nm
@@ -5,7 +5,7 @@
 
 name       = m4
 version    = 1.4.16
-release    = 1
+release    = 2
 
 groups     = Applications/Text
 url        = http://www.gnu.org/software/m4/
@@ -21,16 +21,19 @@ description
        configure scripts, but not for running configure scripts.
 end
 
-source_dl  =
+source_dl  = http://ftp.gnu.org/gnu/m4/
 sources    = %{thisapp}.tar.xz
 
-# Testsuite is broken ( readlink )
-#build
-#      test
-#              make check
-#      end
-#end
+build
+       test
+               make check
+       end
+end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/m4/patches/m4-1.4.16-readlink-einval.patch b/m4/patches/m4-1.4.16-readlink-einval.patch
new file mode 100644 (file)
index 0000000..6a98751
--- /dev/null
@@ -0,0 +1,12 @@
+diff -up m4-1.4.16/tests/test-readlink.h.orig m4-1.4.16/tests/test-readlink.h
+--- m4-1.4.16/tests/test-readlink.h.orig       2011-09-19 12:44:58.745546826 +0200
++++ m4-1.4.16/tests/test-readlink.h    2011-09-19 12:46:00.079548410 +0200
+@@ -38,7 +38,7 @@ test_readlink (ssize_t (*func) (char con
+   ASSERT (errno == ENOENT);
+   errno = 0;
+   ASSERT (func ("", buf, sizeof buf) == -1);
+-  ASSERT (errno == ENOENT);
++  ASSERT (errno == ENOENT || errno == EINVAL);
+   errno = 0;
+   ASSERT (func (".", buf, sizeof buf) == -1);
+   ASSERT (errno == EINVAL);
index da9192a435dacb2b73b7448d91d468d7051b45eb..2a8fb0afd9b60652f81ea63683318e94b35008ed 100644 (file)
@@ -5,10 +5,10 @@
 
 name       = make
 version    = 3.81
-release    = 1
+release    = 2
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
-groups     = Build Development/Tools
+groups     = Development/Tools
 url        = http://www.gnu.org/software/make/
 license    = GPLv2+
 summary    = A GNU tool which simplifies the build process for users.
@@ -37,4 +37,10 @@ end
 
 packages
        package %{name}
+               groups += Build
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 2d6ad4cc43ee05db373de698f821a3b0d51a8fc3..ac066118c4e15b7110bd129a5e1d1899cd5001bf 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = man-db
 version    = 2.6.0.2
-release    = 2
+release    = 3
 
-groups     = Base Documentation
+groups     = Documentation
 url        = http://bzr.savannah.gnu.org/r/man-db/
 license    = GPL
 summary    = man-db is an on-line manual database.
@@ -56,6 +56,8 @@ end
 
 packages
        package %{name}
+               groups += Base
+
                requires
                        groff
                        less
@@ -66,4 +68,8 @@ packages
                        man
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 8f05558f3e29965f3f8b3e1e4164b41b0b9d33d0..2728fa7b1de611e588acf27555b256b6c9c2d9a6 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = man-pages
-version    = 3.23
+version    = 3.35
 release    = 1
 arch       = noarch
 
index dee107de310098435e19662fb0624a60c50ab4be..587eb115c79c6b175af75d0bec5eb4e99cc3e6b1 100644 (file)
--- a/mc/mc.nm
+++ b/mc/mc.nm
@@ -5,7 +5,7 @@
 
 name       = mc
 version    = 4.7.4
-release    = 1
+release    = 2
 
 groups     = Applications/System
 url        = http://www.ibiblio.org/mc/
@@ -13,7 +13,7 @@ license    = GPLv2+
 summary    = User-friendly text console file manager and visual shell.
 
 description
-       Midnight Commander is a visual shell much like a file manager, only 
+       Midnight Commander is a visual shell much like a file manager, only
        with many more features. It is a text mode application, but it also
        includes mouse support. Midnight Commander's best features are its
        ability to FTP, view tar and zip files, and to poke into RPMs for
@@ -32,9 +32,6 @@ build
                slang-devel
        end
 
-       # This awkward dependency is found and cannot be resolved.
-       PKG_REQUIRES_FILTER = perl\(pieces\)
-
        configure_options += \
                --sysconfdir=/etc \
                --libexecdir=/usr/lib \
@@ -51,4 +48,13 @@ end
 
 packages
        package %{name}
+               # This awkward dependency is found and cannot be resolved.
+               filter_requires
+                       perl\(pieces\)
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 165ee4050fb336f92df67357985d78abd1137bb4..8e0073e46c5e4876fc50ac10cd0717f2edce93c1 100644 (file)
@@ -48,8 +48,12 @@ end
 
 packages
        package %{name}
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index dd024d324ebb33b3a5be80bcf8a3b01c352c868f..ee08866608691d8498a96cf8036a8860ce02d41c 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = memtest86+
 version    = 4.20
-release    = 1
+release    = 2
 
-groups     = Base System/Base
+groups     = System/Base
 url        = http://www.memtest.org/
 license    = GPLv2
 summary    = Stand-alone memory tester for x86 and x86-64 computers.
@@ -40,4 +40,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index aa7c73ef9be4ef603ffbecee926af0814b626ed6..31dafc6bed63f0198d66a765e719364581bb7213 100644 (file)
@@ -69,4 +69,8 @@ packages
                        libX11-devel
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 3ab7867460c0a9ad65568fe5586abae2e9b31be6..a8add8b6dab8a0151d4ad6ff68e664bc7ab7058d 100644 (file)
@@ -33,4 +33,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/module-init-tools/modprobe.d/blacklist.conf b/module-init-tools/modprobe.d/blacklist.conf
deleted file mode 100644 (file)
index b393b22..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# Listing a module here prevents the hotplug scripts from loading it.
-# Usually that'd be so that some other driver will bind it instead,
-# no matter which driver happens to get probed first.  Sometimes user
-# mode tools can also control driver binding.
-#
-# Syntax:  driver name alone (without any spaces) on a line. Other
-# lines are ignored.
-#
-
-# watchdog drivers
-blacklist i8xx_tco
-
-# framebuffer drivers
-blacklist aty128fb
-blacklist atyfb
-blacklist radeonfb
-blacklist i810fb
-blacklist cirrusfb
-blacklist intelfb
-blacklist kyrofb
-blacklist i2c-matroxfb
-blacklist hgafb
-blacklist nvidiafb
-blacklist rivafb
-blacklist savagefb
-blacklist sisfb
-blacklist sstfb
-blacklist neofb
-blacklist tridentfb
-blacklist tdfxfb
-blacklist virgefb
-blacklist vga16fb
-
-# ISDN - see bugs 154799, 159068
-blacklist hisax
-blacklist hisax_fcpcipnp
-
index d395fcf4900fa040c94e5d6a7d43104764132880..af61c1ba66fdfee486bd5e77dd65c26088b20bfc 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = module-init-tools
 version    = 3.16
-release    = 1
+release    = 3
 
 groups     = System/Base
 url        = http://ftp.kernel.org/pub/linux/utils/kernel/module-init-tools/
@@ -20,19 +20,16 @@ description
        unloaded modules.
 end
 
-source_dl  =
+source_dl  = http://ftp.kernel.org/pub/linux/utils/kernel/module-init-tools/
 
 build
        requires
+               docbook-utils
                zlib-devel
        end
 
        CFLAGS += -DCONFIG_NO_BACKWARDS_COMPAT=1
 
-       # Set docbooktoman=true, because this package is not available
-       # in IPFire and prevents us from errors
-       export DOCBOOKTOMAN=true
-
        configure_options += \
                --bindir=/bin \
                --sbindir=/sbin \
@@ -48,4 +45,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index da36d028b346deb8d04c8a87fe5462604a62b9ae..848d0379b4450cbe60976bea9a7275f2d16f6ab2 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = mpfr
-version    = 3.0.0
+version    = 3.1.0
 release    = 1
 
 groups     = System/Libraries
@@ -21,11 +21,11 @@ description
        library.
 end
 
-source_dl  =
+source_dl  = http://mpfr.loria.fr/mpfr-%{version}/
 
 build
        requires
-               gmp-devel
+               gmp-devel>=4.3.2
        end
 
        configure_options += \
@@ -34,12 +34,31 @@ build
        test
                make check
        end
+
+       install_cmds
+               ln -svf libmpfr.so.4 %{BUILDROOT}/usr/lib/libmpfr.so.1
+               ln -svf libmpfr.so.4.1.0 %{BUILDROOT}/usr/lib/libmpfr.so.1.2.2
+       end
 end
 
 packages
        package %{name}
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-compat
+               summary = Compat libraries of %{thisapp}.
+
+               provides = libmpfr.so.1
+
+               files
+                       /usr/lib/libmpfr.so.1*
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/mstpd/mstpd.nm b/mstpd/mstpd.nm
new file mode 100644 (file)
index 0000000..8eb7c80
--- /dev/null
@@ -0,0 +1,61 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = mstpd
+version    = 0.01
+svn_ver    = 20
+release    = 0.2-svn%{svn_ver}.1
+thisapp    = %{name}-%{version}-svn%{svn_ver}
+
+groups     = Networking/Tools
+url        = http://sourceforge.net/projects/mstpd/
+license    = GPLv2+
+summary    = The Multiple Spanning Tree Protocol Daemon.
+
+description
+       A daemon that implements the Multiple Spanning Tree Protocol
+       running upon the Linux ethernet bridge.
+end
+
+# Tarballs are created as follows:
+# ./svn-export.sh %{version} %{svn_ver}
+
+build
+       # Compile for release.
+       make_build_targets += MODE=release
+
+       install_cmds
+               rm -vf %{BUILDROOT}/sbin/bridge-stp
+       end
+end
+
+packages
+       package %{name}
+               requires = network
+
+               # Replace rstp.
+               provides  += rstp=0.21-9
+               obsoletes += rstp<0.21-9
+
+               script postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl --no-reload enable mstpd.service >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       /bin/systemctl --no-reload disable mstpd.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop rstp.service >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl try-restart mstpd.service >/dev/null 2>&1 || :
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
diff --git a/mstpd/svn-export.sh b/mstpd/svn-export.sh
new file mode 100755 (executable)
index 0000000..662d3d3
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+version=${1}
+revision=${2}
+
+if [ -z "${version}" ] || [ -z "${revision}" ]; then
+       echo "Usage ${0}: <version> <revision>" >&2
+       exit 1
+fi
+
+export_dir=mstpd-${version}-svn${revision}
+rm -rf ${export_dir}
+
+set -x
+
+svn export http://svn.code.sf.net/p/mstpd/code/trunk ${export_dir}
+tar cfz mstpd-${version}-svn${revision}.tar.gz ${export_dir}
+rm -rf ${export_dir}
+
+exit 0
diff --git a/mstpd/systemd/mstpd.service b/mstpd/systemd/mstpd.service
new file mode 100644 (file)
index 0000000..95b0254
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=Multiple Spanning Tree Protocol Daemon
+Before=network.service
+
+[Service]
+ExecStart=/sbin/mstpd -d
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
index ec7b49954c976316d4964541ec68c7811e3740ac..57c01031c0fa6dec2e7d6ac19cf7cffedb804d4e 100644 (file)
@@ -38,8 +38,12 @@ end
 
 packages
        package %{name}
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 7d38f23dcb14f26cc647e0fa8830a7b0a42a29b6..8a69aad69d0aea86e9a0d09ecc45bf9b82f06459 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = nano
 version    = 2.3.0
-release    = 1
+release    = 2
 
 groups     = Application/Editors
 url        = http://www.nano-editor.org/
@@ -25,7 +25,6 @@ build
        end
 
        configure_options += \
-               --bindir=/bin \
                --sysconfdir=/etc/nano \
                --enable-color \
                --enable-multibuffer \
@@ -39,4 +38,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 8fc7336d1cc14dde6081d9c223c1c44ba9997484..9244b0a9f3fb3c2ef1fbed38c2f6684e810cc14d 100644 (file)
@@ -31,4 +31,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 063f472b26fa8d93498171502fb793a774c2bc28..7edeba2aa25d751e09985ac79fcc9041eb3e1590 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = ncurses
 version    = 5.9
-release    = 2
+release    = 5
 
 groups     = System/Base
 url        = http://invisible-island.net/ncurses/ncurses.html
@@ -30,37 +30,106 @@ build
                --mandir=/usr/share/man \
                --with-shared \
                --without-debug \
-               --enable-widec \
-               --disable-static \
-               --enable-symlinks \
-               --disable-root-environ
+               --without-ada \
+               --with-ospeed=unsigned \
+               --with-chtype=long \
+               --enable-hard-tabs \
+               --enable-xmc-glitch \
+               --enable-colorfgbg \
+               --with-terminfo-dirs=/etc/terminfo:/usr/share/terminfo:/lib/terminfo \
+               --enable-overwrite \
+               --enable-pc-files \
+               --with-termlib=tinfo
 
-       install_cmds
+       export PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig
+
+       build
+               mkdir -pv narrowc widec
+
+               # Build narrowc version.
+               cd narrowc
+               ln -svf ../configure .
+               ./configure %{configure_options} --with-ticlib
+               make %{PARALLELISMFLAGS} libs
+               make %{PARALLELISMFLAGS} -C progs
+
+               # Build widec version.
+               cd ../widec
+               ln -svf ../configure .
+               ./configure %{configure_options} --enable-widec --without-progs
+               make %{PARALLELISMFLAGS} libs
+               cd ..
+       end
+
+       install
+               make -C narrowc DESTDIR=%{BUILDROOT} install.{libs,progs,data}
+               rm -rvf %{BUILDROOT}/usr/lib/libtinfo.*
+               make -C widec DESTDIR=%{BUILDROOT} install.{libs,includes,man}
+
+               chmod -v 755 %{BUILDROOT}/usr/lib/lib*.so.*.*
+
+               # move lib{ncurses{,w},tinfo}.so.* to /lib*
                mkdir -pv %{BUILDROOT}/lib
-               mv -v %{BUILDROOT}/usr/lib/libncursesw.so.5* %{BUILDROOT}/lib
-               ln -sfv ../../lib/libncursesw.so.5 %{BUILDROOT}/usr/lib/libncursesw.so
-               for lib in curses ncurses form panel menu; do
-                       rm -vf %{BUILDROOT}/usr/lib/lib${lib}.so
-                       echo "INPUT(-l${lib}w)" >%{BUILDROOT}/usr/lib/lib${lib}.so
+               mv -v %{BUILDROOT}/usr/lib/lib{ncurses{,w},tinfo}.so.* %{BUILDROOT}/lib
+               for l in %{BUILDROOT}/usr/lib/lib{ncurses{,w},tinfo}.so; do
+                       ln -sf $(echo /usr/lib | \
+                               sed 's,\(^/\|\)[^/][^/]*,..,g')/lib/$(readlink $l) $l
+               done
+               mkdir -pv %{BUILDROOT}/{etc,lib}/terminfo
+
+               # move few basic terminfo entries to /lib
+               baseterms=
+               for termname in \
+                               ansi dumb linux vt100 vt100-nav vt102 vt220 vt52; do
+                       for t in $(find %{BUILDROOT}/usr/share/terminfo \
+                                       -samefile %{BUILDROOT}/usr/share/terminfo/${termname::1}/$termname); do
+                               baseterms="$baseterms $(basename $t)"
+                       done
                done
+               for termname in ${baseterms}; do
+                       termpath=terminfo/${termname::1}/${termname}
+                       mkdir -pv %{BUILDROOT}/lib/terminfo/${termname::1}
+                       mv -v %{BUILDROOT}/usr/share/${termpath} %{BUILDROOT}/lib/${termpath}
+                       ln -svf $(dirname /usr/share/${termpath} | \
+                                       sed 's,\(^/\|\)[^/][^/]*,..,g')/lib/${termpath} \
+                               %{BUILDROOT}/usr/share//${termpath}
+               done
+
+               # can't replace directory with symlink, symlink all headers
+               #mkdir %{BUILDROOT}/usr/include/ncurses{,w}
+               #for l in %{BUILDROOT}/usr/include/*.h; do
+               #       ln -s ../$(basename $l) %{BUILDROOT}/usr/include/ncurses
+               #       ln -s ../$(basename $l) %{BUILDROOT}/usr/include/ncursesw
+               #done
 
-               rm -vf %{BUILDROOT}/usr/lib/libcursesw.so
-               echo "INPUT(-lncursesw)" >%{BUILDROOT}/usr/lib/libcursesw.so
-               ln -sfv libncurses.so %{BUILDROOT}/usr/lib/libcurses.so
+               # don't require -ltinfo when linking with --no-add-needed
+               for l in %{BUILDROOT}/usr/lib/libncurses{,w}.so; do
+                       soname=$(basename $(readlink $l))
+                       rm -f $l
+                       echo "INPUT($soname -ltinfo)" > $l
+               done
+
+               rm -f %{BUILDROOT}/usr/lib/libcurses{,w}.so
+               echo "INPUT(-lncurses)" > %{BUILDROOT}/usr/lib/libcurses.so
+               echo "INPUT(-lncursesw)" > %{BUILDROOT}/usr/lib/libcursesw.so
+               echo "INPUT(-ltinfo)" > %{BUILDROOT}/usr/lib/libtermcap.so
+
+               rm -vf %{BUILDROOT}/usr/lib/terminfo
+               rm -vf %{BUILDROOT}/usr/lib/pkgconfig/{*_g,ncurses++*}.pc
        end
 end
 
 packages
        package %{name}
-       
+
        package %{name}-libs
                template LIBS
-       
+
                requires
-                       %{name}-base
+                       %{name}-base=%{thisver}
                end
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
@@ -72,6 +141,8 @@ packages
                        the ncurses-base package.
                end
 
+               provides += /usr/share/terminfo
+
                files
                        /usr/share/terminfo
                end
@@ -84,7 +155,10 @@ packages
                        descriptions are included in the ncurses-term package.
                end
 
+               conflicts = ncurses<=5.9-1
+
                files
+                       /lib/terminfo
                        /usr/share/terminfo/*/Eterm*
                        /usr/share/terminfo/*/aterm
                        /usr/share/terminfo/*/bterm
@@ -119,4 +193,8 @@ packages
                        /usr/share/terminfo/*/xterm xterm-*
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 18771d3cc73de65cbb18e57182f9f9ee555d5b93..863fedbd4b10fe290a024fa92972cdebbf703b7e 100644 (file)
@@ -4,8 +4,8 @@
 ###############################################################################
 
 name       = net-snmp
-version    = 5.7
-release    = 1
+version    = 5.7.1
+release    = 2
 
 groups     = Networking/Daemons
 url        = http://net-snmp.sourceforge.net
@@ -18,7 +18,7 @@ description
        computer equipment and even devices like UPSs.
 end
 
-source_dl  =
+source_dl  = https://sourceforge.net/projects/net-snmp/files/net-snmp/%{version}/
 
 build
        requires
@@ -48,6 +48,12 @@ end
 
 packages
        package %{name}
+               # XXX Although we don't want to build perl modules,
+               # we have this requirement?!
+               filter_requires
+                       perl\(NetSNMP::TrapReceiver\)
+               end
+       end
 
        package %{name}-libs
                template LIBS
@@ -56,4 +62,8 @@ packages
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 46bf2f0f29e7f6114dea72bd94eace694caff302..10ce6268f4823429e5dcaa6e996941b88b06ad5d 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = net-tools
 version    = 1.60
-release    = 1
+release    = 2
 
-groups     = Base Sytem/Base
+groups     = System/Base
 url        = http://net-tools.berlios.de/
 license    = GPL+
 summary    = Basic networking tools.
@@ -152,4 +152,10 @@ end
 
 packages
        package %{name}
+               groups += Base
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 302cf70a0cd05b68fce4849dc39871929d921c42..8c76e0a137f14b0e2b6c79b6b39ca8f4632bfd29 100644 (file)
@@ -40,4 +40,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 6ae463158577f00d59d17362ed773fb3540e6210..af0a929e4e40f831354de09c64984f05d864efd7 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = nettle
-version    = 2.2
+version    = 2.4
 release    = 1
 
 groups     = System/Libraries
@@ -19,7 +19,7 @@ description
        or even in kernel space.
 end
 
-source_dl  =
+source_dl  = http://www.lysator.liu.se/~nisse/archive/
 
 build
        requires
@@ -40,8 +40,12 @@ packages
        package %{name}
 
        package %{name}-devel
-               requires
-                       gmp-devel
-               end
+               template DEVEL
+
+               requires += gmp-devel
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 0207ff4808b3d2310af3b6d9808793201c70a0b9..717dbe2fae71e9ede77ea935346943f957162a08 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = network
 epoch      = 1
-version    = 001
+version    = 003
 release    = 1
 arch       = noarch
 
@@ -25,7 +25,7 @@ description
        everything.
 end
 
-source_dl  =
+source_dl  = http://source.ipfire.org/releases/network/
 
 build
        build = # Do nothing
@@ -52,5 +52,25 @@ packages
                        /bin/ipcalc
                        /usr/bin/logger
                end
+
+               prerequires = systemd-units
+
+               # Enable network service, so it starts at the first boot.
+               script postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl --no-reload enable network.service >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       /bin/systemctl --no-reload disable network.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop network.service >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+
+                       # Maybe it is not a good idea to restart network.
+                       #/bin/systemctl try-reload-or-restart network.service >/dev/null 2>&1 || :
+               end
        end
 end
index 8688ed3fecf2f2ea0987cf7f06f3021b4e195144..e1092b7116ffec545407e487ff0263c789a2222d 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = newt
-version    = 0.52.10
+version    = 0.52.13
 release    = 1
 
 groups     = System/Libraries
@@ -22,7 +22,7 @@ description
        slang library.
 end
 
-source_dl  =
+source_dl  = %{url}
 
 build
        requires
@@ -61,4 +61,12 @@ packages
                        /usr/lib/python*/site-packages/*snack*
                end
        end
+
+       package %{name}-devel
+               template DEVEL
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index dbf24b72bf2ab383ef9b2f00aa9212dc9be6ad0f..e75e28a10ac8bb45a59e24e42e3bf1d915937d28 100644 (file)
@@ -54,4 +54,8 @@ packages
                        util-linux
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index a439ed18c16824e0ee3f2a29267909125f1d9b65..4df52f7514b924027191c20625a2831d2cbf27a2 100644 (file)
@@ -40,4 +40,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 16eaab2aebcfef828f15101ad949eacd35d9cbd6..ff232791203247f18119ce3bace0877b87b400a4 100644 (file)
@@ -34,4 +34,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 8e84280cc98e84ba1e459094c6a56bae188c7d2d..15a533aec1a56decbee8113a0fcd795e1801bd6f 100644 (file)
@@ -95,4 +95,8 @@ packages
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 9573d49b6ac3780fd4ef3649af5bd7c789515211..52d64ce130fd90340587258aa2eaeb6caf09725f 100644 (file)
@@ -45,4 +45,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 2dc0cddd8b56e30831ce5bb9110b64d5aba37dc7..fae15df8b0458f78a5474594b503f3ba9eba1fb8 100644 (file)
@@ -123,4 +123,8 @@ packages
                        /usr/lib/pkgconfig
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 3ae22ba963be5471705b39a43db8a0cf5335dd49..00eb9cecb55870d11fe98f6e8f8ef44e98c87564 100644 (file)
@@ -101,4 +101,8 @@ packages
                        /usr/lib/pkgconfig
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/nss-util/nss-util.spec b/nss-util/nss-util.spec
deleted file mode 100644 (file)
index 4676bb5..0000000
+++ /dev/null
@@ -1,278 +0,0 @@
-%global nspr_version 4.8.6
-
-Summary:          Network Security Services Utilities Library
-Name:             nss-util
-Version:          3.12.8
-Release:          2%{?dist}
-License:          MPLv1.1 or GPLv2+ or LGPLv2+
-URL:              http://www.mozilla.org/projects/security/pki/nss/
-Group:            System Environment/Libraries
-Requires:         nspr >= %{nspr_version}
-BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires:    nspr-devel >= %{nspr_version}
-BuildRequires:    zlib-devel
-BuildRequires:    pkgconfig
-BuildRequires:    gawk
-BuildRequires:    psmisc
-BuildRequires:    perl
-
-Source0:          %{name}-%{version}.tar.bz2
-# The nss-util tar ball is a subset of nss-{version}-stripped.tar.bz2, 
-# Therefore we use the nss-split-util.sh script to keeping only what we need.
-# Download the nss tarball via CVS from the nss propect and follow these
-# steps to make the r tarball for nss-util out of the for nss:
-# fedpkg clone nss
-# fedpkg clone nss-util
-# cd nss-util/master
-# cp ../../nss/devel/${version}-stripped.tar.bz2 .
-# sh ./nss-split-util.sh ${version}
-# A file named {name}-{version}.tar.bz2 should appear
-Source1:          nss-split-util.sh
-Source2:          nss-util.pc.in
-Source3:          nss-util-config.in
-
-
-%description
-Utilities for Network Security Services and the Softoken module
-
-# We shouln't need to have a devel subpackage as util will be used in the
-# context of nss or nss-softoken. keeping to please rpmlint.
-# 
-%package devel
-Summary:          Development libraries for Network Security Services Utilities
-Group:            Development/Libraries
-Requires:         nss-util = %{version}-%{release}
-Requires:         nspr-devel >= %{nspr_version}
-Requires:         pkgconfig
-
-%description devel
-Header and library files for doing development with Network Security Services.
-
-
-%prep
-%setup -q
-
-
-%build
-
-# Enable compiler optimizations and disable debugging code
-BUILD_OPT=1
-export BUILD_OPT
-
-# Generate symbolic info for debuggers
-XCFLAGS=$RPM_OPT_FLAGS
-export XCFLAGS
-
-PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
-PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
-
-export PKG_CONFIG_ALLOW_SYSTEM_LIBS
-export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS
-
-NSPR_INCLUDE_DIR=`/usr/bin/pkg-config --cflags-only-I nspr | sed 's/-I//'`
-NSPR_LIB_DIR=`/usr/bin/pkg-config --libs-only-L nspr | sed 's/-L//'`
-
-export NSPR_INCLUDE_DIR
-export NSPR_LIB_DIR
-
-NSS_USE_SYSTEM_SQLITE=1
-export NSS_USE_SYSTEM_SQLITE
-
-%ifarch x86_64 ppc64 ia64 s390x sparc64
-USE_64=1
-export USE_64
-%endif
-
-# make util
-%{__make} -C ./mozilla/security/coreconf
-%{__make} -C ./mozilla/security/nss
-
-# Set up our package file
-%{__mkdir_p} ./mozilla/dist/pkgconfig
-%{__cat} %{SOURCE2} | sed -e "s,%%libdir%%,%{_libdir},g" \
-                          -e "s,%%prefix%%,%{_prefix},g" \
-                          -e "s,%%exec_prefix%%,%{_prefix},g" \
-                          -e "s,%%includedir%%,%{_includedir}/nss3,g" \
-                          -e "s,%%NSPR_VERSION%%,%{nspr_version},g" \
-                          -e "s,%%NSSUTIL_VERSION%%,%{version},g" > \
-                          ./mozilla/dist/pkgconfig/nss-util.pc
-
-NSSUTIL_VMAJOR=`cat mozilla/security/nss/lib/util/nssutil.h | grep "#define.*NSSUTIL_VMAJOR" | awk '{print $3}'`
-NSSUTIL_VMINOR=`cat mozilla/security/nss/lib/util/nssutil.h | grep "#define.*NSSUTIL_VMINOR" | awk '{print $3}'`
-NSSUTIL_VPATCH=`cat mozilla/security/nss/lib/util/nssutil.h | grep "#define.*NSSUTIL_VPATCH" | awk '{print $3}'`
-
-export NSSUTIL_VMAJOR 
-export NSSUTIL_VMINOR 
-export NSSUTIL_VPATCH
-
-%{__cat} %{SOURCE3} | sed -e "s,@libdir@,%{_libdir},g" \
-                          -e "s,@prefix@,%{_prefix},g" \
-                          -e "s,@exec_prefix@,%{_prefix},g" \
-                          -e "s,@includedir@,%{_includedir}/nss3,g" \
-                          -e "s,@MOD_MAJOR_VERSION@,$NSSUTIL_VMAJOR,g" \
-                          -e "s,@MOD_MINOR_VERSION@,$NSSUTIL_VMINOR,g" \
-                          -e "s,@MOD_PATCH_VERSION@,$NSSUTIL_VPATCH,g" \
-                          > ./mozilla/dist/pkgconfig/nss-util-config
-
-chmod 755 ./mozilla/dist/pkgconfig/nss-util-config
-
-
-%install
-
-%{__rm} -rf $RPM_BUILD_ROOT
-
-# There is no make install target so we'll do it ourselves.
-
-%{__mkdir_p} $RPM_BUILD_ROOT/%{_includedir}/nss3
-%{__mkdir_p} $RPM_BUILD_ROOT/%{_libdir}
-%{__mkdir_p} $RPM_BUILD_ROOT/%{_libdir}/nss3
-%{__mkdir_p} $RPM_BUILD_ROOT/%{_libdir}/pkgconfig
-%{__mkdir_p} $RPM_BUILD_ROOT/%{_bindir}
-
-for file in libnssutil3.so
-do
-  %{__install} -p -m 755 mozilla/dist/*.OBJ/lib/$file $RPM_BUILD_ROOT/%{_libdir}
-done
-
-# Copy the include files we want
-# The util headers, the rest come from softokn and nss
-for file in mozilla/dist/public/nss/*.h
-do
-  %{__install} -p -m 644 $file $RPM_BUILD_ROOT/%{_includedir}/nss3
-done
-
-# Copy the package configuration files
-%{__install} -p -m 644 ./mozilla/dist/pkgconfig/nss-util.pc $RPM_BUILD_ROOT/%{_libdir}/pkgconfig/nss-util.pc
-%{__install} -p -m 755 ./mozilla/dist/pkgconfig/nss-util-config $RPM_BUILD_ROOT/%{_bindir}/nss-util-config
-
-%clean
-%{__rm} -rf $RPM_BUILD_ROOT
-
-%post
-/sbin/ldconfig >/dev/null 2>/dev/null
-
-%postun
-/sbin/ldconfig >/dev/null 2>/dev/null
-
-%files
-%defattr(-,root,root)
-%{_libdir}/libnssutil3.so
-
-%files devel
-%defattr(-,root,root)
-# package configuration files
-%{_libdir}/pkgconfig/nss-util.pc
-%{_bindir}/nss-util-config
-
-# co-owned with nss
-%dir %{_includedir}/nss3
-# these are marked as public export in
-# mozilla/security/nss/lib/util/manifest.mk
-%{_includedir}/nss3/base64.h
-%{_includedir}/nss3/ciferfam.h
-%{_includedir}/nss3/nssb64.h
-%{_includedir}/nss3/nssb64t.h
-%{_includedir}/nss3/nsslocks.h
-%{_includedir}/nss3/nssilock.h
-%{_includedir}/nss3/nssilckt.h
-%{_includedir}/nss3/nssrwlk.h
-%{_includedir}/nss3/nssrwlkt.h
-%{_includedir}/nss3/nssutil.h
-%{_includedir}/nss3/pkcs11.h
-%{_includedir}/nss3/pkcs11f.h
-%{_includedir}/nss3/pkcs11n.h
-%{_includedir}/nss3/pkcs11p.h
-%{_includedir}/nss3/pkcs11t.h
-%{_includedir}/nss3/pkcs11u.h
-%{_includedir}/nss3/portreg.h
-%{_includedir}/nss3/secasn1.h
-%{_includedir}/nss3/secasn1t.h
-%{_includedir}/nss3/seccomon.h
-%{_includedir}/nss3/secder.h
-%{_includedir}/nss3/secdert.h
-%{_includedir}/nss3/secdig.h
-%{_includedir}/nss3/secdigt.h
-%{_includedir}/nss3/secerr.h
-%{_includedir}/nss3/secitem.h
-%{_includedir}/nss3/secoid.h
-%{_includedir}/nss3/secoidt.h
-%{_includedir}/nss3/secport.h
-%{_includedir}/nss3/utilrename.h
-
-%changelog
-* Wed Sep 29 2010 jkeating - 3.12.8-2
-- Rebuilt for gcc bug 634757
-
-* Thu Sep 23 2010 Elio Maldonado <emaldona@redhat.com> - 3.12.8-1
-- Update to 3.12.8
-
-* Sat Sep 18 2010 Elio Maldonado <emaldona@redhat.com> - 3.12.7.99.4-1
-- NSS 3.12.8 RC0
-
-* Sat Sep 04 2010 Elio Maldonado <emaldona@redhat.com> - 3.12.7.99.3-1
-- NSS 3.12.8 Beta 3
-
-* Sat Aug 29 2010 Elio Maldonado <emaldona@redhat.com> - 3.12.7-2
-- Define NSS_USE_SYSTEM_SQLITE and remove nolocalsql patch 
-
-* Mon Aug 16 2010 Elio Maldonado <emaldona@redhat.com> - 3.12.7-1
-- Update to 3.12.7
-
-* Fri Mar 05 2010 Elio Maldonado <emaldona@redhat.com> - 3.12.6-1
-- Update to 3.12.6
-
-* Mon Jan 18 2010 Elio Maldonado <emaldona@redhat.com> - 3.12.5-2
-- Fix in nss-util-config.in
-
-* Thu Dec 03 2009 Elio Maldonado<emaldona@redhat.com> - 3.12.5-1
-- Update to 3.12.5
-
-* Thu Sep 10 2009 Elio Maldonado<emaldona@redhat.com> - 3.12.4-8
-- Retagging for a chained build with nss-softokn and nss
-
-* Thu Sep 10 2009 Elio Maldonado<emaldona@redhat.com> - 3.12.4-5
-- Restoring -rpath-link to nss-util-config
-
-* Tue Sep 08 2009 Elio Maldonado<emaldona@redhat.com> - 3.12.4-4
-- Installing shared libraries to %%{_libdir}
-
-* Sat Sep 05 2009 Elio Maldonado<emaldona@redhat.com> - 3.12.4-3
-- Remove symbolic links to shared libraries from devel - 521155
-- Apply nss-nolocalsql patch subset for nss-util
-- No rpath-link in nss-util-config
-
-* Fri Sep 04 2009 Elio Maldonado<emaldona@redhat.com> - 3.12.4-2
-- Retagging for a chained build
-
-* Thu Sep 03 2009 Elio Maldonado<emaldona@redhat.com> - 3.12.4-1
-- Update to 3.12.4
-- Don't require sqlite
-
-* Thu Aug 27 2009 Elio Maldonado<emaldona@redhat.com> - 3.12.3.99.3-15
-- Bump the release number for a chained build of nss-util, nss-softokn and nss
-
-* Thu Aug 27 2009 Elio Maldonado<emaldona@redhat.com> - 3.12.3.99.3-14
-- Cleanup nss-util-config.in
-
-* Thu Aug 27 2009 Elio Maldonado<emaldona@redhat.com> - 3.12.3.99.3-13
-- nss-util-devel doesn't require nss-devel
-
-* Wed Aug 26 2009 Elio Maldonado<emaldona@redhat.com> - 3.12.3.99.3-12
-- bump to unique nvr
-
-* Wed Aug 26 2009 Elio Maldonado<emaldona@redhat.com> - 3.12.3.99.3-11
-- Remove spurious executable permissions from nss-util-config
-- Shorten some descriptions to keep rpmlint happy
-
-* Mon Aug 24 2009 Dennis Gilmore <dennis@ausil.us> 3.12.3.99.3-10
-- dont include the headers in nss-util only in the -devel package
-- nss-util-devel Requires nss-devel since its only providing a subset of the headers.
-
-* Thu Aug 20 2009 Dennis Gilmore <dennis@ausil.us> 3.12.3.99.3-9
-- Provide nss-devel since we obsolete it
-
-* Thu Aug 19 2009 Elio Maldonado <emaldona@redhat.com> 3.12.3.99.3-8.1
-- nss-util-devel obsoletes nss-devel < 3.12.3.99.3-8
-
-* Thu Aug 19 2009 Elio Maldonado <emaldona@redhat.com> 3.12.3.99.3-8
-- Initial build
index 8ccc9b6a1f693e8ebe0c34e82cf0cb1b73cac360..584e28ef0b04f2522cf1e553de13a737beb978bf 100644 (file)
@@ -63,7 +63,7 @@ build
 
                # Extract tarball into nss directory.
                cd %{DIR_APP} && %{MACRO_EXTRACT} %{DIR_DL}/%{name}-pem-20100809.tar.bz2
-               
+
                # Apply all patches
                %{MACRO_PATCHES}
 
@@ -234,4 +234,8 @@ packages
                        /usr/lib/pkgconfig
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index b5293ab93a35679ac1ff5208a282de375633eb63..d5358cac162dc763abdfe1b7abad0cbd1e0f35b6 100644 (file)
@@ -95,4 +95,8 @@ packages
                        /lib/security/pam_ldap.so
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/oinkmaster/oinkmaster.nm b/oinkmaster/oinkmaster.nm
new file mode 100644 (file)
index 0000000..f9f5e6d
--- /dev/null
@@ -0,0 +1,47 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = oinkmaster
+version    = 2.0
+release    = 2
+arch       = noarch
+
+groups     = Development/Libraries
+url        = http://oinkmaster.sourceforge.net
+license    = BSD
+summary    = A Perl interface for updating snort rules.
+
+description
+       Oinkmaster is a script that will help you update and manage your Snort rules.
+end
+
+source_dl  =
+
+build
+       requires
+               perl
+       end
+
+       build
+               echo "url = http://rules.emergingthreats.net/open/suricata/emerging.rules.tar.gz" >> oinkmaster.conf
+               echo "tmpdir = /var/tmp/" >> oinkmaster.conf
+       end
+
+       install
+               mkdir -pv %{BUILDROOT}/usr/sbin
+               install -m 755 oinkmaster.pl %{BUILDROOT}/usr/sbin
+               mkdir -pv %{BUILDROOT}/etc
+               install -m 644 oinkmaster.conf %{BUILDROOT}/etc
+       end
+end
+
+packages
+       package %{name}
+
+               filter_requires
+                       perl>=[0-9]\:.*
+               end
+       end
+end
diff --git a/open-vm-tools/open-vm-tools.nm b/open-vm-tools/open-vm-tools.nm
new file mode 100644 (file)
index 0000000..cc483b2
--- /dev/null
@@ -0,0 +1,56 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = open-vm-tools
+version    = 2011.09.23-491607
+release    = 1
+
+groups     = Virtualization/Applications
+url        = http://open-vm-tools.sourceforge.net/
+license    = GPLv2
+summary    = Open source implementation of VMware Tools.
+
+description
+       The open Virtual Machine Tools (open-vm-tools) are the open \
+       source implementation of VMware Tools. They are a set of guest \
+       operation system virtualization components that enhance \
+       performance and user experience of virtual machines.
+end
+
+source_dl = http://sourceforge.net/projects/open-vm-tools/files/open-vm-tools/2011.09.23/
+
+build
+       requires
+               glib2-devel
+       end
+
+       configure_options += \
+               --sysconfdir=/etc \
+               --without-kernel-modules \
+               --without-x \
+               --without-procps \
+               --without-dnet \
+               --without-icu \
+               --without-pam \
+
+       prepare_cmds
+               sed -e "s/-Werror//g" -i configure
+       end
+
+       install_cmds
+               rm -vf %{BUILDROOT}/sbin/mount.vmhgfs
+               rm -vf %{BUILDROOT}/usr/sbin/mount.vmhgfs
+       end
+
+end
+
+packages
+       package %{name}
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
diff --git a/openjade/openjade.nm b/openjade/openjade.nm
new file mode 100644 (file)
index 0000000..7fe8c7f
--- /dev/null
@@ -0,0 +1,100 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = openjade
+version    = 1.3.2
+release    = 2
+
+groups     = Application/Text
+url        = http://openjade.sourceforge.net/
+license    = MIT
+summary    = A DSSSL implementation.
+
+description
+       OpenJade is an implementation of the ISO/IEC 10179:1996 standard DSSSL
+       (Document Style Semantics and Specification Language).
+end
+
+source_dl = http://downloads.sourceforge.net/project/%{name}/%{name}/%{thisapp}
+
+build
+       requires
+               gcc-c++
+               opensp-devel
+               perl
+       end
+
+       configure_options += \
+               --disable-static \
+               --disable-rpath \
+               --datadir=/usr/share/sgml/openjade-%{version} \
+               --enable-splibdir=/usr/lib
+
+       install_cmds
+               # Create symlink for jade
+               ln -s openjade %{BUILDROOT}/usr/bin/jade
+
+               # Install jade catalog
+               cp %{DIR_APP}/dsssl/catalog %{BUILDROOT}/usr/share/sgml/openjade-%{version}/
+               cp %{DIR_APP}/dsssl/{dsssl,style-sheet,fot}.dtd %{BUILDROOT}/usr/share/sgml/openjade-%{version}/
+
+               # Add unversioned/versioned catalog and symlink
+               mkdir -p %{BUILDROOT}/etc/sgml
+               touch %{BUILDROOT}/etc/sgml/openjade-%{version}.soc
+               ln -s openjade-%{version}.soc openjade.soc
+       end
+end
+
+packages
+       package %{name}
+               provides
+                       jade
+               end
+
+               requires
+                       docbook-dtds>=1.0-3
+                       libxml2
+                       opensp>=1.5.2-2
+                       sgml-common
+               end
+
+               prerequires +=\
+                       docbook-dtds>=1.0-3 \
+                       libxml2 \
+                       sgml-common
+
+               script postin
+                       # Install catalog files on system.
+                       /usr/bin/install-catalog --add /etc/sgml/openjade-%{version}.soc \
+                               /usr/share/sgml/%{name}-%{version}/catalog >/dev/null 2>/dev/null
+
+                       # Add openjade catalog to docbook catalogs.
+                       for catalog in /etc/sgml/*-docbook-*.cat; do
+                               /usr/bin/xmlcatalog --sgml --noout --add ${catalog} \
+                                       /usr/share/sgml/openjade-%{version}/catalog /dev/null 2>/dev/null
+                       done
+               end
+
+               script preun
+                       # Uninstall the catalog files.
+                       /usr/bin/install-catalog --remove /etc/sgml/%{name}-%{version}.soc \
+                               /usr/share/sgml/%{name}-%{version}/catalog >/dev/null 2>/dev/null
+
+                       # Remove openjade catalog from docbook catalogs.
+                       for catalog in /etc/sgml/*-docbook-*.cat; do
+                               /usr/bin/xmlcatalog --sgml --noout --remove ${catalog} \
+                                       /usr/share/sgml/openjade-%{version}/catalog > /dev/null 2>/dev/null
+                       done
+               end
+       end
+
+       package %{name}-devel
+               template DEVEL
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
diff --git a/openjade/patches/openjade-1.3.1-manpage.patch b/openjade/patches/openjade-1.3.1-manpage.patch
new file mode 100644 (file)
index 0000000..935ad2d
--- /dev/null
@@ -0,0 +1,5 @@
+--- openjade-1.3.1/docsrc/sgmlnorm.1.manpage   2002-06-13 17:45:48.000000000 +0100
++++ openjade-1.3.1/docsrc/sgmlnorm.1   2002-06-13 17:45:58.000000000 +0100
+@@ -1 +1 @@
+-.so man1/sgmlnorm.1
++.so man1/osgmlnorm.1
diff --git a/openjade/patches/openjade-1.3.1-nsl.patch b/openjade/patches/openjade-1.3.1-nsl.patch
new file mode 100644 (file)
index 0000000..48d1302
--- /dev/null
@@ -0,0 +1,21 @@
+--- openjade-1.3.1/config/configure.in.lr      2003-09-12 08:03:22.000000000 -0600
++++ openjade-1.3.1/config/configure.in 2003-09-12 08:03:44.000000000 -0600
+@@ -156,7 +156,6 @@
+     then
+         AC_MSG_RESULT(yes)
+       AC_DEFINE(SP_HAVE_SOCKET)
+-      AC_CHECK_LIB(nsl,main,LIBS="$LIBS -lnsl")
+       AC_CHECK_LIB(socket,main,LIBS="$LIBS -lsocket")
+       AC_MSG_CHECKING(h_errno in netdb.h)
+       AC_EGREP_HEADER(h_errno,netdb.h,
+--- openjade-1.3.1/configure.lr        2003-09-12 08:35:55.000000000 -0600
++++ openjade-1.3.1/configure   2003-09-12 08:36:07.000000000 -0600
+@@ -5530,7 +5530,7 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lnsl  $LIBS"
++LIBS="-lXXXnsl  $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+ #include "confdefs.h"
diff --git a/openjade/patches/openjade-1.3.2-gcc46.patch b/openjade/patches/openjade-1.3.2-gcc46.patch
new file mode 100644 (file)
index 0000000..962ac19
--- /dev/null
@@ -0,0 +1,82 @@
+If a class or struct has no user-defined default constructor, C++ doesn't
+allow you to default construct a const instance of it.
+
+https://bugs.gentoo.org/358021
+http://clang.llvm.org/compatibility.html#default_init_const
+http://gcc.gnu.org/PR44499
+
+
+--- a/jade/TeXFOTBuilder.cxx
++++ b/jade/TeXFOTBuilder.cxx
+@@ -88,6 +88,8 @@ public:
+       value.convertString(nic_.placement);
+       }
+     ExtensionFlowObj *copy() const { return new PageFloatFlowObj(*this); }
++  public:
++    PageFloatFlowObj() {}
+   private:
+     PageFloatNIC nic_;
+     StringC name_;
+@@ -101,6 +103,8 @@ public:
+       fotb.endPageFootnote();
+     }
+     ExtensionFlowObj *copy() const { return new PageFootnoteFlowObj(*this); }
++  public:
++    PageFootnoteFlowObj() {}
+   private:
+   };
+   //////////////////////////////////////////////////////////////////////
+--- a/jade/TransformFOTBuilder.cxx
++++ b/jade/TransformFOTBuilder.cxx
+@@ -41,6 +41,7 @@ public:
+   };
+   class EntityRefFlowObj : public TransformExtensionFlowObj {
+   public:
++    EntityRefFlowObj() {}
+     void atomic(TransformFOTBuilder &fotb, const NodePtr &) const {
+       fotb.entityRef(name_);
+     }
+@@ -56,6 +57,7 @@ public:
+   };
+   class ProcessingInstructionFlowObj : public TransformExtensionFlowObj {
+   public:
++    ProcessingInstructionFlowObj() {}
+     void atomic(TransformFOTBuilder &fotb, const NodePtr &) const {
+       fotb.processingInstruction(data_);
+     }
+@@ -98,6 +100,8 @@ public:
+       }
+     }
+     ExtensionFlowObj *copy() const { return new EmptyElementFlowObj(*this); }
++  public:
++    EmptyElementFlowObj() {}
+   private:
+     ElementNIC nic_;
+   };
+@@ -133,6 +137,8 @@ public:
+       }
+     }
+     ExtensionFlowObj *copy() const { return new ElementFlowObj(*this); }
++  public:
++    ElementFlowObj() {}
+   private:
+     ElementNIC nic_;
+   };
+@@ -150,6 +156,8 @@ public:
+       value.convertString(systemId_);
+     }
+     ExtensionFlowObj *copy() const { return new EntityFlowObj(*this); }
++  public:
++    EntityFlowObj() {}
+   private:
+     StringC systemId_;
+   };
+@@ -174,6 +182,8 @@ public:
+       }
+     }
+     ExtensionFlowObj *copy() const { return new DocumentTypeFlowObj(*this); }
++  public:
++    DocumentTypeFlowObj() {}
+   private:
+     DocumentTypeNIC nic_;
+   };
diff --git a/openjade/patches/openjade-deplibs.patch b/openjade/patches/openjade-deplibs.patch
new file mode 100644 (file)
index 0000000..3466ad7
--- /dev/null
@@ -0,0 +1,40 @@
+diff -urNp openjade-1.3.2/grove/Makefile.sub devel/grove/Makefile.sub
+--- openjade-1.3.2/grove/Makefile.sub  2002-10-20 23:47:24.000000000 +0200
++++ devel/grove/Makefile.sub   2007-07-23 15:39:23.000000000 +0200
+@@ -1,4 +1,4 @@
+ LTVERSION=0:1:0
+ LIB=ogrove
+-DEPLIBS=-lm
++DEPLIBS=-lm -lstdc++
+ OBJS=Node.o LocNode.o
+diff -urNp openjade-1.3.2/spgrove/Makefile.sub devel/spgrove/Makefile.sub
+--- openjade-1.3.2/spgrove/Makefile.sub        2002-11-15 23:46:50.000000000 +0100
++++ devel/spgrove/Makefile.sub 2007-07-23 16:06:13.000000000 +0200
+@@ -1,9 +1,10 @@
+ LTVERSION=0:1:0
+ LIB=ospgrove
+ INCLUDE=-I$(srcdir)/../grove
+-DEPLIBS=-lm -L$(TOP)/grove -L$(TOP)/grove/.libs \
++DEPLIBS=$(TOP)/grove/libogrove.la \
++       -lm -losp -L$(TOP)/grove/.libs \
+       -L$(TOP)/lib -L$(TOP)/lib/.libs \
+-      $(LIB_THREADS)
++      $(LIB_THREADS) -lstdc++
+ OBJS=GroveApp.o GroveBuilder.o SdNode.o
+ GENSRCS=grove_inst.cxx
+diff -urNp openjade-1.3.2/style/Makefile.sub devel/style/Makefile.sub
+--- openjade-1.3.2/style/Makefile.sub  2003-04-18 19:18:10.000000000 +0200
++++ devel/style/Makefile.sub   2007-07-23 16:08:26.000000000 +0200
+@@ -1,8 +1,8 @@
+ LTVERSION=0:1:0
+ LIB=ostyle
+-DEPLIBS=-lm -L$(TOP)/grove -L$(TOP)/grove/.libs \
+-  -L$(TOP)/lib -L$(TOP)/lib/.libs \
+-  -L$(TOP)/spgrove -L$(TOP)/spgrove/.libs 
++DEPLIBS=$(TOP)/grove/libogrove.la $(TOP)/spgrove/libospgrove.la \
++  -lm -losp -L$(TOP)/lib -L$(TOP)/lib/.libs -L$(TOP)/grove/.libs \
++  -L$(TOP)/spgrove -L$(TOP)/spgrove/.libs -lstdc++
+ OBJS=LangObj.o \
+   Collector.o \
+   DssslApp.o \
diff --git a/openjade/patches/openjade-nola.patch b/openjade/patches/openjade-nola.patch
new file mode 100644 (file)
index 0000000..1e23ca5
--- /dev/null
@@ -0,0 +1,12 @@
+diff -urNp openjade-1.3.2-orig/jade/Makefile.sub openjade-1.3.2/jade/Makefile.sub
+--- openjade-1.3.2-orig/jade/Makefile.sub      2002-11-15 23:46:50.000000000 +0100
++++ openjade-1.3.2/jade/Makefile.sub   2009-02-13 11:52:30.000000000 +0100
+@@ -4,7 +4,7 @@ OBJS=jade.o SgmlFOTBuilder.o RtfFOTBuild
+ INCLUDE=-I$(srcdir)/../grove -I$(srcdir)/../spgrove -I$(srcdir)/../style
+ # XLIBS=../style/libostyle.a ../spgrove/libospgrove.a ../grove/libogrove.a \
+ #   ../lib/libosp.a
+-XLIBS=../style/libostyle.a ../spgrove/libospgrove.a ../grove/libogrove.a $(splibdir)/libosp.a
++XLIBS=../style/libostyle.a ../spgrove/libospgrove.a ../grove/libogrove.a $(splibdir)/libosp.so
+ GENSRCS=JadeMessages.h HtmlMessages.h RtfMessages.h TeXMessages.h \
+  HtmlFOTBuilder_inst.cxx RtfFOTBuilder_inst.cxx  TeXFOTBuilder_inst.cxx \
+  TransformFOTBuilder_inst.cxx MifMessages.h MifFOTBuilder_inst.cxx
index 38ce8eaf3aecea2f3e84b7a78b259ec973f3537e..24003493244b17e256a56c737bca9818d9e5025e 100644 (file)
@@ -56,4 +56,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 028ca96e20f5cec27a1f8598cca6bd5f42340c84..fa98c0f93c688f46ebeaae5291d850ebc1f6262f 100644 (file)
@@ -93,4 +93,8 @@ packages
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/opensp/opensp.nm b/opensp/opensp.nm
new file mode 100644 (file)
index 0000000..39b1592
--- /dev/null
@@ -0,0 +1,67 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = opensp
+version    = 1.5.2
+release    = 2
+
+groups     = Application/Text
+url        = http://openjade.sourceforge.net/
+license    = MIT
+summary    = SGML and XML parser.
+
+description
+       OpenSP is an implementation of the ISO/IEC 8879:1986 standard SGML
+       (Standard Generalized Markup Language).
+end
+
+source_dl = http://downloads.sourceforge.net/project/%{name}/%{name}/%{thisapp}
+
+thisapp = OpenSP-%{version}
+
+build
+       requires
+               gcc-c++
+               docbook-dtds
+               docbook-xsl
+               libxml2
+               libxslt
+               xmlto
+       end
+
+       configure_options += \
+               --mandir=/usr/share/man/ \
+               --disable-dependency-tracking \
+               --disable-static \
+               --disable-rpath \
+               --enable-http \
+               --enable-default-catalog=/etc/sgml/catalog \
+               --enable-default-search-path=/usr/share/sgml:/usr/share/xml
+
+       install_cmds
+               # Create symlinks and manpages for binaries wtitout "o".
+               for file in nsgmls sgmlnorm spam spent sx ; do
+                       ln -s o${file} %{BUILDROOT}/usr/bin/${file}
+                       echo ".so man1/o${file}.1" > %{BUILDROOT}/usr/share/man/man1/${file}.1
+               done
+
+               # Rename sx to sgml2xml.
+               mv %{BUILDROOT}/usr/bin/sx %{BUILDROOT}/usr/bin/sgml2xml
+               mv %{BUILDROOT}/usr/share/man//man1/{sx,sgml2xml}.1
+       end
+
+end
+
+packages
+       package %{name}
+
+       package %{name}-devel
+               template DEVEL
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
diff --git a/opensp/patches/opensp-multilib.patch b/opensp/patches/opensp-multilib.patch
new file mode 100644 (file)
index 0000000..a988613
--- /dev/null
@@ -0,0 +1,91 @@
+--- OpenSP-1.5.2/configure.in.multilib 2005-12-23 14:15:21.000000000 +0000
++++ OpenSP-1.5.2/configure.in  2006-06-13 13:36:49.000000000 +0100
+@@ -90,7 +90,7 @@
+ #define SP_SIZEOF_BOOL_1
+ #endif
+-#if (SIZEOF_WCHAR_T == SIZEOF_UNSIGNED_SHORT)
++#if (WCHAR_MAX == SHRT_MAX)
+ #define SP_WCHAR_T_USHORT
+ #endif
+--- OpenSP-1.5.2/lib/parser_inst.cxx.multilib  2005-07-21 16:33:41.000000000 +0100
++++ OpenSP-1.5.2/lib/parser_inst.cxx   2006-06-13 13:36:49.000000000 +0100
+@@ -9,6 +9,7 @@
+ // Copyright (c) 1994 James Clark
+ // See the file COPYING for copying permission.
++#include <limits.h>
+ #include "splib.h"
+ #ifdef SP_MANUAL_INST
+@@ -1338,7 +1339,7 @@
+ #endif
+ #endif
+  // we really just want to test if size_t == unsigned int
+-#if !defined(SIZEOF_SIZE_T) || !defined(SIZEOF_UNSIGNED_INT) || (SIZEOF_SIZE_T != SIZEOF_UNSIGNED_INT)
++#if INT_MAX != SSIZE_MAX
+ #ifdef __DECCXX
+ #pragma define_template Vector<unsigned int>
+ #else
+--- OpenSP-1.5.2/lib/parser_inst.m4.multilib   2005-05-14 10:17:35.000000000 +0100
++++ OpenSP-1.5.2/lib/parser_inst.m4    2006-06-13 13:36:49.000000000 +0100
+@@ -1,6 +1,7 @@
+ // Copyright (c) 1994 James Clark
+ // See the file COPYING for copying permission.
++#include <limits.h>
+ #include "splib.h"
+ #ifdef SP_MANUAL_INST
+@@ -166,7 +167,7 @@
+ __instantiate(Vector<LeafContentToken*>)
+ __instantiate(Vector<size_t>)
+  // we really just want to test if size_t == unsigned int
+-#if !defined(SIZEOF_SIZE_T) || !defined(SIZEOF_UNSIGNED_INT) || (SIZEOF_SIZE_T != SIZEOF_UNSIGNED_INT)
++#if INT_MAX != SSIZE_MAX
+ __instantiate(Vector<unsigned int>)
+ #endif
+--- OpenSP-1.5.2/config.h.in.multilib  2005-11-05 09:43:42.000000000 +0000
++++ OpenSP-1.5.2/config.h.in   2006-06-13 13:41:45.000000000 +0100
+@@ -1,5 +1,7 @@
+ /* config.h.in.  Generated from configure.in by autoheader.  */
++#include <limits.h>
++
+ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+    systems. This function is required for `alloca.c' support on those systems.
+    */
+@@ -333,22 +335,6 @@
+ /* The size of a `bool', as computed by sizeof. */
+ #undef SIZEOF_BOOL
+-/* The size of a `size_t', as computed by sizeof. */
+-#undef SIZEOF_SIZE_T
+-
+-/* The size of a `unsigned int', as computed by sizeof. */
+-#undef SIZEOF_UNSIGNED_INT
+-
+-/* The size of a `unsigned short', as computed by sizeof. */
+-#undef SIZEOF_UNSIGNED_SHORT
+-
+-/* The size of a `wchar_t', as computed by sizeof. */
+-#undef SIZEOF_WCHAR_T
+-
+-/* Define as the maximum value of type 'size_t', if the system doesn't define
+-   it. */
+-#undef SIZE_MAX
+-
+ /* define this if h_errno should be declared extern int */
+ #undef SP_DECLARE_H_ERRNO
+@@ -503,7 +489,7 @@
+ #define SP_SIZEOF_BOOL_1
+ #endif
+-#if (SIZEOF_WCHAR_T == SIZEOF_UNSIGNED_SHORT)
++#if (WCHAR_MAX == SHRT_MAX)
+ #define SP_WCHAR_T_USHORT
+ #endif
diff --git a/opensp/patches/opensp-nodeids.patch b/opensp/patches/opensp-nodeids.patch
new file mode 100644 (file)
index 0000000..4e539d0
--- /dev/null
@@ -0,0 +1,128 @@
+--- OpenSP-1.5.2/docsrc/releasenotes.xml.nodeids       2006-10-13 13:54:59.000000000 +0100
++++ OpenSP-1.5.2/docsrc/releasenotes.xml       2006-10-13 13:58:25.000000000 +0100
+@@ -1,7 +1,7 @@
+ <?xml version='1.0'?>
+ <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+-<book>
++<book id="relnotesb">
+   <bookinfo>
+     <title>OpenSP 1.5.2</title>
+     <subtitle>Release Notes</subtitle>
+@@ -16,7 +16,7 @@
+     </copyright>
+   </bookinfo>
+-  <chapter><title>OpenSP 1.5.2 Release Notes</title>
++  <chapter id="relnotesc"><title>OpenSP 1.5.2 Release Notes</title>
+     <para>The OpenJade project provides a suite of tools and libraries for
+ validating, processing and applying DSSSL (Document Style Semantics and
+@@ -29,7 +29,7 @@
+ can be used as a basis for either open source or commerical projects. The
+ library can be built as either a dynamic or static library.
+ </para>
+-    <sect1><title>Applications of OpenSP</title>
++    <sect1 id="apps"><title>Applications of OpenSP</title>
+       <para>The OpenSP library has been used in a number of projects. The
+ World Wide Web consortium on-line HTML and XHTML validator is based on the
+ OpenSP library. In addition to the OpenSP library a set of command line tools
+@@ -41,7 +41,7 @@
+ tools.</para>
+     </sect1>
+-    <sect1><title>Obtaining OpenSP</title>
++    <sect1 id="obtaining"><title>Obtaining OpenSP</title>
+       <para>OpenSP is a project hosted at sourceforge.net and is available
+ from the OpenJade web site at http://openjade.sourceforge.net or directly from
+ the OpenJade project page at http://sourceforge.net/projects/openjade</para>
+@@ -49,7 +49,7 @@
+ linkend="bindist"/> for information on how to obtain pre-compiled
+ binary packages.</para>
+     </sect1>
+-    <sect1><title>Supported Platforms</title>
++    <sect1 id="supported"><title>Supported Platforms</title>
+       <para>OpenSP is intended to be as portable as possible. It should be
+ possible to compile and build on most contemporary UNIX type platforms. In
+ addition OpenSP should also build on Microsoft's Win32 based operating
+@@ -166,7 +166,7 @@
+ <email>openjade-devel@lists.sourceforge.net</email>, including any
+ diffs/patches you have used.</para>
+     </sect1>
+-    <sect1><title>Building OpenSP from Source</title>
++    <sect1 id="building"><title>Building OpenSP from Source</title>
+       <para>OpenSP requires 20Mb to 50Mb of disk space to build. An
+ installation will require around 10Mb to 20Mb depending on
+ architecture.</para>
+@@ -249,7 +249,7 @@
+ the latest version of OpenSP to be available from your distributor in due
+ course.</para>
+     </sect1>
+-    <sect1><title>Installation</title>
++    <sect1 id="installation"><title>Installation</title>
+       <para>In addition to the OpenSP executables and libraries you will also
+ need various DTDs and declaration files. Some DTDs and associated files
+ (entity definitions) are available in the <filename>pubtext</filename>
+@@ -263,7 +263,7 @@
+ recommended that you set up and use such a catalog system.
+ </para>
+     </sect1>
+-    <sect1><title>Support</title>
++    <sect1 id="support"><title>Support</title>
+       <para>If, after reading the documentation, you still have a problem,
+ then you may require some additional help. The OpenJade project is a volunteer
+ effort and as such does not provide any formal support. Instead, you should
+@@ -299,7 +299,7 @@
+ often the case that someone has had the same problem before.</para>
+     </sect1>
+-    <sect1><title>Version 1.5.2</title>
++    <sect1 id="v152"><title>Version 1.5.2</title>
+       <formalpara><title>Released December 2005.</title>
+       <para>The release contains a number of enhancements together with
+ support for version 4.0 of the GNU C++ compiler.</para>
+@@ -418,7 +418,7 @@
+       </table>
+     </sect1>
+-    <sect1><title>Version 1.5.1</title>
++    <sect1 id="v151"><title>Version 1.5.1</title>
+       <formalpara><title>Released October 2003.</title>
+       <para>The release contains a number of new features together with
+ support for version 3.3 for the GNU C++ compiler.</para>
+@@ -613,7 +613,7 @@
+       </table>
+     </sect1>
+-    <sect1><title>Version 1.5</title>
++    <sect1 id="v15"><title>Version 1.5</title>
+       <formalpara><title>Released November 2002.</title>
+       <para>In addition to many new features this version also supports the
+ latest GNU C++ compiler: gcc 3.2 at the time of writing.</para>
+@@ -976,7 +976,7 @@
+       </tgroup>
+       </table>
+     </sect1>
+-    <sect1>
++    <sect1 id="v14">
+       <title>Version 1.4</title>
+       <formalpara><title>Released February 2000</title>
+       <para>Version 1.4 added many improvements. Changes
+@@ -1023,7 +1023,7 @@
+       </listitem>
+       </itemizedlist>
+     </sect1>
+-    <sect1><title>Version 1.3.4</title>
++    <sect1 id="v134"><title>Version 1.3.4</title>
+       <formalpara><title>Released October 1999</title>
+       <para>The second release from the OpenJade project. This version was
+ distributed as part of OpenJade 1.3</para>
+@@ -1040,7 +1040,7 @@
+       </itemizedlist>
+     </sect1>
+-    <sect1><title>Version 1.3.3</title>
++    <sect1 id="v133"><title>Version 1.3.3</title>
+       <para>The first release from the OpenJade project</para>
+     </sect1>
+   </chapter>
diff --git a/opensp/patches/opensp-sigsegv.patch b/opensp/patches/opensp-sigsegv.patch
new file mode 100644 (file)
index 0000000..69bd3a9
--- /dev/null
@@ -0,0 +1,20 @@
+--- OpenSP-1.5.2/lib/ExtendEntityManager.cxx   2005-11-05 10:05:20.000000000 +0100
++++ OpenSP-1.5.2.new/lib/ExtendEntityManager.cxx       2007-06-21 12:56:26.000000000 +0200
+@@ -1238,7 +1238,8 @@ StorageObjectSpec::StorageObjectSpec()
+ }
+ StorageObjectSpec::StorageObjectSpec(const StorageObjectSpec& x)
+-: codingSystemName(x.codingSystemName),
++: storageManager(x.storageManager),
++  codingSystemName(x.codingSystemName),
+   codingSystem(x.codingSystem),
+   specId(x.specId),
+   baseId(x.baseId),
+@@ -1253,6 +1254,7 @@ StorageObjectSpec::StorageObjectSpec(con
+ StorageObjectSpec& StorageObjectSpec::operator=(const StorageObjectSpec& x)
+ {
+   if (this != &x) {
++    storageManager = x.storageManager;
+     codingSystemName = x.codingSystemName;
+     codingSystem = x.codingSystem;
+     specId = x.specId;
index 3deb364014b1e1e35a810d87c148742d64ede347..199ed101c3d9e9daae7dc9efdc04c9c2f394838f 100644 (file)
@@ -4,27 +4,28 @@
 ###############################################################################
 
 name       = openssh
-version    = 5.8p1
-release    = 8
+version    = 5.9p1
+release    = 2
 
-maintainer =
 groups     = Application/Internet
 url        = http://www.openssh.com/portable.html
 license    = MIT
 summary    = An open source implementation of SSH protocol versions 1 and 2.
 
 description
-       SSH (Secure SHell) is a program for logging into and executing \
-       commands on a remote machine. SSH is intended to replace rlogin and \
-       rsh, and to provide secure encrypted communications between two \
+       SSH (Secure SHell) is a program for logging into and executing
+       commands on a remote machine. SSH is intended to replace rlogin and
+       rsh, and to provide secure encrypted communications between two
        untrusted hosts over an insecure network.
 end
 
-source_dl  =
+source_dl  = http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/
 
 build
        requires
                audit-devel
+               autoconf
+               automake
                libselinux-devel
                nss-devel
                openssl-devel>=1.0.0d-2
@@ -34,22 +35,35 @@ build
 
        # Apply patches in a special order
        patches
-               openssh-5.6p1-redhat.patch
+               openssh-5.9p1-coverity.patch
                openssh-5.8p1-fingerprint.patch
-               openssh-5.8p1-authorized-keys-command.patch
-               openssh-5.8p1-selinux.patch
-               openssh-5.8p1-selinux-role.patch
-               openssh-5.8p1-mls.patch
-               openssh-5.6p1-keygen.patch
+               openssh-5.8p1-getaddrinfo.patch
+               openssh-5.8p1-packet.patch
+               openssh-5.9p1-2auth.patch
+               openssh-5.9p1-role.patch
+               openssh-5.9p1-mls.patch
+               openssh-5.9p1-sftp-chroot.patch
+               openssh-5.9p1-akc.patch
+               openssh-5.9p1-keygen.patch
                openssh-5.2p1-allow-ip-opts.patch
-               openssh-5.8p1-randclean.patch
-               openssh-5.8p1-kuserok.patch
+               openssh-5.9p1-randclean.patch
+               openssh-5.8p1-keyperm.patch
+               openssh-5.8p2-remove-stale-control-socket.patch
+               openssh-5.9p1-ipv6man.patch
+               openssh-5.8p2-sigpipe.patch
+               openssh-5.8p2-askpass-ld.patch
                openssh-5.5p1-x11.patch
                openssh-5.6p1-exit-deadlock.patch
                openssh-5.1p1-askpass-progress.patch
                openssh-4.3p2-askpass-grab-info.patch
-               openssh-5.2p1-edns.patch
+               openssh-5.9p1-edns.patch
                openssh-5.1p1-scp-manpage.patch
+               openssh-5.8p1-localdomain.patch
+               openssh-5.9p1-ipfire.patch
+               openssh-5.9p1-entropy.patch
+               openssh-5.9p1-vendor.patch
+               openssh-5.8p2-force_krb.patch
+               openssh-5.9p1-kuserok.patch
        end
 
        configure_options += \
@@ -60,12 +74,15 @@ build
                --with-privsep-path=/var/lib/sshd \
                --with-pam \
                --with-selinux \
-               --with-nss \
                --with-audit=linux
 
+       prepare_cmds
+               autoreconf
+       end
+
        install_cmds
-               mkdir -pv %{BUILDROOT}/etc/ssh
-               cp -vf %{DIR_SOURCE}/sshd_config %{BUILDROOT}/etc/ssh/sshd_config
+               # Disable GSS API authentication because KRB5 is required for that.
+               sed -e "s/^.*GSSAPIAuthentication/#&/" -i %{BUILDROOT}/etc/ssh/ssh_config
 
                # Install scriptfile for key generation
                install -m 754 %{DIR_SOURCE}/ssh-keygen %{BUILDROOT}/usr/lib/openssh/
@@ -79,11 +96,11 @@ packages
                        openssh-server=%{thisver}
                end
        end
-       
+
        package openssh-clients
                summary = OpenSSH client applications.
                description = %{summary}
-       
+
                files
                        /etc/ssh/ssh_config
                        /usr/bin/scp
@@ -104,15 +121,19 @@ packages
                        /usr/share/man/cat5/ssh_config.5
                        /usr/share/man/cat8/ssh-pkcs11-helper.8
                end
+
+               configfiles
+                       /etc/ssh/ssh_config
+               end
        end
-       
+
        package openssh-server
                summary = OpenSSH server applications.
                description = %{summary}
-       
+
                # /usr/bin/ssh-keygen is needed to generate keys for the ssh server.
                requires = /usr/bin/ssh-keygen
-       
+
                files
                        /etc/pam.d/sshd
                        /etc/ssh/moduli
@@ -127,17 +148,39 @@ packages
                        /usr/share/man/cat8/sftp-server.8*
                        /var/lib/sshd
                end
-       
-               script postin
+
+               configfiles
+                       /etc/ssh/sshd_config
+               end
+
+               prerequires = shadow-utils systemd-units
+
+               script prein
                        # Create unprivileged user and group.
                        getent group sshd || groupadd -r sshd
                        getent passwd sshd || useradd -r -g sshd \
                                -d /var/lib/sshd -s /sbin/nologin sshd
-       
-                       systemctl --system daemon-reload
-                       systemctl enable openssh.service
                end
-       
-               #script postup = postin
+
+               script postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       /bin/systemctl --no-reload disable openssh.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop openssh.service >/dev/null 2>&1 || :
+               end
+
+               script postun
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
diff --git a/openssh/patches/openssh-5.6p1-keygen.patch b/openssh/patches/openssh-5.6p1-keygen.patch
deleted file mode 100644 (file)
index 9d7fce2..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-diff -up openssh-5.6p1/ssh-keygen.0.keygen openssh-5.6p1/ssh-keygen.0
---- openssh-5.6p1/ssh-keygen.0.keygen  2010-08-22 16:30:03.000000000 +0200
-+++ openssh-5.6p1/ssh-keygen.0 2010-08-23 12:37:19.000000000 +0200
-@@ -4,7 +4,7 @@ NAME
-      ssh-keygen - authentication key generation, management and conversion
- SYNOPSIS
--     ssh-keygen [-q] [-b bits] -t type [-N new_passphrase] [-C comment]
-+     ssh-keygen [-q] [-o] [-b bits] -t type [-N new_passphrase] [-C comment]
-                 [-f output_keyfile]
-      ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]
-      ssh-keygen -i [-m key_format] [-f input_keyfile]
-@@ -232,6 +232,8 @@ DESCRIPTION
-      -q      Silence ssh-keygen.  Used by /etc/rc when creating a new key.
-+     -o      Overwrite the key without prompting user.
-+
-      -R hostname
-              Removes all keys belonging to hostname from a known_hosts file.
-              This option is useful to delete hashed hosts (see the -H option
-diff -up openssh-5.6p1/ssh-keygen.1.keygen openssh-5.6p1/ssh-keygen.1
---- openssh-5.6p1/ssh-keygen.1.keygen  2010-08-05 05:05:32.000000000 +0200
-+++ openssh-5.6p1/ssh-keygen.1 2010-08-23 12:36:25.000000000 +0200
-@@ -47,6 +47,7 @@
- .Bk -words
- .Nm ssh-keygen
- .Op Fl q
-+.Op Fl o
- .Op Fl b Ar bits
- .Fl t Ar type
- .Op Fl N Ar new_passphrase
-@@ -397,6 +398,8 @@ Silence
- Used by
- .Pa /etc/rc
- when creating a new key.
-+.It Fl o
-+Overwrite the key without prompting user.
- .It Fl R Ar hostname
- Removes all keys belonging to
- .Ar hostname
-diff -up openssh-5.6p1/ssh-keygen.c.keygen openssh-5.6p1/ssh-keygen.c
---- openssh-5.6p1/ssh-keygen.c.keygen  2010-08-05 05:05:32.000000000 +0200
-+++ openssh-5.6p1/ssh-keygen.c 2010-08-23 12:34:40.000000000 +0200
-@@ -72,6 +72,7 @@ int change_passphrase = 0;
- int change_comment = 0;
- int quiet = 0;
-+int overwrite = 0;
- int log_level = SYSLOG_LEVEL_INFO;
-@@ -1798,7 +1799,7 @@ main(int argc, char **argv)
-               exit(1);
-       }
--      while ((opt = getopt(argc, argv, "degiqpclBHLhvxXyF:b:f:t:D:I:P:m:N:n:"
-+      while ((opt = getopt(argc, argv, "degiqopclBHLhvxXyF:b:f:t:D:I:P:m:N:n:"
-           "O:C:r:g:R:T:G:M:S:s:a:V:W:z:")) != -1) {
-               switch (opt) {
-               case 'b':
-@@ -1878,6 +1879,9 @@ main(int argc, char **argv)
-               case 'q':
-                       quiet = 1;
-                       break;
-+              case 'o':
-+                      overwrite = 1;
-+                      break;
-               case 'e':
-               case 'x':
-                       /* export key */
-@@ -2124,7 +2128,7 @@ main(int argc, char **argv)
-               }
-       }
-       /* If the file already exists, ask the user to confirm. */
--      if (stat(identity_file, &st) >= 0) {
-+      if (!overwrite && stat(identity_file, &st) >= 0) {
-               char yesno[3];
-               printf("%s already exists.\n", identity_file);
-               printf("Overwrite (y/n)? ");
index f4560a94486bf3cd1b0c6b0d151a0aec7945b616..d1df8c122ee67e7e8707cc81b309999e01dd709a 100644 (file)
@@ -1,7 +1,7 @@
 diff -up openssh-5.6p1/ssh_config.redhat openssh-5.6p1/ssh_config
 --- openssh-5.6p1/ssh_config.redhat    2010-01-12 09:40:27.000000000 +0100
 +++ openssh-5.6p1/ssh_config   2010-09-03 15:21:17.000000000 +0200
-@@ -45,3 +45,14 @@
+@@ -45,3 +45,16 @@
  #   PermitLocalCommand no
  #   VisualHostKey no
  #   ProxyCommand ssh -q -W %h:%p gateway.example.com
@@ -11,6 +11,8 @@ diff -up openssh-5.6p1/ssh_config.redhat openssh-5.6p1/ssh_config
 +# to the original X11 display. As virtually no X11 client supports the untrusted
 +# mode correctly we set this to yes.
 +      ForwardX11Trusted yes
++# Look up the host key SSHFP records
++      VerifyHostKeyDNS ask
 +# Send locale-related environment variables
 +      SendEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES 
 +      SendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT 
diff --git a/openssh/patches/openssh-5.8p1-getaddrinfo.patch b/openssh/patches/openssh-5.8p1-getaddrinfo.patch
new file mode 100644 (file)
index 0000000..6f64067
--- /dev/null
@@ -0,0 +1,11 @@
+diff -up openssh-5.8p1/sshconnect.c.getaddrinfo openssh-5.8p1/sshconnect.c
+--- openssh-5.8p1/sshconnect.c.getaddrinfo     2011-04-27 09:51:44.521384633 +0200
++++ openssh-5.8p1/sshconnect.c 2011-04-27 09:53:21.224443308 +0200
+@@ -355,6 +355,7 @@ ssh_connect(const char *host, struct soc
+       memset(&hints, 0, sizeof(hints));
+       hints.ai_family = family;
+       hints.ai_socktype = SOCK_STREAM;
++      hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG;
+       snprintf(strport, sizeof strport, "%u", port);
+       if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0)
+               fatal("%s: Could not resolve hostname %.100s: %s", __progname,
diff --git a/openssh/patches/openssh-5.8p1-keyperm.patch b/openssh/patches/openssh-5.8p1-keyperm.patch
new file mode 100644 (file)
index 0000000..6167c14
--- /dev/null
@@ -0,0 +1,25 @@
+diff -up openssh-5.8p1/authfile.c.keyperm openssh-5.8p1/authfile.c
+--- openssh-5.8p1/authfile.c.keyperm   2010-12-01 02:03:39.000000000 +0100
++++ openssh-5.8p1/authfile.c   2011-04-21 16:43:36.859648916 +0200
+@@ -57,6 +57,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <grp.h>
+ #include "xmalloc.h"
+ #include "cipher.h"
+@@ -600,6 +612,13 @@ key_perm_ok(int fd, const char *filename
+ #ifdef HAVE_CYGWIN
+       if (check_ntsec(filename))
+ #endif
++      if (st.st_mode & 040) {
++              struct group *gr;
++
++              if ((gr = getgrnam("ssh_keys")) && (st.st_gid == gr->gr_gid))
++                      st.st_mode &= ~040;
++      }
++
+       if ((st.st_uid == getuid()) && (st.st_mode & 077) != 0) {
+               error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
+               error("@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @");
diff --git a/openssh/patches/openssh-5.8p1-localdomain.patch b/openssh/patches/openssh-5.8p1-localdomain.patch
new file mode 100644 (file)
index 0000000..2f21658
--- /dev/null
@@ -0,0 +1,14 @@
+diff -up openssh-5.8p1/sshd_config.localdomain openssh-5.8p1/sshd_config
+--- openssh-5.8p1/sshd_config.localdomain      2011-04-22 11:37:49.273648812 +0200
++++ openssh-5.8p1/sshd_config  2011-04-22 11:39:31.758648401 +0200
+@@ -130,6 +130,10 @@ X11Forwarding yes
+ # override default of no subsystems
+ Subsystem     sftp    /usr/libexec/sftp-server
++# Uncomment this if you want to use .local domain
++#Host *.local
++#     CheckHostIP no
++
+ # Example of overriding settings on a per-user basis
+ #Match User anoncvs
+ #     X11Forwarding no
diff --git a/openssh/patches/openssh-5.8p1-packet.patch b/openssh/patches/openssh-5.8p1-packet.patch
new file mode 100644 (file)
index 0000000..4951af6
--- /dev/null
@@ -0,0 +1,12 @@
+diff -up openssh-5.8p1/packet.c.packet openssh-5.8p1/packet.c
+--- openssh-5.8p1/packet.c.packet      2011-04-05 13:29:06.998648899 +0200
++++ openssh-5.8p1/packet.c     2011-04-05 13:30:32.967648596 +0200
+@@ -294,6 +294,8 @@ packet_connection_is_on_socket(void)
+       struct sockaddr_storage from, to;
+       socklen_t fromlen, tolen;
++      if (!active_state)
++              return 0;
+       /* filedescriptors in and out are the same, so it's a socket */
+       if (active_state->connection_in == active_state->connection_out)
+               return 1;
diff --git a/openssh/patches/openssh-5.8p1-randclean.patch b/openssh/patches/openssh-5.8p1-randclean.patch
deleted file mode 100644 (file)
index 378f367..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -up openssh-5.8p1/entropy.c.randclean openssh-5.8p1/entropy.c
---- openssh-5.8p1/entropy.c.randclean  2011-01-13 11:05:29.000000000 +0100
-+++ openssh-5.8p1/entropy.c    2011-02-14 00:26:31.000000000 +0100
-@@ -159,6 +159,9 @@ init_rng(void)
-               fatal("OpenSSL version mismatch. Built against %lx, you "
-                   "have %lx", (u_long)OPENSSL_VERSION_NUMBER, SSLeay());
-+      /* clean the PRNG status when exiting the program */
-+      atexit(RAND_cleanup);
-+
- #ifndef OPENSSL_PRNG_ONLY
-       original_uid = getuid();
-       original_euid = geteuid();
diff --git a/openssh/patches/openssh-5.8p1-selinux.patch b/openssh/patches/openssh-5.8p1-selinux.patch
deleted file mode 100644 (file)
index 6967cbd..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up openssh-5.8p1/openbsd-compat/port-linux.c.selinux openssh-5.8p1/openbsd-compat/port-linux.c
---- openssh-5.8p1/openbsd-compat/port-linux.c.selinux  2011-02-12 09:38:45.000000000 +0100
-+++ openssh-5.8p1/openbsd-compat/port-linux.c  2011-02-12 09:39:10.000000000 +0100
-@@ -213,7 +213,7 @@ ssh_selinux_setfscreatecon(const char *p
-       if (!ssh_selinux_enabled())
-               return;
--      if (path == NULL)
-+      if (path == NULL) {
-               setfscreatecon(NULL);
-               return;
-       }
diff --git a/openssh/patches/openssh-5.8p2-askpass-ld.patch b/openssh/patches/openssh-5.8p2-askpass-ld.patch
new file mode 100644 (file)
index 0000000..5b85c80
--- /dev/null
@@ -0,0 +1,18 @@
+diff -up openssh-5.8p2/contrib/Makefile.askpass-ld openssh-5.8p2/contrib/Makefile
+--- openssh-5.8p2/contrib/Makefile.askpass-ld  2011-08-08 22:54:06.050546199 +0200
++++ openssh-5.8p2/contrib/Makefile     2011-08-08 22:54:43.364420118 +0200
+@@ -2,12 +2,12 @@ all:
+       @echo "Valid targets: gnome-ssh-askpass1 gnome-ssh-askpass2"
+ gnome-ssh-askpass1: gnome-ssh-askpass1.c
+-      $(CC) `gnome-config --cflags gnome gnomeui` \
++      $(CC) ${CFLAGS} `gnome-config --cflags gnome gnomeui` \
+               gnome-ssh-askpass1.c -o gnome-ssh-askpass1 \
+               `gnome-config --libs gnome gnomeui`
+ gnome-ssh-askpass2: gnome-ssh-askpass2.c
+-      $(CC) `pkg-config --cflags gtk+-2.0` \
++      $(CC) ${CFLAGS} `pkg-config --cflags gtk+-2.0` \
+               gnome-ssh-askpass2.c -o gnome-ssh-askpass2 \
+               `pkg-config --libs gtk+-2.0 x11`
diff --git a/openssh/patches/openssh-5.8p2-force_krb.patch b/openssh/patches/openssh-5.8p2-force_krb.patch
new file mode 100644 (file)
index 0000000..1842ce4
--- /dev/null
@@ -0,0 +1,288 @@
+diff -up openssh-5.8p2/gss-serv-krb5.c.force_krb openssh-5.8p2/gss-serv-krb5.c
+--- openssh-5.8p2/gss-serv-krb5.c.force_krb    2006-09-01 07:38:36.000000000 +0200
++++ openssh-5.8p2/gss-serv-krb5.c      2011-05-19 03:41:45.801109545 +0200
+@@ -32,7 +32,9 @@
+ #include <sys/types.h>
+ #include <stdarg.h>
++#include <stdio.h>
+ #include <string.h>
++#include <unistd.h>
+ #include "xmalloc.h"
+ #include "key.h"
+@@ -40,12 +42,11 @@
+ #include "auth.h"
+ #include "log.h"
+ #include "servconf.h"
++#include "misc.h"
+ #include "buffer.h"
+ #include "ssh-gss.h"
+-extern ServerOptions options;
+-
+ #ifdef HEIMDAL
+ # include <krb5.h>
+ #else
+@@ -56,6 +57,16 @@ extern ServerOptions options;
+ # endif
+ #endif
++extern Authctxt *the_authctxt;
++extern ServerOptions options;
++
++/* all commands are allowed by default */
++char **k5users_allowed_cmds = NULL;
++
++static int ssh_gssapi_k5login_exists();
++static int ssh_gssapi_krb5_cmdok(krb5_principal, const char *, const char *,
++    int);
++
+ static krb5_context krb_context = NULL;
+ /* Initialise the krb5 library, for the stuff that GSSAPI won't do */
+@@ -83,10 +94,11 @@ ssh_gssapi_krb5_init(void)
+  */
+ static int
+-ssh_gssapi_krb5_userok(ssh_gssapi_client *client, char *name)
++ssh_gssapi_krb5_userok(ssh_gssapi_client *client, char *luser)
+ {
+       krb5_principal princ;
+       int retval;
++      int k5login_exists;
+       if (ssh_gssapi_krb5_init() == 0)
+               return 0;
+@@ -97,10 +109,22 @@ ssh_gssapi_krb5_userok(ssh_gssapi_client
+                   krb5_get_err_text(krb_context, retval));
+               return 0;
+       }
+-      if (krb5_kuserok(krb_context, princ, name)) {
++      /* krb5_kuserok() returns 1 if .k5login DNE and this is self-login.
++       * We have to make sure to check .k5users in that case. */
++      k5login_exists = ssh_gssapi_k5login_exists();
++      /* NOTE: .k5login and .k5users must opened as root, not the user,
++       * because if they are on a krb5-protected filesystem, user credentials
++       * to access these files aren't available yet. */
++      if (krb5_kuserok(krb_context, princ, luser) && k5login_exists) {
+               retval = 1;
+               logit("Authorized to %s, krb5 principal %s (krb5_kuserok)",
+-                  name, (char *)client->displayname.value);
++                  luser, (char *)client->displayname.value);
++      } else if (ssh_gssapi_krb5_cmdok(princ, client->exportedname.value,
++              luser, k5login_exists)) {
++              retval = 1;
++              logit("Authorized to %s, krb5 principal %s "
++                  "(ssh_gssapi_krb5_cmdok)",
++                  luser, (char *)client->displayname.value);
+       } else
+               retval = 0;
+@@ -108,6 +132,134 @@ ssh_gssapi_krb5_userok(ssh_gssapi_client
+       return retval;
+ }
++/* Test for existence of .k5login.
++ * We need this as part of our .k5users check, because krb5_kuserok()
++ * returns success if .k5login DNE and user is logging in as himself.
++ * With .k5login absent and .k5users present, we don't want absence
++ * of .k5login to authorize self-login.  (absence of both is required)
++ * Returns 1 if .k5login is available, 0 otherwise.
++ */
++static int
++ssh_gssapi_k5login_exists()
++{
++      char file[MAXPATHLEN];
++      struct passwd *pw = the_authctxt->pw;
++
++      snprintf(file, sizeof(file), "%s/.k5login", pw->pw_dir);
++      return access(file, F_OK) == 0;
++}
++
++/* check .k5users for login or command authorization
++ * Returns 1 if principal is authorized, 0 otherwise.
++ * If principal is authorized, (global) k5users_allowed_cmds may be populated.
++ */
++static int
++ssh_gssapi_krb5_cmdok(krb5_principal principal, const char *name,
++    const char *luser, int k5login_exists)
++{
++      FILE *fp;
++      char file[MAXPATHLEN];
++      char line[BUFSIZ];
++      char kuser[65]; /* match krb5_kuserok() */
++      struct stat st;
++      struct passwd *pw = the_authctxt->pw;
++      int found_principal = 0;
++      int ncommands = 0, allcommands = 0;
++      u_long linenum;
++
++      snprintf(file, sizeof(file), "%s/.k5users", pw->pw_dir);
++      /* If both .k5login and .k5users DNE, self-login is ok. */
++      if (!k5login_exists && (access(file, F_OK) == -1)) {
++              return (krb5_aname_to_localname(krb_context, principal,
++                  sizeof(kuser), kuser) == 0) &&
++                  (strcmp(kuser, luser) == 0);
++      }
++      if ((fp = fopen(file, "r")) == NULL) {
++              int saved_errno = errno;
++              /* 2nd access check to ease debugging if file perms are wrong.
++               * But we don't want to report this if .k5users simply DNE. */
++              if (access(file, F_OK) == 0) {
++                      logit("User %s fopen %s failed: %s",
++                          pw->pw_name, file, strerror(saved_errno));
++              }
++              return 0;
++      }
++      /* .k5users must be owned either by the user or by root */
++      if (fstat(fileno(fp), &st) == -1) {
++              /* can happen, but very wierd error so report it */
++              logit("User %s fstat %s failed: %s",
++                  pw->pw_name, file, strerror(errno));
++              fclose(fp);
++              return 0;
++      }
++      if (!(st.st_uid == pw->pw_uid || st.st_uid == 0)) {
++              logit("User %s %s is not owned by root or user",
++                  pw->pw_name, file);
++              fclose(fp);
++              return 0;
++      }
++      /* .k5users must be a regular file.  krb5_kuserok() doesn't do this
++        * check, but we don't want to be deficient if they add a check. */
++      if (!S_ISREG(st.st_mode)) {
++              logit("User %s %s is not a regular file", pw->pw_name, file);
++              fclose(fp);
++              return 0;
++      }
++      /* file exists; initialize k5users_allowed_cmds (to none!) */
++      k5users_allowed_cmds = xcalloc(++ncommands,
++          sizeof(*k5users_allowed_cmds));
++
++      /* Check each line.  ksu allows unlimited length lines.  We don't. */
++      while (!allcommands && read_keyfile_line(fp, file, line, sizeof(line),
++          &linenum) != -1) {
++              char *token;
++
++              /* we parse just like ksu, even though we could do better */
++              token = strtok(line, " \t\n");
++              if (strcmp(name, token) == 0) {
++                      /* we matched on client principal */
++                      found_principal = 1;
++                      if ((token = strtok(NULL, " \t\n")) == NULL) {
++                              /* only shell is allowed */
++                              k5users_allowed_cmds[ncommands-1] =
++                                  xstrdup(pw->pw_shell);
++                              k5users_allowed_cmds =
++                                  xrealloc(k5users_allowed_cmds, ++ncommands,
++                                      sizeof(*k5users_allowed_cmds));
++                              break;
++                      }
++                      /* process the allowed commands */
++                      while (token) {
++                              if (strcmp(token, "*") == 0) {
++                                      allcommands = 1;
++                                      break;
++                              }
++                              k5users_allowed_cmds[ncommands-1] =
++                                  xstrdup(token);
++                              k5users_allowed_cmds =
++                                  xrealloc(k5users_allowed_cmds, ++ncommands,
++                                      sizeof(*k5users_allowed_cmds));
++                              token = strtok(NULL, " \t\n");
++                      }
++              }
++       }
++      if (k5users_allowed_cmds) {
++              /* terminate vector */
++              k5users_allowed_cmds[ncommands-1] = NULL;
++              /* if all commands are allowed, free vector */
++              if (allcommands) {
++                      int i;
++                      for (i = 0; i < ncommands; i++) {
++                              free(k5users_allowed_cmds[i]);
++                      }
++                      free(k5users_allowed_cmds);
++                      k5users_allowed_cmds = NULL;
++              }
++      }
++      fclose(fp);
++      return found_principal;
++}
++ 
+ /* This writes out any forwarded credentials from the structure populated
+  * during userauth. Called after we have setuid to the user */
+diff -up openssh-5.8p2/session.c.force_krb openssh-5.8p2/session.c
+--- openssh-5.8p2/session.c.force_krb  2011-05-19 03:41:41.000000000 +0200
++++ openssh-5.8p2/session.c    2011-05-19 03:43:32.437173662 +0200
+@@ -816,6 +816,29 @@ do_exec(Session *s, const char *command)
+               debug("Forced command (key option) '%.900s'", command);
+       }
++#ifdef GSSAPI
++#ifdef KRB5 /* k5users_allowed_cmds only available w/ GSSAPI+KRB5 */
++      else if (k5users_allowed_cmds) {
++              const char *match = command;
++              int allowed = 0, i = 0;
++ 
++              if (!match)
++                      match = s->pw->pw_shell;
++              while (k5users_allowed_cmds[i]) {
++                      if (strcmp(match, k5users_allowed_cmds[i++]) == 0) {
++                              debug("Allowed command '%.900s'", match);
++                              allowed = 1;
++                              break;
++                      }
++              }
++              if (!allowed) {
++                      debug("command '%.900s' not allowed", match);
++                      return 1;
++              }
++      }
++#endif
++#endif
++
+ #ifdef SSH_AUDIT_EVENTS
+       if (s->command != NULL || s->command_handle != -1)
+               fatal("do_exec: command already set");
+diff -up openssh-5.8p2/sshd.8.force_krb openssh-5.8p2/sshd.8
+--- openssh-5.8p2/sshd.8.force_krb     2011-05-19 03:41:30.582114401 +0200
++++ openssh-5.8p2/sshd.8       2011-05-19 03:41:46.159106308 +0200
+@@ -320,6 +320,7 @@ Finally, the server and the client enter
+ The client tries to authenticate itself using
+ host-based authentication,
+ public key authentication,
++GSSAPI authentication,
+ challenge-response authentication,
+ or password authentication.
+ .Pp
+@@ -788,6 +789,12 @@ This file is used in exactly the same wa
+ but allows host-based authentication without permitting login with
+ rlogin/rsh.
+ .Pp
++.It Pa ~/.k5login
++.It Pa ~/.k5users
++These files enforce GSSAPI/Kerberos authentication access control.
++Further details are described in
++.Xr ksu 1 .
++.Pp
+ .It Pa ~/.ssh/
+ This directory is the default location for all user-specific configuration
+ and authentication information.
+diff -up openssh-5.8p2/ssh-gss.h.force_krb openssh-5.8p2/ssh-gss.h
+--- openssh-5.8p2/ssh-gss.h.force_krb  2007-06-12 15:40:39.000000000 +0200
++++ openssh-5.8p2/ssh-gss.h    2011-05-19 03:41:46.302234118 +0200
+@@ -48,6 +48,10 @@
+ #define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name
+ #endif /* GSS_C_NT_... */
+ #endif /* !HEIMDAL */
++
++/* .k5users support */
++extern char **k5users_allowed_cmds;
++
+ #endif /* KRB5 */
+ /* draft-ietf-secsh-gsskeyex-06 */
diff --git a/openssh/patches/openssh-5.8p2-remove-stale-control-socket.patch b/openssh/patches/openssh-5.8p2-remove-stale-control-socket.patch
new file mode 100644 (file)
index 0000000..4a25d9e
--- /dev/null
@@ -0,0 +1,13 @@
+diff -up openssh-5.8p2/mux.c.remove_stale openssh-5.8p2/mux.c
+--- openssh-5.8p2/mux.c.remove_stale   2011-01-14 02:01:32.000000000 +0100
++++ openssh-5.8p2/mux.c        2011-06-09 15:27:42.556360291 +0200
+@@ -1867,6 +1867,9 @@ muxclient(const char *path)
+                       unlink(path);
+               } else if (errno == ENOENT) {
+                       debug("Control socket \"%.100s\" does not exist", path);
++              } else if (errno == ECONNREFUSED) {
++                      debug("Removing stale control socket \"%.100s\"", path);
++                      unlink(path);
+               } else {
+                       error("Control socket connect(%.100s): %s", path,
+                           strerror(errno));
diff --git a/openssh/patches/openssh-5.8p2-sigpipe.patch b/openssh/patches/openssh-5.8p2-sigpipe.patch
new file mode 100644 (file)
index 0000000..56af045
--- /dev/null
@@ -0,0 +1,12 @@
+diff -up openssh-5.8p2/ssh-keyscan.c.sigpipe openssh-5.8p2/ssh-keyscan.c
+--- openssh-5.8p2/ssh-keyscan.c.sigpipe        2011-08-23 18:30:33.873025916 +0200
++++ openssh-5.8p2/ssh-keyscan.c        2011-08-23 18:32:24.574025362 +0200
+@@ -715,6 +715,8 @@ main(int argc, char **argv)
+               fdlim_set(maxfd);
+       fdcon = xcalloc(maxfd, sizeof(con));
++      signal(SIGPIPE, SIG_IGN);
++
+       read_wait_nfdset = howmany(maxfd, NFDBITS);
+       read_wait = xcalloc(read_wait_nfdset, sizeof(fd_mask));
diff --git a/openssh/patches/openssh-5.9p1-2auth.patch b/openssh/patches/openssh-5.9p1-2auth.patch
new file mode 100644 (file)
index 0000000..b19d2ac
--- /dev/null
@@ -0,0 +1,354 @@
+diff -up openssh-5.9p1/auth.h.2auth openssh-5.9p1/auth.h
+--- openssh-5.9p1/auth.h.2auth 2011-05-29 13:39:38.000000000 +0200
++++ openssh-5.9p1/auth.h       2011-09-17 11:36:54.314522599 +0200
+@@ -149,6 +149,8 @@ int        auth_root_allowed(char *);
+ char  *auth2_read_banner(void);
++void  userauth_restart(const char *);
++
+ void  privsep_challenge_enable(void);
+ int   auth2_challenge(Authctxt *, char *);
+diff -up openssh-5.9p1/auth2.c.2auth openssh-5.9p1/auth2.c
+--- openssh-5.9p1/auth2.c.2auth        2011-05-05 06:04:11.000000000 +0200
++++ openssh-5.9p1/auth2.c      2011-09-17 11:36:54.402521709 +0200
+@@ -290,6 +290,24 @@ input_userauth_request(int type, u_int32
+ }
+ void
++userauth_restart(const char *method)
++{
++      options.two_factor_authentication = 0;
++
++      debug2("userauth restart, method = %s", method);
++      options.pubkey_authentication = options.second_pubkey_authentication && strcmp(method, method_pubkey.name);
++#ifdef GSSAPI
++      options.gss_authentication = options.second_gss_authentication && strcmp(method, method_gssapi.name);
++#endif
++#ifdef JPAKE
++      options.zero_knowledge_password_authentication = options.second_zero_knowledge_password_authentication && strcmp(method, method_jpake.name);
++#endif
++      options.password_authentication = options.second_password_authentication && strcmp(method, method_passwd.name);
++      options.kbd_interactive_authentication = options.second_kbd_interactive_authentication && strcmp(method, method_kbdint.name);
++      options.hostbased_authentication = options.second_hostbased_authentication && strcmp(method, method_hostbased.name);
++}
++
++void
+ userauth_finish(Authctxt *authctxt, int authenticated, char *method)
+ {
+       char *methods;
+@@ -337,6 +355,12 @@ userauth_finish(Authctxt *authctxt, int
+       /* XXX todo: check if multiple auth methods are needed */
+       if (authenticated == 1) {
++              if (options.two_factor_authentication) {
++                      userauth_restart(method);
++                      debug("1st factor authentication done go to 2nd factor");
++                      goto ask_methods;
++              }
++
+               /* turn off userauth */
+               dispatch_set(SSH2_MSG_USERAUTH_REQUEST, &dispatch_protocol_ignore);
+               packet_start(SSH2_MSG_USERAUTH_SUCCESS);
+@@ -356,7 +380,9 @@ userauth_finish(Authctxt *authctxt, int
+ #endif
+                       packet_disconnect(AUTH_FAIL_MSG, authctxt->user);
+               }
++ask_methods:
+               methods = authmethods_get();
++              debug2("next auth methods = %s", methods);
+               packet_start(SSH2_MSG_USERAUTH_FAILURE);
+               packet_put_cstring(methods);
+               packet_put_char(0);     /* XXX partial success, unused */
+diff -up openssh-5.9p1/monitor.c.2auth openssh-5.9p1/monitor.c
+--- openssh-5.9p1/monitor.c.2auth      2011-08-05 22:15:18.000000000 +0200
++++ openssh-5.9p1/monitor.c    2011-09-17 11:36:54.513491937 +0200
+@@ -417,6 +417,10 @@ monitor_child_preauth(Authctxt *_authctx
+                       }
+               }
+ #endif
++              if (authenticated && options.two_factor_authentication) {
++                      userauth_restart(auth_method);
++                      authenticated = 0;
++              }
+       }
+       /* Drain any buffered messages from the child */
+diff -up openssh-5.9p1/servconf.c.2auth openssh-5.9p1/servconf.c
+--- openssh-5.9p1/servconf.c.2auth     2011-06-23 00:30:03.000000000 +0200
++++ openssh-5.9p1/servconf.c   2011-09-17 11:36:54.632461730 +0200
+@@ -92,6 +92,13 @@ initialize_server_options(ServerOptions
+       options->hostbased_uses_name_from_packet_only = -1;
+       options->rsa_authentication = -1;
+       options->pubkey_authentication = -1;
++      options->two_factor_authentication = -1;
++      options->second_pubkey_authentication = -1;
++      options->second_gss_authentication = -1;
++      options->second_password_authentication = -1;
++      options->second_kbd_interactive_authentication = -1;
++      options->second_zero_knowledge_password_authentication = -1;
++      options->second_hostbased_authentication = -1;
+       options->kerberos_authentication = -1;
+       options->kerberos_or_local_passwd = -1;
+       options->kerberos_ticket_cleanup = -1;
+@@ -237,6 +244,20 @@ fill_default_server_options(ServerOption
+               options->permit_empty_passwd = 0;
+       if (options->permit_user_env == -1)
+               options->permit_user_env = 0;
++      if (options->two_factor_authentication == -1)
++              options->two_factor_authentication = 0;
++      if (options->second_pubkey_authentication == -1)
++              options->second_pubkey_authentication = 1;
++      if (options->second_gss_authentication == -1)
++              options->second_gss_authentication = 0;
++      if (options->second_password_authentication == -1)
++              options->second_password_authentication = 1;
++      if (options->second_kbd_interactive_authentication == -1)
++              options->second_kbd_interactive_authentication = 0;
++      if (options->second_zero_knowledge_password_authentication == -1)
++              options->second_zero_knowledge_password_authentication = 0;
++      if (options->second_hostbased_authentication == -1)
++              options->second_hostbased_authentication = 0;
+       if (options->use_login == -1)
+               options->use_login = 0;
+       if (options->compression == -1)
+@@ -316,8 +337,11 @@ typedef enum {
+       sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem,
+       sMaxStartups, sMaxAuthTries, sMaxSessions,
+       sBanner, sUseDNS, sHostbasedAuthentication,
+-      sHostbasedUsesNameFromPacketOnly, sClientAliveInterval,
+-      sClientAliveCountMax, sAuthorizedKeysFile,
++      sHostbasedUsesNameFromPacketOnly, sTwoFactorAuthentication,
++      sSecondPubkeyAuthentication, sSecondGssAuthentication,
++      sSecondPasswordAuthentication, sSecondKbdInteractiveAuthentication,
++      sSecondZeroKnowledgePasswordAuthentication, sSecondHostbasedAuthentication,
++      sClientAliveInterval, sClientAliveCountMax, sAuthorizedKeysFile,
+       sGssAuthentication, sGssCleanupCreds, sAcceptEnv, sPermitTunnel,
+       sMatch, sPermitOpen, sForceCommand, sChrootDirectory,
+       sUsePrivilegeSeparation, sAllowAgentForwarding,
+@@ -395,6 +419,21 @@ static struct {
+ #else
+       { "zeroknowledgepasswordauthentication", sUnsupported, SSHCFG_ALL },
+ #endif
++      { "twofactorauthentication", sTwoFactorAuthentication, SSHCFG_ALL },
++      { "secondpubkeyauthentication", sSecondPubkeyAuthentication, SSHCFG_ALL },
++#ifdef GSSAPI
++      { "secondgssapiauthentication", sSecondGssAuthentication, SSHCFG_ALL },
++#else
++      { "secondgssapiauthentication", sUnsupported, SSHCFG_ALL },
++#endif
++      { "secondpasswordauthentication", sSecondPasswordAuthentication, SSHCFG_ALL },
++      { "secondkbdinteractiveauthentication", sSecondKbdInteractiveAuthentication, SSHCFG_ALL },
++#ifdef JPAKE
++      { "secondzeroknowledgepasswordauthentication", sSecondZeroKnowledgePasswordAuthentication, SSHCFG_ALL },
++#else
++      { "secondzeroknowledgepasswordauthentication", sUnsupported, SSHCFG_ALL },
++#endif
++      { "secondhostbasedauthentication", sSecondHostbasedAuthentication, SSHCFG_ALL },
+       { "checkmail", sDeprecated, SSHCFG_GLOBAL },
+       { "listenaddress", sListenAddress, SSHCFG_GLOBAL },
+       { "addressfamily", sAddressFamily, SSHCFG_GLOBAL },
+@@ -982,6 +1021,34 @@ process_server_config_line(ServerOptions
+               intptr = &options->challenge_response_authentication;
+               goto parse_flag;
++      case sTwoFactorAuthentication:
++              intptr = &options->two_factor_authentication;
++              goto parse_flag;
++
++      case sSecondPubkeyAuthentication:
++              intptr = &options->second_pubkey_authentication;
++              goto parse_flag;
++
++      case sSecondGssAuthentication:
++              intptr = &options->second_gss_authentication;
++              goto parse_flag;
++
++      case sSecondPasswordAuthentication:
++              intptr = &options->second_password_authentication;
++              goto parse_flag;
++
++      case sSecondKbdInteractiveAuthentication:
++              intptr = &options->second_kbd_interactive_authentication;
++              goto parse_flag;
++
++      case sSecondZeroKnowledgePasswordAuthentication:
++              intptr = &options->second_zero_knowledge_password_authentication;
++              goto parse_flag;
++
++      case sSecondHostbasedAuthentication:
++              intptr = &options->second_hostbased_authentication;
++              goto parse_flag;
++
+       case sPrintMotd:
+               intptr = &options->print_motd;
+               goto parse_flag;
+@@ -1491,14 +1558,21 @@ void
+ copy_set_server_options(ServerOptions *dst, ServerOptions *src, int preauth)
+ {
+       M_CP_INTOPT(password_authentication);
++      M_CP_INTOPT(second_password_authentication);
+       M_CP_INTOPT(gss_authentication);
++      M_CP_INTOPT(second_gss_authentication);
+       M_CP_INTOPT(rsa_authentication);
+       M_CP_INTOPT(pubkey_authentication);
++      M_CP_INTOPT(second_pubkey_authentication);
+       M_CP_INTOPT(kerberos_authentication);
+       M_CP_INTOPT(hostbased_authentication);
++      M_CP_INTOPT(second_hostbased_authentication);
+       M_CP_INTOPT(hostbased_uses_name_from_packet_only);
+       M_CP_INTOPT(kbd_interactive_authentication);
++      M_CP_INTOPT(second_kbd_interactive_authentication);
+       M_CP_INTOPT(zero_knowledge_password_authentication);
++      M_CP_INTOPT(second_zero_knowledge_password_authentication);
++      M_CP_INTOPT(two_factor_authentication);
+       M_CP_INTOPT(permit_root_login);
+       M_CP_INTOPT(permit_empty_passwd);
+@@ -1720,17 +1794,24 @@ dump_config(ServerOptions *o)
+ #endif
+ #ifdef GSSAPI
+       dump_cfg_fmtint(sGssAuthentication, o->gss_authentication);
++      dump_cfg_fmtint(sSecondGssAuthentication, o->second_gss_authentication);
+       dump_cfg_fmtint(sGssCleanupCreds, o->gss_cleanup_creds);
+ #endif
+ #ifdef JPAKE
+       dump_cfg_fmtint(sZeroKnowledgePasswordAuthentication,
+           o->zero_knowledge_password_authentication);
++      dump_cfg_fmtint(sSecondZeroKnowledgePasswordAuthentication,
++          o->second_zero_knowledge_password_authentication);
+ #endif
+       dump_cfg_fmtint(sPasswordAuthentication, o->password_authentication);
++      dump_cfg_fmtint(sSecondPasswordAuthentication, o->second_password_authentication);
+       dump_cfg_fmtint(sKbdInteractiveAuthentication,
+           o->kbd_interactive_authentication);
++      dump_cfg_fmtint(sSecondKbdInteractiveAuthentication,
++          o->second_kbd_interactive_authentication);
+       dump_cfg_fmtint(sChallengeResponseAuthentication,
+           o->challenge_response_authentication);
++      dump_cfg_fmtint(sTwoFactorAuthentication, o->two_factor_authentication);
+       dump_cfg_fmtint(sPrintMotd, o->print_motd);
+       dump_cfg_fmtint(sPrintLastLog, o->print_lastlog);
+       dump_cfg_fmtint(sX11Forwarding, o->x11_forwarding);
+diff -up openssh-5.9p1/servconf.h.2auth openssh-5.9p1/servconf.h
+--- openssh-5.9p1/servconf.h.2auth     2011-06-23 00:30:03.000000000 +0200
++++ openssh-5.9p1/servconf.h   2011-09-17 11:36:54.749584245 +0200
+@@ -112,6 +112,14 @@ typedef struct {
+                                       /* If true, permit jpake auth */
+       int     permit_empty_passwd;    /* If false, do not permit empty
+                                        * passwords. */
++      int     two_factor_authentication;      /* If true, the first sucessful authentication
++                                       * will be followed by the second one from anorher set */
++      int     second_pubkey_authentication;   /* second set of authentications */
++      int     second_gss_authentication;
++      int     second_password_authentication;
++      int     second_kbd_interactive_authentication;
++      int     second_zero_knowledge_password_authentication;
++      int     second_hostbased_authentication;
+       int     permit_user_env;        /* If true, read ~/.ssh/environment */
+       int     use_login;      /* If true, login(1) is used */
+       int     compression;    /* If true, compression is allowed */
+diff -up openssh-5.9p1/sshd_config.2auth openssh-5.9p1/sshd_config
+--- openssh-5.9p1/sshd_config.2auth    2011-05-29 13:39:39.000000000 +0200
++++ openssh-5.9p1/sshd_config  2011-09-17 11:36:54.859588726 +0200
+@@ -87,6 +87,13 @@ AuthorizedKeysFile  .ssh/authorized_keys
+ # and ChallengeResponseAuthentication to 'no'.
+ #UsePAM no
++#TwoFactorAuthentication no
++#SecondPubkeyAuthentication yes
++#SecondHostbasedAuthentication no
++#SecondPasswordAuthentication yes
++#SecondKBDInteractiveAuthentication yes
++#SecondGSSAPIAuthentication no
++
+ #AllowAgentForwarding yes
+ #AllowTcpForwarding yes
+ #GatewayPorts no
+diff -up openssh-5.9p1/sshd_config.5.2auth openssh-5.9p1/sshd_config.5
+--- openssh-5.9p1/sshd_config.5.2auth  2011-08-05 22:17:33.000000000 +0200
++++ openssh-5.9p1/sshd_config.5        2011-09-17 13:45:49.022521436 +0200
+@@ -726,6 +726,12 @@ Available keywords are
+ .Cm PubkeyAuthentication ,
+ .Cm RhostsRSAAuthentication ,
+ .Cm RSAAuthentication ,
++.Cm SecondGSSAPIAuthentication ,
++.Cm SecondHostbasedAuthentication ,
++.Cm SecondKbdInteractiveAuthentication ,
++.Cm SecondPasswordAuthentication ,
++.Cm SecondPubkeyAuthentication ,
++.Cm TwoFactorAuthentication ,
+ .Cm X11DisplayOffset ,
+ .Cm X11Forwarding
+ and
+@@ -931,6 +937,45 @@ Specifies whether pure RSA authenticatio
+ The default is
+ .Dq yes .
+ This option applies to protocol version 1 only.
++.It Cm SecondGSSAPIAuthentication
++Specifies whether the
++.Cm GSSAPIAuthentication
++may be used on the second authentication while
++.Cm TwoFactorAuthentication
++is set.
++The default is
++.Dq no .
++.It Cm SecondHostbasedAuthentication
++Specifies whether the
++.Cm HostbasedAuthentication
++may be used on the second authentication while
++.Cm TwoFactorAuthentication
++is set.
++The default is
++.Dq no .
++.It Cm SecondKbdInteractiveAuthentication
++Specifies whether the
++.Cm KbdInteractiveAuthentication
++may be used on the second authentication while
++.Cm TwoFactorAuthentication
++is set.
++The default is
++.Dq yes .
++.It Cm SecondPasswordAuthentication
++Specifies whether the
++.Cm PasswordAuthentication
++may be used on the second authentication while
++.Cm TwoFactorAuthentication
++is set.
++The default is
++.Dq yes .
++Specifies whether the
++.Cm PubkeyAuthentication
++may be used on the second authentication while
++.Cm TwoFactorAuthentication
++is set.
++The default is
++.Dq yes .
+ .It Cm ServerKeyBits
+ Defines the number of bits in the ephemeral protocol version 1 server key.
+ The minimum value is 512, and the default is 1024.
+@@ -1011,6 +1056,23 @@ For more details on certificates, see th
+ .Sx CERTIFICATES
+ section in
+ .Xr ssh-keygen 1 .
++.It Cm TwoFactorAuthentication
++Specifies whether for a successful login is necessary to meet two independent authentications.
++If select the first method is selected from the set of allowed methods from
++.Cm GSSAPIAuthentication ,
++.Cm HostbasedAuthentication ,
++.Cm KbdInteractiveAuthentication ,
++.Cm PasswordAuthentication ,
++.Cm PubkeyAuthentication .
++And the second method is selected from the set of allowed methods from
++.Cm SecondGSSAPIAuthentication ,
++.Cm SecondHostbasedAuthentication ,
++.Cm SecondKbdInteractiveAuthentication ,
++.Cm SecondPasswordAuthentication ,
++.Cm SecondPubkeyAuthentication 
++without the method used for the first authentication.
++The default is
++.Dq no .
+ .It Cm UseDNS
+ Specifies whether
+ .Xr sshd 8
similarity index 81%
rename from openssh/patches/openssh-5.8p1-authorized-keys-command.patch
rename to openssh/patches/openssh-5.9p1-akc.patch
index 356adfaefeb95be4af6a6c77a803028a6c4824df..62a478b1d8dc490e3f9682faaf813f221f6f86dc 100644 (file)
@@ -1,6 +1,6 @@
-diff -up openssh-5.8p1/auth2-pubkey.c.akc openssh-5.8p1/auth2-pubkey.c
---- openssh-5.8p1/auth2-pubkey.c.akc   2011-02-10 13:21:27.000000000 +0100
-+++ openssh-5.8p1/auth2-pubkey.c       2011-02-10 13:21:28.000000000 +0100
+diff -up openssh-5.9p1/auth2-pubkey.c.akc openssh-5.9p1/auth2-pubkey.c
+--- openssh-5.9p1/auth2-pubkey.c.akc   2011-09-14 07:24:40.876512251 +0200
++++ openssh-5.9p1/auth2-pubkey.c       2011-09-14 07:24:43.318458515 +0200
 @@ -27,6 +27,7 @@
  
  #include <sys/types.h>
@@ -9,7 +9,7 @@ diff -up openssh-5.8p1/auth2-pubkey.c.akc openssh-5.8p1/auth2-pubkey.c
  
  #include <fcntl.h>
  #include <pwd.h>
-@@ -268,27 +269,15 @@ match_principals_file(char *file, struct
+@@ -276,27 +277,15 @@ match_principals_file(char *file, struct
  
  /* return 1 if user allows given key */
  static int
@@ -38,7 +38,7 @@ diff -up openssh-5.8p1/auth2-pubkey.c.akc openssh-5.8p1/auth2-pubkey.c
        found_key = 0;
        found = key_new(key_is_cert(key) ? KEY_UNSPEC : key->type);
  
-@@ -381,8 +370,6 @@ user_key_allowed2(struct passwd *pw, Key
+@@ -389,8 +378,6 @@ user_key_allowed2(struct passwd *pw, Key
                        break;
                }
        }
@@ -47,7 +47,7 @@ diff -up openssh-5.8p1/auth2-pubkey.c.akc openssh-5.8p1/auth2-pubkey.c
        key_free(found);
        if (!found_key)
                debug2("key not found");
-@@ -444,13 +431,191 @@ user_cert_trusted_ca(struct passwd *pw, 
+@@ -452,13 +439,191 @@ user_cert_trusted_ca(struct passwd *pw,
        return ret;
  }
  
@@ -92,7 +92,7 @@ diff -up openssh-5.8p1/auth2-pubkey.c.akc openssh-5.8p1/auth2-pubkey.c
 +      pid_t pstat, pid, child;
 +
 +      if (options.authorized_keys_command == NULL || options.authorized_keys_command[0] != '/')
-+              return -1;
++              return 0;
 +
 +      /* get the run as identity from config */
 +      runas_pw = (options.authorized_keys_command_runas == NULL)? pw
@@ -228,7 +228,7 @@ diff -up openssh-5.8p1/auth2-pubkey.c.akc openssh-5.8p1/auth2-pubkey.c
  int
  user_key_allowed(struct passwd *pw, Key *key)
  {
-       int success;
+       u_int success, i;
        char *file;
  
 +#ifdef WITH_AUTHORIZED_KEYS_COMMAND
@@ -240,10 +240,10 @@ diff -up openssh-5.8p1/auth2-pubkey.c.akc openssh-5.8p1/auth2-pubkey.c
        if (auth_key_is_revoked(key))
                return 0;
        if (key_is_cert(key) && auth_key_is_revoked(key->cert->signature_key))
-diff -up openssh-5.8p1/configure.ac.akc openssh-5.8p1/configure.ac
---- openssh-5.8p1/configure.ac.akc     2011-02-10 13:21:28.000000000 +0100
-+++ openssh-5.8p1/configure.ac 2011-02-10 13:21:28.000000000 +0100
-@@ -1422,6 +1422,18 @@ AC_ARG_WITH(audit,
+diff -up openssh-5.9p1/configure.ac.akc openssh-5.9p1/configure.ac
+--- openssh-5.9p1/configure.ac.akc     2011-09-14 07:24:42.863494886 +0200
++++ openssh-5.9p1/configure.ac 2011-09-14 07:24:43.441583848 +0200
+@@ -1421,6 +1421,18 @@ AC_ARG_WITH([audit],
        esac ]
  )
  
@@ -260,9 +260,9 @@ diff -up openssh-5.8p1/configure.ac.akc openssh-5.8p1/configure.ac
 +)
 +
  dnl    Checks for library functions. Please keep in alphabetical order
- AC_CHECK_FUNCS( \
+ AC_CHECK_FUNCS([ \
        arc4random \
-@@ -4325,6 +4337,7 @@ echo "                   SELinux support
+@@ -4239,6 +4251,7 @@ echo "                   SELinux support
  echo "                 Smartcard support: $SCARD_MSG"
  echo "                     S/KEY support: $SKEY_MSG"
  echo "              TCP Wrappers support: $TCPW_MSG"
@@ -270,10 +270,10 @@ diff -up openssh-5.8p1/configure.ac.akc openssh-5.8p1/configure.ac
  echo "              MD5 password support: $MD5_MSG"
  echo "                   libedit support: $LIBEDIT_MSG"
  echo "  Solaris process contract support: $SPC_MSG"
-diff -up openssh-5.8p1/servconf.c.akc openssh-5.8p1/servconf.c
---- openssh-5.8p1/servconf.c.akc       2011-02-10 13:21:28.000000000 +0100
-+++ openssh-5.8p1/servconf.c   2011-02-10 13:28:21.000000000 +0100
-@@ -134,6 +134,8 @@ initialize_server_options(ServerOptions 
+diff -up openssh-5.9p1/servconf.c.akc openssh-5.9p1/servconf.c
+--- openssh-5.9p1/servconf.c.akc       2011-09-14 07:24:29.402475399 +0200
++++ openssh-5.9p1/servconf.c   2011-09-14 07:56:27.158585590 +0200
+@@ -139,6 +139,8 @@ initialize_server_options(ServerOptions
        options->num_permitted_opens = -1;
        options->adm_forced_command = NULL;
        options->chroot_directory = NULL;
@@ -282,7 +282,7 @@ diff -up openssh-5.8p1/servconf.c.akc openssh-5.8p1/servconf.c
        options->zero_knowledge_password_authentication = -1;
        options->revoked_keys_file = NULL;
        options->trusted_user_ca_keys = NULL;
-@@ -331,6 +333,7 @@ typedef enum {
+@@ -348,6 +350,7 @@ typedef enum {
        sZeroKnowledgePasswordAuthentication, sHostCertificate,
        sRevokedKeys, sTrustedUserCAKeys, sAuthorizedPrincipalsFile,
        sKexAlgorithms, sIPQoS,
@@ -290,7 +290,7 @@ diff -up openssh-5.8p1/servconf.c.akc openssh-5.8p1/servconf.c
        sDeprecated, sUnsupported
  } ServerOpCodes;
  
-@@ -456,6 +459,13 @@ static struct {
+@@ -487,6 +490,13 @@ static struct {
        { "authorizedprincipalsfile", sAuthorizedPrincipalsFile, SSHCFG_ALL },
        { "kexalgorithms", sKexAlgorithms, SSHCFG_GLOBAL },
        { "ipqos", sIPQoS, SSHCFG_ALL },
@@ -304,7 +304,7 @@ diff -up openssh-5.8p1/servconf.c.akc openssh-5.8p1/servconf.c
        { NULL, sBadOption, 0 }
  };
  
-@@ -1406,6 +1416,20 @@ process_server_config_line(ServerOptions
+@@ -1462,6 +1472,24 @@ process_server_config_line(ServerOptions
                }
                break;
  
@@ -318,6 +318,10 @@ diff -up openssh-5.8p1/servconf.c.akc openssh-5.8p1/servconf.c
 +              charptr = &options->authorized_keys_command_runas;
 +
 +              arg = strdelim(&cp);
++              if (!arg || *arg == '\0')
++                      fatal("%s line %d: missing account.",
++                          filename, linenum);
++
 +              if (*activep && *charptr == NULL)
 +                      *charptr = xstrdup(arg);
 +              break;
@@ -325,16 +329,16 @@ diff -up openssh-5.8p1/servconf.c.akc openssh-5.8p1/servconf.c
        case sDeprecated:
                logit("%s line %d: Deprecated option %s",
                    filename, linenum, arg);
-@@ -1499,6 +1523,8 @@ copy_set_server_options(ServerOptions *d
-       M_CP_INTOPT(gss_authentication);
-       M_CP_INTOPT(rsa_authentication);
-       M_CP_INTOPT(pubkey_authentication);
+@@ -1573,6 +1601,8 @@ copy_set_server_options(ServerOptions *d
+       M_CP_INTOPT(zero_knowledge_password_authentication);
+       M_CP_INTOPT(second_zero_knowledge_password_authentication);
+       M_CP_INTOPT(two_factor_authentication);
 +      M_CP_STROPT(authorized_keys_command);
 +      M_CP_STROPT(authorized_keys_command_runas);
-       M_CP_INTOPT(kerberos_authentication);
-       M_CP_INTOPT(hostbased_authentication);
-       M_CP_INTOPT(hostbased_uses_name_from_packet_only);
-@@ -1753,6 +1779,8 @@ dump_config(ServerOptions *o)
+       M_CP_INTOPT(permit_root_login);
+       M_CP_INTOPT(permit_empty_passwd);
+@@ -1839,6 +1869,8 @@ dump_config(ServerOptions *o)
        dump_cfg_string(sRevokedKeys, o->revoked_keys_file);
        dump_cfg_string(sAuthorizedPrincipalsFile,
            o->authorized_principals_file);
@@ -343,10 +347,10 @@ diff -up openssh-5.8p1/servconf.c.akc openssh-5.8p1/servconf.c
  
        /* string arguments requiring a lookup */
        dump_cfg_string(sLogLevel, log_level_name(o->log_level));
-diff -up openssh-5.8p1/servconf.h.akc openssh-5.8p1/servconf.h
---- openssh-5.8p1/servconf.h.akc       2011-02-10 13:21:28.000000000 +0100
-+++ openssh-5.8p1/servconf.h   2011-02-10 13:21:28.000000000 +0100
-@@ -161,6 +161,8 @@ typedef struct {
+diff -up openssh-5.9p1/servconf.h.akc openssh-5.9p1/servconf.h
+--- openssh-5.9p1/servconf.h.akc       2011-09-14 07:24:29.511480441 +0200
++++ openssh-5.9p1/servconf.h   2011-09-14 07:24:43.678459183 +0200
+@@ -174,6 +174,8 @@ typedef struct {
        char   *revoked_keys_file;
        char   *trusted_user_ca_keys;
        char   *authorized_principals_file;
@@ -354,10 +358,10 @@ diff -up openssh-5.8p1/servconf.h.akc openssh-5.8p1/servconf.h
 +      char   *authorized_keys_command_runas;
  }       ServerOptions;
  
- void   initialize_server_options(ServerOptions *);
-diff -up openssh-5.8p1/sshd_config.0.akc openssh-5.8p1/sshd_config.0
---- openssh-5.8p1/sshd_config.0.akc    2011-02-10 13:21:28.000000000 +0100
-+++ openssh-5.8p1/sshd_config.0        2011-02-10 13:21:28.000000000 +0100
+ /*
+diff -up openssh-5.9p1/sshd_config.0.akc openssh-5.9p1/sshd_config.0
+--- openssh-5.9p1/sshd_config.0.akc    2011-09-07 01:16:30.000000000 +0200
++++ openssh-5.9p1/sshd_config.0        2011-09-14 07:24:43.791460201 +0200
 @@ -71,6 +71,23 @@ DESCRIPTION
  
               See PATTERNS in ssh_config(5) for more information on patterns.
@@ -382,7 +386,7 @@ diff -up openssh-5.8p1/sshd_config.0.akc openssh-5.8p1/sshd_config.0
       AuthorizedKeysFile
               Specifies the file that contains the public keys that can be used
               for user authentication.  The format is described in the
-@@ -398,7 +415,8 @@ DESCRIPTION
+@@ -401,7 +418,8 @@ DESCRIPTION
  
               Only a subset of keywords may be used on the lines following a
               Match keyword.  Available keywords are AllowAgentForwarding,
@@ -392,10 +396,10 @@ diff -up openssh-5.8p1/sshd_config.0.akc openssh-5.8p1/sshd_config.0
               Banner, ChrootDirectory, ForceCommand, GatewayPorts,
               GSSAPIAuthentication, HostbasedAuthentication,
               HostbasedUsesNameFromPacketOnly, KbdInteractiveAuthentication,
-diff -up openssh-5.8p1/sshd_config.5.akc openssh-5.8p1/sshd_config.5
---- openssh-5.8p1/sshd_config.5.akc    2011-02-10 13:21:28.000000000 +0100
-+++ openssh-5.8p1/sshd_config.5        2011-02-10 13:21:28.000000000 +0100
-@@ -703,6 +703,8 @@ Available keywords are
+diff -up openssh-5.9p1/sshd_config.5.akc openssh-5.9p1/sshd_config.5
+--- openssh-5.9p1/sshd_config.5.akc    2011-09-14 07:24:29.793520372 +0200
++++ openssh-5.9p1/sshd_config.5        2011-09-14 07:24:43.912583678 +0200
+@@ -706,6 +706,8 @@ Available keywords are
  .Cm AllowAgentForwarding ,
  .Cm AllowTcpForwarding ,
  .Cm AuthorizedKeysFile ,
@@ -404,7 +408,7 @@ diff -up openssh-5.8p1/sshd_config.5.akc openssh-5.8p1/sshd_config.5
  .Cm AuthorizedPrincipalsFile ,
  .Cm Banner ,
  .Cm ChrootDirectory ,
-@@ -715,6 +717,7 @@ Available keywords are
+@@ -718,6 +720,7 @@ Available keywords are
  .Cm KerberosAuthentication ,
  .Cm MaxAuthTries ,
  .Cm MaxSessions ,
@@ -412,7 +416,7 @@ diff -up openssh-5.8p1/sshd_config.5.akc openssh-5.8p1/sshd_config.5
  .Cm PasswordAuthentication ,
  .Cm PermitEmptyPasswords ,
  .Cm PermitOpen ,
-@@ -917,6 +920,20 @@ Specifies a list of revoked public keys.
+@@ -926,6 +929,20 @@ Specifies a list of revoked public keys.
  Keys listed in this file will be refused for public key authentication.
  Note that if this file is not readable, then public key authentication will
  be refused for all users.
@@ -433,15 +437,16 @@ diff -up openssh-5.8p1/sshd_config.5.akc openssh-5.8p1/sshd_config.5
  .It Cm RhostsRSAAuthentication
  Specifies whether rhosts or /etc/hosts.equiv authentication together
  with successful RSA host authentication is allowed.
-diff -up openssh-5.8p1/sshd_config.akc openssh-5.8p1/sshd_config
---- openssh-5.8p1/sshd_config.akc      2011-02-10 13:21:28.000000000 +0100
-+++ openssh-5.8p1/sshd_config  2011-02-10 13:21:28.000000000 +0100
-@@ -46,6 +46,8 @@ SyslogFacility AUTHPRIV
- #RSAAuthentication yes
#PubkeyAuthentication yes
- #AuthorizedKeysFile   .ssh/authorized_keys
+diff -up openssh-5.9p1/sshd_config.akc openssh-5.9p1/sshd_config
+--- openssh-5.9p1/sshd_config.akc      2011-09-14 07:24:29.620461608 +0200
++++ openssh-5.9p1/sshd_config  2011-09-14 07:24:44.034462546 +0200
+@@ -49,6 +49,9 @@
+ # but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile    .ssh/authorized_keys
 +#AuthorizedKeysCommand none
 +#AuthorizedKeysCommandRunAs nobody
++
  # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
  #RhostsRSAAuthentication no
+ # similar for protocol version 2
diff --git a/openssh/patches/openssh-5.9p1-coverity.patch b/openssh/patches/openssh-5.9p1-coverity.patch
new file mode 100644 (file)
index 0000000..f3524e3
--- /dev/null
@@ -0,0 +1,844 @@
+diff -up openssh-5.9p1/auth-pam.c.coverity openssh-5.9p1/auth-pam.c
+--- openssh-5.9p1/auth-pam.c.coverity  2009-07-12 14:07:21.000000000 +0200
++++ openssh-5.9p1/auth-pam.c   2011-09-14 08:09:47.074520582 +0200
+@@ -216,7 +216,12 @@ pthread_join(sp_pthread_t thread, void *
+       if (sshpam_thread_status != -1)
+               return (sshpam_thread_status);
+       signal(SIGCHLD, sshpam_oldsig);
+-      waitpid(thread, &status, 0);
++      while (waitpid(thread, &status, 0) < 0) {                     
++              if (errno == EINTR)                                
++                      continue;
++              fatal("%s: waitpid: %s", __func__,         
++                              strerror(errno));                      
++      }
+       return (status);
+ }
+ #endif
+diff -up openssh-5.9p1/channels.c.coverity openssh-5.9p1/channels.c
+--- openssh-5.9p1/channels.c.coverity  2011-06-23 00:31:57.000000000 +0200
++++ openssh-5.9p1/channels.c   2011-09-14 08:09:47.556582810 +0200
+@@ -229,11 +229,11 @@ channel_register_fds(Channel *c, int rfd
+       channel_max_fd = MAX(channel_max_fd, wfd);
+       channel_max_fd = MAX(channel_max_fd, efd);
+-      if (rfd != -1)
++      if (rfd >= 0)
+               fcntl(rfd, F_SETFD, FD_CLOEXEC);
+-      if (wfd != -1 && wfd != rfd)
++      if (wfd >= 0 && wfd != rfd)
+               fcntl(wfd, F_SETFD, FD_CLOEXEC);
+-      if (efd != -1 && efd != rfd && efd != wfd)
++      if (efd >= 0 && efd != rfd && efd != wfd)
+               fcntl(efd, F_SETFD, FD_CLOEXEC);
+       c->rfd = rfd;
+@@ -248,11 +248,11 @@ channel_register_fds(Channel *c, int rfd
+       /* enable nonblocking mode */
+       if (nonblock) {
+-              if (rfd != -1)
++              if (rfd >= 0)
+                       set_nonblock(rfd);
+-              if (wfd != -1)
++              if (wfd >= 0)
+                       set_nonblock(wfd);
+-              if (efd != -1)
++              if (efd >= 0)
+                       set_nonblock(efd);
+       }
+ }
+diff -up openssh-5.9p1/clientloop.c.coverity openssh-5.9p1/clientloop.c
+--- openssh-5.9p1/clientloop.c.coverity        2011-06-23 00:31:58.000000000 +0200
++++ openssh-5.9p1/clientloop.c 2011-09-14 08:17:41.556521887 +0200
+@@ -1970,14 +1970,15 @@ client_input_global_request(int type, u_
+       char *rtype;
+       int want_reply;
+       int success = 0;
++/* success is still 0 the packet is allways SSH2_MSG_REQUEST_FAILURE, isn't it? */
+       rtype = packet_get_string(NULL);
+       want_reply = packet_get_char();
+       debug("client_input_global_request: rtype %s want_reply %d",
+           rtype, want_reply);
+       if (want_reply) {
+-              packet_start(success ?
+-                  SSH2_MSG_REQUEST_SUCCESS : SSH2_MSG_REQUEST_FAILURE);
++              packet_start(/*success ?
++                  SSH2_MSG_REQUEST_SUCCESS :*/ SSH2_MSG_REQUEST_FAILURE);
+               packet_send();
+               packet_write_wait();
+       }
+diff -up openssh-5.9p1/key.c.coverity openssh-5.9p1/key.c
+--- openssh-5.9p1/key.c.coverity       2011-05-20 11:03:08.000000000 +0200
++++ openssh-5.9p1/key.c        2011-09-14 08:09:47.803458435 +0200
+@@ -803,8 +803,10 @@ key_read(Key *ret, char **cpp)
+               success = 1;
+ /*XXXX*/
+               key_free(k);
++/*XXXX
+               if (success != 1)
+                       break;
++XXXX*/
+               /* advance cp: skip whitespace and data */
+               while (*cp == ' ' || *cp == '\t')
+                       cp++;
+diff -up openssh-5.9p1/misc.c.coverity openssh-5.9p1/misc.c
+diff -up openssh-5.9p1/monitor.c.coverity openssh-5.9p1/monitor.c
+--- openssh-5.9p1/monitor.c.coverity   2011-08-05 22:15:18.000000000 +0200
++++ openssh-5.9p1/monitor.c    2011-09-14 08:09:47.914584009 +0200
+@@ -420,7 +420,7 @@ monitor_child_preauth(Authctxt *_authctx
+       }
+       /* Drain any buffered messages from the child */
+-      while (pmonitor->m_log_recvfd != -1 && monitor_read_log(pmonitor) == 0)
++      while (pmonitor->m_log_recvfd >= 0 && monitor_read_log(pmonitor) == 0)
+               ;
+       if (!authctxt->valid)
+@@ -1161,6 +1161,10 @@ mm_answer_keyallowed(int sock, Buffer *m
+                       break;
+               }
+       }
++
++      debug3("%s: key %p is %s",
++          __func__, key, allowed ? "allowed" : "not allowed");
++
+       if (key != NULL)
+               key_free(key);
+@@ -1182,9 +1186,6 @@ mm_answer_keyallowed(int sock, Buffer *m
+               xfree(chost);
+       }
+-      debug3("%s: key %p is %s",
+-          __func__, key, allowed ? "allowed" : "not allowed");
+-
+       buffer_clear(m);
+       buffer_put_int(m, allowed);
+       buffer_put_int(m, forced_command != NULL);
+diff -up openssh-5.9p1/monitor_wrap.c.coverity openssh-5.9p1/monitor_wrap.c
+--- openssh-5.9p1/monitor_wrap.c.coverity      2011-09-14 08:11:36.480500123 +0200
++++ openssh-5.9p1/monitor_wrap.c       2011-09-14 08:14:11.279520598 +0200
+@@ -707,10 +707,10 @@ mm_pty_allocate(int *ptyfd, int *ttyfd,
+       if ((tmp1 = dup(pmonitor->m_recvfd)) == -1 ||
+           (tmp2 = dup(pmonitor->m_recvfd)) == -1) {
+               error("%s: cannot allocate fds for pty", __func__);
+-              if (tmp1 > 0)
++              if (tmp1 >= 0)
+                       close(tmp1);
+-              if (tmp2 > 0)
+-                      close(tmp2);
++              /*DEAD CODE if (tmp2 >= 0)
++                      close(tmp2);*/
+               return 0;
+       }
+       close(tmp1);
+diff -up openssh-5.9p1/openbsd-compat/bindresvport.c.coverity openssh-5.9p1/openbsd-compat/bindresvport.c
+--- openssh-5.9p1/openbsd-compat/bindresvport.c.coverity       2010-12-03 00:50:26.000000000 +0100
++++ openssh-5.9p1/openbsd-compat/bindresvport.c        2011-09-14 08:09:48.084459344 +0200
+@@ -58,7 +58,7 @@ bindresvport_sa(int sd, struct sockaddr
+       struct sockaddr_in6 *in6;
+       u_int16_t *portp;
+       u_int16_t port;
+-      socklen_t salen;
++      socklen_t salen = sizeof(struct sockaddr_storage);
+       int i;
+       if (sa == NULL) {
+diff -up openssh-5.9p1/packet.c.coverity openssh-5.9p1/packet.c
+--- openssh-5.9p1/packet.c.coverity    2011-05-15 00:58:15.000000000 +0200
++++ openssh-5.9p1/packet.c     2011-09-14 08:09:48.184587842 +0200
+@@ -1177,6 +1177,7 @@ packet_read_poll1(void)
+               case DEATTACK_DETECTED:
+                       packet_disconnect("crc32 compensation attack: "
+                           "network attack detected");
++                      break;
+               case DEATTACK_DOS_DETECTED:
+                       packet_disconnect("deattack denial of "
+                           "service detected");
+@@ -1684,7 +1685,7 @@ void
+ packet_write_wait(void)
+ {
+       fd_set *setp;
+-      int ret, ms_remain;
++      int ret, ms_remain = 0;
+       struct timeval start, timeout, *timeoutp = NULL;
+       setp = (fd_set *)xcalloc(howmany(active_state->connection_out + 1,
+diff -up openssh-5.9p1/progressmeter.c.coverity openssh-5.9p1/progressmeter.c
+--- openssh-5.9p1/progressmeter.c.coverity     2006-08-05 04:39:40.000000000 +0200
++++ openssh-5.9p1/progressmeter.c      2011-09-14 08:09:48.300586004 +0200
+@@ -65,7 +65,7 @@ static void update_progress_meter(int);
+ static time_t start;          /* start progress */
+ static time_t last_update;    /* last progress update */
+-static char *file;            /* name of the file being transferred */
++static const char *file;      /* name of the file being transferred */
+ static off_t end_pos;         /* ending position of transfer */
+ static off_t cur_pos;         /* transfer position as of last refresh */
+ static volatile off_t *counter;       /* progress counter */
+@@ -247,7 +247,7 @@ update_progress_meter(int ignore)
+ }
+ void
+-start_progress_meter(char *f, off_t filesize, off_t *ctr)
++start_progress_meter(const char *f, off_t filesize, off_t *ctr)
+ {
+       start = last_update = time(NULL);
+       file = f;
+diff -up openssh-5.9p1/progressmeter.h.coverity openssh-5.9p1/progressmeter.h
+--- openssh-5.9p1/progressmeter.h.coverity     2006-03-26 05:30:02.000000000 +0200
++++ openssh-5.9p1/progressmeter.h      2011-09-14 08:09:48.420645724 +0200
+@@ -23,5 +23,5 @@
+  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  */
+-void  start_progress_meter(char *, off_t, off_t *);
++void  start_progress_meter(const char *, off_t, off_t *);
+ void  stop_progress_meter(void);
+diff -up openssh-5.9p1/scp.c.coverity openssh-5.9p1/scp.c
+--- openssh-5.9p1/scp.c.coverity       2011-01-06 12:41:21.000000000 +0100
++++ openssh-5.9p1/scp.c        2011-09-14 08:09:48.531505457 +0200
+@@ -155,7 +155,7 @@ killchild(int signo)
+ {
+       if (do_cmd_pid > 1) {
+               kill(do_cmd_pid, signo ? signo : SIGTERM);
+-              waitpid(do_cmd_pid, NULL, 0);
++              (void) waitpid(do_cmd_pid, NULL, 0);
+       }
+       if (signo)
+diff -up openssh-5.9p1/servconf.c.coverity openssh-5.9p1/servconf.c
+--- openssh-5.9p1/servconf.c.coverity  2011-06-23 00:30:03.000000000 +0200
++++ openssh-5.9p1/servconf.c   2011-09-14 08:30:17.557468182 +0200
+@@ -609,7 +609,7 @@ match_cfg_line(char **condition, int lin
+               debug3("checking syntax for 'Match %s'", cp);
+       else
+               debug3("checking match for '%s' user %s host %s addr %s", cp,
+-                  user ? user : "(null)", host ? host : "(null)",
++                  user /* User is not NULL ? user : "(null)" */, host ? host : "(null)",
+                   address ? address : "(null)");
+       while ((attrib = strdelim(&cp)) && *attrib != '\0') {
+@@ -1171,7 +1171,7 @@ process_server_config_line(ServerOptions
+                       fatal("%s line %d: Missing subsystem name.",
+                           filename, linenum);
+               if (!*activep) {
+-                      arg = strdelim(&cp);
++                      /*arg =*/ (void) strdelim(&cp);
+                       break;
+               }
+               for (i = 0; i < options->num_subsystems; i++)
+@@ -1262,8 +1262,9 @@ process_server_config_line(ServerOptions
+               if (*activep && *charptr == NULL) {
+                       *charptr = tilde_expand_filename(arg, getuid());
+                       /* increase optional counter */
+-                      if (intptr != NULL)
+-                              *intptr = *intptr + 1;
++                      /* DEAD CODE intptr is still NULL ;)
++                       if (intptr != NULL)
++                              *intptr = *intptr + 1; */
+               }
+               break;
+diff -up openssh-5.9p1/serverloop.c.coverity openssh-5.9p1/serverloop.c
+--- openssh-5.9p1/serverloop.c.coverity        2011-05-20 11:02:50.000000000 +0200
++++ openssh-5.9p1/serverloop.c 2011-09-14 08:09:48.793586380 +0200
+@@ -147,13 +147,13 @@ notify_setup(void)
+ static void
+ notify_parent(void)
+ {
+-      if (notify_pipe[1] != -1)
++      if (notify_pipe[1] >= 0)
+               write(notify_pipe[1], "", 1);
+ }
+ static void
+ notify_prepare(fd_set *readset)
+ {
+-      if (notify_pipe[0] != -1)
++      if (notify_pipe[0] >= 0)
+               FD_SET(notify_pipe[0], readset);
+ }
+ static void
+@@ -161,8 +161,8 @@ notify_done(fd_set *readset)
+ {
+       char c;
+-      if (notify_pipe[0] != -1 && FD_ISSET(notify_pipe[0], readset))
+-              while (read(notify_pipe[0], &c, 1) != -1)
++      if (notify_pipe[0] >= 0 && FD_ISSET(notify_pipe[0], readset))
++              while (read(notify_pipe[0], &c, 1) >= 0)
+                       debug2("notify_done: reading");
+ }
+@@ -330,7 +330,7 @@ wait_until_can_do_something(fd_set **rea
+                * If we have buffered data, try to write some of that data
+                * to the program.
+                */
+-              if (fdin != -1 && buffer_len(&stdin_buffer) > 0)
++              if (fdin >= 0 && buffer_len(&stdin_buffer) > 0)
+                       FD_SET(fdin, *writesetp);
+       }
+       notify_prepare(*readsetp);
+@@ -470,7 +470,7 @@ process_output(fd_set *writeset)
+       int len;
+       /* Write buffered data to program stdin. */
+-      if (!compat20 && fdin != -1 && FD_ISSET(fdin, writeset)) {
++      if (!compat20 && fdin >= 0 && FD_ISSET(fdin, writeset)) {
+               data = buffer_ptr(&stdin_buffer);
+               dlen = buffer_len(&stdin_buffer);
+               len = write(fdin, data, dlen);
+@@ -583,7 +583,7 @@ server_loop(pid_t pid, int fdin_arg, int
+       set_nonblock(fdin);
+       set_nonblock(fdout);
+       /* we don't have stderr for interactive terminal sessions, see below */
+-      if (fderr != -1)
++      if (fderr >= 0)
+               set_nonblock(fderr);
+       if (!(datafellows & SSH_BUG_IGNOREMSG) && isatty(fdin))
+@@ -607,7 +607,7 @@ server_loop(pid_t pid, int fdin_arg, int
+       max_fd = MAX(connection_in, connection_out);
+       max_fd = MAX(max_fd, fdin);
+       max_fd = MAX(max_fd, fdout);
+-      if (fderr != -1)
++      if (fderr >= 0)
+               max_fd = MAX(max_fd, fderr);
+ #endif
+@@ -637,7 +637,7 @@ server_loop(pid_t pid, int fdin_arg, int
+                * If we have received eof, and there is no more pending
+                * input data, cause a real eof by closing fdin.
+                */
+-              if (stdin_eof && fdin != -1 && buffer_len(&stdin_buffer) == 0) {
++              if (stdin_eof && fdin >= 0 && buffer_len(&stdin_buffer) == 0) {
+                       if (fdin != fdout)
+                               close(fdin);
+                       else
+@@ -735,15 +735,15 @@ server_loop(pid_t pid, int fdin_arg, int
+       buffer_free(&stderr_buffer);
+       /* Close the file descriptors. */
+-      if (fdout != -1)
++      if (fdout >= 0)
+               close(fdout);
+       fdout = -1;
+       fdout_eof = 1;
+-      if (fderr != -1)
++      if (fderr >= 0)
+               close(fderr);
+       fderr = -1;
+       fderr_eof = 1;
+-      if (fdin != -1)
++      if (fdin >= 0)
+               close(fdin);
+       fdin = -1;
+@@ -937,7 +937,7 @@ server_input_window_size(int type, u_int
+       debug("Window change received.");
+       packet_check_eom();
+-      if (fdin != -1)
++      if (fdin >= 0)
+               pty_change_window_size(fdin, row, col, xpixel, ypixel);
+ }
+@@ -990,7 +990,7 @@ server_request_tun(void)
+       }
+       tun = packet_get_int();
+-      if (forced_tun_device != -1) {
++      if (forced_tun_device >= 0) {
+               if (tun != SSH_TUNID_ANY && forced_tun_device != tun)
+                       goto done;
+               tun = forced_tun_device;
+diff -up openssh-5.9p1/sftp-client.c.coverity openssh-5.9p1/sftp-client.c
+--- openssh-5.9p1/sftp-client.c.coverity       2010-12-04 23:02:48.000000000 +0100
++++ openssh-5.9p1/sftp-client.c        2011-09-14 08:09:48.910470343 +0200
+@@ -149,7 +149,7 @@ get_msg(struct sftp_conn *conn, Buffer *
+ }
+ static void
+-send_string_request(struct sftp_conn *conn, u_int id, u_int code, char *s,
++send_string_request(struct sftp_conn *conn, u_int id, u_int code, const char *s,
+     u_int len)
+ {
+       Buffer msg;
+@@ -165,7 +165,7 @@ send_string_request(struct sftp_conn *co
+ static void
+ send_string_attrs_request(struct sftp_conn *conn, u_int id, u_int code,
+-    char *s, u_int len, Attrib *a)
++    const char *s, u_int len, Attrib *a)
+ {
+       Buffer msg;
+@@ -422,7 +422,7 @@ sftp_proto_version(struct sftp_conn *con
+ }
+ int
+-do_close(struct sftp_conn *conn, char *handle, u_int handle_len)
++do_close(struct sftp_conn *conn, const char *handle, u_int handle_len)
+ {
+       u_int id, status;
+       Buffer msg;
+@@ -447,7 +447,7 @@ do_close(struct sftp_conn *conn, char *h
+ static int
+-do_lsreaddir(struct sftp_conn *conn, char *path, int printflag,
++do_lsreaddir(struct sftp_conn *conn, const char *path, int printflag,
+     SFTP_DIRENT ***dir)
+ {
+       Buffer msg;
+@@ -571,7 +571,7 @@ do_lsreaddir(struct sftp_conn *conn, cha
+ }
+ int
+-do_readdir(struct sftp_conn *conn, char *path, SFTP_DIRENT ***dir)
++do_readdir(struct sftp_conn *conn, const char *path, SFTP_DIRENT ***dir)
+ {
+       return(do_lsreaddir(conn, path, 0, dir));
+ }
+@@ -589,7 +589,7 @@ void free_sftp_dirents(SFTP_DIRENT **s)
+ }
+ int
+-do_rm(struct sftp_conn *conn, char *path)
++do_rm(struct sftp_conn *conn, const char *path)
+ {
+       u_int status, id;
+@@ -604,7 +604,7 @@ do_rm(struct sftp_conn *conn, char *path
+ }
+ int
+-do_mkdir(struct sftp_conn *conn, char *path, Attrib *a, int printflag)
++do_mkdir(struct sftp_conn *conn, const char *path, Attrib *a, int printflag)
+ {
+       u_int status, id;
+@@ -620,7 +620,7 @@ do_mkdir(struct sftp_conn *conn, char *p
+ }
+ int
+-do_rmdir(struct sftp_conn *conn, char *path)
++do_rmdir(struct sftp_conn *conn, const char *path)
+ {
+       u_int status, id;
+@@ -636,7 +636,7 @@ do_rmdir(struct sftp_conn *conn, char *p
+ }
+ Attrib *
+-do_stat(struct sftp_conn *conn, char *path, int quiet)
++do_stat(struct sftp_conn *conn, const char *path, int quiet)
+ {
+       u_int id;
+@@ -650,7 +650,7 @@ do_stat(struct sftp_conn *conn, char *pa
+ }
+ Attrib *
+-do_lstat(struct sftp_conn *conn, char *path, int quiet)
++do_lstat(struct sftp_conn *conn, const char *path, int quiet)
+ {
+       u_int id;
+@@ -684,7 +684,7 @@ do_fstat(struct sftp_conn *conn, char *h
+ #endif
+ int
+-do_setstat(struct sftp_conn *conn, char *path, Attrib *a)
++do_setstat(struct sftp_conn *conn, const char *path, Attrib *a)
+ {
+       u_int status, id;
+@@ -701,7 +701,7 @@ do_setstat(struct sftp_conn *conn, char
+ }
+ int
+-do_fsetstat(struct sftp_conn *conn, char *handle, u_int handle_len,
++do_fsetstat(struct sftp_conn *conn, const char *handle, u_int handle_len,
+     Attrib *a)
+ {
+       u_int status, id;
+@@ -718,12 +718,12 @@ do_fsetstat(struct sftp_conn *conn, char
+ }
+ char *
+-do_realpath(struct sftp_conn *conn, char *path)
++do_realpath(struct sftp_conn *conn, const char *path)
+ {
+       Buffer msg;
+       u_int type, expected_id, count, id;
+       char *filename, *longname;
+-      Attrib *a;
++/*UNUSED Attrib *a; */
+       expected_id = id = conn->msg_id++;
+       send_string_request(conn, id, SSH2_FXP_REALPATH, path,
+@@ -754,7 +754,7 @@ do_realpath(struct sftp_conn *conn, char
+       filename = buffer_get_string(&msg, NULL);
+       longname = buffer_get_string(&msg, NULL);
+-      a = decode_attrib(&msg);
++      /*a =*/ (void) decode_attrib(&msg);
+       debug3("SSH_FXP_REALPATH %s -> %s", path, filename);
+@@ -766,7 +766,7 @@ do_realpath(struct sftp_conn *conn, char
+ }
+ int
+-do_rename(struct sftp_conn *conn, char *oldpath, char *newpath)
++do_rename(struct sftp_conn *conn, const char *oldpath, const char *newpath)
+ {
+       Buffer msg;
+       u_int status, id;
+@@ -800,7 +800,7 @@ do_rename(struct sftp_conn *conn, char *
+ }
+ int
+-do_hardlink(struct sftp_conn *conn, char *oldpath, char *newpath)
++do_hardlink(struct sftp_conn *conn, const char *oldpath, const char *newpath)
+ {
+       Buffer msg;
+       u_int status, id;
+@@ -833,7 +833,7 @@ do_hardlink(struct sftp_conn *conn, char
+ }
+ int
+-do_symlink(struct sftp_conn *conn, char *oldpath, char *newpath)
++do_symlink(struct sftp_conn *conn, const char *oldpath, const char *newpath)
+ {
+       Buffer msg;
+       u_int status, id;
+@@ -984,7 +984,7 @@ send_read_request(struct sftp_conn *conn
+ }
+ int
+-do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
++do_download(struct sftp_conn *conn, const char *remote_path, const char *local_path,
+     Attrib *a, int pflag)
+ {
+       Attrib junk;
+@@ -1223,7 +1223,7 @@ do_download(struct sftp_conn *conn, char
+ }
+ static int
+-download_dir_internal(struct sftp_conn *conn, char *src, char *dst,
++download_dir_internal(struct sftp_conn *conn, const char *src, const char *dst,
+     Attrib *dirattrib, int pflag, int printflag, int depth)
+ {
+       int i, ret = 0;
+@@ -1313,7 +1313,7 @@ download_dir_internal(struct sftp_conn *
+ }
+ int
+-download_dir(struct sftp_conn *conn, char *src, char *dst,
++download_dir(struct sftp_conn *conn, const char *src, const char *dst,
+     Attrib *dirattrib, int pflag, int printflag)
+ {
+       char *src_canon;
+@@ -1331,7 +1331,7 @@ download_dir(struct sftp_conn *conn, cha
+ }
+ int
+-do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
++do_upload(struct sftp_conn *conn, const char *local_path, const char *remote_path,
+     int pflag)
+ {
+       int local_fd;
+@@ -1514,7 +1514,7 @@ do_upload(struct sftp_conn *conn, char *
+ }
+ static int
+-upload_dir_internal(struct sftp_conn *conn, char *src, char *dst,
++upload_dir_internal(struct sftp_conn *conn, const char *src, const char *dst,
+     int pflag, int printflag, int depth)
+ {
+       int ret = 0, status;
+@@ -1605,7 +1605,7 @@ upload_dir_internal(struct sftp_conn *co
+ }
+ int
+-upload_dir(struct sftp_conn *conn, char *src, char *dst, int printflag,
++upload_dir(struct sftp_conn *conn, const char *src, const char *dst, int printflag,
+     int pflag)
+ {
+       char *dst_canon;
+@@ -1622,7 +1622,7 @@ upload_dir(struct sftp_conn *conn, char
+ }
+ char *
+-path_append(char *p1, char *p2)
++path_append(const char *p1, const char *p2)
+ {
+       char *ret;
+       size_t len = strlen(p1) + strlen(p2) + 2;
+diff -up openssh-5.9p1/sftp-client.h.coverity openssh-5.9p1/sftp-client.h
+--- openssh-5.9p1/sftp-client.h.coverity       2010-12-04 23:02:48.000000000 +0100
++++ openssh-5.9p1/sftp-client.h        2011-09-14 08:09:49.021583940 +0200
+@@ -56,49 +56,49 @@ struct sftp_conn *do_init(int, int, u_in
+ u_int sftp_proto_version(struct sftp_conn *);
+ /* Close file referred to by 'handle' */
+-int do_close(struct sftp_conn *, char *, u_int);
++int do_close(struct sftp_conn *, const char *, u_int);
+ /* Read contents of 'path' to NULL-terminated array 'dir' */
+-int do_readdir(struct sftp_conn *, char *, SFTP_DIRENT ***);
++int do_readdir(struct sftp_conn *, const char *, SFTP_DIRENT ***);
+ /* Frees a NULL-terminated array of SFTP_DIRENTs (eg. from do_readdir) */
+ void free_sftp_dirents(SFTP_DIRENT **);
+ /* Delete file 'path' */
+-int do_rm(struct sftp_conn *, char *);
++int do_rm(struct sftp_conn *, const char *);
+ /* Create directory 'path' */
+-int do_mkdir(struct sftp_conn *, char *, Attrib *, int);
++int do_mkdir(struct sftp_conn *, const char *, Attrib *, int);
+ /* Remove directory 'path' */
+-int do_rmdir(struct sftp_conn *, char *);
++int do_rmdir(struct sftp_conn *, const char *);
+ /* Get file attributes of 'path' (follows symlinks) */
+-Attrib *do_stat(struct sftp_conn *, char *, int);
++Attrib *do_stat(struct sftp_conn *, const char *, int);
+ /* Get file attributes of 'path' (does not follow symlinks) */
+-Attrib *do_lstat(struct sftp_conn *, char *, int);
++Attrib *do_lstat(struct sftp_conn *, const char *, int);
+ /* Set file attributes of 'path' */
+-int do_setstat(struct sftp_conn *, char *, Attrib *);
++int do_setstat(struct sftp_conn *, const char *, Attrib *);
+ /* Set file attributes of open file 'handle' */
+-int do_fsetstat(struct sftp_conn *, char *, u_int, Attrib *);
++int do_fsetstat(struct sftp_conn *, const char *, u_int, Attrib *);
+ /* Canonicalise 'path' - caller must free result */
+-char *do_realpath(struct sftp_conn *, char *);
++char *do_realpath(struct sftp_conn *, const char *);
+ /* Get statistics for filesystem hosting file at "path" */
+ int do_statvfs(struct sftp_conn *, const char *, struct sftp_statvfs *, int);
+ /* Rename 'oldpath' to 'newpath' */
+-int do_rename(struct sftp_conn *, char *, char *);
++int do_rename(struct sftp_conn *, const char *, const char *);
+ /* Link 'oldpath' to 'newpath' */
+-int do_hardlink(struct sftp_conn *, char *, char *);
++int do_hardlink(struct sftp_conn *, const char *, const char *);
+-/* Rename 'oldpath' to 'newpath' */
+-int do_symlink(struct sftp_conn *, char *, char *);
++/* Symlink 'oldpath' to 'newpath' */
++int do_symlink(struct sftp_conn *, const char *, const char *);
+ /* XXX: add callbacks to do_download/do_upload so we can do progress meter */
+@@ -106,27 +106,27 @@ int do_symlink(struct sftp_conn *, char
+  * Download 'remote_path' to 'local_path'. Preserve permissions and times
+  * if 'pflag' is set
+  */
+-int do_download(struct sftp_conn *, char *, char *, Attrib *, int);
++int do_download(struct sftp_conn *, const char *, const char *, Attrib *, int);
+ /*
+  * Recursively download 'remote_directory' to 'local_directory'. Preserve 
+  * times if 'pflag' is set
+  */
+-int download_dir(struct sftp_conn *, char *, char *, Attrib *, int, int);
++int download_dir(struct sftp_conn *, const char *, const char *, Attrib *, int, int);
+ /*
+  * Upload 'local_path' to 'remote_path'. Preserve permissions and times
+  * if 'pflag' is set
+  */
+-int do_upload(struct sftp_conn *, char *, char *, int);
++int do_upload(struct sftp_conn *, const char *, const char *, int);
+ /*
+  * Recursively upload 'local_directory' to 'remote_directory'. Preserve 
+  * times if 'pflag' is set
+  */
+-int upload_dir(struct sftp_conn *, char *, char *, int, int);
++int upload_dir(struct sftp_conn *, const char *, const char *, int, int);
+ /* Concatenate paths, taking care of slashes. Caller must free result. */
+-char *path_append(char *, char *);
++char *path_append(const char *, const char *);
+ #endif
+diff -up openssh-5.9p1/sftp.c.coverity openssh-5.9p1/sftp.c
+--- openssh-5.9p1/sftp.c.coverity      2010-12-04 23:02:48.000000000 +0100
++++ openssh-5.9p1/sftp.c       2011-09-14 08:09:49.468493585 +0200
+@@ -206,7 +206,7 @@ killchild(int signo)
+ {
+       if (sshpid > 1) {
+               kill(sshpid, SIGTERM);
+-              waitpid(sshpid, NULL, 0);
++              (void) waitpid(sshpid, NULL, 0);
+       }
+       _exit(1);
+@@ -316,7 +316,7 @@ local_do_ls(const char *args)
+ /* Strip one path (usually the pwd) from the start of another */
+ static char *
+-path_strip(char *path, char *strip)
++path_strip(const char *path, const char *strip)
+ {
+       size_t len;
+@@ -334,7 +334,7 @@ path_strip(char *path, char *strip)
+ }
+ static char *
+-make_absolute(char *p, char *pwd)
++make_absolute(char *p, const char *pwd)
+ {
+       char *abs_str;
+@@ -482,7 +482,7 @@ parse_df_flags(const char *cmd, char **a
+ }
+ static int
+-is_dir(char *path)
++is_dir(const char *path)
+ {
+       struct stat sb;
+@@ -494,7 +494,7 @@ is_dir(char *path)
+ }
+ static int
+-remote_is_dir(struct sftp_conn *conn, char *path)
++remote_is_dir(struct sftp_conn *conn, const char *path)
+ {
+       Attrib *a;
+@@ -508,7 +508,7 @@ remote_is_dir(struct sftp_conn *conn, ch
+ /* Check whether path returned from glob(..., GLOB_MARK, ...) is a directory */
+ static int
+-pathname_is_dir(char *pathname)
++pathname_is_dir(const char *pathname)
+ {
+       size_t l = strlen(pathname);
+@@ -516,7 +516,7 @@ pathname_is_dir(char *pathname)
+ }
+ static int
+-process_get(struct sftp_conn *conn, char *src, char *dst, char *pwd,
++process_get(struct sftp_conn *conn, const char *src, const char *dst, const char *pwd,
+     int pflag, int rflag)
+ {
+       char *abs_src = NULL;
+@@ -590,7 +590,7 @@ out:
+ }
+ static int
+-process_put(struct sftp_conn *conn, char *src, char *dst, char *pwd,
++process_put(struct sftp_conn *conn, const char *src, const char *dst, const char *pwd,
+     int pflag, int rflag)
+ {
+       char *tmp_dst = NULL;
+@@ -695,7 +695,7 @@ sdirent_comp(const void *aa, const void
+ /* sftp ls.1 replacement for directories */
+ static int
+-do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag)
++do_ls_dir(struct sftp_conn *conn, const char *path, const char *strip_path, int lflag)
+ {
+       int n;
+       u_int c = 1, colspace = 0, columns = 1;
+@@ -780,10 +780,10 @@ do_ls_dir(struct sftp_conn *conn, char *
+ /* sftp ls.1 replacement which handles path globs */
+ static int
+-do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path,
++do_globbed_ls(struct sftp_conn *conn, const char *path, const char *strip_path,
+     int lflag)
+ {
+-      Attrib *a = NULL;
++/*UNUSED Attrib *a = NULL;*/
+       char *fname, *lname;
+       glob_t g;
+       int err;
+@@ -828,7 +828,7 @@ do_globbed_ls(struct sftp_conn *conn, ch
+               colspace = width / columns;
+       }
+-      for (i = 0; g.gl_pathv[i] && !interrupted; i++, a = NULL) {
++      for (i = 0; g.gl_pathv[i] && !interrupted; i++/*, a = NULL*/) {
+               fname = path_strip(g.gl_pathv[i], strip_path);
+               if (lflag & LS_LONG_VIEW) {
+                       if (g.gl_statv[i] == NULL) {
+@@ -861,7 +861,7 @@ do_globbed_ls(struct sftp_conn *conn, ch
+ }
+ static int
+-do_df(struct sftp_conn *conn, char *path, int hflag, int iflag)
++do_df(struct sftp_conn *conn, const char *path, int hflag, int iflag)
+ {
+       struct sftp_statvfs st;
+       char s_used[FMT_SCALED_STRSIZE];
+diff -up openssh-5.9p1/ssh-agent.c.coverity openssh-5.9p1/ssh-agent.c
+--- openssh-5.9p1/ssh-agent.c.coverity 2011-06-03 06:14:16.000000000 +0200
++++ openssh-5.9p1/ssh-agent.c  2011-09-14 08:09:49.572460295 +0200
+@@ -1147,8 +1147,8 @@ main(int ac, char **av)
+       sanitise_stdfd();
+       /* drop */
+-      setegid(getgid());
+-      setgid(getgid());
++      (void) setegid(getgid());
++      (void) setgid(getgid());
+ #if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
+       /* Disable ptrace on Linux without sgid bit */
+diff -up openssh-5.9p1/sshd.c.coverity openssh-5.9p1/sshd.c
+--- openssh-5.9p1/sshd.c.coverity      2011-06-23 11:45:51.000000000 +0200
++++ openssh-5.9p1/sshd.c       2011-09-14 08:09:49.687509968 +0200
+@@ -676,8 +676,10 @@ privsep_preauth(Authctxt *authctxt)
+               if (getuid() == 0 || geteuid() == 0)
+                       privsep_preauth_child();
+               setproctitle("%s", "[net]");
+-              if (box != NULL)
++              if (box != NULL) {
+                       ssh_sandbox_child(box);
++                      xfree(box);
++              }
+               return 0;
+       }
+@@ -1302,6 +1304,9 @@ server_accept_loop(int *sock_in, int *so
+               if (num_listen_socks < 0)
+                       break;
+       }
++
++      if (fdset != NULL)
++              xfree(fdset);
+ }
+@@ -1774,7 +1779,7 @@ main(int ac, char **av)
+       /* Chdir to the root directory so that the current disk can be
+          unmounted if desired. */
+-      chdir("/");
++      (void) chdir("/");
+       /* ignore SIGPIPE */
+       signal(SIGPIPE, SIG_IGN);
similarity index 62%
rename from openssh/patches/openssh-5.2p1-edns.patch
rename to openssh/patches/openssh-5.9p1-edns.patch
index f3e431eeba1832c3a3237843b4e1e8e74831d3e8..34f3851269797f6d034cebc714156e96b9922e3e 100644 (file)
@@ -1,7 +1,7 @@
-diff -up openssh-5.2p1/dns.c.rh205842 openssh-5.2p1/dns.c
---- openssh-5.2p1/dns.c.rh205842       2009-07-27 16:25:28.000000000 +0200
-+++ openssh-5.2p1/dns.c        2009-07-27 16:40:59.000000000 +0200
-@@ -176,6 +176,7 @@ verify_host_key_dns(const char *hostname
+diff -up openssh-5.9p1/dns.c.edns openssh-5.9p1/dns.c
+--- openssh-5.9p1/dns.c.edns   2010-08-31 14:41:14.000000000 +0200
++++ openssh-5.9p1/dns.c        2011-09-09 08:05:27.782440497 +0200
+@@ -177,6 +177,7 @@ verify_host_key_dns(const char *hostname
  {
        u_int counter;
        int result;
@@ -9,7 +9,7 @@ diff -up openssh-5.2p1/dns.c.rh205842 openssh-5.2p1/dns.c
        struct rrsetinfo *fingerprints = NULL;
  
        u_int8_t hostkey_algorithm;
-@@ -199,8 +200,19 @@ verify_host_key_dns(const char *hostname
+@@ -200,8 +201,19 @@ verify_host_key_dns(const char *hostname
                return -1;
        }
  
@@ -30,9 +30,9 @@ diff -up openssh-5.2p1/dns.c.rh205842 openssh-5.2p1/dns.c
        if (result) {
                verbose("DNS lookup error: %s", dns_result_totext(result));
                return -1;
-diff -up openssh-5.2p1/openbsd-compat/getrrsetbyname.c.rh205842 openssh-5.2p1/openbsd-compat/getrrsetbyname.c
---- openssh-5.2p1/openbsd-compat/getrrsetbyname.c.rh205842     2009-07-27 16:22:23.000000000 +0200
-+++ openssh-5.2p1/openbsd-compat/getrrsetbyname.c      2009-07-27 16:41:55.000000000 +0200
+diff -up openssh-5.9p1/openbsd-compat/getrrsetbyname.c.edns openssh-5.9p1/openbsd-compat/getrrsetbyname.c
+--- openssh-5.9p1/openbsd-compat/getrrsetbyname.c.edns 2009-07-13 03:38:23.000000000 +0200
++++ openssh-5.9p1/openbsd-compat/getrrsetbyname.c      2011-09-09 15:03:39.930500801 +0200
 @@ -209,8 +209,8 @@ getrrsetbyname(const char *hostname, uns
                goto fail;
        }
@@ -40,7 +40,7 @@ diff -up openssh-5.2p1/openbsd-compat/getrrsetbyname.c.rh205842 openssh-5.2p1/op
 -      /* don't allow flags yet, unimplemented */
 -      if (flags) {
 +      /* Allow RRSET_FORCE_EDNS0 flag only. */
-+      if ((flags & !RRSET_FORCE_EDNS0) != 0) {
++      if ((flags & ~RRSET_FORCE_EDNS0) != 0) {
                result = ERRSET_INVAL;
                goto fail;
        }
@@ -57,9 +57,9 @@ diff -up openssh-5.2p1/openbsd-compat/getrrsetbyname.c.rh205842 openssh-5.2p1/op
  #endif /* RES_USE_DNSEC */
  
        /* make query */
-diff -up openssh-5.2p1/openbsd-compat/getrrsetbyname.h.rh205842 openssh-5.2p1/openbsd-compat/getrrsetbyname.h
---- openssh-5.2p1/openbsd-compat/getrrsetbyname.h.rh205842     2009-07-27 16:35:02.000000000 +0200
-+++ openssh-5.2p1/openbsd-compat/getrrsetbyname.h      2009-07-27 16:36:09.000000000 +0200
+diff -up openssh-5.9p1/openbsd-compat/getrrsetbyname.h.edns openssh-5.9p1/openbsd-compat/getrrsetbyname.h
+--- openssh-5.9p1/openbsd-compat/getrrsetbyname.h.edns 2007-10-26 08:26:50.000000000 +0200
++++ openssh-5.9p1/openbsd-compat/getrrsetbyname.h      2011-09-09 08:05:27.965438689 +0200
 @@ -72,6 +72,9 @@
  #ifndef RRSET_VALIDATED
  # define RRSET_VALIDATED      1
diff --git a/openssh/patches/openssh-5.9p1-entropy.patch b/openssh/patches/openssh-5.9p1-entropy.patch
new file mode 100644 (file)
index 0000000..b3dec46
--- /dev/null
@@ -0,0 +1,251 @@
+diff -up openssh-5.9p0/entropy.c.entropy openssh-5.9p0/entropy.c
+--- openssh-5.9p0/entropy.c.entropy    2011-08-31 13:20:59.660150441 +0200
++++ openssh-5.9p0/entropy.c    2011-08-31 13:21:05.072024970 +0200
+@@ -232,6 +232,9 @@ seed_rng(void)
+       memset(buf, '\0', sizeof(buf));
+ #endif /* OPENSSL_PRNG_ONLY */
++#ifdef __linux__
++      linux_seed();
++#endif /* __linux__ */
+       if (RAND_status() != 1)
+               fatal("PRNG is not seeded");
+ }
+diff -up openssh-5.9p0/openbsd-compat/Makefile.in.entropy openssh-5.9p0/openbsd-compat/Makefile.in
+--- openssh-5.9p0/openbsd-compat/Makefile.in.entropy   2011-08-31 13:20:54.000000000 +0200
++++ openssh-5.9p0/openbsd-compat/Makefile.in   2011-08-31 13:44:25.138151565 +0200
+@@ -20,7 +20,7 @@ OPENBSD=base64.o basename.o bindresvport
+ COMPAT=bsd-arc4random.o bsd-asprintf.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-poll.o bsd-snprintf.o bsd-statvfs.o bsd-waitpid.o fake-rfc2553.o openssl-compat.o xmmap.o xcrypt.o
+-PORTS=port-aix.o port-irix.o port-linux.o port-linux_part_2.o port-solaris.o port-tun.o port-uw.o
++PORTS=port-aix.o port-irix.o port-linux.o port-linux_part_2.o port-linux-prng.o port-solaris.o port-tun.o port-uw.o
+ .c.o:
+       $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
+diff -up openssh-5.9p0/openbsd-compat/port-linux-prng.c.entropy openssh-5.9p0/openbsd-compat/port-linux-prng.c
+--- openssh-5.9p0/openbsd-compat/port-linux-prng.c.entropy     2011-08-31 13:21:05.382024083 +0200
++++ openssh-5.9p0/openbsd-compat/port-linux-prng.c     2011-08-31 13:21:05.386024776 +0200
+@@ -0,0 +1,59 @@
++/* $Id: port-linux.c,v 1.11.4.2 2011/02/04 00:43:08 djm Exp $ */
++
++/*
++ * Copyright (c) 2011 Jan F. Chadima <jchadima@redhat.com>
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ */
++
++/*
++ * Linux-specific portability code - prng support
++ */
++
++#include "includes.h"
++
++#include <errno.h>
++#include <stdarg.h>
++#include <string.h>
++#include <stdio.h>
++#include <openssl/rand.h>
++
++#include "log.h"
++#include "xmalloc.h"
++#include "servconf.h"
++#include "port-linux.h"
++#include "key.h"
++#include "hostfile.h"
++#include "auth.h"
++
++void
++linux_seed(void)
++{
++      int len;
++      char *env = getenv("SSH_USE_STRONG_RNG");
++      char *random = "/dev/random";
++      size_t ienv, randlen = 6;
++
++      if (!env || !strcmp(env, "0"))
++              random = "/dev/urandom";
++      else if ((ienv = atoi(env)) > 6)
++              randlen = ienv;
++
++      errno = 0;
++      if ((len = RAND_load_file(random, randlen)) != randlen) {
++              if (errno)
++                      fatal ("cannot read from %s, %s", random, strerror(errno));
++              else
++                      fatal ("EOF reading %s", random);
++      }
++}
+diff -up openssh-5.9p0/ssh-add.1.entropy openssh-5.9p0/ssh-add.1
+--- openssh-5.9p0/ssh-add.1.entropy    2010-11-05 00:20:14.000000000 +0100
++++ openssh-5.9p0/ssh-add.1    2011-08-31 13:21:05.597122030 +0200
+@@ -158,6 +158,20 @@ Identifies the path of a
+ .Ux Ns -domain
+ socket used to communicate with the agent.
+ .El
++.It Ev SSH_USE_STRONG_RNG
++The reseeding of the OpenSSL random generator is usually done from
++.Cm /dev/urandom .
++If the 
++.Cm SSH_USE_STRONG_RNG
++environment variable is set to value other than
++.Cm 0
++the OpenSSL random generator is reseeded from
++.Cm /dev/random .
++The number of bytes read is defined by the SSH_USE_STRONG_RNG value. 
++Minimum is 6 bytes.
++This setting is not recommended on the computers without the hardware
++random generator because insufficient entropy causes the connection to 
++be blocked until enough entropy is available.
+ .Sh FILES
+ .Bl -tag -width Ds
+ .It Pa ~/.ssh/identity
+diff -up openssh-5.9p0/ssh-agent.1.entropy openssh-5.9p0/ssh-agent.1
+--- openssh-5.9p0/ssh-agent.1.entropy  2010-12-01 01:50:35.000000000 +0100
++++ openssh-5.9p0/ssh-agent.1  2011-08-31 13:21:05.735150196 +0200
+@@ -198,6 +198,24 @@ sockets used to contain the connection t
+ These sockets should only be readable by the owner.
+ The sockets should get automatically removed when the agent exits.
+ .El
++.Sh ENVIRONMENT
++.Bl -tag -width Ds -compact
++.Pp
++.It Pa SSH_USE_STRONG_RNG
++The reseeding of the OpenSSL random generator is usually done from
++.Cm /dev/urandom .
++If the 
++.Cm SSH_USE_STRONG_RNG
++environment variable is set to value other than
++.Cm 0
++the OpenSSL random generator is reseeded from
++.Cm /dev/random .
++The number of bytes read is defined by the SSH_USE_STRONG_RNG value. 
++Minimum is 6 bytes.
++This setting is not recommended on the computers without the hardware
++random generator because insufficient entropy causes the connection to 
++be blocked until enough entropy is available.
++.El
+ .Sh SEE ALSO
+ .Xr ssh 1 ,
+ .Xr ssh-add 1 ,
+diff -up openssh-5.9p0/ssh-keygen.1.entropy openssh-5.9p0/ssh-keygen.1
+--- openssh-5.9p0/ssh-keygen.1.entropy 2011-08-31 13:20:59.200212619 +0200
++++ openssh-5.9p0/ssh-keygen.1 2011-08-31 13:21:06.077150115 +0200
+@@ -669,6 +669,24 @@ Contains Diffie-Hellman groups used for
+ The file format is described in
+ .Xr moduli 5 .
+ .El
++.Sh ENVIRONMENT
++.Bl -tag -width Ds -compact
++.Pp
++.It Pa SSH_USE_STRONG_RNG
++The reseeding of the OpenSSL random generator is usually done from
++.Cm /dev/urandom .
++If the 
++.Cm SSH_USE_STRONG_RNG
++environment variable is set to value other than
++.Cm 0
++the OpenSSL random generator is reseeded from
++.Cm /dev/random .
++The number of bytes read is defined by the SSH_USE_STRONG_RNG value. 
++Minimum is 6 bytes.
++This setting is not recommended on the computers without the hardware
++random generator because insufficient entropy causes the connection to 
++be blocked until enough entropy is available.
++.El
+ .Sh SEE ALSO
+ .Xr ssh 1 ,
+ .Xr ssh-add 1 ,
+diff -up openssh-5.9p0/ssh-keysign.8.entropy openssh-5.9p0/ssh-keysign.8
+--- openssh-5.9p0/ssh-keysign.8.entropy        2010-08-31 14:41:14.000000000 +0200
++++ openssh-5.9p0/ssh-keysign.8        2011-08-31 13:21:06.207024356 +0200
+@@ -78,6 +78,24 @@ must be set-uid root if host-based authe
+ If these files exist they are assumed to contain public certificate
+ information corresponding with the private keys above.
+ .El
++.Sh ENVIRONMENT
++.Bl -tag -width Ds -compact
++.Pp
++.It Pa SSH_USE_STRONG_RNG
++The reseeding of the OpenSSL random generator is usually done from
++.Cm /dev/urandom .
++If the 
++.Cm SSH_USE_STRONG_RNG
++environment variable is set to value other than
++.Cm 0
++the OpenSSL random generator is reseeded from
++.Cm /dev/random .
++The number of bytes read is defined by the SSH_USE_STRONG_RNG value. 
++Minimum is 6 bytes.
++This setting is not recommended on the computers without the hardware
++random generator because insufficient entropy causes the connection to 
++be blocked until enough entropy is available.
++.El
+ .Sh SEE ALSO
+ .Xr ssh 1 ,
+ .Xr ssh-keygen 1 ,
+diff -up openssh-5.9p0/ssh.1.entropy openssh-5.9p0/ssh.1
+--- openssh-5.9p0/ssh.1.entropy        2011-08-31 13:21:00.835103535 +0200
++++ openssh-5.9p0/ssh.1        2011-08-31 13:21:05.482032754 +0200
+@@ -1255,6 +1255,23 @@ For more information, see the
+ .Cm PermitUserEnvironment
+ option in
+ .Xr sshd_config 5 .
++.Sh ENVIRONMENT
++.Bl -tag -width Ds -compact
++.It Ev SSH_USE_STRONG_RNG
++The reseeding of the OpenSSL random generator is usually done from
++.Cm /dev/urandom .
++If the 
++.Cm SSH_USE_STRONG_RNG
++environment variable is set to value other than
++.Cm 0
++the OpenSSL random generator is reseeded from
++.Cm /dev/random .
++The number of bytes read is defined by the SSH_USE_STRONG_RNG value. 
++Minimum is 6 bytes.
++This setting is not recommended on the computers without the hardware
++random generator because insufficient entropy causes the connection to 
++be blocked until enough entropy is available.
++.El
+ .Sh FILES
+ .Bl -tag -width Ds -compact
+ .It Pa ~/.rhosts
+diff -up openssh-5.9p0/sshd.8.entropy openssh-5.9p0/sshd.8
+--- openssh-5.9p0/sshd.8.entropy       2011-08-31 13:21:00.000000000 +0200
++++ openssh-5.9p0/sshd.8       2011-08-31 13:46:27.341025537 +0200
+@@ -940,6 +940,24 @@ concurrently for different ports, this c
+ started last).
+ The content of this file is not sensitive; it can be world-readable.
+ .El
++.Sh ENVIRONMENT
++.Bl -tag -width Ds -compact
++.Pp
++.It Pa SSH_USE_STRONG_RNG
++The reseeding of the OpenSSL random generator is usually done from
++.Cm /dev/urandom .
++If the 
++.Cm SSH_USE_STRONG_RNG
++environment variable is set to value other than
++.Cm 0
++the OpenSSL random generator is reseeded from
++.Cm /dev/random .
++The number of bytes read is defined by the SSH_USE_STRONG_RNG value. 
++Minimum is 6 bytes.
++This setting is not recommended on the computers without the hardware
++random generator because insufficient entropy causes the connection to 
++be blocked until enough entropy is available.
++.El
+ .Sh IPV6
+ IPv6 address can be used everywhere where IPv4 address. In all entries must be the IPv6 address enclosed in square brackets. Note: The square brackets are metacharacters for the shell and must be escaped in shell.
+ .Sh SEE ALSO
diff --git a/openssh/patches/openssh-5.9p1-ipfire.patch b/openssh/patches/openssh-5.9p1-ipfire.patch
new file mode 100644 (file)
index 0000000..cdb49c6
--- /dev/null
@@ -0,0 +1,108 @@
+diff -up openssh-5.9p0/ssh_config.redhat openssh-5.9p0/ssh_config
+--- openssh-5.9p0/ssh_config.redhat    2010-01-12 09:40:27.000000000 +0100
++++ openssh-5.9p0/ssh_config   2011-09-05 14:48:16.386439023 +0200
+@@ -45,3 +45,14 @@
+ #   PermitLocalCommand no
+ #   VisualHostKey no
+ #   ProxyCommand ssh -q -W %h:%p gateway.example.com
++Host *
++      GSSAPIAuthentication yes
++# If this option is set to yes then remote X11 clients will have full access
++# to the original X11 display. As virtually no X11 client supports the untrusted
++# mode correctly we set this to yes.
++      ForwardX11Trusted yes
++# Send locale-related environment variables
++      SendEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES 
++      SendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT 
++      SendEnv LC_IDENTIFICATION LC_ALL LANGUAGE
++      SendEnv XMODIFIERS
+diff -up openssh-5.9p0/sshd_config.0.redhat openssh-5.9p0/sshd_config.0
+--- openssh-5.9p0/sshd_config.0.redhat 2011-09-05 14:48:08.522441255 +0200
++++ openssh-5.9p0/sshd_config.0        2011-09-05 14:48:16.477443868 +0200
+@@ -581,9 +581,9 @@ DESCRIPTION
+      SyslogFacility
+              Gives the facility code that is used when logging messages from
+-             sshd(8).  The possible values are: DAEMON, USER, AUTH, LOCAL0,
+-             LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.  The
+-             default is AUTH.
++             sshd(8).  The possible values are: DAEMON, USER, AUTH, AUTHPRIV,
++             LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
++             The default is AUTH.
+      TCPKeepAlive
+              Specifies whether the system should send TCP keepalive messages
+diff -up openssh-5.9p0/sshd_config.5.redhat openssh-5.9p0/sshd_config.5
+--- openssh-5.9p0/sshd_config.5.redhat 2011-09-05 14:48:08.657564688 +0200
++++ openssh-5.9p0/sshd_config.5        2011-09-05 14:48:16.589501736 +0200
+@@ -1029,7 +1029,7 @@ Note that this option applies to protoco
+ .It Cm SyslogFacility
+ Gives the facility code that is used when logging messages from
+ .Xr sshd 8 .
+-The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
++The possible values are: DAEMON, USER, AUTH, AUTHPRIV, LOCAL0, LOCAL1, LOCAL2,
+ LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
+ The default is AUTH.
+ .It Cm TCPKeepAlive
+diff -up openssh-5.9p0/sshd_config.redhat openssh-5.9p0/sshd_config
+--- openssh-5.9p0/sshd_config.redhat   2011-09-05 14:48:16.250626793 +0200
++++ openssh-5.9p0/sshd_config  2011-09-05 15:06:01.513443553 +0200
+@@ -32,6 +32,7 @@
+ # Logging
+ # obsoletes QuietMode and FascistLogging
+ #SyslogFacility AUTH
++SyslogFacility AUTHPRIV
+ #LogLevel INFO
+ # Authentication:
+@@ -65,9 +66,11 @@ AuthorizedKeysFile  .ssh/authorized_keys
+ # To disable tunneled clear text passwords, change to no here!
+ #PasswordAuthentication yes
+ #PermitEmptyPasswords no
++PasswordAuthentication yes
+ # Change to no to disable s/key passwords
+ #ChallengeResponseAuthentication yes
++ChallengeResponseAuthentication no
+ # Kerberos options
+ #KerberosAuthentication no
+@@ -77,7 +80,9 @@ AuthorizedKeysFile   .ssh/authorized_keys
+ # GSSAPI options
+ #GSSAPIAuthentication no
++GSSAPIAuthentication yes
+ #GSSAPICleanupCredentials yes
++GSSAPICleanupCredentials yes
+ # Set this to 'yes' to enable PAM authentication, account processing, 
+ # and session processing. If this is enabled, PAM authentication will 
+@@ -89,6 +94,7 @@ AuthorizedKeysFile   .ssh/authorized_keys
+ # PAM authentication, then enable this but set PasswordAuthentication
+ # and ChallengeResponseAuthentication to 'no'.
+ #UsePAM no
++UsePAM yes
+ #TwoFactorAuthentication no
+ #SecondPubkeyAuthentication yes
+@@ -101,6 +107,7 @@ AuthorizedKeysFile .ssh/authorized_keys
+ #AllowTcpForwarding yes
+ #GatewayPorts no
+ #X11Forwarding no
++X11Forwarding yes
+ #X11DisplayOffset 10
+ #X11UseLocalhost yes
+ #PrintMotd yes
+@@ -121,6 +128,12 @@ AuthorizedKeysFile        .ssh/authorized_keys
+ # no default banner path
+ #Banner none
++# Accept locale-related environment variables
++AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
++AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
++AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
++AcceptEnv XMODIFIERS
++
+ # override default of no subsystems
+ Subsystem     sftp    /usr/libexec/sftp-server
diff --git a/openssh/patches/openssh-5.9p1-ipv6man.patch b/openssh/patches/openssh-5.9p1-ipv6man.patch
new file mode 100644 (file)
index 0000000..ece1a73
--- /dev/null
@@ -0,0 +1,24 @@
+diff -up openssh-5.9p0/ssh.1.ipv6man openssh-5.9p0/ssh.1
+--- openssh-5.9p0/ssh.1.ipv6man        2011-08-05 22:17:32.000000000 +0200
++++ openssh-5.9p0/ssh.1        2011-08-31 13:08:34.880024485 +0200
+@@ -1400,6 +1400,8 @@ manual page for more information.
+ .Nm
+ exits with the exit status of the remote command or with 255
+ if an error occurred.
++.Sh IPV6
++IPv6 address can be used everywhere where IPv4 address. In all entries must be the IPv6 address enclosed in square brackets. Note: The square brackets are metacharacters for the shell and must be escaped in shell.
+ .Sh SEE ALSO
+ .Xr scp 1 ,
+ .Xr sftp 1 ,
+diff -up openssh-5.9p0/sshd.8.ipv6man openssh-5.9p0/sshd.8
+--- openssh-5.9p0/sshd.8.ipv6man       2011-08-05 22:17:32.000000000 +0200
++++ openssh-5.9p0/sshd.8       2011-08-31 13:10:34.129039094 +0200
+@@ -940,6 +940,8 @@ concurrently for different ports, this c
+ started last).
+ The content of this file is not sensitive; it can be world-readable.
+ .El
++.Sh IPV6
++IPv6 address can be used everywhere where IPv4 address. In all entries must be the IPv6 address enclosed in square brackets. Note: The square brackets are metacharacters for the shell and must be escaped in shell.
+ .Sh SEE ALSO
+ .Xr scp 1 ,
+ .Xr sftp 1 ,
diff --git a/openssh/patches/openssh-5.9p1-keygen.patch b/openssh/patches/openssh-5.9p1-keygen.patch
new file mode 100644 (file)
index 0000000..69d4a6f
--- /dev/null
@@ -0,0 +1,80 @@
+diff -up openssh-5.9p0/ssh-keygen.0.keygen openssh-5.9p0/ssh-keygen.0
+--- openssh-5.9p0/ssh-keygen.0.keygen  2011-08-29 16:30:02.000000000 +0200
++++ openssh-5.9p0/ssh-keygen.0 2011-08-30 13:47:56.208087184 +0200
+@@ -4,7 +4,7 @@ NAME
+      ssh-keygen - authentication key generation, management and conversion
+ SYNOPSIS
+-     ssh-keygen [-q] [-b bits] -t type [-N new_passphrase] [-C comment]
++     ssh-keygen [-q] [-o] [-b bits] -t type [-N new_passphrase] [-C comment]
+                 [-f output_keyfile]
+      ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]
+      ssh-keygen -i [-m key_format] [-f input_keyfile]
+@@ -181,6 +181,8 @@ DESCRIPTION
+              principals may be specified, separated by commas.  Please see the
+              CERTIFICATES section for details.
++     -o      Overwrite the key without prompting user.
++
+      -O option
+              Specify a certificate option when signing a key.  This option may
+              be specified multiple times.  Please see the CERTIFICATES section
+diff -up openssh-5.9p0/ssh-keygen.1.keygen openssh-5.9p0/ssh-keygen.1
+--- openssh-5.9p0/ssh-keygen.1.keygen  2011-08-30 13:32:30.787149917 +0200
++++ openssh-5.9p0/ssh-keygen.1 2011-08-30 13:46:42.638087171 +0200
+@@ -45,6 +45,7 @@
+ .Bk -words
+ .Nm ssh-keygen
+ .Op Fl q
++.Op Fl o
+ .Op Fl b Ar bits
+ .Fl t Ar type
+ .Op Fl N Ar new_passphrase
+@@ -339,6 +340,8 @@ Multiple principals may be specified, se
+ Please see the
+ .Sx CERTIFICATES
+ section for details.
++.It Fl o
++Overwrite the key without prompting user.
+ .It Fl O Ar option
+ Specify a certificate option when signing a key.
+ This option may be specified multiple times.
+diff -up openssh-5.9p0/ssh-keygen.c.keygen openssh-5.9p0/ssh-keygen.c
+--- openssh-5.9p0/ssh-keygen.c.keygen  2011-08-30 13:32:20.268149992 +0200
++++ openssh-5.9p0/ssh-keygen.c 2011-08-30 13:39:34.550214102 +0200
+@@ -73,6 +73,7 @@ int change_passphrase = 0;
+ int change_comment = 0;
+ int quiet = 0;
++int overwrite = 0;
+ int log_level = SYSLOG_LEVEL_INFO;
+@@ -1959,7 +1960,7 @@ main(int argc, char **argv)
+               exit(1);
+       }
+-      while ((opt = getopt(argc, argv, "AegiqpclBHLhvxXyF:b:f:t:D:I:P:m:N:n:"
++      while ((opt = getopt(argc, argv, "AegiqopclBHLhvxXyF:b:f:t:D:I:P:m:N:n:"
+           "O:C:r:g:R:T:G:M:S:s:a:V:W:z:")) != -1) {
+               switch (opt) {
+               case 'A':
+@@ -2042,6 +2043,9 @@ main(int argc, char **argv)
+               case 'q':
+                       quiet = 1;
+                       break;
++              case 'o':
++                      overwrite = 1;
++                      break;
+               case 'e':
+               case 'x':
+                       /* export key */
+@@ -2278,7 +2282,7 @@ main(int argc, char **argv)
+               }
+       }
+       /* If the file already exists, ask the user to confirm. */
+-      if (stat(identity_file, &st) >= 0) {
++      if (!overwrite && stat(identity_file, &st) >= 0) {
+               char yesno[3];
+               printf("%s already exists.\n", identity_file);
+               printf("Overwrite (y/n)? ");
similarity index 60%
rename from openssh/patches/openssh-5.8p1-kuserok.patch
rename to openssh/patches/openssh-5.9p1-kuserok.patch
index fcd05d78e3241a988c748bae181d89d7fe78d7d9..11f38a51c9e78ffa0a10cec903fe7bedb890d642 100644 (file)
@@ -1,6 +1,6 @@
-diff -up openssh-5.8p1/auth-krb5.c.kuserok openssh-5.8p1/auth-krb5.c
---- openssh-5.8p1/auth-krb5.c.kuserok  2009-12-21 00:49:22.000000000 +0100
-+++ openssh-5.8p1/auth-krb5.c  2011-02-14 09:15:12.000000000 +0100
+diff -up openssh-5.9p0/auth-krb5.c.kuserok openssh-5.9p0/auth-krb5.c
+--- openssh-5.9p0/auth-krb5.c.kuserok  2011-08-30 16:37:32.651150128 +0200
++++ openssh-5.9p0/auth-krb5.c  2011-08-30 16:37:37.549087368 +0200
 @@ -54,6 +54,20 @@
  
  extern ServerOptions   options;
@@ -31,30 +31,30 @@ diff -up openssh-5.8p1/auth-krb5.c.kuserok openssh-5.8p1/auth-krb5.c
                problem = -1;
                goto out;
        }
-diff -up openssh-5.8p1/gss-serv-krb5.c.kuserok openssh-5.8p1/gss-serv-krb5.c
---- openssh-5.8p1/gss-serv-krb5.c.kuserok      2006-09-01 07:38:36.000000000 +0200
-+++ openssh-5.8p1/gss-serv-krb5.c      2011-02-14 09:15:12.000000000 +0100
-@@ -57,6 +57,7 @@ extern ServerOptions options;
- #endif
+diff -up openssh-5.9p0/gss-serv-krb5.c.kuserok openssh-5.9p0/gss-serv-krb5.c
+--- openssh-5.9p0/gss-serv-krb5.c.kuserok      2011-08-30 16:37:36.988024804 +0200
++++ openssh-5.9p0/gss-serv-krb5.c      2011-08-30 16:37:37.659088030 +0200
+@@ -68,6 +68,7 @@ static int ssh_gssapi_krb5_cmdok(krb5_pr
+     int);
  
  static krb5_context krb_context = NULL;
 +extern int ssh_krb5_kuserok(krb5_context, krb5_principal, const char *);
  
  /* Initialise the krb5 library, for the stuff that GSSAPI won't do */
  
-@@ -97,7 +98,7 @@ ssh_gssapi_krb5_userok(ssh_gssapi_client
-                   krb5_get_err_text(krb_context, retval));
-               return 0;
-       }
--      if (krb5_kuserok(krb_context, princ, name)) {
-+      if (ssh_krb5_kuserok(krb_context, princ, name)) {
+@@ -115,7 +116,7 @@ ssh_gssapi_krb5_userok(ssh_gssapi_client
+       /* NOTE: .k5login and .k5users must opened as root, not the user,
+        * because if they are on a krb5-protected filesystem, user credentials
+        * to access these files aren't available yet. */
+-      if (krb5_kuserok(krb_context, princ, luser) && k5login_exists) {
++      if (ssh_krb5_kuserok(krb_context, princ, luser) && k5login_exists) {
                retval = 1;
                logit("Authorized to %s, krb5 principal %s (krb5_kuserok)",
-                   name, (char *)client->displayname.value);
-diff -up openssh-5.8p1/servconf.c.kuserok openssh-5.8p1/servconf.c
---- openssh-5.8p1/servconf.c.kuserok   2011-02-14 09:15:12.000000000 +0100
-+++ openssh-5.8p1/servconf.c   2011-02-14 09:20:22.000000000 +0100
-@@ -142,6 +142,7 @@ initialize_server_options(ServerOptions 
+                   luser, (char *)client->displayname.value);
+diff -up openssh-5.9p0/servconf.c.kuserok openssh-5.9p0/servconf.c
+--- openssh-5.9p0/servconf.c.kuserok   2011-08-30 16:37:35.093073603 +0200
++++ openssh-5.9p0/servconf.c   2011-08-30 16:41:13.568087145 +0200
+@@ -144,6 +144,7 @@ initialize_server_options(ServerOptions
        options->authorized_principals_file = NULL;
        options->ip_qos_interactive = -1;
        options->ip_qos_bulk = -1;
@@ -63,15 +63,15 @@ diff -up openssh-5.8p1/servconf.c.kuserok openssh-5.8p1/servconf.c
  
  void
 @@ -291,6 +292,8 @@ fill_default_server_options(ServerOption
-       if (use_privsep == -1)
-               use_privsep = 1;
+               options->ip_qos_bulk = IPTOS_THROUGHPUT;
+       if (options->show_patchlevel == -1)
+               options->show_patchlevel = 0;
 +      if (options->use_kuserok == -1)
 +              options->use_kuserok = 1;
- #ifndef HAVE_MMAP
-       if (use_privsep && options->compression == 1) {
-               error("This platform does not support both privilege "
-@@ -312,7 +315,7 @@ typedef enum {
+       /* Turn privilege separation on by default */
+       if (use_privsep == -1)
+@@ -317,7 +320,7 @@ typedef enum {
        sPermitRootLogin, sLogFacility, sLogLevel,
        sRhostsRSAAuthentication, sRSAAuthentication,
        sKerberosAuthentication, sKerberosOrLocalPasswd, sKerberosTicketCleanup,
@@ -80,7 +80,7 @@ diff -up openssh-5.8p1/servconf.c.kuserok openssh-5.8p1/servconf.c
        sKerberosTgtPassing, sChallengeResponseAuthentication,
        sPasswordAuthentication, sKbdInteractiveAuthentication,
        sListenAddress, sAddressFamily,
-@@ -381,11 +384,13 @@ static struct {
+@@ -388,11 +391,13 @@ static struct {
  #else
        { "kerberosgetafstoken", sUnsupported, SSHCFG_GLOBAL },
  #endif
@@ -94,7 +94,7 @@ diff -up openssh-5.8p1/servconf.c.kuserok openssh-5.8p1/servconf.c
  #endif
        { "kerberostgtpassing", sUnsupported, SSHCFG_GLOBAL },
        { "afstokenpassing", sUnsupported, SSHCFG_GLOBAL },
-@@ -1341,6 +1346,10 @@ process_server_config_line(ServerOptions
+@@ -1371,6 +1376,10 @@ process_server_config_line(ServerOptions
                *activep = value;
                break;
  
@@ -105,15 +105,15 @@ diff -up openssh-5.8p1/servconf.c.kuserok openssh-5.8p1/servconf.c
        case sPermitOpen:
                arg = strdelim(&cp);
                if (!arg || *arg == '\0')
-@@ -1544,6 +1553,7 @@ copy_set_server_options(ServerOptions *d
+@@ -1580,6 +1589,7 @@ copy_set_server_options(ServerOptions *d
        M_CP_INTOPT(max_authtries);
        M_CP_INTOPT(ip_qos_interactive);
        M_CP_INTOPT(ip_qos_bulk);
 +      M_CP_INTOPT(use_kuserok);
  
-       M_CP_STROPT(banner);
-       if (preauth)
-@@ -1764,6 +1774,7 @@ dump_config(ServerOptions *o)
+       /* See comment in servconf.h */
+       COPY_MATCH_STRING_OPTS();
+@@ -1816,6 +1826,7 @@ dump_config(ServerOptions *o)
        dump_cfg_fmtint(sUseDNS, o->use_dns);
        dump_cfg_fmtint(sAllowTcpForwarding, o->allow_tcp_forwarding);
        dump_cfg_fmtint(sUsePrivilegeSeparation, use_privsep);
@@ -121,10 +121,10 @@ diff -up openssh-5.8p1/servconf.c.kuserok openssh-5.8p1/servconf.c
  
        /* string arguments */
        dump_cfg_string(sPidFile, o->pid_file);
-diff -up openssh-5.8p1/servconf.h.kuserok openssh-5.8p1/servconf.h
---- openssh-5.8p1/servconf.h.kuserok   2011-02-14 09:15:12.000000000 +0100
-+++ openssh-5.8p1/servconf.h   2011-02-14 09:15:12.000000000 +0100
-@@ -157,6 +157,7 @@ typedef struct {
+diff -up openssh-5.9p0/servconf.h.kuserok openssh-5.9p0/servconf.h
+--- openssh-5.9p0/servconf.h.kuserok   2011-08-30 16:37:35.201051957 +0200
++++ openssh-5.9p0/servconf.h   2011-08-30 16:37:37.926087431 +0200
+@@ -166,6 +166,7 @@ typedef struct {
  
        int     num_permitted_opens;
  
@@ -132,10 +132,10 @@ diff -up openssh-5.8p1/servconf.h.kuserok openssh-5.8p1/servconf.h
        char   *chroot_directory;
        char   *revoked_keys_file;
        char   *trusted_user_ca_keys;
-diff -up openssh-5.8p1/sshd_config.5.kuserok openssh-5.8p1/sshd_config.5
---- openssh-5.8p1/sshd_config.5.kuserok        2011-02-14 09:15:12.000000000 +0100
-+++ openssh-5.8p1/sshd_config.5        2011-02-14 09:17:11.000000000 +0100
-@@ -574,6 +574,10 @@ Specifies whether to automatically destr
+diff -up openssh-5.9p0/sshd_config.5.kuserok openssh-5.9p0/sshd_config.5
+--- openssh-5.9p0/sshd_config.5.kuserok        2011-08-30 16:37:35.979024607 +0200
++++ openssh-5.9p0/sshd_config.5        2011-08-30 16:37:38.040087843 +0200
+@@ -603,6 +603,10 @@ Specifies whether to automatically destr
  file on logout.
  The default is
  .Dq yes .
@@ -146,7 +146,7 @@ diff -up openssh-5.8p1/sshd_config.5.kuserok openssh-5.8p1/sshd_config.5
  .It Cm KexAlgorithms
  Specifies the available KEX (Key Exchange) algorithms.
  Multiple algorithms must be comma-separated.
-@@ -715,6 +719,7 @@ Available keywords are
+@@ -746,6 +750,7 @@ Available keywords are
  .Cm HostbasedUsesNameFromPacketOnly ,
  .Cm KbdInteractiveAuthentication ,
  .Cm KerberosAuthentication ,
@@ -154,10 +154,10 @@ diff -up openssh-5.8p1/sshd_config.5.kuserok openssh-5.8p1/sshd_config.5
  .Cm MaxAuthTries ,
  .Cm MaxSessions ,
  .Cm PubkeyAuthentication ,
-diff -up openssh-5.8p1/sshd_config.kuserok openssh-5.8p1/sshd_config
---- openssh-5.8p1/sshd_config.kuserok  2011-02-14 09:15:12.000000000 +0100
-+++ openssh-5.8p1/sshd_config  2011-02-14 09:15:12.000000000 +0100
-@@ -73,6 +73,7 @@ ChallengeResponseAuthentication no
+diff -up openssh-5.9p0/sshd_config.kuserok openssh-5.9p0/sshd_config
+--- openssh-5.9p0/sshd_config.kuserok  2011-08-30 16:37:36.808026328 +0200
++++ openssh-5.9p0/sshd_config  2011-08-30 16:37:38.148071520 +0200
+@@ -77,6 +77,7 @@ ChallengeResponseAuthentication no
  #KerberosOrLocalPasswd yes
  #KerberosTicketCleanup yes
  #KerberosGetAFSToken no
similarity index 89%
rename from openssh/patches/openssh-5.8p1-mls.patch
rename to openssh/patches/openssh-5.9p1-mls.patch
index 525e6b534b48ec73bdbb720cb4179dbe7b5f0849..1163949063c8070a1dd95e5e3a8aeb759bbede4b 100644 (file)
@@ -1,6 +1,6 @@
-diff -up openssh-5.8p1/misc.c.mls openssh-5.8p1/misc.c
---- openssh-5.8p1/misc.c.mls   2011-01-13 02:21:36.000000000 +0100
-+++ openssh-5.8p1/misc.c       2011-02-12 15:05:06.000000000 +0100
+diff -up openssh-5.9p0/misc.c.mls openssh-5.9p0/misc.c
+--- openssh-5.9p0/misc.c.mls   2011-05-05 06:14:34.000000000 +0200
++++ openssh-5.9p0/misc.c       2011-08-30 12:29:29.157087474 +0200
 @@ -427,6 +427,7 @@ char *
  colon(char *cp)
  {
@@ -23,10 +23,10 @@ diff -up openssh-5.8p1/misc.c.mls openssh-5.8p1/misc.c
        }
        return NULL;
  }
-diff -up openssh-5.8p1/openbsd-compat/port-linux.c.mls openssh-5.8p1/openbsd-compat/port-linux.c
---- openssh-5.8p1/openbsd-compat/port-linux.c.mls      2011-02-12 15:05:06.000000000 +0100
-+++ openssh-5.8p1/openbsd-compat/port-linux.c  2011-02-12 15:09:23.000000000 +0100
-@@ -40,13 +40,164 @@
+diff -up openssh-5.9p0/openbsd-compat/port-linux.c.mls openssh-5.9p0/openbsd-compat/port-linux.c
+--- openssh-5.9p0/openbsd-compat/port-linux.c.mls      2011-08-30 12:29:28.873086987 +0200
++++ openssh-5.9p0/openbsd-compat/port-linux.c  2011-08-30 13:28:12.584149668 +0200
+@@ -40,7 +40,15 @@
  #ifdef WITH_SELINUX
  #include <selinux/selinux.h>
  #include <selinux/flask.h>
@@ -40,8 +40,9 @@ diff -up openssh-5.8p1/openbsd-compat/port-linux.c.mls openssh-5.8p1/openbsd-com
 +#include <unistd.h>
 +#endif
  
- extern ServerOptions options;
- extern Authctxt *the_authctxt;
+ #ifndef SSH_SELINUX_UNCONFINED_TYPE
+ # define SSH_SELINUX_UNCONFINED_TYPE ":unconfined_t:"
+@@ -51,6 +59,149 @@ extern Authctxt *the_authctxt;
  extern int inetd_flag;
  extern int rexeced_flag;
  
@@ -191,7 +192,7 @@ diff -up openssh-5.8p1/openbsd-compat/port-linux.c.mls openssh-5.8p1/openbsd-com
  static void
  ssh_selinux_get_role_level(char **role, const char **level)
  {
-@@ -65,14 +216,16 @@ ssh_selinux_get_role_level(char **role, 
+@@ -69,14 +220,15 @@ ssh_selinux_get_role_level(char **role,
  }
  
  /* Return the default security context for the given username */
@@ -201,16 +202,16 @@ diff -up openssh-5.8p1/openbsd-compat/port-linux.c.mls openssh-5.8p1/openbsd-com
 +ssh_selinux_getctxbyname(char *pwname,
 +      security_context_t *default_sc, security_context_t *user_sc)
  {
-       security_context_t sc = NULL;
+-      security_context_t sc = NULL;
        char *sename, *lvl;
        char *role;
        const char *reqlvl;
        int r = 0;
-+      context_t con;
++      context_t con = NULL;
+  
        ssh_selinux_get_role_level(&role, &reqlvl);
- #ifdef HAVE_GETSEUSERBYNAME
-@@ -82,38 +235,63 @@ ssh_selinux_getctxbyname(char *pwname)
+@@ -87,37 +239,62 @@ ssh_selinux_getctxbyname(char *pwname)
        }
  #else
        sename = pwname;
@@ -264,7 +265,7 @@ diff -up openssh-5.8p1/openbsd-compat/port-linux.c.mls openssh-5.8p1/openbsd-com
 +                          reqlvl = "";
 +
 +                      debug("%s: current connection level '%s'", __func__, reqlvl);
-+              }
+               }
 +              
 +              if ((reqlvl != NULL && reqlvl[0]) || (role != NULL && role[0])) {
 +                      r = get_user_context(sename, role, reqlvl, user_sc);
@@ -287,16 +288,15 @@ diff -up openssh-5.8p1/openbsd-compat/port-linux.c.mls openssh-5.8p1/openbsd-com
 +                      }
 +              } else {
 +                      *user_sc = *default_sc;
-               }
-       }
++              }
++      }
 +      if (r != 0) {
 +              error("%s: Failed to get default SELinux security "
 +                  "context for %s", __func__, pwname);
-+      }
+       }
  
  #ifdef HAVE_GETSEUSERBYNAME
-       if (sename != NULL)
-@@ -121,8 +299,12 @@ ssh_selinux_getctxbyname(char *pwname)
+@@ -126,8 +303,12 @@ ssh_selinux_getctxbyname(char *pwname)
        if (lvl != NULL)
                xfree(lvl);
  #endif
@@ -311,7 +311,7 @@ diff -up openssh-5.8p1/openbsd-compat/port-linux.c.mls openssh-5.8p1/openbsd-com
  }
  
  /* Setup environment variables for pam_selinux */
-@@ -160,6 +342,8 @@ void
+@@ -165,6 +346,8 @@ void
  ssh_selinux_setup_exec_context(char *pwname)
  {
        security_context_t user_ctx = NULL;
@@ -320,7 +320,7 @@ diff -up openssh-5.8p1/openbsd-compat/port-linux.c.mls openssh-5.8p1/openbsd-com
  
        if (!ssh_selinux_enabled())
                return;
-@@ -184,22 +368,45 @@ ssh_selinux_setup_exec_context(char *pwn
+@@ -189,22 +372,45 @@ ssh_selinux_setup_exec_context(char *pwn
  
        debug3("%s: setting execution context", __func__);
  
@@ -373,7 +373,7 @@ diff -up openssh-5.8p1/openbsd-compat/port-linux.c.mls openssh-5.8p1/openbsd-com
  
        debug3("%s: done", __func__);
  }
-@@ -217,7 +424,10 @@ ssh_selinux_setup_pty(char *pwname, cons
+@@ -222,7 +428,10 @@ ssh_selinux_setup_pty(char *pwname, cons
  
        debug3("%s: setting TTY context on %s", __func__, tty);
  
@@ -385,10 +385,10 @@ diff -up openssh-5.8p1/openbsd-compat/port-linux.c.mls openssh-5.8p1/openbsd-com
  
        /* XXX: should these calls fatal() upon failure in enforcing mode? */
  
-diff -up openssh-5.8p1/sshd.c.mls openssh-5.8p1/sshd.c
---- openssh-5.8p1/sshd.c.mls   2011-02-12 15:05:05.000000000 +0100
-+++ openssh-5.8p1/sshd.c       2011-02-12 15:05:06.000000000 +0100
-@@ -2011,6 +2011,9 @@ main(int ac, char **av)
+diff -up openssh-5.9p0/sshd.c.mls openssh-5.9p0/sshd.c
+--- openssh-5.9p0/sshd.c.mls   2011-08-30 12:29:22.663149706 +0200
++++ openssh-5.9p0/sshd.c       2011-08-30 12:29:29.524024777 +0200
+@@ -2082,6 +2082,9 @@ main(int ac, char **av)
                restore_uid();
        }
  #endif
diff --git a/openssh/patches/openssh-5.9p1-randclean.patch b/openssh/patches/openssh-5.9p1-randclean.patch
new file mode 100644 (file)
index 0000000..a2c5d33
--- /dev/null
@@ -0,0 +1,13 @@
+diff -up openssh-5.9p0/entropy.c.randclean openssh-5.9p0/entropy.c
+--- openssh-5.9p0/entropy.c.randclean  2011-08-30 13:52:45.000000000 +0200
++++ openssh-5.9p0/entropy.c    2011-08-30 13:57:44.630111338 +0200
+@@ -217,6 +217,9 @@ seed_rng(void)
+               fatal("OpenSSL version mismatch. Built against %lx, you "
+                   "have %lx", (u_long)OPENSSL_VERSION_NUMBER, SSLeay());
++      /* clean the PRNG status when exiting the program */
++      atexit(RAND_cleanup);
++
+ #ifndef OPENSSL_PRNG_ONLY
+       if (RAND_status() == 1) {
+               debug3("RNG is ready, skipping seeding");
similarity index 77%
rename from openssh/patches/openssh-5.8p1-selinux-role.patch
rename to openssh/patches/openssh-5.9p1-role.patch
index f29ad9a08693510845c8808638f53da8ec24524b..8a26bdfc561110c23029ed989de911c09c2aa3a7 100644 (file)
@@ -1,6 +1,43 @@
-diff -up openssh-5.8p1/auth1.c.role openssh-5.8p1/auth1.c
---- openssh-5.8p1/auth1.c.role 2010-08-31 14:36:39.000000000 +0200
-+++ openssh-5.8p1/auth1.c      2011-02-12 14:34:11.000000000 +0100
+diff -up openssh-5.9p0/auth-pam.c.role openssh-5.9p0/auth-pam.c
+--- openssh-5.9p0/auth-pam.c.role      2009-07-12 14:07:21.000000000 +0200
++++ openssh-5.9p0/auth-pam.c   2011-08-31 11:42:54.870087433 +0200
+@@ -1069,7 +1069,7 @@ is_pam_session_open(void)
+  * during the ssh authentication process.
+  */
+ int
+-do_pam_putenv(char *name, char *value)
++do_pam_putenv(char *name, const char *value)
+ {
+       int ret = 1;
+ #ifdef HAVE_PAM_PUTENV
+diff -up openssh-5.9p0/auth-pam.h.role openssh-5.9p0/auth-pam.h
+--- openssh-5.9p0/auth-pam.h.role      2004-09-11 14:17:26.000000000 +0200
++++ openssh-5.9p0/auth-pam.h   2011-08-31 11:42:54.979086333 +0200
+@@ -38,7 +38,7 @@ void do_pam_session(void);
+ void do_pam_set_tty(const char *);
+ void do_pam_setcred(int );
+ void do_pam_chauthtok(void);
+-int do_pam_putenv(char *, char *);
++int do_pam_putenv(char *, const char *);
+ char ** fetch_pam_environment(void);
+ char ** fetch_pam_child_environment(void);
+ void free_pam_environment(char **);
+diff -up openssh-5.9p0/auth.h.role openssh-5.9p0/auth.h
+--- openssh-5.9p0/auth.h.role  2011-08-31 11:42:47.760024631 +0200
++++ openssh-5.9p0/auth.h       2011-08-31 11:42:55.090151027 +0200
+@@ -59,6 +59,9 @@ struct Authctxt {
+       char            *service;
+       struct passwd   *pw;            /* set if 'valid' */
+       char            *style;
++#ifdef WITH_SELINUX
++      char            *role;
++#endif
+       void            *kbdintctxt;
+       void            *jpake_ctx;
+ #ifdef BSD_AUTH
+diff -up openssh-5.9p0/auth1.c.role openssh-5.9p0/auth1.c
+--- openssh-5.9p0/auth1.c.role 2010-08-31 14:36:39.000000000 +0200
++++ openssh-5.9p0/auth1.c      2011-08-31 11:42:55.215033075 +0200
 @@ -384,6 +384,9 @@ do_authentication(Authctxt *authctxt)
  {
        u_int ulen;
@@ -36,52 +73,10 @@ diff -up openssh-5.8p1/auth1.c.role openssh-5.8p1/auth1.c
  
        /* Verify that the user is a valid user. */
        if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL)
-diff -up openssh-5.8p1/auth2.c.role openssh-5.8p1/auth2.c
---- openssh-5.8p1/auth2.c.role 2010-08-31 14:36:39.000000000 +0200
-+++ openssh-5.8p1/auth2.c      2011-02-12 14:34:11.000000000 +0100
-@@ -216,6 +216,9 @@ input_userauth_request(int type, u_int32
-       Authctxt *authctxt = ctxt;
-       Authmethod *m = NULL;
-       char *user, *service, *method, *style = NULL;
-+#ifdef WITH_SELINUX
-+      char *role = NULL;
-+#endif
-       int authenticated = 0;
-       if (authctxt == NULL)
-@@ -227,6 +230,11 @@ input_userauth_request(int type, u_int32
-       debug("userauth-request for user %s service %s method %s", user, service, method);
-       debug("attempt %d failures %d", authctxt->attempt, authctxt->failures);
-+#ifdef WITH_SELINUX
-+      if ((role = strchr(user, '/')) != NULL)
-+              *role++ = 0;
-+#endif
-+
-       if ((style = strchr(user, ':')) != NULL)
-               *style++ = 0;
-@@ -252,8 +260,15 @@ input_userauth_request(int type, u_int32
-                   use_privsep ? " [net]" : "");
-               authctxt->service = xstrdup(service);
-               authctxt->style = style ? xstrdup(style) : NULL;
--              if (use_privsep)
-+#ifdef WITH_SELINUX
-+              authctxt->role = role ? xstrdup(role) : NULL;
-+#endif
-+              if (use_privsep) {
-                       mm_inform_authserv(service, style);
-+#ifdef WITH_SELINUX
-+                      mm_inform_authrole(role);
-+#endif
-+              }
-               userauth_banner();
-       } else if (strcmp(user, authctxt->user) != 0 ||
-           strcmp(service, authctxt->service) != 0) {
-diff -up openssh-5.8p1/auth2-gss.c.role openssh-5.8p1/auth2-gss.c
---- openssh-5.8p1/auth2-gss.c.role     2007-12-02 12:59:45.000000000 +0100
-+++ openssh-5.8p1/auth2-gss.c  2011-02-12 14:34:11.000000000 +0100
-@@ -258,6 +258,7 @@ input_gssapi_mic(int type, u_int32_t ple
+diff -up openssh-5.9p0/auth2-gss.c.role openssh-5.9p0/auth2-gss.c
+--- openssh-5.9p0/auth2-gss.c.role     2011-05-05 06:04:11.000000000 +0200
++++ openssh-5.9p0/auth2-gss.c  2011-08-31 11:42:55.313025576 +0200
+@@ -260,6 +260,7 @@ input_gssapi_mic(int type, u_int32_t ple
        Authctxt *authctxt = ctxt;
        Gssctxt *gssctxt;
        int authenticated = 0;
@@ -89,7 +84,7 @@ diff -up openssh-5.8p1/auth2-gss.c.role openssh-5.8p1/auth2-gss.c
        Buffer b;
        gss_buffer_desc mic, gssbuf;
        u_int len;
-@@ -270,7 +271,13 @@ input_gssapi_mic(int type, u_int32_t ple
+@@ -272,7 +273,13 @@ input_gssapi_mic(int type, u_int32_t ple
        mic.value = packet_get_string(&len);
        mic.length = len;
  
@@ -104,7 +99,7 @@ diff -up openssh-5.8p1/auth2-gss.c.role openssh-5.8p1/auth2-gss.c
            "gssapi-with-mic");
  
        gssbuf.value = buffer_ptr(&b);
-@@ -282,6 +289,8 @@ input_gssapi_mic(int type, u_int32_t ple
+@@ -284,6 +291,8 @@ input_gssapi_mic(int type, u_int32_t ple
                logit("GSSAPI MIC check failed");
  
        buffer_free(&b);
@@ -113,9 +108,9 @@ diff -up openssh-5.8p1/auth2-gss.c.role openssh-5.8p1/auth2-gss.c
        xfree(mic.value);
  
        authctxt->postponed = 0;
-diff -up openssh-5.8p1/auth2-hostbased.c.role openssh-5.8p1/auth2-hostbased.c
---- openssh-5.8p1/auth2-hostbased.c.role       2011-02-12 14:34:10.000000000 +0100
-+++ openssh-5.8p1/auth2-hostbased.c    2011-02-12 14:34:11.000000000 +0100
+diff -up openssh-5.9p0/auth2-hostbased.c.role openssh-5.9p0/auth2-hostbased.c
+--- openssh-5.9p0/auth2-hostbased.c.role       2011-08-31 11:42:47.863023264 +0200
++++ openssh-5.9p0/auth2-hostbased.c    2011-08-31 11:42:55.421024814 +0200
 @@ -106,7 +106,15 @@ userauth_hostbased(Authctxt *authctxt)
        buffer_put_string(&b, session_id2, session_id2_len);
        /* reconstruct packet */
@@ -133,10 +128,10 @@ diff -up openssh-5.8p1/auth2-hostbased.c.role openssh-5.8p1/auth2-hostbased.c
        buffer_put_cstring(&b, service);
        buffer_put_cstring(&b, "hostbased");
        buffer_put_string(&b, pkalg, alen);
-diff -up openssh-5.8p1/auth2-pubkey.c.role openssh-5.8p1/auth2-pubkey.c
---- openssh-5.8p1/auth2-pubkey.c.role  2011-02-12 14:34:11.000000000 +0100
-+++ openssh-5.8p1/auth2-pubkey.c       2011-02-12 14:34:11.000000000 +0100
-@@ -122,7 +122,15 @@ userauth_pubkey(Authctxt *authctxt)
+diff -up openssh-5.9p0/auth2-pubkey.c.role openssh-5.9p0/auth2-pubkey.c
+--- openssh-5.9p0/auth2-pubkey.c.role  2011-08-31 11:42:47.978087418 +0200
++++ openssh-5.9p0/auth2-pubkey.c       2011-08-31 11:42:55.551025263 +0200
+@@ -121,7 +121,15 @@ userauth_pubkey(Authctxt *authctxt)
                }
                /* reconstruct packet */
                buffer_put_char(&b, SSH2_MSG_USERAUTH_REQUEST);
@@ -153,47 +148,52 @@ diff -up openssh-5.8p1/auth2-pubkey.c.role openssh-5.8p1/auth2-pubkey.c
                buffer_put_cstring(&b,
                    datafellows & SSH_BUG_PKSERVICE ?
                    "ssh-userauth" :
-diff -up openssh-5.8p1/auth.h.role openssh-5.8p1/auth.h
---- openssh-5.8p1/auth.h.role  2011-02-12 14:34:10.000000000 +0100
-+++ openssh-5.8p1/auth.h       2011-02-12 14:34:11.000000000 +0100
-@@ -58,6 +58,9 @@ struct Authctxt {
-       char            *service;
-       struct passwd   *pw;            /* set if 'valid' */
-       char            *style;
+diff -up openssh-5.9p0/auth2.c.role openssh-5.9p0/auth2.c
+--- openssh-5.9p0/auth2.c.role 2011-08-31 11:42:45.409026065 +0200
++++ openssh-5.9p0/auth2.c      2011-08-31 11:42:55.676024869 +0200
+@@ -216,6 +216,9 @@ input_userauth_request(int type, u_int32
+       Authctxt *authctxt = ctxt;
+       Authmethod *m = NULL;
+       char *user, *service, *method, *style = NULL;
 +#ifdef WITH_SELINUX
-+      char            *role;
++      char *role = NULL;
 +#endif
-       void            *kbdintctxt;
-       void            *jpake_ctx;
- #ifdef BSD_AUTH
-diff -up openssh-5.8p1/auth-pam.c.role openssh-5.8p1/auth-pam.c
---- openssh-5.8p1/auth-pam.c.role      2009-07-12 14:07:21.000000000 +0200
-+++ openssh-5.8p1/auth-pam.c   2011-02-12 14:34:11.000000000 +0100
-@@ -1069,7 +1069,7 @@ is_pam_session_open(void)
-  * during the ssh authentication process.
-  */
- int
--do_pam_putenv(char *name, char *value)
-+do_pam_putenv(char *name, const char *value)
- {
-       int ret = 1;
- #ifdef HAVE_PAM_PUTENV
-diff -up openssh-5.8p1/auth-pam.h.role openssh-5.8p1/auth-pam.h
---- openssh-5.8p1/auth-pam.h.role      2004-09-11 14:17:26.000000000 +0200
-+++ openssh-5.8p1/auth-pam.h   2011-02-12 14:34:11.000000000 +0100
-@@ -38,7 +38,7 @@ void do_pam_session(void);
- void do_pam_set_tty(const char *);
- void do_pam_setcred(int );
- void do_pam_chauthtok(void);
--int do_pam_putenv(char *, char *);
-+int do_pam_putenv(char *, const char *);
- char ** fetch_pam_environment(void);
- char ** fetch_pam_child_environment(void);
- void free_pam_environment(char **);
-diff -up openssh-5.8p1/monitor.c.role openssh-5.8p1/monitor.c
---- openssh-5.8p1/monitor.c.role       2011-02-12 14:34:11.000000000 +0100
-+++ openssh-5.8p1/monitor.c    2011-02-12 14:34:11.000000000 +0100
-@@ -138,6 +138,9 @@ int mm_answer_sign(int, Buffer *);
+       int authenticated = 0;
+       if (authctxt == NULL)
+@@ -227,6 +230,11 @@ input_userauth_request(int type, u_int32
+       debug("userauth-request for user %s service %s method %s", user, service, method);
+       debug("attempt %d failures %d", authctxt->attempt, authctxt->failures);
++#ifdef WITH_SELINUX
++      if ((role = strchr(user, '/')) != NULL)
++              *role++ = 0;
++#endif
++
+       if ((style = strchr(user, ':')) != NULL)
+               *style++ = 0;
+@@ -249,8 +257,15 @@ input_userauth_request(int type, u_int32
+                   use_privsep ? " [net]" : "");
+               authctxt->service = xstrdup(service);
+               authctxt->style = style ? xstrdup(style) : NULL;
+-              if (use_privsep)
++#ifdef WITH_SELINUX
++              authctxt->role = role ? xstrdup(role) : NULL;
++#endif
++              if (use_privsep) {
+                       mm_inform_authserv(service, style);
++#ifdef WITH_SELINUX
++                      mm_inform_authrole(role);
++#endif
++              }
+               userauth_banner();
+       } else if (strcmp(user, authctxt->user) != 0 ||
+           strcmp(service, authctxt->service) != 0) {
+diff -up openssh-5.9p0/monitor.c.role openssh-5.9p0/monitor.c
+--- openssh-5.9p0/monitor.c.role       2011-08-31 11:42:53.301024819 +0200
++++ openssh-5.9p0/monitor.c    2011-08-31 11:42:55.796025812 +0200
+@@ -148,6 +148,9 @@ int mm_answer_sign(int, Buffer *);
  int mm_answer_pwnamallow(int, Buffer *);
  int mm_answer_auth2_read_banner(int, Buffer *);
  int mm_answer_authserv(int, Buffer *);
@@ -203,7 +203,7 @@ diff -up openssh-5.8p1/monitor.c.role openssh-5.8p1/monitor.c
  int mm_answer_authpassword(int, Buffer *);
  int mm_answer_bsdauthquery(int, Buffer *);
  int mm_answer_bsdauthrespond(int, Buffer *);
-@@ -218,6 +221,9 @@ struct mon_table mon_dispatch_proto20[] 
+@@ -231,6 +234,9 @@ struct mon_table mon_dispatch_proto20[]
      {MONITOR_REQ_SIGN, MON_ONCE, mm_answer_sign},
      {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow},
      {MONITOR_REQ_AUTHSERV, MON_ONCE, mm_answer_authserv},
@@ -213,7 +213,7 @@ diff -up openssh-5.8p1/monitor.c.role openssh-5.8p1/monitor.c
      {MONITOR_REQ_AUTH2_READ_BANNER, MON_ONCE, mm_answer_auth2_read_banner},
      {MONITOR_REQ_AUTHPASSWORD, MON_AUTH, mm_answer_authpassword},
  #ifdef USE_PAM
-@@ -703,6 +709,9 @@ mm_answer_pwnamallow(int sock, Buffer *m
+@@ -819,6 +825,9 @@ mm_answer_pwnamallow(int sock, Buffer *m
        else {
                /* Allow service/style information on the auth context */
                monitor_permit(mon_dispatch, MONITOR_REQ_AUTHSERV, 1);
@@ -222,8 +222,8 @@ diff -up openssh-5.8p1/monitor.c.role openssh-5.8p1/monitor.c
 +#endif
                monitor_permit(mon_dispatch, MONITOR_REQ_AUTH2_READ_BANNER, 1);
        }
-@@ -747,6 +756,25 @@ mm_answer_authserv(int sock, Buffer *m)
+ #ifdef USE_PAM
+@@ -862,6 +871,25 @@ mm_answer_authserv(int sock, Buffer *m)
        return (0);
  }
  
@@ -249,7 +249,7 @@ diff -up openssh-5.8p1/monitor.c.role openssh-5.8p1/monitor.c
  int
  mm_answer_authpassword(int sock, Buffer *m)
  {
-@@ -1112,7 +1140,7 @@ static int
+@@ -1227,7 +1255,7 @@ static int
  monitor_valid_userblob(u_char *data, u_int datalen)
  {
        Buffer b;
@@ -258,7 +258,7 @@ diff -up openssh-5.8p1/monitor.c.role openssh-5.8p1/monitor.c
        u_int len;
        int fail = 0;
  
-@@ -1138,6 +1166,8 @@ monitor_valid_userblob(u_char *data, u_i
+@@ -1253,6 +1281,8 @@ monitor_valid_userblob(u_char *data, u_i
        if (buffer_get_char(&b) != SSH2_MSG_USERAUTH_REQUEST)
                fail++;
        p = buffer_get_string(&b, NULL);
@@ -267,7 +267,7 @@ diff -up openssh-5.8p1/monitor.c.role openssh-5.8p1/monitor.c
        if (strcmp(authctxt->user, p) != 0) {
                logit("wrong user name passed to monitor: expected %s != %.100s",
                    authctxt->user, p);
-@@ -1169,7 +1199,7 @@ monitor_valid_hostbasedblob(u_char *data
+@@ -1284,7 +1314,7 @@ monitor_valid_hostbasedblob(u_char *data
      char *chost)
  {
        Buffer b;
@@ -276,7 +276,7 @@ diff -up openssh-5.8p1/monitor.c.role openssh-5.8p1/monitor.c
        u_int len;
        int fail = 0;
  
-@@ -1186,6 +1216,8 @@ monitor_valid_hostbasedblob(u_char *data
+@@ -1301,6 +1331,8 @@ monitor_valid_hostbasedblob(u_char *data
        if (buffer_get_char(&b) != SSH2_MSG_USERAUTH_REQUEST)
                fail++;
        p = buffer_get_string(&b, NULL);
@@ -285,9 +285,9 @@ diff -up openssh-5.8p1/monitor.c.role openssh-5.8p1/monitor.c
        if (strcmp(authctxt->user, p) != 0) {
                logit("wrong user name passed to monitor: expected %s != %.100s",
                    authctxt->user, p);
-diff -up openssh-5.8p1/monitor.h.role openssh-5.8p1/monitor.h
---- openssh-5.8p1/monitor.h.role       2011-02-12 14:34:11.000000000 +0100
-+++ openssh-5.8p1/monitor.h    2011-02-12 14:34:11.000000000 +0100
+diff -up openssh-5.9p0/monitor.h.role openssh-5.9p0/monitor.h
+--- openssh-5.9p0/monitor.h.role       2011-08-31 11:42:53.409025333 +0200
++++ openssh-5.9p0/monitor.h    2011-08-31 11:42:55.889024801 +0200
 @@ -31,6 +31,9 @@
  enum monitor_reqtype {
        MONITOR_REQ_MODULI, MONITOR_ANS_MODULI,
@@ -298,10 +298,10 @@ diff -up openssh-5.8p1/monitor.h.role openssh-5.8p1/monitor.h
        MONITOR_REQ_SIGN, MONITOR_ANS_SIGN,
        MONITOR_REQ_PWNAM, MONITOR_ANS_PWNAM,
        MONITOR_REQ_AUTH2_READ_BANNER, MONITOR_ANS_AUTH2_READ_BANNER,
-diff -up openssh-5.8p1/monitor_wrap.c.role openssh-5.8p1/monitor_wrap.c
---- openssh-5.8p1/monitor_wrap.c.role  2011-02-12 14:34:11.000000000 +0100
-+++ openssh-5.8p1/monitor_wrap.c       2011-02-12 14:34:11.000000000 +0100
-@@ -298,6 +298,25 @@ mm_inform_authserv(char *service, char *
+diff -up openssh-5.9p0/monitor_wrap.c.role openssh-5.9p0/monitor_wrap.c
+--- openssh-5.9p0/monitor_wrap.c.role  2011-08-31 11:42:53.548024503 +0200
++++ openssh-5.9p0/monitor_wrap.c       2011-08-31 11:42:56.029024553 +0200
+@@ -336,6 +336,25 @@ mm_inform_authserv(char *service, char *
        buffer_free(&m);
  }
  
@@ -327,10 +327,10 @@ diff -up openssh-5.8p1/monitor_wrap.c.role openssh-5.8p1/monitor_wrap.c
  /* Do the password authentication */
  int
  mm_auth_password(Authctxt *authctxt, char *password)
-diff -up openssh-5.8p1/monitor_wrap.h.role openssh-5.8p1/monitor_wrap.h
---- openssh-5.8p1/monitor_wrap.h.role  2011-02-12 14:34:11.000000000 +0100
-+++ openssh-5.8p1/monitor_wrap.h       2011-02-12 14:34:11.000000000 +0100
-@@ -41,6 +41,9 @@ int mm_is_monitor(void);
+diff -up openssh-5.9p0/monitor_wrap.h.role openssh-5.9p0/monitor_wrap.h
+--- openssh-5.9p0/monitor_wrap.h.role  2011-08-31 11:42:53.660025271 +0200
++++ openssh-5.9p0/monitor_wrap.h       2011-08-31 11:42:56.131025748 +0200
+@@ -42,6 +42,9 @@ int mm_is_monitor(void);
  DH *mm_choose_dh(int, int, int);
  int mm_key_sign(Key *, u_char **, u_int *, u_char *, u_int);
  void mm_inform_authserv(char *, char *);
@@ -340,9 +340,9 @@ diff -up openssh-5.8p1/monitor_wrap.h.role openssh-5.8p1/monitor_wrap.h
  struct passwd *mm_getpwnamallow(const char *);
  char *mm_auth2_read_banner(void);
  int mm_auth_password(struct Authctxt *, char *);
-diff -up openssh-5.8p1/openbsd-compat/Makefile.in.role openssh-5.8p1/openbsd-compat/Makefile.in
---- openssh-5.8p1/openbsd-compat/Makefile.in.role      2010-10-07 13:19:24.000000000 +0200
-+++ openssh-5.8p1/openbsd-compat/Makefile.in   2011-02-12 14:34:11.000000000 +0100
+diff -up openssh-5.9p0/openbsd-compat/Makefile.in.role openssh-5.9p0/openbsd-compat/Makefile.in
+--- openssh-5.9p0/openbsd-compat/Makefile.in.role      2010-10-07 13:19:24.000000000 +0200
++++ openssh-5.9p0/openbsd-compat/Makefile.in   2011-08-31 11:48:02.404091479 +0200
 @@ -20,7 +20,7 @@ OPENBSD=base64.o basename.o bindresvport
  
  COMPAT=bsd-arc4random.o bsd-asprintf.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-poll.o bsd-snprintf.o bsd-statvfs.o bsd-waitpid.o fake-rfc2553.o openssl-compat.o xmmap.o xcrypt.o
@@ -352,10 +352,10 @@ diff -up openssh-5.8p1/openbsd-compat/Makefile.in.role openssh-5.8p1/openbsd-com
  
  .c.o:
        $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
-diff -up openssh-5.8p1/openbsd-compat/port-linux.c.role openssh-5.8p1/openbsd-compat/port-linux.c
---- openssh-5.8p1/openbsd-compat/port-linux.c.role     2011-02-12 14:34:11.000000000 +0100
-+++ openssh-5.8p1/openbsd-compat/port-linux.c  2011-02-12 14:37:31.000000000 +0100
-@@ -31,48 +31,73 @@
+diff -up openssh-5.9p0/openbsd-compat/port-linux.c.role openssh-5.9p0/openbsd-compat/port-linux.c
+--- openssh-5.9p0/openbsd-compat/port-linux.c.role     2011-08-29 08:09:57.000000000 +0200
++++ openssh-5.9p0/openbsd-compat/port-linux.c  2011-08-31 11:42:56.492087969 +0200
+@@ -31,7 +31,11 @@
  
  #include "log.h"
  #include "xmalloc.h"
@@ -367,8 +367,9 @@ diff -up openssh-5.8p1/openbsd-compat/port-linux.c.role openssh-5.8p1/openbsd-co
  
  #ifdef WITH_SELINUX
  #include <selinux/selinux.h>
- #include <selinux/flask.h>
- #include <selinux/get_context_list.h>
+@@ -42,41 +46,63 @@
+ # define SSH_SELINUX_UNCONFINED_TYPE ":unconfined_t:"
+ #endif
  
 -/* Wrapper around is_selinux_enabled() to log its return value once only */
 -int
@@ -414,8 +415,9 @@ diff -up openssh-5.8p1/openbsd-compat/port-linux.c.role openssh-5.8p1/openbsd-co
 +      char *role;
 +      const char *reqlvl;
 +      int r = 0;
++ 
 +      ssh_selinux_get_role_level(&role, &reqlvl);
  #ifdef HAVE_GETSEUSERBYNAME
 -      if (getseuserbyname(pwname, &sename, &lvl) != 0)
 -              return NULL;
@@ -446,7 +448,7 @@ diff -up openssh-5.8p1/openbsd-compat/port-linux.c.role openssh-5.8p1/openbsd-co
  
        if (r != 0) {
                switch (security_getenforce()) {
-@@ -100,6 +125,36 @@ ssh_selinux_getctxbyname(char *pwname)
+@@ -104,6 +130,36 @@ ssh_selinux_getctxbyname(char *pwname)
        return (sc);
  }
  
@@ -483,7 +485,7 @@ diff -up openssh-5.8p1/openbsd-compat/port-linux.c.role openssh-5.8p1/openbsd-co
  /* Set the execution context to the default for the specified user */
  void
  ssh_selinux_setup_exec_context(char *pwname)
-@@ -109,6 +164,24 @@ ssh_selinux_setup_exec_context(char *pwn
+@@ -113,6 +169,24 @@ ssh_selinux_setup_exec_context(char *pwn
        if (!ssh_selinux_enabled())
                return;
  
@@ -508,7 +510,7 @@ diff -up openssh-5.8p1/openbsd-compat/port-linux.c.role openssh-5.8p1/openbsd-co
        debug3("%s: setting execution context", __func__);
  
        user_ctx = ssh_selinux_getctxbyname(pwname);
-@@ -206,21 +279,6 @@ ssh_selinux_change_context(const char *n
+@@ -220,21 +294,6 @@ ssh_selinux_change_context(const char *n
        xfree(newctx);
  }
  
@@ -530,9 +532,9 @@ diff -up openssh-5.8p1/openbsd-compat/port-linux.c.role openssh-5.8p1/openbsd-co
  #endif /* WITH_SELINUX */
  
  #ifdef LINUX_OOM_ADJUST
-diff -up openssh-5.8p1/openbsd-compat/port-linux_part_2.c.role openssh-5.8p1/openbsd-compat/port-linux_part_2.c
---- openssh-5.8p1/openbsd-compat/port-linux_part_2.c.role      2011-02-12 14:34:11.000000000 +0100
-+++ openssh-5.8p1/openbsd-compat/port-linux_part_2.c   2011-02-12 14:34:11.000000000 +0100
+diff -up openssh-5.9p0/openbsd-compat/port-linux_part_2.c.role openssh-5.9p0/openbsd-compat/port-linux_part_2.c
+--- openssh-5.9p0/openbsd-compat/port-linux_part_2.c.role      2011-08-31 11:42:56.583047619 +0200
++++ openssh-5.9p0/openbsd-compat/port-linux_part_2.c   2011-08-31 11:42:56.586178005 +0200
 @@ -0,0 +1,75 @@
 +/* $Id: port-linux.c,v 1.11.4.2 2011/02/04 00:43:08 djm Exp $ */
 +
diff --git a/openssh/patches/openssh-5.9p1-sftp-chroot.patch b/openssh/patches/openssh-5.9p1-sftp-chroot.patch
new file mode 100644 (file)
index 0000000..cfe4366
--- /dev/null
@@ -0,0 +1,63 @@
+diff -up openssh-5.9p0/openbsd-compat/port-linux.c.sftp-chroot openssh-5.9p0/openbsd-compat/port-linux.c
+--- openssh-5.9p0/openbsd-compat/port-linux.c.sftp-chroot      2011-09-01 04:12:22.743024608 +0200
++++ openssh-5.9p0/openbsd-compat/port-linux.c  2011-09-01 04:12:23.069088065 +0200
+@@ -503,6 +503,23 @@ ssh_selinux_change_context(const char *n
+       xfree(newctx);
+ }
++void
++ssh_selinux_copy_context(void)
++{
++      char *ctx;
++
++      if (!ssh_selinux_enabled())
++              return;
++
++      if (getexeccon((security_context_t *)&ctx) < 0) {
++              logit("%s: getcon failed with %s", __func__, strerror (errno));
++              return;
++      }
++      if (setcon(ctx) < 0)
++              logit("%s: setcon failed with %s", __func__, strerror (errno));
++      xfree(ctx);
++}
++
+ #endif /* WITH_SELINUX */
+ #ifdef LINUX_OOM_ADJUST
+diff -up openssh-5.9p0/openbsd-compat/port-linux.h.sftp-chroot openssh-5.9p0/openbsd-compat/port-linux.h
+--- openssh-5.9p0/openbsd-compat/port-linux.h.sftp-chroot      2011-01-25 02:16:18.000000000 +0100
++++ openssh-5.9p0/openbsd-compat/port-linux.h  2011-09-01 04:12:23.163088777 +0200
+@@ -24,6 +24,7 @@ int ssh_selinux_enabled(void);
+ void ssh_selinux_setup_pty(char *, const char *);
+ void ssh_selinux_setup_exec_context(char *);
+ void ssh_selinux_change_context(const char *);
++void ssh_selinux_chopy_context(void);
+ void ssh_selinux_setfscreatecon(const char *);
+ #endif
+diff -up openssh-5.9p0/session.c.sftp-chroot openssh-5.9p0/session.c
+--- openssh-5.9p0/session.c.sftp-chroot        2011-09-01 04:12:19.698049195 +0200
++++ openssh-5.9p0/session.c    2011-09-01 04:40:03.598148719 +0200
+@@ -1519,6 +1519,9 @@ do_setusercontext(struct passwd *pw)
+                           pw->pw_uid);
+                       chroot_path = percent_expand(tmp, "h", pw->pw_dir,
+                           "u", pw->pw_name, (char *)NULL);
++#ifdef WITH_SELINUX
++                      ssh_selinux_change_context("chroot_user_t");
++#endif
+                       safely_chroot(chroot_path, pw->pw_uid);
+                       free(tmp);
+                       free(chroot_path);
+@@ -1788,7 +1791,10 @@ do_child(Session *s, const char *command
+               optind = optreset = 1;
+               __progname = argv[0];
+ #ifdef WITH_SELINUX
+-              ssh_selinux_change_context("sftpd_t");
++              if (options.chroot_directory == NULL ||
++                  strcasecmp(options.chroot_directory, "none") == 0) {
++                      ssh_selinux_copy_context();
++              }
+ #endif
+               exit(sftp_server_main(i, argv, s->pw));
+       }
diff --git a/openssh/patches/openssh-5.9p1-vendor.patch b/openssh/patches/openssh-5.9p1-vendor.patch
new file mode 100644 (file)
index 0000000..3e63d3b
--- /dev/null
@@ -0,0 +1,157 @@
+diff -up openssh-5.9p0/configure.ac.vendor openssh-5.9p0/configure.ac
+--- openssh-5.9p0/configure.ac.vendor  2011-09-03 20:24:29.899501572 +0200
++++ openssh-5.9p0/configure.ac 2011-09-03 20:24:39.153501595 +0200
+@@ -4131,6 +4131,12 @@ AC_ARG_WITH([lastlog],
+               fi
+       ]
+ )
++AC_ARG_ENABLE(vendor-patchlevel,
++  [  --enable-vendor-patchlevel=TAG  specify a vendor patch level],
++  [AC_DEFINE_UNQUOTED(SSH_VENDOR_PATCHLEVEL,[SSH_RELEASE "-" "$enableval"],[Define to your vendor patch level, if it has been modified from the upstream source release.])
++   SSH_VENDOR_PATCHLEVEL="$enableval"],
++  [AC_DEFINE(SSH_VENDOR_PATCHLEVEL,SSH_RELEASE,[Define to your vendor patch level, if it has been modified from the upstream source release.])
++   SSH_VENDOR_PATCHLEVEL=none])
+ dnl lastlog, [uw]tmpx? detection
+ dnl  NOTE: set the paths in the platform section to avoid the
+@@ -4357,6 +4363,7 @@ echo "           Translate v4 in v6 hack
+ echo "                  BSD Auth support: $BSD_AUTH_MSG"
+ echo "              Random number source: $RAND_MSG"
+ echo "             Privsep sandbox style: $SANDBOX_STYLE"
++echo "                Vendor patch level: $SSH_VENDOR_PATCHLEVEL"
+ echo ""
+diff -up openssh-5.9p0/servconf.c.vendor openssh-5.9p0/servconf.c
+--- openssh-5.9p0/servconf.c.vendor    2011-09-03 20:24:29.080500853 +0200
++++ openssh-5.9p0/servconf.c   2011-09-03 20:27:15.727564566 +0200
+@@ -130,6 +130,7 @@ initialize_server_options(ServerOptions
+       options->max_authtries = -1;
+       options->max_sessions = -1;
+       options->banner = NULL;
++      options->show_patchlevel = -1;
+       options->use_dns = -1;
+       options->client_alive_interval = -1;
+       options->client_alive_count_max = -1;
+@@ -300,6 +301,8 @@ fill_default_server_options(ServerOption
+               options->ip_qos_interactive = IPTOS_LOWDELAY;
+       if (options->ip_qos_bulk == -1)
+               options->ip_qos_bulk = IPTOS_THROUGHPUT;
++      if (options->show_patchlevel == -1)
++              options->show_patchlevel = 0;
+       /* Turn privilege separation on by default */
+       if (use_privsep == -1)
+@@ -338,7 +341,7 @@ typedef enum {
+       sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile,
+       sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem,
+       sMaxStartups, sMaxAuthTries, sMaxSessions,
+-      sBanner, sUseDNS, sHostbasedAuthentication,
++      sBanner, sShowPatchLevel, sUseDNS, sHostbasedAuthentication,
+       sHostbasedUsesNameFromPacketOnly, sTwoFactorAuthentication,
+       sSecondPubkeyAuthentication, sSecondGssAuthentication,
+       sSecondPasswordAuthentication, sSecondKbdInteractiveAuthentication,
+@@ -470,6 +473,7 @@ static struct {
+       { "maxauthtries", sMaxAuthTries, SSHCFG_ALL },
+       { "maxsessions", sMaxSessions, SSHCFG_ALL },
+       { "banner", sBanner, SSHCFG_ALL },
++      { "showpatchlevel", sShowPatchLevel, SSHCFG_GLOBAL },
+       { "usedns", sUseDNS, SSHCFG_GLOBAL },
+       { "verifyreversemapping", sDeprecated, SSHCFG_GLOBAL },
+       { "reversemappingcheck", sDeprecated, SSHCFG_GLOBAL },
+@@ -1152,6 +1156,10 @@ process_server_config_line(ServerOptions
+               multistate_ptr = multistate_privsep;
+               goto parse_multistate;
++      case sShowPatchLevel:
++              intptr = &options->show_patchlevel;
++              goto parse_flag;
++
+       case sAllowUsers:
+               while ((arg = strdelim(&cp)) && *arg != '\0') {
+                       if (options->num_allow_users >= MAX_ALLOW_USERS)
+@@ -1849,6 +1857,7 @@ dump_config(ServerOptions *o)
+       dump_cfg_fmtint(sUseLogin, o->use_login);
+       dump_cfg_fmtint(sCompression, o->compression);
+       dump_cfg_fmtint(sGatewayPorts, o->gateway_ports);
++      dump_cfg_fmtint(sShowPatchLevel, o->show_patchlevel);
+       dump_cfg_fmtint(sUseDNS, o->use_dns);
+       dump_cfg_fmtint(sAllowTcpForwarding, o->allow_tcp_forwarding);
+       dump_cfg_fmtint(sUsePrivilegeSeparation, use_privsep);
+diff -up openssh-5.9p0/servconf.h.vendor openssh-5.9p0/servconf.h
+--- openssh-5.9p0/servconf.h.vendor    2011-09-03 20:24:29.179632045 +0200
++++ openssh-5.9p0/servconf.h   2011-09-03 20:24:39.426502323 +0200
+@@ -148,6 +148,7 @@ typedef struct {
+       int     max_authtries;
+       int     max_sessions;
+       char   *banner;                 /* SSH-2 banner message */
++      int     show_patchlevel;        /* Show vendor patch level to clients */
+       int     use_dns;
+       int     client_alive_interval;  /*
+                                        * poke the client this often to
+diff -up openssh-5.9p0/sshd.c.vendor openssh-5.9p0/sshd.c
+--- openssh-5.9p0/sshd.c.vendor        2011-09-03 20:24:35.987501565 +0200
++++ openssh-5.9p0/sshd.c       2011-09-03 20:24:39.542501643 +0200
+@@ -431,7 +431,7 @@ sshd_exchange_identification(int sock_in
+               minor = PROTOCOL_MINOR_1;
+       }
+       snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s", major, minor,
+-          SSH_VERSION, newline);
++         (options.show_patchlevel == 1) ? SSH_VENDOR_PATCHLEVEL : SSH_VERSION, newline);
+       server_version_string = xstrdup(buf);
+       /* Send our protocol version identification. */
+@@ -1627,7 +1627,8 @@ main(int ac, char **av)
+               exit(1);
+       }
+-      debug("sshd version %.100s", SSH_RELEASE);
++      debug("sshd version %.100s",
++            (options.show_patchlevel == 1) ? SSH_VENDOR_PATCHLEVEL : SSH_RELEASE);
+       /* Store privilege separation user for later use if required. */
+       if ((privsep_pw = getpwnam(SSH_PRIVSEP_USER)) == NULL) {
+diff -up openssh-5.9p0/sshd_config.0.vendor openssh-5.9p0/sshd_config.0
+--- openssh-5.9p0/sshd_config.0.vendor 2011-09-03 20:24:37.524438185 +0200
++++ openssh-5.9p0/sshd_config.0        2011-09-03 20:24:39.677508255 +0200
+@@ -556,6 +556,11 @@ DESCRIPTION
+              Defines the number of bits in the ephemeral protocol version 1
+              server key.  The minimum value is 512, and the default is 1024.
++     ShowPatchLevel
++           Specifies whether sshd will display the specific patch level of
++           the binary in the server identification string.  The patch level
++           is set at compile-time.  The default is M-bM-^@M-^\noM-bM-^@M-^].
++
+      StrictModes
+              Specifies whether sshd(8) should check file modes and ownership
+              of the user's files and home directory before accepting login.
+diff -up openssh-5.9p0/sshd_config.5.vendor openssh-5.9p0/sshd_config.5
+--- openssh-5.9p0/sshd_config.5.vendor 2011-09-03 20:24:37.640442022 +0200
++++ openssh-5.9p0/sshd_config.5        2011-09-03 20:24:40.176544206 +0200
+@@ -952,6 +952,14 @@ This option applies to protocol version
+ .It Cm ServerKeyBits
+ Defines the number of bits in the ephemeral protocol version 1 server key.
+ The minimum value is 512, and the default is 1024.
++.It Cm ShowPatchLevel 
++Specifies whether 
++.Nm sshd 
++will display the patch level of the binary in the identification string. 
++The patch level is set at compile-time. 
++The default is 
++.Dq no . 
++This option applies to protocol version 1 only. 
+ .It Cm StrictModes
+ Specifies whether
+ .Xr sshd 8
+diff -up openssh-5.9p0/sshd_config.vendor openssh-5.9p0/sshd_config
+--- openssh-5.9p0/sshd_config.vendor   2011-09-03 20:24:37.770439735 +0200
++++ openssh-5.9p0/sshd_config  2011-09-03 20:24:40.278628002 +0200
+@@ -120,6 +120,7 @@ X11Forwarding yes
+ #Compression delayed
+ #ClientAliveInterval 0
+ #ClientAliveCountMax 3
++#ShowPatchLevel no
+ #UseDNS yes
+ #PidFile /var/run/sshd.pid
+ #MaxStartups 10
diff --git a/openssh/sshd_config b/openssh/sshd_config
deleted file mode 100644 (file)
index dbf3228..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-# This is the sshd server system-wide configuration file.  See
-# sshd_config(5) for more information.
-
-# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
-
-# The strategy used for options in the default sshd_config shipped with
-# OpenSSH is to specify options with their default value where
-# possible, but leave them commented.  Uncommented options change a
-# default value.
-
-Port 22
-#AddressFamily any
-#ListenAddress 0.0.0.0
-#ListenAddress ::
-
-# Disable legacy (protocol version 1) support in the server for new
-# installations. In future the default will change to require explicit
-# activation of protocol 1
-Protocol 2
-
-# HostKey for protocol version 1
-#HostKey /etc/ssh/ssh_host_key
-# HostKeys for protocol version 2
-#HostKey /etc/ssh/ssh_host_rsa_key
-#HostKey /etc/ssh/ssh_host_dsa_key
-
-# Lifetime and size of ephemeral version 1 server key
-#KeyRegenerationInterval 1h
-#ServerKeyBits 1024
-
-# Logging
-# obsoletes QuietMode and FascistLogging
-#SyslogFacility AUTH
-#LogLevel INFO
-
-# Authentication:
-
-LoginGraceTime 30s
-#PermitRootLogin yes
-#StrictModes yes
-#MaxAuthTries 6
-#MaxSessions 10
-
-RSAAuthentication yes
-PubkeyAuthentication yes
-#AuthorizedKeysFile    .ssh/authorized_keys
-
-# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
-#RhostsRSAAuthentication no
-# similar for protocol version 2
-#HostbasedAuthentication no
-# Change to yes if you don't trust ~/.ssh/known_hosts for
-# RhostsRSAAuthentication and HostbasedAuthentication
-IgnoreUserKnownHosts yes
-# Don't read the user's ~/.rhosts and ~/.shosts files
-#IgnoreRhosts yes
-
-# To disable tunneled clear text passwords, change to no here!
-PasswordAuthentication yes
-#PermitEmptyPasswords no
-
-# Change to no to disable s/key passwords
-ChallengeResponseAuthentication yes
-
-# Kerberos options
-#KerberosAuthentication no
-#KerberosOrLocalPasswd yes
-#KerberosTicketCleanup yes
-#KerberosGetAFSToken no
-
-# GSSAPI options
-#GSSAPIAuthentication no
-#GSSAPICleanupCredentials yes
-
-# Set this to 'yes' to enable PAM authentication, account processing, 
-# and session processing. If this is enabled, PAM authentication will 
-# be allowed through the ChallengeResponseAuthentication and
-# PasswordAuthentication.  Depending on your PAM configuration,
-# PAM authentication via ChallengeResponseAuthentication may bypass
-# the setting of "PermitRootLogin without-password".
-# If you just want the PAM account and session checks to run without
-# PAM authentication, then enable this but set PasswordAuthentication
-# and ChallengeResponseAuthentication to 'no'.
-UsePAM yes
-
-#AllowAgentForwarding yes
-AllowTcpForwarding yes
-#GatewayPorts no
-X11Forwarding no
-#X11DisplayOffset 10
-#X11UseLocalhost yes
-#PrintMotd yes
-#PrintLastLog yes
-#TCPKeepAlive yes
-#UseLogin no
-#UsePrivilegeSeparation yes
-#PermitUserEnvironment no
-#Compression delayed
-#ClientAliveInterval 0
-#ClientAliveCountMax 3
-#UseDNS yes
-#PidFile /var/run/sshd.pid
-MaxStartups 5
-#PermitTunnel no
-#ChrootDirectory none
-
-# no default banner path
-#Banner none
-
-# override default of no subsystems
-Subsystem      sftp    /usr/lib/openssh/sftp-server
-
-# Example of overriding settings on a per-user basis
-#Match User anoncvs
-#      X11Forwarding no
-#      AllowTcpForwarding no
-#      ForceCommand cvs server
index 278f3e13f6651c248e807da586db4ac64b8c5565..39b731acb1549e3efb1102df705cb0cf1c94addc 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = openssl
 version    = 1.0.0e
-release    = 1
+release    = 3
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
 groups     = System/Libraries
@@ -26,6 +26,7 @@ build
                bc
                gnutls-devel
                perl
+               util-linux
                zlib-devel
        end
 
@@ -42,7 +43,12 @@ build
        end
 
        if "%{DISTRO_ARCH}" == "i686"
-               SSL_ARCH = no-asm 386 # 386 implies no-sse2
+               # 386 implies no-sse2
+               ssl_arch = linux-elf no-asm 386
+       end
+
+       if "%{DISTRO_ARCH}" == "armv5tel"
+               ssl_arch = linux-generic32
        end
 
        build
@@ -50,7 +56,6 @@ build
                        --prefix=/usr \
                        --openssldir=/etc/pki/tls \
                        --enginesdir=/usr/lib/openssl/engines \
-                       linux-elf \
                        shared \
                        zlib-dynamic \
                        enable-camellia \
@@ -61,8 +66,9 @@ build
                        no-idea \
                        no-mdc2 \
                        no-rc5 \
+                       no-ec no-ecdh no-ecdsa \
                        -DSSL_FORBID_ENULL \
-                        %{SSL_ARCH}
+                        %{ssl_arch}
 
                # Build.
                make depend all build-shared RPM_OPT_FLAGS="%{CFLAGS}" #%{PARALLELISMFLAGS}
@@ -96,6 +102,22 @@ build
                mkdir -pv %{BUILDROOT}/etc/pki/tls
                install -m 0644 %{DIR_SOURCE}/openssl.cnf %{BUILDROOT}/etc/pki/tls
                cp -v -r certs %{BUILDROOT}/etc/pki/tls
+
+               # Rename man pages so that they don't conflict with other system man pages.
+               pushd ${BUILDROOT}/usr/share/man
+               for manpage in man*/*; do
+                       if [ -L ${manpage} ]; then
+                               TARGET=`ls -l ${manpage} | awk '{ print $NF }'`
+                               ln -snf ${TARGET}ssl ${manpage}ssl
+                               rm -f ${manpage}
+                       else
+                               mv ${manpage} ${manpage}ssl
+                       fi
+               done
+
+               mv -v %{BUILDROOT}/usr/share/man/man1/{,ssl}passwd.1
+               mv -v %{BUILDROOT}/usr/share/man/man1/{,ssl}rand.1
+               popd
        end
 end
 
@@ -105,4 +127,8 @@ packages
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 6da76f629d8788c9e2541896cd99cca933693827..3d4bbe2980c35cf9d2ec0b4cd4be5afe2710cdf0 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = openvpn
-version    = 2.2-RC2
+version    = 2.2.1
 release    = 1
 
 groups     = Networking/VPN
@@ -20,7 +20,7 @@ description
        for compression.
 end
 
-source_dl  =
+source_dl  = http://swupdate.openvpn.org/community/releases/
 
 PLUGINS    = auth-pam down-root
 
@@ -57,4 +57,8 @@ packages
                        iproute2
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 25b013c0e4adef6c3df7155d6bc5af6fabcf0eee..bef5b6475b9769bf0ca37d068aea6c45deda27e1 100644 (file)
@@ -48,4 +48,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index a805983aa7d5cf569c96febc95205ed29fd36f89..62802011abfbb5cdd8c79d669266abc8bcee8198 100644 (file)
@@ -33,4 +33,8 @@ packages
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index a96e3e0ce797d2404b673c45a825c0a5763a9a1e..a39c50578604ee892b05c801bdd17768cbcb3a1f 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = pakfire
-version    = 0.9.10
+version    = 0.9.18
 release    = 1
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
@@ -22,6 +22,8 @@ source_dl  = http://source.ipfire.org/releases/pakfire/
 
 build
        requires
+               gettext
+               libcap-devel
                libsolv-devel
                python-devel
        end
@@ -46,7 +48,6 @@ packages
                        pyliblzma
                        python-progressbar
                        python-urlgrabber
-                       pyxattr
                        system-release
                end
 
@@ -57,7 +58,7 @@ packages
                end
        end
        
-       package %{name}-build
+       package %{name}-builder
                summary = The pakfire builder.
                description
                        The tools that are needed to build new pakfire packages.
@@ -68,6 +69,8 @@ packages
                        %{name}=%{thisver}
                        quality-agent=%{thisver}
                end
+               provides = pakfire-build=%{thisver}
+               obsoletes = pakfire-build<%{thisver}
                conflicts = build-essentials
 
                files
@@ -95,4 +98,8 @@ packages
 
                requires = binutils file grep
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 277c33e638b2d18d03487db92aa1a2dd972b3469..99f82072f3b48110c9f229cb96762e497920125b 100644 (file)
@@ -70,4 +70,8 @@ packages
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index f7ae56514a9664f51f483b610083678b3fcb96c4..fce21971c92dfda729859e8caf74d898f9a508de 100644 (file)
@@ -82,4 +82,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index d189ce1ba78d3af3566815de37779c6093a8556b..b544a9a765d46e9852af54ad6537eaf23a9a1591 100644 (file)
@@ -4,7 +4,8 @@
 ###############################################################################
 
 name       = pango
-version    = 1.29.3
+major     = 1.29
+version    = %{major}.5
 release    = 1
 
 groups     = System/Libraries
@@ -17,7 +18,7 @@ description
        emphasis on internationalization.
 end
 
-source_dl  =
+source_dl  = http://ftp.gnome.org/pub/GNOME/sources/pango/%{major}/
 sources    = %{thisapp}.tar.xz
 
 build
@@ -27,6 +28,7 @@ build
                freetype-devel
                gcc-c++
                glib2-devel
+               glibc-devel
                perl
                pkg-config
        end
@@ -38,12 +40,16 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
-       
+
                requires
                        glib2-devel
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index d419fc9d04cc280bfb83f9f58ac9d77192506e75..dda6e6104a7dd811d9a3e22a50eee2783006a8fd 100644 (file)
@@ -48,8 +48,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 5d2e2ebda07dded02ddf2aaba55fc69f41a4b2a1..cc1958c84abfeeabf53e4b1ad09c35f802cd1ed8 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = passwd
 version    = 0.76
-release    = 1
+release    = 2
 
-groups     = Base System/Base
+groups     = System/Base
 url        = http://fedorahosted.org/passwd
 license    = BSD
 summary    = An utility for setting or changing passwords using PAM.
@@ -43,4 +43,10 @@ end
 
 packages
        package %{name}
+               groups += Base
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 642be7d24fcf15d60a2be9ddb9c3d5ef16b6a91c..ecdafacf7a724c8bac70e3a41368fa390a68f8f5 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = patch
 version    = 2.6.1
-release    = 1
+release    = 2
 
-groups     = Build Development/Tools
+groups     = Development/Tools
 url        = http://www.gnu.org/software/patch/patch.html
 license    = GPLv2+
 summary    = Utility for modifying/upgrading files.
@@ -42,4 +42,10 @@ end
 
 packages
        package %{name}
+               groups += Build
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 4f9debb4106d042e3c9e3ad058da2b78698b3245..dca2b2cd0c5f1964491a2033360c19cf889ec233 100644 (file)
@@ -31,4 +31,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index ed11ec4af73e70259b3a6b1a56f497d64be2439f..9783605004eb17c4378a01a7d797e134d1ea70f2 100644 (file)
@@ -31,4 +31,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 925b7177f21f82106836be9df304be3fcfb4f311..662e49b37fc65312279e4088cc1757d6dce78f73 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = paxtest
 version    = 0.9.9
-release    = 2
+release    = 3
 
 groups     = Security/Tools
 url        = http://pax.grsecurity.org/
@@ -31,7 +31,6 @@ build
                        RUNDIR=/usr/lib/paxtest BINDIR=/usr/bin
        end
 
-       export PKG_REQUIRES_FILTER = shlibtest
 end
 
 quality-agent
@@ -42,4 +41,12 @@ end
 
 packages
        package %{name}
+               filter_requires
+                       shlibtest
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 16b72f3aa65066d57ecfee8b48bf5161575c3d20..c12b51f34a723c661ec05f40ab693c2a43f5b0f5 100644 (file)
@@ -40,4 +40,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 360119b0c6981f702f92a211d5f0501be3bb43e9..d04677ab131d166dff6d8f5dfbf3aa4b40e8973c 100644 (file)
@@ -5,10 +5,9 @@
 
 name       = pciutils
 version    = 3.1.7
-release    = 1
+release    = 2
 
 groups     = System/Base
-groups-pciutils = Base %{groups}
 url        = http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml
 license    = GPLv2+
 summary    = PCI bus related utilities.
@@ -41,13 +40,18 @@ end
 
 packages
        package %{name}
+               groups += Base
        end
-       
+
        package %{name}-libs
                template LIBS
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index f51e459aafd54eabea167beaef122f7492ed3f64..5dd980fbb9e197ac104adaec7e3937844836e5c2 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = pcre
-version    = 8.13
+version    = 8.20
 release    = 1
 
 groups     = System/Libraries
@@ -30,6 +30,7 @@ build
        end
 
        configure_options += \
+               --disable-static \
                --docdir=/usr/share/doc/pcre-%{version} \
                --enable-utf8 \
                --enable-pcregrep-libz \
@@ -49,4 +50,8 @@ packages
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index e8d839d57b32de2a46d6d066da995c8d28b139fe..dc91a5c96b103335916959996efdeb671a0dbb8e 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = pdns-recursor
 version    = 3.3
-release    = 4
+release    = 6
 
 groups     = Networking/DNS
 url        = http://powerdns.com/
@@ -17,7 +17,7 @@ description
        package if you need a dns cache for your network.
 end
 
-source_dl  =
+source_dl  = http://downloads.powerdns.com/releases/
 sources    = %{thisapp}.tar.bz2
 
 build
@@ -25,6 +25,11 @@ build
                gcc-c++
                boost-devel
                lua-devel
+               shadow-utils
+       end
+
+       prepare_cmds
+               %{create_user}
        end
 
        build
@@ -47,12 +52,53 @@ build
 
                # Create folder for chroot
                mkdir -pv %{BUILDROOT}/var/lib/pdns-recursor
+
+               # Create directory for socket and stuff.
+               mkdir -pv %{BUILDROOT}/run/pdns-recursor
+               chown -v pdns-recursor.pdns-recursor %{BUILDROOT}/run/pdns-recursor
        end
 end
 
-# XXX Need to create user and group "pdns-recursor" at installation
-# useradd -r -g pdns-recursor pdns-recursor -d /var/lib/pdns-recursor -s /sbin/nologin
+create_user
+       getent group pdns-recursor >/dev/null || groupadd -r pdns-recursor
+       getent passwd pdns-recursor >/dev/null || \
+               useradd -r -g pdns-recursor -d /var/lib/pdns-recursor -s /sbin/nologin \
+                       pdns-recursor
+end
 
 packages
        package %{name}
+               configfiles
+                       /etc/%{name}/recursor.conf
+               end
+
+               prerequires = shadow-utils systemd-units
+
+               script prein
+                       %{create_user}
+               end
+
+               script postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl --no-reload enable pdns-recursor.service >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       /bin/systemctl --no-reload disable pdns-recursor.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop pdns-recursor.service >/dev/null 2>&1 || :
+               end
+
+               script postun
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl try-restart pdns-recursor.service >/dev/null 2>&1 || :
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 39d3edc823d6a6b1f277bb32e5efbfba05b3338f..0d0737c0a31dd09e2538651ec41fe31743a5080d 100644 (file)
@@ -57,4 +57,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index b853fe0969c7ec6167128de0426aac31961e0cbf..dd491b6e22901d722137c0649b06fbda60e43a5c 100644 (file)
@@ -42,4 +42,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/perl-SGMLSpm/perl-SGMLSpm.nm b/perl-SGMLSpm/perl-SGMLSpm.nm
new file mode 100644 (file)
index 0000000..4590ed9
--- /dev/null
@@ -0,0 +1,44 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = perl-SGMLSpm
+version    = 1.03ii
+release    = 1
+arch       = noarch
+
+groups     = Development/Libraries
+url        = http://search.cpan.org/dist/SGMLSpm/
+license    = GPLv2+
+summary    = Perl library for parsing the output of nsgmls.
+
+description
+       Perl programs can use the SGMLSpm module to help convert SGML, HTML or XML
+       documents into new formats.
+end
+
+source_dl  = http://www.cpan.org/authors/id/D/DM/DMEGG/
+
+thisapp    = SGMLSpm-%{version}
+
+build
+       DIR_APP = %{DIR_SRC}/SGMLSpm
+
+       build = # Nothing to do.
+
+       install
+               # Create directory layout.
+               mkdir -pv %{BUILDROOT}/usr/bin
+               mkdir -pv %{BUILDROOT}/usr/share/perl5
+
+               # Install the module.
+               make install_system \
+                       BINDIR=%{BUILDROOT}/usr/bin/ \
+                       PERL5DIR=%{BUILDROOT}/usr/share/perl5/
+       end
+end
+
+packages
+       package %{name}
+end
diff --git a/perl-Test-Simple/perl-Test-Simple.nm b/perl-Test-Simple/perl-Test-Simple.nm
deleted file mode 100644 (file)
index d70a35b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-###############################################################################
-# IPFire.org    - An Open Source Firewall Solution                            #
-# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
-###############################################################################
-
-name       = Test-Simple
-version    = 0.98
-release    = 1
-arch       = noarch
-
-groups     = Development/Libratries
-url        = http://search.cpan.org/dist/Test-Simple/
-license    = GPL+ or Artistic
-summary    = Basic utilities for writing tests.
-
-description
-       This package provides the bulk of the core testing facilities.  For more
-       information, see perldoc for Test::Simple, Test::More, etc.
-end
-
-source_dl  =
-
-build
-       requires
-               perl-core
-               perl-devel
-               perl(Test::Harness)
-       end
-
-       build
-               perl Makefile.PL INSTALLDIRS=perl
-               make %{PARALLELISMFLAGS}
-       end
-
-       test
-               make test
-       end
-end
-
-packages
-       package perl-%{name}
-end
index 588a6d997555da439c5b6388f012ae637ab0820c..6a2ce7a920e9008160751bec7d351beb804792d0 100644 (file)
@@ -46,4 +46,8 @@ packages
                        perl
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index f7e58430278ad7e4aa086e66b6a88c1df04896b1..4538da5a99f134c298f589855f843b14986cc3b2 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = perl-libwww-perl
 version    = 5.837
-release    = 1
+release    = 2
 epoch      = 1
 arch       = noarch
 thisapp    = libwww-perl-%{version}
@@ -28,31 +28,37 @@ build
                perl-core
                perl-devel
                perl-HTML-Parser
-               perl-libwww-perl
                perl(Test::More)
                perl(Compress::Zlib)
                perl(MIME::Base64)
                perl(Net::FTP)
+               perl(URI)
        end
 
-       # Filter string for very weird dependencies.
-       export PKG_REQUIRES_FILTER = (HTTP::Headers|HTTP::GHTTP|Win32|Authen::NTLM)
-
        build
                perl Makefile.PL INSTALLDIRS=perl --aliases < /dev/null
                make %{PARALLELISMFLAGS}
        end
 
-       test
-               # Use system wide MIME types (link also to blib/... for "make test").  Doing
-               # this stuff before "make install" would not cause the symlink to be packaged
-               # but a copy of /etc/mime.types.
-               ln -svf /etc/mime.types %{DIR_APP}/blib/lib/LWP/media.types
-
-               make test
-       end
+       #test
+       #       # Use system wide MIME types (link also to blib/... for "make test").  Doing
+       #       # this stuff before "make install" would not cause the symlink to be packaged
+       #       # but a copy of /etc/mime.types.
+       #       ln -svf /etc/mime.types %{DIR_APP}/blib/lib/LWP/media.types
+       #
+       #       make test
+       #end
 end
 
 packages
        package %{name}
+               # Filter string for very weird dependencies.
+               filter_requires
+                       HTTP::Headers
+                       HTTP::GHTTP
+                       Win32
+                       Authen::NTLM
+               end
+       end
+
 end
index 5389fcd8f340f2d5828a53d52b8318c2b44b0d21..4ce92149e5c31168c2428b33d568ff520fd77748 100644 (file)
@@ -4,9 +4,11 @@
 ###############################################################################
 
 name       = perl
-version    = 5.12.3
-release    = 4
+version    = 5.14.2
+# Never reset release in this package, just increase.
+release    = 9
 
+maintainer = Michael Tremer <michael.tremer@ipfire.org>
 groups     = Development/Languages
 url        = http://www.perl.org/
 license    = GPL+ or Artistic and GPLv2+ or Artistic
@@ -24,7 +26,7 @@ description
        scripts.
 end
 
-source_dl  =
+source_dl  = http://www.cpan.org/src/5.0/
 
 build
        requires
@@ -41,9 +43,6 @@ build
        # So we need to pass it explicitely.
        CFLAGS += -fstack-protector-all
 
-       # Filter string for very weird dependencies.
-       export PKG_REQUIRES_FILTER = (DBD\:\:SQLite|DBIx\:\:Simple|perl>=[0-9]\:.*|NDBM_File|Your\:\:Module\:\:Here|FCGI|Mac\:\:.*)
-
        prepare_cmds
                sed -i 's/command /command[ -]/' makedepend.SH
        end
@@ -56,7 +55,6 @@ build
 
                sh ./Configure -des \
                        -Doptimize="%{CFLAGS}" \
-                       -Dccdlflags="-Wl,--enable-new-dtags" \
                        -Dversion=%{version} \
                        -Dmyhostname=localhost \
                        -Dperladmin=root@localhost \
@@ -102,9 +100,9 @@ build
                make %{PARALLELISMFLAGS}
        end
 
-#      test
-#              make test
-#      end
+       #test
+       #       make test
+       #end
 
        install_cmds
                # Remove precreated directories
@@ -120,95 +118,115 @@ quality-agent
        end
 end
 
+# This variable contains the constant version string
+# of this perl package.
+perl_requires := %{name}=%{thisver}
+
+perl_filter_requires
+       perl>=[0-9]\:.*
+end
+
 packages
-       package %{name}
+       package perl
                requires
-                       %{name}-libs=%{thisver}
+                       perl-libs=%{thisver}
+                       perl(Carp)
                end
 
                provides
-                       # These provides are needed by the perl pkg itself with auto-generated perl.req
-                       %{name}(VMS::Filespec)
-                       %{name}(VMS::Stdio)
-       
                        # Compat provides
-                       %{name}(:MODULE_COMPAT_5.12.3)
-                       %{name}(:MODULE_COMPAT_5.12.2)
-                       %{name}(:MODULE_COMPAT_5.12.1)
-                       %{name}(:MODULE_COMPAT_5.12.0)
-       
+                       perl(:MODULE_COMPAT_5.14.2)
+                       perl(:MODULE_COMPAT_5.14.1)
+                       perl(:MODULE_COMPAT_5.14.0)
+
                        # Threading provides
-                       %{name}(:WITH_ITHREADS)
-                       %{name}(:WITH_THREADS)
-       
+                       perl(:WITH_ITHREADS)
+                       perl(:WITH_THREADS)
+
                        # Largefile provides
-                       %{name}(:WITH_LARGEFILES)
+                       perl(:WITH_LARGEFILES)
 
                        # PerlIO provides
-                       %{name}(:WITH_PERLIO)
-       
+                       perl(:WITH_PERLIO)
+
                        # File provides
-                       %{name}(abbrev.pl)
-                       %{name}(assert.pl)
-                       %{name}(bigfloat.pl)
-                       %{name}(bigint.pl)
-                       %{name}(bigrat.pl)
-                       %{name}(bytes_heavy.pl)
-                       %{name}(cacheout.pl)
-                       %{name}(complete.pl)
-                       %{name}(ctime.pl)
-                       %{name}(dotsh.pl)
-                       %{name}(dumpvar.pl)
-                       %{name}(exceptions.pl)
-                       %{name}(fastcwd.pl)
-                       %{name}(find.pl)
-                       %{name}(finddepth.pl)
-                       %{name}(flush.pl)
-                       %{name}(ftp.pl)
-                       %{name}(getcwd.pl)
-                       %{name}(getopt.pl)
-                       %{name}(getopts.pl)
-                       %{name}(hostname.pl)
-                       %{name}(importenv.pl)
-                       %{name}look.pl)
-                       %{name}(newgetopt.pl)
-                       %{name}(open2.pl)
-                       %{name}(open3.pl)
-                       %{name}(perl5db.pl)
-                       %{name}(pwd.pl)
-                       %{name}(shellwords.pl)
-                       %{name}(stat.pl)
-                       %{name}(syslog.pl)
-                       %{name}(tainted.pl)
-                       %{name}(termcap.pl)
-                       %{name}(timelocal.pl)
-                       %{name}(utf8_heavy.pl)
-                       %{name}(validate.pl)
-                       %{name}(Carp)
-                       %{name}(Carp::Heavy)
-                       %{name}(Exporter)
-                       %{name}(File::Basename)
-                       %{name}(constant)
-                       %{name}(strict)
-                       %{name}(vars)
+                       perl(abbrev.pl)
+                       perl(assert.pl)
+                       perl(bigfloat.pl)
+                       perl(bigint.pl)
+                       perl(bigrat.pl)
+                       perl(bytes_heavy.pl)
+                       perl(cacheout.pl)
+                       perl(complete.pl)
+                       perl(ctime.pl)
+                       perl(dotsh.pl)
+                       perl(dumpvar.pl)
+                       perl(exceptions.pl)
+                       perl(fastcwd.pl)
+                       perl(find.pl)
+                       perl(finddepth.pl)
+                       perl(flush.pl)
+                       perl(ftp.pl)
+                       perl(getcwd.pl)
+                       perl(getopt.pl)
+                       perl(getopts.pl)
+                       perl(hostname.pl)
+                       perl(importenv.pl)
+                       perllook.pl)
+                       perl(newgetopt.pl)
+                       perl(open2.pl)
+                       perl(open3.pl)
+                       perl(perl5db.pl)
+                       perl(pwd.pl)
+                       perl(shellwords.pl)
+                       perl(stat.pl)
+                       perl(syslog.pl)
+                       perl(tainted.pl)
+                       perl(termcap.pl)
+                       perl(timelocal.pl)
+                       perl(utf8_heavy.pl)
+                       perl(validate.pl)
+                       perl(Exporter)
+                       perl(File::Basename)
+                       perl(constant)
+                       perl(strict)
+                       perl(vars)
+
+                       # XXX why?
+                       perl(Mac::InternetConfig)
+                       perl(NDBM_File)
+               end
+
+               filter_requires
+                       %{perl_filter_requires}
+                       DBIx
+                       InternetConfig
+                       perl\(Mac
+                       perl\(NDBM_File
+                       perl\(VMS
+               end
+
+               filter_provides
+                       Carp
+                       perl\(Carp\)
                end
        end
-       
-       package %{name}-libs
+
+       package perl-libs
                template LIBS
-       
+
                provides
                        libperl.so
                end
-       
+
                files
                        /usr/lib/perl5/CORE/libperl.so
                end
        end
-       
-       package %{name}-devel
+
+       package perl-devel
                template DEVEL
-       
+
                files
                        /usr/bin/enc2xs
                        /usr/share/man/man1/enc2xs*
@@ -225,8 +243,8 @@ packages
                        /usr/share/man/man1/perlxs*
                end
        end
-       
-       #package %{name}-tests
+
+       #package perl-tests
        #       summary = Testsuite to check your Perl installation.
        #       description-perl-tests
        #               This package contains the test suite included with perl %{thisver}.
@@ -238,32 +256,32 @@ packages
        #               /usr/lib/perl5-tests
        #       end
        #end
-       
-       package %{name}-Archive-Extract
+
+       package perl-Archive-Extract
                epoch = 0
-               version = 0.38
+               version = 0.48
                arch = noarch
-       
+
                summary = Generic archive extracting mechanism.
                description
                        Archive::Extract is a generic archive extraction mechanism.
                end
 
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
-       
+
                files
                        /usr/share/perl5/Archive/Extract.pm
                        /usr/share/man/man3/Archive::Extract.3*
                end
        end
-       
-       package %{name}-Archive-Tar
+
+       package perl-Archive-Tar
                epoch = 0
-               version = 1.54
+               version = 1.76
                arch = noarch
-       
+
                summary = A module for Perl manipulation of .tar files.
                description
                        Archive::Tar provides an object oriented mechanism for handling tar files. It
@@ -274,22 +292,48 @@ packages
                end
 
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
-       
+
                files
                        /usr/bin/ptar
                        /usr/bin/ptardiff
+                       /usr/bin/ptargrep
                        /usr/share/perl5/Archive/Tar.pm
                        /usr/share/man/man1/ptar.1*
                        /usr/share/man/man1/ptardiff.1*
+                       /usr/share/man/man1/ptargrep.1*
                        /usr/share/man/man3/Archive::Tar*
                end
        end
-       
-       package %{name}-Compress-Raw-Zlib
+
+       package perl-Class-ISA
+               epoch = 0
+               version = 0.36
+               arch = noarch
+
+               summary = Report the search path for a class's ISA tree
+               description
+                       Suppose you have a class (like Food::Fish::Fishstick) that is derived, via
+                       its @ISA, from one or more superclasses (as Food::Fish::Fishstick is from
+                       Food::Fish, Life::Fungus, and Chemicals), and some of those superclasses
+                       may themselves each be derived, via its @ISA, from one or more superclasses
+                       (as above).
+               end
+
+               requires
+                       %{perl_requires}
+               end
+
+               files
+                       /usr/share/perl5/Class/ISA.pm
+                       /usr/share/man/man3/Class::ISA.3*
+               end
+       end
+
+       package perl-Compress-Raw-Zlib
                epoch = 0
-               version = 2.024
+               version = 2.033
 
                summary = Low-Level Interface to the zlib compression library.
                description
@@ -298,35 +342,76 @@ packages
                end
 
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
-       
+
                files
                        /usr/share/perl5/Compress/Raw/Zlib/
                        /usr/share/man/man3/Compress::Raw::Zlib*
                end
        end
-       
-       package %{name}-CPAN
+
+       package perl-CGI
+               epoch = 0
+               version = 3.49
+               arch = noarch
+
+               summary = Handle Common Gateway Interface requests and responses
+               description
+                       CGI.pm is a stable, complete and mature solution for processing and preparing
+                       HTTP requests and responses. Major features including processing form
+                       submissions, file uploads, reading and writing cookies, query string generation
+                       and manipulation, and processing and preparing HTTP headers. Some HTML
+                       generation utilities are included as well.
+
+                       CGI.pm performs very well in in a vanilla CGI.pm environment and also comes
+                       with built-in support for mod_perl and mod_perl2 as well as FastCGI.
+               end
+
+               requires
+                       %{perl_requires}
+               end
+
+               provides
+                       perl(CGI)=%{version}
+               end
+
+               filter_requires
+                       perl\(FCGI\)
+               end
+
+               files
+                       /usr/share/perl5/CGI
+                       /usr/share/perl5/CGI.pm
+                       /usr/share/man/man3/CGI.3*
+                       /usr/share/man/man3/CGI::*.3*
+               end
+       end
+
+       package perl-CPAN
                epoch = 0
-               version = 1.9402
+               version = 1.9600.01
                arch = noarch
-       
+
                summary = Query, download and build perl modules from CPAN sites.
                description
                        Query, download and build perl modules from CPAN sites.
                end
-       
+
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                        perl(Digest::SHA)
                end
-       
+
                provides
                        cpan
                        cpan=$(version-perl-CPAN)
                end
-       
+
+               filter_requires
+                       perl\(Mac::BuildTools\)
+               end
+
                files
                        /usr/bin/cpan
                        /usr/share/perl5/CPAN*
@@ -335,29 +420,88 @@ packages
                end
        end
 
-       package %{name}-CPANPLUS
+       package perl-CPAN-Meta
+               epoch = 0
+               version = 2.110440
+               arch = noarch
+
+               summary = Distribution metadata for a CPAN dist.
+               description
+                       Software distributions released to the CPAN include a META.json or, for
+                       older distributions, META.yml, which describes the distribution, its
+                       contents, and the requirements for building and installing the
+                       distribution. The data structure stored in the META.json file is described
+                       in CPAN::Meta::Spec.
+               end
+
+               requires
+                       %{perl_requires}
+               end
+
+               files
+                       /usr/share/perl5/CPAN/Meta.pm
+                       /usr/share/perl5/CPAN/Meta
+                       /usr/share/perl5/CPAN/Meta/Converter.pm
+                       /usr/share/perl5/CPAN/Meta/Feature.pm
+                       /usr/share/perl5/CPAN/Meta/History.pm
+                       /usr/share/perl5/CPAN/Meta/Prereqs.pm
+                       /usr/share/perl5/CPAN/Meta/Spec.pm
+                       /usr/share/perl5/CPAN/Meta/Validator.pm
+                       /usr/share/man/man5/CPAN::Meta.*
+               end
+       end
+
+       package perl-CPAN-Meta-YAML
+               epoch = 0
+               version = 0.0003
+               arch = noarch
+
+               summary = Read and write a subset of YAML for CPAN Meta files.
+               description
+                       This module implements a subset of the YAML specification for use in reading
+                       and writing CPAN metadata files like META.yml and MYMETA.yml. It should not be
+                       used for any other general YAML parsing or generation task.
+               end
+
+               requires
+                       %{perl_requires}
+               end
+
+               files
+                       /usr/share/perl5/CPAN/Meta/YAML.pm
+                       /usr/share/man/man5/CPAN::Meta::YAML*
+               end
+       end
+
+       package perl-CPANPLUS
                epoch = 0
-               version = 0.9
+               version = 0.9103
                arch = noarch
-       
+
                summary = API & CLI access to the CPAN mirrors.
                description
                        The CPANPLUS library is an API to the CPAN mirrors and a collection of
                        interactive shells, commandline programs, etc, that use this API.
                end
-       
+
                requires
-                       %{name}=%{thisver}
-                       %{name}(Digest::SHA)
-                       %{name}(Module::Pluggable)>=2.4
-                       %{name}(Module::CoreList)
-                       %{name}(DBIx::Simple)
+                       %{perl_requires}
+                       perl(Digest::SHA)
+                       perl(Module::Pluggable)>=2.4
+                       perl(Module::CoreList)
                end
-       
+
                provides
-                       %{name}-CPANPLUS-Dist-Build=0.06
+                       perl-CPANPLUS-Dist-Build=0.06
+               end
+
+               filter_requires
+                       %{perl_filter_requires}
+                       DBIx
+                       Your::Module::Here
+                       perl\(DBD::SQLite\)
                end
-       
+
                files
                        /usr/bin/cpan2dist
                        /usr/bin/cpanp
@@ -368,11 +512,95 @@ packages
                        /usr/share/man/man3/CPANPLUS*
                end
        end
-       
-       package %{name}-Digest-SHA
+
+       package perl-Carp
+               epoch = 0
+               version = 1.20
+               arch = noarch
+
+               summary = Alternative warn and die for modules.
+               description
+                       The Carp routines are useful in your own modules because they act like
+                       die() or warn(), but with a message which is more likely to be useful to a
+                       user of your module. In the case of cluck, confess, and longmess that
+                       context is a summary of every call in the call-stack. For a shorter message
+                       you can use carp or croak which report the error as being from where your
+                       module was called. There is no guarantee that that is where the error was,
+                       but it is a good educated guess.
+               end
+
+               requires
+                       %{perl_requires}
+               end
+
+               # Do not export unversioned module
+               filter_provides = ^perl\(Carp\)\s*$
+
+               files
+                       /usr/share/perl5/Carp*
+                       /usr/share/man3/Carp*
+               end
+       end
+
+       package perl-Digest
+               epoch = 0
+               version = 1.16
+               arch = noarch
+
+               summary = Modules that calculate message digests.
+               description
+                       The Digest:: modules calculate digests, also called "fingerprints" or
+                       "hashes", of some data, called a message. The digest is (usually)
+                       some small/fixed size string. The actual size of the digest depend of
+                       the algorithm used. The message is simply a sequence of arbitrary
+                       bytes or bits.
+               end
+
+               requires
+                       %{perl_requires}
+                       perl(MIME::Base64)
+               end
+
+               files
+                       /usr/lib/perl5/Digest
+                       !/usr/lib/perl5/Digest/*
+                       /usr/share/perl5/Digest.pm
+                       /usr/share/perl5/Digest/base.pm
+                       /usr/share/perl5/Digest/file.pm
+                       /usr/share/man/man5/Digest.3*
+                       /usr/share/man/man5/Digest::base.3*
+                       /usr/share/man/man5/Digest::file.3*
+               end
+       end
+
+       package perl-Digest-MD5
+               epoch = 0
+               version = 2.51
+
+               summary = Perl Interface to the MD5 Algorithm.
+               description
+                       The Digest::MD5 module allows you to use the RSA Data Security Inc. MD5
+                       Message Digest algorithm from within Perl programs. The algorithm takes as
+                       input a message of arbitrary length and produces as output a 128-bit
+                       "fingerprint" or "message digest" of the input.
+               end
+
+               requires
+                       %{perl_requires}
+                       perl(Digest::base)>=1.00
+               end
+
+               files
+                       /usr/lib/perl5/Digest/MD5.pm
+                       /usr/lib/perl5/auto/Digest/MD5
+                       /usr/share/man/man3/Digest::MD5.3*
+               end
+       end
+
+       package perl-Digest-SHA
                epoch = 0
-               version = 5.47
-       
+               version = 5.61
+
                summary = Perl extension for SHA-1/224/256/384/512.
                description
                        Digest::SHA is a complete implementation of the NIST Secure Hash
@@ -380,22 +608,24 @@ packages
                        SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512 message digests. The
                        module can handle all types of input, including partial-byte data.
                end
-       
+
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
+                       perl(Digest::base)
+                       perl(MIME::Base64)
                end
-       
+
                files
                        /usr/bin/shasum
-                       /usr/share/perl5/Digest*
+                       /usr/share/perl5/Digest/SHA*
                        /usr/share/man/man1/shasum.1*
                        /usr/share/man/man3/Digest::SHA.3*
                end
        end
-       
-       package %{name}-ExtUtils-CBuilder
+
+       package perl-ExtUtils-CBuilder
                epoch = 0
-               version = 0.27
+               version = 0.280203
                arch = noarch
 
                summary = Compile and link C code for Perl modules.
@@ -405,53 +635,53 @@ packages
                        motivated by the Module::Build project, but may be useful for other
                        purposes as well.
                end
-       
+
                requires
-                       %{name}=%{thisver}
-                       %{name}-devel
+                       %{perl_requires}
+                       perl-devel
                end
-       
+
                files
                        /usr/share/perl5/ExtUtils/CBuilder*
                        /usr/share/man/man3/ExtUtils::CBuilder*
                end
        end
-       
-       package %{name}-ExtUtils-Embed
+
+       package perl-ExtUtils-Embed
                epoch = 0
-               version = 1.28
+               version = 1.30
                arch = noarch
-       
+
                summary = Utilities for embedding Perl in C/C++ applications.
                description
                        Utilities for embedding Perl in C/C++ applications.
                end
-       
+
                requires
-                       %{name}=%{thisver}
-                       %{name}-devel
+                       %{perl_requires}
+                       perl-devel
                end
-       
+
                files
                        /usr/share/perl5/ExtUtils/Embed*
                        /usr/share/man/man3/ExtUtils::Embed*
                end
        end
-       
-       package %{name}-ExtUtils-MakeMaker
+
+       package perl-ExtUtils-MakeMaker
                epoch = 0
-               version = 6.56
+               version = 6.57_05
                arch = noarch
-       
+
                summary = Create a module Makefile.
                description
                        Create a module Makefile.
                end
-       
+
                requires
-                       %{name}=%{thisver}
-                       %{name}-devel
-                       %{name}(Test::Harness)
+                       %{perl_requires}
+                       perl-devel
+                       perl(Test::Harness)
                end
 
                files
@@ -486,10 +716,10 @@ packages
                        /usr/share/man/man3/ExtUtils::testlib.3*
                end
        end
-       
-       package %{name}-ExtUtils-ParseXS
+
+       package perl-ExtUtils-ParseXS
                epoch = 0
-               version = 2.21
+               version = 2.2210
                arch = noarch
 
                summary = Module and a script for converting Perl XS code into C code.
@@ -498,61 +728,87 @@ packages
                        constructs necessary to let C functions manipulate Perl values and creates
                        the glue necessary to let Perl access those functions.
                end
-       
+
                requires
-                       %{name}=%{thisver}
-                       %{name}-devel
+                       %{perl_requires}
+                       perl-devel
                end
-       
+
                files
                        /usr/share/perl5/ExtUtils/ParseXS.pm
                        /usr/share/perl5/ExtUtils/xsubpp
                        /usr/share/man/man3/ExtUtils::ParseXS.3*
                end
        end
-       
-       package %{name}-File-Fetch
-               epoch = 0
-               version = 6.56
+
+       package perl-File-Fetch
+               epoch = 1
+               version = 0.32
                arch = noarch
 
                summary = Generic file fetching mechanism.
                description
                        File::Fetch is a generic file fetching mechanism.
                end
-       
+
                requires
-                       %{name}=%{thisver}
-                       %{name}(IPC::Cmd)>=0.36
-                       %{name}(Module::Load::Conditional)>=0.04
-                       %{name}(Params::Check)>=0.07
+                       %{perl_requires}
+                       perl(IPC::Cmd)>=0.36
+                       perl(Module::Load::Conditional)>=0.04
+                       perl(Params::Check)>=0.07
                end
-       
+
                files
                        /usr/share/perl5/File/Fetch.pm
                        /usr/share/man/man3/File::Fetch.3*
                end
        end
-       
-       package %{name}-IO-Compress
+
+       package perl-HTTP-Tiny
+               epoch = 0
+               version = 0.012
+               arch = noarch
+
+               summary = A small, simple, correct HTTP/1.1 client.
+               description
+                       This is a very simple HTTP/1.1 client, designed primarily for doing simple GET
+                       requests without the overhead of a large framework like LWP::UserAgent.
+                       It is more correct and more complete than HTTP::Lite. It supports proxies
+                       (currently only non-authenticating ones) and redirection. It also correctly
+                       resumes after EINTR.
+               end
+
+               requires
+                       %{perl_requires}
+                       perl(Carp)
+                       perl(IO::Socket)
+               end
+
+               files
+                       /usr/share/perl5/HTTP/Tiny.pm
+                       /usr/share/man/man5/HTTP::Tiny*
+               end
+       end
+
+       package perl-IO-Compress
                epoch = 0
-               version = 2.026
-       
+               version = 2.033
+
                summary = IO::Compress wrapper for modules.
                description
                        This module is the base class for all IO::Compress and IO::Uncompress
                        modules. This module is not intended for direct use in application code.
                        Its sole purpose is to to be sub-classed by IO::Compress modules.
                end
-       
+
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
-       
+
                provides
-                       %{name}(IO::Uncompress::Bunzip2)
+                       perl(IO::Uncompress::Bunzip2)
                end
-       
+
                files
                        /usr/share/perl5/Compress/Zlib.pm
                        /usr/lib/perl5/auto/Compress/Zlib/
@@ -568,8 +824,8 @@ packages
                        /usr/share/man/man3/IO::Uncompress::Base.*
                end
        end
-       
-       package %{name}-IO-Zlib
+
+       package perl-IO-Zlib
                epoch = 0
                version = 1.10
                arch = noarch
@@ -581,66 +837,93 @@ packages
                        the same way as an IO::File object so you can have common code that doesn't
                        know which sort of file it is using.
                end
-       
+
                requires
-                       %{name}=%{thisver}
-                       %{name}(Compress::Zlib)
+                       %{perl_requires}
+                       perl(Compress::Zlib)
                end
-       
+
                files
                        /usr/share/perl5/IO/Zlib.pm
                        /usr/share/man/man3/IO::Zlib.*
                end
        end
-       
-       package %{name}-IPC-Cmd
+
+       package perl-IPC-Cmd
                epoch = 0
-               version = 0.54
+               version = 0.70
                arch = noarch
-       
+
                summary = Finding and running system commands made easy.
                description
                        IPC::Cmd allows you to run commands, interactively if desired, in a
                        platform independent way, but have them still work.
                end
-       
+
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
+                       perl(ExtUtils::MakeMaker)
                end
-       
+
                files
                        /usr/share/perl5/IPC/Cmd.pm
                        /usr/share/man/man3/IPC::Cmd.3*
                end
        end
-       
-       package %{name}-Locale-Maketext-Simple
+
+       package perl-JSON-PP
+               epoch = 0
+               version = 2.27150
+               arch = noarch
+
+               summary = JSON::XS compatible pure-Perl module.
+               description
+                       JSON::XS is the fastest and most proper JSON module on CPAN. It is written by
+                       Marc Lehmann in C, so must be compiled and installed in the used environment.
+                       JSON::PP is a pure-Perl module and is compatible with JSON::XS.
+               end
+
+               requires
+                       %{perl_requires}
+               end
+
+               files
+                       /usr/bin/json_pp
+                       /usr/share/perl5/JSON/PP
+                       /usr/share/perl5/JSON/PP.pm
+                       /usr/share/man/man1/json_pp.1*
+                       /usr/share/man/man3/JSON::PP.3*
+                       /usr/share/man/man3/JSON::PP::Boolean.3pm*
+               end
+       end
+
+       package perl-Locale-Maketext-Simple
                epoch = 0
                version = 0.21
                arch = noarch
                license = MIT
-       
+
                summary = Simple interface to Locale::Maketext::Lexicon.
                description
                        This module is a simple wrapper around Locale::Maketext::Lexicon, designed
                        to alleviate the need of creating Language Classes for module authors.
                end
-       
+
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
-       
+
                files
                        /usr/share/perl5/Locale/Maketext/Simple.pm
                        /usr/share/man/man3/Locale::Maketext::Simple.*
                end
        end
-       
-       package %{name}-Log-Message
+
+       package perl-Log-Message
                epoch = 0
-               version = 0.02
+               version = 0.04
                arch = noarch
-       
+
                summary = Generic message storage mechanism.
                description
                        Log::Message is a generic message storage mechanism. It allows you to store
@@ -650,13 +933,13 @@ packages
                        identify it or group it, and a level at which to handle the message (for
                        example, log it, or die with it).
                end
-       
+
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
-       
+
                provides
-                       %{name}(Log::Message::Handlers)=%{version}
+                       perl(Log::Message::Handlers)=%{version}
                end
 
                files
@@ -670,33 +953,33 @@ packages
                        /usr/share/man/man3/Log::Message::Item.3*
                end
        end
-       
-       package %{name}-Log-Message-Simple
+
+       package perl-Log-Message-Simple
                epoch = 0
-               version = 0.06
+               version = 0.08
                arch = noarch
-       
+
                summary = Simplified frontend to Log::Message.
                description
                        This module provides standardized logging facilities using the
                        Log::Message module.
                end
-       
+
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
-       
+
                files
                        /usr/share/perl5/Log/Message/Simple.pm
                        /usr/share/man/man3/Log::Message::Simple.3*
                end
        end
-       
-       package %{name}-Module-Build
+
+       package perl-Module-Build
                epoch = 0
-               version = 0.3603
+               version = 0.3800
                arch = noarch
-       
+
                summary = Perl module for building and installing Perl modules.
                description
                        Module::Build is a system for building, testing, and installing Perl modules.
@@ -709,14 +992,15 @@ packages
                        are included with perl 5.6.0, and it works fine on perl 5.005 if you can
                        install a few additional modules.
                end
-       
+
                requires
-                       %{name}=%{thisver}
-                       %{name}(Archive::Tar)>=1.08
-                       %{name}(ExtUtils::CBuilder)>=0.15
-                       %{name}(ExtUtils::ParseXS)>=1.02
+                       %{perl_requires}
+                       perl(Archive::Tar)>=1.08
+                       perl(CPAN::Meta)>=2.110420
+                       perl(ExtUtils::CBuilder)>=0.15
+                       perl(ExtUtils::ParseXS)>=1.02
                end
-       
+
                files
                        /usr/bin/config_data
                        /usr/share/perl5/inc/
@@ -726,23 +1010,23 @@ packages
                        /usr/share/man/man3/inc::latest.3*
                end
        end
-       
-       package %{name}-Module-CoreList
+
+       package perl-Module-CoreList
                epoch = 0
-               version = 2.29
+               version = 2.49_01
                arch = noarch
-       
+
                summary = Perl core modules indexed by perl versions.
                description
                        Module::CoreList contains the hash of hashes %Module::CoreList::version, this
                        is keyed on perl version as indicated in $].  The second level hash is module
                        => version pairs.
                end
-       
+
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
-       
+
                files
                        /usr/bin/corelist
                        /usr/share/perl5/Module/CoreList.pm
@@ -750,54 +1034,54 @@ packages
                        /usr/share/man/man3/Module::CoreList*
                end
        end
-       
-       package %{name}-Module-Load
+
+       package perl-Module-Load
                epoch = 0
-               version = 0.16
+               version = 0.18
                arch = noarch
-       
+
                summary = Runtime require of both modules and files.
                description
                        Module::Load eliminates the need to know whether you are trying to require
                        either a file or a module.
                end
-       
+
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
-       
+
                files
                        /usr/share/perl5/Module/Load.pm
                        /usr/share/man/man3/Module::Load.*
                end
        end
-       
-       package %{name}-Module-Load-Conditional
+
+       package perl-Module-Load-Conditional
                epoch = 0
-               version = 0.34
+               version = 0.44
                arch = noarch
-       
+
                summary = Looking up module information / loading at runtime.
                description
                        Module::Load::Conditional provides simple ways to query and possibly load
                        any of the modules you have installed on your system during runtime.
                end
-       
+
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
-       
+
                files
                        /usr/share/perl5/Module/Load/
                        /usr/share/man/man3/Module::Load::Conditional*
                end
        end
-       
-       package %{name}-Module-Loaded
+
+       package perl-Module-Loaded
                epoch = 0
                version = 0.06
                arch = noarch
-       
+
                summary = Mark modules as loaded or unloaded.
                description
                        When testing applications, often you find yourself needing to provide
@@ -806,18 +1090,38 @@ packages
                        modules as loaded, so they are not attempted to be loaded by perl, this module
                        offers you a very simple way to mark modules as loaded and/or unloaded.
                end
-       
+
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
-       
+
                files
                        /usr/share/perl5/Module/Loaded.pm
                        /usr/share/man/man3/Module::Loaded*
                end
        end
-       
-       package %{name}-Module-Plugable
+
+       package perl-Module-Metadata
+               epoch = 0
+               version = 1.000004
+               arch = noarch
+
+               summary = Gather package and POD information from perl module files.
+               description
+                       Gather package and POD information from perl module files.
+               end
+
+               requires
+                       %{perl_requires}
+               end
+
+               files
+                       /usr/share/perl5/Module/Metadata.pm
+                       /usr/share/man/man3/Module::Metadata.3pm*
+               end
+       end
+
+       package perl-Module-Plugable
                epoch = 0
                version = 3.90
                arch = noarch
@@ -827,11 +1131,11 @@ packages
                        Provides a simple but, hopefully, extensible way of having 'plugins' for
                        your module.
                end
-       
+
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
-       
+
                files
                        /usr/share/perl5/Devel/InnerPackage.pm
                        /usr/share/perl5/Module/Pluggable/
@@ -841,11 +1145,11 @@ packages
                end
        end
 
-       package %{name}-Object-Accessor
+       package perl-Object-Accessor
                epoch = 0
-               version = 0.36
+               version = 0.38
                arch = noarch
-       
+
                summary = Perl module that allows per object accessors.
                description
                        Object::Accessor provides an interface to create per object accessors (as
@@ -853,29 +1157,29 @@ packages
                end
 
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
-       
+
                files
                        /usr/share/perl5/Object/
                        /usr/share/man/man3/Object::Accessor*
                end
        end
-       
-       package %{name}-Package-Constants
+
+       package perl-Package-Constants
                epoch = 0
                version = 0.02
                arch = noarch
-       
+
                summary = List all constants declared in a package.
                description
                        Package::Constants lists all the constants defined in a certain package.  This
                        can be useful for, among others, setting up an autogenerated @EXPORT/@EXPORT_OK
                        for a Constants.pm file.
                end
-       
+
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
 
                files
@@ -883,34 +1187,34 @@ packages
                        /usr/share/man/man3/Package::Constants*
                end
        end
-       
-       package %{name}-Params-Check
+
+       package perl-Params-Check
                epoch = 0
-               version = 0.26
+               version = 0.28
                arch = noarch
-       
+
                summary = Generic input parsing/checking mechanism.
                description
                        Params::Check is a generic input parsing/checking mechanism.
                end
-       
+
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
 
                provides
-                       %{name}(Params::Check)
+                       perl(Params::Check)
                end
-       
+
                files
                        /usr/share/perl5/Params/
                        /usr/share/man/man3/Params::Check*
                end
        end
-       
-       package %{name}-Parse-CPAN-Meta
+
+       package perl-Parse-CPAN-Meta
                epoch = 0
-               version = 1.40
+               version = 1.4401
                arch = noarch
 
                summary = Parse META.yml and other similar CPAN metadata files.
@@ -918,9 +1222,9 @@ packages
                        Parse::CPAN::Meta is a parser for META.yml files, based on the parser half of
                        YAML::Tiny.
                end
-       
+
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
 
                files
@@ -928,21 +1232,25 @@ packages
                        /usr/share/man/man3/Parse::CPAN::Meta.3*
                end
        end
-       
-       package %{name}-Path-Tools
+
+       package perl-Path-Tools
                epoch = 0
-               version = 3.31
+               version = 3.33
                license = (GPL+ or Artistic) and BSD
-       
+
                summary = PathTools Perl module (Cwd, File::Spec).
                description
                        PathTools Perl module (Cwd, File::Spec).
                end
-       
+
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
+               end
+
+               filter_requires
+                       perl\(VMS\:\:Filespec\)
                end
-       
+
                files
                        /usr/lib/perl5/Cwd.pm
                        /usr/lib/perl5/File/Spec*
@@ -950,44 +1258,78 @@ packages
                        /usr/share/man/man3/File::Spec*
                end
        end
-       
-       package %{name}-Pod-Escapes
+
+       package perl-Perl-OSType
+               epoch = 0
+               version = 1.002
+               arch = noarch
+
+               summary = Map perl operating system names to generic types.
+               description
+                       Modules that provide OS-specific behaviors often need to know if the current
+                       operating system matches a more generic type of operating systems. For example,
+                       'linux' is a type of 'Unix' operating system and so is 'freebsd'.
+                       This module provides a mapping between an operating system name as given by $^O
+                       and a more generic type. The initial version is based on the OS type mappings
+                       provided in Module::Build and ExtUtils::CBuilder (thus, Microsoft operating
+                       systems are given the type 'Windows' rather than 'Win32').
+               end
+
+               requires
+                       %{perl_requires}
+               end
+
+               files
+                       /usr/share/perl5/Perl/OSType.pm
+                       /usr/share/man/man3/Perl::OSType.3pm*
+               end
+       end
+
+       package perl-Pod-Escapes
                epoch= 0
                version = 1.04
                arch = noarch
-       
+
                summary = Perl module for resolving POD escape sequences.
                description
                        This module provides things that are useful in decoding Pod E<...> sequences.
                        Presumably, it should be used only by Pod parsers and/or formatters.
                end
-       
+
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
-       
+
+               filter_requires
+                       %{perl_filter_requires}
+               end
+
                files
                        /usr/share/perl5/Pod/Escapes.pm
                        /usr/share/man/man3/Pod::Escapes.*
                end
        end
-       
-       package %{name}-Pod-Simple
+
+       package perl-Pod-Simple
                epoch = 0
-               version = 3.13
+               version = 3.16
                arch = noarch
-       
+
                summary = Framework for parsing POD documentation.
                description
                        Pod::Simple is a Perl library for parsing text in the Pod (plain old
                        documentation) markup language that is typically used for writing
                        documentation for Perl and for Perl modules.
                end
-       
+
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
+               end
+
+               filter_requires
+                       %{perl_filter_requires}
                end
-       
+
                files
                        /usr/share/perl5/Pod/Simple/
                        /usr/share/perl5/Pod/Simple.pm
@@ -995,10 +1337,35 @@ packages
                        /usr/share/man/man3/Pod::Simple*
                end
        end
-       
-       package %{name}-Term-UI
+
+       package perl-Scalar-List-Utils
+               epoch = 0
+               version = 1.22
+
+               summary = A selection of general-utility scalar and list subroutines.
+               description
+                       Scalar::Util and List::Util contain a selection of subroutines that people have
+                       expressed would be nice to have in the perl core, but the usage would not
+                       really be high enough to warrant the use of a keyword, and the size so small
+                       such that being individual extensions would be wasteful.
+               end
+
+               requires
+                       %{perl_requires}
+               end
+
+               files
+                       /usr/lib/perl5/List
+                       /usr/lib/perl5/Scalar
+                       /usr/lib/perl5/auto/List
+                       /usr/share/man/man3/List::Util*
+                       /usr/share/man/man3/Scalar::Util*
+               end
+       end
+
+       package perl-Term-UI
                epoch = 0
-               version = 0.20
+               version = 0.26
                arch = noarch
 
                summary = Term::ReadLine UI made easy.
@@ -1009,8 +1376,8 @@ packages
                end
 
                requires
-                       %{name}=%{thisver}
-                       %{name}(Log::Message::Simple)
+                       %{perl_requires}
+                       perl(Log::Message::Simple)
                end
 
                files
@@ -1020,9 +1387,9 @@ packages
                end
        end
 
-       package %{name}-Test-Harness
+       package perl-Test-Harness
                epoch = 0
-               version = 3.17
+               version = 3.23
                arch = noarch
 
                summary = Run Perl standard test scripts with statistics.
@@ -1032,7 +1399,11 @@ packages
                end
 
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
+               end
+
+               filter_requires
+                       %{perl_filter_requires}
                end
 
                files
@@ -1047,9 +1418,9 @@ packages
                end
        end
 
-       package %{name}-Test-Simple
+       package perl-Test-Simple
                epoch = 0
-               version = 0.94
+               version = 0.98
                arch = noarch
 
                summary = Basic utilities for writing tests.
@@ -1058,7 +1429,7 @@ packages
                end
 
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
 
                files
@@ -1073,9 +1444,9 @@ packages
                end
        end
 
-       package %{name}-Time-Piece
+       package perl-Time-Piece
                epoch = 0
-               version = 1.15
+               version = 1.20_01
 
                summary = Time objects from localtime and gmtime.
                description
@@ -1086,7 +1457,7 @@ packages
                end
 
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
 
                files
@@ -1098,9 +1469,31 @@ packages
                end
        end
 
-       package %{name}-parent
+       package perl-Version-Requirements
+               epoch = 0
+               version = 0.101020
+               arch = noarch
+
+               summary = Set of version requirements for a CPAN dist.
+               description
+                       A Version::Requirements object models a set of version constraints like
+                       those specified in the META.yml or META.json files in CPAN distributions.
+                       It can be built up by adding more and more constraints, and it will reduce
+                       them to the simplest representation.
+               end
+
+               requires
+                       %{perl_requires}
+               end
+
+               # No files.
+               files
+               end
+       end
+
+       package perl-parent
                epoch = 0
-               version = 0.223
+               version = 0.225
                arch = noarch
 
                summary = Establish an ISA relationship with base classes at compile time.
@@ -1110,7 +1503,7 @@ packages
                end
 
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
 
                files
@@ -1119,9 +1512,9 @@ packages
                end
        end
 
-       package %{name}-threads
+       package perl-threads
                epoch = 0
-               version = 1.75
+               version = 1.83
 
                summary = Perl interpreter-based threads.
                description
@@ -1135,7 +1528,7 @@ packages
                end
 
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
 
                files
@@ -1145,9 +1538,9 @@ packages
                end
        end
 
-       package %{name}-threads-shared
+       package perl-threads-shared
                epoch = 0
-               version = 1.32
+               version = 1.37
 
                summary = Perl extension for sharing data structures between threads.
                description
@@ -1160,7 +1553,7 @@ packages
                end
 
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
 
                files
@@ -1170,9 +1563,9 @@ packages
                end
        end
 
-       package %{name}-version
+       package perl-version
                epoch = 0
-               version = 0.82
+               version = 0.88
                arch = noarch
 
                summary = Perl extension for Version Objects.
@@ -1181,7 +1574,7 @@ packages
                end
 
                requires
-                       %{name}=%{thisver}
+                       %{perl_requires}
                end
 
                files
@@ -1193,7 +1586,7 @@ packages
                end
        end
 
-       package %{name}-core
+       package perl-core
                epoch = 0
 
                summary = Base perl metapackage.
@@ -1203,50 +1596,66 @@ packages
                end
 
                requires
-                       %{name}=%{thisver}
-                       %{name}-libs
-                       %{name}-devel
-                       %{name}-Archive-Extract
-                       %{name}-Archive-Tar
-                       %{name}-Compress-Raw-Zlib
-                       %{name}-CPAN
-                       %{name}-CPANPLUS
-                       %{name}-Digest-SHA
-                       %{name}-ExtUtils-CBuilder
-                       %{name}-ExtUtils-Embed
-                       %{name}-ExtUtils-MakeMaker
-                       %{name}-ExtUtils-ParseXS
-                       %{name}-File-Fetch
-                       %{name}-IO-Compress
-                       %{name}-IO-Zlib
-                       %{name}-IPC-Cmd
-                       %{name}-Locale-Maketext-Simple
-                       %{name}-Log-Message
-                       %{name}-Log-Message-Simple
-                       %{name}-Module-Build
-                       %{name}-Module-CoreList
-                       %{name}-Module-Load
-                       %{name}-Module-Load-Conditional
-                       %{name}-Module-Loaded
-                       %{name}-Module-Plugable
-                       %{name}-Object-Accessor
-                       %{name}-Package-Constants
-                       %{name}-Params-Check
-                       %{name}-Parse-CPAN-Meta
-                       %{name}-Path-Tools
-                       %{name}-Pod-Simple
-                       %{name}-Term-UI
-                       %{name}-Test-Harness
-                       %{name}-Test-Simple
-                       %{name}-Time-Piece
-                       %{name}-parent
-                       %{name}-threads
-                       %{name}-threads-shared
-                       %{name}-version
+                       %{perl_requires}
+                       perl-libs
+                       perl-devel
+                       perl-Archive-Extract
+                       perl-Archive-Tar
+                       perl-Class-ISA
+                       perl-Compress-Raw-Zlib
+                       perl-CGI
+                       perl-CPAN
+                       perl-CPAN-Meta
+                       perl-CPAN-Meta-YAML
+                       perl-CPANPLUS
+                       perl-Carp
+                       perl-Digest
+                       perl-Digest-MD5
+                       perl-Digest-SHA
+                       perl-ExtUtils-CBuilder
+                       perl-ExtUtils-Embed
+                       perl-ExtUtils-MakeMaker
+                       perl-ExtUtils-ParseXS
+                       perl-File-Fetch
+                       perl-HTTP-Tiny
+                       perl-IO-Compress
+                       perl-IO-Zlib
+                       perl-IPC-Cmd
+                       perl-JSON-PP
+                       perl-Locale-Maketext-Simple
+                       perl-Log-Message
+                       perl-Log-Message-Simple
+                       perl-Module-Build
+                       perl-Module-CoreList
+                       perl-Module-Load
+                       perl-Module-Load-Conditional
+                       perl-Module-Loaded
+                       perl-Module-Metadata
+                       perl-Module-Plugable
+                       perl-Object-Accessor
+                       perl-Package-Constants
+                       perl-Params-Check
+                       perl-Parse-CPAN-Meta
+                       perl-Perl-OSType
+                       perl-Path-Tools
+                       perl-Pod-Simple
+                       perl-Scalar-List-Utils
+                       perl-Term-UI
+                       perl-Test-Harness
+                       perl-Test-Simple
+                       perl-Time-Piece
+                       perl-parent
+                       perl-threads
+                       perl-threads-shared
+                       perl-version
                end
 
                # Nothing. Nada. Zilch. Zarro. Uh uh. Nope. Sorry.
                files
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index ce91c338b9e6e7734e072ce55c5b9be7bb0e9a00..28353f7ead195b7b9e950a41f153b564d1a78cae 100644 (file)
@@ -37,4 +37,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 850466a1fc37e865a881bfb3f2aafe5135896687..fa240805a50ae6eb4ffaeaf6f42f6e7a6e0ad005 100644 (file)
@@ -28,8 +28,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 25b01b3499e8b1398210ec626fbb9d8247475117..bc36a26c1b57ba5cdcbd4fef7d429337307a0985 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = pkg-config
 version    = 0.25
-release    = 1
+release    = 2
 
-groups     = Build Development/Tools
+groups     = Development/Tools
 url        = http://pkg-config.freedesktop.org/
 license    = GPLv2
 summary    = A tool for determining compilation options.
@@ -37,7 +37,13 @@ end
 
 packages
        package %{name}
+               groups += Build
+
                # Say we provide an alternative spelling of the package name.
                provides = pkgconfig
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index ac0e039169c60c095f30b2883d3ce7fb6a6e9a14..3c8468121edcb32f06e8edcbb5121c8ba9058d27 100644 (file)
@@ -47,8 +47,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index e998cf85f8b9d4accbe4d13ad37182546deb690c..9407ce2da0bff89615f6e88e35fcabff5310f77a 100644 (file)
@@ -34,8 +34,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 5ea577eada5b0c27b470ba82bacb43fbe57c60a0..e6c250cc533208809966abb90170eade8b781ec8 100644 (file)
@@ -28,4 +28,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 60c5cf27fa2b61742102139610fa538e606032da..f4372b0fe2d3b15915f4a93de64028da18afcdd6 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = ppl
 version    = 0.11.2
-release    = 1
+release    = 2
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
 groups     = Development/Libraries
@@ -56,4 +56,12 @@ end
 
 packages
        package %{name}
+
+       package %{name}-devel
+               template DEVEL
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 3e35b44c10e21b421d95b43918a5c629f8fe3941..8930a9278a07df7e75629851b65754607bf9bf85 100644 (file)
@@ -61,8 +61,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 0ce873d86808e1f8d7ab88af7c6f00b8e41f47d5..8fb2822cc8e542a2202b5a163043a89415bf922f 100644 (file)
@@ -45,4 +45,8 @@ packages
                        iproute2
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 5c50a597aec2ccd53860179e3d31bbdb98d402b2..24748a482d056f2ad78534cac71d7cf7c34a0c87 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = procps
 version    = 3.2.8
-release    = 2
+release    = 3
 
-groups     = Base Applications/System
+groups     = Applications/System
 url        = http://procps.sourceforge.net/
 license    = GPLv2+ and LGPLv2+
 summary    = System and process monitoring utilities.
@@ -41,4 +41,10 @@ end
 
 packages
        package %{name}
+               groups += Base
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 3601591cf5d54c2dc504f902807b7e8c250b4ace..c91b3165917131f5664954e17755df425f9f2500 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = psmisc
 version    = 22.10
-release    = 1
+release    = 2
 
-groups     = Base Applications/System
+groups     = Applications/System
 url        = http://sourceforge.net/projects/psmisc
 license    = GPLv2+
 summary    = Utilities for managing processes on your system.
@@ -36,4 +36,10 @@ end
 
 packages
        package %{name}
+               groups += Base
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 832d2abbc58e28ab8a6ad55d72f5c6aa86f96298..345c159e6921c8c01b6c05e585183e6899f8c6d5 100644 (file)
@@ -40,8 +40,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/pyQt/patches/PyQt-x11-gpl-4.4.4-64bit.patch b/pyQt/patches/PyQt-x11-gpl-4.4.4-64bit.patch
deleted file mode 100644 (file)
index 0e52885..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-diff -up PyQt-x11-gpl-4.4.4/configure.py.64bit PyQt-x11-gpl-4.4.4/configure.py
---- PyQt-x11-gpl-4.4.4/configure.py.64bit      2008-11-08 05:55:49.000000000 -0600
-+++ PyQt-x11-gpl-4.4.4/configure.py    2008-11-10 14:01:14.000000000 -0600
-@@ -756,16 +756,15 @@ include(%s)
-             else:
-                 # Use distutils to get the additional configuration.
-                 from distutils.sysconfig import get_config_vars
-+                from distutils.sysconfig import get_python_lib
-                 ducfg = get_config_vars()
-                 if sys.platform == "darwin":
-                     # We need to work out how to specify the right framework
-                     # version.
-                     link = "-framework Python"
--                elif ("--enable-shared" in ducfg.get("CONFIG_ARGS", "") and
--                      glob.glob("%s/lib/libpython%d.%d*" % (ducfg["exec_prefix"], py_major, py_minor))):
--                    lib_dir_flag = quote("-L%s/lib" % ducfg["exec_prefix"])
--                    link = "%s -lpython%d.%d" % (lib_dir_flag, py_major, py_minor)
-+                elif ("--enable-shared" in ducfg.get("CONFIG_ARGS", "") ):
-+                    link = "-L%s -lpython%d.%d" % (get_python_lib(plat_specific=1, standard_lib=1), py_major, py_minor)
-                 else:
-                     sipconfig.inform("Qt Designer plugin disabled because Python library is static")
-                     opts.designer_plugin = False
diff --git a/pyQt/patches/PyQt-x11-gpl-4.5.2-QT_SHARED.patch b/pyQt/patches/PyQt-x11-gpl-4.5.2-QT_SHARED.patch
deleted file mode 100644 (file)
index cfd86d6..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -up PyQt-x11-gpl-4.5.2/configure.py.QT_SHARED PyQt-x11-gpl-4.5.2/configure.py
---- PyQt-x11-gpl-4.5.2/configure.py.QT_SHARED  2009-07-16 08:34:48.419358104 -0500
-+++ PyQt-x11-gpl-4.5.2/configure.py    2009-07-16 08:34:54.260358064 -0500
-@@ -1679,11 +1679,11 @@ int main(int, char **)
-     out << QLibraryInfo::licensee() << '\\n';
--#if defined(QT_SHARED) || defined(QT_DLL)
-+//#if defined(QT_SHARED) || defined(QT_DLL)
-     out << "shared\\n";
--#else
--    out << "\\n";
--#endif
-+//#else
-+//    out << "\\n";
-+//#endif
-     // Determine which features should be disabled.
diff --git a/pyQt/patches/PyQt-x11-gpl-4.7.2-fix-implicit-linking.patch b/pyQt/patches/PyQt-x11-gpl-4.7.2-fix-implicit-linking.patch
deleted file mode 100644 (file)
index 2d73acd..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up PyQt-x11-gpl-4.7.2/configure.py.fix-implicit-linking PyQt-x11-gpl-4.7.2/configure.py
---- PyQt-x11-gpl-4.7.2/configure.py.fix-implicit-linking       2010-03-18 07:08:13.000000000 -0500
-+++ PyQt-x11-gpl-4.7.2/configure.py    2010-03-18 07:09:46.157734414 -0500
-@@ -1173,7 +1173,7 @@ def compile_qt_program(name, mname, extr
-     opengl = (mname == "QtOpenGL")
-     qt = [mname]
--    if mname in ("QtOpenGL", "QtWebKit"):
-+    if mname in ("QtOpenGL", "QtWebKit", "QtAssistant", "QtHelp"):
-         qt.append("QtCore")
-     makefile = sipconfig.ProgramMakefile(sipcfg, console=1, qt=qt, warnings=0,
diff --git a/pyQt/patches/PyQt-x11-gpl-4.8.3-pyuic_shbang.patch b/pyQt/patches/PyQt-x11-gpl-4.8.3-pyuic_shbang.patch
new file mode 100644 (file)
index 0000000..58a64f6
--- /dev/null
@@ -0,0 +1,8 @@
+diff -up PyQt-x11-gpl-snapshot-4.8.3-454d07a16153/pyuic/uic/pyuic.py.pyuic_shbang PyQt-x11-gpl-snapshot-4.8.3-454d07a16153/pyuic/uic/pyuic.py
+--- PyQt-x11-gpl-snapshot-4.8.3-454d07a16153/pyuic/uic/pyuic.py.pyuic_shbang   2011-01-14 21:44:29.000000000 -0600
++++ PyQt-x11-gpl-snapshot-4.8.3-454d07a16153/pyuic/uic/pyuic.py        2011-01-15 08:56:58.371972273 -0600
+@@ -1,3 +1,4 @@
++#!/usr/bin/python -tt
+ #############################################################################
+ ##
+ ## Copyright (c) 2011 Riverbank Computing Limited <info@riverbankcomputing.com>
diff --git a/pyQt/patches/add_gettext_support.patch0 b/pyQt/patches/add_gettext_support.patch0
new file mode 100644 (file)
index 0000000..4e81312
--- /dev/null
@@ -0,0 +1,89 @@
+Index: pyuic/uic/driver.py
+===================================================================
+--- pyuic/uic/driver.py.orig
++++ pyuic/uic/driver.py
+@@ -2,7 +2,19 @@ import sys
+ import logging
+ from PyQt4.uic import compileUi, loadUi
++from PyQt4.uic.Compiler import qtproxies
++original_i18n_string = qtproxies.i18n_string
++class i18n_string(qtproxies.i18n_string):
++    def __init__(self, string, disambig=None):
++        original_i18n_string.__init__(self, string, disambig)
++    def __str__(self):
++        return "i18n(%s)" % (qtproxies.as_string(self.string, encode=False),)
++
++_gettext_header = """import gettext
++__trans = gettext.translation('%s', fallback=True)
++i18n = __trans.ugettext
++"""
+ class Driver(object):
+     """ This encapsulates access to the pyuic functionality so that it can be
+@@ -16,6 +28,8 @@ class Driver(object):
+         name of the .ui file.
+         """
++        self.gettext_header = ''
++
+         if opts.debug:
+             logger = logging.getLogger(self.LOGGER_NAME)
+             handler = logging.StreamHandler()
+@@ -23,6 +37,10 @@ class Driver(object):
+             logger.addHandler(handler)
+             logger.setLevel(logging.DEBUG)
++        if not opts.gettext_domain == '':
++            qtproxies.i18n_string = i18n_string
++            self.gettext_header = _gettext_header % opts.gettext_domain
++
+         self._opts = opts
+         self._ui_file = ui_file
+@@ -60,7 +78,7 @@ class Driver(object):
+             pyfile = open(self._opts.output, 'wt', encoding='utf8')
+         compileUi(self._ui_file, pyfile, self._opts.execute, self._opts.indent,
+-                self._opts.pyqt3_wrapper, self._opts.from_imports)
++                self._opts.pyqt3_wrapper, self._opts.from_imports, self.gettext_header)
+     def on_IOError(self, e):
+         """ Handle an IOError exception. """
+Index: pyuic/uic/__init__.py
+===================================================================
+--- pyuic/uic/__init__.py.orig
++++ pyuic/uic/__init__.py
+@@ -98,7 +98,7 @@ def compileUiDir(dir, recurse=False, map
+                 compile_ui(dir, ui)
+-def compileUi(uifile, pyfile, execute=False, indent=4, pyqt3_wrapper=False, from_imports=False):
++def compileUi(uifile, pyfile, execute=False, indent=4, pyqt3_wrapper=False, from_imports=False, additional_text=''):
+     """compileUi(uifile, pyfile, execute=False, indent=4, pyqt3_wrapper=False, from_imports=False)
+     Creates a Python module from a Qt Designer .ui file.
+@@ -127,6 +127,9 @@ def compileUi(uifile, pyfile, execute=Fa
+     pyfile.write(_header % (uifname, ctime(), PYQT_VERSION_STR))
++    if not additional_text == '':
++        pyfile.write(additional_text)
++
+     winfo = compiler.UICompiler().compileUi(uifile, pyfile, from_imports)
+     if pyqt3_wrapper:
+Index: pyuic/uic/pyuic.py
+===================================================================
+--- pyuic/uic/pyuic.py.orig
++++ pyuic/uic/pyuic.py
+@@ -26,6 +26,8 @@ parser.add_option("-x", "--execute", des
+         help="generate extra code to test and display the class")
+ parser.add_option("-d", "--debug", dest="debug", action="store_true",
+         default=False, help="show debug output")
++parser.add_option("-g", "--use-gettext", dest="gettext_domain", action="store", type="str",
++        default='', help="use gettext for following domain")
+ parser.add_option("-i", "--indent", dest="indent", action="store", type="int",
+         default=4, metavar="N",
+         help="set indent width to N spaces, tab if N is 0 (default: 4)")
index f553a1bcf055a0937aafc97f7de576ca0dc1f30d..5171e48559ea9e714989ecaffef36e257a21421a 100644 (file)
@@ -4,8 +4,8 @@
 ###############################################################################
 
 name       = pyQt
-version    = 4.8.1
-release    = 1
+version    = 4.8.6
+release    = 2
 epoch      = 0
 
 groups     = Development/Languages
@@ -17,16 +17,17 @@ description
         Python bindings for Qt4
 end
 
-source_dl  =
+source_dl  = http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/
 sources    = PyQt-x11-gpl-%{version}.tar.gz
 
 build
        requires
                gcc-c++
+               libX11-devel
                libXext-devel
                python-devel
                qt-devel
-               sip-devel
+               sip-devel>=4.13
        end
 
        DIR_APP = %{DIR_SRC}/PyQt-x11-gpl-%{version}
@@ -55,10 +56,10 @@ packages
                        sip
                end
        end
-       
+
        package %{name}-devel
                template DEVEL
-       
+
                files
                        /usr/bin
                        /usr/lib/python*/site-packages/PyQt4/pyqtconfig*
@@ -66,4 +67,8 @@ packages
                        /usr/share/sip
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 03b674b4d602f04805ff7e9f128036a561abd91b..7aab8b63c1a2ffc3b31131959d589ad7d87e4648 100644 (file)
@@ -35,4 +35,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index ccdcc43e09681d9050a6b0e1972910408b395fc2..6938a5604e5abeceaa88694d3adf2f22896a34a8 100644 (file)
@@ -43,24 +43,28 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-codegen
                summary = The code generation program for PyGObject.
                description
                        This package contains the C code generation
                        program for PyGObject.
                end
-       
+
                files
                        /usr/bin/pygobject-codegen-2.0
                        /usr/share/pygobject/2.0/codegen
                end
        end
-       
+
        package %{name}-devel
                requires
                        glib2-devel
                        %{name}-codegen
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 48450d735c1cb74f9e36bcb7468373904536d01e..a9035a506bd6c08d27711c91db19e1fd60417714 100644 (file)
@@ -45,4 +45,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 3c316c862dbd798575da63c1195e5baae238622e..e1e90fcf7fa79cfb20f7f31cadf916e0cd349ac6 100644 (file)
@@ -32,11 +32,15 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                # The development headers need the cairo headers.
                requires
                        cairo-devel
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index e35d26c36e3d1074e28095ce17bba02efdc1ea02..e333fe71943ecc714a4809c4e4044f715e2f35fe 100644 (file)
@@ -36,4 +36,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 981faba6feba8668860ef78a97b2ddbeee987c73..0e2e8df6efe171cc57daeb228da3f806087b8669 100644 (file)
@@ -32,8 +32,12 @@ end
 
 packages
        package %{name}
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 5c0459b028a9fa6c1fa3519bdb59858d16fea51b..eff0beb81a9dc605ccbd586340da81bb40a6f78d 100644 (file)
@@ -5,10 +5,10 @@
 
 name       = python-gudev
 version    = 147.1
-release    = 1
+release    = 2
 
 groups     = Development/Tools
-url        = http://flex.sourceforge.net/
+url        = http://www.kernel.org/pub/linux/utils/kernel/hotplug/gudev/
 license    = LGPLv3+
 summary    = Python (PyGObject) bindings to the GUDev library.
 
@@ -32,7 +32,7 @@ build
 
        DIR_APP = %{DIR_SRC}/nzjrs-python-gudev-5fac65a
 
-       CFLAGS += -I$(wildcard /usr/include/pygtk*)
+       CFLAGS += -I/usr/include/pygtk-2.0
 
        prepare_cmds
                ./autogen.sh
@@ -45,4 +45,8 @@ packages
                        pygobject2
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index c5a90eb695383eccea77bcbc0d7c97997567edb2..1a6321775750459222cafec0c2dba25a69f85178 100644 (file)
@@ -39,4 +39,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index f8ca75859efa87f8b004a3998df45601159d42bb..8740400a9e51bdd2759b0fe2d83004d38e99f56e 100644 (file)
@@ -37,4 +37,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index a4d46d38f29cc58ee3b6332d9a334c91b0561422..24f9cbf88042521db4ef00a6333181fc30c09f98 100644 (file)
@@ -36,4 +36,8 @@ packages
                        python-decorator
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index d9a46b5833dcdbca01c64993ca18c36aaa415c45..366a6e365a9e0bee77a237d93b1d486cba1568ca 100644 (file)
@@ -20,7 +20,7 @@ end
 source_dl  =
 
 build
-       reqires
+       requires
                python-devel
        end
 
@@ -41,4 +41,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index f435b72637c29c06c7654640f4cd7dd18014c87d..db3422cb631eca8ee3388fb55b5b8ef0e1c781ab 100644 (file)
@@ -36,4 +36,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 109122c7a7baa1cf0a9584f787e0fc4003a13672..8f191725d7251a634be1e4c91c778baee414194b 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = pyblock
 version    = 0.46
-release    = 1
+release    = 2
 
 groups     = System/Libraries
 url        = http://git.fedorahosted.org/git/?p=pyblock.git;a=summary
@@ -21,7 +21,7 @@ sources    = %{thisapp}.tar.bz2
 
 build
        requires
-               dmraid-devel
+               dmraid-devel>=1.0.0.rc15-2
                libdevmapper-devel
                libselinux-devel
                python-devel
@@ -42,5 +42,9 @@ build
 end
 
 packages
-       package %{name}
+       package python-%{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 9d8c942e1b39e0db5def5a0feae46b23e64f5848..b1e600eae802cbd3902a126f43c10edcfa942b70 100644 (file)
@@ -56,4 +56,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index bd8c2a3ac5fe05c70780e763f86ac90d4cb1eeca..5c314ff96711cc38a23e1b80523e9dec0bd0a599 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = python-qtermwidget
 version    = 0.1.2
-release    = 1
+release    = 2
 
 groups     = Development/Languages
 url        = http://code.google.com/p/pyqt4-extrawidgets/downloads/list
@@ -22,6 +22,8 @@ sources    = qtermwidget-%{version}.tar.gz
 build
        requires
                gcc-c++
+               libX11-devel
+               libXext-devel
                pyQt
                pyQt-devel
                python-devel
@@ -40,4 +42,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 4c52dee2848198f5250f08654969f21a407588f9..a7cbc7682b5280d375df12ddaca9598a6b4791a9 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = python-urlgrabber
 version    = 3.9.1
-release    = 2
+release    = 3
 arch       = noarch
-thisap     = urlgrabber-%{version}
+thisapp    = urlgrabber-%{version}
 
 groups     = System/Libraries
 url        = http://urlgrabber.baseurl.org/
index dd4ea61bfb7ab415072a53d486d1094ced1ca22d..34582210e6f2ebcb7a3ed227b5b72f13944b8649 100644 (file)
@@ -4,7 +4,8 @@
 ###############################################################################
 
 name       = python
-version    = 2.7.1
+major_ver  = 2.7
+version    = %{major_ver}.2
 release    = 3
 thisapp    = Python-%{version}
 
@@ -21,8 +22,8 @@ description
        libraries, as well as to various windowing systems.
 end
 
-source_dl  =
-sources    = %{thisapp}.tgz
+source_dl  = http://python.org/ftp/python/%{version}/
+sources    = %{thisapp}.tar.xz
 
 build
        requires
@@ -44,7 +45,6 @@ build
        end
 
        export CFLAGS  += -D_GNU_SOURCE -fwrapv
-       export CPPFLAGS = $(shell pkg-config --cflags-only-I libffi)
 
        prepare_cmds
                sed -e "s/#*shared*/*shared*/g" -i Modules/Setup.dist
@@ -59,10 +59,13 @@ build
        end
 
        build
+               export CPPFLAGS=$(pkg-config --cflags-only-I libffi)
+
                OPT="%{CFLAGS}" \
                        ./configure \
                                --prefix=/usr \
                                --enable-ipv6 \
+                               --enable-unicode=ucs4 \
                                --with-system-expat \
                                --with-system-ffi \
                                --enable-shared
@@ -73,18 +76,24 @@ build
        install_cmds
                # All *.py files don't need to be executeable...
                find %{BUILDROOT}/usr/lib/python*/ -name "*.py" | xargs chmod a-x -v
+
+               # Create symlink for shared lib.
+               ln -svf ../../libpython%{major_ver}.so %{BUILDROOT}/usr/lib/python%{major_ver}/config/
        end
 end
 
 packages
        package %{name}
-       end
-       
+
        package %{name}-devel
                template DEVEL
-       
-               files =+ \
+
+               files += \
                        !/usr/lib/python*/config/Makefile \
                        !/usr/include/python*/pyconfig.h
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 8b323b86fed4de8ab8507b6e841433cf3a446787..9345fa6bf77095cceba9f43c499bdbfc58ed868f 100644 (file)
@@ -37,4 +37,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 8bce0436b11cc58a877fff291025eeb9713011a9..3499c4dee4df578f42940874813cbd55d6b56f98 100644 (file)
@@ -54,4 +54,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index be9f07f3134a3a12cef3bd2c22d690050931959e..b9a952fc75d7a96ec8f97bd339ec28868668f365 100644 (file)
--- a/qt/qt.nm
+++ b/qt/qt.nm
@@ -117,10 +117,10 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
-       
+
                files
                        /usr/lib/*.prl \
                        /usr/lib/qt4/q3porting.xml \
@@ -129,4 +129,8 @@ packages
                        /usr/lib/qt4/mkspecs
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 05a14b32d6cc1397de9a662eec54145f6b5e8c5f..e5cf76a6203ff3f9f7fd3d60b5e2c21babdffc39 100644 (file)
@@ -53,8 +53,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 459fc4410962da5a88f09f1f3557a4964df7457b..57dfbeb0824c31f8ed896f6fa3c8b08ada58d4f5 100644 (file)
@@ -49,4 +49,8 @@ packages
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 32a912c11df39ff3ed4cde290b977cad1e8d5ca1..7c170ed45530e4eeade7b1dbf250ca3e50230a4e 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = radvd
-version    = 1.8
+version    = 1.8.3
 release    = 4
 
 groups     = System/Daemons
@@ -28,6 +28,7 @@ build
                flex
                flex-devel
                bison
+               shadow-utils
        end
 
        configure_options += \
@@ -35,12 +36,61 @@ build
                --with-pidfile=/run/radvd/radvd.pid
 
        prepare_cmds
+               %{create_user}
+
                sed -e "s/-lfl/-lfl_pic/g" -i Makefile.*
        end
+
+       install_cmds
+               mkdir -pv -m 750 %{BUILDROOT}/run/radvd
+               chown -v radvd.radvd %{BUILDROOT}/run/radvd
+       end
+end
+
+create_user
+       getent group radvd >/dev/null || groupadd -r radvd
+
+       # The radvd user also needs to be in the wheel group to get access to
+       # /proc.
+       getent passwd radvd >/dev/null || \
+               useradd -r -g radvd -G wheel -d / -s /sbin/nologin \
+                       -c "User for the Router Advertisement daemon." radvd
 end
 
 packages
        package %{name}
-               reuires = /lib/network/network-radvd-config
+               requires = /lib/network/network-radvd-config
+
+               prerequires += shadow-utils
+
+               script prein
+                       %{create_user}
+               end
+
+               # Just search for new unit files that were just installed.
+               script postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               # Disable the service that is to be removed and stop it if it is still running.
+               script preun
+                       /bin/systemctl --no-reload disable radvd.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop radvd.service >/dev/null 2>&1 || :
+               end
+
+               # Just tell systemd that unitfiles have been removed.
+               script postun
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               # Try to restart the service if it is running.
+               script postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl try-restart radvd.service >/dev/null 2>&1 || :
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 8bab2324d14ed80a9f0c87db3a4fcb13a8dc0fe8..c2a3047174541d7953a7111fadaab20a9f9faad1 100644 (file)
@@ -1,2 +1,2 @@
-d /var/run/radvd 0750 radvd radvd -
+d /run/radvd 0750 radvd radvd -
 
index 25cff9994957b4567b11ad9f428274174f6ac743..48a6cecd18608031c06feb53891a7267b8b0180b 100644 (file)
@@ -6,8 +6,8 @@ After=network.target
 [Service]
 ExecStartPre=/lib/network/network-radvd-config start
 ExecStart=/usr/sbin/radvd -C /etc/radvd.conf -u radvd
-ExecStopPre=/lib/network/network-radvd-config stop
 ExecReload=/bin/kill -HUP $MAINPID
+ExecStopPost=/lib/network/network-radvd-config stop
 Type=forking
 PIDFile=/run/radvd/radvd.pid
 Restart=on-failure
index 1d9095d86fa3de77004048631d0497137c234f60..0c57490c2d8e84b2f4e8d896427adeba04bdecdc 100644 (file)
@@ -55,4 +55,8 @@ packages
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 02c89689c39cf20cc113ceaaaa537ef83b608f0d..12b3d6a42e59a4aae64b37a0bffa33958a32147b 100644 (file)
@@ -58,8 +58,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 7130e20fba895b0c727865f43ab29771a705c686..bd3bee0f7ff3c5847a45991cd0a07d6885a471c6 100644 (file)
@@ -33,4 +33,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 3384a59b5370e84d82724502fb21350777751310..cbfb3d44c8efba99c6e1343bea6cdab0bef97597 100644 (file)
@@ -61,12 +61,16 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-libs
                template LIBS
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/rstp/bridge-stp b/rstp/bridge-stp
deleted file mode 100644 (file)
index 947c12b..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-###############################################################################
-#                                                                             #
-# IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007, 2008, 2009 Michael Tremer & Christian Schmidt           #
-#                                                                             #
-# This program is free software: you can redistribute it and/or modify        #
-# it under the terms of the GNU General Public License as published by        #
-# the Free Software Foundation, either version 3 of the License, or           #
-# (at your option) any later version.                                         #
-#                                                                             #
-# This program is distributed in the hope that it will be useful,             #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
-# GNU General Public License for more details.                                #
-#                                                                             #
-# You should have received a copy of the GNU General Public License           #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
-#                                                                             #
-###############################################################################
-#
-# This script always returns 0 to prevent the kernel
-# starting its own stp implementation.
-
-exit 0
diff --git a/rstp/patches/rstp-0.21-dump-commands.patch b/rstp/patches/rstp-0.21-dump-commands.patch
deleted file mode 100644 (file)
index cc48819..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-diff --git a/ctl_main.c b/ctl_main.c
-index dd041d7..7382d97 100644
---- a/ctl_main.c
-+++ b/ctl_main.c
-@@ -443,6 +443,240 @@ static int cmd_debuglevel(int argc, char *const *argv)
-       return CTL_set_debug_level(getuint(argv[1]));
- }
-+#define DUMP_FMT(br_name, key) "%-8s %-26s ", br_name, key
-+
-+static int do_dumpbridge(const char *br_name) {
-+      STP_BridgeStatus s;
-+
-+      int br_index = get_index_die(br_name, "bridge", 0);
-+      if (br_index < 0)
-+              return -1;
-+
-+      int r = CTL_get_bridge_status(br_index, &s);
-+      if (r)
-+              return -1;
-+
-+      /* bridge forward delay */
-+      printf(DUMP_FMT(br_name, "bridge_forward_delay"));
-+      printf("%u\n", s.bridge_forward_delay);
-+
-+      /* bridge hello time */
-+      printf(DUMP_FMT(br_name, "bridge_hello_time"));
-+      printf("%u\n", s.bridge_hello_time);
-+
-+      /* bridge max age */
-+      printf(DUMP_FMT(br_name, "bridge_max_age"));
-+      printf("%u\n", s.bridge_max_age);
-+
-+      /* designated root */
-+      printf(DUMP_FMT(br_name, "designated_root"));
-+      printf(BR_ID_FMT "\n", BR_ID_ARGS(s.designated_root));
-+
-+      /* enabled */
-+      printf(DUMP_FMT(br_name, "enabled"));
-+      printf("%s\n", BOOL_STR(s.enabled));
-+
-+      /* forward delay */
-+      printf(DUMP_FMT(br_name, "forward_delay"));
-+      printf("%u\n", s.forward_delay);
-+
-+      /* hello time */
-+      printf(DUMP_FMT(br_name, "hello_time"));
-+      printf("%u\n", s.hello_time);
-+
-+      /* id */
-+      printf(DUMP_FMT(br_name, "id"));
-+      printf(BR_ID_FMT "\n", BR_ID_ARGS(s.bridge_id));
-+
-+      /* max age */
-+      printf(DUMP_FMT(br_name, "max_age"));
-+      printf("%u\n", s.max_age);
-+
-+      /* protocol version */
-+      printf(DUMP_FMT(br_name, "protocol_version"));
-+      printf("%d\n", s.protocol_version);
-+
-+      /* root path cost */
-+      printf(DUMP_FMT(br_name, "root_path_cost"));
-+      printf("%u\n", s.root_path_cost);
-+
-+      /* root port */
-+      printf(DUMP_FMT(br_name, "root_port"));
-+      printf("%u\n", s.root_port);
-+
-+      /* time since topology change */
-+      printf(DUMP_FMT(br_name, "time_since_topology_change"));
-+      printf("%u\n", s.time_since_topology_change);
-+
-+      /* topology change */
-+      printf(DUMP_FMT(br_name, "topology_change"));
-+      printf("%u\n", s.topology_change);
-+
-+      /* topology change count */
-+      printf(DUMP_FMT(br_name, "topology_change_count"));
-+      printf("%u\n", s.topology_change_count);
-+
-+      /* tx hold count */
-+      printf(DUMP_FMT(br_name, "tx_hold_count"));
-+      printf("%u\n", s.tx_hold_count);
-+
-+      return 0;
-+}
-+
-+static int do_dumpbridgeport(int br_index, const char *pt_name) {
-+      STP_PortStatus p;
-+      int r = 0;
-+      int port_index = get_index_die(pt_name, "port", 0);
-+      if (port_index < 0)
-+              return -1;
-+
-+      r = CTL_get_port_status(br_index, port_index, &p);
-+      if (r) {
-+              fprintf(stderr, "Failed to get port state for port %d\n", port_index);
-+              return -1;
-+      }
-+
-+      /* admin edge port */
-+      printf(DUMP_FMT(pt_name, "admin_edge_port"));
-+      printf("%s\n", BOOL_STR(p.admin_edge_port));
-+
-+      /* admin point to point */
-+      printf(DUMP_FMT(pt_name, "admin_point_to_point"));
-+      printf("%s\n", BOOL_STR(p.admin_p2p));
-+
-+      /* auto edge port */
-+      printf(DUMP_FMT(pt_name, "auto_edge_port"));
-+      printf("%s\n", BOOL_STR(p.auto_edge_port));
-+
-+      /* path cost */
-+      printf(DUMP_FMT(pt_name, "admin_path_cost"));
-+      printf("%d\n", p.admin_path_cost);
-+
-+      /* designated bridge */
-+      printf(DUMP_FMT(pt_name, "designated_bridge"));
-+      printf(BR_ID_FMT "\n", BR_ID_ARGS(p.designated_bridge));
-+
-+      /* designated cost */
-+      printf(DUMP_FMT(pt_name, "designated_cost"));
-+      printf("%d\n", p.designated_cost);
-+
-+      /* designated port */
-+      printf(DUMP_FMT(pt_name, "designated_port"));
-+      printf("%0x\n", p.designated_port);
-+
-+      /* designated root */
-+      printf(DUMP_FMT(pt_name, "designated_root"));
-+      printf(BR_ID_FMT "\n", BR_ID_ARGS(p.designated_root));
-+
-+      /* enabled */
-+      printf(DUMP_FMT(pt_name, "enabled"));
-+      printf("%s\n", BOOL_STR(p.enabled));
-+
-+      /* id */
-+      printf(DUMP_FMT(pt_name, "id"));
-+      printf("%u\n", p.id & 0xfff);
-+
-+      /* oper edge port */
-+      printf(DUMP_FMT(pt_name, "oper_edge_port"));
-+      printf("%s\n", BOOL_STR(p.oper_edge_port));
-+
-+      /* path cost */
-+      printf(DUMP_FMT(pt_name, "path_cost"));
-+      printf("%d\n", p.path_cost);
-+
-+      /* point to point */
-+      printf(DUMP_FMT(pt_name, "point_to_point"));
-+      printf("%s\n", BOOL_STR(p.oper_p2p));
-+
-+      /* state */
-+      printf(DUMP_FMT(pt_name, "state"));
-+      printf(STATE_STR(p.state));
-+      printf("\n");
-+
-+      /* topology change ack */
-+      printf(DUMP_FMT(pt_name, "topology_change_ack"));
-+      printf("%s\n", BOOL_STR(p.tc_ack));
-+
-+      return 0;
-+}
-+
-+static int cmd_dumpbridge(int argc, char *const *argv)
-+{
-+      int i, count = 0;
-+      int r = 0;
-+      struct dirent **namelist;
-+
-+      if (argc > 1) {
-+              count = argc - 1;
-+      } else {
-+              count =
-+                  scandir(SYSFS_CLASS_NET, &namelist, isbridge, alphasort);
-+              if (count < 0) {
-+                      fprintf(stderr, "Error getting list of all bridges\n");
-+                      return -1;
-+              }
-+      }
-+
-+      for (i = 0; i < count; i++) {
-+              const char *name;
-+              if (argc > 1)
-+                      name = argv[i + 1];
-+              else
-+                      name = namelist[i]->d_name;
-+
-+              int err = do_dumpbridge(name);
-+              if (err)
-+                      r = err;
-+      }
-+
-+      if (argc <= 1) {
-+              for (i = 0; i < count; i++)
-+                      free(namelist[i]);
-+              free(namelist);
-+      }
-+
-+      return r;
-+}
-+
-+static int cmd_dumpbridgeports(int argc, char *const *argv)
-+{
-+      int r = 0;
-+
-+      int br_index = get_index(argv[1], "bridge");
-+
-+      int i, count = 0;
-+      struct dirent **namelist;
-+
-+      if (argc > 2) {
-+              count = argc - 2;
-+      } else {
-+              char buf[SYSFS_PATH_MAX];
-+              snprintf(buf, sizeof(buf), SYSFS_CLASS_NET "/%s/brif", argv[1]);
-+              count = scandir(buf, &namelist, not_dot_dotdot, alphasort);
-+              if (count < 0) {
-+                      fprintf(stderr,
-+                              "Error getting list of all ports of bridge %s\n",
-+                              argv[1]);
-+                      return -1;
-+              }
-+      }
-+
-+      for (i = 0; i < count; i++) {
-+              const char *name;
-+              name = namelist[i]->d_name;
-+
-+              int err = do_dumpbridgeport(br_index, name);
-+              if (err)
-+                      r = err;
-+      }
-+
-+      for (i = 0; i < count; i++)
-+              free(namelist[i]);
-+      free(namelist);
-+
-+      return r;
-+}
-+
- struct command {
-       int nargs;
-       int optargs;
-@@ -483,6 +717,10 @@ static const struct command commands[] = {
-       {2, 0, "portmcheck", cmd_portmcheck,
-        "<bridge> <port>\ttry to get back from STP to RSTP mode"},
-       {1, 0, "debuglevel", cmd_debuglevel, "<level>\t\tLevel of verbosity"},
-+      {0, 32, "dumpbridge", cmd_dumpbridge,
-+       "Dump all information about a bridge in machine parseable format"},
-+      {1, 0, "dumpports", cmd_dumpbridgeports,
-+       "Dump all port information in machine parseable format"},
- };
- const struct command *command_lookup(const char *cmd)
-diff --git a/rstpctl.8 b/rstpctl.8
-index ca72eaf..f827c85 100644
---- a/rstpctl.8
-+++ b/rstpctl.8
-@@ -115,6 +115,13 @@ switch back to RSTP mode.
- .B rstpctl debuglevel <level>
- sets the level of verbosity of rstpd's logging.
-+.B rstpctl dumpbridge [<bridge> ...]
-+dumps all informational parameters to the console. This is needed to
-+parse the output in shell scripts for example.
-+
-+.B rstpctl dumpports <bridge> [<port> ...]
-+like dumpbridge but prints information about the ports of a bridge.
-+
- .SH NOTES
- TODO: Indicate lack of persistence of configuration across restarts of
- daemon.
diff --git a/rstp/patches/rstp-0.21-upstream-fixes.patch b/rstp/patches/rstp-0.21-upstream-fixes.patch
deleted file mode 100644 (file)
index c209e99..0000000
+++ /dev/null
@@ -1,784 +0,0 @@
-diff --git a/Makefile b/Makefile
-index c65dd39..f672a45 100644
---- a/Makefile
-+++ b/Makefile
-@@ -9,7 +9,8 @@ CTLSOURCES = ctl_main.c ctl_cli_wrap.c ctl_socket_client.c
- CTLOBJECTS = $(CTLSOURCES:.c=.o)
- CC=gcc
--CFLAGS = -Wall -Werror -O2 -g -D_REENTRANT -D__LINUX__ -DVERSION=$(version) -DBUILD=$(build) -I. -I./include
-+CFLAGS = -Wall -Werror -fno-strict-aliasing -O2 -g -D_REENTRANT -D__LINUX__ \
-+      -DVERSION=$(version) -DBUILD=$(build) -I. -I./include -I./rstplib
- all: rstpd rstpctl
-diff --git a/bridge-stp b/bridge-stp
-index 49d5a41..5e663a9 100755
---- a/bridge-stp
-+++ b/bridge-stp
-@@ -53,9 +53,9 @@ start() {
- case $2 in
-      start) 
-       daemon
--      exec /sbin/rstpctl $bridge on ;;
-+      exec /sbin/rstpctl rstp $bridge on ;;
-      stop)  
--      exec /sbin/rstpctl $bridge off ;;
-+      exec /sbin/rstpctl rstp $bridge off ;;
-      *)
-       echo "Unknown action:" $2
-       echo "Usage: bridge-stp <bridge> {start|stop}"
-diff --git a/bridge_track.c b/bridge_track.c
-index c685935..f5efa3f 100644
---- a/bridge_track.c
-+++ b/bridge_track.c
-@@ -449,7 +449,7 @@ void bridge_bpdu_rcv(int if_index, const unsigned char *data, int len)
-       struct ifdata *ifc = find_if(if_index);
-       LOG("ifindex %d, len %d", if_index, len);
--      if (!ifc)
-+      if (!ifc || !ifc->master)
-               return;
-       TST(ifc->up,);
-diff --git a/brmon.c b/brmon.c
-index d29e7f5..fd4dacd 100644
---- a/brmon.c
-+++ b/brmon.c
-@@ -30,32 +30,10 @@
- static const char SNAPSHOT[] = "v0.1";
--
--/* RFC 2863 operational status */
--enum {
--      IF_OPER_UNKNOWN,
--      IF_OPER_NOTPRESENT,
--      IF_OPER_DOWN,
--      IF_OPER_LOWERLAYERDOWN,
--      IF_OPER_TESTING,
--      IF_OPER_DORMANT,
--      IF_OPER_UP,
--};
--
--/* link modes */
--enum {
--      IF_LINK_MODE_DEFAULT,
--      IF_LINK_MODE_DORMANT,   /* limit upward transition to dormant */
--};
--
--static const char *port_states[] = {
--      [BR_STATE_DISABLED] = "disabled",
--      [BR_STATE_LISTENING] = "listening",
--      [BR_STATE_LEARNING] = "learning",
--      [BR_STATE_FORWARDING] = "forwarding",
--      [BR_STATE_BLOCKING] = "blocking",
--};
--
-+static int is_up(const struct ifinfomsg *ifi)
-+{
-+      return (ifi->ifi_flags & IFF_UP) && (ifi->ifi_flags & IFF_RUNNING);
-+}
- static int dump_msg(const struct sockaddr_nl *who, struct nlmsghdr *n,
-                   void *arg)
-@@ -64,25 +42,16 @@ static int dump_msg(const struct sockaddr_nl *who, struct nlmsghdr *n,
-       struct ifinfomsg *ifi = NLMSG_DATA(n);
-       struct rtattr * tb[IFLA_MAX+1];
-       int len = n->nlmsg_len;
-+      int master = -1;
-       char b1[IFNAMSIZ];
--      int af_family = ifi->ifi_family;
-         if (n->nlmsg_type == NLMSG_DONE)
-           return 0;
--        
-+
-       len -= NLMSG_LENGTH(sizeof(*ifi));
--      if (len < 0) {
-+      if (len < 0)
-           return -1;
--        }
--        
--#if 0
--
--      if (filter.ifindex && ifi->ifi_index != filter.ifindex)
--              return 0;
--      if (filter.up && !(ifi->ifi_flags&IFF_UP))
--              return 0;
--#endif
-         if (ifi->ifi_family != AF_BRIDGE && ifi->ifi_family != AF_UNSPEC)
-           return 0;
-@@ -93,73 +62,41 @@ static int dump_msg(const struct sockaddr_nl *who, struct nlmsghdr *n,
-       parse_rtattr(tb, IFLA_MAX, IFLA_RTA(ifi), len);
-         /* Check if we got this from bonding */
--        if (tb[IFLA_MASTER] && af_family != AF_BRIDGE)
--          return 0;
-+        if (tb[IFLA_MASTER] && ifi->ifi_family != AF_BRIDGE)
-+           return 0;
-+
-+      /* Check if hearing our own state changes */
-+      if (n->nlmsg_type == RTM_NEWLINK && tb[IFLA_PROTINFO]) {
-+         uint8_t state = *(uint8_t *)RTA_DATA(tb[IFLA_PROTINFO]);
-+
-+         if (state != BR_STATE_DISABLED)
-+            return 0;
-+      }
-       if (tb[IFLA_IFNAME] == NULL) {
--              fprintf(stderr, "BUG: nil ifname\n");
--              return -1;
-+         fprintf(stderr, "BUG: nil ifname\n");
-+         return -1;
-       }
-       if (n->nlmsg_type == RTM_DELLINK)
--              fprintf(fp, "Deleted ");
-+         fprintf(fp, "Deleted ");
-       fprintf(fp, "%d: %s ", ifi->ifi_index,
--              tb[IFLA_IFNAME] ? (char*)RTA_DATA(tb[IFLA_IFNAME]) : "<nil>");
--
--
--      if (tb[IFLA_OPERSTATE]) {
--              int state = *(int*)RTA_DATA(tb[IFLA_OPERSTATE]);
--              switch (state) {
--              case IF_OPER_UNKNOWN: 
--                      fprintf(fp, "Unknown "); break;
--              case IF_OPER_NOTPRESENT:
--                      fprintf(fp, "Not Present "); break;
--              case IF_OPER_DOWN:
--                      fprintf(fp, "Down "); break;
--              case IF_OPER_LOWERLAYERDOWN:
--                      fprintf(fp, "Lowerlayerdown "); break;
--              case IF_OPER_TESTING:
--                      fprintf(fp, "Testing "); break;
--              case IF_OPER_DORMANT:
--                      fprintf(fp, "Dormant "); break;
--              case IF_OPER_UP:
--                      fprintf(fp, "Up "); break;
--              default:
--                      fprintf(fp, "State(%d) ", state);
--              }
--      }
--      
--      if (tb[IFLA_MTU])
--              fprintf(fp, "mtu %u ", *(int*)RTA_DATA(tb[IFLA_MTU]));
-+              (const char*)RTA_DATA(tb[IFLA_IFNAME]));
-       if (tb[IFLA_MASTER]) {
--              fprintf(fp, "master %s ", 
--                      if_indextoname(*(int*)RTA_DATA(tb[IFLA_MASTER]), b1));
--      }
--
--      if (tb[IFLA_PROTINFO]) {
--              uint8_t state = *(uint8_t *)RTA_DATA(tb[IFLA_PROTINFO]);
--              if (state <= BR_STATE_BLOCKING)
--                      fprintf(fp, "state %s", port_states[state]);
--              else
--                      fprintf(fp, "state (%d)", state);
-+         master = *(int*)RTA_DATA(tb[IFLA_MASTER]);
-+         fprintf(fp, "master %s ", if_indextoname(master, b1));
-       }
--
-       fprintf(fp, "\n");
-       fflush(fp);
--        {
--          int newlink = (n->nlmsg_type == RTM_NEWLINK);
--          int up = 0;
--          if (newlink && tb[IFLA_OPERSTATE]) {
--            int state = *(int*)RTA_DATA(tb[IFLA_OPERSTATE]);
--            up = (state == IF_OPER_UP) || (state == IF_OPER_UNKNOWN);
--          }
--
--          bridge_notify((tb[IFLA_MASTER]?*(int*)RTA_DATA(tb[IFLA_MASTER]):-1), 
--                        ifi->ifi_index, newlink, up);
--        }
-+
-+
-+      bridge_notify(master, ifi->ifi_index,
-+                    (n->nlmsg_type == RTM_NEWLINK),
-+                    is_up(ifi));
-+
-       return 0;
- }
-@@ -252,7 +189,7 @@ int init_bridge_ops(void)
-     fprintf(stderr, "Couldn't open rtnl socket for monitoring\n");
-     return -1;
-   }
--  
-+
-   if (rtnl_open(&rth_state, 0) < 0) {
-     fprintf(stderr, "Couldn't open rtnl socket for setting state\n");
-     return -1;
-@@ -262,7 +199,7 @@ int init_bridge_ops(void)
-     fprintf(stderr, "Cannot send dump request: %m\n");
-     return -1;
-   }
--  
-+
-   if (rtnl_dump_filter(&rth, dump_msg, stdout, NULL, NULL) < 0) {
-     fprintf(stderr, "Dump terminated\n");
-     return -1;
-@@ -276,10 +213,10 @@ int init_bridge_ops(void)
-   br_handler.fd = rth.fd;
-   br_handler.arg = NULL;
-   br_handler.handler = br_ev_handler;
--  
-+
-   if (add_epoll(&br_handler) < 0)
-     return -1;
--  
-+
-   return 0;
- }
-diff --git a/include/linux/llc.h b/include/linux/llc.h
-index 09f2e6d..6bb32fe 100644
---- a/include/linux/llc.h
-+++ b/include/linux/llc.h
-@@ -49,9 +49,9 @@ enum llc_sockopts {
- /* LLC SAP types. */
- #define LLC_SAP_NULL  0x00            /* NULL SAP.                    */
--#define LLC_SAP_LLC   0x02            /* LLC Sublayer Managment.      */
-+#define LLC_SAP_LLC   0x02            /* LLC Sublayer Management.     */
- #define LLC_SAP_SNA   0x04            /* SNA Path Control.            */
--#define LLC_SAP_PNM   0x0E            /* Proway Network Managment.    */      
-+#define LLC_SAP_PNM   0x0E            /* Proway Network Management.   */      
- #define LLC_SAP_IP    0x06            /* TCP/IP.                      */
- #define LLC_SAP_BSPAN 0x42            /* Bridge Spanning Tree Proto   */
- #define LLC_SAP_MMS   0x4E            /* Manufacturing Message Srv.   */
-@@ -70,11 +70,4 @@ enum llc_sockopts {
- #define LLC_SAP_RM    0xD4            /* Resource Management          */
- #define LLC_SAP_GLOBAL        0xFF            /* Global SAP.                  */
--#ifdef __KERNEL__
--#define LLC_SAP_DYN_START     0xC0
--#define LLC_SAP_DYN_STOP      0xDE
--#define LLC_SAP_DYN_TRIES     4
--
--#define llc_ui_skb_cb(__skb) ((struct sockaddr_llc *)&((__skb)->cb[0]))
--#endif /* __KERNEL__ */
- #endif /* __LINUX_LLC_H */
-diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
-index 5e33a20..ba9e46c 100644
---- a/include/linux/rtnetlink.h
-+++ b/include/linux/rtnetlink.h
-@@ -1,7 +1,11 @@
- #ifndef __LINUX_RTNETLINK_H
- #define __LINUX_RTNETLINK_H
-+#include <linux/types.h>
- #include <linux/netlink.h>
-+#include <linux/if_link.h>
-+#include <linux/if_addr.h>
-+#include <linux/neighbour.h>
- /****
-  *            Routing/neighbour discovery messages.
-@@ -80,8 +84,6 @@ enum {
-       RTM_NEWPREFIX   = 52,
- #define RTM_NEWPREFIX RTM_NEWPREFIX
--      RTM_GETPREFIX   = 54,
--#define RTM_GETPREFIX RTM_GETPREFIX
-       RTM_GETMULTICAST = 58,
- #define RTM_GETMULTICAST RTM_GETMULTICAST
-@@ -96,6 +98,21 @@ enum {
-       RTM_SETNEIGHTBL,
- #define RTM_SETNEIGHTBL       RTM_SETNEIGHTBL
-+      RTM_NEWNDUSEROPT = 68,
-+#define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT
-+
-+      RTM_NEWADDRLABEL = 72,
-+#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL
-+      RTM_DELADDRLABEL,
-+#define RTM_NEWADDRLABEL RTM_NEWADDRLABEL
-+      RTM_GETADDRLABEL,
-+#define RTM_GETADDRLABEL RTM_GETADDRLABEL
-+
-+      RTM_GETDCB = 78,
-+#define RTM_GETDCB RTM_GETDCB
-+      RTM_SETDCB,
-+#define RTM_SETDCB RTM_SETDCB
-+
-       __RTM_MAX,
- #define RTM_MAX               (((__RTM_MAX + 3) & ~3) - 1)
- };
-@@ -235,13 +252,12 @@ enum rt_class_t
- {
-       RT_TABLE_UNSPEC=0,
- /* User defined values */
-+      RT_TABLE_COMPAT=252,
-       RT_TABLE_DEFAULT=253,
-       RT_TABLE_MAIN=254,
-       RT_TABLE_LOCAL=255,
--      __RT_TABLE_MAX
-+      RT_TABLE_MAX=0xFFFFFFFF
- };
--#define RT_TABLE_MAX (__RT_TABLE_MAX - 1)
--
- /* Routing message attributes */
-@@ -258,11 +274,12 @@ enum rtattr_type_t
-       RTA_PREFSRC,
-       RTA_METRICS,
-       RTA_MULTIPATH,
--      RTA_PROTOINFO,
-+      RTA_PROTOINFO, /* no longer used */
-       RTA_FLOW,
-       RTA_CACHEINFO,
--      RTA_SESSION,
--      RTA_MP_ALGO,
-+      RTA_SESSION, /* no longer used */
-+      RTA_MP_ALGO, /* no longer used */
-+      RTA_TABLE,
-       __RTA_MAX
- };
-@@ -351,6 +368,8 @@ enum
- #define RTAX_INITCWND RTAX_INITCWND
-       RTAX_FEATURES,
- #define RTAX_FEATURES RTAX_FEATURES
-+      RTAX_RTO_MIN,
-+#define RTAX_RTO_MIN RTAX_RTO_MIN
-       __RTAX_MAX
- };
-@@ -383,226 +402,6 @@ struct rta_session
-       } u;
- };
--
--/*********************************************************
-- *            Interface address.
-- ****/
--
--struct ifaddrmsg
--{
--      unsigned char   ifa_family;
--      unsigned char   ifa_prefixlen;  /* The prefix length            */
--      unsigned char   ifa_flags;      /* Flags                        */
--      unsigned char   ifa_scope;      /* See above                    */
--      int             ifa_index;      /* Link index                   */
--};
--
--enum
--{
--      IFA_UNSPEC,
--      IFA_ADDRESS,
--      IFA_LOCAL,
--      IFA_LABEL,
--      IFA_BROADCAST,
--      IFA_ANYCAST,
--      IFA_CACHEINFO,
--      IFA_MULTICAST,
--      __IFA_MAX
--};
--
--#define IFA_MAX (__IFA_MAX - 1)
--
--/* ifa_flags */
--
--#define IFA_F_SECONDARY               0x01
--#define IFA_F_TEMPORARY               IFA_F_SECONDARY
--
--#define IFA_F_DEPRECATED      0x20
--#define IFA_F_TENTATIVE               0x40
--#define IFA_F_PERMANENT               0x80
--
--struct ifa_cacheinfo
--{
--      __u32   ifa_prefered;
--      __u32   ifa_valid;
--      __u32   cstamp; /* created timestamp, hundredths of seconds */
--      __u32   tstamp; /* updated timestamp, hundredths of seconds */
--};
--
--
--#define IFA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
--#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
--
--/*
--   Important comment:
--   IFA_ADDRESS is prefix address, rather than local interface address.
--   It makes no difference for normally configured broadcast interfaces,
--   but for point-to-point IFA_ADDRESS is DESTINATION address,
--   local address is supplied in IFA_LOCAL attribute.
-- */
--
--/**************************************************************
-- *            Neighbour discovery.
-- ****/
--
--struct ndmsg
--{
--      unsigned char   ndm_family;
--      unsigned char   ndm_pad1;
--      unsigned short  ndm_pad2;
--      int             ndm_ifindex;    /* Link index                   */
--      __u16           ndm_state;
--      __u8            ndm_flags;
--      __u8            ndm_type;
--};
--
--enum
--{
--      NDA_UNSPEC,
--      NDA_DST,
--      NDA_LLADDR,
--      NDA_CACHEINFO,
--      NDA_PROBES,
--      __NDA_MAX
--};
--
--#define NDA_MAX (__NDA_MAX - 1)
--
--#define NDA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg))))
--#define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg))
--
--/*
-- *    Neighbor Cache Entry Flags
-- */
--
--#define NTF_PROXY     0x08    /* == ATF_PUBL */
--#define NTF_ROUTER    0x80
--
--/*
-- *    Neighbor Cache Entry States.
-- */
--
--#define NUD_INCOMPLETE        0x01
--#define NUD_REACHABLE 0x02
--#define NUD_STALE     0x04
--#define NUD_DELAY     0x08
--#define NUD_PROBE     0x10
--#define NUD_FAILED    0x20
--
--/* Dummy states */
--#define NUD_NOARP     0x40
--#define NUD_PERMANENT 0x80
--#define NUD_NONE      0x00
--
--
--struct nda_cacheinfo
--{
--      __u32           ndm_confirmed;
--      __u32           ndm_used;
--      __u32           ndm_updated;
--      __u32           ndm_refcnt;
--};
--
--
--/*****************************************************************
-- *            Neighbour tables specific messages.
-- *
-- * To retrieve the neighbour tables send RTM_GETNEIGHTBL with the
-- * NLM_F_DUMP flag set. Every neighbour table configuration is
-- * spread over multiple messages to avoid running into message
-- * size limits on systems with many interfaces. The first message
-- * in the sequence transports all not device specific data such as
-- * statistics, configuration, and the default parameter set.
-- * This message is followed by 0..n messages carrying device
-- * specific parameter sets.
-- * Although the ordering should be sufficient, NDTA_NAME can be
-- * used to identify sequences. The initial message can be identified
-- * by checking for NDTA_CONFIG. The device specific messages do
-- * not contain this TLV but have NDTPA_IFINDEX set to the
-- * corresponding interface index.
-- *
-- * To change neighbour table attributes, send RTM_SETNEIGHTBL
-- * with NDTA_NAME set. Changeable attribute include NDTA_THRESH[1-3],
-- * NDTA_GC_INTERVAL, and all TLVs in NDTA_PARMS unless marked
-- * otherwise. Device specific parameter sets can be changed by
-- * setting NDTPA_IFINDEX to the interface index of the corresponding
-- * device.
-- ****/
--
--struct ndt_stats
--{
--      __u64           ndts_allocs;
--      __u64           ndts_destroys;
--      __u64           ndts_hash_grows;
--      __u64           ndts_res_failed;
--      __u64           ndts_lookups;
--      __u64           ndts_hits;
--      __u64           ndts_rcv_probes_mcast;
--      __u64           ndts_rcv_probes_ucast;
--      __u64           ndts_periodic_gc_runs;
--      __u64           ndts_forced_gc_runs;
--};
--
--enum {
--      NDTPA_UNSPEC,
--      NDTPA_IFINDEX,                  /* u32, unchangeable */
--      NDTPA_REFCNT,                   /* u32, read-only */
--      NDTPA_REACHABLE_TIME,           /* u64, read-only, msecs */
--      NDTPA_BASE_REACHABLE_TIME,      /* u64, msecs */
--      NDTPA_RETRANS_TIME,             /* u64, msecs */
--      NDTPA_GC_STALETIME,             /* u64, msecs */
--      NDTPA_DELAY_PROBE_TIME,         /* u64, msecs */
--      NDTPA_QUEUE_LEN,                /* u32 */
--      NDTPA_APP_PROBES,               /* u32 */
--      NDTPA_UCAST_PROBES,             /* u32 */
--      NDTPA_MCAST_PROBES,             /* u32 */
--      NDTPA_ANYCAST_DELAY,            /* u64, msecs */
--      NDTPA_PROXY_DELAY,              /* u64, msecs */
--      NDTPA_PROXY_QLEN,               /* u32 */
--      NDTPA_LOCKTIME,                 /* u64, msecs */
--      __NDTPA_MAX
--};
--#define NDTPA_MAX (__NDTPA_MAX - 1)
--
--struct ndtmsg
--{
--      __u8            ndtm_family;
--      __u8            ndtm_pad1;
--      __u16           ndtm_pad2;
--};
--
--struct ndt_config
--{
--      __u16           ndtc_key_len;
--      __u16           ndtc_entry_size;
--      __u32           ndtc_entries;
--      __u32           ndtc_last_flush;        /* delta to now in msecs */
--      __u32           ndtc_last_rand;         /* delta to now in msecs */
--      __u32           ndtc_hash_rnd;
--      __u32           ndtc_hash_mask;
--      __u32           ndtc_hash_chain_gc;
--      __u32           ndtc_proxy_qlen;
--};
--
--enum {
--      NDTA_UNSPEC,
--      NDTA_NAME,                      /* char *, unchangeable */
--      NDTA_THRESH1,                   /* u32 */
--      NDTA_THRESH2,                   /* u32 */
--      NDTA_THRESH3,                   /* u32 */
--      NDTA_CONFIG,                    /* struct ndt_config, read-only */
--      NDTA_PARMS,                     /* nested TLV NDTPA_* */
--      NDTA_STATS,                     /* struct ndt_stats, read-only */
--      NDTA_GC_INTERVAL,               /* u64, msecs */
--      __NDTA_MAX
--};
--#define NDTA_MAX (__NDTA_MAX - 1)
--
--#define NDTA_RTA(r) ((struct rtattr*)(((char*)(r)) + \
--                   NLMSG_ALIGN(sizeof(struct ndtmsg))))
--#define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg))
--
--
- /****
-  *            General form of address family dependent message.
-  ****/
-@@ -663,138 +462,6 @@ struct prefix_cacheinfo
-       __u32   valid_time;
- };
--/* The struct should be in sync with struct net_device_stats */
--struct rtnl_link_stats
--{
--      __u32   rx_packets;             /* total packets received       */
--      __u32   tx_packets;             /* total packets transmitted    */
--      __u32   rx_bytes;               /* total bytes received         */
--      __u32   tx_bytes;               /* total bytes transmitted      */
--      __u32   rx_errors;              /* bad packets received         */
--      __u32   tx_errors;              /* packet transmit problems     */
--      __u32   rx_dropped;             /* no space in linux buffers    */
--      __u32   tx_dropped;             /* no space available in linux  */
--      __u32   multicast;              /* multicast packets received   */
--      __u32   collisions;
--
--      /* detailed rx_errors: */
--      __u32   rx_length_errors;
--      __u32   rx_over_errors;         /* receiver ring buff overflow  */
--      __u32   rx_crc_errors;          /* recved pkt with crc error    */
--      __u32   rx_frame_errors;        /* recv'd frame alignment error */
--      __u32   rx_fifo_errors;         /* recv'r fifo overrun          */
--      __u32   rx_missed_errors;       /* receiver missed packet       */
--
--      /* detailed tx_errors */
--      __u32   tx_aborted_errors;
--      __u32   tx_carrier_errors;
--      __u32   tx_fifo_errors;
--      __u32   tx_heartbeat_errors;
--      __u32   tx_window_errors;
--      
--      /* for cslip etc */
--      __u32   rx_compressed;
--      __u32   tx_compressed;
--};
--
--/* The struct should be in sync with struct ifmap */
--struct rtnl_link_ifmap
--{
--      __u64   mem_start;
--      __u64   mem_end;
--      __u64   base_addr;
--      __u16   irq;
--      __u8    dma;
--      __u8    port;
--};
--
--enum
--{
--      IFLA_UNSPEC,
--      IFLA_ADDRESS,
--      IFLA_BROADCAST,
--      IFLA_IFNAME,
--      IFLA_MTU,
--      IFLA_LINK,
--      IFLA_QDISC,
--      IFLA_STATS,
--      IFLA_COST,
--#define IFLA_COST IFLA_COST
--      IFLA_PRIORITY,
--#define IFLA_PRIORITY IFLA_PRIORITY
--      IFLA_MASTER,
--#define IFLA_MASTER IFLA_MASTER
--      IFLA_WIRELESS,          /* Wireless Extension event - see wireless.h */
--#define IFLA_WIRELESS IFLA_WIRELESS
--      IFLA_PROTINFO,          /* Protocol specific information for a link */
--#define IFLA_PROTINFO IFLA_PROTINFO
--      IFLA_TXQLEN,
--#define IFLA_TXQLEN IFLA_TXQLEN
--      IFLA_MAP,
--#define IFLA_MAP IFLA_MAP
--      IFLA_WEIGHT,
--#define IFLA_WEIGHT IFLA_WEIGHT
--      IFLA_OPERSTATE,
--      IFLA_LINKMODE,
--      __IFLA_MAX
--};
--
--
--#define IFLA_MAX (__IFLA_MAX - 1)
--
--#define IFLA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
--#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
--
--/* ifi_flags.
--
--   IFF_* flags.
--
--   The only change is:
--   IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
--   more not changeable by user. They describe link media
--   characteristics and set by device driver.
--
--   Comments:
--   - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
--   - If neither of these three flags are set;
--     the interface is NBMA.
--
--   - IFF_MULTICAST does not mean anything special:
--   multicasts can be used on all not-NBMA links.
--   IFF_MULTICAST means that this media uses special encapsulation
--   for multicast frames. Apparently, all IFF_POINTOPOINT and
--   IFF_BROADCAST devices are able to use multicasts too.
-- */
--
--/* IFLA_LINK.
--   For usual devices it is equal ifi_index.
--   If it is a "virtual interface" (f.e. tunnel), ifi_link
--   can point to real physical interface (f.e. for bandwidth calculations),
--   or maybe 0, what means, that real media is unknown (usual
--   for IPIP tunnels, when route to endpoint is allowed to change)
-- */
--
--/* Subtype attributes for IFLA_PROTINFO */
--enum
--{
--      IFLA_INET6_UNSPEC,
--      IFLA_INET6_FLAGS,       /* link flags                   */
--      IFLA_INET6_CONF,        /* sysctl parameters            */
--      IFLA_INET6_STATS,       /* statistics                   */
--      IFLA_INET6_MCAST,       /* MC things. What of them?     */
--      IFLA_INET6_CACHEINFO,   /* time values and max reasm size */
--      __IFLA_INET6_MAX
--};
--
--#define IFLA_INET6_MAX        (__IFLA_INET6_MAX - 1)
--
--struct ifla_cacheinfo
--{
--      __u32   max_reasm_len;
--      __u32   tstamp;         /* ipv6InterfaceTable updated timestamp */
--      __u32   reachable_time;
--      __u32   retrans_time;
--};
- /*****************************************************************
-  *            Traffic control messages.
-@@ -821,6 +488,7 @@ enum
-       TCA_RATE,
-       TCA_FCNT,
-       TCA_STATS2,
-+      TCA_STAB,
-       __TCA_MAX
- };
-@@ -829,6 +497,32 @@ enum
- #define TCA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
- #define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
-+/********************************************************************
-+ *            Neighbor Discovery userland options
-+ ****/
-+
-+struct nduseroptmsg
-+{
-+      unsigned char   nduseropt_family;
-+      unsigned char   nduseropt_pad1;
-+      unsigned short  nduseropt_opts_len;     /* Total length of options */
-+      int             nduseropt_ifindex;
-+      __u8            nduseropt_icmp_type;
-+      __u8            nduseropt_icmp_code;
-+      unsigned short  nduseropt_pad2;
-+      unsigned int    nduseropt_pad3;
-+      /* Followed by one or more ND options */
-+};
-+
-+enum
-+{
-+      NDUSEROPT_UNSPEC,
-+      NDUSEROPT_SRCADDR,
-+      __NDUSEROPT_MAX
-+};
-+
-+#define NDUSEROPT_MAX (__NDUSEROPT_MAX - 1)
-+
- /* RTnetlink multicast groups - backwards compatibility for userspace */
- #define RTMGRP_LINK           1
- #define RTMGRP_NOTIFY         2
-@@ -883,10 +577,19 @@ enum rtnetlink_groups {
-       RTNLGRP_NOP2,
-       RTNLGRP_DECnet_ROUTE,
- #define RTNLGRP_DECnet_ROUTE  RTNLGRP_DECnet_ROUTE
--      RTNLGRP_NOP3,
-+      RTNLGRP_DECnet_RULE,
-+#define RTNLGRP_DECnet_RULE   RTNLGRP_DECnet_RULE
-       RTNLGRP_NOP4,
-       RTNLGRP_IPV6_PREFIX,
- #define RTNLGRP_IPV6_PREFIX   RTNLGRP_IPV6_PREFIX
-+      RTNLGRP_IPV6_RULE,
-+#define RTNLGRP_IPV6_RULE     RTNLGRP_IPV6_RULE
-+      RTNLGRP_ND_USEROPT,
-+#define RTNLGRP_ND_USEROPT    RTNLGRP_ND_USEROPT
-+      RTNLGRP_PHONET_IFADDR,
-+#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR
-+      RTNLGRP_PHONET_ROUTE,
-+#define RTNLGRP_PHONET_ROUTE  RTNLGRP_PHONET_ROUTE
-       __RTNLGRP_MAX
- };
- #define RTNLGRP_MAX   (__RTNLGRP_MAX - 1)
diff --git a/rstp/rstp.nm b/rstp/rstp.nm
deleted file mode 100644 (file)
index 65e0082..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-###############################################################################
-# IPFire.org    - An Open Source Firewall Solution                            #
-# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
-###############################################################################
-
-name       = rstp
-version    = 0.21
-release    = 5
-
-groups     = Networking/Tools
-url        = http://git.ipfire.org/?p=thirdparty/rstp.git;a=summary
-license    = GPLv2+
-summary    = Rapid Spanning Tree Protocol for Linux Ethernet bridge.
-
-description
-       Rapid Spanning Tree Protocol for Linux Ethernet bridge.
-end
-
-build
-       prepare_cmds
-               sed -i Makefile \
-                       -e "s/-Werror//" \
-                       -e "s/^CFLAGS =/CFLAGS = %{CFLAGS}/g"
-       end
-
-       install
-               make install INSTALLPREFIX=%{BUILDROOT}
-               install -v -m 755 %{DIR_SOURCE}/bridge-stp %{BUILDROOT}/sbin/bridge-stp
-       end
-end
-
-packages
-       package %{name}
-       end
-end
diff --git a/rstp/systemd/rstp.service b/rstp/systemd/rstp.service
deleted file mode 100644 (file)
index d322a39..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Rapid Spanning Tree Protocol Daemon
-Before=network.service
-
-[Service]
-RemainAfterExit=yes
-ExecStartPre=/sbin/modprobe net_pf_17
-ExecStart=/sbin/rstpd -d
-
-[Install]
-WantedBy=multi-user.target
index 4cc20d8c45ab3a04b09841a3c860b66a79c6e9b1..3af7d69f9e63f7c613423d37fb241b283888f868 100644 (file)
@@ -66,4 +66,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index b2d41f1806519021802c46d7d74c3d9ccb36c031..674e9d0f880c1b818f75af07c3bf39e72209ff0f 100644 (file)
@@ -1,4 +1,4 @@
-/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
+/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/cron {
     sharedscripts
     postrotate
        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
index cb19dc454f4772e8e6ae1fccc3e859f625e7b95d..1f2aef3d904e26a23b5fde84a0f3e8b1624f0ac2 100644 (file)
@@ -4,10 +4,10 @@
 ###############################################################################
 
 name       = rsyslog
-version    = 5.8.0
+version    = 5.8.6
 release    = 2
 
-groups     = Base System/Daemons
+groups     = System/Daemons
 url        = http://www.rsyslog.com/
 license    = GPLv3+
 summary    = Enhanced system logging and kernel message trapping daemon.
@@ -21,13 +21,8 @@ description
        relay chains.
 end
 
-provides  += syslog
-
 source_dl  = http://www.rsyslog.com/files/download/rsyslog/
 
-CFLAGS    += \
-       -DSYSLOGD_PIDNAME=\"syslogd.pid\"
-
 build
        requires
                gnutls-devel
@@ -36,6 +31,9 @@ build
                zlib-devel
        end
 
+       CFLAGS += \
+               -DSYSLOGD_PIDNAME=\"syslogd.pid\"
+
        configure_options += \
                --exec-prefix= \
                --libdir=/lib \
@@ -69,5 +67,35 @@ end
 packages
        package %{name}
                requires = logrotate
+               provides += syslog
+
+               prerequires = systemd-units
+
+               script postin
+                       for n in /var/log/{messages,secure,maillog,spooler}; do
+                               [ -f "${n}" ] && continue
+                               umask 066 && touch ${n}
+                       done
+
+                       /bin/systemctl enable rsyslog.service >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       /bin/systemctl --no-reload disable rsyslog.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop rsyslog.service 2>&1 || :
+               end
+
+               script postun
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl try-restart rsyslog.service >/dev/null 2>&1 || :
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 320436c03885de28909685d0822341dc8005fa3b..ae55fe5bd6aba4fbd85b08abb56cd6b40889d2ae 100644 (file)
@@ -37,4 +37,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index c7591cd644a742aa954eace22c398e5ccabab512..2a5cef06dcc8d879f74eb96d9e0cd9261160d0c1 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = samba
-version    = 3.5.11
+version    = 3.6.1
 release    = 1
 
 maintainer = Christian Schmidt <christian.schmidt@ipfire.org>
@@ -37,7 +37,9 @@ build
                automake
                avahi-devel
                cups-devel
+               gettext
                ncurses-devel
+               libacl-devel
                libcap-devel
                openldap-devel
                openssl-devel
@@ -45,6 +47,7 @@ build
                popt-devel
                readline-devel
                which
+               zlib-devel
        end
 
        DIR_APP = %{DIR_SRC}/%{thisapp}/source3
@@ -85,13 +88,18 @@ end
 
 packages
        package %{name}
-       end
-       
+
        package %{name}-libs
                template LIBS
        end
-       
+
        package %{name}-devel
                template DEVEL
+
+               requires += %{name}-libs=%{thisver}
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 8d6c3398a3460f8eeee3f8e283e01dac85b811be..54b8d0a8d881defe4e14ef5c0072b827eb26a659 100644 (file)
@@ -45,12 +45,16 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-libs
                template LIBS
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index c6d685aeb16d20e76b81cd6aeebc3eff89acd4a4..e83b3fa68c40cd45ba0ae16a22dd5f5f5b572e95 100644 (file)
@@ -46,4 +46,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 49e71cd89fec17df18eeb50ec5c7446658e3f9ec..0c43fbb5bb1c75a813ef3060ac2e8fb144f3a949 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = sed
 version    = 4.2.1
-release    = 1
+release    = 2
 
-groups     = Base Build Applications/Text
+groups     = Applications/Text
 url        = http://sed.sourceforge.net/
 license    = GPLv2+
 summary    = A GNU stream text editor.
@@ -39,5 +39,10 @@ end
 
 packages
        package %{name}
+               groups += Base Build
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index e8a9b8c9297050d4c73dade1cdc2ab6874a871d0..891af408f8d373bd406b18f3017585500c831bab 100644 (file)
@@ -5,7 +5,8 @@
 
 name       = setup
 version    = 3.0
-release    = 2
+release    = 4
+arch       = noarch
 
 groups     = Base Build System/Base
 url        =
@@ -48,5 +49,22 @@ end
 packages
        package %{name}
                requires = iana-etc
+
+               configfiles
+                       /etc/aliases
+                       /etc/exports
+                       /etc/fstab
+                       /etc/group
+                       /etc/gshadow
+                       /etc/host.conf
+                       /etc/hosts
+                       /etc/hosts.allow
+                       /etc/hosts.deny
+                       /etc/motd
+                       /etc/passwd
+                       /etc/printcap
+                       /etc/shadow
+                       /etc/shells
+               end
        end
 end
index 3b97ee071a5970e6f83270fa1d3a1f0f23b4afb8..07ec394ffd648c0937d1da0c072a97288579ed78 100644 (file)
@@ -26,12 +26,16 @@ sources    = %{thisapp}.tgz
 packages
        package %{name}
        end
-       
+
        package %{name}-libs
                template LIBS
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/sgml-common/MLCATALOG b/sgml-common/MLCATALOG
new file mode 100644 (file)
index 0000000..2ca27aa
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+  <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook XML" catalog="file:///etc/sgml/docbook/xmlcatalog"/>
+  <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML" catalog="file:///etc/sgml/docbook/xmlcatalog"/>
+  <delegatePublic publicIdStartString="ISO 8879:1986" catalog="file:///etc/sgml/docbook/xmlcatalog"/>
+  <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/" catalog="file:///etc/sgml/docbook/xmlcatalog"/>
+  <delegateURI uriStartString="http://www.oasis-open.org/docbook/" catalog="file:///etc/sgml/docbook/xmlcatalog"/>
+</catalog>
diff --git a/sgml-common/html.dcl b/sgml-common/html.dcl
new file mode 100644 (file)
index 0000000..710e9e2
--- /dev/null
@@ -0,0 +1,88 @@
+<!SGML  "ISO 8879:1986"
+--
+       SGML Declaration for HyperText Markup Language (HTML).
+
+--
+
+CHARSET
+         BASESET  "ISO 646:1983//CHARSET
+                   International Reference Version
+                   (IRV)//ESC 2/5 4/0"
+         DESCSET  0   9   UNUSED
+                  9   2   9
+                  11  2   UNUSED
+                  13  1   13
+                  14  18  UNUSED
+                  32  95  32
+                  127 1   UNUSED
+     BASESET   "ISO Registration Number 100//CHARSET
+                ECMA-94 Right Part of
+                Latin Alphabet Nr. 1//ESC 2/13 4/1"
+
+         DESCSET  128  32   UNUSED
+                  160  96    32
+
+CAPACITY        SGMLREF
+                TOTALCAP        150000
+                GRPCAP          150000
+               ENTCAP          150000
+  
+SCOPE    DOCUMENT
+SYNTAX   
+         SHUNCHAR CONTROLS 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
+                17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 127
+         BASESET  "ISO 646:1983//CHARSET
+                   International Reference Version
+                   (IRV)//ESC 2/5 4/0"
+         DESCSET  0 128 0
+         FUNCTION
+                 RE          13
+                  RS          10
+                  SPACE       32
+                  TAB SEPCHAR  9
+       
+
+         NAMING   LCNMSTRT ""
+                  UCNMSTRT ""
+                  LCNMCHAR ".-"
+                  UCNMCHAR ".-"
+                  NAMECASE GENERAL YES
+                           ENTITY  NO
+         DELIM    GENERAL  SGMLREF
+                  SHORTREF SGMLREF
+         NAMES    SGMLREF
+         QUANTITY SGMLREF
+                  ATTSPLEN 2100
+                  LITLEN   1024
+                  NAMELEN  72    -- somewhat arbitrary; taken from
+                                internet line length conventions --
+                  PILEN    1024
+                  TAGLVL   100
+                  TAGLEN   2100
+                  GRPGTCNT 150
+                  GRPCNT   64                   
+
+FEATURES
+  MINIMIZE
+    DATATAG  NO
+    OMITTAG  YES
+    RANK     NO
+    SHORTTAG YES
+  LINK
+    SIMPLE   NO
+    IMPLICIT NO
+    EXPLICIT NO
+  OTHER
+    CONCUR   NO
+    SUBDOC   NO
+    FORMAL   YES
+  APPINFO    "SDA"  -- conforming SGML Document Access application
+                   --
+>
+<!-- 
+       $Id: html.dcl,v 1.1 2004/09/09 12:19:26 cvsdist Exp $
+
+       Author: Daniel W. Connolly <connolly@w3.org>
+
+       See also: http://www.w3.org/hypertext/WWW/MarkUp/MarkUp.html
+ -->
diff --git a/sgml-common/html.soc b/sgml-common/html.soc
new file mode 100644 (file)
index 0000000..c0b1949
--- /dev/null
@@ -0,0 +1,31 @@
+       -- catalog: SGML Open style entity catalog for HTML --
+       -- $Id: html.soc,v 1.1 2004/09/09 12:19:26 cvsdist Exp $ --
+       -- Hacked by jjc --
+
+       -- Ways to refer to Level 2: most general to most specific --
+PUBLIC "-//IETF//DTD HTML//EN"                 html.dtd
+PUBLIC "-//IETF//DTD HTML 2.0//EN"             html.dtd
+PUBLIC "-//IETF//DTD HTML Level 2//EN"         html.dtd
+PUBLIC "-//IETF//DTD HTML 2.0 Level 2//EN"     html.dtd
+
+       -- Ways to refer to Level 1: most general to most specific --
+PUBLIC "-//IETF//DTD HTML Level 1//EN"         html-1.dtd
+PUBLIC "-//IETF//DTD HTML 2.0 Level 1//EN"     html-1.dtd
+
+       -- Ways to refer to
+                Strict Level 2: most general to most specific --
+PUBLIC "-//IETF//DTD HTML Strict//EN"                  html-s.dtd
+PUBLIC "-//IETF//DTD HTML 2.0 Strict//EN"              html-s.dtd
+PUBLIC "-//IETF//DTD HTML Strict Level 2//EN"          html-s.dtd
+PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 2//EN"      html-s.dtd
+
+       -- Ways to refer to
+                Strict Level 1: most general to most specific --
+PUBLIC "-//IETF//DTD HTML Strict Level 1//EN"          html-1s.dtd
+PUBLIC "-//IETF//DTD HTML 2.0 Strict Level 1//EN"      html-1s.dtd
+
+       -- ISO latin 1 entity set for HTML -- 
+PUBLIC "ISO 8879-1986//ENTITIES Added Latin 1//EN//HTML"       ISOlat1.sgm
+
+SGMLDECL html.dcl
+DOCTYPE html html.dtd
diff --git a/sgml-common/patches/sgml-common-quotes.patch b/sgml-common/patches/sgml-common-quotes.patch
new file mode 100644 (file)
index 0000000..c901b9e
--- /dev/null
@@ -0,0 +1,94 @@
+--- sgml-common-0.6.3/bin/install-catalog.in.quotes    Mon Nov  5 11:19:23 2001
++++ sgml-common-0.6.3/bin/install-catalog.in   Mon Nov  5 11:20:12 2001
+@@ -39,8 +39,8 @@
+ # Process actions
+ case $1 in
+    -a|--add)    SGML_ACTION="addition"
+-              SGML_CENTRALIZED=$2
+-              SGML_ORDINARY=$3
++              SGML_CENTRALIZED="$2"
++              SGML_ORDINARY="$3"
+               ;;
+    -r|--remove)       if [ -z "$3" -o "$3" = "--version" ]
+               then
+@@ -48,8 +48,8 @@
+                 exit 0
+               fi
+               SGML_ACTION="removal"
+-              SGML_CENTRALIZED=$2
+-              SGML_ORDINARY=$3
++              SGML_CENTRALIZED="$2"
++              SGML_ORDINARY="$3"
+               ;;
+    -h|--help) echo -e $SGML_HELP_MESSAGE
+               exit 0
+@@ -96,14 +96,14 @@
+ fi
+ case $SGML_ACTION in
+    addition)
+-      if [ -e $SGML_CENTRALIZED -a ! -w $SGML_CENTRALIZED ]
++      if [ -e "$SGML_CENTRALIZED" -a ! -w "$SGML_CENTRALIZED" ]
+       then
+         echo "`basename $0`: can not modify \"$SGML_CENTRALIZED\"." >&2
+         exit 2
+       fi
+       ;;
+    removal)
+-      if [ ! -w $SGML_CENTRALIZED ]
++      if [ ! -w "$SGML_CENTRALIZED" ]
+       then
+         echo "`basename $0`: can not modify \"$SGML_CENTRALIZED\"." >&2
+         exit 2
+@@ -119,7 +119,7 @@
+ fi
+ case $SGML_ACTION in
+    addition)
+-      if [ ! -s $SGML_ORDINARY ]
++      if [ ! -s "$SGML_ORDINARY" ]
+       then
+         echo "`basename $0`: \"$SGML_ORDINARY\" does not exist or is empty." >&2
+         exit 2
+@@ -131,33 +131,33 @@
+ case $SGML_ACTION in
+     addition)
+       echo "`basename $0`: addition of $SGML_ORDINARY in $SGML_CENTRALIZED"
+-      if grep -q $SGML_ORDINARY $SGML_CENTRALIZED 2>/dev/null
++      if grep -q "$SGML_ORDINARY" "$SGML_CENTRALIZED" 2>/dev/null
+       then
+         echo "Warning: $SGML_ORDINARY is already installed in the centralized catalog $SGML_CENTRALIZED" >&2
+       else
+-        echo "$SGML_POINTER $SGML_ORDINARY" >> $SGML_CENTRALIZED
++        echo "$SGML_POINTER \"$SGML_ORDINARY\"" >> "$SGML_CENTRALIZED"
+       fi
+-      grep -q $SGML_CENTRALIZED /etc/sgml/catalog 2>/dev/null
++      grep -q "$SGML_CENTRALIZED" /etc/sgml/catalog 2>/dev/null
+       if [ $? -ne 0 ]
+       then
+         echo "`basename $0`: addition of $SGML_CENTRALIZED in /etc/sgml/catalog"
+-        echo "$SGML_POINTER $SGML_CENTRALIZED" >> /etc/sgml/catalog
++        echo "$SGML_POINTER \"$SGML_CENTRALIZED\"" >> /etc/sgml/catalog
+       fi
+       ;;
+    removal)
+       echo "`basename $0`: removal of $SGML_ORDINARY from $SGML_CENTRALIZED"
+-      if grep -q $SGML_ORDINARY $SGML_CENTRALIZED 2>/dev/null
++      if grep -q "$SGML_ORDINARY" "$SGML_CENTRALIZED" 2>/dev/null
+       then
+-          sed -e "\:$SGML_POINTER $SGML_ORDINARY:d" < $SGML_CENTRALIZED > ${SGML_CENTRALIZED}.new
+-          mv ${SGML_CENTRALIZED}.new $SGML_CENTRALIZED
++          sed -e "\:$SGML_POINTER \"\\?$SGML_ORDINARY\"\\?:d" < "$SGML_CENTRALIZED" > "${SGML_CENTRALIZED}.new"
++          mv "${SGML_CENTRALIZED}.new" "$SGML_CENTRALIZED"
+       else
+         echo "Warning: $SGML_ORDINARY was not found in the centralized catalog $SGML_CENTRALIZED" >&2
+       fi
+-      if [ ! -s $SGML_CENTRALIZED ]
++      if [ ! -s "$SGML_CENTRALIZED" ]
+       then
+-        rm $SGML_CENTRALIZED
++        rm "$SGML_CENTRALIZED"
+         echo "`basename $0`: removal of $SGML_CENTRALIZED from /etc/sgml/catalog"
+-          sed -e "\:$SGML_POINTER $SGML_CENTRALIZED:d" < /etc/sgml/catalog > /etc/sgml/catalog.new
++          sed -e "\:$SGML_POINTER \"\\?$SGML_CENTRALIZED\"\\?:d" < /etc/sgml/catalog > /etc/sgml/catalog.new
+           mv /etc/sgml/catalog.new /etc/sgml/catalog
+       fi
+       ;;
diff --git a/sgml-common/patches/sgml-common-umask.patch b/sgml-common/patches/sgml-common-umask.patch
new file mode 100644 (file)
index 0000000..90bda3b
--- /dev/null
@@ -0,0 +1,12 @@
+--- sgml-common-0.6.3/bin/install-catalog.in.umask     Mon May 21 11:48:37 2001
++++ sgml-common-0.6.3/bin/install-catalog.in   Mon May 21 12:00:34 2001
+@@ -13,6 +13,9 @@
+ \040 -h, --help: \t\t\t\t Print this help message and exit\n\
+ \040 -v, --version: \t\t\t Print the version number and exit\n"
++# We need the files we create to be world readable
++umask 022
++
+ # Set version message
+ SGML_VERSION_MESSAGE="sgml-common version @VERSION@ (install-catalog version 1.0)"
diff --git a/sgml-common/patches/sgml-common-xmldir.patch b/sgml-common/patches/sgml-common-xmldir.patch
new file mode 100644 (file)
index 0000000..d7c2b2b
--- /dev/null
@@ -0,0 +1,19 @@
+--- sgml-common-0.6.3/xml-iso-entities/Makefile.am.xmldir      Fri Oct  5 16:37:43 2001
++++ sgml-common-0.6.3/xml-iso-entities/Makefile.am     Fri Oct  5 16:37:57 2001
+@@ -1,4 +1,4 @@
+-isoentdir = $(prefix)/share/sgml/xml-iso-entities-8879.1986
++isoentdir = $(prefix)/share/xml/xml-iso-entities-8879.1986
+ isoent_DATA = ISOamsa.ent ISOamsb.ent ISOamsc.ent ISOamsn.ent ISOamso.ent ISOamsr.ent \
+               ISObox.ent ISOcyr1.ent ISOcyr2.ent ISOdia.ent ISOgrk1.ent ISOgrk2.ent \
+               ISOgrk3.ent ISOgrk4.ent ISOlat1.ent ISOlat2.ent ISOnum.ent ISOpub.ent \
+--- sgml-common-0.6.3/xml-iso-entities/Makefile.in.xmldir      2007-05-15 17:21:31.000000000 +0100
++++ sgml-common-0.6.3/xml-iso-entities/Makefile.in     2007-05-15 17:21:43.000000000 +0100
+@@ -62,7 +62,7 @@
+ VERSION = @VERSION@
+ docdir = @docdir@
+-isoentdir = $(prefix)/share/sgml/xml-iso-entities-8879.1986
++isoentdir = $(prefix)/share/xml/xml-iso-entities-8879.1986
+ isoent_DATA = ISOamsa.ent ISOamsb.ent ISOamsc.ent ISOamsn.ent ISOamso.ent ISOamsr.ent               ISObox.ent ISOcyr1.ent ISOcyr2.ent ISOdia.ent ISOgrk1.ent ISOgrk2.ent               ISOgrk3.ent ISOgrk4.ent ISOlat1.ent ISOlat2.ent ISOnum.ent ISOpub.ent               ISOtech.ent catalog
diff --git a/sgml-common/sgml-common.nm b/sgml-common/sgml-common.nm
new file mode 100644 (file)
index 0000000..e1e3f13
--- /dev/null
@@ -0,0 +1,112 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = sgml-common
+version    = 0.6.3
+release    = 2
+arch       = noarch
+
+groups     = Applications/Text
+url        =
+license    = GPL+
+summary    = Common SGML catalog and DTD files.
+
+desciption
+       The sgml-common package contains a collection of entities and DTDs
+       that are useful for processing SGML, but that don't need to be
+       included in multiple packages.  Sgml-common also includes an
+       up-to-date Open Catalog file.
+end
+
+source_dl =
+sources   = %{thisapp}.tgz
+
+build
+       requires
+               autoconf
+               automake
+               libxml2-devel
+       end
+
+       configure_options += \
+               --mandir=/usr/share/man \
+               --sysconfdir=/etc
+
+       prepare_cmds
+               for i in COPYING INSTALL install-sh missing mkinstalldirs; do \
+                       rm -f ${i}; \
+                       cp -pvf /usr/share/automake*/${i} .; \
+               done
+       end
+
+       install_cmds
+               mkdir -pv %{BUILDROOT}/etc/{sg,x}ml/docbook
+               mkdir -pv %{BUILDROOT}/usr/share/sgml/docbook
+
+               # Touch SGML catalog
+               touch %{BUILDROOT}/etc/sgml/catalog
+
+               # Create an empty XML catalog.
+               xmlcatalog --noout --create %{BUILDROOT}/etc/xml/catalog
+
+               # Now put the common DocBook entries in it
+               xmlcatalog --noout --add "delegatePublic" \
+                       "-//OASIS//ENTITIES DocBook XML" \
+                       "file:///etc/sgml/docbook/xmlcatalog" %{BUILDROOT}/etc/xml/catalog
+
+               xmlcatalog --noout --add "delegatePublic" \
+                       "-//OASIS//DTD DocBook XML" \
+                       "file:///etc/sgml/docbook/xmlcatalog" %{BUILDROOT}/etc/xml/catalog
+
+               xmlcatalog --noout --add "delegatePublic" \
+                       "ISO 8879:1986" \
+                       "file:///etc/sgml/docbook/xmlcatalog" %{BUILDROOT}/etc/xml/catalog
+
+               xmlcatalog --noout --add "delegateSystem" \
+                       "http://www.oasis-open.org/docbook/" \
+                       "file:///etc/sgml/docbook/xmlcatalog" %{BUILDROOT}/etc/xml/catalog
+
+               xmlcatalog --noout --add "delegateURI" \
+                       "http://www.oasis-open.org/docbook/" \
+                       "file:///etc/sgml/docbook/xmlcatalog" %{BUILDROOT}/etc/xml/catalog
+
+               # Also create the common DocBook catalog
+               xmlcatalog --noout --create \
+                       %{BUILDROOT}/etc/sgml/docbook/xmlcatalog
+
+               ln -svf ../../../../etc/sgml/docbook/xmlcatalog \
+                       %{BUILDROOT}/usr/share/sgml/docbook/xmlcatalog
+
+               rm -f %{BUILDROOT}/usr/share/sgml/xml.dcl
+
+               install -p -m0644 %{DIR_SOURCE}/*.dcl %{DIR_SOURCE}/*.soc \
+                       %{BUILDROOT}/usr/share/sgml
+
+               rm -rf %{BUILDROOT}/usr/share/xml/*
+       end
+end
+
+packages
+       package %{name}
+               requires
+                       xml-common
+               end
+       end
+
+       package xml-common
+               summary = Common XML catalog and DTD files.
+               description
+                       The xml-common is a subpackage of sgml-common which contains
+                       a collection XML catalogs that are useful for processing XML,
+                       but that don't need to be included in main package.
+               end
+
+               files
+                       /etc/xml
+                       /etc/sgml/docbook/xmlcatalog
+                       /usr/share/sgml/docbook/xmlcatalog
+               end
+       end
+end
diff --git a/sgml-common/xml.dcl b/sgml-common/xml.dcl
new file mode 100644 (file)
index 0000000..fed2103
--- /dev/null
@@ -0,0 +1,179 @@
+<!SGML -- SGML Declaration for valid XML documents --
+     "ISO 8879:1986 (WWW)"
+
+     CHARSET
+         BASESET
+             "ISO Registration Number 176//CHARSET
+             ISO/IEC 10646-1:1993 UCS-4 with implementation 
+             level 3//ESC 2/5 2/15 4/6"
+         DESCSET
+                0       9       UNUSED
+                9       2       9
+                11      2       UNUSED
+                13      1       13
+                14      18      UNUSED
+                32      95      32
+                127     1       UNUSED
+                128     32      UNUSED
+             -- use this instead of the official declaration because SP only
+                supports 16-bit characters --
+                160     65374   160
+                65534   2       UNUSED 
+             -- 55296   2048    UNUSED
+                57344   8190    57344
+                65534   2       UNUSED
+                65536   1048576 65536 --
+     CAPACITY NONE
+
+     SCOPE DOCUMENT
+
+     SYNTAX
+         SHUNCHAR NONE
+         BASESET "ISO Registration Number 176//CHARSET
+                 ISO/IEC 10646-1:1993 UCS-4 with implementation 
+                 level 3//ESC 2/5 2/15 4/6"
+         DESCSET
+             0 1114112 0
+         FUNCTION
+             RE    13
+             RS    10
+             SPACE 32
+             TAB   SEPCHAR 9
+
+         NAMING
+             LCNMSTRT ""
+             UCNMSTRT ""
+             NAMESTRT
+                 58 95 192-214 216-246 248-305 308-318 321-328
+                 330-382 384-451 461-496 500-501 506-535 592-680
+                 699-705 902 904-906 908 910-929 931-974 976-982
+                 986 988 990 992 994-1011 1025-1036 1038-1103
+                 1105-1116 1118-1153 1168-1220 1223-1224
+                 1227-1228 1232-1259 1262-1269 1272-1273
+                 1329-1366 1369 1377-1414 1488-1514 1520-1522
+                 1569-1594 1601-1610 1649-1719 1722-1726
+                 1728-1742 1744-1747 1749 1765-1766 2309-2361
+                 2365 2392-2401 2437-2444 2447-2448 2451-2472
+                 2474-2480 2482 2486-2489 2524-2525 2527-2529
+                 2544-2545 2565-2570 2575-2576 2579-2600
+                 2602-2608 2610-2611 2613-2614 2616-2617
+                 2649-2652 2654 2674-2676 2693-2699 2701
+                 2703-2705 2707-2728 2730-2736 2738-2739
+                 2741-2745 2749 2784 2821-2828 2831-2832
+                 2835-2856 2858-2864 2866-2867 2870-2873 2877
+                 2908-2909 2911-2913 2949-2954 2958-2960
+                 2962-2965 2969-2970 2972 2974-2975 2979-2980
+                 2984-2986 2990-2997 2999-3001 3077-3084
+                 3086-3088 3090-3112 3114-3123 3125-3129
+                 3168-3169 3205-3212 3214-3216 3218-3240
+                 3242-3251 3253-3257 3294 3296-3297 3333-3340
+                 3342-3344 3346-3368 3370-3385 3424-3425
+                 3585-3630 3632 3634-3635 3648-3653 3713-3714
+                 3716 3719-3720 3722 3725 3732-3735 3737-3743
+                 3745-3747 3749 3751 3754-3755 3757-3758 3760
+                 3762-3763 3773 3776-3780 3904-3911 3913-3945
+                 4256-4293 4304-4342 4352 4354-4355 4357-4359
+                 4361 4363-4364 4366-4370 4412 4414 4416 4428
+                 4430 4432 4436-4437 4441 4447-4449 4451 4453
+                 4455 4457 4461-4462 4466-4467 4469 4510 4520
+                 4523 4526-4527 4535-4536 4538 4540-4546 4587
+                 4592 4601 7680-7835 7840-7929 7936-7957
+                 7960-7965 7968-8005 8008-8013 8016-8023 8025
+                 8027 8029 8031-8061 8064-8116 8118-8124 8126
+                 8130-8132 8134-8140 8144-8147 8150-8155
+                 8160-8172 8178-8180 8182-8188 8486 8490-8491
+                 8494 8576-8578 12295 12321-12329 12353-12436
+                 12449-12538 12549-12588 19968-40869 44032-55203
+
+             LCNMCHAR ""
+             UCNMCHAR ""
+             NAMECHAR
+                 45-46 183 720-721 768-837 864-865 903 1155-1158
+                 1425-1441 1443-1465 1467-1469 1471 1473-1474
+                 1476 1600 1611-1618 1632-1641 1648 1750-1764
+                 1767-1768 1770-1773 1776-1785 2305-2307 2364
+                 2366-2381 2385-2388 2402-2403 2406-2415
+                 2433-2435 2492 2494-2500 2503-2504 2507-2509
+                 2519 2530-2531 2534-2543 2562 2620 2622-2626
+                 2631-2632 2635-2637 2662-2673 2689-2691 2748
+                 2750-2757 2759-2761 2763-2765 2790-2799
+                 2817-2819 2876 2878-2883 2887-2888 2891-2893
+                 2902-2903 2918-2927 2946-2947 3006-3010
+                 3014-3016 3018-3021 3031 3047-3055 3073-3075
+                 3134-3140 3142-3144 3146-3149 3157-3158
+                 3174-3183 3202-3203 3262-3268 3270-3272
+                 3274-3277 3285-3286 3302-3311 3330-3331
+                 3390-3395 3398-3400 3402-3405 3415 3430-3439
+                 3633 3636-3642 3654-3662 3664-3673 3761
+                 3764-3769 3771-3772 3782 3784-3789 3792-3801
+                 3864-3865 3872-3881 3893 3895 3897 3902-3903
+                 3953-3972 3974-3979 3984-3989 3991 3993-4013
+                 4017-4023 4025 8400-8412 8417 12293 12330-12335
+                 12337-12341 12441-12442 12445-12446 12540-12542
+
+             NAMECASE
+                 GENERAL NO
+                 ENTITY  NO
+
+         DELIM
+             GENERAL SGMLREF
+             HCRO "&#38;#x" -- 38 is the number for ampersand --
+             NESTC "/"
+             NET ">"
+             PIC "?>"
+             SHORTREF NONE
+
+         NAMES
+             SGMLREF
+
+         QUANTITY NONE
+
+         ENTITIES
+             "amp" 38
+             "lt" 60
+             "gt" 62
+             "quot" 34
+             "apos" 39
+
+     FEATURES
+         MINIMIZE
+             DATATAG NO
+             OMITTAG NO
+             RANK NO
+             SHORTTAG
+                 STARTTAG
+                     EMPTY NO
+                     UNCLOSED NO 
+                     NETENABL IMMEDNET
+                 ENDTAG
+                     EMPTY NO 
+                     UNCLOSED NO
+                 ATTRIB
+                     DEFAULT YES
+                     OMITNAME NO
+                     VALUE NO
+             EMPTYNRM YES
+             IMPLYDEF
+                 ATTLIST NO
+                 DOCTYPE NO
+                 ELEMENT NO
+                 ENTITY NO
+                 NOTATION NO
+         LINK
+             SIMPLE NO
+             IMPLICIT NO
+             EXPLICIT NO
+         OTHER
+             CONCUR NO
+             SUBDOC NO
+             FORMAL NO
+             URN NO
+             KEEPRSRE YES
+             VALIDITY TYPE
+             ENTITIES
+                 REF ANY
+                 INTEGRAL YES
+     APPINFO NONE
+     SEEALSO "ISO 8879:1986//NOTATION
+             Extensible Markup Language (XML) 1.0//EN"
+>
diff --git a/sgml-common/xml.soc b/sgml-common/xml.soc
new file mode 100644 (file)
index 0000000..278c6f3
--- /dev/null
@@ -0,0 +1 @@
+SGMLDECL "xml.dcl"
index b8f0a14bff69a7700fe4140375dc1a939c945f19..8de9700d848df1b576d19dca81c95e8ab03c8b4a 100644 (file)
@@ -5,11 +5,11 @@
 
 name       = shadow-utils
 version    = 4.1.4.3
-release    = 2
+release    = 6
 thisapp    = shadow-%{version}
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
-groups     = Base System/Base
+groups     = System/Base
 url        = http://pkg-shadow.alioth.debian.org/
 license    = GPLv2+
 summary    = Utilities to deal with user accounts.
@@ -60,16 +60,29 @@ build
        install_cmds
                # Remove man pages in other languages
                rm -rfv %{BUILDROOT}/usr/share/man/{cs,de,fi,fr,hu,id,it,ja,pl,pt_BR,ru,sv,tr}
+
+               # Remove duplicate man pages.
+               rm -vf %{BUILDROOT}/usr/share/man/man*/{getspnam,nologin,passwd}.*
        end
 end
 
 packages
        package %{name}
-               obsoletes += shadow
+               groups += Base
+
+               obsoletes += shadow<%{thisver}
+               provides  += shadow=%{thisver}
 
                conflicts
-                       shadow
                        pam<1.1.0-4
                end
+
+               configfiles
+                       /etc/default/useradd
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index d00867f4a453993afc739be03e2b550f8f9fa8bd..e6a30dcae4693e44c39c6665e823221181b9ee0f 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = sip
-version    = 4.12-snapshot-12acbffd0085
+version    = %{major_ver}.13
 major_ver  = 4
 release    = 1
 epoch      = 1
@@ -41,12 +41,16 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
-       
+
                files += /usr/bin/sip
-       
+
                requires = sip
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 819431e3f559c9d0d1921b49ad92b80326ee55ea..a572e24395c37256b4f45741dfa3d61b55530f55 100644 (file)
@@ -42,8 +42,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index c35d048e18e866bc628eb07cb81b806f2d6a2fe6..cf16053408e1752852e99b4b133167ba19c5731b 100644 (file)
@@ -42,4 +42,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 76d5effb53873cdd3fd792f6b0b603e7a4652fd1..530f18019680e68b383688293a52477ec2057b22 100644 (file)
@@ -65,4 +65,8 @@ packages
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index ac328e21644872a5fb563489ce148e4dabdb3b5b..f687d8502327ec37af17431b76fe795749037df4 100644 (file)
@@ -43,4 +43,8 @@ packages
        package %{name}
                requires = libgcc_s.so.1
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/squid/cache_swap.sh b/squid/cache_swap.sh
new file mode 100644 (file)
index 0000000..b714e66
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+if [ -f /etc/sysconfig/squid ]; then
+       . /etc/sysconfig/squid
+fi
+
+SQUID_CONF=${SQUID_CONF:-"/etc/squid/squid.conf"}
+
+CACHE_SWAP=`sed -e 's/#.*//g' $SQUID_CONF | \
+       grep cache_dir | awk '{ print $3 }'`
+
+for adir in $CACHE_SWAP; do
+       if [ ! -d $adir/00 ]; then
+               echo -n "init_cache_dir $adir... "
+               squid -z -F -f $SQUID_CONF >> /var/log/squid/squid.out 2>&1
+       fi
+done
diff --git a/squid/patches/squid-3.0.STABLE7-from_manpg.patch b/squid/patches/squid-3.0.STABLE7-from_manpg.patch
deleted file mode 100644 (file)
index 368e634..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-diff -up squid-3.0.STABLE7/helpers/basic_auth/NCSA/ncsa_auth.8.from_manpg squid-3.0.STABLE7/helpers/basic_auth/NCSA/ncsa_auth.8
---- squid-3.0.STABLE7/helpers/basic_auth/NCSA/ncsa_auth.8.from_manpg   2008-06-22 05:35:49.000000000 +0200
-+++ squid-3.0.STABLE7/helpers/basic_auth/NCSA/ncsa_auth.8      2007-06-06 18:25:30.000000000 +0200
-@@ -1,38 +1,38 @@
--.\" This file is distributed in the hope that it will be useful,
--.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
--.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
--.\" the GNU General Public License for more details.
--.\"
--.\" You should have received a copy of the GNU General Public License
--.\" along with this file; if not, write to the Free Software
--.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston,
--.\" MA 02111-1307 USA
--.\"
--.\" HISTORY:
--.\" 2006-05-16, created by Rodrigo Rubira Branco <rrbranco@br.ibm.com>
--.TH ncsa_auth 8 "May 16, 2006" "Squid NCSA Auth helper"
--.SH NAME
--ncsa_auth \- NCSA httpd-style password file authentication helper for Squid
--\fB
--.SH SYNOPSIS
--.nf
--.fam C
--\fBncsa_auth\fP \fIpasswdfile\fP 
--.fam T
--.fi
--.SH DESCRIPTION
--\fBncsa_auth\fP allows Squid to read and authenticate user and password information from an NCSA/Apache httpd-style password file when using basic HTTP authentication.
--.PP
--The only parameter is the password file.  It must have permissions to be read by the user that Squid is running as (cache_effective_user in squid.conf).
--.PP
--This password file can be manipulated using htpasswd.
--.SH OPTIONS
--Only specify the password file name.
--.SH EXAMPLE
--\fBncsa_auth\fP /etc/squid/squid.pass
--.SH SECURITY
--\fBncsa_auth\fP must have access to the password file to be executed.
--.SH SEE ALSO
--\fBhtpasswd\fP(1), \fBsquid\fP(8)
--.SH AUTHOR
--Manpage written by Rodrigo Rubira Branco <rrbranco@br.ibm.com>
-+.\" This file is distributed in the hope that it will be useful,\r
-+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See\r
-+.\" the GNU General Public License for more details.\r
-+.\"\r
-+.\" You should have received a copy of the GNU General Public License\r
-+.\" along with this file; if not, write to the Free Software\r
-+.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston,\r
-+.\" MA 02111-1307 USA\r
-+.\"\r
-+.\" HISTORY:\r
-+.\" 2006-05-16, created by Rodrigo Rubira Branco <rrbranco@br.ibm.com>\r
-+.TH ncsa_auth 8 "May 16, 2006" "User Manuals" "User Manuals"\r
-+.SH NAME\r
-+ncsa_auth \- NCSA httpd-style password file authentication helper for Squid\r
-+\fB\r
-+.SH SYNOPSIS\r
-+.nf\r
-+.fam C\r
-+\fBncsa_auth\fP \fIpasswdfile\fP \r
-+.fam T\r
-+.fi\r
-+.SH DESCRIPTION\r
-+\fBncsa_auth\fP allows Squid to read and authenticate user and password information from an NCSA httpd-style password file when using basic HTTP authentication.\r
-+.PP\r
-+The only parameter is the password file.  It must have permissions to be read by the user that Squid is running as. By default this user is proxy. This can be changed using the cache_effective_user directive in the squid.conf file.\r
-+.PP\r
-+This password file can be manipulated using htpasswd.\r
-+.SH OPTIONS\r
-+Only specify the password file name.\r
-+.SH EXAMPLE\r
-+\fBncsa_auth\fP /etc/squid/squid.pass\r
-+.SH SECURITY\r
-+\fBncsa_auth\fP must have access to the password file to be executed.\r
-+.SH SEE ALSO\r
-+\fBhtpasswd\fP(1), \fBsquid\fP(8)\r
-+.SH AUTHOR\r
-+Manpage written by Rodrigo Rubira Branco <rrbranco@br.ibm.com>\r
index 20d542dfb6ef299751e5608b6db4592e9f3e5ee3..f41eb27b92d0f9ad6cb9c012234403aaabd2a9d6 100644 (file)
@@ -4,9 +4,9 @@
 ###############################################################################
 
 name       = squid
-version    = 3.1.12
 major_ver  = 3.1
-release    = 1
+version    = %{major_ver}.16
+release    = 4
 
 maintainer = Christian Schmidt <christian.schmidt@ipfire.org>
 groups     = Networking/Daemons
@@ -36,25 +36,27 @@ build
                pam-devel
                libcap-devel
                /usr/bin/smbclient
+               shadow-utils
        end
 
-       export PKG_REQUIRES_FILTER = perl\(Authen::Smb\)
+       CFLAGS += -Wno-error
 
        configure_options += \
                --datadir=/usr/lib/squid \
                --libexecdir=/usr/lib/squid \
                --localstatedir=/var \
                --sysconfdir=/etc/squid \
+               --with-logdir=/var/log/squid \
                --enable-storeio="aufs,diskd,ufs" \
                --enable-removal-policies="heap,lru" \
                --enable-icmp \
                --enable-delay-pools \
                --disable-esi \
-               --disable-icap-client \
+               --enable-icap-client \
                --enable-useragent-log \
                --enable-referrer-log \
-               --disable-wccp \
-               --disable-wccpv2 \
+               --enable-wccp \
+               --enable-wccpv2 \
                --enable-kill-parent-hack \
                --enable-snmp \
                --enable-arp-acl \
@@ -82,24 +84,75 @@ build
                --with-dl \
                --with-large-files
 
+       prepare_cmds
+               %{create_user}
+       end
+
        install_cmds
                rm -vf %{BUILDROOT}/etc/squid/errors
-               rmdir  %{BUILDROOT}/var/logs
 
                mkdir -pv %{BUILDROOT}/var/log/cache %{BUILDROOT}/var/log/squid
                touch %{BUILDROOT}/var/log/squid/access.log
+               touch %{BUILDROOT}/var/log/squid/cache.log
                mkdir -pv %{BUILDROOT}/var/cache/squid
 
-               # What is this?????
-               #groupadd -r squid && useradd -r -g squid -d %{BUILDROOT}/var/cache/squid -s /bin/false -p '*' squid
-               #chown -Rv squid:squid %{BUILDROOT}/var/log/squid %{BUILDROOT}/var/log/cache %{BUILDROOT}/var/cache/squid
-               #chmod 600 %{BUILDROOT}/var/cache/squid
-               #chown squid:squid %{BUILDROOT}/var/log/squid
+               echo "visible_hostname %{DISTRO_NAME}" >> %{BUILDROOT}/etc/squid/squid.conf
+               echo "cache_effective_user squid" >> %{BUILDROOT}/etc/squid/squid.conf
+               echo "cache_effective_group squid" >> %{BUILDROOT}/etc/squid/squid.conf
+
+               chown -Rv squid:squid %{BUILDROOT}/var/log/squid %{BUILDROOT}/var/log/cache %{BUILDROOT}/var/cache/squid
+               chmod 600 %{BUILDROOT}/var/cache/squid
+               mkdir -pv %{BUILDROOT}/etc/sysconfig
+               cp -vf %{DIR_SOURCE}/squid.sysconfig %{BUILDROOT}/etc/sysconfig/squid
+               cp -vf %{DIR_SOURCE}/cache_swap.sh %{BUILDROOT}/usr/lib/squid/
+               chmod 755 %{BUILDROOT}/usr/lib/squid/cache_swap.sh
+               chown -Rv squid:squid %{BUILDROOT}/usr/lib/squid/cache_swap.sh
        end
 end
 
+create_user
+       getent group squid >/dev/null || /usr/sbin/groupadd -r squid
+       getent passwd squid >/dev/null || /usr/sbin/useradd -r -g squid \
+               -d /var/cache/squid -s /sbin/nologin squid
+end
+
 packages
        package %{name}
+               prerequires = shadow-utils systemd-units
+
+               configfiles
+                       /etc/squid.conf
+                       /etc/sysconfig/squid
+               end
+
+               script prein
+                       %{create_user}
+               end
+
+               script postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       /bin/systemctl --no-reload disable squid.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop squid.service >/dev/null 2>&1 || :
+               end
+
+               script postun
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl try-restart squid.service >/dev/null 2>&1 || :
+               end
+
                requires = /usr/bin/smbclient
+
+               filter_requires = perl\(Authen::Smb\)
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
diff --git a/squid/squid.sysconfig b/squid/squid.sysconfig
new file mode 100644 (file)
index 0000000..3864bd8
--- /dev/null
@@ -0,0 +1,9 @@
+# default squid options
+SQUID_OPTS=""
+
+# Time to wait for Squid to shut down when asked. Should not be necessary
+# most of the time.
+SQUID_SHUTDOWN_TIMEOUT=100
+
+# default squid conf file
+SQUID_CONF="/etc/squid/squid.conf"
diff --git a/squid/systemd/squid.service b/squid/systemd/squid.service
new file mode 100644 (file)
index 0000000..2c0c98e
--- /dev/null
@@ -0,0 +1,14 @@
+[Unit]
+Description=Squid caching proxy
+After=syslog.target network.target
+
+[Service]
+Type=forking
+EnvironmentFile=/etc/sysconfig/squid
+ExecStartPre=/usr/lib/squid/cache_swap.sh
+ExecStart=/usr/sbin/squid $SQUID_OPTS -f $SQUID_CONF
+ExecReload=/usr/sbin/squid $SQUID_OPTS -k reconfigure -f $SQUID_CONF
+ExecStop=/usr/sbin/squid -k shutdown -f $SQUID_CONF
+
+[Install]
+WantedBy=multi-user.target
index ce0e4199ae7d28370e93bf94f5b0f3660bf661df..a45597b7027b352214e708ddce6f4003d33c41df 100644 (file)
@@ -53,4 +53,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 5497a556c6c15894c3fdd198602b8701a3569692..7aec6d76744cc7db203987b4828db0aed5487531 100644 (file)
@@ -31,4 +31,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 17361fa9a11d22374c7d067983907dbee9b09f6f..2db6214237d0f789e22e73c9cac6f5a883f797f6 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = strongswan
-version    = 4.5.3
+version    = 4.6.1
 release    = 1
 
 groups     = Networking/VPN
@@ -63,5 +63,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index a85f6119d4ffb6642cb4fa93dab4fc01037a93f6..139157b83bf8a8e12e01f236c00cd63df366c83d 100644 (file)
@@ -4,10 +4,10 @@
 ###############################################################################
 
 name       = sudo
-version    = 1.7.4p3
-release    = 1
+version    = 1.8.3
+release    = 2
 
-groups     = Base Applications/System
+groups     = Applications/System
 url        = http://www.sudo.ws/sudo/download.html
 license    = BSD
 summary    = Allows restricted root access for specified users.
@@ -58,5 +58,10 @@ end
 
 packages
        package %{name}
+               groups += Base
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
diff --git a/suricata/suricata.conf b/suricata/suricata.conf
new file mode 100644 (file)
index 0000000..8c2b1ed
--- /dev/null
@@ -0,0 +1,526 @@
+%YAML 1.1
+---
+# Suricata Emergingthreats Pro Open Rulesets Recommended
+reference-config-file: /etc/suricata/rules/reference.config
+
+# Number of packets allowed to be processed simultaneously.  Default is a
+# conservative 50. a higher number will make sure CPU's/CPU cores will be
+# more easily kept busy, but will negatively impact caching.
+#
+# If you are using the CUDA pattern matcher (b2g_cuda below), different rules
+# apply. In that case try something like 4000 or more. This is because the CUDA
+# pattern matcher scans many packets in parallel.
+#max-pending-packets: 50
+
+# Set the order of alerts bassed on actions
+# The default order is pass, drop, reject, alert
+action-order:
+  - pass
+  - drop
+  - reject
+  - alert
+
+
+# The default logging directory.  Any log or output file will be
+# placed here if its not specified with a full path name.  This can be
+# overridden with the -l command line parameter.
+default-log-dir: /var/log/suricata
+
+# Configure the type of alert (and other) logging you would like.
+outputs:
+
+  # a line based alerts log similar to Snort's fast.log
+  - fast:
+      enabled: yes
+      filename: fast.log
+
+  # log output for use with Barnyard
+  - unified-log:
+      enabled: no
+      filename: unified.log
+
+      # Limit in MB.
+      #limit: 32
+
+  # alert output for use with Barnyard
+  - unified-alert:
+      enabled: no
+      filename: unified.alert
+
+      # Limit in MB.
+      #limit: 32
+
+  # alert output for use with Barnyard2
+  - unified2-alert:
+      enabled: no
+      filename: unified2.alert
+
+      # Limit in MB.
+      #limit: 32
+
+  # a line based log of HTTP requests (no alerts)
+  - http-log:
+      enabled: yes
+      filename: http.log
+
+  # a full alerts log containing much information for signature writers
+  # or for investigating suspected false positives.
+  - alert-debug:
+      enabled: no
+      filename: alert-debug.log
+
+  # alert output to prelude (http://www.prelude-technologies.com/) only
+  # available if Suricata has been compiled with --enable-prelude
+  - alert-prelude:
+      enabled: no
+      profile: suricata
+
+defrag:
+  max-frags: 65535
+  prealloc: yes
+  timeout: 60
+
+# You can specify a threshold config file by setting "threshold-file"
+# to the path of the threshold config file:
+# threshold-file: /etc/suricata/threshold.config
+
+# The detection engine builds internal groups of signatures. The engine
+# allow us to specify the profile to use for them, to manage memory on an
+# efficient way keeping a good performance. For the profile keyword you
+# can use the words "low", "medium", "high" or "custom". If you use custom
+# make sure to define the values at "- custom-values" as your convenience.
+# Usually you would prefer medium/high/low
+detect-engine:
+  - profile: medium
+  - custom-values:
+      toclient_src_groups: 2
+      toclient_dst_groups: 2
+      toclient_sp_groups: 2
+      toclient_dp_groups: 3
+      toserver_src_groups: 2
+      toserver_dst_groups: 4
+      toserver_sp_groups: 2
+      toserver_dp_groups: 25
+
+# Suricata is multi-threaded. Here the threading can be influenced.
+threading:
+  # On some cpu's/architectures it is beneficial to tie individual threads
+  # to specific CPU's/CPU cores. In this case all threads are tied to CPU0,
+  # and each extra CPU/core has one "detect" thread.
+  #
+  # On Intel Core2 and Nehalem CPU's enabling this will degrade performance.
+  #
+  set_cpu_affinity: no
+  #
+  # By default Suricata creates one "detect" thread per available CPU/CPU core.
+  # This setting allows controlling this behaviour. A ratio setting of 2 will
+  # create 2 detect threads for each CPU/CPU core. So for a dual core CPU this
+  # will result in 4 detect threads. If values below 1 are used, less threads
+  # are created. So on a dual core CPU a setting of 0.5 results in 1 detect
+  # thread being created. Regardless of the setting at a minimum 1 detect
+  # thread will always be created.
+  #
+  detect_thread_ratio: 1.5
+
+# Select the cuda device to use.  The device_id identifies the device to be used
+# if one has multiple devices on the system.  To find out device_id associated
+#  with the card(s) on the system run "suricata --list-cuda-cards".
+cuda:
+  device_id: 0
+
+# Select the multi pattern algorithm you want to run for scan/search the
+# in the engine. The supported algorithms are b2g, b3g and wumanber.
+#
+# There is also a CUDA pattern matcher (only available if Suricata was
+# compiled with --enable-cuda: b2g_cuda. Make sure to update your
+# max-pending-packets setting above as well if you use b2g_cuda.
+
+mpm-algo: b2g
+
+# The memory settings for hash size of these algorithms can vary from lowest
+# (2048) - low (4096) - medium (8192) - high (16384) - highest (32768) - max
+# (65536). The bloomfilter sizes of these algorithms can vary from low (512) -
+# medium (1024) - high (2048).
+#
+# For B2g/B3g algorithms, there is a support for two different scan/search
+# algorithms. For B2g the scan algorithms are B2gScan & B2gScanBNDMq, and
+# search algorithms are B2gSearch & B2gSearchBNDMq. For B3g scan algorithms
+# are B3gScan & B3gScanBNDMq, and search algorithms are B3gSearch &
+# B3gSearchBNDMq.
+#
+# For B2g the different scan/search algorithms and, hash and bloom
+# filter size settings. For B3g the different scan/search algorithms and, hash
+# and bloom filter size settings. For wumanber the hash and bloom filter size
+# settings.
+
+pattern-matcher:
+  - b2g:
+      scan_algo: B2gScanBNDMq
+      search_algo: B2gSearchBNDMq
+      hash_size: low
+      bf_size: medium
+  - b3g:
+      scan_algo: B3gScanBNDMq
+      search_algo: B3gSearchBNDMq
+      hash_size: low
+      bf_size: medium
+  - wumanber:
+      hash_size: low
+      bf_size: medium
+
+# Flow settings:
+# By default, the reserved memory (memcap) for flows is 32MB. This is the limit
+# for flow allocation inside the engine. You can change this value to allow
+# more memory usage for flows.
+# The hash_size determine the size of the hash used to identify flows inside
+# the engine, and by default the value is 65536.
+# At the startup, the engine can preallocate a number of flows, to get a better
+# performance. The number of flows preallocated is 10000 by default.
+# emergency_recovery is the percentage of flows that the engine need to
+# prune before unsetting the emergency state. The emergency state is activated
+# when the memcap limit is reached, allowing to create new flows, but
+# prunning them with the emergency timeouts (they are defined below).
+# If the memcap is reached, the engine will try to prune prune_flows
+# with the default timeouts. If it doens't find a flow to prune, it will set
+# the emergency bit and it will try again with more agressive timeouts.
+# If that doesn't work, then it will try to kill the last time seen flows
+# not in use.
+
+flow:
+  memcap: 33554432
+  hash_size: 65536
+  prealloc: 10000
+  emergency_recovery: 30
+  prune_flows: 5
+
+# Specific timeouts for flows. Here you can specify the timeouts that the
+# active flows will wait to transit from the current state to another, on each
+# protocol. The value of "new" determine the seconds to wait after a hanshake or
+# stream startup before the engine free the data of that flow it doesn't
+# change the state to established (usually if we don't receive more packets
+# of that flow). The value of "established" is the amount of
+# seconds that the engine will wait to free the flow if it spend that amount
+# without receiving new packets or closing the connection. "closed" is the
+# amount of time to wait after a flow is closed (usually zero).
+#
+# There's an emergency mode that will become active under attack circumstances,
+# making the engine to check flow status faster. This configuration variables
+# use the prefix "emergency_" and work similar as the normal ones.
+# Some timeouts doesn't apply to all the protocols, like "closed", for udp and
+# icmp.
+
+flow-timeouts:
+
+  default:
+    new: 30
+    established: 300
+    closed: 0
+    emergency_new: 10
+    emergency_established: 100
+    emergency_closed: 0
+  tcp:
+    new: 60
+    established: 3600
+    closed: 120
+    emergency_new: 10
+    emergency_established: 300
+    emergency_closed: 20
+  udp:
+    new: 30
+    established: 300
+    emergency_new: 10
+    emergency_established: 100
+  icmp:
+    new: 30
+    established: 300
+    emergency_new: 10
+    emergency_established: 100
+
+# Stream engine settings. Here the TCP stream tracking and reaasembly
+# engine is configured.
+#
+# stream:
+#   memcap: 33554432            # 32mb tcp session memcap
+#   checksum_validation: yes    # To validate the checksum of received
+                                # packet. If csum validation is specified as
+                                # "yes", then packet with invalid csum will not
+                                # be processed by the engine stream/app layer.
+#   max_sessions: 262144        # 256k concurrent sessions
+#   prealloc_sessions: 32768    # 32k sessions prealloc'd
+#   midstream: false            # don't allow midstream session pickups
+#   async_oneside: false        # don't enable async stream handling
+#   reassembly:
+#     memcap: 67108864          # 64mb tcp reassembly memcap
+#     depth: 1048576            # 1 MB reassembly depth
+stream:
+  memcap: 33554432
+  checksum_validation: yes
+  inline: yes
+  reassembly:
+    memcap: 67108864
+    depth: 1048576
+
+# Logging configuration.  This is not about logging IDS alerts, but
+# IDS output about what its doing, errors, etc.
+logging:
+
+  # The default log level, can be overridden in an output section.
+  # Note that debug level logging will only be emitted if Suricata was
+  # compiled with the --enable-debug configure option.
+  #
+  # This value is overriden by the SC_LOG_LEVEL env var.
+  default-log-level: info
+
+  # The default output format.  Optional parameter, should default to
+  # something reasonable if not provided.  Can be overriden in an
+  # output section.  You can leave this out to get the default.
+  #
+  # This value is overriden by the SC_LOG_FORMAT env var.
+  #default-log-format: "[%i] %t - (%f:%l) <%d> (%n) -- "
+
+  # A regex to filter output.  Can be overridden in an output section.
+  # Defaults to empty (no filter).
+  #
+  # This value is overriden by the SC_LOG_OP_FILTER env var.
+  default-output-filter:
+
+  # Define your logging outputs.  If none are defined, or they are all
+  # disabled you will get the default - console output.
+  outputs:
+  - console:
+      enabled: yes
+  - file:
+      enabled: yes
+      filename: /var/log/suricata.log
+  - syslog:
+      enabled: no
+      facility: local5
+      format: "[%i] <%d> -- "
+  - drop:
+      enabled: yes
+      filename: drop.log
+      append: yes
+
+nfq:
+      mode: repeat
+      repeat_mark: 1
+      repeat_mask: 1
+
+# PF_RING configuration. for use with native PF_RING support
+# for more info see http://www.ntop.org/PF_RING.html
+pfring:
+
+  # Default interface we will listen on.
+  interface: eth0
+
+  # Default clusterid.  PF_RING will load balance packets based on flow.
+  # All threads/processes that will participate need to have the same
+  # clusterid.
+  cluster-id: 99
+
+  # Default PF_RING cluster type. PF_RING can load balance per flow or per hash.
+  # This is only supported in versions of PF_RING > 4.1.1.
+  cluster-type: cluster_round_robin
+
+# For FreeBSD ipfw(8) divert(4) support.
+# Please make sure you have ipfw_load="YES" and ipdivert_load="YES"
+# in /etc/loader.conf or kldload'ing the appropriate kernel modules.
+# Additionally, you need to have an ipfw rule for the engine to see
+# the packets from ipfw.  For Example:
+#
+#   ipfw add 100 divert 8000 ip from any to any
+#
+# The 8000 above should be the same number you passed on the command
+# line, i.e. -d 8000
+#
+ipfw:
+
+  # Reinject packets at the specified ipfw rule number.  This config
+  # option is the ipfw rule number AT WHICH rule processing continues
+  # in the ipfw processing system after the engine has finished
+  # inspecting the packet for acceptance.  If no rule number is specified,
+  # accepted packets are reinjected at the divert rule which they entered
+  # and IPFW rule processing continues.  No check is done to verify
+  # this will rule makes sense so care must be taken to avoid loops in ipfw.
+  #
+  ## The following example tells the engine to reinject packets
+  # back into the ipfw firewall AT rule number 5500:
+  #
+  # ipfw-reinjection-rule-number: 5500
+
+# Set the default rule path here to search for the files.
+# if not set, it will look at the current working dir
+default-rule-path: /etc/suricata/rules/
+rule-files:
+# - emerging-ftp.rules
+# - emerging-policy.rules
+# - emerging-trojan.rules 
+# - emerging-games.rules
+# - emerging-pop3.rules
+# - emerging-user_agents.rules 
+# - emerging-activex.rules
+# - emerging-rpc.rules
+# - emerging-virus.rules 
+# - emerging-attack_response.rules
+# - emerging-icmp.rules
+# - emerging-scan.rules
+# - emerging-scada.rules
+# - emerging-voip.rules 
+# - emerging-chat.rules
+# - emerging-icmp_info.rules
+# - emerging-shellcode.rules
+# - emerging-web_client.rules 
+# - emerging-imap.rules
+# - emerging-web_server.rules 
+# - emerging-current_events.rules
+# - emerging-inappropriate.rules
+# - emerging-smtp.rules
+# - emerging-web_specific_apps.rules 
+# - emerging-deleted.rules
+# - emerging-malware.rules
+# - emerging-snmp.rules
+# - emerging-worm.rules 
+# - emerging-dns.rules
+# - emerging-misc.rules
+# - emerging-sql.rules                 
+# - emerging-dos.rules
+# - emerging-netbios.rules
+# - emerging-telnet.rules              
+# - emerging-exploit.rules
+# - emerging-p2p.rules
+# - emerging-tftp.rules
+# - emerging-botcc.rules
+# - emerging-compromised.rules
+# - emerging-drop.rules
+# - emerging-dshield.rules
+# - emerging-rbn.rules
+# - emerging-rbn-malvertisers.rules
+# - emerging-tor.rules
+# - emerging-mobile_malware.rules
+
+classification-file: /etc/suricata/rules/classification.config
+
+# Holds variables that would be used by the engine.
+vars:
+
+  # Holds the address group vars that would be passed in a Signature.
+  # These would be retrieved during the Signature address parsing stage.
+  address-groups:
+
+    HOME_NET: "[192.168.0.0/16,10.0.0.0/8,172.16.0.0/12]"
+
+    EXTERNAL_NET: any
+
+    HTTP_SERVERS: "$HOME_NET"
+
+    SMTP_SERVERS: "$HOME_NET"
+
+    SQL_SERVERS: "$HOME_NET"
+
+    DNS_SERVERS: "$HOME_NET"
+
+    TELNET_SERVERS: "$HOME_NET"
+
+    AIM_SERVERS: any
+
+#These vars are required if you're using the Digitalbond Scada signatures in the scada.rules category
+#    DNP3_SERVER: "$HOME_NET"
+#    DNP3_CLIENT: "$HOME_NET"
+#    MODBUS_CLIENT: "$HOME_NET"
+#    MODBUS_SERVER: "$HOME_NET"
+#    ENIP_CLIENT: "$HOME_NET"
+#    ENIP_SERVER: "$HOME_NET"
+
+
+  # Holds the port group vars that would be passed in a Signature.
+  # These would be retrieved during the Signature port parsing stage.
+  port-groups:
+
+    HTTP_PORTS: "80"
+
+    SHELLCODE_PORTS: "!80"
+
+    ORACLE_PORTS: 1521
+
+    SSH_PORTS: 22
+
+#    DNP3_PORTS: 20000
+
+# Host specific policies for defragmentation and TCP stream
+# reassembly.  The host OS lookup is done using a radix tree, just
+# like a routing table so the most specific entry matches.
+host-os-policy:
+  # Make the default policy windows.
+  windows: [0.0.0.0/0]
+  bsd: []
+  bsd_right: []
+  old_linux: []
+  linux: [10.0.0.0/8, 192.168.1.100, "8762:2352:6241:7245:E000:0000:0000:0000"]
+  old_solaris: []
+  solaris: ["::1"]
+  hpux10: []
+  hpux11: []
+  irix: []
+  macos: []
+  vista: []
+  windows2k3: []
+
+###########################################################################
+# Configure libhtp.
+#
+#
+# default-config:  Used when no server-config matches
+#   personality:   List of personalities used by default
+#
+# server-config:   List of server configurations to use if address matches
+#   address:       List of ip addresses or networks for this block
+#   personalitiy:  List of personalities used by this block
+#
+# Currently Available Personalities:
+#   Minimal
+#   Generic
+#   IDS (default)
+#   IIS_4_0
+#   IIS_5_0
+#   IIS_5_1
+#   IIS_6_0
+#   IIS_7_0
+#   IIS_7_5
+#   Apache
+#   Apache_2_2
+###########################################################################
+libhtp:
+
+   default-config:
+     personality: IDS
+
+   server-config:
+
+     - apache:
+         address: [192.168.1.0/24, 127.0.0.0/8, "::1"]
+         personality: Apache_2_2
+
+     - iis7:
+         address:
+           - 192.168.0.0/24
+           - 192.168.10.0/24
+         personality: IIS_7_0
+
+# rule profiling settings. Only effective if Suricata has been built with the
+# the --enable-profiling configure flag.
+#
+profiling:
+
+  rules:
+
+    # Profiling can be disabled here, but it will still have a
+    # performance impact if compiled in.
+    enabled: yes
+
+    # Sort options: ticks, avgticks, checks, matches
+    sort: avgticks
+
+    # Limit the number of items printed at exit.
+    limit: 100
+
+
index 56becaa405d840f893a556eb0a4b48d3611bda46..f06c66c4b0197388826bb132751b0747b362cb74 100644 (file)
@@ -4,8 +4,8 @@
 ###############################################################################
 
 name       = suricata
-version    = 1.0.5
-release    = 1
+version    = 1.1
+release    = 2
 
 groups     = Networking/IDS
 url        = http://www.openinfosecfoundation.org/
@@ -30,21 +30,60 @@ build
                libyaml-devel
                pcre-devel
                pkg-config
-               zlib-devel
+               zlib-devel>=1.2.5-2
        end
 
        configure_options += \
                --enable-gccprotect \
                --enable-nfqueue \
+               --disable-gccmarch-native \
                --disable-static
+
+       install_cmds
+               mkdir -pv %{BUILDROOT}/etc
+               mkdir -pv %{BUILDROOT}/etc/suricata
+               mkdir -pv %{BUILDROOT}/etc/suricata/rules
+               cp -vf %{DIR_SOURCE}/%{name}.conf %{BUILDROOT}/etc/suricata
+               mkdir -pv %{BUILDROOT}/var/log/suricata
+       end
+
 end
 
 
 packages
        package %{name}
+
+               prerquires = systemd-units
+
+               configfiles
+                       /etc/suricata/suricata.conf
+               end
+
+               script postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       /bin/systemctl --no-reload disable suricata.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop suricata.service >/dev/null 2>&1 || :
+               end
+
+               script postun
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl try-restart suricata.service >/dev/null 2>&1 || :
+               end
+
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/suricata/systemd/suricata.service b/suricata/systemd/suricata.service
new file mode 100644 (file)
index 0000000..24cfa98
--- /dev/null
@@ -0,0 +1,14 @@
+[Unit]
+Description=Open Source Next Generation Intrusion Detection and Prevention Engine
+After=syslog.target network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/suricata -c /etc/suricata/suricata.conf -q 0 -q 1 -D
+ExecStartPost=/sbin/iptables -I INPUT -mark ! --mark 1/1 -j NFQUEUE -–queue-balance 0:1
+ExecReload=/bin/kill -HUP $MAINPID
+ExecStop=/sbin/iptables -D INPUT -j NFQUEUE -–queue-balance 0:1
+ExecStopPost=/bin/kill $MAINPID
+
+[Install]
+WantedBy=multi-user.target
index 2ce14b632a7f2ac90e0ae66645d3e65ddfd93074..e3e68cc771370ae801c30953f8c1a0dfcda526ab 100644 (file)
@@ -46,4 +46,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 909e005ec4f570c62b54e1e4de2800d86724d499..3ace7b4b47290554c1e88cb8c224a718518b6e5c 100644 (file)
@@ -27,8 +27,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index db8ff61002adf7abfe5c8b9b085f8c001bd6140e..36681f75a3b5e4b116d4f74c6cf54dd8d836eebd 100644 (file)
@@ -26,7 +26,7 @@ build
                nasm
                python-devel
        end
-       
+
        CFLAGS = -Werror -Wno-unused -finline-limit=2000
 
        prepare_cmds
@@ -63,4 +63,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 24f0a56acb089796f3a9df057bb1f4b985400374..afc0609dfce77b8bccd7520ba15f1371afdd8083 100644 (file)
@@ -64,6 +64,5 @@ end
 packages
        package %{name}
                provides = system-release
-               obsoletes = system-release
        end
 end
diff --git a/systemd/patches/systemd-33-no_manpages.patch b/systemd/patches/systemd-33-no_manpages.patch
deleted file mode 100644 (file)
index b416d80..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-diff -Nur a/Makefile.am b/Makefile.am
---- a/Makefile.am      2011-08-03 04:19:53.000000000 +0200
-+++ b/Makefile.am      2011-08-05 19:41:33.923993685 +0200
-@@ -692,81 +692,18 @@
-         src/dbus-loop.h \
-         src/spawn-agent.h
--MANPAGES = \
--      man/systemd.1 \
--      man/systemctl.1 \
--      man/systemadm.1 \
--      man/systemd-cgls.1 \
--      man/systemd-nspawn.1 \
--      man/systemd-tmpfiles.8 \
--      man/systemd-notify.1 \
--      man/sd_notify.3 \
--      man/sd_readahead.3 \
--      man/sd_booted.3 \
--      man/sd_listen_fds.3 \
--      man/sd_is_fifo.3 \
--      man/systemd.unit.5 \
--      man/systemd.service.5 \
--      man/systemd.socket.5 \
--      man/systemd.mount.5 \
--      man/systemd.automount.5 \
--      man/systemd.swap.5 \
--      man/systemd.timer.5 \
--      man/systemd.path.5 \
--      man/systemd.target.5 \
--      man/systemd.device.5 \
--      man/systemd.snapshot.5 \
--      man/systemd.exec.5 \
--      man/daemon.7 \
--      man/sd-daemon.7 \
--      man/sd-readahead.7 \
--      man/runlevel.8 \
--      man/telinit.8 \
--      man/halt.8 \
--      man/shutdown.8 \
--      man/pam_systemd.8 \
--      man/systemd.conf.5 \
--      man/systemd-logind.conf.5 \
--      man/tmpfiles.d.5 \
--      man/hostname.5 \
--      man/machine-id.5 \
--      man/vconsole.conf.5 \
--      man/locale.conf.5 \
--      man/os-release.5 \
--        man/machine-info.5 \
--      man/modules-load.d.5 \
--      man/sysctl.d.5 \
--        man/systemd-ask-password.1 \
--        man/systemd-loginctl.1
-+MANPAGES =
- if ENABLE_BINFMT
--MANPAGES += \
--      man/binfmt.d.5
-+MANPAGES +=
-+
- endif
--MANPAGES_ALIAS = \
--      man/reboot.8 \
--      man/poweroff.8 \
--      man/sd_is_socket.3 \
--      man/sd_is_socket_unix.3 \
--      man/sd_is_socket_inet.3 \
--      man/sd_notifyf.3 \
--      man/init.1
--
--man/reboot.8: man/halt.8
--man/poweroff.8: man/halt.8
--man/sd_is_socket.3: man/sd_is_fifo.3
--man/sd_is_socket_unix.3: man/sd_is_fifo.3
--man/sd_is_socket_inet.3: man/sd_is_fifo.3
--man/sd_notifyf.3: man/sd_notify.3
--man/init.1: man/systemd.1
--
--dist_man_MANS = \
--      $(MANPAGES) \
--      $(MANPAGES_ALIAS)
-+MANPAGES_ALIAS =
-+
-+dist_man_MANS =
--nodist_man_MANS = \
--      man/systemd.special.7
-+nodist_man_MANS =
- XML_FILES = \
-       ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
index 1ffaf3b8c71793aba962b2ebb76f22420e22b06a..d8032c298fc08b307c3865d325a3228a2625531f 100644 (file)
@@ -4,8 +4,8 @@
 ###############################################################################
 
 name       = systemd
-version    = 33
-release    = 3
+version    = 36
+release    = 5
 
 maintainer = Stefan Schantl <stefan.schantl@ipfire.org>
 groups     = System/Base
@@ -18,8 +18,6 @@ description
        SysV and LSB init scripts.
 end
 
-conflicts += upstart
-
 source_dl  = http://cgit.freedesktop.org/systemd/snapshot/
 
 build
@@ -29,13 +27,17 @@ build
                autoconf
                cryptsetup-luks-devel
                dbus-devel
+               docbook-utils
+               docbook-xsl
                gperf
                intltool
+               libacl-devel
                libcap-devel
                libselinux-devel
                libtool
                libudev-devel>=172
                pam-devel
+               vala
        end
 
        configure_options += \
@@ -110,10 +112,14 @@ packages
                        dbus
                        python-cairo
                        python-dbus
+                       %{name}-units=%{thisver}
                        udev>=172
                        util-linux>=2.19
                end
 
+               prerequires += authconfig
+               conflicts += upstart
+
                script postin
                        # Generate Machine ID.
                        /bin/systemd-machine-id-setup > /dev/null 2>&1 || :
@@ -135,7 +141,7 @@ packages
                        /bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || :
                end
        end
-       
+
        # Package information for systemd-units
        package %{name}-units
                summary =  Configuration files, directories and installation tool for systemd.
@@ -143,7 +149,7 @@ packages
                        This package contains all needed configuration files, directories
                        and installation / configuration tool for systemd.
                end
-       
+
                files
                        /etc/systemd/system
                        /etc/tmpfiles.d
@@ -173,8 +179,12 @@ packages
                        systemctl daemon-reload > /dev/null 2>&1 || :
                end
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 31f82c2d58f17404d799a27db4d7e2aba0e8c679..cdbed7f697c1ab33cccb97b638fa1aa2f5995347 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = sysvinit
 version    = 2.86
-release    = 1
+release    = 3
 
 groups     = System/Base
 url        = https://alioth.debian.org/projects/pkg-sysvinit/
@@ -35,10 +35,19 @@ build
                mkdir -pv %{BUILDROOT}/{bin,sbin,usr/{bin,include}}
                mkdir -pv %{BUILDROOT}/usr/share/man/man{1,5,8}
                make -C src install ROOT=%{BUILDROOT}
+
+               # /bin/mountpoint is part of util-linux >= 2.20
+               rm -vf %{BUILDROOT}/bin/mountpoint \
+                       %{BUILDROOT}/usr/share/man/man1/mountpoint.1
        end
 end
 
 packages
        package %{name}
+               groups += Base
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 74bd88e6d2511e595bc0000bdb90b63136b77c15..9287bf279f373ee9769ef507727010f6a8633eb9 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = tar
 version    = 1.26
-release    = 1
+release    = 2
 
-groups     = Base Build System/Packaging
+groups     = System/Packaging
 url        = http://www.gnu.org/software/tar/
 license    = GPLv3+
 summary    = A GNU file archiving program.
@@ -54,5 +54,10 @@ end
 
 packages
        package %{name}
+               groups += Base Build
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 17815c5e357a043072f20116bdb531993cab7f7e..0ce3438a8ace48441f60802f4828b1296afe20ce 100644 (file)
@@ -4,8 +4,8 @@
 ###############################################################################
 
 name       = tcl
-version    = 8.5.8
-release    = 1
+version    = 8.5.10
+release    = 2
 
 groups     = Development/Languages
 url        = http://tcl.sourceforge.net/
@@ -21,16 +21,15 @@ end
 source_dl  = http://downloads.sourceforge.net/project/%{name}/%{name}/%{thisapp}
 sources    = tcl%{version}-src.tar.gz
 
-CFLAGS        += -DTCL_NO_STACK_CHECK=1
-
 build
        requires
+               perl>=5.14.2-9.ip3
                autoconf
                automake
        end
 
-
        DIR_APP = %{DIR_SRC}/tcl%{version}/unix
+       CFLAGS += -DTCL_NO_STACK_CHECK=1
 
        configure_options +=\
                --enable-shared
@@ -45,7 +44,10 @@ build
        end
 
        test
-               make test
+               # Skip remote tests http, httpold and socket.
+               # Also skip unixInit-1.1. This test fails because "kill -PIPE"
+               # will be executed and we don't support that.
+               make test TESTFLAGS="-skip 'http* socket* unixInit-1.1'"
        end
 
        install_cmds
@@ -56,5 +58,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 849b84f534dc6f74ab002d997064f127f0542770..d491340aab2491b2b178faa1ab9bbc606461eaf2 100644 (file)
@@ -37,4 +37,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 38da6f194b005a3de8c060d500097dd6b9a0b74e..a538c7a9c855fc64850954985fade8990846844b 100644 (file)
@@ -87,4 +87,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 733bc2147fdff81303940a8d69ea36dd22d36a9a..a59e45017ec44a0b88b1d957233d26ff7e91c469 100644 (file)
@@ -37,4 +37,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 6ad56184ed449815ef9c2468d1bff80ba0019160..1bf179b9fac7c42eb1a54f7f3028e08062a93048 100644 (file)
@@ -35,4 +35,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 9197cb24cf1c99d75b0c9a06c23f018efe26dbf1..5d3a7f8a1f90954e168360c464ce5456b302fd24 100644 (file)
@@ -40,4 +40,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index dbca120e21ce3797da87b65abe17038879287791..7aaf8f23bb7666e31fd3d9f3e72eb9a5814c3ba8 100644 (file)
@@ -32,4 +32,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index a57f1a387381457c110b5147efc16bb22e30c40c..2e519829fb4426576edde9ca9b2f68bc21f18da4 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = tunctl
 version    = 1.5
-release    = 1
+release    = 2
 
 groups     = Networking/Tools
 url        = http://tunctl.sourceforge.net/
@@ -22,22 +22,22 @@ end
 
 source_dl  = http://sourceforge.net/projects/tunctl/files/tunctl/%{version}/%{sources}/download
 
-# XXX needs docbook for man page
-
 build
+       requires
+               docbook-utils
+       end
+
        prepare_cmds
                sed -e "s/^CFLAGS.*/CFLAGS = %{CFLAGS}/" -i Makefile
        end
 
-       make_build_targets = tunctl CC=gcc
-
-       install
-               mkdir -pv %{BUILDROOT}/usr/sbin
-               install -m 755 tunctl %{BUILDROOT}/usr/sbin
-       end
 end
 
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/tzdata/tzdata.nm b/tzdata/tzdata.nm
new file mode 100644 (file)
index 0000000..79ef3ed
--- /dev/null
@@ -0,0 +1,56 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+tzdata_version = 2011n
+tzcode_version = 2011i
+
+name       = tzdata
+version    = %{tzdata_version}
+release    = 1
+arch       = noarch
+
+groups     = System/Base
+url        = ftp://munnari.oz.au/pub/
+license    = Public Domain
+summary    = Timezone data.
+
+description
+       This package contains data files with rules for various timezones around
+       the world.
+end
+
+source_dl += ftp://elsie.nci.nih.gov/pub/
+sources    = tzdata-base-0.tar.bz2 tzdata%{tzdata_version}.tar.gz tzcode%{tzcode_version}.tar.gz
+
+build
+       requires
+               gawk
+               perl
+       end
+
+       DIR_APP = %{DIR_SRC}/tzdata
+
+       prepare
+               %{MACRO_EXTRACT} %{DIR_DL}/tzdata-base-0.tar.bz2
+               cd %{DIR_APP}
+
+               mkdir tzdata%{tzdata_version} tzcode%{tzcode_version}
+               %{MACRO_EXTRACT} %{DIR_DL}/tzdata%{tzdata_version}.tar.gz -C tzdata%{tzdata_version}
+               %{MACRO_EXTRACT} %{DIR_DL}/tzcode%{tzcode_version}.tar.gz -C tzcode%{tzcode_version}
+
+               sed -e 's|@objpfx@|'`pwd`'/obj/|' \
+                       -e 's|@datadir@|/usr/share|' \
+                       -e 's|@install_root@|%{BUILDROOT}|' \
+                       Makeconfig.in > Makeconfig
+       end
+
+       #test
+       #       make check
+       #end
+end
+
+packages
+       package %{name}
+end
diff --git a/u-boot/targets b/u-boot/targets
new file mode 100644 (file)
index 0000000..f6fad92
--- /dev/null
@@ -0,0 +1,12 @@
+# HOST_ARCH            platform        target
+# --------------------------------------------
+armv5tel               dockstar        u-boot.kwb
+# Dreamplug is not supported by this version of uboot.
+#armv5tel              dreamplug       u-boot.kwb
+armv5tel               guruplug        u-boot.kwb
+armv5tel               openrd_ultimate u-boot.kwb
+armv5tel               sheevaplug      u-boot.kwb
+armv7hl                        efikamx         u-boot.imx
+armv7hl                        igep0020        u-boot.bin
+armv7hl                        omap3_beagle    u-boot.bin
+armv7hl                        omap4_panda     u-boot.bin
diff --git a/u-boot/u-boot.nm b/u-boot/u-boot.nm
new file mode 100644 (file)
index 0000000..0847564
--- /dev/null
@@ -0,0 +1,87 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = u-boot
+version    = 2011.09
+release    = 1
+sup_arches = armv5tel armv7hl
+
+groups     = Development/Tools
+url        = http://www.denx.de/wiki/U-Boot
+license    = GPLv2+
+summary    = U-Boot utilities.
+
+description
+       U-Boot is a Boot Loader, i.e. its primary purpose in the shipping
+       system is to load some operating system.
+end
+
+source_dl  = ftp://ftp.denx.de/pub/u-boot/
+sources    = %{thisapp}.tar.bz2
+
+build
+       build
+               while read arch platform target; do
+                       # Skip all other architectures.
+                       [ "${arch}" = "%{DISTRO_ARCH}" ] || continue
+
+                       builddir="$(pwd)/build-${platform}"
+                       mkdir -p ${builddir}
+
+                       make O=${builddir} ${platform}_config
+                       make O=${builddir} ${builddir}/${target}
+               done < %{DIR_SOURCE}/targets
+
+               # Build tools.
+               # Need to create a config because the tools won't build without.
+               make sheevaplug_config
+
+               make tools HOSTCC="gcc %{CFLAGS}" HOSTSTRIP="/bin/true" CROSS_COMPILE=""
+               make env HOSTCC="gcc %{CFLAGS}" HOSTSTRIP="/bin/true"
+       end
+
+       install
+               while read arch platform target; do
+                       # Skip all other architectures.
+                       [ "${arch}" = "%{DISTRO_ARCH}" ] || continue
+
+                       builddir="build-${platform}"
+                       installdir="%{BUILDROOT}/usr/lib/%{name}/${platform}"
+                       mkdir -pv ${installdir}
+
+                       install -D -m 644 ${builddir}/${target} ${installdir}
+                       install -D -m 644 ${builddir}/u-boot ${installdir}/uboot.elf
+               done < %{DIR_SOURCE}/targets
+
+               # Install tools.
+               mkdir -pv %{BUILDROOT}/usr/bin %{BUILDROOT}/usr/share/man/man1
+               install -p -m 0755 tools/mkimage %{BUILDROOT}/usr/bin
+               install -p -m 0644 doc/mkimage.1 %{BUILDROOT}/usr/share/man/man1
+               install -p -m 0755 tools/env/fw_printenv %{BUILDROOT}/usr/bin
+               ln -svf fw_printenv %{BUILDROOT}/usr/bin/fw_setenv
+       end
+end
+
+packages
+       package %{name}
+
+       package %{name}-tools
+               summary = U-Boot utilities.
+               description
+                       This package contains a few U-Boot utilities - mkimage
+                       for creating boot images and fw_printenv/fw_setenv for
+                       manipulating the boot environment variables.
+               end
+
+               files
+                       /usr/bin
+                       /usr/share/man/man1
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
diff --git a/udev/console_init b/udev/console_init
deleted file mode 100644 (file)
index 1aaaf4d..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/bash
-###############################################################################
-#                                                                             #
-# IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2008  Michael Tremer & Christian Schmidt                      #
-#                                                                             #
-# This program is free software: you can redistribute it and/or modify        #
-# it under the terms of the GNU General Public License as published by        #
-# the Free Software Foundation, either version 3 of the License, or           #
-# (at your option) any later version.                                         #
-#                                                                             #
-# This program is distributed in the hope that it will be useful,             #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
-# GNU General Public License for more details.                                #
-#                                                                             #
-# You should have received a copy of the GNU General Public License           #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
-#                                                                             #
-###############################################################################
-
-is_true() {
-       [ "$1" = "1" ] || [ "$1" = "yes" ] || [ "$1" = "true" ]
-}
-
-# Native English speakers probably don't have /etc/sysconfig/console at all
-if [ -f /etc/sysconfig/console ]; then
-       . /etc/sysconfig/console
-fi
-
-# Setting default values
-[ -z "$UNICODE" ] && UNICODE=1
-[ -z "$FONT" ] && FONT="LatArCyrHeb-16"
-
-device="/dev/$1"
-
-# Figure out the mode to set the console into
-if is_true "${UNICODE}"; then
-       echo -en '\033%G' > $device
-else
-       echo -en '\033%@' > $device
-fi
-
-# Setting font
-setfont ${FONT} -C $device
-
-# Setting up keyboard
-if [ -n "$KEYMAP" ]; then
-       if is_true "${UNICODE}"; then
-               loadkeys -u $KEYMAP >/dev/null
-       else
-               loadkeys $KEYMAP >/dev/null
-       fi
-       [ -n "$KEYMAP_CORRECTIONS" ] && \
-               loadkeys $KEYMAP_CORRECTIONS >/dev/null
-fi
diff --git a/udev/rules/10-console.rules b/udev/rules/10-console.rules
deleted file mode 100644 (file)
index 6e8c458..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-# Console initialization - keyboard, font, etc.
-KERNEL=="tty0",                RUN+="/lib/udev/console_init %k"
-
-# Check and set up serial and serial-like consoles if necessary
-KERNEL=="console",     RUN+="/lib/udev/console_check %k"
-KERNEL=="ttySG*",      RUN+="/lib/udev/console_check %k"
-KERNEL=="xvc*",                RUN+="/lib/udev/console_check %k"
-KERNEL=="hvsi*",       RUN+="/lib/udev/console_check %k"
-KERNEL=="hvc*",                RUN+="/lib/udev/console_check %k"
index d7176ff324f21834eefaf359c3365ca85aa5f7ea..1629b1cea37195e7f259a876d6be114be291ed82 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = udev
 version    = 172
-release    = 2
+release    = 4
 
-groups     = Base System/Base
+groups     = System/Base
 url        = ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/
 license    = GPLv2+
 summary    = A userspace implementation of devfs.
@@ -45,10 +45,6 @@ build
                --with-systemdsystemunitdir=/lib/systemd/system
 
        install_cmds
-               # Install rules
-               mkdir -pv %{BUILDROOT}/lib/udev/rules.d/
-               install -m644 -v %{DIR_SOURCE}/rules/*.rules %{BUILDROOT}/lib/udev/rules.d/
-
                # Install pkg-config files correctly
                mv -v %{BUILDROOT}/lib/pkgconfig %{BUILDROOT}/usr/lib
 
@@ -59,8 +55,6 @@ build
                ln -svf ../../../../lib/udev/udev-acl \
                        %{BUILDROOT}/usr/lib/ConsoleKit/run-seat.d/udev-acl.ck
 
-               install -m 755 %{DIR_SOURCE}/console_init %{BUILDROOT}/lib/udev/
-
                # Remove network rules. We have our own in the network package.
                rm -v %{BUILDROOT}/lib/udev/{write_net_rules,rules.d/75-persistent-net-generator.rules}
        end
@@ -68,13 +62,18 @@ end
 
 packages
        package %{name}
+               groups += Base
        end
-       
+
        package lib%{name}
                template LIBS
        end
-       
+
        package lib%{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 188edc50ec12f6d7f735db604df2d06ad085f941..b6288f3653efffc26856b1a85ac91dff30021fbc 100644 (file)
@@ -53,4 +53,8 @@ packages
                        xfsprogs
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index c383406d5895eafe59e85d995052e053045cd4d0..fd1a7899d1b8e10bf569d30c2f8809c1cc3f3ec1 100644 (file)
@@ -48,4 +48,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index faf915d8a84ba6252bf55934e2e2aba9f5d4112e..9a1ab51b9f011d2c03f8f4994156f4d075789b8e 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = unzip
 version    = 6.0
-release    = 1
+release    = 3
 
 groups     = Applications/Archiving
 url        = ftp://ftp.info-zip.org/pub/infozip/src/
@@ -40,13 +40,20 @@ build
                CC="gcc %{CFLAGS}" \
                LD=gcc
 
-       make_install_targetsi += \
+       make_install_targets += \
                prefix=%{BUILDROOT}/usr \
                MANDIR=/usr/share/man/man1 \
                INSTALL="cp -p"
+
+       install_cmds
+               chown -v root.root %{BUILDROOT}/usr/bin/zipgrep
+       end
 end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index a3fdc088de0202ba419ec2993e566f4700ed510d..67949dd25affce370772f10414ce58ac596347d7 100644 (file)
@@ -41,12 +41,16 @@ packages
        package %{name}
                requires = udev util-linux
        end
-       
+
        package %{name}-libs
                template LIBS
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/usb-modeswitch-data/usb-modeswitch-data.nm b/usb-modeswitch-data/usb-modeswitch-data.nm
new file mode 100644 (file)
index 0000000..af02b40
--- /dev/null
@@ -0,0 +1,45 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = usb-modeswitch-data
+version    = 20111023
+release    = 1
+arch       = noarch
+
+groups     = Applications/System
+url        = http://www.draisberghof.de/usb_modeswitch
+license    = GPLv2
+summary    = A USB mode switching tool.
+
+description
+       USB_ModeSwitch is (surprise!) a mode switching tool for controlling
+       "flip flop" (multiple device) USB gear.
+end
+
+source_dl  = http://www.draisberghof.de/usb_modeswitch/
+sources    = %{thisapp}.tar.bz2
+
+build
+       build
+               # Nothing to do here.
+       end
+
+       install
+               mkdir -pv %{BUILDROOT}/etc/usb_modeswitch.d/
+               mkdir -pv %{BUILDROOT}/lib/udev/rules.d/
+
+               install -p -m 644 usb_modeswitch.d/* %{BUILDROOT}/etc/usb_modeswitch.d/
+               install -p -m 644 40-usb_modeswitch.rules %{BUILDROOT}/lib/udev/rules.d/
+       end
+end
+
+packages
+       package %{name}
+               requires
+                       udev
+                       usb-modeswitch
+               end
+       end
+end
index 7b50d3a319b91869b6261c5c4026b090396bd54b..2e8ebada35dd307c04c12ea370b6a77f7641b271 100644 (file)
@@ -4,7 +4,7 @@
 ###############################################################################
 
 name       = usb-modeswitch
-version    = 1.1.9
+version    = 1.2.0
 release    = 1
 
 groups     = Applications/System
@@ -28,4 +28,10 @@ end
 
 packages
        package %{name}
+               requires += usb-modeswitch-data
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 7319cae5dde487ca7bc32d3aec964adc48f95f02..6a24f0966e7ac1219cf38fcdcf4bee522f0e3d7f 100644 (file)
@@ -37,4 +37,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index bbf76ca2ebe762b108846c9ec37ba1711643753d..a8e8eb917f8fea716388c5c33e88e318e6099ea7 100644 (file)
@@ -39,10 +39,10 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
-       
+
                files
                        /usr/bin/
                        /usr/include/
@@ -50,4 +50,8 @@ packages
                        */lib/*.so
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index d403c9b549657784108db25878042d2339f765c3..351c79496705d2ae15dec47b154800712f8329ee 100644 (file)
@@ -4,9 +4,9 @@
 ###############################################################################
 
 name       = util-linux
-version    = 2.19
-major_ver  = 2.19
-release    = 3
+major_ver  = 2.20
+version    = %{major_ver}
+release    = 1
 
 groups     = System/Base
 url        = http://kernel.org/~kzak/util-linux/
@@ -76,22 +76,17 @@ build
 
                # Remove deprecated commands
                rm -fv %{BUILDROOT}/{sbin,usr/share/man/man*}/{fsck,mkfs}.{bfs,minix}* \
-                       %{BUILDROOT}/usr/bin/chkdupexe %{BUILDROOT}/usr/bin/vi{gr,pw} \
-                       %{BUILDROOT}/sbin/{sln,shutdown} %{BUILDROOT}/bin/{line,newgrp,pg}
+                       %{BUILDROOT}/usr/{,s}bin/{chkdupexe,newgrp,vi{gr,pw}} \
+                       %{BUILDROOT}/sbin/{sln,shutdown} %{BUILDROOT}/bin/{line,pg}
+               rm -fv %{BUILDROOT}/usr/share/man/man1/{chkdupexe,line,pg,newgrp}.* \
+                       %{BUILDROOT}/usr/share/man/man8/{vipw,vigr}.*
                rm -fv %{BUILDROOT}/usr/share/getopt/*.tcsh
 
-               # Create /etc/mtab symlink
-               mkdir -pv %{BUILDROOT}/etc
-               ln -svf /proc/mounts %{BUILDROOT}/etc/mtab
-       end
-
-       export PKG_REQUIRES_FILTER = /proc/.*/mounts
-end
-
-# This symlink is allowed to be absolute.
-quality-agent
-       whitelist_symlink
-               /etc/mtab
+               # Set capabilities
+               chmod -v -s %{BUILDROOT}/bin/mount
+               setcap CAP_DAC_OVERRIDE,CAP_SYS_ADMIN=ep %{BUILDROOT}/bin/mount
+               chmod -v -s %{BUILDROOT}/bin/umount
+               setcap CAP_DAC_OVERRIDE,CAP_SYS_ADMIN=ep %{BUILDROOT}/bin/umount
        end
 end
 
@@ -108,9 +103,20 @@ packages
                conflicts
                        setup<3.0-2
                        util-linux-ng
+                       sysvinit<=2.86-2
+               end
+
+               preprequires += coreutils
+
+               script postin
+                       touch /var/log/lastlog
+
+                       # mtab symlink
+                       rm -f /etc/mtab
+                       ln -s /proc/mounts /etc/mtab
                end
        end
-       
+
        # Package information for libblkid
        package libblkid
                summary =  Block device ID library.
@@ -118,17 +124,17 @@ packages
                        This is the block device identification library,
                        part of util-linux.
                end
-       
+
                files
                        /lib/libblkid.*
                end
        end
-       
+
        # Package information for libblkid-devel
-       package libblikid-devel
+       package libblkid-devel
                summary =  Development library and header of libblkid.
                description = %{summary}
-       
+
                files
                        /usr/include/blkid/
                        /usr/lib/libblkid.*
@@ -136,7 +142,7 @@ packages
                        /usr/share/man/man3/*blkid*
                end
        end
-       
+
        # Package information for libuuid
        package libuuid
                summary =  Universally unique ID library.
@@ -144,17 +150,17 @@ packages
                        This is the universally unique ID library,
                        part of util-linux.
                end
-       
+
                files
                        /lib/libuuid.*
                end
        end
-       
+
        # Package information for libuuid-devel
        package libuuid-devel
                summary =  Development library and header of libuuid.
                description = %{summary}
-       
+
                files
                        /usr/include/uuid/
                        /usr/lib/libuuid.*
@@ -162,7 +168,7 @@ packages
                        /usr/share/man/man3/*uuid*
                end
        end
-       
+
        # Package information for libmount
        package libmount
                summary =  Device mounting library.
@@ -170,17 +176,17 @@ packages
                        This is the device mounting library,
                        part of util-linux.
                end
-       
+
                files
                        /lib/libmount.*
                end
        end
-       
+
        # Package information for libmount-devel
        package libmount-devel
                summary =  Development library and header of libmount.
                description = %{summary}
-       
+
                files
                        /usr/include/mount/
                        /usr/lib/libmount.*
@@ -188,4 +194,8 @@ packages
                        /usr/share/man/man3/*mount*
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 84b2f028e9c57ba81c8bdc95396b44269c3d878f..015c06a78dc1465f96d5f76b5698130c74b2f63d 100644 (file)
@@ -42,8 +42,12 @@ packages
        package %{name}
                requires = glib2
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 20ba02658feec4cd91060b0e624625201b06d3a2..d826fb60b054d89baa6581f2e8cb1a46344fc173 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = vim
 version    = 7.3
-release    = 1
+release    = 2
 
-groups     = Base Applications/Editors
+groups     = Applications/Editors
 url        = http://www.vim.org
 license    = PublicDomain/Charityware
 summary    = Very feature- and powerful editor.
@@ -52,5 +52,10 @@ end
 
 packages
        package %{name}
+               groups += Base
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index 18f4d7cab7e6ede06159fb4f484b7e983d21806d..c9ddf100022dd232186e768deca9fa771ff39a70 100644 (file)
@@ -38,4 +38,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index f34c677dacac99d68a9306ef992d37d1a63e7fdd..8eb1f4cda09cfd4c5441c2d5e2d6f37b97788b1e 100644 (file)
@@ -53,4 +53,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index e86f903b5dd894b0872d9d78cffa3e46e32d3404..ea4f1a0d2c772422caf640ca98cd9cebbf4ad7e3 100644 (file)
@@ -36,4 +36,8 @@ packages
        package %{name}
                requires = wireless-tools
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 29d21c90696e1b518f16131fc82ae65d80678745..7803a2cb984af6756691d6297613dbd547263d29 100644 (file)
@@ -38,4 +38,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index aab6f00678f43bbdbcfa9843a67e122deecfd655..3f9a756b1d09387b6ef10d6c5017811c6b660438 100644 (file)
@@ -5,9 +5,9 @@
 
 name       = which
 version    = 2.20
-release    = 1
+release    = 2
 
-groups     = Base Build Applications/System
+groups     = Applications/System
 url        = http://www.xs4all.nl/~carlo17/which/
 license    = GPLv3
 summary    = Displays where a particular program in your path is located.
@@ -21,4 +21,10 @@ source_dl  = http://carlo17.home.xs4all.nl/which/
 
 packages
        package %{name}
+               groups += Base Build
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index c7faadaa52ee6bd73bff963be06d21f7b9bbece6..44a5f73d40cbc779516769d37c07e1bfe12a3f5d 100644 (file)
@@ -45,8 +45,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 05730fd2cbc6c3a538642f86d6b9fe62ea01aa67..fb0af1a8387d7b1102b05c6c9079a96a03cdffe7 100644 (file)
@@ -54,4 +54,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 4d7b580a5156a33b9e2acd26fda371095a192263..ebeb037d5152372b0f89ebd01bcdd9d2e59847fa 100644 (file)
@@ -44,8 +44,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 07bf2a1b9682377e35297e7c19b48c8cb2103e43..ab414456913a8fcfe8b7f2f745f9ace8c143db80 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = xen
 version    = 4.1.1
-release    = 3
+release    = 4
 
 maintainer = Ben Schweikert <ben.schweikert@ipfire.org>
 groups     = Applications/Virtualization
@@ -32,7 +32,9 @@ build
                python
                python-devel
                sdl-devel
+               texinfo
                xorg-x11-proto-devel
+               wget
                zlib-devel
        end
 
@@ -40,8 +42,8 @@ build
                # Following two lines are disabling HVM. HVM does not work because \
                # of some PIE errors we get when we try to build the firmware part \
                # needed for different architektures.
-               sed -i -e '/^CONFIG_IOEMU := y$$/d' config/*.mk
-               sed -i -e '/SUBDIRS-$%{CONFIG_X86} += firmware/d' tools/Makefile
+               sed -i -e '/^CONFIG_IOEMU := y$/d' config/*.mk
+               sed -i -e '/SUBDIRS-$(CONFIG_X86) += firmware/d' tools/Makefile
 
                rm -f Config.mk~
        end
@@ -65,8 +67,7 @@ end
 
 packages
        package %{name}
-       end
-       
+
        package %{name}-libs
                template LIBS
 
@@ -74,33 +75,33 @@ packages
                        This package contains the libraries needed to
                        run applications which manage Xen virtual machines
                end
-       
+
                files += /usr/lib/fs
        end
-       
+
        package %{name}-hypervisor
                summary = The Xen hypervisor.
                description
                        This package contains the Xen hypervisor.
                end
-       
+
                files
                        /boot/*
                end
        end
-       
+
        package %{name}-runtime
                summary = Runtime programms and daemons for Xen environments.
                description
                        This package contains the runtime programs
                        and daemons which form the core Xen userspace environment.
                end
-       
+
                files
                        /usr/bin/*
                end
        end
-       
+
        package %{name}-devel
                template DEVEL
 
@@ -109,4 +110,8 @@ packages
                        develop applications which manage Xen virtual machines.
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 24dfbc0ac32837c7b3b19188e6a8a9e4ff39368e..51e2d736abc47a0d0a45f5496d33917d8233ada5 100644 (file)
@@ -63,8 +63,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/xmlto/xmlto.nm b/xmlto/xmlto.nm
new file mode 100644 (file)
index 0000000..3ca1240
--- /dev/null
@@ -0,0 +1,50 @@
+###############################################################################
+# IPFire.org    - An Open Source Firewall Solution                            #
+# Copyright (C) - IPFire Development Team <info@ipfire.org>                   #
+###############################################################################
+
+name       = xmlto
+version    = 0.0.24
+release    = 1
+
+groups     = Applications/System
+url        = https://fedorahosted.org/xmlto/
+license    = GPLv2+
+summary    = A tool for converting XML files to various formats.
+
+description
+       This is a package for converting XML files to various formats using XSL
+       stylesheets.
+end
+
+source_dl  = https://fedorahosted.org/releases/x/m/%{name}/
+source     = %{thisapp}.tar.bz2
+
+build
+       requires
+               docbook-dtds
+               docbook-xsl
+               flex
+               libxslt
+               util-linux
+       end
+
+       configure_options +=\
+               BASH=/bin/bash
+
+       test
+               make check
+       end
+end
+
+packages
+       package %{name}
+               requires
+                       util-linux
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
+end
index ce5358a096af70f18e243f8c9c19a29f254d8abd..2a76462c0cc62a813200d9b587a3adb1727a5649 100644 (file)
@@ -48,4 +48,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index b85e2428e7489111e6dc36b048c19241c54daaec..56b0c5693e85a1c63650e6b74d38c5c32b3f7ef9 100644 (file)
@@ -48,4 +48,8 @@ packages
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index c72bddca5d45c4d65790bd8c95e3790acb96dd64..9c2ae1d0ff5419271a3801e79ec7e79c615c1892 100644 (file)
@@ -63,4 +63,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 03f6f9a0ce7a24cfc9bb08e540c70a5858d12dad..bcaa6a738b4b9786b94fdfc84d4d4ce5aca171d1 100644 (file)
@@ -42,4 +42,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 8badb77a22f852a0e61adaf5db67bcc36c8839ea..5289c41e00dfd8a46df35075aac6d76973f2dada 100644 (file)
@@ -43,4 +43,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 91fd257a973d363ee1765a501e3b99d48fb9a716..af61d9e99c7813111aac35e004caa2bedfcac372 100644 (file)
@@ -52,4 +52,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index e3d57f0d040ab3f8fa5faa0c0b7de105f6d498b7..87d378fae57c4c49f4234c1266c3660ebcefcf68 100644 (file)
@@ -53,8 +53,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 66fc404ce5d18a88bb60e5e274602b8dc02346e3..eee113a7fa1b0aaeb57f9b16908d4608edbb1d9b 100644 (file)
@@ -47,4 +47,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index a24655faefbca1ee17ac4d7990906d0dca2ebc3c..15d6eaabecd0b19b76af93c06302ccb6d72c20fe 100644 (file)
@@ -47,4 +47,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index df9c317ab6cf23a1446cca8772b5de3d23c9a974..b849bd4cdc7e69fb0310e3883db1660ba364437e 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = xorg-x11-font-utils
 version    = 7.4
-release    = 2
+release    = 3
 
 maintainer = Stefan Schantl <stefan.schantl@ipfire.org>
 groups     = X/Fonts
@@ -36,7 +36,7 @@ build
                libfontenc-devel
                pkg-config
                xorg-x11-proto-devel
-               zlib-devel              
+               zlib-devel
        end
 
        configure_options += \
@@ -66,6 +66,10 @@ build
                                make install DESTDIR=%{BUILDROOT}
                        fi
                done
+
+               # Install xorg-x11-fonts-update-dirs
+               install -m 0744 %{DIR_SOURCE}/xorg-x11-fonts-update-dirs %{BUILDROOT}/usr/bin/
+               sed -i "s:@DATADIR@:/usr/share:" %{BUILDROOT}/usr/bin/xorg-x11-fonts-update-dirs
        end
 end
 
@@ -80,4 +84,8 @@ packages
                        freetype-devel
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/xorg-x11-font-utils/xorg-x11-fonts-update-dirs b/xorg-x11-font-utils/xorg-x11-fonts-update-dirs
new file mode 100644 (file)
index 0000000..536bfe8
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/sh
+# This script is used by the xorg-x11-fonts package in the %post stage for
+# some fonts to generate the right encodings.
+
+fontdir=""
+encodingsdir="@DATADIR@/X11/fonts/encodings"
+
+# some fonts need to skip mkfontscale, set to "yes" to skip
+skip_fontscale=""
+# some fonts need to run ttmkfdir, set to "yes" to run
+need_ttmkfdir=""
+
+if [ $# -lt 1 ]; then
+    echo "Need at least one parameter for font dir."
+    exit 1
+fi
+
+while [ $# != 0 ]; do
+    case $1 in
+        --skip-fontscale)
+        skip_fontscale="yes"
+        ;;
+        --need-ttmkfdir)
+        need_ttmkfdir="yes"
+        ;;
+        --encodingsdir)
+        shift
+        encodingsdir="$1"
+        ;;
+        *)
+        fontdir="$1"
+
+        if [ $# != 1 ]; then
+            echo "Too many parameters."
+            exit 1
+        fi
+        ;;
+    esac
+    shift
+done
+
+if [ "$skip_fontscale" != "yes" ]; then
+    mkfontscale $fontdir
+fi
+if [ "$need_ttmkfdir" = "yes" ]; then
+    ttmkfdir $fontdir
+fi
+
+mkfontdir $fontdir
+fc-cache $fontdir
+
+if ! [ -z "$encodingsdir" ]; then
+    [ -d "$encodingsdir" ] || mkdir -p "$encodingsdir"
+    oldpwd=$(pwd)
+    cd "$encodingsdir"
+    mkfontscale -n -e "$encodingsdir" -e "$encodingsdir/large"
+    cd ${oldpwd}
+fi
+
+
index 6b98ac6c323d629d1feb24118ce47000d44ba7f1..856df62e70fae8f9a6873af90a89f5445f0ca7ea 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = xorg-x11-fonts
 version    = 7.2
-release    = 3
+release    = 4
 arch       = noarch
 
 maintainer = Stefan Schantl <stefan.schantl@ipfire.org>
@@ -19,7 +19,8 @@ description
        Arabic fonts for use with X Window System.
 end
 
-source_dl = http://ftp.x.org/pub/individual/font/ http://unifoundry.com/
+source_dl  = http://ftp.x.org/pub/individual/font/
+source_dl += http://unifoundry.com/
 
 sources = \
        encodings-1.0.3.tar.bz2 \
@@ -113,11 +114,290 @@ build
                mkdir -pv %{BUILDROOT}/usr/share/X11/fonts/misc
                cp -vf %{DIR_DL}/unifont-5.1.20080820.pcf.gz \
                        %{BUILDROOT}/usr/share/X11/fonts/misc/unifont.pcf.gz
+
+               # XXX Do we need to create these symlinks to use the fonts - check this in a running X environment.
+               # Install catalogue symlinks
+               #mkdir -pv %{BUILDROOT}/etc/X11/fontpath.d
+               #ln -svf ../../../usr/share/X11/fonts/100dpi %{BUILDROOT}/etc/X11/fontpath.d/xorg-x11-fonts-100dpi
+               #ln -svf ../../../usr/share/X11/fonts/75dpi %{BUILDROOT}/etc/X11/fontpath.d/xorg-x11-fonts-75dpi
+               #ln -svf ../../../usr/share/X11/fonts/cyrillic %{BUILDROOT}/etc/X11/fontpath.d/xorg-x11-fonts-cyrillic
+               #ln -svf ../../../usr/share/X11/fonts/misc %{BUILDROOT}/etc/X11/fontpath.d/xorg-x11-fonts-misc
+               #ln -svf ../../../usr/share/X11/fonts/Type1 %{BUILDROOT}/etc/X11/fontpath.d/xorg-x11-fonts-Type1
        end
 end
 
 packages
+       # Template for 75 DPI fonts
+       template 75DPI
+               requires
+                       fontconfig
+               end
+
+               #files
+               #       /etc/X11/fontpath.d/xorg-x11-fonts-75dpi
+               #end
+
+               prerequires = xorg-x11-font-utils
+
+               script postin
+                       /usr/bin/mkfontdir /usr/share/X11/fonts/75dpi
+               end
+
+               script postun
+                       /usr/bin/mkfontdir /usr/share/X11/fonts/75dpi
+               end
+       end
+
+       # Template for 100 DPI fonts
+       template 100DPI
+               requires
+                       fontconfig
+               end
+
+               #files
+               #       /etc/X11/fontpath.d/xorg-x11-fonts-100
+               #end
+
+               prerequires = xorg-x11-font-utils
+
+               script postin
+                       /usr/bin/mkfontdir /usr/share/X11/fonts/100dpi
+               end
+
+               script postun
+                       /usr/bin/mkfontdir /usr/share/X11/fonts/100dpi
+               end
+       end
+
        package %{name}
-               requires = fontconfig
+               summary = Bitmap fonts for the X Window System.
+               description
+                       This package contains misc bitmap Chinese, Japanese, Korean, Indic, and Arabic
+                       fonts for use with X Window System.
+               end
+
+               requires
+                       fontconfig
+               end
+
+               prerequires = xorg-x11-font-utils
+
+               script postin
+                       /usr/bin/xorg-x11-fonts-update-dirs --skip-fontscale /usr/share/X11/fonts/misc
+               end
+
+               script postun
+                       /usr/bin/xorg-x11-fonts-update-dirs --skip-fontscale /usr/share/X11/fonts/misc
+               end
+       end
+
+       package %{name}-Type1
+               summary = Type1 fonts provided by the X Window System.
+               description
+                       A collection of Type1 fonts which are part of the core X Window System
+                       distribution.
+               end
+
+               requires
+                       fontconfig
+               end
+
+               files
+                       /usr/share/X11/fonts/Type1/
+               end
+
+               prerequires = xorg-x11-font-utils
+
+               script postin
+                       /usr/bin/xorg-x11-fonts-update-dirs --skip-fontscale /usr/share/X11/fonts/Type1
+               end
+
+               script postun
+                       /usr/bin/xorg-x11-fonts-update-dirs --skip-fontscale /usr/share/X11/fonts/Type1
+               end
+       end
+
+       package %{name}-75dpi
+               template 75DPI
+
+               summary = A set of 75dpi resolution fonts for the X Window System.
+               description
+                       A set of 75 dpi fonts used by the X window system.
+               end
+
+               files +=\
+                       /usr/share/X11/fonts/75dpi/
+       end
+
+       package %{name}-100dpi
+               template 100DPI
+
+               summary = A set of 100dpi resolution fonts for the X Window System.
+               description
+                       A set of 100 dpi fonts used by the X window system.
+               end
+
+               files +=\
+                       /usr/share/X11/fonts/100dpi/
+       end
+
+       package %{name}-ISO8859-1-75dpi
+               template 75DPI
+
+               summary = A set of 75dpi ISO-8859-1 fonts for X.
+               description
+                       Contains a set of 75dpi fonts for ISO-8859-1.
+               end
+
+               files +=\
+                       /usr/share/X11/fonts/75dpi/*ISO8859-1.*
+       end
+
+       package %{name}-ISO8859-1-100dpi
+               template 100DPI
+
+               summary = A set of 100dpi ISO-8859-1 fonts for X.
+               description
+                       Contains a set of 100dpi fonts for ISO-8859-1.
+               end
+
+               files +=\
+                       /usr/share/X11/fonts/100dpi/*ISO8859-1.*
+       end
+
+       package %{name}-ISO8859-2-75dpi
+               template 75DPI
+
+               summary = A set of 75dpi Central European language fonts for X.
+               description
+                       Contains a set of 75dpi fonts for Central European languages.
+               end
+
+               files +=\
+                       /usr/share/X11/fonts/75dpi/*ISO8859-2.*
+       end
+
+       package %{name}-ISO8859-2-100dpi
+               template 100DPI
+
+               summary = A set of 100dpi Central European language fonts for X.
+               description
+                       Contains a set of 100dpi fonts for Central European languages.
+               end
+
+               files +=\
+                       /usr/share/X11/fonts/100dpi/*ISO8859-2.*
+       end
+
+       package %{name}-ISO8859-9-75dpi
+               template 75DPI
+
+               summary = ISO8859-9-75dpi fonts.
+               description
+                       Contains a set of 75dpi fonts for the Turkish language.
+               end
+
+               files +=\
+                       /usr/share/X11/fonts/75dpi/*ISO8859-9.*
+       end
+
+       package %{name}-ISO8859-9-100dpi
+               template 100DPI
+
+               summary = ISO8859-9-100dpi fonts.
+               description
+                       Contains a set of 100dpi fonts for the Turkish language.
+               end
+
+               files +=\
+                       /usr/share/X11/fonts/100dpi/*ISO8859-9.*
+       end
+
+       package %{name}-ISO8859-14-75dpi
+               template 75DPI
+
+               summary = ISO8859-14-75dpi fonts.
+               description
+                       Contains a set of 75dpi fonts in the ISO8859-14 encoding which
+                       provide Welsh support.
+               end
+
+               files +=\
+                       /usr/share/X11/fonts/75dpi/*ISO8859-14.*
+       end
+
+       package %{name}-ISO8859-14-100dpi
+               template 100DPI
+
+               summary = ISO8859-14-100dpi fonts.
+               description
+                       Contains a set of 100dpi fonts in the ISO8859-14 encoding which
+                       provide Welsh support.
+               end
+
+               files +=\
+                       /usr/share/X11/fonts/100dpi/*ISO8859-14.*
+       end
+
+       package %{name}-ISO8859-15-75dpi
+               template 75DPI
+
+               summary = ISO8859-15-75dpi fonts.
+               description
+                       Contains a set of 75dpi fonts in the ISO8859-15 encoding which
+                       provide Euro support.
+               end
+
+               files +=\
+                       /usr/share/X11/fonts/75dpi/*ISO8859-15.*
+       end
+
+       package %{name}-ISO8859-15-100dpi
+               template 100DPI
+
+               summary = ISO8859-15-100dpi fonts.
+               description
+                       Contains a set of 100dpi fonts in the ISO8859-15 encoding which
+                       provide Euro support.
+               end
+
+               files +=\
+                       /usr/share/X11/fonts/100dpi/*ISO8859-15.*
+       end
+
+       package %{name}-cyrillic
+               summary = Cyrillic fonts for X.
+               description
+                       Contains a set of Cyrillic fonts.
+               end
+
+               requires
+                       fontconfig
+               end
+
+               files
+                       /usr/share/X11/fonts/cyrillic/
+               end
+
+               prerequires = xorg-x11-font-utils
+
+               script postin
+                       /usr/bin/mkfontdir /usr/share/X11/fonts/cyrillic
+               end
+
+               script postun
+                       /usr/bin/mkfontdir /usr/share/X11/fonts/cyrillic
+               end
+       end
+
+       package %{name}-unifont
+               summary = The GNU unifont.
+               description
+                       GNU Unifont, contains glyphs for every printable code point in the Unicode 5.1 Basic Multilingual Plane (BMP).
+               end
+
+               files
+                       /usr/share/X11/fonts/misc/unifont.pcf.gz
+               end
        end
 end
index c46aa314d5dac938bf368de7e8807dee553894c7..7ed9a8b2a282f8caffc6f3f8a12b06c4ecd48943 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = xorg-x11-server
 version    = 1.8.2
-release    = 3
+release    = 4
 
 maintainer = Stefan Schantl <stefan.schantl@ipfire.org>
 groups     = X/Server
@@ -137,18 +137,26 @@ packages
                        pixman
                        udev
                        xkeyboard-config
+                       xorg-x11-drv-evdev
+                       xorg-x11-drv-keyboard
+                       xorg-x11-drv-mouse
+                       xorg-x11-drv-vesa
                        xorg-x11-fonts
                        xorg-x11-font-utils
                        xorg-x11-xkb-utils
                end
        end
-       
+
        package %{name}-devel
                template DEVEL
-       
+
                requires
                        libpciaccess-devel
                        pixman-devel
                end
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index b73bd2dd0957ffb92fde6aeef3219255888530e3..cd8243624662b72995bfd879689bed6a57041b16 100644 (file)
@@ -29,4 +29,8 @@ end
 
 packages
        package %{name}
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 25abfb7c98244e4201fe8fb54049b8795749fb72..c7d194e794eb4c8b6bb4ff88b87878f80fb4b2d1 100644 (file)
@@ -65,4 +65,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 1ce8c6a831cc6ebabe6b8ee62a5361c2fc28215b..eebec73e80c02afc9fec9962849550c1bbb9edcf 100644 (file)
@@ -37,4 +37,8 @@ end
 packages
        package %{name}
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 7ed670822948449d99c4d23306dfdf9134f5c882..52b824ad6087c26e92420dc1f52718dcd42461cb 100644 (file)
@@ -48,4 +48,8 @@ packages
        package %{name}
                requires = xorg-x11-server
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
index 83af5ad7cfbcc25e4b8f63143c0461d4feb0124d..75711a0e3e51435b75834045299a76d7e70f8c4d 100644 (file)
--- a/xz/xz.nm
+++ b/xz/xz.nm
@@ -5,11 +5,13 @@
 
 name       = xz
 version    = 5.0.3
-release    = 1
+release    = 6
 
-groups     = Build Applications/Compression
+compat_version = 4.999.9beta
+
+groups     = Applications/Compression
 url        = http://tukaani.org/xz/
-license    = GPLv2+
+license    = LGPLv2+
 summary    = LZMA Utils.
 
 description
@@ -20,17 +22,70 @@ description
        tools.
 end
 
-source_url = http://tukaani.org/xz/
-sources    = %{thisapp}.tar.xz
+source_dl  = http://tukaani.org/xz/
+sources    = %{thisapp}.tar.xz %{name}-%{compat_version}.tar.xz
+
+build
+       build_cmds
+               # Build compat version of library.
+               cd %{DIR_SRC}/%{name}-%{compat_version}
+               ./configure %{configure_options}
+               make %{PARALLELISMFLAGS}
+       end
+
+       test
+               export LD_LIBRARY_PATH=$(pwd)/src/liblzma/.libs
+               make check
+       end
+
+       install_cmds
+               # Install comapt version of library.
+               cd %{DIR_SRC}/%{name}-%{compat_version}
+               cp -vr src/liblzma/.libs/liblzma.so.0* %{BUILDROOT}/usr/lib
+       end
+end
 
 packages
        package %{name}
+               groups += Build
+       end
+
+       package %{name}-libs
+               template LIBS
+       end
 
        package %{name}-devel
                template DEVEL
        end
 
-       package %{name}-libs
-               template LIBS
+       package xz-lzma-compat
+               summary = Older LZMA format compatibility binaries.
+               description
+                       The xz-lzma-compat package contains compatibility
+                       links for older commands that deal with the older
+                       LZMA format.
+               end
+               license = GPLv2+ and LGPLv2+
+               groups += Build
+
+               requires = %{name}=%{thisver}
+               provides = lzma
+
+               files
+                       /usr/bin/*lz*
+                       /usr/share/man/man1/*lz*
+               end
+       end
+
+       package xz-compat-libs
+               summary = Compatibility version of %{name} (%{compat_version}).
+
+               files
+                       /usr/lib/lib*.so.0*
+               end
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end
index dc21ca82c119b105669a1df99cd692c51b1ae310..5820fae331de674bb6cc1f7e21512151e80ec223 100644 (file)
@@ -47,4 +47,8 @@ end
 packages
        package zerofree
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end
diff --git a/zlib/patches/zlib-1.2.5-gentoo.patch b/zlib/patches/zlib-1.2.5-gentoo.patch
new file mode 100644 (file)
index 0000000..82c7f39
--- /dev/null
@@ -0,0 +1,12 @@
+diff -up zlib-1.2.5/zlib.h.pom zlib-1.2.5/zlib.h
+--- zlib-1.2.5/zlib.h.pom      2010-04-20 06:12:48.000000000 +0200
++++ zlib-1.2.5/zlib.h  2010-06-16 13:08:59.000000000 +0200
+@@ -1578,7 +1578,7 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF(
+ #  define gzoffset gzoffset64
+ #  define adler32_combine adler32_combine64
+ #  define crc32_combine crc32_combine64
+-#  ifdef _LARGEFILE64_SOURCE
++#  ifndef _LARGEFILE64_SOURCE
+      ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+      ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
+      ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
index f1611f4358224b569801510f88239cd676b56bd8..d65d2f8a7d4d23a06f93ce9e621012ce1dfaf8d8 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = zlib
 version    = 1.2.5
-release    = 1
+release    = 2
 
 groups     = System/Libraries
 url        = http://www.gzip.org/zlib/
@@ -44,8 +44,12 @@ end
 packages
        package %{name}
        end
-       
+
        package %{name}-devel
                template DEVEL
        end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
+       end
 end