<div dir="ltr"><div dir="ltr"><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jul 4, 2020 at 6:29 AM Valentin Vidić <<a href="mailto:vvidic@valentin-vidic.from.hr">vvidic@valentin-vidic.from.hr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sat, Jul 04, 2020 at 06:11:19AM -0400, William Tambe wrote:<br>
> I am seeing an issue in our Linux port where printk() format %pS will print<br>
> a symbol as:<br>
> kernel_init+0x120/0x120<br>
> where the offset within the function 0x120, is the same as the function<br>
> size 0x120; in fact, the largest offset within the function should be 0x11f.<br>
> <br>
> When printing above symbol+offset in gdb, the correct symbol is<br>
> displayed as follow:<br>
> <br>
> (gdb) p (void*)(kernel_init+0x120)<br>
> $1 = (void *) 0x589a28 <ret_for_syscall><br>
> <br>
> What could be the cause of printk() format %pS printing an incorrect symbol.<br>
> <br>
> Where can I find in the Linux source code, the function handling the format<br>
> %pS ?<br>
<br>
Check lib/vsprintf.c<br></blockquote><div><br></div><div>How or which function within that file translates an address to the string symbol+offset for the format %pS ?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
-- <br>
Valentin<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a>Kernelnewbies@kernelnewbies.org</a><br>
<a rel="noreferrer">https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</blockquote></div></div>