Ignore:
Timestamp:
2013-11-07T09:44:15+01:00 (11 months ago)
Author:
moo
Message:

update relocate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/foot.m4

    r1444 r1446  
    137137dnl }}} 
    138138define(`DEFINE_RELOCATE_API', ` 
    139 EXPORTED_FUNCTION(`void xc_processor_relocate_$1($1 *dst, char *old_start, char *new_start TSRMLS_DC)') dnl {{{ 
     139EXPORTED_FUNCTION(`void xc_processor_relocate_$1($1 *src, $1 *old_start, $1 *new_start TSRMLS_DC)') dnl {{{ 
    140140{ 
    141     xc_relocate_t relocate; 
    142     relocate.dst = dst; 
    143     relocate.old_start = old_start; 
    144     relocate.new_start = new_start; 
    145     xc_relocate_$1(&relocate, dst TSRMLS_CC); 
     141    /* 
     142    $1 *xc_addressof(offset) { 
     143        return (char *) offset + (ptrdiff_t) old_start; 
     144    } 
     145    */ 
     146    ptrdiff_t ptrdiff = /* offset + */ (ptrdiff_t) old_start; 
     147 
     148    /* 
     149    ptrdiff_t *xc_offsetof(offset) { 
     150        return (char *) xc_addressof(offset) - src; 
     151    } 
     152 
     153    $1 *xc_newoffset(offset) { 
     154        return new_start + xc_offsetof(offset); 
     155    } 
     156    */ 
     157    ptrdiff_t relocatediff = new_start + (/* offset + */ ptrdiff - (ptrdiff_t) src); 
     158 
     159    xc_relocate_$1(src, ptrdiff, relocatediff TSRMLS_CC); 
    146160} 
    147161dnl }}} 
Note: See TracChangeset for help on using the changeset viewer.