PATCH: Support VER_FLG_INFO in readelf

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Tue Mar 2 20:54:00 GMT 2010


Ian Lance Taylor <iant@google.com> writes:

>> Nothing at the moment.  Unless someone can verify that executables with
>> the VER_FLG_INFO flag set continue to work ld-linux.so.2, I'm very
>> reluctant to add code to either gld or gold to set that flag, perhaps
>> unless targetting Solaris 2.
>
> That's fine, but let me rephrase.  What would you expect to cause that
> field to be true if it were the right thing to do on GNU/Linux?

Ok, I misunderstood.  The flag is set on versions the executable or
shared object depends upon, but which aren't the last in a dependency
chain.  E.g., on Solaris 11:

ro@manam 8332 > pvs -r /bin/ls
        libsec.so.1 (SUNW_1.2, SUNWprivate_1.1);
        libnvpair.so.1 (SUNW_1.2);
        libcmdutils.so.1 (SUNWprivate_1.1);
        libcurses.so.1 (SUNW_1.1);
        libc.so.1 (SUNW_1.23, SUNWprivate_1.1);
ro@manam 8333 > pvs -rv /bin/ls
        libsec.so.1 (SUNW_1.2, SUNWprivate_1.1);
        libnvpair.so.1 (SUNW_1.2, SUNW_1.1 [INFO]);
        libcmdutils.so.1 (SUNWprivate_1.1);
        libcurses.so.1 (SUNW_1.1);
        libc.so.1 (SUNW_1.23, SUNW_1.22 [INFO], SUNW_1.19 [INFO], SUNW_1.1 [INFO], SUNW_0.7 [INFO], SUNWprivate_1.1, SISCD_2.3 [INFO], SYSVABI_1.3 [INFO]);

There's a dependency chain from SYSVABI_1.3 all the way up to SUNW_1.23,
so the INFO flag is set on all versions in that chain but the last.  As
an optimization, ld.so.1 only needs to verify the presence of SUNW_1.23
in libc.so.1 and be done with it, since the chain guarantees that all
others are present as well.  SUNWprivate_1.1 is different, though: it
comprises all global exported symbols in libc that aren't public
interfaces, but e.g. are used by other system libraries.  It has no
relationship to SUNW_1.* etc. and is thus not flagged INFO.

Hope that clarifies it; I expect the Linker and Libraries Guide to be
updated with that information spelled out in the Object File-Format
chapter soon.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University



More information about the Binutils mailing list