1. 17 7月, 2007 11 次提交
  2. 12 6月, 2007 1 次提交
    • S
      kbuild: fix sh64 section mismatch problems · 2648a53a
      Sam Ravnborg 提交于
      There's a special .cranges section that is almost always generated,
      with data being moved to the appropriate section by the linker at a later
      stage.
      
      To give a bit of background, sh64 has both a native SHmedia instruction
      set (32-bit instructions) and SHcompact (which is compatability with
      normal SH -- 16-bit, a massively reduced register set, etc.). code ranges
      are emitted when we're using the 32-bit ABI, but not the 64-bit one.
      
      It is a special staging section used solely by binutils where code with
      different flags get placed (more specifically differing flags for input
      and output sections), before being lazily merged by the linker.
      
      The closest I've been able to find to documentation is:
        http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/ld/emultempl/sh64elf.em?rev=1.10&content-type=text/x-cvsweb-markup&cvsroot=src
      
      It's an array of 8-byte Elf32_CRange structure given in
        http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/elf32-sh64.h?rev=1.4&content-type=text/x-cvsweb-markup&cvsroot=src
      that describes for which ISA a range is used.
      
      Silence the warnings by allowing references from .init.text to .cranges.
      
      The following warnings are fixed:
      
      WARNING: init/built-in.o(.cranges+0x0): Section mismatch: reference to .init.text:
      WARNING: init/built-in.o(.cranges+0xa): Section mismatch: reference to .init.text:
      WARNING: init/built-in.o(.cranges+0x14): Section mismatch: reference to .init.text:
      WARNING: init/built-in.o(.cranges+0x1e): Section mismatch: reference to .init.text:
      WARNING: init/built-in.o(.cranges+0x28): Section mismatch: reference to .init.text:
      WARNING: init/built-in.o(.cranges+0x32): Section mismatch: reference to .init.text:
      WARNING: kernel/built-in.o(.cranges+0x50): Section mismatch: reference to .init.text:
      WARNING: kernel/built-in.o(.cranges+0x5a): Section mismatch: reference to .init.text:
      WARNING: kernel/built-in.o(.cranges+0x64): Section mismatch: reference to .init.text:
      WARNING: kernel/built-in.o(.cranges+0xfa): Section mismatch: reference to .init.text:
      WARNING: kernel/built-in.o(.cranges+0x104): Section mismatch: reference to .init.text:
      WARNING: kernel/built-in.o(.cranges+0x10e): Section mismatch: reference to .init.text:
      WARNING: kernel/built-in.o(.cranges+0x14a): Section mismatch: reference to .init.text:
      WARNING: kernel/built-in.o(.cranges+0x154): Section mismatch: reference to .init.text:
      WARNING: kernel/built-in.o(.cranges+0x15e): Section mismatch: reference to .init.text:
      WARNING: mm/built-in.o(.cranges+0x6e): Section mismatch: reference to .init.text:
      WARNING: mm/built-in.o(.cranges+0x78): Section mismatch: reference to .init.text:
      WARNING: mm/built-in.o(.cranges+0x82): Section mismatch: reference to .init.text:
      WARNING: mm/built-in.o(.cranges+0xaa): Section mismatch: reference to .init.text:
      WARNING: fs/built-in.o(.cranges+0x136): Section mismatch: reference to .init.text:
      WARNING: fs/built-in.o(.cranges+0x140): Section mismatch: reference to .init.text:
      WARNING: fs/built-in.o(.cranges+0x14a): Section mismatch: reference to .init.text:
      WARNING: fs/built-in.o(.cranges+0x168): Section mismatch: reference to .init.text:
      WARNING: fs/built-in.o(.cranges+0x1f4): Section mismatch: reference to .init.text:
      WARNING: fs/built-in.o(.cranges+0x1fe): Section mismatch: reference to .init.text:
      WARNING: net/built-in.o(.cranges+0x302): Section mismatch: reference to .init.text:
      WARNING: net/built-in.o(.cranges+0x30c): Section mismatch: reference to .init.text:
      WARNING: net/built-in.o(.cranges+0x316): Section mismatch: reference to .init.text:
      WARNING: net/built-in.o(.cranges+0x3a2): Section mismatch: reference to .init.text:
      WARNING: net/built-in.o(.cranges+0x3ac): Section mismatch: reference to .init.text:
      WARNING: net/built-in.o(.cranges+0x4ce): Section mismatch: reference to .init.text:
      WARNING: net/built-in.o(.cranges+0x4d8): Section mismatch: reference to .init.text:
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      Cc: Kaz Kojima <kkojima@rr.iij4u.or.jp>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      2648a53a
  3. 22 5月, 2007 1 次提交
  4. 19 5月, 2007 6 次提交
    • S
      mm: fix section mismatch warnings · 577a32f6
      Sam Ravnborg 提交于
      modpost had two cases hardcoded for mm/
      Shift over to __init_refok and kill the
      hardcoded function names in modpost.
      
      This has the drawback that the functions
      will always be kept no matter configuration.
      With previous code the function were placed in
      init section if configuration allowed it.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      577a32f6
    • S
      init/main: use __init_refok to fix section mismatch · 92080309
      Sam Ravnborg 提交于
      Kill a special case in modpost by introducing the
      __init_refok marker.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      92080309
    • S
      kbuild: introduce __init_refok/__initdata_refok to supress section mismatch warnings · 0e0d314e
      Sam Ravnborg 提交于
      Throughout the kernel there are a few legitimite references
      to init or exit sections. Most of these are covered by the
      patterns included in modpost but a few nees special attention.
      To avoid hardcoding a lot of function names in modpost introduce
      a marker so relevant function/data can be marked.
      When modpost see a reference to a init/exit function from
      a function/data marked no warning will be issued.
      
      Idea from: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      0e0d314e
    • L
      kbuild: add "Section mismatch" warning whitelist for powerpc · cd547791
      Li Yang 提交于
      This patch fixes the following class of "Section mismatch" warnings when
      building powerpc platforms.
      
      WARNING: arch/powerpc/kernel/built-in.o - Section mismatch: reference to .init.data:.got2 from prom_entry (offset 0x0)
      WARNING: arch/powerpc/platforms/built-in.o - Section mismatch: reference to .init.text:mpc8313_rdb_probe from .machine.desc after 'mach_mpc8313_rdb' (at offset 0x4)
      ....
      Signed-off-by: NLi Yang <leoli@freescale.com>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      cd547791
    • A
      kbuild: make better section mismatch reports on i386, arm and mips · f892b7d4
      Atsushi Nemoto 提交于
      On i386, ARM and MIPS, warn_sec_mismatch() sometimes fails to show
      usefull symbol name.  This is because empty 'refsym' due to 0 r_addend
      value.  This patch is to adjust r_addend value, consulting with
      apply_relocate() routine in kernel code.
      
      Without this patch:
        MODPOST vmlinux
      WARNING: init/built-in.o - Section mismatch: reference to .init.text: from .text between 'rest_init' (at offset 0xf4) and 'try_name'
      WARNING: mm/built-in.o - Section mismatch: reference to .init.text: from .text between 'kmem_cache_create' (at offset 0x18a39) and 'cache_reap'
      WARNING: mm/built-in.o - Section mismatch: reference to .init.text: from .text between 'kmem_cache_create' (at offset 0x18a6b) and 'cache_reap'
      
      With this patch:
        MODPOST vmlinux
      WARNING: mm/built-in.o - Section mismatch: reference to .init.text:set_up_list3s from .text between 'kmem_cache_create' (at offset 0x18a39) and 'cache_reap'
      WARNING: mm/built-in.o - Section mismatch: reference to .init.text:set_up_list3s from .text between 'kmem_cache_create' (at offset 0x18a6b) and 'cache_reap'
      
      Now modpost can detect "kernel_init" name (and whitelist it) and show
      "set_up_list3s" name.
      Signed-off-by: NAtsushi Nemoto <anemo@mba.ocn.ne.jp>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      f892b7d4
    • R
      kbuild: make modpost section warnings clearer · 25601209
      Russell King 提交于
      Change modpost section mismatch warnings to be less confusing;
      model them on the binutils linker warnings which we all know how
      to interpret.
      
      Also, fix the wrong ordering of arguments for the final case -
      fromsec and refsymname were reversed.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Acked-by: NAcked-by: David S. Miller <davem@davemloft.net>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      25601209
  5. 10 5月, 2007 1 次提交
  6. 09 5月, 2007 1 次提交
    • Y
      Add white list into modpost.c for memory hotplug code and ia64's machvec section · 72280ede
      Yasunori Goto 提交于
      This patch is add white list into modpost.c for some functions and
      ia64's section to fix section mismatchs.
      
        sparse_index_alloc() and zone_wait_table_init() calls bootmem allocator
        at boot time, and kmalloc/vmalloc at hotplug time. If config
        memory hotplug is on, there are references of bootmem allocater(init text)
        from them (normal text). This is cause of section mismatch.
      
        Bootmem is called by many functions and it must be
        used only at boot time. I think __init of them should keep for
        section mismatch check. So, I would like to register sparse_index_alloc()
        and zone_wait_table_init() into white list.
      
        In addition, ia64's .machvec section is function table of some platform
        dependent code. It is mixture of .init.text and normal text. These
        reference of __init functions are valid too.
      Signed-off-by: NYasunori Goto <y-goto@jp.fujitsu.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      72280ede
  7. 03 5月, 2007 9 次提交
  8. 21 2月, 2007 1 次提交
    • D
      [PATCH] remove modpost false warnings on ARM · da68d61f
      David Brownell 提交于
      This patch stops "modpost" from issuing erroneous modpost warnings on ARM
      builds, which it's been doing since since maybe last summer.  A canonical
      example would be driver method table entries:
      
        WARNING: <path> - Section mismatch: reference to .exit.text:<name>_remove
      	from .data after '$d' (at offset 0x4)
      
      That "$d" symbol is generated by tools conformant with ARM ABI specs; in
      this case it's a symbol **in the middle of** a "<name>_driver" struct.
      
      The erroneous warnings appear to be issued because "modpost" whitelists
      references from "<name>_driver" data into init and exit sections ...  but
      doesn't know should also include those "$d" mapping symbols, which are not
      otherwise associated with "<name>_driver" symbols.
      
      This patch prevents the modpost symbol lookup code from ever returning
      those mapping symbols, so it will return a whitelisted symbol instead.
      Then things work as expected.
      
      Now to revert various code-bloating "fixes" that got merged because of this
      modpost bug....
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Acked-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Acked-by: NSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      da68d61f
  9. 13 2月, 2007 1 次提交
    • V
      [PATCH] i386: move startup_32() in text.head section · f8657e1b
      Vivek Goyal 提交于
      o Entry startup_32 was in .text section but it was accessing some init
        data too and it prompts MODPOST to generate compilation warnings.
      
      WARNING: vmlinux - Section mismatch: reference to .init.data:boot_params from
      .text between '_text' (at offset 0xc0100029) and 'startup_32_smp'
      WARNING: vmlinux - Section mismatch: reference to .init.data:boot_params from
      .text between '_text' (at offset 0xc0100037) and 'startup_32_smp'
      WARNING: vmlinux - Section mismatch: reference to
      .init.data:init_pg_tables_end from .text between '_text' (at offset
      0xc0100099) and 'startup_32_smp'
      
      o Can't move startup_32 to .init.text as this entry point has to be at the
        start of bzImage. Hence moved startup_32 to a new section .text.head and
        instructed MODPOST to not to generate warnings if init data is being
        accessed from .text.head section. This code has been audited.
      
      o SMP boot up code (startup_32_smp) can go into .init.text if CPU hotplug
        is not supported. Otherwise it generates more warnings
      
      WARNING: vmlinux - Section mismatch: reference to .init.data:new_cpu_data from
      .text between 'checkCPUtype' (at offset 0xc0100126) and 'is486'
      WARNING: vmlinux - Section mismatch: reference to .init.data:new_cpu_data from
      .text between 'checkCPUtype' (at offset 0xc0100130) and 'is486'
      Signed-off-by: NVivek Goyal <vgoyal@in.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      f8657e1b
  10. 09 2月, 2007 1 次提交
    • M
      [PATCH] PA-RISC: Fix bogus warnings from modpost · 742433b0
      Matthew Wilcox 提交于
      parisc and parisc64 seem to name sections a little differently from other
      targets.  parisc64 gives spurious warnings like:
      
      WARNING: drivers/net/dummy.o - Section mismatch: reference to .init.text:dummy_setup from .data.rel.ro between '.LC1' (at offset 0x0) and '.LC6'
      
      and parisc gives spurious warnings like:
      
      WARNING: drivers/net/dummy.o - Section mismatch: reference to .init.text:dummy_setup from .rodata.cst4 between '.LC1' (at offset 0x0) and '.LC6'
      
      Given the other comments in modpost.c, it seems that the best solution is
      to move rodata down to the 'match at start of name' section and add
      .data.rel.ro to the 'match entire name' section.
      
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      742433b0
  11. 11 1月, 2007 2 次提交
    • V
      [PATCH] x86-64: Modpost whitelist reference to more symbols (pattern 3) · ee6a8545
      Vivek Goyal 提交于
      o MODPOST generates warning on i386 if kernel is compiled with
        CONFIG_RELOCATABLE=y.
      
      WARNING: vmlinux - Section mismatch: reference to .init.text:__init_begin from .text between 'free_initmem' (at offset 0xc0114fd3) and 'do_test_wp_bit'
      WARNING: vmlinux - Section mismatch: reference to .init.text:_sinittext from .text between 'core_kernel_text' (at offset 0xc012aeae) and 'kernel_text_address'
      WARNING: vmlinux - Section mismatch: reference to .init.text:_einittext from .text between 'core_kernel_text' (at offset 0xc012aeb7) and 'kernel_text_address'
      WARNING: vmlinux - Section mismatch: reference to .init.text:_sinittext from .text between 'get_symbol_pos' (at offset 0xc0135776) and 'reset_iter'
      WARNING: vmlinux - Section mismatch: reference to .init.text:_einittext from .text between 'get_symbol_pos' (at offset 0xc013577d) and 'reset_iter'
      
      o These symbols (__init_begin, _sinittext, _einittext) belong to init
        section and generally represent a section boundary. These are special
        symbols in the sense that their size is zero and no memory is allocated
        for them in init section. Their addr and value are same. So even if
        we free the init section, it is ok to reference them.
      
      o Whitelist access to such select symbols in MODPOST.
      Signed-off-by: NVivek Goyal <vgoyal@in.ibm.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      ee6a8545
    • V
      [PATCH] x86-64: modpost add more symbols to whitelist pattern2 · 118c0ace
      Vivek Goyal 提交于
      o MODPOST generates warning for i386 if compiled with CONFIG_RELOCATABLE=y
        and serial console support is enabled.
      
      o Serial console setup function, serial8250_console_setup(), is a non __init
        function and it calls functions which are of type __init().
        (uart_parse_options() and uart_set_options()). Assuming, setup will
        be called during init time, changing serial8250_console_setup() to __init.
      
      o Adding one more pattern to modpost whitelist. Console drivers might
        have *_console structures containing references to setup functions which
        can be of __init type. Don't generate warnings for those.
      
      WARNING: vmlinux - Section mismatch: reference to .init.text: from .data between 'serial8250_console' (at offset 0xc05a33d8) and 'serial8250_reg'
      Signed-off-by: NVivek Goyal <vgoyal@in.ibm.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      118c0ace
  12. 14 12月, 2006 1 次提交
  13. 07 12月, 2006 1 次提交
    • R
      [PATCH] paravirt: Patch inline replacements for paravirt intercepts · 139ec7c4
      Rusty Russell 提交于
      It turns out that the most called ops, by several orders of magnitude,
      are the interrupt manipulation ops.  These are obvious candidates for
      patching, so mark them up and create infrastructure for it.
      
      The method used is that the ops structure has a patch function, which
      is called for each place which needs to be patched: this returns a
      number of instructions (the rest are NOP-padded).
      
      Usually we can spare a register (%eax) for the binary patched code to
      use, but in a couple of critical places in entry.S we can't: we make
      the clobbers explicit at the call site, and manually clobber the
      allowed registers in debug mode as an extra check.
      
      And:
      
      Don't abuse CONFIG_DEBUG_KERNEL, add CONFIG_DEBUG_PARAVIRT.
      
      And:
      
      AK:  Fix warnings in x86-64 alternative.c build
      
      And:
      
      AK: Fix compilation with defconfig
      
      And:
      
      ^From: Andrew Morton <akpm@osdl.org>
      
      Some binutlises still like to emit references to __stop_parainstructions and
      __start_parainstructions.
      
      And:
      
      AK: Fix warnings about unused variables when PARAVIRT is disabled.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NJeremy Fitzhardinge <jeremy@xensource.com>
      Signed-off-by: NChris Wright <chrisw@sous-sol.org>
      Signed-off-by: NZachary Amsden <zach@vmware.com>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      139ec7c4
  14. 25 10月, 2006 1 次提交
  15. 25 9月, 2006 2 次提交