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: [PATCH] Don't check ABI for _nl_default_dirname


On Sun, Dec 09, 2012 at 11:03:03AM +0530, Siddhesh Poyarekar wrote:
> On Sat, Dec 08, 2012 at 11:41:59PM +0100, Andi Kleen wrote:
> > The only way in C to know the size of a extern symbol is to hardcode 
> > the size in a header declaration. But:
> > - there is no header for _nl_default_dirname
> > - even if there was the size in the header would not change because
> > the size is already compiled into the program
> > 
> > So it cannot find the size at link time.
> 
> I read this after I sent the previous email; my example is obviously
> invalid.  I tried to think (not very hard though) of other situations
> where data size checks make a difference but couldn't come up with
> anything, so maybe it makes sense to ignore data sizes in the check or
> maybe just issue a warning.

I think size is normally just used as a proxy for the type. That's fine,
except for variable length arrays like this.

It's not a very good proxy, better would be something like the kernel
modsyms mechanism that actually looks at the type.

Converting it to a warning only would work.

Short of that I still think my patch is the right fix short term.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.


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