hidden names, made arg_error dependant on DEBUG
This commit is contained in:
parent
bf6a1eb0ba
commit
0291c897be
4 changed files with 23 additions and 21 deletions
|
@ -1,8 +1,9 @@
|
||||||
#include <system.h>
|
#include <system.h>
|
||||||
|
#include <back.h>
|
||||||
|
|
||||||
extern File *_out_file;
|
extern File *B_out_file;
|
||||||
|
|
||||||
close_back()
|
close_back()
|
||||||
{
|
{
|
||||||
sys_close( _out_file);
|
sys_close( B_out_file);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include <system.h>
|
#include <system.h>
|
||||||
|
#include <back.h>
|
||||||
|
|
||||||
File *_out_file;
|
File *B_out_file;
|
||||||
|
|
||||||
open_back( filename)
|
open_back( filename)
|
||||||
char *filename;
|
char *filename;
|
||||||
|
@ -8,6 +9,6 @@ char *filename;
|
||||||
if ( filename == (char *) '\0')
|
if ( filename == (char *) '\0')
|
||||||
return( 0);
|
return( 0);
|
||||||
else
|
else
|
||||||
return( sys_open( filename, OP_WRITE, &_out_file));
|
return( sys_open( filename, OP_WRITE, &B_out_file));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
#include <out.h>
|
#include <out.h>
|
||||||
#include "mach.h"
|
#include "mach.h"
|
||||||
#include "back.h"
|
#include "back.h"
|
||||||
#include "data.h"
|
|
||||||
|
|
||||||
/* Unportable code. Written for VAX, meant to be run on a VAX.
|
/* Unportable code. Written for VAX, meant to be run on a VAX.
|
||||||
*/
|
*/
|
||||||
|
@ -11,7 +10,7 @@
|
||||||
Read above comment ...
|
Read above comment ...
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern File *_out_file;
|
extern File *B_out_file;
|
||||||
|
|
||||||
#include <a.out.h>
|
#include <a.out.h>
|
||||||
#include <alloc.h>
|
#include <alloc.h>
|
||||||
|
@ -20,16 +19,14 @@ static struct exec u_header;
|
||||||
|
|
||||||
static long ntext, ndata, nrelo, nchar;
|
static long ntext, ndata, nrelo, nchar;
|
||||||
|
|
||||||
long _base_address[SEGBSS+1];
|
long B_base_address[SEGBSS+1];
|
||||||
|
|
||||||
static int trsize=0, drsize=0;
|
static int trsize=0, drsize=0;
|
||||||
|
|
||||||
static struct relocation_info *u_reloc;
|
static struct relocation_info *u_reloc;
|
||||||
|
|
||||||
static reduce_name_table();
|
static reduce_name_table(), putbuf(), put_stringtablesize();
|
||||||
static putbuf(), put_stringtablesize();
|
static convert_name(), convert_reloc(), init_unixheader();
|
||||||
static init_unixheader();
|
|
||||||
static convert_reloc(), convert_name()
|
|
||||||
|
|
||||||
output_back()
|
output_back()
|
||||||
{
|
{
|
||||||
|
@ -162,6 +159,7 @@ reduce_name_table()
|
||||||
string = q;
|
string = q;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
init_unixheader()
|
init_unixheader()
|
||||||
{
|
{
|
||||||
ntext = text - text_area;
|
ntext = text - text_area;
|
||||||
|
@ -183,6 +181,7 @@ init_unixheader()
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
convert_reloc( a_relo, u_relo)
|
convert_reloc( a_relo, u_relo)
|
||||||
register struct outrelo *a_relo;
|
register struct outrelo *a_relo;
|
||||||
register struct relocation_info *u_relo;
|
register struct relocation_info *u_relo;
|
||||||
|
@ -220,6 +219,7 @@ register struct relocation_info *u_relo;
|
||||||
#define n_mptr n_un.n_name
|
#define n_mptr n_un.n_name
|
||||||
#define n_str n_un.n_strx
|
#define n_str n_un.n_strx
|
||||||
|
|
||||||
|
static
|
||||||
convert_name( a_name, u_name)
|
convert_name( a_name, u_name)
|
||||||
register struct outname *a_name;
|
register struct outname *a_name;
|
||||||
register struct nlist *u_name;
|
register struct nlist *u_name;
|
||||||
|
@ -253,21 +253,22 @@ register struct nlist *u_name;
|
||||||
u_name->n_value = a_name->on_valu;
|
u_name->n_value = a_name->on_valu;
|
||||||
else if ( a_name->on_valu != -1)
|
else if ( a_name->on_valu != -1)
|
||||||
u_name->n_value = a_name->on_valu +
|
u_name->n_value = a_name->on_valu +
|
||||||
_base_address[( a_name->on_type & S_TYP) - S_MIN];
|
B_base_address[( a_name->on_type & S_TYP) - S_MIN];
|
||||||
else
|
else
|
||||||
u_name->n_value = 0;
|
u_name->n_value = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
put_stringtablesize( n)
|
put_stringtablesize( n)
|
||||||
long n;
|
long n;
|
||||||
{
|
{
|
||||||
putbuf( (char *)&n, 4L);
|
putbuf( (char *)&n, 4L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static
|
||||||
putbuf(buf,n)
|
putbuf(buf,n)
|
||||||
char *buf;
|
char *buf;
|
||||||
long n;
|
long n;
|
||||||
{
|
{
|
||||||
sys_write( _out_file, buf, n);
|
sys_write( B_out_file, buf, n);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
#include <system.h>
|
#include <system.h>
|
||||||
#include <out.h>
|
#include <out.h>
|
||||||
#include "data.h"
|
|
||||||
#include "back.h"
|
#include "back.h"
|
||||||
|
|
||||||
/* Written to run on SUN, and generate code for SUN */
|
/* Written to run on VAX, and generate code for VAX */
|
||||||
|
|
||||||
extern long _base_address[];
|
extern long B_base_address[];
|
||||||
|
|
||||||
do_local_relocation()
|
do_local_relocation()
|
||||||
{
|
{
|
||||||
|
@ -13,9 +12,9 @@ do_local_relocation()
|
||||||
|
|
||||||
/* print( "n relocation records %d\n", relo - reloc_info); */
|
/* print( "n relocation records %d\n", relo - reloc_info); */
|
||||||
|
|
||||||
_base_address[SEGTXT] = 0;
|
B_base_address[SEGTXT] = 0;
|
||||||
_base_address[SEGCON] = text - text_area;
|
B_base_address[SEGCON] = text - text_area;
|
||||||
_base_address[SEGBSS] = _base_address[SEGCON] + data - data_area;
|
B_base_address[SEGBSS] = B_base_address[SEGCON] + data - data_area;
|
||||||
for ( rp = reloc_info; rp < relo; rp++) {
|
for ( rp = reloc_info; rp < relo; rp++) {
|
||||||
register struct outname *np = &symbol_table[rp->or_nami];
|
register struct outname *np = &symbol_table[rp->or_nami];
|
||||||
|
|
||||||
|
@ -38,7 +37,7 @@ do_local_relocation()
|
||||||
if ( rp->or_type & RELO4)
|
if ( rp->or_type & RELO4)
|
||||||
*((long *)(sect+rp->or_addr)) +=
|
*((long *)(sect+rp->or_addr)) +=
|
||||||
np->on_valu +
|
np->on_valu +
|
||||||
_base_address[(np->on_type&S_TYP)-S_MIN];
|
B_base_address[(np->on_type&S_TYP)-S_MIN];
|
||||||
else
|
else
|
||||||
fprint( STDERR,
|
fprint( STDERR,
|
||||||
"do_relo() : bad relocation size\n");
|
"do_relo() : bad relocation size\n");
|
||||||
|
|
Loading…
Add table
Reference in a new issue