From: William Tambe <tambewilliam@gmail.com>
To: "Valentin Vidić" <vvidic@valentin-vidic.from.hr>
Cc: kernelnewbies@kernelnewbies.org
Subject: Re: printk() format %pS wrong symbol
Date: Sat, 4 Jul 2020 12:04:59 -0400 [thread overview]
Message-ID: <CAF8i9mMY5vHnCM+e4i0L6_BeGPYRDMcdbPUPwG-wzamEt026zg@mail.gmail.com> (raw)
In-Reply-To: <20200704102910.GA6573@valentin-vidic.from.hr>
[-- Attachment #1.1: Type: text/plain, Size: 1187 bytes --]
On Sat, Jul 4, 2020 at 6:29 AM Valentin Vidić <vvidic@valentin-vidic.from.hr>
wrote:
> On Sat, Jul 04, 2020 at 06:11:19AM -0400, William Tambe wrote:
> > I am seeing an issue in our Linux port where printk() format %pS will
> print
> > a symbol as:
> > kernel_init+0x120/0x120
> > where the offset within the function 0x120, is the same as the function
> > size 0x120; in fact, the largest offset within the function should be
> 0x11f.
> >
> > When printing above symbol+offset in gdb, the correct symbol is
> > displayed as follow:
> >
> > (gdb) p (void*)(kernel_init+0x120)
> > $1 = (void *) 0x589a28 <ret_for_syscall>
> >
> > What could be the cause of printk() format %pS printing an incorrect
> symbol.
> >
> > Where can I find in the Linux source code, the function handling the
> format
> > %pS ?
>
> Check lib/vsprintf.c
>
How or which function within that file translates an address to the string
symbol+offset for the format %pS ?
>
> --
> Valentin
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
[-- Attachment #1.2: Type: text/html, Size: 1791 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
next prev parent reply other threads:[~2020-07-04 16:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-04 10:11 printk() format %pS wrong symbol William Tambe
2020-07-04 10:29 ` Valentin Vidić
2020-07-04 16:04 ` William Tambe [this message]
2020-07-04 17:14 ` Valentin Vidić
2020-07-06 22:06 ` William Tambe
2020-07-07 18:39 ` Valentin Vidić
2020-07-07 18:53 ` Valentin Vidić
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAF8i9mMY5vHnCM+e4i0L6_BeGPYRDMcdbPUPwG-wzamEt026zg@mail.gmail.com \
--to=tambewilliam@gmail.com \
--cc=kernelnewbies@kernelnewbies.org \
--cc=vvidic@valentin-vidic.from.hr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).