This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] S390: Hotpatching fixes.
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, vogt at linux dot vnet dot ibm dot com
- Date: Fri, 27 Mar 2015 10:37:05 +0100
- Subject: Re: [PATCH] S390: Hotpatching fixes.
- Authentication-results: sourceware.org; auth=none
- References: <20150305124019 dot GA6266 at linux dot vnet dot ibm dot com> <20150309112221 dot GA4801 at linux dot vnet dot ibm dot com> <20150309121938 dot GA11867 at linux dot vnet dot ibm dot com> <20150326205630 dot GH1746 at tucnak dot redhat dot com> <5515233E dot 2010406 at linux dot vnet dot ibm dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Mar 27, 2015 at 10:30:38AM +0100, Andreas Krebbel wrote:
> At a second glance it is not really clear to me why we disable hotpatching for nested functions at
> all. While it is probably a bit difficult to actually hotpatch them I don't see why we should
> prevent it. We probably just copied that over from the x86 ms_hook_prologue attribute implementation:
>
> static bool
> ix86_function_ms_hook_prologue (const_tree fn)
> {
> if (fn && lookup_attribute ("ms_hook_prologue", DECL_ATTRIBUTES (fn)))
> {
> if (decl_function_context (fn) != NULL_TREE)
> error_at (DECL_SOURCE_LOCATION (fn),
> "ms_hook_prologue is not compatible with nested function");
> else
> return true;
> }
> return false;
> }
>
> Also the kernel guys (one of the main users of that feature) confirmed that they in principle prefer
> hotpatching to behave more like -pg and -pg does insert an mcount call for nested functions.
> (Although I would be surprised to hear of nested functions in the Linux kernel).
>
> So I'm inclined to just remove that special handling of nested functions.
Agreed, I also wondered what would be so special about nested functions
here.
Sure, one could hotpatch them with code clobbering the static chain
register, but that wouldn't be a gcc issue.
Jakub