public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathaniel McCallum <nathaniel@natemccallum.com>
To: Greg KH <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Exposing device ids and driver names
Date: Thu, 01 Oct 2009 17:36:57 -0400	[thread overview]
Message-ID: <4AC520F9.8000201@natemccallum.com> (raw)
In-Reply-To: <20091001184021.GA26875@kroah.com>

On 10/01/2009 02:40 PM, Greg KH wrote:
> On Thu, Oct 01, 2009 at 02:35:40PM -0400, Nathaniel McCallum wrote:
>> But I still would prefer a non-invasive solution.
>
> Agreed, sorry I don't have an idea on how to do it.

How about this?

-#define MODULE_GENERIC_TABLE(gtype,name)
+#define MODULE_GENERIC_TABLE(gtype,name)               \
+static const struct gtype##_id gtype##_id_table        \
+  __attribute__ ((unused, alias(__stringify(name))))

We add an alias to the existing symbol.  This just creates a new entry 
in the symbol table.  These entries are all stripped anyway and inserted 
into the System.map.

Impact:
	* No change to the resulting vmlinuz binary
	* Increases size of System.map (~2k with the Fedora config)

Nathaniel


  parent reply	other threads:[~2009-10-01 21:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-01 16:40 Exposing device ids and driver names Nathaniel McCallum
2009-10-01 16:42 ` Greg KH
2009-10-01 17:01   ` Nathaniel McCallum
2009-10-01 18:05     ` Greg KH
2009-10-01 18:35       ` Nathaniel McCallum
2009-10-01 18:40         ` Greg KH
2009-10-01 18:56           ` Nathaniel McCallum
2009-10-01 19:07             ` Greg KH
2009-10-01 19:17               ` Nathaniel McCallum
2009-10-01 21:36           ` Nathaniel McCallum [this message]
2009-10-01 17:47 ` Stefan Richter
2009-10-01 18:02   ` Nathaniel McCallum
2009-10-01 18:23     ` Stefan Richter
2009-10-01 18:28       ` Nathaniel McCallum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AC520F9.8000201@natemccallum.com \
    --to=nathaniel@natemccallum.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox