[PATCH v3] elf: Only use function size from regular object

Alan Modra amodra@gmail.com
Mon Sep 14 10:16:35 GMT 2026


On Mon, Sep 14, 2026 at 08:17:31AM +0200, Jan Beulich wrote:
> On 13.09.2026 06:59, Alan Modra wrote:
> > If we wanted to go down the path that HJ claims is correct, then the
> > following on top of v2 would work, but I question the premise of the
> > patch that ld should not copy any function st_size from a shared
> > object.  We clearly do have a minor bug in pr34585 and not copying any
> > st_size from a shared library would fix it, but there is another
> > possible fix which is to copy a zero st_size from the definition.
> 
> Did you really mean "copy a zero st_size", not "copy a non-zero st_size"
> (or "only copy over zero st_size from the definition")? If it was meant
> as written, I guess I'm not quite following.

Yes, I meant copy a zero st_size.  Over top of a non-zero st_size set
by a previous weak definition, say, when we find a strong definition.
Conversely, keep a zero st_size from a previous definition when
finding another definition that does not override the previous
definition.

I thought that was what we did..  I haven't checked the claim in
pr34585.  Maybe it is bogus?

> > I'm inclined to think st_size from an actual definition in a shared
> > library is perhaps useful information about the link-time function.
> 
> Yes.
> 
> Jan

-- 
Alan Modra


More information about the Binutils mailing list