13 Aug, 2010

2 commits

  • * 'params' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: (22 commits)
    param: don't deref arg in __same_type() checks
    param: update drivers/acpi/debug.c to new scheme
    param: use module_param in drivers/message/fusion/mptbase.c
    ide: use module_param_named rather than module_param_call
    param: update drivers/char/ipmi/ipmi_watchdog.c to new scheme
    param: lock if_sdio's lbs_helper_name and lbs_fw_name against sysfs changes.
    param: lock myri10ge_fw_name against sysfs changes.
    param: simple locking for sysfs-writable charp parameters
    param: remove unnecessary writable charp
    param: add kerneldoc to moduleparam.h
    param: locking for kernel parameters
    param: make param sections const.
    param: use free hook for charp (fix leak of charp parameters)
    param: add a free hook to kernel_param_ops.
    param: silence .init.text references from param ops
    Add param ops struct for hvc_iucv driver.
    nfs: update for module_param_named API change
    AppArmor: update for module_param_named API change
    param: use ops in struct kernel_param, rather than get and set fns directly
    param: move the EXPORT_SYMBOL to after the definitions.
    ...

    Linus Torvalds
     
  • Permit .GCC-command-line sections in modules. Otherwise modpost says things
    like:

    WARNING: drivers/mtd/chips/map_ram.o (.GCC-command-line): unexpected non-allocatable section.
    Did you forget to use "ax"/"aw" in a .S file?
    Note that for example contains
    section definitions for use in .S files.

    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    David Howells
     

11 Aug, 2010

2 commits


10 Aug, 2010

1 commit

  • sec2annotation returns malloc'ed buffer directly to printf as an argument.
    Free this buffer after printing.

    Signed-off-by: Alexey Fomenko
    Cc: Trevor Keith
    Cc: Rusty Russell
    Cc: Michal Marek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Fomenko
     

04 Aug, 2010

1 commit


03 Aug, 2010

1 commit

  • This patch makes modpost able to process object files with more than
    64k sections. Needed for huge kernel builds (allyesconfig, for example)
    with -ffunction-sections. 64k sections handling is covered, for example,
    by this document:

    "IA-64 gABI Proposal 74: Section Indexes"
    http://www.codesourcery.com/public/cxx-abi/abi/prop-74-sindex.html

    Signed-off-by: Denys Vlasenko
    Signed-off-by: Anders Kaseorg
    Acked-by: Sam Ravnborg
    Cc: Rusty Russell
    Cc: Andi Kleen
    Signed-off-by: Michal Marek

    Denys Vlasenko
     

08 Jul, 2010

1 commit


12 Jun, 2010

1 commit

  • Alan writes:

    > program: /home/alan/GitTrees/linux-2.6-mid-ref/scripts/mod/modpost -o
    > Module.symvers -S vmlinux.o
    >
    > Program received signal SIGSEGV, Segmentation fault.

    It just hit me.
    It's the offset calculation in reloc_location() which overflows:
    return (void *)elf->hdr + sechdrs[section].sh_offset +
    (r->r_offset - sechdrs[section].sh_addr);

    E.g. for the first rodata r entry:
    r->r_offset < sechdrs[section].sh_addr
    and the expression in the parenthesis produces 0xFFFFFFE0 or something
    equally wise.

    Reported-by: Alan
    Signed-off-by: Krzysztof Hałasa
    Tested-by: Alan
    Signed-off-by: Michal Marek

    Krzysztof Halasa
     

31 Jan, 2010

4 commits


30 Jan, 2010

3 commits


17 Dec, 2009

1 commit

  • * 'for-33' of git://repo.or.cz/linux-kbuild: (29 commits)
    net: fix for utsrelease.h moving to generated
    gen_init_cpio: fixed fwrite warning
    kbuild: fix make clean after mismerge
    kbuild: generate modules.builtin
    genksyms: properly consider EXPORT_UNUSED_SYMBOL{,_GPL}()
    score: add asm/asm-offsets.h wrapper
    unifdef: update to upstream revision 1.190
    kbuild: specify absolute paths for cscope
    kbuild: create include/generated in silentoldconfig
    scripts/package: deb-pkg: use fakeroot if available
    scripts/package: add KBUILD_PKG_ROOTCMD variable
    scripts/package: tar-pkg: use tar --owner=root
    Kbuild: clean up marker
    net: add net_tstamp.h to headers_install
    kbuild: move utsrelease.h to include/generated
    kbuild: move autoconf.h to include/generated
    drop explicit include of autoconf.h
    kbuild: move compile.h to include/generated
    kbuild: drop include/asm
    kbuild: do not check for include/asm-$ARCH
    ...

    Fixed non-conflicting clean merge of modpost.c as per comments from
    Stephen Rothwell (modpost.c had grown an include of linux/autoconf.h
    that needed to be changed to generated/autoconf.h)

    Linus Torvalds
     

