PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

How to change the function name when export it to SO

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
linzhr



Joined: 09 Dec 2004
Posts: 2

PostPosted: Thu Dec 09, 2004 7:23 pm    Post subject: How to change the function name when export it to SO Reply with quote

How to change the function name when export it to a shared object file under LINUX operation system. I used CVF to compile my code before, and I can use
" !DEC$ ATTRIBUTES DLLEXPORT, ALIAS: 'newfuncname' :: funcname " to change the export symbol. Could you tell me how to do such things using pgf90 under LINUX?
Thanks very much.
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 5871
Location: The Portland Group Inc.

PostPosted: Fri Dec 10, 2004 4:43 pm    Post subject: Reply with quote

Perhaps another user might have a better answer but I believe the linker (ld) achieves this functionality using "weak" references. Unfortunately I don't feel I can explain weak references well enough, but if you don't mind doing some research, I do believe this is the right direction.

In C the weak pragma:
Code:
#pragma weak newfunc = func
indicates to the linker that newfunc is a weak reference to func. There is no coresponding Fortran directive so you'd need to create an assembly file using the "-S" flag, add your ".weak" labels, and then continue by linking the assembly file.

- Mat
Back to top
View user's profile
linzhr



Joined: 09 Dec 2004
Posts: 2

PostPosted: Sat Dec 11, 2004 8:46 am    Post subject: Reply with quote

Thanks alot.
I'll try it following your way.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group