This is the mail archive of the libc-alpha@sourceware.org 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]
Other format: [Raw text]

Re: Fixing namespace issues for variables


On Fri, 23 Oct 2015, Florian Weimer wrote:

> For real global variables, this isn't pretty, but I think it is
> acceptable (if the ELF specifics work out, including size changes, which

signgam is an int; there's no reason for its size to change.  If 
re_syntax_options changes size various functions would need new symbol 
versions anyway and I don't see a problem with a new version of 
__re_syntax_options_location in that case.

> I don't know).  Such global variables are legacy anyway due to thread
> safety, so the additional performance overhead would not matter.
> 
> Constants are another matter.  We might need something else for them if
> applications can expect fast access.

If a variable is read-only (and its contents are what matters, not its 
address) then it's not a problem for the main program and libc to end up 
using different copies (it doesn't even waste memory - both copies are 
always allocated even if only one is used), so aliases can be used in the 
same way as for functions.  Cf. my fix for in6addr_* 
<https://sourceware.org/ml/libc-alpha/2015-06/msg00484.html>.

-- 
Joseph S. Myers
joseph@codesourcery.com


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