[oss] [Lab 02][Task 5] mark .data as executable

Alex Teaca ionutalex.teaca at gmail.com
Sat Oct 25 17:06:17 EEST 2014


Hello !

For the task 5, I try to mark the .data section as executable.
I tried in gdb to call the mprotect function:

(gdb) call mprotect(0x0804a010, 4, 0x1|0x2|0x4)
$1 = -1
, where the 0x0804a010 is the address of .data section found with objdump.
You see that mprotect returns error.

Also, I tried to compile with -S flag, and update the task5.s with
".section .data,"awx", at progbits"
but, when I compile, I get

gcc -C task5.s
test5.s: Assembler messages:
test5.s:5: Warning: ignoring changed section attributes for .data

and the .data section remains WA.

So, how can I run code from .data section ?

Thanks, Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cursuri.cs.pub.ro/pipermail/oss/attachments/20141025/be6efcb3/attachment.html>


More information about the oss mailing list