tags:

views:

222

answers:

1

I am using "--verbose" for ld in an attempt to get something useful for finding the problem, but it prints the error message amidst printing normal "--verbose" output:

[...blah - dump of linker script...]
attempt to open blah1.o succeeded
blah1.o
attempt to open blah2.o succeeded
blah2.o
[...blah - more opens that succeeded...]
attempt to open blah9.o succeeded
blah9.o
attemcollect2: ld returned 1 exit status

Invoked by:

gcc blah1.o [...blah...] blah9.o blahLib1.a blahLib2.a -g -lc -nostdlib -Wl,--warn-constructors -fpic -fno-pic -Wl,-q -Wl,-gc-sections -Wl,--verbose -T blahScript.ld -lm -o blahProgram.elf
+1  A: 

It's a generic error. Usually caused by undefined reference to a symbol.

I don't think you need --verbose to see the error. ld should print the cause of the error in any case. Try to run it without --verbose and carefully examine every line of the output.

Igor Krivokon
That's the strange part - there is no other printed text whatsoever. Just the "ld returned 1 exist status".
Jim Buck
What is the command line you're running?
Igor Krivokon
Updated OP with the command invoked.
Jim Buck
You could try to add this option: -Wl,--unresolved-symbols=report-all However, this should be default anyway. Hmm... Another thing - you're using a custom linker script (blahScript.ld). I don't know how linkers respond to errors in the script; double check the script contents.
Igor Krivokon