From: Robert R. Henry Date: Thu, 21 Aug 1980 03:10:30 +0000 (-0800) Subject: Partial backout of previous delta; align to no more than full word X-Git-Tag: BSD-4^3~854 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/7a5aec15fac1d8a75e379c43d3fe23b1c95bf44c?hp=8efb1a2c70a0d077e4971eeadb8c1572555a5e18 Partial backout of previous delta; align to no more than full word SCCS-vsn: old/as.vax/asmain.c 4.8 SCCS-vsn: old/as.vax/asjxxx.c 4.5 --- diff --git a/usr/src/old/as.vax/asjxxx.c b/usr/src/old/as.vax/asjxxx.c index 42985e0823..36ced59b93 100644 --- a/usr/src/old/as.vax/asjxxx.c +++ b/usr/src/old/as.vax/asjxxx.c @@ -1,5 +1,5 @@ /* Copyright (c) 1980 Regents of the University of California */ -static char sccsid[] = "@(#)asjxxx.c 4.4 %G%"; +static char sccsid[] = "@(#)asjxxx.c 4.5 %G%"; #include #include "as.h" #include "assyms.h" @@ -116,6 +116,24 @@ jalign(xp, sp) register struct symtab *sp; { register int mask; + /* + * Problem with .align + * + * When the loader constructs an executable file from + * a number of objects, it effectively concatnates + * together all of the text segments from all objects, + * and then all of the data segments. + * + * If we do an align by a large value, we can align + * within the a.out this assembly produces, but + * after the loader concatnates, the alignment can't + * be guaranteed if the objects preceding this one + * in the load are also aligned to the same size. + * + * Currently, the loader guarantees full word alignment. + * So, ridiculous aligns are caught here and converted + * to a .align 2, if possible. + */ if ( (xp->e_xtype != XABS) || (xp->e_xvalue < 0) || (xp->e_xvalue > 16) @@ -123,11 +141,14 @@ jalign(xp, sp) yyerror("Illegal `align' argument"); return; } - if ( (xp->e_xvalue > 3) - && (dotp != &usedot[0]) - ) { - yywarning("Alignment by %d in segments other than text 0 may not work.", xp->e_xvalue); - yywarning("Phase errors may occur after this .align in the second pass."); + if (xp->e_xvalue > 2){ + if (passno == 1){ + yywarning(".align %d in any segment is NOT preserved by the loader", + xp->e_xvalue); + yywarning(".align %d converted to .align 2", + xp->e_xvalue); + } + xp->e_xvalue = 2; } flushfield(NBPW/4); if (passno == 1) { diff --git a/usr/src/old/as.vax/asmain.c b/usr/src/old/as.vax/asmain.c index ef9c83e282..936eaf14d3 100644 --- a/usr/src/old/as.vax/asmain.c +++ b/usr/src/old/as.vax/asmain.c @@ -1,5 +1,5 @@ /* Copyright (c) 1980 Regents of the University of California */ -static char sccsid[] = "@(#)asmain.c 4.7 %G%"; +static char sccsid[] = "@(#)asmain.c 4.8 %G%"; #include #include #include @@ -10,7 +10,7 @@ static char sccsid[] = "@(#)asmain.c 4.7 %G%"; #include "asscan.h" #ifdef UNIX -#define unix_lang_name "VAX/UNIX Assembler V%G% 4.7" +#define unix_lang_name "VAX/UNIX Assembler V%G% 4.8" #endif #ifdef VMS @@ -190,14 +190,14 @@ main(argc, argv) if (anyerrs) delexit(); open_a_out(); /* open a.out */ - roundsegments(); /* round segments to DW */ + roundsegments(); /* round segments to FW */ build_hdr(); /* build initial header, and output */ i_pass2(); /* reopen temporary file, etc */ pass2(); /* second pass through the virtual .s */ if (anyerrs) delexit(); - fillsegments(); /* fill segments with 0 to DW */ + fillsegments(); /* fill segments with 0 to FW */ reloc_syms(); /* dump relocation and symbol table */ delete(); /* remove tmp file */ @@ -438,7 +438,7 @@ roundsegments() */ tsize = 0; for (locindex=0; locindex