From 71dc5f627691cd0656d8fd74253f0bb7dc61f556 Mon Sep 17 00:00:00 2001 From: jdp Date: Fri, 25 Apr 1997 15:26:12 +0000 Subject: Fill the padding at the end of the runtime strings with zeros, instead of leaving random data there. This makes the linker's output files more deterministic -- an important property for regression tests. --- gnu/usr.bin/ld/rrs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gnu/usr.bin/ld/rrs.c b/gnu/usr.bin/ld/rrs.c index 915f2bf..9e0ff8b 100644 --- a/gnu/usr.bin/ld/rrs.c +++ b/gnu/usr.bin/ld/rrs.c @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id$ + * $Id: rrs.c,v 1.20 1997/02/22 15:46:23 peter Exp $ */ #include @@ -989,6 +989,7 @@ write_rrs_text() int symsize; struct nzlist *nlp; int offset = 0; + int aligned_offset; struct shobj *shp; struct sod *sodp; int bind; @@ -1165,7 +1166,10 @@ write_rrs_text() } END_EACH_SYMBOL; - if (MALIGN(offset) != rrs_strtab_size) + aligned_offset = MALIGN(offset); + while (offset < aligned_offset) /* Pad deterministically */ + rrs_strtab[offset++] = '\0'; + if (offset != rrs_strtab_size) errx(1, "internal error: " "inconsistent RRS string table length: %d, expected %d", offset, rrs_strtab_size); -- cgit v1.1