This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]