+2007-07-14 Maarten Brock <sourceforge.brock AT dse.nl>
+
+ * as/link/aslink.h,
+ * as/link/hc08/lkihx.c,
+ * as/link/hc08/lkrloc.c,
+ * as/link/mcs51/lkihx.c,
+ * as/link/mcs51/lkrloc.c: renamed ihxEntendedLinearAddress to
+ ihxExtendedLinearAddress
+ * as/link/mcs51/lkrloc.c (relr),
+ * as/mcs51/asout.c (outr11, outr19): handle absolute destination for
+ acall/ajmp, see bug 830513
+
2007-07-13 Maarten Brock <sourceforge.brock AT dse.nl>
* src/SDCCcse.c (replaceAllSymBySym): renamed siaddr to isaddr,
/* lkihx.c */
extern VOID ihx();
-extern VOID ihxEntendedLinearAddress(Addr_T);
+extern VOID ihxExtendedLinearAddress(Addr_T);
extern VOID ihxNewArea();
/* lkstore.c */
* lkihx.c contains the following functions:
* VOID hexRecord(addr, rtvalIndex)
* VOID ihx(i)
- * VOID ihxEntendedLinearAddress(a)
+ * VOID ihxExtendedLinearAddress(a)
*
* local variables: hexPageOverrun, lastHexAddr
*/
*
* functions called:
* int fprintf() c_library
- * ihxEntendedLinearAddress() lkihx.c
+ * ihxExtendedLinearAddress() lkihx.c
* hexRecord() lkihx.c (recursion)
*
* side effects:
if (lastHexAddr > addr) {
overrun = hexPageOverrun + 1;
- ihxEntendedLinearAddress(lastExtendedAddress + overrun);
+ ihxExtendedLinearAddress(lastExtendedAddress + overrun);
hexPageOverrun = overrun;
hexRecord(addr, rtvalIndex);
return;
if (rflag) {
fprintf(ofp, "%02X\n", (0-chksum) & 0xff);
overrun = hexPageOverrun + 1;
- ihxEntendedLinearAddress(lastExtendedAddress + overrun);
+ ihxExtendedLinearAddress(lastExtendedAddress + overrun);
hexPageOverrun = overrun;
hexRecord(0, i + 1);
return;
lastHexAddr = 0;
}
-/*)Function ihxEntendedLinearAddress(i)
+/*)Function ihxExtendedLinearAddress(i)
*
* Addr_T i 16 bit extended linear address.
*
- * The function ihxEntendedLinearAddress() writes an extended
+ * The function ihxExtendedLinearAddress() writes an extended
* linear address record (type 04) to the output file.
*
* local variables:
* hexPageOverrun and lastHexAddr is cleared
*/
VOID
-ihxEntendedLinearAddress(Addr_T a)
+ihxExtendedLinearAddress(Addr_T a)
{
Addr_T chksum;
if (rflag)
{
- ihxEntendedLinearAddress(extendedAddress);
+ ihxExtendedLinearAddress(extendedAddress);
}
else if (extendedAddress)
{
* lkihx.c contains the following functions:
* VOID hexRecord(addr, rtvalIndex)
* VOID ihx(i)
- * VOID ihxEntendedLinearAddress(a)
+ * VOID ihxExtendedLinearAddress(a)
*
* local variables: hexPageOverrun, lastHexAddr
*/
*
* functions called:
* int fprintf() c_library
- * ihxEntendedLinearAddress() lkihx.c
+ * ihxExtendedLinearAddress() lkihx.c
* hexRecord() lkihx.c (recursion)
*
* side effects:
if ( (lastHexAddr > addr) && (rflag) ) {
overrun = hexPageOverrun + 1;
- ihxEntendedLinearAddress(lastExtendedAddress + overrun);
+ ihxExtendedLinearAddress(lastExtendedAddress + overrun);
hexPageOverrun = overrun;
hexRecord(addr, rtvalIndex);
return;
if (rflag) {
fprintf(ofp, "%02X\n", (0-chksum) & 0xff);
overrun = hexPageOverrun + 1;
- ihxEntendedLinearAddress(lastExtendedAddress + overrun);
+ ihxExtendedLinearAddress(lastExtendedAddress + overrun);
hexPageOverrun = overrun;
hexRecord(0, i + 1);
return;
lastHexAddr = 0;
}
-/*)Function ihxEntendedLinearAddress(i)
+/*)Function ihxExtendedLinearAddress(i)
*
* Addr_T i 16 bit extended linear address.
*
- * The function ihxEntendedLinearAddress() writes an extended
+ * The function ihxExtendedLinearAddress() writes an extended
* linear address record (type 04) to the output file.
*
* local variables:
* hexPageOverrun and lastHexAddr is cleared
*/
VOID
-ihxEntendedLinearAddress(Addr_T a)
+ihxExtendedLinearAddress(Addr_T a)
{
Addr_T chksum;
return;
}
reli = symval(s[rindex]);
+ } else if ((IS_R_J11(mode) || IS_R_J19(mode)) && (rindex == 0xFFFF)) {
+ /* absolute acall/ajmp address */
+ reli = 0;
} else {
if (rindex >= hp->h_narea) {
fprintf(stderr, "R area error\n");
if (rflag)
{
- ihxEntendedLinearAddress(extendedAddress);
+ ihxExtendedLinearAddress(extendedAddress);
}
else if (extendedAddress)
{
* 11 bit address. This form of address is used only on the 8051 and 8048.
*/
VOID
-outr11(esp, op, r)
-register struct expr *esp;
-int op;
-int r;
+outr11(register struct expr *esp, int op, int r)
{
register int n;
if (pass == 2) {
if (esp->e_flag==0 && esp->e_base.e_ap==NULL) {
- /* equated absolute destination. Assume value
- * relative to current area */
- esp->e_base.e_ap = dot.s_area;
- }
+ /* Absolute destination.
+ * Listing shows only the address.
+ */
+ out_lw(esp->e_addr,0);
+ if (oflag) {
+ outchk(3, 0);
+ out_tw(esp->e_addr);
+ *txtp++ = op;
- /* Relocatable destination. Build THREE
- * byte output: relocatable word, followed
- * by op-code. Linker will combine them.
- * Listing shows only the address.
- */
- r |= R_WORD | esp->e_rlcf;
- out_lw(esp->e_addr,r|R_RELOC);
- if (oflag) {
- outchk(3, 5);
- out_tw(esp->e_addr);
- *txtp++ = op;
+ write_rmode(r);
+ *relp++ = txtp - txt - 3;
+ out_rw(0xFFFF);
+ }
+ } else {
+ /* Relocatable destination. Build THREE
+ * byte output: relocatable word, followed
+ * by op-code. Linker will combine them.
+ * Listing shows only the address.
+ */
+ r |= R_WORD | esp->e_rlcf;
+ out_lw(esp->e_addr,r|R_RELOC);
+ if (oflag) {
+ outchk(3, 5);
+ out_tw(esp->e_addr);
+ *txtp++ = op;
- if (esp->e_flag) {
- n = esp->e_base.e_sp->s_ref;
- r |= R_SYM;
- } else {
- n = esp->e_base.e_ap->a_ref;
+ if (esp->e_flag) {
+ n = esp->e_base.e_sp->s_ref;
+ r |= R_SYM;
+ } else {
+ n = esp->e_base.e_ap->a_ref;
+ }
+ write_rmode(r);
+ *relp++ = txtp - txt - 3;
+ out_rw(n);
}
- write_rmode(r);
- *relp++ = txtp - txt - 3;
- out_rw(n);
}
}
dot.s_addr += 2;
if (pass == 2) {
if (esp->e_flag==0 && esp->e_base.e_ap==NULL) {
- /* equated absolute destination. Assume value
- * relative to current area */
- esp->e_base.e_ap = dot.s_area;
- }
+ /* Absolute destination.
+ * Listing shows only the address.
+ */
+ out_lw(esp->e_addr,0);
+ if (oflag) {
+ outchk(4, 0);
+ out_t24(esp->e_addr);
+ *txtp++ = op;
- /* Relocatable destination. Build FOUR
- * byte output: relocatable 24-bit entity, followed
- * by op-code. Linker will combine them.
- * Listing shows only the address.
- */
- r |= R_WORD | esp->e_rlcf;
- out_l24(esp->e_addr,r|R_RELOC);
- if (oflag) {
- outchk(4, 5);
- out_t24(esp->e_addr);
- *txtp++ = op;
+ write_rmode(r);
+ *relp++ = txtp - txt - 4;
+ out_rw(0xFFFF);
+ }
+ } else {
+ /* Relocatable destination. Build FOUR
+ * byte output: relocatable 24-bit entity, followed
+ * by op-code. Linker will combine them.
+ * Listing shows only the address.
+ */
+ r |= R_WORD | esp->e_rlcf;
+ out_l24(esp->e_addr,r|R_RELOC);
+ if (oflag) {
+ outchk(4, 5);
+ out_t24(esp->e_addr);
+ *txtp++ = op;
- if (esp->e_flag) {
- n = esp->e_base.e_sp->s_ref;
- r |= R_SYM;
- } else {
- n = esp->e_base.e_ap->a_ref;
+ if (esp->e_flag) {
+ n = esp->e_base.e_sp->s_ref;
+ r |= R_SYM;
+ } else {
+ n = esp->e_base.e_ap->a_ref;
+ }
+ write_rmode(r);
+ *relp++ = txtp - txt - 4;
+ out_rw(n);
}
- write_rmode(r);
- *relp++ = txtp - txt - 4;
- out_rw(n);
}
}
dot.s_addr += 3;