Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1
crash
crash-struct-module-2.6.27.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File crash-struct-module-2.6.27.diff of Package crash
From: Bernhard Walle <bwalle@suse.de> Fix module size and num_symtab for 2.6.27 This patch implements the kernel change commit 2f0f2a334bc38b61a9afca951185cd3844ee709d Author: Denys Vlasenko <vda.linux@googlemail.com> Date: Tue Jul 22 19:24:27 2008 -0500 module: turn longs into ints for module sizes This shrinks module.o and each *.ko file. And finally, structure members which hold length of module code (four such members there) and count of symbols are converted from longs to ints. We cannot possibly have a module where 32 bits won't be enough to hold such counts. For one, module loading checks module size for sanity before loading, so such insanely big module will fail that test first. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> in crash. Without the patch I was not able to open a core dump created with 2.6.27 on POWER. I think it's mostly a problem on big endian architectures, because on little endian you can have luck and read zeros which don't change the value of a number while on big endian you cannot have luck. ;-) Signed-off-by: Bernhard Walle <bwalle@suse.de> --- kernel.c | 13 ++++++++++--- symbols.c | 24 +++++++++++++++++++----- 2 files changed, 29 insertions(+), 8 deletions(-) --- a/kernel.c +++ b/kernel.c @@ -2510,7 +2510,10 @@ module_init(void) break; case KALLSYMS_V2: - numksyms = ULONG(modbuf + OFFSET(module_num_symtab)); + if (THIS_KERNEL_VERSION >= LINUX(2,6,27)) + numksyms = UINT(modbuf + OFFSET(module_num_symtab)); + else + numksyms = ULONG(modbuf + OFFSET(module_num_symtab)); total += numksyms; break; } @@ -2623,8 +2626,12 @@ verify_modules(void) case KMOD_V2: module_name = modbuf + OFFSET(module_name); - mod_size = LONG(modbuf + - OFFSET(module_core_size)); + if (THIS_KERNEL_VERSION >= LINUX(2,6,27)) + mod_size = UINT(modbuf + + OFFSET(module_core_size)); + else + mod_size = ULONG(modbuf + + OFFSET(module_core_size)); if (strlen(module_name) < MAX_MOD_NAME) strcpy(buf, module_name); else --- a/symbols.c +++ b/symbols.c @@ -1290,8 +1290,15 @@ store_module_symbols_v2(ulong total, int gpl_syms = ULONG(modbuf + OFFSET(module_gpl_syms)); nsyms = UINT(modbuf + OFFSET(module_num_syms)); ngplsyms = UINT(modbuf + OFFSET(module_num_gpl_syms)); - nksyms = ULONG(modbuf + OFFSET(module_num_symtab)); - size = ULONG(modbuf + OFFSET(module_core_size)); + + if (THIS_KERNEL_VERSION >= LINUX(2,6,27)) { + nksyms = UINT(modbuf + OFFSET(module_num_symtab)); + size = UINT(modbuf + OFFSET(module_core_size)); + } else { + nksyms = ULONG(modbuf + OFFSET(module_num_symtab)); + size = ULONG(modbuf + OFFSET(module_core_size)); + } + mod_name = modbuf + OFFSET(module_name); lm = &st->load_modules[m++]; @@ -1314,8 +1321,12 @@ store_module_symbols_v2(ulong total, int ngplsyms, nksyms); lm->mod_flags = MOD_EXT_SYMS; lm->mod_ext_symcnt = mcnt; - lm->mod_etext_guess = lm->mod_base + - ULONG(modbuf + OFFSET(module_core_text_size)); + if (THIS_KERNEL_VERSION >= LINUX(2,6,27)) + lm->mod_etext_guess = lm->mod_base + + UINT(modbuf + OFFSET(module_core_text_size)); + else + lm->mod_etext_guess = lm->mod_base + + ULONG(modbuf + OFFSET(module_core_text_size)); lm->mod_text_start = lm->mod_base; st->ext_module_symtable[mcnt].value = lm->mod_base; @@ -1753,7 +1764,10 @@ store_module_kallsyms_v2(struct load_mod return 0; } - nksyms = ULONG(modbuf + OFFSET(module_num_symtab)); + if (THIS_KERNEL_VERSION >= LINUX(2,6,27)) + nksyms = UINT(modbuf + OFFSET(module_num_symtab)); + else + nksyms = ULONG(modbuf + OFFSET(module_num_symtab)); ksymtab = ULONG(modbuf + OFFSET(module_symtab)); locsymtab = module_buf + (ksymtab - lm->mod_base); kstrtab = ULONG(modbuf + OFFSET(module_strtab));
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor