2006-08-30 15:33:38

by Kaz Kylheku

[permalink] [raw]
Subject: How to prevent an object file from being thrown away?

I have an object file which contains only static objects and functions.
One of them is marked __init, and annotated with a late_initcall().
However, the file, which is added to a lib.a archive, is still
ultimately thrown away by the linker.

I can solve it with a dummy reference to a symbol in that file from
another module, but is there some "officially blessed" Linux kernel
Makefile trick to make the linker do the
--whole-archive/--no-whole-archive around a particular lib.a?