Study day01 notes during winter vacation
Linux-vdso.so.1 (0x00007fff47eac000)
Libc. so.6 =>/lib64/libc. so.6 (0x00007f37c4414000)
/Lib64/ld-linux-x86-64.so.2 (0x00007f37c47bc000)
A2 0x601048
A3 0x400828
B1 0x7fffaa41f41c
B2 0x60104c
B3 0x7fffaa41f418
P1 0x7fffaa41f510
P2 0xddd010
Main 0x4005e8
F 0x4005d4
18155
00600000-00601000 r -- p 00000000 1845721/codes/gj/1
00601000-00602000 rw-p 00001000 1845721/codes/gj/1
00ddd000-00dfe000 rw-p 00000000 00:00 0 [heap]
7f7916efa000-7f7917099000 r-xp 00000000 2883641/lib64/libc-2.15.so
7f7917099000-7f7917298000 --- p 0019f000 08:13 2883641/lib64/libc-2.15.so
7f7917298000-7f791729c000 r -- p 0019e000 08:13 2883641/lib64/libc-2.15.so
7f791729c000-7f791729e000 rw-p 001a2000 08:13 2883641/lib64/libc-2.15.so
7f791729e000-7f79172a2000 rw-p 00000000 00:00 0
7f79172a2000-7f79172c3000 r-xp 00000000 2883719/lib64/ld-2.15.so
7f791749316-7f7917493000 rw-p 00000000 0
7f79174c1000-7f79174c3000 rw-p 00000000 00: 00 0
7f79174c3000-7f79174c4000 r -- p 00021000 2883719/lib64/ld-2.15.so
7f79174c4000-7f79174c5000 rw-p 00022000 2883719/lib64/ld-2.15.so
7f79174c5000-7f79174c6000 rw-p 00000000 00:00 0
7fffaa400000-7fffaa421000 rw-p 00000000 00:00 0 [stack]
7fffaa444000-7fffaa445000 r-xp 00000000 0 [vdso]
Ffffffffff600000-ffffffffff601000 r-xp 00000000 0 [vsyscall]
1. The common variable is in the stack, and its address is smaller than the address allocated earlier. The memory created by malloc is allocated in sequence in the heap address.
2. The variable applied for by malloc does not occupy only 4 bytes if it is applied for 4 bytes. For details, see the following section.
3. memory structure applied by malloc
The cause heap is managed by the linked list ,. Therefore, changing the value of p1 + 2 p1 + 3 will cause free errors.
Other knowledge points: