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]

Re: ld: link order changes behavior


hauke strasdat <strasdat@gmail.com> writes:

> 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?

I don't see how we can tell whether this is a linker bug without seeing
the input files.

There are certainly valid object files which would produce this result.

Ian


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