All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libfcoe: fix section mismatches
@ 2012-07-11 11:02 Heiko Carstens
  2012-07-12 19:59 ` Rustad, Mark D
  0 siblings, 1 reply; 3+ messages in thread
From: Heiko Carstens @ 2012-07-11 11:02 UTC (permalink / raw)
  To: James Bottomley; +Cc: Robert Love, linux-scsi

Fix this warning:

WARNING: drivers/scsi/fcoe/libfcoe.o(.init.text+0x7c):
 Section mismatch in reference from the function init_module()
 to the function .exit.text:fcoe_transport_exit()

libfcoe_init() calls fcoe_transport_exit() which is annotated with
__exit which puts it into the exit section.
If the driver would be compiled into the kernel the exit section
could be discarded at compile time, so all calls to functions which
reside in the exit section would be jumps to random data.

Not really an issue currently since the exit section is currently
only discarded at runtime together with the init section. So this
patch only removes the compile time warning.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
 drivers/scsi/fcoe/fcoe_sysfs.c     |    2 +-
 drivers/scsi/fcoe/fcoe_transport.c |    4 ++--
 include/scsi/fcoe_sysfs.h          |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c
index 2bc1631..7d6c119 100644
--- a/drivers/scsi/fcoe/fcoe_sysfs.c
+++ b/drivers/scsi/fcoe/fcoe_sysfs.c
@@ -826,7 +826,7 @@ int __init fcoe_sysfs_setup(void)
 	return 0;
 }
 
-void __exit fcoe_sysfs_teardown(void)
+void fcoe_sysfs_teardown(void)
 {
 	bus_unregister(&fcoe_bus_type);
 }
diff --git a/drivers/scsi/fcoe/fcoe_transport.c b/drivers/scsi/fcoe/fcoe_transport.c
index b46f43d..ea87f6b 100644
--- a/drivers/scsi/fcoe/fcoe_transport.c
+++ b/drivers/scsi/fcoe/fcoe_transport.c
@@ -502,7 +502,7 @@ static int __init fcoe_transport_init(void)
 	return 0;
 }
 
-static int __exit fcoe_transport_exit(void)
+static int fcoe_transport_exit(void)
 {
 	struct fcoe_transport *ft;
 
@@ -832,7 +832,7 @@ module_init(libfcoe_init);
 /**
  * libfcoe_exit() - Tear down libfcoe.ko
  */
-static void __exit libfcoe_exit(void)
+static void libfcoe_exit(void)
 {
 	fcoe_sysfs_teardown();
 	fcoe_transport_exit();
diff --git a/include/scsi/fcoe_sysfs.h b/include/scsi/fcoe_sysfs.h
index 604cb9b..8e7a41a 100644
--- a/include/scsi/fcoe_sysfs.h
+++ b/include/scsi/fcoe_sysfs.h
@@ -119,6 +119,6 @@ struct fcoe_fcf_device *fcoe_fcf_device_add(struct fcoe_ctlr_device *,
 void fcoe_fcf_device_delete(struct fcoe_fcf_device *);
 
 int __init fcoe_sysfs_setup(void);
-void __exit fcoe_sysfs_teardown(void);
+void fcoe_sysfs_teardown(void);
 
 #endif /* FCOE_SYSFS */
-- 
1.7.10.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] libfcoe: fix section mismatches
  2012-07-11 11:02 [PATCH] libfcoe: fix section mismatches Heiko Carstens
@ 2012-07-12 19:59 ` Rustad, Mark D
  2012-07-13  5:49   ` Heiko Carstens
  0 siblings, 1 reply; 3+ messages in thread
From: Rustad, Mark D @ 2012-07-12 19:59 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: James Bottomley, Love, Robert W, <linux-scsi@vger.kernel.org>

On Jul 11, 2012, at 4:02 AM, Heiko Carstens wrote:

> Fix this warning:
> 
> WARNING: drivers/scsi/fcoe/libfcoe.o(.init.text+0x7c):
> Section mismatch in reference from the function init_module()
> to the function .exit.text:fcoe_transport_exit()

As far as I can see, resolving this issue only requires removing the __exit annotation from the fcoe_transport_exit function, as three previous patches have done. I believe that is the correct fix and I have verified that by building with full section analysis turned on.

> libfcoe_init() calls fcoe_transport_exit() which is annotated with
> __exit which puts it into the exit section.
> If the driver would be compiled into the kernel the exit section
> could be discarded at compile time, so all calls to functions which
> reside in the exit section would be jumps to random data.
> 
> Not really an issue currently since the exit section is currently
> only discarded at runtime together with the init section. So this
> patch only removes the compile time warning.
> 
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
> ---
> drivers/scsi/fcoe/fcoe_sysfs.c     |    2 +-
> drivers/scsi/fcoe/fcoe_transport.c |    4 ++--
> include/scsi/fcoe_sysfs.h          |    2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/fcoe/fcoe_sysfs.c b/drivers/scsi/fcoe/fcoe_sysfs.c
> index 2bc1631..7d6c119 100644
> --- a/drivers/scsi/fcoe/fcoe_sysfs.c
> +++ b/drivers/scsi/fcoe/fcoe_sysfs.c
> @@ -826,7 +826,7 @@ int __init fcoe_sysfs_setup(void)
> 	return 0;
> }
> 
> -void __exit fcoe_sysfs_teardown(void)
> +void fcoe_sysfs_teardown(void)
> {
> 	bus_unregister(&fcoe_bus_type);
> }
> diff --git a/drivers/scsi/fcoe/fcoe_transport.c b/drivers/scsi/fcoe/fcoe_transport.c
> index b46f43d..ea87f6b 100644
> --- a/drivers/scsi/fcoe/fcoe_transport.c
> +++ b/drivers/scsi/fcoe/fcoe_transport.c
> @@ -502,7 +502,7 @@ static int __init fcoe_transport_init(void)
> 	return 0;
> }
> 
> -static int __exit fcoe_transport_exit(void)
> +static int fcoe_transport_exit(void)
> {
> 	struct fcoe_transport *ft;
> 
> @@ -832,7 +832,7 @@ module_init(libfcoe_init);
> /**
>  * libfcoe_exit() - Tear down libfcoe.ko
>  */
> -static void __exit libfcoe_exit(void)
> +static void libfcoe_exit(void)
> {
> 	fcoe_sysfs_teardown();
> 	fcoe_transport_exit();
> diff --git a/include/scsi/fcoe_sysfs.h b/include/scsi/fcoe_sysfs.h
> index 604cb9b..8e7a41a 100644
> --- a/include/scsi/fcoe_sysfs.h
> +++ b/include/scsi/fcoe_sysfs.h
> @@ -119,6 +119,6 @@ struct fcoe_fcf_device *fcoe_fcf_device_add(struct fcoe_ctlr_device *,
> void fcoe_fcf_device_delete(struct fcoe_fcf_device *);
> 
> int __init fcoe_sysfs_setup(void);
> -void __exit fcoe_sysfs_teardown(void);
> +void fcoe_sysfs_teardown(void);
> 
> #endif /* FCOE_SYSFS */

So, please use the earlier patch and not this one.

-- 
Mark Rustad, LAN Access Division, Intel Corporation


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] libfcoe: fix section mismatches
  2012-07-12 19:59 ` Rustad, Mark D
