gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

ASM > Something's screwy with devkitpro - Not giving link errors!

#130856 - Dwedit - Fri Jun 08, 2007 7:12 pm

This code generates no link errors despite the fact that it should:

Code:

 .text
  adr r0,some_label

 .section .iwram, "ax", %progbits
 .subsection 0
 .align
 .pool
some_label:
  bx lr


Does the linker even get a chance to find invalid PC reletive operations?
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#130899 - wintermute - Sat Jun 09, 2007 2:42 am

The assembler is designed to be used by the compiler rather than be used for large projects and does not report errors in some cases where it might be expected that it should.

As I've told you several times before, the assembler assumes that references within the same compilation unit can be reached by normal branches. You *must* separate iwram code into it's own object and *not* mix code in different areas in the same compilation unit or all bets are off.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog