[llvmlinux] [arch/x86/kernel/head64.c] In function `early_make_pgtable': undefined reference to `mcount'

PaX Team pageexec at gmail.com
Tue Jul 16 19:57:10 UTC 2013


On 15 Jul 2013 at 11:25, Sedat Dilek wrote:

> So, CONFIG_FTRACE should be disabled at all or is
> (CONFIG_FUNCTION_TRACER=n plus CONFIG_DYNAMIC_FTRACE=n) sufficient.
> The latter makes the "mcount" issue go away.

i disabled all tracing related options but it's really just a config
i keep carrying over from release to release. it's entirely possible
that some things would work better these days than they did 2-3 years
ago. you're welcome to experiment ;).

> Speaking of the changes to x86-ftrace.h in 0033 (see [1]).
> So, these workarounds can be dropped and CONFIG_FTRACE=n
> (alternatively: CONFIG_FUNCTION_TRACER=n plus CONFIG_DYNAMIC_FTRACE=n)
> from config_x86_64 in [2]?

those changes prevent any kernel code from doing too deep stack walks
and i believe it's not only the tracers that did so but also things
like stack dumps during reporting an oops, etc.

you can try without that patch and see what triggers. like i said,
assumptions had existed at the time in some code that assumed a certain
minimal stack depth at certain points that didn't hold when compiled by
clang. since both the kernel and clang/llvm have changed since, it's
possible that such stack walking code wouldn't blow up these days.

the proper/reliable solution would still be a thorough audit of any
code that walks the stack though.



More information about the LLVMLinux mailing list