1. 03 2月, 2011 2 次提交
    • M
      tracepoints: Fix section alignment using pointer array · 65498646
      Mathieu Desnoyers 提交于
      Make the tracepoints more robust, making them solid enough to handle compiler
      changes by not relying on anything based on compiler-specific behavior with
      respect to structure alignment. Implement an approach proposed by David Miller:
      use an array of const pointers to refer to the individual structures, and export
      this pointer array through the linker script rather than the structures per se.
      It will consume 32 extra bytes per tracepoint (24 for structure padding and 8
      for the pointers), but are less likely to break due to compiler changes.
      
      History:
      
      commit 7e066fb8 tracepoints: add DECLARE_TRACE() and DEFINE_TRACE()
      added the aligned(32) type and variable attribute to the tracepoint structures
      to deal with gcc happily aligning statically defined structures on 32-byte
      multiples.
      
      One attempt was to use a 8-byte alignment for tracepoint structures by applying
      both the variable and type attribute to tracepoint structures definitions and
      declarations. It worked fine with gcc 4.5.1, but broke with gcc 4.4.4 and 4.4.5.
      
      The reason is that the "aligned" attribute only specify the _minimum_ alignment
      for a structure, leaving both the compiler and the linker free to align on
      larger multiples. Because tracepoint.c expects the structures to be placed as an
      array within each section, up-alignment cause NULL-pointer exceptions due to the
      extra unexpected padding.
      
      (this patch applies on top of -tip)
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      LKML-Reference: <20110126222622.GA10794@Krystal>
      CC: Frederic Weisbecker <fweisbec@gmail.com>
      CC: Ingo Molnar <mingo@elte.hu>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Andrew Morton <akpm@linux-foundation.org>
      CC: Peter Zijlstra <peterz@infradead.org>
      CC: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      65498646
    • S
      tracing: Replace trace_event struct array with pointer array · e4a9ea5e
      Steven Rostedt 提交于
      Currently the trace_event structures are placed in the _ftrace_events
      section, and at link time, the linker makes one large array of all
      the trace_event structures. On boot up, this array is read (much like
      the initcall sections) and the events are processed.
      
      The problem is that there is no guarantee that gcc will place complex
      structures nicely together in an array format. Two structures in the
      same file may be placed awkwardly, because gcc has no clue that they
      are suppose to be in an array.
      
      A hack was used previous to force the alignment to 4, to pack the
      structures together. But this caused alignment issues with other
      architectures (sparc).
      
      Instead of packing the structures into an array, the structures' addresses
      are now put into the _ftrace_event section. As pointers are always the
      natural alignment, gcc should always pack them tightly together
      (otherwise initcall, extable, etc would also fail).
      
      By having the pointers to the structures in the section, we can still
      iterate the trace_events without causing unnecessary alignment problems
      with other architectures, or depending on the current behaviour of
      gcc that will likely change in the future just to tick us kernel developers
      off a little more.
      
      The _ftrace_event section is also moved into the .init.data section
      as it is now only needed at boot up.
      Suggested-by: NDavid Miller <davem@davemloft.net>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      e4a9ea5e
  2. 24 1月, 2011 1 次提交
    • D
      module: show version information for built-in modules in sysfs · e94965ed
      Dmitry Torokhov 提交于
      Currently only drivers that are built as modules have their versions
      shown in /sys/module/<module_name>/version, but this information might
      also be useful for built-in drivers as well. This especially important
      for drivers that do not define any parameters - such drivers, if
      built-in, are completely invisible from userspace.
      
      This patch changes MODULE_VERSION() macro so that in case when we are
      compiling built-in module, version information is stored in a separate
      section. Kernel then uses this data to create 'version' sysfs attribute
      in the same fashion it creates attributes for module parameters.
      Signed-off-by: NDmitry Torokhov <dtor@vmware.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      e94965ed
  3. 14 1月, 2011 1 次提交
  4. 24 12月, 2010 1 次提交
    • D
      of: Add support for linking device tree blobs into vmlinux · aab94339
      Dirk Brandewie 提交于
      This patch adds support for linking device tree blob(s) into
      vmlinux. Modifies asm-generic/vmlinux.lds.h to add linking
      .dtb sections into vmlinux. To maintain compatiblity with the of/fdt
      driver code platforms MUST copy the blob to a non-init memory location
      before the kernel frees the .init.* sections in the image.
      
      Modifies scripts/Makefile.lib to add a kbuild command to
      compile DTS files to device tree blobs and a rule to create objects to
      wrap the blobs for linking.
      
      STRUCT_ALIGNMENT is defined in vmlinux.lds.h for use in the rule to
      create wrapper objects for the dtb in Makefile.lib.  The
      STRUCT_ALIGN() macro in vmlinux.lds.h is modified to use the
      STRUCT_ALIGNMENT definition.
      
      The DTB's are placed on 32 byte boundries to allow parsing the blob
      with driver/of/fdt.c during early boot without having to copy the blob
      to get the structure alignment GCC expects.
      
      A DTB is linked in by adding the DTB object to the list of objects to
      be linked into vmlinux in the archtecture specific Makefile using
         obj-y += foo.dtb.o
      Signed-off-by: NDirk Brandewie <dirk.brandewie@gmail.com>
      Acked-by: NMichal Marek <mmarek@suse.cz>
      [grant.likely@secretlab.ca: cleaned up whitespace inconsistencies]
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      aab94339
  5. 27 10月, 2010 2 次提交
    • M
      vmlinux.lds.h: lower init ramfs alignment to 4 · d8826262
      Mike Frysinger 提交于
      The new init ramfs format (cpio based) requires an alignment of 4 (per the
      documentation and per the source files themselves).  As for compressed
      sources, the decompressors can all deal with unaligned buffers.
      
      The cpio source is also found in the __init sections of the kernel, so
      once they are read and expanded into a tmpfs, the source is freed.  That
      means there is no need to force page alignment here either.
      
      This has been used on Blackfin systems for many releases without issue.
      Signed-off-by: NMike Frysinger <vapier@gentoo.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: <linux-arch@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d8826262
    • M
      vmlinux.lds.h: gather .data..shared_aligned sections in DATA_DATA · d356c0b6
      Mike Frysinger 提交于
      With the recent change "net: remove time limit in process_backlog()", the
      softnet_data variable changed from "DEFINE_PER_CPU()" to
      "DEFINE_PER_CPU_ALIGNED()" which moved it from the .data section to the
      .data.shared_align section.  I'm not saying this patch is wrong, just that
      is what caused me to notice this larger problem.  No one else in the
      kernel is using this aligned macro variant, so I imagine that's why no one
      has noticed yet.
      
      Since .data..shared_align isn't declared in any vmlinux files that I can
      see, the linker just places it last.  This "just works" for most people,
      but when building a ROM kernel on Blackfin systems, it causes section
      overlap errors:
      
      bfin-uclinux-ld.real:
      	section .init.data [00000000202e06b8 -> 00000000202e48b7] overlaps
      	section .data.shared_aligned [00000000202e06b8 -> 00000000202e0723]
      
      I imagine other arches which support the ROM config option and thus do
      funky placement would see similar issues ...
      
      On x86, it is stuck in a dedicated section at the end:
       [8] .data             PROGBITS ffffffff810ec000 2ec0000303a8 00 WA 0 0 4096
       [9] .data.shared_alig PROGBITS ffffffff8111c3c0 31c3c00000c8 00 WA 0 0 64
      
      So make sure we include this section in the DATA_DATA macro so that it is
      placed in the right location.
      Signed-off-by: NMike Frysinger <vapier@gentoo.org>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
      Cc: Greg Ungerer <gerg@snapgear.com>
      Cc: <linux-arch@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d356c0b6
  6. 21 10月, 2010 2 次提交
    • H
      x86-32, percpu: Correct the ordering of the percpu readmostly section · 2aeb66d3
      H. Peter Anvin 提交于
      Checkin c957ef2c had inconsistent
      ordering of .data..percpu..page_aligned and .data..percpu..readmostly;
      the still-broken version affected x86-32 at least.
      
      The page aligned version really must be page aligned...
      Signed-off-by: NH. Peter Anvin <hpa@zytor.com>
      LKML-Reference: <1287544022.4571.7.camel@sli10-conroe.sh.intel.com>
      Cc: Shaohua Li <shaohua.li@intel.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      2aeb66d3
    • S
      percpu: Introduce a read-mostly percpu API · c957ef2c
      Shaohua Li 提交于
      Add a new readmostly percpu section and API.  This can be used to
      avoid dirtying data lines which are generally not written to, which is
      especially important for data which may be accessed by processors
      other than the one for which the percpu area belongs to.
      
      [ hpa: moved it *after* the page-aligned section, for obvious
        reasons. ]
      Signed-off-by: NShaohua Li <shaohua.li@intel.com>
      LKML-Reference: <1287544022.4571.7.camel@sli10-conroe.sh.intel.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      c957ef2c
  7. 29 9月, 2010 1 次提交
    • H
      initramfs: fix initramfs size calculation · ffe8018c
      Hendrik Brueckner 提交于
      The size of a built-in initramfs is calculated in init/initramfs.c by
      "__initramfs_end - __initramfs_start".  Those symbols are defined in the
      linker script include/asm-generic/vmlinux.lds.h:
      
      #define INIT_RAM_FS                                                     \
              . = ALIGN(PAGE_SIZE);                                           \
              VMLINUX_SYMBOL(__initramfs_start) = .;                          \
              *(.init.ramfs)                                                  \
              VMLINUX_SYMBOL(__initramfs_end) = .;
      
      If the initramfs file has an odd number of bytes, the "__initramfs_end"
      symbol points to an odd address, for example, the symbols in the
      System.map might look like:
      
          0000000000572000 T __initramfs_start
          00000000005bcd05 T __initramfs_end	  <-- odd address
      
      At least on s390 this causes a problem:
      
      Certain s390 instructions, especially instructions for loading addresses
      (larl) or branch addresses must be on even addresses.  The compiler loads
      the symbol addresses with the "larl" instruction.  This instruction sets
      the last bit to 0 and, therefore, for odd size files, the calculated size
      is one byte less than it should be:
      
          0000000000540a9c <populate_rootfs>:
            540a9c:     eb cf f0 78 00 24       stmg    %r12,%r15,120(%r15),
            540aa2:     c0 10 00 01 8a af       larl    %r1,572000 <__initramfs_start>
            540aa8:     c0 c0 00 03 e1 2e       larl    %r12,5bcd04 <initramfs_end>
                                                        (Instead of  5bcd05)
            ...
            540abe:     1b c1                   sr      %r12,%r1
      
      To fix the problem, this patch introduces the global variable
      __initramfs_size, which is calculated in the "usr/initramfs_data.S" file.
      The populate_rootfs() function can then use the start marker of the
      .init.ramfs section and the value of __initramfs_size for loading the
      initramfs.  Because the start marker and size is sufficient, the
      __initramfs_end symbol is no longer needed and is removed.
      Signed-off-by: NMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: NHendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Reviewed-by: NWANG Cong <xiyou.wangcong@gmail.com>
      Acked-by: NMichal Marek <mmarek@suse.cz>
      Acked-by: N"H. Peter Anvin" <hpa@zytor.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      ffe8018c
  8. 23 9月, 2010 1 次提交
    • J
      jump label: Base patch for jump label · bf5438fc
      Jason Baron 提交于
      base patch to implement 'jump labeling'. Based on a new 'asm goto' inline
      assembly gcc mechanism, we can now branch to labels from an 'asm goto'
      statment. This allows us to create a 'no-op' fastpath, which can subsequently
      be patched with a jump to the slowpath code. This is useful for code which
      might be rarely used, but which we'd like to be able to call, if needed.
      Tracepoints are the current usecase that these are being implemented for.
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NJason Baron <jbaron@redhat.com>
      LKML-Reference: <ee8b3595967989fdaf84e698dc7447d315ce972a.1284733808.git.jbaron@redhat.com>
      
      [ cleaned up some formating ]
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      bf5438fc
  9. 28 7月, 2010 1 次提交
  10. 23 7月, 2010 1 次提交
  11. 21 7月, 2010 1 次提交
    • S
      tracing: Properly align linker defined symbols · 07fca0e5
      Sam Ravnborg 提交于
      We define a number of symbols in the linker scipt like this:
      
          __start_syscalls_metadata = .;
          *(__syscalls_metadata)
      
      But we do not know the alignment of "." when we assign
      the __start_syscalls_metadata symbol.
      gcc started to uses bigger alignment for structs (32 bytes),
      so we saw situations where the linker due to alignment
      constraints increased the value of "." after the symbol assignment.
      
      This resulted in boot fails.
      
      Fix this by forcing a 32 byte alignment of "." before the
      assignment.
      
      This patch introduces the forced alignment for
      ftrace_events and syscalls_metadata.
      It may be required in more places.
      Reported-by: NZeev Tarantov <zeev.tarantov@gmail.com>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      LKML-Reference: <20100710063459.GA14596@merkur.ravnborg.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      07fca0e5
  12. 16 7月, 2010 1 次提交
  13. 28 5月, 2010 2 次提交
  14. 03 3月, 2010 7 次提交
  15. 15 12月, 2009 1 次提交
    • A
      module: make MODULE_SYMBOL_PREFIX into a CONFIG option · 9e1b9b80
      Alan Jenkins 提交于
      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: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Acked-by: Mike Frysinger <vapier@gentoo.org> (blackfin)
      CC: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      9e1b9b80
  16. 25 9月, 2009 1 次提交
  17. 13 9月, 2009 1 次提交
    • J
      ftrace: __start_mcount_loc should be .init.rodata · 4b3b4c5e
      John Reiser 提交于
      __start_mcount_loc[] is unused after init, yet occupies RAM forever
      as part of .rodata.  152kiB is typical on a 64-bit architecture.  Instead,
      __start_mcount_loc should be in the interval [__init_begin, __init_end)
      so that the space is reclaimed after init.
      
      __start_mcount_loc[] is generated during the load portion
      of kernel build, and is used only by ftrace_init().  ftrace_init is declared
      '__init' and is in .init.text, which is freed after init.
      __start_mcount_loc is placed into .rodata by a call to MCOUNT_REC inside
      the RO_DATA macro of include/asm-generic/vmlinux.lds.h.  The array *is*
      read-only, but more importantly it is not used after init.  So the call to
      MCOUNT_REC should be moved from RO_DATA to INIT_DATA.
      
      This patch has been tested on x86_64 with CONFIG_DEBUG_PAGEALLOC=y
      which verifies that the address range never is accessed after init.
      Signed-off-by: NJohn Reiser <jreiser@BitWagon.com>
      LKML-Reference: <4A6DF0B6.7080402@bitwagon.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      4b3b4c5e
  18. 18 7月, 2009 1 次提交
    • T
      vmlinux.lds.h: restructure BSS linker script macros · 04e448d9
      Tim Abbott 提交于
      The BSS section macros in vmlinux.lds.h currently place the .sbss
      input section outside the bounds of [__bss_start, __bss_end].  On all
      architectures except for microblaze that handle both .sbss and
      __bss_start/__bss_end, this is wrong: the .sbss input section is
      within the range [__bss_start, __bss_end].  Relatedly, the example
      code at the top of the file actually has __bss_start/__bss_end defined
      twice; I believe the right fix here is to define them in the
      BSS_SECTION macro but not in the BSS macro.
      
      Another problem with the current macros is that several
      architectures have an ALIGN(4) or some other small number just before
      __bss_stop in their linker scripts.  The BSS_SECTION macro currently
      hardcodes this to 4; while it should really be an argument.  It also
      ignores its sbss_align argument; fix that.
      
      mn10300 is the only user at present of any of the macros touched by
      this patch.  It looks like mn10300 actually was incorrectly converted
      to use the new BSS() macro (the alignment of 4 prior to conversion was
      a __bss_stop alignment, but the argument to the BSS macro is a start
      alignment).  So fix this as well.
      
      I'd like acks from Sam and David on this one.  Also CCing Paul, since
      he has a patch from me which will need to be updated to use
      BSS_SECTION(0, PAGE_SIZE, 4) once this gets merged.
      Signed-off-by: NTim Abbott <tabbott@ksplice.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: David Howells <dhowells@redhat.com>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      04e448d9
  19. 09 7月, 2009 1 次提交
    • T
      linker script: unify usage of discard definition · 023bf6f1
      Tejun Heo 提交于
      Discarded sections in different archs share some commonality but have
      considerable differences.  This led to linker script for each arch
      implementing its own /DISCARD/ definition, which makes maintaining
      tedious and adding new entries error-prone.
      
      This patch makes all linker scripts to move discard definitions to the
      end of the linker script and use the common DISCARDS macro.  As ld
      uses the first matching section definition, archs can include default
      discarded sections by including them earlier in the linker script.
      
      ia64 is notable because it first throws away some ia64 specific
      subsections and then include the rest of the sections into the final
      image, so those sections must be discarded before the inclusion.
      
      defconfig compile tested for x86, x86-64, powerpc, powerpc64, ia64,
      alpha, sparc, sparc64 and s390.  Michal Simek tested microblaze.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NPaul Mundt <lethal@linux-sh.org>
      Acked-by: NMike Frysinger <vapier@gentoo.org>
      Tested-by: NMichal Simek <monstr@monstr.eu>
      Cc: linux-arch@vger.kernel.org
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: microblaze-uclinux@itee.uq.edu.au
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Tony Luck <tony.luck@intel.com>
      023bf6f1
  20. 01 7月, 2009 1 次提交
    • H
      gcov: fix __ctors_start alignment · 2a2325e6
      Heiko Carstens 提交于
      The ctors section for each object file is eight byte aligned (on 64 bit).
      However the __ctors_start symbol starts at an arbitrary address dependent
      on the size of the previous sections.
      
      Therefore the linker may add some zeroes after __ctors_start to make sure
      the ctors contents are properly aligned.  However the extra zeroes at the
      beginning aren't expected by the code.  When walking the functions
      pointers contained in there and extra zeroes are added this may result in
      random jumps.  So make sure that the __ctors_start symbol is always
      aligned as well.
      
      Fixes this crash on an allyesconfig on s390:
      
      [    0.582482] Kernel BUG at 0000000000000012 [verbose debug info unavailable]
      [    0.582489] illegal operation: 0001 [#1] SMP DEBUG_PAGEALLOC
      [    0.582496] Modules linked in:
      [    0.582501] CPU: 0 Tainted: G        W  2.6.31-rc1-dirty #273
      [    0.582506] Process swapper (pid: 1, task: 000000003f218000, ksp: 000000003f2238e8)
      [    0.582510] Krnl PSW : 0704200180000000 0000000000000012 (0x12)
      [    0.582518]            R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:0 CC:2 PM:0 EA:3
      [    0.582524] Krnl GPRS: 0000000000036727 0000000000000010 0000000000000001 0000000000000001
      [    0.582529]            00000000001dfefa 0000000000000000 0000000000000000 0000000000000040
      [    0.582534]            0000000001fff0f0 0000000001790628 0000000002296048 0000000002296048
      [    0.582540]            00000000020c438e 0000000001786000 0000000002014a66 000000003f223e60
      [    0.582553] Krnl Code:>0000000000000012: 0000                unknown
      [    0.582559]            0000000000000014: 0000                unknown
      [    0.582564]            0000000000000016: 0000                unknown
      [    0.582570]            0000000000000018: 0000                unknown
      [    0.582575]            000000000000001a: 0000                unknown
      [    0.582580]            000000000000001c: 0000                unknown
      [    0.582585]            000000000000001e: 0000                unknown
      [    0.582591]            0000000000000020: 0000                unknown
      [    0.582596] Call Trace:
      [    0.582599] ([<0000000002014a46>] kernel_init+0x622/0x7a0)
      [    0.582607]  [<0000000000113e22>] kernel_thread_starter+0x6/0xc
      [    0.582615]  [<0000000000113e1c>] kernel_thread_starter+0x0/0xc
      [    0.582621] INFO: lockdep is turned off.
      [    0.582624] Last Breaking-Event-Address:
      [    0.582627]  [<0000000002014a64>] kernel_init+0x640/0x7a0
      
      Cc: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2a2325e6
  21. 27 6月, 2009 2 次提交
    • T
      asm-generic/vmlinux.lds.h: shuffle INIT_TASK* macro names in vmlinux.lds.h · 39a449d9
      Tim Abbott 提交于
      We recently added a INIT_TASK(align) in include/asm-generic/vmlinux.lds.h,
      but there is already a macro INIT_TASK in include/linux/init_task.h, which
      is quite confusing.  We should switch the macro in the linker script to
      INIT_TASK_DATA. (Sorry that I missed this in reviewing the patch).  Since
      the macros are new, there is only one user of the INIT_TASK in
      vmlinux.lds.h, arch/mn10300/kernel/vmlinux.lds.S.
      
      However, we are currently using INIT_TASK_DATA for laying down an entire
      .data.init_task section.  So rename that to INIT_TASK_DATA_SECTION.
      
      I would be worried about changing the meaning of INIT_TASK_DATA, but the
      old INIT_TASK_DATA implementation had no users, and in fact if anyone had
      tried to use it, it would have failed to compile because it didn't pass
      the alignment to the old INIT_TASK.
      Signed-off-by: NTim Abbott <tabbott@ksplice.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Jesper Nilsson <Jesper.Nilsson@axis.com
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      39a449d9
    • P
      asm-generic/vmlinux.lds.h: Fix up RW_DATA_SECTION definition. · 73f1d939
      Paul Mundt 提交于
      RW_DATA_SECTION is defined to take 4 different alignment parameters,
      while NOSAVE_DATA currently uses a fixed PAGE_SIZE alignment as noted
      in the comments.
      
      There are presently no in-tree users of this at present, and I just
      stumbled across this while implementing the simplified script on a new
      architecture port, which subsequently resulted in a syntax error.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      73f1d939
  22. 24 6月, 2009 1 次提交
    • T
      linker script: throw away .discard section · 405d967d
      Tejun Heo 提交于
      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: NTejun 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
  23. 23 6月, 2009 1 次提交
  24. 19 6月, 2009 1 次提交
  25. 15 6月, 2009 1 次提交
    • S
      vmlinux.lds.h update · 7923f90f
      Sam Ravnborg 提交于
      Updated after review by Tim Abbott.
      - Use HEAD_TEXT_SECTION
      - Drop use of section-names.h and delete file
      - Introduce EXIT_CALL
      
      Deleting section-names.h required a few simple
      updates of init.h
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Tim Abbott <tabbott@ksplice.com>
      7923f90f
  26. 10 6月, 2009 2 次提交
    • S
      Improve vmlinux.lds.h support for arch specific linker scripts · ef53dae8
      Sam Ravnborg 提交于
      To support alingment of the individual architecture specific linker scripts
      provide a set of general definitions in vmlinux.lds.h
      
      With these definitions applied the diverse linekr scripts can be reduced
      in line count and their readability are improved - IMO.
      
      A sample linker script is included to give the preferred
      order of the sections for the architectures that do not
      have any special requirments.
      
      These definitions are also a first step towards eventual
      support for -ffunction-sections.
      The definitions makes it much easier to do a global
      renaming of section names - but the main purpose is
      to clean up the linker scripts.
      
      Tim Aboot has provided a lot of inputs to improve
      the definitions - all faults are mine.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Tim Abbott <tabbott@mit.edu>
      ef53dae8
    • J
      initconst adjustments · fd6c3a8d
      Jan Beulich 提交于
      - 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: NJan Beulich <jbeulich@novell.com>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      fd6c3a8d
  27. 28 4月, 2009 1 次提交
  28. 27 4月, 2009 1 次提交
    • T
      Add new HEAD_TEXT_SECTION macro. · c80d471a
      Tim Abbott 提交于
      This patch is preparation for replacing all uses of ".head.text" or
      ".text.head" in the kernel with macros, so that the section name can
      later be changed without having to touch a lot of the kernel.
      
      Since some linker scripts do more complex things than referencing
      HEAD_TEXT, we add a HEAD_TEXT_SECTION macro that just contains the
      actual name.
      
      I've defined HEAD_TEXT_SECTION in a new header,
      include/linux/section-names.h, so that this section name only needs to
      appear in one place.  I anticipate creating similar macro structures
      for a number of other section names.
      
      The long-term goal here is to be able to change the kernel's magic
      section names to those that are compatible with -ffunction-sections
      -fdata-sections.  This requires renaming all magic sections with names
      of the form ".text.foo".
      Signed-off-by: NTim Abbott <tabbott@mit.edu>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c80d471a