* [PATCH] move BUG_TABLE into RODATA
@ 2008-04-22 15:10 Jan Beulich
2008-04-22 15:10 ` Jan Beulich
[not found] ` <480E1BEE.76E4.0078.0-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
0 siblings, 2 replies; 6+ messages in thread
From: Jan Beulich @ 2008-04-22 15:10 UTC (permalink / raw)
To: linux-arch, linux-kernel
Signed-off-by: Jan Beulich <jbeulich@novell.com>
---
arch/avr32/kernel/vmlinux.lds.S | 2 --
arch/parisc/kernel/vmlinux.lds.S | 1 -
arch/powerpc/kernel/vmlinux.lds.S | 2 --
arch/s390/kernel/vmlinux.lds.S | 1 -
arch/sh/kernel/vmlinux_32.lds.S | 1 -
arch/sh/kernel/vmlinux_64.lds.S | 1 -
arch/x86/kernel/vmlinux_32.lds.S | 8 +++-----
arch/x86/kernel/vmlinux_64.lds.S | 10 ++++------
include/asm-generic/vmlinux.lds.h | 6 ++++++
9 files changed, 13 insertions(+), 19 deletions(-)
--- linux-2.6.25/arch/avr32/kernel/vmlinux.lds.S 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-bug-table-rodata/arch/avr32/kernel/vmlinux.lds.S 2008-03-04 11:14:13.000000000 +0100
@@ -93,8 +93,6 @@ SECTIONS
__stop___ex_table = .;
}
- BUG_TABLE
-
RODATA
. = ALIGN(THREAD_SIZE);
--- linux-2.6.25/arch/parisc/kernel/vmlinux.lds.S 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-bug-table-rodata/arch/parisc/kernel/vmlinux.lds.S 2008-03-04 11:14:13.000000000 +0100
@@ -66,7 +66,6 @@ SECTIONS
_etext = .;
RODATA
- BUG_TABLE
/* writeable */
/* Make sure this is page aligned so
--- linux-2.6.25/arch/powerpc/kernel/vmlinux.lds.S 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-bug-table-rodata/arch/powerpc/kernel/vmlinux.lds.S 2008-03-04 11:14:13.000000000 +0100
@@ -66,8 +66,6 @@ SECTIONS
NOTES
- BUG_TABLE
-
/*
* Init sections discarded at runtime
*/
--- linux-2.6.25/arch/s390/kernel/vmlinux.lds.S 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-bug-table-rodata/arch/s390/kernel/vmlinux.lds.S 2008-03-04 11:14:50.000000000 +0100
@@ -40,7 +40,6 @@ SECTIONS
_etext = .; /* End of text section */
NOTES :text :note
- BUG_TABLE :text
RODATA
--- linux-2.6.25/arch/sh/kernel/vmlinux_32.lds.S 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-bug-table-rodata/arch/sh/kernel/vmlinux_32.lds.S 2008-03-04 11:15:48.000000000 +0100
@@ -44,7 +44,6 @@ SECTIONS
_etext = .; /* End of text section */
- BUG_TABLE
NOTES
RO_DATA(PAGE_SIZE)
--- linux-2.6.25/arch/sh/kernel/vmlinux_64.lds.S 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-bug-table-rodata/arch/sh/kernel/vmlinux_64.lds.S 2008-03-04 11:15:53.000000000 +0100
@@ -65,7 +65,6 @@ SECTIONS
_etext = .; /* End of text section */
- BUG_TABLE
NOTES
RO_DATA(PAGE_SIZE)
--- linux-2.6.25/arch/x86/kernel/vmlinux_32.lds.S 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-bug-table-rodata/arch/x86/kernel/vmlinux_32.lds.S 2008-03-04 11:14:13.000000000 +0100
@@ -49,16 +49,14 @@ SECTIONS
_etext = .; /* End of text section */
} :text = 0x9090
+ NOTES :text :note
+
. = ALIGN(16); /* Exception table */
__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
__start___ex_table = .;
*(__ex_table)
__stop___ex_table = .;
- }
-
- NOTES :text :note
-
- BUG_TABLE :text
+ } :text = 0x9090
. = ALIGN(4);
.tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {
--- linux-2.6.25/arch/x86/kernel/vmlinux_64.lds.S 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-bug-table-rodata/arch/x86/kernel/vmlinux_64.lds.S 2008-03-04 11:14:13.000000000 +0100
@@ -19,7 +19,7 @@ PHDRS {
data PT_LOAD FLAGS(7); /* RWE */
user PT_LOAD FLAGS(7); /* RWE */
data.init PT_LOAD FLAGS(7); /* RWE */
- note PT_NOTE FLAGS(4); /* R__ */
+ note PT_NOTE FLAGS(0); /* ___ */
}
SECTIONS
{
@@ -40,16 +40,14 @@ SECTIONS
_etext = .; /* End of text section */
} :text = 0x9090
+ NOTES :text :note
+
. = ALIGN(16); /* Exception table */
__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
__start___ex_table = .;
*(__ex_table)
__stop___ex_table = .;
- }
-
- NOTES :text :note
-
- BUG_TABLE :text
+ } :text = 0x9090
RODATA
--- linux-2.6.25/include/asm-generic/vmlinux.lds.h 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-bug-table-rodata/include/asm-generic/vmlinux.lds.h 2008-03-04 11:14:13.000000000 +0100
@@ -67,6 +67,8 @@
*(.rodata1) \
} \
\
+ BUG_TABLE \
+ \
/* PCI quirks */ \
.pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start_pci_fixups_early) = .; \
@@ -310,6 +312,7 @@
.stab.indexstr 0 : { *(.stab.indexstr) } \
.comment 0 : { *(.comment) }
+#ifdef CONFIG_GENERIC_BUG
#define BUG_TABLE \
. = ALIGN(8); \
__bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \
@@ -317,6 +320,9 @@
*(__bug_table) \
__stop___bug_table = .; \
}
+#else
+#define BUG_TABLE
+#endif
#define NOTES \
.notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] move BUG_TABLE into RODATA
2008-04-22 15:10 [PATCH] move BUG_TABLE into RODATA Jan Beulich
@ 2008-04-22 15:10 ` Jan Beulich
[not found] ` <480E1BEE.76E4.0078.0-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
1 sibling, 0 replies; 6+ messages in thread
From: Jan Beulich @ 2008-04-22 15:10 UTC (permalink / raw)
To: linux-arch, linux-kernel
Signed-off-by: Jan Beulich <jbeulich@novell.com>
---
arch/avr32/kernel/vmlinux.lds.S | 2 --
arch/parisc/kernel/vmlinux.lds.S | 1 -
arch/powerpc/kernel/vmlinux.lds.S | 2 --
arch/s390/kernel/vmlinux.lds.S | 1 -
arch/sh/kernel/vmlinux_32.lds.S | 1 -
arch/sh/kernel/vmlinux_64.lds.S | 1 -
arch/x86/kernel/vmlinux_32.lds.S | 8 +++-----
arch/x86/kernel/vmlinux_64.lds.S | 10 ++++------
include/asm-generic/vmlinux.lds.h | 6 ++++++
9 files changed, 13 insertions(+), 19 deletions(-)
--- linux-2.6.25/arch/avr32/kernel/vmlinux.lds.S 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-bug-table-rodata/arch/avr32/kernel/vmlinux.lds.S 2008-03-04 11:14:13.000000000 +0100
@@ -93,8 +93,6 @@ SECTIONS
__stop___ex_table = .;
}
- BUG_TABLE
-
RODATA
. = ALIGN(THREAD_SIZE);
--- linux-2.6.25/arch/parisc/kernel/vmlinux.lds.S 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-bug-table-rodata/arch/parisc/kernel/vmlinux.lds.S 2008-03-04 11:14:13.000000000 +0100
@@ -66,7 +66,6 @@ SECTIONS
_etext = .;
RODATA
- BUG_TABLE
/* writeable */
/* Make sure this is page aligned so
--- linux-2.6.25/arch/powerpc/kernel/vmlinux.lds.S 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-bug-table-rodata/arch/powerpc/kernel/vmlinux.lds.S 2008-03-04 11:14:13.000000000 +0100
@@ -66,8 +66,6 @@ SECTIONS
NOTES
- BUG_TABLE
-
/*
* Init sections discarded at runtime
*/
--- linux-2.6.25/arch/s390/kernel/vmlinux.lds.S 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-bug-table-rodata/arch/s390/kernel/vmlinux.lds.S 2008-03-04 11:14:50.000000000 +0100
@@ -40,7 +40,6 @@ SECTIONS
_etext = .; /* End of text section */
NOTES :text :note
- BUG_TABLE :text
RODATA
--- linux-2.6.25/arch/sh/kernel/vmlinux_32.lds.S 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-bug-table-rodata/arch/sh/kernel/vmlinux_32.lds.S 2008-03-04 11:15:48.000000000 +0100
@@ -44,7 +44,6 @@ SECTIONS
_etext = .; /* End of text section */
- BUG_TABLE
NOTES
RO_DATA(PAGE_SIZE)
--- linux-2.6.25/arch/sh/kernel/vmlinux_64.lds.S 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-bug-table-rodata/arch/sh/kernel/vmlinux_64.lds.S 2008-03-04 11:15:53.000000000 +0100
@@ -65,7 +65,6 @@ SECTIONS
_etext = .; /* End of text section */
- BUG_TABLE
NOTES
RO_DATA(PAGE_SIZE)
--- linux-2.6.25/arch/x86/kernel/vmlinux_32.lds.S 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-bug-table-rodata/arch/x86/kernel/vmlinux_32.lds.S 2008-03-04 11:14:13.000000000 +0100
@@ -49,16 +49,14 @@ SECTIONS
_etext = .; /* End of text section */
} :text = 0x9090
+ NOTES :text :note
+
. = ALIGN(16); /* Exception table */
__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
__start___ex_table = .;
*(__ex_table)
__stop___ex_table = .;
- }
-
- NOTES :text :note
-
- BUG_TABLE :text
+ } :text = 0x9090
. = ALIGN(4);
.tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {
--- linux-2.6.25/arch/x86/kernel/vmlinux_64.lds.S 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-bug-table-rodata/arch/x86/kernel/vmlinux_64.lds.S 2008-03-04 11:14:13.000000000 +0100
@@ -19,7 +19,7 @@ PHDRS {
data PT_LOAD FLAGS(7); /* RWE */
user PT_LOAD FLAGS(7); /* RWE */
data.init PT_LOAD FLAGS(7); /* RWE */
- note PT_NOTE FLAGS(4); /* R__ */
+ note PT_NOTE FLAGS(0); /* ___ */
}
SECTIONS
{
@@ -40,16 +40,14 @@ SECTIONS
_etext = .; /* End of text section */
} :text = 0x9090
+ NOTES :text :note
+
. = ALIGN(16); /* Exception table */
__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
__start___ex_table = .;
*(__ex_table)
__stop___ex_table = .;
- }
-
- NOTES :text :note
-
- BUG_TABLE :text
+ } :text = 0x9090
RODATA
--- linux-2.6.25/include/asm-generic/vmlinux.lds.h 2008-04-17 04:49:44.000000000 +0200
+++ 2.6.25-bug-table-rodata/include/asm-generic/vmlinux.lds.h 2008-03-04 11:14:13.000000000 +0100
@@ -67,6 +67,8 @@
*(.rodata1) \
} \
\
+ BUG_TABLE \
+ \
/* PCI quirks */ \
.pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start_pci_fixups_early) = .; \
@@ -310,6 +312,7 @@
.stab.indexstr 0 : { *(.stab.indexstr) } \
.comment 0 : { *(.comment) }
+#ifdef CONFIG_GENERIC_BUG
#define BUG_TABLE \
. = ALIGN(8); \
__bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) { \
@@ -317,6 +320,9 @@
*(__bug_table) \
__stop___bug_table = .; \
}
+#else
+#define BUG_TABLE
+#endif
#define NOTES \
.notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] move BUG_TABLE into RODATA
[not found] ` <480E1BEE.76E4.0078.0-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
@ 2008-04-22 18:07 ` Sam Ravnborg
2008-04-22 18:07 ` Sam Ravnborg
[not found] ` <20080422180732.GA27222-QabhHTsIXMSnlFQ6Q1D1Y0B+6BGkLq7r@public.gmane.org>
0 siblings, 2 replies; 6+ messages in thread
From: Sam Ravnborg @ 2008-04-22 18:07 UTC (permalink / raw)
To: Jan Beulich
Cc: linux-arch-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Hi Jan.
> --- linux-2.6.25/arch/x86/kernel/vmlinux_64.lds.S 2008-04-17 04:49:44.000000000 +0200
> +++ 2.6.25-bug-table-rodata/arch/x86/kernel/vmlinux_64.lds.S 2008-03-04 11:14:13.000000000 +0100
> @@ -19,7 +19,7 @@ PHDRS {
> data PT_LOAD FLAGS(7); /* RWE */
> user PT_LOAD FLAGS(7); /* RWE */
> data.init PT_LOAD FLAGS(7); /* RWE */
> - note PT_NOTE FLAGS(4); /* R__ */
> + note PT_NOTE FLAGS(0); /* ___ */
> }
Is this intentional in this patch?
> SECTIONS
> {
> @@ -40,16 +40,14 @@ SECTIONS
> _etext = .; /* End of text section */
> } :text = 0x9090
>
> + NOTES :text :note
> +
> . = ALIGN(16); /* Exception table */
> __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
> __start___ex_table = .;
> *(__ex_table)
> __stop___ex_table = .;
> - }
> -
> - NOTES :text :note
> -
> - BUG_TABLE :text
> + } :text = 0x9090
And I do not see the 0x9090 justified.
Is this something to do with the fact that 0x90 equals NOP on x86?
Rest looks good.
Sam
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] move BUG_TABLE into RODATA
2008-04-22 18:07 ` Sam Ravnborg
@ 2008-04-22 18:07 ` Sam Ravnborg
[not found] ` <20080422180732.GA27222-QabhHTsIXMSnlFQ6Q1D1Y0B+6BGkLq7r@public.gmane.org>
1 sibling, 0 replies; 6+ messages in thread
From: Sam Ravnborg @ 2008-04-22 18:07 UTC (permalink / raw)
To: Jan Beulich; +Cc: linux-arch, linux-kernel
Hi Jan.
> --- linux-2.6.25/arch/x86/kernel/vmlinux_64.lds.S 2008-04-17 04:49:44.000000000 +0200
> +++ 2.6.25-bug-table-rodata/arch/x86/kernel/vmlinux_64.lds.S 2008-03-04 11:14:13.000000000 +0100
> @@ -19,7 +19,7 @@ PHDRS {
> data PT_LOAD FLAGS(7); /* RWE */
> user PT_LOAD FLAGS(7); /* RWE */
> data.init PT_LOAD FLAGS(7); /* RWE */
> - note PT_NOTE FLAGS(4); /* R__ */
> + note PT_NOTE FLAGS(0); /* ___ */
> }
Is this intentional in this patch?
> SECTIONS
> {
> @@ -40,16 +40,14 @@ SECTIONS
> _etext = .; /* End of text section */
> } :text = 0x9090
>
> + NOTES :text :note
> +
> . = ALIGN(16); /* Exception table */
> __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
> __start___ex_table = .;
> *(__ex_table)
> __stop___ex_table = .;
> - }
> -
> - NOTES :text :note
> -
> - BUG_TABLE :text
> + } :text = 0x9090
And I do not see the 0x9090 justified.
Is this something to do with the fact that 0x90 equals NOP on x86?
Rest looks good.
Sam
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] move BUG_TABLE into RODATA
[not found] ` <20080422180732.GA27222-QabhHTsIXMSnlFQ6Q1D1Y0B+6BGkLq7r@public.gmane.org>
@ 2008-04-23 6:36 ` Jan Beulich
2008-04-23 6:36 ` Jan Beulich
0 siblings, 1 reply; 6+ messages in thread
From: Jan Beulich @ 2008-04-23 6:36 UTC (permalink / raw)
To: Sam Ravnborg
Cc: linux-arch-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
>>> Sam Ravnborg <sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org> 22.04.08 20:07 >>>
>Hi Jan.
>
>> --- linux-2.6.25/arch/x86/kernel/vmlinux_64.lds.S 2008-04-17 04:49:44.000000000 +0200
>> +++ 2.6.25-bug-table-rodata/arch/x86/kernel/vmlinux_64.lds.S 2008-03-04 11:14:13.000000000 +0100
>> @@ -19,7 +19,7 @@ PHDRS {
>> data PT_LOAD FLAGS(7); /* RWE */
>> user PT_LOAD FLAGS(7); /* RWE */
>> data.init PT_LOAD FLAGS(7); /* RWE */
>> - note PT_NOTE FLAGS(4); /* R__ */
>> + note PT_NOTE FLAGS(0); /* ___ */
>> }
>
>Is this intentional in this patch?
Yes. While it may be possible to do this separately, it seemed safer to
me to keep it together since I only tested it this way.
>> SECTIONS
>> {
>> @@ -40,16 +40,14 @@ SECTIONS
>> _etext = .; /* End of text section */
>> } :text = 0x9090
>>
>> + NOTES :text :note
>> +
>> . = ALIGN(16); /* Exception table */
>> __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
>> __start___ex_table = .;
>> *(__ex_table)
>> __stop___ex_table = .;
>> - }
>> -
>> - NOTES :text :note
>> -
>> - BUG_TABLE :text
>> + } :text = 0x9090
>
>And I do not see the 0x9090 justified.
>Is this something to do with the fact that 0x90 equals NOP on x86?
Yes, for consistency I think this ought to be repeated here - while
not strictly necessary (__ex_table is data, hence padding with
zeroes rather than NOPs would be fine), it seems more safe to have
it here so that we don't catch occasional linker bugs. Ultimately I
would think __ex_table should go into RODATA, too, which would
eliminate the question.
Jan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] move BUG_TABLE into RODATA
2008-04-23 6:36 ` Jan Beulich
@ 2008-04-23 6:36 ` Jan Beulich
0 siblings, 0 replies; 6+ messages in thread
From: Jan Beulich @ 2008-04-23 6:36 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: linux-arch, linux-kernel
>>> Sam Ravnborg <sam@ravnborg.org> 22.04.08 20:07 >>>
>Hi Jan.
>
>> --- linux-2.6.25/arch/x86/kernel/vmlinux_64.lds.S 2008-04-17 04:49:44.000000000 +0200
>> +++ 2.6.25-bug-table-rodata/arch/x86/kernel/vmlinux_64.lds.S 2008-03-04 11:14:13.000000000 +0100
>> @@ -19,7 +19,7 @@ PHDRS {
>> data PT_LOAD FLAGS(7); /* RWE */
>> user PT_LOAD FLAGS(7); /* RWE */
>> data.init PT_LOAD FLAGS(7); /* RWE */
>> - note PT_NOTE FLAGS(4); /* R__ */
>> + note PT_NOTE FLAGS(0); /* ___ */
>> }
>
>Is this intentional in this patch?
Yes. While it may be possible to do this separately, it seemed safer to
me to keep it together since I only tested it this way.
>> SECTIONS
>> {
>> @@ -40,16 +40,14 @@ SECTIONS
>> _etext = .; /* End of text section */
>> } :text = 0x9090
>>
>> + NOTES :text :note
>> +
>> . = ALIGN(16); /* Exception table */
>> __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
>> __start___ex_table = .;
>> *(__ex_table)
>> __stop___ex_table = .;
>> - }
>> -
>> - NOTES :text :note
>> -
>> - BUG_TABLE :text
>> + } :text = 0x9090
>
>And I do not see the 0x9090 justified.
>Is this something to do with the fact that 0x90 equals NOP on x86?
Yes, for consistency I think this ought to be repeated here - while
not strictly necessary (__ex_table is data, hence padding with
zeroes rather than NOPs would be fine), it seems more safe to have
it here so that we don't catch occasional linker bugs. Ultimately I
would think __ex_table should go into RODATA, too, which would
eliminate the question.
Jan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-04-23 6:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-22 15:10 [PATCH] move BUG_TABLE into RODATA Jan Beulich
2008-04-22 15:10 ` Jan Beulich
[not found] ` <480E1BEE.76E4.0078.0-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
2008-04-22 18:07 ` Sam Ravnborg
2008-04-22 18:07 ` Sam Ravnborg
[not found] ` <20080422180732.GA27222-QabhHTsIXMSnlFQ6Q1D1Y0B+6BGkLq7r@public.gmane.org>
2008-04-23 6:36 ` Jan Beulich
2008-04-23 6:36 ` Jan Beulich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox