How to define addresses of .bss from kernel module?
Hi. I have two nontrivial question.
1. I want to find address of the end of .bss segment or its size from kernel module. When I wanted to find addresses of data segment, I use struct task_struct ( current->mm->end_data and current->mm->strart_data ). Does anybody knows how to learn such addresses for .bss? And is it true, that the begining of .bss segment is end of data segment (mm->end_data)?
2. I recently knew, that each shared library have own data segment and own .bss. For example:
# cat /proc/1/maps look at init
08048000-0804e000 r-xp 00000000 03:01 64652 /sbin/init text
0804e000-0804f000 rw-p 00006000 03:01 64652 /sbin/init data
0804f000-08053000 rwxp 00000000 00:00 0 zero-mapped BSS
40000000-40015000 r-xp 00000000 03:01 96278 /lib/ld-2.3.2.so text
40015000-40016000 rw-p 00014000 03:01 96278 /lib/ld-2.3.2.so data
40016000-40017000 rw-p 00000000 00:00 0 BSS for ld.so
42000000-4212e000 r-xp 00000000 03:01 80290 /lib/tls/libc-2.3.2.so text
4212e000-42131000 rw-p 0012e000 03:01 80290 /lib/tls/libc-2.3.2.so data
42131000-42133000 rw-p 00000000 00:00 0 BSS for libc
bffff000-c0000000 rwxp 00000000 00:00 0 Stack segment
ffffe000-fffff000 ---p 00000000 00:00 0 vsyscall page
How I can to learn addresses for them from kernel module? Which structures in kernel contain this information? I didn`t find this information in google, and I suspect that it`s very hard. I would appreciate any help.