Commit 4eb2c553 authored by Martin Storsjo's avatar Martin Storsjo Committed by Alexandre Julliard

ntdll: Simplify the arm version of a stub function.

parent dd305360
......@@ -237,13 +237,11 @@ struct stub
struct stub
{
BYTE ldr_r0[4]; /* ldr r0, $dll */
BYTE mov_pc_pc1[4]; /* mov pc,pc */
const char *dll;
BYTE ldr_r1[4]; /* ldr r1, $name */
BYTE mov_pc_pc2[4]; /* mov pc,pc */
const char *name;
BYTE mov_r2_lr[4]; /* mov r2, lr */
BYTE ldr_pc_pc[4]; /* ldr pc, [pc, #-4] */
BYTE ldr_pc_pc[4]; /* ldr pc, [pc, #4] */
const char *dll;
const char *name;
const void* entry;
};
#elif defined(__aarch64__)
......@@ -303,32 +301,24 @@ static ULONG_PTR allocate_stub( const char *dll, const char *name )
stub->call = 0xe8; /* call stub_entry_point */
stub->entry = (BYTE *)stub_entry_point - (BYTE *)(&stub->entry + 1);
#elif defined(__arm__)
stub->ldr_r0[0] = 0x00; /* ldr r0, $dll */
stub->ldr_r0[0] = 0x08; /* ldr r0, [pc, #8] ($dll) */
stub->ldr_r0[1] = 0x00;
stub->ldr_r0[2] = 0x9f;
stub->ldr_r0[3] = 0xe5;
stub->mov_pc_pc1[0] = 0x0f; /* mov pc,pc */
stub->mov_pc_pc1[1] = 0xf0;
stub->mov_pc_pc1[2] = 0xa0;
stub->mov_pc_pc1[3] = 0xe1;
stub->dll = dll;
stub->ldr_r1[0] = 0x00; /* ldr r1, $name */
stub->ldr_r1[0] = 0x08; /* ldr r1, [pc, #8] ($name) */
stub->ldr_r1[1] = 0x10;
stub->ldr_r1[2] = 0x9f;
stub->ldr_r1[3] = 0xe5;
stub->mov_pc_pc2[0] = 0x0f; /* mov pc,pc */
stub->mov_pc_pc2[1] = 0xf0;
stub->mov_pc_pc2[2] = 0xa0;
stub->mov_pc_pc2[3] = 0xe1;
stub->name = name;
stub->mov_r2_lr[0] = 0x0e; /* mov r2, lr */
stub->mov_r2_lr[1] = 0x20;
stub->mov_r2_lr[2] = 0xa0;
stub->mov_r2_lr[3] = 0xe1;
stub->ldr_pc_pc[0] = 0x04; /* ldr pc, [pc, #-4] */
stub->ldr_pc_pc[0] = 0x04; /* ldr pc, [pc, #4] */
stub->ldr_pc_pc[1] = 0xf0;
stub->ldr_pc_pc[2] = 0x1f;
stub->ldr_pc_pc[2] = 0x9f;
stub->ldr_pc_pc[3] = 0xe5;
stub->dll = dll;
stub->name = name;
stub->entry = stub_entry_point;
#elif defined(__aarch64__)
stub->ldr_x0[0] = 0xa0; /* ldr x0, #20 ($dll) */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment