【原创】实验验证调试信息的剥离与链回

简介:

测试代码如下  
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[root@Betty gdb_-g_test]# cat test.c
#include <stdio.h>
#include <stdlib.h>
 
int main()
{
     int m = 0, n =9;
     int k = m+n;
     printf ( "k is %d\n" , k);
     m = k + n;
     printf ( "m is %d\n" , m);
     n = m-n;
     printf ( "n is %d\n" , n);
     return 0;
}
[root@Betty gdb_-g_test]#

可以按如下方式分离调试信息:  

a.编译带调试信息(-g)的可执行程序  
?
1
2
3
4
5
[root@Betty gdb_-g_test] # gcc -g -o test test.c
[root@Betty gdb_-g_test] # ll
总用量 12
-rwxr-xr-x 1 root root 7858 8月  12 17:28 test
-rw-r--r-- 1 root root  219 8月  12 14:23 test .c
确认 MD5 校验值  
?
1
2
[root@Betty gdb_-g_test] # md5sum test
23e4cda9e7419d2062cb1afd5f5d1069  test
确认 test 文件类型信息  
?
1
2
[root@Betty gdb_-g_test] # file test
test : ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU /Linux 2.6.18, not stripped
读取二进制文件   段头   信息  
?
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
[root@Betty gdb_-g_test] # readelf -S test
There are 37 section headers, starting at offset 0xcd8:
 
 
Section Headers:
   [Nr] Name              Type             Address           Offset
        Size              EntSize          Flags  Link  Info  Align
   [ 0]                   NULL             0000000000000000  00000000
        0000000000000000  0000000000000000           0     0     0
   [ 1] .interp           PROGBITS         0000000000400200  00000200
        000000000000001c  0000000000000000   A       0     0     1
   [ 2] .note.ABI-tag     NOTE             000000000040021c  0000021c
        0000000000000020  0000000000000000   A       0     0     4
   [ 3] .note.gnu.build-i NOTE             000000000040023c  0000023c
        0000000000000024  0000000000000000   A       0     0     4
   [ 4] .gnu. hash         GNU_HASH         0000000000400260  00000260
        000000000000001c  0000000000000000   A       5     0     8
   [ 5] .dynsym           DYNSYM           0000000000400280  00000280
        0000000000000060  0000000000000018   A       6     1     8
   [ 6] .dynstr           STRTAB           00000000004002e0  000002e0
        000000000000003f  0000000000000000   A       0     0     1
   [ 7] .gnu.version      VERSYM           0000000000400320  00000320
        0000000000000008  0000000000000002   A       5     0     2
   [ 8] .gnu.version_r    VERNEED          0000000000400328  00000328
        0000000000000020  0000000000000000   A       6     1     8
   [ 9] .rela.dyn         RELA             0000000000400348  00000348
        0000000000000018  0000000000000018   A       5     0     8
   [10] .rela.plt         RELA             0000000000400360  00000360
        0000000000000030  0000000000000018   A       5    12     8
   [11] .init             PROGBITS         0000000000400390  00000390
        0000000000000018  0000000000000000  AX       0     0     4
   [12] .plt              PROGBITS         00000000004003a8  000003a8
        0000000000000030  0000000000000010  AX       0     0     4
   [13] .text             PROGBITS         00000000004003e0  000003e0
        0000000000000248  0000000000000000  AX       0     0     16
   [14] .fini             PROGBITS         0000000000400628  00000628
        000000000000000e  0000000000000000  AX       0     0     4
   [15] .rodata           PROGBITS         0000000000400638  00000638
        000000000000002b  0000000000000000   A       0     0     8
   [16] .eh_frame_hdr     PROGBITS         0000000000400664  00000664
        0000000000000024  0000000000000000   A       0     0     4
   [17] .eh_frame         PROGBITS         0000000000400688  00000688
        000000000000007c  0000000000000000   A       0     0     8
   [18] .ctors            PROGBITS         0000000000600708  00000708
        0000000000000010  0000000000000000  WA       0     0     8
   [19] .dtors            PROGBITS         0000000000600718  00000718
        0000000000000010  0000000000000000  WA       0     0     8
   [20] .jcr              PROGBITS         0000000000600728  00000728
        0000000000000008  0000000000000000  WA       0     0     8
   [21] .dynamic          DYNAMIC          0000000000600730  00000730
        0000000000000190  0000000000000010  WA       6     0     8
   [22] .got              PROGBITS         00000000006008c0  000008c0
        0000000000000008  0000000000000008  WA       0     0     8
   [23] .got.plt          PROGBITS         00000000006008c8  000008c8
        0000000000000028  0000000000000008  WA       0     0     8
   [24] .data             PROGBITS         00000000006008f0  000008f0
        0000000000000004  0000000000000000  WA       0     0     4
   [25] .bss              NOBITS           00000000006008f8  000008f4
        0000000000000010  0000000000000000  WA       0     0     8
   [26] .comment          PROGBITS         0000000000000000  000008f4
        000000000000002d  0000000000000001  MS       0     0     1
   [27] .debug_aranges    PROGBITS         0000000000000000  00000921
        0000000000000030  0000000000000000           0     0     1
   [28] .debug_pubnames   PROGBITS         0000000000000000  00000951
        000000000000001b  0000000000000000           0     0     1
   [29] .debug_info       PROGBITS         0000000000000000  0000096c
        00000000000000be  0000000000000000           0     0     1
   [30] .debug_abbrev     PROGBITS         0000000000000000  00000a2a
        000000000000004e  0000000000000000           0     0     1
   [31] .debug_line       PROGBITS         0000000000000000  00000a78
        0000000000000044  0000000000000000           0     0     1
   [32] .debug_str        PROGBITS         0000000000000000  00000abc
        00000000000000a9  0000000000000001  MS       0     0     1
   [33] .debug_pubtypes   PROGBITS         0000000000000000  00000b65
        0000000000000012  0000000000000000           0     0     1
   [34] .shstrtab         STRTAB           0000000000000000  00000b77
        000000000000015e  0000000000000000           0     0     1
   [35] .symtab           SYMTAB           0000000000000000  00001618
        00000000000006a8  0000000000000018          36    53     8
   [36] .strtab           STRTAB           0000000000000000  00001cc0
        00000000000001f2  0000000000000000           0     0     1
Key to Flags:
   W (write), A (alloc), X (execute), M (merge), S ( strings )
   I (info), L (link order), G (group), x (unknown)
   O (extra OS processing required) o (OS specific), p (processor specific)
[root@Betty gdb_-g_test] #

b.将 test 中的调试信息拷贝到 test.debug

?
1
2
3
4
5
6
[root@Betty gdb_-g_test] # objcopy --only-keep-debug test test.debug
[root@Betty gdb_-g_test] # ll
总用量 20
-rwxr-xr-x 1 root root 7858 8月  12 17:28 test
-rw-r--r-- 1 root root  219 8月  12 14:23 test .c
-rwxr-xr-x 1 root root 6146 8月  12 17:31 test .debug
可以看到 test 文件的 MD5 值没有被改变  
?
1
2
[root@Betty gdb_-g_test] # md5sum test
23e4cda9e7419d2062cb1afd5f5d1069  test
可以看到 test.debug 和 test 的文件类型信息相同  
?
1
2
3
[root@Betty gdb_-g_test] # file test.debug
test .debug: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU /Linux 2.6.18, not stripped
[root@Betty gdb_-g_test] #
同样可以从 test.debug 中获得段头信息  
?
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
[root@Betty gdb_-g_test] # readelf -S test.debug
There are 37 section headers, starting at offset 0x628:
 
Section Headers:
   [Nr] Name              Type             Address           Offset
        Size              EntSize          Flags  Link  Info  Align
   [ 0]                   NULL             0000000000000000  00000000
        0000000000000000  0000000000000000           0     0     0
   [ 1] .interp           NOBITS           0000000000400200  00000200
        000000000000001c  0000000000000000   A       0     0     1
   [ 2] .note.ABI-tag     NOTE             000000000040021c  00000200
        0000000000000020  0000000000000000   A       0     0     4
   [ 3] .note.gnu.build-i NOTE             000000000040023c  00000220
        0000000000000024  0000000000000000   A       0     0     4
   [ 4] .gnu. hash         NOBITS           0000000000400260  00000244
        000000000000001c  0000000000000000   A       0     0     8
   [ 5] .dynsym           NOBITS           0000000000400280  00000244
        0000000000000060  0000000000000018   A       0     1     8
   [ 6] .dynstr           NOBITS           00000000004002e0  00000244
        000000000000003f  0000000000000000   A       0     0     1
   [ 7] .gnu.version      NOBITS           0000000000400320  00000244
        0000000000000008  0000000000000002   A       0     0     2
   [ 8] .gnu.version_r    NOBITS           0000000000400328  00000244
        0000000000000020  0000000000000000   A       0     1     8
   [ 9] .rela.dyn         NOBITS           0000000000400348  00000244
        0000000000000018  0000000000000018   A       0     0     8
   [10] .rela.plt         NOBITS           0000000000400360  00000244
        0000000000000030  0000000000000018   A       0     0     8
   [11] .init             NOBITS           0000000000400390  00000244
        0000000000000018  0000000000000000  AX       0     0     4
   [12] .plt              NOBITS           00000000004003a8  00000244
        0000000000000030  0000000000000010  AX       0     0     4
   [13] .text             NOBITS           00000000004003e0  00000244
        0000000000000248  0000000000000000  AX       0     0     16
   [14] .fini             NOBITS           0000000000400628  00000244
        000000000000000e  0000000000000000  AX       0     0     4
   [15] .rodata           NOBITS           0000000000400638  00000244
        000000000000002b  0000000000000000   A       0     0     8
   [16] .eh_frame_hdr     NOBITS           0000000000400664  00000244
        0000000000000024  0000000000000000   A       0     0     4
   [17] .eh_frame         NOBITS           0000000000400688  00000244
        000000000000007c  0000000000000000   A       0     0     8
   [18] .ctors            NOBITS           0000000000600708  00000708
        0000000000000010  0000000000000000  WA       0     0     8
   [19] .dtors            NOBITS           0000000000600718  00000708
        0000000000000010  0000000000000000  WA       0     0     8
   [20] .jcr              NOBITS           0000000000600728  00000708
        0000000000000008  0000000000000000  WA       0     0     8
   [21] .dynamic          NOBITS           0000000000600730  00000708
        0000000000000190  0000000000000010  WA       0     0     8
   [22] .got              NOBITS           00000000006008c0  00000708
        0000000000000008  0000000000000008  WA       0     0     8
   [23] .got.plt          NOBITS           00000000006008c8  00000708
        0000000000000028  0000000000000008  WA       0     0     8
   [24] .data             NOBITS           00000000006008f0  00000708
        0000000000000004  0000000000000000  WA       0     0     4
   [25] .bss              NOBITS           00000000006008f8  00000708
        0000000000000010  0000000000000000  WA       0     0     8
   [26] .comment          PROGBITS         0000000000000000  00000244
        000000000000002d  0000000000000001  MS       0     0     1
   [27] .debug_aranges    PROGBITS         0000000000000000  00000271
        0000000000000030  0000000000000000           0     0     1
   [28] .debug_pubnames   PROGBITS         0000000000000000  000002a1
        000000000000001b  0000000000000000           0     0     1
   [29] .debug_info       PROGBITS         0000000000000000  000002bc
        00000000000000be  0000000000000000           0     0     1
   [30] .debug_abbrev     PROGBITS         0000000000000000  0000037a
        000000000000004e  0000000000000000           0     0     1
   [31] .debug_line       PROGBITS         0000000000000000  000003c8
        0000000000000044  0000000000000000           0     0     1
   [32] .debug_str        PROGBITS         0000000000000000  0000040c
        00000000000000a9  0000000000000001  MS       0     0     1
   [33] .debug_pubtypes   PROGBITS         0000000000000000  000004b5
        0000000000000012  0000000000000000           0     0     1
   [34] .shstrtab         STRTAB           0000000000000000  000004c7
        000000000000015e  0000000000000000           0     0     1
   [35] .symtab           SYMTAB           0000000000000000  00000f68
        00000000000006a8  0000000000000018          36    53     8
   [36] .strtab           STRTAB           0000000000000000  00001610
        00000000000001f2  0000000000000000           0     0     1
