mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
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.
This commit is contained in:
parent
d4192bac8e
commit
ec77d02207
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=25139
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user