Ubuntu 14.04 LTS:
peter@peterubuntu0:$ insmod mymodule
peter@peterubuntu0:/sys/module/mymodule/sections$ cat .text .data .bss
0x0000000000000000
0x0000000000000000
0x0000000000000000
So how do I tell gdb where is my module loaded on target machine when I debug remotely? Do I use just the offsets (so 0x64 or 64 decimal for .text then?)?
peter@peterubuntu0:~$ objdump mymodule.ko --section-headers
mymodule.ko: file format elf64-x86-64
Sections:
Idx Name Size VMA LMA File off Algn
0 .note.gnu.build-id 00000024 0000000000000000 0000000000000000 00000040 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .text 0000b345 0000000000000000 0000000000000000 00000064 2**0
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
12 .data 000001e4 0000000000000000 0000000000000000 00012620 2**5
CONTENTS, ALLOC, LOAD, RELOC, DATA, LINK_ONCE_DISCARD
15 .bss 00000014 0000000000000000 0000000000000000 00012a80 2**3
ALLOC