This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

version scripts...


I am trying to find out whether this is a feature or bug...

I am building a shared library. I want to avoid making everything global,
so I created a version script with 2 nodes (VERS1.0 and VERS1.1).

- with the first version script, "funca" & "funcb" are global, with "fun*"
local.
- the second version script, "funca" & "funcb" are still global, with "*"
and "fun*" local.

* what I found is that with the first script, only "funca" is global. With
the second one, "funca" and "funcb" are global(which is what I expected).

I've copied & pasted my version scripts and the output of nm.

My machine is SLES9:
> ld -v
GNU ld version 2.15.90.0.1.1 20040303 (SuSE Linux)

TIA,
Rayson


> cat lib.c
funca() {}
funcb() {}
funcc() {}
funcd() {}

> cat elist
VERS1.0 {
 global:
        funca;
 local:
        fun*;
};

VERS1.1 {
 global:
        funcb;
 local:
        fun*;
};

> gcc -shared -Wl,--version-script -Wl,elist lib.c
> nm a.out | g func
000018c4 T funca
000018e4 t funcb
00001904 t funcc
00001924 t funcd

=========================================================================

> cat elist
VERS1.0 {
 global:
        funca;
 local:
        *;
};

VERS1.1 {
 global:
        funcb;
 local:
        fun*;
};

> gcc -shared -Wl,--version-script -Wl,elist lib.c
> nm a.out | g func
000007a8 T funca
000007c8 T funcb
000007e8 t funcc
00000808 t funcd
---------------------------------------------------------
Get your FREE E-mail account at http://www.eseenet.com !


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]