projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleanup from Chris Torek
[unix-history]
/
usr
/
src
/
old
/
as.vax
/
asmain.c
diff --git
a/usr/src/old/as.vax/asmain.c
b/usr/src/old/as.vax/asmain.c
index
c4b281e
..
4375294
100644
(file)
--- a/
usr/src/old/as.vax/asmain.c
+++ b/
usr/src/old/as.vax/asmain.c
@@
-1,8
+1,17
@@
/*
/*
- * Copyright (c) 1982 Regents of the University of California
+ * Copyright (c) 1982 Regents of the University of California.
+ * All rights reserved. The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
*/
*/
+
#ifndef lint
#ifndef lint
-static char sccsid[] = "@(#)asmain.c 4.12 %G%";
+char copyright[] =
+"@(#) Copyright (c) 1982 Regents of the University of California.\n\
+ All rights reserved.\n";
+#endif not lint
+
+#ifndef lint
+static char sccsid[] = "@(#)asmain.c 5.5 (Berkeley) %G%";
#endif not lint
#include <stdio.h>
#endif not lint
#include <stdio.h>
@@
-13,8
+22,11
@@
static char sccsid[] = "@(#)asmain.c 4.12 %G%";
#include "assyms.h"
#include "asscan.h"
#include "asexpr.h"
#include "assyms.h"
#include "asscan.h"
#include "asexpr.h"
+#include <paths.h>
+
+#include <sys/stat.h>
-#define unix_lang_name "VAX/UNIX Assembler V%G%
4.12
"
+#define unix_lang_name "VAX/UNIX Assembler V%G%
5.5
"
/*
* variables to manage reading the assembly source files
*/
/*
* variables to manage reading the assembly source files
*/
@@
-28,6
+40,7
@@
int ninfiles; /*how many interesting files there are*/
int silent = 0; /*don't complain about any errors*/
int savelabels = 0; /*write the labels to the a.out file*/
int d124 = 4; /*default allocate 4 bytes for unknown pointers*/
int silent = 0; /*don't complain about any errors*/
int savelabels = 0; /*write the labels to the a.out file*/
int d124 = 4; /*default allocate 4 bytes for unknown pointers*/
+int maxalign = 2; /*default .align maximum*/
int anyerrs = 0; /*no errors yet*/
int anywarnings=0; /*no warnings yet*/
int orgwarn = 0; /*Bad origins*/
int anyerrs = 0; /*no errors yet*/
int anywarnings=0; /*no warnings yet*/
int orgwarn = 0; /*Bad origins*/
@@
-87,7
+100,7
@@
int strfilepos = 0; /* position within the string file */
* It is opened by stdio, but is filled with the parallel
* block I/O library
*/
* It is opened by stdio, but is filled with the parallel
* block I/O library
*/
-char *outfile
= "a.out"
;
+char *outfile;
FILE *a_out_file;
off_t a_out_off; /* cumulative offsets for segments */
/*
FILE *a_out_file;
off_t a_out_off; /* cumulative offsets for segments */
/*
@@
-227,6
+240,7
@@
argprocess(argc, argv)
#ifdef DEBUG
debug = 0;
#endif
#ifdef DEBUG
debug = 0;
#endif
+ outfile = (char *)genbuildname("a.out");
innames = (char **)ClearCalloc(argc+1, sizeof (innames[0]));
dotsname = "<argv error>";
while (argc > 1) {
innames = (char **)ClearCalloc(argc+1, sizeof (innames[0]));
dotsname = "<argv error>";
while (argc > 1) {
@@
-256,12
+270,21
@@
argprocess(argc, argv)
exit(1);
}
break;
exit(1);
}
break;
+ case 'a':
+ maxalign = atoi(cp+1);
+ for (cp++; isdigit(*cp); cp++)
+ /*VOID*/;
+ if ( (maxalign > 16) || (maxalign < 0)){
+ yyerror("-a: 0<=align<=16");
+ exit(1);
+ }
+ break;
case 'o':
if (argc < 3){
yyerror("-o what???");
exit(1);
}
case 'o':
if (argc < 3){
yyerror("-o what???");
exit(1);
}
- outfile =
argv[2]
;
+ outfile =
(char *)genbuildname(argv[2])
;
bumpone:
argc -= 2;
argv += 2;
bumpone:
argc -= 2;
argv += 2;
@@
-401,9
+424,9
@@
FILE *tempopen(tname, part)
char *part;
{
FILE *file;
char *part;
{
FILE *file;
- sprintf(tname, "%s%sas%s%05d",
+
(void)
sprintf(tname, "%s%sas%s%05d",
tmpdirprefix,
tmpdirprefix,
- (tmpdirprefix[strlen(tmpdirprefix)-1] != '/') ? "/" :
0
,
+ (tmpdirprefix[strlen(tmpdirprefix)-1] != '/') ? "/" :
""
,
part,
getpid());
file = fopen(tname, "w");
part,
getpid());
file = fopen(tname, "w");
@@
-470,6
+493,8
@@
pass1_5()
open_a_out()
{
open_a_out()
{
+ struct stat stb;
+
/*
* Open up the a.out file now, and get set to build
* up offsets into it for all of the various text,data
/*
* Open up the a.out file now, and get set to build
* up offsets into it for all of the various text,data
@@
-481,6
+506,8
@@
open_a_out()
delexit();
}
biofd = a_out_file->_file;
delexit();
}
biofd = a_out_file->_file;
+ fstat(biofd, &stb);
+ biobufsize = stb.st_blksize;
a_out_off = 0;
}
a_out_off = 0;
}
@@
-631,8
+658,7
@@
reloc_syms()
hdr.a_drsize = 0;
}
/*
hdr.a_drsize = 0;
}
/*
- * Output the symbol table
- * and if FLEXNAMES is set, the string pool
+ * Output the symbol table and the string pool
*
* We must first rewind the string pool file to its beginning,
* in case it was seek'ed into for fetching ascii and asciz
*
* We must first rewind the string pool file to its beginning,
* in case it was seek'ed into for fetching ascii and asciz