aboutsummaryrefslogtreecommitdiffstats
path: root/exec/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'exec/exec.c')
-rw-r--r--exec/exec.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/exec/exec.c b/exec/exec.c
index cbe22d4f18c..fad345c532c 100644
--- a/exec/exec.c
+++ b/exec/exec.c
@@ -292,7 +292,9 @@ write_load_command (program_header *header, bool use_alternate,
292 struct exec_map_command command1; 292 struct exec_map_command command1;
293 USER_WORD start, end; 293 USER_WORD start, end;
294 bool need_command1; 294 bool need_command1;
295#ifndef PAGE_MASK
295 static long pagesize; 296 static long pagesize;
297#endif /* !PAGE_MASK */
296 298
297 /* First, write the commands necessary to map the specified segment 299 /* First, write the commands necessary to map the specified segment
298 itself. 300 itself.
@@ -306,14 +308,14 @@ write_load_command (program_header *header, bool use_alternate,
306#ifdef HAVE_GETPAGESIZE 308#ifdef HAVE_GETPAGESIZE
307 if (!pagesize) 309 if (!pagesize)
308 pagesize = getpagesize (); 310 pagesize = getpagesize ();
309#else /* HAVE_GETPAGESIZE */ 311#else /* !HAVE_GETPAGESIZE */
310 if (!pagesize) 312 if (!pagesize)
311 pagesize = sysconf (_SC_PAGESIZE); 313 pagesize = sysconf (_SC_PAGESIZE);
312#endif /* HAVE_GETPAGESIZE */ 314#endif /* !HAVE_GETPAGESIZE */
313 315
314#define PAGE_MASK (~(pagesize - 1)) 316#define PAGE_MASK (~(pagesize - 1))
315#define PAGE_SIZE (pagesize) 317#define PAGE_SIZE (pagesize)
316#endif /* PAGE_MASK */ 318#endif /* !PAGE_MASK */
317 319
318 start = header->p_vaddr & PAGE_MASK; 320 start = header->p_vaddr & PAGE_MASK;
319 end = ((header->p_vaddr + header->p_filesz 321 end = ((header->p_vaddr + header->p_filesz
@@ -895,10 +897,6 @@ format_pid (char *in, unsigned int pid)
895 with #!; in that case, find the program to open and use that 897 with #!; in that case, find the program to open and use that
896 instead. 898 instead.
897 899
898 If REENTRANT is not defined, NAME is actually a buffer of size
899 PATH_MAX + 80. In that case, copy over the file name actually
900 opened.
901
902 Next, read the executable header, and add the necessary memory 900 Next, read the executable header, and add the necessary memory
903 mappings for each file. Finally, return the action data and its 901 mappings for each file. Finally, return the action data and its
904 size in *SIZE. 902 size in *SIZE.
@@ -976,11 +974,6 @@ exec_0 (char *name, struct exec_tracee *tracee,
976 rewrite = buffer1 + link_size; 974 rewrite = buffer1 + link_size;
977 remaining = buffer1 + sizeof buffer1 - rewrite - 1; 975 remaining = buffer1 + sizeof buffer1 - rewrite - 1;
978 memcpy (rewrite, name, strnlen (name, remaining)); 976 memcpy (rewrite, name, strnlen (name, remaining));
979
980 /* Replace name with buffer1. */
981#ifndef REENTRANT
982 strcpy (name, buffer1);
983#endif /* REENTRANT */
984 } 977 }
985 } 978 }
986 979