Elf file checking - Added the test that data and text are at least a page apart.

This commit is contained in:
Bahadir Balban
2009-05-13 16:37:08 +03:00
parent 2c01463482
commit ae50823599
3 changed files with 8 additions and 5 deletions

View File

@@ -24,7 +24,7 @@ int exectest(void)
char filename[128];
memset(filename, 0, 128);
sprintf(filename, "/home/bahadir/execfile%d.txt", getpid());
sprintf(filename, "/home/bahadir/execfile%d", getpid());
/* First create a new file and write the executable data to that file */
if ((fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, S_IRWXU)) < 0) {
@@ -33,7 +33,7 @@ int exectest(void)
}
left = size;
printf("Writing %d bytes to %s\n", left, filename);
test_printf("Writing %d bytes to %s\n", left, filename);
while (left != 0) {
if ((cnt = write(fd, exec_start, left)) < 0)
goto out_err;
@@ -51,7 +51,7 @@ int exectest(void)
argv[4] = 0;
/* Execute the file */
execve("/home/bahadir/test1.axf", argv, 0);
execve(filename, argv, 0);
out_err:
printf("EXECVE TEST -- FAILED --\n");