linux-parisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: John David Anglin <dave@hiauly1.hia.nrc.ca>
Cc: carlos@systemhalted.org, linux-parisc@vger.kernel.org
Subject: Re: FUNCTION_TRACER and parisc kernel
Date: Sat, 07 Feb 2009 20:05:33 +0100	[thread overview]
Message-ID: <498DDB7D.50309@gmx.de> (raw)
In-Reply-To: <20090207032523.06F704EF8@hiauly1.hia.nrc.ca>

John David Anglin wrote:
>> Hi Carlos, Dave & parisc-linux mailing list,
>>
>> I just started looking into implementing function tracer functionality 
>> into the parisc kernel (http://cateee.net/lkddb/web-lkddb/FUNCTION_TRACER.html).
>>
>> While doing so, I noticed that gcc issues lots of warnings like this one:
>>   CC      arch/parisc/lib/iomap.o
>> cc1: warning: -ffunction-sections disabled; it makes profiling impossible
>>
>> So it seems that this statement in arch/parisc/Makefile:
>> # Without this, "ld -r" results in .text sections that are too big
>> # (> 0x40000) for branches to reach stubs.
>> cflags-y        += -ffunction-sections
>>
>> breaks with the -pg compile option which is needed for function tracing.
>>
>> Some searching with google brought up this thread:
>> http://gcc.gnu.org/ml/gcc-help/2008-11/msg00128.html
>> and esp. this answer:
>> http://gcc.gnu.org/ml/gcc-help/2008-11/msg00141.html
> 
> Hmmm, we killed named section support on the HP-UX SOM port several years
> ago because it wasn't very useful.  Jeff did it...  So, at this time, only
> Solaris is an issue.  Of course, changing the code in toplev.c affects all
> targets.  So, a change to remove this would have to go into 4.5 quite
> early.
> 
> There was some work on the profiling implementation for both HP-UX and
> Linux after the removal of named section support on HP-UX, so the label
> issue may not be a problem.  Remove the code disabling function sections
> when -pg is specified and see what happens.

It does not link when building 32bit or PA20 code.
On 64bit it does build and link, although taking the patch from 
http://sourceware.org/ml/binutils/2009-02/msg00040.html
into account, as well as me running an old ld, it might be that
I just don't see it failing yet...

> [I have thought it would be useful to have named sections for dwarf2
> debug support on HP-UX.  However, this is not useful for normal code.
> I have a patch somewhere to do this, but gdb needs work which I've
> never got around to.  So, I might bring named section support back
> in a limited way.]

Ok. This means it would be possible to drop function-sections.

> Regarding .text sections that are too big, see this thread:
> http://sourceware.org/ml/binutils/2009-02/msg00061.html
> 
> It seems that it should be possible to do more fine grained stub
> sections.  At this time, it's not fully clear where the problem
> lies.  GCC may need to start a new .text section before each function,
> or maybe the .text sections are getting merged.
> 
> Recently, I got pushed to look a bit at GNU ld.  It turns out there is no
> long branch stub support in it at all.  As a result, it can't assemble
> large applications like cc1plus.  It can just barely link cc1.  It
> might have trouble with a large linux kernel.  I added a check recently
> to generate an error if a branch target is out of range.  There's
> a possibility that the current code for stub management in elf32-hppa.c
> can be modified for hppa64 without too much work.

That would be great.

> I don't know about the "ld -r" problem but I suspect we have to stop
> .text sections from getting merged in partial links.  The other possiblity
> would be to add long branch stubs for calls to undefined symbols.  The
> latter approach would complicate final links.

Thanks a lot for those explanations!!!
I see I need to dig in closer into ld/gcc as well too :-(

Helge

      parent reply	other threads:[~2009-02-07 19:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-07  1:19 FUNCTION_TRACER and parisc kernel Helge Deller
2009-02-07  3:25 ` John David Anglin
2009-02-07 18:32   ` John David Anglin
2009-02-07 19:05   ` Helge Deller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=498DDB7D.50309@gmx.de \
    --to=deller@gmx.de \
    --cc=carlos@systemhalted.org \
    --cc=dave@hiauly1.hia.nrc.ca \
    --cc=linux-parisc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).