Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MkM6i-0008On-P1 for mharc-grub-devel@gnu.org; Sun, 06 Sep 2009 14:04:56 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MkM6g-0008Nf-Mo for grub-devel@gnu.org; Sun, 06 Sep 2009 14:04:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MkM6c-0008MN-2h for grub-devel@gnu.org; Sun, 06 Sep 2009 14:04:54 -0400 Received: from [199.232.76.173] (port=38268 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MkM6b-0008MK-Ue for grub-devel@gnu.org; Sun, 06 Sep 2009 14:04:49 -0400 Received: from csmail.ucc.ie ([143.239.75.220]:59372) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MkM6b-0002TZ-Ex for grub-devel@gnu.org; Sun, 06 Sep 2009 14:04:49 -0400 Received: by csmail.ucc.ie (Postfix, from userid 4060) id 894D15C002; Sun, 6 Sep 2009 19:04:48 +0100 (BST) Date: Sun, 6 Sep 2009 19:04:48 +0100 From: Neil Cafferkey To: grub-devel@gnu.org Message-ID: <20090906180448.GA3439@csmail.ucc.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 Subject: grub_mod_init and grub_mod_fini missing from symbol table X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Sep 2009 18:04:55 -0000 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)