lkml.org 
[lkml]   [2015]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [RFC v1 0/8] x86/init: Linux linker tables
    From
    Date
    On 12/17/15 20:25, H. Peter Anvin wrote:
    >
    > /* DECLARE_LINKTABLE_RO */
    > extern const struct foo tablename[], tablename__end[];
    >
    > /* DEFINE_LINKTABLE_RO */
    > DECLARE_LINKTABLE_RO(struct foo, tablename);
    >
    > const struct
    > foo__attribute__((used,section(".rodata.tbl.tablename.0"))) tablename[0];
    >
    > const struct
    > foo__attribute__((used,section(".rodata.tbl.tablename.999")))
    > tablename__end[0];
    >
    > /* LINKTABLE_RO */
    > static const __typeof__(tablename)
    > __attribute__((used,section(".rodata.tbl.tablename.50")))
    > __tbl_tablename_12345
    >
    > /* LINKTABLE_SIZE */
    > ((tablename__end) - (tablename))
    >
    > ... and so on for all the possible sections where we may want tables.
    >

    Come to think of it, we could even eliminate the need for a DEFINE
    entirely if we made the start and end symbols static. However, this
    would generate an awful lot of identical-but-local symbols which
    probably would make the linker slower and definitely would bloat the
    debug data.

    -hpa




    \
     
     \ /
      Last update: 2015-12-18 06:01    [W:2.676 / U:0.036 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site