[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ld problem



On Wed, May 10, 2000 at 07:30:45PM -0400, Christopher C. Chimelis wrote:

> Yikes.  I'll write a few examples later tonight and see what I can figure
> out.  If possible, send me a log of everything that you're attempting
> (including invocation).  I'd be interested to see what is going on with
> your particular setup and the code you're feeding to it...

If there's anything else I can do to help, let me know.

Source code:

#include <stdio.h>

int main(int argc, char **argv)
{
   int i;

   printf("Hello, World!\n");
   printf("arguments:");
   for (i = 0; i < argc; i++)
      printf(" %s", argv[i]);
   printf("\n");

   return 0;
}

Invocation:

leopard:~% gcc -g -Wall -o ctest ctest.c
collect2: ld terminated with signal 11 [Segmentation fault], core dumped
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status

However:

leopard:~% gcc -c -g -Wall ctest.c
leopard:~% gcc -o ctest ctest.o
collect2: ld terminated with signal 11 [Segmentation fault], core dumped
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status
collect2: ld returned 33 exit status

Which leads me to conclude this is a linker problem. But:

leopard:~% ccc -g -Wall -o ctest ctest.c
leopard:~% ctest
Hello, World!
arguments: ctest

Which I find confusing to no end, since I assumed that both ccc and
gcc use the same linker. (Otherwise, why is the C++ compiler dependent
on an up-to-date binutils release?) The same thing happens when I try
to use cxx and g++: no error with one, linking problems with the
other.

Here is also some dpkg information that might be helpful:

pi  gcc            2.95.2-10      The GNU C compiler.
ii  g++            2.95.2-10      The GNU C++ compiler.
ii  libstdc++2.10  2.95.2-10      The GNU stdc++ library
ii  libc6.1        2.1.3-10       GNU C Library: Shared libraries and Timezone
ii  binutils       2.9.5.0.37-1   The GNU assembler, linker and binary utiliti
ii  ldso           1.9.11-9       The Linux dynamic linker, library and utilit

I don't know why the status of gcc is flagged 'pi', incidentally.

Finally, here is some information from /proc about the system in
question:

leopard:~% cat /proc/version
Linux version 2.2.13 (root@leopard) (gcc version 2.95.2 19990906 (prerelease)) #1 Wed Oct 20 11:45:05 EDT 1999

leopard:~% cat /proc/cpuinfo
cpu                     : Alpha
cpu model               : EV56
cpu variation           : 0
cpu revision            : 0
cpu serial number       : Linux_is_Great!
system type             : Ruffian
system variation        : 0
system revision         : 0
system serial number    : MILO-0000
cycle frequency [Hz]    : 599948388 est.
timer frequency [Hz]    : 1024.00
page size [bytes]       : 8192
phys. address bits      : 40
max. addr. space #      : 127
BogoMIPS                : 595.59
kernel unaligned acc    : 1 (pc=fffffc00003f9a88,va=fffffc0007ede6b2)
user unaligned acc      : 212 (pc=20000185d5c,va=11ffff7cc)
platform string         : N/A
cpus detected           : 1

I have not had time to build binutils from source yet... And I won't
be able to anyhow unless someone gives me a downgraded version of
binutils.

---Constantine Vetoshev



Reply to: