diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2008-01-28 20:21:15 +0100 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2008-01-28 23:21:19 +0100 |
commit | 312b1485fb509c9bc32eda28ad29537896658cb8 (patch) | |
tree | 875ad50025dd230e7097a46cbab4e1a57a3696e1 /include/asm-generic | |
parent | e241a630374e06aecdae2884af8b652d3b4d6c37 (diff) | |
download | blackbird-op-linux-312b1485fb509c9bc32eda28ad29537896658cb8.tar.gz blackbird-op-linux-312b1485fb509c9bc32eda28ad29537896658cb8.zip |
Introduce new section reference annotations tags: __ref, __refdata, __refconst
Today we have the following annotations for functions/data
referencing __init/__exit functions / data:
__init_refok => for init functions
__initdata_refok => for init data
__exit_refok => for exit functions
There is really no difference between the __init and __exit
versions and simplify it and to introduce a shorter annotation
the following new annotations are introduced:
__ref => for functions (code) that
references __*init / __*exit
__refdata => for variables
__refconst => for const variables
Whit this annotation is it more obvious what the annotation
is for and there is no longer the arbitary division
between __init and __exit code.
The mechanishm is the same as before - a special section
is created which is made part of the usual sections
in the linker script.
We will start to see annotations like this:
-static struct pci_serial_quirk pci_serial_quirks[] = {
+static const struct pci_serial_quirk pci_serial_quirks[] __refconst = {
-----------------
-static struct notifier_block __cpuinitdata cpuid_class_cpu_notifier =
+static struct notifier_block cpuid_class_cpu_notifier __refdata =
----------------
-static int threshold_cpu_callback(struct notifier_block *nfb,
+static int __ref threshold_cpu_callback(struct notifier_block *nfb,
[The above is just random samples].
Note: No modifications were needed in modpost
to support the new sections due to the newly introduced
blacklisting.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/vmlinux.lds.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 294853053707..76df771be585 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -42,6 +42,7 @@ #define DATA_DATA \ *(.data) \ *(.data.init.refok) \ + *(.ref.data) \ DEV_KEEP(init.data) \ DEV_KEEP(exit.data) \ CPU_KEEP(init.data) \ @@ -169,6 +170,7 @@ \ /* __*init sections */ \ __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \ + *(.ref.rodata) \ DEV_KEEP(init.rodata) \ DEV_KEEP(exit.rodata) \ CPU_KEEP(init.rodata) \ @@ -202,6 +204,7 @@ #define TEXT_TEXT \ ALIGN_FUNCTION(); \ *(.text) \ + *(.ref.text) \ *(.text.init.refok) \ *(.exit.text.refok) \ DEV_KEEP(init.text) \ |