Imported Upstream version 0.160
[platform/upstream/elfutils.git] / tests / run-unstrip-M.sh
1 #! /bin/sh
2 # Copyright (C) 2013 Red Hat, Inc.
3 # This file is part of elfutils.
4 #
5 # This file is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # elfutils is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18 . $srcdir/test-subr.sh
19
20 # Linux /proc/PID/maps file with some non-file entries (and fake exe/lib names).
21 tempfiles testmaps
22 cat > testmaps <<EOF
23 00400000-024aa000 r-xp 00000000 08:02 159659                             /opt/TestBins/bin/arwijn
24 026aa000-026b2000 rwxp 020aa000 08:02 159659                             /opt/TestBins/bin/arwijn
25 026b2000-026bf000 rwxp 00000000 00:00 0
26 0335a000-03e6f000 rwxp 00000000 00:00 0                                  [heap]
27 2b7b38282000-2b7b38302000 rwxs 00000000 00:06 493872                     socket:[493872]
28 2b7b38302000-2b7b38312000 rwxs 00000000 00:06 493872                     socket:[493872]
29 2b7b38312000-2b7b38b12000 r-xs 00000000 00:06 493872                     socket:[493872]
30 2b7b38b12000-2b7b38b22000 rwxs 00000000 00:06 493872                     socket:[493872]
31 2b7b38b22000-2b7b39322000 rwxs 00000000 00:06 493872                     socket:[493872]
32 2b7b4439f000-2b7b45ea1000 rwxp 00000000 00:00 0
33 7f31e7d9f000-7f31e7f29000 r-xp 00000000 fd:00 917531                     /lib64/libc-1.13.so
34 7f31e7f29000-7f31e8128000 ---p 0018a000 fd:00 917531                     /lib64/libc-1.13.so
35 7f31e8128000-7f31e812c000 r--p 00189000 fd:00 917531                     /lib64/libc-1.13.so
36 7f31e812c000-7f31e812d000 rw-p 0018d000 fd:00 917531                     /lib64/libc-1.13.so
37 7f31e812d000-7f31e8132000 rw-p 00000000 00:00 0 
38 7f31ea3f9000-7f31ea3fc000 rw-s 00000000 00:09 3744                       anon_inode:kvm-vcpu
39 7f31ea3fc000-7f31ea3ff000 rw-s 00000000 00:09 3744                       anon_inode:kvm-vcpu
40 7f31ea400000-7f31ea402000 rw-p 00000000 00:00 0 
41 7fff26cf7000-7fff26d0c000 rwxp 00000000 00:00 0                          [stack]
42 7fff26dff000-7fff26e00000 r-xp 00000000 00:00 0                          [vdso]
43 ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
44 EOF
45
46 testrun_compare ${abs_top_builddir}/src/unstrip -n -M testmaps <<\EOF
47 0x400000+0x22b2000 - - - /opt/TestBins/bin/arwijn
48 0x7f31e7d9f000+0x38e000 - - - /lib64/libc-1.13.so
49 EOF
50
51 exit 0