Skip to contentSkip to conversation

UBI: Fix section mismatch

PATCH Superseded Andy Shevchenko 2 participants 5 messages Jan 9, 2017 – Jan 10, 2017

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 UBI: Fix section mismatch

WARNING: vmlinux.o(.text+0x1f2a80): Section mismatch in reference from the variable __param_ops_mtd to the function .init.text:ubi_mtd_param_parse() The function __param_ops_mtd() references
the function __init ubi_mtd_param_parse().
This is often because __param_ops_mtd lacks a __init
annotation or the annotation of ubi_mtd_param_parse is wrong.

Cc Richard Weinberger <[email protected]>
---
 drivers/mtd/ubi/build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/ubi/build.c +1 -1
index 85d54f37e28f..00a46ff61528 100644
@@ -1389,7 +1389,7 @@ static int __init bytes_str_to_int(const char *str)
  * This function returns zero in case of success and a negative error code in
  * case of error.
  */
-static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
+static int ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
 {
 	int i, len;
 	struct mtd_dev_param *p;
Signature · 1 line
2.11.0
#1 lore raw
Quoted 7 lines · Andy Shevchenko

WARNING: vmlinux.o(.text+0x1f2a80): Section mismatch in reference from the variable __param_ops_mtd to the function .init.text:ubi_mtd_param_parse()
The function __param_ops_mtd() references
the function __init ubi_mtd_param_parse().
This is often because __param_ops_mtd lacks a __init annotation or the annotation of ubi_mtd_param_parse is wrong.

Please, discard this. It fixes one and add another.

Quoted 24 lines
Cc Richard Weinberger <[email protected]>

---
 drivers/mtd/ubi/build.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/ubi/build.c +0 -0
index 85d54f37e28f..00a46ff61528 100644
@@ -1389,7 +1389,7 @@ static int __init bytes_str_to_int(const char
 *str)
   * This function returns zero in case of success and a negative error

code in
  * case of error.
  */
-static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
+static int ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
 {
  int i, len;
  struct mtd_dev_param *p;

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#2 lore raw
Quoted 10 lines · On Mon, 09 Jan 2017 21:34:26 +0200 Andy Shevchenko…
Quoted 7 lines · Andy Shevchenko

WARNING: vmlinux.o(.text+0x1f2a80): Section mismatch in reference from the variable __param_ops_mtd to the function .init.text:ubi_mtd_param_parse()
The function __param_ops_mtd() references
the function __init ubi_mtd_param_parse().
This is often because __param_ops_mtd lacks a __init annotation or the annotation of ubi_mtd_param_parse is wrong.

Please, discard this. It fixes one and add another.

Just remove the __initdata specifiers on mtd_devs and mtd_dev_param and you should be fine.

Quoted 26 lines
Quoted 25 lines
Cc Richard Weinberger <[email protected]>

---
 drivers/mtd/ubi/build.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/ubi/build.c +0 -0
index 85d54f37e28f..00a46ff61528 100644
@@ -1389,7 +1389,7 @@ static int __init bytes_str_to_int(const char
 *str)
   * This function returns zero in case of success and a negative error

code in
  * case of error.
  */
-static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
+static int ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
 {
  int i, len;
  struct mtd_dev_param *p;

#3 lore raw
Quoted 13 lines · Boris Brezillon
Quoted 10 lines · On Mon, 09 Jan 2017 21:34:26 +0200 Andy Shevchenko…
Quoted 8 lines · Andy Shevchenko

WARNING: vmlinux.o(.text+0x1f2a80): Section mismatch in reference from
the variable __param_ops_mtd to the function .init.text:ubi_mtd_param_parse()
The function __param_ops_mtd() references
the function __init ubi_mtd_param_parse().
This is often because __param_ops_mtd lacks a __init annotation or the annotation of ubi_mtd_param_parse is wrong.

Quoted 5 lines
Quoted 1 line

Please, discard this. It fixes one and add another.

Just remove the __initdata specifiers on mtd_devs and mtd_dev_param and
you should be fine.

Yes, I already have this patch.

But I decided to talk to Artem and just talked.

We thought about comment to explain what is going on there and why section mismatch is false positive, though a bit error prone (since you have to keep in mind 0000 permissions).

So, one solution here is to unmark them and, what I would add, change permissions to read-only.

If you are okay with this I will send series.

Quoted 31 lines
Quoted 29 lines
Quoted 29 lines
Cc Richard Weinberger <[email protected]>

---
 drivers/mtd/ubi/build.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/ubi/build.c +0 -0
index 85d54f37e28f..00a46ff61528 100644
@@ -1389,7 +1389,7 @@ static int __init bytes_str_to_int(const

char
*str)
  * This function returns zero in case of success and a negative error
code in
  * case of error.
  */
-static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
+static int ubi_mtd_param_parse(const char *val, struct kernel_param
*kp)
 {
  int i, len;
  struct mtd_dev_param *p;

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#4 lore raw
Quoted 24 lines · On Tue, 10 Jan 2017 13:45:11 +0200 Andy Shevchenko…
Quoted 13 lines · Boris Brezillon
Quoted 10 lines · On Mon, 09 Jan 2017 21:34:26 +0200 Andy Shevchenko…
Quoted 8 lines · Andy Shevchenko

WARNING: vmlinux.o(.text+0x1f2a80): Section mismatch in reference from
the variable __param_ops_mtd to the function .init.text:ubi_mtd_param_parse()
The function __param_ops_mtd() references
the function __init ubi_mtd_param_parse().
This is often because __param_ops_mtd lacks a __init annotation or the annotation of ubi_mtd_param_parse is wrong.

Quoted 5 lines
Quoted 1 line

Please, discard this. It fixes one and add another.

Just remove the __initdata specifiers on mtd_devs and mtd_dev_param and
you should be fine.

Yes, I already have this patch.

But I decided to talk to Artem and just talked.

Quoted 8 lines

We thought about comment to explain what is going on there and why section mismatch is false positive, though a bit error prone (since you have to keep in mind 0000 permissions).

So, one solution here is to unmark them and, what I would add, change permissions to read-only.

If you are okay with this I will send series.

Sounds good.

Quoted 33 lines
Quoted 32 lines
Quoted 30 lines
Quoted 30 lines
Cc Richard Weinberger <[email protected]>

---
 drivers/mtd/ubi/build.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/ubi/build.c +0 -0
index 85d54f37e28f..00a46ff61528 100644
@@ -1389,7 +1389,7 @@ static int __init bytes_str_to_int(const

char
*str)
  * This function returns zero in case of success and a negative error
code in
  * case of error.
  */
-static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
+static int ubi_mtd_param_parse(const char *val, struct kernel_param
*kp)
 {
  int i, len;
  struct mtd_dev_param *p;