From d06865bf070f23cafe7bf03851c5b5ac3747ed97 Mon Sep 17 00:00:00 2001 From: Dave Korn Date: Mon, 10 Jan 2011 00:33:32 +0000 Subject: re PR c++/47218 (C++ multiple definitions of non-virtual thunk problem) gcc/ChangeLog: PR c++/47218 * cgraphunit.c (assemble_thunk): Call resolve_unique_section. gcc/testsuite/ChangeLog: PR c++/47218 * g++.dg/other/pr47218-1.C: New test file. * g++.dg/other/pr47218.C: Likewise. * g++.dg/other/pr47218.h: New supporting header. From-SVN: r168624 --- gcc/cgraphunit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gcc/cgraphunit.c') diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index ec477ee..92e5aa9 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1,6 +1,6 @@ /* Callgraph based interprocedural optimizations. - Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 - Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, + 2011 Free Software Foundation, Inc. Contributed by Jan Hubicka This file is part of GCC. @@ -1317,6 +1317,9 @@ assemble_thunk (struct cgraph_node *node) current_function_decl = thunk_fndecl; + /* Ensure thunks are emitted in their correct sections. */ + resolve_unique_section (thunk_fndecl, 0, flag_function_sections); + if (this_adjusting && targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset, virtual_value, alias)) -- cgit v1.1