This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -ffunction-sections and -fdata-sections documentation
- From: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- To: David Edelsohn <dje dot gcc at gmail dot com>
- Cc: GCC <gcc at gcc dot gnu dot org>
- Date: Fri, 13 Oct 2017 20:29:44 +0200 (CEST)
- Subject: Re: -ffunction-sections and -fdata-sections documentation
- Authentication-results: sourceware.org; auth=none
- References: <8469cdcc-a00b-0b31-43f5-0fd3df7eab67@embedded-brains.de> <CAGWvnykhRbnS7=9XZYK+d_HgUi383csQALix=suJ8uEbAiQ=_w@mail.gmail.com>
----- Am 13. Okt 2017 um 16:02 schrieb David Edelsohn dje.gcc@gmail.com:
> On Fri, Oct 13, 2017 at 3:06 AM, Sebastian Huber
> <sebastian.huber@embedded-brains.de> wrote:
>> Hello,
>>
>> I would like to update the documentation of these compiler flags and have
>> some questions. The -ffunction-sections and -fdata-sections documentation
>> is currently:
>>
>> "Place each function or data item into its own section in the output file if
>> the target supports arbitrary sections. The name of the function or the name
>> of the data item determines the section’s name in the output file.
>>
>> Use these options on systems where the linker can perform optimizations to
>> improve locality of reference in the instruction space. Most systems using
>> the ELF object format and SPARC processors running Solaris 2 have linkers
>> with such optimizations. AIX may have these optimizations in the future.
>>
>> Only use these options when there are significant benefits from doing so.
>> When you specify these options, the assembler and linker create larger
>> object and executable files and are also slower. You cannot use |gprof| on
>> all systems if you specify this option, and you may have problems with
>> debugging if you specify both this option and -g."
>>
>> The end-of-life of Solaris 2.6 was 2006. Is it worth to mention this here?
>>
>> This "AIX may have these optimizations in the future." is there since at
>> least 1996. What is the current AIX status?
>>
>> Is the "Only use these options when there are significant benefits from
>> doing so. When you specify these options, the assembler and linker create
>> larger object and executable files and are also slower. You cannot use
>> |gprof| on all systems if you specify this option, and you may have problems
>> with debugging if you specify both this option and -g." still correct on the
>> systems of today?
>>
>> Do these options affect the code generation?
>
> Out of date documentation in GCC? What a surprise!
>
> -ffunction-sections and -fdata-sections are available on AIX. The AIX
> linker rearranges sections (CSECTs) based on the call graph. The
> performance impact varies.
>
> I'm not certain what the central question of the email message is.
The central question for me is the effect on code generation.