diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2017-04-24 09:41:35 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-04-24 12:53:43 -0400 |
commit | b68697e579d38ca29c2b84377dc2affa04659a28 (patch) | |
tree | 3d7a9f8c888baad175c81863d5519fb42e817770 /includes/rts | |
parent | d5cb4d2b7fab89ea1c3fc74da2317f86e75816ea (diff) | |
download | haskell-b68697e579d38ca29c2b84377dc2affa04659a28.tar.gz |
compiler/cmm/PprC.hs: constify labels in .rodata
Consider one-line module
module B (v) where v = "hello"
in -fvia-C mode it generates code like
static char gibberish_str[] = "hello";
It resides in data section (precious resource on ia64!).
The patch switches genrator to emit:
static const char gibberish_str[] = "hello";
Other types if symbols that gained 'const' qualifier are:
- info tables (from haskell and CMM)
- static reference tables (from haskell and CMM)
Cleanups along the way:
- fixed info tables defined in .cmm to reside in .rodata
- split out closure declaration into 'IC_' / 'EC_'
- added label declaration (based on label type) right before
each label definition (based on section type) so that C
compiler could check if declaration and definition matches
at definition site.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Test Plan: ran testsuite on unregisterised x86_64 compiler
Reviewers: simonmar, ezyang, austin, bgamari, erikd
Reviewed By: bgamari, erikd
Subscribers: rwbarton, thomie
GHC Trac Issues: #8996
Differential Revision: https://phabricator.haskell.org/D3481
Diffstat (limited to 'includes/rts')
-rw-r--r-- | includes/rts/storage/InfoTables.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/includes/rts/storage/InfoTables.h b/includes/rts/storage/InfoTables.h index e732a30daf..3201c105e1 100644 --- a/includes/rts/storage/InfoTables.h +++ b/includes/rts/storage/InfoTables.h @@ -265,7 +265,7 @@ typedef struct { } StgFunInfoTable; // canned bitmap for each arg type, indexed by constants in FunTypes.h -extern StgWord stg_arg_bitmaps[]; +extern const StgWord stg_arg_bitmaps[]; /* ----------------------------------------------------------------------------- Return info tables |