This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]