Key to Flags:
   W (write), A (alloc), X (execute), M (merge), S ( strings )
   I (info), L (link order), G (group), x (unknown)
   O (extra OS processing required) o (OS specific), p (processor specific)
[root@Betty gdb_-g_test] #
通过比较工具,可以看到两次得到的段头信息中,只有部分内容发生了变化。
 
 
确认 test.debug 的 MD5 值  
?
1
2
3
[root@Betty gdb_-g_test] # md5sum test.debug
0f7c5372716becc6eac033e5a76258f5  test .debug
[root@Betty gdb_-g_test] #

c.移除 test 中的调试信息  
确认各个文件的大小  
?
1
2
3
4
5
[root@Betty gdb_-g_test] # ll
总用量 20
-rwxr-xr-x 1 root root 7858 8月  12 17:28 test
-rw-r--r-- 1 root root  219 8月  12 14:23 test .c
-rwxr-xr-x 1 root root 6146 8月  12 17:31 test .debug
对 test 进行调试信息移除  
?
1
2
3
4
5
6
7
[root@Betty gdb_-g_test] # strip --strip-debug --strip-unneeded test
[root@Betty gdb_-g_test] # ll
总用量 20
-rwxr-xr-x 1 root root 4368 8月  12 17:38 test
-rw-r--r-- 1 root root  219 8月  12 14:23 test .c
-rwxr-xr-x 1 root root 6146 8月  12 17:31 test .debug
[root@Betty gdb_-g_test] #
确认 test 文件类型的变化  
?
1
2
3
[root@Betty gdb_-g_test] # file test
test : ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU /Linux 2.6.18, stripped
[root@Betty gdb_-g_test] #
重新确认 test 文件的 MD5 值  
?
1
2
3
[root@Betty gdb_-g_test] # md5sum test
bf725c6a07a17880ab2193c5e98bdec3  test
[root@Betty gdb_-g_test] #
查看移除调试信息后 test 的   段头   信息  
?
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
[root@Betty gdb_-g_test] # readelf -S test
There are 28 section headers, starting at offset 0xa10:
 
Section Headers:
   [Nr] Name              Type             Address           Offset
        Size              EntSize          Flags  Link  Info  Align
   [ 0]                   NULL             0000000000000000  00000000
        0000000000000000  0000000000000000           0     0     0
   [ 1] .interp           PROGBITS         0000000000400200  00000200
        000000000000001c  0000000000000000   A       0     0     1
   [ 2] .note.ABI-tag     NOTE             000000000040021c  0000021c
        0000000000000020  0000000000000000   A       0     0     4
   [ 3] .note.gnu.build-i NOTE             000000000040023c  0000023c
        0000000000000024  0000000000000000   A       0     0     4
   [ 4] .gnu. hash         GNU_HASH         0000000000400260  00000260
        000000000000001c  0000000000000000   A       5     0     8
   [ 5] .dynsym           DYNSYM           0000000000400280  00000280
        0000000000000060  0000000000000018   A       6     1     8
   [ 6] .dynstr           STRTAB           00000000004002e0  000002e0
        000000000000003f  0000000000000000   A       0     0     1
   [ 7] .gnu.version      VERSYM           0000000000400320  00000320
        0000000000000008  0000000000000002   A       5     0     2
   [ 8] .gnu.version_r    VERNEED          0000000000400328  00000328
        0000000000000020  0000000000000000   A       6     1     8
   [ 9] .rela.dyn         RELA             0000000000400348  00000348
        0000000000000018  0000000000000018   A       5     0     8
   [10] .rela.plt         RELA             0000000000400360  00000360
        0000000000000030  0000000000000018   A       5    12     8
   [11] .init             PROGBITS         0000000000400390  00000390
        0000000000000018  0000000000000000  AX       0     0     4
   [12] .plt              PROGBITS         00000000004003a8  000003a8
        0000000000000030  0000000000000010  AX       0     0     4
   [13] .text             PROGBITS         00000000004003e0  000003e0
        0000000000000248  0000000000000000  AX       0     0     16
   [14] .fini             PROGBITS         0000000000400628  00000628
        000000000000000e  0000000000000000  AX       0     0     4
   [15] .rodata           PROGBITS         0000000000400638  00000638
        000000000000002b  0000000000000000   A       0     0     8
   [16] .eh_frame_hdr     PROGBITS         0000000000400664  00000664
        0000000000000024  0000000000000000   A       0     0     4
   [17] .eh_frame         PROGBITS         0000000000400688  00000688
        000000000000007c  0000000000000000   A       0     0     8
   [18] .ctors            PROGBITS         0000000000600708  00000708
        0000000000000010  0000000000000000  WA       0     0     8
   [19] .dtors            PROGBITS         0000000000600718  00000718
        0000000000000010  0000000000000000  WA       0     0     8
   [20] .jcr              PROGBITS         0000000000600728  00000728
        0000000000000008  0000000000000000  WA       0     0     8
   [21] .dynamic          DYNAMIC          0000000000600730  00000730
        0000000000000190  0000000000000010  WA       6     0     8
   [22] .got              PROGBITS         00000000006008c0  000008c0
        0000000000000008  0000000000000008  WA       0     0     8
   [23] .got.plt          PROGBITS         00000000006008c8  000008c8
        0000000000000028  0000000000000008  WA       0     0     8
   [24] .data             PROGBITS         00000000006008f0  000008f0
        0000000000000004  0000000000000000  WA       0     0     4
   [25] .bss              NOBITS           00000000006008f8  000008f4
        0000000000000010  0000000000000000  WA       0     0     8
   [26] .comment          PROGBITS         0000000000000000  000008f4
        000000000000002d  0000000000000001  MS       0     0     1
   [27] .shstrtab         STRTAB           0000000000000000  00000921
        00000000000000ee  0000000000000000           0     0     1
