]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 6740/1: Place correctly notes section in the linker script
authorPawel Moll <pawel.moll@arm.com>
Wed, 16 Feb 2011 17:54:01 +0000 (18:54 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 21 Feb 2011 19:29:25 +0000 (19:29 +0000)
commitc165ddc60d36546a69310200951caa66be96f6ce
tree85237820baf61398b53057207fe8bf5014742841
parent6fc642c027e387ee4f91b0fdf192ebdbecbb984e
ARM: 6740/1: Place correctly notes section in the linker script

Commit 834f89eff1444579d0e932d57feb426a87e700ed added --build-id
linker option when toolchain supports it. ARM one does, but for some
reason places the section at 0 when linker script doesn't mention it
explicitly.

The 3eb526dee702e728a972858a3f0bc3f7f606ff61 worked around the problem
removing this section from binary image with explicit objcopy options,
but it still exists in vmlinux, confusing tools like debuggers and perf.

This problem was discussed here:
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-May/015994.html
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-May/015994.html
but the proposed changes to the linker script were substantial.

This patch simply places NOTES (36 bytes long, at least when compiled
with CodeSourcery toolchain) between data and bss, which seem to be
the right place (and suggested by the sample linker script in
include/asm-generic/vmlinux.lds.h).

It is enough to place it correctly in vmlinux (so debuggers are happy):

Section Headers:
  [11] .data             PROGBITS        c07ce000 7ce000 020fc0 00  WA  0   0 32
  [12] .notes            NOTE            c07eefc0 7eefc0 000024 00  AX  0   0  4
  [13] .bss              NOBITS          c07ef000 7eefe4 01e628 00  WA  0   0 32
Program Headers:
  LOAD           0x008000 0xc0008000 0xc0008000 0x7e6fe4 0x805628 RWE 0x8000
  NOTE           0x7eefc0 0xc07eefc0 0xc07eefc0 0x00024 0x00024 R E 0x4
Section to Segment mapping:
  Segment Sections...
   00     <...> .data .notes .bss
   01     .notes

and to get it exposed as /sys/kernel/notes used by perf tools.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/Makefile
arch/arm/kernel/vmlinux.lds.S