<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 11/25/2010 01:31 PM, dotnetdub wrote:
<blockquote
 cite="mid:AANLkTinUoF49nfaAcShw9yuz=ck0rkuEbtruBAyJgjGL@mail.gmail.com"
 type="cite">
  <div class="gmail_quote"><br>
  <div>
  <div>There are 36 section headers, starting at offset 0x17b34:</div>
  <div><br>
  </div>
  <div>Section Headers:</div>
  <div>&nbsp;&nbsp;[Nr] Name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Type &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Addr &nbsp; &nbsp; Off &nbsp; &nbsp;Size &nbsp;
ES Flg Lk Inf Al</div>
  <div>&nbsp;&nbsp;[ 0] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NULL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;00000000 000000 000000
00 &nbsp; &nbsp; &nbsp;0 &nbsp; 0 &nbsp;0</div>
  <div>&nbsp;&nbsp;[ 1] .hash &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HASH &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;000000b4 0000b4 000498
04 &nbsp; A &nbsp;3 &nbsp; 0 &nbsp;4</div>
  <div>&nbsp;&nbsp;[ 2] .gnu.hash &nbsp; &nbsp; &nbsp; &nbsp; GNU_HASH &nbsp; &nbsp; &nbsp; &nbsp;0000054c 00054c 0002d8
04 &nbsp; A &nbsp;3 &nbsp; 0 &nbsp;4</div>
  <div>&nbsp;&nbsp;[ 3] .dynsym &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DYNSYM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;00000824 000824 000650
10 &nbsp; A &nbsp;4 &nbsp; 1 &nbsp;4</div>
  <div>&nbsp;&nbsp;[ 4] .dynstr &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; STRTAB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;00000e74 000e74 000581
00 &nbsp; A &nbsp;0 &nbsp; 0 &nbsp;1</div>
  <div>&nbsp;&nbsp;[ 5] .gnu.version &nbsp; &nbsp; &nbsp;VERSYM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;000013f6 0013f6 0000ca
02 &nbsp; A &nbsp;3 &nbsp; 0 &nbsp;2</div>
  <div>&nbsp;&nbsp;[ 6] .gnu.version_r &nbsp; &nbsp;VERNEED &nbsp; &nbsp; &nbsp; &nbsp; 000014c0 0014c0 000030
00 &nbsp; A &nbsp;4 &nbsp; 1 &nbsp;4</div>
  <div>&nbsp;&nbsp;[ 7] .rel.dyn &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;REL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 000014f0 0014f0 0001d0
08 &nbsp; A &nbsp;3 &nbsp; 0 &nbsp;4</div>
  <div>&nbsp;&nbsp;[ 8] .rel.plt &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;REL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 000016c0 0016c0 000210
08 &nbsp; A &nbsp;3 &nbsp;10 &nbsp;4</div>
  <div>&nbsp;&nbsp;[ 9] .init &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;000018d0 0018d0 000030
00 &nbsp;AX &nbsp;0 &nbsp; 0 &nbsp;4</div>
  <div>&nbsp;&nbsp;[10] .plt &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;00001900 001900 000430
04 &nbsp;AX &nbsp;0 &nbsp; 0 &nbsp;4</div>
  <div>&nbsp;&nbsp;[11] .text &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;00001d30 001d30 0080d8
00 &nbsp;AX &nbsp;0 &nbsp; 0 16</div>
  <div>&nbsp;&nbsp;[12] .fini &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;00009e08 009e08 00001c
00 &nbsp;AX &nbsp;0 &nbsp; 0 &nbsp;4</div>
  <div>&nbsp;&nbsp;[13] .rodata &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;00009e24 009e24 001618
01 AMS &nbsp;0 &nbsp; 0 &nbsp;4</div>
  <div>&nbsp;&nbsp;[14] .eh_frame &nbsp; &nbsp; &nbsp; &nbsp; PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;0000b43c 00b43c 000004
00 &nbsp; A &nbsp;0 &nbsp; 0 &nbsp;4</div>
  <div>&nbsp;&nbsp;[15] .ctors &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;0000c440 00b440 000008
00 &nbsp;WA &nbsp;0 &nbsp; 0 &nbsp;4</div>
  <div>&nbsp;&nbsp;[16] .dtors &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;0000c448 00b448 000008
00 &nbsp;WA &nbsp;0 &nbsp; 0 &nbsp;4</div>
  <div>&nbsp;&nbsp;[17] .jcr &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;0000c450 00b450 000004
00 &nbsp;WA &nbsp;0 &nbsp; 0 &nbsp;4</div>
  <div>&nbsp;&nbsp;[18] .dynamic &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DYNAMIC &nbsp; &nbsp; &nbsp; &nbsp; 0000c454 00b454 0000c8
08 &nbsp;WA &nbsp;4 &nbsp; 0 &nbsp;4</div>
  <div>&nbsp;&nbsp;[19] .got &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;0000c51c 00b51c 00006c
04 &nbsp;WA &nbsp;0 &nbsp; 0 &nbsp;4</div>
  <div>&nbsp;&nbsp;[20] .got.plt &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;0000c588 00b588 000114
04 &nbsp;WA &nbsp;0 &nbsp; 0 &nbsp;4</div>
  <div>&nbsp;&nbsp;[21] .data &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;0000c6a0 00b6a0 00012c
00 &nbsp;WA &nbsp;0 &nbsp; 0 32</div>
  <div>&nbsp;&nbsp;[22] .bss &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NOBITS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0000c7e0 00b7cc 0004a0
