c++/7234: Link Problem, GCC 3.1 on AIX 4.3.3

Frank.Seehase@pdv-fs.de Frank.Seehase@pdv-fs.de
Mon Jul 8 10:46:00 GMT 2002


>Number:         7234
>Category:       c++
>Synopsis:       Link Problem, GCC 3.1 on AIX 4.3.3
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 08 09:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     F. G. Seehase
>Release:        gcc version 3.1
>Organization:
>Environment:
AIX 4.3.3 ML 10
Configured with: ../configure --prefix=/tools/pkg/gcc/3.1 --disable-threads
Thread model: aix
>Description:
When linking an executable, not referenced objects from a library are pulled in, maybe due to static objects initialization code, even if there is no C++ code. The garbarge collection of the AIX Linker fails.
If the code is compiled as .c (not .cc) files with gcc (not g++) there is no problem.
>How-To-Repeat:

Symbol fct3 is missing even fct2 is unused. 

> g++ -v
Reading specs from /tools/pkg/gcc/3.1/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/3.1/specs
Configured with: ../configure --prefix=/tools/pkg/gcc/3.1 --disable-threads
Thread model: aix
gcc version 3.1

> ar -V
GNU ar 2.12.1

> g++ -Wall -c -o fct1.o fct1.cc
> g++ -Wall -c -o fct2.o fct2.cc
> g++ -Wall -c -o main.o main.cc
> ar -rv libTst.a fct1.o fct2.o
> g++ -Wall -o main main.o libTst.a




/* --- fct1.cc --- */
void fct3( void );

void fct2( void )
{
  fct3( );
}

/* --- fct2.cc --- */

void fct1( void )
{
}

/* --- main.cc --- */
void fct1( void );

int main( void )
{
  fct1( );
  return 0;
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list