Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Nov 1996 15:19:21 -0100
From:      Darius Moos <moos@degnet.baynet.de>
To:        David Nugent <davidn@sdev.usn.blaze.net.au>
Cc:        freebsd-hackers <freebsd-hackers@FreeBSD.org>
Subject:   Re: Who needs Perl? We do!
Message-ID:  <32972409.70FC@degnet.baynet.de>
References:  <199611212355.PAA29016@osprey.grizzly.com> <329580BB.7E40@degnet.baynet.de> <Mutt.19961123030936.roberto@keltia.freenix.fr> <3296EAFF.32FF@degnet.baynet.de> <Mutt.19961123224644.davidn@sdev>

next in thread | previous in thread | raw e-mail | index | archive | help
The perl-script i want to turn into a binary version is called myfile.pl
The perl-binary (5.003) was compiled with -DUNEXEC and the unexec-
functionality from emacs was merged in. It compiled without any errors.
After some variable-initialisation there is a
  dump LALA;
  LALA:
in the perlscript.

Following is the info you advised me to check. I still have no idea
what is going wrong here.
I am thankfull for any little hint, that helps to solve the problem.

Darius Moos.

neuron:~/projects/perltest> 
neuron:~/projects/perltest> pwd
/home/moos/projects/perltest
neuron:~/projects/perltest> whoami
moos
neuron:~/projects/perltest> ll
total 764
drwxr-xr-x  2 moos  home     512 Nov 23 14:46 ./
drwxr-xr-x  4 moos  home     512 Nov 23 14:41 ../
-rwxr-xr-x  1 moos  home    8804 Nov 23 14:46 callmyfile*
-rw-r--r--  1 moos  home     252 Nov 23 14:41 callmyfile.c
-rwxr-x---  1 moos  home   28011 Nov 23 14:44 myfile.pl*
neuron:~/projects/perltest> ./myfile.pl 
neuron:~/projects/perltest> ll
total 764
drwxr-xr-x  2 moos  home     512 Nov 23 14:50 ./
drwxr-xr-x  4 moos  home     512 Nov 23 14:41 ../
-rwxr-xr-x  1 moos  home    8804 Nov 23 14:46 callmyfile*
-rw-r--r--  1 moos  home     252 Nov 23 14:41 callmyfile.c
-rwxr-x---  1 moos  home   28011 Nov 23 14:44 myfile.pl*
-rwxr-xr-x  1 moos  home  723223 Nov 23 14:50 myfile.pl.perldump*
neuron:~/projects/perltest> ./myfile.pl.perldump 
bash: ./myfile.pl.perldump: cannot execute binary file
neuron:~/projects/perltest> echo $?
126
neuron:~/projects/perltest> file ./myfile.pl          
./myfile.pl: a /usr/local/bin/perl script text
neuron:~/projects/perltest> file ./myfile.pl.perldump 
./myfile.pl.perldump: FreeBSD/i386 demand paged dynamically linked
executable not stripped
neuron:~/projects/perltest> cat ./callmyfile.c 
#include <stdio.h>
#include <unistd.h>
#include <sys/errno.h>

extern int errno;

int main ()
{
   int err;

   err = execv("/home/moos/projects/perltest/myfile.pl.perldump", NULL);
   printf("execv-returned %d\nerrno was set to %d\n", err, errno);
}

neuron:~/projects/perltest> cc ./callmyfile.c -o ./callmyfile
neuron:~/projects/perltest> ./callmyfile 
execv-returned -1
errno was set to 8
neuron:~/projects/perltest>
neuron:~/projects/perltest> man errno
.
.
.
     8 ENOEXEC Exec format error. A request was made to execute a file
               that,
               although it has the appropriate permissions, was not in
               the for-
               mat required for an executable file.
.
.
.



David Nugent wrote:
> 
> Darius Moos writes:
> > I've also merged unexec into perl as far, as it compiles without errors.
> > When then using the "dump <LABEL>" command in the source-perl-script,
> > it dumps fine but when trying to execute the binary-file, bash brings
> > an error: "Cannot execute binary file".
> > I'm lost at this point.
> 
> What does 'file' say about the file's type? Got any executable
> dumpters (say, from GNU bfd tools) which might help locate the
> problem? What's the real errno (what's set if you execv() the
> file from a C program?).
> 
> > Maybe someone can give me a helpful hint or suggestion.
> 
> Hope this helps. They'd be the first things I'd try, at any
> rate.
> 
> Regards,
> 
> David Nugent, Unique Computing Pty Ltd - Melbourne, Australia
> Voice +61-3-9791-9547 Data/BBS +61-3-9792-3507 3:632/348@fidonet
> davidn@blaze.net.au http://www.blaze.net.au/~davidn



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?32972409.70FC>