Quo vadis, thunk? (Was: Re: [PATCH/RFA] PR target/16665: SH thunk

Mark Mitchell mark@codesourcery.com
Tue Aug 3 15:47:00 GMT 2004


Joern Rennecke wrote:

>No, there is code in use_thunk that sets the section of the thunk to match
>the section of the function if the function is DECL_ONE_ONLY:
>
>  if (TARGET_USE_LOCAL_THUNK_ALIAS_P (function)
>      && targetm.have_named_sections)
>    {
>      resolve_unique_section (function, 0, flag_function_sections);
>
>      if (DECL_SECTION_NAME (function) != NULL && DECL_ONE_ONLY (function))
>        {
>          resolve_unique_section (thunk_fndecl, 0, flag_function_sections);
>
>          /* Output the thunk into the same section as function.  */
>          DECL_SECTION_NAME (thunk_fndecl) = DECL_SECTION_NAME (function);
>        }
>    }
>
>AFAICS after the first resolve_unique_section call
>DECL_SECTION_NAME (function) should always be set if the function is
>DECL_ONE_ONLY and the port fully supports named sections.
>  
>
I was not aware of this code.  It does look like it does what you say, 
assuming you have TARGET_USE_LOCAL_THUNK_ALIAS_P true, which looks like 
it is true on most targets.  So, you may be able to make the assumption 
that you want on your target.

-- 
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com



More information about the Gcc mailing list