[PATCH 15/15] modpost: convert modpost to use HEAD_TEXT_SECTION macro.

From: Tim Abbott
Date: Sat Apr 25 2009 - 22:12:47 EST


Using the HEAD_TEXT_SECTION macro in modpost requires including a few
more files from the linux headers.

The entry in head_sections[] ".head.text*" should be ".head.text",
since only that section name is actually used by any architectures. I
corrected this since preserving this over-broad pattern would have
involved some string concatination nastiness.

Signed-off-by: Tim Abbott <tabbott@xxxxxxx>
Cc: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
---
scripts/mod/modpost.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index df6e628..f93645f 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -16,6 +16,8 @@
#include <ctype.h>
#include "modpost.h"
#include "../../include/linux/license.h"
+#include "../../include/linux/section-names.h"
+#include "../../include/linux/stringify.h"

/* Are we using CONFIG_MODVERSIONS? */
int modversions = 0;
@@ -818,7 +820,7 @@ static const char *symbol_white_list[] =
NULL
};

-static const char *head_sections[] = { ".head.text*", NULL };
+static const char *head_sections[] = { __stringify(HEAD_TEXT_SECTION), NULL };
static const char *linker_symbols[] =
{ "__init_begin", "_sinittext", "_einittext", NULL };

@@ -942,8 +944,8 @@ static int section_mismatch(const char *fromsec, const char *tosec)
* *probe_one, *_console, *_timer
*
* Pattern 3:
- * Whitelist all refereces from .text.head to .init.data
- * Whitelist all refereces from .text.head to .init.text
+ * Whitelist all refereces from HEAD_TEXT_SECTION to .init.data
+ * Whitelist all refereces from HEAD_TEXT_SECTION to .init.text
*
* Pattern 4:
* Some symbols belong to init section but still it is ok to reference
--
1.6.2.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/