Hi,
On Mo. 17. Jul. 2006, 08:59:27, kbaxley wrote:
Show quoted text> In 19030 there was mention that the pp executable file
> is the combination of a genuine executable (as produced by the linker)
> with additional items simply appended (and _not_ registered as an ELF
> section or something). Those appened items apparently get dropped from
> the output file when RPM runs strip during the build process. In the
> case here, it looks like a lot of the perl code gets discarded, thus
> rendering the executable non-functional. Could it be that the perl code
> is simply appended to the executable?
to my limited understanding, that is exactly what happens. It generates
a valid binary executable (basically a perl) and then appends a) perl
code for PAR (and Archive::Zip and such) and b) the zipped user code and
files.
Show quoted text> Running /usr/local/bin/helloworld after installing the rpm didn't work
> whenever I tried to invoke it.
>
> [kentb@dhcp59-156 ~]# /usr/local/bin/helloworld
> Usage: /usr/local/bin/helloworld [ -Alib.par ] [ -Idir ] [ -Mmodule ] [
> src.par ] [ program.pl ]
> /usr/local/bin/helloworld [ -B|-b ] [-Ooutfile] src.par
IIRC, the pp-ed binary is a "parl" with a .par (i.e. zip) file
concatenated which uses that archive instead of a user specified one.
Show quoted text> I also tried:
>
> pp -o hw helloworld.pl
>
> and running ./hw *did* work.
>
> When I compared the two files (/usr/local/bin/helloworld & hw) using
> readelf, they were *exactly* the same...so my guess is that the ELF
> binary itself isn't necessarily "bogus". My guess is that when we run
> strip during the rpm build process whatever was attached to the pp
> executable wasn't in the ELF header information and was tossed away? I
> don't really know if that constitutes bogus ELF vs. how pp packages
> executables, but, again, this is a totally un-educated guess based on
> what I've been researching so far. If I'm missing anything please let
> me know! Thanks!
*Exactly* the same? As in bit-for-bit? I doubt that - or else they
should both work or both not work. I suppose they have the same
binary/executable component, but /usr/local/bin/helloworld lacks the
"payload" - the actual "print qq(Hello World\n);" Perl code which was
stripped by rpm.
The solution to this problem might either be to
a) teach pp to register the appended stuff as ELF whatever (I have no
idea about Linux binary executable formats)
b) prevent rpm from stripping the executables.
I suppose b) is easier and is also what Scott suggested in his reply to
#19030. Unfortunately, his suggestion does not seem to be the full solution.
I'm sorry, but I can't help you any further with this. Fixing pp to
produce "strip-safe" binaries is way beyond my understanding of this.
If you find a solution one way or another, please, please let me know.
Steffen