15 Dec, 2009

3 commits

  • memcmp() is wrong here, the symbol name can be shorter than KSYMTAB_PFX
    or CRC_PFX.

    Signed-off-by: Michal Marek
    Signed-off-by: Rusty Russell

    Michal Marek
     
  • Remove the unnecessary functions and variables.

    Signed-off-by: Wenji Huang
    Signed-off-by: Michal Marek
    Signed-off-by: Rusty Russell

    Wenji Huang
     
  • The next commit will require the use of MODULE_SYMBOL_PREFIX in
    .tmp_exports-asm.S. Currently it is mixed in with C structure
    definitions in "asm/module.h". Move the definition of this arch option
    into Kconfig, so it can be easily accessed by any code.

    This also lets modpost.c use the same definition. Previously modpost
    relied on a hardcoded list of architectures in mk_elfconfig.c.

    A build test for blackfin, one of the two MODULE_SYMBOL_PREFIX archs,
    showed the generated code was unchanged. vmlinux was identical save
    for build ids, and an apparently randomized suffix on a single "__key"
    symbol in the kallsyms data).

    Signed-off-by: Alan Jenkins
    Acked-by: Mike Frysinger (blackfin)
    CC: Sam Ravnborg
    Signed-off-by: Rusty Russell

    Alan Jenkins
     

23 Sep, 2009

1 commit


10 Jun, 2009

2 commits

  • As requested by Guennadi Liakhovetski

    Cc: Guennadi Liakhovetski
    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • - add .init.rodata to INIT_DATA, and group all initconst flavors
    together
    - move strings generated from __setup_param() into .init.rodata
    - add .*init.rodata to modpost's sets of init sections
    - make modpost warn about references between meminit and cpuinit
    as well as memexit and cpuexit sections (as CPU and memory
    hotplug are independently selectable features)

    Signed-off-by: Jan Beulich
    Signed-off-by: Sam Ravnborg

    Jan Beulich
     

04 May, 2009

3 commits

  • mips emit the following debug sections:
    .mdebug* and .pdr

    They were included in the check for non-allocatable section
    and caused modpost to warn.

    Manuel Lauss suggested to fix this by adding the relevant
    sections to the list of sections we do not check.

    Signed-off-by: Sam Ravnborg
    Reported-by: Manuel Lauss

    Sam Ravnborg
     
  • Jean reported that he saw one warning for each module like the one below:
    WARNING: arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.o (.comment.SUSE.OPTs): unexpected non-allocatable section.

    The warning appeared with the improved version of the
    check of the flags in the sections.

    That check already ignored sections named ".comment" - but SUSE store
    additional info in the comment section and has named it in a SUSE
    specific way. Therefore modpost failed to ignore the section.

    The fix is to extend the pattern so we ignore all sections
    that start with the name ".comment.".

    Signed-off-by: Sam Ravnborg
    Reported-by: Jean Delvare
    Tested-by: Jean Delvare

    Sam Ravnborg
     
  • The missing TO_NATIVE(sechdrs[i].sh_flags) was causing many
    unexpected non-allocatable section warnings when cross-compiling
    for an architecture with a different endianness.

    Fix endianness of all the fields in the ELF header and
    section headers, not just some of them so we are not
    hit by this anohter time.

    Signed-off-by: Anders Kaseorg
    Reported-by: Sean MacLennan
    Tested-by: Sean MacLennan
    Signed-off-by: Sam Ravnborg

    Anders Kaseorg
     

01 May, 2009

