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
describe_sym(relocation_info.r_symndx);
12
where = the_start + relocation_info.r_vaddr;
13
dprintf (where has %x , *where);
14
dprintf( at %x -->, where );
16
if (relocation_info.r_type == R_ABS)
17
{ dprintf( r_abs ,0) return; }
18
switch(relocation_info.r_type)
21
dprintf(new val r_dir32 %x , *((int *)where) +
22
symbol_table[relocation_info.r_symndx].n_value);
23
*(int *)where= *((int *)where) +
24
symbol_table[relocation_info.r_symndx].n_value;
28
dprintf( r_pcrlong new value = %x ,
29
*((int *)where) - (int)start_address
30
+ symbol_table[relocation_info.r_symndx].n_value );
32
/* the following is logical, except the address offset is
33
not where the 'where' is but where the 'call' is just
36
*(int *)where= symbol_table[relocation_info.r_symndx].n_value
37
- (int) where - sizeof(int *);
39
*(int *)where= *((int *)where) - (int)start_address
40
+ symbol_table[relocation_info.r_symndx].n_value;
45
fprintf(stdout, "%d: unsupported relocation type.",
46
relocation_info.r_type);
47
FEerror("The relocation type was unknown",0,0);
57
#define describe_sym describe_sym1
63
sym= &symbol_table[n];
64
str= sym->n_zeroes == 0 ?
65
&my_string_table[sym->n_offset] :
66
(sym->n_name[SYMNMLEN -1] ?
67
/* MAKE IT NULL TERMINATED */
68
(strncpy(tem,sym->n_name,
71
printf ("sym-index = %d table entry at %x",n,&symbol_table[n]);
72
printf("symbol is (%s):\nsymbol_table[n]._n._n_name %s\nsymbol_table[n]._n._n_n._n_zeroes %d\nsymbol_table[n]._n._n_n._n_offset %d\nsymbol_table[n]._n._n_nptr[0] %d\nsymbol_table[n]._n._n_nptr[n] %d\nsymbol_table[n].n_value %d\nsymbol_table[n].n_scnum %d
73
\nsymbol_table[n].n_type %d\nsymbol_table[n].n_sclass %d\nsymbol_table[n].n_numaux %d", str,
74
symbol_table[n]._n._n_name,
75
symbol_table[n]._n._n_n._n_zeroes ,
76
symbol_table[n]._n._n_n._n_offset ,
77
symbol_table[n]._n._n_nptr[0] ,
78
symbol_table[n]._n._n_nptr[1] ,
79
symbol_table[n].n_value ,
80
symbol_table[n].n_scnum ,
81
symbol_table[n].n_type ,
82
symbol_table[n].n_sclass ,
83
symbol_table[n].n_numaux );