Re: executing code in mmapped memory
From: Anton Ertl (anton_at_mips.complang.tuwien.ac.at)
Date: 08/27/03
- Next message: Corné Beerse: "Re: .profile question"
- Previous message: Philippe.Dimonte: ".profile question"
- In reply to: Dennis Handly: "Re: executing code in mmapped memory"
- Next in thread: Dennis Handly: "Re: executing code in mmapped memory"
- Reply: Dennis Handly: "Re: executing code in mmapped memory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 27 Aug 2003 13:21:13 GMT
dhandly@cup.hp.com (Dennis Handly) writes:
>Anton Ertl (anton@mips.complang.tuwien.ac.at) wrote:
>: I allocate the memory for the code I generate at run-time with
>: mmap(next_address, size, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0)
>
>: As soon as the program tries to execute the first instruction in this
>: region, it produces a SIGSEGV
>: - the PA-RISC segmentation somehow gets in the way.
>
>This is probably it. How did you "call" this code?
I just jump into it with a
0x4c34 <engine+132>: bv %r0(%r3)
This is what gcc generates for a "goto *...".
>>From a register dump, what is sr4, sr5, pcsqh and pcoqh?
>Unfortunately gdb doesn't model the hardware and track the 96 bit PC value.
sr4: 0x4c39c00 (only displays with "p/x $sr4", not with "info reg")
sr5: 0x95e3400
pcsqh: 4c39c00
pcoqh: 6f616b10
r3 is 6f616b10 (same as pcoqh), and gdb shows $pc as having the same value.
- anton
-- M. Anton Ertl Some things have to be seen to be believed anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen http://www.complang.tuwien.ac.at/anton/home.html
- Next message: Corné Beerse: "Re: .profile question"
- Previous message: Philippe.Dimonte: ".profile question"
- In reply to: Dennis Handly: "Re: executing code in mmapped memory"
- Next in thread: Dennis Handly: "Re: executing code in mmapped memory"
- Reply: Dennis Handly: "Re: executing code in mmapped memory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|