Key to Flags:
   W (write), A (alloc), X (execute), M (merge), S ( strings )
   I (info), L (link order), G (group), x (unknown)
   O (extra OS processing required) o (OS specific), p (processor specific)
[root@Betty gdb_-g_test] #
对边前后两次信息变化


至此,我们就得到了
 
  • test 是移除了调试信息的可执行文件
  • test.debug 是被移除后单独存储的调试信息

d.通过 gdb 加载调试信息分离的可执行文件  
?
1
2
3
4
5
6
7
8
9
10
11
12
[root@Betty gdb_-g_test] # gdb -s test.debug -e test
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http: //gnu .org /licenses/gpl .html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu" .
For bug reporting instructions, please see:
<http: //www .gnu.org /software/gdb/bugs/ >...
Reading symbols from /root/workspace/GDB_TEST/gdb_-g_test/test .debug... done .
( gdb )
也可以这样加载  
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
[root@Betty gdb_-g_test] # gdb
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http: //gnu .org /licenses/gpl .html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu" .
For bug reporting instructions, please see:
<http: //www .gnu.org /software/gdb/bugs/ >.
( gdb ) exec - file test
( gdb ) symbol- file test .debug
Reading symbols from /root/workspace/GDB_TEST/gdb_-g_test/test .debug... done .
( gdb )

e.将分离出的调试信息 test.debug 链接回可执行文件 test 中
备份并确认 MD5 值

?
1
2
3
4
5
6
7
8
9
10
11
[root@Betty gdb_-g_test] # cp test test.bak
[root@Betty gdb_-g_test] # ll
总用量 28
-rwxr-xr-x 1 root root 4368 8月  12 17:38 test
-rwxr-xr-x 1 root root 4368 8月  12 17:52 test .bak
-rw-r--r-- 1 root root  219 8月  12 14:23 test .c
-rwxr-xr-x 1 root root 6146 8月  12 17:31 test .debug
[root@Betty gdb_-g_test] # md5sum test
bf725c6a07a17880ab2193c5e98bdec3  test
[root@Betty gdb_-g_test] # md5sum test.bak
bf725c6a07a17880ab2193c5e98bdec3  test .bak

将调试信息链回 test

