Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1294433

Re: [RFC v1 0/8] x86/init: Linux linker tables

From "H. Peter Anvin" <hpa@zytor.com>
Newsgroups linux.kernel
Subject Re: [RFC v1 0/8] x86/init: Linux linker tables
Date 2015-12-18 05:50 +0100
Message-ID <qGV9n-Tm-3@gated-at.bofh.it> (permalink)
References <qG66R-1Iz-7@gated-at.bofh.it> <qGNvc-4lY-17@gated-at.bofh.it> <qGQt4-6k7-19@gated-at.bofh.it> <qGUQ2-Ms-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC v1 0/8] x86/init: Linux linker tables "Luis R. Rodriguez" <mcgrof@do-not-panic.com> - 2015-12-15 23:20 +0100
  [RFC v1 8/8] x86/init: use linker table for mid early setup "Luis R. Rodriguez" <mcgrof@do-not-panic.com> - 2015-12-15 23:20 +0100
  [RFC v1 3/8] x86/boot: add BIT() to boot/bitops.h "Luis R. Rodriguez" <mcgrof@do-not-panic.com> - 2015-12-15 23:20 +0100
  [RFC v1 4/8] x86/init: add linker table support "Luis R. Rodriguez" <mcgrof@do-not-panic.com> - 2015-12-15 23:20 +0100
  Re: [RFC v1 0/8] x86/init: Linux linker tables "H. Peter Anvin" <hpa@zytor.com> - 2015-12-16 00:10 +0100
  Re: [RFC v1 0/8] x86/init: Linux linker tables "H. Peter Anvin" <hpa@zytor.com> - 2015-12-17 21:40 +0100
    Re: [RFC v1 0/8] x86/init: Linux linker tables "Luis R. Rodriguez" <mcgrof@suse.com> - 2015-12-18 00:50 +0100
      Re: [RFC v1 0/8] x86/init: Linux linker tables "Luis R. Rodriguez" <mcgrof@do-not-panic.com> - 2015-12-18 01:00 +0100
      Re: [RFC v1 0/8] x86/init: Linux linker tables "H. Peter Anvin" <hpa@zytor.com> - 2015-12-18 05:30 +0100
        Re: [RFC v1 0/8] x86/init: Linux linker tables "H. Peter Anvin" <hpa@zytor.com> - 2015-12-18 05:50 +0100
        Re: [RFC v1 0/8] x86/init: Linux linker tables "Luis R. Rodriguez" <mcgrof@suse.com> - 2015-12-18 20:00 +0100
          Re: [RFC v1 0/8] x86/init: Linux linker tables "H. Peter Anvin" <hpa@zytor.com> - 2015-12-18 20:00 +0100

csiph-web