g++ -o Server.exe MessageBroker/src/Server.o \
-LMessageBroker/src -lServer \
-LBusinessServices/src -lServices \
-LDatabases/src -lDatabase \
-L../lib/MessageQueueAPI/src -lMessageQueueAPI \
-L../lib/odbc++/shared/src -lodbc++ \
-L../lib/Utilities/src -lUtilities \
-L/usr/sqlnk/4_51_00/lib -lodbc \
-L/p/gcc/lib/gcc-lib/powerpc-ibm-aix4.3.0.0/2.95.2 -lgcc -lstdc++
ld: 0711-781 ERROR: TOC overflow. TOC size: 66712 Maximum size: 65536
collect2: ld returned 12 exit status
make: *** [Server.exe] Error 1
Can anyone tell me what the TOC stands for and how to work around this
problem? Since our program used to compile before and just recently this
has happened, I am assuming it is related to the increasing size of our
code. If so, is there a way to increase the TOC size?
Thanks in advance to anyone who responds.
--
=========================================================================
Robert Drinovac
Invatron Systems Corp.
http://www.invatron.com
Tel: (905) 282-1290 Ext. 33
Fax: (905) 282-1266
TOC == table of contents. I believe it's symbol table entries.
There is an option you can pass to ld to request a big TOC - do 'man ld' to
find it. If you pass that, it should link clean.
-Steve
Yes, TOC stands for table of contents, but
> ...... I believe it's symbol table entries.
>
no, it has nothing to do with the symbol table entries.
You are compiling for a PowerPC architecture, where the TOC is a
table with addresses to global objects (variables, functions).
The PPC keeps the address of the TOC loaded in a register and can
address TOC entries using that register as long as they lie within
a 64KByte range.
During linking the linker detects that your TOC contents don't fit in
the required space ..... big problemo ....
When your program contains floating point constants, these will be placed
in the TOC too.
However, gcc (and g++ I think ...) has a switch to prevent this:
-mno-fp-in-toc
you may use this switch, cross you fingers, and hope that all stuff
will fit in the 64KByte TOC then ....
If not, you have to find out which stuff is kept in TOC then, and try
to rearrange things.
Hope this helps,
Rob Windgassen
Depending on what version of AIX you're using, you may need a PTF
for the ld command (if you're running AIX 4.1.x). The other option
is to add -bbigtoc to the command line. This is a flag specifically
to the linker, so it should be ignored by gcc itself (or so I've been
told)
jerry
--
Jerry Heyman 919.224.1442 | Tivoli Systems |"Software is the
Build Infrastructure Architect | 3901 S Miami Blvd | difference between
Jerry....@tivoli.com | RTP, NC 27709 | hardware and reality"
http://www.acm.org/~heymanj
- Bernhard