Re: Exposing device ids and driver names

From: Nathaniel McCallum
Date: Thu Oct 01 2009 - 17:37:11 EST


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

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