- 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
Forums
Discussions
Discussions
Discussions
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
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".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2010 11:41 PM
01-06-2010 11:41 PM
Re: dld.sl: Bad magic number for shared library
make -d gives pages of output which so far has not given much insight but I will continue to search through the details.
Perl version:
$ file /usr/local/perl2exe/perl5/bin/perl5.10.0
/usr/local/perl2exe/perl5/bin/perl5.10.0: PA-RISC2.0 shared executable dynamically linked -not stripped
What is tusc, this is not installed on our system.
Are you available for remote support and able to assist us resolving this issue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2010 12:54 AM
01-07-2010 12:54 AM
Re: dld.sl: Bad magic number for shared library
>/usr/local/perl2exe/perl5/bin/perl5.10.0: PA-RISC2.0 shared executable dynamically linked -not stripped
This is 32 bit.
>What is tusc, this is not installed on our system.
You can download it from here:
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/tusc-7.10/
>Are you available for remote support
No.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2010 01:07 AM
01-07-2010 01:07 AM
Re: dld.sl: Bad magic number for shared library
>Perl version:
>/usr/local/perl2exe/perl5/bin/perl5.10.0: PA-RISC2.0 shared executable dynamically linked -not stripped
I thought PA-RISC1.1 was 32bit and PA-RISC2.0 is 64bit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2010 01:20 AM
01-07-2010 01:20 AM
Re: dld.sl: Bad magic number for shared library
Yes, 1.0 and 1.1 are 32 bit only.
>PA-RISC2.0 is 64bit.
It can be 32 or 64 bit.
This is 64 bit for PA (LP64):
ELF-64 shared object file - PA-RISC 2.0 (LP64)
For IPF it's much simpler:
ELF-32 executable object file - IA64
ELF-64 executable object file - IA64
>Thank you.
If you are happy with the answers you got, please read the following on how to assign points:
http://forums.itrc.hp.com/service/forums/helptips.do?#33
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2010 03:53 PM
01-07-2010 03:53 PM
Re: dld.sl: Bad magic number for shared library
Do I need to download the 32bit gcc compiler (HP-GCC 4.3.3 PA-RISC ILP32) or can I use the current 64bit compiler to compile the module with the 32bit perl?
What flags do I need to set to force the 64bit gcc compiler to compile for 32bit?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2010 11:29 PM
01-07-2010 11:29 PM
Re: dld.sl: Bad magic number for shared library
So the issues was that the Perl executable was 32bit and not 64bit.
Thanks Dennis!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2010 01:00 AM
01-08-2010 01:00 AM
Re: dld.sl: Bad magic number for shared library
For PA, the foreign devil compiler only has one data model. You have to install both to switch to the other model.
On Integrity, the models are similar, so there is -mlp64 and -milp32.
- Tags:
- foreign devil tools