grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grub_mod_init and grub_mod_fini missing from symbol table


From: Neil Cafferkey
Subject: grub_mod_init and grub_mod_fini missing from symbol table
Date: Sun, 6 Sep 2009 19:04:48 +0100
User-agent: Mutt/1.4.2.1i

Hi,

When compiling GRUB with GCC 3.4.3, I had the problem that my modules
didn't work, apparently because the symbols grub_mod_init and
grub_mod_fini weren't in the modules' symbol tables.

Does the absence of these symbols indicate a bug in GCC, or does
"__attribute__ ((used))" not in fact guarantee placement in the symbol
table?

I got around the problem by making these functions non-static. Would this
be undesirable in the main code tree? (Obviously it would be a problem if
modules are to be linked together, but I don't know if this is ever done
in GRUB.)

BTW, does the call to grub_mod_init() from grub_##name##_init() not make
"((used))" unnecessary in the former (and likewise for *fini)?

I've included the macro from includes/grub/dl.h that generates these
functions below.

Regards,
Neil

#define GRUB_MOD_INIT(name)     \
void grub_mod_init (grub_dl_t mod __attribute__ ((unused))) __attribute__ 
((used)); \
void grub_##name##_init (void); \
void \
grub_##name##_init (void) { grub_mod_init (0); } \
void \
grub_mod_init (grub_dl_t mod __attribute__ ((unused)))

#define GRUB_MOD_FINI(name)     \
void grub_mod_fini (void) __attribute__ ((used)); \
void grub_##name##_fini (void); \
void \
grub_##name##_fini (void) { grub_mod_fini (); } \
void \
grub_mod_fini (void)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]