Author Topic: GCC "phase error detected at end of assembly"  (Read 5816 times)

R.M. Klippstein

  • Sr. Member
  • ****
  • Posts: 313
  • Karma: +3/-0
    • View Profile
GCC "phase error detected at end of assembly"
« on: November 07, 2015, 11:47:30 pm »
Could somebody please explain what this GCC error is trying to tell me.
/src/Vbox/VMM/VMMSwitcher/32BitTo32Bit.asm error: phase error detected at end of assembly
 thanks,  klipp

Daniel

  • Guest
Re: GCC "phase error detected at end of assembly"
« Reply #1 on: November 09, 2015, 08:53:13 am »
Well, from a non-expert but quoting a few random search results:

A phase error is caused by a label in the symbol table having a address that is different after the second pass than what it was after the first pass. This is usually caused by not having an ORG statement properly defining the location of the code.

Using an undefined variable was also mentioned, but usually you get an earlier error on this.

Of course there is also the remove lines until it assembles method to try to track it down. All I've had to worry about has been 8051 assembly and at this point it is traditional for someone else to chime in and call me an idiot. Good luck  :)

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: GCC "phase error detected at end of assembly"
« Reply #2 on: November 09, 2015, 09:14:23 am »
Are you sure this is a GCC (GAS) error? Usually GAS assembly files have a .S suffix and NASM etc use .asm. Of course it is not a hard and fast rule. If NASM, the usual fix is to do more passes, -O2 IIRC.
If using silent rules like too much stuff does now, set V=1 or make V=1 will display the whole command, perhaps post it

R.M. Klippstein

  • Sr. Member
  • ****
  • Posts: 313
  • Karma: +3/-0
    • View Profile
Re: GCC "phase error detected at end of assembly"
« Reply #3 on: November 10, 2015, 04:39:52 pm »
Hey Dave & Daniel, Thanks! Doing more passes solved it,it was NASM!

klipp