xref: /illumos-gate/usr/src/cmd/dtrace/test/tst/common/uctf/tst.linkmap.ksh (revision 6e6545bfaed3bab9ce836ee82d1abd8f2edba89a)
1#! /usr/bin/ksh
2#
3#
4# This file and its contents are supplied under the terms of the
5# Common Development and Distribution License ("CDDL"), version 1.0.
6# You may only use this file in accordance with the terms of version
7# 1.0 of the CDDL.
8#
9# A full copy of the text of the CDDL should have accompanied this
10# source.  A copy of the CDDL is also available via the Internet at
11# http://www.illumos.org/license/CDDL.
12#
13
14#
15# Copyright (c) 2013 Joyent, Inc. All rights reserved.
16#
17
18#
19# We should be able to see both strstr from libc and from ld on an
20# alternate linkmap.
21#
22
23if [ $# != 1 ]; then
24        echo expected one argument: '<'dtrace-path'>'
25        exit 2
26fi
27
28dtrace=$1
29
30$dtrace -q -p $$ -s /dev/stdin  <<EOF
31pid\$target:LM1\`ld.so.1:strstr:entry,
32pid\$target:libc.so.1:strstr:entry
33{
34	exit (0);
35}
36
37BEGIN
38{
39	exit (0);
40}
41EOF
42rc=$?
43
44exit $rc
45