Re: [RFC v2 7/7] kprobes: port to linker table
From: Luis R. Rodriguez
Date: Fri Feb 19 2016 - 09:55:38 EST
On Fri, Feb 19, 2016 at 02:15:11PM +0000, Russell King - ARM Linux wrote:
> On Fri, Feb 19, 2016 at 05:45:59AM -0800, Luis R. Rodriguez wrote:
> > kprobe makes use of two custom sections:
> >
> > type name begin end
> > init.data _kprobe_blacklist __start_kprobe_blacklist __stop_kprobe_blacklist
> > text .kprobes.text __kprobes_text_start __kprobes_text_end
> >
> > Port these to the linker table generic solution. This lets
> > us remove all the custom kprobe section declarations on the
> > linker script.
>
> I don't like this. You create this "table" thing, which you use for
> tables, and then you go and use it for something else - for kprobes
> text which is not a table. The kprobes text section is a section for
> text which is not kprobe-able.
No the thing about linker tables is its generalizing custom section solutions
we have scattered all over the place.
> So, it seems to be a complete mis-nomer to me. Maybe you can explain
> the rationale here?
Sure, so each custom section solution requires modifying the linker script.
With linker tables we end up only with a few basic types of tables, a
read-only, text, data, init init_data, etc. A linker table belongs to one of
these. The linker table provides a means by which to describe explicitly
what type of section you are using for your solution but also allows us
to enable such custom solutions without furthering the custom linker
script.
Luis