1987-11-20 10:41:03 +00:00
|
|
|
#include <out.h>
|
|
|
|
#include "mach.h"
|
|
|
|
#include "back.h"
|
|
|
|
#include "header.h"
|
|
|
|
|
1987-11-25 13:54:01 +00:00
|
|
|
/* There are two forms of relocation program counter relative or
|
|
|
|
* absolute.
|
|
|
|
*/
|
|
|
|
|
1988-10-31 15:42:15 +00:00
|
|
|
#ifdef WORDS_REVERSED
|
|
|
|
#ifdef BYTES_REVERSED
|
|
|
|
#define RRR (RELO2|RELBR|RELWR)
|
|
|
|
#else
|
|
|
|
#define RRR (RELO2|RELWR)
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#ifdef BYTES_REVERSED
|
|
|
|
#define RRR (RELO2|RELBR)
|
|
|
|
#else
|
|
|
|
#define RRR (RELO2)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
1987-11-20 10:41:03 +00:00
|
|
|
reloc2( sym, off, pcrel)
|
|
|
|
char *sym;
|
|
|
|
arith off;
|
|
|
|
int pcrel;
|
|
|
|
{
|
1988-10-31 15:42:15 +00:00
|
|
|
register struct outrelo *r;
|
|
|
|
|
1987-11-20 10:41:03 +00:00
|
|
|
if ( relo - reloc_info >= size_reloc)
|
|
|
|
mem_relo();
|
|
|
|
|
1988-10-31 15:42:15 +00:00
|
|
|
r = relo;
|
|
|
|
r->or_type = ( pcrel) ? RELPC|RRR : RRR;
|
|
|
|
r->or_sect = S_MIN + conv_seg( cur_seg);
|
|
|
|
r->or_nami = find_sym(sym, REFERENCE);
|
|
|
|
r->or_addr = cur_value();
|
|
|
|
gen2( (pcrel) ? off - ( r->or_addr + 2) : off);
|
1987-11-20 10:41:03 +00:00
|
|
|
|
|
|
|
relo++;
|
|
|
|
}
|