tables.h: split off linker table in 3 parts

There are two ways custom ELF sections are used:

a) text "ranges":

   Collection of executable routines, this use varies but one
   example is the kernel's kprobes. Since kprobes uses two
   custom sections, to be specific this references the use
   case for .kprobes.text -- these are currently rolled into
   the kernel's INIT_DATA in include/asm-generic/vmlinux.lds.h
   and used as INIT_DATA_SECTION(16) on x86 under
   arch/x86/kernel/vmlinux.lds.S

b) tables:

   Custom data structures stitched together

We split off linker tables into 3 sections:

I.   include/linux/sections.h
II.  include/linux/tables.h
III. include/linux/ranges.h

The sections.h already existed, we just keep stuffing in there
generic helpers which allow us to streamlne customizing Linux
sections.

Motivation for this is as per hpa [0]:

-----------------------------------------------------------------------
1. priority ordering doesn't make any sense for ranges.
2. ranges can be hierarchial, that is, range "bar" can be entirely
   inside range "foo".
3. ranges aren't typed (although in C, that pretty much means they are
   "char" or "unsigned char" as there really isn't any way to define an
   "array of void".)
4. the only useful operator on a range is "is address X inside this
   range"; this operator is likely *not* useful for a table, since
   if you have to ever invoke it you are probably doing something very
   wrong.

For this to work, we need strings such that they will always sort in the
appropriate order with the bracket symbols around subranges.
-----------------------------------------------------------------------

This is an initial attempt to provide support for this. We do this
by first acknowledging that that both section ranges and linker tables
need common building blocks, and then granting the option to declare
either a section range, or letting you customize this further
with a custom data structure. This at least addresses the conceptual
division between section ranges and linker tables.

No section range support test case is provided here, although upstream
this would be used for the .kprobes.text.

We'll next need to try to demo an example with subsections.

[0] http://lkml.kernel.org/r/56CCE9B6.4080000@zytor.com

Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
7 files changed