@ 2012-07-13  5:49   ` Heiko Carstens
  0 siblings, 0 replies; 3+ messages in thread
From: Heiko Carstens @ 2012-07-13  5:49 UTC (permalink / raw)
  To: Rustad, Mark D
  Cc: James Bottomley, Love, Robert W, <linux-scsi@vger.kernel.org>

On Thu, Jul 12, 2012 at 07:59:12PM +0000, Rustad, Mark D wrote:
> On Jul 11, 2012, at 4:02 AM, Heiko Carstens wrote:
> 
> > Fix this warning:
> > 
> > WARNING: drivers/scsi/fcoe/libfcoe.o(.init.text+0x7c):
> > Section mismatch in reference from the function init_module()
> > to the function .exit.text:fcoe_transport_exit()
> 
> As far as I can see, resolving this issue only requires removing the
>__exit annotation from the fcoe_transport_exit function, as three
> previous patches have done. I believe that is the correct fix and I
> have verified that by building with full section analysis turned on.

Yes, you're right. Just ignore my patch and use one of the others.
Ah, I see, James did that already ;)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-13  5:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-11 11:02 [PATCH] libfcoe: fix section mismatches Heiko Carstens
2012-07-12 19:59 ` Rustad, Mark D
2012-07-13  5:49   ` Heiko Carstens

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.