[glib/resources] Put resources into named sections on ELF based gcc arches
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/resources] Put resources into named sections on ELF based gcc arches
- Date: Thu, 22 Dec 2011 10:55:58 +0000 (UTC)
commit d12272d1564b883a3be67f0ae71580802aeb7647
Author: Alexander Larsson <alexl redhat com>
Date: Thu Dec 22 11:48:14 2011 +0100
Put resources into named sections on ELF based gcc arches
This means you can extract the resources from the generated file.
gio/glib-compile-resources.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/gio/glib-compile-resources.c b/gio/glib-compile-resources.c
index 4c56de6..a463dc0 100644
--- a/gio/glib-compile-resources.c
+++ b/gio/glib-compile-resources.c
@@ -569,9 +569,17 @@ main (int argc, char **argv)
return 1;
}
- fprintf (file, "#include <gio/gio.h>\n");
- fprintf (file, "\n");
- fprintf (file, "static const guint8 %s_resource_data[] = {\n", c_name);
+ fprintf (file,
+ "#include <gio/gio.h>\n"
+ "\n"
+ "#if defined (__ELF__) && ( __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6))\n"
+ "# define SECTION __attribute__ ((section (\".gresource.%s\"), aligned (8)))\n"
+ "#else\n"
+ "# define SECTION\n"
+ "#endif\n"
+ "\n"
+ "static const guint8 SECTION %s_resource_data[] = {\n",
+ c_name, c_name);
for (i = 0; i < data_size; i++) {
if (i % 8 == 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]