public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@linux.intel.com>
To: mmarek@suse.cz
Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
	Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 3/6] kbuild: Don't include const variable in kallsyms with !KALLSYMS_ALL
Date: Sat,  8 Feb 2014 08:50:37 +0100	[thread overview]
Message-ID: <1391845840-28514-3-git-send-email-ak@linux.intel.com> (raw)
In-Reply-To: <1391845840-28514-1-git-send-email-ak@linux.intel.com>

const variables are put into the text segment, so !KALLSYMS_ALL
includes them into the kallsyms section. Remove them to make
the kallsyms smaller. This also avoids some problems with LTO.
The way LTO generates the first pass kallsyms cannot handle
variables currently, so if we don't filter them out the
first and second level pass differ too much.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 scripts/kallsyms.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index ceef756..d79027e 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -151,6 +151,11 @@ static int read_symbol(FILE *in, struct sym_entry *s)
 	/* exclude debugging symbols */
 	else if (stype == 'N')
 		return -1;
+	/* Don't include const symbols in the text section
+	 * unless --all-symbols is specified.
+	 */
+	else if (toupper(stype) != 'T' && !all_symbols)
+		return -1;
 
 	/* include the type field in the symbol name, so that it gets
 	 * compressed together */
-- 
1.8.5.2


  parent reply	other threads:[~2014-02-08  7:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-08  7:50 [PATCH 1/6] kbuild: Remove relocations from kallsyms table Andi Kleen
2014-02-08  7:50 ` [PATCH 2/6] kbuild: Put kallsyms into own section Andi Kleen
2014-02-08  7:50 ` Andi Kleen [this message]
2014-02-08  7:50 ` [PATCH 4/6] kbuild: Support padding in kallsyms tables Andi Kleen
2014-02-08 12:12   ` Markus Trippelsdorf
2014-02-08 17:46     ` Andi Kleen
2014-02-08 18:01       ` Markus Trippelsdorf
2014-02-08  7:50 ` [PATCH 5/6] kbuild: Use single pass kallsyms Andi Kleen
2014-02-08  9:19   ` Markus Trippelsdorf
2014-02-08 16:01     ` Andi Kleen
2014-02-08 18:00       ` Markus Trippelsdorf
2014-02-08  7:50 ` [PATCH 6/6] kbuild: Remove .dot postfixes in kallsyms Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2014-02-14 21:17 Updated single-pass kallsyms patchkit for LTO Andi Kleen
2014-02-14 21:17 ` [PATCH 3/6] kbuild: Don't include const variable in kallsyms with !KALLSYMS_ALL Andi Kleen
2014-02-18 14:24 Single pass kallsyms v3 Andi Kleen
2014-02-18 14:24 ` [PATCH 3/6] kbuild: Don't include const variable in kallsyms with !KALLSYMS_ALL Andi Kleen

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=1391845840-28514-3-git-send-email-ak@linux.intel.com \
    --to=ak@linux.intel.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    /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