Advertisement

01.23.2006 at 03:50AM PST, ID: 21706383
[x]
Attachment Details

Compiling and Linking AIX 64 bit shared libraries

Asked by martintrv in IBM AIX Unix

Tags: aix

This question is a follow on to:

http://www.experts-exchange.com/Operating_Systems/AIX_IBMs_UNIX_OS/Q_21703889.html

Using the same build script, I tried to modify it to created a 64 bit shared library that has libgcc.a statically linked to it.

Firstly, its my understanding that in AIX you cannot have a mixed library with 32 bit and 64 bit functions.

When I do a:

nm -Xd64 on the libgcc.a that is included, I get output, so I am making an assumption that I am including a 64 bit libgcc.a.

Here is my doit script (changed the name from buildit to doit, as it is quicker to tyoe, and sjm_ee uses that name, so how can I go wrong ? :-) )


OBJECT_MODE=64
export OBJECT_MODE
cc -maix64 -c share1.c
cc -maix64 -c share2.c

ld -lc -o shrsub.o share1.o share2.o -bE:shrsub.exp -bM:SRE -bnoentry  -bnoquiet

cc -maix64  -o main main.c shrsub.o -L.

./main




and the output:

(ld): setopt 64
(ld): halt 4
(ld): lrgpage 0
(ld): savename shrsub.o
(ld): filelist 3 2
(ld): setopt noprogram
(ld): noentry
NOENTRY: There is no entry point.
(ld): lib /usr/lib/libc.a
(ld): i share1.o
(ld): i share2.o
INSERT: Shared object libc.a[shr_64.o]: 2270 symbols imported.
INSERT: Shared object libc.a[aio_64.o]: 11 symbols imported.
INSERT: Shared object libc.a[pse_64.o]: 5 symbols imported.
INSERT: Shared object libc.a[dl_64.o]: 4 symbols imported.
INSERT: Shared object libc.a[pty_64.o]: 1 symbols imported.
FILELIST: Number of previously inserted files processed: 3
(ld): exports shrsub.exp
EXPORTS: Symbols exported: 10
(ld): resolve
ld: 0711-324 WARNING: Export of .func1 changed to export of func1
ld: 0711-324 WARNING: Export of .func2 changed to export of func2
ld: 0711-324 WARNING: Export of .func3 changed to export of func3
RESOLVE: 13 of 2669 symbols were kept.
RESOLVE: The return code is 4.
(ld): addgl /usr/lib/glink64.o
ADDGL: Glink code added for 1 symbols.
(ld): er full
ld: 0711-319 WARNING: Exported symbol not defined: _GLOBAL__F__Unwind_GetLanguageSpecificData
ld: 0711-319 WARNING: Exported symbol not defined: _GLOBAL__F___register_frame_info_bases
ld: 0711-319 WARNING: Exported symbol not defined: .__register_frame_info_table
ld: 0711-319 WARNING: Exported symbol not defined: .__deregister_frame_info
ER: The return code is 4.
(ld): mismatch
MISMATCH: No type mismatches exist.
(ld): comprld
COMPRLD: Kept 17 of 17 relocation entries.
(ld): origin 0x0 0x0
(ld): save SRE .
SAVE: Section sizes = 319+104+0 (0x13F+0x68+0x0 hex)
SAVE: Size of TOC: 32 (0x20 hex)
(ld): rc
RC: Highest return code was 4.
ld: 0711-317 ERROR: Undefined symbol: _GLOBAL__F__Unwind_GetLanguageSpecificData
ld: 0711-317 ERROR: Undefined symbol: _GLOBAL__F___register_frame_info_bases
ld: 0711-317 ERROR: Undefined symbol: .__register_frame_info_table
ld: 0711-317 ERROR: Undefined symbol: .__deregister_frame_info
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status
./doit: ./main: A file or directory in the path name does not exist.


------------------------------

Now even when I tried adding these symbols to my .exp, I still get the same result.

How do I get it to work?

AIX 5.1 64 Bit
GCC 3.0.1

MartyStart Free Trial
 
Loading Advertisement...
 
[+][-]01.23.2006 at 04:35AM PST, ID: 15765437

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.23.2006 at 04:53AM PST, ID: 15765548

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.24.2006 at 03:42AM PST, ID: 15774498

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: IBM AIX Unix
Tags: aix
Sign Up Now!
Solution Provided By: sjm_ee
Participating Experts: 1
Solution Grade: B
 
 
[+][-]01.26.2006 at 06:58AM PST, ID: 15795597

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32