I have a big array, 103680 bytes of 256 elements declared in the global scope. The linker is giving me a reference error at address .text+0x174 for this, because if a delete some items of the struct it works well. The reference error is very strange because it calls _memcpy a function not declared with the C calling conventions. My linker script is
Some basic sanity checks for builtins:
- are you using a cross-compiler?
- are you linking in libgcc?
If any of them are a "no", fix them.
I don't have the faulting code and corresponding annotated disassembly, but I'm guessing you are doing a non-pointer assignment (console x = array which causes gcc to inject a memcpy rather than some inline sequence above a certain data size.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
I'm using DJGPP on windows and I get 80x86 executable file.
I don't use libgcc, memcpy is defined in my code. The reference error is also shown if I remove all the references to System->memcpy (which points to the memcpy function itself).
Memcpy is never used in this object file.
if you need anything other or better explanations of what I did please ask me
_memcpy isn't declared like extern "C", this is why all my objects files reference it with a more complex name C++ linker style.
lib.o require the C reference only when that struct becomes too large, so I tried to declare memcpy like extern "C" and it is working =.=
I think I'll soon change compiler, mingw is good for windows? Aren't booth based on gcc?