Page 1 of 1

Error: backward ref to unknown label "1:"

Posted: Sat Jun 07, 2008 4:29 pm
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.

Posted: Sat Jun 07, 2008 4:35 pm
by svdmeer
Is the use of labels having a number as first char allowed?

Posted: Sat Jun 07, 2008 4:45 pm
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.