On Wed, 16 Feb 2005, Jeff Garzik wrote:
>
> In example.c:
> 
>          FOR_EACH_PTR(list, sym) {
>                  struct entrypoint *ep;
>                  expand_symbol(sym);
>                  ep = linearize_symbol(sym);
>                  if (ep)
>                          output(ep);
>          } END_FOR_EACH_PTR(sym);
> 
> Does 'struct entrypoint' include stuff outside function scope like 
> global and static variables?

No. The linearizer will do nothign with those. So you'd generally do 
something like this:

        FOR_EACH_PTR(list, sym) {
                struct entrypoint *ep;
                expand_symbol(sym);
                ep = linearize_symbol(sym);
                if (ep)
                        output_code(ep);
                else if (sym->initializer)
                        output_initializer(sym);
                else 
                        output_bss(sym);
        } END_FOR_EACH_PTR(sym);

(or _something_ like that, you get the idea)

                Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to