function-sections and data-sections option in gcc

Discussion in 'C Programming' started by Raman, Aug 2, 2007.

  1. Raman

    Raman Guest

    Hi All,


    Could any one tell what exactly these two option do. I have not been
    able to understand why we use them because as per the gcc man page,
    these options increase the size of libraries and exe


    Thanks in advance,
    Raman Chalotra
    Raman, Aug 2, 2007
    #1
    1. Advertising

  2. Raman

    Spoon Guest

    Raman wrote:

    > Could any one tell what exactly these two option do. I have not been
    > able to understand why we use them because as per the gcc man page,
    > these options increase the size of libraries and exe


    This group is not appropriate to answer your question.
    cf. http://gcc.gnu.org/lists.html

    http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Optimize-Options.html

    -ffunction-sections
    -fdata-sections
    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 will
    create larger object and executable files and will also be slower. You
    will not be able to 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.
    Spoon, Aug 2, 2007
    #2
    1. Advertising

  3. Raman

    Flash Gordon Guest

    Raman wrote, On 02/08/07 08:49:
    >
    > Could any one tell what exactly these two option do. I have not been
    > able to understand why we use them because as per the gcc man page,
    > these options increase the size of libraries and exe


    This is to do with gcc, not the C programming language, so you need to
    ask somewhere that deals specifically with gcc such as gnu.gcc.help
    --
    Flash Gordon
    Flash Gordon, Aug 2, 2007
    #3
  4. Raman said:

    > Hi All,
    >
    >
    > Could any one tell what exactly these two option do.


    Yes. The people in gnu.gcc.help could.

    --
    Richard Heathfield <http://www.cpax.org.uk>
    Email: -www. +rjh@
    Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
    "Usenet is a strange place" - dmr 29 July 1999
    Richard Heathfield, Aug 2, 2007
    #4
  5. Raman <> writes:
    > Could any one tell what exactly these two option do. I have not been
    > able to understand why we use them because as per the gcc man page,
    > these options increase the size of libraries and exe


    What two options?

    Oh, I see, it's in the subject header. Please put the entire question
    in the body of your message.

    As it happens, your question really isn't about C. I believe the gcc
    documentation answers your question. If not, try gnu.gcc.help.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
    Keith Thompson, Aug 2, 2007
    #5
  6. Raman

    Raman Guest

    On Aug 2, 2:02 pm, Keith Thompson <> wrote:
    > Raman<> writes:
    > > Could any one tell what exactly these two option do. I have not been
    > > able to understand why we use them because as per the gcc man page,
    > > these options increase the size of libraries and exe

    >
    > What two options?
    >
    > Oh, I see, it's in the subject header. Please put the entire question
    > in the body of your message.
    >
    > As it happens, your question really isn't about C. I believe the gcc
    > documentation answers your question. If not, try gnu.gcc.help.
    >
    > --
    > Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    > San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    > "We must do something. This is something. Therefore, we must do this."
    > -- Antony Jay and Jonathan Lynn, "Yes Minister"



    My apologise for putting option in subject.

    Thanks for the responce.

    Regards,
    Raman Chalotra
    Raman, Aug 3, 2007
    #6
  7. Raman

    santosh Guest

    Raman wrote:

    > On Aug 2, 2:02 pm, Keith Thompson <> wrote:
    >> Raman<> writes:
    >> > Could any one tell what exactly these two option do. I have not been
    >> > able to understand why we use them because as per the gcc man page,
    >> > these options increase the size of libraries and exe

    >>
    >> What two options?
    >>
    >> Oh, I see, it's in the subject header. Please put the entire question
    >> in the body of your message.
    >>
    >> As it happens, your question really isn't about C. I believe the gcc
    >> documentation answers your question. If not, try gnu.gcc.help.
    >>
    >> --
    >> Keith Thompson (The_Other_Keith)
    >> <http://www.ghoti.net/~kst>
    >> San Diego Supercomputer Center <*>
    >> <http://users.sdsc.edu/~kst>
    >> "We must do something. This is something. Therefore, we must do this."
    >> -- Antony Jay and Jonathan Lynn, "Yes Minister"

    >
    >
    > My apologise for putting option in subject.
    >
    > Thanks for the responce.


    Also please don't quote signature blocks, i.e., text after a '-- NL'
    sequence, unless you're discussing it, which is almost always off-topic.
    santosh, Aug 3, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Julien ROUZIERES

    g++ -pg option and -shared option

    Julien ROUZIERES, Dec 21, 2004, in forum: C++
    Replies:
    1
    Views:
    704
    GianGuz
    Dec 21, 2004
  2. Replies:
    8
    Views:
    418
  3. Madhur

    C_INCLUDE_PATH and gcc -I option

    Madhur, Jun 9, 2008, in forum: C Programming
    Replies:
    3
    Views:
    832
    Ben Bacarisse
    Jun 9, 2008
  4. Madhur
    Replies:
    0
    Views:
    550
    Madhur
    Jun 9, 2008
  5. GriffithsJ

    Giving the user option to expand sections

    GriffithsJ, Oct 1, 2003, in forum: ASP General
    Replies:
    1
    Views:
    116
    Rick Groenewegen
    Oct 1, 2003
Loading...

Share This Page