lkml.org 
[lkml]   [2022]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [powerpc] ftrace warning kernel/trace/ftrace.c:2068 with code-patching selftests
On Thu, Jan 27, 2022 at 07:46:01AM -0500, Steven Rostedt wrote:
> On Thu, 27 Jan 2022 12:27:04 +0000
> Mark Rutland <mark.rutland@arm.com> wrote:
>
> > Ah, so those non-ELF relocations for the mcount_loc table just mean "apply the
> > KASLR offset here", which is equivalent for all entries.
> >
> > That makes sense, thanks!
>
> And this is why we were having such a hard time understanding each other ;-)

;)

With that in mind, I think that we understand that the build-time sort works
for:

* arch/x86, becuase the non-ELF relocations for mcount_loc happen to be
equivalent.

* arch/arm, because there's no dynamic relocaiton and the mcount_loc entries
have been finalized prior to sorting.

... but doesn't work for anyone else (including arm64) because the ELF
relocations are not equivalent, and need special care that is not yet
implemented.

So we should have arm and x86 opt-in, but for now everyone else (including
arm64, powerpc, s390) should be left with the prior behaviour with the runtime
sort only (in case the build-time sort breaks anything, as I mentioned in my
other mail).

Does that sound about right?

In future we might be able to do something much smarter (e.g. adding some
preprocessing to use relative entries).

I'll take a look at shelf. :)

Thanks,
Mark.

> I started a new project called "shelf", which is a shell interface to
> read ELF files (Shelf on a ELF!).
>
> It uses my ccli library:
>
> https://github.com/rostedt/libccli
>
> and can be found here:
>
> https://github.com/rostedt/shelf
>
> Build and install the latest libccli and then build this with just
> "make".
>
> $ shelf vmlinux
>
> and then you can see what is stored in the mcount location:
>
> shelf> dump symbol __start_mcount_loc - __stop_mcount_loc
>
> I plan on adding more to include the REL and RELA sections and show how
> they affect symbols and such.
>
> Feel free to contribute too ;-)
>
> -- Steve

\
 
 \ /
  Last update: 2022-01-27 14:09    [W:0.425 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site