lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 8 Sep 2007 13:05:18 +0530
From:	"Satyam Sharma" <satyam.sharma@...il.com>
To:	"Andrew Morton" <akpm@...ux-foundation.org>
Cc:	"Luck, Tony" <tony.luck@...el.com>, mathieu.desnoyers@...ymtl.ca,
	linux-kernel@...r.kernel.org
Subject: Re: 2.6.23-rc4-mm1 build issue: ia64 link error

On 9/7/07, Andrew Morton <akpm@...ux-foundation.org> wrote:
> > On Fri, 7 Sep 2007 00:34:59 -0700 "Luck, Tony" <tony.luck@...el.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

View attachment "ia64-tree-wide-misc-__cpuinitdata-init-exit-fix.patch" of type "text/x-diff" (490 bytes)

Powered by blists - more mailing lists