- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- invalid magic number using shared lib, explanation...
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
07-24-2003 02:04 AM
07-24-2003 02:04 AM
invalid magic number using shared lib, explanations please
I'm using cc in hp-ux 11.11 to build a shared library lib1.sl. that works well.
Then I still use cc to build another library lib2.sl, including lib1. I get an error:
/usr/ccs/bin/ld: /home/dev/resources/lib1.sl: Not a valid object file (invalid magic number)
What does that mean exactly?
What compilation options should I use on CC to correctly build the first library?
Thanks for all answers.
Florent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 02:13 AM
07-24-2003 02:13 AM
Re: invalid magic number using shared lib, explanations please
If you want them to be two separate libraries, then dont include lib1.sl in the command to compile/link the program - you will have to explicitly attach the 2nd shared library in your program, as well as the first.
If you want the two libraries in one .sl then cc -c lib1.c (creates an object file lib1.o) and then cc -b lib2.c lib1.o -o lib-both.sl
.sl files are not the same as .o files.
I hope I understood the question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 02:21 AM
07-24-2003 02:21 AM
Re: invalid magic number using shared lib, explanations please
But what does "invalid magic number" means?
Thanks.
Florent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 02:24 AM
07-24-2003 02:24 AM
Re: invalid magic number using shared lib, explanations please
It lets me cc -o testprog test.c test2.sl
But using nm on the file testprog doesn't show me the functions in test2.sl.
It seems to me that maybe your lib1.sl was built on another architecture. Were they both compiled on the same machine, with the same options (CCOPTS/LDOPTS) and +DA..?
You could try compiling everything using +DA_PORTABLE but that wouldn't be the most efficient way through.
Use chatr on both object files to see what they are.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 02:30 AM
07-24-2003 02:30 AM
Re: invalid magic number using shared lib, explanations please
Essentially the magic number defines how a program is loaded in memory and whether it is kept there for others to use (i.e. same code, different data for different processes).
Maybe one was exec magic and the other share-magic or demand-loaded or something, where the two are incompatible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2003 03:47 AM
07-29-2003 03:47 AM
Re: invalid magic number using shared lib, explanations please
lib1.sl: PA-RISC2.0 shared executable
you should use the '-b' option of cc to build the first and the second libraries:
1. cc -b 1.c -o lib1.sl
2. cc -b 2.c ./lib1.sl -o lib2.sl
(or)
cc -b 2.c -L. -l1 -o lib2.sl
--
ranga