What exactly will happen to the data segment and text segment if I use the below two lines in my c source code file?
#pragma CODE_SECTION(func1, "Sec1")
#pragma DATA_SECTION(globalvar1, "Sec2")
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Source (contains examples): https://web.archive.org/web/20080803190119/http://hi.baidu.com/jevidyang/blog/item/6d4dc436d87e3a300b55a918.html
Note:
#pragmais compiler specific, so syntax may vary for your compiler.The DATA_SECTION pragma allocates space for the symbol in a section called section name.
The syntax for the pragma in C could be:
The syntax for the pragma in C++ could be:
The DATA_SECTION pragma is useful if you have data objects that you want to link into an area separate from the .bss section.
The CODE_SECTION pragma allocates space for the func in a section named section name. The CODE_SECTION pragma is useful if you have code objects that you want to link into an area separate from the .text section.
The syntax of the pragma in C could be:
The syntax of the pragma in C++ could be: