468,289 Members | 1,837 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,289 developers. It's quick & easy.

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

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
2 1312
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
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.

Similar topics

6 posts views Thread by Jochen Daum | last post: by
2 posts views Thread by Askari | last post: by
3 posts views Thread by Alfred E Neuman | last post: by
13 posts views Thread by dhughey | last post: by
2 posts views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.