This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 1/2] Update _bfd_elf_symbol_refs_local_p/add UNDEFINED_WEAK_RESOLVED_TO_ZERO
- From: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 9 Oct 2017 11:31:40 +1030
- Subject: Re: [PATCH 1/2] Update _bfd_elf_symbol_refs_local_p/add UNDEFINED_WEAK_RESOLVED_TO_ZERO
- Authentication-results: sourceware.org; auth=none
- References: <20171007002908.GA31964@gmail.com>
On Fri, Oct 06, 2017 at 05:29:08PM -0700, H.J. Lu wrote:
> Update _bfd_elf_symbol_refs_local_p to cache result
Caching the result is a really bad idea. It's not as if the function
is anywhere near the top of any profiling result, and to cache return
value you need to be sure that the return value won't change between
the first call and the last in every target. That isn't true, as even
a cursory examination of the code in _bfd_elf_symbol_refs_local_p
should reveal. forced_local changes in many places!
> and handle undefined
> weak symbols and check version script.
You don't say why this is necessary. I suspect it's just one of the
cases where you discovered that forced_local changes.
You also didn't justify moving zero_undefweak to the generic elf
flags.
--
Alan Modra
Australia Development Lab, IBM