size = bfd_get_section_size_before_reloc (s);
size = bfd_get_section_size (s);
compare_sections_command (char *args, int from_tty){  struct remote_state *rs = get_remote_state ();  asection *s;  unsigned long host_crc, target_crc;  extern bfd *exec_bfd;  struct cleanup *old_chain;  char *tmp;  char *sectdata;  const char *sectname;  char *buf = alloca (rs->remote_packet_size);  bfd_size_type size;  bfd_vma lma;  int matched = 0;  int mismatched = 0;  if (!exec_bfd)    error ("command cannot be used without an exec file");  if (!current_target.to_shortname ||      strcmp (current_target.to_shortname, "remote") != 0)    error ("command can only be used with remote target");  for (s = exec_bfd->sections; s; s = s->next)    {      if (!(s->flags & SEC_LOAD))	continue;		/* skip non-loadable section */      size = bfd_get_section_size_before_reloc (s);      if (size == 0)	continue;		/* skip zero-length section */      sectname = bfd_get_section_name (exec_bfd, s);      if (args && strcmp (args, sectname) != 0)	continue;		/* not the section selected by user */      matched = 1;		/* do this section */      lma = s->lma;      /* FIXME: assumes lma can fit into long */      sprintf (buf, "qCRC:%lx,%lx", (long) lma, (long) size);      putpkt (buf);      /* be clever; compute the host_crc before waiting for target reply */      sectdata = xmalloc (size);      old_chain = make_cleanup (xfree, sectdata);      bfd_get_section_contents (exec_bfd, s, sectdata, 0, size);      host_crc = crc32 ((unsigned char *) sectdata, size, 0xffffffff);      getpkt (buf, (rs->remote_packet_size), 0);      if (buf[0] == 'E')	error ("target memory fault, section %s, range 0x%s -- 0x%s",	       sectname, paddr (lma), paddr (lma + size));      if (buf[0] != 'C')	error ("remote target does not support this operation");      for (target_crc = 0, tmp = &buf[1]; *tmp; tmp++)	target_crc = target_crc * 16 + fromhex (*tmp);      printf_filtered ("Section %s, range 0x%s -- 0x%s: ",		       sectname, paddr (lma), paddr (lma + size));      if (host_crc == target_crc)	printf_filtered ("matched.\n");      else	{	  printf_filtered ("MIS-MATCHED!\n");	  mismatched++;	}      do_cleanups (old_chain);    }  if (mismatched > 0)    warning ("One or more sections of the remote executable does not match\n\the loaded file\n");  if (args && !matched)    printf_filtered ("No loaded section named '%s'.\n", args);}