Re: printk() format %pS wrong symbol

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 06, 2020 at 06:06:42PM -0400, William Tambe wrote:
> the issue I am having is due to sprint_backtrace() calling
> __sprint_symbol() with its argument symbol_offset == -1.
> Despite the comment above its definition, it is hard to understand why
> sprint_backtrace() calls __sprint_symbol() that way; in our port it
> results in printing incorrect symbols.
> As a workaround, we have made sprint_backtrace() to be the same as
> sprint_symbol().

>From what I understand print_backtrace() tries to handle the case when
call is the last instruction in a function:

func1: ...
       ...
       ...
       call noret_func3()
func2: ...
       ...
       ...

Return value on the stack points to the next instruction after the call. 
But in this case a new function already starts on that address so they
add -1 to make the address point back to func1.

Not sure what goes wrong in your case, could you share an example and
more info on the port?

-- 
Valentin

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux