public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* RE: Shared library question
@ 2002-07-19  1:36 Zagorodnev, Grigory
  0 siblings, 0 replies; 21+ messages in thread
From: Zagorodnev, Grigory @ 2002-07-19  1:36 UTC (permalink / raw)
  To: 'H. J. Lu'
  Cc: 'Jakub Jelinek', 'binutils@sources.redhat.com'

>Your Makefile is wrong.
Agree

>BTW, there was a bug in glibc, which would cause your problem. It was
Thanks!
It looks to be the right explanation of problem I see.
I'm using Red Hat 7.1 which, likely, does not include the glibc fix you
mentioned.

Grigory.

^ permalink raw reply	[flat|nested] 21+ messages in thread
* RE: Shared library question
@ 2002-07-18 10:46 Zagorodnev, Grigory
  2002-07-18 12:01 ` H. J. Lu
  0 siblings, 1 reply; 21+ messages in thread
From: Zagorodnev, Grigory @ 2002-07-18 10:46 UTC (permalink / raw)
  To: 'H. J. Lu'
  Cc: 'Jakub Jelinek', 'binutils@sources.redhat.com'

>> Actually I found the reason and made the fix for _my_particular_case. But
it
>> seems to be a linker bug. Should it be reflected in separate report or
not?
>
>Please provide a small testcase to show the bug. I will look into it.

Given test case reproduces the _desired_ situation: 'old' application is
still running, new - could not be built. You should see final 'PASSED'
message.

Now, if you uncomment marked line in the version.map file and run the test
again, you will see the failure: 'old' application is unable to run. 
And, of cource you will not see 'PASSED' message.

Note: just run make.

Grigory.


begin 600 libfoo.c
M(VEN8VQU9&4@/'-T9&EO+F@^"@H*(VEF(&1E9FEN960H($Q)0E]8("D*87-M
M*"(N<WEM=F5R(%]?<F5A;%]F;V\L(&9O;T!615)?,2XP(BD["@IV;VED(%]?
M<F5A;%]F;V\H*7L*(V5L<V4*=F]I9"!F;V\H*7L*(V5N9&EF"B`@("!P=71S
4*")F;V\@:7,@=&AE<F4B*3L*?0H=
`
end

begin 600 main.c
M(VEN8VQU9&4@/'-T9&EO+F@^"@IE>'1E<FX@=F]I9"!F;V\H*3L*"FEN="!M
B86EN*"E["B`@("!F;V\H*3L*("`@(')E='5R;B`P.PI]"@==
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`<FT@+68@82YO=70*
`
end

begin 600 version.map
M(R!5;F-O;6UE;G0@=&AI<R!L:6YE('1O('-E92!T:&4@9F%I;'5R90HC5D52
M7S`N.2![('T["@I615)?,2XP('L@9VQO8F%L.B!F;V\[(&QO8V%L.B`J.R!]
8.PH*5D527S$N,2![('T@5D527S$N,#L*
`
end

^ permalink raw reply	[flat|nested] 21+ messages in thread
* RE: Shared library question
@ 2002-07-18  7:55 Zagorodnev, Grigory
  2002-07-18  8:43 ` H. J. Lu
  0 siblings, 1 reply; 21+ messages in thread
From: Zagorodnev, Grigory @ 2002-07-18  7:55 UTC (permalink / raw)
  To: 'H. J. Lu'
  Cc: 'Jakub Jelinek', 'binutils@sources.redhat.com'

>> >If you'll do:
>> >VER_1.0 { global: foo; bar; baz; local: *; };
>> >VER_1.1 { } VER_1.0;
>> This solution works fine for small test-cases. But I have problems
running
>> huge real application. Same conditions, same library, same symbol
>> information in the application but ld.so does not resolve reference to
>> foo@VER_1.0.
>> 
>
>It should work. You need to provide more info.

There is the problem!
If you add line VER_0.9 {}; at the beginning of the linker script you will
se the error message:
	a.out: error while loading shared libraries: a.out: undefined
symbol: foo

Actually I found the reason and made the fix for _my_particular_case. But it
seems to be a linker bug. Should it be reflected in separate report or not?

Grigory.

^ permalink raw reply	[flat|nested] 21+ messages in thread
* RE: Shared library question
@ 2002-07-17  5:40 Zagorodnev, Grigory
  2002-07-17  7:58 ` H. J. Lu
  0 siblings, 1 reply; 21+ messages in thread
From: Zagorodnev, Grigory @ 2002-07-17  5:40 UTC (permalink / raw)
  To: 'Jakub Jelinek'
  Cc: 'H . J . Lu', 'binutils@sources.redhat.com'

>If you'll do:
>VER_1.0 { global: foo; bar; baz; local: *; };
>VER_1.1 { } VER_1.0;
>and .symver __real_foo, foo@VER_1.0
>then program/libs linked against non-versioned foo will resolve to
>foo@VER_1.0, while ld won't use foo.

Well...
This solution works fine for small test-cases. But I have problems running
huge real application. Same conditions, same library, same symbol
information in the application but ld.so does not resolve reference to
foo@VER_1.0.

Any assumptions on that?

Grigory.

^ permalink raw reply	[flat|nested] 21+ messages in thread
* RE: Shared library question
@ 2002-06-20  4:33 Zagorodnev, Grigory
  2002-06-20  4:40 ` Jakub Jelinek
  0 siblings, 1 reply; 21+ messages in thread
From: Zagorodnev, Grigory @ 2002-06-20  4:33 UTC (permalink / raw)
  To: 'Jakub Jelinek'
  Cc: 'H . J . Lu', 'binutils@sources.redhat.com'

>Of course there is, GCC inline assembly:

Ok! Fine. 
But I would like to see the solution without inline asm. 
Is there one?

Best regards,
Grigory.

^ permalink raw reply	[flat|nested] 21+ messages in thread
* RE: Shared library question
@ 2002-06-19 21:42 Zagorodnev, Grigory
  2002-06-20  0:05 ` Jakub Jelinek
  0 siblings, 1 reply; 21+ messages in thread
From: Zagorodnev, Grigory @ 2002-06-19 21:42 UTC (permalink / raw)
  To: 'Jakub Jelinek'
  Cc: 'H . J . Lu', 'binutils@sources.redhat.com'

>If you'll do:
>VER_1.0 { global: foo; bar; baz; local: *; };
>VER_1.1 { } VER_1.0;
>and .symver __real_foo, foo@VER_1.0

Thanks a lot!
I finally understood what is going on here. This approach does work fine.
The only one question remains:
	Is there C-language extension to define symbol version like above?

Thanks once again,
Grigory.

^ permalink raw reply	[flat|nested] 21+ messages in thread
* RE: Shared library question
@ 2002-06-19  7:55 Zagorodnev, Grigory
  0 siblings, 0 replies; 21+ messages in thread
From: Zagorodnev, Grigory @ 2002-06-19  7:55 UTC (permalink / raw)
  To: 'binutils@sources.redhat.com'

I feel that the solution is to filter-out symbol 'foo' from the library
interface at link-time. 

Is there a way to do that? Version script? Filtering library auxiliary
library? 
Remember that final application should has the same so-name in DT_NEEDED
record.

Grigory.

^ permalink raw reply	[flat|nested] 21+ messages in thread
* RE: Shared library question
@ 2002-06-19  7:45 Zagorodnev, Grigory
  2002-06-19  7:54 ` H . J . Lu
  2002-06-19  7:57 ` Jakub Jelinek
  0 siblings, 2 replies; 21+ messages in thread
From: Zagorodnev, Grigory @ 2002-06-19  7:45 UTC (permalink / raw)
  To: 'H . J . Lu'; +Cc: 'binutils@sources.redhat.com'

>It is very trivial. Just give "foo", a none-default version so that
>ld won't use it, but ld.so will.

Well... It's not so easy.

If I change the version of symbol 'foo', no previously biult application
will run, since they are referencing foo_with_no_version. But any next
application I link against new library could reference
foo_with_some_version, since it's not hided from the linking.

So I think it looks like "ld.so won't use it, but ld will".

But I'm looking for the solution of diametrically opposite task: old apps
still able to see symbol foo, new apps - not. 

Actually the goal of work I do is: remove symbol foo from the library but
keep backward compatibility. At the same time, the library name should stay
unchanged.

^ permalink raw reply	[flat|nested] 21+ messages in thread
* RE: Shared library question
@ 2002-06-19  7:22 Zagorodnev, Grigory
  2002-06-19  7:27 ` H . J . Lu
  0 siblings, 1 reply; 21+ messages in thread
From: Zagorodnev, Grigory @ 2002-06-19  7:22 UTC (permalink / raw)
  To: 'H . J . Lu'; +Cc: 'binutils@sources.redhat.com'

>You didn't say if you could rebuild the shared library from source.

Yes, I'm able to do that.

Grigory

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Shared library question
@ 2002-06-19  6:56 Zagorodnev, Grigory
  2002-06-19  7:08 ` H . J . Lu
  2002-06-19  7:29 ` Daniel Jacobowitz
  0 siblings, 2 replies; 21+ messages in thread
From: Zagorodnev, Grigory @ 2002-06-19  6:56 UTC (permalink / raw)
  To: 'binutils@sources.redhat.com'

There is a little question about...

I have a shared library contaning some symbol 'foo'. This symbol has no any
version defined.

Is there a way to keep symbol accessible at run-time but hide it at build
time? 
So any application previously built with (linked against) that library stay
workable but any new application will not see this symbol i.e. linker will
not resolve symbol foo from that library.

Changing library name is not applicable. Any tricks are wellcome!

Environment: x86, Red Hat Linux 7.2/7.3

Thanks and regards,
 Grigory Zagorodnev

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2002-07-19  5:44 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-19  1:36 Shared library question Zagorodnev, Grigory
  -- strict thread matches above, loose matches on Subject: below --
2002-07-18 10:46 Zagorodnev, Grigory
2002-07-18 12:01 ` H. J. Lu
2002-07-18  7:55 Zagorodnev, Grigory
2002-07-18  8:43 ` H. J. Lu
2002-07-17  5:40 Zagorodnev, Grigory
2002-07-17  7:58 ` H. J. Lu
2002-06-20  4:33 Zagorodnev, Grigory
2002-06-20  4:40 ` Jakub Jelinek
2002-06-19 21:42 Zagorodnev, Grigory
2002-06-20  0:05 ` Jakub Jelinek
2002-06-19  7:55 Zagorodnev, Grigory
2002-06-19  7:45 Zagorodnev, Grigory
2002-06-19  7:54 ` H . J . Lu
2002-06-19  7:57 ` Jakub Jelinek
2002-06-19  7:22 Zagorodnev, Grigory
2002-06-19  7:27 ` H . J . Lu
2002-06-19  6:56 Zagorodnev, Grigory
2002-06-19  7:08 ` H . J . Lu
2002-06-19  7:29 ` Daniel Jacobowitz
2002-06-19  7:39   ` H . J . Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).