I am stuck into a strange issue. I have an exe that is created using gyp project and common.gypi is supported to build exe for both 32 and 64 bit linux. However, when i build for 64 bit linux and memcpy is invoked at a point within the code, the content gets zeroed out. Building for 32 bit platform using -m32 flag does not cause this problem. I doubt there might be an issue with the headers since the header files for the project is common for both 32bit and 64bit platform. Can someone please provide some pointers how to tackle this issue? The binary is dynamically linked and uses GLIBC lgcc, lc and lm. Any pointers in this area is greatly appreciated. I will be happy to provide any additional information required. Thanks.
UPDATE : Little bit of code snippet: This is the basic snippet of the code:
dst->flags = src->flags;
src->b = dst->b;
and few more assignments
memcpy(dst, src, size here is 152);
size of dst is 224 and size of src is 496.
The problem is the value of flags that was initially copied to dst becomes zero after memcpy is invoked. Same logic when built for 32bit works just fine.