Arm Community
Site
Search
User
Site
Search
User
Support forums
Arm Development Studio forum
gcc segment usage
Jump...
Cancel
Locked
Locked
Replies
4 replies
Subscribers
119 subscribers
Views
3394 views
Users
0 members are here
Options
Share
More actions
Cancel
Related
How was your experience today?
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
gcc segment usage
Etienne SOBOLE
over 12 years ago
Note: This was originally posted on 17th April 2011 at
http://forums.arm.com
Hi!
With gcc, we have 4 segment:
.rodata : readonly data
.data : initialized global var
.bss : uninitialized global var
.text : assembler code source
To use ADR opcode, you have to put your data into .text segment.
For example
main:
push {r7, lr}
adr r0, .myString
bl printf
mov r0, #0
pop {r7, pc}
.myString:
.asciz "Hello\n"
I'd like to know (to be sure in fact) if you can't write into .text segment.
Ie, you can't write into r0 after the ADR instruction !
Can anybody confirm me that .text segment is read only ?
Parents
Etienne SOBOLE
over 12 years ago
Note: This was originally posted on 17th April 2011 at
http://forums.arm.com
Ok
Thank you.
My .text segment is AX (Access Execute)
You say I can change that with mprotect or objcopy.
Does it mean that I can't change that with a gcc option or a gcc directive ?
Etienne
Cancel
Vote up
0
Vote down
Cancel
Reply
Etienne SOBOLE
over 12 years ago
Note: This was originally posted on 17th April 2011 at
http://forums.arm.com
Ok
Thank you.
My .text segment is AX (Access Execute)
You say I can change that with mprotect or objcopy.
Does it mean that I can't change that with a gcc option or a gcc directive ?
Etienne
Cancel
Vote up
0
Vote down
Cancel
Children
No data