Node and Host Name Sizes on HP-UX: Using the Expanded Capabilities of HP-UX

28
FLV for Data Definitions and Data Types
Interfaces can be both data structures and functions. A data structure can be defined and exported
by one object and referenced (imported) by another.
The version attribute can be applied to data and types as well as to functions. Here are a few
examples:
struct __attribute__((version_id(“rev2”))) eventinfo { <fields> … };
extern struct __attribute__((version_id(“rev2”))) logparams
logparmeters;
int logstatus __attribute__((version_id(“rev2”)));
typedef long logflags_t __attribute__((version_id(“rev2”)));
The following is a cleaner way to code this:
#define REV2 __attribute__((version_id(“rev2”)))
struct REV2 eventinfo { <fields> … };
extern struct REV2 logparams logparmeters;
int logstatus REV2;
typedef long logflags_t REV2;
An object file generated from a program source containing the preceding declarations would exhibit
the following binary names in its symbol table:
logstatus{rev2}
logparams{rev2}
log.
o (original
version)
- source file specifies no
version_id attribute
- object symbol table
exports “logevent()”
- source file specifies
“rev2” version_id
attribute
- object symbol table
exports
“logevent{rev2}()”
c
lient
A
.o
- source file specifies no
version_id attribute
- object symbol table
references “logevent()”
c
lientB.o
- source file specifies
“rev2” version_id
attribute
- object symbol table
references
“logevent{rev2}()
Figure D
-
1: Legal link binding with version tags