3 commits

  • When you put
    .section ".foo"
    in an assembly file instead of
    .section "foo", "ax"
    , one of the possible symptoms is that modpost will see an
    ld-generated section name ".foo.1" in section_rel() or section_rela().
    But this heuristic has two problems: it will miss a bad section that
    has no relocations, and it will incorrectly flag many gcc-generated
    sections as bad when compiling with -ffunction-sections
    -fdata-sections.

    On mips it fixes a lot of bogus warnings with gcc 4.4.0 lije this one:
    WARNING: crypto/cryptd.o (.text.T.349): unexpected section name.

    So instead of checking whether the section name matches a particular
    pattern, we directly check for a missing SHF_ALLOC in the section
    flags.

    Signed-off-by: Anders Kaseorg
    Tested-by: Ralf Baechle
    Signed-off-by: Sam Ravnborg

    Anders Kaseorg
     
  • There is some confusion on naming of the head section.
    Correct naming is .head.text.

    Fix comment so we use correct naming.

    Signed-off-by: Sam Ravnborg

    Sam Ravnborg
     
  • While building the kernel, we end-up calling modpost with -K and -M
    options for the same file (Modules.markers). This is resulting in
    modpost's main function calling read_markers() and then write_markers() on
    the same file.

    We then have read_markers() mmap'ing the file, and writer_markers()
    opening that same file for writing.

    The issue is that read_markers() exits without munmap'ing the file and is
    as a matter holding a reference on Modules.markers. When write_markers()
    is opening that very same file for writing, we still have a reference on
    it and cygwin (Windows?) is then making fopen() fail with EPERM.

    Calling release_file() before exiting read_markers() clears that reference
    (and memory leak) and fopen() then succeeds.

    Tested on both cygwin (1.3.22) and Linux. Also ran modpost within
    valgrind on Linux to make sure that the munmap'ed file was not accessed
    after read_markers()

    Signed-off-by: Cedric Hombourger
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Sam Ravnborg

    Cedric Hombourger
     

28 Apr, 2009

1 commit

  • The old refok sections

    .text.init.refok
    .data.init.refok
    .exit.text.refok

    have been deprecated since commit
    312b1485fb509c9bc32eda28ad29537896658cb8. After the other patches in
    this patch series nothing is put in these sections, so clean things up
    by eliminating all the remaining references to them.

    Signed-off-by: Tim Abbott
    Acked-by: Sam Ravnborg
    Signed-off-by: Linus Torvalds

    Tim Abbott
     

11 Apr, 2009

1 commit


31 Mar, 2009

1 commit

  • With CONFIG_MODVERSIONS, we version 'struct module' using a dummy
    export, but other things matter too:

    1) 'struct modversion_info' determines the layout of the __versions section,
    2) 'struct kernel_param' determines the layout of the __params section,
    3) 'struct kernel_symbol' determines __ksymtab*.
    4) 'struct marker' determines __markers.
    5) 'struct tracepoint' determines __tracepoints.

    So we rename 'struct_module' to 'module_layout' and include these in
    the signature. Now it's general we can add others later on without
    confusion.

    Signed-off-by: Rusty Russell

    Rusty Russell
     

06 Feb, 2009

1 commit

  • Impact: fix link failure on certain toolchains with specific configs

    Recent percpu change made x86_64 split .data.init section into three
    separate segments - data.init, percpu and data.init2. data.init2 gets
    .data.nosave and .bss.* and is followed by .notes segment. Depending
    on configuration both segments might contain no data, in which case
    the tool chain makes the section header to contain offset beyond the
    end of the file.

    modpost isn't too happy about it and fails build - as reported by
    Pawel Dziekonski:

    Building modules, stage 2.
    MODPOST 416 modules
    FATAL: vmlinux is truncated. sechdrs[i].sh_offset=10354688 >
    sizeof(*hrd)=64
    make[1]: *** [__modpost] Error 1

    Teach modpost that NOBITS section may point beyond the end of the file
    and that .modinfo can't be NOBITS.

    Reported-by: Pawel Dziekonski
    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar

    Tejun Heo
     

11 Oct, 2008

1 commit

  • We need to add a flag for all code that is in the drivers/staging/
    directory to prevent all other kernel developers from worrying about
    issues here, and to notify users that the drivers might not be as good
    as they are normally used to.

    Based on code from Andreas Gruenbacher and Jeff Mahoney to provide a
    TAINT flag for the support level of a kernel module in the Novell
    enterprise kernel release.

    This is the code that actually modifies the modules, adding the flag to
    any files in the drivers/staging directory.

    Cc: Andreas Gruenbacher
    Cc: Jeff Mahoney
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

07 Oct, 2008

