- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: dld.sl: Bad magic number for shared library
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2010 08:47 PM
тАО01-03-2010 08:47 PM
dld.sl: Bad magic number for shared library
I am trying to compile a Perl module in a 64bit PA-RISC2.0 11.11 HP-UX environment.
The make command is successful:
$ make
gcc -c -I. -D_HPUX_SOURCE -mpa-risc-2-0 -DNO_HASH_SEED -DDEBUGGING -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O -DVERSION=\"2.023\" -DXS_VERSION=\"2.023\" -fPIC "-I/usr/local/perl2exe/perl5/lib/5.10.0/PA-RISC2.0/CORE" -Wall -Wno-comment -DBZ_NO_STDIO -DUSE_PPPORT_H blocksort.c
gcc -c -I. -D_HPUX_SOURCE -mpa-risc-2-0 -DNO_HASH_SEED -DDEBUGGING -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O -DVERSION=\"2.023\" -DXS_VERSION=\"2.023\" -fPIC "-I/usr/local/perl2exe/perl5/lib/5.10.0/PA-RISC2.0/CORE" -Wall -Wno-comment -DBZ_NO_STDIO -DUSE_PPPORT_H huffman.c
gcc -c -I. -D_HPUX_SOURCE -mpa-risc-2-0 -DNO_HASH_SEED -DDEBUGGING -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O -DVERSION=\"2.023\" -DXS_VERSION=\"2.023\" -fPIC "-I/usr/local/perl2exe/perl5/lib/5.10.0/PA-RISC2.0/CORE" -Wall -Wno-comment -DBZ_NO_STDIO -DUSE_PPPORT_H crctable.c
gcc -c -I. -D_HPUX_SOURCE -mpa-risc-2-0 -DNO_HASH_SEED -DDEBUGGING -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O -DVERSION=\"2.023\" -DXS_VERSION=\"2.023\" -fPIC "-I/usr/local/perl2exe/perl5/lib/5.10.0/PA-RISC2.0/CORE" -Wall -Wno-comment -DBZ_NO_STDIO -DUSE_PPPORT_H randtable.c
gcc -c -I. -D_HPUX_SOURCE -mpa-risc-2-0 -DNO_HASH_SEED -DDEBUGGING -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O -DVERSION=\"2.023\" -DXS_VERSION=\"2.023\" -fPIC "-I/usr/local/perl2exe/perl5/lib/5.10.0/PA-RISC2.0/CORE" -Wall -Wno-comment -DBZ_NO_STDIO -DUSE_PPPORT_H compress.c
gcc -c -I. -D_HPUX_SOURCE -mpa-risc-2-0 -DNO_HASH_SEED -DDEBUGGING -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O -DVERSION=\"2.023\" -DXS_VERSION=\"2.023\" -fPIC "-I/usr/local/perl2exe/perl5/lib/5.10.0/PA-RISC2.0/CORE" -Wall -Wno-comment -DBZ_NO_STDIO -DUSE_PPPORT_H decompress.c
gcc -c -I. -D_HPUX_SOURCE -mpa-risc-2-0 -DNO_HASH_SEED -DDEBUGGING -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O -DVERSION=\"2.023\" -DXS_VERSION=\"2.023\" -fPIC "-I/usr/local/perl2exe/perl5/lib/5.10.0/PA-RISC2.0/CORE" -Wall -Wno-comment -DBZ_NO_STDIO -DUSE_PPPORT_H bzlib.c
gcc -c -I. -D_HPUX_SOURCE -mpa-risc-2-0 -DNO_HASH_SEED -DDEBUGGING -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O -DVERSION=\"2.023\" -DXS_VERSION=\"2.023\" -fPIC "-I/usr/local/perl2exe/perl5/lib/5.10.0/PA-RISC2.0/CORE" -Wall -Wno-comment -DBZ_NO_STDIO -DUSE_PPPORT_H Bzip2.c
Running Mkbootstrap for Compress::Raw::Bzip2 ()
chmod 644 Bzip2.bs
rm -f blib/arch/auto/Compress/Raw/Bzip2/Bzip2.sl
/usr/bin/ld -b blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o Bzip2.o -o blib/arch/auto/Compress/Raw/Bzip2/Bzip2.sl \
\
chmod 755 blib/arch/auto/Compress/Raw/Bzip2/Bzip2.sl
cp Bzip2.bs blib/arch/auto/Compress/Raw/Bzip2/Bzip2.bs
chmod 644 blib/arch/auto/Compress/Raw/Bzip2/Bzip2.bs
Manifying blib/man3/Compress::Raw::Bzip2.3
The compiled shared libraries are all 64bit, and so is the Perl executable.
But when I run make test, I get the following:
Manifying blib/man3/Compress::Raw::Bzip2.3
$ make test
PERL_DL_NONLAZY=1 /usr/local/perl2exe/perl5/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/000prereq........ok
t/01bzip2........../usr/lib/dld.sl: Bad magic number for shared library: /opt/oracle/orabase/cpan/Compress-Raw-Bzip2-2.023/blib/arch/auto/Compress/Raw/Bzip2/Bzip2.sl
/usr/lib/dld.sl: Exec format error
/usr/lib/dld.sl: Bad magic number for shared library: /opt/oracle/orabase/cpan/Compress-Raw-Bzip2-2.023/blib/arch/auto/Compress/Raw/Bzip2/Bzip2.sl
/usr/lib/dld.sl: Exec format error
The shared library is 64bit:
$ file /opt/oracle/orabase/cpan/Compress-Raw-Bzip2-2.023/blib/arch/auto/Compress/Raw/Bzip2/Bzip2.sl
/opt/oracle/orabase/cpan/Compress-Raw-Bzip2-2.023/blib/arch/auto/Compress/Raw/Bzip2/Bzip2.sl: ELF-64 shared object file - PA-RISC 2.0 (LP64)
So as far as I can see the issue is that it calls the 32bit linker /usr/lib/dld.sl. It should be calling the 64bit linker: /usr/lib/pa20_64/dld.sl
The linker is patched to the latest version:
# ld -V
92453-07 linker command s800.sgs ld PA64 B.11.68 REL 090514
ld: 92453-07 linker linker ld B.11.68 090514
My settings:
LD_LIBRARY_PATH=/usr/lib/pa20_6a:/usr/ccs/lib/pa20_644
SHLIB_PATH=/usr/lib/
Anyone has any ideas how to force the 64 bit linker /usr/lib/pa20_64/dld.sl?
Thanks
- Tags:
- shlib
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-04-2010 12:52 AM
тАО01-04-2010 12:52 AM
Re: dld.sl: Bad magic number for shared library
blib/arch/auto/Compress/Raw/Bzip2/Bzip2.sl with ELF-64, it's very
easy to use /usr/local/pa64/bin/gcc which can be installed from
http://hp.com/go/gcc as "HP-GCC 4.4.0-1 PA-RISC LP64".
% which gcc
/usr/local/bin/gcc
% gcc -o hello hello.c -mpa-risc-2-0
% file hello
hello: PA-RISC2.0 shared executable dynamically linked -not stripped
% /usr/local/pa64/bin/gcc -o hello hello.c
% file hello
hello: ELF-64 executable object file - PA-RISC 2.0 (LP64)
%
Hope this helps you !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-04-2010 01:39 AM
тАО01-04-2010 01:39 AM
Re: dld.sl: Bad magic number for shared library
$ which gcc
/opt/hp-gcc/bin/gcc
$ file /opt/hp-gcc/bin/gcc
/opt/hp-gcc/bin/gcc: ELF-64 executable object file - PA-RISC 2.0 (LP64)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-04-2010 01:40 AM
тАО01-04-2010 01:40 AM
Re: dld.sl: Bad magic number for shared library
Using built-in specs.
Target: hppa64-hp-hpux11.11
Configured with: /tmp/gcc-4.4.0.tar.gz/gcc-4.4.0/configure --host=hppa64-hp-hpux11.11 --target=hppa64-hp-hpux11.11 --build=hppa64-hp-hpux11.11 --prefix=/opt/hp-gcc64-4.4.0 --with-gnu-as --without-gnu-ld --enable-threads=posix --enable-languages=c,c++ --with-gmp=/proj/opensrc/be/hppa64-hp-hpux11.11 --with-mpfr=/proj/opensrc/be/hppa64-hp-hpux11.11
Thread model: posix
gcc version 4.4.0 (GCC)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-04-2010 10:28 AM
тАО01-04-2010 10:28 AM
Re: dld.sl: Bad magic number for shared library
Then you have to use HP's gcc compiler to get 64 bit mode. (Or build your own.)
>The compiled shared libraries are all 64bit, and so is the Perl executable.
>the issue is that it calls the 32bit linker /usr/lib/dld.sl. It should be calling the 64bit linker: /usr/lib/pa20_64/dld.sl
If it invokes /usr/lib/dld.sl, it's 32 bit.
(This is the dynamic loader, not linker.)
>LD_LIBRARY_PATH=/usr/lib/pa20_6a:/usr/ccs/lib/pa20_644
You have typos here? And there are no shlibs in /usr/ccs/lib/, so remove that.
>SHLIB_PATH=/usr/lib/
This is the default, so remove this too.
>$ file /opt/hp-gcc/bin/gcc
/opt/hp-gcc/bin/gcc: ELF-64 executable object file - PA-RISC 2.0 (LP64)
This may not be telling us the right thing. You need to run file(1) on a binary produced by the compiler. (HP's compilers can produce both 32 and 64 bit with the same executable.)
>But when I run make test, I get the following:
Is this using the right gcc?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-04-2010 01:17 PM
тАО01-04-2010 01:17 PM
Re: dld.sl: Bad magic number for shared library
>>LD_LIBRARY_PATH=/usr/lib/pa20_6a:/usr/ccs/lib/pa20_644
>You have typos here? And there are no shlibs in /usr/ccs/lib/, so remove that.
Thanks for pointing this out, I have removed the typo but still get the same result.
> This may not be telling us the right thing. You need to run file(1) on a binary produced by the compiler. (HP's compilers can produce both 32 and 64 bit with the same executable.)
The resulting binary is 64 bit as far as I can tell:
$ file /opt/oracle/orabase/cpan/Compress-Raw-Bzip2-2.023/blib/arch/auto/Compress/Raw/Bzip2/Bzip2.sl
/opt/oracle/orabase/cpan/Compress-Raw-Bzip2-2.023/blib/arch/auto/Compress/Raw/Bzip2/Bzip2.sl: ELF-64 shared object file - PA-RISC 2.0 (LP64)
>>But when I run make test, I get the following:
>Is this using the right gcc?
How can I tell if make uses the right gcc.
>Then you have to use HP's gcc compiler to get 64 bit mode. (Or build your own.)
I used the HP gcc compiler from the DSPP HP website.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-04-2010 11:28 PM
тАО01-04-2010 11:28 PM
Re: dld.sl: Bad magic number for shared library
Naturally since you are still in 32 bit mode.
>The resulting binary is 64 bit as far as I can tell:
Yes, you showed that elsewhere. But my comment was directed at using file(1) on gcc.
>How can I tell if make uses the right gcc?
Do you see the make macro CC defined anywhere?
Typically you can use:
gmake ... CC=/opt/hp-gcc/bin/gcc ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2010 01:17 PM
тАО01-05-2010 01:17 PM
Re: dld.sl: Bad magic number for shared library
$ ls
sample.c
$ gcc -Wall -o sample sample.c
$ ./sample
sum = 55
$ file sample
sample: ELF-64 executable object file - PA-RISC 2.0 (LP64)
$ gcc -v
Using built-in specs.
Target: hppa64-hp-hpux11.11
Configured with: /tmp/gcc-4.4.0.tar.gz/gcc-4.4.0/configure --host=hppa64-hp-hpux11.11 --target=hppa64-hp-hpux11.11 --build=hppa64-hp-hpux11.11 --prefix=/opt/hp-gcc64-4.4.0 --with-gnu-as --without-gnu-ld --enable-threads=posix --enable-languages=c,c++ --with-gmp=/proj/opensrc/be/hppa64-hp-hpux11.11 --with-mpfr=/proj/opensrc/be/hppa64-hp-hpux11.11
Thread model: posix
gcc version 4.4.0 (GCC)
I also set CC=/opt/hp-gcc/bin/gcc and ran gmake with CC=/opt/hp-gcc/bin/gcc, but still get the same results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2010 03:45 PM
тАО01-05-2010 03:45 PM
Re: dld.sl: Bad magic number for shared library
AR = ar
CC = gcc
CCCDLFLAGS = -fPIC
CCDLFLAGS = -Wl,-E -Wl,-B,deferred
DLEXT = sl
DLsrc=dl_hpux.xs
EXE_EXT =
FULL_AR = /usr/bin/ar
LD = /usr/bin/ld
LDDLFLAGS = -b
LDFLAGS =
LIBC = /lib/libc.sl
LIB_EXT = .a
OBJ_EXT = .o
OSNAME = hpux
OSVERS = 11.11
RANLIB = :
SITELIBEXP = /usr/local/perl2exe/perl5/lib/site_perl/5.10.0
SITEARCHEXP = /usr/local/perl2exe/perl5/lib/site_perl/5.10.0/PA-RISC2.0
SO = sl
Anything there I can try to get this resolved?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-06-2010 01:29 AM
тАО01-06-2010 01:29 AM
Re: dld.sl: Bad magic number for shared library
Now, this is a valid test.
>CC=/opt/hp-gcc/bin/gcc, but still get the same results.
Then you need to do makefile debugging. Try removing every stinkin' "@" at the beginning of lines so you see what's happening.
Also make has -d.
>Anything there I can try to get this resolved?
You need to find out the name of the executable when it aborts.
>so is the Perl executable
Is /usr/local/perl2exe/perl5/bin/perl 64 bit?
If you can't debug your makefiles you need to give up and just use "tusc -fp -ae -o tusc.out make test".