diff options
author | Iain Sandoe <iains@gcc.gnu.org> | 2011-06-26 16:25:29 +0000 |
---|---|---|
committer | Iain Sandoe <iains@gcc.gnu.org> | 2011-06-26 16:25:29 +0000 |
commit | a45a766bf3af5eb9f7ebf3ab62d03ab727ff3bcd (patch) | |
tree | d376fcf4439c0de9d23ae631e018610d6a137da7 | |
parent | 07a9e891c9cbb1df6aa33edbe39c21d948da2301 (diff) | |
download | gcc-a45a766bf3af5eb9f7ebf3ab62d03ab727ff3bcd.zip gcc-a45a766bf3af5eb9f7ebf3ab62d03ab727ff3bcd.tar.gz gcc-a45a766bf3af5eb9f7ebf3ab62d03ab727ff3bcd.tar.bz2 |
re PR target/47997 (gcc on macosx: "ld: warning: -fwritable-strings not compatible with literal CF/NSString")
PR target/47997
* config/darwin.c (darwin_mergeable_string_section): Place string
constants in '.cstring' rather than '.const' when CF/NSStrings are
active.
From-SVN: r175410
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/darwin.c | 6 |
2 files changed, 12 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2737249..12a90b7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2011-06-25 Iain Sandoe <iains@gcc.gnu.org> + + PR target/47997 + * config/darwin.c (darwin_mergeable_string_section): Place string + constants in '.cstring' rather than '.const' when CF/NSStrings are + active. + 2011-06-26 Eric Botcazou <ebotcazou@adacore.com> * config/sparc/sparc.c (save_local_or_in_reg_p): Adjust comment. diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index b47e806..bedda1e 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -1195,7 +1195,11 @@ static section * darwin_mergeable_string_section (tree exp, unsigned HOST_WIDE_INT align) { - if (flag_merge_constants + /* Darwin's ld expects to see non-writable string literals in the .cstring + section. Later versions of ld check and complain when CFStrings are + enabled. Therefore we shall force the strings into .cstring since we + don't support writable ones anyway. */ + if ((darwin_constant_cfstrings || flag_merge_constants) && TREE_CODE (exp) == STRING_CST && TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE && align <= 256 |