From: H.J. Lu Date: Wed, 18 Feb 2015 17:24:20 +0000 (+0000) Subject: Return false for common symbols in sdata_symbolic_operand X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b0ddb385f0fa0ae6b4b9a360d3dd42060e6b0e63;p=gcc.git Return false for common symbols in sdata_symbolic_operand Although common symbols are defined in executables, they aren't in small data section. But a definition in small data section overrides a common symbol, which still binds lcoally, and turns a reference to common symbol to reference to small data section. Even if ia64_in_small_data_p returns true on common symbols, sdata_symbolic_operand must return false on common symbols. Common symbols are assumed to be placed in small data section, but are accessed as if they are in normal data section so that they won't cause any relocation overflow. PR target/65064 * config/ia64/predicates.md (sdata_symbolic_operand): Return false for common symbols. From-SVN: r220792 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 86831bf7b59..35bcf40f566 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-02-18 H.J. Lu + + PR target/65064 + * config/ia64/predicates.md (sdata_symbolic_operand): Return false + for common symbols. + 2015-02-18 Jakub Jelinek * config/i386/t-intelmic (mkoffload.o): Remove dependency on diff --git a/gcc/config/ia64/predicates.md b/gcc/config/ia64/predicates.md index cba0efe7a6e..2aa7a780e02 100644 --- a/gcc/config/ia64/predicates.md +++ b/gcc/config/ia64/predicates.md @@ -69,7 +69,12 @@ of constants here. */ t = SYMBOL_REF_DECL (op); if (DECL_P (t)) - t = DECL_SIZE_UNIT (t); + { + /* Common symbol isn't placed in small data section. */ + if (DECL_COMMON (t)) + return false; + t = DECL_SIZE_UNIT (t); + } else t = TYPE_SIZE_UNIT (TREE_TYPE (t)); if (t && tree_fits_shwi_p (t))