diff options
| author | Andi Kleen <ak@linux.intel.com> | 2012-10-04 20:11:27 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-05 14:04:37 -0400 |
| commit | 754b7b63d112ecc771e376388dcefd7b79bf5c4b (patch) | |
| tree | 93e651411471d86213fa94526546551f38afccca /include/linux/init.h | |
| parent | 0f6d93aa9d96cc9022b51bd10d462b03296be146 (diff) | |
sections: disable const sections for PA-RISC v2
The PA-RISC tool chain seems to have some problem with correct
read/write attributes on sections. This causes problems when the const
sections are fixed up for other architecture to only contain truly
read-only data.
Disable const sections for PA-RISC
This can cause a bit of noise with modpost.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Helge Deller <deller@gmx.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/init.h')
| -rw-r--r-- | include/linux/init.h | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/include/linux/init.h b/include/linux/init.h index 5e664f671615..e59041e21df3 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
| @@ -43,11 +43,22 @@ | |||
| 43 | discard it in modules) */ | 43 | discard it in modules) */ |
| 44 | #define __init __section(.init.text) __cold notrace | 44 | #define __init __section(.init.text) __cold notrace |
| 45 | #define __initdata __section(.init.data) | 45 | #define __initdata __section(.init.data) |
| 46 | #define __initconst __section(.init.rodata) | 46 | #define __initconst __constsection(.init.rodata) |
| 47 | #define __exitdata __section(.exit.data) | 47 | #define __exitdata __section(.exit.data) |
| 48 | #define __exit_call __used __section(.exitcall.exit) | 48 | #define __exit_call __used __section(.exitcall.exit) |
| 49 | 49 | ||
| 50 | /* | 50 | /* |
| 51 | * Some architecture have tool chains which do not handle rodata attributes | ||
| 52 | * correctly. For those disable special sections for const, so that other | ||
| 53 | * architectures can annotate correctly. | ||
| 54 | */ | ||
| 55 | #ifdef CONFIG_BROKEN_RODATA | ||
| 56 | #define __constsection(x) | ||
| 57 | #else | ||
| 58 | #define __constsection(x) __section(x) | ||
| 59 | #endif | ||
| 60 | |||
| 61 | /* | ||
| 51 | * modpost check for section mismatches during the kernel build. | 62 | * modpost check for section mismatches during the kernel build. |
| 52 | * A section mismatch happens when there are references from a | 63 | * A section mismatch happens when there are references from a |
| 53 | * code or data section to an init section (both code or data). | 64 | * code or data section to an init section (both code or data). |
| @@ -66,7 +77,7 @@ | |||
| 66 | */ | 77 | */ |
| 67 | #define __ref __section(.ref.text) noinline | 78 | #define __ref __section(.ref.text) noinline |
| 68 | #define __refdata __section(.ref.data) | 79 | #define __refdata __section(.ref.data) |
| 69 | #define __refconst __section(.ref.rodata) | 80 | #define __refconst __constsection(.ref.rodata) |
| 70 | 81 | ||
| 71 | /* compatibility defines */ | 82 | /* compatibility defines */ |
| 72 | #define __init_refok __ref | 83 | #define __init_refok __ref |
| @@ -85,26 +96,26 @@ | |||
| 85 | /* Used for HOTPLUG */ | 96 | /* Used for HOTPLUG */ |
| 86 | #define __devinit __section(.devinit.text) __cold notrace | 97 | #define __devinit __section(.devinit.text) __cold notrace |
| 87 | #define __devinitdata __section(.devinit.data) | 98 | #define __devinitdata __section(.devinit.data) |
| 88 | #define __devinitconst __section(.devinit.rodata) | 99 | #define __devinitconst __constsection(.devinit.rodata) |
| 89 | #define __devexit __section(.devexit.text) __exitused __cold notrace | 100 | #define __devexit __section(.devexit.text) __exitused __cold notrace |
| 90 | #define __devexitdata __section(.devexit.data) | 101 | #define __devexitdata __section(.devexit.data) |
| 91 | #define __devexitconst __section(.devexit.rodata) | 102 | #define __devexitconst __constsection(.devexit.rodata) |
| 92 | 103 | ||
| 93 | /* Used for HOTPLUG_CPU */ | 104 | /* Used for HOTPLUG_CPU */ |
| 94 | #define __cpuinit __section(.cpuinit.text) __cold notrace | 105 | #define __cpuinit __section(.cpuinit.text) __cold notrace |
| 95 | #define __cpuinitdata __section(.cpuinit.data) | 106 | #define __cpuinitdata __section(.cpuinit.data) |
| 96 | #define __cpuinitconst __section(.cpuinit.rodata) | 107 | #define __cpuinitconst __constsection(.cpuinit.rodata) |
| 97 | #define __cpuexit __section(.cpuexit.text) __exitused __cold notrace | 108 | #define __cpuexit __section(.cpuexit.text) __exitused __cold notrace |
| 98 | #define __cpuexitdata __section(.cpuexit.data) | 109 | #define __cpuexitdata __section(.cpuexit.data) |
| 99 | #define __cpuexitconst __section(.cpuexit.rodata) | 110 | #define __cpuexitconst __constsection(.cpuexit.rodata) |
| 100 | 111 | ||
| 101 | /* Used for MEMORY_HOTPLUG */ | 112 | /* Used for MEMORY_HOTPLUG */ |
| 102 | #define __meminit __section(.meminit.text) __cold notrace | 113 | #define __meminit __section(.meminit.text) __cold notrace |
| 103 | #define __meminitdata __section(.meminit.data) | 114 | #define __meminitdata __section(.meminit.data) |
| 104 | #define __meminitconst __section(.meminit.rodata) | 115 | #define __meminitconst __constsection(.meminit.rodata) |
| 105 | #define __memexit __section(.memexit.text) __exitused __cold notrace | 116 | #define __memexit __section(.memexit.text) __exitused __cold notrace |
| 106 | #define __memexitdata __section(.memexit.data) | 117 | #define __memexitdata __section(.memexit.data) |
| 107 | #define __memexitconst __section(.memexit.rodata) | 118 | #define __memexitconst __constsection(.memexit.rodata) |
| 108 | 119 | ||
| 109 | /* For assembly routines */ | 120 | /* For assembly routines */ |
| 110 | #define __HEAD .section ".head.text","ax" | 121 | #define __HEAD .section ".head.text","ax" |
