Error: backward ref to unknown label "1:"

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
slide_rule
Posts: 16
Joined: Sat Nov 24, 2007 6:41 pm
Location: loglogdecalog

Error: backward ref to unknown label "1:"

Post by slide_rule »

I'm getting that error from gas on the attached code, here's a snippet:

Code: Select all

        /* setup level 3 - need 4 entries at top & bottom */
	movl boot_pg - KERNEL_VMA + 0x1000, %edi /*address of level 3
	leal 0x1007(%edi), %eax
	movl $4, %ecx
1:     movl %eax, %edi /*identity map*/
	movl %eax, 4088(%edi) /*higher-half*/
	addl $0x1000, %eax
	addl $8, %edi
	decl %ecx
	jnz 1b
It complains about that "jnz 1b" line which baffles me, since it seems like a perfectly straightforward use of local labels. I pretty much took the code verbatim from linux

I attached the rest of the code, and, on the off chance it might help, my linker script (I've been skirting around relocation truncation problems, perhaps that would add to this).

I googled the error, but didn't find anything helpful, nor did I find anything in the manual that indicated local labels were behavior you could turn on and off.

Any help would be greatly appreciated.
Attachments

[The extension s has been deactivated and can no longer be displayed.]

wlink.ld
Linker script
(374 Bytes) Downloaded 20 times
svdmeer
Member
Member
Posts: 87
Joined: Tue May 06, 2008 9:32 am
Location: The Netherlands

Post by svdmeer »

Is the use of labels having a number as first char allowed?
slide_rule
Posts: 16
Joined: Sat Nov 24, 2007 6:41 pm
Location: loglogdecalog

Post by slide_rule »

yes.

Found it. I had a comment that didn't end with a */ on line 30-something. Damn and blast. Ignore me.
Post Reply