Index: loader/wrapper.S =================================================================== --- loader/wrapper.S (revision 30495) +++ loader/wrapper.S (working copy) @@ -1,27 +1,33 @@ -.section .data -.globl caller_return -caller_return: +#include "config.h" + +#define GLUE(a, b) a ## b +#define JOIN(a, b) GLUE(a, b) +#define X(s) JOIN(EXTERN_ASM, s) + +.data +.globl X(caller_return) +X(caller_return): .long 0 -.globl report_entry -report_entry: - .long null_call -.globl report_ret -report_ret: - .long null_call -.global wrapper_target -wrapper_target: - .long null_call +.globl X(report_entry) +X(report_entry): + .long X(null_call) +.globl X(report_ret) +X(report_ret): + .long X(null_call) +.global X(wrapper_target) +X(wrapper_target): + .long X(null_call) -.section .text -.globl null_call - .type null_call, @function +.text +.globl X(null_call) + .type X(null_call), @function .balign 16,0x90 -null_call: +X(null_call): ret -.globl wrapper - .type wrapper, @function +.globl X(wrapper) + .type X(wrapper), @function .balign 16,0x90 -wrapper: +X(wrapper): pusha # store registers (EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI) pushf # store flags @@ -39,7 +45,7 @@ push %eax push %edx - call *report_entry # report entry + call *X(report_entry) # report entry test %eax, %eax jnz .Ldone @@ -48,14 +54,14 @@ popf # restore flags popa # restore registers - popl caller_return # switch return addresses + popl X(caller_return) # switch return addresses pushl $.Lwrapper_return - jmp *wrapper_target # wrapper_target should return at .Lwrapper_return + jmp *X(wrapper_target) # wrapper_target should return at .Lwrapper_return .balign 16, 0x90 .Lwrapper_return: - pushl caller_return # restore the original return address + pushl X(caller_return) # restore the original return address pusha # more for reference sake here pushf @@ -73,7 +79,7 @@ push %eax push %edx - call *report_ret # report the return information (same args) + call *X(report_ret) # report the return information (same args) .Ldone: leave