[parisc-linux-cvs] binfmt_elf changes for 64-bit coredumps of 32-bit binaries

Richard Hirst rhirst@linuxcare.com
Mon, 12 Feb 2001 19:06:48 +0000


On Mon, Feb 12, 2001 at 11:41:05AM -0700, Matthew Wilcox wrote:
> 
> Here's the reorg of my binfmt_elf changes that are being committed RSN.
> ...
> +#define ELF_CORE_COPY_REGS(dst, pt)	\
> +	memset(dst, 0, sizeof(dst));	/* don't leak any "random" bits */ \
> +	memcpy(dst + 0, pt->gr, 32 * sizeof(elf_greg_t)); \

These changes define elf_greg_t to be unsigned int for dumping 32 bit
processes, and unsigned long for dumping 64 bit processes, which is
fine.  However, pt_regs is the same in both cases, with pt->gr[] being
an array of unsigned long.  So, the above memcpy needs to be 32
seperate copies to translate 64 bit pt_regs entries in to 32 bit core
file entries.

Or am I confused?

Richard