By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,027 Members | 1,088 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,027 IT Pros & Developers. It's quick & easy.

How can I modify the name of the text section which is by default".text"

P: n/a
When C source code is compiled into an object file (.o), the functions
are put into the .text section.
Is it possible that I put all functions to a renamed text section
whose name may be ".text.app".

When linking several .o files into an executable, I need to put the
code of .o files into different positions(in MCU).
If I can rename the text section of object files, I can set different
section start addresses for each section.
Sep 11 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
LinNan wrote:
When C source code is compiled into an object file (.o), the functions
are put into the .text section.
Is it possible that I put all functions to a renamed text section
whose name may be ".text.app".

When linking several .o files into an executable, I need to put the
code of .o files into different positions(in MCU).
If I can rename the text section of object files, I can set different
section start addresses for each section.

Some compilers support this. Please look the documentation of
the compiler system you are using.

If not, just generate an assembly listing, and
change the name of the section with an editor, then assemble
the file.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Sep 11 '08 #2

P: n/a
On Sep 11, 9:39*pm, jacob navia <ja...@nospam.comwrote:
LinNan wrote:
When C source code is compiled into an object file (.o), the functions
are put into the .text section.
Is it possible that I put all functions to a renamed text section
whose name may be ".text.app".
When linking several .o files into an executable, I need to put the
code of .o files into different positions(in MCU).
If I can rename the text section of object files, I can set different
section start addresses for each section.

Some compilers support this. Please look the documentation of
the compiler system you are using.

If not, just generate an assembly listing, and
change the name of the section with an editor, then assemble
the file.

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatiquehttp://www.cs.virginia.edu/~lcc-win32
I found that objcopy meets my need
Sep 11 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.