On Thu, Sep 24, 2015 at 12:41:24PM +0200, Bernd Schmidt wrote: > On 09/23/2015 04:48 PM, Dominik Vogt wrote: > >On Tue, Sep 22, 2015 at 01:56:15PM -0600, Jeff Law wrote: > Is > >there some good reason these aren't hooks? > > > >No, that was just inobservance. New version attached. Would it be > >preferrable to initialize the hooks with a NULL pointer and test > >the pointer before calling them? (That way the changes to > >hooks.[ch] could be dropped.) > > There are already several hooks/macros in use for this kind of > thing, have you checked that they are not usable for your purpose? > There's ASM_DECLARE_FUNCTION_NAME, which is used by nvptx for > example, and there's also ASM_OUTPUT_FUNCTION_PREFIX, which is > apparently used by nothing in the current tree. For the end you > could use ASM_DECLARE_FUNCTION_SIZE.
Hm, ASM_DECLARE_FUNCTION_NAME, ASM_DECLARE_FUNCTION_LABEL and ASM_OUTPUT_FUNCTION_PREFIX are all called too late in the code to be useful. The new hook (or any replacement for it) must be emitted: * before any alignmanet of the function is done, * before the constant pool is generated (however, s390 places the constant pool after the function anyway). ASM_DECLARE_FUNCTION_SIZE on the ohter hand is called too early; the end hook must be called after generating the constant pool. For example, activating or deactivating the vector extension on a z13 affects alignment of vector type constants. So, unfortunately, I see no way to make use of the existing hooks. You're right that there are plenty already. Hm, I wonder whether wrapping all these section switches in assemble_start/end_function in ".machine" pseudoops (that's what we need the hooks for; similar to .arch for ix86) has any real effect. Ciao Dominik ^_^ ^_^ -- Dominik Vogt IBM Germany