1 commit

  • * Theodore Ts'o (tytso@mit.edu) wrote:
    >
    > I've been playing with adding some markers into ext4 to see if they
    > could be useful in solving some problems along with Systemtap. It
    > appears, though, that as of 2.6.27-rc8, markers defined in code which is
    > compiled directly into the kernel (i.e., not as modules) don't show up
    > in Module.markers:
    >
    > kvm_trace_entryexit arch/x86/kvm/kvm-intel %u %p %u %u %u %u %u %u
    > kvm_trace_handler arch/x86/kvm/kvm-intel %u %p %u %u %u %u %u %u
    > kvm_trace_entryexit arch/x86/kvm/kvm-amd %u %p %u %u %u %u %u %u
    > kvm_trace_handler arch/x86/kvm/kvm-amd %u %p %u %u %u %u %u %u
    >
    > (Note the lack of any of the kernel_sched_* markers, and the markers I
    > added for ext4_* and jbd2_* are missing as wel.)
    >
    > Systemtap apparently depends on in-kernel trace_mark being recorded in
    > Module.markers, and apparently it's been claimed that it used to be
    > there. Is this a bug in systemtap, or in how Module.markers is getting
    > built? And is there a file that contains the equivalent information
    > for markers located in non-modules code?

    I think the problem comes from "markers: fix duplicate modpost entry"
    (commit d35cb360c29956510b2fe1a953bd4968536f7216)

    Especially :

    - add_marker(mod, marker, fmt);
    + if (!mod->skip)
    + add_marker(mod, marker, fmt);
    }
    return;
    fail:

    Here is a fix that should take care if this problem.

    Thanks for the bug report!

    Signed-off-by: Mathieu Desnoyers
    Tested-by: "Theodore Ts'o"
    CC: Greg KH
    CC: David Smith
    CC: Roland McGrath
    CC: Sam Ravnborg
    CC: Wenji Huang
    CC: Takashi Nishiie
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     

31 Jul, 2008

1 commit


23 Jul, 2008

1 commit

  • When a kernel was rebuilt, the previous Module.markers was not cleared.
    It caused markers with different format strings to appear as duplicates
    when a markers was changed. This problem is present since
    scripts/mod/modpost.c started to generate Module.markers, commit
    b2e3e658b344c6bcfb8fb694100ab2f2b5b2edb0

    It therefore applies to 2.6.25, 2.6.26 and linux-next.

    I merely merged the patches from Roland, Wenji and Takashi here.

    Credits to
    Roland McGrath
    Wenji Huang
    and
    Takashi Nishiie

    for providing the individual fixes.

    - Changelog :
    - Integrated Takashi's Makefile modification to clear Module.markers upon
    make clean.

    Signed-off-by: Mathieu Desnoyers
    Cc: Roland McGrath
    Cc: Wenji Huang
    Cc: Takashi Nishiie
    Cc: [2.6.25.x, 2.6.26.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     

12 Jun, 2008

1 commit

  • Kumar Gala wrote:
    We have a case in powerpc in which we want to link some library
    routines with all module objects. The routines are intended for
    handling out-of-line function call register save/restore so having
    them as EXPORT_SYMBOL() is counter productive (we do also need to
    link the same "library" code into the kernel).

    Without this patch a powerpc build would error out and fail
    to build modules with the added register save/restore module.

    There were two obvious solutions:
    1) To link the .o file before the modpost stage
    2) To ignore the symbols in modpost

    Option 1) was ruled out because we do not have any separate
    linking stage for single file modules.

    This patch implements option 2 - and do so only for powerpc.

    The symbols we ignore are all undefined symbols named:
    _restgpr_*, _savegpr_*, _rest32gpr_*, _save32gpr_*

    Signed-off-by: Sam Ravnborg
    Cc: Kumar Gala
    Cc: Paul Mackerras

    Sam Ravnborg
     

11 May, 2008

1 commit

  • Disable modpost warnings for linkonce sections

    My build gives lots of warnings like

    WARNING: sound/core/snd.o (.gnu.linkonce.wi.mpspec_def.h.30779716): unexpected section name.
    The (.[number]+) following section name are ld generated and not expected.
    Did you forget to use "ax"/"aw" in a .S file?
    Note that for example contains
    section definitions for use in .S files.

    But for .linkonce. duplicated sections are actually ok and expected.
    So just disable the warning for this case.

    Signed-off-by: Andi Kleen
    Signed-off-by: Sam Ravnborg

    Andi Kleen
     

27 Apr, 2008

1 commit