ld: circle-references in libraries
Wolfgang Haidinger
Wolfgang.Haidinger@br-automation.com
Fri Jul 7 05:50:00 GMT 2006
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
More information about the Binutils
mailing list