This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR49366] emit loc exprs for C++ non-virtual pmf template value parms
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 05 Aug 2016 18:59:55 -0300
- Subject: Re: [PR49366] emit loc exprs for C++ non-virtual pmf template value parms
- Authentication-results: sourceware.org; auth=none
- References: <orvazwbf65.fsf@livre.home> <CADzB+2=wwCd6g=T3DrHMjyyFpszSQfM2VgACo=Y8v2tbJvjpCA@mail.gmail.com>
On Aug 5, 2016, Jason Merrill <jason@redhat.com> wrote:
>> With this patch, when we can't emit a DW_AT_const_value, we emit each
>> "member" of the pointer to member function "record" as a
>> DW_OP_stack_value DW_OP_piece, as long as the referenced member
>> function is output in the same translation unit, otherwise we'd get
>> relocations to external symbols, something to avoid in debug sections.
> I wonder if it would make sense to use weak references...
I found the chunk of code that caused us to drop references to symbols
not defined in the current translation unit. The comments at the end of
const_ok_for_output_1 don't sound not exactly hopeful:
/* Avoid references to external symbols in debug info, on several targets
the linker might even refuse to link when linking a shared library,
and in many other cases the relocations for .debug_info/.debug_loc are
dropped, so the address becomes zero anyway. Hidden symbols, guaranteed
to be defined within the same shared library or executable are fine. */
Anyway, this change is something that could certainly be addressed as a
separate patch, since it would have effects over a lot more than just
pointers to member functions.
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer