This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


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

Re: A patch to add --with-oldest-abi=ABI. [Re: A patch to add --disable-old-version.]


"H . J . Lu" <hjl@valinux.com> writes:

> It indicates that res_init is obsoleted by GLIBC_2.2.
> 
> # objdump --dynamic-sym libc.so.6 | grep res_init
> 000eaad0 g    DF .text  00000078  GLIBC_2.2   __res_init
> 
> res_init is gone with --with-oldest-abi=2.2.

Yes, exactly.  And with the normal libc you can still use it.  It's
not that simple.  Either res_init is prevented from being used in
liking or it must be always available.

> This a.out was compiled on glibc 2.0.
> 
> # objdump --dynamic-sym a.out| grep GLIBC
> 08048324  w   DF *UND*  00000074  GLIBC_2.0   __register_frame_info
> 08048334      DF *UND*  00000024  GLIBC_2.0   fprintf
> 08048344  w   DF *UND*  000000a2  GLIBC_2.0   __deregister_frame_info
> 08048354      DF *UND*  000000ed  GLIBC_2.0   fclose
> 08048364      DF *UND*  0000006e  GLIBC_2.0   fopen
> 08048374      DF *UND*  00000105  GLIBC_2.0   __libc_start_main
> # /work/build/gnu/bin/glibc-current/elf/ld-linux.so.2 --library-path /work/build/gnu/bin/glibc-current ./a.out
> ./a.out: error while loading shared libraries: ./a.out: symbol fopen, version GLIBC_2.0 not defined in file libc.so.6 with link time reference

This works if there is versioning information but not if there isn't.
In the latter case the oldest interface is taken.  But if that is gone
the only existing interface is used and this is wrong and dangerous.
This is mainly important for binaries linked against glibc 2.0 but I'm
not sure there isn't a problem elsewhere.

Again, just another case where the consequences haven't been
completely investigated.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

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