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

简介:

测试代码如下  
?
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
目录
相关文章
|
JSON 机器人 Linux
推荐一款嵌入式Linux开源框架与封装-cpp-tbox
推荐一款嵌入式Linux开源框架与封装-cpp-tbox
839 3
|
JSON 算法 API
微信支付超过2000元配置
导入依赖、微信工具类、请求示例、超过2000元转账参数、姓名加密、请求参数、微信支付平台证书序列号、Wechatpay-Serial
1238 0
|
网络协议 算法 网络性能优化
第十一问:TCP的窗口机制是什么?
TCP的窗口机制是实现流量控制和拥塞控制的重要手段,主要包括滑动窗口、接收窗口(rwnd)和拥塞窗口(cwnd)。滑动窗口定义了发送方允许发送的数据范围,接收窗口控制接收方的缓冲区容量,拥塞窗口防止网络拥塞。这些窗口通过动态调整,确保数据传输的高效性和可靠性。
|
12月前
|
监控 安全 数据安全/隐私保护
55_大模型部署:从云端到边缘的全场景实践
随着大型语言模型(LLM)技术的飞速发展,从实验室走向产业化应用已成为必然趋势。2025年,大模型部署不再局限于传统的云端集中式架构,而是向云端-边缘协同的分布式部署模式演进。这种转变不仅解决了纯云端部署在延迟、隐私和成本方面的痛点,还为大模型在各行业的广泛应用开辟了新的可能性。本文将深入剖析大模型部署的核心技术、架构设计、工程实践及最新进展,为企业和开发者提供从云端到边缘的全场景部署指南。
2532 1
|
监控 前端开发 应用服务中间件
小游戏源码开发搭建技术栈和服务器配置流程
近些年不同场景游戏层出不穷,现就小游戏开发技术应用及功能详细剖析!
|
JavaScript 前端开发 Java
115.【SpringBoot(IDEA)+Vue(Vscode)前后端交互】(一)
115.【SpringBoot(IDEA)+Vue(Vscode)前后端交互】
2048 0
|
机器学习/深度学习 存储 监控
基于YOLOv8深度学习的路面坑洞检测与分割系统【python源码+Pyqt5界面+数据集+训练代码】深度学习实战、目标分割(1)
基于YOLOv8深度学习的路面坑洞检测与分割系统【python源码+Pyqt5界面+数据集+训练代码】深度学习实战、目标分割
|
IDE Java 应用服务中间件
Tomcat部署的服务有部分中文是乱码如何处理
【6月更文挑战第9天】Tomcat部署的服务有部分中文是乱码如何处理
2676 5
在哪里续费域名?
在哪里续费域名?
1571 2