This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ld: circle-references in libraries
- From: Wolfgang Haidinger <Wolfgang dot Haidinger at br-automation dot com>
- To: binutils at sourceware dot org
- Date: Fri, 7 Jul 2006 07:50:45 +0200
- Subject: ld: circle-references in libraries
Hi volks!
When you have circle-references in libraries ld generates an
undefined-reference-error.
For example:
main -> A0 -> B0 -> A1
Whereas libA.a contains all A*, libB.a all B* functions, and f1 -> f2
means f1 calls function f2.
Then the result is an error: In function 'B0': undefined reference to
'A1'.
To state the -l option multiple, like -lA -lB -lA will work, but is this a
good idea? Why is this work: "rotating through all libs until no more
object file is added", not done by the linker itself? Or is there any
option to advise the linkter to do so?
Grüße
Wolfgang Haidinger
---
Wolfgang Haidinger
B&R Industrie-Elektronik GmbH
BU Controls, Safety
Tel: +43 (0)7748 6586 1121
eMail: wolfgang dot haidinger at br-automation dot com