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

L

LinNan

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.
 
J

jacob navia

LinNan said:
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.
 
L

LinNan

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.

I found that objcopy meets my need
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top