OK, here is a fun one. secondary.inc moved to separate compilation as secondary.S
It won't assemble:
secondary.s: Assembler messages: secondary.s:87: Error: subtraction of two symbols in different sections `gdt_end' {*UND* section} - `gdt' {*UND* section} at file address 155 make: *** [secondary.o] Error 1
The problem code is: gdtaddr: .word gdt_end - gdt - 1 /* compute the table limit */ .long gdt /* we know the offset */
Now, I have to sign off -- kids and all that -- and I'm hoping some of you gas experts can puzzle this out. What should happen is that the gdtaddr in secondary.S will have pointers to the gdt defined in crt0.S. Obviously something needs fixing here so that the undefined references in secondary.S are properly set up so you have a gdt in secondary.S. One option is to include the gdt from the .inc file.
That *UND* section is kind of suspicious -- Maybe another directive is needed?
ron