2
/* Copyright William Schelter. All rights reserved. This file does
3
the low level relocation which tends to be very system dependent.
4
It is included by the file sfasl.c
11
{unsigned int new_value;
12
where = the_start + relocation_info.r_address;
13
if(relocation_info.r_extern)
15
if (relocation_info.r_pcrel)
16
new_value= - (int)start_address
17
+ symbol_table[relocation_info.r_symbolnum].n_value;
20
symbol_table[relocation_info.r_symbolnum].n_value;}}
22
{ switch(relocation_info.r_symbolnum){
23
case N_DATA: case N_BSS: case N_TEXT:
24
new_value= (int)start_address;
27
dprintf(relocation_info.r_extern = %d, relocation_info.r_extern);
28
printf("\nrelocation_info {r_symbolnum= %d, r_address = %d, r_extern=0 Ignored:",relocation_info.r_address,
29
relocation_info.r_symbolnum);fflush(stdout);
32
switch(relocation_info.r_length){
34
*( char *)where = new_value + *( char *) where; break;
36
*( short *)where = new_value + *( short *) where; break;
38
*( long *)where = new_value + *( long *) where; break;