This is the mail archive of the libc-hacker@sourceware.cygnus.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: gcc -static and glibc 2.0/2.1


> 1. We make a libcompat-2.0.a which has the old libio symbols with
> version, like fopen@GLIBC_2.0.

Might as well put them in libc.a; they will only be linked in by old .o's,
and passed over for newer binaries.  Then you don't have know where your
binaries came from and change your linking command accordingly--after
versionifying the old libraries, just the versioned symbols in the binaries
will be enough information.

> 2. I have a patch for objcopy which is supposed to be able to rename
> the symbols in the .o files. We run objcopy on the static library
> compiled against glibc 2.0. For those symbols whose ABIs changed in
> 2.1, we append @GLIBC_2.0 at the end.

I think we should provide an option to objcopy or ld (or another tool) that
does the equivalent of ld's behavior when handling old shared library
binaries with unversioned symbols.  What I have in mind is:

	objcopy foo.a versioned-foo.a --version-scan=libc.a

This would search libc.a like ld would, for every unversioned symbol used
in foo.a--but solely for the purpose of ascertaining the version tag that
libc.a uses for that symbol.  The resultant versioned-foo.a would use
versioned symbols for every versioned symbol defined in libc.a.  When other
packages install some libfoo.a, they can do this to version-mark the
installed libfoo.a with what ABIs it was compiled against; this is a step
corresponding to linking the shared library with dependencies on other
shared libraries (using --version-scan=libfoo.a in place of each -lfoo).


Another useful tool would be a way to apply a version script to a .a (or .o).
e.g.

	objcopy libc.a versioned-libc.a --version-script=libc.map

This would produce a versioned-libc.a archive where the symbols in each .o
are versioned.  Then using this archive for --version-scan to version-mark
another library indicates the ABI of this libc.a, which that library
expects to be linked against.

We can provide a special file libc-2.0.a to be used in --version-scan that
marks all the libc symbols with GLIBC_2.0; this can be used to version-mark
old .a's compiled against the pre-versioning libc.



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