Mercurial > hg > qcc
diff arm/gen.c @ 592:04ef85a39cf4
Rename gsym() and gsym_addr() to gen_resolve_sym() and gen_resolve_sym_addr(),
plus fluff out their argument names and add better comments about what they do.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sun, 06 Apr 2008 17:55:44 -0500 |
parents | 7fc19a001568 |
children |
line wrap: on
line diff
--- a/arm/gen.c Sun Apr 06 17:30:40 2008 -0500 +++ b/arm/gen.c Sun Apr 06 17:55:44 2008 -0500 @@ -301,25 +301,25 @@ } /* output a symbol and patch all calls to it */ -void gsym_addr(int t, int a) +void gen_resolve_sym_addr(int call_addr, int sym_addr) { unsigned long *x; int lt; - while(t) { - x=(unsigned long *)(cur_text_section->data + t); - t=decbranch(lt=t); - if(a==lt+4) + while(call_addr) { + x=(unsigned long *)(cur_text_section->data + call_addr); + call_addr=decbranch(lt=call_addr); + if(sym_addr==lt+4) *x=0xE1A00000; // nop else { *x &= 0xff000000; - *x |= encbranch(lt,a,1); + *x |= encbranch(lt,sym_addr,1); } } } -void gsym(int t) +void gen_resolve_sym(int call_addr) { - gsym_addr(t, gen_ind); + gen_resolve_sym_addr(call_addr, gen_ind); } #ifdef TCC_ARM_VFP @@ -561,7 +561,7 @@ t = v & 1; gen_multibyte(0xE3A00000|(intr(r)<<12)|t); gen_multibyte(0xEA000000); - gsym(sv->c.ul); + gen_resolve_sym(sv->c.ul); gen_multibyte(0xE3A00000|(intr(r)<<12)|(t^1)); return; } else if (v < VT_CONST) { @@ -1035,7 +1035,7 @@ } } else { t = gjmp(t); - gsym(vtop->c.i); + gen_resolve_sym(vtop->c.i); } } else { if (is_float(vtop->type.t)) {