PL/SQL-AIX-C Shared Library-0509-103 The module has an invalid magic number
Hi,
I'm wrting this message to ask for your help and advice with a PL/SQL and AIX isusse I'm incountering withim my environment,
I create a shared library with the following commands on IBM AIX5L:
1).- Shared Library compilation and creation with "ar" command:
gcc -c \
validatoken.c \
-o validatoken.o \
-D_64BIT -I/opt/vasco/VACMAN_Controller-3.7/include \
-maix64 -L/opt/vas co/VACMAN_Controller-3.7/lib \
-laal2sdk \
-G
ar rv libvalidatoken.a validatoken.o
2).- Library was tested agains a test program compiled with the following commands:
gcc cteAut.c \
-D_64BIT \
-o cteAut \
-I/opt/vasco/VACMAN_Controller-3.7/include \
-maix64 \
-L. -lvalidatoken \
Program name cteAut run OK, no problems how so ever.
3).- Shared Library is called within a Oracle 10g triger with PL/SQL as follows:
4).- Oracle 10G generates the following error:
ORA-06520: PL/SQL: Error loading external library
ORA-06522: 0509-022 Cannot load module /xxxx/xxx/libxxx.a.
0509-103 The module has an invalid magic number
The same Shared Libraries can be accessed from a 'C' test program.
Solution Description
--------------------
The problem lies with the format of the Library(shared library/dynamically
linked or archive/statically linked) or the commands used to create
the library. Recreating the Library resolves the issue.
Explanation
-----------
The Magic Number for a file is an indicator of the File Type/Format
and this information is stored in /etc/magic.
The /etc/magic file specifies what magic numbers are to be tested for,
what message to print if a particular magic number is found, and additional
information to extract from the file. When a file is being read a test on,
whether the file begins with a certain magic number is done(This identifies
the file type).
/etc/magic has entries likeā¦
#>20 long 1 Version 1
#>36 long 1 MAU Required
257 string ustar USTAR tar archive
0 short 070701 cpio archive
0 string 070701 ASCII cpio archive
0 short 070702 cpio archive - CRC header
It seems that the 64 bit compilation is not compatible with the PL/SQL program
which may be using a 32 bit version.
How do I define to PL/SQL to use 64 bit mode instead of 32 bits mode on AIX?
Any idea or hint to help solve this error will be greatly welcome.
Regards.
Edgar Alejandro Villegas
Villegas.Edgar@Yahoo.com