1
0
Fork 0
Commit Graph

62 Commits (redonkable)

Author SHA1 Message Date
Tejun Heo 9281acea6a kallsyms: make KSYM_NAME_LEN include space for trailing '\0'
KSYM_NAME_LEN is peculiar in that it does not include the space for the
trailing '\0', forcing all users to use KSYM_NAME_LEN + 1 when allocating
buffer.  This is nonsense and error-prone.  Moreover, when the caller
forgets that it's very likely to subtly bite back by corrupting the stack
because the last position of the buffer is always cleared to zero.

This patch increments KSYM_NAME_LEN by one and updates code accordingly.

* off-by-one bug in asm-powerpc/kprobes.h::kprobe_lookup_name() macro
  is fixed.

* Where MODULE_NAME_LEN and KSYM_NAME_LEN were used together,
  MODULE_NAME_LEN was treated as if it didn't include space for the
  trailing '\0'.  Fix it.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Acked-by: Paulo Marques <pmarques@grupopie.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-17 10:23:03 -07:00
Paulo Marques 7c5d249ad3 kallsyms: remove usage of memmem and _GNU_SOURCE from scripts/kallsyms.c
The only in-kernel user of "memmem" is scripts/kallsyms.c and it only
uses it to find tokens that are 2 bytes in size. It is trivial to
replace it with a simple function that finds 2-byte tokens.

This should help users from systems that don't have the memmem GNU
extension available.

Signed-off-by: Paulo Marques <pmarques@grupopie.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2007-07-17 14:36:08 +02:00
Jan Beulich aad094701c [PATCH] move kallsyms data to .rodata
Kallsyms data is never written to, so it can as well benefit from
CONFIG_DEBUG_RODATA.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-08 08:28:37 -08:00
Vivek Goyal 2c22d8baa9 [PATCH] relocatable kernel: Fix kallsyms on avr32 after relocatable kernel changes
o On some platforms like avr32, section init comes before .text and
  not necessarily a symbol's relative position w.r.t _text is positive.
  In such cases assembler detects the overflow and emits warning. This
  patch fixes it.

Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Andi Kleen <ak@suse.de>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
2006-12-07 02:14:10 +01:00
Eric W. Biederman fd593d1277 [PATCH] relocatable kernel: Kallsyms generate relocatable symbols
Print the addresses of non-absolute symbols relative to _text
so that ld will generate relocations.  Allowing a relocatable
kernel to relocate them.  We can't actually use the symbol names
because kallsyms includes static symbols that are not exported
from their object files.

Add the _text symbol definitions to the architectures which don't
define it otherwise linker will fail.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andi Kleen <ak@suse.de>
2006-12-07 02:14:04 +01:00
Jesper Juhl f1a136e0d0 [PATCH] kallsyms: handle malloc() failure
This fixes coverity bugs #398 and #397

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-25 08:22:56 -08:00
Ralf Baechle 6f00df24ee [PATCH] Strip local symbols from kallsyms
Local symbols generated by gcc start with a `$'; no point in including them
in the kernel.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-07 16:57:20 -07:00
Paulo Marques b3dbb4ecd4 [PATCH] kallsyms: change compression algorithm
This patch changes the way the compression algorithm works.  The base
algorithm is similiar to the previous but we force the compressed token
size to 2.

Having a fixed size compressed token allows for a lot of optimizations, and
that in turn allows this code to run over *all* the symbols faster than it
did before over just a subset.

Having it work over all the symbols will make it behave better when symbols
change positions between passes, and the "inconsistent kallsyms" messages
should become less frequent.

In my tests the compression ratio was degraded by about 0.5%, but the
results will depend greatly on the number of symbols to compress.

Signed-off-by: Paulo Marques <pmarques@grupopie.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-07 16:57:18 -07:00
J.A. Magallon 61d9cdf2a9 [PATCH] kbuild: signed char fixes for scripts
This time I did not break anything... and they shut up gcc4 ;)

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2005-07-27 22:27:08 +02:00
David Woodhouse 075d6eb16d [PATCH] ppc32: platform-specific functions missing from kallsyms.
The PPC32 kernel puts platform-specific functions into separate sections so
that unneeded parts of it can be freed when we've booted and actually
worked out what we're running on today.

This makes kallsyms ignore those functions, because they're not between
_[se]text or _[se]inittext.  Rather than teaching kallsyms about the
various pmac/chrp/etc sections, this patch adds '_[se]extratext' markers
for kallsyms.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-05 16:36:31 -07:00
Yoshinori Sato 41f11a4fa3 [PATCH] kallsyms C_SYMBOL_PREFIX support
kallsyms does not consider SYMBOL_PREFIX of C.  Consequently it does not
work on architectures using that prefix character (h8300, v850).

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-01 08:59:06 -07:00
Linus Torvalds 1da177e4c3 Linux-2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!
2005-04-16 15:20:36 -07:00