function-sections and data-sections option in gcc

R

Raman

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
 
S

Spoon

Raman said:
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.
 
F

Flash Gordon

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
 
K

Keith Thompson

Raman said:
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.
 
R

Raman

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) (e-mail address removed) <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
 
S

santosh

Raman said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top