More rigorous sh_addr and sh_offset checking
Pull out existing re-layouting code