Debian Bug report logs -
#563481
binutils: error message about /usr/lib/debug/usr/lib/crt1.o when linking executable without main
Reported by: Török Edwin <edwintorok@gmail.com>
Date: Sun, 3 Jan 2010 10:24:02 UTC
Severity: normal
Found in version binutils/2.20-4
Done: Matthias Klose <doko@debian.org>
Bug is archived. No further changes may be made.
Toggle useless messages
Report forwarded
to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#563481; Package binutils.
(Sun, 03 Jan 2010 10:24:05 GMT) (full text, mbox, link).
Acknowledgement sent
to Török Edwin <edwintorok@gmail.com>:
New Bug report received and forwarded. Copy sent to Matthias Klose <doko@debian.org>.
(Sun, 03 Jan 2010 10:24:05 GMT) (full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
Package: binutils
Version: 2.20-4
Severity: normal
When trying to link an executable without main, instead of getting the simple
error message that the symbol 'main' was not found, I get a lengthy error
message about crt1.o.
This made me believe there was something wrong with my libc, so I reinstalled
it, but I got the same error message after that too.
Then I noticed that the real problem was that I forgot to add an object file on the link command line
(which defines main), and not something wrong with my libc.
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 1 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 2 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 3 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 4 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 5 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 6 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 7 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 8 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 9 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 10 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 11 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 12 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 13 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 14 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 15 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 16 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 17 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 18 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 19 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 20 has invalid symbol index 20
/usr/lib/gcc/x86_64-linux-gnu/4.4.2/../../../../lib/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
Testcase:
$ echo "int foo(){return 0;}" > foo.c
$ /usr/bin/gcc foo.c
I started getting this error message with binutils 2.20, the previous ones
didn't give me this error message.
For example this version shows the correct error message:
$ ld -v
2.19.51.20090805
$ gcc-4.3 foo.c
/usr/lib/gcc/i486-linux-gnu/4.3.4/../../../../lib/crt1.o: In function `_start':
/build/buildd-eglibc_2.9-25-i386-IXOntq/eglibc-2.9/csu/../sysdeps/i386/elf/start.S:115: undefined reference to `main'
collect2: ld returned 1 exit status
This one shows the wrong error message pasted above:
$ ld -v
GNU ld (GNU Binutils for Debian) 2.20
$ /usr/bin/gcc-4.3 foo.c
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 1 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 2 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 3 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 4 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 5 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 6 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 7 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 8 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 9 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 10 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 11 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 12 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 13 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 14 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 15 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 16 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 17 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 18 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 19 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 20 has invalid symbol index 20
/usr/lib/gcc/x86_64-linux-gnu/4.3.4/../../../../lib/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (990, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32.2 (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages binutils depends on:
ii libc6 2.10.2-3 Embedded GNU C Library: Shared lib
ii zlib1g 1:1.2.3.4.dfsg-3 compression library - runtime
binutils recommends no packages.
Versions of packages binutils suggests:
ii binutils-doc 2.20-4 Documentation for the GNU assemble
-- no debconf information
Information forwarded
to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#563481; Package binutils.
(Sat, 27 Aug 2011 20:27:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Jörgen Grahn <grahn+debian@snipabacken.se>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>.
(Sat, 27 Aug 2011 20:27:03 GMT) (full text, mbox, link).
Message #10 received at 563481@bugs.debian.org (full text, mbox, reply):
I get the same thing here, today, binutils 2.20.1-16 on amd64 and ppc.
Bloody annoying; I knew I had no main() yet, but the error messages made me
suspect I had some deeper problem, and I did a lot of fruitless
investigations before I googled the error message and found this.
/Jorgen
--
// Jörgen Grahn | mot du jour: Space-Time for
\X/ <grahn@snipabacken.se> | Springers
Reply sent
to Matthias Klose <doko@debian.org>:
You have taken responsibility.
(Thu, 18 Dec 2014 18:37:41 GMT) (full text, mbox, link).
Notification sent
to Török Edwin <edwintorok@gmail.com>:
Bug acknowledged by developer.
(Thu, 18 Dec 2014 18:37:41 GMT) (full text, mbox, link).
Message #15 received at 563481-done@bugs.debian.org (full text, mbox, reply):
Control: tags -1 + wontfix moreinfo
Closing binutils bug reports reported for ancient versions
of binutils, or for outdated packages built with outdated
versions of binutils. This doesn't mean that this issue
is fixed, but your help is needed to confirm the issue with
a recent binutils version (currently 2.24.90.20141209-1,
available in unstable).
Please reopen the issue if you think this still needs fixing,
adding all relevant files (including system libraries) in
a tarball attached to the bug report.
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Fri, 16 Jan 2015 07:35:50 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Sun Jan 7 14:21:37 2018;
Machine Name:
buxtehude
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.