Operating System - HP-UX
1757942 Members
3194 Online
108866 Solutions
New Discussion юеВ

Having trouble with archive libraries on HP-UX Machine

 
SOLVED
Go to solution
ShivS
Frequent Advisor

Having trouble with archive libraries on HP-UX Machine

Hi,

Following are the details of the HP UX machine where I am trying to build my executables:

uname -a
HP-UX ocpdev1 B.11.11 U 9000/800 ocpdev1 unlimited-user license

All the library files (.a files) are compiled using ar -r command and I dont see any error during building the archive file.

But while compiling executable, I get, for example, the following error:

ld: (Warning) Cannot load library symbol table in /tfsw/ocp/src/baseline/util/libOcpUtil.a, it might be missing or corrupted. Skipping library /tfsw/ocp/src/
baseline/util/libOcpUtil.a.

Running some tools on libOcpUtil.a:
file libOcpUtil.a
libOcpUtil.a: archive file

file *.o
bsearch.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)
fmlUtil.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)
lookup.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)
ocpCompressStr.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)
ocpGetMonthEndDate.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)
ocpParams.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)
oracleConnect.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)
oracleQueries.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)
qsort.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)
regionalInfo.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)
sh_manage.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)
tableAccess.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)
tableAccessInitException.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)
tableClasses.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)
tableConfigHandler.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)
tableConfigReader.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)
tableName.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)
xmlOutput.o: ELF-64 relocatable object file - PA-RISC 2.0 (LP64)

(Listing partial output of elfdump below)
elfdump -f -g libOcpUtil.a

libOcpUtil.a:

libOcpUtil.a[bsearch.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: 0x1de58
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: 342
Section Hdr String Idx: 341


Can somebody please let me know where things are going wrong.

Thanks
5 REPLIES 5
Dennis Handly
Acclaimed Contributor

Re: Having trouble with archive libraries on HP-UX Machine

>Can somebody please let me know where things are going wrong?

What does "whence ar" show?
Make sure you aren't using a foreign devil version of ar(1).

It doesn't appear that you have a symbol table in your archive.
ShivS
Frequent Advisor

Re: Having trouble with archive libraries on HP-UX Machine

Hi Dennis,

$ whence ar
/usr/local/bin/ar

$ objdump -D libOcpUtil.a
In archive libOcpUtil.a:
objdump: bsearch.o: File format not recognized
objdump: fmlUtil.o: File format not recognized
objdump: lookup.o: File format not recognized
objdump: ocpParams.o: File format not recognized
objdump: oracleConnect.o: File format not recognized
objdump: oracleQueries.o: File format not recognized
objdump: qsort.o: File format not recognized
objdump: tableAccess.o: File format not recognized
objdump: tableAccessInitException.o: File format not recognized
objdump: tableConfigHandler.o: File format not recognized
objdump: tableConfigReader.o: File format not recognized
objdump: tableName.o: File format not recognized
objdump: tableClasses.o: File format not recognized
objdump: xmlOutput.o: File format not recognized
objdump: sh_manage.o: File format not recognized
objdump: regionalInfo.o: File format not recognized
objdump: ocpGetMonthEndDate.o: File format not recognized
objdump: ocpCompressStr.o: File format not recognized


$ nm libOcpUtil.a
nm: bsearch.o: File format not recognized
nm: fmlUtil.o: File format not recognized
nm: lookup.o: File format not recognized
nm: ocpParams.o: File format not recognized
nm: oracleConnect.o: File format not recognized
nm: oracleQueries.o: File format not recognized
nm: qsort.o: File format not recognized
nm: tableAccess.o: File format not recognized
nm: tableAccessInitException.o: File format not recognized
nm: tableConfigHandler.o: File format not recognized
nm: tableConfigReader.o: File format not recognized
nm: tableName.o: File format not recognized
nm: tableClasses.o: File format not recognized
nm: xmlOutput.o: File format not recognized
nm: sh_manage.o: File format not recognized
nm: regionalInfo.o: File format not recognized
nm: ocpGetMonthEndDate.o: File format not recognized
nm: ocpCompressStr.o: File format not recognized

nm++ gives me a hugh output (showing partial output below)
$ nm++ libOcpUtil.a


Symbols from libOcpUtil.a[bsearch.o]:

[Index] Value Size Type Bind O Shndx Name

[0] | 0| 0|NOTYP|LOCAL|0| UNDEF|
[59] | 0| 0|MILLI|GLOB |0| UNDEF|$$mulI
[29] | 0| 8|OBJT |LOCAL|0|$AUX_ACTION$|$AUX_ACTION$logic_error::~logic_error()
[51] | 0| 8|OBJT |LOCAL|0|$AUX_ACTION$|$AUX_ACTION$range_error::~range_error()
[34] | 0| 8|OBJT |LOCAL|0|$AUX_ACTION$|$AUX_ACTION$domain_error::~domain_error()
[40] | 0| 8|OBJT |LOCAL|0|$AUX_ACTION$|$AUX_ACTION$length_error::~length_error()
[43] | 0| 8|OBJT |LOCAL|0|$AUX_ACTION$|$AUX_ACTION$out_of_range::~out_of_range()
[19] | 0| 8|OBJT |LOCAL|0|$AUX_ACTION$|$AUX_ACTION$bad_exception::~bad_exception()
[46] | 0| 8|OBJT |LOCAL|0|$AUX_ACTION$|$AUX_ACTION$runtime_error::~runtime_error()
[54] | 0| 8|OBJT |LOCAL|0|$AUX_ACTION$|$AUX_ACTION$overflow_error::~overflow_error()
[37] | 0| 8|OBJT |LOCAL|0|$AUX_ACTION$|$AUX_ACTION$invalid_argument::~invalid_argument()
[24] | 0| 8|OBJT |LOCAL|0|$AUX_ACTION$|$AUX_ACTION$bad_alloc::~bad_alloc()


Please let me know if you need any more information.

Thanks for your help.


Dennis Handly
Acclaimed Contributor
Solution

Re: Having trouble with archive libraries on HP-UX Machine

>/usr/local/bin/ar
>Please let me know if you need any more information.

(No, that was enough. :-)

You need to remove this bogus ar(1) from your system. Only use /usr/bin/ar (or /usr/ccs/bin/ar).

You can repair the archive with:
/usr/ccs/bin/ar -rs libOcpUtil.a
ShivS
Frequent Advisor

Re: Having trouble with archive libraries on HP-UX Machine

Hi Dennis,

Thanks for your help. /usr/bin/ar has solved the problem.

Thanks again!
ShivS
Frequent Advisor

Re: Having trouble with archive libraries on HP-UX Machine

I used suggestion from Dennis on using /usr/bin/ar and this helped in solving the problem.