?
1
2
3
4
5
6
7
[root@Betty gdb_-g_test] # objcopy --add-gnu-debuglink test.debug test
[root@Betty gdb_-g_test] # ll
总用量 28
-rwxr-xr-x 1 root root 4464 8月  12 17:53 test
-rwxr-xr-x 1 root root 4368 8月  12 17:52 test .bak
-rw-r--r-- 1 root root  219 8月  12 14:23 test .c
-rwxr-xr-x 1 root root 6146 8月  12 17:31 test .debug

产看文件类型变化,以及 MD5 值变化

?
1
2
3
4
[root@Betty gdb_-g_test] # file test
test : ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU /Linux 2.6.18, stripped
[root@Betty gdb_-g_test] # md5sum test
a201d3195542a0897f633d187776d65c  test
确认链回后 test 的   段头   内容变化  
?
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
[root@Betty gdb_-g_test] # readelf -S test
There are 29 section headers, starting at offset 0xa30:
 
Section Headers:
   [Nr] Name              Type             Address           Offset
        Size              EntSize          Flags  Link  Info  Align
   [ 0]                   NULL             0000000000000000  00000000
        0000000000000000  0000000000000000           0     0     0
   [ 1] .interp           PROGBITS         0000000000400200  00000200
        000000000000001c  0000000000000000   A       0     0     1
   [ 2] .note.ABI-tag     NOTE             000000000040021c  0000021c
        0000000000000020  0000000000000000   A       0     0     4
   [ 3] .note.gnu.build-i NOTE             000000000040023c  0000023c
        0000000000000024  0000000000000000   A       0     0     4
   [ 4] .gnu. hash         GNU_HASH         0000000000400260  00000260
        000000000000001c  0000000000000000   A       5     0     8
   [ 5] .dynsym           DYNSYM           0000000000400280  00000280
        0000000000000060  0000000000000018   A       6     1     8
   [ 6] .dynstr           STRTAB           00000000004002e0  000002e0
        000000000000003f  0000000000000000   A       0     0     1
   [ 7] .gnu.version      VERSYM           0000000000400320  00000320
        0000000000000008  0000000000000002   A       5     0     2
   [ 8] .gnu.version_r    VERNEED          0000000000400328  00000328
        0000000000000020  0000000000000000   A       6     1     8
   [ 9] .rela.dyn         RELA             0000000000400348  00000348
        0000000000000018  0000000000000018   A       5     0     8
   [10] .rela.plt         RELA             0000000000400360  00000360
        0000000000000030  0000000000000018   A       5    12     8
   [11] .init             PROGBITS         0000000000400390  00000390
        0000000000000018  0000000000000000  AX       0     0     4
   [12] .plt              PROGBITS         00000000004003a8  000003a8
        0000000000000030  0000000000000010  AX       0     0     4
   [13] .text             PROGBITS         00000000004003e0  000003e0
        0000000000000248  0000000000000000  AX       0     0     16
   [14] .fini             PROGBITS         0000000000400628  00000628
        000000000000000e  0000000000000000  AX       0     0     4
   [15] .rodata           PROGBITS         0000000000400638  00000638
        000000000000002b  0000000000000000   A       0     0     8
   [16] .eh_frame_hdr     PROGBITS         0000000000400664  00000664
        0000000000000024  0000000000000000   A       0     0     4
   [17] .eh_frame         PROGBITS         0000000000400688  00000688
        000000000000007c  0000000000000000   A       0     0     8
   [18] .ctors            PROGBITS         0000000000600708  00000708
        0000000000000010  0000000000000000  WA       0     0     8
   [19] .dtors            PROGBITS         0000000000600718  00000718
        0000000000000010  0000000000000000  WA       0     0     8
   [20] .jcr              PROGBITS         0000000000600728  00000728
        0000000000000008  0000000000000000  WA       0     0     8
   [21] .dynamic          DYNAMIC          0000000000600730  00000730
        0000000000000190  0000000000000010  WA       6     0     8
   [22] .got              PROGBITS         00000000006008c0  000008c0
        0000000000000008  0000000000000008  WA       0     0     8
   [23] .got.plt          PROGBITS         00000000006008c8  000008c8
        0000000000000028  0000000000000008  WA       0     0     8
   [24] .data             PROGBITS         00000000006008f0  000008f0
        0000000000000004  0000000000000000  WA       0     0     4
   [25] .bss              NOBITS           00000000006008f8  000008f4
        0000000000000010  0000000000000000  WA       0     0     8
   [26] .comment          PROGBITS         0000000000000000  000008f4
        000000000000002d  0000000000000001  MS       0     0     1
   [27] .gnu_debuglink    PROGBITS         0000000000000000  00000921
        0000000000000010  0000000000000000           0     0     1
   [28] .shstrtab         STRTAB           0000000000000000  00000931
        00000000000000fd  0000000000000000           0     0     1
