hi list,
i have some doubt about process segment in linux kernel. I wrote a small
program. I tried to see which segment falls in which virtual address
space. i do it like
suman@ajit process_info]$ size -x ./process_plain
text data bss dec hex filename
0x485 0x10c 0x8 1433 599 ./process_plain
..one doubt why size is not showing "stack" segment.....
i got wonder when i saw the output with objdump -h ./process_plain and
later size -A -x ./process_plain. I could see that the result contains
23 segments... i checked with these segments by writing kernel module
which list the VMA. (by manipulating memory data structure
mm_struct,vm_area_struct,task_struct). I saw that it also lists 23 VMA.
can anybody please tell me or point out any reference where i can look
what are the contents in other segments.I know about
(text,data,bss,stack) segments only....i googled but didn't get(might be
my wrong search).....
output:
suman@ajit process_info]$ objdump -h ./process_plain
./process_plain: file format elf32-i386
Sections:
Idx Name Size VMA LMA File off Algn
0 .interp 00000013 08048114 08048114 00000114 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .note.ABI-tag 00000020 08048128 08048128 00000128 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .hash 00000030 08048148 08048148 00000148 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .dynsym 00000070 08048178 08048178 00000178 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .dynstr 00000067 080481e8 080481e8 000001e8 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .gnu.version 0000000e 08048250 08048250 00000250 2**1
CONTENTS, ALLOC, LOAD, READONLY, DATA
6 .gnu.version_r 00000020 08048260 08048260 00000260 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
7 .rel.dyn 00000008 08048280 08048280 00000280 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
8 .rel.plt 00000020 08048288 08048288 00000288 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
9 .init 00000017 080482a8 080482a8 000002a8 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
10 .plt 00000050 080482c0 080482c0 000002c0 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
11 .text 000001dc 08048310 08048310 00000310 2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
12 .fini 0000001c 080484ec 080484ec 000004ec 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
13 .rodata 00000092 08048508 08048508 00000508 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
14 .eh_frame 00000004 0804859c 0804859c 0000059c 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
15 .ctors 00000008 080495a0 080495a0 000005a0 2**2
CONTENTS, ALLOC, LOAD, DATA
16 .dtors 00000008 080495a8 080495a8 000005a8 2**2
CONTENTS, ALLOC, LOAD, DATA
17 .jcr 00000004 080495b0 080495b0 000005b0 2**2
CONTENTS, ALLOC, LOAD, DATA
18 .dynamic 000000c8 080495b4 080495b4 000005b4 2**2
CONTENTS, ALLOC, LOAD, DATA
19 .got 00000004 0804967c 0804967c 0000067c 2**2
CONTENTS, ALLOC, LOAD, DATA
20 .got.plt 0000001c 08049680 08049680 00000680 2**2
CONTENTS, ALLOC, LOAD, DATA
21 .data 00000010 0804969c 0804969c 0000069c 2**2
CONTENTS, ALLOC, LOAD, DATA
22 .bss 00000008 080496ac 080496ac 000006ac 2**2
ALLOC
23 .comment 0000010e 00000000 00000000 000006ac 2**0
CONTENTS, READONLY
****************************************************************
[suman@ajit
process_info]$ size -A -x ./process_plain
./process_plain :
section size addr
.interp 0x13 0x8048114
.note.ABI-tag 0x20 0x8048128
.hash 0x30 0x8048148
.dynsym 0x70 0x8048178
.dynstr 0x67 0x80481e8
.gnu.version 0xe 0x8048250
.gnu.version_r 0x20 0x8048260
.rel.dyn 0x8 0x8048280
.rel.plt 0x20 0x8048288
.init 0x17 0x80482a8
.plt 0x50 0x80482c0
.text 0x1dc 0x8048310
.fini 0x1c 0x80484ec
.rodata 0x92 0x8048508
.eh_frame 0x4 0x804859c
.ctors 0x8 0x80495a0
.dtors 0x8 0x80495a8
.jcr 0x4 0x80495b0
.dynamic 0xc8 0x80495b4
.got 0x4 0x804967c
.got.plt 0x1c 0x8049680
.data 0x10 0x804969c
.bss 0x8 0x80496ac
.comment 0x10e 0x0
Total 0x6a7
***********************************
thanks
suman