Operating System - Linux
1748166 Members
3986 Online
108758 Solutions
New Discussion юеВ

Re: Having trouble with archive libraries in 64-bit 11.11 HP-UX

 
SOLVED
Go to solution
Sandman!
Honored Contributor

Re: Having trouble with archive libraries in 64-bit 11.11 HP-UX

Hi Connie,

Typically the mismatched ABI is related to mixing 32/64-bit modes in the same compilation. You checked all your .o (object files) but have you verified with elfdump that all the .a (archive libs) files that you're loading into your executable are indeed 64-bit.

cheers!
MTSU_SAN
Regular Advisor

Re: Having trouble with archive libraries in 64-bit 11.11 HP-UX

I never thought of that, because the table was built only from the object files listed, and that is the one being complained of that it cannot load the symbol table. Which option to elfdump tells you if it is a 64-bit archive library?
Dennis Handly
Acclaimed Contributor

Re: Having trouble with archive libraries in 64-bit 11.11 HP-UX

Looking at your archive indicates no symbol table at all. (elfdump -f -g)
Were you using -q to create or add to it?

My suggestion about using ar -rs doesn't seem to work.

You need to use ar -qs, or use ranlib(1) to fix your archive.
Kent Ostby
Honored Contributor

Re: Having trouble with archive libraries in 64-bit 11.11 HP-UX

This RCEN will give you the syntax you are looking for:

http://www1.itrc.hp.com/service/cki/search.do?category=c0&&mode=id&searchCrit=allwords&docType=EngineerNotes&searchString=TFKBRC00004691
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
MTSU_SAN
Regular Advisor

Re: Having trouble with archive libraries in 64-bit 11.11 HP-UX

Well, now I'm really confused, cause when I run elfdump it is fine...
elfdump -a liblutil.a

liblutil.a:

*** Archive Header ***

Date Uid Gid Mode Size Member Name

liblutil.a[base64.o]:
Mar 14 16:10 2006 105 201 304370 0x2070 base64.o

liblutil.a[csn.o]:
Mar 14 16:10 2006 105 201 304370 0xb78 csn.o

liblutil.a[entropy.o]:
Mar 14 16:10 2006 105 201 304370 0xaf0 entropy.o

liblutil.a[sasl.o]:
Mar 14 16:10 2006 105 201 304370 0x588 sasl.o

liblutil.a[signal.o]:
Mar 14 16:10 2006 105 201 304370 0x838 signal.o



etc..

and
elfdump -f -g liblutil.a
liblutil.a:

liblutil.a[base64.o]:

*** ELF Header ***

Class: ELF-64
Data: Big-endian
OS: HP-UX
ABI Version: 1
Type: REL
Machine: PA-RISC
Version: 1
Entry Addr: 0x0
Program Hdr Offset: 0x0
Section Hdr Offset: 0x1c30
Flags: Wide-mode
Flags: PA2.0
Elf Hdr Size: 0x40
Program Hdr Size: 0x38
Program Hdr Number: 0
Section Hdr Size: 0x40
Section Hdr Number: 17
Section Hdr String Idx: 16

liblutil.a[csn.o]:
... etc...

So, why when you looked at it was it not?
c*
Dennis Handly
Acclaimed Contributor

Re: Having trouble with archive libraries in 64-bit 11.11 HP-UX

>now I'm really confused, cause when I run elfdump it is fine...

Basically you are seeing the -a and -f output which is useless for ld. You need to look for the -g output. Use ranlib and you'll see the extra global symbol table.
MTSU_SAN
Regular Advisor

Re: Having trouble with archive libraries in 64-bit 11.11 HP-UX

I just ran elfdump -g liblutil.a on the file before and after running ranlib, and I get the same output (none!)
frank3 /usr/local4/openldap-2.3.19/libraries/liblutil $ elfdump -g liblutil.a

liblutil.a:
Dennis Handly
Acclaimed Contributor

Re: Having trouble with archive libraries in 64-bit 11.11 HP-UX

>I just ran elfdump -g liblutil.a on the file before and after running ranlib, and I get the same output (none!)

I get -g output on your test .a whether I use /usr/ccs/bin/ranlib or /usr/ccs/bin/ar -qs.
MTSU_SAN
Regular Advisor

Re: Having trouble with archive libraries in 64-bit 11.11 HP-UX

Different than just the name of the archive file, like I posted?
Dennis Handly
Acclaimed Contributor
Solution

Re: Having trouble with archive libraries in 64-bit 11.11 HP-UX

>Different than just the name of the archive file, like I posted?

Yes, massive amounts of output:
copy.a:
*** Archive Symbol Table ***
1618 lutil_b64_ntop
...