This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/27950] [4.2 regression] undefined reference when compiling valgrind 3.2.0
- From: "seongbae dot park at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jun 2006 23:55:27 -0000
- Subject: [Bug middle-end/27950] [4.2 regression] undefined reference when compiling valgrind 3.2.0
- References: <bug-27950-12708@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from seongbae dot park at gmail dot com 2006-06-23 23:55 -------
Looks like this indeed is a duplicate of 27657.
In toplev.c:
1013 cgraph_varpool_assemble_pending_decls ();
...
1040 (*debug_hooks->finish) (main_input_filename);
dwarf2 finish ends up calling final.c:output_address w/ SYMREF to hacky_auxmap,
which calls mark_decl_referenced() for hacky_auxmap declaration
and is added to the pending list of varpool decls to be emitted.
However, there's no call to cgraph_varpool_assemble_pending_decls()
so even though hacky_auxmap is marked as needed, it won't get output.
Calling
cgraph_varpool_assemble_pending_decls()
after debug hook finish can alleviate the linking problem
by forcing the emission of hacky_auxmap (which seems
unused except for debug information purpose,
after uncalled static function elimination).
However, the real cause is having const value marking for an unused
(and hence removed) static variable - gcc seems to determine
that auxmap is not used, after some removal of unused static functions
and the analysis looks correct (though I didn't try hard to verify that).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27950