1. 26 Sep, 2011 2 commits
  2. 20 Sep, 2011 1 commit
    • Russell King's avatar
      ARM: fix vmlinux.lds.S discarding sections · 6760b109
      Russell King authored
      We are seeing linker errors caused by sections being discarded, despite
      the linker script trying to keep them.  The result is (eg):
      
      `.exit.text' referenced in section `.alt.smp.init' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o
      `.exit.text' referenced in section `.alt.smp.init' of net/built-in.o: defined in discarded section `.exit.text' of net/built-in.o
      
      This is the relevent part of the linker script (reformatted to make it
      clearer):
      | SECTIONS
      | {
      | /*
      | * unwind exit sections must be discarded before the rest of the
      | * unwind sections get included.
      | */
      | /DISCARD/ : {
      | *(.ARM.exidx.exit.text)
      | *(.ARM.extab.exit.text)
      | }
      | ...
      | .exit.text : {
      | *(.exit.text)
      | *(.memexit.text)
      | }
      | ...
      | /DISCARD/ : {
      | *(.exit.text)
      | *(.memexit.text)
      | *(.exit.data)
      | *(.memexit.data)
      | *(.memexit.rodata)
      | *(.exitcall.exit)
      | *(.discard)
      | *(.discard.*)
      | }
      | }
      
      Now, this is what the linker manual says about discarded output sections:
      
      |    The special output section name `/DISCARD/' may be used to discard
      | input sections.  Any input sections which are assigned to an output
      | section named `/DISCARD/' are not included in the output file.
      
      No questions, no exceptions. It doesn't say "unless they are listed
      before the /DISCARD/ section." Now, this is what asn-generic/vmlinux.lds.S
      says:
      | /*
      |  * Default discarded sections.
      |  *
      |  * Some archs want to discard exit text/data at runtime rather than
      |  * link time due to cross-section references such as alt instructions,
      |  * bug table, eh_frame, etc. DISCARDS must be the last of output
      |  * section definitions so that such archs put those in earlier section
      |  * definitions.
      |  */
      
      And guess what - the list _always_ includes .exit.text etc.
      
      Now, what's actually happening is that the linker is reading the script,
      and it finds the first /DISCARD/ output section at the beginning of the
      script. It continues reading the script, and finds the 'DISCARD' macro
      at the end, which having been postprocessed results in another
      /DISCARD/ output section. As the linker already contains the earlier
      /DISCARD/ output section, it adds it to that existing section, so it
      effectively is placed at the start. This can be seen by using the -M
      option to ld:
      
      | Linker script and memory map
      |
      |                 0xc037c080                jiffies = jiffies_64
      |
      | /DISCARD/
      |  *(.ARM.exidx.exit.text)
      |  *(.ARM.extab.exit.text)
      |  *(.exit.text)
      |  *(.memexit.text)
      |  *(.exit.data)
      |  *(.memexit.data)
      |  *(.memexit.rodata)
      |  *(.exitcall.exit)
      |  *(.discard)
      |  *(.discard.*)
      |
      |                 0xc0008000                . = 0xc0008000
      |
      | .head.text      0xc0008000      0x1d0
      |                 0xc0008000                _text = .
      |  *(.head.text)
      |  .head.text     0xc0008000      0x1d0 arch/arm/kernel/head.o
      |                 0xc0008000                stext
      |
      | .text           0xc0008200   0x2d78d0
      |                 0xc0008200                _stext = .
      |                 0xc0008200                __exception_text_start = .
      |  *(.exception.text)
      |  .exception.text
      | ...
      
      As you can see, all the discarded sections are grouped together - and
      as a result of it being the first output section, they all appear before
      any other section.
      
      The result is that not only is the unwind information discarded (as
      intended), but also the .exit.text, despite us wanting to have the
      .exit.text preserved.
      
      We can't move the unwind information elsewhere, because it'll then be
      included even when we do actually discard the .exit.text (and similar)
      sections.
      
      So, work around this by avoiding the generic DISCARDS macro, and instead
      conditionalize the sections to be discarded ourselves.  This avoids the
      ambiguity in how the linker assigns input sections to output sections,
      making our script less dependent on undocumented linker behaviour.
      Reported-by: default avatarRob Herring <robherring2@gmail.com>
      Tested-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      6760b109
  3. 17 Sep, 2011 2 commits
  4. 16 Sep, 2011 3 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://github.com/dtor/input · 279b1e0f
      Linus Torvalds authored
      * 'for-linus' of git://github.com/dtor/input:
        Input: wacom - fix touch parsing on newer Bamboos
        Input: bcm5974 - add MacBookAir4,1 trackpad support
        Input: wacom - add POINTER and DIRECT device properties
        Input: adp5588-keys - remove incorrect modalias
        Input: cm109 - fix checking return value of usb_control_msg
        Input: wacom - advertise BTN_TOOL_PEN and BTN_STYLUS for PenPartner
        Input: wacom - remove pressure for touch devices
      279b1e0f
    • Linus Torvalds's avatar
      Merge branch 'stable/bug.fixes' of git://oss.oracle.com/git/kwilk/xen · abbe0d3c
      Linus Torvalds authored
      * 'stable/bug.fixes' of git://oss.oracle.com/git/kwilk/xen:
        xen/i386: follow-up to "replace order-based range checking of M2P table by linear one"
        xen/irq: Alter the locking to use a mutex instead of a spinlock.
        xen/e820: if there is no dom0_mem=, don't tweak extra_pages.
        xen: disable PV spinlocks on HVM
      abbe0d3c
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://github.com/tiwai/sound · c455ea4f
      Linus Torvalds authored
      * 'for-linus' of git://github.com/tiwai/sound:
        ALSA: pcm - fix race condition in wait_for_avail()
        ALSA: HDA: Cirrus - fix "Surround Speaker" volume control name
        ALSA: hda - Terminate the recursive connection search properly
        ASoC: Fix trivial build regression in Kirkwood I2S
        ASoC: Blackfin: bf5xx-ad193x: Fix codec device name
        ASoC: Fix reporting of partial jack updates
        ASoC: imx: Fix build warning of unused 'card' variable
        ASoC: Fix register cache sync register_writable WARN_ONs
        ASoC: snd_soc_codec_{readable,writable}_register change default to true
        ASoC: soc-dapm: Fix parameter comment for snd_soc_dapm_free
        MAINTAINERS: Add some missed Wolfson files
        ASoC: MPC5200: replace of_device with platform_device
      c455ea4f
  5. 15 Sep, 2011 32 commits