| View previous topic :: View next topic |
| Author |
Message |
linzhr
Joined: 09 Dec 2004 Posts: 2
|
Posted: Thu Dec 09, 2004 7:23 pm Post subject: How to change the function name when export it to SO |
|
|
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 |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Fri Dec 10, 2004 4:43 pm Post subject: |
|
|
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 |
|
 |
linzhr
Joined: 09 Dec 2004 Posts: 2
|
Posted: Sat Dec 11, 2004 8:46 am Post subject: |
|
|
Thanks alot.
I'll try it following your way. |
|
| Back to top |
|
 |
|