summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1998-09-21 17:27:32 +0000
committerderaadt <deraadt@openbsd.org>1998-09-21 17:27:32 +0000
commit64e402b6b4aea53705f2f2a6683393fef1839580 (patch)
tree1e17d6e2ad163726c19283c26f4a69b19033e30a
parentman page for tx... borrwed from hme and FreeBSD manpages (diff)
downloadwireguard-openbsd-64e402b6b4aea53705f2f2a6683393fef1839580.tar.xz
wireguard-openbsd-64e402b6b4aea53705f2f2a6683393fef1839580.zip
work around the vm system problem, gross eh
-rw-r--r--distrib/crunch/crunchide/crunchide.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/distrib/crunch/crunchide/crunchide.c b/distrib/crunch/crunchide/crunchide.c
index 281bc13fd2f..4b3f867f1af 100644
--- a/distrib/crunch/crunchide/crunchide.c
+++ b/distrib/crunch/crunchide/crunchide.c
@@ -232,6 +232,7 @@ void hide_syms(char *filename)
struct relocation_info *relp;
struct nlist *symp;
char *buf;
+ u_char zero = 0;
/*
* Open the file and do some error checking.
@@ -316,8 +317,15 @@ void hide_syms(char *filename)
*/
for(symp = symbase; symp < symbase + nsyms; symp++)
- if(IS_GLOBAL_DEFINED(symp) && !in_keep_list(SYMSTR(symp)))
+ if(IS_GLOBAL_DEFINED(symp) && !in_keep_list(SYMSTR(symp))) {
+ /*
+ * XXX Our VM system has some problems, so
+ * avoid the VM system....
+ */
+ lseek(inf, (off_t)((void *)&symp->n_type - (void *)buf), SEEK_SET);
+ write(inf, &zero, sizeof zero);
symp->n_type = 0;
+ }
/*
* Check whether the relocation entries reference any symbols that we
@@ -331,6 +339,8 @@ void hide_syms(char *filename)
for(relp = datarel; relp < datarel + ndatarel; relp++)
check_reloc(filename, relp);
+ msync(buf, infstat.st_size, MS_SYNC);
+ munmap(buf, infstat.st_size);
close(inf);
#endif /* DO_AOUT */
}