From 876df2eeea8d0b50d2e2e1ede1f0c3a6dfdc1a53 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Sat, 19 Feb 2011 17:03:25 +0100
Subject: [PATCH] unictype/scripts: Reduce the size of the 'data' segment.

* lib/gen-uni-tables.c (output_scripts_byname): Emit gperf option
'%pic'.
* lib/unictype/scripts_byname.gperf: Regenerated.
---
 ChangeLog                         | 7 +++++++
 lib/gen-uni-tables.c              | 4 +++-
 lib/unictype/scripts_byname.gperf | 4 +++-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e3804dc8da..ba8c88a192 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-02-19  Bruno Haible  <bruno@clisp.org>
+
+	unictype/scripts: Reduce the size of the 'data' segment.
+	* lib/gen-uni-tables.c (output_scripts_byname): Emit gperf option
+	'%pic'.
+	* lib/unictype/scripts_byname.gperf: Regenerated.
+
 2011-02-19  Bruno Haible  <bruno@clisp.org>
 
 	stdint: Update documentation.
diff --git a/lib/gen-uni-tables.c b/lib/gen-uni-tables.c
index 762d995228..6d06ab71ec 100644
--- a/lib/gen-uni-tables.c
+++ b/lib/gen-uni-tables.c
@@ -3943,7 +3943,7 @@ output_scripts_byname (const char *version)
   fprintf (stream, "/* Unicode scripts.  */\n");
   fprintf (stream, "/* Generated automatically by gen-uni-tables.c for Unicode %s.  */\n",
            version);
-  fprintf (stream, "struct named_script { const char *name; unsigned int index; };\n");
+  fprintf (stream, "struct named_script { int name; unsigned int index; };\n");
   fprintf (stream, "%%struct-type\n");
   fprintf (stream, "%%language=ANSI-C\n");
   fprintf (stream, "%%define hash-function-name scripts_hash\n");
@@ -3951,6 +3951,8 @@ output_scripts_byname (const char *version)
   fprintf (stream, "%%readonly-tables\n");
   fprintf (stream, "%%global-table\n");
   fprintf (stream, "%%define word-array-name script_names\n");
+  fprintf (stream, "%%pic\n");
+  fprintf (stream, "%%define string-pool-name script_stringpool\n");
   fprintf (stream, "%%%%\n");
   for (s = 0; s < numscripts; s++)
     fprintf (stream, "%s, %u\n", scripts[s], s);
diff --git a/lib/unictype/scripts_byname.gperf b/lib/unictype/scripts_byname.gperf
index c0c3002997..6352fdf6e7 100644
--- a/lib/unictype/scripts_byname.gperf
+++ b/lib/unictype/scripts_byname.gperf
@@ -1,7 +1,7 @@
 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 /* Unicode scripts.  */
 /* Generated automatically by gen-uni-tables.c for Unicode 6.0.0.  */
-struct named_script { const char *name; unsigned int index; };
+struct named_script { int name; unsigned int index; };
 %struct-type
 %language=ANSI-C
 %define hash-function-name scripts_hash
@@ -9,6 +9,8 @@ struct named_script { const char *name; unsigned int index; };
 %readonly-tables
 %global-table
 %define word-array-name script_names
+%pic
+%define string-pool-name script_stringpool
 %%
 Common, 0
 Latin, 1
-- 
2.39.5