From: Shamus Hammons Date: Fri, 21 Apr 2017 19:31:10 +0000 (-0500) Subject: Possible fix for bug #92. X-Git-Tag: v2.1.0~133 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=commitdiff_plain;h=005275defacb4b5d2f511bf7357ac7720f807761 Possible fix for bug #92. --- diff --git a/mark.c b/mark.c index 6c40c30..6c065b5 100644 --- a/mark.c +++ b/mark.c @@ -368,7 +368,7 @@ printf("MarkBSDImage():\n"); continue; #ifdef DEBUG_IMAGE_MARKING -printf(" validsegment: raddr = $%08X\n", raddr); +printf(" validsegment: raddr = $%08X\n", loc); #endif uint32_t rflag = 0x00000040; // Absolute relocation @@ -527,9 +527,20 @@ uint32_t CreateELFRelocationRecord(uint8_t * buf, uint8_t * secBuf, uint16_t sec else r_type = 1; // R_68K_32 - if (symbol != NULL) - r_addend = symbol->svalue; // Mark offset into section - else +#ifdef DEBUG_IMAGE_MARKING +if (symbol) +{ + printf("CreateELFReloc: symbol-svalue = $%08X\n", symbol->svalue); +} + +printf("CreateELFReloc: deposited value = $%08X\n", GETBE32(secBuf + r_offset, 0)); + +#endif +//Turns out this is pretty much bollocks. So now we punt all the time :-) +//N.B.: Once this is proved out, this will go for good. +// if (symbol != NULL) +// r_addend = symbol->svalue; // Mark offset into section +// else r_addend = GETBE32(secBuf + r_offset, 0); // Deposit the relocation record