summaryrefslogtreecommitdiff
path: root/distrib
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-09-21 17:27:33 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-09-21 17:27:33 +0000
commit9f7a87e8530d3e59e4ef290196e89b6545bd9949 (patch)
treed977d4147d40a8203e26bc2bbdea3878722f19f5 /distrib
parentc48dc301bfa0d098378b7096fd52cc39307472e2 (diff)
work around the vm system problem, gross eh
Diffstat (limited to 'distrib')
-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 */
}