diff options
author | jdp <jdp@FreeBSD.org> | 1997-04-25 15:26:12 +0000 |
---|---|---|
committer | jdp <jdp@FreeBSD.org> | 1997-04-25 15:26:12 +0000 |
commit | 71dc5f627691cd0656d8fd74253f0bb7dc61f556 (patch) | |
tree | 61fe4c8e0ab516296f48674eac0f568cf5b15197 /gnu | |
parent | 34d3c87f8fa472fe5cf435a30e2324e9ac5ced46 (diff) | |
download | FreeBSD-src-71dc5f627691cd0656d8fd74253f0bb7dc61f556.zip FreeBSD-src-71dc5f627691cd0656d8fd74253f0bb7dc61f556.tar.gz |
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.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/ld/rrs.c | 8 |
1 files 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 <sys/param.h> @@ -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); |