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: link order changes behavior


Hi,

I hope this is the right place to ask this question. If not, I apologize!

I do have two object files (foo.cpp.o, main.cpp.o).

The first link order produces one result (=correct result):
/usr/bin/g++-4.4   -g  foo.cpp.o main.cpp.o -o test
./test
output: 1

The other link order produces a different result (=incorrect result):
/usr/bin/g++-4.4   -g  main.cpp.o foo.cpp.o -o test
./test
output: -1

Could this be a linker bug? If yes, I would go ahead and file a bug report.
Or is a different cause likely?

Thanks,
Hauke

 ld -v
GNU ld (GNU Binutils for Ubuntu) 2.21.53.20110810


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