Operating System - HP-UX
1832305 Members
2002 Online
110041 Solutions
New Discussion

Mismatched ABI(not an ELF file ) for /usr/lib/libsec.sl

 
Charlie123
Frequent Advisor

Mismatched ABI(not an ELF file ) for /usr/lib/libsec.sl

Hi experts,
I have an old program to call "setpwent" etc, it worked fine. I was told to port this to Trusted System of HP UX. So I changed setpwent to "setprpwent". In the same old machine I got this build error:
-------------------------------------------
ld: Mismatched ABI (not an ELF file) for /usr/lib/libsec.sl
Fatal error.
*** Error exit code 1
---------------------------
My OS:
awagshpi [/users/charliex/lib/utils/src] uname -a
HP-UX awagshpi B.11.23 U ia64 0947177310 unlimited-user license
-----------------------
Can you teach me how to fix it?
Thanks a lot.
Charlie
6 REPLIES 6
whiteknight
Honored Contributor

Re: Mismatched ABI(not an ELF file ) for /usr/lib/libsec.sl

Charlie,

it may not work because the program is running on 32bit and you are on ia-64 bit now.

WK

Problem never ends, you must know how to fix it
Charlie123
Frequent Advisor

Re: Mismatched ABI(not an ELF file ) for /usr/lib/libsec.sl

Thank you for reply. My code snippet is:
--------------------------
if( !trusted )
setpwent();
else
setprpwent();
--------------------------
Do you mean this is logically wrong? From the uname command, it seemed to be a 64 bit machine. Do you mean setpwent is a 32 bit function, setprpwent is a 64 bit function?
James R. Ferguson
Acclaimed Contributor

Re: Mismatched ABI(not an ELF file ) for /usr/lib/libsec.sl

Hi Charlie:

This is a linker error ('ld'). You are attempting to mix 32-bit and 64-bit objects and/or shared libraries. This isn't allowed; everything must be of the same bitness. The linker uses the first object in the list to determine whether is will assume 32-bit or 64-bit.

On Itanium systems, 32-bit libraries live in '/usr/lib/hpux32' and 64-bit ones in /usr/lib/hpux64'. The '.so' suffix is used in stead of the 'sl' one on PA-RISC.

Regards!

...JRF...
Charlie123
Frequent Advisor

Re: Mismatched ABI(not an ELF file ) for /usr/lib/libsec.sl

Thanks for reply, James.
1: Is setpwent a 32 bit function, and setprpwent a 64 bit function?
2: This link oponent: /usr/lib/libsec.sl wasn't in the Makefile in the first place. After I used setprpwent, I added it into Makefile, and got the error mentioned before. However, after I removed this oponent, replaced with -lsec( got "man setprpwent" ), the code snippet above got compiled/linked properly, without any error message. Why?
3: All my builds ( before & after I applied setprpwent ) were in the same machine. And I couldn't find a library named "libsec", what does -lsec mean in this case?
Please answer,
Thanks a lot.
Charlie
Venkatesh BL
Honored Contributor

Re: Mismatched ABI(not an ELF file ) for /usr/lib/libsec.sl

I think the mismatch here is that your application is compiled on itanium, but is referring to a PA-RISC library - which is not allowed.

# file /usr/lib/libsec.sl
/usr/lib/libsec.sl: PA-RISC1.1 shared library -not stripped <<<

So, you could try changing the library path such that it searches for the library in the hpux32 directory instead.

# file /usr/lib/hpux32/libsec.so
/usr/lib/hpux32/libsec.so: ELF-32 shared object file - IA64 <<<
Dennis Handly
Acclaimed Contributor

Re: Mismatched ABI(not an ELF file ) for /usr/lib/libsec.sl

>2: This link: /usr/lib/libsec.sl wasn't in the Makefile in the first place.

As Venkatesh says, this isn't a valid lib for IPF. /usr/lib is for PA only.

>replaced with -lsec, the code snippet above got compiled/linked properly, without any error message. Why?

Because the default shlib path is /usr/lib/hpux32.

>3: And I couldn't find a library named "libsec", what does -lsec mean in this case?

-lsec means look for: libsec.a, libsec.so or libsec.sl.