| Previous | Next | Up | Top |
Q: Whenever I define very large static arrays in my program, the linker fails saying "could not read symbols: Bad value". Huh??
Q: I have some large libraries that I cannot link because the linker fails on them with a message saying "memory exhausted". I have plenty of virtual memory on my system, so why
would ld fail?
A: This is a known bug in ld.exe from GNU Binutils 2.5.2. Please upgrade to DJGPP v2.01 which comes with Binutils 2.7. If you can't upgrade, or if the latest
ld.exe exhibits such bugs, these are your alternatives for a work-around:
- In case of a large library, split it into several smaller ones.
- For a module that defines large data structures, move some of the static data to other files, or allocate the space at runtime with
calloc
.
ld.exe from GNU Binutils 2.7 (which comes with DJGPP v2.01) doesn't have most of these problems, but there are still some cases where you might see such messages. One such case is the
POVRAY package, where the failure is caused by an object file called _pmlite.o in the pmode.a library. The problem here is that _pmlite.o is a
TASM-compiled file, processed by EMXAOUT. EMXAOUT produces a.out object files which ld.exe cannot link if they are in a library. Either taking
that object file out of the library, or processing the original _pmlite.obj with another tool (such as OBJ2BFD or OBJ2COFF) will solve these problems. Note
however, that the authors of OBJ2COFF have explicitly forbidden commercial use of their tool.

You can help support this site by
visiting the advertisers that sponsor it! (only once each, though)