This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Don't check ABI for _nl_default_dirname
On Sun, Dec 09, 2012 at 06:28:42PM -0800, Jonathan Nieder wrote:
> Andreas Schwab wrote:
>
> > The size is copied into the program by the COPY relocation.
>
> Yep, that's why I didn't write a patch after reporting PR14664.
>
> Are applications that use _nl_default_dirname buggy by definition
> because its size can vary from machine to machine? I'm inclined to
> think "yes". Is there anything we can do to make them behave better
> anyway?
Yes, they are inherently buggy. The fix is to deprecate
_nl_default_dirname (the array) and replace it with a pointer.
In general, having a shared library expose an external symbol for an
array or struct is almost always a serious design flaw; the only
exceptions I can think of are when the dimension of the array or
layout of the struct is already part of the ABI, and even then, just
the memory-size waste of copy relocations for large objects makes it a
bad idea.
Rich