d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe# This file and its contents are supplied under the terms of the
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe# Common Development and Distribution License ("CDDL"), version 1.0.
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe# You may only use this file in accordance with the terms of version
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe# 1.0 of the CDDL.
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe# A full copy of the text of the CDDL should have accompanied this
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe# source. A copy of the CDDL is also available via the Internet at
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe# Copyright 2015, Richard Lowe.
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowecoreadm -p core $pid # We need to be able to reliably find the core
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe## gcore-produced core
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe descsz: 0x28
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe type: [ NT_SECFLAGS ]
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe desc: (prsecflags_t)
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe pr_version: 1
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe pr_effective: [ ASLR ]
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe pr_inherit: [ ASLR ]
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe pr_upper: [ ASLR FORBIDNULLMAP NOEXECSTACK ]
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe/usr/bin/elfdump -n core.${pid} | grep -B5 -A5 prsecflags_t > gcore-output.$$
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Loweif ! diff -u gcore-expected.$$ gcore-output.$$; then
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe## kernel-produced core
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe descsz: 0x28
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe type: [ NT_SECFLAGS ]
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe desc: (prsecflags_t)
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe pr_version: 1
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe pr_effective: [ ASLR ]
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe pr_inherit: [ ASLR ]
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe pr_upper: [ ASLR FORBIDNULLMAP NOEXECSTACK ]
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Lowe/usr/bin/elfdump -n core | grep -B5 -A5 prsecflags_t > core-output.$$
d2a70789f056fc6c9ce3ab047b52126d80b0e3daRichard Loweif ! diff -u core-expected.$$ core-output.$$; then