Skip to content
Snippets Groups Projects
  1. Mar 13, 2017
  2. Mar 03, 2017
  3. Mar 01, 2017
  4. Feb 14, 2015
    • Andrey Ryabinin's avatar
      kernel: add support for .init_array.* constructors · 9ddf8252
      Andrey Ryabinin authored
      
      KASan uses constructors for initializing redzones for global variables.
      Globals instrumentation in GCC 4.9.2 produces constructors with priority
      (.init_array.00099)
      
      Currently kernel ignores such constructors.  Only constructors with
      default priority supported (.init_array)
      
      This patch adds support for constructors with priorities.  For kernel
      image we put pointers to constructors between __ctors_start/__ctors_end
      and do_ctors() will call them on start up.  For modules we merge
      .init_array.* sections into resulting .init_array.  Module code properly
      handles constructors in .init_array section.
      
      Signed-off-by: default avatarAndrey Ryabinin <a.ryabinin@samsung.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Konstantin Serebryany <kcc@google.com>
      Cc: Dmitry Chernenkov <dmitryc@google.com>
      Signed-off-by: default avatarAndrey Konovalov <adech.fo@gmail.com>
      Cc: Yuri Gribov <tetra2005@gmail.com>
      Cc: Konstantin Khlebnikov <koct9i@gmail.com>
      Cc: Sasha Levin <sasha.levin@oracle.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      Cc: David Rientjes <rientjes@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9ddf8252
  5. Feb 06, 2015
    • Rabin Vincent's avatar
      module: set ksymtab/kcrctab* section addresses to 0x0 · 5d8591bc
      Rabin Vincent authored
      
      These __ksymtab*/__kcrctab* sections currently have non-zero addresses.
      Non-zero section addresses in a relocatable ELF confuse GDB and it ends
      up not relocating all symbols when add-symbol-file is used on modules
      which have exports.  The kernel's module loader does not care about
      these addresses, so let's just set them to zero.
      
       Before:
      
        $ readelf -S lib/notifier-error-inject.ko   | grep 'Name\| __ksymtab_gpl'
          [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
          [ 8] __ksymtab_gpl     PROGBITS        0000000c 0001b4 000010 00   A  0   0  4
      
        (gdb) add-symbol-file lib/notifier-error-inject.ko 0x500000 -s .bss 0x700000
        add symbol table from file "lib/notifier-error-inject.ko" at
           .text_addr = 0x500000
           .bss_addr = 0x700000
        (gdb) p &notifier_err_inject_dir
        $3 = (struct dentry **) 0x0
      
       After:
      
        $ readelf -S lib/notifier-error-inject.ko   | grep 'Name\| __ksymtab_gpl'
          [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
          [ 8] __ksymtab_gpl     PROGBITS        00000000 0001b4 000010 00   A  0   0  4
      
        (gdb) add-symbol-file lib/notifier-error-inject.ko 0x500000 -s .bss 0x700000
        add symbol table from file "lib/notifier-error-inject.ko" at
           .text_addr = 0x500000
           .bss_addr = 0x700000
        (gdb) p &notifier_err_inject_dir
        $3 = (struct dentry **) 0x700000
      
      Signed-off-by: default avatarRabin Vincent <rabin.vincent@axis.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      5d8591bc
  6. May 19, 2011
    • Alessio Igor Bogani's avatar
      module: Sort exported symbols · f02e8a65
      Alessio Igor Bogani authored
      
      This patch places every exported symbol in its own section
      (i.e. "___ksymtab+printk").  Thus the linker will use its SORT() directive
      to sort and finally merge all symbol in the right and final section
      (i.e. "__ksymtab").
      
      The symbol prefixed archs use an underscore as prefix for symbols.
      To avoid collision we use a different character to create the temporary
      section names.
      
      This work was supported by a hardware donation from the CE Linux Forum.
      
      Signed-off-by: default avatarAlessio Igor Bogani <abogani@kernel.org>
      Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (folded in '+' fixup)
      Tested-by: default avatarDirk Behme <dirk.behme@googlemail.com>
      f02e8a65
  7. Jun 24, 2009
    • Tejun Heo's avatar
      linker script: throw away .discard section · 405d967d
      Tejun Heo authored
      
      x86 throws away .discard section but no other archs do.  Also,
      .discard is not thrown away while linking modules.  Make every arch
      and module linking throw it away.  This will be used to define dummy
      variables for percpu declarations and definitions.
      
      This patch is based on Ivan Kokshaysky's alpha percpu patch.
      
      [ Impact: always throw away everything in .discard ]
      
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
      Cc: Bryan Wu <cooloney@kernel.org>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Hirokazu Takata <takata@linux-m32r.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Ingo Molnar <mingo@elte.hu>
      405d967d
Loading