Пример #1
0
 public int store(OutputStream out) throws IOException {
   int cnt = 0;
   if (elf.isClass32()) {
     cnt += StoreUtil.little32(out, st_name);
     cnt += StoreUtil.storeAddr(out, elf.e_ident, st_value);
     cnt += StoreUtil.storeXword(out, elf.e_ident, st_size);
     cnt += StoreUtil.little8(out, st_info);
     cnt += StoreUtil.little8(out, st_other);
     cnt += StoreUtil.little16(out, st_shndx);
   } else {
     cnt += StoreUtil.little32(out, st_name);
     cnt += StoreUtil.little8(out, st_info);
     cnt += StoreUtil.little8(out, st_other);
     cnt += StoreUtil.little16(out, st_shndx);
     cnt += StoreUtil.storeAddr(out, elf.e_ident, st_value);
     cnt += StoreUtil.storeXword(out, elf.e_ident, st_size);
   }
   return cnt;
 }
Пример #2
0
  public int store(OutputStream out) throws IOException {

    if (symbol != null) {
      r_symndx = elf.getIndexOfSymbol(symbol);
    }

    final long info;
    if (elf.isClass32()) {
      info = (r_type & 0xFF) | (r_symndx << 8);
    } else {
      info = ((long) r_type) | (((long) r_symndx) << 32);
    }
    int cnt = 0;
    cnt += StoreUtil.storeAddr(out, elf.e_ident, r_address);
    cnt += StoreUtil.storeXword(out, elf.e_ident, info);
    return cnt;
  }