From: "Satyam Sharma" <satyam.sharma@gmail.com>
To: "Andrew Morton" <akpm@linux-foundation.org>
Cc: "Luck, Tony" <tony.luck@intel.com>,
mathieu.desnoyers@polymtl.ca, linux-kernel@vger.kernel.org
Subject: Re: 2.6.23-rc4-mm1 build issue: ia64 link error
Date: Sat, 8 Sep 2007 13:05:18 +0530 [thread overview]
Message-ID: <a781481a0709080035h3df2c664x6586ca09c727a096@mail.gmail.com> (raw)
In-Reply-To: <20070907040104.fad5fc70.akpm@linux-foundation.org>
[-- Attachment #1: Type: text/plain, Size: 2665 bytes --]
On 9/7/07, Andrew Morton <akpm@linux-foundation.org> wrote:
> > On Fri, 7 Sep 2007 00:34:59 -0700 "Luck, Tony" <tony.luck@intel.com> wrote:
> > > local symbol 0: discarded in section `.exit.text' from arch/ia64/kernel/built-in.o
> >
> > This usually means that there is a static __exit function (or __devexit etc.)
> > somewhere in the object being linked. The error message is pretty unhelpful
> > in figuring out *where* in the module. Look at the 'mm' patches that touch
> > arch/ia64/kernel to see if one of them tinkers with __exit* attributes.
>
> Confused. There are >2500 static __exit functions in the tree, including
> ones like
>
> arch/ia64/kernel/esi.c:static void __exit esi_exit (void)
That message means the linker found someone referencing an .exit.text
function -- on other archs this would've been a section mismatch but on
ia64 its a link error due to reasons below (although it would not have ever
caused an oops).
The message /is/ quite helpful actually -- you just need to objdump the
mentioned object file (arch/ia64/kernel/built-in.o) and see all functions
present in .exit.text (which turns out to be only four). Then cscope them
in the kernel tree and see which (if any) are referenced from non-__exit
code ...
> Could we have some more details on what you think has gone wrong here?
... and it turns out my ia64-tree-wide-misc-__cpuinitdata-init-exit.patch is
to blame here.
I just confirmed from arch/ia64/kernel/vmlinux.ld.S, that ia64 discards .exit.*
sections at link time itself -- unlike other archs such as x86 that drop it at
boot (after initcalls) time instead. And hence the "function that is referenced
only from __cpuinit or __exit can be marked __cpuexit" rule does not hold
true for ia64, sadly.
Now that patch made remove_palinfo_proc_entries() a __cpuexit function,
with the reasoning that it was only referenced from the __cpuinit notifier
callback and the general __exit function of that module. But the following
combination:
1. HOTPLUG_CPU=n in Mathieu's .config, and,
2. ia64's build-time .exit.* discarding, and,
3. an old toolchain (gcc-3.4.5) -- therefore ensuring that the notifier callback
wasn't elided from arch/ia64/kernel/built-in.o although nobody references it
ensured that the .init.text-resident palinfo_cpu_callback() referenced the
.exit.text-resident remove_palinfo_proc_entries(), thereby causing link error.
So this is the second goof-up in that "misc cpuinit/exit annotations" series
of mine, apologies. I've installed the ia64 cross-compile toolchain now, so
hopefully should be able to avoid such in future ...
Patch attached (have gmail access only for next few days).
Satyam
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: ia64-tree-wide-misc-__cpuinitdata-init-exit-fix.patch --]
[-- Type: text/x-diff; name="ia64-tree-wide-misc-__cpuinitdata-init-exit-fix.patch", Size: 490 bytes --]
Signed-off-by: Satyam Sharma <satyam@infradead.org>
---
arch/ia64/kernel/palinfo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-2.6.23-rc4-mm1/arch/ia64/kernel/palinfo.c~fix 2007-09-08 12:54:12.000000000 +0530
+++ linux-2.6.23-rc4-mm1/arch/ia64/kernel/palinfo.c 2007-09-08 12:54:45.000000000 +0530
@@ -947,7 +947,7 @@ create_palinfo_proc_entries(unsigned int
}
}
-static void __cpuexit
+static void
remove_palinfo_proc_entries(unsigned int hcpu)
{
int j;
next prev parent reply other threads:[~2007-09-08 7:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-06 18:35 Mathieu Desnoyers
2007-09-07 7:34 ` Luck, Tony
2007-09-07 11:01 ` Andrew Morton
2007-09-08 7:35 ` Satyam Sharma [this message]
2007-09-08 7:50 ` Satyam Sharma
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=a781481a0709080035h3df2c664x6586ca09c727a096@mail.gmail.com \
--to=satyam.sharma@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@polymtl.ca \
--cc=tony.luck@intel.com \
/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
all inboxes | Powered by JetHome®