r167795 gcc/ 2010-12-14 Jan Hubicka PR middle-end/46667 * varasm.c (assemble_start_function): Do not call resolve_unique_section. * cfgexpand.c (gimple_expand_cfg): Resolve it here. --- gcc-4.6-20101127/gcc/cfgexpand.c.~1~ 2010-11-24 09:57:37.000000000 +0100 +++ gcc-4.6-20101127/gcc/cfgexpand.c 2010-12-22 18:20:03.000000000 +0100 @@ -3949,6 +3949,10 @@ gimple_expand_cfg (void) crtl->preferred_stack_boundary = STACK_BOUNDARY; cfun->cfg->max_jumptable_ents = 0; + /* Resovle the function section. Some targets, like ARM EABI rely on knowledge + of the function section at exapnsion time to predict distance of calls. */ + resolve_unique_section (current_function_decl, 0, flag_function_sections); + /* Expand the variables recorded during gimple lowering. */ timevar_push (TV_VAR_EXPAND); start_sequence (); --- gcc-4.6-20101127/gcc/varasm.c.~1~ 2010-11-23 17:06:37.000000000 +0100 +++ gcc-4.6-20101127/gcc/varasm.c 2010-12-22 18:19:57.000000000 +0100 @@ -1549,8 +1549,6 @@ assemble_start_function (tree decl, cons if (CONSTANT_POOL_BEFORE_FUNCTION) output_constant_pool (fnname, decl); - resolve_unique_section (decl, 0, flag_function_sections); - /* Make sure the not and cold text (code) sections are properly aligned. This is necessary here in the case where the function has both hot and cold sections, because we don't want to re-set