00 &nbsp;WA &nbsp;0 &nbsp; 0 32</div>
  <div>&nbsp;&nbsp;[23] .comment &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;00000000 00b7cc 0000d9
00 &nbsp; &nbsp; &nbsp;0 &nbsp; 0 &nbsp;1</div>
  <div>&nbsp;&nbsp;[24] .debug_aranges &nbsp; &nbsp;PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;00000000 00b8a8 0000b0
00 &nbsp; &nbsp; &nbsp;0 &nbsp; 0 &nbsp;8</div>
  <div>&nbsp;&nbsp;[25] .debug_pubnames &nbsp; PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;00000000 00b958 000448
00 &nbsp; &nbsp; &nbsp;0 &nbsp; 0 &nbsp;1</div>
  <div>&nbsp;&nbsp;[26] .debug_info &nbsp; &nbsp; &nbsp; PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;00000000 00bda0 005dd1
00 &nbsp; &nbsp; &nbsp;0 &nbsp; 0 &nbsp;1</div>
  <div>&nbsp;&nbsp;[27] .debug_abbrev &nbsp; &nbsp; PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;00000000 011b71 0007a8
00 &nbsp; &nbsp; &nbsp;0 &nbsp; 0 &nbsp;1</div>
  <div>&nbsp;&nbsp;[28] .debug_line &nbsp; &nbsp; &nbsp; PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;00000000 012319 0014b9
00 &nbsp; &nbsp; &nbsp;0 &nbsp; 0 &nbsp;1</div>
  <div>&nbsp;&nbsp;[29] .debug_frame &nbsp; &nbsp; &nbsp;PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;00000000 0137d4 0004b0
00 &nbsp; &nbsp; &nbsp;0 &nbsp; 0 &nbsp;4</div>
  <div>&nbsp;&nbsp;[30] .debug_str &nbsp; &nbsp; &nbsp; &nbsp;PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;00000000 013c84 001d76
01 &nbsp;MS &nbsp;0 &nbsp; 0 &nbsp;1</div>
  <div>&nbsp;&nbsp;[31] .debug_loc &nbsp; &nbsp; &nbsp; &nbsp;PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;00000000 0159fa 001ebe
00 &nbsp; &nbsp; &nbsp;0 &nbsp; 0 &nbsp;1</div>
  <div>&nbsp;&nbsp;[32] .debug_ranges &nbsp; &nbsp; PROGBITS &nbsp; &nbsp; &nbsp; &nbsp;00000000 0178b8 000140
00 &nbsp; &nbsp; &nbsp;0 &nbsp; 0 &nbsp;8</div>
  <div>&nbsp;&nbsp;[33] .shstrtab &nbsp; &nbsp; &nbsp; &nbsp; STRTAB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;00000000 0179f8 00013b
00 &nbsp; &nbsp; &nbsp;0 &nbsp; 0 &nbsp;1</div>
  <div>&nbsp;&nbsp;[34] .symtab &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SYMTAB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;00000000 0180d4 0009e0
10 &nbsp; &nbsp; 35 &nbsp;58 &nbsp;4</div>
  <div>&nbsp;&nbsp;[35] .strtab &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; STRTAB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;00000000 018ab4 0006ec
00 &nbsp; &nbsp; &nbsp;0 &nbsp; 0 &nbsp;1</div>
  <div>Key to Flags:</div>
  <div>&nbsp;&nbsp;W (write), A (alloc), X (execute), M (merge), S (strings)</div>
  <div>&nbsp;&nbsp;I (info), L (link order), G (group), x (unknown)</div>
  <div>&nbsp;&nbsp;O (extra OS processing required) o (OS specific), p (processor
specific)</div>
  </div>
  <div><br>
  </div>
  <div><br>
  </div>
&nbsp;
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
    <div text="#000000" bgcolor="#ffffff">in the gdb console load the
topoh.so<br>
    <br>
add-symbol-file /path/to/topoh.so 0xb7004000 + 0x&lt;offset of .text
segment found as above&gt; <br>
    <br>
    </div>
  </blockquote>
  <div><br>
  </div>
  <div>Ok.</div>
  <div><br>
  </div>
  </div>
</blockquote>
Hello <br>
<br>
Did you give gdb the command <br>
add-symbol-file /path/to/topoh.so 0xb7004000+0x00001d30 <br>
<br>
Gdb should inquire you if you want to lead topoh.so at offset
0xb7005d30 (press 'y'). Then the IP should not be out of bounds ... it
should be mapped to the topoh.so text segment. Ah, I have made a
mistake, there should be no spaces between the address and the offset
(as seen above)<br>
<br>
Anyway you should get something like this (on my machine - on your use
the offsets from above)<br>
(gdb) add-symbol-file modules/topoh/topoh.so 0xb7004000+0x00001d80<br>
add symbol table from file "modules/topoh/topoh.so" at<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .text_addr = 0xb7005d80<br>
(y or n) y<br>
Reading symbols from
/home/marius/dev/sip-router/modules/topoh/topoh.so...done.<br>
<br>
Then<br>
(gdb) x/s 0xb70070d9<br>
!!!!!!!!!!!!!!!!!!0xb70070d9 &lt;th_get_hdr_cookie+25&gt;:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;Address 0xb70070d9 out of bounds&gt;!!!!!!!!!!!!!!!!!<br>
<br>
The line between all the !!!!!! is the line I care about<br>
<br>
<br>
Also don't forget <br>
(gdb)info registers<br>
<br>
Thank you <br>
Marius<br>
<br>
<br>
<br>
</body>
</html>