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]

Re: Version script help needed


On Mon, Aug 05, 2002 at 04:11:56PM +0200, Franz Sirl wrote:
> At 22:00 03.08.2002, H. J. Lu wrote:
> >On Sat, Aug 03, 2002 at 07:04:18PM +0200, Franz Sirl wrote:
> > > On Samstag, 3. August 2002 18:33, H. J. Lu wrote:
> > > > On Sat, Aug 03, 2002 at 05:57:37PM +0200, Franz Sirl wrote:
> > > > > One thing makes me wonder though, if I use .symver and a version 
> > script,
> > > > > why are versioned symbols matched? E. if I use .symver and the 
> > following
> > > > > version script
> > > > >
> > > > > VEROLD {
> > > > >      local:
> > > > >      *;
> > > > > };
> > > > >
> > > > > VERNEW {
> > > > >      local:
> > > > >      *;
> > > > > } VEROLD;
> > > > >
> > > > > divdi3@VEROLD and divdi3@@VERNEW will be changed from GLOBAL scope to
> > > > > LOCAL scope. On the other side version scripts prevent me from from 
> > using
> > > > > versioned symbols in there? Is this the right behaviour?
> > > >
> > > > I don't see there is a problem.
> > >
> > > Hmm, I seem to miss the logic then. If you don't strip mylibgcc2.so, 
> > you'll
> > > see:
> > >
> > > [fsirl@enzo:~/test-versioning]$ readelf -a mylibgcc2.so|grep divdi3
> > >     31: 00000708    36 FUNC    GLOBAL DEFAULT    9 divdi3@@VERNEW
> > >     69: 00000000     0 FILE    LOCAL  DEFAULT  ABS divdi3-old.c
> > >     70: 00000000     0 FILE    LOCAL  DEFAULT  ABS divdi3-new.c
> > >     78: 000006e4    36 FUNC    LOCAL  DEFAULT    9 divdi3@VEROLD
> > >    190: 000006e4    36 FUNC    LOCAL  DEFAULT    9 divdi3_old
> > >    200: 00000708    36 FUNC    GLOBAL DEFAULT    9 divdi3
> > >
> > > So divdi3 got versioned as VEROLD, but it wasn't globalized. On the 
> > other hand
> > > if I mention divdi3 under VEROLD too in the script (and you can't directly
> > > list divdi3@VEROLD in there), I don't get divdi3 at VERNEW, even though 
> > it is
> > > mentioned there.
> > >
> > > I guess what I'm trying to say, why isn't the symbol matching in version
> > > scripts limited to unversioned symbols and symbols matching the current
> > > version node for a particular version node?
> >
> >I can't guess what you really want. Why not tell us what you want in
> >the resulting DSO?
> 
> I still want the same as in my first mail in the DSO:
> 
>      31: 00000708    36 FUNC    GLOBAL DEFAULT    9 divdi3@@VERNEW
>      78: 000006e4    36 FUNC    GLOBAL DEFAULT    9 divdi3@VEROLD
> 
> And I wanted to accomplish that without having an explicit .symver for the 
> VERNEW symbol version.
> 
> I think I just don't understand how the symbol matching in a version script 
> works. With this script:
> 
> VEROLD {
>          global:
>            divdi3;
> };
> 
> VERNEW {
>          global:
>            divdi3;
>          local:
>            *;
> } VEROLD;
> 

Here is a patch to do that. However, I am sure if it is %100 correct.
Any comments with testcases?


H.J.

Attachment: bfd-version-def.patch
Description: Text document


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