This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: ELF linking question related to symbol collisions
- From: Florian Weimer <fweimer at redhat dot com>
- To: "Carlos O'Donell" <carlos at redhat dot com>
- Cc: libc-help <libc-help at sourceware dot org>
- Date: Wed, 18 Dec 2013 19:44:27 +0100
- Subject: Re: ELF linking question related to symbol collisions
- Authentication-results: sourceware.org; auth=none
- References: <528CB7AB dot 2080901 at redhat dot com> <CAE2sS1gi_qV9n8Ynerh6nWTdTAftM1xvt=hQZ7DxxP9jfGyGwQ at mail dot gmail dot com> <528DDBB9 dot 8090208 at redhat dot com> <528E779E dot 3050009 at redhat dot com> <52B1B57D dot 7000604 at redhat dot com> <52B1E70A dot 9040506 at redhat dot com>
On 12/18/2013 07:18 PM, Carlos O'Donell wrote:
Or more to the point, I'm not sure if the current linking algorithm
is what we need. Something like -B direct might be a better fit for
our current needs.
I assume we're talking about some of the features present in Solaris?
Correct.
Unless that function references static symbols, then it may or may
not be safe. If everything ends up being interposed, it is okay, but
if not, code might hit different static symbols.
That is correct. If the API has state then it would not work to use
a mixed implementation as you point out.
It's also common to have code like this:
static const char * msg = "some string";
void
foo_close (struct foo *pfoo)
{
if (pfoo->msg != msg)
free (pfoo->msg);
free (pfoo);
}
I think this is what sometimes break the Lua interpreter when interposed.
Sure, but I think static linking has no future. If it reappears, it
will be in the form of LTO object files.
Static has use cases that will never go away.
I plan to support it in glibc forever or until some new method is
as easy as static linking to solve the same use cases.
Yes, from a toolchain standpoint, it's absolutely true. I was concerned
with the distribution POV and didn't make that clear.
I agree that toolchain features for managing namespaces are
important.
However, no amount of tooling will fix people from breaking
the namespace. The tooling only helps you resolve the breakage.
There must be a higher level analysis and policy at the distribution
level.
Do you disagree with that last statement?
I agree completely. As a distribution, we also need some way to detect
upstream surprises and override their decisions if necessary.
--
Florian Weimer / Red Hat Product Security Team