Key to Flags:
   W (write), A (alloc), X (execute), M (merge), S ( strings )
   I (info), L (link order), G (group), x (unknown)
   O (extra OS processing required) o (OS specific), p (processor specific)
[root@Betty gdb_-g_test] #
可以看到执行后,多了 .gnu_debuglink 段信息。  
 

相关实践学习
阿里云图数据库GDB入门与应用
图数据库(Graph Database,简称GDB)是一种支持Property Graph图模型、用于处理高度连接数据查询与存储的实时、可靠的在线数据库服务。它支持Apache TinkerPop Gremlin查询语言,可以帮您快速构建基于高度连接的数据集的应用程序。GDB非常适合社交网络、欺诈检测、推荐引擎、实时图谱、网络/IT运营这类高度互连数据集的场景。 GDB由阿里云自主研发,具备如下优势: 标准图查询语言:支持属性图,高度兼容Gremlin图查询语言。 高度优化的自研引擎:高度优化的自研图计算层和存储层,云盘多副本保障数据超高可靠,支持ACID事务。 服务高可用:支持高可用实例,节点故障迅速转移,保障业务连续性。 易运维:提供备份恢复、自动升级、监控告警、故障切换等丰富的运维功能,大幅降低运维成本。 产品主页:https://www.aliyun.com/product/gdb
目录
相关文章
|
2月前
|
开发工具 git
三类代码协同模式问题之在推送命令中加入参数绕过推送评审问题如何解决
三类代码协同模式问题之在推送命令中加入参数绕过推送评审问题如何解决
|
10月前
|
存储 监控 Cloud Native
剖析Linux网络包接收过程:掌握数据如何被捕获和分发的全过程(上)
剖析Linux网络包接收过程:掌握数据如何被捕获和分发的全过程
|
4月前
|
数据采集
检验代理ip是否有用的小办法
检验代理ip是否有用的小办法
|
10月前
|
存储 网络协议 Linux
剖析Linux网络包接收过程:掌握数据如何被捕获和分发的全过程(下)
剖析Linux网络包接收过程:掌握数据如何被捕获和分发的全过程
|
移动开发
微信h5扫码接口范例:多个扫码框支持的办法,通过引入一个参数来区分及使用localStorage保证之前扫到的数据不丢失
微信h5扫码接口范例:多个扫码框支持的办法,通过引入一个参数来区分及使用localStorage保证之前扫到的数据不丢失
102 0
|
安全 API Android开发
教你如何高效的检查APK中使用敏感权限的地方以及检查某系统方法被调用的地方
教你如何高效的检查APK中使用敏感权限的地方以及检查某系统方法被调用的地方
484 0
教你如何高效的检查APK中使用敏感权限的地方以及检查某系统方法被调用的地方
|
存储 自然语言处理 Dubbo
几行代码轻松实现跨系统传递 traceId,再也不用担心对不上日志了!
新项目查日志太麻烦,多台机器之间查来查去,还不知道是不是同一个请求的。打印日志时使用 MDC 在日志上添加一个 traceId,那这个 traceId 如何跨系统传递呢?
1118 0
|
监控 算法 Java
【Android 逆向】Android 逆向方法 ( 静态逆向解析 | 函数调用分析 | 动态运行跟踪 | 运行日志分析 | 文件格式解析 | 敏感信息分析 | 网络信息监控 | 环境伪装模拟 )
【Android 逆向】Android 逆向方法 ( 静态逆向解析 | 函数调用分析 | 动态运行跟踪 | 运行日志分析 | 文件格式解析 | 敏感信息分析 | 网络信息监控 | 环境伪装模拟 )
381 0
|
PHP Windows 安全