Open
Description
From http://www.6502.org/users/andre/o65/fileformat.html:
If the segment is "undefined", the typebyte is immediately followed by the two (mode size=0) or four (mode size=1) byte value index in the undefined references list. If it is a high byte relocation, the low byte is saved behind the index value. The index value determines the undefined reference, which must be looked up by the loader.
So, given the code:
lda #>sys_exit
The relocation info should be ?? 40 00 00 00
, but it's currently ?? 40 00 00
Current ld65/o65.c, lines 752 to 759 read:
} else if (ED.ExtRef) {
/* Imported symbol */
RelocType |= O65SEG_UNDEF;
O65RelocPutByte (D->CurReloc, RelocType);
/* Put the number of the imported symbol into the table */
O65RelocPutWord (D->CurReloc, ExtSymNum (ED.ExtRef));
} else {
but I guess after outputting the index of the imported symbol, it needs the code from lines 742 to 750:
/* Output additional data if needed */
switch (RelocType & O65RELOC_MASK) {
case O65RELOC_HIGH:
O65RelocPutByte (D->CurReloc, ED.Val & 0xFF);
break;
case O65RELOC_SEG:
O65RelocPutWord (D->CurReloc, ED.Val & 0xFFFF);
break;
}