Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TOC Overflow

91 views
Skip to first unread message

Robert Drinovac

unread,
Sep 8, 2000, 11:01:14 AM9/8/00
to
We are having a problem trying to produce an executable on AIX using GCC
2.95.2. Below is the output that is produced during the final build stage.

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

rdri...@invatron.com

Steve Huston

unread,
Sep 8, 2000, 11:22:19 AM9/8/00
to
"Robert Drinovac" <rdri...@invatron.com> wrote in message
news:_a7u5.2217$YG5....@tor-nn1.netcom.ca...

> We are having a problem trying to produce an executable on AIX using GCC
> 2.95.2. Below is the output that is produced during the final build
stage.
>
> 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?

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

Rob Windgassen

unread,
Sep 8, 2000, 5:50:06 PM9/8/00
to

Steve Huston heeft geschreven in bericht ...

>"Robert Drinovac" <rdri...@invatron.com> wrote in message
>news:_a7u5.2217$YG5....@tor-nn1.netcom.ca...
>> We are having a problem trying to produce an executable on AIX using GCC
>> 2.95.2. Below is the output that is produced during the final build
>stage.
>>
>> 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?
>
>TOC == table of contents. ....
>

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


Jerry Heyman

unread,
Sep 11, 2000, 9:29:38 AM9/11/00
to
In article <8pbmqj$rqn$1...@sshuraab-i-1.production.compuserve.com>,

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 Hochstetter

unread,
Sep 12, 2000, 10:22:41 AM9/12/00
to Robert Drinovac
use -Xlinker -bbigtoc in your g++ commandline

- Bernhard

0 new messages