public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* ld "undefined reference" shows wrong line number
@ 2011-06-20 11:13 Jon Grant
  2011-06-21 15:12 ` Nick Clifton
  0 siblings, 1 reply; 3+ messages in thread
From: Jon Grant @ 2011-06-20 11:13 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 902 bytes --]

Hello

I noticed in a version of the tools I am using that the output from ld
shows the wrong line number for an "undefined reference". as my tools
are not so recent (codesourcery), would someone be able to confirm if
this issue is reproducable if possible please.

The line number 19 is the last symbol in the start.S. void main(void)
function does exist in the build as well. Possibly is this the debug
info that is incorrect in the start.o file?

I attach my sample assembler file, which is for ARM.

Let me know if you would like me to create a bugzilla ticket.

Best regards, Jon



./libtest.a(start.o): In function `go_main':
c:\test\start.S:19: undefined reference to `global_buffer'
collect2: ld returned 1 exit status
make: *** [test.elf] Error 1



C:\>arm-none-eabi-ld --version
GNU ld (Sourcery G++ Lite 2010.09-51) 2.20.51.20100809

arm-none-eabi-gcc (Sourcery G++ Lite 2010.09-51) 4.5.1

[-- Attachment #2: start.S --]
[-- Type: application/octet-stream, Size: 230 bytes --]

.global entrypoint


entrypoint:
	LDR		PC,=test
	LDR		PC,=test
	LDR		PC,=test
	LDR		PC,=test
	LDR		PC,=test
	LDR		PC,=test

test:
	LDR		R1,=global_buffer


go_main:
	LDR		PC, =main
	NOP
	LDR		PC, =main

	.END

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-10 11:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-20 11:13 ld "undefined reference" shows wrong line number Jon Grant
2011-06-21 15:12 ` Nick Clifton
2011-07-11  2:06   ` Jon Grant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).