* [PATCH] fix for pseudo symbol swapping with scripts/kallsyms - linux-2.6.10-rc1-bk12 & gcc 3.4.2
@ 2004-11-03 14:33 Alexander Stohr
2004-11-05 23:25 ` Sam Ravnborg
0 siblings, 1 reply; 4+ messages in thread
From: Alexander Stohr @ 2004-11-03 14:33 UTC (permalink / raw)
To: linux-kernel; +Cc: kai, sam
[-- Attachment #1: Type: text/plain, Size: 1388 bytes --]
Hello,
when trying out gcc 3.4.2 (in contrast to my former gcc 3.3.3)
with a recent bitkeeper snapshot of the linux kernel (2.6.10-rc1-bk12)
i suddenly got a notification about problems with symbol check
and hinting me for turning on CONFIG_KALLSYMS_EXTRA_PASS, thus
suggesting me to turn on tripple pass bzImage linking as a
short term work around.
a deeper analysis of the symbols (using nm and a hacked in table
dump for kallsyms) showed me that the symbols "__sched_text_start"
and "__down" did fall onto the very same memory location in
linker run 2 and 3 and further did swap their order! (a-z sorted?)
in linker run 1, there was a small offset between them for whatever
reason which prevented them from beeing consolidated and swapped.
(i dont see what makes up the difference here. take it as a hint.)
as such names, like the *_start and *_end symbols, are only used
for the kernel integrated stack dumps range checking, and even
that is only needed for some two archs, my solution of choice
was to add all similar "no real data" symbols to the list of
stripped symbols in the sources of the kallsyms application.
Below you will find my patch for inclusion into the Linux kernel.
-Alex.
PS: please CC me on replys as i am not subscribed to the lkml.
--
Geschenkt: 3 Monate GMX ProMail + 3 Top-Spielfilme auf DVD
++ Jetzt kostenlos testen http://www.gmx.net/de/go/mail ++
[-- Attachment #2: linux-2.6.10-rc1-bk12-kallsyms.patch.bz2 --]
[-- Type: application/octet-stream, Size: 539 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fix for pseudo symbol swapping with scripts/kallsyms - linux-2.6.10-rc1-bk12 & gcc 3.4.2
2004-11-03 14:33 [PATCH] fix for pseudo symbol swapping with scripts/kallsyms - linux-2.6.10-rc1-bk12 & gcc 3.4.2 Alexander Stohr
@ 2004-11-05 23:25 ` Sam Ravnborg
2004-11-06 21:05 ` Sam Ravnborg
0 siblings, 1 reply; 4+ messages in thread
From: Sam Ravnborg @ 2004-11-05 23:25 UTC (permalink / raw)
To: Alexander Stohr; +Cc: linux-kernel, kai, sam
On Wed, Nov 03, 2004 at 03:33:34PM +0100, Alexander Stohr wrote:
> Hello,
>
> when trying out gcc 3.4.2 (in contrast to my former gcc 3.3.3)
> with a recent bitkeeper snapshot of the linux kernel (2.6.10-rc1-bk12)
> i suddenly got a notification about problems with symbol check
> and hinting me for turning on CONFIG_KALLSYMS_EXTRA_PASS, thus
> suggesting me to turn on tripple pass bzImage linking as a
> short term work around.
>
> a deeper analysis of the symbols (using nm and a hacked in table
> dump for kallsyms) showed me that the symbols "__sched_text_start"
> and "__down" did fall onto the very same memory location in
> linker run 2 and 3 and further did swap their order! (a-z sorted?)
> in linker run 1, there was a small offset between them for whatever
> reason which prevented them from beeing consolidated and swapped.
> (i dont see what makes up the difference here. take it as a hint.)
The linker will adhere to any alingment demands in the section,
but not the labels. So the real fix is to make sure the labels are
defined inside the section.
Please try attached (untested) patch.
Check that error is present without patch, and it is fixed with the patch.
Sam
===== include/asm-generic/vmlinux.lds.h 1.16 vs edited =====
--- 1.16/include/asm-generic/vmlinux.lds.h 2004-10-06 18:45:06 +02:00
+++ edited/include/asm-generic/vmlinux.lds.h 2004-11-06 00:22:27 +01:00
@@ -77,11 +77,15 @@
}
#define SCHED_TEXT \
+ .sched.text: { \
VMLINUX_SYMBOL(__sched_text_start) = .; \
*(.sched.text) \
- VMLINUX_SYMBOL(__sched_text_end) = .;
+ VMLINUX_SYMBOL(__sched_text_end) = .; \
+ }
#define LOCK_TEXT \
+ .spinlock.text: { \
VMLINUX_SYMBOL(__lock_text_start) = .; \
*(.spinlock.text) \
- VMLINUX_SYMBOL(__lock_text_end) = .;
+ VMLINUX_SYMBOL(__lock_text_end) = .; \
+ }
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fix for pseudo symbol swapping with scripts/kallsyms - linux-2.6.10-rc1-bk12 & gcc 3.4.2
2004-11-05 23:25 ` Sam Ravnborg
@ 2004-11-06 21:05 ` Sam Ravnborg
2004-11-06 22:32 ` Alexander Stohr
0 siblings, 1 reply; 4+ messages in thread
From: Sam Ravnborg @ 2004-11-06 21:05 UTC (permalink / raw)
To: Alexander Stohr, linux-kernel, kai, sam
On Sat, Nov 06, 2004 at 12:25:58AM +0100, Sam Ravnborg wrote:
> The linker will adhere to any alingment demands in the section,
> but not the labels. So the real fix is to make sure the labels are
> defined inside the section.
> Please try attached (untested) patch.
>
> Check that error is present without patch, and it is fixed with the patch.
This patch is better - we cannot define sections within sections.
Sam
===== include/asm-generic/vmlinux.lds.h 1.16 vs edited =====
--- 1.16/include/asm-generic/vmlinux.lds.h 2004-10-06 18:45:06 +02:00
+++ edited/include/asm-generic/vmlinux.lds.h 2004-11-06 21:56:11 +01:00
@@ -6,6 +6,11 @@
#define VMLINUX_SYMBOL(_sym_) _sym_
#endif
+/* Aling functions to a 32 byte boundary.
+ * This prevents lables defined to mark start/end of section to differ
+ * during pass 1 and pass 2 when generating Systme.map */
+#define ALIGN_FUNCTION() . = ALIGN(8)
+
#define RODATA \
.rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
*(.rodata) *(.rodata.*) \
@@ -77,11 +82,13 @@
}
#define SCHED_TEXT \
+ ALIGN_FUNCTION(); \
VMLINUX_SYMBOL(__sched_text_start) = .; \
*(.sched.text) \
VMLINUX_SYMBOL(__sched_text_end) = .;
#define LOCK_TEXT \
+ ALIGN_FUNCTION(); \
VMLINUX_SYMBOL(__lock_text_start) = .; \
*(.spinlock.text) \
VMLINUX_SYMBOL(__lock_text_end) = .;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fix for pseudo symbol swapping with scripts/kallsyms - linux-2.6.10-rc1-bk12 & gcc 3.4.2
2004-11-06 21:05 ` Sam Ravnborg
@ 2004-11-06 22:32 ` Alexander Stohr
0 siblings, 0 replies; 4+ messages in thread
From: Alexander Stohr @ 2004-11-06 22:32 UTC (permalink / raw)
To: linux-kernel, kai, Sam Ravnborg
i will try to give it a try on monday
when i am back to the console of that machine.
Thanks for your good hints. I assume that function
alignment might expose some other benefits as well.
-Alex.
----- Original Message -----
From: "Sam Ravnborg" <sam@mars.opasia.dk>
To: "Alexander Stohr" <Alexander.Stohr@gmx.de>; <linux-kernel@vger.kernel.org>; <kai@germaschewski.name>; <sam@ravnborg.org>
Sent: Saturday, November 06, 2004 10:05 PM
Subject: Re: [PATCH] fix for pseudo symbol swapping with scripts/kallsyms - linux-2.6.10-rc1-bk12 & gcc 3.4.2
> On Sat, Nov 06, 2004 at 12:25:58AM +0100, Sam Ravnborg wrote:
> > The linker will adhere to any alingment demands in the section,
> > but not the labels. So the real fix is to make sure the labels are
> > defined inside the section.
> > Please try attached (untested) patch.
> >
> > Check that error is present without patch, and it is fixed with the patch.
>
> This patch is better - we cannot define sections within sections.
>
> Sam
>
> ===== include/asm-generic/vmlinux.lds.h 1.16 vs edited =====
> --- 1.16/include/asm-generic/vmlinux.lds.h 2004-10-06 18:45:06 +02:00
> +++ edited/include/asm-generic/vmlinux.lds.h 2004-11-06 21:56:11 +01:00
> @@ -6,6 +6,11 @@
> #define VMLINUX_SYMBOL(_sym_) _sym_
> #endif
>
> +/* Aling functions to a 32 byte boundary.
> + * This prevents lables defined to mark start/end of section to differ
> + * during pass 1 and pass 2 when generating Systme.map */
> +#define ALIGN_FUNCTION() . = ALIGN(8)
> +
> #define RODATA \
> .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
> *(.rodata) *(.rodata.*) \
> @@ -77,11 +82,13 @@
> }
>
> #define SCHED_TEXT \
> + ALIGN_FUNCTION(); \
> VMLINUX_SYMBOL(__sched_text_start) = .; \
> *(.sched.text) \
> VMLINUX_SYMBOL(__sched_text_end) = .;
>
> #define LOCK_TEXT \
> + ALIGN_FUNCTION(); \
> VMLINUX_SYMBOL(__lock_text_start) = .; \
> *(.spinlock.text) \
> VMLINUX_SYMBOL(__lock_text_end) = .;
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-11-06 22:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-03 14:33 [PATCH] fix for pseudo symbol swapping with scripts/kallsyms - linux-2.6.10-rc1-bk12 & gcc 3.4.2 Alexander Stohr
2004-11-05 23:25 ` Sam Ravnborg
2004-11-06 21:05 ` Sam Ravnborg
2004-11-06 22:32 ` Alexander Stohr
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®