Tango 0.96 beta2 released
Sean Kelly
sean at f4.ca
Fri Mar 16 19:44:11 PDT 2007
Frits van Bommel wrote:
> Sean Kelly wrote:
>> Frits van Bommel wrote:
>>> Sean Kelly wrote:
>>>
>>> > That said, if someone wants to
>>>> pass on the relevant setjmp headers for a 64-bit glibc then I'll see
>>>> about expanding support.
>>>
>>> You mean the ones attached? Or do you need any others?
>>
>> That should do it. Though if there are any related comments on what
>> registers are stored in __jmp_buf, that would come in handy. The ones
>> I have for Linux contain this in bits/setjmp.h:
>>
>> #if defined __USE_MISC || defined _ASM
>> # define JB_BX 0
>> # define JB_SI 1
>> # define JB_DI 2
>> # define JB_BP 3
>> # define JB_SP 4
>> # define JB_PC 5
>> # define JB_SIZE 24
>> #endif
>>
>> Your headers don't contain that however, so I'm not entirely sure how
>> to slice & dice jmp_buf to inject the proper information. I'll google
>> a bit and try to find out as well.
>
> Sorry, a "grep JB_ * -rn" didn't find anything...
>
> [some time later]
>
> I disassembled libc, this is the result:
> 0x00 rbx
> 0x08 rbp XOR POINTER_GUARD
> 0x10 r12
> 0x18 r13
> 0x20 r14
> 0x28 r15
> 0x30 (rsp before function call) XOR POINTER_GUARD
> 0x38 (return address) XOR POINTER_GUARD
>
> Where POINTER_GUARD is the 8-byte value at fs:0x30.
> Not sure why this is done, perhaps to avoid accidental dereferences?
>
> later verified by apt-getting the source:
> // from glibc-2.4/sysdeps/x86_64/jmpbuf-offsets.h
> #define JB_RBX 0
> #define JB_RBP 1
> #define JB_R12 2
> #define JB_R13 3
> #define JB_R14 4
> #define JB_R15 5
> #define JB_RSP 6
> #define JB_PC 7
> #define JB_SIZE (8*8)
Perfect. Thanks!
Sean
More information about the Digitalmars-d-announce
mailing list