Subject: Re: gcc-3.4 optimization kills "link sets"
To: None <>
From: Christos Zoulas <>
List: tech-kern
Date: 06/07/2004 17:59:00
In article <>,
Matthias Drochner <> wrote:
>Trying to build a kernel with gcc-3.4 I've found that the
>optimisation settings of the current default kernel Makefile
>cause unreferenced static variables to be optimized away,
>regardless of an __attribute__((unused)).
>This breaks the "link set" way of initializing arrays of
>things which are scattered around.
>Rather than introducing dummy references to trick gcc into
>keeping definitions in it would look cleaner to just make
>these definitions global -- see the appended patch.
>Are ther any possible conflicts or side-effects?
>best regards

Well, there is the "used" attribute that we should probably be using...
Reading the documentation, both "used" and "unused" attributes
affect only functions.