- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Hp-ux ld linker option for shared library versioni...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-12-2009 10:59 PM
тАО05-12-2009 10:59 PM
The necessary symbols of a shared library can be exported to the application using linker option --version-script in Linux. The same can be done in Hp-ux using ld linker option +e. This can also be done by listing all the global symbols with +e in a file with linker option ld -c filename in hp-ux.
I use an export file listing all global symbols with "+e" in my shared library.
I have to add a new interface in my shared library without any compatibility issues. In Linux, there is an option to specify version nodes in the version-script file as:
VERS_1.1 {
global:
foo1;
old*;
};
VERS_1.2 {
foo2;
new*;
} VERS_1.1;
Is there any similar option in hp where I can add new interfaces using library versioning without any compatibility issues?
Any help in this regard is greatly appreciated.
Thanks,
Roopa
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2009 12:03 AM
тАО05-13-2009 12:03 AM
Re: Hp-ux ld linker option for shared library versioning
The use of +e hides ALL other symbols in the shlibs. It isn't supported to use +e for aC++.
>I have to add a new interface in my shared library without any compatibility issues.
If you are adding new functions, you just add them, no need to version at all.
If you are changing existing functions, this doesn't meet forward compatibility criteria.
To have multiple shlib versions, you create multiple shlibs:
ld -b -o libfoo.so.1 +h libfoo.so.1 ...
ld -b -o libfoo.so.2 +h libfoo.so.2 ...
Then you create a symlink to the latest:
ln -s libfoo.so.2 libfoo.so
That way when an application is linked to libfoo.so, it remembers it was linked with libfoo.so.2. Existing applications still use libfoo.so.1.
http://docs.hp.com/en/14640/OnlineHelp/creatingandusinglibraries.htm#S-LIBLEVEL-VERS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2009 01:02 AM
тАО05-13-2009 01:02 AM
Re: Hp-ux ld linker option for shared library versioning
I'm only concerned about the scenario if a shared library is out of date and a required interface may be missing; when the application tries to use that interface, it may suddenly and unexpectedly fail.
Thanks,
Roopa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2009 06:21 PM
тАО05-13-2009 06:21 PM
SolutionPutting this type of check in your application may be more trouble than it is worth. It would lead to multiple copies of the shlib.
If you link your application with "-Wl,-B,immediate" you will get an error at startup. But you will get a delay.
It may be better to have an installation checking script, so you pay the cost once.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2009 08:41 PM
тАО05-13-2009 08:41 PM
Re: Hp-ux ld linker option for shared library versioning
Regards,
Roopa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2009 09:29 PM
тАО05-13-2009 09:29 PM
Re: Hp-ux ld linker option for shared library versioning
symbol versioning is also available through the hp c/c++ compilers:
$ cat 2.c
void foo () __attribute__((version_id(VERSION))) {}
$ cc -b 2.c -o lib1.so +DD64 -DVERSION=\"11.00\"
$ elfdump -t lib1.so | grep foo
5 FUNC GLOB 0 0x8 ... 28 foo{11.00}
24 FUNC GLOB 0 0x8 ... 28 foo{11.00}
the version information can be specified only through code, as shown above, through the compiler. it cannot be done post-compile, at the link phase.
--
ranga
[i work for hpe]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2009 09:31 PM
тАО05-13-2009 09:31 PM
Re: Hp-ux ld linker option for shared library versioning
--
ranga
[i work for hpe]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-13-2009 09:47 PM
тАО05-13-2009 09:47 PM
Re: Hp-ux ld linker option for shared library versioning
If you are happy with the answers you were given, please read the following about assigning points:
http://forums.itrc.hp.com/service/forums/helptips.do?#33
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2009 01:26 AM
тАО05-14-2009 01:26 AM
Re: Hp-ux ld linker option for shared library versioning
You are right. I got confused between versioning of shared library and symbol version.
I already have versioning done for the shared library. Introducing a new interface will not have any compatibility issues. The installation check script in the application would solve my problem.
Thanks,
Roopa