Messages in this thread | | | Subject | Re: [RFC v1 0/8] x86/init: Linux linker tables | From | "H. Peter Anvin" <> | Date | Thu, 17 Dec 2015 20:40:09 -0800 |
| |
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
| |