linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ftrace: sorttable unable to sort ELF64 on 32-bit host
@ 2025-03-20 22:02 Sahil Gupta
  0 siblings, 0 replies; 20+ messages in thread
From: Sahil Gupta @ 2025-03-20 22:02 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-kernel, Dmitry Safonov, Kevin Mitchell

Hi Steven,

On 6.12.0, sorttable is unable to sort 64-bit ELFs on 32-bit hosts
because of the parsing of the start_mcount_loc and stop_mcount_loc
values in get_mcount_loc():

  *_start = strtoul(start_buff, NULL, 16);

and

 *_stop = strtoul(stop_buff, NULL, 16);

This code makes the (often correct) assumption that the host and the
target have the same architecture, however it runs into issues when
compiling for a 64-bit target on a 32-bit host, as unsigned long is
shorter than the pointer width. As a result, I've noticed that both
start and stop max out at 2^32 - 1.

It seems that commit 4acda8ed fixes this issue inadvertently by
directly extracting them from the ELF using the correct width. I'm
wondering if it is possible to backport this as well as the other
sorttable refactors to 6.12.0 since they fix this issue.

Thanks,
Sahil

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2025-05-03 10:24 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CABEuK15=+Bo7xkBn5ufytVowt0j3fVEsdGVsryn1zH8KxfoCyQ@mail.gmail.com>
2025-03-24 17:36 ` ftrace: sorttable unable to sort ELF64 on 32-bit host Steven Rostedt
2025-03-24 18:39   ` Sahil Gupta
2025-03-24 18:52     ` Greg KH
2025-03-24 19:07       ` Steven Rostedt
2025-03-25 11:58         ` Greg KH
2025-03-25 12:15           ` Steven Rostedt
2025-03-25 17:52             ` Sahil Gupta
2025-03-25 18:02               ` Steven Rostedt
2025-03-25 18:10                 ` Sahil Gupta
2025-03-25 18:19                   ` Steven Rostedt
2025-03-25 18:23                     ` Sahil Gupta
2025-03-26  0:06                       ` [PATCH 6.1 6.6 6.12 6.13] scripts/sorttable: fix ELF64 mcount_loc address parsing when compiling on 32-bit Sahil Gupta
2025-03-26  0:23                         ` Greg KH
2025-03-26  0:32                           ` Steven Rostedt
2025-03-26  0:37                             ` Steven Rostedt
2025-03-26  0:45                               ` Greg KH
2025-03-26  0:47                                 ` Steven Rostedt
2025-03-26  1:07                                   ` Sahil Gupta
2025-05-03 10:24                                     ` Sahil Gupta
2025-03-20 22:02 ftrace: sorttable unable to sort ELF64 on 32-bit host Sahil Gupta

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).