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.]


On Sat, Dec 02, 2000 at 09:50:02AM -0800, Ulrich Drepper wrote:
> "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.

I can do that. Please take a pick:

1. res_init is not used for linking. Or
2. res_init is always available.

I prefer 1.

> 
> > 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.
> 

I don't think it is really a problem. If we really want, we can
disallow the unversioned reference in ld.so with --with-oldest-abi=ABI.
I may be able to provide such a patch.

-- 
H.J. Lu (hjl@valinux.com)

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