I am not familiar with the GNU assembler syntax as I use the ARM tools. However, based on the ARM syntax it looks what you are doing is getting the address of the label. Have you tried:.extern mainldr pc, =main
.extern mainldr pc, =main