bool target_patch_shdr(Target* t)
{
  Elf32_Shdr* shdr;
  unsigned end_of_cs;
  unsigned nr;

  TRACE(stderr, "patchShdr\n");

  shdr = (Elf32_Shdr*)(t->p.b + t->p.ehdr->e_shoff);
  end_of_cs = t->end_of_cs;
  for(nr = t->p.ehdr->e_shnum; nr > 0; nr--, shdr++)
  {
    if (shdr->sh_offset >= end_of_cs)
    {
      /* move all following sections down */
      shdr->sh_offset += TEVWH_PAGESIZE;
    }
    else if (shdr->sh_offset + shdr->sh_size == end_of_cs)
    {  
      /* increase length of last section of code-segment (.rodata) */
      shdr->sh_size += TEVWH_PAGESIZE;
    }
  }
  t->p.ehdr->e_shoff += TEVWH_PAGESIZE;
  return true; /* this implementation can't fail */
}
