From: Ralf Baechle <ralf@linux-mips.org>
To: linux-scsi@vger.kernel.org
Subject: [SCSI] Avoid ld errors messages by marking sd_major noinline.
Date: Sat, 4 Mar 2006 17:12:27 +0000 [thread overview]
Message-ID: <20060304171227.GA16799@linux-mips.org> (raw)
Gcc may compile sd_major() using a jump table which it will put into
.rodata. If also inline sd_major's function body into exit_sd() and
CONFIG_BLK_DEV_SD has been set to y ld is going to discard exit_sd's
code later at link time. It won't discard the jump table if was put
into another section than .exit.data and so the remaining refernces
to sd_major's function body will result in about 100 lines of non-fatal
linker error messages. This is avoided by marking sd_major noinline.
Observed on MIPS with GCC 4.0.2 and 4.1.0 but not 3.4.5 and seems
possible on other architectures such as i386.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 9d98723..bee2d0d 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -158,6 +158,14 @@ static struct scsi_driver sd_template =
* for major1, ...
* As we stay compatible with our numbering scheme, we can reuse
* the well-know SCSI majors 8, 65--71, 136--143.
+ *
+ * Gcc may compile sd_major() using a jump table which it will put into
+ * .rodata. If also inline sd_major's function body into exit_sd() and
+ * CONFIG_BLK_DEV_SD has been set to y ld is going to discard exit_sd's
+ * code later at link time. It won't discard the jump table if was put
+ * into another section than .exit.data and so the remaining refernces to
+ * sd_major's function body will result in about 100 lines of non-fatal
+ * linker error messages. This is avoided by marking sd_major noinline.
*/
static int sd_major(int major_idx)
{
next reply other threads:[~2006-03-04 17:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-04 17:12 Ralf Baechle [this message]
2006-03-04 17:15 ` [SCSI] Avoid ld errors messages by marking sd_major noinline Ralf Baechle
-- strict thread matches above, loose matches on Subject: below --
2006-03-04 17:16 Ralf Baechle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060304171227.GA16799@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).