public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Wankerl <sisewank@cip.cs.fau.de>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Philip Kranz <philip.kranz@googlemail.com>,
	linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org,
	i4passt@lists.informatik.uni-erlangen.de
Subject: Re: [PATCH] Add non-zero module sections to sysfs
Date: Fri, 05 Apr 2013 11:40:29 +0200	[thread overview]
Message-ID: <515E9C0D.503@cip.cs.fau.de> (raw)
In-Reply-To: <87vc81lj7x.fsf@rustcorp.com.au>

On 04/05/13 06:00, Rusty Russell wrote:
> Exactly.  Don't workaround it here, revert it and put the
> duplicate-section-name fixup in parisc where it belongs.
>
> Assuming parisc still produces these dup sections: that patch is 4 years
> old now.
>
> Untested:
>
> diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c
> index 2a625fb..28d32a2 100644
> --- a/arch/parisc/kernel/module.c
> +++ b/arch/parisc/kernel/module.c
> @@ -341,6 +341,11 @@ int module_frob_arch_sections(CONST Elf_Ehdr *hdr,
>  			    ".PARISC.unwind", 14) == 0)
>  			me->arch.unwind_section = i;
>  
> +		/* we produce multiple, empty .text sections, and kallsyms
> +		 * gets upset.  make non-alloc so it doesn't see them. */
> +		if (sechdrs[i].sh_size == 0)
> +			sechdrs[i].sh_flags &= ~SHF_ALLOC;
> +
>  		if (sechdrs[i].sh_type != SHT_RELA)
>  			continue;
We just worked your suggested patch in.

> Why?  Does something refer to this empty section?  Why has noone noticed
> this since 2009?

GDB wants to know all section with attribute ALLOC, regardless whether
they are empty or not. Thus, it is useful if all of them appear in sysfs.
> A zero-length section doesn't change the binary's structure.  You don't
> see non-SHF_ALLOC sections either.

Yes, but they do occupy an index in the section headers of the binary.
GDB needs to know all of them in the right order.

  reply	other threads:[~2013-04-05  9:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-03 13:08 [PATCH] Add non-zero module sections to sysfs Sebastian Wankerl
2013-04-04  1:00 ` Rusty Russell
2013-04-04  9:40   ` Sebastian Wankerl
2013-04-05  4:00     ` Rusty Russell
2013-04-05  9:40       ` Sebastian Wankerl [this message]
2013-04-05 10:07       ` James Bottomley
2013-04-06  4:52         ` Rusty Russell
2013-04-06 10:52           ` James Bottomley
2013-04-06 15:16             ` John David Anglin
2013-04-07  1:22               ` James Bottomley
2013-04-07  1:45                 ` John David Anglin
2013-04-06 10:40         ` Philip Kranz
2013-04-08  4:14           ` Rusty Russell
2013-04-08 11:55             ` Philip Kranz
2013-04-11 14:11             ` Philip Kranz
2013-04-05 14:56       ` Sebastian Wankerl
2013-04-06  4:31         ` Rusty Russell

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=515E9C0D.503@cip.cs.fau.de \
    --to=sisewank@cip.cs.fau.de \
    --cc=i4passt@lists.informatik.uni-erlangen.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=philip.kranz@googlemail.com \
    --cc=rusty@rustcorp.com.au \
    /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